diff --git a/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_content_list.json b/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3caaa930d39eaaa7d37733feaf01be02abd6832e --- /dev/null +++ b/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb3ef88a7c16e10f5e56d2466608c33cf6faeb18f4bdfab1bafc2b0f563b1303 +size 79038 diff --git a/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_model.json b/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2005fe860e466b3ae85051f7b77c13071ec95c19 --- /dev/null +++ b/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8af5c94b20f4e5b7474ed75aebe48705a0088f107b59c94568aa1e88703a4dd +size 96638 diff --git a/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_origin.pdf b/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e9c424bf756e057318f60adfbd12f1709ec2ff2c --- /dev/null +++ b/generalizedfewshotobjectdetectionwithoutforgetting/f7ebbc94-1ed4-4a35-8686-9919e1b21777_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a863a5e328bd2e5c835d5f0ac23aeadac4be0405e2e4bcb737aa64f74786e0e1 +size 2484649 diff --git a/generalizedfewshotobjectdetectionwithoutforgetting/full.md b/generalizedfewshotobjectdetectionwithoutforgetting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c34f5939e718c224b617b87e63f5fd715b2e2d84 --- /dev/null +++ b/generalizedfewshotobjectdetectionwithoutforgetting/full.md @@ -0,0 +1,279 @@ +# Generalized Few-Shot Object Detection without Forgetting + +Zhibo Fan, Yuchen Ma, Zeming Li, Jian Sun Megvii Technology + +{fanzhibo, mayuchen, lizeming, sunjian} @ megvii.com + +# Abstract + +Recently few-shot object detection is widely adopted to deal with data-limited situations. While most previous works merely focus on the performance on few-shot categories, we claim that detecting all classes is crucial as test samples may contain any instances in realistic applications, which requires the few-shot detector to learn new concepts without forgetting. Through analysis on transfer learning based methods, some neglected but beneficial properties are utilized to design a simple yet effective few-shot detector, Retentive R-CNN. It consists of Bias-Balanced RPN to debias the pretrained RPN and Re-detector to find few-shot class objects without forgetting previous knowledge. Extensive experiments on few-shot detection benchmarks show that Retentive R-CNN significantly outperforms state-of-the-art methods on overall performance among all settings as it can achieve competitive results on few-shot classes and does not degrade the base class performance at all. Our approach has demonstrated that the long desired never-forgetting learner is available in object detection. + +# 1. Introduction + +Computer vision community has seen significant progress by applying deep convolutional neural networks trained from a massive amount of data. However, sufficient training data is sometimes unavailable due to extensive human labor for annotation, especially for object detection, and the source data distribution may be long-tailed by nature such that certain object categories only contain limited examples. These circumstances raise the need to learn under a low-data regime effectively. Inspired by human's ability to learn new concepts rapidly from a handful of examples, few-shot learning[22, 19, 40, 37, 38, 30, 9, 8, 35, 3, 2, 42] is then proposed to mimic such generalization capability, with extensive research on image classification. + +Several recent works[1, 17, 46, 18, 41, 44, 45, 14, 7, 6, 16, 43, 29] have attempted to apply few-shot learning techniques on instance-level tasks, such as object detection, where an extra localization task is included and more com + +![](images/321ad7a9c1d0ff7c2b0ecfc11985b08144ece45b0e636458232d37ad659a791f.jpg) +Figure 1. Performance of previous methods and ours on generalized few-shot objection on MS-COCO[25] under 10-shot settings, where base class AP and novel class AP are represented by x- and y-axis respectively. The red dashed line represents the base class AP of a base class detector. Our method does not degrade the base class AP while reaching state-of-the-art performance on novel categories. + +plicated visual contexts and features encountered, making few-shot object detection way more challenging. However, the majority focus merely on the performance of few-shot categories and ignore the catastrophic forgetting of base classes, which is not realistic. Unlike image classification, the capability to detect the joint domain of both classes at once is even crucial for object detection since samples at test time may contain instances of both classes, which requires the detector to be computationally efficient and learn new concepts without catastrophic forgetting. The problem of detecting objects of both classes is called Generalized Few-Shot Detection (G-FSD). + +A popular stream of few-shot object detection[17, 46, 45, 14, 6] falls under the umbrella of meta-learning by leveraging external exemplars to do a visual search within the image. As their computational complexity is proportional to the number of categories, these methods become rather slow or even unavailable when tackling both sets of classes of a dataset. A promising alternative is transfer learning based + +approaches[1, 47, 41, 44], which can be trained incrementally to detect all classes in a single run. Wang et al.[41] share a similar interest in maintaining the overall performance on both classes and achieve competitive results by their two-stage finetuning approach (TFA), in which only the last layer of classification and box regression branch of RCNN[11, 10, 34] is finetuned while freezing backbone and RPN[34]. Nevertheless, there still exists a non-negligible base class performance gap with the pretrained model. + +To diminish the gap, we first analyze the pretrained RCNN of TFA[41] and find advantageous but neglected properties: 1) pretrained base class detector does not predict many false positives on novel class instances despite their saliency 2) RPN is biased on its seen classes instead of being ideally class-agnostic, thus freezing it without exposure to new classes can be suboptimal. By utilizing these properties, we propose a simple yet effective transfer learning based method, Retentive R-CNN, to meet the demands of G-FSD to learn without forgetting and detect all categories efficiently. The name of Retentive R-CNN comes from its surprising ability to fully reserve the performance on base classes. Retentive R-CNN combines base and novel class detectors by Bias-Balanced RPN and Re-detector, introducing little extra cost. Bias-Balanced RPN can better adapt to novel class objects and remain powerful on the base class, thus provides better proposals for both training and inference. Re-detector utilizes a consistency loss to regularize the adaptation during finetuning and takes advantage of the base class detector's property to incrementally detect without forgetting. It is worth mentioning that our method does not degrade the base class performance at all while achieving competitive performance on novel classes as well, as shown in Figure1. Our contributions can be concluded as follows: + +- We find properties of base class detectors neglected in few-shot detection literature, which can be utilized to improve both base and novel class performance for transfer learning based methods with little overhead. +- We propose a few-shot detector without forgetting, Retentive R-CNN, with Bias-Balanced RPN and Redetector to assist novel class adaptation with base class knowledge and ensemble base and novel class detectors. +- Our method achieves state-of-the-art overall performance on the few-shot detection benchmark[41, 17] across all settings, with leading base class metrics and competitive novel class metrics. + +# 2. Related Work + +Few-Shot Learning. Previous few-shot learning literature mainly focuses on the task of image classification. Two + +popular approaches, metric learning[40, 37, 19, 38] and meta-learning[8, 35], have been widely adapted to avoid overfitting on the small data. Recent works[2, 42, 3] also demonstrate the effectiveness of a pretrained backbone as a strong feature extractor and outperform many previous methods. However, catastrophic forgetting[28, 27] on base classes may happen during finetuning. Gidaris et al.[9] stress that a good few-shot learning system should adapt to new tasks rapidly while maintaining the performance on previous knowledge without forgetting[28, 27], namely generalized few-shot learning, which is also the research interest of several other works[30, 31, 36, 21]. It is worth mentioning that such an ability is more critical for object detection since images may have instances of both sets of categories. + +Object Detection. Modern object detection has seen tremendous progress by utilizing deep convolutional networks. One of the representative architectures is R-CNN[11, 10, 34, 12, 23], which generates object proposals upon the holistic image features, then classify and refine the proposals given the features within it. R-CNN is also the architecture mostly explored in the context of few-shot object detection and the one we extend for G-FSD in this paper. Impressive progress has also been made by single-stage methods[33, 26, 24] and recent anchor-free methods[20, 4, 39, 49, 32]. + +Few-Shot Object Detection. Exploration of few-shot object detection so far can be categorized into two streams: meta-learning[17, 46, 14, 29, 7, 6, 18, 45, 43, 16] based and transfer learning based[1, 41, 44, 47]. The majority of meta-learning stream predict detections conditioned on a set of support examples, which can be viewed as an exemplar-based visual search. For instance, Meta R-CNN[46] predicts upon ROI features reweighted by attentive vectors of each class, whose computational complexity grows linearly as the number of categories increases, making it hard to apply on large-scale datasets. On the contrary, transfer learning based methods can easily employ full class detection. Transfer learning methods thus far have explored various aspects: Chen et al.[1] apply regularizations during finetuning, Yang et al.[47] utilize a non-local structure to model global context, Wu et al.[44] augment training samples to mitigate scale bias due to limited data. + +A handful of works share a similar focus on well detecting both classes: Juan-Manuel et al.[16] try to tackle it with a meta-learned CenterNet[4], though the performance is still limited with the linearly growing complexity issue; Wang et al.[41] propose TFA with a simple pretrainfinetune scheme for G-FSD. In TFA, adapting to novel classes with less degradation on base classes is achieved by two-stage finetuning: first finetune on novel classes, then use the weights of novel classes as initialization to finetune on both classes. The metrics on base classes are somewhat + +reserved by this procedure and a slow learning schedule. Nevertheless, the performance drop in base classes still exists. + +# 3. Approach + +In this section, we start with the problem formulation of few-shot object detection. Next, we investigate the representative transfer learning based TFA[41] to reveal some neglected properties of the pretrained base detector. Then we describe our proposed model, which utilizes these properties, followed by training and inference details. + +# 3.1. Problem Statement + +Following previous literature[17, 41], we split the categories of a dataset into base classes $\mathcal{C}_b$ and novel classes $\mathcal{C}_n$ , with $\mathcal{D}_b$ and $\mathcal{D}_n$ denoting the corresponding sub-datasets, respectively. $\mathcal{D}_b$ contains abundant annotations for training, while only a few data in $\mathcal{D}_n$ is available. Our objective is to learn a detection model $f(\cdot)$ for both $\mathcal{C}_b$ and $\mathcal{C}_n$ from the few novel class samples without forgetting the learned capability from the abundant base class samples. + +Such an objective can be easily achieved by meta training a model to perform an exemplar-based visual search on $\mathcal{D}_b$ , then directly deploy it without finetuning, as in one-shot detection literature [14, 29]. However, these methods do not perform as good as ordinary detection methods on $\mathcal{D}_b$ and require high time and space complexity. On the contrary, transfer learning based methods can efficiently deal with full-way detection and achieve competitive results on $\mathcal{C}_n$ , as demonstrated in previous works[41, 44]. Thus we propose to tackle the problem of G-FSD in a transfer learning paradigm: first obtain a base model $f^b$ by training on $\mathcal{D}_b$ and then obtain a novel model $f^n$ via finetuning $f^b$ on $\mathcal{D}_n$ (or a combination of $\mathcal{D}_b$ 's subset and $\mathcal{D}_n$ ). However, the finetuning stage tends to degrade the base class performance due to the forgetting effect[28, 27] if it is finetuned on $\mathcal{D}_n$ , or due to the sample limitation on $\mathcal{D}_b$ to balance class frequency if finetuned on both classes. Regarding this problem, a question is probably raised: is the degradation unavoidable? + +
Metric / ComponentRPNRCNNdrop
uAR@100034.18.525.6
AR@100061.154.76.4
+ +Table 1. Recall between the output of RPN, the detector and the ground truths of unseen classes (uAR) and seen classes (AR). + +
Metric / RPNpretrainedfinetuned
AR@10031.334.2
AR@100045.848.0
+ +Table 2. Mean average recall between the output of RPN and ground truths of both base and novel classes. + +![](images/38492d340025676dbb6a17aa2c1046132003f050fcd9bd983915190f764a38e7.jpg) + +![](images/a12d01f8bcd012113fd47f625617b2709d4b368692769d021eb09be18ac5bd06.jpg) + +![](images/0045acad9e461a9c0c053f8ebb059e6183ef87b838fe079b3504d60a0eaea697.jpg) + +![](images/bde245b1346c59d96bc14f394051003a2ece364a769bb8ef81c3f86ba4cd290f.jpg) + +![](images/25b9b23e84ea857147ebdc49609adf940420d3b2f11768f76d7ca2c2a518c70f.jpg) +Figure 2. (a) L2-norms of ROI features extracted from a pretrained R-CNN on $\mathcal{D}^b$ , sorted by class index. Blue and red represent seen and unseen classes, respectively, and dashed lines denote their average. Unseen classes with norms significantly higher or lower than average are annotated with class names in blue or red, respectively. (b) Backbone features' (FPN-P3) L2-norm map and (c) the corresponding detections of the base detector (green boxes) and ground truths of unseen classes (black boxes). The base detector has a strong ability to reject unseen classes. + +![](images/d74aa419bd6ce4dd5c64cf6dcf483c45287cc92a369557c2c1d64299f2cde7da.jpg) +(c) + +![](images/bb1ede7cd451dc55c077bac5298d1fe6e6c851066309f87f350d9d1782d04d21.jpg) + +# 3.2. Analysis on Transfer Learning based Few-Shot Object Detection + +To answer this question without loss of generality, we analyze TFA[41]'s properties as a representative transfer learning model on few-shot detection tasks. TFA is first pretrained on $\mathcal{D}_b$ as ordinary R-CNN, then the last layers in classification and box regression heads are tuned on $\mathcal{D}_n$ . The finetuned novel class heads' weights are concatenated with base class weights as the initialization for the final finetuning on a combined dataset consists of $\mathcal{D}_n$ and $\mathcal{D}_b$ 's subset, where the number of samples per category is enforced to be identical. A slow and steady learning schedule is also applied during the final finetuning stage. Take 10-shot settings on MS-COCO for example, AP on $\mathcal{C}_b$ is better reserved than a pure finetuning baseline (31.8 to 35.0), though AP of the base class detector can achieve as high as 39.2. + +Why cosine classifier works? Cosine classifier is commonly adapted in few-shot classification[9, 30] as cosine similarity bridged transfer learning and metric learning approach and generally performs well on base and novel class trade-off. The conclusion remains valid for TFA[41] as the base class performance is generally higher with a cosine classifier. We collect the ROI features from an R-CNN pretrained on $\mathcal{D}_b$ of MS-COCO[25] and compute the average pixel-wise L2-norm of $C_b$ and $C_n$ . The results are shown in Figure2(a). A massive variation of norms between base classes and unseen novel classes can be easily observed. This may account for the effectiveness of cosine classifiers for being agnostic to feature norms. Also, the norms of unseen classes with closer relationship with seen classes are + +![](images/44c84e07be5782686dd69d75ed38549ad603307a7533b83c997255899f83d848.jpg) +Figure 3. An overview of the proposed Retentive R-CNN. We implement Bias-Balanced RPN to debias the pretrained RPN and Re-detector to detect objects of both classes without forgetting, where a consistency loss is utilized to regularize finetuning. $\otimes$ represents ensembling operation, which is max in our implementation. + +relatively higher (blue names annotated in Figure2(a)). + +Does base detector find novel class salient objects? To a large extent, no. We hypothesize it is due to the features deactivated during training on $\mathcal{C}_b$ as indicated by low L2-norm, which will not produce a high confidence score with a dot-product classifier. We visualize the detection results and its feature norms on FPN[23] P3 in Figure2. The local features around the people in the first two images are obviously deactivated, although the object is of great saliency to humans. Features of the bus are somewhat activated in the third image of Figure2(b) (probably due to close relationship with trucks of $\mathcal{C}_b$ ), yet the detector is still able to recognize it as background. More results indicating this property are provided in the supplementary materials without cherrypicking. To quantitatively answer this question, the average recall between $f^b$ 's RPN proposals, final outputs, and ground truths of unseen class $\mathcal{C}_n$ (uAR) and seen classes (AR), is calculated in Table1. The drastic drop of uAR well demonstrates the ability of $f^b$ to reject novel class objects. Thus we can utilize this property to reserve base class performance as $f^b$ does not introduce many false positives on $\mathcal{C}_b$ when encountering novel class instances. + +Is RPN class-agnostic? While most transfer learning[41, 44] and meta-learning[46, 45, 18] works treat RPN as class-agnostic and freeze it during finetuning, RPN is not ideally class-agnostic and biased on its seen categories. During training on $\mathcal{D}_b$ , anchors of novel class instances are categorized into non-object due to lack of annotations, making RPN bias on training samples. We compare AR of all classes of a finetuned RPN on $\mathcal{C}_b \cup \mathcal{C}_n$ under 10-shot setting with pretrained RPN in Table2, where the apparent improvement validates our answer. + +# 3.3. Retentive R-CNN + +Our proposed model for G-FSD, Retentive R-CNN, consists of Bias-Balanced RPN and Re-detector to utilize the aforementioned properties of the base class detector $f^b$ . The model architecture is illustrated in Figure3. + +Re-detector. Re-detector consists of two detector heads, + +predicting detections of $\mathcal{C}_b$ and $\mathcal{C}_b \cup \mathcal{C}_n$ from object proposals in parallel, where one stream remains the same weight as in $f^b$ to predict objects of $\mathcal{C}_b$ (denote as $det^b$ ) and the other holds the finetuned weights to detect objects of both $\mathcal{C}_n$ and $\mathcal{C}_b$ (denote as $det^n$ ). Detecting both classes can well alleviate the false positives due to inadequate data training, as shown in Section4.3. $det^b$ utilize a fully-connected layer for classification and $det^n$ use a cosine classifier to balance the variation of features in their norms. Similar to TFA, we finetune merely the last layers of classification and box regression head of $det^n$ , which is capable of producing competitive results. + +As $f^b$ is trained from abundant data, we hope that $det^n$ can inherit the reliable knowledge of $f^b$ . Towards this end, we propose an auxiliary consistency loss to regularize $det^n$ to score object proposals similar to $det^b$ on the base class entries, which takes the form of KL-Divergence as in previous knowledge distillation works[15, 48]. For proposals of $C_b$ , $det^n$ is enforced to predict high confidence, and for proposals not belonging to $C_b$ , $det^n$ mimics $det^b$ with similarly low probabilities. Given the final probabilities $p_c^b$ and $p_c^n$ of class $c$ predicted by $det^b$ and $det^n$ , the consistency loss is formalized as: + +$$ +\mathcal {L} _ {c o n} = \sum_ {c \in \mathcal {C} _ {b}} \tilde {p _ {c} ^ {n}} \log \left(\frac {\tilde {p _ {c} ^ {n}}}{\tilde {p _ {c} ^ {b}}}\right) \tag {1} +$$ + +where $\tilde{p_i^n} = \frac{p_i^n}{\sum_{c\in\mathcal{C}_b}p_c^n}$ and the same for $\tilde{p_i^b}$ . This is quite different from TK in LSTD[1] where the KL-Divergence is computed between the highest probabilities of $\mathcal{C}_b$ and $\mathcal{C}_n$ . Note that $p_i^n$ is the normalized marginal probability distribution over base classes after softmax over all class entries. The total loss of Re-detector during finetuning stage is + +$$ +\mathcal {L} _ {\text {d e t}} = \mathcal {L} _ {\text {c l s}} ^ {n} + \mathcal {L} _ {\text {b o x}} ^ {n} + \lambda \mathcal {L} _ {\text {c o n}} \tag {2} +$$ + +where $\mathcal{L}_{cls}$ and $\mathcal{L}_{box}$ takes the same form as Faster R-CNN[34] and is computed on $det^n$ only, and $\lambda$ denotes the coefficient for the consistency loss. + +Bias-Balanced RPN. R-CNN relies on RPN to generate object proposals as training samples for second stage classification and other subsequent processing. The quality of RPN proposals is especially crucial when the network is trained under low-data scenarios. As shown in Section3.2, a pretrained RPN may fail to catch novel class objects, further aggravating the scarcity of samples, while a finetuned RPN can alleviate this issue, thus providing better samples for second-stage modules to learn. We try to unfreeze different layers of RPN for finetuning and empirically, unfreeze the final layer that predicts objectness is sufficient to produce a noticeable improvement (results given in Setion4.3). + +To retain performance on base classes, we propose Bias-Balanced RPN to integrate both pretrained RPN and the finetuned one. It ensembles the objectness prediction heads to raise $\mathcal{C}_b$ and $\mathcal{C}_n$ proposals properly. Given a feature map of size $H \times W$ , base RPN predicts an objectness map $\mathcal{O}_b^{H \times W}$ and finetuned RPN predicts $\mathcal{O}_n^{H \times W}$ , the final output objectness of Bias-Balanced RPN is defined as $\mathcal{O}^{H \times W} = \max(\mathcal{O}_b^{H \times W}, \mathcal{O}_n^{H \times W})$ . Note that, during the finetuning stage, only the objectness of finetuned RPN is set unfrozen. Box regression and the convolution layer are shared across base RPN and finetuned RPN, as illustrated in Figure3. Theoretically, the max operation guarantees the RPN not to overlook proposals of previously learned classes catastrophically. With little computational overhead and extra weights, we believe Bias-Balanced RPN can serve as a general component for G-FSD. The full loss function of Retentive R-CNN during the finetuning stage is + +$$ +\mathcal {L} _ {f t} = \mathcal {L} _ {o b j} ^ {n} + \mathcal {L} _ {d e t} \tag {3} +$$ + +where $\mathcal{L}_{obj}^n$ is the binary cross-entropy loss on finetuned RPN's objectness layer. + +Training. As a transfer learning based method, Retentive R-CNN is trained in two stages: pretraining on $\mathcal{D}_b$ and then finetune on the combined dataset of $\mathcal{D}_n$ and $\mathcal{D}_b$ 's subset. As aforementioned, we only unfreeze three layers: objectness of the finetuned RPN, the last linear layers of classification and box regression of $det^n$ . Thanks to the capability of retaining base class performance, we can apply a swifter learning schedule for finetuning, e.g., 5000 iterations for 10-shot MS-COCO[25] compared to 160000 iterations of TFA[41]. + +Inference. Given the object proposals from Bias-Balanced RPN, the corresponding features are fed into the two heads of Re-detector in parallel. The set of predicted boxes of both heads are gathered into one for the final NMS procedure. As $det^b$ is somehow more reliable as it learns from abundant data, we add a little bonus (0.1 in our implementation) for the scores predicted from $det^b$ if they surpass the pre-NMS threshold, which could encourage the NMS procedure to take $det^b$ 's output when $det^b$ and $det^n$ find similar base class results. More details will be de + +scribed in the supplementary material. As the backbone and feature transformation layers in Bias-Balanced RPN and Re-detector are shared among both detector heads, we can maintain the base class performance with little overhead compared to an ordinary R-CNN. + +# 4. Experiments + +# 4.1. Experimental Settings + +We evaluate our method on the well-established few-shot detection benchmark[41, 17] based on MS-COCO[25] and Pascal VOC [5], following the same class splits and data splits in previous works[17, 41, 44] for a fair comparison. We report 5,10,30-shot results on MS-COCO and 1,2,3,5,10-shot results on 3 random splits of Pascal VOC. Towards the problem of G-FSD, the overall performance of both classes is our major concern. We reproduce Meta R-CNN[46] and FsDetView[45] using exactly the same samples for finetuning without hyperparameter changing (by running their official code) and denote the reproduced results with a * at the upper right corner. Results for ONCE[16], MetaDet[43] and FSRW[17] are reported from their original paper. + +We use an ImageNet pretrained ResNet-101[13] with FPN[23] as the backbone. Pretraining on $\mathcal{D}_b$ is the same as in [41], then the finetuning layers are initialized by random. For all experiments, we set learning rate to 0.05 and $\lambda$ to 0.1 to finetune until full convergence. + +# 4.2. Comparison Experiments + +We compared our results with both transfer learning[41, 44] and meta-learning based methods[16, 46, 17, 45]. Towards maintaining base class performance, one can quickly come up with an R-CNN model with N binary classifiers for detecting a dataset of N classes as binary classifiers are decoupled with each other. We also train such a model (denoted as FRCN-BCE) with binary cross-entropy loss for ROI classification as a strong baseline, using the same hyperparameters as Retentive R-CNN except for initializing the classifiers' bias as in RetinaNet[24]. + +Results on MS-COCO[25]. Table3 shows mean average precision over 0.5 to 0.95 IOU thresholds on all, base, and novel classes (AP, bAP, nAP) under different data settings. We outperform previous methods significantly on AP and bAP, as our method does not degrade on base classes at all. Meanwhile, we achieve competitive results on novel classes as well (state-of-the-art for 10-shot and on-par with state-of-the-art for 5- and 30-shot). + +Towards the same objective to incrementally detect rare objects, ONCE[16] does not degrade the base class performance as well, yet its performance on both classes is limited. The very competitive TFA[41] models can gradually recover base class performance with samples increas + +
Methods / Shots5 shot10 shot30 shot
APbAPnAPAPbAPnAPAPbAPnAP
OursRetentive R-CNN31.539.28.332.139.210.532.939.313.8
Transfer LearningFRCN-ft-full[41]18.022.06.018.121.09.218.620.612.5
FRCN-BCE29.136.86.029.236.86.430.236.810.3
TFA w/ fc[41]27.533.98.427.933.910.029.735.113.4
TFA w/ cos[41]28.134.78.328.735.010.030.335.813.7
MPSR[44]---15.317.19.717.118.114.1
Meta LearningONCE [16]13.717.91.013.717.91.2---
Meta R-CNN*[46]3.63.53.85.45.26.17.87.19.9
FSRW[17]-----5.6--9.1
FsDetView*[45]5.95.76.66.76.47.610.09.312.0
+ +Table 3. Few-shot object detection results on MS-COCO under 5,10,30-shot settings, best viewed in color. AP, bAP, nAP represents mAP of MS-COCO for all classes, base classes, and novel classes, respectively. Best results and second-best are colored in red and blue, respectively, ' -' means the result is not reported in the original paper. We outperform or on-par with all previous methods for each metric under these settings, with significant improvements on AP and bAP. + +
Methods / ShotsAll Set 1All Set 2All Set 3
123510123510123510
OursRetentive R-CNN71.372.372.174.074.666.868.470.270.771.569.070.972.373.974.1
Transfer LearningFRCN-ft-full[41]55.457.156.860.160.950.153.753.655.955.558.559.158.761.860.8
TFA w/ fc[41]69.366.970.373.473.264.766.367.768.368.767.868.970.872.372.2
TFA w/ cos[41]69.768.270.573.472.865.565.067.768.068.667.968.671.072.572.4
MPSR[44]56.860.462.866.169.053.157.662.864.266.355.259.862.766.967.7
Meta LearningMeta R-CNN*[46]17.530.536.249.355.619.433.234.844.453.920.331.041.248.055.1
FSRW[17]53.550.255.356.059.555.154.255.257.558.954.253.554.758.657.6
FsDetView*[45]36.440.340.150.055.336.343.741.645.854.137.039.540.750.754.8
+ +Table 4. Few-shot object detection results on Pascal VOC(07+12) all classes (AP50) under 1,2,3,5,10-shot settings, best viewed in color. Best results and second-best are colored in red and blue, respectively. Thanks to the non-forgetting ability, Retentive R-CNN consistently outperforms other methods w.r.t overall AP under all the data settings. + +ing; however, the gap is still indispensable, e.g., the bAP gap between 30-shot TFA w/cos[41] and the base model is as large as 3.4. As expected, FRCN-BCE can maintain base class performance from its pretrained model intrinsically, but the performance on both base and novel class is lower than an ordinary RCNN by a large margin. Given that Retentive R-CNN only adds little overhead with layers mostly shared, our method is a superior choice for G-FSD. Despite MPSR[44] slightly outperform our method with respect to nAP on 30-shot, the performance drop on base classes is significant, and thus it is not suitable for G-FSD. An even larger performance drop can be observed in Meta R-CNN[46] and FsDetView[45], probably because they predict the whole probability distribution of an ROI from features reweighted by a certain class-attentive vector. The vast performance drop is alleviated to some extent in FSRW[17] (see Table4), which only predicts the probability for the class of the reweighting vector. + +Results on Pascal-VOC[5]. Table4 and Table5 show overall and novel class results on VOC benchmark respectively. Results of Meta R-CNN[46] from original paper are also included in Table5 as a reference. Note that the results are not directly comparable because samples used for finetuning are different, which can make a significant im + +pact on the final metrics. We consistently outperform all methods on overall AP across all datasplits thanks to the non-forgetting property. As stated above, MPSR[44] and several other meta-learning methods[46, 45, 17] do not perform well on overall performance as the base class knowledge is forgotten during the finetuning stage. + +Notice that performance on novel classes is not our primary concern, though, competitive results are achieved by Retentive R-CNN under most cases on VOC novel classes as shown in Table5. MPSR[44] made most of the best nAP records; however, non-negligible base class performance is sacrificed. Compared to the methods that better preserves base class performance, we outperform the current best TFA[41] in most cases, with approximative results under the rest. + +# 4.3. Ablation Study and Visualization + +Without loss of generality, we conduct ablation experiments on COCO benchmark under 10-shot scenario. All models are trained with the same hyperparameters unless otherwise stated. + +Bias-Balanced RPN. To validate the effectiveness of our design, results on RPN recall and final detection precision for different classes of different RPN designs, including the + +
Methods / ShotsNovel Set 1Novel Set 2Novel Set 3
123510123510123510
OursRetentive R-CNN42.445.845.953.756.121.727.835.237.040.330.237.643.049.750.1
Transfer LearningFRCN-ft-full[41]15.220.329.025.528.713.420.628.632.438.819.620.828.742.242.1
TFA w/ fc[41]36.829.143.655.757.018.229.033.435.539.027.733.642.548.750.2
TFA w/ cos[41]39.836.144.755.756.023.526.934.135.139.130.834.842.849.549.8
MPSR[44]42.843.648.455.361.229.828.141.643.247.035.940.043.748.951.3
Meta LearningMeta R-CNN[46]19.925.535.045.751.510.419.429.634.845.414.318.227.541.248.1
Meta R-CNN*[46]16.820.120.338.243.77.712.014.921.931.19.213.926.229.236.2
FSRW[17]14.815.526.733.947.215.715.322.730.139.219.221.725.740.641.3
MetaDet[43]18.920.630.236.849.621.823.127.831.743.020.623.929.443.944.1
FsDetView*[45]25.420.437.436.142.322.921.722.625.629.232.419.029.833.239.8
+ +Table 5. Few-shot object detection results on Pascal VOC(07+12) novel classes (nAP50) under 1,2,3,5,10-shot settings, best viewed in color. Best results and second-best are colored in red and blue, respectively. Although nAP is not our primary concern, our method makes competitive results. MPSR[44] made most of the best nAP; however, base class metrics are largely sacrificed, as shown in Table4. We outperform TFA[41], the current best method paying fair attention to both classes, in most cases and on-par with it in the rest. + +
clsbboxARAPbAPnAP
max-47.832.139.210.5
--45.632.039.310.1
arith-avg-47.132.039.310.3
geo-avg-33.530.537.49.6
maxunfreeze47.732.039.310.4
maxarith-avg47.732.039.210.4
+ +Table 6. AR and AP results for base and novel classes among different RPN variants. Results of RPN components are ensembled by functions, including max, arithmetic average, and geometric average. '-' denotes for no ensembling, only base RPN is applied. The design option for current implementation is in bold. + +ensembling strategy for both RPN outputs and the choice of unfrozen layers during finetuning, are evaluated in Table6. Taking max as the ensembling strategy performs best, among other alternatives. Taking geometric average significantly degrades performance because any low objectness will produce a low final score. It can also be observed from the experiment that novel class AP is tightly related to AR of the RPN, while base class AP can remain stable with slightly inferior RPN AR, which validates one of our design philosophies to debias RPN thus improve novel class performance. Unfreezing box regression layers and ensembling does not make much difference. Thus the extra computation overhead is not necessary. + +Re-detector. We study various design options in Redetector, including the form of consistency loss (KL divergence, L1 difference, and negative cosine similarity between the normalized marginal probability distribution on base classes), layers in Re-detector to set unfrozen and classifier choice. As shown in Table7, our current design maximizes the overall performance. Surprisingly, unfreezing more layers even lowers the performance. + +In addition, to validate the necessity of finetuning on both base and novel classes, we also implement a Redetector where $f^n$ only detects $\mathcal{C}_n$ . It produces relatively low results, probably due to severer false positives as diverse objects in base classes are encountered during test + +
C(fn)LconlayersclsAPbAPnAP
allKLDivc+bcos32.139.210.5
allL1c+bcos32.039.210.3
allcosc+bcos31.939.210.0
novel-c+bcos31.639.28.7
allKLDivc+b+hcos31.939.29.8
allKLDivc+bfc31.939.39.9
+ +Table 7. Ablation results in Re-detector design. $\mathcal{C}(f^n)$ represents the classification domain of a novel detector. The column of layers denotes unfrozen layers in the second stage, c represents classification, b represents bbox and h represents linear layers in the box head. The design option for current implementation is in bold. + +time, but unseen during finetuning, and the model is trained to categorize these objects the same as those deactivated background features from only a handful of samples, which is undoubtedly challenging. + +Inference time. We report average inference time per image on COCO 2014 test set by adding modules into Faster R-CNN in Table8. The inference time of Meta R-CNN[46] is also provided as a reference for representative meta-learning methods that demand exemplars for inference, which also introduces much lower extra computation than others, to the best of our knowledge. As most weights are set frozen and shared, Retentive R-CNN introduces little overhead during test time to realize few-shot detection without forgetting, especially compared to meta learned models requiring exemplars at test time. + +
FRCN+BB-RPN+ReDEToursMeta R-CNN
70.270.574.275.785.4
+ +Table 8. Inference time in milliseconds on MS-COCO dataset. Meta R-CNN is reported in 10-shot from the original paper. + +Visualization. We provide exemplary results obtained by Retentive R-CNN and TFA w/cos[41] in Figure4 for comparison under MS-COCO 10-shot setting. The nonforgetting property of our method can be observed from the last four images containing either crowded scenes or less + +![](images/9b5c16075dfcb9a081e0b1f8b188594bde9063ffd321e7b03e8f43e171900b44.jpg) +Figure 4. Visualization of Retentve R-CNN and TFA w/cos[41] results under MS-COCO 10-shot setting. Novel classes are bounded with purple boxes while base classes are bounded with green ones. Our method generally performs better on base classes and can detect novel class objects ignored by TFA in certain cases. + +![](images/e343cfbcd749ae3606f84a3e9883c4b3caa1eb8c522de164758862fa1cc50112.jpg) +(a) + +![](images/b332cee7cf9ede8edd8c19db767e34524c9e9e756ecc2c41ea96b734082e9ea3.jpg) +(b) +Figure 5. Visualization of classification logits of Retentive R-CNN $det^n$ head, TFA w/cos[41] (finetuned from the same model), and the base model's classifiers. Regions colored pink represent novel class logits. The consistency loss regularizes our model to produce similar distribution as the base model on base classes, making detection on (a) base classes more reliable and (b) novel classes less confusing. + +sallent instances where TFA[41] tends to ignore some of these objects, e.g., the inconspicuous baseball bat in the third image is ignored, and many well-learned objects are overseen in the fourth image by TFA[41]. We also perform better on novel classes under certain cases, as shown in the first two images. + +We further investigate the role of consistency loss by comparing the classification distribution of our method and TFA w/cos[41] and a base detector. Specifically, we show two representative examples for the base class and novel class and visualize the logits of their classifiers for analysis. To make a fair comparison, both our method and TFA w/cos[41] are trained upon this same base detector. It can be easily observed that our method produces much more similar logits distribution as the base model on base classes rather than TFA w/cos[41]. Such property can better reserve base class performance, as shown in Figure5(a), where the base model and ours produce unimodal distribution with one strong peak. When it comes to novel classes, as shown in Figure5(b), base class distribution is suppressed, thus making a more confident response to novel classes. + +# 5. Conclusion + +In this paper, we have presented Retentive R-CNN to tackle the problem of G-FSD and proved that few-shot + +learning without forgetting is achievable in object detection. We analyze transfer learning based few-shot detection and find useful properties that are neglected by the community. Towards utilizing these properties, Retentive R-CNN is designed to combine base and novel detector simply and effectively, with Bias-Balanced RPN alleviating the bias of pretrained RPN and Re-detector reliably finding objects of both base and novel classes. Experiments on well-established few-shot object detection benchmarks show that Retentive R-CNN does not degrade on the base class while remains competitive on novel classes, reaching state-of-the-art overall performance among all data settings. Ablation study validates the effectiveness of our design. Nevertheless, the huge performance gap between few-shot and general object detection on data-limited classes indicates that this task is arduous by nature, and we hope that this paper sheds light on works to further boost novel class metrics with little or no trade-off on base classes. + +# Acknowledgement + +This research was partially supported by National Key R&D Program of China (No. 2017YFA0700800), and Beijing Academy of Artificial Intelligence (BAAI). + +# References + +[1] Hao Chen, Yali Wang, Guoyou Wang, and Yu Qiao. Lstd: A low-shot transfer detector for object detection. In AAAI Conference on Artificial Intelligence, pages 2836-2843, 2018. 1, 2, 4 +[2] Yinbo Chen, Xiaolong Wang, Zhuang Liu, Huijuan Xu, and Trevor Darrell. A new meta-baseline for few-shot learning. arXiv preprint arXiv:2003.04390, 2020. 1, 2 +[3] Guneet S Dhillon, Pratik Chaudhari, Avinash Ravichandran, and Stefano Soatto. A baseline for few-shot image classification. arXiv preprint arXiv:1909.02729, 2019. 1, 2 +[4] Kaiwen Duan, Song Bai, Lingxi Xie, Honggang Qi, Qingming Huang, and Qi Tian. Centernet: Keypoint triplets for object detection. In IEEE International Conference on Computer Vision, pages 6569-6578, 2019. 2 +[5] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International Journal of Computer Vision, 88(2):303-338, 2010. 5, 6 +[6] Qi Fan, Wei Zhuo, and Yu-Wing Tai. Few-shot object detection with attention-rpn and multi-relation detector. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4012-4021, 2020. 1, 2 +[7] 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 IEEE Conference on Computer Vision and Pattern Recognition, pages 9169-9178, 2020. 1, 2 +[8] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, 2017. 1, 2 +[9] Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4367-4375, 2018. 1, 2, 3 +[10] B. Ross Girshick. Fast r-cnn. In IEEE International Conference on Computer Vision, pages 1440-1448, 2015. 2 +[11] B. Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In IEEE Conference on Computer Vision and Pattern Recognition, pages 580-587, 2014. 2 +[12] Kaiming He, Georgia Gkioxari, Piotr Dólar, and B. Ross Girshick. Mask r-cnn. In IEEE International Conference on Computer Vision, pages 386-397, 2017. 2 +[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. 5 +[14] Ting-I Hsieh, Yi-Chen Lo, Hwann-Tzong Chen, and Tyng-Luh Liu. One-shot object detection with co-attention and coexcitation. In Neural Information Processing Systems, pages 2721–2730, 2019. 1, 2, 3 +[15] Zhiting Hu, Zichao Yang, Ruslan Salakhutdinov, and Eric Xing. Deep neural networks with massive learned knowledge. In Proceedings of the 2016 Conference on Empirical + +Methods in Natural Language Processing, pages 1670-1679, 2016.4 +[16] Perez-Rua Juan-Manuel, Zhu Xiatian, Hospedales Timothy, and Xiang Tao. Incremental few-shot object detection. In IEEE Conference on Computer Vision and Pattern Recognition, pages 13843-13852, 2020. 1, 2, 5, 6 +[17] Bingyi Kang, Zhuang Liu, Xin Wang, Fisher Yu, Jiashi Feng, and Trevor Darrell. Few-shot object detection via feature reweighting. In IEEE International Conference on Computer Vision, pages 8419-8428, 2019. 1, 2, 3, 5, 6, 7 +[18] Leonid Karlinsky, Joseph Shtok, Sivan Harary, Eli Schwartz, Amit Aides, Schmidt Rogério Feris, Raja Giryes, and M. Alexander Bronstein. Repmet - representative-based metric learning for classification and few-shot object detection. In IEEE Conference on Computer Vision and Pattern Recognition, pages 5197-5206, 2019. 1, 2, 4 +[19] Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML deep learning workshop, volume 2. Lille, 2015. 1, 2 +[20] Hei Law and Jia Deng. Cornernet: Detecting objects as paired keypoints. In IEEE International Conference on Computer Vision, pages 642-656, 2019. 2 +[21] Aoxue Li, Tiange Luo, Tao Xiang, Weiran Huang, and Liwei Wang. Few-shot learning with global class representations. In IEEE International Conference on Computer Vision, pages 9715-9724, 2019. 2 +[22] Fei-Fei Li, Fergus Rob, and Perona Pietro. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence, 28(4):594-611, 2006. 1 +[23] Tsung-Yi Lin, Piotr Dólar, B. Ross Girshick, Kaiming He, Bharath Hariharan, and J. Serge Belongie. Feature pyramid networks for object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2017. 2, 4, 5 +[24] Tsung-Yi Lin, Priya Goyal, B. Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. In IEEE International Conference on Computer Vision, pages 318-327, 2017. 2, 5 +[25] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and Lawrence C. Zitnick. Microsoft coco: Common objects in context. In European Conference on Computer Vision, pages 740-755, 2014. 1, 3, 5 +[26] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, and Scott Reed. Ssd: Single shot multibox detector. In European Conference on Computer Vision, 2016. 2 +[27] David Lopez-Paz and Marc'Aurelio Ranzato. Gradient episodic memory for continual learning. In Neural Information Processing Systems, pages 6467-6476, 2017. 2, 3 +[28] Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pages 109-165. Elsevier, 1989. 2, 3 +[29] Claudio Michaelis, Ivan Ustyuzhaninov, Matthias Bethge, and Alexander S. Ecker. One-shot instance segmentation. arXiv preprint arXiv:1811.11507, 2018. 1, 2, 3 +[30] Hang Qi, Matthew Brown, and David G Lowe. Low-shot learning with imprinted weights. In IEEE Conference + +on Computer Vision and Pattern Recognition, pages 5822-5830, 2018. 1, 2, 3 +[31] Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting parameters from activations. In IEEE Conference on Computer Vision and Pattern Recognition, pages 7229-7238, 2018. 2 +[32] Han Qiu, Yuchen Ma, Zeming Li, Songtao Liu, and Jian Sun. Borderdet: Border feature for dense object detection. In European Conference on Computer Vision, pages 549-564. Springer, 2020. 2 +[33] Joseph Redmon, Kumar Santosh Divvala, B. Ross Girshick, and ali farhadi. You only look once: Unified, real-time object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. 2 +[34] Shaoqing Ren, Kaiming He, B. Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1137-1149, 2017. 2, 4 +[35] A. Andrei Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In International Conference on Learning Representations, 2019. 1, 2 +[36] Edgar Schonfeld, Sayna Ebrahimi, Samarth Sinha, Trevor Darrell, and Zeynep Akata. Generalized zero-and few-shot learning via aligned variational autoencoders. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8247-8255, 2019. 2 +[37] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Neural Information Processing Systems, pages 4077-4087, 2017. 1, 2 +[38] 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 IEEE Conference on Computer Vision and Pattern Recognition, pages 1199-1208, 2018. 1, 2 +[39] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In IEEE International Conference on Computer Vision, pages 9627-9636, 2019. 2 +[40] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Neural Information Processing Systems, pages 3630-3638, 2016. 1, 2 +[41] Xin Wang, Thomas Huang, Joseph Gonzalez, Trevor Darryll, and Fisher Yu. Frustratingly simple few-shot object detection. In International Conference on Machine Learning, 2020. 1, 2, 3, 4, 5, 6, 7, 8 +[42] Yan Wang, Wei-Lun Chao, Kilian Q Weinberger, and Laurens van der Maaten. Simpleshot: Revisiting nearest-neighbor classification for few-shot learning. arXiv preprint arXiv:1911.04623, 2019. 1, 2 +[43] Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Meta-learning to detect rare objects. In IEEE International Conference on Computer Vision, pages 9924-9933, 2019. 1, 2, 5, 7 +[44] Jiaxi Wu, Songtao Liu, Di Huang, and Yunhong Wang. Multi-scale positive sample refinement for few-shot object + +detection. In European Conference on Computer Vision, 2020. 1, 2, 3, 4, 5, 6, 7 +[45] Yang Xiao and Renaud Marlet. Few-shot object detection and viewpoint estimation for objects in the wild. In European Conference on Computer Vision, 2020. 1, 2, 4, 5, 6, 7 +[46] Xiaopeng Yan, Ziliang Chen, Anni Xu, Xiaoxi Wang, Xiaodan Liang, and Liang Lin. Meta r-cnn - towards general solver for instance-level low-shot learning. In IEEE International Conference on Computer Vision, pages 9576-9585, 2019. 1, 2, 4, 5, 6, 7 +[47] Ze Yang, Yali Wang, Xianyu Chen, Jianzhuang Liu, and Yu Qiao. Context-transformer: Tackling object confusion for few-shot detection. In AAAI Conference on Artificial Intelligence, pages 12653-12660, 2020. 2 +[48] 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, pages 1974-1982, 2017. 4 +[49] Shifeng Zhang, Cheng Chi, Yongqiang Yao, Zhen Lei, and Stan Z. Li. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In IEEE Conference on Computer Vision and Pattern Recognition, pages 9756-9765, 2019. 2 \ No newline at end of file diff --git a/generalizedfewshotobjectdetectionwithoutforgetting/images.zip b/generalizedfewshotobjectdetectionwithoutforgetting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9312fd6f7d9f8cc7d485b5c5e07842b7e92469ef --- /dev/null +++ b/generalizedfewshotobjectdetectionwithoutforgetting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba033d0b1dd94e5932a59d3e9f14e5102660bdac962eb3e1208af6e0dc952d61 +size 580835 diff --git a/generalizedfewshotobjectdetectionwithoutforgetting/layout.json b/generalizedfewshotobjectdetectionwithoutforgetting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..230373b2f596a685d3b7231c068ed86a9271b8fb --- /dev/null +++ b/generalizedfewshotobjectdetectionwithoutforgetting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae79f90ba903ccc0c502b63f6bb516e9f3008710bd3f7e8fa0daff9728efd1fc +size 378947 diff --git a/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_content_list.json b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4b852ab8eb80b3a86d6541ee52d80a8fe71469f7 --- /dev/null +++ b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9be9a5160612f3dca7a2eb791b88983ad157e0f2aaa1fc1cc7d94242dd795623 +size 74530 diff --git a/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_model.json b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_model.json new file mode 100644 index 0000000000000000000000000000000000000000..91f686123660d719936de530cf3485649416f204 --- /dev/null +++ b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99e3f3af210f7429ee7f9870588084f3dd5e3cbddafbe4fe78a3d90667b774f3 +size 92142 diff --git a/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_origin.pdf b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..998b4fed0a4536b00e400283aa4c6e0b2348adc7 --- /dev/null +++ b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/8d50f3ec-9c94-45f9-b802-0daa55621e11_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3743fedfa68175e4e97d217a3ff96434d156aa8671227b6895eb5b043b83b15c +size 1177650 diff --git a/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/full.md b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c542eda15f3aaa628b48a1309f92d6af07655732 --- /dev/null +++ b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/full.md @@ -0,0 +1,281 @@ +# Generalized Focal Loss V2: Learning Reliable Localization Quality Estimation for Dense Object Detection + +Xiang Li $^{1,2}$ , Wenhai Wang $^{3}$ , Xiaolin Hu $^{4}$ , Jun Li $^{1}$ , Jinhui Tang $^{1}$ , and Jian Yang $^{1*}$ + +$^{1}$ Nanjing University of Science and Technology $^{2}$ Momenta $^{3}$ Nanjing University $^{4}$ Tsinghua University + +{xiang.li.implus, junl, jinhuitang, csjyang}@njust.edu.cn, wangwenhai362@163.com, xlu@mail.tsinghua.edu.cn + +# Abstract + +Localization Quality Estimation (LQE) is crucial and popular in the recent advancement of dense object detectors since it can provide accurate ranking scores that benefit the Non-Maximum Suppression processing and improve detection performance. As a common practice, most existing methods predict LQE scores through vanilla convolutional features shared with object classification or bounding box regression. In this paper, we explore a completely novel and different perspective to perform LQE - based on the learned distributions of the four parameters of the bounding box. The bounding box distributions are inspired and introduced as "General Distribution" in GFLV1, which describes the uncertainty of the predicted bounding boxes well. Such a property makes the distribution statistics of a bounding box highly correlated to its real localization quality. Specifically, a bounding box distribution with a sharp peak usually corresponds to high localization quality, and vice versa. By leveraging the close correlation between distribution statistics and the real localization quality, we develop a considerably lightweight Distribution-Guided Quality Predictor (DGQP) for reliable LQE based on GFLV1, thus producing GFLV2. To our best knowledge, it is the first attempt in object detection to use a highly relevant, statistical representation to facilitate LQE. Extensive experiments demonstrate the effectiveness of our method. Notably, GFLV2 (ResNet-101) achieves 46.2 AP at 14.6 FPS, surpassing the previous state-of-the-art ATSS baseline (43.6 AP at 14.6 FPS) by absolute 2.6 AP on COCO test-dev, without sacrificing the efficiency both in training and inference. + +# 1. Introduction + +Dense object detector [28, 23, 42, 33, 18, 27] which directly predicts pixel-level object categories and bounding boxes over feature maps, becomes increasingly popular due to its elegant and effective framework. One of the crucial techniques underlying this framework is Localization Quality Estimation (LQE). With the help of better LQE, high-quality bounding boxes tend to score higher than low-quality ones, greatly reducing the risk of mistaken suppression in Non-Maximum Suppression (NMS) processing. + +Many previous works [28, 29, 30, 33, 40, 36, 14, 18, 39, 43, 27] have explored LQE. For example, the YOLO family [28, 29, 30] first adopt Objectness to describe the localization quality, which is defined as the Intersection-over-Union (IoU) between the predicted and ground-truth box. After that, IoU is further explored and proved to be effective in IoU-Net [13], IoU-aware [36], PAA [14], GFLV1 [18] and VFNet [39]. Recently, FCOS [33] and ATSS [40] introduce Centerness, the distance degree to the object center, to suppress low-quality detection results. Generally, the aforementioned methods share a common characteristic that they are all based on vanilla convolutional features, e.g., features of points, borders or regions (see Fig. 2 (a)-(g)), to estimate the localization quality. + +Different from previous works, in this paper, we explore a brand new perspective to conduct LQE – by directly utilizing the statistics of bounding box distributions, instead of using the vanilla convolutional features (see Fig. 2). Here the bounding box distribution is introduced as “General Distribution” in GFLV1 [18], where it learns a discrete probability distribution of each predicted edge (Fig. 1 (a)) for describing the uncertainty of bounding box regression. Interestingly, we observe that the statistic of the General Distribution has a strong correlation with its real localization quality, as illustrated in Fig. 1 (b). More specifically in Fig. 1 (c) and (d), the shape (flatness) of bounding box distribution can clearly reflect the localization quality of the + +![](images/996c7240be8680de8c31264604a9710bb4492e71983cb1b1200cec4df59c74ed.jpg) +(a) + +![](images/27186c58671e3c3598d208a50c44d4d9d83ec16d48127e236f049cff592a1b1b.jpg) +(b) + +![](images/8e919fbb56d0794a6b0a608aed69f9237c4af4278dae97bec4bf42c41705d590.jpg) +Lower Localization Quality: 0.69 IoU + +![](images/6036c78b551476f8fed055014a547e8b62d2addcdd9ba8990a9674d747e53bae.jpg) +(c) + +![](images/c57da2791bdfd667f1bee2b896bd5e9ffbeb6cb0920043a31d060c83ac29575f.jpg) +Higher Localization Quality: 0.90 IoU + +![](images/571020d23fbeb46127f64918c1d71f7e8aae2d0533cfbb9596267fce0abd810a.jpg) +(d) +Figure 1: Motivation of utilizing the highly relevant statistics of learned bounding box distributions to guide the better generation of its estimated localization quality. (a): The illustration of General Distribution in GFLV1 [18] to represent bounding boxes, which models the probability distribution of the predicted edges. (b): The scatter diagram of the relation between Top-1 (mean of four sides) value of General Distribution of predicted boxes and their real localization quality (IoU between the prediction and ground-truth), calculated over all validation images on COCO [22] dataset, based on GFLV1 model. (c) and (d): Two specific examples from (b), where the sharp distribution corresponds to higher quality, whilst the flat one stands for lower quality usually. Green: predicted bounding boxes; White: ground-truth bounding boxes. + +predicted results: the sharper the distribution, the more accurate the predicted bounding box, and vice versa. Consequently, it can potentially be easier and very efficient to conduct better LQE by the guidance of the distribution information, as the input (distribution statistics of bounding boxes) and the output (LQE scores) are highly correlated. + +Inspired by the strong correlation between the distribution statistics and LQE scores, we propose a very lightweight sub-network with only dozens of (e.g., 64) hidden units, on top of these distribution statistics to produce reliable LQE scores, significantly boosting the detec + +tion performance. Importantly, it brings negligible additional computation cost in practice and almost does not affect the training/inference speed of the basic object detectors. In this paper, we term this lightweight sub-network as Distribution-Guided Quality Predictor (DGQP), since it relies on the guidance of distribution statistics for quality predictions. + +By introducing the lightweight DGQP that predicts reliable LQE scores via statistics of bounding box distributions, we develop a novel dense object detector based on the framework of GFLV1, thus termed GFLV2. To verify the effectiveness of GFLV2, we conduct extensive experiments on the challenging benchmark COCO [22]. Notably, based on ResNet-101 [11], GFLV2 achieves impressive detection performance (46.2 AP), i.e., 2.6 AP gains over the state-of-the-art ATSS baseline (43.6 AP) on COCO test-dev, under the same training schedule and without sacrificing the efficiency both in training and inference. + +In summary, our contributions are as follows: + +- To our best knowledge, our work is the first to bridge the statistics of bounding box distributions and localization quality estimation in an end-to-end dense object detection framework. +- The proposed GFLV2 is considerably lightweight and cost-free in practice. It can also be easily plugged into most dense object detectors with a consistent gain of $\sim 2$ AP, and without loss of training/inference speed. +- Our GFLV2 (Res2Net-101-DCN) achieves very competitive 53.3 AP (multi-scale testing) on COCO dataset among dense object detectors. + +# 2. Related Work + +Formats of LQE: Early popular object detectors [9, 31, 1, 10] simply treat the classification confidence as the formulation of LQE score, but there is an obvious inconsistency between them, which inevitably degrades the detection performance. To alleviate this problem, AutoAssign [43] and BorderDet [27] employ additional localization features to rescore the classification confidence, but they still lack an explicit definition of LQE. + +Recently, FCOS [33] and ATSS [40] introduce a novel format of LQE, termed Centerness, which depicts the distance degree to the center of the object. Although Centerness is effective, recent researches [18, 39] show that it has certain limitations and may be suboptimal for LQE. SABL [35] introduces boundary buckets for coarse localization, and utilizes the averaged bucketing confidence as a formulation of LQE. + +After years of technical iterations [28, 29, 30, 13, 34, 12, 36, 14, 18, 39], IoU has been deeply studied and becomes increasingly popular as an excellent measurement of LQE. IoU is first known as the Objectness inYOLO [28, 29, 30], where the network is supervised to produce estimated IoUs + +![](images/0274c383aaf6f5b9fecd61f45f53439ff493042c39224368234bf6d5f932e2ef.jpg) +Figure 2: Comparisons of input features for predicting localization quality between existing works (left) and ours (right). Existing works focus on different spatial locations of convolutional features, including (a): point [28, 29, 30, 33, 40, 36, 14, 18], (b): region [13], (c): border [27] dense points, (d): border [27] middle points, (e): border [27] extreme points, (f): regular sampling points [39], and (g): deformable sampling points [4, 5]. In contrast, we use the statistic of learned box distribution to produce reliable localization quality. + +between predicted boxes and ground-truth ones, to reduce ranking basis during NMS. Following the similar paradigm, IoU-Net [13], Fitness NMS [34], MS R-CNN [12], IoU-aware [36], PAA [14] utilize a separate branch to perform LQE in the IoU form. Concurrently, GFLV1 [18] and VFNet [39] demonstrate a more effective format, by merging the classification score with IoU to reformulate a joint representation. Due to its great success [18, 39], we build our GFLV2 based on the Classification-IoU Joint Representation [18], and develop a novel approach for reliable LQE. Input Features for LQE: As shown in the left part of Fig. 2, previous works directly use convolutional features as input for LQE, which only differ in the way of spatial sampling. Most existing methods [28, 29, 30, 33, 40, 36, 14, 18] adopt the point features (see Fig. 2 (a)) to produce LQE scores for high efficiency. IoU-Net [13] predicts IoU based on the region features as shown in Fig. 2 (b). BorderDet [27] designs three types of border-sensitive features (see Fig. 2 (c)-(e)) to facilitate LQE. Similar with BorderDet, a star-shaped sampling manner (see Fig. 2 (f)) is designed in VFNet [39]. Alternatively, HSD [2] and RepPoints [38, 4] focus on features with learned locations (see Fig. 2 (g)) via the deformable convolution [5, 46]. + +The aforementioned methods mainly focus on extracting discriminating convolutional features with various spatial aspects for better LQE. Different from previous methods, our proposed GFLV2 is designed in an artful perspective: predicting LQE scores by its directly correlated variables—the statistics of bounding box distributions (see the right part of Fig. 2). + +# 3. Method + +In this section, we first briefly review the Generalized Focal Loss (i.e., GFLV1 [18]), and then derive the proposed GFLV2 based on the relevant concepts and formulations. + +# 3.1. Generalized Focal Loss V1 + +Classification-IoU Joint Representation: This representation is the key component in GFLV1, which is designed to reduce the inconsistency between localization quality es + +timation and object classification during training and inference. Concretely, given an object with category label $c \in \{1,2,\dots,m\}$ ( $m$ indicates the total number of categories), GFLV1 utilizes the classification branch to produce the joint representation of Classification and IoU as $\mathbf{J} = [J_1,J_2,\dots,J_m]$ , which satisfies: + +$$ +J _ {i} = \left\{ \begin{array}{l l} \operatorname {I o U} \left(b _ {p r e d}, b _ {g t}\right), & \text {i f} i = c; \\ 0, & \text {o t h e r w i s e ,} \end{array} \right. \tag {1} +$$ + +where $\mathrm{IoU}(b_{pred}, b_{gt})$ denotes the IoU between the predict bounding box $b_{pred}$ and the ground truth $b_{gt}$ . + +General Distribution of Bounding Box Representation: Modern detectors [31, 21, 33] usually describe the bounding box regression by Dirac delta distribution: $y = \int_{-\infty}^{+\infty}\delta (x - y)x\mathrm{d}x$ . Unlike them, GFLV1 introduces a flexible General Distribution $P(x)$ to represent the bounding box, where each edge of the bounding box can be formulated as: $\hat{y} = \int_{-\infty}^{+\infty}P(x)x\mathrm{d}x = \int_{y_0}^{y_n}P(x)x\mathrm{d}x$ , under a predefined output range of $[y_0,y_n]$ . To be compatible with the convolutional networks, the continuous domain is converted into the discrete one, via discretizing the range $[y_0,y_n]$ into a list $[y_0,y_1,\dots ,y_i,y_{i + 1},\dots ,y_{n - 1},y_n]$ with even intervals $\Delta$ $(\Delta = y_{i + 1} - y_i,\forall i\in \{0,1,\dots ,n - 1\})$ . As a result, given the discrete distribution property $\sum_{i = 0}^{n}P(y_{i}) = 1$ , the estimated regression value $\hat{y}$ can be presented as: + +$$ +\hat {y} = \sum_ {i = 0} ^ {n} P \left(y _ {i}\right) y _ {i}. \tag {2} +$$ + +Compared with the Dirac delta distribution, the General Distribution $P(x)$ can faithfully reflect the prediction quality (see Fig. 1 (c)-(d)), which is the cornerstone of this work. + +# 3.2. Generalized Focal Loss V2 + +Decomposed Classification-IoU Representation: Although the joint representation solves the inconsistency problem [18] between object classification and quality estimation during training and testing, there are still some limitations in using only the classification branch to predict the joint representation. In this work, we decompose the joint representation explicitly by leveraging information + +![](images/759ca39d9a596dfe915966aa0e8c089a90cf9d9bd6d84beab82b8516a6c4fed6.jpg) +Figure 3: The illustration of the proposed Generalized Focal Loss V2 (GFLV2), where a novel and tiny Distribution-Guided Quality Predictor (DGQP) uses the statistics of learned bounding box distributions to facilitate generating reliable IoU quality estimations. + +from both classification (C) and regression $(I)$ branches: + +$$ +\mathbf {J} = \mathbf {C} \times I, \tag {3} +$$ + +where $\mathbf{C} = [C_1, C_2, \dots, C_m], C_i \in [0, 1]$ denotes the Classification Representation of total $m$ categories, and $I \in [0, 1]$ is a scalar that stands for the IoU Representation. + +Although $\mathbf{J}$ is decomposed into two components, we use the final joint formulation (i.e., $\mathbf{J}$ ) in both the training and testing phases, so it can still avoid the inconsistency problem as mentioned in GFLV1. Specifically, we first combine $\mathbf{C}$ from the classification branch and $I$ from the proposed Distribution-Guided Quality Predictor (DGQP) in regression branch, into the unified form $\mathbf{J}$ . Then, $\mathbf{J}$ is supervised by Quality Focal loss (QFL) as proposed in [18] during training, and used directly as NMS score in inference. + +Distribution-Guided Quality Predictor: DGQP is the key component of GFLV2. It delivers the statistics of the learned General Distribution $\mathbf{P}$ into a tiny sub-network (see red dotted frame in Fig. 3) to obtain the predicted IoU scalar $I$ , which helps to generate high-quality Classification-IoU Joint Representation (Eq. (3)). Following GFLV1 [18], we adopt the relative offsets from the location to the four sides of a bounding box as the regression targets, which are represented by the General Distribution. For convenience, we mark the left, right, top and bottom sides as $\{l, r, t, b\}$ , and define the discrete probabilities of the $w$ side as $\mathbf{P}^w = [P^w(y_0), P^w(y_1), \dots, P^w(y_n)]$ , where $w \in \{l, r, t, b\}$ . + +As illustrated in Fig. 1, the flatness of the learned distribution is highly related to the quality of the final detected bounding box, and some relevant statistics can be used to reflect the flatness of the General Distribution. As a result, such statistical features have a very strong correlation with the localization quality, which will ease the training difficulty and improves the quality of estimation. Practically, we recommend to choose the Top- $k$ values along with the mean value of each distribution vector $\mathbf{P}^w$ , and concatenate + +them as the basic statistical feature $\mathbf{F}\in \mathbb{R}^{4(k + 1)}$ + +$$ +\mathbf {F} = \operatorname {C o n c a t} \left(\left\{\operatorname {T o p k m} \left(\mathbf {P} ^ {w}\right) \mid w \in \{l, r, t, b \} \right\}\right), \tag {4} +$$ + +where $\mathrm{Topkm}(\cdot)$ denotes the joint operation of calculating Top- $k$ values and their mean value. $\mathrm{Concat}(\cdot)$ means the channel concatenation. Selecting Top- $k$ values and their mean value as the input statistics have two benefits: + +- Since the sum of $\mathbf{P}^w$ is fixed (i.e., $\sum_{i=0}^{n} P^w(y_i) = 1$ ), Top- $k$ values along with their mean value can basically reflect the flatness of the distribution: the larger, the sharper; the smaller, the flatter; +- Top- $k$ and mean values can make the statistical feature insensitive to its relative offsets over the distribution domain (see Fig. 4), resulting in a robust representation which is not affected by object scales. + +![](images/f398d3cf83da16e7f6c3dc2065bb00c6d76fe9f22168a78c4bd2c17eae3bd9c6.jpg) +Figure 4: Topkm(·) feature is robust to object scales. + +Given the statistical feature $\mathbf{F}$ of General Distribution as input, we design a very tiny sub-network $\mathcal{F}(\cdot)$ to predict the final IoU quality estimation. The sub-network has only two Fully-Connected (FC) layers, which are followed by ReLU [16] and Sigmoid, respectively. Consequently, the IoU scalar $I$ can be calculated as: + +$$ +I = \mathcal {F} (\mathbf {F}) = \sigma \left(\mathbf {W} _ {2} \delta \left(\mathbf {W} _ {1} \mathbf {F}\right)\right), \tag {5} +$$ + +where $\delta$ and $\sigma$ refer to the ReLU and Sigmoid, respectively. $\mathbf{W}_1\in \mathbb{R}^{p\times 4(k + 1)}$ and $\mathbf{W}_2\in \mathbb{R}^{1\times p}$ . $k$ denotes the Top- $k$ parameter and $p$ is the channel dimension of the hidden layer ( $k = 4$ , $p = 64$ is a typical setting in our experiment). + +**Complexity:** The overall architecture of GFLV2 is illustrated in Fig. 3. It is worth noting that the DGQP module is very lightweight. First, it only brings thousands of additional parameters, which are negligible compared to the + +
Top-k (4)MeanVarDimAP\( AP_{50} \)\( AP_{75} \)
✓1640.858.544.2
✓440.258.543.6
✓440.358.343.7
✓✓2041.158.844.9
✓✓2040.958.544.7
✓✓✓2440.958.444.7
+ +Table 1: Performances of different combinations of the input statistics by fixing $k = 4$ and $p = {64}$ . "Mean" denotes the mean value, "Var" denotes the variance number, and "Dim" is short for "Dimension" that means the total amount of the input channels. + +number of parameters of the entire detection model. For example, for the model with ResNet-50 [11] and FPN [20], the extra parameters of the DGQP module only account for $\sim 0.003\%$ . Second, the computational overhead of the DGQP module is also very small due to its extremely light structure. As shown in Table 5 and 8, the use of the DGQP module hardly reduces the training and inference speed of the original detector in practice. + +# 4. Experiment + +Experimental Settings: We conduct experiments on COCO benchmark [22], where trainval35k with 115K images is used for training and minival with 5K images for validation in our ablation study. Besides, we obtain the main results on test-dev with 20K images from the evaluation server. All results are produced under mmdetection [3] for fair comparisons, where the default hyperparameters are always adopted. Unless otherwise stated, we apply the standard 1x learning schedule (12 epochs) without multi-scale training for the ablation study, based on ResNet-50 [11] backbone. The training/testing details follow the descriptions in previous works [18, 4]. + +# 4.1. Ablation Study + +Combination of Input Statistics: In addition to the pure Top- $k$ values, there are some statistics that may reflect more characteristics of the distributions, such as the mean and variance of these Top- $k$ numbers. Therefore, we conduct experiments to investigate the effect of their combinations as input, by fixing $k = 4$ and $p = 64$ . From Table 1, we observe that the Top-4 values with their mean number perform best. Therefore, we default to use such a combination as the standard statistical input in the following experiments. + +Structure of DGQP (i.e., $k, p$ ): We then examine the impact of different parameters of $k, p$ in DGQP on the detection performance. Specifically, we report the effect of $k$ and $p$ by fixing one and varying another in Table 2. It is observed that $k = 4, p = 64$ steadily achieves the optimal accuracy among various combinations. + +Type of Input Features: To the best of our knowledge, the proposed DGQP is the first to use the statistics of learned + +
kpAP\( AP_{50} \)\( AP_{75} \)\( AP_S \)\( AP_M \)\( AP_L \)
0-40.258.643.423.044.353.0
140.258.344.023.444.152.1
240.958.544.623.344.853.5
36440.958.544.624.344.952.3
441.158.844.923.544.953.3
841.058.644.523.544.553.4
1640.858.544.423.444.253.1
4840.958.444.523.144.552.6
1640.858.344.123.344.652.0
3240.958.744.323.144.653.2
6441.158.844.923.544.953.3
12840.958.344.623.244.452.7
25640.758.344.423.444.352.9
+ +Table 2: Performances of various $k,p$ in DGQP. $k = 0$ denotes the baseline version without the usage of DGQP (i.e., GFLV1). + +
Input FeatureAP\( AP_{50} \)\( AP_{75} \)FPS
Baseline (ATSS [40] w/ QFL [18])39.958.543.019.4
Convolutional Features(a)40.258.643.719.3
(b)40.559.044.014.0
(c)40.558.744.116.2
(d)40.659.044.018.3
(e)40.658.944.117.8
(f)40.759.044.117.9
(g)40.858.944.618.4
Distribution Statistics (ours)41.158.844.919.4
+ +Table 3: Comparisons among different input features by fixing the hidden layer dimension of DGQP. + +![](images/537f091d4c26673e4e603d1a66db804c07e339f83d34dbf6ae5f57ab0fb7332e.jpg) +Figure 5: Different ways to utilize the distribution statistics, including Decomposed Form (left) and Composed Form (right). + +distributions of bounding boxes for the generation of better LQE scores in the literature. Since the input (distribution statistics) and the output (LQE scores) are highly correlated, we speculate that it can be more effective or efficient than ordinary convolutional input proposed in existing methods. Therefore, we fix the hidden layer dimension of DGQP (i.e., $p = 64$ ) and compare our statistical input with most existing possible types of convolutional inputs, from point (a), region (b), border (c)-(e), regular points (f), and deformable points (g), respectively (Fig. 2). Table 3 shows that our distribution statistics perform best in overall AP, also fastest in inference, compared against various convolutional features. + +Usage of the Decomposed Form: Next, we examine what is the best formulation of Classification-IoU Joint Representation in the case of using distribution statistics. There + +
TypeAPAP50AP75FPS
Baseline (GFLV1 [18])40.258.643.419.4
Composed Formd = 1640.558.543.719.2
d = 3240.558.543.719.2
d = 6440.758.544.319.1
d = 12840.758.644.418.9
d = 25640.758.344.218.5
Decomposed Form (ours)41.158.844.919.4
+ +Table 4: Comparisons between Decomposed Form (proposed) and Composed Form (with various dimension $d$ settings). + +
MethodGFLV2AP\( AP_{50} \)\( AP_{75} \)FPS
RetinaNet [21]36.555.538.719.0
RetinaNet [21]✓38.6 (+2.1)56.241.719.0
FoveaNet [15]36.455.838.820.0
FoveaNet [15]✓38.5 (+2.1)56.841.620.0
FCOS [33]38.556.941.419.4
FCOS [33]✓40.6 (+2.1)58.243.919.4
ATSS [40]39.257.442.219.4
ATSS [40]✓41.1 (+1.9)58.844.919.4
+ +are basically two formats: the Composed Form and the proposed Decomposed Form (Sec. 3.2), as illustrated in Fig. 5. Here the "Decomposed" (the left part of Fig. 5) means that the final joint representation can be explicitly decomposed through multiplication by two components, i.e., $\mathbf{J} = \mathbf{C} \times I$ in Eq. (3). Whilst the "Composed" (the right part of Fig. 5) shows that $\mathbf{J}$ is directly obtained through FC layers where its input feature is enriched ( $d$ is the dimension of the appended feature) by the information of distribution statistics. From Table 4, our proposed Decomposed Form is always superior than the Composed Forms with various $d$ settings in both accuracy and running speed. + +Compatibility for Dense Detectors: Since GFLV2 is very lightweight and can be adapted to various types of dense detectors, we employ it to a series of recent popular detection methods. For those detectors that do not support the distributed representation of bounding boxes, we make the minimal and necessary modifications to enable it to generate distributions for each edge of a bounding box. Based on the results in Table 5, GFLV2 can consistently improve $\sim 2$ AP in popular dense detectors, without loss of inference speed. + +# 4.2. Comparisons with State-of-the-arts + +In this section, we compare GFLV2 with state-of-the-art approaches on COCO test-dev in Table 7. Following previous works [21, 33], the multi-scale ([480, 960]) training strategy and $2\mathrm{x}$ learning schedule (24 epochs) are adopted during training. For a fair comparison, the re + +![](images/8ab9d6e178ec546927ef6870898b3d4c38a370f017afed5634dbe732f0986c27.jpg) +Figure 6: Single-model single-scale speed (ms) vs. accuracy (AP) on COCO test-dev among state-of-the-art approaches. GFLV2 achieves better speed-accuracy trade-off than its competitive counterparts. + +Table 5: Integrating GFLV2 into various popular dense object detectors. A consistent $\sim 2$ AP gain is observed without loss of inference speed. + +
MethodAPFPSPCC ↑
FCOS* [33]39.119.40.624
ATSS* [40]39.919.40.631
GFLV1 [18]40.219.40.634
GFLV2 (ours)41.1 (+0.9)19.40.660 (+0.26)
+ +Table 6: Pearson Correlation Coefficients (PCC) for representative dense object detectors. * denotes the application of Classification-IoU Joint Representation, instead of additional Centerness branch. + +sults of single-model single-scale testing for all methods are reported, including their corresponding inference speeds (FPS). We also report additional multi-scale testing results for GFLV2. The visualization of the accuracy-speed trade-off is demonstrated in Fig. 6, and we observe that GFLV2 pushes the envelope of accuracy-speed boundary to a new level. Our best result with a single Res2Net-101-DCN model achieves considerably competitive 53.3 AP. + +# 4.3. Analysis + +Although the proposed DGQP module has been shown to improve the performance of dense object detectors, we would also like to understand how its mechanism operates. + +DGQP Improves LQE: To assess whether DGQP is able to benefit the estimation of localization quality, we first obtain the predicted IoUs (given by four representative models with IoU as the quality estimation targets) and their corresponding real IoUs over all the positive samples on COCO minival. Then we calculate their Pearson Correlation Coefficient (PCC) in Table 6. It demonstrates that DGQP in GFLV2 indeed improves the linear correlation between the estimated IoUs and the ground-truth ones by a considerable margin (+0.26) against GFLV1, which eventually leads to an absolute 0.9 AP gain. + +DGQP Eases the Learning Difficulty: Fig. 8 provides the visualization of the training losses on LQE scores, where + +
MethodBackboneEpoch\(MS_{train}\)FPSAP\(AP_{50}\)\(AP_{75}\)\(AP_S\)\(AP_M\)\(AP_L\)Reference
multi-stage:
Faster R-CNN w/ FPN [20]R-1012414.236.259.139.018.239.048.2CVPR17
Cascade R-CNN [1]R-1011811.942.862.146.323.745.555.2CVPR18
Grid R-CNN [24]R-1012011.441.560.944.523.344.953.1CVPR19
Libra R-CNN [26]X-101-64x4d128.543.064.047.025.345.654.6CVPR19
RepPoints [38]R-1012413.341.062.944.323.644.151.7ICCV19
RepPoints [38]R-101-DCN24✓11.845.066.149.026.648.657.5ICCV19
RepPointsV2 [4]R-10124✓11.146.065.349.527.448.957.3NeurIPS20
RepPointsV2 [4]R-101-DCN24✓10.048.167.551.828.750.960.8NeurIPS20
TridentNet [19]R-10124✓2.7*42.763.646.523.946.656.6ICCV19
TridentNet [19]R-101-DCN36✓1.3*46.867.651.528.051.260.5ICCV19
TSD [32]R-101201.143.264.046.924.046.355.8CVPR20
BorderDet [27]R-10124✓13.2*45.464.148.826.748.356.5ECCV20
BorderDet [27]X-101-64x4d24✓8.1*47.266.151.028.150.259.9ECCV20
BorderDet [27]X-101-64x4d-DCN24✓6.4*48.067.152.129.450.760.5ECCV20
one-stage:
CornerNet [17]HG-104200✓3.1*40.656.443.219.142.854.3ECCV18
CenterNet [7]HG-104190✓3.3*44.962.448.125.647.457.4ICCV19
CentripetalNet [6]HG-104210✓n/a45.863.049.325.048.258.7CVPR20
RetinaNet [21]R-1011813.639.159.142.321.842.750.2ICCV17
FreeAnchor [41]R-10124✓12.843.162.246.424.546.154.8NeurIPS19
FreeAnchor [41]X-101-32x8d24✓8.244.964.348.526.848.355.9NeurIPS19
FSAF [45]R-10118✓15.140.961.544.024.044.251.3CVPR19
FSAF [45]X-101-64x4d18✓9.142.963.846.326.646.252.7CVPR19
FCOS [33]R-10124✓14.741.560.745.024.444.851.6ICCV19
FCOS [33]X-101-64x4d24✓8.944.764.148.427.647.555.6ICCV19
SAPD [44]R-10124✓13.243.563.646.524.946.854.6CVPR20
SAPD [44]R-101-DCN24✓11.146.065.949.626.349.259.6CVPR20
SAPD [44]X-101-32x4d-DCN24✓8.846.666.650.027.349.760.7CVPR20
ATSS [40]R-10124✓14.643.662.147.426.147.053.6CVPR20
ATSS [40]R-101-DCN24✓12.746.364.750.427.749.858.4CVPR20
ATSS [40]X-101-32x8d-DCN24✓6.947.766.652.129.350.859.7CVPR20
PAA [14]R-10124✓14.644.863.348.726.548.856.3ECCV20
PAA [14]R-101-DCN24✓12.747.465.751.627.951.360.6ECCV20
PAA [14]X-101-64x4d-DCN24✓6.949.067.853.330.252.862.2ECCV20
GFLV1 [18]R-5024✓19.443.162.046.826.046.752.3NeurIPS20
GFLV1 [18]R-10124✓14.645.063.748.927.248.854.5NeurIPS20
GFLV1 [18]R-101-DCN24✓12.747.366.351.428.051.159.2NeurIPS20
GFLV1 [18]X-101-32x4d-DCN24✓10.748.267.452.629.251.760.2NeurIPS20
GFLV2 (ours)R-5024✓19.444.362.348.526.847.754.1-
GFLV2 (ours)R-10124✓14.646.264.350.527.849.957.0-
GFLV2 (ours)R-101-DCN24✓12.748.366.552.828.851.960.7-
GFLV2 (ours)X-101-32x4d-DCN24✓10.749.067.653.529.752.461.4-
GFLV2 (ours)R2-101-DCN24✓10.950.669.055.331.354.363.5-
GFLV2 (ours) + \(MS_{test}\)R2-101-DCN24✓-53.370.959.235.756.165.6-
+ +Table 7: Comparisons between state-of-the-art detectors (single-model and single-scale results except the last row) on COCO test-dev. "MStrain" and "MStest" denote multi-scale training and testing, respectively. FPS values with * are from [44] or their official repositories [27], while others are measured on the same machine with a single GeForce RTX 2080Ti GPU under the same mmdetection [3] framework, using a batch size of 1 whenever possible. "n/a" means that both trained models and timing results from original papers are not available. R: ResNet [11]. X: ResNeXt [37]. HG: Hourglass [25]. DCN: Deformable Convolutional Network [46]. R2: Res2Net [8]. + +![](images/1a803d1c6c919783e6bda0e993223555f5f3176e7b968b926773745e818a4dd5.jpg) +Figure 7: Visualization of predicted bounding boxes before and after NMS, along with their corresponding predicted LQE scores (only Top-4 scores are plotted for a better view). For many existing approaches [33, 40, 18], they fail to produce the highest LQE scores for the best candidates. In contrast, our GFLV2 reliably assigns larger quality scores for those real high-quality ones, thus reducing the risk of mistaken suppression in NMS processing. White: ground-truth bounding boxes; Other colors: predicted bounding boxes. + +![](images/dceef20d5dc03555890f5ab9211bb6580f613f00ed1f80b045e4162e04cd9667.jpg) +Figure 8: Comparisons of losses on LQE between GFLV1 and GFLV2. DGQP helps to ease the learning difficulty with lower losses during training. + +DGQP in GFLV2 successfully accelerates the training process and converges to lower losses. + +Training/Inference Efficiency: We also compare the training and inference efficiency among recent state-of-the-art dense detectors in Table 8. Note that PAA [14], RepPointsV2 [4] and BorderDet [27] bring an inevitable time overhead (52%, 65%, and 22% respectively) during training, and the latter two also sacrifice inference speed by 30% and 14%, respectively. In contrast, our proposed GFLV2 can achieve top performance (~41 AP) while still maintaining the training and inference efficiency. + +Qualitative Results: In Fig. 7, we qualitatively demonstrate the mechanism how GFLV2 makes use of its more reliable IoU quality estimations to maintain accurate predictions during NMS. Unfortunately for other detectors, high-quality candidates are wrongly suppressed due to their relatively lower localization confidences, which eventually leads to a performance degradation. + +
MethodAPTraining Hours ↓Inference FPS ↑
ATSS* [40]39.98.219.4
GFLV1 [18]40.28.219.4
PAA [14]40.412.5 (+52%)19.4
RepPointsV2 [4]41.014.4 (+65%)13.5 (-30%)
BorderDet [27]41.410.0 (+22%)16.7 (-14%)
GFLV2 (ours)41.18.219.4
+ +Table 8: Comparisons of training and inference efficiency based on ResNet-50 backbone. "Training Hours" is evaluated on 8 GeForce RTX 2080Ti GPUs under standard 1x schedule (12 epochs). * denotes the application of Classification-IoU Joint Representation. + +# 5. Conclusion + +In this paper, we propose to learn reliable localization quality estimation, through the guidance of statistics of bounding box distributions. It is an entirely new and completely different perspective in the literature, which is also conceptually effective as the information of distribution is highly correlated to the real localization quality. Based on it we develop a dense object detector, namely GFLV2. Extensive experiments and analyses on COCO dataset further validate its effectiveness, compatibility and efficiency. We hope GFLV2 can serve as simple yet effective baseline for the community. + +# Acknowledgments + +The authors would like to thank the editor and the anonymous reviewers for their critical and constructive comments and suggestions. This work was supported by Postdoctoral Innovative Talent Support Program of China under Grant BX20200168, 2020M681608, NSFC 62072242, 61836014, U19B2034 and U1713208, Program for Changjiang Scholars. + +# References + +[1] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR, 2018. +[2] Jiale Cao, Yanwei Pang, Jungong Han, and Xuelong Li. Hierarchical shot detector. In ICCV, 2019. +[3] Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, et al. Mmdetection: Open mmlab detection toolbox and benchmark. arXiv preprint arXiv:1906.07155, 2019. +[4] Yihong Chen, Zheng Zhang, Yue Cao, Liwei Wang, Stephen Lin, and Han Hu. Reppoints v2: Verification meets regression for object detection. arXiv preprint arXiv:2007.08508, 2020. +[5] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017. +[6] Zhiwei Dong, Guoxuan Li, Yue Liao, Fei Wang, Pengju Ren, and Chen Qian. Centripetalnet: Pursuing high-quality keypoint pairs for object detection. In CVPR, 2020. +[7] Kaiwen Duan, Song Bai, Lingxi Xie, Honggang Qi, Qingming Huang, and Qi Tian. Centernet: Keypoint triplets for object detection. In ICCV, 2019. +[8] Shanghua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip HS Torr. Res2net: A new multi-scale backbone architecture. TPAMI, 2019. +[9] Ross Girshick. Fast r-cnn. In ICCV, 2015. +[10] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In ICCV, 2017. +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. +[12] Zhaojin Huang, Lichao Huang, Yongchao Gong, Chang Huang, and Xinggang Wang. Mask scoring r-cnn. In CVPR, 2019. +[13] Borui Jiang, Ruixuan Luo, Jiayuan Mao, Tete Xiao, and Yun-ting Jiang. Acquisition of localization confidence for accurate object detection. In ECCV, 2018. +[14] Kang Kim and Hee Seok Lee. Probabilistic anchor assignment with iou prediction for object detection. ECCV, 2020. +[15] Tao Kong, Fuchun Sun, Huaping Liu, Yuning Jiang, and Jianbo Shi. Foveabox: Beyond anchor-based object detector. arXiv preprint arXiv:1904.03797, 2019. +[16] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012. +[17] Hei Law and Jia Deng. Cornernet: Detecting objects as paired keypoints. In ECCV, 2018. +[18] 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 NeurlPS, 2020. +[19] Yanghao Li, Yuntao Chen, Naiyan Wang, and Zhaoxiang Zhang. Scale-aware trident networks for object detection. In ICCV, 2019. +[20] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017. + +[21] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In ICCV, 2017. +[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, 2014. +[23] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In ECCV, 2016. +[24] Xin Lu, Buyu Li, Yuxin Yue, Quanquan Li, and Junjie Yan. Grid r-cnn. In CVPR, 2019. +[25] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In ECCV, 2016. +[26] Jiangmiao Pang, Kai Chen, Jianping Shi, Huajun Feng, Wanli Ouyang, and Dahua Lin. Libra r-cnn: Towards balanced learning for object detection. In CVPR, 2019. +[27] Han Qiu, Yuchen Ma, Zeming Li, Songtao Liu, and Jian Sun. Borderdet: Border feature for dense object detection. ECCV, 2020. +[28] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, pages 779-788, 2016. +[29] Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. In CVPR, 2017. +[30] Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018. +[31] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. +[32] Guanglu Song, Yu Liu, and Xiaogang Wang. Revisiting the sibling head in object detector. In CVPR, 2020. +[33] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In ICCV, 2019. +[34] Lachlan Tychsen-Smith and Lars Petersson. Improving object localization with fitness nms and bounded iou loss. In CVPR, 2018. +[35] Jiaqi Wang, Wenwei Zhang, Yuhang Cao, Kai Chen, Jiangmiao Pang, Tao Gong, Jianping Shi, Chen Change Loy, and Dahua Lin. Side-aware boundary localization for more precise object detection. ECCV, 2020. +[36] Shengkai Wu, Xiaoping Li, and Xinggang Wang. Iou-aware single-stage object detector for accurate localization. Image and Vision Computing, 2020. +[37] Saining Xie, Ross Girshick, Piotr Dolkar, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017. +[38] Ze Yang, Shaohui Liu, Han Hu, Liwei Wang, and Stephen Lin. Repoints: Point set representation for object detection. In ICCV, 2019. +[39] Haoyang Zhang, Ying Wang, Feras Dayoub, and Niko Sünderhauf. Varifocalnet: An iou-aware dense object detector. arXiv preprint arXiv:2008.13367, 2020. +[40] Shifeng Zhang, Cheng Chi, Yongqiang Yao, Zhen Lei, and Stan Z Li. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In CVPR, 2020. + +[41] Xiaosong Zhang, Fang Wan, Chang Liu, Rongrong Ji, and Qixiang Ye. Freeanchor: Learning to match anchors for visual object detection. In NeurIPS, 2019. +[42] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. arXiv preprint arXiv:1904.07850, 2019. +[43] Benjin Zhu, Jianfeng Wang, Zhengkai Jiang, Fuhang Zong, Songtao Liu, Zeming Li, and Jian Sun. Autoassign: Differentiable label assignment for dense object detection. arXiv preprint arXiv:2007.03496, 2020. +[44] Chenchen Zhu, Fangyi Chen, Zhiqiang Shen, and Marios Savvides. Soft anchor-point object detection. In CVPR, 2020. +[45] Chenchen Zhu, Yihui He, and Marios Savvides. Feature selective anchor-free module for single-shot object detection. In CVPR, 2019. +[46] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In CVPR, 2019. \ No newline at end of file diff --git a/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/images.zip b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..00131c300c81840f24aef9b174aa3a3fae79585a --- /dev/null +++ b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce5257d92ca5f27dc0f1b2d148d20e5146f9d6e3ad9aecc3fe12783d4b9c96d2 +size 963769 diff --git a/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/layout.json b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..11e2910c5ca33cac1557cc6ebe8e26b90b565887 --- /dev/null +++ b/generalizedfocallossv2learningreliablelocalizationqualityestimationfordenseobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9389b164fa6dd23fe303a667bc5403a5d1dc81bba5cdc6e67110a2b674aa54e +size 368979 diff --git a/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_content_list.json b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4aa288cfddf97bf12778f37fb4afba45d7c20d7f --- /dev/null +++ b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05a387b817f9f4f9c2495be4ff6c0175b0e0907529b2fc2a6802b74229abbdc2 +size 80282 diff --git a/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_model.json b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_model.json new file mode 100644 index 0000000000000000000000000000000000000000..632251a4851311a2aa105763561e383da977df69 --- /dev/null +++ b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a10e4e88bebd3d4b95f36936953a1a81195db0b31fc60071298bfb35fd6547a8 +size 99512 diff --git a/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_origin.pdf b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..631c565e9fb45ec0e0ccc1116bdb254063357c5f --- /dev/null +++ b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/dea5c24d-3079-465b-aa6a-fc0736818581_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6fe8196a938343bae053801201608dc0b83aabf26ad72c8511968679d660389 +size 2097791 diff --git a/generalizingfaceforgerydetectionwithhighfrequencyfeatures/full.md b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5fc32db13899449e07e58903cafc4888b47bbcd5 --- /dev/null +++ b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/full.md @@ -0,0 +1,352 @@ +# Generalizing Face Forgery Detection with High-frequency Features + +Yuchen Luo\*1,2 + +Yong Zhang*3 + +Junchi Yan $^{\ddagger,2}$ + +Wei Liu†4 + +$^{1}$ Department of Computer Science and Engineering, Shanghai Jiao Tong University $^{2}$ MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University $^{3}$ Tencent AI Lab $^{4}$ Tencent Data Platform + +{592mcavoy,yanjunchi}@sjtu.edu.cn + +zhangyong201303@gmail.com + +w12223@columbia.edu + +# Abstract + +Current face forgery detection methods achieve high accuracy under the within-database scenario where training and testing forgeries are synthesized by the same algorithm. However, few of them gain satisfying performance under the cross-database scenario where training and testing forgeries are synthesized by different algorithms. In this paper, we find that current CNN-based detectors tend to overfit to method-specific color textures and thus fail to generalize. Observing that image noises remove color textures and expose discrepancies between authentic and tampered regions, we propose to utilize the high-frequency noises for face forgery detection. We carefully devise three functional modules to take full advantage of the high-frequency features. The first is the multi-scale high-frequency feature extraction module that extracts high-frequency noises at multiple scales and composes a novel modality. The second is the residual-guided spatial attention module that guides the low-level RGB feature extractor to concentrate more on forgery traces from a new perspective. The last is the cross-modality attention module that leverages the correlation between the two complementary modalities to promote feature learning for each other. Comprehensive evaluations on several benchmark databases corroborate the superior generalization performance of our proposed method. + +# 1. Introduction + +As face manipulation techniques [4, 24, 59] spring up along with the breakthrough of deep generators [27, 20], face forgery detection becomes an arousing research topic. Most existing methods focus on within-database detection [7, 29, 9], where forged images in the training set and testing set are manipulated by the same algorithm. However, the biggest challenge hampering face forgery detec + +![](images/fc3dfdd2cbcb964f61ebf4a2de53f3ed5a4eb4eec102cc78202570fa8adde3dc.jpg) +Figure 1: Training and testing forgeries of within-database detection are synthesized by the same algorithm while those of cross-database detection are synthesized by different algorithms. We focus on the latter which is more challenging. + +tion is the generalization problem. Due to the diversified data distributions generated by different manipulation techniques, methods with high within-database detection accuracy always experience a severe performance drop in the cross-database scenario, thus limiting broader applications. + +Recently, several works are devoted to addressing the generalizing problem. [30, 28] assume that some artifacts are shared in forged faces and customize databases specialized on those artifacts. However, these assumptions do not always hold. Besides, transfer learning [13], domain adaptation [54], and multi-task learning [14, 35, 45] are utilized to improve model's performance in unseen domains. Nevertheless, the acquisition of target samples and annotations is expensive. Meanwhile, some attempt to obtain information from frequency domains, such as Fourier transformation [11], DCT [38], and steganalysis features [52, 57]. But they rarely consider the relation and interaction between the additional information and regular color textures. + +In this paper, we aim at learning a more generalizable face forgery detector (See Fig. 1). To facilitate understanding why current CNN-based works fail on unseen forgeries, we analyze CNN-based classifiers' behaviors and find that + +the model is biased to method-specific color textures. Observing that high-frequency noises can suppress image textures and expose statistical discrepancies between tampered and authentic regions, we propose to utilize noises to tackle the overfitting problem. + +We propose a generalizable model for face forgery detection. To take full advantage of image noises, we carefully devise three novel modules. The first is the multiscale high-frequency feature extraction module. We adopt the widely used high-pass filters from SRM [18] to extract high-frequency noises from images. Unlike [11, 52, 57] that only consider extracting noises from an input image, we further apply these filters to low-level features at multiple scales to compose more abundant and informative features. Employing both the high-frequency noises and the low-frequency textures, we build a two-stream network to process the two modalities, respectively. Secondly, we apply the residual guided spatial attention in the entry part to guide the RGB modality from the residual perspective to attach more importance to forgery traces. Thirdly, we design a dual cross-modality attention module to formulate the interaction between the two modalities instead of keeping them independent [11, 52]. In this way, the two modalities provide complementary information based on their correlation and mutually promote representation learning. + +Our contributions are summarized as follows: + +- We perform an analysis on CNN-based detectors and find that they are biased to method-specific textures, leading to the generalization problem. Given that the image's high-frequency noises can remove color textures and reveal forgery traces, we propose to utilize image noises to boost the generalization ability. +- We devise a generalizable model by exploiting high-frequency features and modeling the correlation and interaction between the high-frequency modality and the regular one. We design three functional modules for learning an adequate representation, i.e., the multiscale high-frequency feature extraction module, the residual guided spatial attention module, and the dual cross-modality attention module. +- We conduct comprehensive evaluations on several benchmarks and demonstrate the superior generalization ability of the proposed model. + +# 2. Related Work + +Conventional image forgery detection. Though image tampering detection has been investigated for a long time, those conventional detectors [16, 39] cannot handle the detection of face forgery well. Firstly, those methods detect image editing operations like copy-move or copy-paste [8], which produce different artifacts from those in GAN-based + +face forgeries. Besides, face forgeries have a much smaller size and inferior quality than natural images. Furthermore, recent advanced forgery techniques leave almost no visible artifact in the tampered face, which easily deceive conventional detectors and require specialized treatments. + +Specific artifacts or novel architectures. Current attempts mainly focus on improving within-database performance. [29, 34, 55, 9, 7, 32] targeted at specific artifacts such as abnormal eye-blinking frequency [29] or head-pose inconsistency [55]. However, those artifacts may not exist in improved forgeries. For network design, Afchar et al. [6] provided two compact network architectures to capture the mesoscopic features. Nguyen et al. [36] introduced the capsule network. These methods emphasize the power of representation and computational efficiency but did not explicitly consider the generalization ability. + +Auxiliary tasks or synthetic data. Some works notice the generalization problem and attempt to utilize additional tasks [14, 35, 45, 44] or generate samples capturing the typical defects [30, 28, 54]. Stehouwer et al. [45] proposed to jointly predict the binary label and the attention map of the manipulated region. Yang et al. [54] generated samples with similar distributions to those in the target domain. These methods require additional annotations or extra data samples. Li et al. [30] observed that forged images contain some common warping and blurring effects. Li et al. [28] focused on the fusion operation in forgery creation. Both of them customized a database to learn such artifacts, but there remain non-negligible gaps between the hand-crafted forgeries and those from sophisticated algorithms. + +High-frequency features. Several methods tried to exploit information from other domains. Durall et al. [15] found that the spectrum of real and fake images distributes differently in the high-frequency part. Chen et al. [11] proposed a multi-stream design and leveraged the DFT features. Wu et al. [52] proposed a two-stream network to extract spatial features and steganalysis features, respectively. Qian et al. [38] applied DCT on images and collected the frequency-aware clues to mine subtle forgery artifacts and compression errors. These methods exploited frequency information but did not explicitly consider the relationship between different domains. + +# 3. Analysis of Generalizable Forgery Detector + +# 3.1. Why current methods fail to generalize? + +CNN and texture bias. Although many previous methods perform flawlessly on the testing set, they always suffer from a significant performance drop on images manipulated by unseen algorithms (See Tab. 1). Why do they fail to generalize? The reason is that those deep CNN models learn to capture the method-specific texture patterns for forgery + +![](images/2cc0087abdcef8f2797834e5712acf7be63469478529cbc5b27e666783ebe22a.jpg) +Figure 2: Grad-CAM maps from the Xception model trained on F2F forgeries. Numbers in the bracket denote the probability of being classified as fake. The mouth region is especially highlighted in F2F images, indicating that the model learns F2F's specific texture. But when evaluated on unseen forgeries (i.e., NT, DF, and FS), the model's responses resemble those in the real face more, showing that it fails to recognize identical artifacts and mistakes these forgeries as real. + +Table 1: Xception [12] detector experiences a significant performance drop when evaluated on unseen forgeries. + +
Training SetTesting Set (AUC)
DFF2FFSNT
DF0.9930.7360.4850.736
F2F0.8030.9940.7620.696
FS0.6640.8880.9940.713
NT0.8000.8130.7310.991
+ +detection [32]. Geirhos et al. [19] studied the texture response of CNNs and showed that CNN models are strongly biased to textures. Different forgery algorithms always have unique network architectures and processing streams, so images manipulated by different algorithms will have different fake textures. Therefore, it is hard for a CNN model that has already been biased to one kind of fake textures to generalize to another. + +Grad-CAM study and results. To verify that the CNN classifier is biased to specific fake textures, we exploit the gradient-based visualization tool [42] to generate class activation maps, namely Grad-CAM maps, which reveal the regions that CNNs rely on for classification. We train Xception [12] on images forged by the Face2Face method and then evaluate it on forgeries of four different algorithms. + +As presented in Fig. 2, in the within-database evaluation, the model correctly finds out forgeries with high confidence. It especially concentrates on regions around the mouth (warmer color region), just as it does on the training images. Nevertheless, when encountering unseen forgeries, the model mistakes the other three kinds of fakes as real though they contain many visible artifacts. Besides, the high response regions deviate significantly from those in the training set and resemble those in the real face. The reason is that the model has overfitted to F2F's unique fake textures. Thus, when it cannot recognize the identical fake texture patterns, it always gives wrong predictions. + +![](images/27defb6a0a4044a187c0fab5c6e2149a13377be86e5aa1133a8adc966ec6d155.jpg) +Figure 3: The overview of the typical manipulation pipeline. The two stages bring the method-specific texture artifacts and characteristics discrepancy, respectively. + +The above observation motivates us to investigate more general clues other than the texture patterns. + +# 3.2. What is common in forged face images? + +Manipulation pipeline. To find the commonality among different manipulation methods, let us review the typical face manipulation pipeline firstly. As presented in Fig. 3, the manipulation procedure can be roughly divided into two processing stages, i.e., fake face creation and face blending. In the first stage, fake faces are generated by sophisticated deep networks [46, 3] or rendered based on model templates [47, 5]. Different manipulation methods always adopt different algorithms and thus produce varied texture patterns. In the second stage, the generated face is further refined and warped back to the original image. This stage usually consists of some post-processing operations such as color correction and image blending. + +Discrepancy brought by forged part. Though the face region in the output image is manipulated, the background remains the same as in the source image (See Fig. 3). Assuming that different images have unique characteristics, the blending stage violates the original data distributions, and we can utilize the characteristics discrepancy to gener + +![](images/c81d12de27fbc080f3341826adc50bdb0fd960182bea1d5f524db8d98f1e34fb.jpg) +Figure 4: Noises extracted by SRM from (a) authentic face and face manipulated by (b) Deepfakes and (c) Face2Face. Red boxes mark blending traces that are hard to recognize in the RGB space but distinctive in the noise space. Blue boxes mark noise statistics in the central face region. Noises in the face region distribute continuously in authentic images but are visibly smoother or sharper in tampered images. + +alize forgery detection. We share a similar intuition to [28], which focuses on the blending operation and detects the blending boundary. But instead of identifying the boundary pattern which may change with various post-processing operations, we expect a more robust way to discover the inconsistency between authentic and tampered regions. + +# 3.3. Use SRM to extract high-frequency noise features and boost the generalization ability + +Based on the above analysis, we assume that a generalizable forgery detector should (i) pay attention not only to texture-related features but also to texture-irrelevant ones, and (ii) be capable of discovering the discrepancy between the tampered face and pristine background. Observing that the image's high-frequency noises remove the color content while portrait the intrinsic characteristics, we attempt to utilize image noises for face forgery detection. + +Image Noise Analysis. Noises are some high-frequency signals capturing random variations of brightness or color information. The distributions of image noises are influenced by the image sensor or circuitry of a digital camera. Hence images processed by different equipment or coming from different sources have different noise patterns. Noises can be viewed as an intrinsic specificity of an image and can be found in various forms in all digital imagery domains [25]. Given that manipulation operations ruin the consistency of characteristics in the original image, there often leave distinctive traces in the noise space [17, 33]. + +SRM for noise feature extraction. Inspired by recent progress on SRM [18] noise features in general image manipulation detection [58, 53], we adopt SRM filters for noise + +extraction. Fig. 4 shows some examples of SRM noises. + +To validate noise features' effectiveness, we compare the detection performance on RGB color textures and SRM noises features, respectively. We train two Xception models, one with the regular RGB images and the other with the SRM noises. The two models are trained on images forged by the F2F method and evaluated on all four methods. As presented in the first two rows in Tab. 3, the model with SRM noise generalizes better than that with the regular color textures, especially on FS and NT methods. + +# 4. The Proposed Method + +The promising performance of SRM noises motivates us to explore the noise space further and boost generalization. In this section, we devise three modules to take full advantage of the high-frequency features, i.e., a multi-scale high-frequency feature extraction module, a dual cross-modality attention module, and a residual guided spatial attention module. The proposed model is illustrated in Fig. 5. + +# 4.1. Multi-scale High-frequency Feature Extraction + +Previous methods [57, 53, 11] extract noise residuals solely from the input image. Apart from a straight-forward conversion of the input image, we apply high-pass filters to multiple low-level feature maps to enrich the high-frequency features. As shown in Fig. 5, given an input RGB image $\mathbf{X}$ , we convert it to a residual image $\mathbf{X}_h$ in the high-frequency domain exploiting the SRM filters [18]. The entry flow takes both $\mathbf{X}$ and $\mathbf{X}_h$ as input and generates two types of raw features, i.e., the multi-scale high-frequency feature maps $\mathbf{F}_h$ and the low-frequency spatial feature maps $\mathbf{F}$ , which can be formulated as + +$$ +\mathbf {F}, \mathbf {F} _ {h} = f _ {\text {e n t r y}} (\mathbf {X}, \mathbf {X} _ {h}). \tag {1} +$$ + +The multi-scale high-frequency features are obtained as follows. Firstly, we apply regular convolutions on $\mathbf{X}$ and $\mathbf{X}_h$ to produce feature maps $\mathbf{F}^1$ and $\mathbf{F}_h^1$ . To extract more high-frequency information, we then apply SRM filters on $\mathbf{F}^1$ , following a $1\times 1$ convolution to align the channel dimensions and get the output $\tilde{\mathbf{F}}_h^1$ . As $\mathbf{F}_h^1$ and $\tilde{\mathbf{F}}_h^1$ are obtained from different sources and different operations, they contain different information. We down-sample $\mathbf{F}_1$ as well as the sum of $\mathbf{F}_h^1$ and $\tilde{\mathbf{F}}_h^1$ , and then get $\mathbf{F}^2$ and $\mathbf{F}_h^2$ in the two streams, respectively. Repeating the above operations, we finally acquire the multi-scale high-frequency feature maps $\mathbf{F}_h$ . Compared with $\mathbf{X}_h$ , $\mathbf{F}_h$ embodies more abundant high-frequency signals from both the image and low-level feature maps at multiple scales. + +# 4.2. Residual Guided Spatial Attention + +Inspired by CBAM [51], we adopt spatial attention to highlight the manipulation traces and guide the feature + +![](images/ea55882033d48c363697cf12996959a1e01ad6465ed388a263ebfbe3c85623fc.jpg) +Figure 5: The pipeline of the proposed model. We design a two-stream architecture to process the RGB image and the high-frequency noises. In the entry flow, we extract multi-scale high-frequency features and residual guided spatial features. In the middle flow, we model the interaction between feature maps of the two modalities via several DCMA modules. Features from the two streams are fused in an attention-based manner for the final classification. + +![](images/468645a6a1be408386ac7a04c7b16e9bc582497a7b17dffea3b9ff8157c1f9d1.jpg) +Figure 6: The residual guided spatial attention. + +learning in the RGB modality. While CBAM derives the attention weights from the RGB image, we exploit the residuals generated by the SRM filters to predict the attention maps, which guide from a high-frequency perspective (See Fig. 6). Considering that the spatial correspondence between the noise residuals and low-level RGB features is still well maintained, we place several spatial attention modules in the entry part. The residual guided spatial attention block is defined as + +$$ +\mathbf {M} = f _ {\text {a t t}} \left(\mathbf {X} _ {h}\right), \tag {2} +$$ + +where $\mathbf{M}$ is the output attention map and $\mathbf{X}_h$ is the residual image. The raw feature maps $\mathbf{F}$ in Eq. (1) are computed by feeding the element-wise production $\mathbf{M} \odot \mathbf{F}^2$ into consequent convolutions and down-sampling operations. + +See the attention visualizations in Fig. 8, high responses occur around abnormal facial boundaries in manipulated faces but distribute uniformly in real ones, which implies + +![](images/0c5c07f9c7229d1f7d2d3fa462b8ec55a6a90f5ab77079db375b91e31e81aac5.jpg) +Figure 7: The dual cross-modality attention. + +that the residual guided spatial attention can help feature extractor focus on forgery traces. + +# 4.3. Dual Cross-modality Attention + +The attention mechanism has been broadly applied in natural language processing [48] and computer vision [22, 37, 23]. As for the cross-modality attention, Ye et al. [56] applied self-attention to concatenated features, while Hou et al. [21] derives correlation-based attention for paired class and query features. Inspired by these works, we devise a dual cross-modality attention module (DCMA) to capture long-range dependency and model the interaction between the low-frequency textures and the high-frequency noises. + +Denoting input features derived from the RGB stream and the high-frequency stream as $\mathbf{T}$ and $\mathbf{T}_h$ , respectively, + +the DCMA module leverages the computation block described in Fig. 7 to convert them to $\mathbf{T}'$ and $\mathbf{T}_h'$ : + +$$ +\mathbf {T} ^ {\prime}, \mathbf {T} _ {h} ^ {\prime} = f _ {\mathrm {D C M A}} (\mathbf {T}, \mathbf {T} _ {h}). \tag {3} +$$ + +Taking the conversion of $\mathbf{T}$ as an example, we first convert the input $\mathbf{T} \in \mathbb{R}^{C \times H \times W}$ into two components through different convolution blocks. One value component $\mathbf{V} \in \mathbb{R}^{C \times H \times W}$ represents the domain-specific information, the other key component $\mathbf{K} \in \mathbb{R}^{C / r \times \bar{H} \times W}$ measures the correlation between two different domains. $r$ is a scalar that reduces $\mathbf{K}$ 's channel dimension for computation efficiency. Input features $\mathbf{T}_h \in \mathbb{R}^{C \times H \times W}$ in the high-frequency domain are converted into two components, i.e., $\mathbf{V}_h$ and $\mathbf{K}_h$ , similarly. Note that the key component is obtained through a two-layer convolution block. We set the first layer independently while sharing the second layer to project feature maps from the two modalities onto the same space. + +Then we measure the correlation $\mathbf{C} \in \mathcal{R}^{HW \times HW}$ between the two modalities through $\mathbf{C} = \mathrm{flt}(\mathbf{K})^T \otimes \mathrm{flt}(\mathbf{K}_h)$ , where $\mathrm{flt}(\cdot)$ denotes the flatten operation and $\otimes$ denotes matrix multiplication. For the RGB attention, we multiply the correlation $\mathbf{C}$ with weight matrix $\mathbf{W}$ and generate the attention map $\mathbf{A}$ through the softmax operation, which is formulated as $\mathbf{A} = \operatorname{softmax}(\mathbf{C} \otimes \mathbf{W})$ . Similarly, we obtain the high-frequency attention map $\mathbf{A}_h = \operatorname{softmax}(\mathbf{C}^T \otimes \mathbf{W}_h)$ . $\mathbf{A}$ and $\mathbf{A}_h$ re-weight features in one modality according to its correlation with the other. + +Applying $\mathbf{A}$ to the corresponding value component $\mathbf{V}_h$ , we obtain the refined features $\mathbf{R}$ , where $\mathbf{R} = \mathrm{flt}(\mathbf{V}_h) \otimes \mathbf{A}$ . We then recover $\mathbf{R}$ to the input dimension, and output the features $\mathbf{T}'$ of the RGB stream by $\mathbf{T}' = \mathbf{T} + \mathbf{R}$ . The calculation for features $\mathbf{T}_h'$ in the high-frequency stream is the same. $\mathbf{T}'$ and $\mathbf{T}_h'$ embody complementary information and promote the feature learning for each other. As shown in the pipeline, the DCMA module can be applied $N$ times to model the correlations between the two modalities at different scales. We set $N = 2$ in our experiments. + +Feature Fusion and Loss Function. High-level features of the two modalities are fused at the end of the exit flow (See Fig. 5). We apply channel-wise attention [22] on the concatenated features and then make the prediction. Inspired by progress in face recognition [50, 43], we adopt the AM-Softmax Loss [49] as the objective function since it leads to smaller intra-class variations and larger inter-class differences than the regular cross-entropy loss. + +# 5. Experiments + +# 5.1. Settings + +Datasets. To evaluate the generalization ability, we perform experiments on five large scale benchmark databases, i.e., FaceForensics++ (FF++) [40], DeepfakeDetection + +Table 2: Specifications of benchmark databases. + +
DatabaseVideo ScaleManipulation Algorithm
FF++ [40]1000 real, 4000 fakeDF [3], FS [5], NT [46], F2F [47]
DFD [2]363 real, 3068 fakeImproved DF
CelebDF [31]408 real, 795 fakeImproved DF
DFDC [1]1133 real, 4080 fakeUnpublished
DF1.0 [24]11,000 fakeDF-VAE [24]
+ +Table 3: Ablation study on $\mathrm{FF} + +$ . The metric is AUC. Results in gray indicate the within-dataset performance. + +
MethodDFF2FFSNT
RGB0.8030.9940.7620.696
SRM0.7580.9940.9130.858
Two-stream Fusion (Fusion)0.8100.9940.9220.894
Fusion + RSA0.8190.9950.9660.927
Fusion + RSA + DCMA0.8010.9950.9750.957
Fusion + RSA + DCMA + Multi-scale0.8370.9940.9870.984
+ +(DFD) [2], Deepfake Detection Challenge (DFDC) [1], CelebDF [31], and DeeperForensics-1.0 (DF1.0) [24]. Detailed specifications are presented in Tab. 2. For evaluation on $\mathrm{FF}++$ , we follow the official splits by using 740 videos for training, 140 videos for validation, and 140 videos for testing. There are three versions of $\mathrm{FF}++$ in terms of compression level, i.e., raw, lightly compressed (HQ), and heavily compressed (LQ). The heavier the compression level, the harder it to distinguish the forgery traces. Since realistic forgeries always have a limited quality, we use the HQ and LQ versions in experiments. We adopt the HQ version by default and specify the version otherwise. + +Implementation. We modify Xception [12, 40] as the backbone network. We use DLIB [41] for face extraction and alignment and resize the aligned faces to $256 \times 256$ . Model parameters are initialized by Xception pre-trained on ImageNet. The batch size is set to 32. Adam [26] is used for optimization with a learning rate of 0.0002. Details of the two-stream network structure and training settings are presented in the supplementary material. + +# 5.2. Ablation Study + +To demonstrate the benefit of each module, we evaluate the proposed model and its variants on the $\mathrm{FF + + }$ database. All models are trained on F2F and examined on all four datasets. The results are presented in Tab. 3. RGB represents the Xception baseline with RGB images as input. SRM denotes the modified model with the input image replaced by SRM noise residuals. Two-stream Fusion represents the basic two-stream model, which consists of an RGB stream and a high-frequency noise stream and adopts the attention-based fusion mechanism. RSA, DCMA, and Multi-scale represent the residual guided spatial attention module, the dual cross-modality attention module, and the multi-scale high-frequency feature extraction module. + +![](images/18fd43a6e12c7241870ccb4bc0372038a05687a6e911bcaf99b723241a2d58f4.jpg) + +![](images/dca0b37f8da9196db499f8cbc656d29e618e66f86b53a34aba91449fd424fe3d.jpg) + +![](images/0c1ce00014c79d5203bd4d418d79ba98c87aa2bb85865eaf99dc76395e29af9f.jpg) + +![](images/980a29a2e29e612c404d943c7ea942f53a6296d67f70f10d7af82724e95cdfe3.jpg) +Figure 8: Examples of the residual guided attention. High responses occur around abnormal facial boundaries in manipulated faces while distribute uniformly in real ones. + +![](images/8dbf7e53861a830e421b5d0afe41a307fd64c2d27f83db1f823b1667edad9acb.jpg) + +![](images/92e2a33c1677879f7506f5070595a999238043e09e4c9c2a985ba7348513b5f1.jpg) + +![](images/d8bf4efd44dbff5578ed5b6eaf2e6e7d268499996b02a5b07a7efff264e63b76.jpg) + +![](images/53342d577a9c5da0d3c5476eab7d1a0df04d7eeb393be12bc1b4832f14cffde2.jpg) + +![](images/66f267469bf16e3b446aa09349f1eb15b0f101de6f60ff30e97045b41fb3db39.jpg) + +![](images/e13405cc1fb5b2fa9dc8fe64c5aeb21534e1ebf22ffb75c62c3978296497770c.jpg) + +![](images/c57169b9f4c78d0596105b5934f972836f395ce06d523fb2790631ca129b9ca7.jpg) + +![](images/c3f6359b6e015a59d413076bc303dd1a1fcb4ce3d760a4da296c4d7ab47e3817.jpg) + +![](images/3d9b2b827bf1b2eadb19b477bda8638f9df241bdd027c2f485d5678c9a82458e.jpg) +Attention + +![](images/7fc02f6ca04a1620caf9e9c08b538b57b4e0f23c208189f89b8f5dad86a035d0.jpg) + +![](images/3993cee9d5262c982645aa2ba1adaffaf3bc38800fb4b5d837936c7c257c8ddf.jpg) + +![](images/2784f517655903b0786a388d952f6826434569939b7f04a682693a1709d02e4f.jpg) + +![](images/0f070ff852c3a9c8dc4fab086ba750e62e26f16cf4e055294470638361ae3218.jpg) +Real + +![](images/2644af40f861c1dbb80d42c64f34190aae9e9f19c0483f2190a8c2699c3122d9.jpg) + +![](images/6c819a0bff36c0d3bde8e72f5bd7b14674f2ab4c5fac82c55f7cabda29450701.jpg) + +![](images/0067ccc6057ba083a0bfaaa9de04c20b46c926c6e5185b118b2e930e44b18f74.jpg) + +![](images/52211644cea74568e6bb17199859dfc97cbaa86c1f18c253bb4e347bdb492fae.jpg) +Attention + +![](images/dafada9f463509be2014f41d4f3a7bf4cf5ab3636fdedc7aefa6e15680917746.jpg) + +![](images/484925829408ece3a041ce218ddbb519e36891fd8b2b3c09b15cdbb13c026964.jpg) + +![](images/6d22e27437ed9ffc4e47760a38a44d77deb0ea2be4eaa17ba551e5d6401206c1.jpg) + +Table 4: Cross-database evaluation on FF++ database (HQ). + +
Training SetModelTesting Set (AUC)
DFF2FFSNT
DFXception [40]0.9930.7360.4900.736
Face X-ray [28]0.9870.6330.6000.698
Ours0.9920.7640.4970.814
F2FXception [40]0.8030.9940.7620.696
Face X-ray [28]0.6300.9840.9380.945
Ours0.8370.9940.9870.984
FSXception [40]0.6640.8880.9940.713
Face X-ray [28]0.4580.9610.9810.957
Ours0.6850.9930.9950.980
NTXception [40]0.7990.8130.7310.991
Face X-ray [28]0.7050.9170.9100.925
Ours0.8940.9950.9930.994
+ +Table 5: Cross-database evaluation from FF++ to others. + +
TrainingModelTesting AUC
DFDDFDCCelebDFDF1.0
FF++Xception [40]0.8310.6790.5940.698
Face X-ray [28]0.8560.7000.7420.723
Ours0.9190.7970.7940.738
+ +From this experiment we get the following observations. Firstly, compared with RGB, SRM achieves better performance on FS and NT. Furthermore, the basic two-stream model outperforms both RGB and SRM on all datasets, indicating the two modalities' complementary nature. As presented in the last three rows, the model's performance gradually improves with each module added step-by-step, demonstrating each module's effectiveness. + +# 5.3. Generalization Ability Evaluation + +To fully evaluate the proposed model's generalization ability, we conduct extensive cross-database evaluations in two different settings. The model is compared against two competing methods, Xception [40] and Face X-ray [28]. Face X-ray attempts to detect the fusion boundary brought by the blending operation. We implement it rigorously following the companion paper's instructions and train these models under the same setting. + +Generalize from one method to another. We conduct this experiment on the FF++ (HQ) database [40] that contains forged images from four different manipulation techniques, i.e., DeepFakes (DF) [3], Face2Face (F2F) [47], FaceSwap (FS) [5], and NeuralTextures (NT) [46]. We use forged images of one method for training and those of all four methods for testing. As shown in Tab. 4, our model exceeds the competitors in most cases. Since Xception overly relies on the texture patterns, its performance drops drastically in unseen forgeries. Face X-ray achieves a relatively better generalization ability as it detects the blending evidence. Our model leverages both textures and noises and captures the blending effects in the noise space, therefore generalizing better from one method to another. + +Generalize from $\mathbf{F}\mathbf{F} + +$ to other databases. In this experiment, we train models on $\mathrm{FF} + +$ (HQ) [40] and evaluate them in DFD [2], DFDC [1], CelebDF [31], and DF1.0 [24], respectively. This setting is more challenging than the first one since the testing sets share much less similarity with the training set. We can see from Tab. 5 that our method achieves apparent improvements over Xception and Face + +X-ray on all the databases, especially on DFD, DFDC, and CelebDF. This is because Face X-ray learns to identify the boundary patterns that are sensitive to the post-process operations varying in different databases. On the contrary, our model learns more robust representations. + +We present more statistics on the cross-database evaluation and the comparison result with Face X-ray on the blend face (BI) dataset in the supplementary material. + +# 5.4. Comparison with recent works + +Comparison with methods utilizing high-frequency features. We first compare with methods exploiting high-frequency features, i.e., SRMNet [58], Bayar Conv [10], SSTNet [52], and F3Net [38]. The former three methods target video forges and share the same backbone but different high-pass filters, i.e., SRM filters, Bayar Conv filters, and loosely-constrained residual filters. F3Net adopts Discrete Cosine Transform to estimate frequency statistics. We follow their setting and perform video-level detection on the highly compressed (LQ) FF++ database. Since our model is trained at the image level, we sample 1 frame every five frames to collect a total of 25 images for each video. Then we average the predictions over sampled images to classify each video. Results are presented in Tab. 6. Note that we compare against F3Net with the Xception backbone for a fair comparison. Our method achieves comparable robustness with F3Net and better performance than the others. + +Comparison with methods using multi-task learning. We then compare our model against several methods that adopt multi-task learning for a better generalization ability, including LAE [14], ClassNSeg [35], and Forensic-Trans [13]. These three methods perform forgery localization and classification simultaneously. Note that Forensic-Trans adopts image residuals as input and needs to be finetuned on a few samples from the target domain. Following these methods, we train our model on F2F and test it on both F2F and FS. The results of the competing methods are the reported statistics in the corresponding papers. As illustrated in Tab. 7, our method surpasses the competitors in both within-database and cross-database evaluations. + +Comparison with other state-of-the-art methods. We further compare our model with FWA [30] and FFD [45]. FWA focuses on post-processing artifacts such as blurring and warping effects, and it is trained on synthetic data which mimics those artifacts explicitly. FFD exploits annotated forgery masks to provide supervision on attention maps. Note that FFD is trained on the DFFD [45] database, which contains $\mathrm{FF} + +$ and forges from other manipulation algorithms. We adopt CelebDF as the testing set. As shown in Tab. 8, our method outperforms the competing methods by more than $15\%$ in AUC. + +Table 6: Comparison on $\mathrm{FF}++$ with methods using high-frequency features. The metric is accuracy. + +
ModelTraining/Testing Set (LQ)
DFF2FFSReal
SRMNet [58]0.9190.9270.8910.693
Bayar Conv [10]0.9290.9460.8970.755
SSTNet [52]0.9340.9190.9190.793
F3Net [38]0.9800.9530.965-
Ours0.9860.9570.9290.971
+ +Table 7: Comparison with recent works using multi-task learning. The metric is accuracy. + +
Training SetModelTesting Set (Acc)
FS(HQ)F2F(HQ)
F2F(HQ)LAE [14]0.6320.909
ClassNSeg [35]0.5410.928
ForensicTrans [13]0.7260.945
Ours0.8670.992
+ +Table 8: Comparison on CelebDF. The metric is AUC. + +
ModelTraining SetTesting AUC on CelebDF
FWA [30]self-collected0.538
FFD [45]DFFD [45]0.644
OursFF++(HQ)0.794
+ +# 6. Conclusion + +In this paper, we conducted studies on the CNN-based forgery detector, finding that the CNN detector is easily overfitted to method-specific texture patterns. To learn more robust representations, we proposed to utilize the image's high-frequency noise features, which remove the color textures and reveal forgery traces. We leveraged both the color textures and the high-frequency noises and proposed a new face forgery detector. Three functional modules were carefully devised, i.e., a multi-scale high-frequency feature extraction module, a residual guided spatial attention module, and a dual cross-modality attention module. We employed the proposed modules to extract more informative features and capture the correlation and interaction between complementary modalities. The comprehensive experiments demonstrate the effectiveness of each module, and the comparisons with the competing methods further corroborate our model's superior generalization ability. + +# Acknowledgement + +This work was partly supported by the National Key Research and Development Program of China (2018AAA0100704), NSFC (61972250, U19B2035), CCF-Tencent Open Fund (RAGR20200113), and Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102). + +# References + +[1] Deepfake detection challenge. https://www.kaggle.com/c/deepfake-detection-challenge. Accessed: 2020-05-10. 6, 7 +[2] Deepfakedetection. https://ai.googleblog.com/2019/09/contributing-data-to-deepfake-detection.html. Accessed: 2020-05-10. 6,7 +[3] Deepfakes. https://github.com/iperov/DeepFaceLab. Accessed: 2020-05-10. 3, 6, 7 +[4] Faceapp. https://www_faceapp.com/. Accessed: 2020-05-10.1 +[5] Faceswap. https://github.com/MarekKowalski/FaceSwap. Accessed: 2020-05-10.3,6,7 +[6] Darius Afchar, Vincent Nozick, Junichi Yamagishi, and Isao Echizen. Mesonet: a compact facial video forgery detection network. In WIFS, 2018. 2 +[7] Shruti Agarwal, Hany Farid, Yuming Gu, Mingming He, Koki Nagano, and Hao Li. Protecting world leaders against deep fakes. In CVPRW, 2019. 1, 2 +[8] Irene Amerini, Lamberto Ballan, Roberto Caldelli, Alberto Del Bimbo, and Giuseppe Serra. A sift-based forensic method for copy-move attack detection and transformation recovery. TIFS, 2011. 2 +[9] Irene Amerini, Leonardo Galteri, Roberto Caldelli, and Alberto Del Bimbo. Deepfake video detection through optical flow based cnn. In ICCVW, 2019. 1, 2 +[10] Belhassen Bayar and Matthew C Stamm. A deep learning approach to universal image manipulation detection using a new convolutional layer. In Proceedings of the 4th ACM Workshop on Information Hiding and Multimedia Security, pages 5-10, 2016. 8 +[11] Zehao Chen and Hua Yang. Manipulated face detector: Joint spatial and frequency domain attention network. arXiv preprint arXiv:2005.02958, 2020. 1, 2, 4 +[12] F. Chollet. Xception: Deep learning with depthwise separable convolutions. In CVPR, 2017. 3, 6 +[13] Davide Cozzolino, Justus Thies, Andreas Rössler, Christian Riess, Matthias Nießner, and Luisa Verdoliva. Forensictransfer: Weakly-supervised domain adaptation for forgery detection. arXiv preprint arXiv:1812.02510, 2018. 1, 8 +[14] Mengnan Du, Shiva Pentyala, Yuening Li, and Xia Hu. Towards generalizable forgery detection with locality-aware autoencoder. arXiv preprint arXiv:1909.05999, 2019. 1, 2, 8 +[15] Ricard Durall, Margret Keuper, Franz-Josef Pfreundt, and Janis Keuper. Unmasking deepfakes with simple features. arXiv preprint arXiv:1911.00686, 2019. 2 +[16] Hany Farid. Image forgery detection. IEEE Signal processing magazine, 2009. 2 +[17] J. Fridrich. Digital image forensics. IEEE Signal Processing Magazine, 26(2):26-37, 2009. 4 +[18] Jessica Fridrich and Jan Kodovsky. Rich models for steganalysis of digital images. TIFS, 2012. 2, 4 +[19] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. + +Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019. 3 +[20] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. 1 +[21] Ruibing Hou, Hong Chang, MA Bingpeng, Shiguang Shan, and Xilin Chen. Cross attention network for few-shot classification. In NIPS, 2019. 5 +[22] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, 2018. 5, 6 +[23] Zilong Huang, Xinggang Wang, Lichao Huang, Chang Huang, Yunchao Wei, and Wenyu Liu. Ccnet: Criss-cross attention for semantic segmentation. In ICCV, October 2019. 5 +[24] 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 CVPR, 2020. 1, 6, 7 +[25] Thibaut Julliand, Vincent Nozick, and Hugues Talbot. Image noise and digital image forensics. volume 9569, pages 3-17, 03 2016. 4 +[26] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. *ICLR*, 2015. 6 +[27] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. *ICLR*, 2014. 1 +[28] Lingzhi Li, Jianmin Bao, Ting Zhang, Hao Yang, Dong Chen, Fang Wen, and Baining Guo. Face x-ray for more general face forgery detection. CVPR, 2020. 1, 2, 4, 7 +[29] Yuezun Li, Ming-Ching Chang, and Siwei Lyu. In ictu oculi: Exposing ai created fake videos by detecting eye blinking. In WIFS, 2018. 1, 2 +[30] Yuezun Li and Siwei Lyu. Exposing deepfake videos by detecting face warping artifacts. CVPRW, 2019. 1, 2, 8 +[31] Yuezun Li, Xin Yang, Pu Sun, Honggang Qi, and Siwei Lyu. Celeb-df: A new dataset for deepfake forensics. arXiv preprint arXiv:1909.12962, 2019. 6, 7 +[32] Z. Liu, X. Qi, and P. H. S. Torr. Global texture enhancement for fake face detection in the wild. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8057-8066, 2020. 2, 3 +[33] Babak Mahdian and Stanislav Saic. Using noise inconsistencies for blind image forensics. Image and Vision Computing, 27(10):1497 - 1503, 2009. Special Section: Computer Vision Methods for Ambient Intelligence. 4 +[34] Falko Matern, Christian Riess, and Marc Stamminger. Exploiting visual artifacts to expose deepfakes and face manipulations. In WACVW, 2019. 2 +[35] Huy H Nguyen, Fuming Fang, Junichi Yamagishi, and Isao Echizen. Multi-task learning for detecting and segmenting manipulated facial images and videos. arXiv preprint arXiv:1906.06876, 2019. 1, 2, 8 +[36] Huy H Nguyen, Junichi Yamagishi, and Isao Echizen. Capsule-forensics: Using capsule networks to detect forged images and videos. In ICASSP, 2019. 2 + +[37] Marco Pedersoli, Thomas Lucas, Cordelia Schmid, and Jakob Verbeek. Areas of attention for image captioning. In ICCV, 2017. 5 +[38] Yuyang Qian, Guojun Yin, Lu Sheng, Zixuan Chen, and Jing Shao. Thinking in frequency: Face forgery detection by mining frequency-aware clues. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision – ECCV 2020, pages 86–103, Cham, 2020. Springer International Publishing. 1, 2, 8 +[39] Anderson Rocha, Walter Scheirer, Terrance Boult, and Siome Goldenstein. Vision of the unseen: Current trends and challenges in digital image and video forensics. ACM Computing Surveys (CSUR), 2011. 2 +[40] Andreas Rossler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner. Faceforensics: Learning to detect manipulated facial images. In ICCV, 2019. 6, 7 +[41] Christos Sagonas, Epameinondas Antonakos, Georgios Tzimiropoulos, Stefanos Zafeiriou, and Maja Pantic. 300 faces in-the-wild challenge: Database and results. IVC, 2016. 6 +[42] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 618-626, 2017. 3 +[43] L. Song, D. Gong, Z. Li, C. Liu, and W. Liu. Occlusion robust face recognition based on mask learning with pairwise differential siamese network. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 773-782, 2019. 6 +[44] Kritaphat Songsri-in and Stefanos Zafeiriou. Complement face forensic detection and localization with faciallandmarks. arXiv preprint arXiv:1910.05455, 2019. 2 +[45] Joel Stehouwer, Hao Dang, Feng Liu, Xiaoming Liu, and Anil Jain. On the detection of digital face manipulation. CVPR, 2020. 1, 2, 8 +[46] Justus Thies, Michael Zollhöfer, and Matthias Nießner. Deferred neural rendering: Image synthesis using neural textures. TOG, 2019. 3, 6, 7 +[47] Justus Thies, Michael Zollhofer, Marc Stamminger, Christian Theobalt, and Matthias Nießner. Face2face: Real-time face capture and reenactment of rgb videos. In CVPR, 2016. 3, 6, 7 +[48] 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. 5 +[49] Feng Wang, Jian Cheng, Weiyang Liu, and Hajjun Liu. Additive margin softmax for face verification. IEEE Signal Processing Letters, 2018. 6 +[50] H. Wang, Y. Wang, Z. Zhou, X. Ji, D. Gong, J. Zhou, Z. Li, and W. Liu. Cosface: Large margin cosine loss for deep face recognition. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5265-5274, 2018. 6 +[51] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In ECCV, 2018. 4 + +[52] Xi Wu, Zhen Xie, YuTao Gao, and Yu Xiao. Sstnet: Detecting manipulated faces through spatial, steganalysis and temporal features. In ICASSP, 2020. 1, 2, 8 +[53] Yue Wu, Wael AbdAlmageed, and Premkumar Natarajan. *Mantra-net: Manipulation tracing network for detection and localization of image forgeries with anomalous features*. In *CVPR*, 2019. 4 +[54] Chao Yang and Ser-Nam Lim. One-shot domain adaptation for face generation. CVPR, 2020. 1, 2 +[55] Xin Yang, Yuezun Li, and Siwei Lyu. Exposing deep fakes using inconsistent head poses. In ICASSP, 2019. 2 +[56] Linwei Ye, Mrigank Rochan, Zhi Liu, and Yang Wang. Cross-modal self-attention network for referring image segmentation. In CVPR, 2019. 5 +[57] Peng Zhou, Xintong Han, Vlad I Morariu, and Larry S Davis. Two-stream neural networks for tampered face detection. In CVPRW, 2017. 1, 2, 4 +[58] Peng Zhou, Xintong Han, Vlad I Morariu, and Larry S Davis. Learning rich features for image manipulation detection. In CVPR, 2018. 4, 8 +[59] Hao Zhu, Chaoyou Fu, Qianyi Wu, W. Wu, Chen Qian, and R. He. Aot: Appearance optimal transport based identity swapping for forgery detection. ArXiv, abs/2011.02674, 2020. 1 \ No newline at end of file diff --git a/generalizingfaceforgerydetectionwithhighfrequencyfeatures/images.zip b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4f9de65604767c1914ccc277d3ec3e48a4a8f214 --- /dev/null +++ b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99f8a40c17c6246d44cc6665c330c6bb4ce438a269b7eca3e1317a520c08bf98 +size 609317 diff --git a/generalizingfaceforgerydetectionwithhighfrequencyfeatures/layout.json b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..df3485228f51aee1a5820517ab548f3e73c03aba --- /dev/null +++ b/generalizingfaceforgerydetectionwithhighfrequencyfeatures/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c350a16f53f999325da368e223b6a5303de3a8887fc8eae15bf0ae38a61721eb +size 419440 diff --git a/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_content_list.json b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3c6fad6d28bb8c931b232241ffd4fcfa7e1e58b9 --- /dev/null +++ b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:644daf7322734b2066a80ce78d6e8b20b0d476087ac9202bf6d56fa3bb7a4970 +size 81582 diff --git a/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_model.json b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f8187a3793129d029c51616ae8c1058b721d69b2 --- /dev/null +++ b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1556dd63b353cc69df58eabc18964179b9d581bd17011bf0622c7c2a0c3da422 +size 100529 diff --git a/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_origin.pdf b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5d8222b88823b1ec9abd62681329e92f78bd9369 --- /dev/null +++ b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/411c1ebf-036c-426d-b5e3-4b5ce3568659_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02105a9241f4ec6264b064fad4858e9cfb5ebbe2474d67c0d929abe41e93647e +size 1629943 diff --git a/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/full.md b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9696d34602be228f27f3af050c1bbe5e012e5d50 --- /dev/null +++ b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/full.md @@ -0,0 +1,387 @@ +# Generalizing to the Open World: Deep Visual Odometry with Online Adaptation + +Shunkai Li + +Xin Wu + +Yingdian Cao + +Hongbin Zha + +Key Laboratory of Machine Perception (MOE), School of EECS, Peking University PKU-SenseTime Machine Vision Joint Lab + +{lishunkai, wuxin1998, yingdianc}@pku.edu.cn zha@cis.pku.edu.cn + +# Abstract + +Despite learning-based visual odometry (VO) has shown impressive results in recent years, the pretrained networks may easily collapse in unseen environments. The large domain gap between training and testing data makes them difficult to generalize to new scenes. In this paper, we propose an online adaptation framework for deep VO with the assistance of scene-agnostic geometric computations and Bayesian inference. In contrast to learning-based pose estimation, our method solves pose from optical flow and depth while the single-view depth estimation is continuously improved with new observations by online learned uncertainties. Meanwhile, an online learned photometric uncertainty is used for further depth and pose optimization by a differentiable Gauss-Newton layer. Our method enables fast adaptation of deep VO networks to unseen environments in a self-supervised manner. Extensive experiments including Cityscapes to KITTI and outdoor KITTI to indoor TUM demonstrate that our method achieves state-of-the-art generalization ability among self-supervised VO methods. + +# 1. Introduction + +Estimating camera motion from monocular videos plays an essential role in many real-world applications, such as autonomous driving and robotics. This problem is usually solved by visual odometry (VO) or simultaneous localization and mapping (SLAM). Classic SLAM/VO methods [7, 8, 10, 26] perform well in favorable conditions but often fail in challenging situations (e.g. textureless region, dynamic object) due to the reliance on low-level features and handcrafted pipeline. Since deep neural networks are able to extract high-level features and infer end-to-end by learning from data, many learning-based VO methods [21, 22, 39, 47] have been proposed to break through the limitations of classic SLAM/VO. Among them, self-supervised VO methods are able to jointly learn camera pose, depth and optical flow by minimizing photometric error [39], which have shown promising results in recent years. + +![](images/eca915795881b7d379685c8a84ed92124b25b192c5d9a8378284809bff6de7d1.jpg) +Pretrained on Cityscapes + +![](images/fe6f4dc5a4e0bf8b3e6a9fead1b843c2e162f5cff3252442b78199973c6d08cf.jpg) + +![](images/71300d0f51e9d18a2811fb4605a675518036eecd1411ff6585a46021568a2b28.jpg) +Test on KITTI +Pretrained on KITTI + +![](images/5c4735c8114cdb35af8e6164d8155b5bd0a27f18079170b4ce9c770d3cf4c311.jpg) +Test on TUM + +![](images/52bee20c91cdf4ff0347fb20cadf7dbb3335c02c694a125c23dd490ea54efee5.jpg) + +![](images/05b2e04a76829a2069f142b7babd64dd90f5efcd07c4d36fba1ba081b78666bb.jpg) +Figure 1. In this paper, we focus on the generalization ability to unseen environments of deep VO. When the test data are different from the training data, previous methods fail to generalize while our method still performs well with very small trajectory error. + +However, learning-based VO often fails during inference when the scenes are different from the training data. The inability of pretrained VO to generalize to unseen environments limits its wide applications [21, 44]. To this end, the pretrained networks are required to achieve real-time online adaptation in a self-supervised manner. + +As a result, several previous works [3, 21, 44] have been proposed to mitigate the domain generalization problem of stereo matching and VO. However, the performance is still much inferior to classic methods in terms of accuracy and the pretrained networks suffer from slow convergence. These methods treat VO as a black-box by learning all components (pose, depth, optical flow, etc.) but ignore well-defined geometric computations and optimization methods, which leads to slow convergence during online adaptation. + +Existing deep VO methods predict depth by single-view estimation, which is an ill-posed problem [22]. The learned depth has a strong reliance on the training dataset. During inference, the camera intrinsics, scene layouts and distances are usually different. Meanwhile, the camera pose is learned rather than calculated analytically, which requires favorable camera motion with sufficient disparity (e.g. KITTI dataset). Therefore, these methods tend to fail when faced with unseen or more complicated motion patterns. In addition, existing learning-based methods do not explicitly ensure multi-view geometric consistency during inference, which leads to large scale drift in trajectories. + +In order to improve the online adaptation of VO to unseen environments, we propose a self-supervised framework that combines the advantage of deep learning and geometric computations. The proposed framework utilizes scene-agnostic 3D geometry constraints and Bayesian inference formulations to speed up online adaptation. During inference, the single-view depth estimation is used as a prior of the current scene geometry and is continuously improved with incoming observations by a probabilistic Bayesian updating framework. The refined depth is used as Maximum A Posteriori (MAP) to train DepthNet for better estimation at the next timestep. Instead of predicting pose by PoseNet, our framework solves pose analytically from optical flow and refined depth. Meanwhile, in order to deal with observation noise, the proposed method online learns depth and photometric uncertainties which are used in the depth refinement process and differentiable Gauss-Newton optimization, respectively. Finally, the optimized pose, depth and flow are used for online self-supervision. Our framework ensures scale consistency by exploiting multi-view geometric constraints. The well-defined scene-agnostic computation helps our VO framework achieve good generalization ability across different scene conditions. Our contributions can be summarized as follows: + +- We propose a generalizable deep VO that uses scene-agnostic geometric formulation and Bayesian inference to speed up self-supervised online adaptation. +- The predicted depth is continuously refined by a Bayesian fusion framework, which is further used to train depth and optical flow during online learning. +- We introduce online learned depth and photometric uncertainties for better depth refinement and differentiable Gauss-Newton optimization. + +Our method achieves much better generalization than state-of-the-art baselines when tested cross different domains, including Cityscapes [4] to KITTI [13] and outdoor KITTI to indoor TUM [31] datasets. Meanwhile, we also achieve state-of-the-art depth estimation results on KITTI and NYUv2 [30] datasets. + +# 2. Related works + +Learning-based VO has been widely studied in recent years and shown impressive results [35, 37, 45]. DeepTAM [45] mimics the framework of parallel tracking and mapping in classic SLAM/VO by using two networks for depth and pose estimation simultaneously. Xue et al [37] extends the VO pipeline to tracking, selecting memory and refining modules, which shows superior performance under challenging conditions. However, these methods require ground truth which is often impractical to obtain. In order to alleviate the need of ground truth data, self-supervised VO has been proposed. SfMLearner [47] learns depth and pose simultaneously by minimizing photometric loss between warped and input image. Zhao et al. [43] and Ranjan et al. [28] extend this idea to joint estimation of pose, depth and optical flow. Monodepth2 [15] explicitly handles non-rigid and occluded cases which are against static-scene assumption. SAVO [22] exploits spatial-temporal correlations over long sequence and utilizes RNN to reduce scale drift. In this paper, we use the depth network of Monodepth2 [15] for single-view depth estimation. + +Online adaptation Most machine learning algorithms assume that the training and testing data are sampled from the same feature distribution. However, when the test data are different from the training set, most pretrained models suffer from a significant reduce in performance. In this situation, online learning [23, 33] is an effective method to solve the domain shift problem. Previous methods use online gradient update [5] and probabilistic filtering [2] to accelerate domain adaptation. In the computer vision field, Zhong et al. [44] proposes a self-supervised framework for stereo matching in the open world. Li et al. [21] proposes an online meta-learning algorithm for VO to continuously adapt to unseen environments. However, these methods learn all components by deep networks, leading to slow convergence and inferior performance. In contrast, our method combines the advantage of deep learning and well-defined geometric computations to achieve better generalization. + +3D Geometric computations In classic 3D computer vision, the relative pose between two images and scene depth can be solved analytically by multi-view geometric constraints. Given a set of correspondences, the pose can be solved by epipolar geometry [16, 17] with 2D-2D matching or Perspective-n-Point (PnP) [19] with 3D-2D matching. The depth of each correspondence can be recovered by mid-point triangulation [26]. On the other hand, the depth and pose can also be solved by minimizing photometric error [7, 8] via classic optimizations. If more observations are available, the 3D map can be further refined by Bundle Adjustment (BA) [26] or filtering [10]. In this paper, we adopt a Bayesian depth fusion method to refine single-view depth estimation and propose a differentiable Gauss-Newton layer to minimize weighted photometric residuals. + +![](images/96a7623ee79759b4753b1987ab4c450bb4b6465b6c65451461197d864bb7178a.jpg) +Figure 2. The framework of our online adaptation method. FlowNet predicts dense optical flow $F_{k,t}$ , $F_{t,k}$ and photometric uncertainty $\Gamma_t$ while DepthNet provides a prior depth estimation of the keyframe by estimating initial depth $D_k^0$ and uncertainty $\Sigma_k$ . The relative pose $T_k^t$ is solved analytically from selected correspondences. During online adaptation, the initial depth $D_k^0$ is continuously improved with new triangulated depth patches in a Bayesian updating framework. The photometric loss weighted by $\Gamma_t$ is minimized by a differentiable Gauss-Newton layer. Finally, the optimized depth and pose are then used to self-supervise the online learning of DepthNet and FlowNet. + +# 3. Method + +In this section, we will introduce our framework in detail. The system overview is illustrated in Fig. 2. Firstly, the FlowNet predicts dense optical flow between the keyframe $I_{k}$ and current frame $I_{t}$ (Section 3.1), and predicts photometric uncertainty map $\Gamma_{t}$ (Section 3.4) as a side output. Meanwhile, the DepthNet estimates depth mean $D_{k}^{0}$ and uncertainty $\Sigma_{k}$ of keyframe, providing a prior of the current scene geometry (Section 3.2). The relative pose $T_{k}^{t}$ is solved by essential matrix or PnP from selected flow correspondences. During online adaptation, we firstly reconstruct the sparse depth of $I_{k}$ by a differentiable triangulation module. Then, the prior keyframe depth $D_{k}^{0}$ is continuously improved by subsequent depth estimations in a Bayesian updating framework (Section 3.3). Next, the differentiable Gauss-Newton layer minimizes the photometric loss of $I_{t}$ and warped image $\hat{I}_{t}$ weighted by predicted $\Gamma_{t}$ (Section 3.5). Finally, the optimized depth $D_{k}^{\prime}$ and flow $F_{k,t}^{\prime}$ are used as pseudo ground truth to supervise the online learning of DepthNet and FlowNet (Section 3.6). + +# 3.1. Pose recovery from optical flow + +We use RAFT [32] to learn dense optical flow $F_{k,t}$ between keyframe $I_{k}$ and current frame $I_{t}$ . The optical flow + +between $I_{k}$ and $I_{t - 1}$ is used as a prior to initialize current flow prediction. However, the predicted flow is not accurate for all pixels and the pose estimation error will increase if the displacement becomes small. Thus we select robust correspondences $(p_k,p_t)$ with good forward-backward flow consistency and moderate flow magnitude [42]: + +$$ +\left\| F _ {k, t} \left(p _ {k}\right) + F _ {t, k} \left(p _ {t}\right) \right\| < \delta_ {1}, \quad \left\| F _ {k, t} \left(p _ {k}\right) \right\| > \delta_ {2}, \tag {1} +$$ + +where we set $\delta_1 = 0.1, \delta_2 = 3$ . We select $I_t$ as a new keyframe if the mean flow of robust correspondences is larger than 30. Benefiting from this keyframe-based scheme, the motion disparity between two frames are increased, enabling more accurate pose and depth estimation. + +Given 2D correspondences between $p_k, p_t$ , the relative pose $T_k^t = [R|t]$ is computed by solving essential matrix $E$ with RANSAC [9] algorithm: + +$$ +p _ {t} ^ {T} K ^ {- T} E K ^ {- 1} p _ {k} = 0, \quad E = [ t ] _ {\times} R, \tag {2} +$$ + +where $K$ denotes camera intrinsics. The scale of up-to-scale pose $T_{k}^{t}$ is recovered by aligning triangulated sparse depth (detailed in Section 3.3) with keyframe depth. However, when confronted with small translation or pure rotation, the 2D-2D estimation fails. In these cases, we recover pose with PnP [19] by minimizing reprojection error: + +$$ +e _ {r} = \sum \left| \left| K T _ {k} ^ {t} D _ {k} K ^ {- 1} p _ {k} - p _ {t} \right| \right| _ {2}, \tag {3} +$$ + +where the 2D correspondences in $I_{k}$ are lifted to 3D with depth $D_{k}$ (detailed in Section 3.2-3.3) and intrinsics $K$ . + +# 3.2. Depth modeling + +In this paper, we model the depth estimation and updating in a unified Bayesian framework. The inverse depth $z_{i} = \frac{1}{d_{i}}$ of every pixel $i$ is used since it obeys Gaussian-like distribution and is more robust to distant objects. For inverse depth measurement $z_{i}^{t}$ at time $t$ , we model the good measurement as Gaussian distribution around the ground truth $z_{i}$ while the bad one is regarded as observation noise which is uniformly distributed within the interval $[z_{i}^{\min}, z_{i}^{\max}]$ . For every new observation $z_{i}^{t}$ , the probability of being a inlier is $\rho_{i}^{t}$ . Thus $z_{i}^{t}$ is modeled as [10]: + +$$ +p \left(z _ {i} ^ {t} \mid z _ {i}, \rho_ {i} ^ {t}\right) := \rho_ {i} ^ {t} \mathcal {N} \left(z _ {i} ^ {t} \mid z _ {i}, \tau_ {i} ^ {2}\right) + \left(1 - \rho_ {i} ^ {t}\right) \mathcal {U} \left(z _ {i} ^ {t} \mid z _ {i} ^ {\min }, z _ {i} ^ {\max }\right), \tag {4} +$$ + +where $\tau_{i}^{2}$ denotes the variance of a good measurement. We follow [10] to set inverse depth variance $\tau_{i}^{2}$ as the photometric disparity error of one pixel. + +During online inference, we seek to find the Maximum A Posteriori (MAP) estimation of $z_{i}^{t}$ at each timestep, which can be approximated [34] by the product of a Gaussian distribution for $z_{i}^{t}$ and a Beta distribution for inlier ratio $\rho_{i}^{t}$ : + +$$ +q \left(z _ {i} ^ {t}, \rho_ {i} ^ {t} \mid a _ {i} ^ {t}, b _ {i} ^ {t}, \mu_ {i} ^ {t}, \sigma_ {i} ^ {t 2}\right) := B e t a \left(\rho_ {i} ^ {t} \mid a _ {i} ^ {t}, b _ {i} ^ {t}\right) \mathcal {N} \left(z _ {i} ^ {t} \mid \mu_ {i} ^ {t}, \sigma_ {i} ^ {t 2}\right), \tag {5} +$$ + +where $a_i^t, b_i^t$ are the parameters in Beta distribution, and $\mu_i^t, \sigma_i^t$ the mean and variance of Gaussian depth estimate. + +The depth of keyframe is initialized with single-view estimation $d_k^0 \in D_k^0$ and inverse depth uncertainty $\sigma_i^0 \in \Sigma_k$ from DepthNet as follows: + +$$ +\begin{array}{l} \mu_ {i} ^ {0} = \frac {1}{d _ {k} ^ {0}}, \quad \sigma_ {i} ^ {0} \in \Sigma_ {k}, \quad z _ {i} ^ {\max } = \mu_ {i} ^ {0} + \sigma_ {i} ^ {0}, \tag {6} \\ z _ {i} ^ {\min } = \left\{ \begin{array}{l l} \mu_ {i} ^ {0} - \sigma_ {i} ^ {0}, & \quad \text {i f} \mu_ {i} ^ {0} - \sigma_ {i} ^ {0} > 0 \\ 1 e ^ {- 6}, & \quad \text {e l s e} \end{array} \right. \\ \end{array} +$$ + +During adaptation, the DepthNet online learns the prior knowledge of the new scene geometry. Besides, the learned uncertainties can also serve to gauge the reliability in probabilistic depth fusion. + +# 3.3. Online depth refinement + +Given the relative pose $T_{k}^{t}$ and 2D correspondences, the subsequent depth estimation of keyframe can be further calculated by two-view triangulation [26]: + +$$ +d _ {i} ^ {k} = \underset {d _ {i} ^ {k}} {\arg \min } \left[ \operatorname {d i s} \left(L _ {k}, d _ {i} ^ {k}\right) ^ {2} + \operatorname {d i s} \left(L _ {t}, d _ {i} ^ {k}\right) \right] ^ {2}, \tag {7} +$$ + +![](images/23ae28aa876673eec69f3db3c5f07d0ca52e6fffaade9103b8e843ba4dfa751a.jpg) +Figure 3. Illustration of online depth refinement process. When tested on TUM dataset, the pretrained network predicts erroneous depth. The initial guess is continuously updated by triangulated depth patches in a Bayesian refinement framework which becomes much more accurate after only 4 timesteps. + +where $\mathrm{dis}()$ denotes the distance between $d_i^k$ and two camera rays $L_{k},L_{t}$ generated from 2D correspondences. The midpoint triangulation is naturally differentiable, enabling our VO framework to perform end-to-end online learning. + +The triangulated depth map $D_{k}^{s}$ is usually very sparse ( $\sim 2000$ points) and we densify each point with a local $3 \times 3$ patch $D_{k}^{s^{\prime}}$ . The depth of each patch pixel is assumed the same as the central point. The patch-based representation allows larger region of depth filtering and provides more valid gradients with a wider basin of convergence. + +During online adaptation, $D_k^{s'}$ is used to update the prior depth estimate to get a MAP estimation $z_i^t$ according to Eq. 5 as illustrated in Fig. 3. Meanwhile, the parameters $a_i^t, b_i^t, \mu_i^t, \sigma_i^{t2}$ in Eq. 5 are incrementally updated by Bayesian formulation. The updating method can be found in the supplementary materials. We assume the inverse depth $z_i^t$ have converged to the ground truth $z_i$ once the uncertainty $\sigma_i^{t2}$ is lower than a threshold. + +# 3.4. Photometric residuals with learned uncertainty + +Given the estimated pose $T_{k}^{t}$ and refined depth $D_{k}$ , one can synthesize $\hat{I}_{t}$ by warping $I_{k}$ to the target image $I_{t}$ [47]: + +$$ +p _ {t} \sim K T _ {k} ^ {t} D _ {k} \left(p _ {k}\right) K ^ {- 1} p _ {k}, \tag {8} +$$ + +However, view synthesis builds on the photometric constancy assumption, which is often violated in practice. In order to alleviate this issue, we regard these corner cases as + +observation noise and use deep neural network to predict a posterior probability distribution $p(I|\mu_I,\gamma)$ for each RGB pixel parametrized by mean $\mu_I$ and variance $\gamma \in \Gamma$ over ground truth intensity $I$ . By assuming the observation noise to be Laplacian, the online learning process can be formulated as minimizing the negative log-likelihood, which can be converted to a weighted photometric loss: + +$$ +\mathcal {L} _ {p h o} = \sum - \log p (I | \mu_ {I}, \gamma) = \frac {\| \hat {I} _ {t} - I _ {t} \| _ {1}}{\Gamma_ {t}} + \log \Gamma_ {t}, \tag {9} +$$ + +where $\Gamma_t$ denotes photometric uncertainty map. + +# 3.5. Differentiable Gauss-Newton optimization + +Furthermore, we propose to use a differentiable Gauss-Newton [7] layer to minimize $\mathcal{L}_{pho}$ for optimized depth $D_{k}^{\prime}$ and pose $T_{k}^{t}$ . The predicted $\Gamma_{t}$ in Eq. 9 improves the robustness to illumination change and occlusions. Specifically, starting with an initial depth and pose $D_{k}, T_{k}^{t}$ , we compute the weighted photometric loss $r_{i}(p)$ for each pixel $p_{i}$ in all frames $I_{i}$ among two keyframes $I_{k_{1}}, I_{k_{2}}$ : + +$$ +r _ {i} (p) = \frac {\hat {I} _ {i} \left(p _ {i}\right) - I _ {i} (p)}{\gamma_ {i}}, \quad \gamma_ {i} \in \Gamma_ {t} \tag {10} +$$ + +The first order derivatives with respect to $D_{k}$ and $T_{k}^{t}$ are: + +$$ +J _ {i} ^ {D} (p) = \frac {1}{\gamma_ {i}} \frac {\partial \hat {I} _ {i} \left(p _ {i}\right)}{\partial p _ {i}} \frac {\partial p _ {i}}{\partial D _ {k} (p)}, \quad J _ {i} ^ {T} (p) = \frac {1}{\gamma_ {i}} \frac {\partial \hat {I} _ {i} \left(p _ {i}\right)}{\partial p _ {i}} \frac {\partial p _ {i}}{\partial T _ {k} ^ {t}} \tag {11} +$$ + +Thus the increment $\delta$ to the current estimation is: + +$$ +\delta = - \left(J ^ {T} J\right) ^ {- 1} J ^ {T} r, \quad J = \left[ J ^ {D} J ^ {T} \right] \tag {12} +$$ + +where $J$ denotes the stack of Jacobians $\{J_i(p)\}$ and $r$ denotes the stack of weighted photometric residuals $\{r_i(p)\}$ . The Gauss-Newton algorithm is naturally differentiable and we implement it as a layer in neural network. In practice, we find that it converges within only 3 iterations. + +# 3.6. Loss functions + +We propose to use the following loss functions to online learn DepthNet and FlowNet in a self-supervised manner. + +Smoothness loss We introduce an edge-aware loss for depth and flow to enforce local smoothness: + +$$ +\mathcal {L} _ {\text {s m o o t h}} (G) = \frac {1}{N} \sum_ {x, y} \| \nabla_ {x} G (x, y) \| e ^ {- \| \nabla_ {x} I (x, y) \|} + \tag {13} +$$ + +$$ +\| \nabla_ {y} G (x, y) \| e ^ {- \| \nabla_ {y} I (x, y) \|}, +$$ + +where $G$ denotes optical flow or depth. + +Depth loss We derive a loss function of depth by evaluating the negative log-likelihood of the estimated inverse depth $\tilde{z}_i$ with uncertainty $\sigma_i$ defined in Eq. 6. This allows + +the network to attenuate the cost of difficult regions and to focus more on well explained parts. We assume a Laplacian distribution of inverse depth residuals: + +$$ +p \left(\tilde {z} _ {i} \mid \mu_ {i}, \sigma_ {i}\right) = \frac {1}{2 \sigma_ {i}} \exp \left(- \frac {\left| \tilde {z} _ {i} - \mu_ {i} \right|}{\sigma_ {i}}\right) \tag {14} +$$ + +We use refined inverse depth $z_k'$ as $\mu_i$ for self-supervision. Thus the negative log-likelihood becomes: + +$$ +\mathcal {L} _ {d} = \sum - \log p (\tilde {z} _ {i} | \mu_ {i}, \sigma_ {i}) = \frac {\left\| 1 / D _ {k} ^ {\prime} - 1 / D _ {k} \right\| _ {1}}{\Sigma_ {k}} + \log \Sigma_ {k} \tag {15} +$$ + +Intuitively, the network will tune the depth uncertainty $\sigma_{i}$ that best minimize the depth loss $\|1 / D_k' - 1 / D_k\|_1$ while being subject to the regularization term $\log \Sigma_{k}$ . In order to enforce depth continuity, we modify Eq. 15 to: + +$$ +\mathcal {L} _ {d} = \frac {\left\| 1 / D _ {k} ^ {\prime} - 1 / D _ {k} \right\| _ {1}}{\Sigma_ {k}} + \log \Sigma_ {k} + \mathcal {L} _ {\text {s m o o t h}} (D _ {k}) \tag {16} +$$ + +Flow loss The optimized depth and pose $D_{k}^{\prime}, T_{k}^{t}$ can be used to synthesize optical flow $F_{k,t}^{\prime}$ by calculating the difference between warped coordinates $p_t^\prime$ and $p_t$ . We use $F_{k,t}^{\prime}$ to supervise FlowNet during online adaptation: + +$$ +\mathcal {L} _ {f l o w} = \left\| F _ {k, t} - F _ {k, t} ^ {\prime} \right\| _ {1} + \mathcal {L} _ {s m o o t h} \left(F _ {k, t}\right) \tag {17} +$$ + +Photometric loss is defined in Eq. 9. Thus the total self-supervised loss is: + +$$ +\mathcal {L} = \mathcal {L} _ {p h o} + \mathcal {L} _ {d} + \mathcal {L} _ {f l o w} \tag {18} +$$ + +# 4. Experiments + +# 4.1. Implementation details + +Network Architectures Since our method focuses on improving online adaptation of deep VO to achieve better generalization, we adopt similar networks with existing self-supervised VO methods. As for DepthNet, we use the same architecture as Monodepth2 [15] and add a $5 \times 5$ convolution layer at the output to predict depth uncertainty map $\Sigma_{k}$ . The optical flow network is based on RAFT [32]. We add a $5 \times 5$ convolution + Sigmoid layer at output to predict photometric uncertainty $\Gamma_{t}$ at the same time. + +Learning Settings Our model is implemented by PyTorch [27] on a single NVIDIA GTX 2080Ti. The images are resized to $256 \times 832$ for KITTI [13] and Cityscapes [4] datasets while set $192 \times 256$ for TUM dataset [31]. The FlowNet and DepthNet are pretrained in a self-supervised manner for $1 \times 10^{5}$ iterations according to [28]. The Adam [18] optimizer with $\beta_{1} = 0.9, \beta_{2} = 0.99$ is used. The learning objective (Eq. 18) is used for both pretraining and online adaptation with the learning rate of $1 \times 10^{-4}$ . The uncertainty maps $\Gamma_{t}, \Sigma_{k}$ are also jointly trained by minimizing Eq. 18. During online adaptation, we retrain FlowNet and DepthNet for 2 iterations in every time step. + +![](images/4bb5e58ab4bdb5e5f144b7cba14f27d318e8351d9d69f68d9198c416ea27c8d5.jpg) +(a) Seq.00 + +![](images/805a76352682b2702cf622aa5d4d00a748574549d9274d049672d73f94bdb030.jpg) +(b) Seq.01 + +![](images/1c89659dabc546fde65669d462e7dabfb70bc28933a651c7e4914affcb59c0c5.jpg) +(c) Seq.02 +Figure 4. Selected trajectories of different methods on KITTI odometry dataset. We use pretrained network on Cityscapes to directly test on KITTI while all the other methods use pretrained network on KITTI for testing. It can be seen that our method shows much more accurate trajectories. Note that we do not use any mapping, pose graph optimization, loop closing or bundle adjustment techniques. + +![](images/58783ee757a3e1d51d08d25993f2a391083bac05345c2dab1b1c56e94feec00f.jpg) +(d) Seq.08 + +# 4.2. Cityscapes to KITTI + +Firstly, we try to test the generalization ability of our framework to different outdoor environments. We pretrain our method on Cityscapes [4] dataset and test on KITTI [13] dataset, which differ not only in scene contents and white balance but also in camera intrinsics. We compare with recent self-supervised VO baselines: GeoNet [39], Vid2Depth [24], Zhan et al. [41], SAVO [22] and Li et al. [21] as well as classic methods: ORB-SLAM2 [26] (with and without loop closure) and VISO2 [14]. Besides, we compare with Zhao et al. [43] and DF-VO [42] which are state-of-the-art methods that combine the output of pretrained networks with classic VO pipeline. + +As for pose estimation, we evaluate on 11 KITTI sequences with ground truth poses [39]. It's worthy to note that all the other VO baselines are pretrained on KITTI, while our method is only pretrained on Cityscapes and directly tested on KITTI dataset. Although in such unfair conditions, our method achieves state-of-the-art results even compared with ORB-SLAM2 (LC) (shown in Table 1 and Fig. 4). Meanwhile, different from most self-supervised VO baselines, our method maintains a consistent scale of the entire trajectory. Thus, instead of calculating absolute trajectory error (ATE) on short sequence as previous methods, we align trajectories with ground truth [13] by a single scaling factor and compute translation/rotation error $t_{err} / r_{err}$ on entire trajectory. + +Our method outperforms all the other baselines (including end-to-end learning and combination of geometric computation methods) by a clear margin. The rotation and translation errors are an order of magnitude smaller than the other self-supervised baselines, indicating that pose, depth and scale estimation collaborated with probabilistic geometric computation is much better than learning-based inference. As for classic baselines, ORB-SLAM2 is implemented by a local map tracking with bundle adjustment + +![](images/a7b3d65d072e4dd1794f881441f96c986da08ffa86fd946aac00496ba742624b.jpg) + +![](images/a311040a29f22a6f49adcd221630bbc1c3eb9a71328060bfb9c2a7eb939f954d.jpg) + +![](images/2f5194e94cd36c35dd5ab5f6da61a249be935523c193b59a92c88c846cc29ebf.jpg) +(c) fr3/long_office_hou_valid +Figure 5. Visual odometry results pretrained on outdoor KITTI and tested on indoor TUM dataset. All the other learning-based baselines tend to fail when faced with large domain shift. In contrast, our method is still able to recover accurate VO estimation by online adapting to challenging indoor datasets. + +![](images/c014a4070b75c5ad740e7ab30627ee0faaa9687bb5ecd57006dc921f5956106b.jpg) +(d) fr2/pioneer_360 + +(BA) and ORB-SLAM2 (LC) processes the entire sequence with loop closure, pose graph optimization and global BA to ensure good performance. Our method doesn't use any optimization backend techniques but it still achieves comparable results with ORB-SLAM2 (LC). + +# 4.3. Outdoor KITTI to indoor TUM + +In order to further evaluate the generalization ability to more complex indoor environments, we test on TUM [31] dataset using networks pretrained on KITTI. TUM indoor dataset contains much more complicated motion patterns + +
MethodSeq.00 +terr/errSeq.01 +terr/errSeq.02 +terr/errSeq.03 +terr/errSeq.04 +terr/errSeq.05 +terr/errSeq.06 +terr/errSeq.07 +terr/errSeq.08 +terr/errSeq.09 +terr/errSeq.10 +terr/err
Vid2Depth [24]59.97 22.599.34 4.1855.20 14.6127.02 10.391.89 1.1951.14 21.8658.07 26.8351.21 36.6445.82 18.1044.52 12.1121.45 12.50
GeoNet [39]27.60 5.7212.25 4.1542.21 6.1419.21 9.789.09 7.5520.12 7.679.28 4.348.27 5.9318.59 7.8523.94 9.8120.73 9.10
Zhan et al. [41]6.23 2.4423.78 1.756.59 2.2615.76 10.623.14 2.024.94 2.345.80 2.066.49 3.565.45 2.3911.89 3.6212.82 3.40
SAVO [22]18.67 3.129.86 1.2317.58 4.2915.01 6.543.35 1.189.82 2.535.27 4.309.85 4.0321.37 3.659.52 3.646.45 2.41
Li et al. [21]8.42 3.9117.36 4.6014.38 2.6218.24 0.923.28 4.407.58 3.314.36 2.285.58 3.127.51 2.635.89 3.344.79 0.83
VISO2 [14]12.66 2.7341.93 7.689.47 1.193.93 2.212.50 1.7815.10 3.656.80 1.9310.80 4.6714.82 2.523.69 1.2521.01 3.26
DF-VO [42]2.25 0.5866.98 17.043.60 0.522.67 0.501.43 0.291.10 0.301.03 0.300.97 0.271.60 0.322.61 0.292.29 0.37
D3VO [38] (stereo)- -1.07 -0.80 -- -- -- -0.67 -- -1.00 -0.78 -0.62 -
Zhao et al. [43]4.45 1.1362.54 2.714.64 0.916.86 1.264.76 3.312.93 0.903.48 1.322.57 1.215.09 1.196.81 0.724.39 1.05
ORB-SLAM2 [26]11.43 0.58107.57 0.8910.34 0.260.97 0.191.30 0.279.04 0.2614.56 0.269.77 0.3611.46 0.289.30 0.262.57 0.32
ORB-SLAM2 (LC)2.35 0.35109.10 0.453.32 0.310.91 0.191.56 0.271.84 0.204.99 0.231.91 0.289.41 0.302.88 0.253.30 0.30
Ours (w/o RDS)4.67 1.286.99 2.834.33 1.058.73 1.143.78 2.094.20 1.985.02 3.617.24 1.113.30 2.787.99 2.535.21 2.87
Ours (w/o PU)2.28 0.875.42 1.403.98 1.877.76 0.992.92 1.043.63 1.284.92 2.078.25 2.393.28 1.694.60 1.133.25 1.70
Ours1.32 0.452.83 0.651.42 0.451.77 0.391.22 0.271.07 0.441.02 0.412.06 1.181.50 0.421.87 0.461.93 0.30
+ +Table 1. Quantitative comparison on KITTI dataset. Our method is pretrained on Cityscapes and tested on KITTI, while all the other learning-based methods are pretrained on KITTI. LC: loop closure, w/o: without, RDS: refined depth for online supervision, PU: photometric uncertainty. $t_{err}$ : translational root mean square error (RMSE) drift (\%); $r_{err}$ : average rotational RMSE drift ( $^\circ/100\mathrm{m}$ ). + +
SequenceVid2Depth [24]GeoNet [39]Zhan et al. [41]SAVO [22]Li et al. [21]DF-VO [42]Zhao et al. [43]DSO [7]ORB-SLAM2 (LC) [26]OursOurs (w/o RDS)Ours (w/o PU)
fr2/desk0.6980.4620.5700.4020.2140.3060.485XX0.1580.5720.221
fr2/pioneer_3600.5810.6620.4530.4020.2180.5990.693XX0.2010.6380.254
fr2/pioneer_slam0.3670.3010.3090.3380.1900.5850.3540.737X0.1760.4810.210
fr2/360_kidnap0.5640.5790.4300.4210.3570.7450.468X0.5820.3840.6050.371
fr3/cabinet0.4920.2820.3160.2810.2720.4470.227XX0.2130.4530.276
fr3/long_office_hou_valid0.4010.3160.3270.2970.2370.2270.5340.3270.0420.1330.5290.168
fr3/nostr_texture_near_loop0.3280.2770.3400.4400.2550.5640.3480.0930.0570.1590.4010.186
fr3/str_notexture FAR0.2270.2580.2350.2160.1770.5050.1750.543X0.1040.4320.201
fr3/str_notexture_near0.2350.1980.2170.2040.1280.6030.2180.481X0.2070.5790.224
+ +Table 2. Quantitative evaluation of different methods pretrained on KITTI and tested on TUM-RGBD dataset. We evaluate relative pose error (RPE) which is presented as translational RMSE in [m/s]. LC: loop closure, X: fail. w/o RDS: without refined depth for online supervision. w/o PU: without online learned photometric uncertainty. + +and challenging conditions. As shown in Table 2 and Fig. 5, learning-based baselines have large errors when confronted with significant domain shift and different motion patterns (from fast planar motion to small motion in $xyz$ axes). On the contrary, our method yields promising results due to fast online adaptation. Besides, our method is more robust than classic methods (ORB-SLAM2 [26] and DSO [7]) in textureless scenes, abrupt motion and illumination changes, indicating that it tends to find out robust correspondences and online learns depth/photometric uncertainty in challenging conditions. + +# 4.4. Depth evaluation on KITTI and NYUv2 + +We demonstrate the effectiveness of using optimized $D_{k}^{\prime}$ for self-supervision by evaluating different single-view depth estimation methods on KITTI [13] and NYUv2 [30] datasets. We only use triangulation and Bayesian updating for training. During test, our method predicts single-view depth without refinement. As for KITTI, we take Eigen et al. [6] split for training and test. As for NYUv2, we use the raw training set and evaluate depth prediction results on labeled test set. The predicted depth is multiplied by a + +scaling factor to match the median with ground truth [6]. + +Table 3, 4 and Fig. 6 show the depth evaluation results on KITTI and NYUv2 datasets. Benefiting from the patch-based depth triangulation and multi-frame refinement process, our method is able to synthesize refined depth for self-supervision. The learned depth is more accurate and preserves sharper edges with fine details than other methods. More qualitative results and analysis can be found in the supplementary materials. + +# 4.5. Ablation studies + +In order to demonstrate the effectiveness of each component, we present ablation studies on various versions of our method on KITTI, TUM and NYUv2 datasets (shown in Table 1, 2, 3, 4). 'w/o RDS' means without the final step of retraining both DepthNet and FlowNet. It can be seen that the performance of pose and depth estimation shows a considerable improvement when the refined depth is used for online training the DepthNet. Besides, it can be noticed that KITTI contains many moving objects (cars, people) and all these datasets have many sequences with changing camera exposure time. The online learned + +
MethodSupervisionAbs RelSq RelRMSERMSE logδ < 1.25δ < 1.252δ < 1.253
SfMLearner [47]-0.2081.7686.8560.2830.6780.8850.957
Garg et al. [12]stereo0.1691.0805.1040.2730.7400.9040.962
Vid2Depth [24]-0.1631.2406.2200.2500.7620.9160.968
GeoNet [39]-0.1551.2965.8570.2330.7930.9310.973
Zhan et al. [41]stereo0.1351.1325.5850.2290.8200.9330.971
Mahjourian et al. [25]-0.1631.2406.2200.2500.7620.9160.968
SAVO [22]-0.1501.1275.5640.2290.8230.9360.974
SC-SfMLearner [1]-0.1371.0895.4390.2170.8300.9420.975
Zhao et al. [43]-0.1130.7044.5810.1840.8710.9610.984
Monodepth2 [15] (w/o pretrain)-0.1321.0445.1420.2100.8450.9480.977
Monodepth2 (ImageNet pretrain)-0.1150.8824.7010.1900.8790.9610.982
Ranjan et al. [28]-0.1481.1495.4640.2260.8150.9350.973
Ours (w/o RDS)-0.1361.0875.1180.2100.8430.9520.980
Ours (w/o PU)-0.1150.7994.2820.2530.8820.9650.981
Ours-0.1060.7014.1290.2100.8890.9670.984
+ +![](images/4ff5fcdb5b68250c9244b8ad96f027f2e3d73245b4c089ff267c6d667ec32c5e.jpg) +Input +Figure 6. Depth estimation results on KITTI dataset. Thanks to our triangulation process and multi-frame depth refinement, our method shows better predictions and preserves sharp edges while other methods tend to predict vague depth. Best viewed in color. + +![](images/31902b9e0d5865833e46d19bf6b6701b5fc8bb39bcf3381486e7efbfbdcec909.jpg) +GeoNet + +![](images/a024a9d2c0d0b312b6bd3292604ee6a43b3a0aed8aed3874c9f2ea2cdbacdab0.jpg) +SAVO + +![](images/e94f2262f3e4513b4c288175a8b4b03ce0a888e0696b8e3d3974d81931adaf01.jpg) +Monodepth2 + +![](images/37bafb9a4e34e267a0375f848cc44bf4f5c6df990ee477b4355cedf54cfad9ef.jpg) +Ours + +Table 3. Depth estimation results on KITTI dataset by Eigen et al. [6] split. The results are capped at 80 meters. As for error metrics Abs Rel, Seq Rel, RMSE and RMSE log, lower value is better; as for accuracy metrics $\delta$ ,higher value is better. w/o RDS: without refined depth for online supervision. w/o PU: without online learned photometric uncertainty. + +
MethodRelError log10RMSEAccuracy δ < 1.25n
n = 1n = 2n = 3
Make3D [29]0.349-1.2140.4470.7450.987
Li et al. [20]0.2320.0940.8210.6210.8860.968
MS-CRF [36]0.1210.0520.5860.8110.9540.987
DORN [11]0.1150.0510.5090.8280.9650.992
Zhou et al. [46]0.2080.0860.7120.6740.9000.968
Zhao et al. [43]0.2010.0850.7080.6870.9030.968
P2Net* [40]0.1470.0620.5530.8010.9510.987
Ours (w/o RDS)0.2250.0900.7020.7110.8820.970
Ours (w/o PU)0.1420.0870.6310.7840.9230.976
Ours0.1390.0710.5280.8050.9670.989
+ +Table 4. Depth estimation results on NYUv2 dataset. Supervised methods are shown in the first rows. *The inference resolution of $\mathrm{P^2Net}$ is $288\times 384$ with 5-frame left-right flipping augmentation. + +photometric uncertainty (w/o PU) helps a lot on KITTI and TUM for pose estimation. We suggest readers to refer to supplementary materials for more qualitative comparisons. + +# 5. Conclusions + +In this paper, we propose an online adaptation framework for deep VO with the assistance of scene-agnostic geometric computations and Bayesian inference. The predicted single-view depth is continuously improved with incoming observations by Baysian depth filter. Meanwhile, we explicitly model depth and photometric uncertainties to deal with the observation noise. The optimized pose, depth and flow from differentiable Gauss-Newton layer are used for online self-supervision. Extensive experiments on various environment shifting demonstrate that our method has much better generalization ability than state-of-the-art learning-based VO methods. + +Acknowledgments This work is supported by the National Key Research and Development Program of China (2017YFB1002601) and National Natural Science Foundation of China (61632003, 61771026). + +# References + +[1] Jiawang Bian, Zhichao Li, Naiyan Wang, Huangying Zhan, Chunhua Shen, Ming-Ming Cheng, and Ian Reid. Unsupervised Scale-Consistent Depth and Ego-Motion Learning From Monocular Video. In NeurIPS, 2019. 4328 +[2] Tamara Broderick, Nicholas Boyd, Andre Wibisono, Ashia C Wilson, and Michael I Jordan. Streaming Variational Bayes. In NeurIPS, 2013. 4322 +[3] Vincent Casser, Soeren Pirk, Reza Mahjourian, and Anelia Angelova. Depth Prediction without the Sensors: Leveraging Structure for Unsupervised Learning from Monocular Videos. In AAAI, 2019. 4321 +[4] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The Cityscapes Dataset for Semantic Urban Scene Understanding. In CVPR, 2016. 4322, 4325, 4326 +[5] John Duchi, Elad Hazan, and Yoram Singer. Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 12(Jul):2121-2159, 2011. 4322 +[6] David Eigen, Christian Puhrsch, and Rob Fergus. Depth Map Prediction From a Single Image Using a Multi-Scale Deep Network. In NeurIPS, 2014. 4327, 4328 +[7] Jakob Engel, Vladlen Koltun, and Daniel Cremers. Direct Sparse Odometry. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(3):611-625, 2018. 4321, 4322, 4325, 4327 +[8] Jakob Engel, Thomas Schöps, and Daniel Cremers. LSD-SLAM: Large-Scale Direct Monocular SLAM. In ECCV, 2014. 4321, 4322 +[9] Martin A Fischler and Robert C Bolles. Random Sample Consensus: a Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography. Communications of the ACM, 24(6):381-395, 1981. 4323 +[10] Christian Forster, Matia Pizzoli, and Davide Scaramuzza. SVO: Fast Semi-Direct Monocular Visual Odometry. In ICRA, 2014. 4321, 4322, 4324 +[11] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep Ordinal Regression Network for Monocular Depth Estimation. In CVPR, 2018. 4328 +[12] Ravi Garg, Vijay Kumar Bg, Gustavo Carneiro, and Ian Reid. Unsupervised CNN for Single View Depth Estimation: Geometry to the Rescue. In ECCV, 2016. 4328 +[13] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are We Ready for Autonomous Driving? The KITTI Vision Benchmark Suite. In CVPR, 2012. 4322, 4325, 4326, 4327 +[14] Andreas Geiger, Julius Ziegler, and Christoph Stiller. StereoScan: Dense 3D Reconstruction in Real-Time. In 2011 IEEE intelligent vehicles symposium (IV), 2011. 4326, 4327 +[15] Clément Godard, Oisin Mac Aodha, Michael Firman, and Gabriel J Brostow. Digging into Self-Supervised Monocular Depth Estimation. In ICCV, 2019. 4322, 4325, 4328 +[16] Richard I Hartley. In Defense of the Eight-Point Algorithm. PAMI, 19(6):580-593, 1997. 4322 + +[17] Mingxing Hu, Gordon Dodds, and Baozong Yuan. Evolutionary agents for epipolar geometry estimation. In ICIP, 2004. 4322 +[18] Diederik P Kingma and Jimmy Ba. Adam: A method for Stochastic Optimization. In ICLR, 2015. 4325 +[19] Vincent Lepetit, Francesc Moreno-Noguer, and Pascal Fua. Epnp: An Accurate O (n) Solution to the PnP Problem. IJCV, 81(2):155, 2009. 4322, 4323 +[20] Bo Li, Chunhua Shen, Yuchao Dai, Anton Van Den Hengel, and Mingyi He. Depth and Surface Normal Estimation from Monocular Images Using Regression on Deep Features and Hierarchical CRFs. In CVPR, 2015. 4328 +[21] Shunkai Li, Xin Wang, Yingdian Cao, Fei Xue, Zike Yan, and Hongbin Zha. Self-Supervised Deep Visual Odometry with Online Adaptation. In CVPR, 2020. 4321, 4322, 4326, 4327 +[22] Shunkai Li, Fei Xue, Xin Wang, Zike Yan, and Hongbin Zha. Sequential Adversarial Learning for Self-Supervised Deep Visual Odometry. In ICCV, 2019. 4321, 4322, 4326, 4327, 4328 +[23] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep Transfer Learning with Joint Adaptation Networks. In ICML, 2017. 4322 +[24] Reza Mahjourian, Martin Wicke, and Anelia Angelova. Unsupervised Learning of Depth and Ego-Motion from Monocular Video Using 3D Geometric Constraints. In CVPR, 2018. 4326, 4327, 4328 +[25] Reza Mahjourian, Martin Wicke, and Anelia Angelova. Unsupervised Learning of Depth and Ego-Motion from Monocular Video Using 3D Geometric Constraints. In CVPR, 2018. 4328 +[26] Raul Mur-Artal, Jose Maria Martinez Montiel, and Juan D Tardos. ORB-SLAM: A Versatile and Accurate Monocular SLAM System. IEEE Transactions on Robotics, 31(5):1147-1163, 2015. 4321, 4322, 4324, 4326, 4327 +[27] Adam Paszke, Sam Gross, Soumith Chintala, and Gregory Chanan. PyTorch. https://github.com/pytorch/pytorch, 2017.4325 +[28] Anurag Ranjan, Varun Jampani, Lukas Balles, Kihwan Kim, Deqing Sun, Jonas Wulff, and Michael J Black. Competitive Collaboration: Joint Unsupervised Learning of Depth, Camera Motion, Optical Flow and Motion Segmentation. In CVPR, 2019. 4322, 4325, 4328 +[29] Ashutosh Saxena, Min Sun, and Andrew Y Ng. Make3D: Learning 3D Scene Structure from a Single Still Image. PAMI, 31(5):824-840, 2008. 4328 +[30] Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from rgbd images. In ECCV, 2012. 4322, 4327 +[31] Jürgen Sturm, Nikolas Engelhard, Felix Endres, Wolfram Burgard, and Daniel Cremers. A Benchmark for the Evaluation of RGB-D SLAM Systems. In IROS, 2012. 4322, 4325, 4326 +[32] Zachary Teed and Jia Deng. RAFT: Recurrent All-Pairs Field Transforms for Optical Flow. In ECCV, 2020. 4323, 4325 +[33] Sebastian Thrun. Lifelong learning algorithms. In Learning to learn, pages 181-209. Springer, 1998. 4322 + +[34] George Vogiatzis and Carlos Hernández. Video-Based, Real-Time Multi-View Stereo. Image and Vision Computing, 29(7):434-441, 2011. 4324 +[35] Sen Wang, Ronald Clark, Hongkai Wen, and Niki Trigoni. DeepVO: Towards End-to-End Visual Odometry with Deep Recurrent Convolutional Neural Networks. In ICRA, 2017. 4322 +[36] Dan Xu, Elisa Ricci, Wanli Ouyang, Xiaogang Wang, and Nicu Sebe. Multi-Scale Continuous CRFs as Sequential Deep networks for Monocular Depth Estimation. In CVPR, 2017. 4328 +[37] Fei Xue, Xin Wang, Shunkai Li, Qiuyuan Wang, Junqiu Wang, and Hongbin Zha. Beyond Tracking: Selecting Memory and Refining Poses for Deep Visual Odometry. In CVPR, 2019. 4322 +[38] Nan Yang, Lukas von Stumberg, Rui Wang, and Daniel Cremers. D3VO: Deep Depth, Deep Pose and Deep Uncertainty for Monocular Visual Odometry. In CVPR, 2020. 4327 +[39] Zhichao Yin and Jianping Shi. GeoNet: Unsupervised Learning of Dense Depth, Optical Flow and Camera Pose. In CVPR, 2018. 4321, 4326, 4327, 4328 +[40] Zehao Yu, Lei Jin, and Shenghua Gao. P2Net: Patch-match and Plane-regularization for Unsupervised Indoor Depth Estimation. In ECCV. 4328 +[41] Huangying Zhan, Ravi Garg, Chamara Saroj Weerasekera, Kejie Li, Harsh Agarwal, and Ian Reid. Unsupervised Learning of Monocular Depth Estimation and Visual Odometry with Deep Feature Reconstruction. In CVPR, 2018. 4326, 4327, 4328 +[42] Huangying Zhan, Chamara Saroj Weerasekera, Jiawang Bian, and Ian Reid. Visual Odometry Revisited: What Should be Learned? ICRA, 2020. 4323, 4326, 4327 +[43] Wang Zhao, Shaohui Liu, Yezhi Shu, and Yong-Jin Liu. Towards Better Generalization: Joint Depth-Pose Learning without PoseNet. In CVPR, 2020. 4322, 4326, 4327, 4328 +[44] Yiran Zhong, Hongdong Li, and Yuchao Dai. Open-World Stereo Video Matching with Deep RNN. In ECCV, 2018. 4321, 4322 +[45] Huizhong Zhou, Benjamin Ummenhofer, and Thomas Brox. DeepTAM: Deep Tracking and Mapping. In ECCV, 2018. 4322 +[46] Junsheng Zhou, Yuwang Wang, Kaihuai Qin, and Wenjun Zeng. Moving Indoor: Unsupervised Video Depth Learning in Challenging Environments. In ICCV, 2019. 4328 +[47] Tinghui Zhou, Matthew Brown, Noah Snavely, and David G Lowe. Unsupervised Learning of Depth and Ego-Motion from Video. In CVPR, 2017. 4321, 4322, 4324, 4328 \ No newline at end of file diff --git a/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/images.zip b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2892086ff85cef98c3d8a7abf55e20798530191b --- /dev/null +++ b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:709491ed1f19d70b329e833cca211e170a96e6949ba32570c35389f51d0d3d94 +size 869163 diff --git a/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/layout.json b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fceb0baf2de777427e8e912a01c4a2387e3c7d23 --- /dev/null +++ b/generalizingtotheopenworlddeepvisualodometrywithonlineadaptation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef17faf86adab67f9655ab4b632311b0fe477fc5ee9ed8dae7be6735d6058ff7 +size 448618 diff --git a/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_content_list.json b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..45dc68bb6ae5e1b2b3e5e432070013d9ab368bb2 --- /dev/null +++ b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c332dba2f003849701a95bef4d42caff37f43fa1f8644562a14972ade7e0087 +size 72638 diff --git a/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_model.json b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c1d0033a3cf6f328da9649866badd669e3a18d68 --- /dev/null +++ b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cf35c937bc618f757472a931e2bd85661d96d0e68621b57a9c78a568d9bd64c +size 87843 diff --git a/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_origin.pdf b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6faaf1f5a58e427a77ca36ece541000c0cb69e3b --- /dev/null +++ b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/82c87cc9-3101-48ac-af50-3482ddef1b26_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8516a2db423243044abffb6468a38c065be6d9454290baa0ae616180aa83a68 +size 2088104 diff --git a/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/full.md b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cf71efd46b4472e19c06b1e89fa0207b551beba6 --- /dev/null +++ b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/full.md @@ -0,0 +1,296 @@ +# Generating Diverse Structure for Image Inpainting With Hierarchical VQ-VAE + +Jialun Peng $^{1}$ Dong Liu $^{1*}$ + +Songcen Xu² Houqiang Li¹ + +1 University of Science and Technology of China 2 Noah's Ark Lab, Huawei Technologies Co., Ltd. + +pjl@mail.ustc.edu.cn, {dongeliu, lihq}@ustc.edu.cn, xusongcen@huawei.com + +# Abstract + +Given an incomplete image without additional constraint, image inpainting natively allows for multiple solutions as long as they appear plausible. Recently, multiple-solution inpainting methods have been proposed and shown the potential of generating diverse results. However, these methods have difficulty in ensuring the quality of each solution, e.g. they produce distorted structure and/or blurry texture. We propose a two-stage model for diverse inpainting, where the first stage generates multiple coarse results each of which has a different structure, and the second stage refines each coarse result separately by augmenting texture. The proposed model is inspired by the hierarchical vector quantized variational auto-encoder (VQ-VAE), whose hierarchical architecture disentangles structural and textural information. In addition, the vector quantization in VQ-VAE enables autoregressive modeling of the discrete distribution over the structural information. Sampling from the distribution can easily generate diverse and high-quality structures, making up the first stage of our model. In the second stage, we propose a structural attention module inside the texture generation network, where the module utilizes the structural information to capture distant correlations. We further reuse the VQ-VAE to calculate two feature losses, which help improve structure coherence and texture realism, respectively. Experimental results on CelebA-HQ, Places2, and ImageNet datasets show that our method not only enhances the diversity of the inpainting solutions but also improves the visual quality of the generated multiple images. Code and models are available at: https://github.com/USTC-JialunPeng/Diverse-Structure-Inpainting. + +# 1. Introduction + +Image inpainting refers to the task of filling in the missing region of an incomplete image so as to produce a complete and visually plausible image. Inpainting benefits a se + +![](images/d7843f9d6459b5a17fad17f2bebaa358f0a9888a625534a0afd2fdfd2323a52d.jpg) + +![](images/341c6d5b465e3ade5b41aa56f6b48b7ddf20872de38939c5e9474721d14a12d7.jpg) + +![](images/7b702a2794551c23db4447f61bdd1cdad9be870481f9ed67a9f9b52f4d10c09f.jpg) + +![](images/782ed5a0ae36af794b776912e67f2a8aca2b87f9326fb2bed6371053f2e8423a.jpg) + +![](images/c0ca53a1766d3a2519ac9a3e12dfe88c31332553ecc2c2cb528fe08d110e7c5c.jpg) +Figure 1. (Top) Input incomplete image, where the missing region is depicted in gray. (Middle) Visualization of the generated diverse structures. (Bottom) Output images of our method. + +![](images/6dbd01556ca90935a45ce0dee4e521bb3fc6fe0ff2052c86c3888c097a948ccd.jpg) + +![](images/ec0fc8e34c3422b97853891b66474f4adf1f38316c01915f715e191aa5178e2e.jpg) + +ries of applications including object removal, photo restoration, and transmission error concealment. As an ill-posed problem, inpainting raises a great challenge especially when the missing region is large and contains complex content. As such, inpainting has attracted much research attention. + +Recently, a series of deep learning-based methods are proposed for inpainting [10, 19]. They usually employ encoder-decoder architectures and train the networks with the combinations of reconstruction and adversarial losses. To enhance the visual quality of the results, a number of studies [23, 26, 32, 34, 36] adopt the contextual attention mechanisms to use the available content for generating the missing content. Also, several studies [13, 33, 35] propose modified convolutions in replacement of normal convolutions to reduce the artifacts. + +The aforementioned methods all learn a deterministic mapping from an incomplete image to a complete im + +age. However, in practice, the solution to inpainting is not unique. Without additional constraint, multiple inpainting results are equally/similarly plausible for an incomplete image, especially when the missing region is large and contains complex content (e.g. Figure 1). Moreover, for typical applications, providing multiple inpainting results may enable the user to select from them according to his/her own preference. It then motivates the design for multiple-solution inpainting. + +In contrast to single-solution methods, multiple-solution inpainting shall build a probabilistic model of the missing content conditioned on the available content. Several recent studies [38, 39] employ variational auto-encoder (VAE) architectures and train the networks with the combinations of Kullback-Leibler (KL) divergences and adversarial losses. VAE-based methods [38, 39] assume a Gaussian distribution over continuous latent variables. Sampling from the Gaussian distribution presents diverse latent features and leads to diverse inpainted images. Although these methods can generate multiple solutions, some of their solutions are of low quality due to distorted structures and/or blurry textures. It may be attributed to the limitation of the parametric (e.g. Gaussian) distribution when we try to model the complex natural image content. In addition, recent studies more and more demonstrate the importance of structural information, e.g. segmentation maps [12, 27], edges [17, 30], and smooth images [14, 21], for guiding image inpainting. Such structural information is yet to be incorporated into multiple-solution inpainting. Thus, VAE-based methods [38, 39] tend to produce multiple results with limited structural diversity, which is called posterior collapse in [29]. + +In this paper we try to address the limitations of the existing multiple-solution inpainting methods. First, instead of parametric distribution modeling of continuous variables, we resort to autoregressive modeling of discrete variables. Second, we want to generate multiple structures in an explicit fashion, and then base the inpainting upon the generated structure. We find that the hierarchical vector quantized VAE (VQ-VAE) [20] is suitable for our study1. First, there is a vector quantization step in VQ-VAE making the latent variables to be all discrete; as noted in [29], these discrete latent variables allow the usage of powerful decoders to avoid the posterior collapse. Second, the hierarchical layout encourages the split of the image information into global and local parts; with proper design, it may disentangle structural features from textural features of an image. + +Based on the hierarchical VQ-VAE, we propose a two-stage model for multiple-solution inpainting. The first stage is known as diverse structure generator, where sampling from a conditional autoregressive distribution pro + +duces multiple sets of structural features. The second stage is known as texture generator, where an encoder-decoder architecture is used to produce a complete image based on the guidance of a set of structural features. Note that each set of the generated structural features leads to a complete image (see Figure 1). + +The main contributions we have made in this paper can be summarized as follows: + +- We propose a multiple-solution image inpainting method based on hierarchical VQ-VAE. The method has two distinctions from previous multiple-solution methods: first, the model learns an autoregressive distribution over discrete latent variables; second, the model splits structural and textural features. +- We propose to learn a conditional autoregressive network for the distribution over structural features. The network manages to generate reasonable structures with high diversity. +- For texture generation we propose a structural attention module to capture distant correlations of structural features. We also propose two new feature losses to improve structure coherence and texture realism. +- Extensive experiments on three benchmark datasets including CelebA-HQ, Places2, and ImageNet demonstrate the superiority of our proposed method in both quality and diversity. + +# 2. Related Work + +# 2.1. Image Inpainting + +Traditional image inpainting methods such as diffusion-based methods [1, 4] and patch-based methods [2, 5, 7, 8] borrow image-level patches from source images to fill in the missing regions. They are unable to generate unique content not found in the source images. Furthermore, these methods often generate unreasonable results without considering high-level semantics of the images. + +Recently, learning-based methods which use deep convolutional networks are proposed to semantically predict the missing regions. Pathak et al. [19] first apply adversarial learning to the image inpainting. Iizuka et al. [10] introduce an extra discriminator to enforce the local consistency. Yan et al. [32] and Yu et al. [34] propose patch-swap and contextual attention to make use of distant feature patches for the higher inpainting quality. Liu et al. [13] and Yu et al. [35] introduce partial convolutions and gated convolutions to reduce visual artifacts caused by normal convolutions. In order to generate reasonable structures and realistic textures, Nazeri et al. [17] and Xu et al. [31] use edge maps as structural information to guide image inpainting. Ren et al. [21] propose to use edge-preserved smooth images instead of edge maps. Liu et al. [14] propose feature equalizations to improve the consistency between the structure and the texture. However, these learning-based meth + +ods only generate one optimal result for each incomplete input. They focus on reconstructing ground truth rather than creating plausible results. + +To obtain multiple inpainting solutions, Zheng et al. [39] propose a VAE-based model with two parallel paths, which trades off between reconstructing ground truth and maintaining the diversity of the inpainting results. Zhao et al. [38] propose a similar VAE-based model which uses instance images to improve the diversity. However, these methods do not effectively separate the structural and textural information, they often produce distorted structures and/or blurry textures. + +# 2.2. VQ-VAE and Autoregressive Networks + +The vector quantized variational auto-encoder (VQ-VAE) [29] is a discrete latent VAE model which relies on vector quantization layers to model discrete latent variables. The discrete latent variables allow a powerful autoregressive network such as PixelCNN [6, 18, 25, 28] to model latents without worrying about the posterior collapse problem [29]. Razavi et al. [20] propose a hierarchical VQ-VAE which uses a hierarchy of discrete latent variables to separate the structural and textural information. Then they use two PixelCNNs to model structural and textural information, respectively. However, the PixelCNNs are conditioned on the class label for image generation, while there is no class label in the image inpainting task. Besides, the generated textures of the PixelCNNs lack fine-grained details due to the lossy nature of VQ-VAE. It relieves the generation model from modeling negligible information, but it hinders the inpainting model from generating realistic textures consistent with the known regions. The PixelCNNs are thus not practical for image inpainting. + +# 3. Method + +As shown in Figure 2, the pipeline of our method consists of three parts: hierarchical VQ-VAE $E_{vq} - D_{vq}$ , diverse structure generator $G_{s}$ and texture generator $G_{t}$ . The hierarchical encoder $E_{vq}$ disentangles discrete structural features and discrete textural features of the ground truth $\mathbf{I}_{\mathrm{gt}}$ and the decoder $D_{vq}$ outputs the reconstructed image $\mathbf{I}_{\mathrm{r}}$ . The diverse structure generator $G_{s}$ produces diverse discrete structural features given an input incomplete image $\mathbf{I}_{\mathrm{in}}$ . The texture generator $G_{t}$ synthesizes the image texture given the discrete structural features and outputs the completion result $\mathbf{I}_{\mathrm{comp}}$ . We also use the pre-trained $E_{vq}$ as an auxiliary evaluator to define two novel feature losses for better visual quality of the completion result. + +# 3.1. Hierarchical VQ-VAE + +In order to disentangle structural and textural information, we pre-train a hierarchical VQ-VAE $E_{vq} - D_{vq}$ following [20]. The hierarchical encoder $E_{vq}$ maps ground truth + +$\mathbf{I}_{\mathrm{gt}}$ onto structural features $\mathbf{s}_{\mathrm{gt}}$ and textural features $\mathbf{t}_{\mathrm{gt}}$ . The processing of $E_{vq}$ can be written as $(\mathbf{s}_{\mathrm{gt}},\mathbf{t}_{\mathrm{gt}}) = E_{vq}(\mathbf{I}_{\mathrm{gt}})$ . These features are then quantized to discrete features by two vector quantization layers. Each vector quantization layer has $K = 512$ prototype vectors in its codebook and the vector dimensionality is $D = 64$ . As such, each vector of features is replaced by the nearest prototype vector based on Euclidean distance. The processing of vector quantization can be written as $\bar{\mathbf{s}}_{\mathrm{gt}} = VQ_s(\mathbf{s}_{\mathrm{gt}})$ and $\bar{\mathbf{t}}_{\mathrm{gt}} = VQ_t(\mathbf{t}_{\mathrm{gt}})$ . Finally, the decoder $D_{vq}$ reconstructs image from these two sets of discrete features. The processing of $D_{vq}$ can be written as $\mathbf{I}_{\mathrm{r}} = D_{vq}(\bar{\mathbf{s}}_{\mathrm{gt}},\bar{\mathbf{t}}_{\mathrm{gt}})$ . + +The reconstruction loss of $E_{vq} - D_{vq}$ is defined as: + +$$ +\mathcal {L} _ {\ell_ {2}} = \left\| \mathbf {I} _ {\mathrm {r}} - \mathbf {I} _ {\mathrm {g t}} \right\| _ {2} ^ {2} \tag {1} +$$ + +To back-propagate the gradient of the reconstruction loss through vector quantization, we use the straight-through gradient estimator [3]. The codebook prototype vectors are updated using the exponential moving average of the encoder output. As proposed in [29], we also use two commitment losses $\mathcal{L}_{sc}$ and $\mathcal{L}_{tc}$ to align the encoder output with the codebook prototype vectors for stable training. The commitment loss of structural features is defined as: + +$$ +\mathcal {L} _ {s c} = \left\| \mathbf {s} _ {\mathrm {g t}} - s g \left[ \bar {\mathbf {s}} _ {\mathrm {g t}} \right] \right\| _ {2} ^ {2} \tag {2} +$$ + +where $sg$ denotes the stop-gradient operator [29]. The commitment loss of textural features (denoted as $\mathcal{L}_{tc}$ ) is similar to $\mathcal{L}_{sc}$ . The total loss of $E_{vq} - D_{vq}$ is defined as: + +$$ +\mathcal {L} _ {v q} = \alpha_ {\ell_ {2}} \mathcal {L} _ {\ell_ {2}} + \alpha_ {c} \left(\mathcal {L} _ {s c} + \mathcal {L} _ {t c}\right) \tag {3} +$$ + +where $\alpha_{\ell_2}$ and $\alpha_{c}$ are loss weights. + +For $256 \times 256$ images, the size of structural features is $32 \times 32$ and that of textural features is $64 \times 64$ . We visualize their discrete representations using the decoder $D_{vq}$ . The visualized results can be written as $D_{vq}(\overline{\mathbf{s}}_{\mathrm{gt}}, \mathbf{0})$ and $D_{vq}(\mathbf{0}, \overline{\mathbf{t}}_{\mathrm{gt}})$ , where $\mathbf{0}$ is a zero tensor. As shown in Figure 2, the structural features model global information such as shapes and colors, and the textural features model local information such as details and textures. + +# 3.2. Diverse Structure Generator + +Previous multiple-solution inpainting methods [38, 39] often produce distorted structures and/or blurry textures, suggesting that these methods struggle to recover the structure and the texture simultaneously. Therefore, we first propose a diverse structure generator $G_{s}$ which uses an autoregressive network to formulate a conditional distribution over the discrete structural features. Sampling from the distribution can produce diverse structural features. + +Similar to the PixelCNN in [20], our autoregressive network consists of 20 residual gated convolution layers and + +![](images/72d449393f820515117229363c05b589fca3a2375a87ac769ea947319f8ff43d.jpg) +Figure 2. Overview of the proposed method. (Top) Hierarchical vector quantized variational auto-encoder (VQ-VAE) consists of hierarchical encoder $E_{vq}$ and decoder $D_{vq}$ . $E_{vq}$ extracts discrete structural features $\bar{\mathbf{s}}_{\mathrm{gt}}$ and discrete textural features $\bar{\mathbf{t}}_{\mathrm{gt}}$ . $D_{vq}$ reconstructs the image from these two sets of discrete features. (Middle) Diverse structure generator $G_{s}$ models the conditional distribution over the discrete structural features by using an autoregressive network, where $\bar{\mathbf{s}}_{\mathrm{gt}}$ is used to calculate the loss $\mathcal{L}_{NLL}$ . During inference, sampling from the distribution can generate multiple possible structural features $\bar{\mathbf{s}}_{\mathrm{gen}}$ . (Bottom) Texture generator $G_{t}$ synthesizes the image texture given the discrete structural features $(\bar{\mathbf{s}}_{\mathrm{gt}}$ in the training and $\bar{\mathbf{s}}_{\mathrm{gen}}$ in the inference). The pre-trained $E_{vq}$ is used as an auxiliary evaluator to improve image quality, where $\bar{\mathbf{s}}_{\mathrm{gt}}$ and $\bar{\mathbf{t}}_{\mathrm{gt}}$ are used to calculate the losses $\mathcal{L}_{sf}$ and $\mathcal{L}_{tf}$ . During training, the hierarchical VQ-VAE is firstly trained, and then $G_{s}$ and $G_{t}$ are trained individually. During inference, only $G_{s}$ and $G_{t}$ are used. + +4 casual multi-headed attention layers. Since the PixelCNN in [20] is conditioned on the class label for the image generation task, we make two modifications to make it practical for the image inpainting task. First, we stack gated convolution layers to map the input incomplete image $\mathbf{I}_{\mathrm{in}}$ and its binary mask $\mathbf{M}$ to a condition. The condition is injected into each residual gated convolution layer of the autoregressive network. Second, we use a light-weight autoregressive network by reducing both the hidden units and the residual units to 128 for efficiency. + +During training, $G_{s}$ utilizes the input incomplete image as the condition and models the conditional distribution over $\bar{\mathbf{s}}_{\mathrm{gt}}$ . This distribution can be written as $p_{\theta}(\bar{\mathbf{s}}_{\mathrm{gt}}|\mathbf{I}_{\mathrm{in}},\mathbf{M})$ , where $\theta$ denotes network parameters of $G_{s}$ . The training loss of $G_{s}$ is defined as the negative log likelihood of $\bar{\mathbf{s}}_{\mathrm{gt}}$ : + +$$ +\mathcal {L} _ {N L L} = - \mathbb {E} _ {\mathbf {I} _ {\mathrm {g t}} \sim p _ {d a t a}} \left[ \log p _ {\theta} (\bar {\mathbf {s}} _ {\mathrm {g t}} | \mathbf {I} _ {\mathrm {i n}}, \mathbf {M}) \right] \tag {4} +$$ + +where $p_{data}$ denotes the distribution of training dataset. During inference, $G_{s}$ utilizes the input incomplete image + +as condition and outputs a conditional distribution for generating structural features. This distribution can be written as $p_{\theta}(\bar{\mathbf{s}}_{\mathrm{gen}}|\mathbf{I}_{\mathrm{in}},\mathbf{M})$ . Sampling from $p_{\theta}(\bar{\mathbf{s}}_{\mathrm{gen}}|\mathbf{I}_{\mathrm{in}},\mathbf{M})$ sequentially can generate diverse discrete structural features $\bar{\mathbf{s}}_{\mathrm{gen}}$ . + +Due to the low-resolution of structural features, our diverse structure generator can better capture global information. It thus helps generate reasonable global structures. In addition, the training objective of our diverse structure generator is to maximize likelihood of all samples in the training set without any additional loss. Thus, the generated structures do not suffer from GAN's known shortcomings such as mode collapse and lack of diversity. + +# 3.3. Texture Generator + +Network Architecture. After obtaining the generated structural features $\bar{\mathbf{s}}_{\mathrm{gen}}$ , our texture generator $G_{t}$ synthesizes the image texture based on the guidance of $\bar{\mathbf{s}}_{\mathrm{gen}}$ . The network architecture of $G_{t}$ is similar to the refine network in [33]. As shown in Figure 2, the network architecture consists of gated convolutions and dilated convolutions. Unlike + +existing inpainting methods, our texture generator $G_{t}$ utilizes the given structural features as guidance. The structural features are not only input to the first few layers of $G_{t}$ , but also input to our structural attention module. The proposed structural attention module borrows distant information based on the correlations of the structural features. It thus ensures that the synthesized texture is consistent with the generated structure. + +Let $\mathbf{I}_{\mathrm{out}}$ denote the output of $G_{t}$ . The final completion result $\mathbf{I}_{\mathrm{comp}}$ is the output $\mathbf{I}_{\mathrm{out}}$ with the non-masked pixels directly set to ground truth. During training, $G_{t}$ takes the ground truth structural features $\bar{\mathbf{s}}_{\mathrm{gt}}$ as input so that $\mathbf{I}_{\mathrm{comp}}$ is the reconstruction of ground truth. During inference, $G_{t}$ takes the generated structural features $\bar{\mathbf{s}}_{\mathrm{gen}}$ as input so that $\mathbf{I}_{\mathrm{comp}}$ is the inpainting result. + +Structural Attention Module. Attention modules are widely used in the existing image inpainting methods. They generally calculate the attention scores on a low-resolution intermediate feature map of the network. However, due to the lack of direct supervision on the attention scores, the learned attention is insufficiently reliable [41]. These attention modules may refer to unsuitable features, resulting in poor inpainting quality. To address this problem, we propose a structural attention module which directly calculates the attention scores on the structural features. Intuitively, regions with similar structures should have similar textures. Calculating the attention scores on the structural features can model accurate long-range correlations of structural information, thereby improving the consistency between the synthesized texture and the generated structure. + +In addition, the attention modules in the existing image inpainting methods distinguish the foreground features and the background features using the down-sampled mask. This hand-crafted design may incorrectly divide the feature map and produce artifacts in the inpainting result. Therefore, our structural attention module calculates full attention scores on the structural features. Unlike the foreground-background cross attention that only models correlations between the foreground and the background, our full attention learns full correlations regardless of the feature division. It thus maintains the global consistency of the inpainting result. Moreover, our full attention does not increase the amount of calculation compared to the cross attention. + +Like [33], our structural attention module consists of an attention computing step and an attention transfer step. The attention computing step extracts $3 \times 3$ patches from the input structural features. Then, the truncated distance similarity score [23] between the patches at $(x,y)$ and $(x',y')$ is defined as: + +$$ +\tilde {d} _ {(x, y), \left(x ^ {\prime}, y ^ {\prime}\right)} = \tanh \left(- \left(\frac {d _ {(x , y) , \left(x ^ {\prime} , y ^ {\prime}\right)} - m}{\sigma}\right)\right) \tag {5} +$$ + +where $d_{(x,y),(x',y')}$ is the Euclidean distance, $m$ and $\sigma$ are the mean value and the standard deviation of $d_{(x,y),(x',y')}$ . + +The truncated distance similarity scores are applied by a scaled sotfmax layer to output full attention scores: + +$$ +s _ {(x, y), \left(x ^ {\prime}, y ^ {\prime}\right)} ^ {*} = \operatorname {s o f t m a x} \left(\lambda_ {1} \tilde {d} _ {(x, y), \left(x ^ {\prime}, y ^ {\prime}\right)}\right) \tag {6} +$$ + +where $\lambda_{1} = 50$ . After obtaining the full attention scores from the structural features, the attention transfer step reconstructs lower-level feature maps $(P^{l})$ by using the full attention scores as weights: + +$$ +q _ {(x ^ {\prime}, y ^ {\prime})} ^ {l} = \sum_ {x, y} s _ {(x, y), (x ^ {\prime}, y ^ {\prime})} ^ {*} p _ {(x, y)} ^ {l} \tag {7} +$$ + +where $l \in (1,2)$ is the layer number and $p_{(x,y)}^{l}$ is the patch of $P^l$ , and $q_{(x',y')}^{l}$ is the patch of the reconstructed feature map. The size of patches varies according to the size of feature map like [33]. Finally, the reconstructed feature maps supplement the decoder of $G_t$ via skip connections. + +Training Losses. The total loss of $G_{t}$ consists of a reconstruction loss, an adversarial loss, and two feature losses. The reconstruction loss of $G_{t}$ is defined as: + +$$ +\mathcal {L} _ {\ell_ {1}} = \left\| \mathbf {I} _ {\text {o u t}} - \mathbf {I} _ {\mathrm {g t}} \right\| _ {1} \tag {8} +$$ + +We use SN-PatchGAN [35] as our discriminator $D_{t}$ . The hinge version of the adversarial loss for $D_{t}$ is defined as: + +$$ +\begin{array}{l} \mathcal {L} _ {d} = \mathbb {E} _ {\mathbf {I} _ {\mathrm {g t}} \sim p _ {d a t a}} \left[ \operatorname {R e L U} \left(1 - D _ {t} \left(\mathbf {I} _ {\mathrm {g t}}\right)\right) \right] \tag {9} \\ + \mathbb {E} _ {\mathbf {I} _ {\mathrm {c o m p}} \sim p _ {z}} [ \mathrm {R e L U} (1 + D _ {t} (\mathbf {I} _ {\mathrm {c o m p}})) ] \\ \end{array} +$$ + +where $p_z$ denotes the distribution of the inpainting results. The adversarial loss for $G_{t}$ is defined as: + +$$ +\mathcal {L} _ {a d v} = - \mathbb {E} _ {\mathbf {I} _ {\mathrm {c o m p}} \sim p _ {z}} \left[ D _ {t} \left(\mathbf {I} _ {\mathrm {c o m p}}\right) \right] \tag {10} +$$ + +Some inpainting methods such as [13, 14] use the pretrained VGG-16 as an auxiliary evaluator to improve the perceptual quality of the results. They define a perceptual loss and a style loss based on the VGG features to train the generator. Inspired by these feature losses, we propose two novel feature losses by reusing our pre-trained hierarchical encoder $E_{vq}$ as an auxiliary evaluator. As shown in Figure 2, $E_{vq}$ maps $\mathbf{I}_{\mathrm{comp}}$ onto structural features $\mathbf{s}_{\mathrm{comp}}$ and textural features $\mathbf{t}_{\mathrm{comp}}$ . The structural feature loss of $G_{t}$ is defined as the multi-class cross-entropy between $\mathbf{s}_{\mathrm{comp}}$ and $\overline{\mathbf{s}}_{\mathrm{gt}}$ : + +$$ +\mathcal {L} _ {s f} = - \sum_ {i, j} I _ {i j} \log \left(\operatorname {s o f t m a x} \left(\lambda_ {2} \tilde {d} _ {i j}\right)\right) \tag {11} +$$ + +Here, we set $\lambda_{2} = 10$ . $\tilde{d}_{ij}$ denotes the truncated distance similarity score between the $i^{th}$ feature vector of $\mathbf{s}_{\mathrm{comp}}$ and the $j^{th}$ prototype vector of the structural codebook. $I_{ij}$ is an indicator of the prototype vector class. $I_{ij} = 1$ when the $i^{th}$ feature vector of $\bar{\mathbf{s}}_{\mathrm{gt}}$ belongs to the $j^{th}$ class of the structural codebook, otherwise $I_{ij} = 0$ . The textural feature loss (denoted as $\mathcal{L}_{tf}$ ) is similar to $\mathcal{L}_{sf}$ . The total loss of $G_{t}$ is defined as: + +$$ +\mathcal {L} _ {t g} = \alpha_ {\ell 1} \mathcal {L} _ {\ell 1} + \alpha_ {a d v} \mathcal {L} _ {a d v} + \alpha_ {f} \left(\mathcal {L} _ {s f} + \mathcal {L} _ {t f}\right) \tag {12} +$$ + +where $\alpha_{\ell 1}$ , $\alpha_{adv}$ , and $\alpha_{f}$ are loss weights. + +![](images/3405894268c98c822b802b0ccdbabddbe5978336899f7c177d6e42a700fb025b.jpg) +Figure 3. Qualitative comparison results on two test images of CelebA-HQ. For each group, from top to bottom, from left to right, the pictures are: incomplete image, results of CA [34], GC [35], CSA [15], SF [21], FE [14], results of PIC [39] (with blue box), results of UCTGAN [38] (with green box), and results of our method (with red box). + +![](images/eeb0a2671949b454fed2ecffe2c8335a4f6be33518cf7069b64dbb0c683426de.jpg) +Figure 4. Qualitative comparison results on two test images of Places2. For each group, from top to bottom, from left to right, the pictures are: incomplete image, results of CA [34], GC [35], CSA [15], SF [21], FE [14], results of PIC [39] (with blue box), results of UCTGAN [38] (with green box), and results of our method (with red box). + +
MethodPSNR\( ^\uparrow \)SSIM\( ^\uparrow \)IS\( ^\uparrow \)MIS\( ^\uparrow \)FID\( ^\downarrow \)
Single-SolutionCA [34]23.650.85253.2060.020716.64
GC [35]25.230.87133.3840.023512.24
CSA [15]25.260.88403.4080.019911.78
SF [21]25.050.87173.3600.022910.59
FE [14]24.100.86323.3570.024010.73
Multiple-SolutionPIC [39]23.930.85673.3570.022511.70
UCTGAN [38]24.390.86033.3420.023711.74
Ours24.560.86753.4560.02459.784
+ +Table 1. Quantitative comparison of different methods on the CelebA-HQ test set. For multiple-solution methods, we sample 50 images for each incomplete image and report the average result. Note that PSNR and SSIM are full-reference metrics that compare the generated image with the ground truth, but IS, MIS, and FID are not. For each metric, the best score is highlighted in bold, and the best score within the other category is highlighted in red. + +# 4. Experiments + +# 4.1. Implementation Details + +Our model is implemented in TensorFlow v1.12 and trained on two NVIDIA 2080 Ti GPUs. The batch size is 8. During optimization, the weights of different losses are set to $\alpha_{\ell_1} = \alpha_{\ell_2} = \alpha_{adv} = 1$ , $\alpha_c = 0.25$ , $\alpha_f = 0.1$ . We use the Adam optimizer to train the three parts of our model. The learning rate of $E_{vq} - D_{vq}$ is $10^{-4}$ . The learning rate of $G_s$ follows the linear warm-up and square-root decay schedule used in [20]. The learning rate of $G_t$ is $10^{-4}$ and $\beta_1 = 0.5$ . We also use polyak exponential moving average (EMA) decay of 0.9997 when training $E_{vq} - D_{vq}$ and $G_s$ . Each part is trained for 1M iterations. During training, $E_{vq} - D_{vq}$ is firstly trained, and then $G_s$ and $G_t$ are trained individually. During inference, only $G_s$ and $G_t$ are used. + +# 4.2. Performance Evaluation + +We evaluate our method on three datasets including CelebA-HQ [11], Places2 [40], and ImageNet [22]. We use the original training, testing, and validation splits for these three datasets. For CelebA-HQ, training images are downsampled to $256 \times 256$ and data augmentation is adopted. For Places2 and ImageNet, training images are randomly cropped to $256 \times 256$ . The missing regions of the incomplete images can be regular or irregular. We compare our method with state-of-the-art single-solution and multiple-solution inpainting methods. The single-solution methods among them are CA [34], GC [35], CSA [15], SF [21] and FE [14]. The multiple-solution methods among them are PIC [39] and UCTGAN [38] + +Qualitative Comparisons. Figure 3 and Figure 4 show the qualitative comparison results of center-hole inpainting on CelebA-HQ and Places2, respectively. It is difficult for CA [34], GC [35] and CSA [15] to generate reasonable structures without structural information acts as prior knowledge. SF [21] and FE [14] use edge-preserved smooth images to guide structure generation. However, they strut + +gle to synthesize fine-grained textures, which indicates that their structural information provides limited help to texture generation. PIC [39] and UCTGAN [38] show high diversity. But their results are of low quality, especially for the challenging Places2 test images. Compared to these methods, the results of our method have more reasonable structures and more realistic textures, e.g. fine-grained hair and eyebrows in Figure 3. In addition, the diversity of our method is enhanced, e.g. different eye colors in Figure 3 and varying window sizes in Figure 4. More qualitative results and analyses of artifacts are presented in the supplementary material. + +Quantitative Comparisons. Following previous image inpainting methods, we use common evaluation metrics such as peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) to measure the similarity between the inpainting result and ground truth. However, these full-reference metrics are not suitable for the image inpainting task because there are multiple plausible solutions for an incomplete image. The image inpainting methods are supposed to focus on generating realistic results rather than merely approximating ground truth. Therefore, we also use Inception Score (IS) [24], Modified Inception Score (MIS) [38], and Fréchet Inception Distance (FID) [9] as perceptual quality metrics. These metrics are consistent with human judgment [9]. FID can also detect GAN's known shortcomings such as mode collapse and mode dropping [16]. + +Unlike previous multiple-solution methods [38, 39] that use discriminator to select samples for quantitative evaluation, we use all samples for fair comparison. The comparison is conducted on CelebA-HQ 1000 testing images with $128 \times 128$ center holes. As shown in Table 1, multiple-solution methods score relatively low on PSNR and SSIM because they generate highly diverse results instead of approximating ground truth. Still, our method outperforms PIC [39] and UCTGAN [38] on these two metrics. Furthermore, our method outperforms all the other methods in terms of IS, MIS and FID. + +![](images/ba2b73d294f5a88ba99259439a265141ab51c176937c8b9855d18014f9210d4d.jpg) +Figure 5. Results of the ablation study on the structural attention module. (a) Incomplete image. (b) Using cross attention on the learned features. (c) Using full attention on the learned features. (d) Using cross attention on the structural features. (e) Using full attention on the structural features. [Best viewed with zoom-in.] + +
FullStructuralSSIM↑IS↑FID↓
0.86063.40211.55
✓0.86453.43611.26
✓0.86753.41610.12
✓✓0.86763.4679.670
+ +We also evaluate the diversity of our method using the LPIPS [37] metric. The average score is calculated between consecutive pairs of 50K results which are sampled from 1K incomplete images. Higher score indicates higher diversity. The reported scores of PIC [39] and UCTGAN [38] are 0.029 and 0.030, respectively. Our method achieves a comparable score of 0.029. Please refer to the supplementary material for some discussions about the diversity. + +# 4.3. Ablation Study + +We conduct an ablation study on CelebA-HQ to show the effect of different components of the texture generator $G_{t}$ . Since the structure generator $G_{s}$ can produce diverse structural features, we randomly sample a set of generated structural features. Then we use it across all the following experiments for fair comparison. + +Effect of structural attention module. We compare the effect of different attention modules. The attention module in [33] calculates cross attention scores on the learned features, which often results in texture artifacts (see Figure 5(b)). Using full attention instead of cross attention maintains global consistency (see Figure 5(c)). Using the structural features instead of the learned features improves the consistency between structures and textures (see Figure 5(d)). Our structural attention module calculates full attention scores on the structural features, which can synthesize realistic textures, such as symmetric eyes and eyebrows (see Figure 5(e)). The quantitative results in Table 2 also demonstrate the benefits of our structural attention module. + +Effect of our feature losses. We compare the effect of + +![](images/516284d1a1df263993d1f387a67b65ceabe14fafaf85979a7c3e6189f2639d48.jpg) +Figure 6. Results of the ablation study on the auxiliary losses. (a) Incomplete image. (b) Using no feature losses (but still using $\mathcal{L}_{\ell 1}$ and $\mathcal{L}_{adv}$ ). (c) Using $\mathcal{L}_{sf}$ . (d) Using $\mathcal{L}_{tf}$ . (e) Using both $\mathcal{L}_{sf}$ and $\mathcal{L}_{tf}$ . (f) Using the perceptual and style losses as in [13, 14]. [Best viewed with zoom-in.] + +Table 2. Quantitative comparison for the ablation study on the structural attention module. Refer to Section 4.3 and Figure 5 for description. + +
\( \mathcal{L}_{sf} \)\( \mathcal{L}_{tf} \)\( SSIM^{\uparrow} \)\( IS^{\uparrow} \)\( FID^{\downarrow} \)
0.85813.38311.02
✓0.85893.36711.16
✓0.86253.41410.34
✓✓0.86763.4679.670
\( \mathcal{L}_{perceptual} + \mathcal{L}_{style} \) [13, 14]0.86383.3889.672
+ +Table 3. Quantitative comparison for the ablation study on the auxiliary losses. Refer to Section 4.3 and Figure 6 for description. + +different auxiliary losses. Without any auxiliary loss, the perceptual quality of the inpainting result is not satisfactory (see Figure 6(b)). Using our structural feature loss $\mathcal{L}_{sf}$ can improve structure coherence, such as the shape of nose and mouth (see Figure 6(c)). Using our textural feature loss $\mathcal{L}_{tf}$ can improve texture realism, such as the luster of facial skin (see Figure 6(d)). Using both $\mathcal{L}_{sf}$ and $\mathcal{L}_{tf}$ can generate more natural images (see Figure 6(e)). Compared to our feature losses, perceptual and style losses used in [13, 14] may produce a distorted structure or an inconsistent texture (see Figure 6(f)). The quantitative results in Table 3 also demonstrate the benefits of our feature losses. + +# 5. Conclusion + +We have proposed a multiple-solution inpainting method for generating diverse and high-quality images using hierarchical VQ-VAE. Our method first formulates an autoregressive distribution to generate diverse structures, then synthesizes the image texture for each kind of structure. We propose a structural attention module to ensure that the synthesized texture is consistent with the generated structure. We further propose two feature losses to improve structure coherence and texture realism, respectively. Extensive qualitative and quantitative comparisons show the superiority of our method in both quality and diversity. We demonstrate that the structural information extracted by the hierarchical VQ-VAE is of great benefit for the inpainting task. As for future work, we plan to extend our method to other conditional image generation tasks including style transfer, image super-resolution, and guided editing. + +# References + +[1] Coloma Ballester, Marcelo Bertalmio, Vicent Caseles, Guillermo Sapiro, and Joan Verdera. Filling-in by joint interpolation of vector fields and gray levels. IEEE Trans. Image Process., 10(8):1200-1211, 2001. 2 +[2] 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-33, 2009. 2 +[3] Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. 3 +[4] Marcelo Bertalmio, Guillermo Sapiro, Vincent Caseles, and Coloma Ballester. Image inpainting. In ACM SIGGRAPH, pages 417-424, 2000. 2 +[5] Marcelo Bertalmio, Luminita Vese, Guillermo Sapiro, and Stanley Osher. Simultaneous structure and texture image inpainting. IEEE Trans. Image Process., 12(8):882-889, 2003. 2 +[6] Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. PixelSNAIL: An improved autoregressive generative model. In ICML, pages 864-872, 2018. 3 +[7] Antonio Criminisi, Patrick Pérez, and Kentaro Toyama. Region filling and object removal by exemplar-based image inpainting. IEEE Trans. Image Process., 13(9):1200-1212, 2004. 2 +[8] Iddo Drori, Daniel Cohen-Or, and Hezy Yeshurun. Fragment-based image completion. In ACM SIGGRAPH, pages 303-312. 2003. 2 +[9] 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 NIPS, pages 6626-6637, 2017. 7 +[10] Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and locally consistent image completion. ACM Trans. Graph., 36(4):1-14, 2017. 1, 2 +[11] 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. 7 +[12] Liang Liao, Jing Xiao, Zheng Wang, Chia-Wen Lin, and Shin'ichi Satoh. Guidance and evaluation: Semantic-aware image inpainting for mixed scenes. In ECCV, pages 1-17, 2020. 2 +[13] 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 ECCV, pages 85-100, 2018. 1, 2, 5, 8 +[14] Hongyu Liu, Bin Jiang, Yibing Song, Wei Huang, and Chao Yang. Rethinking image inpainting via a mutual encoder-decoder with feature equalizations. In ECCV, pages 725-741, 2020. 2, 5, 6, 7, 8 +[15] Hongyu Liu, Bin Jiang, Yi Xiao, and Chao Yang. Coherent semantic attention for image inpainting. In ICCV, pages 4170-4179, 2019. 6, 7 + +[16] Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are GANs created equal? A large-scale study. In NIPS, pages 700-709, 2018. 7 +[17] Kamyar Nazeri, Eric Ng, Tony Joseph, Faisal Z. Qureshi, and Mehran Ebrahimi. EdgeConnect: Structure guided image inpainting using edge prediction. In ICCV Workshops, pages 1-10, 2019. 2 +[18] Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In ICML, pages 1747-1756, 2016. 3 +[19] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A. Efros. Context encoders: Feature learning by inpainting. In CVPR, pages 2536-2544, 2016. 1, 2 +[20] Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with VQ-VAE-2. In NeurIPS, pages 14866-14876, 2019. 2, 3, 4, 7 +[21] Yurui Ren, Xiaoming Yu, Ruonan Zhang, Thomas H. Li, Shan Liu, and Ge Li. StructureFlow: Image inpainting via structure-aware appearance flow. In ICCV, pages 181-190, 2019. 2, 6, 7 +[22] Olga Russakovsky, Jia Deng, Hao Su, et al. ImageNet large scale visual recognition challenge. Int. J. Comput. Vis., 115(3):211-252, 2015. 7 +[23] Min-cheol Sagong, Yong-goo Shin, Seung-wook Kim, Seung Park, and Sung-jae Ko. PEPSI: Fast image inpainting with parallel decoding network. In CVPR, pages 11360-11368, 2019. 1, 5 +[24] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In NIPS, pages 2234-2242, 2016. 7 +[25] Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma. PixelCNN++: Improving the PixelCNN with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017. 3 +[26] Yuhang Song, Chao Yang, Zhe Lin, Xiaofeng Liu, Qin Huang, Hao Li, and C.-C. Jay Kuo. Contextual-based image inpainting: Infer, match, and translate. In ECCV, pages 3-19, 2018. 1 +[27] 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. In BMVC, pages 97–110, 2018. 2 +[28] Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with PixelCNN decoders. In NIPS, pages 4790-4798, 2016. 3 +[29] Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In NIPS, pages 6306-6315, 2017. 2, 3 +[30] Wei Xiong, Jiahui Yu, Zhe Lin, Jimei Yang, Xin Lu, Connelly Barnes, and Jiebo Luo. Foreground-aware image inpainting. In CVPR, pages 5840-5848, 2019. 2 +[31] Shunxin Xu, Dong Liu, and Zhiwei Xiong. E2I: Generative inpainting from edge to image. IEEE Trans. Circuit Syst. Video Technol., 2020. 2 + +[32] Zhaoyi Yan, Xiaoming Li, Mu Li, Wangmeng Zuo, and Shiguang Shan. Shift-Net: Image inpainting via deep feature rearrangement. In ECCV, pages 1–17, 2018. 1, 2 +[33] Zili Yi, Qiang Tang, Shekoofeh Azizi, Daesik Jang, and Zhan Xu. Contextual residual aggregation for ultra high-resolution image inpainting. In CVPR, pages 7508-7517, 2020. 1, 4, 5, 8 +[34] 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. 1, 2, 6, 7 +[35] Jiahui Yu, Zhe Lin, Jamei Yang, Xiaohui Shen, Xin Lu, and Thomas S. Huang. Free-form image inpainting with gated convolution. In ICCV, pages 4471-4480, 2019. 1, 2, 5, 6, 7 +[36] 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. 1 +[37] 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. 8 +[38] Lei Zhao, Qihang Mo, Sihuan Lin, Zhizhong Wang, Zhiwen Zuo, Haibo Chen, Wei Xing, and Dongming Lu. UCTGAN: Diverse image inpainting based on unsupervised cross-space translation. In CVPR, pages 5741-5750, 2020. 2, 3, 6, 7, 8 +[39] Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. Pluralistic image completion. In CVPR, pages 1438-1447, 2019. 2, 3, 6, 7, 8 +[40] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Trans. Pattern Anal. Mach. Intell., 40(6):1452-1464, 2017. 7 +[41] Tong Zhou, Changxing Ding, Shaowen Lin, Xinchao Wang, and Dacheng Tao. Learning oracle attention for high-fidelity face completion. In CVPR, pages 7680-7689, 2020. 5 \ No newline at end of file diff --git a/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/images.zip b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9197bd1884cec2e39c1fe339648545de577b396e --- /dev/null +++ b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df39ed2086e6c4ecec4ed324e6cbb0e2b90ff9c2cee180a2ec7977a98e7ecb04 +size 758803 diff --git a/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/layout.json b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..be0d02749cd27efe8b42c6dfed950d989cd93687 --- /dev/null +++ b/generatingdiversestructureforimageinpaintingwithhierarchicalvqvae/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bd047b9aff7f98d791bc64d687f225232eec90869a22f93403f5637161e3e8c +size 427661 diff --git a/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_content_list.json b/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..17c6d988940c56c2a419fb8d60e703bf9bf02da2 --- /dev/null +++ b/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13b11d45bfbb481020d7fdad8209bda4684960372a86efa5456f433b4a53030e +size 77916 diff --git a/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_model.json b/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_model.json new file mode 100644 index 0000000000000000000000000000000000000000..98a64b8182876719c3819b031a53afe4b6bf6690 --- /dev/null +++ b/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9866faa9dc0982296216a2c1046832731bb764a781a96fe7591745b6bb0417a0 +size 97851 diff --git a/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_origin.pdf b/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cee67e8892e1ac86a9bc4cfabdc80471ce4caea6 --- /dev/null +++ b/generatingmangafromillustrationsviamimickingmangacreationworkflow/90196629-b874-4fd9-9ea2-638be4dd8b54_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43f0601c9dca22f321ebbf318592946fc1b2649f90f6e42ba908b20fe4469b1f +size 1713667 diff --git a/generatingmangafromillustrationsviamimickingmangacreationworkflow/full.md b/generatingmangafromillustrationsviamimickingmangacreationworkflow/full.md new file mode 100644 index 0000000000000000000000000000000000000000..32dc5e871265034d6b0a7b6261a71713adc81e45 --- /dev/null +++ b/generatingmangafromillustrationsviamimickingmangacreationworkflow/full.md @@ -0,0 +1,403 @@ +# Generating Manga from Illustrations via Mimicking Manga Creation Workflow + +Lvmin Zhang +Soochow University / Style2Paints Research +China + +Ivminzhang@acm.org + +Xinrui Wang +The University of Tokyo / Tencent +China + +secret_wang@outlook.com + +Qingnan Fan +Stanford University +United States + +fqnchina@gmail.com + +Yi Ji +Soochow University +China + +jiyi@suda.edu.cn + +Chunping Liu +Soochow University +China + +cpliu@suda.edu.cn + +# Abstract + +We present a framework to generate manga from digital illustrations. In professional mange studios, the manga create workflow consists of three key steps: (1) Artists use line drawings to delineate the structural outlines in manga storyboards. (2) Artists apply several types of regular screentones to render the shading, occlusion, and object materials. (3) Artists selectively paste irregular screen textures onto the canvas to achieve various background layouts or special effects. Motivated by this workflow, we propose a data-driven framework to convert a digital illustration into three corresponding components: manga line drawing, regular screentone, and irregular screen texture. These components can be directly composed into manga images and can be further retouched for more plentiful manga creations. To this end, we create a large-scale dataset with these three components annotated by artists in a human-in-the-loop manner. We conduct both perceptual user study and qualitative evaluation of the generated manga, and observe that our generated image layers for these three components are practically usable in the daily works of manga artists. We provide 60 qualitative results and 15 additional comparisons in the supplementary material. We will make our presented manga dataset publicly available to assist related applications. + +# 1. Introduction + +Generating manga from illustrations (Fig. 1-left) is an important task in high demand. The expansion of manga market and the rarity of manga artist have caused many manga companies to recruit a large number of digital painting or illustration artists and train them as manga creators. Training an artist to master the unique manga workflow, e.g., inking strategy, screentone management, texture applying, + +![](images/7012c039e01080a3677489d8e6ba81012e45d1f248969771de89a00c0fb944cd.jpg) +Figure 1. Our framework automatically generate the right high-quality manga given the left illustration. Zoom in to see details. + +![](images/d69212185e282eda04be17d03e9373b2dc7df3ca5393a0338befad996c54e114.jpg) + +etc., is financially expensive and can often take weeks or even months. To reduce such training costs and speed up the producing, many manga companies have began to adopt techniques that generate manga from generic art forms like illustrations and digital paintings, so that the costs to train artists can be saved, and those newly hired digital illustration artists can be free from learning extra skills and can create manga directly in their familiar digital illustration working environments. The software Clip Studio Paints (CSP) [6] and Adobe After Effects (AE) [1] are typical examples with many plugins and online tutorials [10, 11, 7, 9, 8] for editing illustrations to obtain manga manually. The widespread popularity of those tutorials and plugins verifies the significance of the problem to generate manga from illustrations. + +This paper starts with a key observation: the unique visual appearance of manga comes from the unique manga creation workflow. As shown in Fig. 2, we verify this observation + +![](images/01b9ce9a18a6fd5aba72547bf5322c8139b81f86cc191a424d4b30214ec99a9e.jpg) +Figure 2. Justification for our motivation: the classic professional manga creation workflow. Artists first ink structural line drawings, and then apply regular screentones and irregular screen texture to obtain the final manga. + +by studying the manga creation workflow in professional studios. Firstly, artists draw line drawings as the initial outlines in manga storyboards, e.g., the artist delineates the line structure of the girl portrait in Fig. 2-(a). Secondly, artists paste screentone sheets with different regular patterns onto the regions between lines, e.g., the hair, eyes and dress in Fig. 2-(b) are pasted with such screentone sheets. Thirdly, artists fill the canvas with irregular screen textures to achieve background layouts or special effects, e.g., the artist applies the romantic background screen texture to set off the mood of the girl character in Fig. 2-(c). We can see that these three steps are sufficient and necessary to determine the appearance of a manga image, and each step is indispensable for preparing the high-quality manga product. + +Might we be able to achieve a program that can mimic the above workflow, producing manga images with similar appearance to the ones created by artists manually with this workflow, and at the same time, yielding independently usable result layers that can assist artists in each step of this workflow? To achieve these goals, we present a deep learning approach to mimic the manga creation workflow step-by-step. Firstly, given an input illustration, our framework estimates a line drawing map that plays a similar role to the line drawings inked by artists manually. Secondly, our framework segments the input image into a fixed number of screentone classes, and pastes corresponding regular screentone sheets onto the image regions of each class. Thirdly, our framework predicts a texture mask to identify the areas that need to be pasted with screen textures, and afterwards synthesizes irregular textures in the identified areas. In this way, our framework automatically produces the line drawings, regular screentones, and screen textures. Those components can be independently used by artists for further creation, or can be directly composed into the manga outputs. + +To this end, we invite artists to annotate a large-scale dataset and learn a hierarchical neural network in a data-driven manner. Our dataset contains 1502 image&annotation pairs of {illustration image, line drawing annotation, regular + +screentone segmentation annotation, and irregular screen texture mask annotation}. All annotations are achieved with a human-in-the-loop approach, and checked by multiple artists for quality assurance. We will make this dataset publicly available to assist related applications. + +Experiments show that mimicking the manga creation workflow yields several advantages. Firstly, in qualitative analyse, our framework can produce not only single manga image but also independent image layers at each workflow step to assist artists. Then, in perceptual user study, our framework tends to learn the artist decisions recorded in our presented dataset for each workflow step, making our framework preferred by the artists, as the manga creation depends heavily on content semantics and even artist perception. Furthermore, we provide 60 qualitative results and 15 additional comparisons in the supplementary material. + +In summary, our contributions are: (1) We propose a data-driven framework to generate manga from illustrations by mimicking the professional manga creation workflow, including the steps of line drawing inking, regular screentone pasting, and irregular screen texture pasting. (2) We present a large-scale artistic dataset of illustration and annotation pairs to facilitate the problem to generate manga from illustrations and assist related applications. (3) Perceptual user study and qualitative evaluations demonstrate that our framework is more preferable by artists when compared to other possible alternatives. + +# 2. Related Work + +Screentone and manga processing. The synthesis of manga screentone or halftoned texture is a unique problem with considerable demand. Halftoning exploits the spatial integration of human vision to approximate the intensity over a small local region with black-and-white pixels [24, 16, 44, 21]. Path-based methods [45, 32] try to reduce the artifact patterns by adjusting the scanning path over images. Knuth et al. [24] enhance edges in a prepro + +![](images/922bcffae7f9a0d35f445d74e62515190c70f406eda635d26249d9bef63776d4.jpg) +Figure 3. Overview of our framework. Given an input illustration, our framework separately estimates the line drawing, regular screentone segmentation, and the irregular screen texture mask. These components are composed to produce the final manga result. All convolutional layers use $3 \times 3$ px kernels and are processed by Batch Normalizations (BNs) and ReLU activations. + +![](images/d026eb4e0f6902ac413022fc4e440b2b9d2fb3f3ef9113af96b6e40eafb9d637.jpg) + +![](images/e48dea7fe9452060f74d004c9dd03eb2adab798c6cdb967fda2cb4d44dbfdfc2.jpg) + +![](images/e6e0d791c1e36d7ad6d4fa164b3917d01033cbd26e09508abfb5a0161dc0a1be.jpg) + +cessing step to preserve the edges. Afterwards, Buchanan et al. [3] preserve the fine structure by optimising the structure similarity. Perception-aware methods [51, 52, 34, 36] map pixel-wise or region-wise luminance to screentone patterns to achieve perceptually distinguishable salient screentone structure. Learning-based method Li et al. [26] train neural networks to predict the sketching texture in an end-to-end manner. Variational-auto-encoder screentone filler [53] maps the screened manga to an intermediate domain. Hatching is another technique to halftoned effects. Winkenbach et al. [50] synthesise pen-and-ink illustrations by rendering a geometric scene with prioritised stroke textures. Our framework not only focuses on the synthesis of screentones, but also works with the practical workflow of manga creation, including the steps of line drawing inking, screentone synthesis, and texture blending. + +Cartoon and digital painting techniques. Cartoon image processing and computational digital painting have been extensively studied in the past few decades. Manga structure extraction [25], cartoon inking [40, 38, 39], and line closure [29, 31] methods analysis the lines in cartoon and digital paintings. A region-based composition method can be used in cartoon image animating [41]. Stylization methods [5, 48, 54, 56, 55] generate cartoon images or artistic drawings from photographs or human portraits. Line drawing colour filling applications [58, 43, 42] colourize sketch or line drawings with optimization-based or learning-based approaches. Our approach generates manga from illustrations and digital paintings, and can be used in manga products and related cartoon or digital painting applications. + +Image-to-image translation and stylization. The task of generating manga from illustrations can also be seen as an image-to-image translation or image stylization problem. + +For example, paired image-to-image translation [20, 47, 4] and unpaired methods [59, 22, 2, 57, 14, 30]. These methods can transform images across categories, e.g., maps-to-aerials, edges-to-cats, and in our case, illustrations-to-manga. Neural style transfer [17, 19, 27] can stylize images via transferring low-level style features to the content images. Our experiments include typical candidates of these methods, analysing the differences between our customized framework and these generic methods. + +# 3. Method + +We present an overview of our framework as shown in Fig. 3, where the input is an illustration $\mathbf{X} \in \mathbb{R}^{w \times h \times c}$ (Fig. 3-left), whereas the output is a manga image $\mathbf{Y} \in \mathbb{R}^{w \times h}$ (Fig. 3-right), with $w, h, c$ being the image width, height, and channel quantity. We train Convolutional Neural Networks (CNNs) to mimic the professional manga creation workflow with the following three steps: + +Firstly, to mimic the behaviour that artists ink line drawings to delineate the structural outlines in manga storyboards (Fig. 2-(a)), our framework estimates a line drawing map $\hat{\pmb{L}}\in \mathbb{R}^{w\times h}$ (Fig. 3-(a)). Learnt from thousands of images, our neural network inks salient structural lines and suppresses unwanted constituents like noises and shadow interferences. + +Secondly, to mimic the behaviour that artists paste regular screentones to depict the manga shading and object materials (Fig. 2-(b)), our framework estimates a panoptic segmentation map, namely the regular screentone segmentation map $\hat{S} \in \mathbb{R}^{w \times h \times N}$ (Fig. 3-(b)), with $N$ representing the number of screentone classes. Such segmentation yields a set of region labels, and each label indicates one type of screentone that should be pasted to each region. Our framework then + +pastes the screentones according to such region-wise labels. + +Thirdly, to mimic the behaviour that artists paste irregular screen textures to achieve background layouts or special effects (Fig. 2-(c)), our framework estimates an irregular texture mask $\hat{M} \in \mathbb{R}^{w \times h}$ (Fig. 3-(c)) to identify the areas that should be covered with irregular textures, and afterwards synthesizes manga textures for those identified areas. + +Finally, the output manga image $\mathbf{Y}$ can be composed with + +$$ +\boldsymbol {Y} = \hat {\boldsymbol {L}} \odot \varphi_ {\text {t o n e}} (\hat {\boldsymbol {S}}) \odot \varphi_ {\text {t e x}} (\hat {\boldsymbol {M}}, \boldsymbol {X}), \tag {1} +$$ + +where $\odot$ is Hadamard product, $\varphi_{\mathrm{tone}}(\cdot)$ is a tone transform (described in § 3.2) that pastes screentone sheets according to the given screentone segmentation $\hat{S}$ , and $\varphi_{\mathrm{tex}}(\cdot,\cdot)$ is a texture transform (described in § 3.3) that synthesizes textures given the texture mask $\hat{M}$ and the illustration $X$ . + +In order to train this framework, we invite artists to annotate a dataset containing 1502 pairs of $\{$ illustration $X$ , line drawing map $L$ , regular screentone segmentation map $S$ , and irregular texture mask $M\}$ . These data are annotated in a human-in-the-loop manner, i.e., artists create annotations for our framework to learn, and our framework estimates coarse annotations for artists to refine. The annotating approach is detailed in §4. + +# 3.1. Inking line drawing + +When creating manga in real life, artists ink line drawings to outline the object structures in manga storyboards. Our framework estimates a line drawing map $\hat{L}$ to mimic this artist behaviour. Given the ground truth line drawing $L$ and the estimation $\hat{L}$ , we customize a likelihood $\mathcal{L}_{\mathrm{ink}}$ with + +$$ +\mathcal {L} _ {\mathrm {i n k}} = \sum_ {p} \left(\left| \left| \hat {\boldsymbol {L}} _ {p} - \boldsymbol {L} _ {p} \right| \right| _ {2} ^ {2} + \lambda_ {i} \left| \left| \phi (\hat {\boldsymbol {L}}) _ {p} - \phi (\boldsymbol {L}) _ {p} \right| \right| _ {2} ^ {2}\right), \tag {2} +$$ + +where $p$ is pixel position, $||\cdot||_2$ is Euclidean distance, and $\lambda_i$ is a weighting parameter. The operator $\phi(\cdot)$ is a high-pass transform that penalizes the line patterns — we observe that the line patterns in line drawings routinely come with sparse and discrete high-amplitude/frequency transitions over pixel intensities, and we tailor make the transform $\phi(\cdot)$ to identify such line patterns that are "darker" than their surrounding low-frequency domain with + +$$ +\phi (\hat {\boldsymbol {L}}) _ {p} = \left\{ \begin{array}{l l} | | \hat {\boldsymbol {L}} _ {p} - g (\hat {\boldsymbol {L}}) _ {p} | | _ {2}, & \text {i f} \quad \hat {\boldsymbol {L}} _ {p} < g (\hat {\boldsymbol {L}}) _ {p}; \\ 0, & \text {o t h e r s ,} \end{array} \right. \tag {3} +$$ + +where $g(\cdot)$ is a Gaussian filter with a sigma of 3.0. With this transform, the likelihood $\mathcal{L}_{\mathrm{ink}}$ not only describes how close the estimation $\hat{\pmb{L}}$ is to the ground truth $\pmb{L}$ , but also penalizes the lines guided by the transform $\phi (\cdot)$ . + +# 3.2. Pasting regular screentone + +Manga artists paste screentone sheets with regular patterns onto their canvases to render the shading, occlusion, + +![](images/b7fcdcef54355fe56345260a2ea7028920ea8e9a05222063585cc52d423fb2d2.jpg) +(a) Screentone sheets + +![](images/db07c93b38b47650eed7df71374100a37c330a2f5fb29c535e7e8d1c6a34f305.jpg) +(b) Regular screentone classes and labels + +![](images/d08b2f74d9a85b9355b20be75401715c2819e4154f36a06a4a9060b96f6b0923.jpg) +(c) Illustration + +![](images/b88002f1f3c1f89cfbe113a3a87763d56192f07c67c64ba003e5ea1663f58b2d.jpg) +(d) Region-wise label + +![](images/89d9054030e70e434c9a2c8acf3a5ee9694ff86cd6fb15e0e61c0ff6238586fd.jpg) +(e) Pasted screentone +Figure 4. Pasting regular screentone. (a) Examples of real-life screentone sheets. (b) Standard manga screentone classes and corresponding label colours. (c) Example illustration. (d) Screentone segmentation map annotated by artists manually. (e) Screentones pasted according to the segmentation. + +and object materials. A widely-used commercial screentone standard "JAPAN-DELETETER-SE" [13] (Fig. 4-(a)) includes 8 types of manga screentone sheets (Fig. 4-(b)). Based on this standard, our framework estimates a screentone segmentation map $\hat{S}$ (Fig. 4-(d)) with 8 classes corresponding to these 8 types of screentones. With the estimated logits $\hat{S}$ and the ground truth label $S$ , we measure the likelihood $\mathcal{L}_{\mathrm{seg}}$ with the Softmax Cross Entropy [49] as + +$$ +\mathcal {L} _ {\mathrm {s e g}} = - \sum_ {p, i} \log (\psi (\hat {\boldsymbol {S}} _ {p}) \odot \boldsymbol {S} _ {p}) _ {i}, \tag {4} +$$ + +where $\psi (\cdot)$ is Softmax [49] operation, $p$ is pixel position, and $i$ is class channel index. We further observe how artists paste screentone sheets, and find that artists are accustomed to paste screentones in a region-wise manner instead of in pixelwise, i.e., artists paste screentone sheets region-by-region rather than pasting independent sheets for each individual pixel. To achieve such region-wise consistency, we use the Felzenszwalb [15] super-pixel algorithm to segment the input image $\mathbf{X}$ into a set of over-segmented regions $\Omega = \{\omega_{1\dots n}\}$ , and penalize the region-wise variation $\mathcal{L}_{\mathrm{var}}$ with + +$$ +\mathcal {L} _ {\text {v a r}} = \sum_ {p} \left| \left| \hat {\boldsymbol {S}} _ {p} - \overline {{\hat {\boldsymbol {S}} _ {\omega (p)}}} \right| \right| _ {2} ^ {2}, \tag {5} +$$ + +where $\omega(p)$ is a super-pixel region in $\Omega$ that the pixel $p$ belongs to, and $\overline{\hat{S}_{\omega(p)}}$ is the average value of $\hat{S}$ in the region $\omega(p)$ . By encouraging the region-wise consistency, this penalty mimics the artist behaviour of region-by-region + +![](images/6ec1de9d9adab7eed9cc2b5fab61c7a1b086986bce5146d300099e2c8e57a997.jpg) +(a) Illustration + +![](images/15a2383b769a58bda1e230812b0d6a66fe18d2462baeeb2e9c1db4be1e7ef00d.jpg) +(b) Mask + +![](images/8924f07216b1e4e9465933350b9626bef5ac935f7b93ee77d0d38a89281317e7.jpg) +(c) Knuth 1987 + +![](images/91160bfbddad172ad7b793350c23d80d6506e251d086362899245a291b4df2ec.jpg) +(d)Floyd et al.1974 + +![](images/5cf59d2409d0180a09fc90aca61923ea0adf311fbb9158c09b37dc96ba294a09.jpg) +(e) Ulichney 1987 (f) Jarvis et al. 1976 (g) Velho et al. 1991 (h) Ulichney 1991* + +![](images/3b62fcf29ce2dcec06fcf5673380b5c2b1955e76457eccd46d2c5677318ab73e.jpg) + +![](images/358e067ed171e25639d41cc1346f2f93a3bb0a3c150f8f5c1a42c7819183a441.jpg) + +![](images/9176894fc2d13e1ac5354eb65767b567a704c9408daf6c836bb4247639b16c59.jpg) +Figure 5. Pasting irregular screen texture. (a) Example illustration. (b) Screen texture mask annotated by artist manually. (c-h) Different types of halftone transforms. The “*” indicates the default transform used by our framework. + +screentone sheet pasting. Afterwards, our framework pastes the screentones according to the segmentation $\hat{S}$ with a tone transform $\varphi_{\mathrm{tone}}(\cdot)$ as + +$$ +\varphi_ {\text {t o n e}} (\hat {\boldsymbol {S}}) _ {p} = \sum_ {i} \psi (\hat {\boldsymbol {S}} _ {p}) _ {i} \odot (\boldsymbol {T} _ {i}) _ {p}, \tag {6} +$$ + +where $T_{i} \in \mathbb{R}^{w \times h}$ is a screentone image computed by tiling the $i$ -th screentone patch in Fig. 4-(b). We show an example of the transform $\varphi_{\mathrm{tone}}(\cdot)$ in Fig. 4-(e), where the screentone segmentation (Fig. 4-(d)) is transformed using the screentone-label correspondence in Fig. 4-(b). + +# 3.3. Pasting irregular screen texture + +The screen texture pasting is an indispensable step in the manga creation workflow. Such screen textures have irregular patterns and can be used in scenarios like background layouts or special effects. Our framework identifies the areas that need to be pasted with screen texture by estimating a texture mask $\hat{M}$ (Fig. 5-(b)). We minimize the likelihood $\mathcal{L}_{\mathrm{mask}}$ between the estimation $\hat{M}$ and the ground truth $M$ with + +$$ +\mathcal {L} _ {\text {m a s k}} = \sum_ {p} | | \hat {\boldsymbol {M}} _ {p} - \boldsymbol {M} _ {p} | | _ {2} ^ {2}, \tag {7} +$$ + +where $p$ is pixel position. Furthermore, we observe how artists paste screen textures, and find that artists tend to paste identical texture in consecutive and monotonic areas, e.g., large backgrounds, full-screen effects, big fonts, etc. To achieve the spacial coherency in such areas, we introduce an anisotropic penalty $\mathcal{L}_{\mathrm{ani}}$ with + +$$ +\mathcal {L} _ {\mathrm {a n i}} = \sum_ {p} \sum_ {i \in o (p)} \sum_ {j \in o (p)} \left(\delta (\boldsymbol {X}) _ {i j} | | \hat {\boldsymbol {M}} _ {i} - \hat {\boldsymbol {M}} _ {j} | | _ {2} ^ {2}\right), \quad (8) +$$ + +where $o(p)$ is a $3 \times 3$ window centred at the pixel position $p$ , with $\delta(\cdot)$ being an anisotropic term $\delta(X)_{ij} = \exp(-||X_i - X_j||_2^2/\kappa^2)$ , and $\kappa$ is an anisotropic weight. The term $\delta(X)_{ij}$ increases when $o(p)$ is located at consecutive and monotonic areas with uniform pixel intensities, and decreases when $o(p)$ comes across salient contours like edges. Afterwards, given the estimated mask $\hat{M}$ , our framework synthesizes manga textures in the masked areas with a texture transform $\varphi_{\mathrm{tex}}(\cdot, \cdot)$ as + +$$ +\varphi_ {\mathrm {t e x}} (\hat {\boldsymbol {M}}, \boldsymbol {X}) _ {p} = \sum_ {p} \xi (\boldsymbol {X}) _ {p} \odot \hat {\boldsymbol {M}} _ {p}, \tag {9} +$$ + +where $\xi(\cdot)$ is a halftone transform to synthesize texture. Our framework allows the transform $\xi(\cdot)$ to be chosen from many popular halftone synthesizing algorithms [24, 16, 44, 21, 45, 32] as shown in Fig. 5-(c-h), and we use the dotted transform [44] (Fig. 5-(h)) by default. + +# 3.4. Neural architecture and learning objective + +Our neural network architecture consists of three convolutional decoders: inking decoder, segment decoder, and mask decoder (Fig. 3). We apply Batch Normalization [18] and ReLU activation [33] to each convolutional layer. The sampling layers have skip connections in U-net [37] style. The three decoders are trained jointly with the loss term $\mathcal{L}$ with + +$$ +\mathcal {L} = \lambda_ {1} \mathcal {L} _ {\text {i n k}} + \lambda_ {2} \mathcal {L} _ {\text {s e g}} + \lambda_ {3} \mathcal {L} _ {\text {m a s k}} + \lambda_ {\text {v a r}} \mathcal {L} _ {\text {v a r}} + \lambda_ {\text {a n i}} \mathcal {L} _ {\text {a n i}}, \tag {10} +$$ + +where $\lambda_{1\dots 3},\lambda_{\mathrm{var}},\lambda_{\mathrm{ani}}$ are weighting parameters. Given that the architecture is fully convolutional, this model is applicable to images with adjustable resolutions. + +# 4. Dataset + +Our dataset contains 1502 pairs of $\{\text{illustration } X$ , line drawing map $L$ , regular screentone segmentation map $S$ , and irregular texture mask $M\}$ in 1024px resolution. We provide examples in the supplemental material. We invite 5 artists to annotate the dataset. The data preparation starts with a relatively small set of 56 illustration and line drawing pairs collected by searching the key word "illustration with line drawing" in Pixiv [35]. Artists align and retouch those 56 line drawings into usable annotations. Next, artists manually create 56 paired screentone segmentation maps using a commercial segmentation annotation tool [28] and 56 texture masks using Adobe Photoshop "quick select" tool. We train our framework on these initial data for 20 epochs and estimate coarse annotations for 1446 high-quality illustrations in Danbooru [12]. Artists refine those coarse estimations into final annotations. We view 100 refinements as one loop. When each loop is finished, we train our framework on the new data for 50 epochs and all old-and-new data for 20 epochs, and then re-estimate coarse annotations for the remaining + +![](images/918677bf1e6b713b95db405a4cfee56811b15df010e6accb3d2e39f058f37c3f.jpg) +Figure 6. Qualitative results. We show the generated manga image layers. 60 additional results are available in the supplementary material. + +![](images/96fc072efa78f85180a53caf555e01ed9048fe3ad9d536c98deb616735d95b29.jpg) + +![](images/da8435cce4ab4ce0ca51533d2d4f356af53c4eb54f8ed5b1b09860aeb0d4c7ff.jpg) + +![](images/e7acfd635179fafe3f72a5bdd4b6ac0d10e8cb529eaf888f6bad9f764f5d6662.jpg) + +![](images/d8839d7fbf6f041f35deea8fbdbc8e5a0ff2dfe38bfdc00b268f28957b3c8458.jpg) + +
MethodLi 2019 [26]Qu 2008 [36]CSP 2020 [6]Xie 2020 [53]Ours
AHR ↓3.11 ± 0.534.66 ± 0.312.66 ± 0.374.11 ± 0.291.33 ± 0.24
+ +Table 1. Average Human Ranking (AHR) of the manga images generated by different methods. The arrow $(\downarrow)$ indicates that lower is better. Top 1 (or 2) score is marked in blue (or red). + +
MethodLi 2019 [26]Qu 2008 [36]CSP 2020 [6]Xie 2020 [53]Ours
AMTFR ↑9.52%1.16%11.52%5.06%24.54%
+ +Table 2. Amazon Mechanical Turk Fooling Rate (AMTFR) on generated manga images. This metric reflects how indistinguishable the generated manga images are from real ones. Top 1 (or 2) score is marked in blue (or red). Higher ( $\uparrow$ ) is better. + +unrefined illustrations. In parallel, all 5 artists are invited to check the annotation quality in that loop. Artists are allowed to remove any annotations when they find low-quality ones. This human-in-the-loop annotation workflow finishes when the quality of each annotation has been assured by at least three artists. + +# 5. Evaluation + +# 5.1. Experimental setting + +Compared approaches. We test several typical manga generation methods of (1) the traditional optimization-based manga screentone method Qu et al. 2008 [36], (2) the com + +mercial manga software CSP 2020 [6], (3) the learning-based stylization framework Li et al. 2019 [26], (4) the state-of-the-art manga effect ScreenVAE from Xie et al. 2020 [53], (5) Pix2Pix [20], and (6) our framework. + +Implementation details. Our framework is trained using the Adam optimizer [23] with a learning rate of $\mathrm{lr} = 10^5$ , $\beta = 0.5$ , a batch size of 16, and 100 epochs. Training samples are randomly cropped to be $224 \times 224$ pixels and augmented with random left-and-right flipping. Besides, Qu [36] supports arbitrary screentone types, and we set it to use the same screentones with us. CSP [6] supports a vast majority of screentones with commercial standards, and we choose the same screentones as ours in the their interface. Li [26], Xie [53], and Pix2Pix [20] are learning-based methods with official implementations, and we train them on the illustration-to-manga pairs composed with our dataset. + +Hyper-parameters. We use the default (and recommended) configuration of our framework: $\lambda_{i} = 0.5, \kappa = 0.1, \lambda_{1} = 1.0, \lambda_{2} = 1.0, \lambda_{3} = 1.0, \lambda_{\mathrm{var}} = 0.1$ and $\lambda_{\mathrm{ani}} = 0.1$ . + +Testing samples. The tested images are Pixiv [35] and Danbooru [12] illustrations sampled randomly in different experiments. We make sure that all tested images are unseen from the training dataset. + +# 5.2. Perceptual user study + +The user study involves 15 individuals, where 10 individuals are non-artist students, and the other 5 are professional + +![](images/a1cd757666f5b4ac245697523fe6e738838b381329a2c14939600aadaa2074f1.jpg) +Figure 7. Comparisons to possible alternative methods. 15 additional full-resolution comparisons are available in the supplementary material. + +artists. Each artist has at least three months of manga creation experience. We randomly sample 150 unseen illustrations in Danbooru [12], and then use the involved 5 methods ([53, 36, 26, 6] and ours) to generate 150 result groups, with each group containing 5 results from 5 methods. The participants are invited to rank the results in each group. When ranking the results in each group, we ask users the question – “Which of the following results do you prefer most to use in commercial manga? Please rank the following images according to your preference”. We use the Average Human Ranking (AHR) as the testing metric. For each group in the 150 groups, one random user ranks the 5 results in the current group from 1 to 5 (lower is better). Afterwards, we calculate the average ranking obtained by each method. + +The results of this user study is reported in Table 1. We have several interesting discoveries: (1) Our framework outperforms the secondly best method by a large margin of $1.33 / 5$ . (2) The commercial software CSP 2020 [6] reports the secondly best score. (3) The two learning-based methods [26, 53] reports similar perceptual quality, with [53] slightly better than [26]. (4) Qu 2008 [36] reports a relatively low user preference, possibly due to its hard threshold when segmenting screentone regions. + +We also conduct a user study with the Amazon Mechanical Turk Fooling Rate (AMTFR). The turk workers first watch a few real manga on the VIZ-manga [46] website, and then play with all the tested tools for 15 minutes to get familiar with the appearance of the "real/fake" manga. We randomly shuffle the 150 fake manga images (generated by the 5 tested methods as described in § 5.2) and another 150 images cropped from the real VIZ manga. We afterwards ask the turk workers to tell whether each image is real manga. The workers' mistake rate (fooling rate) reflects how the generated manga is indistinguishable from the real manga products. The result is presented in Table 2. We can see that our framework reports the highest fooling rate, more than twice that of the secondly best method. This is because our framework mimics the real manga creation workflow to simulate the manga created by artists manually. + +# 5.3. Qualitative result + +We present decomposed qualitative results in Fig. 6 and 60 additional results in the supplementary material. We can see that our framework not only generates satisfactory manga results, but also produces independent image layers of line drawing, screentone, and screen texture. These layers are + +![](images/4cb0d8276a07dc6b45dad1edf0b93d6f88e79c48d56f7eb615926b53784bed33.jpg) + +![](images/bfd23447566db062d6218c10a2e9001d81a41dd83a694f0a219645ecda99056c.jpg) + +![](images/3bf4ae87e737221209cee71e46e07314960e9054819af6a02e4c44a8fffed8a2.jpg) + +![](images/c1ef75dd16a70bf81bde67a77c23e0c8b0c92beb19cf5d45906b308e936137e8.jpg) + +![](images/f35e4328eb6a7f8a02b475fa6727f50d2c12894694d71ffba61dbdb0dbd36685.jpg) + +![](images/a486f7e8b2379bbe49f1a673c4f3140bdcbfcb3f70f7491301ee5b1abc146182.jpg) + +![](images/5eae7325c309c6e4e20ab2ccef67e9aefcb8a2820caaabc82fe6515e1501b0e5.jpg) + +![](images/85295fb79c125078148c8d73e3bea5c33fc234f42e33410623972ddb6ff332ef.jpg) + +![](images/b262b79f819c9bf5fdf42938eeded883feda1175f997c0276d68b015ab5f9494.jpg) +(a) Illustration + +![](images/7cf3133d4e0c16c6747d3f368513b691742c6f74ba462be87065ace27b47bd29.jpg) +(b) W/o inking + +![](images/2f5438107a059d0ef2f163c281887e1b9e85e783db1c9a0b690183b898d553e6.jpg) +(c) W/o segment + +![](images/c414c437b18c65a13d6c03b1ae3d33393efb32ec3610569e2be72dbeea7135cb.jpg) +(d) W/o masking + +![](images/dd7e0031fa9ef0d1d5ba896e3865597d96a51bad6c156a94c89a1feac9dcf651.jpg) +(e) $\mathrm{W / o}\phi (\cdot)$ +Figure 8. Ablative study. We study the impact of each individual component within our framework by removing components one-by-one. + +![](images/e8847b69296b948ad0581e2401c3c76af43b712674a53ddac698d5ab32721d1c.jpg) +(f) W/o $\mathcal{L}_{\mathrm{var}}$ + +![](images/94c5990233a143fb4d8437a35d0a9afb5a4ceb86b8efc5655891effb2087f8fa.jpg) +(g) W/o $\mathcal{L}_{\mathrm{ani}}$ + +![](images/4b793c3ee9f64f558a6aff8361f7ac03db79cf1c2ef09b9f7eafde1970fddae6.jpg) +(h) Ours + +practically usable in the daily works of manga artists. + +# 5.4. Visual comparison + +We present comparisons with previous methods [26, 36, 6, 53, 20] in Fig. 7 and 15 additional comparisons in the supplementary material. We also provide greyscale images for reference. We can see that CSP 2020 [6] and Qu et al. 2008 [36] can only map region-wise or pixel-wise intensity to screentone dots. Li et al. 2019 [26] causes boundary/detail distortion, e.g., the girl eyes. Xie et al. 2020 [53] and Pix2Pix [20] suffer from severe blurring/halo artifacts (when zooming in), e.g., the cake decoration. Our framework mimics the artist workflow and yields sharp and clean manga products. + +# 5.5. Ablative study + +As shown in Fig. 8, the ablative study includes the following experiments. (1) We remove the inking decoder and train our framework without line drawing maps. We can see that the removal of line drawing fails our framework in outlining the object structure (Fig. 8-(b)). (2) If trained without the screentone segmentations (with the segment decoder removed), the framework cannot mimics the artist behaviour of region-by-region screentone pasting, yielding screentone distortions (Fig. 8-(c)). (3) If trained without the screen texture masks (with the mask decoder removed), the framework fails to capture appropriate textures, resulting in dull and defective tone transitions (Fig. 8-(d)). (4) If trained without the line pattern penalty $\phi (\cdot)$ , the lines become blurred (Fig. 8-(e)). (5) If trained without the region-wise variation penalty $\mathcal{L}_{\mathrm{var}}$ , the framework suffers from screentone type inconsistency (Fig. 8-(f)). (6) If trained without the anisotropic penalty $\mathcal{L}_{\mathrm{ani}}$ , the textured areas become uncontrolled and noisy (Fig. 8-(g)). (7) The full framework suppresses these + +types of artifacts and achieves a satisfactory balance over the line drawing, screentone, and screen texture (Fig. 8-(h)). + +# 5.6. Influence of hyper-parameters + +A weak region-wise variation penalty $(\mathcal{L}_{\mathrm{var}} = 0.01)$ causes inconsistency tone over adjacent regions, whereas a too strong penalty $(\mathcal{L}_{\mathrm{var}} = 1.0)$ causes texture vanishing. Besides, a weak anisotropic penalty $(\mathcal{L}_{\mathrm{ani}} = 0.01)$ causes textural distortion, whereas a too strong penalty $(\mathcal{L}_{\mathrm{ani}} = 1.0)$ causes low contrast in detailed constituents. See also the supplement for examples. + +# 6. Conclusion + +We present a framework to generate manga from illustrations by mimicking the manga creation workflow, including the steps of line drawing inking, regular screentone pasting, and irregular screen texture pasting. We invite artists to annotate a large-scale dataset to train the neural networks, and the dataset will be publicly available. Both quantitative and qualitative experiments elaborate that the users prefer our layered manga products compared to possible alternatives. + +# 7. Acknowledgement + +This technique is presented by Style2Paints Research. This work is supported by National Natural Science Foundation of China Nos 61972059, 61773272, 61602332; Natural Science Foundation of the Jiangsu Higher Education Institutions of China No 19KJA230001, Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education, Jilin University No93K172016K08; the Priority Academic Program Development of Jiangsu Higher Education Institutions (PAPD). We thank Qianwen Lu for the helpful discussions for the technical merits and limitations. + +# References + +[1] Adobe. Adobe after effects. Adobe, 2020. +[2] Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. CVPR, 2017. +[3] J. W. BUCHANAN, , VEREVKA, and O. Edge preservation with space-filling curve half-toning. In Proceedings of Graphics Interface 95, 7582. ACM, 1995. +[4] Qifeng Chen and Vladlen Koltun. Photographic image synthesis with cascaded refinement networks. In ICCV, 2017. +[5] Yang Chen, Yu-Kun Lai, and Yong-Jin Liu. CartoonGAN: Generative adversarial networks for photo cartoonization. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. IEEE, jun 2018. +[6] clip studio. Clip studio paints. clip studio, 2020. +[7] clip studio. The complete clip studio paint screentone tutorial. https://doncorgi.com/blog/clip-studio-paint-screentone-tutorial/, 2020. +[8] clip studio. Csp: Turning your art into screentone. https://digiartstuff.wordpress.com/2019/04/18/csp-turning-your-art-into-screentone/, 2020. +[9] clip studio. Making comic backgrounds using layer properties. https://tips.clip-studio.com/en-us/articles/1164, 2020. +[10] clip studio. Turning color illustrations into black and white manga. https://tips.clip-studio.com/en-us/articles/1339, 2020. +[11] clip studio manga materials. Convert image to comic style background baccis of photo lt conversion. https://manga-materials.net/en/2dlt_b/, 2020. +[12] DanbooruCommunity. Danbooru2017: A large-scale crowdsourced and tagged anime illustration dataset, 2018. +[13] DELETER. Deeter official shopping site. http://deetermangashop.com/, 2020. +[14] Jeff Donahue, Philipp Krhenbhl, and Trevor Darrell. Adversarial feature learning. *ICLR*, 2017. +[15] Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient graph-based image segmentation. *IJCV*, 2004. +[16] R. W. FLOYD, , STEINBERG, and L. An adaptive algorithm for spatial grey scale. In SID International Symposium Digest of Technical Papers, Society for Information Display, 3637. ACM, 1974. +[17] Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, pages 2414-2423, 2016. +[18] 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). IEEE, jun 2016. +[19] Mingming He, Jing Liao, Lu Yuan, and Pedro V Sander. Neural color transfer between images. ArXiv, 2017. +[20] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. CVPR, 2017. +[21] J. F. JARVIS, C. N. JUDICE, , NINKE, and W. H. A survey of techniques for the display of continuous tone pictures on bilevel displays. Comput Graphics Image Process 5, 1, 1976. + +[22] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. ICML, 2017. +[23] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. Computer Science, 2014. +[24] D. E. KNUTH. Digital halftones by dot-diffusion. ACM Transactions on Graphics 6, 4, 1987. +[25] Chengze Li, Xueting Liu, and Tien-Tsin Wong. Deep extraction of manga structural lines. ACM Transactions on Graphics, 36(4), 2017. +[26] Yijun Li, Chen Fang, Aaron Hertzmann, Eli Shechtman, and Ming-Hsuan Yang. Im2pencil: Controllable pencil illustration from photographs. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. +[27] Jing Liao, Yuan Yao, Lu Yuan, Gang Hua, and Sing Bing Kang. Visual attribute transfer through deep image analogy. ACM Transactions on Graphics, 36(4):1-15, jul 2017. +[28] lionbridge. Lionbridge data annotation platform. https://lionbridge.ai/data-annotation-platform, 2020. +[29] Chenxi Liu, Enrique Rosales, and Alla Sheffer. Strokeaggregator: Consolidating raw sketches into artist-intended curve drawings. ACM Transactions on Graphics, 2018. +[30] Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. NIPS, 2017. +[31] Xueting Liu, Tien-Tsin Wong, and Pheng-Ann Heng. Closure-aware sketch simplification. ACM Transactions on Graphics, 34(6):168:1–168:10, November 2015. +[32] A. NAIMAN, , LAM, and D. Error diffusion: wavefront traversal and contrast considerations. In Proceedings of Graphics Interface 96, 7886. ACM, 1996. +[33] Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. ICML, pages 807-814, 2010. +[34] Wai-Man Pang, Yingge Qu, Tien-Tsin Wong, Daniel Cohen-Or, and Pheng-Ann Heng. Structure-aware halftoning. ACM Transactions on Graphics (SIGGRAPH 2008 issue), 27(3):89:1-89:8, 2008. +[35] pixiv.net. pixiv. pixiv, 2007. +[36] Yingge Qu, Wai-Man Pang, Tien-Tsin Wong, and Pheng-Ann Heng. Richness-preserving manga screening. ACM Transactions on Graphics (SIGGRAPH Asia 2008 issue), 27(5):155:1–155:8, December 2008. +[37] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. MICCAI, 2015. +[38] Edgar Simo-Serra, Satoshi Iizuka, and Hiroshi Ishikawa. Mastering Sketching: Adversarial Augmentation for Structured Prediction. ACM Transactions on Graphics, 37(1), 2018. +[39] Edgar Simo-Serra, Satoshi Iizuka, and Hiroshi Ishikawa. Real-time data-driven interactive rough sketch inking. ACM Transactions on Graphics, 2018. +[40] Edgar Simo-Serra, Satoshi Iizuka, Kazuma Sasaki, and Hiroshi Ishikawa. Learning to Simplify: Fully Convolutional Networks for Rough Sketch Cleanup. ACM Transactions on Graphics, 35(4), 2016. +[41] Daniel Sykora, Jan Burianek, and Jiří Žára. Sketching cartoons by example. In Proceedings of Eurographics Workshop on Sketch-Based Interfaces and Modeling, pages 27-34, 2005. + +[42] Daniel Sykora, John Dingliana, and Steven Collins. LazyBrush: Flexible painting tool for hand-drawn cartoons. Computer Graphics Forum, 28(2), 2009. +[43] TaiZan. Paintschainer tanpopo. PreferredNetwork, 2016. +[44] R. A. ULICHNEY. Digital halftoning. MIT Press, 25(4), 1991. +[45] L. VELHO, , GOMES, and J. M. Stochastic screening dithering with adaptive clustering. Computer Graphics (Proceedings of SIGGRAPH95), 273276, 1994. +[46] viz. Viz manga. https://www.viz.com/read, 2020. +[47] 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. CVPR, 2018. +[48] Xinrui Wang and Jinze Yu. Learning to cartoonize using white-box cartoon representations. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +[49]wikipedia. Softmax function. wipedia, 2020. +[50] G. WINKENBACH, , SALESIN, and D. H. Computergenerated pen-and-ink illustration. Proceedings of SIGGRAPH 1994, 91100, 1994. +[51] Tien-Tsin Wong. The modelling of natural imperfections and an improved space filling curve halftoning technique. Master thesis The Chinese University of Hong Kong, 1994. +[52] Tien-Tsin Wong and Siu chi Hsu. Halftoning with selective precipitation and adaptive clustering. Graphics Gems V, 1995. +[53] Minshan Xie, Chengze Li, Xueting Liu, and Tien-Tsin Wong. Manga filling style conversion with screentone variational autoencoder. ACM Transactions on Graphics (SIGGRAPH Asia 2020 issue), 39(6):226:1-226:15, December 2020. +[54] Ran Yi, Yong-Jin Liu, Yu-Kun Lai, and Paul L. Rosin. AP- DrawingGAN: Generating artistic portrait drawings from face photos with hierarchical GANs. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, jun 2019. +[55] Ran Yi, Yong-Jin Liu, Yu-Kun Lai, and Paul L Rosin. Unpaired portrait drawing generation via asymmetric cycle mapping. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR '20), 2020. +[56] Ran Yi, Mengfei Xia, Yong-Jin Liu, Yu-Kun Lai, and Paul L. Rosin. Line drawings for face portraits from photos using global and local structure based GANs. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1-1, 2020. +[57] Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. ICCV, 2017. +[58] Lvmin Zhang, Chengze Li, Tien-Tsin Wong, Yi Ji, and Chunping Liu. Two-stage sketch colorization. In ACM Transactions on Graphics, 2018. +[59] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. ICCV, 2017. \ No newline at end of file diff --git a/generatingmangafromillustrationsviamimickingmangacreationworkflow/images.zip b/generatingmangafromillustrationsviamimickingmangacreationworkflow/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c6d9fae3299cfc619fcb2047c53286bd4e189212 --- /dev/null +++ b/generatingmangafromillustrationsviamimickingmangacreationworkflow/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e99f62675a28c1cca9d34db83fd901bcf6250c7e5ca6f95431a66a5c2f0718f6 +size 1142785 diff --git a/generatingmangafromillustrationsviamimickingmangacreationworkflow/layout.json b/generatingmangafromillustrationsviamimickingmangacreationworkflow/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0eefd1792c303c11a6c02fbd67df55b17548465d --- /dev/null +++ b/generatingmangafromillustrationsviamimickingmangacreationworkflow/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8948f25122d0741bc6e6cb4a3837e7a335ff09d2140714b1f2f6a5e767b3aecc +size 455144 diff --git a/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_content_list.json b/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..64111483734f65d41975a3eb57b8444dbcc80edf --- /dev/null +++ b/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc6e4170c8b9758be11fac985f5f43bf653bba88f2e7e783bd45a6f0f9e1ae6b +size 87931 diff --git a/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_model.json b/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fc29d2ccfce7eb8d72582ae6da9dfc7e1fadb91c --- /dev/null +++ b/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b90b8e78d16938143d41c31bdc5eeb93c5b9755b23ddfb131ec8e3f7e10ce49c +size 108201 diff --git a/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_origin.pdf b/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ce303a89d5a625bd076f8eccab3863020d24c295 --- /dev/null +++ b/generativeclassifiersasabasisfortrustworthyimageclassification/c7d06dbd-ab89-4feb-9c88-9e17706760d2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5bda6e20ab47f9552db50cd9a82d29cf3692a29516807df3a6d4e974ece17f6 +size 1575611 diff --git a/generativeclassifiersasabasisfortrustworthyimageclassification/full.md b/generativeclassifiersasabasisfortrustworthyimageclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d652ab4fddce8d5543bb44a8b51f256e43dbfe1a --- /dev/null +++ b/generativeclassifiersasabasisfortrustworthyimageclassification/full.md @@ -0,0 +1,366 @@ +# Generative Classifiers as a Basis for Trustworthy Image Classification + +Radek Mackowiak* + +Visual Learning Lab, Heidelberg University + +Ullrich Köthe + +Visual Learning Lab, Heidelberg University + +Lynton Ardizzzone* + +Visual Learning Lab, Heidelberg University + +Carsten Rother + +Visual Learning Lab, Heidelberg University + +* equal contribution + +# Abstract + +With the maturing of deep learning systems, trustworthiness is becoming increasingly important for model assessment. We understand trustworthiness as the combination of explainability and robustness. Generative classifiers (GCs) are a promising class of models that are said to naturally accomplish these qualities. However, this has mostly been demonstrated on simple datasets such as MNIST and CIFAR in the past. In this work, we firstly develop an architecture and training scheme that allows GCs to operate on a more relevant level of complexity for practical computer vision, namely the ImageNet challenge. Secondly, we demonstrate the immense potential of GCs for trustworthy image classification. Explainability and some aspects of robustness are vastly improved compared to feed-forward models, even when the GCs are just applied naively. While not all trustworthiness problems are solved completely, we observe that GCs are a highly promising basis for further algorithms and modifications. We release our trained model for download in the hope that it serves as a starting point for other generative classification tasks, in much the same way as pretrained ResNet architectures do for discriminative classification. + +Code: github.com/VLL-HD/trustworthy_GCs + +# 1. Introduction + +Generative classifiers (GCs) and discriminative classifiers (DCs) represent two contrasting ways of solving classification tasks. In short, while standard DCs model the class probability given an input directly, $p(\text{class} \mid \text{image})$ (e.g. softmax classification), generative classifiers (GCs) take the opposite approach: They model the likelihood of the input image, conditioned on each class, $p(\text{image} \mid \text{class})$ . The actual classification is then performed by finding the class under which the image has the highest likelihood. + +The application of GCs has so far been limited to very + +Discriminative Classifier + +$q(\mathrm{class}Y|\mathrm{image}X)$ + +sums to 1 over classes + +Generative Classifier + +$q(\mathrm{image}X|\mathrm{class}Y)$ + +integrates to 1 over images + +![](images/fe020e1891a1a2670d520419f7bd407efbc46bec9474a60dcc449d6a235fadf7.jpg) +(a) Normal input + +![](images/163a5cdd1b6e00af56acc5dcd268e4fa8cd2366801a6f2e5c1ad1935cba5d9a4.jpg) +Cat Dog + +![](images/5330b5fed1690ab4b3f77957385167c998c87b4da0c0a7d4159379621002dd76.jpg) +Cat Dog + +![](images/d9ea32c24e5bb7d720e0f1951bb1236cf2208352cc3dfc74d4b9852d8687d870.jpg) +(b) Unrelated input +Figure 1: Example of one advantage of generative classifiers: The class posterior of a DC always sums up to 1, while the likelihoods of the GC do not have this restriction, constituting inherently more informative outputs. E.g. the GC can show if a prediction is uncertain because the input agrees with both classes, or with neither. + +![](images/eb33225244000fd1f399ce9fbbce9c8e91b63d90af65add82c6157561b0bb59f.jpg) +Cat Dog + +![](images/1cf0fe69a36946c4014b3e1c719f8c9dbcfc5e7e29f1555a1952a0a9a0eed503.jpg) +Cat Dog + +simple datasets such as MNIST, SVHN and CIFAR-10/100. For any practical image classification tasks, DCs are used exclusively, due to their excellent discriminative performance. In principle, GCs are said to have various advantages over DCs, which align with the term trustworthiness. In general agreement with [24], we understand trustworthiness as the combination of explainability and robustness. + +Explainability: DCs based on deep neural networks are notorious for being 'black boxes', prompting many developments in the field of explainable AI. In the taxonomy laid out in [18], most commonly used algorithms fall into categories I or II: post-hoc methods that visualize how a network processes information (I), or that show its internal representations (II). The explanations can vary depending on the chosen method, and there is no guarantee that the results faithfully reflect what the DC is doing internally. + +In contrast, GCs bring to mind Feynman's mantra "What I cannot create, I do not understand". As GCs are able to model the input data itself, not just the class posteriors, they + +have fundamentally more informative outputs. For instance, GCs allow us to tell if a decision between two classes is uncertain because the input agrees well with both classes, or with neither (see Fig. 1). In addition, most GCs have interpretable latent spaces with meaningful features, allowing for the actual decision process to be directly visualized without post-hoc techniques. Therefore, it could be argued that GCs belong to category III of the explainability taxonomy [18], i.e. methods that intrinsically work in an explainable way, without relying on additional algorithms. + +Robustness: A second large concern about the practical use of deep learning based classification systems is their robustness, which can have different meanings, depending on the context. In particular, GCs have been assumed to be superior to DCs in terms of generalization under dataset shifts [51, 39] and accurately calibrated posteriors [3]. In addition, a big advantage of GCs is their capability to explicitly identify abnormal inputs in a natural way, thus indicating when a decision should not be trusted. Furthermore, GCs were found to be more robust towards adversarial attacks [33] and allow for their explicit detection [17]. + +It is still unclear if GCs can also manifest these advantages in more complex tasks while remaining competitive to DCs in task performance. For example, the authors of [15] find while GCs can successfully detect adversarily attacked MNIST images, this already fails for the CIFAR-10 dataset. The authors of [34, 30] observe that detection of other forms of OoD data also fails in various ways for natural images. In [16], the authors cast doubt on whether GCs can be used for high-dimensional input data at all. + +In light of this background, our work makes the following contributions: (i) We design and train a GC that performs at a level relevant to practical image classification, demonstrated on the ImageNet dataset. (ii) We show various native explainability techniques unique to GCs. (iii) We examine the model in terms of robustness. + +Overall, we find our GC to work better than a comparable DC in terms of trustworthiness. However, we do observe that previous findings on superior generalization under dataset shift [51] and immunity to adversarial attacks [41] do not hold for the ImageNet dataset. For other aspects of robustness, our GC shows some great benefits, such as naturally detecting OoD inputs and adversarial attacks. + +# 2. Related Work + +Years before the deep learning revolution, works such as [37, 51, 39] already compared the properties of GCs vs DCs, theoretically and experimentally, with agreement that GCs are more robust and more explainable. Works like [6, 5, 54] presented models that combine the aspects of GCs and DCs, to reach a more favourable trade-off compared to each extreme. However, all these works consider simple problems, and with the unmatched task performance later + +delivered by deep-learning based DCs in the 2010s, GCs became rarely used. + +As one example of more recent work, [16] investigates normalizing-flow based GCs trained on natural images. The authors find that naively trained GC models achieve very poor classification performance, and argue that this is due to some model properties that are not properly penalized by maximum likelihood training. Later, [3] propose that this problem can be avoided by training with the Information Bottleneck loss function instead. The authors of [32] modify the problem, and train a GC on features previously extracted from a standard feed-forward network. For all these works, the most complex dataset used is CIFAR-100, at a resolution of $32 \times 32$ pixels. + +So-called hybrid models [38] have been more successful in practice. Here, a likelihood estimation method is involved, commonly for the marginal $p(\mathrm{image})$ , while the actual classification is still performed in a discriminative way, using shared features between the two tasks, the main motivation being semi-supervised learning. Notable examples are [29, 14, 11, 35, 20]. They have some fundamental differences to GCs, e.g. that the conditional likelihoods are not directly modeled and the latent space has no explicit class structure. + +Concerning OoD detection with generative models, the authors of [34] and later [30] observed that likelihood models trained on natural images fail to detect certain OoD inputs, and may perform significantly worse than random. This problem is addressed e.g. by [36, 10, 43, 45, 55], where different OoD scores are introduced that correct for these shortcomings. These works only consider unconditional likelihood models for OoD detection, while a separate classifier is still needed to perform the actual task. GCs combine both these steps into a single model, simplifying the process and potentially improving OoD detection at the same time. + +GCs have also been examined for adversarial defense recently [41, 17, 33]. While these works highlight the potential of GCs, they are limited to simple datasets such as MNIST and SVHN, and do not scale to problems with more than approx. 10 classes, or to natural images [15]. + +# 3. Methods + +# 3.1. Invertible Neural Networks + +While VAEs have been used as generative classifiers with some success [41, 17, 33], perhaps the most natural choice are normalizing flows, due to their exact likelihood estimation capabilities [13]. The networks used in normalizing flows are so-called invertible neural networks (INNs), a class of neural network architectures that meet the following conditions: (i) the network represents a diffeomorphism by construction (essentially, a smooth and invertible function), (ii) the inversion can be computed efficiently, and (iii) the network has a tractable Jacobian determinant. These con + +ditions place some restrictions on the architecture, e.g. that the number of input and output dimensions have to be equal, and that non-invertible operations such as max-pooling can not be used. In recent years, various different invertible architectures have been developed that fulfill these conditions [12, 13, 4, 19]. In this work, we employ the affine coupling block architecture proposed in [13], with additional modifications, as described in Appendix B.1. + +In any generative setting, there are training images $X$ , that follow some unknown image distribution $p(X)$ . The goal is then to approximate $p(X)$ as closely as possible with a distribution given by the network, which we denote as $q_{\theta}(X)$ . In the case of normalizing flows, $q_{\theta}(X)$ is represented by transforming possible inputs $X$ to a latent space $Z$ using an INN $f_{\theta}$ ('flow'), with a prescribed standard normal latent distribution $p(Z) = \mathcal{N}(0,1)$ ('normalizing'). Then, the change-of-variables formula can be used to compute $q_{\theta}(X)$ at any point $x$ through + +$$ +q _ {\theta} (x) = p \left(Z = f _ {\theta} (x)\right) | \det J (x) | \tag {1} +$$ + +with $J \equiv \partial f_{\theta} / \partial X$ being the Jacobian. It can be shown that the network will learn the true distribution $(q_{\theta}(X) = p(X))$ by maximizing the expected log-likelihood $\log q_{\theta}(X)$ , as given through Eq. 1 above [47]. After training is complete, the model can not only be used to estimate likelihoods $q_{\theta}(X)$ , but also to generate new samples by inverting the network, in order to map sampled instances of $Z$ back to image space. + +In our case, this approach is not sufficient, as we want to use the INN as a generative classifier, meaning we need to model conditional likelihoods $q_{\theta}(X \mid Y)$ . While different approaches for this exist [52, 2], we adopt the form introduced in [25]. Here, the latent distribution is a conditional density $p(Z \mid Y)$ : The standard normal distribution $p(Z)$ is replaced with a Gaussian Mixture Model (GMM) containing a unit-variance mixture component per class + +$$ +p (Z \mid Y) = \mathcal {N} (Z; \mu_ {Y}, \mathbb {1}) \tag {2} +$$ + +$$ +p (Z) = \sum p (y) p (Z \mid y) = \sum p (y) \mathcal {N} (Z; \mu_ {y}, \mathbb {1}) \tag {3} +$$ + +where $\mu_y$ is the mean of class $y$ in latent space; and the mixture weights are the class priors $p(y)$ , i.e. the frequency of occurrence of each class in the dataset. The conditional likelihood $q_{\theta}(X|Y)$ can be evaluated with the change-of-variables formula (Eq. 1) as before by replacing the full distribution $p(Z)$ with the appropriate mixture component: + +$$ +q _ {\theta} (X \mid Y) = p \left(Z = f _ {\theta} (X) \mid Y\right) | \det J |. \tag {4} +$$ + +# 3.2. Training INNs with Information Bottleneck + +An INN naively trained with a class-conditional log-likelihood loss will perform very poorly as GC, even on mildly challenging tasks [16]. Instead, we require a loss function where the focus on the generative and class-separating capabilities can be explicitly controlled. For this, + +we utilize the IB objective [49], the ideal loss function for robust classification from an information theoretic point of view. Given some features $Z$ of a network, inputs $X$ , and ground-truth outputs $Y$ , the IB loss consists of two terms using the mutual information $I$ (MI): + +$$ +\mathcal {L} _ {\mathrm {I B}} = I (X, Z) - \hat {\beta} I (Y, Z). \tag {5} +$$ + +The MI quantifies the degree of shared information between variables and can be written as $I(V,W) = D_{\mathrm{KL}}(p(V,W)\| p(V)p(W))$ . Minimizing the IB loss means maximizing the information about the desired output $Y$ contained in the features, $I(Y,Z)$ . Simultaneously, it minimizes the information about the original image contained in the features, $I(X,Z)$ , resulting in robust and efficient representations $Z$ . The trade-off between these two aspects is explicitly adjusted by choosing $\hat{\beta}$ . + +How to apply this objective to INNs is not immediately obvious, as INNs preserve information, and the loss becomes ill-defined. The authors of [3] show that this can be avoided by adding very low noise to the inputs. This is already an established practice in the context of normalizing flows for the purpose of dequantization. From this, the authors go on to derive two loss terms representing the IB objective, $\mathcal{L}_{\mathrm{IB}} = \mathcal{L}_X + \beta \mathcal{L}_Y$ . In practice, the two terms amount to the following: + +$$ +\mathcal {L} _ {X} (x) = - \log | \det J _ {x} | + \frac {1}{2} \operatorname {l o g s u m e x p} \left(v _ {y ^ {\prime}} ^ {2} - 2 w _ {y ^ {\prime}}\right) \tag {6} +$$ + +$$ +\mathcal {L} _ {Y} (x, y) = \operatorname {o n e h o t} (y) \cdot \log \underset {y ^ {\prime}} {\text {s o f t m a x}} \left(\frac {v _ {y ^ {\prime}} ^ {2}}{2} - w _ {y ^ {\prime}}\right) \tag {7} +$$ + +Hereby, we use $v_{y} \coloneqq f(x) - \mu_{y}$ , and $\backslash w_{y} \coloneqq \log p(y)$ ( $\log(1 / (\# \text{classes}))$ for uniform class priors in our case). $J_{x}$ is the Jacobian $\frac{\partial f(x)}{\partial x}$ . $y'$ denotes the summation over all classes in the logsumexp and log softmax operations. The difference between $\hat{\beta}$ in the original IB and $\beta$ in the loss is a constant weighting factor for convenience [3], producing a sensible objective for manageable values of $\beta$ in the rough range (1, 100). + +Intuitively, we find the following: The $\mathcal{L}_X$ -loss forces the data to follow the GMM in latent space, making the INN a generative model. However, it has no effect on the class-conditional aspect, as the class $y$ is summed out. This loss can be rearranged to look similar to the maximum-likelihood-loss used for normalizing flows, but with a GMM as a latent distribution. On the other hand, the $\mathcal{L}_Y$ -loss bears resemblance to the categorical cross entropy loss, except that the usual logits are replaced by $\log p(z|y)p(y) = \log p(z,y)$ . Therefore, $\mathcal{L}_Y$ is responsible for making the likelihood model conditional on the class, but otherwise ignores the generative performance. + +X + +# 3.3. Detecting OoD Inputs + +For likelihood-based generative models, detecting OoD inputs is straight forward, by directly utilizing the estimated + +probability density $q_{\theta}$ : in principle, if an input is outside the support of the training data, and the model has learned the true distribution, the OoD sample should be assigned $\log q_{\theta}(x) = -\infty$ . In practice, it is only required that OoD samples have lower likelihood scores than the training data. From here, any input with an inferred likelihood below a threshold can be treated as OoD. However, in [34], the authors identified various special cases where OoD inputs have an unnaturally high log-likelihood score. This prompted the development of a typicality-test in [36], that uses both an upper and a lower threshold. Even better performing extensions to this exist [10, 43, 45, 55], but we choose the typicality-test as the simplest option, to examine the natural capabilities of the model. We slightly modify the typicality-test to make it a traditional hypothesis test, with the null hypothesis being that the input is in-distribution, more details in Appendix A.1. The $p$ -value for the hypothesis test is the fraction of training samples with scores in the OoD-zone, which also equals the false positive rate. To evaluate the OoD detection capabilities independent of the threshold, we vary the $p$ -value of the test and produce a receiver operating characteristic (ROC) curve. The area under this curve (ROC-AUC), in percent, serves as a scalar measurement of the OoD detection capabilities, with ROC-AUC of $100\%$ meaning that the OoD samples and in-distribution samples are perfectly separated, and a value at $50\%$ or below indicates a random performance or worse. + +# 4. Experiments + +A detailed description of the network architecture is found in Appendix B.1, we summarize the main points in the following. We construct the invertible network (INN) from affine coupling blocks, as introduced in [13], with various modifications from other recent works [1, 2, 26, 28]. As invertible alternatives to $2 \times 2$ max-pooling and global mean-pooling, we use a Haar wavelet transform [2] and a DCT transform [26] respectively. + +Because of the similarities between affine coupling blocks and residual blocks as used in a ResNet, we match the design of the INN to that of a standard ResNet-50 wherever possible. The overall layout is summarized in Table 1, c.f. [21, Table 1]. Some differences arise due to the constraint of invertibility: the number of feature channels and the available receptive field vary between the two networks. Regarding the effective rather than maximum receptive field, see Appendix B.2. The invertibility is also associated with an extra cost of parameters and computation, summarized in Appendix Table 5: Both in terms of network parameters, as well as FLOPs for one forward pass, the cost of the INN is about twice as high as a standard ResNet-50. We are optimistic that this overhead can be reduced in the future with more efficient INN architectures. + +
LayerBlocksIm. sizeChannelsR.F.
INNResNetINNResNet
Input22433
Entry flow1112126486
Pool (Haar/max)5648641010
Conv_2_x356482563434
Conv_3_x42819251210690
Conv_4_x6147681024314266
Conv_5_x3730722048538426
Pool (DCT/avg.)11505282048∞∞
+ +Table 1: For each of the resolution levels in the INN and ResNet-50, the number of coupling/residual blocks and spatial size is given, along with the number of feature channels and the maximum possible receptive field (R.F.). + +![](images/5fc11328ca6ab26ce32c36f24abc32041718e9d0a7bcfbfd05ca34f4e5f7d1c2.jpg) +Figure 2: Trade-off between the two losses $\mathcal{L}_X$ and $\mathcal{L}_Y$ (left), and between generative modeling accuracy in bits/dim, and top-1 accuracy (right). Each point represents one model, trained with a different beta. A standard ResNet has no $\mathcal{L}_X$ loss and is shown as a horizontal line. The model with $\beta = 0$ (standard normalizing flow) is missing the $\mathcal{L}_Y$ loss and is shown as a vertical line. The small numbers inside the markers give the value of $\beta$ of that particular model. + +![](images/109a18827c2212a1abf48620a81ac4b7d973bd3c3edd089bf898655408bf8f02.jpg) + +# 4.1. General Performance + +We train several generative classifiers, with the following values for the hyperparameter $\beta \in \{1,2,4,8,16,32,\infty\}$ . Again, $\beta$ controls how much the model focuses on the generative likelihood estimation aspect (low $\beta$ ), vs. prioritizing good classification performance (high $\beta$ ). In addition, we include a model trained with $\beta = 0$ , i.e. no classification at all, analogous to a standard normalizing flow, as well as a standard feed-forward ResNet-50 [21], i.e. a pure DC. + +The primary performance metrics used in Table 2 and Fig. 2 are firstly, the top-1 accuracy on the test set (in our case, the ILSVCR 2012 validation set [40]). We use 10-crop testing, which is most commonly used for performance evaluation in this setting. Secondly, for the generative likelihood estimation performance, we use the bits per dimension ('bits/dim') metric, as this is the prevalent evaluation metric for likelihood-based generative models such as normalizing flows. It quantitatively measures the accuracy of the density estimation (i.e. generative performance), explained e.g. in [48], where a lower bits/dim corresponds to a more accurate generative model. + +In Table 2, we report the test losses and the two dis + +
β\( {\mathcal{L}}_{X}^{\left( \text{test}\right) }\left( \downarrow \right) \)\( {\mathcal{L}}_{Y}^{\left( \text{test}\right) }\left( \downarrow \right) \)Bits/dim (↓)Acc. (%) (↑)OCE (↓)
1-1.908.524.3467.303.87
2-0.658.266.1471.734.13
41.148.148.7273.694.31
83.668.1012.3574.594.73
167.178.0617.4375.544.15
3210.818.0122.6876.184.94
∞27.687.9947.0176.275.12
0-3.11-2.59--
ResNet-7.87-77.406.75
+ +Table 2: Test losses and metrics for models trained with different $\beta$ . Bits/dimension quantifies the performance of density estimation models (see text, smaller is better, i.e. more accurate generative model). As with the original ResNet, the classification accuracy uses 10-crop testing. OCE is the overconfidence error, i.e. how often confident predictions are wrong (see text, smaller is better). + +cussed performance metrics for the different models. Further shown in Fig. 2, changing $\beta$ moves smoothly between the limit cases of a feed-forward network, and a pure density estimation model: the classification accuracy increases continuously with $\beta$ , but a minor gap remains to the feedforward ResNet-50, in line with works such as [27]. Simultaneously and as expected, the bits/dim get worse as we move away from a purely generative model ( $\beta = 0$ ). + +Lastly, we examine the uncertainty calibration, a quantitative measure of the quality of the predictive posteriors. The full analysis is provided in the Appendix Table 6. Here we only report the overconfidence error 'OCE', which measures the normalized classification error of predictions with a high confidence $C \geq C_{\mathrm{crit}} = 99.7\%$ . For instance, if the error rate in these cases is $1.1\%$ , although it should only be $0.3\%$ according to the confidence, this gives an OCE of $1.1 / 0.3 \approx 3.7$ . Our findings are in line with previous works, in that the uncertainty calibration improves with lower $\beta$ and better generative capabilities [3]. + +# 4.2. Explainability + +In the following, we demonstrate several examples on how GCs can be used for native and intuitive explanations of the data and the prediction outputs. Certainly, algorithms and approaches exist that can generate similar results for DCs. The point of the following examples is to show that in GCs a range of explanations is available using only the structure of latent space and the learned likelihoods, without requiring additional modifications or algorithms applied in a post-hoc manner. + +Visualizing decision-space: The properties of a classification decision are fully determined by the latent code of an input image in relation to the surrounding classes. The only difficulty consists in reducing the high-dimensional latent space to a 2D plot. Fig. 3 shows one possibility: latent codes are visualized in a plane through the centers of the two most probable classes, such that relative distances to + +![](images/dc4c6e30b933d7f95710327565a602b0c85d4e9e2eb0715b3e37e303ec2d810c.jpg) + +![](images/a1e8f26b93679ce176a47cf4b3a2ea325f7f0cf63a1a3ee41baf1f29dbe4f619.jpg) + +![](images/6119d6dfe972561bb660c003090db89005f9eb9a814f26ec7a83920d4fea7b51.jpg) +Figure 3: Latent space location of input images (black point) in the decision space spanned by the $\mu_y$ of the top 5 predicted classes. The horizontal axis of the plot is the axis connecting the top 2 predicted classes (red and blue points). The vertical axis of the plot shows the radial distance from the horizontal axis in the 5D space. The illustrative circles are chosen such that in both the vertical and horizontal directions, $90\%$ of the mass of the Gaussian mixture component lies inside. Note that the axes in the plot are scaled differently to make it appear as a circle. Test examples from left to right: a confident in-distribution decision, an uncertain in-distribution decision due to ambiguous classes, an uncertain decision due to multiple plausible image interpretations, an uncertain out-of-distribution decision. + +![](images/2c6af53602f2d402560c6f26f74e63056e91f0a3d4d480ac1255e34f9d3ef016.jpg) + +the centers and to their connecting axis are preserved. A second approach is given in Appendix C.1, where the classification among a subset of classes can be fully visualized. + +Class similarities: Building on Fig. 3, we see that different classes have various amounts of overlap, which represents the relationship between them. This is not possible for a feed-forward model, as there is no latent space where the input data is embedded in such a way. We observe that the locations $\mu_y$ of the Gaussian mixture components are close together for classes that are semantically similar, and far apart for classes that are dissimilar. + +Importantly, this also has implications for predictions the model makes. For instance, in Fig. 3, top right, the classes overlap a lot. This means more points will lie in the overlap zone, and consequently more of these decisions will be uncertain, compared to e.g. bottom left, where most inputs will be in only one of two classes. More precisely, the closer two class centers are, the larger is the overlap, and the larger + +![](images/965d71e63ddec37c66c1f4268adbe0464db822b735e9ab229368afca42340245.jpg) +Figure 4: Latent similarity between different classes. The colormap indicates the pairwise distance of the $\mu_y$ as well as the expected pairwise posterior, meaning e.g. the binary decision between "tabby cat" and "tiger cat" is associated with $20\%$ expected uncertainty, by construction (see text). The distance on the diagonal is 0 (outside colormap range). + +![](images/b1d0343f9af934d170c3df72c946122d029491ef103189d9749808e9b9098298.jpg) + +![](images/7807c9c1221da776b10f1de447f074c9a9200e38d916a7fd53640b46e9351792.jpg) + +![](images/d20672a53e5e1de4fba6fbfb5361ac41a4e338b14df3bc888db8315a2ccd3c41.jpg) + +![](images/764b20ac4ab0a5126a229e8ab6bca8d58552f3e6e618c91a6cc2410cad1bc64c.jpg) +Figure 5: Examples of the prediction heatmaps. Summing the bright areas directly gives the final class prediction. Top: bowtie and sunglasses are located, suit is distributed over a large area. Middle: The head of the bird causes it to be classified as a limpkin, whereas the feathers are more indicative of an eagle or vulture. Bottom: The heatmaps of both Rottweiler and Appenzeller classes are located in the same area (ambiguous classes), while the soccer ball is separate. + +the proportion of split decisions between these classes. In fact, if a class A is the top prediction, the expected confidence for any other class B can be worked out explicitly from the distance between $\mu_{A}$ and $\mu_{B}$ in latent space, see Appendix C.2. Some examples are shown in Fig. 4, with the full similarity matrix in Appendix Fig. 16. + +These considerations highlight an important fact: the latent mixture model contains a built-in uncertainty between classes. A decision between similar classes will always be uncertain, by the structure of the latent space alone. This may be one of the reasons explaining why the predictive uncertainties are better calibrated in such GCs. + +Posterior Heatmaps: To increase the trust in a decision, it is often helpful to show which regions of the image were + +relevant. Examples are widespread where models e.g. base the decision on the background of the image, not the object in question, or focus only on a specific detail that identifies an object. Approaches such as CAM or GradCAM [56, 42] are used to generate coarse heatmaps showing regions that are influential for a particular decision. With the IB-INN, we can provide such heatmaps as a direct decomposition of the prediction output, meaning they can be understood simply as a different way of representing the model output, rather than a post-hoc explanation technique. + +To produce a spatially structured output, we consider the following: Due to the invertibility of every part of the model, we can start from the output $z$ , and transform it back through the DCT operation. Unlike standard mean-pooling, the DCT pooling does not lose any information in either direction. We define the following for short: + +$$ +w ^ {(y)} = \mathrm {D C T} ^ {- 1} (z - \mu_ {y}). \tag {8} +$$ + +Importantly, $w^{(y)}$ has the spatial structure of the final convolutional outputs, $w_{kl}^{(y)}$ , with height- and width indexes $k$ and $l$ . Because the DCT is linear and orthogonal, it conserves distances, i.e. $\| z - \mu_y\| = \| w^{(y)}\|$ , which allows us to write + +$$ +q (z | y) \propto \exp \left(- \frac {\| w ^ {(y)} \| ^ {2}}{2}\right) = \exp \left(- \sum_ {k l} \frac {\left(w _ {k l} ^ {(y)}\right) ^ {2}}{2}\right) \tag {9} +$$ + +This means the latent density is can be written as a sum over spatial coordinates inside the exponential. We can do the same kind of decomposition to the posterior with a few extra steps, noting $q(y|x) = q(z|y)p(y) / q(z)$ . This leads to our heatmap $Q_{\mathrm{Class}}(k,l,y)$ , that sums to the class posterior over space in the same way as in Eq. 9: + +$$ +q _ {\theta} (y | x) = \exp \left(\sum_ {k l} Q _ {\text {C l a s s}} (k, l, y)\right). \tag {10} +$$ + +$Q_{\mathrm{Class}}$ has a single hyperparameter that adjusts the contrast of the heatmaps. The derivation is given in Appendix C.4. Examples are shown in Fig. 5. Similarly, we can compute a salience map $Q_{\mathrm{Salience}}(k,l,y)$ , that decomposes $q_{\theta}(x)$ spatially, showing which parts of the image contain the most information according to the model, explained and shown in Appendix C.3. + +
NoiseBlurWeatherDigital
βClean ErrormCErel. mCEΔ entropy.OoDGauss.ShotImpulseDefocusGlassMotionZoomSnowFrostFogBrightContrastElasticPixelJPEG
0----77.5194.994.398.095.789.888.389.538.143.194.844.796.765.563.066.2
132.798.51161.6267.995.395.298.692.987.184.987.433.045.496.543.597.060.461.955.6
228.2792.51191.7573.694.895.298.587.882.681.384.930.943.296.544.195.256.661.051.2
426.3188.21171.7270.8492.793.897.477.676.775.681.731.043.295.544.589.254.161.748.0
825.4186.81171.8165.8589.391.294.656.963.563.173.737.646.687.845.171.253.165.149.1
1624.4684.91151.7962.4383.784.688.046.756.763.567.943.252.080.245.666.353.362.042.7
3223.8283.11131.7155.8381.681.584.039.851.650.154.843.944.361.644.653.952.452.541.1
∞23.7383.41141.5844.2439.544.540.642.848.146.346.040.938.936.144.348.552.247.947.0
ResNet22.678.21091.51-
+ +Table 3: We report the error on the unperturbed images (clean error), the mean corruption error ( $mCE$ ) and the relative mCE, describing the relative performance degradation caused the corruptions ( $\Delta$ entropy.). Furthermore, we report the OoD ROC-AUC detection score ( $OoD$ ) averaged over all corruptions as well as for the individual corruptions. Meaning of colors: good detection $\geq 85\%$ ; some detection $>55\%$ ; random or worse detection $\leq 55\%$ . + +# 4.3. Robustness + +Different Measures of Robustness: In current literature, there is no agreement upon a single measurement that clearly defines robustness in deep learning. In general, the question is how a model reacts to out-of-distribution (OoD) inputs, meaning inputs that do not come from the same distribution as the training data. We identify four different concepts of robustness, which are commonly used: + +(1) Especially for dataset shifts that preserve the semantic information, a robust model is one that retains good performance for the OoD inputs. +(2) There are other cases where definition (1) is not applicable: There is no 'correct' prediction if the OoD input does not contain any of the classes which were trained for. The second idea of robustness is therefore that the model should at least make uncertain predictions for OoD inputs, measured by discrete entropy of the predictive outputs [44]. In reality, standard (non-robust) models make highly confident predictions on OoD data [44]. +(3) A robust model can be one that is able to explicitly detect OoD inputs. In this case, along with the usual task output, the model has some auxiliary output that indicates whether an input is OoD. The model is robust by explicitly indicating that it's prediction may not be trusted in these cases. GCs are uniquely suited for this, as the estimated likelihood of the inputs can serve as a built-in OoD detection mechanism, but other approaches also exist [31, 23, 9]. To measure this, metrics such as the area under the receiver-operator curve can be used (AUC-ROC). +(4) In the context of adversarial attacks, robustness is commonly understood to be the amplitude of adversarial perturbation necessary to trick the model [53]. + +Handling Corrupted Images: We first consider the robustness test in the sense of (1) established by [22]. Here, the existing ImageNet validation images are corrupted with 5 severity levels in 15 different ways, examples are shown in Appendix D.1. The authors propose the mean corruption error (mCE) and the relative mean corruption error (rel. mCE) score to measure the robustness of a classifier. We also mea + +sure the increase in predictive entropy as in [44] for robustness in the sense of (2), and perform OoD detection (3). + +As can be seen in Table 3 the GC does not show an improvement compared to the ResNet in terms of (rel.) mCE, regardless of $\beta$ . However, it infers more uncertain predictions on corrupted data. For OoD detection, we observe overall better scores for smaller values for $\beta$ . We find the GC trained with $\beta = 2$ to be the most robust classification model: It is able to detect a wide range of corruption types while being a reasonably good classifier (4.54 percentage point classification accuracy gap compared to the $\beta = \infty$ model and 5.67 gap compared to the ResNet). + +Handling Adversarial Attacks: We are interested in finding out if generative classifiers are more robust to adversarial attacks in the sense of (4). We are not proposing a new, competitive method of adversarial attack defense, the goal is simply to examine whether GCs are naturally more robust to adversarial attacks on ImageNet, in the same way it was observed for e.g. MNIST previously [33, 41]. For this, we perform the well established 'Carlini-Wagner' white-box targeted attack introduced in [8], which optimizes the following objective: + +$$ +\mathcal {L} _ {\mathrm {C W}} = \| x - x _ {\mathrm {a d v}} \| ^ {2} + c \cdot \mathcal {L} _ {\text {c l a s s}} ^ {(\kappa)} \left(y _ {\text {t a r g e t}}\right), \tag {11} +$$ + +i.e. the attacked image $x_{\mathrm{adv}}$ should be close to the original image $x$ , while being classified as a target class $y_{\mathrm{target}}$ . $\kappa$ is a hyperparameter that specifies how large the difference in logits should be between $y_{\mathrm{target}}$ and the next highest class, controlling how confident the classifier will be forced to be in its (wrong) decision. When facing a model such as a GC, which can detect attacks, it is also possible to add an extra loss term $\mathcal{L}_{\mathrm{detect}}$ in order to fool the detection mechanism as well, as proposed in [7]: + +$$ +\mathcal {L} _ {\mathrm {C W D}} = \left\| x - x _ {\mathrm {a d v}} \right\| ^ {2} + c \cdot \mathcal {L} _ {\text {c l a s s}} ^ {(\kappa)} \left(y _ {\text {t a r g e t}}\right) + d \cdot \mathcal {L} _ {\text {d e t e c t}} \tag {12} +$$ + +The full formulation of the attack objectives is given in Appendix D.2. + +For evaluation, we examine standard CW attacks and two detection-fooling attacks with $d = 66$ and $d = 1000$ , + +![](images/f170d1b19ee40714293b24f1e40886fc3f1697436747f3067d13f30a158ce98b.jpg) +Figure 6: Trajectory of four adversarial attacks shown in latent space (colored curves), with $\kappa = 1$ , $d = 0$ (standard CW). The large black dot indicates the position of $\mu_{\mathrm{target}}$ , the target class being 'Harvestman (spider)'. The solid black lines are the decision boundaries to the surrounding classes. The dashed black lines are the boundaries of the region where the classifier is fooled with sufficiently high confidence corresponding to $\kappa$ . In the dotted section of the colored trajectories, the classifier is not yet fooled with sufficiently high confidence. In the solid section, the classifier has been fooled, and the attack only tries to reduce the perturbation. Below, the four perturbed images are shown, along with the absolute perturbation. More examples and detailed explanation in Appendix D.3. + +each for three values of $\kappa \in \{0.01, 1, \infty\}$ . For these 9 attack settings, we measure the L2 perturbation of the images after the attack and the ROC-AUC of the attack detection. + +The results are presented in Fig 7, from which we make several key observations. We conclude that the GC requires roughly $2 \times$ larger perturbations for a standard adversarial compared to the ResNet, in line with [33]. We also observe the attack detection mechanism to be partially robust against attacks; even with $d = 1000$ it still works reasonably well for some cases. Furthermore, within this setting, the size of the perturbation is even more extensive compared to the standard attack setting. Fooling the classifier to predict the wrong class with greater confidence also increases the necessary perturbation as the detectability. An intuitive visualization of the adversarial attack in latent space is shown in Fig. 6. + +![](images/932744481a383b7c6d27d6dc0fa9ecb41d3cb8585e18c192d2496151c606189c.jpg) +Figure 7: Behaviour of GCs under adversarial attacks. The first column of plots shows the mean perturbation, the second shows the detection ROC-AUC. The three rows of plots correspond to adversarial attacks with $\kappa = 0.01$ (any confidence for the target prediction is enough), $\kappa = 1$ (should have high confidence), and $\kappa = \infty$ (should be as confident as possible). The labels on the x-axis give the values of $\beta$ , 'RN' is a ResNet-50. The three bars for each $\beta$ correspond to: standard adversarial attack ( $d = 0$ ), $d = 66$ , and $d = 1000$ , i.e. the detection mechanism is fooled at the same time as the prediction. The dotted line in the perturbation plots roughly indicates the level at which attacks are visible by eye. Note that this is subjective and only a rough indication. The line in the detection plots indicates random performance, i.e. the OoD detection does nothing useful. + +![](images/a84a10d0cdb16394283070b4b63ae544f617566b8caf9ff71b29b37e574c1ac8.jpg) + +# 5. Conclusion + +In this work we have addressed the question of trustworthiness for image classification. In the past, many properties linked with trustworthiness have been ascribed to generative classifier (GCs), such as increased robustness and explainability. Our GC performs nearly on-par with a standard discriminative classifier (DC), here ResNet, when tuned for discriminative performance. We observe that our GC offers significant improvements over standard DCs in terms of explainability and native out-of-distribution detection capability, but does not automatically solve all aspects of trustworthiness: Contrary to common belief, it does not generalize better under image corruptions than a DC, and it does not fully prevent adversarial attacks. In the future, we expect that robustness can be increased with further modifications or additional post-processing algorithms, as already exist for DCs. Finally, we contribute downloadable GC models pre-trained on ImageNet. + +# References + +[1] Lynton Ardizzone, Jakob Kruse, Carsten Rother, and Ullrich Kothe. Analyzing inverse problems with invertible neural networks. In Intl. Conf. on Learning Representations, 2019. +[2] Lynton Ardizzone, Carsten Lüth, Jakob Kruse, Carsten Rother, and Ullrich Köthe. Guided image generation with conditional invertible neural networks. arXiv preprint arXiv:1907.02392, 2019. +[3] Lynton Ardizzone, Radek Mackowiak, Carsten Rother, and Ullrich Kothe. Training normalizing flows with the information bottleneck for competitive generative classification. Advances in Neural Information Processing Systems, 33, 2020. +[4] Jens Behrmann, David Duvenaud, and Jörn-Henrik Jacobsen. Invertible residual networks. arXiv:1811.00995, 2018. +[5] Christopher M. Bishop and Julia Lasserre. Generative or discriminative? getting the best of both worlds. Bayesian statistics, 8(3):3-24, 2007. +[6] Guillaume Bouchard and Bill Triggs. The tradeoff between generative and discriminative classifiers. In 16th IASC International Symposium on Computational Statistics (COMP-STAT'04), pages 721-728, 2004. +[7] Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pages 3-14, 2017. +[8] Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy, SP 2017, San Jose, CA, USA, May 22-26, 2017, pages 39-57. IEEE Computer Society, 2017. +[9] Jiefeng Chen, Yixuan Li, Xi Wu, Yingyu Liang, and Somesh Jha. Robust out-of-distribution detection in neural networks. CoRR, abs/2003.09711, 2020. +[10] Hyunsun Choi, Eric Jang, and Alexander A Alemi. Waic, but why? generative ensembles for robust anomaly detection. arXiv preprint arXiv:1810.01392, 2018. +[11] LI Chongxuan, Taufik Xu, Jun Zhu, and Bo Zhang. Triple generative adversarial nets. In Advances in neural information processing systems, pages 4088-4098, 2017. +[12] Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-linear independent components estimation. arXiv:1410.8516, 2014. +[13] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. arXiv:1605.08803, 2016. +[14] Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. In Intl. Conf. on Learning Representations, 2017. +[15] Ethan Fetaya, Jorn-Henrik Jacobsen, Will Grathwohl, and Richard S. Zemel. Understanding the limitations of conditional generative models. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. +[16] Ethan Fetaya, Jörn-Henrik Jacobsen, and Richard S. Zemel. Conditional generative models are not robust. CoRR, abs/1906.01171, 2019. + +[17] Partha Ghosh, Arpan Losalka, and Michael J. Black. Resisting adversarial attacks using gaussian mixture variational autoencoders. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 541-548. AAAI Press, 2019. +[18] Leilani H Gilpin, David Bau, Ben Z Yuan, Ayesha Bajwa, Michael Specter, and Lalana Kagal. Explaining explanations: An overview of interpretability of machine learning. In 2018 IEEE 5th International Conference on data science and advanced analytics (DSAA), pages 80-89. IEEE, 2018. +[19] Will Grathwohl, Ricky TQ Chen, Jesse Betterncourt, Ilya Sutskever, and David Duvenaud. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018. +[20] Will Grathwohl, Kuan-Chieh Wang, Jorn-Henrik Jacobsen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky. Your classifier is secretly an energy based model and you should treat it like one. arXiv preprint arXiv:1912.03263, 2019. +[21] 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. +[22] Dan Hendrycks and Thomas G. Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. +[23] Yen-Chang Hsu, Yilin Shen, Hongxia Jin, and Zsolt Kira. Generalized ODIN: detecting out-of-distribution image without learning from out-of-distribution data. CoRR, abs/2002.11297, 2020. +[24] Xiaowei Huang, Daniel Kroening, Wenjie Ruan, James Sharp, Youcheng Sun, Emese Thamo, Min Wu, and Xinping Yi. A survey of safety and trustworthiness of deep neural networks. arXiv preprint arXiv:1812.08342, 2018. +[25] Pavel Izmailov, Polina Kirichenko, Marc Finzi, and Andrew Gordon Wilson. Semi-supervised learning with normalizing flows. arXiv preprint arXiv:1912.13025, 2019. +[26] Jorn-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive invariance causes adversarial vulnerability. arXiv preprint arXiv:1811.00401, 2018. +[27] Jorn-Henrik Jacobsen, Arnold W.M. Smeulders, and Edouard Oyallon. i-RevNet: deep invertible networks. In International Conference on Learning Representations, 2018. +[28] Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. arXiv:1807.03039, 2018. +[29] Durk P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in neural information processing systems, pages 3581-3589, 2014. +[30] Polina Kirichenko, Pavel Izmailov, and Andrew Gordon Wilson. Why normalizing flows fail to detect out-of-distribution + +data. Advances in neural information processing systems, 33, 2020. +[31] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesà-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montréal, Canada, pages 7167-7177, 2018. +[32] Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. arXiv preprint arXiv:1901.11300, 2019. +[33] Yingzhen Li, John Bradshaw, and Yash Sharma. Are generative classifiers more robust to adversarial attacks? In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 3804-3814. PMLR, 2019. +[34] Eric T. Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don't know? In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019. +[35] Eric T. Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Hybrid models with deep and invertible features. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pages 4723-4732, 2019. +[36] Eric T. Nalisnick, Akihiro Matsukawa, Yee Whye Teh, and Balaji Lakshminarayanan. Detecting out-of-distribution inputs to deep generative models using a test for typicality. CoRR, abs/1906.02994, 2019. +[37] Andrew Y. Ng and Michael I. Jordan. On discriminative vs. generative classifiers: A comparison of logistic regression and naive bayes. In Advances in Neural Information Processing Systems 14 [Neural Information Processing Systems: Natural and Synthetic, NIPS 2001, December 3-8, 2001, Vancouver, British Columbia, Canada], pages 841-848, 2001. +[38] Rajat Raina, Yirong Shen, Andrew Mccallum, and Andrew Y Ng. Classification with hybrid generative/discriminative models. In Advances in neural information processing systems, pages 545-552, 2004. +[39] Christian Raymond and Giuseppe Riccardi. Generative and discriminative algorithms for spoken language understanding. In Eighth Annual Conference of the International Speech Communication Association, 2007. +[40] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 115(3):211-252, 2015. + +[41] Lukas Schott, Jonas Rauber, Matthias Bethge, and Wieland Brendel. Towards the first adversarially robust neural network model on MNIST. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. +[42] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pages 618-626, 2017. +[43] Joan Serrà, David Álvarez, Vicenç Gómez, Olga Slizovskaia, José F Núñez, and Jordi Luque. Input complexity and out-of-distribution detection with likelihood-based generative models. arXiv preprint arXiv:1909.11480, 2019. +[44] Jasper Snoek, Yaniv Ovadia, Emily Fertig, Balaji Lakshminarayanan, Sebastian Nowozin, D Sculley, Joshua Dillon, Jie Ren, and Zachary Nado. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. In Advances in Neural Information Processing Systems, pages 13969-13980, 2019. +[45] Jiaming Song, Yang Song, and Stefano Ermon. Unsupervised out-of-distribution detection with batch normalization. arXiv preprint arXiv:1910.09115, 2019. +[46] 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. +[47] Esteban G Tabak and Cristina V Turner. A family of nonparametric density estimation algorithms. Communications on Pure and Applied Mathematics, 66(2):145-164, 2013. +[48] Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015. +[49] Naftali Tishby, Fernando C. N. Pereira, and William Bialek. The information bottleneck method. CoRR, physics/0004057, 2000. +[50] Jakub M Tomczak and Max Welling. Improving variational auto-encoders using householder flow. arXiv preprint arXiv:1611.09630, 2016. +[51] Ilkay Ulusoy and Christopher M. Bishop. Comparison of generative and discriminative techniques for object detection and classification. In Toward Category-Level Object Recognition, pages 173-195, 2006. +[52] Christina Winkler, Daniel Worrall, Emiel Hoogeboom, and Max Welling. Learning likelihoods with conditional normalizing flows. arXiv preprint arXiv:1912.00042, 2019. +[53] Han Xu, Yao Ma, Haochen Liu, Debayan Deb, Hui Liu, Jiliang Tang, and Anil Jain. Adversarial attacks and defenses in images, graphs and text: A review. arXiv preprint arXiv:1909.08072, 2019. +[54] Jing-Hao Xue and D. M. Titterington. On the generative-discriminative tradeoff approach: Interpretation, asymptotic efficiency and classification performance. Computational Statistics & Data Analysis, 54(2):438-451, 2010. +[55] Yufeng Zhang, Wanwei Liu, Zhenbang Chen, Ji Wang, Zhiming Liu, Kenli Li, Hongmei Wei, and Zuoning Chen. + +Out-of-distribution detection with distance guarantee in deep generative models. arXiv preprint arXiv:2002.03328, 2020. +[56] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2921-2929, 2016. \ No newline at end of file diff --git a/generativeclassifiersasabasisfortrustworthyimageclassification/images.zip b/generativeclassifiersasabasisfortrustworthyimageclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..efcf0340fab4cc1c9d5dd5459cdeb17e082bbaf6 --- /dev/null +++ b/generativeclassifiersasabasisfortrustworthyimageclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ebd3086a1c1e9de9b18eee178f89006791420e4adaff2bb6ca411e7872b5c2c +size 482794 diff --git a/generativeclassifiersasabasisfortrustworthyimageclassification/layout.json b/generativeclassifiersasabasisfortrustworthyimageclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fba873eff3ec2a5d6d4eb5f1adac9b2ce98bb45d --- /dev/null +++ b/generativeclassifiersasabasisfortrustworthyimageclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36c594cf9d5b3b259de39ca316038c30f5c6c623ef5c2aad99af2b785ba1408f +size 465165 diff --git a/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_content_list.json b/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bd964dfb79adf0d9b469c13af73a08f3f749406a --- /dev/null +++ b/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecdd1b1933b9b60dcdd22339e4c7b5ed16a2b9050dcbb362a91cc7742756692e +size 93277 diff --git a/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_model.json b/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..34591019c96d13a4a6fd8a6ef16fb526909ebd9c --- /dev/null +++ b/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7be339f069c99fef303dc8c4c33dd4caf21a0353ada7cd57734be04c5c462b1 +size 113255 diff --git a/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_origin.pdf b/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c77ef1a8f4e8fcc38b8c1e57e0bab6191b188d7f --- /dev/null +++ b/generativehierarchicalfeaturesfromsynthesizingimages/d3f1d387-5a67-4e8c-82c9-bf3e31d9011f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:456ccccde15841e43f3da7d4329ff032541e2628706bdf822a8c5306d4f2d44f +size 3785284 diff --git a/generativehierarchicalfeaturesfromsynthesizingimages/full.md b/generativehierarchicalfeaturesfromsynthesizingimages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b95f8790901c5aa8733f9823903cb0c8a50442b4 --- /dev/null +++ b/generativehierarchicalfeaturesfromsynthesizingimages/full.md @@ -0,0 +1,429 @@ +# Generative Hierarchical Features from Synthesizing Images + +Yinghao Xu* Yujun Shen* Jiapeng Zhu Ceyuan Yang Bolei Zhou The Chinese University of Hong Kong + +{xy119, syl116, jpzhu, yc019, bzhou}@ie.cuhk.edu.hk + +# Abstract + +Generative Adversarial Networks (GANs) have recently advanced image synthesis by learning the underlying distribution of the observed data. However, how the features learned from solving the task of image generation are applicable to other vision tasks remains seldom explored. In this work, we show that learning to synthesize images can bring remarkable hierarchical visual features that are generalizable across a wide range of applications. Specifically, we consider the pre-trained StyleGAN generator as a learned loss function and utilize its layer-wise representation to train a novel hierarchical encoder. The visual feature produced by our encoder, termed as Generative Hierarchical Feature (GH-Feat), has strong transferability to both generative and discriminative tasks, including image editing, image harmonization, image classification, face verification, landmark detection, and layout prediction. Extensive qualitative and quantitative experimental results demonstrate the appealing performance of GH-Feat. $^{1}$ + +# 1. Introduction + +Representation learning plays an essential role in the rise of deep learning. The learned representation is able to express the variation factors of the complex visual world. Accordingly, the performance of a deep learning algorithm highly depends on the features extracted from the input data. As pointed out by Bengio et al. [4], a good representation is expected to have the following properties. First, it should be able to capture multiple configurations from the input. Second, it should organize the explanatory factors of the input data as a hierarchy, where more abstract concepts are at a higher level. Third, it should have strong transferability, not only from datasets to datasets but also from tasks to tasks. + +Deep neural networks supervisedly trained for image classification on large-scale datasets (e.g., ImageNet [8] and Places [66]) have resulted in expressive and discriminative + +visual features [46]. However, the developed features are heavily dependent on the training objective. For example, prior work has shown that deep features trained for the object recognition task may mainly focus on the shapes and parts of the objects while remain invariant to rotation [1, 41], and the deep features from a scene classification model may focus more on detecting the categorical objects (e.g., bed for bedroom and sofa for living room) [65]. Thus the discriminative features learned from solving high-level image classification tasks might not be necessarily good for other mid-level and low-level tasks, limiting their transferability [57, 64]. Besides, it remains unknown how the discriminative features can be used in generative applications like image editing. + +Generative Adversarial Network (GAN) [17] has recently made great progress in synthesizing photo-realistic images. It considers the image generation task as the training supervision to learn the underlying distribution of real data. Through adversarial training, the generator can capture the multi-level variations underlying the input data to the most extent, otherwise, the discrepancy between the real and synthesized data would be spotted by the discriminator. The recent state-of-the-art StyleGAN [31] has been shown to encode rich hierarchical semantics in its layer-wise representations [31, 55, 47]. However, the generator is primarily designed for image generation and hence lacks the inference ability of taking an image as the input and extracting its visual feature, which greatly limits the applications of GANs to real images. + +To solve this problem, a common practice is to introduce an additional encoder into the two-player game described in GANs [12, 15, 13, 44]. Nevertheless, existing encoders typically choose the initial latent space (i.e., the most abstract level feature) as the target representation space, omitting the pre-layer information learned by the generator. On the other hand, the transferability of the representation from GAN models is not fully verified in the literature. Most prior work focuses on learning discriminative features for the high-level image classification task [12, 15, 13] yet put little effort on other mid-level and low-level downstream tasks, such as landmark detection and layout prediction. + +In this work, we show that the pre-trained GAN generator can be considered as a learned loss function. Training with it can bring highly competitive hierarchical visual features which are generalizable to various tasks. Based on the StyleGAN model, we tailor a novel hierarchical encoder whose outputs align with the layer-wise representations from the generator. In particular, the generator takes the feature hierarchy produced by the encoder as the per-layer inputs and supervises the encoder via reconstructing the input image. We evaluate such visual features, termed as Generative Hierarchical Features (GH-Feat), on both generative and discriminative tasks, including image editing, image harmonization, image classification, face verification, landmark detection, layout prediction, etc. Extensive experiments validate that the generative feature learned from solving the image synthesis task has compelling hierarchical and transferable properties, facilitating many downstream applications. + +# 2. Related Work + +Visual Features. Visual Feature plays a fundamental role in the computer vision field. Traditional methods used manually designed features [40, 3, 7] for pattern matching and object detection. These features are significantly improved by deep models [34, 49, 20], which automatically learn the feature extraction from large-scale datasets. However, the features supervisedly learned for a particular task could be biased to the training task and hence become difficult to transfer to other tasks, especially when the target task is too far away from the base task [57, 64]. Unsupervised representation learning is widely explored to learn a more general and transferable feature [10, 61, 53, 16, 24, 68, 19, 42, 21, 51]. However, most of existing unsupervised feature learning methods focus on evaluating their features on the tasks of image recognition, yet seldom evaluate them on other mid-level or low-level tasks, let alone generative tasks. Shocher et al. [48] discover the potential of discriminative features in image generation, but the transferability of these features are still not fully verified. + +Generative Adversarial Networks. GANs [17] are able to produce photo-realistic images via learning the underlying data distribution. The recent advance of GANs [45, 30, 5] has significantly improved the synthesis quality. StyleGAN [31] proposes a style-based generator with multi-level style codes and achieves the start-of-the-art generation performance. However, little work explores the representation learned by GANs as well as how to apply such representation for other applications. Some recent work interprets the semantics encoded in the internal representation of GANs and applies them for image editing [27, 47, 2, 18, 55, 67]. But it remains much less explored whether the learned GAN representations are transferable to discriminative tasks. + +Adversarial Representation Learning. The main reason of hindering GANs from being applied to discriminative tasks comes from the lack of inference ability. To fill this gap, prior work introduces an additional encoder to the GAN structure [12, 15]. Donahue and Simonyan [13] and Pidhorskyi et al. [44] extend this idea to the state-of-the-art BigGAN [5] and StyleGAN [31] models respectively. In this paper, we also study the representation learning using GANs, with following improvements compared to existing methods. First, we propose to treat the well-trained StyleGAN generator as a learned loss function. Second, instead of mapping the images to the initial GAN latent space, like most algorithms [12, 15, 13, 44] have done, we design a novel encoder to produce hierarchical features that well align with the layer-wise representation learned by StyleGAN. Third, besides the image classification task that is mainly targeted at by prior work [12, 15, 13, 44], we validate the transferability of our proposed GH-Feat on a range of generative and discriminative tasks, demonstrating its generalization ability. + +# 3. Methodology + +We design a novel encoder to extract hierarchical visual features from the input images. This encoder is trained in an unsupervised learning manner from the image reconstruction loss based on a prepared StyleGAN generator. Sec. 3.1 describes how we abstract the multi-level representation from StyleGAN. Sec. 3.2 presents the structure of the novel hierarchical encoder. Sec. 3.3 introduces the idea of using pre-trained StyleGAN generator as a learned loss function for representation learning. + +# 3.1. Layer-wise Representation from StyleGAN + +The generator $G(\cdot)$ of GANs typically takes a latent code $\mathbf{z} \in \mathcal{Z}$ as the input and is trained to synthesize a photo-realistic image $\mathbf{x} = G(\mathbf{z})$ . The recent state-of-the-art StyleGAN [31] proposes to first map $\mathbf{z}$ to a disentangled space $\mathcal{W}$ with $\mathbf{w} = f(\mathbf{z})$ . Here, $f(\cdot)$ denotes the mapping implemented by multi-layer perceptron (MLP). The $\mathbf{w}$ code is then projected to layer-wise style codes $\{\mathbf{y}^{(\ell)}\}_{\ell=1}^{L} \triangleq \{(\mathbf{y}_s^{(\ell)}, \mathbf{y}_b^{(\ell)})\}_{\ell=1}^{L}$ with affine transformations, where $L$ is the number of convolutional layers. $\mathbf{y}_s^{(\ell)}$ and $\mathbf{y}_b^{(\ell)}$ correspond to the scale and weight parameters in Adaptive Instance Normalization (AdaIN) [26]. These style codes are used to modulate the output feature maps of each convolutional layer with + +$$ +\operatorname {A d a I N} \left(\mathbf {x} _ {i} ^ {(\ell)}, \mathbf {y} ^ {(\ell)}\right) = \mathbf {y} _ {s, i} ^ {(\ell)} \frac {\mathbf {x} _ {i} ^ {(\ell)} - \mu \left(\mathbf {x} _ {i} ^ {(\ell)}\right)}{\sigma \left(\mathbf {x} _ {i} ^ {(\ell)}\right)} + \mathbf {y} _ {b, i} ^ {(\ell)}, \tag {1} +$$ + +where $\mathbf{x}_i^{(\ell)}$ indicates the $i$ -th channel of the output feature map from the $\ell$ -th layer. $\mu (\cdot)$ and $\sigma (\cdot)$ denote the mean and variance respectively. + +![](images/37726374705c9852e602a52c6425b44e9e7e2928fa75f08848a9a91f93673d50.jpg) +Figure 1. Framework of the proposed encoder, which is able to extract Generative Hierarchical Features (GH-Feat) from input image. This feature hierarchy highly aligns with the layer-wise representation (i.e., style codes of per-layer AdaIN) learned by the StyleGAN generator. Parameters in blue blocks are trainable. + +![](images/1a775ae422a058334a7d386c08cbbb48e3af4d85092bdf7a12ef79be3e50928f.jpg) + +Here, we treat the layer-wise style codes, $\{\mathbf{y}^{(\ell)}\}_{\ell = 1}^{L}$ , as the generative visual features that we would like to extract from the input image. There are two major advantages. First, the synthesized image can be completely determined by these style codes without any other variations, making them suitable to express the information contained in the input data from the generative perspective. Second, these style codes are organized as a hierarchy where codes at different layers correspond to semantics at different levels [31, 55]. To the best of our knowledge, this is the first work that adopts the style codes for the per-layer AdaIN module as the learned representations of StyleGAN. + +# 3.2. Hierarchical Encoder + +Based on the layer-wise representation described in Sec. 3.1, we propose a novel encoder $E(\cdot)$ with a hierarchical structure to extract multi-level visual features from a given image. As shown in Fig. 1, the encoder is designed to best align with the StyleGAN generator. In particular, the Generative Hierarchical Features (GH-Feat) produced by the encoder, $\{\mathbf{f}^{(\ell)}\}_{\ell = 1}^{L} \triangleq \{(\mathbf{f}_s^{(\ell)},\mathbf{f}_b^{(\ell)})\}_{\ell = 1}^L$ , are fed into the per-layer AdaIN module of the generator by replacing the style code $\mathbf{y}^{(L - \ell +1)}$ in Eq. (1). + +We adopt ResNet [20] architecture as the encoder backbone and add an extra residual block to get an additional feature map with lower resolution. Besides, we introduce a feature pyramid network [36] to learn the features from multiple levels. The output feature maps from the last three stages, $\{R_4, R_5, R_6\}$ , are used to produce GH-Feat. Taking a 14-layer StyleGAN generator as an instance, $R_4$ aligns with layer 9-14, $R_5$ with 5-8, while $R_6$ with 1-4. Here, to bridge the feature map with each style code, we first downsample it to $4 \times 4$ resolution and then map it to a vector of the target dimension using a fully-connect (FC) layer. In addition, we introduce a lightweight Spatial Alignment Module (SAM) [56, 38] into the encoder structure to better capture the spatial information from the input image. SAM + +works in a simple yet efficient way: + +$$ +R _ {i} = W _ {i} \operatorname {d o w n} \left(R _ {i}\right) + W _ {6} R _ {6} \quad i \in \{4, 5 \}, +$$ + +where $W_{4}, W_{5}$ , and $W_{6}$ (all are implemented with an $1 \times 1$ convolutional layer) are used to project the feature maps $R_{4}$ , $R_{5}$ , and $R_{6}$ to have the same number of feature channels respectively. $R_{4}$ and $R_{5}$ are downsampled to the same resolution of $R_{6}$ before fusion. The detailed structure of the encoder can be found in Supplementary Material. + +# 3.3. StyleGAN Generator as Learned Loss + +We consider the pre-trained StyleGAN generator as a leaned loss function. Specifically, we employ a StyleGAN generator to supervise the encoder training with the objective of image reconstruction. We also introduce a discriminator to compete with the encoder, following the formulation of GANs [17], to ensure the reconstruction quality. To summarize, the encoder $E(\cdot)$ and the discriminator $D(\cdot)$ are jointly trained with + +$$ +\begin{array}{l} \min _ {\Theta_ {E}} \mathcal {L} _ {E} = | | \mathbf {x} - G (E (\mathbf {x})) | | _ {2} - \lambda_ {1} \mathbb {E} _ {\mathbf {x}} [ D (G (E (\mathbf {x}))) ] \tag {2} \\ + \lambda_ {2} | | F (\mathbf {x}) - F (G (E (\mathbf {x}))) | | _ {2}, \\ \end{array} +$$ + +$$ +\begin{array}{l} \min _ {\Theta_ {D}} \mathcal {L} _ {D} = \mathbb {E} _ {\mathbf {x}} [ D (G (E (\mathbf {x}))) ] - \mathbb {E} _ {\mathbf {x}} [ D (\mathbf {x}) ] \tag {3} \\ + \lambda_ {3} \mathbb {E} _ {\mathbf {x}} [ | | \nabla_ {\mathbf {x}} D (\mathbf {x}) | | _ {2} ^ {2} ], \\ \end{array} +$$ + +where $||\cdot ||_2$ denotes the $\ell_2$ norm and $\lambda_1,\lambda_2,\lambda_3$ are loss weights to balance different loss terms. The last term in Eq. (2) represents the perceptual loss [29] and $F(\cdot)$ denotes the conv4_3 output from a pre-trained VGG [49] model. + +# 4. Experiments + +We evaluate Generative Hierarchical Features (GH-Feat) on a wide range of downstream applications. Sec. 4.1 introduces the experimental settings, such as implementation details, datasets, and tasks. Sec. 4.2 conducts ablation study on the proposed hierarchical encoder. Sec. 4.3 and Sec. 4.4 evaluate the applicability of GH-Feat on generative and discriminative tasks respectively. + +# 4.1. Experimental Settings + +Implementation Details. The loss weights are set as $\lambda_1 = 0.1$ , $\lambda_2 = 5e^{-5}$ , and $\lambda_3 = 5$ . We use Adam [32] optimizer, with $\beta_1 = 0$ and $\beta_2 = 0.99$ , to train both the encoder and the discriminator. The learning rate is initially set as $1e^{-4}$ and exponentially decayed with the factor of 0.8. + +Datasets and Models. We conduct experiments on four StyleGAN [31] models, pre-trained on MNIST [35], FF-HQ [31], LSUN bedrooms [58], and ImageNet [8] respectively. The MNIST model is with $32 \times 32$ resolution and the remaining models are with $256 \times 256$ resolution. + +Tasks and Metrics. Unlike existing adversarial feature learning methods [15, 12, 44, 13] that are mainly evaluated on the high-level image classification task, we benchmark GH-Feat on a range of both generative and discriminative tasks from multiple levels, including (1) Image editing. It focuses on manipulating the image content or style, e.g., style mixing, global editing, and local editing. (2) Image harmonization. This task harmonizes a discontinuous image to produce a realistic output. (3) MNIST digit recognition. It is a long-standing image classification task. We report the Top-1 accuracy on the test set following [35]. (4) Face verification. It aims at distinguishing whether the given pair of faces come from the same identity. We validates on the LFW dataset [25] following the standard protocol [25]. (5) ImageNet classification. This is a large-scale image classification dataset [8], consisting of over $1M$ training samples across 1,000 classes and $50K$ validation samples. We use Top-1 accuracy as the evaluation metric following existing work [12, 13]. (6) Pose estimation. This task targets at estimating the yaw pose of the input face. $70K$ real faces on FF-HQ [31] are split to $60K$ training samples and $10K$ test samples. The $\ell_1$ regression error is used as the evaluation metric. (7) Landmark detection. This task learns a set of semantic points with visual meaning. We use FF-HQ [31] dataset and follow the standard MSE metric [63] to report performances in inter-ocular distance (IOD). (8) Layout prediction. We extract the corner points of the layout line and convert the task to a landmark regression task. The annotations of the collected $90K$ bedroom images ( $70K$ for training and $20K$ for validation) are obtained with [62]. Following [69], we report the corner distance as the metric. (9) Face luminance regression. It focuses on regressing the luminance of face images. We use it as a low-level task on the FF-HQ [31] dataset. + +# 4.2. Ablation Study + +We make ablation studies on the training of encoder from two perspectives. (1) We choose the layer-wise style codes $\mathbf{y}$ over the $\mathbf{w}$ codes as the representation from StyleGAN. (2) We introduce Spatial Alignment Module (SAM) into the encoder to better handle the spatial information. + +Table 1. Quantitative results on ablation study. + +
SpaceSAMMSE↓SSIM↑FID↓
W✓0.06010.54022.24
Y0.05020.55019.06
Y✓0.04640.55818.48
+ +Table 2. Quantitative comparison with ALAE [44] on reconstructing images from FF-HQ faces [31] and LSUN bedrooms [58]. + +
MethodFaceBedroom
MSE↓SSIM↑FID↓MSE↓SSIM↑FID↓
ALAE [44]0.1820.39824.860.2750.31521.01
GH-Feat (Ours)0.0460.55818.420.0680.50716.01
+ +![](images/5694d5037ff19b223da2f625f820ce3c54885d0e3d72dd3f06e8ad7a6870495e.jpg) + +![](images/48dde8de2b1ebcfb7146853307ee2c366835832e3818fa7928b9dc6518dbeebd.jpg) + +![](images/5b32ecac5029e4c23551d70f06ff97ac735ee20caf9ed93965ae025291d3b5e4.jpg) + +![](images/5d99c34e3d5fcd353a481a777937b6561d728c2ad0620291b2f95070d8f7deec.jpg) +Figure 2. Qualitative comparison on reconstructing real images. From left to right: Inputs, ALAE [44], and our GH-Feat. + +![](images/cc0f15ffbd5b53a59756788027295e2d6446225248bd341daae29039dc9c7f80.jpg) + +![](images/ed6e60ad5e9413bed847f02d53b7c4d365581b655710aba6d02b7556f723ded7.jpg) + +Since the encoder is trained with the objective of image reconstruction, we use mean square error (MSE), SSIM [52], and FID [22] to evaluate the encoder performance. Tab. 1 shows the results where we can tell that our encoder benefits from the effective SAM module and that choosing an adequate representation space (i.e., the comparison between the first row and the last row) results in a better reconstruction. More discussion on the differences between $\mathcal{W}$ space and $\mathcal{V}$ space can be found in Sec. 4.4.1. + +# 4.3. Evaluation on Generative Tasks + +Thanks to using the StyleGAN as a learned loss function, a huge advantage of GH-Feat over existing unsupervised feature learning approaches [24, 68, 42, 51, 19], which mainly focus on the image classification task, is its generative capability. In this section, we conduct a number of generative experiments to verify this point. + +# 4.3.1 Image Reconstruction + +Image reconstruction is an important evaluation on whether the learned features can best represent the input image. The very recent work ALAE [44] also employs StyleGAN for representation learning. We have following differences from ALAE: (1) We use the $\mathcal{V}$ space instead of the $\mathcal{W}$ + +![](images/bafae2d8b89c39d5c2c865039ada2d6c871bde242df67a7842f6634432522399.jpg) +Figure 3. Style mixing results by exchanging the GH-Feat extracted from the content image and the style image (first row) at different levels. Higher level corresponds to more abstract feature. + +![](images/a8d3510bf15aa47738a76b4b906f19c110681c545703f3d62ebcd5f32dd8a7c0.jpg) +Figure 4. Global image editing achieved by GH-Feat. On the left is the input image, while the others are generated by randomly sampling the visual feature at some particular level. + +space of StyleGAN as the representation space. (2) We learn hierarchical features that highly align with the perlayer style codes in StyleGAN. (3) Our encoder can be efficiently trained with a well-learned generator by treating StyleGAN as a loss function. Tab. 2 and Fig. 2 show the quantitative and qualitative comparison between GH-Feat and ALAE [44] on FF-HQ faces [31] and LSUN bedrooms [58]. We can tell that GH-Feat better reconstructs the input by preserving more information, resulting a more expressiveness representation. + +# 4.3.2 Image Editing + +In this part, we evaluate GH-Feat on a number of image editing tasks. Different from the features learned from discriminative tasks [20, 19], our GH-Feat naturally supports sampling and enables creating new data. + +Style Mixing. To achieve style mixing, we use the encoder to extract visual features from both the content image and the style image and swap these two features at some particular level. The swapped features are then visualized by the generator, as shown in Fig. 3. We can observe the compelling hierarchical property of the learned GH-Feat. For example, by exchanging low-level features, only the image color tone and the skin color are changed. Meanwhile, mid-level features controls the expression, age, or even hair styles. Finally, high-level features correspond to the face shape and pose information (last two columns). + +Global Editing. The style mixing results have suggested the potential of GH-Feat in multi-level image stylization. Sometimes, however, we may not have a target style image to use as the reference. Thanks to the design of the latent space in GANs [17], the generative representation naturally + +supports sampling, resulting in a strong creativity. In other words, based on GH-Feat, we can arbitrarily sample meaningful visual features and use them for image editing. Fig. 4 presents some high-fidelity editing results at multiple levels. This benefits from the matching between the learned GH-Feat and the internal representation of StyleGAN. + +Local Editing. Besides global editing, our GH-Feat also facilitates editing the target image locally by deeply cooperating with the generator. In particular, instead of directly swapping features, we can exchange a certain region of the spatial feature map at some certain level. In this way, only a local patch in the output image will be modified while other parts remain untouched. As shown in Fig. 5, we can successfully manipulate the input face with different eyes, noses, and mouths. + +# 4.3.3 Image Harmonization + +Our hierarchical encoder is robust such that it can extract reasonable visual features even from discontinuous image content. We copy some patches (e.g., bed and window) onto a bedroom image and feed the stitched image into our proposed encoder for feature extraction. The extracted features are then visualized via the generator, as in Fig. 6. We can see that the copied patches well blend into the "background". We also surprisingly find that when copying a window into the source image, the view from the original window and that from the new window highly align with each other (e.g., vegetation or ocean), benefiting from the robust generative visual features. + +# 4.4. Evaluation on Discriminative Tasks + +In this part, we verify that even the proposed GH-Feat is learned from generative models, it can be applicable + +![](images/661113d6e5c33379626d16a2533092d3d73a67f16a64480c40823156ebb91872.jpg) +Input + +![](images/17881a12abe2ade4d227a868f36f028b1c12fafe81b4cd7131bc2bfb653ba660.jpg) +Figure 5. Local image editing achieved by GH-Feat. On the left is the input image, while the others are generated by randomly sampling the visual feature and replacing the spatial feature map (for different regions) at some particular level. Zoom in for details. + +![](images/3f6f933077d6dee304c9f41b1dbb866ab38f9869c3f3a00c9988a3baba88bf23.jpg) +Eyes + +![](images/c0f0c378fc3fe89d71087aabf1a6e6be257d44e6bc27082ad8e78d2b05c76d75.jpg) + +![](images/e36e146022498c5554dc7511a28990388db719912e5dc874a40df6ae031f734f.jpg) +Nose + +![](images/a0eb186403452b7196d06dd1b69d15893e400cbe149805fcdcdf4619cafa779d.jpg) + +![](images/780dbb61ab6fc96c3d597167a7a7fe585ccae3b1c03fcfafe655c4e252d41ae4.jpg) +Mouth + +![](images/21f8062aa96a98bebd5aca3e08e8fb7a9a15f497d5276a184bc054d9863e7502.jpg) + +![](images/1b8156de8370709d63c6362329a735c15925c97ca34ebd839fdcfcf573f5f834.jpg) + +![](images/5ac15c4ec9c0baa2234dc505b4d9ee27398957d531f8168f1d07bb3b1842962a.jpg) + +![](images/e81ca7fd8cc2fb1015bfee6d68036d74a9e3f544a02751775d3f2382ba2d958a.jpg) + +![](images/62cbd5fdf2c616f7997a3abd904b82744c9c9f4ebca146c4949a55fa20f6c90c.jpg) + +![](images/6ac57ecf6b029c2077f985d5fb26b06c485c927aea75e8c9c056936f325b671f.jpg) + +![](images/88dae244652a09fe5b67332cb94197748b73e5186154b142ceace3e672d62b3c.jpg) + +![](images/63a3e6b3836c03a1003f7fc0a8eaba58698760391b091b721eb9474c2e5d7071.jpg) + +![](images/d509ea78b14020ac97c0c6bf987ebbeda981eeb450e769c0cd713e31ddd7e31d.jpg) + +![](images/6393af93c44749e4ce7b5105c464b7d89f9d74c6a080e79ec8b6fff8a370393f.jpg) +Figure 6. Image harmonization with GH-Feat. On the top left corner is the original image. Pasting a target image patch onto the original image then feeding it as the input (top row), our hierarchical encoder is able to smooth the image content and produce a photo-realistic image (bottom row). + +![](images/219ee5562e1bbc50379a4803caf4ec22e4469dca0c02cfddb74e9e7bbf5985be.jpg) +Bed + +![](images/e7907fea382914d61d2eecb9d81ba330666aa8f9a291162a3da2b27240005f1f.jpg) + +![](images/81197592372ea4e78cc451d6c04eca99989f61635ab5e6858fd95f94c273e159.jpg) +Window + +![](images/6b1a718b75d885583e78c51ac9c5133a569b12d46171a85f1c32e78f1183253a.jpg) + +![](images/e3f46300e083d3624bf2387e6a395b17da3ca6ff4fcbb993a11555eea84cc572.jpg) +Ceiling Light + +![](images/f124236860ee7dc95e75a39c0f7088ef0ae5b65d251c97ac503ce6b1badb2cfa.jpg) + +![](images/530cc35abc6094c9d5bdc4a577747a8e3faefba4cfcf0b886c1eebb3f7aea0eb.jpg) +Figure 7. Performance on different discriminative tasks using GH-Feat. Left three columns enclose the comparisons between using different spaces of StyleGAN as the representation space, where $\mathcal{V}$ space (in red color) shows stronger discriminative and hierarchical property than $\mathcal{W}$ space (in blue color). This is discussed in Sec. 4.4.1. The last column compares the two different strategies used in the face verification task, which is explained in Sec. 4.4.2. Higher level corresponds to more abstract feature. + +![](images/07614ba314eab76ea9e40d04d8a5c2d26996234336d14abc7e4e697e6385d905.jpg) + +![](images/f0a56aac308fc833fbe3c9eca2f6c8a6f6bf3ce9d169e76d613cb51a65f341ed.jpg) + +![](images/dd2185d95abbb0a2e4de0d3273dbf2fcf193635373c2c50be5315042785b6e88.jpg) + +to a wide range of discriminative tasks with competitive performances. Here, we do not fine-tune the encoder for any certain task. In particular, we choose multi-level downstream applications, including image classification, face verification, pose estimation, layout prediction, landmark detection, and luminance regression. For each task, we use our encoder to extract visual features from both the training and the test set. A linear regression model (i.e., a fully-connected layer) is learned on the training set with ground-truth and then evaluated on the test set. + +# 4.4.1 Discriminative and Hierarchical Property + +Recall that GH-Feat is a multi-scale representation learned by using StyleGAN as a loss function. As a results, it consists of features from multiple levels, each of which correspond to a certain layer in the StyleGAN generator. + +Here, we would to explore how this feature hierarchy is organized as well as how they can facilitate multi-level discriminative tasks, including face pose estimation, indoor scene layout prediction, and luminance3 regression from face images. In particular, we evaluate GH-Feat on each task level by level. As a comparison, we also train encoders by treating the w code, instead of the style code y, as the representation. From Fig. 7, we have three observations: (1) GH-Feat is discriminative. (2) Features at lower level are more suitable for low-level tasks (e.g., luminance regression) and those at higher level better aid high-level tasks (e.g., pose estimation). (3) $\mathcal{V}$ space demonstrates a more obvious hierarchical property than $\mathcal{W}$ space. + +![](images/b173b837c04f847493add0102a3cebd0555d6da4313b889f9337bb2ed6756d38.jpg) +Figure 8. Image reconstruction results on LFW [25]. For each pair of images, left is the low-resolution input while right is reconstructed by GH-Feat. All samples are with the same identity. + +![](images/e4ec978ea04e942c5c336e14a7e234eb2b83cfdc95305fd9e0654ba835ff289d.jpg) + +![](images/7fb8625de8ba03ddf4efe2627bc988bf1f237decbc8867d65798cd4d12556d01.jpg) + +![](images/fcea9fd25723feb6a42b58912851f1d8721ea2fff3a8580ae798f1f6022a8616.jpg) + +![](images/f12dbbed5412e4de016b338f38619efa08ba202d2e5efb3e0abde19d6da0f1f1.jpg) + +![](images/3a8a13268edf4e82acdc56eb7f2b72e21bcf22ec9a9518fc04c84e00ca7ab430.jpg) + +![](images/8db72aeebc71b91f103f422a588cd1513c8f4f83bcc171cafd00107141fffe42.jpg) + +![](images/89279a2fc6cf6e77deb952bea1a4cb2f43e66989095dd7b7538cb61f38d01918.jpg) + +# 4.4.2 Digit Recognition & Face Verification + +Image classification is widely used to evaluate the performance of learned representations [24, 68, 19, 42, 13]. In this section, we first compare our proposed GH-Feat with other alternatives on a toy dataset, i.e., MNIST [35]. Then, we use a more challenging task, i.e., face verification, to evaluate the discriminative property of GH-Feat. + +MNIST Digit Recognition. We first show a toy example on MNIST following prior work [12, 44]. We make a little modification to ResNet-18 like [37] which is widely used in literatures to handle samples from MNIST [35] in lower resolution. The Top-1 accuracy is reported in Tab. 3 (a). Our GH-feat outperforms ALAE [44] and BiGAN [12] with $1.45\%$ and $1.92\%$ , suggesting a stronger discriminative power. Here, ResNet-18 [20] is employed as the backbone structure for both MoCo [19] and GH-Feat. + +LFW Face Verification. We directly use the proposed encoder, which is trained on FF-HQ [31], to extract GH-Feat from face images in LFW [25] and tries three different strategies on exploiting GH-Feat for face verification: (1) using a single level feature; (2) grouping multi-level features (starting from the highest level) together; (3) voting by choosing the largest face similarity across all levels. Fig. 7 (last column) shows the results from the first two strategies. Obviously, GH-Feat from the 5-th to the 9-th levels best preserve the identity information. Tab. 3 (b) compares GH-Feat with other unsupervised feature learning methods, including VAE [33], MoCo [19], and ALAE [44]. All these competitors are also trained on FF-HQ dataset [31] with optimally chosen hyper-parameters. ResNet-50 [20] is employed as the backbone for MoCo and GH-Feat. Our method with voting strategy achieves $69.7\%$ accuracy, surpassing other competitors by a large margin. We also visualize some reconstructed LFW faces in Fig. 8, where our GH-Feat well handles the domain gap (e.g., image resolution) and preserves the identity information. + +# 4.4.3 Large-Scale Image Classification + +We further evaluate GH-Feat on the high-level image classification task using ImageNet [8]. Before the training of encoder, we first train a StyleGAN model, with $256 \times 256$ resolution, on the ImageNet training collection. After that, we learn the hierarchical encoder by using the pre-trained generator as the supervision. No labels are involved in the + +Table 3. Quantitative comparison between our proposed GH-Feat and other alternatives on MNIST [35] and LFW [25]. +(a) Digit recognition on MNIST. + +
MethodsAcc.
AE(ℓ1) [23]97.43
AE(ℓ2) [23]97.37
BiGAN [12]97.14
ALAE [44]97.61
MoCo-R18 [19]95.89
GH-Feat (Ours)99.06
+ +(b) Face verification on LFW. + +
MethodsAcc.
VAE [33]49.3
MoCo-R50 [19]48.9
ALAE [44]55.7
GH-Feat (Grouping)60.1
GH-Feat (Layer-wise)67.5
GH-Feat (Voting)69.7
+ +Table 4. Quantitative comparison on the ImageNet [8] classification task. + +
MethodArchitectureTop-1 Acc.
Motion Seg (MS) [43, 11]ResNet-10127.6
Exemplar (Ex) [14, 11]ResNet-10131.5
Relative Po (RP) [9, 11]ResNet-10136.2
Colorization (Col) [60, 11]ResNet-10139.6
Contrastive Learning
InstDisc [54]ResNet-5042.5
CPC [42]ResNet-10148.7
MoCo [19]ResNet-5060.6
Generative Modeling
BiGAN [12]AlexNet31.0
SS-GAN [6]ResNet-1938.3
BigBiGAN [13]ResNet-5055.4
GH-Feat (Ours)ResNet-5051.1
+ +above training process. $^{4}$ For the image classification problem, we train a linear model on top of the features extracted from the training set with the softmax loss. Then, this linear model is evaluated on the validation set. $^{5}$ Tab. 4 shows the comparison between GH-Feat and other unsupervised representation learning approaches [54, 42, 19, 12, 6, 13], where we beat most of the competitors. The state-of-the-art MoCo [19] gives the most compelling performance. But different from the representations learned with contrastive learning, GH-Feat has huge advantages in generative tasks, as already discussed in Sec. 4.3. Among adversarial representation learning approaches, BigBiGAN [13] achieves + +![](images/1457f425388b19fc6f1da07724f6686f2cac7b794672ffbd111d433c35f05ee3.jpg) +Figure 9. Landmark detection results. GH-Feat is trained on FF-HQ [31] dataset but can successfully handle the hard cases (large pose and low image quality) in MAFL dataset [63], a subset of CelebA [39]. + +![](images/f052e1867671cef77727221719915ebefd1fc4e60d4ccc11f6ab7dabf2c6b882.jpg) +FF-HQ + +![](images/c4bbb89463a6b6672b9036a4360cebc0c64964167c610071b46572eae643635c.jpg) + +![](images/11b76364a6b2165d08351df47f8e6c5dad6dd38a5f49f6cf5dfc928e7aa7db31.jpg) + +![](images/bd90ace8400e720af3d6477e61799d39a401303e94c41fce6b903e4214c42744.jpg) + +![](images/4cfe02671608447cbe2004ff35ec9182caff82c9c4d311fd349da5c413bf5194.jpg) +CelebA + +![](images/f23934ad1598c20bcb69b20868013f46a38667eab441e85d71528633b4f1fbca.jpg) + +![](images/d9d986e654c193fce0099d103d1ae172af853b419e157dc94d3c7bf2bc705d13.jpg) + +![](images/04a487dccd28bbb745469b4efafab3ef60e5a79800a7635bd818497c3b83b9fb.jpg) + +![](images/fd018851b14cd88de024d7bb417724e3054171af377e944ad7007cdc1b8db83e.jpg) +Figure 10. Layout prediction results using feature learned by MoCo [19] (top row) and our GH-Feat (bottom row). Both methods are trained on LSUN bedrooms [58] and then transferred to LSUN kitchens. + +![](images/fd4aea8d8b584461235d7f3cd9c968b91aae251c9646893afa3efe817a894267.jpg) + +![](images/4a3cee648dc40da98600dd55a18dab81c0f67755da29c0effb7e378d6e63631d.jpg) +Bedroom + +![](images/e502d60cb2134e5699a999a0318c650a151fd985e471526ca6d5af6228661d1e.jpg) + +![](images/0398625901b024c22129d939009dc9b3db55187bdaaae22c92175d4754d33337.jpg) + +![](images/7786a5e39dcbab643be02f3a3fc08baa5f58d1ae5c5e0493dca303d2879c2d85.jpg) + +![](images/3143129e63f9c44040c62a63f6d867a76c92a3a6c6df45a36ea7a502dc28b716.jpg) + +![](images/351560e8de93926b1bcc19761820c94a007e5bff46530daf88ab8d0dca83c257.jpg) + +![](images/5131a4ca34d6803899f0fade48550681ccadef70d896c0196a10d2f5d541053c.jpg) + +![](images/d5e6551e773683b0729a7c8fac4fd78b4e422e389be0854a5326c090b7aa7788.jpg) + +![](images/2632053ccbd21647479cf4decab218f60349f54784b0fdc830c9b3c5c43c24b8.jpg) +Kitchen + +![](images/d55425d3c91c1a2998608559049146cac21b984ce2e03e4f00447f4f10110417.jpg) + +![](images/c2ae8f0144accdab907ebdf3e72e8555a4da1ac394ce873b02f9065eae3fedc6.jpg) + +![](images/24200682b13b53d7b64db423b60b223a62d5e995e41b0a0e3670a0bcfded5f84.jpg) + +![](images/4e436eebd63bef319066224071ac6b5c94136fa0e064acb2e0744a2a8c0f9d51.jpg) + +the best performance, benefiting from the incredible large-scale training. However, GH-Feat presents a stronger generative ability, suggested by the comparison results on image reconstruction shown in Tab. 5. More discussion can be found in Supplementary Material. + +# 4.4.4 Transfer Learning + +In this part, we explore how GH-Feat can be transferred from one dataset to another. + +Landmark Detection. We train a linear regression model using GH-Feat on FF-HQ [31] and test it on MAFL [63], which is a subset of CelebA [39]. This two datasets have a large domain gap, e.g., faces in MAFL have larger poses yet lower image quality. As shown in Fig. 9, GH-Feat shows a strong transferability across these two datasets. We compare our approach with some supervised and unsupervised alternatives [63, 59, 28, 19]. For a fair comparison, we try the multi-scale representations from MoCo [19] (i.e., Res2, Res3, Res4, and Res5 feature maps) and report the best results. Tab. 6 demonstrates the strong generalization ability of GH-Feat. In particular, it achieves on-par or better performance than the methods that are particular designed for this task [63, 59, 28]. Also, it outperforms MoCo [19] on this mid-level discriminative task. + +Layout Prediction. We train the layout predictor on LSUN [58] bedrooms and test it on kitchens to validate how GH-Feat can be transferred from one scene category to another. Feature learned by MoCo [19] on the bedroom dataset is used for comparison. We can tell from Fig. 10 that GH-Feat shows better predictions than MoCo, especially on the target set (i.e., kitchens), suggesting a + +Table 5. Qualitative comparison between BigBiGAN [13] and GH-Feat on reconstructing images from ImageNet [8]. + +
MSE↓SSIM↑FID↓
BigBiGAN [13]0.3630.23633.42
GH-Feat (Ours)0.0780.43122.70
+ +Table 6. Landmark detection results on MAFL [63]. + +
MethodSupervisionMSE↓
TCDCN [63]✓7.95
MTCNN [59]✓5.39
Cond. ImGen [28]4.95
ALAE [44].10.13
MoCo-R50 [19]9.07
GH-Feat (Ours)5.12
+ +stronger transferability. Like landmark detection, we also conduct experiments with the 4-level representations from MoCo [19] and select the best. + +# 5. Conclusion + +In this work, we consider the well-trained GAN generator as a learned loss function for learning multi-scale features. The resulting Generative Hierarchical Features are shown to be generalizable to a wide range of vision tasks. + +Acknowledgements: This work is supported in part by the Early Career Scheme (ECS) through the Research Grants Council (RGC) of Hong Kong under Grant No.24206219, CUHK FoE RSFS Grant, SenseTime Collaborative Grant, and Centre for Perceptual and Interactive Intelligence (CPII) Ltd under the Innovation and Technology Fund. + +# References + +[1] David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 1 +[2] David Bau, Jun-Yan Zhu, Hendrik Strobelt, Bolei Zhou, Joshua B. Tenenbaum, William T. Freeman, and Antonio Torralba. Gan dissection: Visualizing and understanding generative adversarial networks. In Int. Conf. Learn. Represent., 2019. 2 +[3] Herbert Bay, Tinne Tuytelaars, and Luc Van Gool. Surf: Speeded up robust features. In Eur. Conf. Comput. Vis., 2006. 2 +[4] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Trans. Pattern Anal. Mach. Intell., 2013. 1 +[5] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In Int. Conf. Learn. Represent., 2019. 2 +[6] Ting Chen, Xiaohua Zhai, Marvin Ritter, Mario Lucic, and Neil Houlsby. Self-supervised gans via auxiliary rotation loss. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 7 +[7] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2005. 2 +[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conf. Comput. Vis. Pattern Recog., 2009. 1, 4, 7, 8 +[9] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Int. Conf. Comput. Vis., 2015. 7 +[10] Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In Int. Conf. Comput. Vis., 2017. 2 +[11] Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In Int. Conf. Comput. Vis., 2017. +[12] Jeff Donahue, Philipp Krahenbuhl, and Trevor Darrell. Adversarial feature learning. In Int. Conf. Learn. Represent., 2017. 1, 2, 4, 7 +[13] Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning. In Adv. Neural Inform. Process. Syst., 2019. 1, 2, 4, 7, 8 +[14] Alexey Dosovitskiy, Jost Tobias Springenberg, Martin Ried-miller, and Thomas Brox. Discriminative unsupervised feature learning with convolutional neural networks. In Adv. Neural Inform. Process. Syst., 2014. 7 +[15] Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarily learned inference. In Int. Conf. Learn. Represent., 2017. 1, 2, 4 +[16] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In Int. Conf. Learn. Represent., 2018. 2 +[17] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and + +Yoshua Bengio. Generative adversarial nets. In Adv. Neural Inform. Process. Syst., 2014. 1, 2, 3, 5 +[18] Jinjin Gu, Yujun Shen, and Bolei Zhou. Image processing using multi-code gan prior. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 2 +[19] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 2, 4, 5, 7, 8 +[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. 2, 3, 5, 7 +[21] Olivier J Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, SM Eslami, and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019. 2 +[22] 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 Adv. Neural Inform. Process. Syst., 2017. 4 +[23] Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 2006. 7 +[24] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In Int. Conf. Learn. Represent., 2019. 2, 4, 7 +[25] 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, Technical Report 07-49, University of Massachusetts, Amherst, 2007. 4, 7 +[26] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Int. Conf. Comput. Vis., 2017. 2 +[27] Ali Jahanian, Lucy Chai, and Phillip Isola. On the "steerability" of generative adversarial networks. In Int. Conf. Learn. Represent., 2020. 2 +[28] Tomas Jakab, Ankush Gupta, Hakan Bilen, and Andrea Vedaldi. Unsupervised learning of object landmarks through conditional image generation. In Adv. Neural Inform. Process. Syst., 2018. 8 +[29] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In Eur. Conf. Comput. Vis., 2016. 3 +[30] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In Int. Conf. Learn. Represent., 2018. 2 +[31] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 1, 2, 3, 4, 5, 7, 8 +[32] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Int. Conf. Learn. Represent., 2015. 4 + +[33] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Int. Conf. Learn. Represent., 2014. 7 +[34] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Adv. Neural Inform. Process. Syst., 2012. 2 +[35] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998. 4, 7 +[36] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 3 +[37] Kuang Liu. Pyotrch cifar10. https://github.com/kuangliu/pytorch-cifar.git, 2019.7 +[38] Shu Liu, Lu Qi, Haifang Qin, Jianping Shi, and Jiaya Jia. Path aggregation network for instance segmentation. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 3 +[39] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Int. Conf. Comput. Vis., 2015. 8 +[40] David G Lowe. Distinctive image features from scale-invariant keypoints. Int. J. Comput. Vis., 2004. 2 +[41] DZ Matthew and R Fergus. Visualizing and understanding convolutional neural networks. In IEEE Conf. Comput. Vis. Pattern Recog., 2014. 1 +[42] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 2, 4, 7 +[43] Deepak Pathak, Ross Girshick, Piotr Dollar, Trevor Darrell, and Bharath Hariharan. Learning features by watching objects move. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 7 +[44] Stanislav Pidhorskyi, Donald Adjeroh, and Gianfranco Doretto. Adversarial latent autoencoders. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 2, 4, 5, 7, 8 +[45] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In Int. Conf. Learn. Represent., 2016. 2 +[46] Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features off-the-shelf: an astounding baseline for recognition. In IEEE Conf. Comput. Vis. Pattern Recog. Worksh., 2014. 1 +[47] Yujun Shen, Ceyuan Yang, Xiaou Tang, and Bolei Zhou. Interfacegan: Interpreting the disentangled face representation learned by gans. IEEE Trans. Pattern Anal. Mach. Intell., 2020. 1, 2 +[48] Assaf Shocher, Yossi Gandelsman, Inbar Mosseri, Michal Yarom, Michal Irani, William T Freeman, and Tali Dekel. Semantic pyramid for image generation. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 2 +[49] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Int. Conf. Learn. Represent., 2015. 2, 3 +[50] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with + +convolutions. In IEEE Conf. Comput. Vis. Pattern Recog., 2015. 7 +[51] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019. 2, 4 +[52] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process., 2004. 4 +[53] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 2 +[54] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 7 +[55] Ceyuan Yang, Yujun Shen, and Bolei Zhou. Semantic hierarchy emerges in deep generative representations for scene synthesis. Int. J. Comput. Vis., 2020. 1, 2, 3 +[56] Ceyuan Yang, Yinghao Xu, Jianping Shi, Bo Dai, and Bolei Zhou. Temporal pyramid network for action recognition. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 3 +[57] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Adv. Neural Inform. Process. Syst., 2014. 1, 2 +[58] Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 4, 5, 8 +[59] Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 2016. 8 +[60] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In Eur. Conf. Comput. Vis., 2016. 7 +[61] Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 2 +[62] Weidong Zhang, Wei Zhang, and Jason Gu. Edge-semantic learning strategy for layout estimation in indoor environment. Transactions On Cybernetics, 2019. 4 +[63] Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaou Tang. Facial landmark detection by deep multi-task learning. In Eur. Conf. Comput. Vis., 2014. 4, 8 +[64] Nanxuan Zhao, Zhirong Wu, Rynson WH Lau, and Stephen Lin. What makes instance discrimination good for transfer learning? arXiv preprint arXiv:2006.06606, 2020. 1, 2 +[65] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in deep scene cnns. In Int. Conf. Learn. Represent., 2015. 1 +[66] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Trans. Pattern Anal. Mach. Intell., 2017. 1 +[67] Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. Indomain gan inversion for real image editing. In Eur. Conf. Comput. Vis., 2020. 2 + +[68] Chengxu Zhuang, Alex Lin Zhai, and Daniel Yamins. Local aggregation for unsupervised learning of visual embeddings. In Int. Conf. Comput. Vis., 2019. 2, 4, 7 +[69] Chuhang Zou, Alex Colburn, Qi Shan, and Derek Hoiem. Layoutnet: Reconstructing the 3d room layout from a single rgb image. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 4 \ No newline at end of file diff --git a/generativehierarchicalfeaturesfromsynthesizingimages/images.zip b/generativehierarchicalfeaturesfromsynthesizingimages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c15c335c48d8759489070eddbc2aee90808f1d48 --- /dev/null +++ b/generativehierarchicalfeaturesfromsynthesizingimages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93a4b481909234eeb2b3f4edff74e156ba3b783a5d98a6ab450ef50466280a83 +size 758599 diff --git a/generativehierarchicalfeaturesfromsynthesizingimages/layout.json b/generativehierarchicalfeaturesfromsynthesizingimages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5d473136238bf56272a107c8e2c4ca1da1658e98 --- /dev/null +++ b/generativehierarchicalfeaturesfromsynthesizingimages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61f6fa3e23eac4b51992211a09abeba88ecdfe5c5d670387615bbf3d4cb6075e +size 506908 diff --git a/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_content_list.json b/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a980a8c5fff40dce3df3f8b831c262591554f7bb --- /dev/null +++ b/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d3af70296819e61d39ba3950655d448c8b229127e81c31ec8da6d46d8b992e0 +size 91521 diff --git a/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_model.json b/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_model.json new file mode 100644 index 0000000000000000000000000000000000000000..604ed763a10a77819f688273b8d2e6ad7b34fc95 --- /dev/null +++ b/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9244670406e46781c88ccdd17ed0d20e1d66384c7197fe5b4ba12b1a59d6fd43 +size 110788 diff --git a/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_origin.pdf b/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b22e3181fcbee3416ae68f644a0f168fed14f01 --- /dev/null +++ b/generativeinterventionsforcausallearning/c723740b-fba3-4566-b6b7-5e14a704e730_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ba59a7ada605366f6ac6cbb9fbf74323b05ad25d343e3bab6ca21e64987a5ec +size 2240644 diff --git a/generativeinterventionsforcausallearning/full.md b/generativeinterventionsforcausallearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3f2619cc1d114e792ee9d3bfb446d24072ba9959 --- /dev/null +++ b/generativeinterventionsforcausallearning/full.md @@ -0,0 +1,351 @@ +# Generative Interventions for l Learning + +Chengzhi Mao + +Augustine Cha $^{1*}$ + +Amogh Gu + +Carl Vondric + +1Columbia University, 2Ru + +![](images/9643a9956420a1bc0da9b810219f08a34e5cb46b848777ecd9313fa888b541be.jpg) + +Hao Wang $^{2}$ + +iversity + +![](images/767b66beb2b1e01189d2a66f5ac9df6bc4c65cf154f91a446b23dab3651e1795.jpg) + +![](images/6bbb95fafadcbbc507a6142ab1f45b2ae734b2ab13f989135226640276d29fe9.jpg) + +Yang + +{mcz, junfeng, vondrick}@cs.columbia.edu, {ac4612, ag4202}@columbia.edu, hoguewang@gmail.com + +# Abstract + +We introduce a framework for learning robust visual representations that generalize to new viewpoints, backgrounds, and scene contexts. Discriminative models often learn naturally occurring spurious correlations, which cause them to fail on images outside of the training distribution. In this paper, we show that we can steer generative models to manufacture interventions on features caused by confounding factors. Experiments, visualizations, and theoretical results show this method learns robust representations more consistent with the underlying causal relationships. Our approach improves performance on multiple datasets demanding out-of-distribution generalization, and we demonstrate state-of-the-art performance generalizing from ImageNet to ObjectNet dataset. + +# 1. Introduction + +Visual recognition today is governed by empirical risk minimization (ERM), which bounds the generalization error when the training and testing distributions match [47]. When training sets cover all factors of variation, such as background context or camera viewpoints, discriminative models learn invariances and predict object category labels with the right cause [33]. However, the visual world is vast and naturally open. Collecting a representative, balanced dataset is difficult and, in some cases, impossible because the world can unpredictably change after learning. + +Directly optimizing the empirical risk is prone to learning unstable spurious correlations that do not respect the underlying causal structure [11, 8, 24, 44, 4, 35]. Figure 1 illustrates the issue succinctly. In natural images, the object of interest and the scene context have confounding factors, creating spurious correlations. For example, ladle (the object of interest) often has a hand holding it (the scene context), but there is no causal relation between them. Several studies have exposed this challenge by demonstrating substantial performance degradation when the confounding bias no longer holds at testing time [41, 19]. For example, + +![](images/dbfeed9c6988056a004c8e4d5173ad384f2c976107c168045cd0660e3b989d3f.jpg) +Ladle + +![](images/79d14d782dc857e274cc161a25696655a3c00537c10e3209359d2051b625099c.jpg) +Television + +![](images/812a93c39d0ae8cadaec97b7d3b10f46f59dc70313f1ab829136bf29055069c7.jpg) +Shovel +Figure 1. Top predictions from a state-of-the-art ImageNet classifier [21]. The model uses spurious correlations (scene contexts, viewpoints, and backgrounds), leading to incorrect predictions.1 In this paper, we introduce a method to learn causal visual features that improve robustness of visual recognition models. The predictions of our model are in Figure 7. + +the ObjectNet [6] dataset removes several common spurious correlations from the test set, causing the performance of state-of-the-art models to deteriorate by $40\%$ compared to the ImageNet validation set. + +A promising direction for fortifying visual recognition is to learn causal representations (see [43] for an excellent overview). If representations are able to identify the causal mechanism between the image features and the category labels, then robust generalization is possible. While the traditional approach to establish causality is through randomized control trials or interventions, natural images are passively collected, preventing the use of such procedures. + +This paper introduces a framework for learning causal visual representations with natural images. Our approach is based on the observation that generative models quantify nuisance variables [23, 26], such as viewpoint or background. We present a causal graph that models both robust features and spurious features during image recognition. Crucially, our formulation shows how to learn causal features by steering generative models to perform interventions on realistic images, simulating manipulations to the camera and scene that remove spurious correlations. As our approach is model-agnostic, we are able to learn robust representations for any state-of-the-art computer vision model. + +Our empirical and theoretical results show that our ap + +![](images/8088e23aa13260bb4d7b3d483822cd47dda3bc890d1094587119c6dfdd212718.jpg) +Figure 2. Generative adversarial networks are steerable [23, 26], allowing us to manipulate images and construct interventions on nuisances. The transformations transfer across categories. Each column in the figure presents images with one consistent intervention direction. + +![](images/9f16789b5e48dc462ee3ca7a9720030f632e21290bba36be86c249a32a545fc5.jpg) + +![](images/b64f88cb51bb3dad9388470c5d5a9db7281c6ab10d5675a8c3015f70adf57957.jpg) + +proach learns representations that regard causal structures. While just sampling from generative models will replicate the same training set biases, steering the generative models allows us to reduce the bias, which we show is critical for performance. On ImageNet-C [22] benchmark, we surpass established methods by up to $12\%$ , which shows that our method helps discriminate based on the causal features. Our approach also demonstrates the state-of-the-art performance on the new ObjectNet dataset [6]. We obtain $39.3\%$ top-1 accuracy with ResNet152 [21], which is over $9\%$ gain over the published ObjectNet benchmark [6] while increasing accuracy on ImageNet and ImageNet-V2 [41]. We will release code, data, and models. + +# 2. Related Work + +Data augmentation: Data augmentation often helps learn robust image classifiers. Most existing data augmentations use lower-level transformations [29, 46], such as rotate, contrast, brightness, and shear. Auto-data augmentation [13, 52] uses reinforcement learning to optimize the combination of those lower-level transformations. Other work, such as cutout [15] and mixup [51], develops new augmentation strategies towards improved generalization. [34, 54, 19] explored style transfer to augment the training data, however, the transformations for training are limited to texture and color change. Adversarial training, where images are augmented by adding adversarial noise, can also train robust models [50]. However, both adversarial training [50] and auto augmentation [13, 52] introduce orders of magnitude of computational overhead. In addition, none of the above methods can do high-level transformations such as changing the viewpoint or background [6], while our generative interventions can. Our method fundamentally differs from prior data augmentation methods because it learns a robust model by estimating the causal effects via generative interventions. Our method not only eliminates spurious correlations more than data augmentations, but also theoretically produces a tighter causal effect bound. + +Causal Models: Causal image classifiers generalize well despite environmental changes because they are in- + +variant to the nuisances caused by the confounding factors [8]. A large body of work studies how to acquire causal effects from a combination of association levels and intervention levels [31, 11, 32]. Ideally, we can learn an invariant representation across different environments and nuisances [8, 35] while maintaining the causal information [5]. While structural risk minimization, such as regularization [27], can also promote a model's causality, this paper focuses on training models under ERM [47]. + +Generative Models: Our work leverages recent advances in deep generative models [20, 28, 25, 10, 40]. Deep generative models capture the joint distribution of the data, which complements discriminative models [25, 37, 38]. Prior work has explored adding data sampled from a deep generator to the original training data to improve classification accuracy on ImageNet [39]. We denote it as GAN Augmentation in this paper. Other works improved classification accuracy under imbalanced and insufficient data by oversampling through a deep generator [16, 17, 49, 7]. However, sampling without intervention, the augmented data still follows the same training joint distribution, where unobserved confounding bias will continue to contaminate the generated data. Thus, the resulting models still fail to generalize once the spurious correlations changed. Ideally, we want to generate data independent of the spurious correlations while holding the object's causal features fixed. + +Recent works analyzing deep generative models show that different variations, such as viewpoints and background, are automatically learned [26, 23]. We leverage deep generative models for constructing interventions in realistic visual data. Our work randomizes a large class of steerable variations, which shifts the observed data distribution to be independent of the confounding bias further. Our approach tends to manipulate high-level transformations orthogonal to traditional data augmentation strategies [12, 46, 29], and we obtain additional performance gains by combining them. + +Domain Adaptation: Our goal is to train robust models that generalize to unforeseen data. Accessing the test data distribution, even unlabeled, could lead to overfitting + +![](images/e861dbc6c9897772511a45c3abd5b59950e2403c905756375b40cda19f180b47.jpg) +Figure 3. Do unwanted correlations exist between the nuisance factors (e.g. backgrounds, viewpoint) and labels on ImageNet? We measure correlation (y-axis) via how many times the classification accuracy is better than chance on the ImageNet validation set. The x-axis denotes the number of categories we select for prediction. To train causal models, nuisance factors should not be predictable for labels (chance). Our generative interventions (GenInt) reduce the unwanted correlations from the data better than existing data augmentation strategies [51, 13, 19, 39]. + +and fail to measure the true generalization. Our work thus is trained with no access to the test data. Our setting is consistent with ObjectNet's policy prohibiting any form of learning on its test set [6], and ImageNet-C's policy discouraging training on the tested corruptions. On the other hand, domain adaptation [3, 42, 48] needs access to the distributions of both the source domain and the target domain, which conflicts with our setting. + +# 3. Causal Analysis + +We quantify nuisances via generative models and propose the corresponding causal graph. We show how to train causal models via intervention on the nuisance factors. We theoretically show sufficient conditions for intervention strategy selection that promote causal learning. + +# 3.1. Correlation Analysis + +Nuisance factors do not cause the object label. If there is a correlation between the nuisance factors and the label in data, we cannot learn causal classifiers. While identifying such correlations is crucial, they are hard to quantify on large, real-world vision datasets, because nuisance factors such as viewpoint and backgrounds, are difficult and expensive to measure in natural images. + +We propose to measure such nuisance factors via intervening on the conditional generative models. Prior work [23, 26] shows that nuisance transformations automatically emerge in generative models (Figure 2), which enables constructing desired nuisances via intervention. Given a category $\mathbf{y}$ and random noise vector $\mathbf{h}_0$ , we first generate an exemplar image $\mathbf{x} = G(\mathbf{h}_0, \mathbf{y})$ . We then conduct intervention $\mathbf{z}$ to get the intervened noise vector $\mathbf{h}_0^*$ , and the intervened image $\mathbf{x}^* = G(\mathbf{h}_0^*, \mathbf{y})$ , which corresponds to changing the viewpoints, backgrounds, and scene context of the exemplar. We thus get data with both image $\mathbf{x}^*$ and the corresponding nuisance manipulation $\mathbf{z}$ . Implementation details are in the supplementary. + +![](images/6b630540f740944de4fbd7b59add6a2c763ce826ef2cc56c439a89fae5939344.jpg) +Figure 4. Causal graph for image classification. Gray variables are observed. (a) $F$ is the variable that generates the object features. The unobserved confounder $C$ causes both the background features $Z$ and label $Y$ , which creates a spurious correlation between the image $X$ and label $Y$ . (b) An ideal intervention blocks the backdoor path from $Z$ to $C$ , which produces causal models. (c) In practice, we cannot guarantee to intervene on all the $Z$ variables. However, by properly intervening on even a small set of nuisance factors $Z_{i}$ , the confounding bias of the observed distribution is mitigated, which is theoretically proven by Theorem 1. + +![](images/0b876df3ae8969b5cc45bba85399cf1c26c22017e51c0fb2ed42d502a25eb49a.jpg) + +![](images/0928f0831e065b8f2c8628079ce1485271a2216031c241fb7616fca47a950c63.jpg) + +We train a model that predicts the nuisances $\mathbf{z}$ from input image $\mathbf{x}^*$ . This model can then predict nuisances $\mathbf{z}$ from natural images $\mathbf{x}$ . We read out the correlation between the nuisance $\mathbf{z}$ and label $\mathbf{y}$ by training a fully-connected classifier with input $\mathbf{z}$ and output $\mathbf{y}$ . We measure the correlations via the times the classifier outperforms random. Generative models may capture only a subset of the nuisances, thus our estimated correlations are lower bounds. The true correlations maybe even more significant. + +In Figure 3, the training data of five established methods [21, 51, 13, 19, 39] contains strong correlations that are undesirable. On the original ImageNet data, the undesirable correlation in the data is up to 8 times larger than chance. Our generative interventions reduce the unwanted correlations from the data significantly, naturally leading to robust classifiers that use the right cause. + +# 3.2. Causal Graph + +We build our causal graph based on the correlation analysis. We know that nuisances do not cause the label (context 'hand' does not cause the category 'ladle'), and there is no additional common outcome variable (collider) in our correlation prediction. If the correlation between the nuisances and the label is not chance, then there exists a confounder $C$ that causes both $Z$ and $Y$ . + +Figure 4(a) shows our causal graph for image recognition. We denote the unobserved confounder as $C$ , which produces nuisance factors $Z$ , and the corresponding annotated categorical label $Y$ . $Z$ produces the nuisance features $X_Z$ in images. There is another variable $F$ that generates the core object features $X_F$ , which together with $X_Z$ constructs the pixels of a natural image $X$ . There is no direct arrow from $F$ to $Y$ since $Y \perp F|X$ , i.e., image $X$ contains all the features for predicting $Y$ . We can observe only $X$ but not $X_Z$ or $Z_F$ separately. We draw a causal arrow from $X$ to $Y$ . Since nuisances $Z$ are spuriously correlated to the label but not causing the label $Y$ , classifiers are not causal if they predict $Y$ from the nuisances $Z$ better than + +chance. Note that "while a directed path is necessary for a total causal effect, it is not sufficient [36]." Thus, though there is a path $Z \to X \to Y$ , $Z$ does not cause $Y$ . + +# 3.3. Causal Discriminative Model + +Generative interventions help in eliminating spurious correlations (Figure 3 and Section 3.1), leading to better generalization. We denote the causality from $X$ to $Y$ to be $P(\mathbf{y}|do(\mathbf{x}))$ , which is the treatment effect of an input image $X$ on label $Y$ . To capture the right cause via correlations learned by empirical risk minimization, we need to construct data such that $P(Y|do(X)) = P(Y|X)$ . + +Natural images are often biased by unobserved confounding factors that are common causes to both the image $X$ and the label $Y$ . A passively collected vision dataset only enables us to observe the variables $X$ and $Y$ . Theoretically, we cannot identify the causal effect $P(Y|do(X))$ in Figure 4(a) with only the observed joint distribution $P(X,Y)$ because there is an unobserved common cause. + +We thus want to collect faithful data independent of the confounding bias, so that we can identify the causal effect with only the observed data. We need to intervene on the data-generation process for the nuisances $Z$ to be independent to the confounders, while keeping the core object features $F$ unchanged. In the physical world, such interventions correspond to actively manipulating the camera or objects in the scene. In our paper, we perform such interventions via steering the generative models. The outcome of this intervention on $Z$ is visualized in Figure 4(b), which manipulates the causal graph such that dependencies arriving at $Z$ are removed. Removing the backdoor, the correlation is now equal to the causality, i.e., $P(Y|X) = P(Y|do(X))$ . While this result is intuitive, performing perfect intervention in practice is challenging due to the complexity of the natural image distribution. + +# 3.4. Causal Effect Bound + +Imperfect interventions can eliminate only some spurious correlations. Though it is theoretically impossible to calculate the exact causal effect $P(\mathbf{y} \mid \text{do}(\mathbf{x}))$ when spurious correlations are not totally removed, we can still estimate the lower and upper bound for $P(\mathbf{y} \mid \text{do}(\mathbf{x}))$ . + +Given the observed joint distribution $P(\mathbf{x}, \mathbf{y})$ , Pearl [33] identified that $P(\mathbf{y} | \text{do}(\mathbf{x}))$ can be bounded by $P(\mathbf{x}, \mathbf{y}) \leq P(\mathbf{y} | \text{do}(\mathbf{x})) \leq P(\mathbf{x}, \mathbf{y}) + 1 - P(\mathbf{x})$ , which can be estimated by existing discriminative models without interventions. + +Prior work augments the data by sampling from the GANs without explicit intervention [49, 7, 16, 17], which will yield the same causal bound as the original data. Since GANs capture the same distribution as the observational training set, the spurious correlations remain the same. The sampled transformations $Z$ in Figure 4 (a) are still dependent on the confounders $C$ . Thus, augmenting training data + +with GANs [39], without intervention is not an effective algorithm for causal identification. + +In this paper, we aim to identify a tighter causal effect bound for $P(\mathbf{y} | \text{do}(\mathbf{x}))$ using generative interventions. This is desirable for robustness because it removes or reduces the overlap between the causal intervals, promoting causal predictions. Section 3.3 establishes that perfect interventions eliminate all spurious correlation and leads to better generalization. In practice, our generative interventions may only eliminate a subset of spurious correlations $Z_{i}$ , while other nuisances $Z_{U}$ remain unobserved and untouched. The next question is then: what generative intervention strategy is optimal for tightening the causal effect bound? We derive the following theory: + +Theorem 1 (Effective Intervention Strategy). We denote the images as $x$ . The causal bound under intervention $z_{i}$ is thus $P(\mathbf{y},\mathbf{x}|\mathbf{z}_i)\leq P(\mathbf{y}|do(\mathbf{x}))\leq P(\mathbf{y},\mathbf{x}|\mathbf{z}_i) + 1 - P(\mathbf{x}|\mathbf{z}_i)$ . For two intervention strategies $\mathbf{z}_1$ and $\mathbf{z}_2$ , $\mathbf{z}_1\subset \mathbf{z},\mathbf{z}_2\subset \mathbf{z}$ , if $P(\mathbf{x}|\mathbf{z}_1) > P(\mathbf{x}|\mathbf{z}_2)$ , then $\mathbf{z}_1$ is more effective for causal identification. + +Proof. Figure 4(c) shows the causal graph after intervention $Z_{i}$ , where $Z_{i} \perp Y|X$ . We add and remove the same term $\sum_{c} P(\mathbf{y}, \mathbf{x}, \mathbf{c}|\mathbf{z}_{i})$ : + +$$ +\begin{array}{l} P (\mathbf {y} \mid d o (\mathbf {x})) = \sum_ {c} P (\mathbf {y} \mid \mathbf {x}, \mathbf {z} _ {i}, \mathbf {c}) P (\mathbf {c}) \quad \text {(B a c k d o o r C r i t e r i a)} \\ = \sum_ {\mathbf {c}} P (\mathbf {y}, \mathbf {x}, \mathbf {c} | \mathbf {z} _ {i}) + \sum_ {\mathbf {c}} P (\mathbf {y} | \mathbf {x}, \mathbf {z} _ {i}, \mathbf {c}) (P (\mathbf {c}) - P (\mathbf {x}, \mathbf {c} | \mathbf {z} _ {i})) \\ \end{array} +$$ + +Since $0 \leq P(\mathbf{y}|\mathbf{x},\mathbf{z}_i,\mathbf{c}) \leq 1$ , we have the lower and upper bounds. We denote $\delta_1 = P(\mathbf{x}|\mathbf{z}_1) - P(\mathbf{x}|\mathbf{z}_2)$ , thus $\delta_1 > 0$ . In the causal graph (Figure 4(c)), since we intervene on $\mathbf{z}_i$ , all incoming edges to $\mathbf{z}_i$ are removed; we then have $\mathbf{z}_i \perp \mathbf{y}|\mathbf{x}$ and $P(\mathbf{x},\mathbf{y}|\mathbf{z}_i) = P(\mathbf{y}|\mathbf{x},\mathbf{z}_i)P(\mathbf{x}|\mathbf{z}_i) = P(\mathbf{y}|\mathbf{x})P(\mathbf{x}|\mathbf{z}_i)$ . Therefore $\delta_2 = P(\mathbf{x},\mathbf{y}|\mathbf{z}_1) - P(\mathbf{x},\mathbf{y}|\mathbf{z}_2) = \delta_1 \cdot P(\mathbf{y}|\mathbf{x})$ . Since apparently $0 < P(\mathbf{y}|\mathbf{x}) < 1$ , we have that $0 < \delta_2 < \delta_1$ . Thus we obtain $[P(\mathbf{y},\mathbf{x}|\mathbf{z}_1),P(\mathbf{y},\mathbf{x}|\mathbf{z}_1) + 1 - P(\mathbf{x}|\mathbf{z}_1)] \subset [P(\mathbf{y},\mathbf{x}|\mathbf{z}_2),P(\mathbf{y},\mathbf{x}|\mathbf{z}_2) + 1 - P(\mathbf{x}|\mathbf{z}_2)]$ , which means the intervention $\mathbf{z}_1$ results in a tighter causal effect bound. + +Our theorem shows that: the optimal intervention strategy should maximize $P(\mathbf{x}|\mathbf{z})$ , which will tighten the causal effect bound $P(\mathbf{y}|do(\mathbf{x}))$ . Also, the intervention strategy should be identically selected across all categories, so that they are independent of the confounding bias. While there are different choices of intervening on the generative model to create independence, we empirically select our generative intervention strategy that increases $P(\mathbf{x}|\mathbf{z})$ , which we will discuss in Section 5.4. + +# 4. Method + +We show how deep generative models can be used to construct interventions on the spuriously correlated features + +in the causal graph. We combine these results to develop a practical framework for robust learning. + +# 4.1. Learning Objective + +We minimize the following training loss on our intervened data: + +$$ +\begin{array}{l} \mathcal {L} = \mathcal {L} _ {e} (\phi (\mathbf {X}), \mathbf {Y}) + \lambda_ {1} \mathcal {L} _ {e} (\phi (\mathbf {X} _ {\text {i n t}}), \mathbf {Y} ^ {\prime}) \\ + \lambda_ {2} \mathcal {L} _ {e} \left(\phi \left(\mathbf {X} _ {i t r}\right), \mathbf {Y} ^ {\prime \prime}\right) \\ \end{array} +$$ + +where $\mathcal{L}_e$ denotes the standard cross entropy loss and $\lambda_i \in \mathbb{R}$ are hyper-parameters controlling training data choice. We denote the original data matrix as $\mathbf{X}$ with target labels $\mathbf{Y}$ ; the generated data matrix as $\mathbf{X}_{int}$ (Section 4.2) with target labels $\mathbf{Y}'$ ; the transferred data as $\mathbf{X}_{itr}$ (Section 4.3) with target labels $\mathbf{Y}''$ ; and the discriminative classifier as $\phi$ . + +The last two terms of this objective are the interventions. In the remainder of this section, we present two different ways of constructing these interventions. + +# 4.2. Generative Interventions + +We construct interventions using conditional generative adversarial networks (CGAN). We denote the $i$ -th layer's hidden representation as $\mathbf{h}_i$ . CGAN learns the mapping $\mathbf{x} = G(\mathbf{h}_0, \mathbf{y})$ , where $\mathbf{h}_0 \sim \mathcal{N}(0, I)$ is the input noise, $\mathbf{y}$ is the label, and $\mathbf{x}$ is a generated image of class $\mathbf{y}$ that lies in the natural image distribution. CGANs are trained on the joint data distribution $P(\mathbf{x}, \mathbf{y})$ . While we can use any type of CGANs, we select BigGAN [10] in this paper since it produces highly realistic images. In addition, generative models learn a latent representation $\mathbf{h}_i$ equivariant to a large class of visual transformations and independent of the object category [23, 26], allowing for controlled visual manipulation. For example, GANSpace [23] showed that the principal components of $\mathbf{h}_i$ correspond to visual transformations over camera extrinsics and scene properties. The same perturbations in the latent space will produce the same visual transformations across different categories. Figure 2 visualizes this steerability for a few samples and different transformations. This property enables us to construct a new training distribution, where the nuisance features $Z$ are not affected by the confounders. + +Our generative intervention strategy follows the GANSpace [23] method, which empirically steers the GAN with transformations independent of the categories. It contains three factors: the truncation value, the transformation type, and the transformation scale. The input noise $\mathbf{h}_0$ is sampled from Gaussian noise truncated by value $t$ [10]. We define the transformations to be along the $j$ -th principal directions $\mathbf{r}_j$ in the feature space [23], which are orthogonal and captures the major variations of the data. We select the top- $k$ significant ones $\{\mathbf{r}_1, \mathbf{r}_2, \dots, \mathbf{r}_k\}$ as the intervention directions. We then intervene along the selected directions with a uniformly sampled step size $s'$ from a range $[-s, s]$ . + +We intervene on the generator's intermediate layers with $\mathbf{h}_i^* = \mathbf{h}_i + \sigma s'\mathbf{r}_j - \mu$ , where $\mathbf{h}_i^*$ are the features at layer $i$ after interventions, $\sigma$ is the standard deviation of noise on direction $\mathbf{r}$ , and $\mu$ is the offset term. After the intervention, we follow the method in GANSpace [23] to recover $\mathbf{h}_0^*$ with regression and generate the new image $\mathbf{x}^* = G(\mathbf{h}_0^*,\mathbf{y})$ . Using conditional generative models, we produce the causal features $X_{F}$ by specifying the category. Our intervention removes the incoming edge from $C$ to $Z_{i}$ (Figure 4 (c)). We denote the intervention procedure as function $I$ , and rewrite the generative interventions as: + +$$ +\mathbf {X} _ {i n t} = I (t, s, k, \mathbf {Y} ^ {\prime}) +$$ + +Based on our Theorem 1, we choose the hyper-parameters $t, k, s$ for intervention $Z$ that maximizes $P(\mathbf{x}|\mathbf{z})$ . We show ablation studies in Section 5.4. + +# 4.3. Transfer to Natural Data + +Maintaining the original training data $\mathbf{X}$ will add confounding bias to models. While our theory shows that our method still tightens the causal effect bound under the presence of spurious correlations, it is desirable to eliminate as many spurious correlations as possible. We will therefore also intervene on the original dataset. + +One straightforward approach is to estimate the latent codes in the generator corresponding to the natural images, and apply our above intervention method. We originally tried projecting the images back to the latent space in the generative models [53, 2], but this did not obtain strong results, because the projected latent code cannot fully recover the query images [9]. + +Instead, we propose to transfer the desirable generative interventions from $\mathbf{X}_{int}$ to the original data $\mathbf{X}$ with neural style transfer [18]. The category information is maintained by the matching loss while the intervened nuisance factors are transferred via minimizing the maximum mean discrepancy [30]. Without projecting the images to the latent code, the transfer enables us to intervene on some of the nuisance factors $z$ in the original data, such as the background. The transfer of the generative interventions $I(t,k,s,\mathbf{Y}^{\prime})$ to natural data $\mathbf{X}$ is formulated as: + +$$ +\mathbf {X} _ {i t r} = T \left(I (t, k, s, \mathbf {Y} ^ {\prime}), \mathbf {X}\right) +$$ + +where $T$ denote the style transfer mapping. The corresponding label $\mathbf{Y}''$ is the same label as for $\mathbf{X}$ . Please see supplemental material for visualizations of these interventions. + +# 5. Experiments + +We present image classification experiments on four datasets — ImageNet, ImageNet-V2,Imagenet-C,and ObjectNet to analyze the generalization capabilities of this + +
Training DistributionResNet 18ResNet 152
Std. Augmentation top1top5Add. Augmentation top1top5Std. Augmentation top1top5Add. Augmentation top1top5
ImageNet Only [21, 6]20.48%40.64%24.42%44.39%30.00%48.00%37.43%59.10%
Stylized ImageNet [19]18.39%37.29%22.81%42.27%31.64%52.56%36.17%57.95%
Mixup [51]19.12%37.78%24.05%44.17%34.27%55.68%38.61%60.36%
AutoAug [13]21.20%41.26%21.20%41.26%33.96%55.81%33.96%55.81%
GAN Augmentation [39]20.63%39.77%23.72%43.67%33.17%54.59%36.37%58.88%
GenInt (ours)22.07%41.94%25.71%46.39%34.47%55.63%39.21%61.06%
GenInt with Transfer (ours)22.34%41.65%27.03%48.02%34.69%55.82%39.38%61.43%
+ +Table 1. Accuracy on the ObjectNet test set versus training distributions. By intervening on the training distribution with generative models, we obtain the state-of-the-art performance on the ObjectNet test set, even though the model was never trained on ObjectNet. + +
ModelmCE ↓Gauss.ShotImpulseDefocusGlassMotionZoomSnowFrostFogBrightContrastElasticPixelJPEG
AlexNet100.00100100100100100100100100100100100100100100100
ResNet 18 [21]ImgNet Only [21]87.1689.590.493.086.0193.387.790.087.586.480.073.780.591.585.592.4
Stylized ImgNet [19]80.8379.180.981.781.787.680.090.078.380.276.272.577.284.176.286.7
Mixup [51]86.0686.888.190.888.795.689.189.382.572.871.975.976.596.289.597.2
AutoAug [13]84.0084.383.784.587.993.687.793.585.783.471.067.463.597.885.390.5
GAN Augmentation [39]86.4886.487.590.587.092.487.290.388.086.382.873.382.890.784.587.5
GenInt with Transfer (ours)74.6867.068.467.375.080.576.084.277.475.977.568.876.687.559.877.5
ResNet 152 [21]ImgNet Only [21]69.2772.573.476.366.981.465.774.570.767.862.151.067.175.668.965.1
Stylized ImgNet [19]64.1963.363.164.666.177.063.571.662.465.459.452.062.073.255.362.9
Mixup [51]66.4369.071.173.867.383.465.574.663.556.955.249.462.475.465.063.7
AutoAug [13]69.2071.772.875.667.282.167.776.770.367.761.850.565.076.068.364.6
GAN Augmentation [39]69.0171.873.175.967.382.367.576.269.968.159.251.362.576.667.765.7
GenInt with Transfer (ours)61.7059.260.262.460.770.859.569.964.463.858.348.761.570.955.260.0
+ +Table 2. The mCE $\downarrow$ rate (the smaller the better) on ImageNet-C validation [22] set with 15 different corruptions. Our GenInt model, without training on any of the corruptions, reduces the mCE by up to ${12.48}\%$ . From column 'Gauss.' to column 'JPEG,' we show individual Error Rate on each corruption method. Without adding similar corruptions in the training set, our generative causal learning approach learns models that naturally generalize to unseen corruptions. + +method and validate our theoretical results. We call our approach GenInt for generative interventions, and compare the different intervention strategies. + +# 5.1. Datasets + +In our experiments, all the models are first trained on ImageNet [14] (in addition to various intervention strategies). We train only on ImageNet without any additional data from other target domains. We directly evaluate the models on the following out-of-distribution testing sets: + +ObjectNet [6] is a test set of natural images that removes background, context, and camera viewpoints confounding bias. Improving performance on ObjectNet—without finetuning on it—indicates that a model is learning causal features. ObjectNet's policy prohibits any form of training on the ObjectNet data. We measure performance on the 113 overlapping categories between ImageNet and ObjectNet. + +ImageNet-C [22] is a benchmark for model generalization under 15 common corruptions, such as 'motion,' 'snow,' and 'defocus.' Each corruption has 5 different intensities. We use mean Corruption Error (mCE) normalized by AlexNet as the evaluation metric [22]. Note that we do not train our model with any of these corruptions, thus the performance gain measures our model's generalization to unseen corruptions. + +ImageNet-V2 [41] is a new test set for ImageNet, aiming + +to quantify the generalization ability of ImageNet models. It contains three sampling strategies: MatchedFrequency, Threshold0.7, and TopImages. While current models are overfitting to the ImageNet test set, this dataset measures the ability to generalize to a new test set. + +# 5.2. Baselines + +We compare against several established data augmentation baselines: + +Stylized ImageNet refers to training the model using style transferred dataset [19], which trains classifiers that are not biased towards texture. + +Mixup [51] does linear interpolation to augment the dataset. We use their best hyperparameters setup $(\alpha = 0.4)$ . + +AutoAug [13] systematically optimizes the strategy for data augmentation using reinforcement learning. + +GAN Augmentation refers to the method that augments the ImageNet data by directly sampling from the BigGAN [39]. They provide an extensive study for hyper-parameter selection. We use their best setup as our baseline: $50\%$ of synthetic data sampled from BigGAN with truncation 0.2. + +ImageNet only refers to training the standard model on ImageNet dataset only [21]. + +# 5.3. Empirical Results + +Our GenInt method demonstrates significant gains on four datasets over five established baselines. We report + +
Training DistributionImageNet-V2 Grouped by Sampling Strategy [41]Original +ImageNet Val
“TopImages”“Threshold0.7”“MatchedFrequency”
top1top5top1top5top1top5top1top5
ResNet 18[21]ImageNet Only [21]71.77%91.11%65.41%87.39%56.18%79.35%68.82%88.96%
Stylized ImageNet [19]69.55%89.97%62.92%85.38%54.13%77.30%66.95%87.42%
Mixup [51]69.90%90.16%63.42%86.40%54.42%77.94%66.00%86.93%
AutoAug [13]72.05%91.49%65.32%87.32%56.25%79.16%69.24%88.91%
GAN Augmentation [39]72.01%91.24%65.72%87.58%56.43%79.42%69.19%88.85%
GenInt (ours)72.80%91.89%66.26%88.30%57.86%80.11%70.41%89.59%
GenInt with Transfer (ours)72.84%91.85%66.49%88.11%57.35%79.61%70.25%89.33%
ResNet 152[21]ImageNet Only [21]81.01%96.21%76.17%94.12%67.76%87.57%78.57%94.29%
Stylized ImageNet [19]79.40%95.72%74.02%92.88%65.12%86.22%77.27%93.76%
Mixup [51]80.68%96.28%75.91%94.00%67.11%87.66%78.78%94.45%
AutoAug [13]80.61%96.30%75.90%94.06%67.35%87.61%78.95%94.56%
GAN Augmentation [39]80.10%96.00%75.60%93.74%66.89%87.04%78.53%94.21%
GenInt (ours)80.77%96.38%76.20%94.24%67.74%87.83%79.46%94.71%
GenInt with Transfer (ours)81.24%96.28%76.60%93.95%68.08%87.70%79.59%94.79%
+ +Table 3. Accuracy on ImageNet V2 validation set [41] and original ImageNet validation set. Our method improves the performance upon the baselines, which suggests our causal learning approach does not hurt the performance on original test set while becoming robust. + +results for two different network architectures (ResNet18, ResNet152). All ResNet18 models are trained with SGD for 90 epochs, we follow the standard learning rate schedule where we start from 0.1, and reduce it by 10 times every 30 epochs. For ResNet152 models, we train "ImageNet only" models using the above mentioned method, and fine-tune all the other methods from the baseline for 40 epochs given that it is computationally expensive to train ResNet152 models from scratch. For GenInt, we all use $\lambda_{1} = 0.05$ and $\lambda_{2} = 0$ for ResNet18 and $\lambda_{1} = 0.2$ and $\lambda_{2} = 0$ for ResNet152. For GenInt with Transfer, we use $\lambda_{1} = 0.02$ and $\lambda_{2} = 1$ for our experiments on Resnet18, and $\lambda_{1} = 0.2$ and $\lambda_{2} = 0.2$ for our finetuning on ResNet152. We select hyperparameters of our intervention strategy in Section 5.4. Implementation details are in the supplementary. + +ObjectNet: Table 1 shows that our model can learn more robust features, and consequently generalizes better to ObjectNet without any additional training. Our results consistently outperform the naive sampling from generative models [39] and other data augmentation strategies [51, 19, 13] for multiple metrics and network architectures, highlighting the difference between traditional data augmentation and our generative intervention. Our approach enjoys benefits by combining with additional data augmentations, demonstrated by the differences between the "Std. Augmentation" columns and the "Add. Augmentation" columns. This improvement suggests that our generative intervention can manipulate additional nuisances (viewpoints, backgrounds, and scene contexts) orthogonal to traditional augmentation, which complements existing data augmentation methods. Moreover, our results suggest that intervening on the generative model is more important than just sampling from it. + +ImageNet-C: To further validate that our approach learns causality, and not just overfits, we measure the same models' generalization to unseen corruptions on ImageNet-C. We evaluate performance with mean corruption error + +![](images/2acf5982c2063f55ffbc5947beab01246736673679404c8f0134f63c9a0e7364.jpg) +Figure 5. As the strength of the intervention increases, the value of $\log P(x|z)$ increases (value calculated on sampled set), which improves the performance of ResNet-18 model. + +![](images/cc43b92924b649285d04d831220b98fb097fd4a118e4c60836d340d90345f0f0.jpg) + +![](images/24c82cf6d5a06d5bcedae40c389175f7cccb63eb75f4220058942e3de7cca1f6.jpg) +Figure 6. $\log P(x|z)$ for causal effect bound under different intervention strategies. The x-axis of each subfigure changes one hyper-parameter for intervention strategy: truncation value $t$ (left), PCA number $k$ (middle), and the intervention scale $s$ (right). Based on theorem 1, we choose the hyper-parameters $t, k, s$ that produces the highest value for $\log P(x|z)$ from individual figure. + +![](images/473ecacdaa0a53aac86f33aea6fd70472255cea84b0774571a40a0cb024e7f88.jpg) + +![](images/aadcad10432ffc2b89e8f3f112823220845fbdf8f59493e3eea7c3f423a33469.jpg) + +(mCE) [22] normalized by CE of AlexNet. Table 2 shows that directly sampling from GAN as augmentation (GAN Augmentation) slightly improves performance (less than $1\%$ ). Stylized ImageNet achieves the best performance among all the baselines, but it is still worse than our approach in mCE. In addition, Stylized ImageNet hurts the performance on ObjectNet, which suggests its high performance on corruptions is overfitting to the correlations instead of learning the causality. Our approach outperforms baseline by up to $12.48\%$ and $7.57\%$ on ResNet18 and ResNet152 respectively, which validates that our generative interventions promote causal learning. + +ImageNet and ImageNet-V2: Table 3 shows the accuracy on both validation sets. Some baselines, such as Stylized ImageNet, hurt the performances on the ImageNet validation set, while our approach improves the performance. + +Overall, without trading-off the performance between + +
Training Dist.TruncationImageNet
top1top5
Observational GAN [39]1.039.07%62.97%
Observational GAN [39]1.542.65%65.92%
Observational GAN [39]2.040.98%64.37%
Interventional GAN (ours)1.045.06%68.48%
+ +Table 4. We show performance for ResNet50 trained only on BigGAN. Our intervention model surpasses performance of the best established benchmark [39] + +different datasets, our approach achieves improved performance for all test sets, which highlights the advantage of our causal learning approach. + +# 5.4. Analysis + +Causal Bound and Performance: Does tighter causal bound lead to a better classifier? Following Theorem 1, we measure the tightness of causal bound after intervention, where we use the log likelihood $\log P(x|z) = \sum_{i}\sum_{x_j'}\log (P(x_i|x_j')P(x_j'|z))$ , where $x_{i}$ is the query image from the held out ImageNet validation set, and $x_{j}^{\prime}$ is the data generated by intervention $z$ . We train ResNet18 on our generated data. By varying the intervention strength, we increase the value of $P(x|z)$ , which corresponds to a tighter causal bound. Figure 5 shows that, as the causal bound getting tighter (left), performance steadily increases (right). + +Optimal Intervention Strategy: Since tighter causal bound produces better models, we investigate the optimal intervention strategy for tightening causal bounds. We study the effect of changing $t, k, s$ for our intervention on the causal bound (Section 4.2). We conduct ablation studies and show the trend in Figure 6. We choose $t = 1$ , $k = 60$ , and $s = 100\%$ as our intervention strategy for tightest causal bound, which produces $\log P(x|z) = -5.162$ and yields the optimal accuracy of $45.06\%$ (Table 4) in practice. + +Importance of Intervention: Our results show that creating interventions with a GAN is different from simply augmenting datasets with samples from a GAN. To examine this, Table 4 shows performance on ImageNet when the training sets only consist of images from the GAN. We use the best practices from [39], which comprehensively studies GAN image generation as training data. Our results show that creating interventions, not just augmentations, improves classification performance by $2.4\% -6.0\%$ . + +# 5.5. Model Visualization + +By removing the confounding factors in the dataset, we expect the model to learn to attend tightly to the spatial regions corresponding to the object, and not spuriously correlated contextual regions. To analyze this, Figure 7 uses GradCAM [45] to visualize what regions the models use for making prediction. While the baseline often attends to the + +![](images/dea6736539f400de0957031197bb9573d0ffd7b9c4e63bda0c39f335d97db19f.jpg) +Figure 7. We visualize the input regions that the model uses to make predictions. Blue implies the model ignores the region for discrimination, while red implies the region is very discriminative. The white text shows the model's top prediction. The baseline frequently latches onto spurious background context (e.g., hand spuriously correlated with ladle, chair spuriously correlated with tablelamp), and consequently makes the wrong prediction. Meanwhile, our model often predicts correctly for the right reasons. + +background or other nuisances for prediction, our method focuses on the spatial features of the object. For example, for the first 'Broom' image, the baseline uses spurious context 'hand,' leading to a misprediction 'Ladle,' while our model predicts the right 'Broom' by looking at its shape. This suggests that, in addition to performance gains, our model predicts correctly for the right reasons. + +# 6. Conclusion + +Fortifying visual recognition for an unconstrained environment remains an open challenge in the field. We introduce a method for learning discriminative visual models that are consistent with causal structures, which enables robust generalization. By steering generative models to construct interventions, we are able to randomize many features without being affected by confounding factors. We show a theoretical guarantee for learning causal classifiers under imperfect interventions, and demonstrate improved performance on ImageNet, ImageNet-C, ImageNet-V2, and the systematically controlled ObjectNet. + +Acknowledgments: This research is based on work partially supported by NSF NRI Award #1925157, the DARPA SAIL-ON program under PTE Federal Award No. W911NF2020009, an Amazon Research Gift, NSF grant CNS-15-64055, ONR grants N00014-16-1-2263 and N00014-17-1-2788, a JP Morgan Faculty Research Award, and a DiDi Faculty Research Award. We thank NVidia for GPU donations. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of the U.S. Government. + +# References + +[1] PytorchImagenet tutorial. +[2] Transforming and projecting images to class-conditional generative networks. +[3] Cycada: Cycle consistent adversarial domain adaptation. In International Conference on Machine Learning (ICML), 2018. +[4] Jayadev Acharya, Arnab Bhattacharyya, Constantinos Daskalakis, and Saravanan Kandasamy. Learning and testing causal models with interventions. In Advances in Neural Information Processing Systems, pages 9447-9460, 2018. +[5] Alessandro Achille and Stefano Soatto. Emergence of invariance and disentanglement in deep representations. The Journal of Machine Learning Research, 19(1):1947-1980, 2018. +[6] Julian Alverio William Luo Christopher Wang Dan Gutfreund Josh Tenenbaum Andrei Barbu, David Mayo and Boris Katz. Objectnet: A large-scale bias-controlled dataset for pushing the limits of object recognition models. In In Advances in Neural Information Processing Systems 32, page 9448-9458, 2019. +[7] Antreas Antoniou, Amos Storkey, and Harrison Edwards. Data augmentation generative adversarial networks, 2017. +[8] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization, 2019. +[9] David Bau, Jun-Yan Zhu, Jonas Wulff, William Peebles, Hendrik Strobelt, Bolei Zhou, and Antonio Torralba. Seeing what a gan cannot generate. In Proceedings of the IEEE International Conference on Computer Vision, pages 4502-4511, 2019. +[10] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019. +[11] Krzysztof Chalupka, Pietro Perona, and Frederick Eberhardt. Visual causal feature learning. In Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, UAI'15, page 181–190, Arlington, Virginia, USA, 2015. AUAI Press. +[12] Shorten Connor and Taghi M. Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 6, 2019. +[13] Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment: Learning augmentation policies from data, 2018. +[14] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. +[15] Terrance DeVries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout, 2017. +[16] Fabio Henrique Kiyoiti dos Santos Tanaka and Claus Aranha. Data augmentation using gans, 2019. + +[17] M. Frid-Adar, E. Klang, M. Amitai, J. Goldberger, and H. Greenspan. Synthetic data augmentation using gan for improved liver lesion classification. In 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018), pages 289–293, 2018. +[18] 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 (CVPR), June 2016. +[19] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019. +[20] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139-144, 2020. +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2016. +[22] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019. +[23] Erik Härkönen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering interpretable gan controls, 2020. +[24] Maximilian Ilse, Jakub M. Tomczak, and Patrick Forre. Designing data augmentation for simulating interventions, 2020. +[25] Tommi Jaakkola and David Haussler. Exploiting generative models in discriminative classifiers. In In Advances in Neural Information Processing Systems 11, pages 487-493. MIT Press, 1998. +[26] Ali Jahanian*, Lucy Chai*, and Phillip Isola. On the "steerability" of generative adversarial networks. In International Conference on Learning Representations, 2020. +[27] Dominik Janzing. Causal regularization. In Advances in Neural Information Processing Systems, pages 12704-12714, 2019. +[28] Diederik P. Kingma and Max Welling. Auto-Encoding Variational Bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. +[29] 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 25, pages 1097-1105. Curran Associates, Inc., 2012. +[30] Yanghao Li, Naiyan Wang, Jiaying Liu, and Xiaodi Hou. Demystifying neural style transfer. In Proceedings of the + +26th International Joint Conference on Artificial Intelligence, pages 2230-2236, 2017. +[31] Raha Moraffah, Kai Shu, Adrienne Raglin, and Huan Liu. Deep causal representation learning for unsupervised domain adaptation, 2019. +[32] Suraj Nair, Yuke Zhu, Silvio Savarese, and Li Fei-Fei. Causal induction from visual observations for goal directed tasks, 2019. +[33] Judea Pearl. Causality: Models, reasoning, and inference, 2003. +[34] Luis Perez and Jason Wang. The effectiveness of data augmentation in image classification using deep learning, 2017. +[35] Jonas Peters, Peter Buhlmann, and Nicolai Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 78(5):947-1012, Oct 2016. +[36] Jonas Peters, Dominik Janzing, and Bernhard Schlkopf. Elements of Causal Inference: Foundations and Learning Algorithms. The MIT Press, 2017. +[37] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In Yoshua Bengio and Yann LeCun, editors, 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. +[38] Vikram V. Ramaswamy, Sunnie S. Y. Kim, and Olga Russakovsky. Fair attribute classification through latent space de-biasing, 2020. +[39] Suman Ravuri and Oriol Vinyals. Classification accuracy score for conditional generative models. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 12268-12279. Curran Associates, Inc., 2019. +[40] Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. In Advances in Neural Information Processing Systems, pages 14866–14876, 2019. +[41] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do ImageNet classifiers generalize to ImageNet? 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 5389-5400, Long Beach, California, USA, 09-15 Jun 2019. PMLR. +[42] Swami Sankaranarayanan, Yogesh Balaji, Carlos D. Castillo, and Rama Chellappa. Generate to adapt: Aligning domains using generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. +[43] Bernhard Schölkopf. Causality for machine learning. arXiv preprint arXiv:1911.10500, 2019. + +[44] Patrick Schwab and Walter Karlen. Cxplain: Causal explanations for model interpretation under uncertainty. In Advances in Neural Information Processing Systems, pages 10220-10230, 2019. +[45] Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. International Journal of Computer Vision, 128(2):336-359, Oct 2019. +[46] Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B. Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: a good embedding is all you need?, 2020. +[47] V. Vapnik. Principles of risk minimization for learning theory. In J. E. Moody, S. J. Hanson, and R. P. Lippmann, editors, Advances in Neural Information Processing Systems 4, pages 831-838. Morgan-Kaufmann, 1992. +[48] Hao Wang, Hao He, and Dina Katabi. Continuously indexed domain adaptation. In ICML, 2020. +[49] Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Jun 2018. +[50] Cihang Xie, Mingxing Tan, Boqing Gong, Jiang Wang, Alan L Yuille, and Quoc V Le. Adversarial examples improve image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 819-828, 2020. +[51] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018. +[52] Xinyu Zhang, Qiang Wang, Jian Zhang, and Zhao Zhong. Adversarial autoaugment. In International Conference on Learning Representations, 2020. +[53] Jun-Yan Zhu, Philipp Krahenbuhl, Eli Shechtman, and Alexei A Efros. Generative visual manipulation on the natural image manifold. In European conference on computer vision, pages 597-613. Springer, 2016. +[54] Xinyue Zhu, Yifan Liu, Jiahong Li, Tao Wan, and Zengchang Qin. Emotion classification with data augmentation using generative adversarial networks. In Dinh Phung, Vincent S. Tseng, Geoffrey I. Webb, Bao Ho, Mohadeseh Ganji, and Lida Rashidi, editors, Advances in Knowledge Discovery and Data Mining, pages 349-360, Cham, 2018. Springer International Publishing. \ No newline at end of file diff --git a/generativeinterventionsforcausallearning/images.zip b/generativeinterventionsforcausallearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fe2cfe0d7fb2c68d0ff8de9726fad21dc35a5539 --- /dev/null +++ b/generativeinterventionsforcausallearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edc59a70961729e193b553e376207010db863b581865235d4e2dea11ce9a2045 +size 572749 diff --git a/generativeinterventionsforcausallearning/layout.json b/generativeinterventionsforcausallearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5a9099fb976e0f3b3dd9c53ed9e495d7af056d19 --- /dev/null +++ b/generativeinterventionsforcausallearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5858bac0f6e0874b686cdfa0ee07f8f01e1ddafe9f5df57e3edbed808393727 +size 523959 diff --git a/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_content_list.json b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..827de608054c507a087bd2c905d0123221a1f6f1 --- /dev/null +++ b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abc5370bd5895c7ed54b12163f712924928a081bfea214ced3fcaa54cd071e2c +size 78979 diff --git a/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_model.json b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..23df5422b49fc8189d72a6699653fac4ec878c03 --- /dev/null +++ b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7b4b97aed6a7b04457b6bcd15f320db7ba1bfd270bc655d4506f81a6d262a54 +size 96289 diff --git a/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_origin.pdf b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f19284caebb4dfea3cfb23807269b9db629048d9 --- /dev/null +++ b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/e0a6dcb3-1a59-4cbd-9b3d-9ab36f93726c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56e4071e1ed0c8baf9073b80084c1ecdbc6e3ceb1c82acd4303e1a1eed8b9fd6 +size 2397561 diff --git a/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/full.md b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e57b6b32624896ae6a1716f86358fb488215a579 --- /dev/null +++ b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/full.md @@ -0,0 +1,284 @@ +# Generative PointNet: Deep Energy-Based Learning on Unordered Point Sets for 3D Generation, Reconstruction and Classification + +Jianwen Xie $^{1*}$ , Yifei Xu $^{2*}$ , Zilong Zheng $^{2}$ , Song-Chun Zhu $^{2,3,4}$ , Ying Nian Wu $^{2}$ $^{1}$ Cognitive Computing Lab, Baidu Research, Bellevue, WA, USA + $^{2}$ University of California, Los Angeles (UCLA), CA, USA + $^{3}$ Tsinghua University, Beijing, China + $^{4}$ Peking University, Beijing, China + +{jianwen,fei960922,z.zheng}@ucla.edu,{sczhu,ywu}@stat.ucla.edu + +# Abstract + +We propose a generative model of unordered point sets, such as point clouds, in the forms of an energy-based model, where the energy function is parameterized by an input-permutation-invariant bottom-up neural network. The energy function learns a coordinate encoding of each point and then aggregates all individual point features into an energy for the whole point cloud. We call our model the Generative PointNet because it can be derived from the discriminative PointNet. Our model can be trained by MCMC-based maximum likelihood learning (as well as its variants), without the help of any assisting networks like those in GANs and VAEs. Unlike most point cloud generators that rely on hand-crafted distance metrics, our model does not require any hand-crafted distance metric for the point cloud generation, because it synthesizes point clouds by matching observed examples in terms of statistical properties defined by the energy function. Furthermore, we can learn a short-run MCMC toward the energy-based model as a flow-like generator for point cloud reconstruction and interpolation. The learned point cloud representation can be useful for point cloud classification. Experiments demonstrate the advantages of the proposed generative model of point clouds. + +# 1. Introduction + +# 1.1. Background and motivation + +Point clouds, as a standard 3D acquisition format used by devices like Lidar on autonomous vehicles, Kinect for Xbox and face identification sensor on phones, are getting increasingly popular for 3D representation in computer vision. Moreover, compared to other 3D formats such as + +voxel grids and 3D meshes, point clouds can provide a compact and detailed representation of a 3D object. + +Learning a generative model of 3D point clouds is a fundamental problem for 3D computer vision because it is beneficial to 3D point cloud synthesis and analysis tasks, by providing an explicit probability distribution of point clouds. Despite the enormous advance of discriminative models for the tasks of 3D point cloud classification and segmentation, e.g., PointNet [31], PointNet++ [32], DeepSet [52], ShapeContextNet [49], PointGrid [24], DynamicGCN [37], and SampleNet [23], the progress in developing generative models for 3D point clouds has been lagging. A major challenge in generative modeling of point clouds is that unlike images, videos and volumetric shapes, point clouds are not regular structures but unordered point sets, which makes extending existing paradigms intended for structured data not straightforward. That is why the majority of existing works on 3D generative models are based on volumetric data, e.g., 3D ShapeNet [39], 3D GAN [38], Generative VoxelNet [44, 45], 3D-INN [16], etc. + +With the recent success of a variety of generation tasks such as image generation and video generation, researchers have become increasingly interested in point cloud generation, e.g., [8, 53, 35, 1, 25, 50]. Most of them are based on well-established frameworks of GAN [11] (e.g., [53, 35, 1, 25]), VAE [22] (e.g., [8, 50]), or encoder-decoder with hand-crafted distance metrics, such as Chamfer distance or earth mover's distance [7] for measuring the dissimilarity of two point clouds (e.g., [8, 53]). In this paper, we propose a principled generative model for probabilistic modeling of 3D point clouds. Specifically, the model is a probability density function directly defined on unordered point sets, and it is in the form of a deep energy-based model (EBM) [42] with the energy function parameterized by an input-permutation-invariant bottom-up deep network that is suitable for defining energy on an unordered point + +set. We call the proposed model the Generative PointNet because, following the theory presented in [42], such a model can be derived from the discriminative PointNet [31]. The maximum likelihood estimation (MLE) of our model follows what Grenander [13] called "analysis by synthesis" scheme in pattern theory [12]. Specifically, within each learning iteration, "fake" 3D point cloud examples are generated by Langevin dynamics sampling, which is a gradient-based Markov chain Monte Carlo [26, 3] (MCMC) method, from the current model, and then the model parameters are updated based on the difference between the "fake" examples and the "real" observed examples in order to match the "fake" examples to the "real" observed examples in terms of some permutation-invariant statistical properties defined by the energy function. + +Instead of implicitly modeling the distribution of points as a top-down generator [11, 22] (implicit because the marginal probability density of a generator model requires integrating out the latent noise vector, which is analytically intractable) or indirectly learning the model by an adversarial learning scheme where a discriminator is recruited and simultaneously trained with the generator in a minimax two-player game, or a variational inference scheme where an encoder is used as an inference model to approximate the intractable posterior distribution, we explicitly model this distribution as an EBM and directly learn the model by MCMC-based MLE (as well as its variants) without the aid of any extra network. The MLE, in general, does not suffer from mode collapse and instability issues, which exist in GANs due to the unbalanced joint training of two models. + +Models using encoder-decoders for point cloud generation typically rely on hand-crafted distance metrics to measure the dissimilarity between two point sets. However, the MLE learning of our model corresponds to a statistical matching between the observed and the generated point clouds, where the statistical properties are defined by the derivatives of the energy function with respect to the learning parameters. Therefore, our model does not rely on hand-crafted distance metrics. + +About the learning algorithm, as mentioned above, the MLE learning algorithm follows an "analysis by synthesis" scheme, which iterates the following two steps. Synthesis step: generate the "fake" synthesized examples from the current model. Analysis step: update the model parameters based on the difference between the "real" observed examples and the "fake" synthesized examples. See the recent paper [29] for a thorough investigation of various implementation schemes for learning the EBM. The following are different implementations of the synthesis step. (i) Persistent chain [42], which runs a finite-step MCMC such as Langevin dynamics [27] from the synthesized examples generated from the previous learning iteration. (ii) Contrastive divergence chain [15], which runs a finite step + +MCMC from the observed examples. (iii) Non-persistent short-run MCMC [30], which runs a finite-step MCMC from Gaussian white noise. It is possible to learn an unbiased model using scheme (i), but the learning can be time-consuming. Scheme (ii) learns a biased model that usually cannot generate realistic synthesized examples. (iii) has been recently proposed by [30]. Even though the learned model may still be biased, similar to contrastive divergence, the learning is very efficient, and the short-run MCMC initialized from noise can generate realistic synthesized examples. Moreover, the noise-initialized short-run Langevin dynamics may be viewed as a flow-like model [5, 6, 21] or a generator-like model [11, 22] that transforms the initial noise to the synthesized example. Interestingly, the learned short-run dynamics is capable of reconstructing the observed examples and interpolating different examples, similar to the flow model and the generator model [30]. + +In our work, we adopt the learning scheme (iii). We show that the learned short-run MCMC can generate realistic point cloud patterns, and it can reconstruct observed point clouds and interpolate between point clouds. Moreover, even though it learns a biased model, the learned energy function and features are still useful for classification. + +# 1.2. Related work + +Energy-based modeling and learning. Energy-based generative ConvNets [42] aim to learn an explicit probability distribution of data in the form of the EBM, in which the energy function is parametrized by a modern convolutional neural network and the MCMC sampling is based on Langevin dynamics. Compelling results on learning complex data distributions with the energy-based generative ConvNets [42] have been shown on images [42], videos [47, 48, 14] and 3D voxels [44, 45]. Some alternative sampling strategies to make the training of the models more effective have been studied. For example, [9] proposes a multi-grid method for learning energy-based generative ConvNet models. Cooperative learning or CoopNets [41, 40, 43] trains a generative ConvNet with a generator as an amortized sampler via MCMC teaching. [30] proposes to learn a non-convergent, non-mixing, and non-persistent short-run MCMC, and treats this short-run MCMC as a learned generator model. Recent advances show that the generative ConvNet can be trained with a VAE, e.g., [14, 46] or a flow-based model, e.g., [10, 28]. However, the models in the works mentioned above are only suitable for data with regular structures. Learning EBMs for 3D point clouds, which are unordered point sets, has not been investigated prior to our paper. + +Deep learning for point clouds. Deep learning methods have been successfully applied to point clouds for discriminative tasks including classification and segmentation, such as [31, 32, 52]. PointNet [31] is a pioneering dis + +criminative deep net that directly processes point clouds for classification, by designing permutation invariant network architecture to deal with unordered point sets. As to generative models of point clouds, [8] uses VAEs and [53] uses adversarial auto-encoders with heuristic loss functions measuring the dissimilarity between two point sets, e.g., Chamfer distance (CD) or earth mover's distance (EMD), for the point cloud generation. GANs for point clouds are explored in [25, 1, 35]. For example, [25] and [1] learn a GAN on raw point cloud data, while [25] learns a GAN on the latent space of an auto-encoder that is pre-trained with CD or EMD loss on raw data. [35] proposes to generate point clouds via a GAN with graph convolution that extracts localized information from point clouds. [50] studies point cloud generation using continuous normalizing flows trained with variational inference. Our paper learns an EBM of point clouds via MCMC-based MLE. The proposed model, which we call Generative PointNet (or GPointNet), can be derived from the discriminative PointNet. Our model enables us to get around the complexities of training GANs or VAEs, or the troubles of crafting distance metrics for measuring similarity between two point sets. + +# 1.3. Contributions + +The key contributions of our work are as follows. + +Modeling: We propose a novel EBM to explicitly represent the probability distribution of an unordered point set, e.g., a 3D point cloud, by designing a input-permutation-invariant bottom-up network as the energy function. This is the first generative model that provides an explicit density function for point cloud data. It will shed a new light not only on the area of 3D deep learning but also in the study of unordered set modeling. + +Learning: Under the proposed EBMs, we propose to adopt an unconventional short-run MCMC to learn our model and treat the MCMC as a flow-based generator model, such that it can be used for point cloud reconstruction and generation simultaneously. Usually EBM is unable to reconstruct data. This is the first EBM that can perform point cloud reconstruction and interpolation. + +Uniqueness: Compared with existing point cloud generative models, our model has the following unique properties: (1) It does not rely on an extra assisting network for training; (2) It can be derived from the discriminative PointNet; (3) It unifies synthesis and reconstruction in a single framework; (4) It unifies an explicit density (i.e., EBM) and an implicit density (i.e., short-run MCMC as a latent variable model) of the point cloud in a single framework. + +Performance: Our energy-based framework obtains competitive performance with much fewer parameters compared with the state-of-art point cloud generative models, such as GAN-based and VAE-based approaches, in the tasks of synthesis, reconstruction and classification. + +# 2. Generative PointNet + +# 2.1. Energy-based model for unordered point sets + +Suppose we observe a set of 3D shapes $\{X_{i}, i = 1, \dots, N\}$ from a particular category of objects. Each shape is represented by a set of 3D points $X = \{x_{k}, k = 1, \dots, M\}$ , where each point $x$ is a vector of its 3D coordinate plus optional extra information such as RGB color, etc. In this paper, the points we discuss only contain 3D coordinate information for simplicity. + +We define an explicit probability distribution of shape, each shape itself being a 3D point cloud, by the following energy-based model + +$$ +p _ {\theta} (X) = \frac {1}{Z (\theta)} \exp [ f _ {\theta} (X) ] p _ {0} (X), \tag {1} +$$ + +where $f_{\theta}(X)$ is a scoring function that maps the input $X$ to a score and is parameterized by a bottom-up neural network, $p_0(X) \propto \exp (-||X||^2 /2s^2)$ is the Gaussian white noise reference distribution ( $s$ is a hyperparameter and set to be 0.3 in our paper), $Z(\theta) = \int \exp [f_{\theta}(X)]p_0(X)dX$ is the analytically intractable normalizing constant, which ensures the sum of all the probabilities in the distribution is equal to 1. The energy function $\mathcal{E}_{\theta}(X) = -f_{\theta}(X) + ||X||^{2} / 2s^{2}$ containing parameters $\theta$ defines the energy of the point cloud $X$ , and the point cloud $X$ with a low energy is assigned a high probability. + +Since each point cloud input $X$ is a set of unordered points, the energy function, $\mathcal{E}_{\theta}(X)$ , defined on a point set needs to be invariant to $M!$ permutations of the point set in point feeding order. Because $||X||^2 / 2s^2$ is already naturally invariant to the point permutation, we only need to parameterize $f_{\theta}(X)$ by an input-permutation-invariant bottom-up deep network in order to obtain a proper $\mathcal{E}_{\theta}(X)$ that can handle unordered points. Specifically, we design $f_{\theta}(X)$ by applying a symmetric function on non-linearly transformed points in the set, i.e., $f_{\theta}(\{x_1, \ldots, x_M\}) = g(\{h(x_1), \ldots, h(x_M)\})$ , where $h$ is parameterized by a multi-layer perceptron network and $g$ is a symmetric function, which is an average pooling function followed by a multi-layer perceptron network. The network architecture of the scoring function $f_{\theta}$ is illustrated in Figure 1. Please read the caption for the details of the network. + +# 2.2. Maximum likelihood + +Suppose we observe a collection of 3D point clouds $\mathcal{X} = \{X_{i}, i = 1, \dots, N\}$ from a particular category of object. Let $q_{\mathrm{data}}$ be the distribution that generates the observed examples. The goal of learning $p_{\theta}$ is to estimate the parameter $\theta$ from the observations $\mathcal{X}$ . For a large $N$ , the maximum likelihood estimation of $\theta$ , + +$$ +\max _ {\theta} \left[ \frac {1}{N} \sum_ {i = 1} ^ {N} \log p _ {\theta} (X _ {i}) \right] \approx \max _ {\theta} \operatorname {E} _ {q _ {\mathrm {d a t a}}} [ \log p _ {\theta} (X) ] +$$ + +![](images/19afb816d98bc43e75caecea17050bace09d4d1e2189aba1c76734cbd371f521.jpg) +Figure 1: Architecture of the scoring function of the Generative PointNet. The scoring function $f_{\theta}(X)$ is an input-permutation-invariant bottom-up deep network, which takes $n$ unordered points as input, encodes each point into features by multilayer perceptron (MLP) with numbers of channels 64, 128, 256, 512 and 1,024 at each layer respectively, and then aggregates all point features to a global feature by average pooling, and eventually outputs scalar energy by multilayer perceptron with numbers of channels 512, 256, 64 and 1 at each layer respectively. Layer Normalization [2] is used with ReLU for layers before average pooling, while only ReLU is used for layers after average pooling. + +is equivalently to minimize the Kullback-Leibler (KL)-divergence $\mathrm{KL}(q_{\mathrm{data}}||p_{\theta})$ over $\theta$ , where the KL divergence is defined as $\mathrm{KL}(q|p) = \operatorname{E}_q[\log (q(x) / p(x))]$ . We can update $\theta$ by gradient ascent. The gradient of the log-likelihood or, equivalently, the negative KL divergence is computed by + +$$ +\begin{array}{l} - \frac {\partial}{\partial \theta} \mathrm {K L} \left(q _ {\text {d a t a}} (X) \| p _ {\theta} (X)\right) \\ = \mathrm {E} _ {q _ {\text {d a t a}}} \left[ \frac {\partial}{\partial \theta} f _ {\theta} (X) \right] - \mathrm {E} _ {p _ {\theta}} \left[ \frac {\partial}{\partial \theta} f _ {\theta} (X) \right] (2) \\ \approx \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ \frac {\partial}{\partial \theta} f _ {\theta} \left(X _ {i}\right) \right] - \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ \frac {\partial}{\partial \theta} f _ {\theta} \left(\tilde {X} _ {i}\right) \right], (3) \\ \end{array} +$$ + +where $\{\tilde{X}_i,i = 1,\dots,n\}$ are $n$ point clouds generated from the current distribution $p_{\theta}$ by an MCMC method, such as Langevin dynamics. Eq.(3) refers to the MCMC approximation of the analytically intractable gradient due to the intractable expectation term $\mathrm{E}_{p_\theta}[\cdot ]$ in Eq.(2), and leads to the mini-batch "analysis by synthesis" learning algorithm. At iteration $t$ we randomly sample a batch of observed examples from the training data set $\{X_{i},i = 1,\ldots ,n\} \sim q_{\mathrm{data}}$ and generate a batch of synthesized examples from the current distribution $\{\tilde{X}_i,i = 1,\dots,n\} \sim p_\theta$ by MCMC sampling. Then we compute the gradient $\Delta (\theta_t)$ according to Eq.(3) and update the model parameter $\theta$ by $\theta_{t + 1} = \theta_t + \gamma_t\Delta (\theta_t)$ with a learning rate $\gamma_{t}$ + +# 2.3. MCMC sampling with Langevin dynamics + +To sample point clouds from the distribution $p_{\theta}(X)$ by Langevin dynamics, we iterate the following step: + +$$ +X _ {\tau + 1} = X _ {\tau} - \frac {\delta^ {2}}{2} \frac {\partial}{\partial X} \mathcal {E} _ {\theta} (X _ {\tau}) + \delta U _ {\tau}, \tag {4} +$$ + +where $\tau$ indexes the time step, $\delta$ is the step size, and $U_{\tau} \sim \mathcal{N}(0, I)$ is the Gaussian white noise. Since $f_{\theta}$ is a differentiable function, the term of gradient of $\mathcal{E}_{\theta}(X_{\tau})$ with respect + +to $X$ can be efficiently computed via back-propagation. As to MCMC initialization, the following are three options. (1) Initialize long-run non-persistent MCMC from noise point clouds. (2) Initialize persistent MCMC from noise point clouds, and within each subsequent learning iteration, run a finite-step MCMC starting from the synthesized point cloud generated in the previous learning iteration. (3) Following Contrastive Divergence [15], one may initialize the MCMC from the training examples sampled from the training data set within each learning iteration. + +# 3. Short-run MCMC as generator model + +Learning $p_{\theta}$ requires MCMC sampling to generate synthesized point clouds. The learned $p_{\theta}$ is multi-modal because $p_{data}$ is usually multi-modal, which is due to the complexity of the point cloud patterns and the large scale of the data set. The property of multimodality is likely to cause different MCMC chains to get trapped by the local modes. Thus the MCMC sampling of $p_{\theta}$ may take a long time to mix, regardless of the initial distribution and the length of the Markov chain. Following the recent work on learning EBM [30], instead of running a long-run convergent MCMC to sample from $p_{\theta}$ , we only run non-convergent, non-persistent short-run MCMC toward $p_{\theta}$ for a fixed number of steps $K$ , starting from a fixed initial distribution, such as Gaussian white noise distribution $p_0$ . + +We use $M_{\theta}$ to denote the transition kernel of the $K$ steps of MCMC toward $p_{\theta}(X)$ . For a given initial probability distribution $p_0$ , the resulting marginal distribution of the sample $X$ after running $K$ steps of MCMC starting from $p_0$ is denoted by + +$$ +q _ {\theta} (X) = M _ {\theta} p _ {0} (X) = \int p _ {0} (Z) M _ {\theta} (X | Z) d Z \tag {5} +$$ + +Since $q_{\theta}(X)$ is not convergent, the $X$ is highly dependent to $Z$ . $q_{\theta}(X)$ can be considered a generator model, a + +![](images/20416f007637cfc2acd23b0f0cf4262edf6d4d3194743159cf1248e372d48ab2.jpg) +Figure 2: Generating 3D point clouds of objects. Each row shows one experiment, where the first three point clouds are three examples randomly selected from the training set. The rest are synthesized point clouds sampled from the short-run Langevin dynamics. The number of points in each example is 2,048. From top to bottom: chair, toilet, table, and bathtub. + +![](images/8b6c56dd2d9a871b03db5ed235d9918fce84ff9f919d66489ae1079b378cad75.jpg) + +flow-based model, or a latent variable model with $Z$ being the continuous latent variables in the following form + +$$ +X = M _ {\theta} (Z, \xi), Z \sim p _ {0} (Z), \tag {6} +$$ + +where $Z$ and $X$ have the same number of dimensions, and $Z$ follows a known prior (Gaussian) distribution $p_0$ . $M_{\theta}$ is a short-run Langevin dynamics including $K$ Langevin steps in Eq.(4), which can be considered a $K$ -layer residual network with noise injected into each layer and weight sharing at each layer. Let $\xi$ be all the randomness in $M_{\theta}$ due to the layer-wise injected noise. The model represented by a short-run MCMC shown in Eq.(6) can be trained by the "analysis by synthesis" scheme, where we update $\theta$ according to Eq.(3) and synthesize $\{\tilde{X}\}$ according to Eq.(6). Training $\theta$ with a short-run MCMC is no longer a maximum likelihood estimator but a moment matching estimator (MME) that solves the following estimating equation + +$$ +\mathrm {E} _ {q _ {\text {d a t a}}} \left[ \frac {\partial}{\partial \theta} f _ {\theta} (X) \right] = \mathrm {E} _ {p _ {\theta}} \left[ \frac {\partial}{\partial \theta} f _ {\theta} (X) \right]. \tag {7} +$$ + +Even though the learned $p_{\theta}$ based on short-run MCMC is $p_{\hat{\theta}_{\mathrm{MEE}}}$ rather than $p_{\hat{\theta}_{\mathrm{MLE}}}$ , the $q_{\hat{\theta}_{\mathrm{MEE}}}$ is still a valid generator that is useful for 3D point cloud generation and reconstruction. As to reconstruction, given a testing 3D point cloud $X$ , we can reconstruct $X$ by finding $Z$ to minimize the reconstruction error $L(Z) = \| X - M_{\theta}(Z)\|^{2}$ , where $M_{\theta}(Z)$ is a noise-disabled version of $M_{\theta}(Z,\xi)$ (after learning, the noise term is negligible compared to the gradient term). This can be easily achieved by running gradient descent on $L(Z)$ , with $Z$ initialized from $Z_0 \sim p_0$ . Even though we abandon $p_{\theta}$ in Eq.(1) and keep $q_{\theta}$ in Eq.(5) eventually, $p_{\theta}$ is crucial because $q$ is derived from $p$ and we learn $q$ under $p$ . In other works, $p$ serves as an incubator of $q_{\hat{\theta}_{\mathrm{MEE}}}$ . + +When the model $p_{\theta}$ is learned from a large scale data set and only a limited budge of MCMC can be affordable, + +learning a short-run MCMC as a generator model toward $p_{\theta}$ for point cloud generation and construction will be a tradeoff between MCMC efficiency and MLE accuracy. + +The learning method based on noise-initialized short-run MCMC is similar to contrastive divergence [15], which initializes a finite-step MCMC from each observed example within each learning iteration. Contrastive divergence also learns a bias model, but the learned model is usually incapable of synthesis, much less reconstruction and interpolation. For noise-initialized short-run Langevin, it is possible to optimize tuning parameters such as step size $\delta$ to minimize the bias caused by short-run MCMC. Also, the learning algorithm of our model seeks to match the expectations of $\Phi_{\theta}(X) = \frac{\partial}{\partial\theta} f_{\theta}(X)$ over the observed data and synthesized data. In the recent literature on the theoretical understanding of deep neural networks, the expectation of $\langle \Phi_{\theta}(X),\Phi_{\theta}(X^{\prime})\rangle$ , where the expectation is with respect to the random initialization of $\theta$ , is called the neural tangent kernel [17], and it plays a central role in understanding the optimization and generalization of deep and wide networks. It is possible to define a metric based on such a kernel. We shall study these issues in our future work. + +# 4. Experiments + +We conduct experiments to test the proposed GPointNet model for point cloud modeling on a variety of tasks below. The code and more results can be found at: http://www.stat.ucla.edu/~jxie/GPointNet. + +# 4.1. Synthesis + +We evaluate our model for 3D point cloud synthesis on the ModelNet10, a 10-category subset of ModelNet [39] which is commonly used as a benchmark for 3D object analysis. We first create a point cloud dataset by sampling points uniformly from the mesh surface of each object in the Mod + +
ModelJSD (↓)MMD (↓)Coverage (↑)
CDEMDCDEMD
night standr-GAN2.6791.1632.39450.0038.37
l-GAN1.0000.7461.56344.1939.53
PointFlow0.2400.8881.45155.8139.53
Ours0.5900.6921.14859.3061.63
Training Set0.2630.7931.09660.4052.32
toiletr-GAN3.1802.9952.89117.0016.00
l-GAN1.2531.2581.48121.0028.00
PointFlow0.3620.9651.51339.0033.00
Ours0.3860.8161.26544.0037.00
Training Set0.2490.8231.11648.0051.00
monitorr-GAN2.9361.5242.02121.0024.00
l-GAN1.6530.9151.34928.0027.00
PointFlow0.3260.8311.28837.0032.00
Ours0.7800.8031.21340.0038.00
Training Set0.2830.5540.93848.0053.00
chairr-GAN2.7721.7092.16423.0028.00
l-GAN1.3581.4191.48023.0026.00
PointFlow0.2780.9651.32242.0051.00
Ours0.5630.8891.28056.0057.00
Training Set0.3650.8581.19054.0059.00
bathroomr-GAN3.0142.4782.53626.0030.00
l-GAN0.9280.8651.32432.0038.00
PointFlow0.3500.5931.32050.0044.00
Ours0.4600.6601.10858.0050.00
Training Set0.3440.6520.98056.0052.00
+ +
ModelJSD (↓)MMD (↓)Coverage (↑)
CDEMDCDEMD
sofar-GAN1.8662.0372.24713.0023.00
l-GAN0.6810.6311.02843.0044.00
PointFlow0.2440.5851.31334.0033.00
Ours0.6470.5471.08939.0045.00
Training Set0.1850.4670.90456.0056.00
bedr-GAN1.9731.2502.44127.0021.00
l-GAN0.6460.5390.99248.0044.00
PointFlow0.2190.5441.23050.0035.00
Ours0.4610.5521.00450.0050.00
Training Set0.1690.5160.92757.0055.00
tabler-GAN3.8013.7142.6258.0014.00
l-GAN4.2541.2322.16614.009.00
PointFlow1.0441.6301.53516.0029.00
Ours0.8690.6401.00044.0037.00
Training Set0.7031.2181.18231.0038.00
deskr-GAN3.5752.7123.67822.0922.09
l-GAN2.2331.1392.34538.3725.58
PointFlow0.3271.2541.54838.3746.51
Ours0.4541.2231.56756.9852.33
Training Set0.3291.0551.33253.4850.00
dresserr-GAN1.7261.2991.67536.0530.23
l-GAN0.6480.6421.01045.3543.02
PointFlow0.2700.7151.34946.5137.21
Ours0.4570.4850.98853.4952.33
Training Set0.2150.5510.88256.9854.65
+ +elNet10 dataset, and then scale them into a range of [-1,1]. We train one single model for each category of point clouds. The number of training examples in each category ranges from 100 to 900. Each point cloud contains 2,048 points. + +The network structure of the scoring function $f_{\theta}(X)$ is visualized in Figure 1. It first encodes each 3-dimensional point coordinate in Euclidean space to a 1,024-dimensional + +Table 1: Comparison of quality of point cloud synthesis on the ModelNet10. ↓: the lower the better, ↑: the higher the better. MMD-CD scores are multiplied by 100; MMD-EMD scores and JSDs are multiplied by 10. + +
ModelCategoryCDEMDCategoryCDEMD
Oursnight stand0.3780.685sofa0.4270.703
PointFlow0.4640.9900.3890.888
Ourstoilet0.3960.708bed0.3610.670
PointFlow0.4560.9920.3720.914
Oursmonitor0.3710.705table0.3180.621
PointFlow0.4410.9570.5811.008
Ourschair0.3370.719desk0.3910.697
PointFlow0.5101.0280.5001.063
Oursbathtub0.3210.612dresser0.3290.645
PointFlow0.2890.8250.4150.942
+ +Table 2: Comparison of performance in reconstruction on the ModelNet10. CD scores are multiplied by 100 and EMD scores are multiplied by 10. The lower the better. + +point feature by an MLP, then uses an average pooling layer to aggregate information from all the points to a single 1,024-dimensional global point cloud feature, and maps it to the score by another MLP. The scoring function is input-permutation-invariant because the MLP for point encoding is shared by all unordered points and also the output of the symmetric function, which is an average pooling layer followed by an MLP, is not affected by the point feeding order. + +We use Adam [20] for optimization with an initial learning rate 0.005, $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ . We decay the learning rate by 0.985 for every 50 iterations. The minibatch size is 128. The number of paralleled MCMC chains is 128. We run $K = 64$ Langevin steps, with the step size $\delta = 0.005$ . To avoid exploding gradients in MCMC, we clip the gradient values to a range [-1,1] at each Langevin step. We run 2,000 iterations for training. To further improve training, we inject additive Gaussian noises with stand deviation 0.01 to the observed examples at each iteration. + +To quantitatively evaluate the performance of generative models of point clouds, we adopt three metrics that are also used in [1, 50], i.e., Jensen-Shannon Divergence (JSD), Coverage (COV) and Minimum Matching Distance (MMD). When evaluating COV and MMD, two point + +![](images/c7339333dc030fb3a414b669f9d0030765e17a3fbc9877ddb632e355aa0ac92a.jpg) +Figure 3: Point cloud reconstruction. A short-run MCMC as a generator is learned from chair, table, toilet and bathtub, respectively. The learned generator is applied to reconstruction by inferring the latent $Z$ to minimize the reconstruction error. + +![](images/e7d0a39df9d002d663da94b40cac52f4f78e3cf4f0230aeb1c9a04f275964565.jpg) +Figure 4: Point cloud interpolation between the generated examples at two ends. The transition in each row displays the sequence of $M_{\theta}(Z_{\rho})$ with the linear interpolated latent variable $Z_{\rho} = \rho Z_{1} + (1 - \rho)Z_{2}$ , where $\rho \in [0,1]$ . The left and right point clouds are $M_{\theta}(Z_{1})$ and $M_{\theta}(Z_{2})$ , respectively. + +
MethodFullGeneration
r-GAN7.226.91
l-GAN1.971.71
PointFlow1.611.06
Ours1.39
+ +Table 3: A comparison of model sizes. Our method has only one network for both learning and generation.(Million) + +
MethodAccuracy
SPH [18]79.8%
LFD [4]79.9%
PANorama-NN [33]91.1%
VConv-DAE [34]80.5%
3D-GAN [38]91.0%
3D-WINN [16]91.9%
3D-DescriptorNet [44]92.4%
Primitive GAN [19]92.2%
FoldingNet [51]94.4%
1-GAN [1]95.4%
PointFlow [50]93.7%
Ours93.7%
+ +Table 4: A comparison of accuracy of 3D object classification on the 10-category ModelNet10 dataset. + +clouds are measured by either Chamfer distance (CD) or earth mover's distance (EMD). We compare our model with some baseline generative models for point clouds, including PointFlow [50], l-GAN, and r-GAN, in Table 1. We report the performance of the baselines using their official codes. Figure 2 displays some examples of point clouds generated by our model for categories chair, toilet, table, and bathtub. + +# 4.2. Reconstruction + +We demonstrate the reconstruction ability of the GPoint-Net model for 3D point clouds. We learn our model with a short-run MCMC as a generator. Given a testing point cloud object, we reconstruct it with the learned generator by minimizing the reconstruction error as we discussed in Section 3. Figure 3 displays some examples of reconstructing unobserved examples. The first row displays the original point clouds to reconstruct, the second row shows the corresponding reconstructed point clouds obtained by the learned model, and the third row shows the results obtained by a baseline, PointFlow [50], which is a VAE-based framework. For VAE, the reconstruction can be easily achieved by first inferring the latent variables of the input example and then mapping the inferred latent variables back to the point cloud space via the generator. Table 2 shows a quantitative comparison of our method with PointFlow for point cloud reconstruction. CD and EMD metrics are adopted to + +measure the quality of the reconstruction. On the whole, our method outperforms the baseline. + +As to model complexity, we also compare the numbers of parameters of different models in Table 3. Due to the usage of extra networks in learning, models based on GAN and VAE have different sizes of parameters in training and generation stages. Our model does not use an auxiliary network, thus it has less parameters. + +# 4.3. Interpolation + +We demonstrate the interpolation ability of our model. We learn the model with short-run MCMC. We first sample two noise point clouds $Z_{1}$ and $Z_{2}$ from Gaussian distribution as two samples from the latent space. Then we perform linear interpolation in the latent space $Z_{\rho} = (1 - \rho)\cdot Z_{1} + \rho \cdot Z_{2}$ , with $\rho$ discretized into 8 values within [0,1]. We generate point clouds by $X_{\rho} = M_{\theta}(Z_{\rho})$ . Figure 4 shows two results of interpolation between $Z_{1}$ and $Z_{2}$ by showing the sequences of generated point clouds $\{X_{\rho}\}$ . Smooth transition and physically plausible intermediate generated examples suggest that the generator learns a smooth latent space for point cloud embedding. + +# 4.4. Representation learning for classification + +The learned point encoder $h(x)$ in the scoring function $f_{\theta}(X)$ can be useful for point cloud feature extraction, and + +the features can be applied to supervised learning. We evaluate $h$ by performing a classification experiment on the ModelNet10 dataset. We first train a single GPointNet on the training examples from all categories in an unsupervised manner. The network $f_{\theta}(X)$ is the same as the one used in the previous sections, except that we add one layer with 2,048 channels before the average pooling and one layer with 1,024 channels after the average pooling. We replace the average pooling layer by a max-pooling layer in the learned scoring function and use the output of the max-pooling as point cloud features. Such a point cloud feature extractor is also permutation-invariant. We train an SVM [36] classifier from labeled data based on the extracted features for classification. We evaluate the classification accuracy of the SVM on the testing data using the one-versus-all rule. Table 4 reports 11 published results on this dataset obtained by other baselines. Our method is on a par with other methods in terms of classification accuracy on this dataset. + +We conduct experiments to test the robustness of the classifier. We consider the following three types of data corruptions: (1) Type 1: missing points, where we randomly delete points from each point cloud. (2) Type 2: added points, where we add extra points that are uniformly distributed in the cube $[-1,1]^3$ into each point cloud. (3) Type 3: point perturbation, where we perturb each point of each point cloud by adding a Gaussian noise. We report classification accuracy of the classifier on the corrupted version of ModelNet10 test set. Figure 5 shows the results. The classification performance decreases as the corruption level (e.g., missing point ratio, added point ratio, and standard deviation of point perturbation) increases. In the case of missing points, even though $94\%$ points are deleted in each testing example, the classifier can still perform with an accuracy $90.20\%$ . In the extreme case where we only keep 20 points $(1\%)$ in each point cloud, the accuracy becomes $53.19\%$ . + +![](images/47e75de5aab47eed13407e3c792cc9b832a0aedd4f9f7a2758e24c4a1fb1d702.jpg) +Figure 5: Robustness Test. The model is tested on Model-Net10 test set with three types of point corruptions. Classification accuracies are reported across different levels of corruptions. Left: missing points. Middle: added points. Right: point perturbation. + +# 4.5. Visualization of point encoding function + +The scoring function learns a coordinate encoding of each point and then aggregates all individual point codes into a score for the point set. The coordinate encoding function is implemented by an MLP, learning to encode each + +3-dimensional point to a 2,048-dimensional vector in the model that we use for classification. To better understand what each encoding function learns, we visualize each filter at different layers of the MLP by showing the points in the point cloud domain that give positive filter responses. In Figure 6, we randomly visualize 4 filters at each layer. The results suggest that different filters at different layers learn to detect points in different shapes of regions. Filters at a higher layer usually detect points in regions with more complicated shapes than those at a lower layer. + +![](images/345077a50e533a6acbd4416e33d82a0c7b595168ee98fe609a10be24962304d6.jpg) +Figure 6: Visualization of point encoding functions. The point encoding function is implemented by a MLP. Each filter at different layers of the MLP is visualized by showing the points that have positive filter responses. Four filters randomly selected at each layer are visualized. + +# 5. Conclusion + +This paper studies the deep energy-based modeling and learning of unordered 3D point clouds. We propose a probability density of 3D point clouds, which is unordered point sets, in the form of the energy-based model where the energy function is parameterized by an input-permutation-invariant deep neural network. The model can be trained via MCMC-based maximum likelihood learning, without the need of recruiting any other assisting network. The learning process follows "analysis by synthesis" scheme. Experiments show that the model can be useful for 3D generation, reconstruction, interpretation, and classification. + +# Acknowledgment + +The work is supported by NSF DMS-2015577, DARPA XAI project N66001-17-2-4029, ARO project W911NF1810296, ONR MURI project N00014-16-1-2007, and XSEDE grant ASC180018. We thank Erik Ni-jkamp for insightful discussions about short-run MCMC for EBM and neural tangent kernel. + +# 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 (ICML), pages 40-49, 2018. 1, 3, 6, 7 +[2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 4 +[3] Adrian Barbu and Song-Chun Zhu. Monte Carlo Methods. Springer, 2020. 2 +[4] Ding-Yun Chen, Xiao-Pei Tian, Yu-Te Shen, and Ming Ouhyoung. On visual similarity based 3d model retrieval. In Computer Graphics Forum, volume 22, pages 223–232. Wiley Online Library, 2003. 7 +[5] Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: non-linear independent components estimation. In Yoshua Bengio and Yann LeCun, editors, International Conference on Learning Representations (ICLR) Workshop, 2015. 2 +[6] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In International Conference on Learning Representations (ICLR), 2017. 2 +[7] Haoqiang Fan, Hao Su, and Leonidas J Guibas. A point set generation network for 3D object reconstruction from a single image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 605-613, 2017. 1 +[8] Matheus Gadelha, Rui Wang, and Subhransu Maji. Multiresolution tree networks for 3D point cloud processing. In European Conference on Computer Vision (ECCV), pages 103-118, 2018. 1, 3 +[9] Ruiqi Gao, Yang Lu, Junpei Zhou, Song-Chun Zhu, and Ying Nian Wu. Learning generative ConvNets via multi-grid modeling and sampling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 9155-9164, 2018. 2 +[10] Ruiqi Gao, Erik Nijkamp, Diederik P Kingma, Zhen Xu, Andrew M Dai, and Ying Nian Wu. Flow contrastive estimation of energy-based models. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7518-7528, 2020. 2 +[11] 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 (NIPS), pages 2672–2680, 2014. 1, 2 +[12] Ulf Grenander. A unified approach to pattern analysis. In Advances in Computers, volume 10, pages 175-216. Elsevier, 1970. 2 +[13] Ulf Grenander and Michael I Miller. Pattern Theory: From Representation to Inference. Oxford University Press, 2007. 2 +[14] Tian Han, Erik Nijkamp, Xiaolin Fang, Mitch Hill, Song-Chun Zhu, and Ying Nian Wu. Divergence triangle for joint training of generator model, energy-based model, and inferential model. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8670-8679, 2019. 2 +[15] Geoffrey E Hinton. Training products of experts by minimizing contrastive divergence. Neural Computation, 14(8):1771-1800, 2002. 2, 4, 5 + +[16] Wenlong Huang, Brian Lai, Weijian Xu, and Zhuowen Tu. 3D volumetric modeling with introspective neural networks. In The Thirty-Third AAAI Conference on Artificial Intelligence (AAAI), pages 8481-8488, 2019. 1, 7 +[17] Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 8571-8580, 2018. 5 +[18] Michael Kazhdan, Thomas Funkhouser, and Szymon Rusinkiewicz. Rotation invariant spherical harmonic representation of 3D shape descriptors. In Symposium on Geometry Processing, volume 6, pages 156-164, 2003. 7 +[19] Salman H Khan, Yulan Guo, Munawar Hayat, and Nick Barnes. Unsupervised primitive discovery for improved 3d generative modeling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 9739-9748, 2019. 7 +[20] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. 6 +[21] Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems (NIPS), pages 10215-10224, 2018. 2 +[22] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR), 2014. 1, 2 +[23] Itai Lang, Asaf Manor, and Shai Avidan. Samplenet: differentiable point cloud sampling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7578-7588, 2020. 1 +[24] Truc Le and Ye Duan. Pointgrid: A deep network for 3d shape understanding. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 9204-9214, 2018. 1 +[25] Chun-Liang Li, Manzil Zaheer, Yang Zhang, Barnabas Poc-zos, and Ruslan Salakhutdinov. Point cloud GAN. arXiv preprint arXiv:1810.05795, 2018. 1, 3 +[26] Jun S Liu. Monte Carlo Strategies in Scientific Computing. Springer Science & Business Media, 2008. 2 +[27] Radford M Neal et al. MCMC using hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 2(11):2, 2011. 2 +[28] Erik Nijkamp, Ruiqi Gao, Pavel Sountsov, Srinivas Vasudevan, Bo Pang, Song-Chun Zhu, and Ying Nian Wu. Learning energy-based model with flow-based backbone by neural transport mcmc. arXiv preprint arXiv:2006.06897, 2020. 2 +[29] Erik Nijkamp, Mitch Hill, Tian Han, Song-Chun Zhu, and Ying Nian Wu. On the anatomy of MCMC-based maximum likelihood learning of energy-based models. In The Thirty-Fourth AAAI Conference on Artificial Intelligence (AAAI), pages 5272-5280, 2020. 2 +[30] Erik Nijkamp, Mitch Hill, Song-Chun Zhu, and Ying Nian Wu. Learning non-convergent non-persistent short-run MCMC toward energy-based model. In Advances in Neural Information Processing Systems (NeurIPS), pages 5233-5243, 2019. 2, 4 + +[31] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3D classification and segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 652-660, 2017. 1, 2 +[32] 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 (NIPS), pages 5099-5108, 2017. 1, 2 +[33] Konstantinos Sfikas, Theoharis Theoharis, and Ioannis Pratikakis. Exploiting the PANorama representation for convolutional neural network classification and retrieval. In 10th Eurographics Workshop on 3D Object Retrieval, 2017. 7 +[34] Abhishek Sharma, Oliver Grau, and Mario Fritz. VConvDAE: Deep volumetric shape learning without object labels. In European Conference on Computer Vision (ECCV), pages 236-250. Springer, 2016. 7 +[35] Diego Valsesia, Giulia Fracastoro, and Enrico Magli. Learning localized generative models for 3D point clouds via graph convolution. In International Conference on Learning Representations (ICLR), 2019. 1, 3 +[36] Vladimir Vapnik. The Nature of Statistical Learning Theory. Springer, 2000. 8 +[37] 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. 1 +[38] 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 (NIPS), pages 82–90, 2016. 1, 7 +[39] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3D shapenets: A deep representation for volumetric shapes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1912-1920, 2015. 1, 5 +[40] Jianwen Xie, Yang Lu, Ruiqi Gao, and Ying Nian Wu. Cooperative learning of energy-based model and latent variable model via MCMC teaching. In Thirty-Second AAAI Conference on Artificial Intelligence (AAAI), pages 4292–4301, 2018. 2 +[41] Jianwen Xie, Yang Lu, Ruiqi Gao, Song-Chun Zhu, and Ying Nian Wu. Cooperative training of descriptor and generator networks. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 42(1):27-45, 2020. 2 +[42] Jianwen Xie, Yang Lu, Song-Chun Zhu, and Yingnian Wu. A theory of generative ConvNet. In International Conference on Machine Learning (ICML), pages 2635-2644, 2016. 1, 2 +[43] Jianwen Xie, Zilong Zheng, Xiaolin Fang, Song-Chun Zhu, and Ying Nian Wu. Cooperative training of fast thinking initializer and slow thinking solver for conditional learning. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2021. 2 +[44] 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 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8629-8638, 2018. 1, 2, 7 +[45] Jianwen Xie, Zilong Zheng, Ruiqi Gao, Wenguan Wang, Song-Chun Zhu, and Ying Nian Wu. Generative VoxelNet: learning energy-based models for 3D shape synthesis and analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2020. 1, 2 +[46] Jianwen Xie, Zilong Zheng, and Ping Li. Learning energy-based model with variational auto-encoder as amortized sampler. In The Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI), 2021. 2 +[47] Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Synthesizing dynamic patterns by spatial-temporal generative ConvNet. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7093-7101, 2017. 2 +[48] Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Learning energy-based spatial-temporal generative ConvNets for dynamic patterns. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 43(2):516-531, 2021. 2 +[49] Saining Xie, Sainan Liu, Zeyu Chen, and Zhuowen Tu. Attentional shapecontextnet for point cloud recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4606-4615, 2018. 1 +[50] Guandao Yang, Xun Huang, Zekun Hao, Ming-Yu Liu, Serge Belongie, and Bharath Hariharan. PointFlow: 3D point cloud generation with continuous normalizing flows. In IEEE International Conference on Computer Vision (ICCV), pages 4541-4550, 2019. 1, 3, 6, 7 +[51] Yaoqing Yang, Chen Feng, Yiru Shen, and Dong Tian. Foldingnet: Point cloud auto-encoder via deep grid deformation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 206–215, 2018. 7 +[52] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems (NIPS), pages 3391-3401, 2017. 1, 2 +[53] Maciej Zamorski, Maciej Zięba, Rafat Nowak, Wojciech Stokowiec, and Tomasz Trzeciński. Adversarial autoencoders for generating 3D point clouds. arXiv preprint arXiv:1811.07605, 2018. 1, 3 \ No newline at end of file diff --git a/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/images.zip b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e55f7e03bb5721b37457b9e42e131c509df86b5f --- /dev/null +++ b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:158746d695a99a99ad446d0d4caf7e4bfa19634c54e439a78f30769679eb4b86 +size 593010 diff --git a/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/layout.json b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..bd4048ace91f65f72c1dfd5695c4979cf800054a --- /dev/null +++ b/generativepointnetdeepenergybasedlearningonunorderedpointsetsfor3dgenerationreconstructionandclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee83a3165c4409bbc8091f0492e011b6c355cff35cbebec922d59be7dfa08ceb +size 414601 diff --git a/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_content_list.json b/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..480b0cac480493c6a0fe4a493943bade6adece45 --- /dev/null +++ b/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05232604f24c761ea3ebf28c1ee407be02408f39de611e581d718d2cea170360 +size 73906 diff --git a/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_model.json b/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bd0d6981379c7306083ec3d0fa11e76625a7e5da --- /dev/null +++ b/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a9a5f1106f1c06182f63ed203ed47521db61f76c9806b219ad47845549a2ab8 +size 89136 diff --git a/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_origin.pdf b/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..885473e93b41230cb5aa50b5804aa20aa81fb351 --- /dev/null +++ b/genericperceptuallossformodelingstructuredoutputdependencies/116bd2ff-f11d-4286-beac-37874207c453_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c0fdfbd7e6eeb156927af6d2109242fdbf804023f1431521523452bcc907ab5 +size 835981 diff --git a/genericperceptuallossformodelingstructuredoutputdependencies/full.md b/genericperceptuallossformodelingstructuredoutputdependencies/full.md new file mode 100644 index 0000000000000000000000000000000000000000..14cb2b01ef3f5141aa058f1ff380ff71ddb746a0 --- /dev/null +++ b/genericperceptuallossformodelingstructuredoutputdependencies/full.md @@ -0,0 +1,292 @@ +# Generic Perceptual Loss for Modeling Structured Output Dependencies + +Yifan Liu $^{1}$ , Hao Chen $^{1}$ , Yu Chen $^{2}$ , Wei Yin $^{1}$ , Chunhua Shen $^{1,3*}$ $^{1}$ The University of Adelaide + $^{2}$ Automind + $^{3}$ Monash University, Australia + +# Abstract + +The perceptual loss has been widely used as an effective loss term in image synthesis tasks including image superresolution [16], and style transfer [14]. It was believed that the success lies in the high-level perceptual feature representations extracted from CNNs pretrained with a large set of images. Here we reveal that, what matters is the network structure instead of the trained weights. Without any learning, the structure of a deep network is sufficient to capture the dependencies between multiple levels of variable statistics using multiple layers of CNNs. This insight removes the requirements of pre-training and a particular network structure (commonly, VGG) that are previously assumed for the perceptual loss, thus enabling a significantly wider range of applications. To this end, we demonstrate that a randomly-weighted deep CNN can be used to model the structured dependencies of outputs. On a few dense per-pixel prediction tasks such as semantic segmentation, depth estimation and instance segmentation, we show improved results of using the extended randomized perceptual loss, compared to the baselines using pixel-wise loss alone. We hope that this simple, extended perceptual loss may serve as a generic structured-output loss that is applicable to most structured output learning tasks. + +# 1. Introduction + +Dense pixel-wise prediction tasks represent the most important category of computer vision problems, ranging from low-level image processing such as denoising, superresolution, through mid-level tasks such as stereo matching, to high-level understanding such as semantic/instance segmentation. These tasks are naturally structured output learning problems since the prediction variables often depend on each other. The pixel-wise loss serves as the unary term for these tasks. Besides, the perceptual loss [14] was introduced to capture perceptual information by measuring discrepancy in high-level convolutional features extracted from CNNs. It has been successfully used in various low- + +level image processing tasks, such as style transfer, and super-resolution [14]. + +Previous works assume that the perceptual loss benefits from the high-level perceptual features extracted from CNNs pretrained with a large set of images (e.g., VGG [23] pretrained on the ImageNet dataset. Relying on this assumption, the perceptual loss is limited to a specific network structure (commonly, VGG) with pre-trained weights, which is not able to take arbitrary signals as the input. In this work, we reveal that, contrary to this belief, the success of the perceptual loss is not necessarily dependent on the ability of a pretrained CNN in extracting high-level perceptual features. Instead, without any learning, the structure of a multi-layered CNN is sufficient to capture a large amount of interaction statistics for various output forms. We argue that what matters is the deep network architecture rather than the pretrained weights. + +To verify the statement, we conduct a pilot experiment on image super-resolution. Apart from using the pretrained VGG net for perceptual loss, we use a randomly-weighted network. The results with the randomly-weighted network are on par with that of the pretrained VGG, which are both visually improved than using the per-pixel loss alone (see Figure 1). This indicates that the pretrained weights—previously assumed for the perceptual loss—is not essential to the success of the perceptual loss. We may conclude from this experiment that it is the deep network structure, rather than learnt weights, plays the core role. + +Given a target $y$ or a prediction $\hat{y}$ as an input, a randomly-weighted network $f(\cdot)$ can work as a function to explore hierarchical dependencies between variable statistics through the convolution operations in multiple layers. Thus, a generic perceptual loss for structured output learning can be computed by comparing the discrepancy between $f^{j}(y)$ and $f^{j}(\hat{y})$ . Here $j$ indexes a particular layer of the network $f(\cdot)$ . Thus, this enables the perceptual loss1 to be applied to a wider range of structured output learning tasks. + +Structured information is important in dense per-pixel prediction problems, such as semantic segmentation [17], + +![](images/ae115e734a0a68037a20bd55942257ed5f71858146e0855c4518cee42aaa221f.jpg) +(a) Ground Truth + +![](images/918f6d3758ba91993dd49e6f5a10f547570220153f6ab8383198277f3998e865.jpg) +(b) Bicubic + +![](images/6a326ce51a4e972ac267e2bdd669edeff035e9c3c6d5f2f3720bcd23077a25d8.jpg) +(c) Pixel-wise Loss alone [16] + +![](images/12dc9e791d521b1971c59f7795913cf867bb688a24823333ab6c182c8ed5e373.jpg) +(d) w. Pretrained VGG [16] +Figure 1 - Super-resolution results of the pilot experiments (super-resoled from $4\times$ down-scaled images). (a) Ground truth highresolution images. (b) Bi-cubic up-sampling. (c) SRResNet [16] trained with the per-pixel loss. (d) SRResNe trained with the per-pixel loss and perceptual loss with a pretrained VGGNet. (e) SRResNet trained with the per-pixel loss and perceptual loss with a randomly-weighted VGGNet. We can see that the perceptual loss improves image quality. Besides, formulating the perceptual loss with a pre-trained network and a randomly-weighted network produces on par results. + +![](images/837010ee0b97a26e303939c70e2b0635772342a013c013392d51b48e83a86608.jpg) +(e) w. Random VGG + +depth estimation and instance segmentation [18]. For example, the pairwise term in Markov Random Filed is complementary to the unary term, which defines pairwise compatibility and in general improves prediction accuracy especially when the unary term alone is not sufficient. The proposed generic perceptual loss can be easily applied to these dense prediction tasks, with no computation overhead during inference. Also, as now pre-training with labelled data is not required, it is straightforward to explore the effectiveness of using various network structures—not necessary the VGG—to model the dependency between output variables. + +Experimental results on various structured output learning tasks with different network structures show that the generic perceptual loss benefits the training, and consistently achieves improved performance compared to the baselines using pixel-wise loss term alone. We also provide detailed comparisons and analysis on the impact of initialization schemes and architectures of the perceptual loss network. + +In summary, our main contributions are as follows. + +- We reveal that the success of the perceptual loss is not dependent on the pretrained CNN weights. Without any learning, the structure of a deep network is sufficient to capture the dependencies between multiple levels of variable statistics using multiple layers of CNNs. + +- We apply the generic perceptual loss to a few structured output learning tasks, including semantic segmentation, depth estimation and instance segmentation. We consistently improve the performance of baseline models. +- We investigate how the initialization and the network structures may affect the performance of the proposed perceptual loss. A reliable initialization approach is designed based on the analysis. +- This proposed simple perceptual loss may serve as a generic structured-output loss that is applicable to most structured output learning tasks in computer vision. + +# 2. Related Work + +Perceptual loss. Early works [16, 14] generate high-quality images using perceptual loss functions, which consider the discrepancy between deep features, not only the pixels. Gatys et al. [8] found that a pretrained VGG architecture can be used to as a loss function for style transfer. They attribute the success to the ability of the trained filters in learning certain features which are coincident to human perception. Johnson et al. [14] further formulate the perceptual loss as an extra loss term for the deep neural network. There, the context/perceptual loss is the Euclidean distance between feature representations. Inclusion of the percep + +tual loss achieves visually improved results on style transfer and super-resolution. While doing other image synthesis tasks, such as super-resolution, colorizing, and other image generation tasks [13], the perpetual loss often refers to this context loss as shown in Eq. (1), + +$$ +\ell_ {f e a t} ^ {\phi , j} (\hat {y}, y) = \frac {1}{C _ {j} H _ {j} W _ {j}} \| \phi_ {j} (\hat {y}) - \phi_ {j} (y) \| _ {2} ^ {2}, \tag {1} +$$ + +where $y$ and $\hat{y}$ are the targeted images and synthesis images. $\phi_{j}$ represents the perceptual function which outputs the activation of the $j$ th layer in the perceptual loss network. $C_j$ , $H_j$ , $W_j$ are the dimensions of the tensor feature map. + +Recently, a perceptual loss was also introduced to depth estimation task [31]. The authors argue that the embedding spaces should be designed for particular relevant tasks, i.e., depth-based scene classification and depth reconstruction. Thus, they have pretrained the perceptual loss network on RGBD datasets and failed to realize that pretraining is not compulsory, as we show here. + +Representations with random weights. A few methods have discussed the untrained, randomly-weighted CNNs. Researchers found that networks with random weights can extract useful features as the classification accuracy with these features is higher than random guesses. He et al. [9] use generative models with the constraints from untrained, randomly-weighted network for deep visualization tasks. They found that during optimization for a style transfer task, the perceptual loss with a proper weight scale can work well with untrained, randomly-weighted networks, and generate competitive results as prior work [8] with pretrained weights. Mongia et al. [19] prove why one-layer CNNs with random weights can successfully generate textures. The randomly-weighted networks are also employed in unsupervised learning [29] and reinforcement learning [7]. Another relevant work is deep image prior [28] where a randomly-initialized neural network is used as a "handcrafted prior" with excellent results in image reconstruction tasks such as denoising, super-resolution, and inpainting. These works provide a way to study network architectures without any learning, and also exploit the randomness as a useful feature. + +Here, we explore the ability of the randomly-weighted network in investigating hierarchical dependencies between variable statistics. The perceptual loss with a randomly-weighted network works as a useful loss term on various structured output learning tasks. + +Dense prediction. Dense prediction is a family of fundamental problems in computer vision, which learns a per-pixel mapping from input images to output structures, including semantic segmentation [37], depth estimation [35, 33, 36], object detection [27], etc. As extensively studied in the literature, taking the inter-dependency between output variables into account during training and/or inference + +often improves the accuracy. Thus structured information is important for these tasks. + +In this work, we demonstrate that a randomly-weighted network can implicitly capture the structural information with its natural architecture and internal convolution operations. The performance of these dense prediction tasks can be enhanced by simply enforcing a perceptual loss from a randomly-weighed network. This is achieved without any learning on the perceptual loss network, and no further computation cost for inference is required. + +# 3. Our Method + +The observations from the pilot experiments in Figure 1 suggest that the network structure, instead of the pretrained weights, contributed to the success of the perceptual loss. More details can be found in the supplementary materials. In this section, we first extend the perceptual loss with randomly-weighted networks to some structured output learning tasks. Then, we analyze the devils in the weight initialization and design an appropriate way for an effective initialization. + +# 3.1. Perception Loss for Structured Output Prediction + +If the randomly-weighted network has the ability in capturing structured information, it should also be able to help dense prediction problems. In addition, as the pretrained weights learnt with a large number of samples are not required, it is easier to apply this regularization on any task and to compare the performance with different perceptual loss networks. We start with the commonly used VGGNet-like structure as the perceptual loss network. We denote the number of convolutional layers between max pooling downsample operations with $N_{1}, N_{2}, \ldots, N_{k}$ , where $k$ is the number of blocks. + +Semantic segmentation. Semantic segmentation is a typical dense prediction problem, where a semantic label is assigned to each pixel in an input image. A segmentation network as $\mathcal{S}$ takes an input image $\mathbf{I} \in \mathbb{R}^{W \times H \times 3}$ and predicts a segmentation map $\hat{y} = \mathcal{S}(\mathbf{I}) \in \mathbb{R}^{W \times H \times C}$ . The output channel of the segmentation network $C$ equals to the number of the pre-define object classes. Conventional methods usually employ a per-pixel cross-entropy loss. The correlations among pixels are neglected in the cross-entropy loss. Therefore, the perceptual loss can work as a complementary to the per-pixel loss for capturing the structured information. + +To extend the perceptual loss to semantic segmentation, we use the estimated segmentation map or the ground-truth one as the input to the perceptual loss network, and get the embedded structured feature after several CNN layers. The mean square error is used to minimize the distance between the structured features of prediction and the learning target. + +The softmax output $\hat{y}$ has a domain gap with the one-hot ground truth $y$ , which make the perceptual loss hard to converge. To solve this problem, we follow recently knowledge distillation methods [18] to generate soft labels $y_{t}$ by a large teacher net as the learning targets. The total loss is then defined as: + +$$ +\ell_ {\text {s e g}} = \ell_ {c e} (\hat {y}, y) + \lambda \cdot \ell_ {r} ^ {\phi_ {r}} (\hat {y}, y _ {t}), \tag {2} +$$ + +where $\phi_r$ represents the perceptual loss network initialized with random weights and we set $\lambda$ as 0.1 in all experiments. Depth estimation. Monocular depth prediction [35, 6] is a regression problem, which predicts the per-pixel real-world distance from the camera imaging plane to the object captured by each pixel in a still image $\mathbf{I}$ . We use VNL proposed by Yin et al. [35] as a baseline model. The pixel-level depth prediction loss and the virtual normal loss are used to supervise the network. The network outputs a predicted depth map $\hat{d} \in \mathbb{R}^{W \times H \times 1}$ . Therefore, the input channel of the perceptual loss net equals to 1. As the ground-truth depth map follows the same statistical distribution as the estimations, the target and the estimation can be directly used as inputs to the perceptual loss network. The network with virtual normal loss, as a strong baseline, minimizes the difference of a manually defined geometry information between the prediction and the ground truth, i.e., the direction of the normal recovered with three samples. The perceptual loss can still capture extra structured information when combined with $\ell_{vn}$ . + +Instance segmentation. Instance segmentation is one of the most challenging computer vision tasks, as it requires the precise per-pixel object detection and semantic segmentation simultaneously. Recently, one stage methods achieve promising performance [26, 2, 34], making the pipeline more elegant and easier to implement. The mask and classification logits are predicted for each pixel in the feature space. + +We follow CondInst [26], a state-of-the-art one-stage method, as a strong baseline. In the training procedure, CondInst consists of a bounding box detection head and a mask head. The detection head also includes a controller, which is dynamically applied to the mask head for different instances. In this way, it will produce single channel segmentation masks for each instance in the training batch with the shape of $1/4W \times 1/4H$ . If there are $n$ predicted instances in the training batch, the input of the perceptual loss network is then $n \times 1 \times 1/4W \times 1/4H$ . Similar to semantic segmentation, the soft targets are generated by a teacher network. + +# 3.2. Devils in the Initialization + +The initialization of the randomly-weighted network affects the performance of the generic perceptual loss. As we + +employ the structured predictions as the input to the perceptual loss network and produce an embedding, an inappropriate initialization may lead to an unstable results. It is important to guarantee that each layer is bounded by a Lipschitz constant close to 1, so that the gradient generated by the random network will not explode or vanish. Here we investigate the gradient scales in the random network and derive a robust initialization method by following [10]. For a dense prediction task, we have the prediction results (e.g., segmentation map) $\mathbf{Y}'$ , and also its ground-truth or soft targets $\mathbf{Y}$ . Our random-weight perceptual loss network transforms $\mathbf{Y}'$ and $\mathbf{Y}$ into two embeddings $\mathbf{E}'$ and $\mathbf{E}$ . The generic perceptual loss is computed as the discrepancy between $\mathbf{E}'$ and $\mathbf{E}$ , + +$$ +\ell_ {r} = \left\| \mathbf {E} ^ {\prime} - \mathbf {E} \right\| _ {2} ^ {2}. \tag {3} +$$ + +Suppose that $\mathbf{e}_l$ is the response activation values related to the corresponding $k\times k$ pixels in the convolution operation with kernel size $k$ . We have: + +$$ +\mathbf {e} _ {l} = \mathbf {W} _ {l} \mathbf {y} _ {l} + \mathbf {b} _ {l}. \tag {4} +$$ + +Here, $l$ is the index of a layer. $\mathbf{y}_l$ is the input vector with $n_l = k^2 c_l$ elements, where $c_{l}$ is the input channel of this layer. $\mathbf{W}_l$ is a $d_{l}$ -by- $n_l$ matrix, where $d$ is the number of random initialized filters in this layer. With a deep convolutional network, we have $\mathbf{y}_l = f(\mathbf{e}_{l - 1})$ , where $f(\cdot)$ is the ReLU activation function. We also have $c_{l} = d_{l - l}$ . If we initialize $w_{l}$ with a symmetric distribution around zero and $b_{l} = 0$ , then $e_l$ has zero mean and has a symmetric distribution around zero. Following [10], we compute the variance of the output embedding after $L$ layers: + +$$ +\operatorname {V a r} \left[ e _ {L} \right] = \operatorname {V a r} \left[ e _ {1} \right] \left(\prod_ {l = 2} ^ {L} \frac {1}{2} n _ {l} \operatorname {V a r} \left[ w _ {l} \right]\right). \tag {5} +$$ + +The variance of the discrepancy is upper bounded by the same factor: + +$$ +\begin{array}{l} \operatorname {V a r} \left[ \left(e _ {L} ^ {\prime} - e _ {L}\right) \right] \\ = \operatorname {V a r} \left[ e _ {L} ^ {\prime} \right] + \operatorname {V a r} \left[ e _ {L} \right] - 2 \operatorname {C o v} \left[ e _ {L} ^ {\prime}, e _ {L} \right] \tag {6} \\ \leq \operatorname {V a r} \left[ e _ {l} \right] + \operatorname {V a r} \left[ e _ {l} ^ {\prime} \right]) \left(\prod_ {l = 2} ^ {L} \frac {1}{2} n _ {l} \operatorname {V a r} \left[ w _ {l} \right]. \right. \\ \end{array} +$$ + +When $L$ becomes extremely large, the product $\prod_{l=2}^{L} \frac{1}{2} n_l \text{Var}[w_l]$ vanishes or explodes if $\frac{1}{2} n_l \text{Var}[w_l] \neq 1$ . Therefore we initialize each layer using a zero-mean Gaussian distribution with a standard deviation (std) of $\sqrt{2 / n_l}$ as in [10]. Before the optimization of the task network, the correlation between $Y$ and $Y'$ is very small. Therefore, the scale of the $\theta$ is small. In the training process, the weights of the random network $(\mathbf{W})$ are fixed, but $Y'$ becomes closer to $Y$ as the task network is optimized. Then the covariance becomes close to the variance of the two embeddings and this bound tends to zero. + +# 4. Experiments + +In this section, we first investigate some interesting questions about the perceptual loss network, and then employ an efficient and effective structure as the perceptual loss network to show its ability in boosting performance in a few dense prediction tasks, including semantic segmentation, depth estimation and instance segmentation. + +# 4.1. Discussions + +We share some observations in exploring the capacity of the random weight perceptual loss networks. We ask a few questions including: Will the trained filters help the perceptual loss in dense prediciton problems? How does the depth/receptive field/multi-scale losses affect the performance? How does the initialization affect the performance? Discussions are based on semantic segmentation task with Cityscapes [4] as the training set. PSPNet [38] with Resent18 [11] as the backbone is used as a baseline model, which is trained with the per-pixel cross-entropy loss. The soft targets are generated by the PSPNet with Resent101 [11] as the backbone. The training settings follow the details in Section 4.2.1. The performance is evaluated on the validation set of Cityscapes with the mean of Intersection over Union (mIoU) as the metric. + +
P NetR: mIoU (%)T: mIoU (%)
Non-VGG families
GoogleNet [25]68.9168.90
AlexNet [15]69.8069.87
MobileNetV2 [22]69.9870.01
ResNet18 [11]70.1670.14
VGG families
VGG16 [23]70.6870.71
VGG19 [23]71.2571.19
+ +# 4.1.1 Training Weights vs. Architecture + +The pretrained filters were considered the key to the success of the perceptual loss. Apart from the visualization results on image super-resolution in the previous pilot experiment, we show quantitative analysis on structured output learning tasks in this section. + +Taking the semantic segmentation task as an example, we use the same semantic segmentation network and training settings in our experiments, and only change the perceptual loss networks. We assign the weights of the perceptual + +Table 1 - Results of the perceptual loss for semantic segmentation with a few different networks. 'R' indicates that we randomly weight the loss network. 'T' means that we assign the network with the pretrained kernels from ImageNet classification. The baseline model achieves $69.60\%$ of mIoU. + +
Percep. networkStructureR: mIoU (%)T: mIoU (%)
N/A1, 1, 1, 1, 170.88 ± 0.03N/A
VGG111, 1, 2, 2, 270.18 ± 0.1170.21 ± 0.10
VGG132, 2, 2, 2, 270.64 ± 0.1470.62 ± 0.12
VGG162, 2, 3, 3, 370.68 ± 0.0370.71 ± 0.02
VGG192, 2, 4, 4, 471.25 ± 0.0471.19 ± 0.07
N/A3, 3, 4, 4, 470.89 ± 0.23N/A
+ +Table 2 - The perceptual loss with variants of VGG as the perceptual loss network (kernel size: 3). We vary the number of convolutional layers in each block. 'R' means random initialization. 'T' means initialization with pre-trained weights + +loss network with pretrained kernels to see if the trained filters can help improve the performance. Also, we choose different network structures as the perceptual loss network, including VGG families [23], ResNet18 [11], GoogleNet [25], AlexNet [15] and MobileNetV2 [22]. The results are shown in Table 1. 'R' means that the weights of the perceptual loss network are randomly initialized following Section 3.2. 'T' means that we employ the per-trained weights on the ImageNet to initialize the perceptual loss network, and the dense prediction output is transferred from $C$ channels to 3 using a $1 \times 1$ convolutional layer to fit the pretrained network structure. + +From the table, we can see that training with random weights and the pre-trained weights show almost no difference on improvements (difference around $0.02\%$ to $0.06\%$ ), but different network structures lead to a larger performance gap (varies from $68.90\%$ to $71.25\%$ ). + +This indicates that, in this structured output learning task, the trained filters for ImageNet is not the key to the success of perceptual loss. Meanwhile, the network architecture of the perceptual loss network affects the ability of capturing the structured information. + +Interestingly, we observe that the VGG families perform better than other structures. VGG families have been shown unique in a few previous works. Researchers find that in style transfer, the VGG structure can work better than ResNet [12, 20], and explain the reason as the VGGNet is more robust than the ResNet. Su et al. [24] observe that VGG families exhibit high adversarial transfer-ability than other structures. However, the theoretical explanation of why VGG structures show a better performance is still not fully investigated in literature. + +An independent recent work [31] for depth estimation also shows interesting results by employing a convolutional network to map the structured output into an embedding space. They argue that if the perceptual loss network are trained with some highly related tasks, the performance is improved. So they require additional annotations and try to design an efficient network structure as the perceptual loss network. Different from their work, we focus on a more general discussion on the perceptual loss, and verify that the network architecture plays a more important role than + +pretrained weights. Although training the perceptual loss network on highly relative tasks with additional information may further improve the performance, it is not generic to be applied to various tasks and requires extra annotation effort. + +# 4.1.2 Design of the Perceptual Loss Network + +In the previous section, we have shown that the network architecture plays a more important role in the perceptual loss. As our method does not require pre-training, it is convenient to investigate the performance with various network structures. Here we explore different designs for the randomized perceptual loss network. All the experiments are conducted for three times with random initialization, and we report the mean and derivation for each setting. + +Impact of depth. Conventional VGG families have variants with different numbers of layers, such as the most popular VGG16 and VGG19. These VGG families contain five convolutional blocks, and a max pooling layer at the end of each block. For each block, the feature dimension is 64, 128, 256, 512, 512. We change the number of convolutions in each block, as shown in the 'Structure' in Table 2. For the typical structures in original VGG families, we also report the results with pretrained weight on ImageNet as in Section 4.1.1. All the convolutions' kernel size is 3 as in VGGNet. From Table 2, we can find a consistent conclusion that pretrained kernels do not help to improve the performance, while the network structures exhibit a larger impact. With the kernel size of 3, VGG19 is the most effective perceptual loss network. Besides, the structure of $\{1, 1, 1, 1, 1\}$ (only 1 conv. layer for each block) also show good performance. As the training memory and the training time may increase as the perceptual loss network becomes deeper, the structure of $\{1, 1, 1, 1, 1\}$ among these settings is the best choice considering both effectiveness and efficiency. + +Impact of the receptive field. The randomly-weighted network can capture the structured correlation among local features, as the convolution operation has the ability to exploit the information at multiple scales of receptive fields. We conduct experiments to see if a larger receptive field can help the randomly weighted network to better capture the structured information. We employ the structure of '1, 1, 1, 1, 1' as the basic perceptual loss network and adjust the kernel size in each convolutional layer to change the receptive field. The results are shown in Table 3. We can see that a larger kernel size might lead to slightly better performance on average (from $70.71\%$ to $71.16\%$ ). Note that the derivation of the results increases (from $0.02\%$ to $0.12\%$ ). + +We plot the pixel accuracy and mIoU on the validation dataset w.r.t. the training iterations in Figure 2. Clearly the perception loss helps the training and almost during the + +![](images/97b4f20f5f6f23343e77557af08d4788ae1e64ac0f99b526ea82886c00a8d13f.jpg) + +![](images/5a7e2d2245dc801c5796ea07e494a7a9ed2910f572156bd7d8d553c344492375.jpg) +Figure 2 - Pixel accuracy and mIoU on the validation set during training on the Pascal VOC dataset. 'Base' means a semantic segmentation network of PSPRes18 without a perceptual loss. 'Ours' represents the baseline network trained with a randomized perceptual loss. + +
Kernel sizemIoU (%)
170.71 ± 0.020
370.88 ± 0.025
570.93 ± 0.191
771.16 ± 0.122
+ +Table 3 - The perceptual loss with different kernel sizes in the perceptual loss network with five layers. With a larger receptive field, the perceptual loss works slightly better, with increased computation in training. + +entire training course, we observe improved performance when the perception loss is used. + +Impact of multi-level losses. A few previous works pay attention to aggregate multi-level losses for the perceptual loss. We also conduct experiments to see if combining multi-level losses is helpful in our method. We employ the same baseline which achieves $69.60\%$ of mIoU in semantic segmentation on Cityscapes and uses structure of $\{1, 1, 1, 1, 1\}$ as the perceptual loss network. Adding the perceptual loss at the final layer of the random network alone can achieve $70.88\%$ of mIoU. If we add five perceptual + +loss from the output of each convolutional block with equal loss weight, it slightly harms the performance and achieve $70.73\%$ of mIoU. + +If we adjust the weights on the losses following [32] (i.e., using scales of $\frac{1}{16}, \frac{1}{8}, \frac{1}{4}, \frac{1}{2}, 1$ respectively), the result is improved slightly and achieves $70.93\%$ of mIoU. + +Combining multi-level of the losses may lead to slightly better accuracy with more hyper-parameters. Therefore, we only use the final layer as the generic perceptual loss in other tasks. + +# 4.1.3 Initialization + +In this section, we show the importance of initialization that we propose in Section 3.2. We initialize the perceptual loss network with the Gaussian distributions, the uniform distributions, the Xavier-normal initializer and our developed initialization methods in Section 3.2, and compare their results in. Table 4. We can see that experimental results are consistent with theoretical analysis. + +# 4.2. Dense Prediction Results + +We show that the generic perceptual loss can work well in different tasks by taking the structured information into account during training. The perceptual loss network in this section refers to the VGG structure with 16 convolutional layers and 5 pooling layers, and the number of the input channel equals to the number of the task output channel. In semantic segmentation, the output channel equals to the number of class. In depth estimation and instance segmentation, the output channel is 1. The weight of the perceptual loss is set to 0.1. + +# 4.2.1 Semantic Segmentation + +Experiment settings. Experiments are conducted on three benchmarks, Cityscapes [4], Pascal VOC [5] and ADE20K [39]. On Cityscapes/Pascal VOC/ADE20K, the segmentation networks are trained by stochastic gradient descent (SGD) for 40K/20K/80K epochs with 8/16/16 training samples in the mini-batch, respectively. The learning rate is initialized as 0.01 and is multiplied by $(1 - \frac{\text{iter}}{\text{maxiter}})^{0.9}$ . We randomly crop the images into $769 \times 769$ , $512 \times 512$ , $512 \times 512$ on these three datasets. Random scaling and random flipping are applied during training. + +Experimental results. We employ three popular segmentation models with different model sizes, including a PSPNet [38] with ResNet18 as backbone (PSPRes18), a lightweight HRnet [30] with 18 layers (HRNetw18s) and the DeepLabV3+ [3] model with ResNet50 as the backbone. The corresponding soft targets are generated by the same architecture, but the backbone is replaced with ResNet101 or HRNet with 48 layers. The baseline models are trained + +
Init. schememIoU (%)
N(0,1)-
N(0,0.1)45.6
N(0,0.01)68.5
U[-1,1]-
U[-0.1,0.1]51.7
U[-0.01,0.01]69.2
Xavier-normal69.8
Ours71.3
+ +Table 4 - Results with a few different initialization schemes. $\mathcal{N}(\mu, \sigma)$ represents the Gaussian distributions with mean of $\mu$ and a stander deviation of $\sigma$ . $\mathcal{U}[a, b]$ represent a uniform distribution. - means that the network fails to converge. + +with the cross-entropy loss, and we further add the perceptual loss initialized with random weights. + +Table 6 reports the results. We can see that inclusion of the randomized perceptual loss can improve the performance over different datasets from $0.21\%$ to $1.6\%$ , and it also works with different architectures. If the unary term (pixel-wise loss) works sufficiently well, then additional pair-wise or other high-order loss becomes less useful. + +# 4.2.2 Depth Estimation + +Depth estimation is a typical per-pixel regression problem. We employ a plain ResNet50 as the backbone for depth estimation. The experiments are conducted on the NYUDV2 dataset [21]. The input images are cropped into the resolution of $385 \times 385$ . The base learning rate is set to 0.0001. We train our model using SGD with a mini-batch size of 8 for 30 epochs. We employ a pixel-wise weighted cross-entropy [1] and the vitural normal loss [35]. + +Predictions are evaluated by the relative error. The results are shown in Table 7. Although the VNL have already considered the geometry information to some extent, the randomized perceptual loss network can still show further improvement. + +# 4.2.3 Instance Segmentation + +For instance segmentation, we apply the generic perceptual loss based on the open source framework AdelaiDet. We employ the state-of-the-art method CondInst [26] as a strong baseline. ResNet50 is used as the backbone network for CondInst, and experiments are conducted on the MS COCO dataset. + +Following [26], models are trained with SGD on 4 V100 GPUs for 90K iterations with the initial learning rate being 0.01 and a mini-batch of 8 images. Other training details the same as [26]. The learning rate is reduced by a factor of 10 at iteration 60K and 80K, respectively. Weight decay + +
MethodPercep.BoxMask
AP\( AP_{50} \)\( AP_{75} \)AP\( AP_{50} \)\( AP_{75} \)
CondInst [26]36.9155.2939.9433.4253.0035.56
CondInst [26]✓37.4455.6940.5133.6953.3335.82
+ +Table 5 - Results of the generic perceptual loss for instance segmentation. Both the detection results (Box AP $(\%)$ ) and the segmentation results (Mask AP $(\%)$ ) are improved by applying the generic perceptual loss. + +
NetworkParam.Percep.mIoU
Cityscapes
PSPRes18 [38]22.9M69.6%
PSPRes18 [38]22.9M✓71.2% (↑1.6%)
HRNetw18s [32]3.76M73.61%
HRNetw18s [32]3.76M✓74.17% (↑0.56%)
DeepLabV3+ [3]39.3M80.09 %
DeepLabV3+ [3]39.3M✓80.70% (↑0.61%)
ADE20K
PSPRes18 [38]23.0M33.8%
PSPRes18 [38]23.0M✓34.2% (↑0.4%)
HRNetw18s [32]3.79M31.38%
HRNetw18s [32]3.79M✓32.26% (↑0.88%)
DeepLabV3+ [3]39.4M42.72%
DeepLabV3+ [3]39.4M✓42.95% (↑0.23%)
PascalVOC
PSPRes18 [38]22.9M49.1%
PSPRes18 [38]22.9M✓50.31% (↑1.21%)
HRNetw18s [32]3.76M65.20%
HRNetw18s [32]3.76M✓65.41% (↑0.21%)
DeepLabV3+ [3]39.3M75.93%
DeepLabV3+ [3]39.3M✓76.79% (↑0.86%)
+ +Table 6 - Results of semantic segmentation on three datasets. +√ means that we employ the perceptual loss during training. +The perceptual loss consistently improves the baseline across different datasets with different network structures. + +
MethodsWCE [1]VNL [35]Percep.Rel. (%)
a✓14.5
b✓✓14.0
c✓✓13.6
d✓✓✓13.2
+ +Table 7 - Depth estimation results. The generic perceptual loss complements the previous virtual normal loss [35]. + +and momentum are set to 0.0001 and 0.9, respectively. The experiment results are reported in Table 5. As bounding box detection is naturally a byproduct of CondInst, we compare results on both detection and instance segmentation tasks. With the generic perceptual loss, the performance of both tasks are improved on all metrics. This experiment again demonstrates that the proposed loss can benefit the object detection task, when a mask branch as in CondInst is added to an one-stage object detection method. + +# 5. Conclusion + +In this work, we have extended the widely used perceptual loss in image synthesis tasks to structured output learning tasks, and shows its usefulness. We argue that the randomly-weighted network can capture vital information + +among different spatial locations of the structural predictions. On a few image understanding tasks, including semantic segmentation, monocular depth estimation and instance segmentation, we demonstrate that the inclusion of this simple perceptual loss consistently improves accuracy. The proposed loss can be effortlessly applied to many dense prediction tasks in computer vision. The only cost is the extra computation overhead during training and inference complexity remains the same. Considering its simplicity and promising performance gain, we wish to see a wide application of this generic perceptual loss in computer vision. + +# References + +[1] Yuanzhouhan Cao, Zifeng Wu, and Chunhua Shen. Estimating depth from monocular images as classification using deep fully convolutional residual networks. IEEE Trans. Circuits Syst. Video Technol., 28(11):3174-3182, 2017. +[2] Hao Chen, Kunyang Sun, Zhi Tian, Chunhua Shen, Yongming Huang, and Youliang Yan. Blendmask: Top-down meets bottom-up for instance segmentation. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 8573-8581, 2020. +[3] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In Proc. Eur. Conf. Comp. Vis., pages 801-818, 2018. +[4] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2016. +[5] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. Int. J. Comput. Vision, 88(2):303-338, 2010. +[6] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Bat-manghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 2002-2011, 2018. +[7] Adam Gaier and David Ha. Weight agnostic neural networks. In Proc. Advances in Neural Inf. Process. Syst., pages 5364-5378, 2019. +[8] Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2016. +[9] Kun He, Yan Wang, and John Hopcroft. A powerful generative model using random weights for the deep image representation. In Proc. Advances in Neural Inf. Process. Syst., pages 631-639, 2016. + +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proc. IEEE Int. Conf. Comp. Vis., pages 1026-1034, 2015. +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 770-778, 2016. +[12] Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Proc. Advances in Neural Inf. Process. Syst., pages 125-136, 2019. +[13] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei Efros. Image-to-image translation with conditional adversarial networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 1125-1134, 2017. +[14] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In Proc. Eur. Conf. Comp. Vis., pages 694-711, 2016. +[15] Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton. Image-net classification with deep convolutional neural networks. Comm. of the ACM, 60(6):84-90, 2017. +[16] 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 Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 4681-4690, 2017. +[17] Guosheng Lin, Chunhua Shen, Anton van den Hengel, and Ian Reid. Efficient piecewise training of deep structured models for semantic segmentation. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 3194-3203, 2016. +[18] Yifan Liu, Ke Chen, Chris Liu, Zengchang Qin, Zhenbo Luo, and Jingdong Wang. Structured knowledge distillation for semantic segmentation. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 2604-2613, 2019. +[19] Mihir Mongia, Kundan Kumar, Akram Erraqabi, and Yoshua Bengio. On random weights for texture generation in one layer CNNs. In Proc. IEEE Int. Conf. Acous., Speech & Signal Process., pages 2207-2211, 2017. +[20] Reiichiro Nakano. A discussion of 'adversarial examples are not bugs, they are features': Adversarially robust neural style transfer. Distill, 4(8), 2019. +[21] Pushmeet Kohli Nathan Silberman, Derek Hoiem and Rob Fergus. Indoor segmentation and support inference from RGBD images. In Proc. Eur. Conf. Comp. Vis., 2012. +[22] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zh-moginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2018. +[23] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. Proc. Int. Conf. Learn. Representations, 2015. +[24] Dong Su, Huan Zhang, Hongge Chen, Jinfeng Yi, Pin-Yu Chen, and Yupeng Gao. Is robustness the cost of accuracy? a comprehensive study on the robustness of 18 deep image classification models. In Proc. Eur. Conf. Comp. Vis., pages 631-648, 2018. + +[25] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 1-9, 2015. +[26] Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In Proc. Eur. Conf. Comp. Vis., 2020. +[27] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. FCOS: Fully convolutional one-stage object detection. In Proc. IEEE Int. Conf. Comp. Vis., pages 9627-9636, 2019. +[28] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2018. +[29] Hu Wang, Guansong Pang, Chunhua Shen, and Congbo Ma. Unsupervised representation learning by predicting random distances. Proc. Int. Joint Conf. Artificial Intell., 2019. +[30] 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 Trans. Pattern Anal. Mach. Intell., 2020. +[31] Lijun Wang, Jianming Zhang, Yifan Wang, Hutchuan Lu, and Xiang Ruan. Cliffnet for monocular depth estimation with hierarchical embedding loss. In Proc. Eur. Conf. Comp. Vis., pages 316-331, 2020. +[32] 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 Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 8798-8807, 2018. +[33] Xinlong Wang, Wei Yin, Tao Kong, Yuning Jiang, Lei Li, and Chunhua Shen. Task-aware monocular depth estimation for 3d object detection. In Proc. AAAI Conf. Artificial Intell., volume 34, pages 12257-12264, 2020. +[34] Xinlong Wang, Rufeng Zhang, Tao Kong, Lei Li, and Chunhua Shen. Solov2: Dynamic, faster and stronger. Proc. Advances in Neural Inf. Process. Syst., 2020. +[35] Yin Wei, Yifan Liu, Chunhua Shen, and Youliang Yan. Enforcing geometric constraints of virtual normal for depth prediction. Proc. IEEE Int. Conf. Comp. Vis., 2019. +[36] Wei Yin, Jianming Zhang, Oliver Wang, Simon Niklaus, Long Mai, Simon Chen, and Chunhua Shen. Learning to recover 3d scene shape from a single image. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2021. +[37] Changqian Yu, Yifan Liu, Changxin Gao, Chunhua Shen, and Nong Sang. Representative graph neural network. Proc. Eur. Conf. Comp. Vis., 2020. +[38] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 2881-2890, 2017. +[39] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2017. \ No newline at end of file diff --git a/genericperceptuallossformodelingstructuredoutputdependencies/images.zip b/genericperceptuallossformodelingstructuredoutputdependencies/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5486fe4e6ed5320631e6823ea58c77cfb18ccd71 --- /dev/null +++ b/genericperceptuallossformodelingstructuredoutputdependencies/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d2e0526e49689e769517170f542a0672e218d644692bcf1969c39d52000933f +size 403340 diff --git a/genericperceptuallossformodelingstructuredoutputdependencies/layout.json b/genericperceptuallossformodelingstructuredoutputdependencies/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b10a644e651d837d70aeb4fc98cefd70da180c36 --- /dev/null +++ b/genericperceptuallossformodelingstructuredoutputdependencies/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71a26b93988200f83341e3889b752b1c9e60967944952e7b322e616b427df114 +size 368719 diff --git a/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_content_list.json b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..433211e7cc5ac0b423d724232942e2600cfe733b --- /dev/null +++ b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49e818ef422c9b48d3d430815f7678fe8c387b7bc9ad15a64950601d8143c569 +size 84505 diff --git a/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_model.json b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..812fa72db0ba0c82a987bac3661dfd9fc388b596 --- /dev/null +++ b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d24ce339ba0e263b2c6ac913bd167123b953c6388d4194cfc286bd751652b7b +size 102035 diff --git a/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_origin.pdf b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3984d07abe67358c701854f984cef4954075b8e1 --- /dev/null +++ b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/a89dbf7d-4e02-4e08-a9be-71f43fc0e78c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e22584711cf7e6a0768b3913641e3c916885d5154b0785f9119f86e889041c3c +size 2552927 diff --git a/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/full.md b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8d4f086b0d62a3f9e284c94bca69531473b4f7d7 --- /dev/null +++ b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/full.md @@ -0,0 +1,421 @@ +# Geo-FARM: Geodesic Factor Regression Model for Misaligned Pre-shape Responses in Statistical Shape Analysis + +Chao Huang, Anuj Srivastava, Rongjie Liu +Department of Statistics, Florida State University +Tallahassee, FL 32306, USA + +chaohuang@stat.fsu.edu, anuj@stat.fsu.edu, rliu3@fsu.edu + +# Abstract + +The problem of using covariates to predict shapes of objects in a regression setting is important in many fields. A formal statistical approach, termed Geodesic regression model, is commonly used for modeling and analyzing relationships between Euclidean predictors and shape responses. Despite its popularity, this model faces several key challenges, including (i) misalignment of shapes due to pre-processing steps, (ii) difficulties in shape alignment due to imaging heterogeneity, and (iii) lack of spatial correlation in shape structures. This paper proposes a comprehensive geodesic factor regression model that addresses all these challenges. Instead of using shapes as extracted from pre-registered data, it takes a more fundamental approach, incorporating alignment step within the proposed regression model and learns them using both pre-shape and covariate data. Additionally, it specifies spatial correlation structures using low-dimensional representations, including latent factors on the tangent space and isotropic error terms. The proposed framework results in substantial improvements in regression performance, as demonstrated through simulation studies and a real data analysis on Corpus Callosum contour data obtained from the ADNI study. + +# 1. Introduction + +The field of statistical analysis and modeling of shapes has seen tremendous research and progress. This research is driven by strong applications in computer vision, bioinformatics, computational anatomy, forensics, computer graphics, and so on. Numerous important scientific endeavors have sought to analyze the shapes of objects and investigate their correlations with objects' functionality in large-scale datasets [10, 36, 40, 29]. Shape is broadly defined to be a characteristic that is left after certain nuisance or shape-preserving transformations, such as rotations, trans + +lations and scale, have been removed [6, 34, 21], with the result that shape representation spaces are nonlinear, high-dimensional, and have quotient space geometry. The last property stems from the need to be invariant to certain shape-preserving transformations as rotations, translations and scale. Consequently, shapes are represented by orbits under transformation groups, rather than as points in a preshape space. Together, these properties make shape spaces as non-traditional domains for statistical formulations, including definitions of shape statistics (e.g. mean and variability) [15], clustering analysis [35], classification [8], testing differences in populations [2] and some others. + +In recent years, shape regression analysis – the use of shape variables in statistical regression models – has attracted considerable attention. Consequently several approaches have been developed to model the relationships between shape responses and some Euclidean covariates of interest [25, 24, 32, 14, 17, 22, 7, 42, 33, 43]. The past approaches can be classified in two broad categories: extrinsic regression and intrinsic regression. In the extrinsic regression framework, the shape responses are usually embedded onto a higher dimensional Euclidean space, where classical regression models in that space are applied, and then the estimated models and predictions are projected back onto the original shape space [25, 24]. However, these approaches face some drawbacks including (i) lack in preservation the local shape geometry and (ii) non-guaranteed existence of an inverse and continuous embedding map to the shape space [37]. + +In contrast, the intrinsic approaches are natural generalizations of regression models from Euclidean spaces to non-Euclidean shape geometries, typically using exponential maps and tangent space representations [32, 14, 17, 22, 7, 42, 33, 43]. To understand this approach better, let $\{f_i^y,x_i\}_{i = 1}^n$ be the observed data, where $f_{i}^{y}$ is an element of Kendall's shape space $S$ , and $x_{i}\in \mathbb{R}^{p}$ is a Euclidean variable. Ideally $f_{i}^{y}$ , representing a shape, should be an orbit $[f_i^y ]$ of a pre-shape space under the rotation group. However, the use of quotient space geometry in specify + +ing regression models is difficult and has not been pursued. Instead, the common approach is to take a representative element of the pre-shape space, aligned or rotated appropriately through some pre-processing steps. The presumption is that through this pre-processing the nuisance transformations have been filtered out. Then, one can apply a commonly used geodesic regression model: + +$$ +f _ {i} ^ {y} = \operatorname {E x p} (\kappa (x _ {i}), \epsilon_ {i}), \quad \kappa (x _ {i}) \in \mathcal {S}, \epsilon_ {i} \in T _ {\kappa (x _ {i})} \mathcal {S}, \tag {1} +$$ + +where $\mathrm{Exp}(\kappa (x_i),\cdot):T_{\kappa (x_i)}S\to S$ is the exponential map at $\kappa (x_{i})$ , and $T_{\kappa (x_i)}S$ is the corresponding tangent space (some useful concepts from differential geometry can be found in Appendix A). Model (1) involves two key terms: the conditional mean shape $\kappa (x_{i})$ and the error $\epsilon_{i}\in T_{\kappa (x_{i})}S$ . The conditional mean shape $\kappa (x_{i})$ can be treated as a link function including the typical parametric setting, i.e., $\mathrm{Exp}(\mu ,\mathbf{B}x_i)$ , [14, 22, 43] and some other nonparametric settings [32, 7]. Similarly, the error term $\epsilon_{i}$ can be specified using parametric [14], semi-parametric [7], or completely nonparametric models [22]. + +The main issue here lies in using (pre-aligned) elements of pre-shape space, rather than actual orbits as shape representations. It is a well-known mathematical fact that optimal rotations alignments of objects can not be achieved via pre-processing. For instance, the optimal alignments of objects A and B to object C, respectively, do not result in optimal alignments between objects A and B themselves! Rotations have to be solved for during pairwise shape comparisons. That is why shape spaces are typically quotient spaces, and not subsets, of pre-shape spaces. This fundamental issue leads to three key limitations of geodesic regression models: (i) Misalignment issue in prealigned responses. In practice one observes raw images rather than getting the shape data directly. The shapes are extracted from the images using a pre-processing step – these steps are increasingly being performed using deep learning networks. Even when the image data are preregistered and assumed to be well aligned, the shapes extracted from this image data exhibit mis-alignment and can even be noisy [1, 42, 33], which negatively affects regression performance. To illustrate this issue, we fitted the popular geodesic regression model to some simulated data later in the paper (detailed simulation settings can be found in Section 3.2), and reached an estimated “baseline shape” presented in Figure 1, where the estimate is found to be biased when the shape data contains misalignment variability. (ii) Non-optimal alignment due to imaging heterogeneity. Since most pre-alignment approaches are implemented on imaging data, the presence of imaging heterogeneity [19] causes the nuisance transformations to be correlated with some covariates of interest, e.g., gender and age, which makes the pre-alignment non-optimal and adversely affects the regression performance. (iii) Lack of + +![](images/0019f98a86fb481e18a1c4df7822cea2c1c36656bb280358a5c4451c6cf21c0e.jpg) +Figure 1. Example of misalignment issue in pre-aligned responses. + +spatial correlation structure in modeling. Most existing methods assume that stochastic terms have isotropic variability [14, 22]. Although the spatial correlation is considered in [7] via introduction of a random weighted matrix on the tangent space, its implementation suffered due to heavy computational burden incurred in choosing the optimal weighted matrix. + +This aim of this paper is to propose a Geodesic FActor Regression Model (Geo-FARM) that addresses all three challenges. Specifically, the main contributions of this paper are: (i). Instead of treating objects extracted from prealigned functional data as shapes, we treat them as preshapes, i.e., coordinate data after filtering out only the location and scale effects. We incorporate full shapes inside regression models as proper orbits. In practical terms, the rotational alignments are applied on pre-shapes and learned inside the regression model itself. (ii). The spatial correlation structure in our Geo-FARM is established as a low-dimensional representation, including latent factors through a factor analysis framework on the tangent space and error term modeled using the isotropic Riemannian Normal (RN) distribution [28, 14]. (iii). A Monte Carlo Expectation-Maximization (MCEM) algorithm is used to develop the estimation procedure for both parameters and nuisance transformations. In addition, hypothesis testing problems are discussed to investigate the significance of some covariates of interest on the shape responses. (iv). The efficacy of our Geo-FARM is assessed using Monte Carlo simulations and a real data example on corpus callosum contour data obtained from the ADNI study. A MATLAB-based companion software will be released to the public through GitHub. + +# 2. Method + +# 2.1. Pre-shape space for planar curves + +Let $\mathbf{L} \in \mathcal{L}_{2,k}$ be a $2 \times k$ matrix whose $k$ columns denote $k$ landmarks from a 2-dimensional object. After removing the translation and scaling of elements in $\mathcal{L}_{2,k}$ , one reaches the pre-shape space defined as $S_2^k = \{\mathbf{L} \in \mathcal{L}_{2,k} : \sum_{j=1}^k L_{i,j} = 0, i = 1, 2, \| \mathbf{L} \|_F = 1\}$ , where $\| \cdot \|_F$ is the Frobenius norm. $S_2^k$ is not the shape space since the pre-shape is not invariant to the action of the rotation group, $SO(2)$ . Noting that there exists an one-to-one map $f(\cdot)$ such that $S_2^k$ is equivalent to the unit hypersphere $\mathbb{S}^{m-1}$ with $m = 2k - 2$ , one can utilize + +all the geometric properties on hyperspheres to analyze preshapes [36]. Specifically, Let $y \in \mathcal{L}_{2,k}$ and $f(y)$ be a point on a $(m-1)$ -dimensional sphere $\mathbb{S}^{m-1}$ , and $v$ be a tangent vector at $f(y)$ . The exponential map is given by + +$$ +\operatorname {E x p} (f (y), v) = \cos (\| v \|) f (y) + \frac {\sin (\| v \|)}{\| v \|} v. \tag {2} +$$ + +For another point $f(y') \in \mathbb{S}^{m-1}$ , the inverse exponential map, or log map, between $f(y)$ and $f(y')$ is given by + +$$ +\operatorname {L o g} (f (y), f \left(y ^ {\prime}\right)) = \frac {\mathbb {P} \left(y , y ^ {\prime}\right)}{\| \mathbb {P} \left(y , y ^ {\prime}\right) \|} \arccos \langle f (y), f \left(y ^ {\prime}\right) \rangle , \tag {3} +$$ + +where $\mathbb{P}(y,y^{\prime}) = f(y^{\prime}) - f(y)\langle f(y),f(y^{\prime})\rangle$ . In addition, the parallel transport of the tangent vector $v$ from $T_{f(y)}\mathbb{S}^{m - 1}$ to $T_{f(y^{\prime})}\mathbb{S}^{m - 1}$ can be derived as + +$$ +\Gamma_ {f (y)} ^ {f \left(y ^ {\prime}\right)} [ v ] = v - \frac {2 v ^ {T} f \left(y ^ {\prime}\right)}{\| f (y) + f \left(y ^ {\prime}\right) \| ^ {2}} \left(f (y) + f \left(y ^ {\prime}\right)\right). \tag {4} +$$ + +# 2.2. Geo-FARM + +Assume that $\{y_i\}_{i=1}^n$ are observed from the pre-shape space $S_2^k$ and $\{x_i\}_{i=1}^n$ are from a Euclidean space $\mathbb{R}^p$ . In order to simultaneously handle the nuisance transformations and establish the relationship between pre-shape responses and Euclidean covariates, a novel geodesic regression model is proposed as: + +$$ +f \left(y _ {i} * g _ {i}\right) = \operatorname {E x p} \left(\operatorname {E x p} \left(f (\mu), \mathbf {B} x _ {i}\right), \epsilon_ {i}\right), \tag {5} +$$ + +where $g_{i}\in SO(2)$ denotes the rotation group action that forms the individual nuisance transformation. $\mu \in S_2^k$ and $f(\mu)\in \mathbb{S}^{m - 1}$ is the base point. All the columns in $\mathbf{B}$ i.e., $\{\beta_j\}_{j = 1}^p$ , are tangent vectors at $T_{f(\mu)}\mathbb{S}^{m - 1}$ , representing the effects from the predictors $\{x_i\}_{i = 1}^n$ + +In order to establish the spatial correlation structure, our Geo-FARM integrates model (5) with a factor analysis framework generalized from Euclidean space to the preshape space: + +$$ +f \left(y _ {i} * g _ {i}\right) \mid x _ {i}, z _ {i} \sim \operatorname {R N} \left(\kappa \left(x _ {i}, z _ {i}\right), \sigma\right), z _ {i} \sim \mathrm {N} \left(0, \mathrm {I} _ {q}\right), \tag {6} +$$ + +where $\kappa (x_i,z_i) = \mathrm{Exp}(f(\mu),\mathbf{B}x_i + \boldsymbol {\Lambda}z_i)$ and RN is the isotropic RN distribution [14]. The proposed factor analysis framework builds the correlation structure with a low rank representation $(q\ll m)$ including (i) a low number of latent factors represented by the columns of $\pmb{\Lambda}$ , i.e., $\{\alpha_{j}\in T_{f(\mu)}\mathbb{S}^{m - 1}\}_{j = 1}^{q}$ , and (ii) stochastic error term $\epsilon_{i}$ that follows the isotropic RN distribution. Then, the joint probability density function for $(f(y_{i}*g_{i}),z_{i})$ is given by + +$$ +\begin{array}{l} h (f (y _ {i} * g _ {i}), z _ {i}) = \phi (z _ {i}) \mathcal {C} (\sigma) \exp \{- \frac {1}{2 \sigma} \times \\ \left\| \operatorname {L o g} \left(\operatorname {E x p} (f (\mu), \mathbf {B} x _ {i} + \boldsymbol {\Lambda} z _ {i}), f \left(y _ {i} * g _ {i}\right)\right) \right\| ^ {2} \}, \tag {7} \\ \end{array} +$$ + +where $\phi (\cdot)$ is the $q$ -dimensional standard normal distribution density function. In addition, the model identifiability of our Geo-FARM is guaranteed under certain conditions. + +Proposition 2.1 Consider the probability density function of GEO-FARM, i.e., $\varrho(f(y*g),\Theta) \doteq \int h(f(y*g),z)dz$ . Given the nuisance transformation $g$ and the number of latent factors $q$ , if the design matrix $\mathbf{X} = (x_{1},\ldots,x_{n})^{T}$ is full row rank, the density function $\varrho(f(y*g),\Theta)$ is generically identifiable in the parameter space. + +A graphical illustration of our Geo-FARM is presented in Figure 2. In summary, there are several advantages of our + +![](images/c726e1d57e636ec60b7a748bf8ca9916045c6f24837a67d649ebe7c04ad067ee.jpg) +Figure 2. Graphical illustration of Geo-FARM. + +$$ +\begin{array}{l} f \left(y _ {i} * g _ {i}\right) = \operatorname {E x p} \left(\nu_ {\bullet} \varepsilon_ {i}\right), \\ v _ {i} = \operatorname {E x p} (f (i), \xi_ {i}) \\ \xi_ {i} = x _ {i 1} \beta_ {1} + x _ {i 2} \beta_ {2} + z _ {i 1} \alpha_ {1} + z _ {i 2} \alpha_ {2} \\ f: S _ {2} ^ {k} \rightarrow \mathbb {S} ^ {m - 1}, m = 2 k - 2 \\ y _ {i} \in S _ {2} ^ {k}: \text {p r e - s h a p e r s o n s p r e} \\ g _ {i} \in S O (2): \text {n u i s a n c e t r a n s f o r m a t i o n} \\ \epsilon_ {i} \in T _ {\nu_ {i}} \mathbb {S} ^ {m - 1}: \text {s t o c h a s t e r} \\ f (\mu) \in S ^ {m - 1}: \text {b a s e p o i n t} \\ \beta_ {1}, \beta_ {2}, \alpha_ {1}, \alpha_ {2} \in T _ {f (\mu)} \mathbb {S} ^ {m - 1} \\ x _ {i 1}, x _ {i 2}: \text {c o v a r i a t e s o f i n t e r s t} \\ z _ {i 1}, z _ {i 2}: \text {l a t e n t f a c t o r s} \\ \end{array} +$$ + +Geo-FARM: (i) Compared to the existing geodesic regression models for well aligned responses [22, 7], our GeoFARM can successfully deal with the misalignment issue in pre-aligned responses via introducing the individual nuisance transformation $g_{i}$ . In addition, compared to the traditional preprocessing approaches, the alignment of each pre-shape in our Geo-FARM can be refined since the nuisance transformation $g_{i}$ is learned based on all the available information including not only the response $y_{i}$ but also the other covariates $x_{i}$ . (ii) Through the factor analysis frame in our Geo-FARM, the variability among pre-shapes in model (5) can be expressed by two parts: latent variables from a low dimensional space in the tangent space $T_{f(\mu)}\mathbb{S}^{m - 1}$ ; and stochastic error terms with isotropic variance structure in the tangent space $T_{\mathrm{Exp}(f(\mu),Bx_i + \Lambda z_i)}\mathbb{S}^{m - 1}$ . Compared to the general RN distribution [28], the number of parameters that specify the correlation structure has been reduced a lot from $m(m + 1) / 2$ to $mq + 1$ , where $q \ll m$ . (iii) Instead of considering the nuisance transformation $g_{i} \in SO(m)$ for responses $f(y_{i}) \in \mathbb{S}^{m - 1}$ , our Geo-FARM treats $g_{i}$ as a rotation group action on the pre-shape $y_{i} \in S_{2}^{k}$ , which avoids the computational burden caused by the high dimensional structure of nuisance transformations in [42]. Specifically, $g_{i}$ can be represented by the 2-dimensional orthogonal matrix: $O_{i}(\psi) = \left[ \begin{array}{cc}\cos (\psi) & -\sin (\psi)\\ \sin (\psi) & \cos (\psi) \end{array} \right]$ , where $\psi \in [-\pi ,\pi ]$ . Therefore, the dimension of the nuisance transformation group is reduced from $m(m - 1) / 2$ to 1. + +# 2.3. Estimation procedure + +The maximum likelihood estimate (MLE) of $\Theta$ including the parameters of interest, $\Upsilon \doteq \{\mu ,\mathbf{B},\boldsymbol {\Lambda}\}$ , the nuisance parameter, $\sigma$ , and the nuisance transformations, $G\doteq \{g_i\}_{i = 1}^n$ , can be derived through the following complete log-likelihood function based optimization problem: + +$$ +\hat {\Theta} = \operatorname {a r g m a x} _ {\Upsilon , \sigma} n \log \mathcal {C} (\sigma) - \frac {1}{2 \sigma} \times \sum_ {i = 1} ^ {n} +$$ + +$$ +\inf _ {g _ {i}} \left\| \operatorname {L o g} \left(\operatorname {E x p} (f (\mu), \mathbf {B} x _ {i} + \boldsymbol {\Lambda} z _ {i}), f (y _ {i} * g _ {i})\right) \right\| ^ {2}. \tag {8} +$$ + +Noting that the presence of optimization over $g_{i}$ inside the summation ensures that the nuisance transformation is removed using all available information (e.g., $y_{i}$ and $x_{i}$ ) instead of a pre-processing over $y_{i}$ . Since the latent variables $\{z_i\}_{i = 1}^n$ are unobserved, the objective function in (8) is often intractable in practice. Here the EM algorithm [9] is considered by iteratively applying two steps: E-step and M-step. Specifically, at the $t$ -th iteration, instead of the complete log-likelihood function, the optimization problem in M-step is established based on the Q-function $Q(\Theta |\Theta^{(t)})$ calculated in E-step, + +$$ +\sum_ {i = 1} ^ {n} \mathbb {E} _ {z _ {i}} \left[ \log h \left(f \left(y _ {i} * g _ {i}\right), z _ {i}\right) \mid y _ {i}, x _ {i}, \Theta^ {(t)} \right], \tag {9} +$$ + +which is the expectation of complete log-likelihood function with respect to the latent variables given the observed data and the current estimate $\Theta^{(t)}$ . However, the conditional expectation in (9) does not yield a closed-form solution, which brings about difficulties in M-step [41]. To address this issue, we consider the MCEM algorithm [23], where the Q-function is approximated via Monte Carlo techniques. Monte Carlo E-step: at the $t$ -th iteration, given the current estimate $\Theta^{(t)}$ , we consider the approximated Q-function: + +$$ +\tilde {Q} (\Theta | \Theta^ {(t)}) \propto \frac {1}{n _ {z}} \sum_ {j = 1} ^ {n _ {z}} \sum_ {i = 1} ^ {n} \log h \left(f \left(y _ {i} * g _ {i}\right), z _ {i} ^ {j}\right), \tag {10} +$$ + +where $\{z_i^j\}_{j = 1}^{n_z}$ are generated from the conditional distribution $p(z_{i}|y_{i},x_{i},\Theta^{(t)})$ via the Hamiltonian Monte Carlo (HMC) sampling method [26]. According to HMC method, we set up the Hamiltonian dynamic system first. The Hamiltonian function can be written as + +$$ +H (z _ {i}, r) = U (z _ {i}) + \frac {1}{2} r _ {i} ^ {T} r _ {i}, +$$ + +$$ +U \left(z _ {i}\right) = - \log p \left(z _ {i} \mid y _ {i}, x _ {i}, \Theta^ {(t)}\right), \tag {11} +$$ + +where $U(z_{i})$ is called the potential energy function. The other item $\frac{1}{2} r_i^T r_i$ is called the kinetic energy, where $r_i$ are auxiliary momentum variables drawn independently from $\mathrm{N}(0,\mathrm{I}_q)$ . Because of the introduction of $r_k$ , the Hamiltonian dynamics can be established as + +$$ +\frac {d z _ {i}}{d t} = r _ {i}, \quad \frac {d r _ {i}}{d t} = - \nabla_ {z _ {i}} U (z _ {i}). \tag {12} +$$ + +Then the approximation solution to (12) can be obtained via the Leap Frog numerical integration method [26] if the item $\nabla_{z_i}U(z_i)$ is calculated. In fact, the gradient term $\nabla_{z_i}U(z_i)$ can be derived as below + +$$ +z _ {i} - \sigma^ {(t) ^ {- 1}} \boldsymbol {\Lambda} ^ {(t) ^ {T}} d _ {v} \operatorname {E x p} (u, v) ^ {\dagger} \log \left(\operatorname {E x p} (u, v), f _ {i} ^ {(t)}\right), \tag {13} +$$ + +where $u = f(\mu^{(t)})$ , $v = \mathbf{B}^{(t)}x_{i} + \boldsymbol{\Lambda}^{(t)}z_{i}$ , $f_{i}^{(t)} = f(y_{i}*g_{i}^{(t)})$ , and $d_v\mathrm{Exp}(u,v)$ is the derivative of $\mathrm{Exp}(u,v)$ with respect to $v$ , and $\dagger$ represents the adjoint of a linear operator. For spheres, the adjoint derivative has an analytical expression, i.e., $d_v\mathrm{Exp}(u,v)\dagger w = \sin (\| v\|)\| v\|^{-1}w^\perp +w^\top$ where $w^\perp$ and $w^{\top}$ denote the components of $w$ that are orthogonal and tangent to $v$ , respectively. + +The performance of standard HMC method is highly sensitive to two user-specified parameters: a step size $\varepsilon$ and a desired number of steps $l$ . In particular, if $l$ is too small then the algorithm exhibits undesirable random walk behavior, while if $l$ is too large the algorithm wastes computation. Compared with the standard HMC, the No-U-Turn Sampler (NUTS) [18], an extension to standard HMC, can avoid setting the tuning parameter $l$ . Specifically, NUTS uses a recursive algorithm to build a set of likely candidate points that spans a wide swath of the target distribution, stopping automatically when it starts to double back and retrace its steps. Because of this, NUTS is adopted in this paper. The details of NUTS algorithm is omitted here, and readers can refer to Section 3 and Algorithm 3 in [18]. + +M-step: the updated estimate $\Theta^{(t + 1)}$ can be obtained via maximizing the approximated Q-function $\tilde{Q} (\Theta |\Theta^{(t)})$ . In order to solve the optimization problem above, here an iterative approach is adopted, where one updates the estimates of $\Upsilon$ , $\sigma$ , or $G$ while keeping the other fixed. Thus, we first focus on techniques for estimating these quantities separately. + +Updating $\Upsilon^{(t + 1)}$ while keeping $G^{(t)}$ and $\sigma^{(t)}$ fixed. Given $G^{(t)}$ and $\sigma^{(t)}$ , $\Theta^{(t + 1)}$ is updated via the proximal alternating linearized minimization (PALM) algorithm [4, 42], where $\Upsilon$ is iteratively updated through the gradient functions of $\tilde{Q} (\Theta |\Theta^{(t)})$ . Specifically, let $c$ be a positive constant while $K_{\mu}$ , $K_{\beta_j}$ , and $K_{\alpha_j}$ be the Lipschitz constants of $\nabla_{f(\mu)}\tilde{Q}$ , $\nabla_{\beta_j}\tilde{Q}$ , and $\nabla_{\alpha_j}\tilde{Q}$ , respectively. Given the update $\Theta^{(t,k)} = \{\Upsilon^{(t,k)}, G^{(t)}, \sigma^{(t)}\}$ at the $k$ -th iteration, the iterations of PALM algorithm is provided in Algorithm 1. Finally, $\Theta^{(t)}$ in E-step is updated by $\Theta^{(t + 1)} = \Theta^{(t,k + 1)}$ when certain iteration stopping criterion is satisfied, e.g., $\| \Upsilon^{(t,k + 1)} - \Upsilon^{(t,k)} \| < 10^{-4}$ . + +Updating $G^{(t + 1)}$ while keeping $\Upsilon^{(t + 1)}$ and $\sigma^{(t)}$ fixed. Since each $g_{i}\in SO(2)$ can be written as the orthogonal matrix $O(\psi_i)$ related to one parameter $\psi_{i}\in [-\pi ,\pi ],g_{i}^{(t + 1)}$ is updated via minimizing the following objective function: + +$$ +E \left(\psi_ {i} \mid \Upsilon^ {(t + 1)}\right) = \sum_ {l = 1} ^ {n _ {z}} \left\| \operatorname {L o g} \left(f _ {i, l} ^ {(t + 1)}, f \left(O _ {i} (\psi) y _ {i}\right)\right) \right\| ^ {2}, \tag {14} +$$ + +Algorithm 1: PALM algorithm in M-step +while stopping criterion not satisfied do +```txt +Update $f(\mu^{(t,k + 1)})$ by +``` + +```txt +$\mathrm{Exp}\left(f(\mu^{(t,k)}), -(cK_{\mu})^{-1}\nabla_{f(\mu)}\tilde{Q}\right);$ +``` + +```csv +Update $\beta_j^{(t,k + 1)},j = 1,\ldots ,p,$ by +``` + +```latex +$\Gamma_{f(\mu^{(t,k)})}^{f(\mu^{(t,k + 1)})}\left[\beta_j^{(t,k)} - (cK_{\beta_j})^{-1}\nabla_{\beta_j}\tilde{Q}\right];$ +``` + +```txt +Update $\alpha_{j}^{(t,k + 1)}, j = 1,\dots ,q,$ by +``` + +```txt +$\Gamma_{f(\mu^{(t,k)})}^{f(\mu^{(t,k + 1)})}\left[\alpha_{j}^{(t,k)} - (cK_{\alpha_{j}})^{-1}\nabla_{\alpha_{j}}\tilde{Q}\right];$ +``` + +```lisp +Set $k = k + 1$ +``` + +where $f_{i,l}^{(t + 1)} = \mathrm{Exp}(f(\mu^{(t + 1)}),\mathbf{B}^{(t + 1)}x_i + \boldsymbol{\Lambda}^{(t + 1)}z_i^l)$ , and $\psi_{i}\in [-\pi ,\pi ]$ . This univariate minimization problem can be solved based on the Golden Section Search algorithm [30] and implemented by the MATLAB function fminbnd. + +Updating $\sigma^{(t + 1)}$ while keeping $\Upsilon^{(t + 1)}$ and $G^{(t + 1)}$ fixed. We first define that $\eta = -1 / 2\sigma$ and $\varphi (\eta) = -\log \mathcal{C}(\sigma)$ . Then given $\Upsilon^{(t + 1)}$ and $G^{(t + 1)}$ , $\sigma^{(t + 1)}$ is updated via solving the following problem related to $\eta$ : + +$$ +\min _ {\eta} \varphi (\eta) - \frac {\eta}{n _ {z}} \sum_ {i = 1} ^ {n} E \left(\psi_ {i} ^ {(t + 1)} \mid \Upsilon^ {(t + 1)}\right). \tag {15} +$$ + +where the normalization term $\varphi (\eta)$ defined for $\mathbb{S}^{m - 1}$ can be derived with a closed form [41]. Noting that $\varphi (\eta)$ is a strictly convex function with respect to $\eta$ , therefore the solution to problem (15) exists and is unique [31], which can be solved based on the Newton-Raphson algorithm [5] and implemented by the MATLAB function fminunc. + +Now we summarize the overall estimation procedure for our Geo-FARM in the following Algorithm 2. + +Algorithm 2: MCEM algorithm for Geo-FARM +```txt +Data: pre-shapes $\{y_{i}\}_{i = 1}^{n}$ and covariates $\{x_i\}_{i = 1}^n$ +``` + +```txt +Result: estimation of $\Theta$ +``` + +```latex +Initialization: $\Theta^{(0)}$ and $t = 0$ +``` + +```txt +while stopping criterion not satisfied do +``` + +```txt +Monte Carlo E-step +``` + +```javascript +Sample $\{z_i^j\}_{i,j}$ via HMC method; +``` + +```javascript +Calculate the approximated Q-function in (10); +``` + +```txt +M-step +``` + +```txt +Update $\Upsilon^{(t + 1)}$ in Algorithm 1; +``` + +```javascript +Update $G^{(t + 1)}$ by minimizing (14); +``` + +```javascript +Update $\sigma^{(t + 1)}$ by minimizing (15); +``` + +```txt +Set $t = t + 1$ +``` + +```txt +Output: $\hat{\Theta} = \Theta^{(t)}$ +``` + +Here we end the estimation procedure with discussions on some other issues in MCEM algorithm including the ini- + +tialization in MCEM algorithm and criterion for choosing the number of latent factors. + +Initialization in MCEM algorithm. Since the MCEM algorithm is an iterative procedure, its performance strongly depends on starting points. For our Geo-FARM, good initialization is crucial for finding the estimates due to the presence of multiple local maxima of the likelihood function. Here we consider using the random MCEM algorithm, where multiple starting points are chosen and the point with the highest log-likelihood function is chosen as the starting point. In simulation studies and real data analysis, the estimation procedure in [22] is considered for initializing base point parameter $f(\mu)$ and coefficients $\mathbf{B}$ , while the factor analysis method is performed in the tangent space $T_{f(\mu)}\mathbb{S}^{m - 1}$ to initialize the factor loading matrices $\Lambda$ and the nuisance parameter $\sigma$ . + +Determining the number of latent factors. Since the number of latent factors, $q$ , is unknown, the 2-fold cross predictive log-likelihood method is considered through an exhaustive search as our model selection criterion [20]. However, according to the simulation results in Section 3.2, our Geo-FARM is not sensitive to the choice of number of latent variable. In particular, even when the model is misspecified (e.g. the values of $q$ is larger than 0 but incorrectly selected), our Geo-FARM still performs well in terms of its estimation accuracy. Therefore, in our simulation studies and real data analysis, we prefixed the number of latent factors as 1, which will release the potential computational burden due to the large value assigned for $q$ . + +# 2.4. Hypothesis testing + +In medical image data analysis, people are interested in investigating the relationship between the pre-shape responses and some covariates of interest. This type of scientific questions are formulated into the following hypothesis testing problem on each $\beta_{j}, j = 1,\dots ,p$ : + +$$ +\mathbf {H} _ {\mathbf {0}}: \beta_ {j} = 0 \text {v s .} \mathbf {H} _ {\mathbf {1}}: \beta_ {j} \neq 0. \tag {16} +$$ + +For this testing problem, we consider using the Wald test statistic [7]. Specifically, for testing problem (16), the test statistic is constructed as + +$$ +T _ {j} = \boldsymbol {e} _ {j} ^ {T} \hat {\mathbf {B}} ^ {T} \left[ \boldsymbol {e} _ {j} \otimes \mathrm {I} _ {m} \right] \hat {\Omega} _ {B} \left[ \boldsymbol {e} _ {j} \otimes \mathrm {I} _ {m} \right] ^ {T} \hat {\mathbf {B}} \boldsymbol {e} _ {j},, \tag {17} +$$ + +where $e_j$ is a $p \times 1$ vector with the $j$ -th element 1 and rest 0. $\hat{\Omega}_B$ is the corresponding partition of estimated inverse covariance matrix of all the estimated parameters in GeoFARM. It can be shown that $T_j$ is asymptotically $\chi^2$ distributed with $m - 1$ degree of free under $\mathbf{H}_0$ . In practice, when the sample size is not on a large scale, the parametric bootstrap procedure can be used to derive the empirical distribution of $T_j$ and the p-value [11]. + +On the other side, since we claim that our Geo-FARM can help refine the alignment as the nuisance transformations are learned based on both pre-shapes and covariates, we would like to check if the mean shape extracted from our Geo-FARM is significantly different from that extracted from the pre-aligned data. In order to achieve this goal, The Hoteling $T^2$ test statistic is adopted and implemented through a bootstrap hypothesis testing approach [2] and its R package shapes (http://cran.r-project.org/web/packages/shapes/index.html). + +# 3. Numerical experiments + +The corpus callosum (CC) contains homotopic and heterotopic interhemispheric connections and is essential for communication between the two cerebral hemispheres [27, 20]. Connection with most of the cortex has made CC a target of investigation of brain integrity in Alzheimer's disease [3, 12, 7]. In this section, both simulation studies and real data analysis are conducted to assess the performance of Geo-GARM using the CC contour data of ADNI-1 study. In simulation studies, the synthetic data is generated from the real dataset. + +# 3.1. Data preprocessing + +We use FreeSurfer [13] to process each T1-weighted MRI, including motion correction, non-parametric nonuniform intensity normalization, affine transform to the MNI305 atlas, intensity normalization, skullstripping, and automatic subcortical segmentation. Some quality control procedures are done on each output image data. Then, through the package CCSeg [38], each T1-weighted MRI image and tissue segmentation results are used to extract the planar CC contour data on the midsagittal slice, which contains 50 landmarks (See Figure 3). + +![](images/da5006630e0f5e4215133e465dd03b92a5667aad22597bd286b34b83f846d8fc.jpg) +Figure 3. CC contour data preprocessing. + +Table 1. Demographic information of preprocessed ADNI-1 CC contour data, including gender and age (in years). + +
NC (223)AD (186)All (409)
Gender (F/M)107/11688/98195/214
Avg. Age (Std.)76.2 (4.9)75.4 (7.4)75.9 (6.2)
+ +After the quality control, we obtain CC contour data from 409 subjects including 223 normal control (NC) and 186 AD. The demographic information of the preprocessed CC contour data set is presented in Table 1. + +# 3.2. Simulation studies + +We generate the data $\{x_i, y_i, g_i\}_{i=1}^n$ from the model (6) as follows. Without special saying, we set $n = 100$ . In order to mimic the ADNI-1 CC contour data, the true values of parameters in (6) are learned from the real data itself. Specifically, we first fit Geo-FARM to the CC contour data of all the normal controls in ADNI-1, where two predictors, i.e., gender $(x_{i1})$ and normalized age $(x_{i2})$ , are included. Then, we use the obtained parameter estimators of $\mu, \mathbf{B}, \boldsymbol{\Lambda}$ , and $\sigma$ as their true values in our simulation setting. Meanwhile, the number of latent factors is also learned from the model fitting, i.e., $q = 2$ . Next, the covariates $x_{i1}$ and $x_{i2}$ are generated according to their data types, i.e., $x_{i1}$ is generated from Bernoulli distribution with parameter $p = 0.5$ while $x_{i2}$ is generated from uniform distribution $U(0,1)$ . In order to generate the sphere data $f(y_i * g_i)$ from the RN distribution, the sampling algorithm proposed for spherical normal distribution [16] is considered. After that, we generate the nuisance transformations $g_i$ via sampling the rotation angle $\psi$ in orthogonal matrix $O_i(\psi)$ . Specifically, given an upper bound $\bar{\psi}$ , the rotation angle $\psi$ for each data point is uniformly generated from $[- \bar{\psi}, \bar{\psi}]$ . In order to investigate the effect of nuisance transformations on the estimation performance, multiple scenarios are considered here via setting different values of $\bar{\psi}$ , i.e., $\bar{\psi} \in \{0, 5, 10, 15, 20, 25, 30\}$ . Finally, we generate 50 datasets for each simulation scenario. + +Here two other approaches are considered here for comparison: (i) multivariate general linear models (MGLM) on Riemannian manifolds [22] and (ii) multivariate regression with gross errors (MRGE) on manifold-valued data [42]. Specifically, MGLM can be treated as an generalization of multiple linear regression models from Euclidean space to Riemannian space, while MRGE aims to improve MGLM by considering gross errors on manifold responses. For comparison, we introduce several loss functions here: (i) the sum of squared geodesic errors (SSGE), i.e., $\sum_{i=1}^{n} \|\mathrm{Log}(\mathrm{Exp}(f(\mu), \mathbf{B}x_i), \mathrm{Exp}(f(\hat{\mu}), \hat{\mathbf{B}}x_i))\|^2$ , to assess the prediction accuracy of the pre-shapes; (ii) the norm $\| \mathbf{B} - \Gamma_{f(\hat{\mu})}^{f(\mu)} \hat{\mathbf{B}} \|_F$ to assess the estimation accuracy of $\hat{\mathbf{B}}$ ; (iii) geodesic distance between $f(\mu)$ and $f(\hat{\mu})$ , i.e., $\| \mathrm{Log}(f(\mu), f(\hat{\mu}))\|$ to assess the estimation accuracy of $\hat{\mu}$ ; and (iv) the median absolute deviation (MAD) of $\triangle_{\psi} \dot{=} \{| \psi_i - \hat{\psi}_i | \}_{i=1}^n$ , i.e., median $(\triangle_{\psi})$ , to assess the detection accuracy of nuisance rotations. The simulation results for all different scenarios are presented in Figure 4. It can be found that (i) when the pre-shapes are slightly misaligned, all the three methods perform well; (ii) when the misalignment is getting severe (i.e., $\bar{\psi}$ increases), our Geo-FARM + +![](images/52e18775decaefccc799c2a537cfc3594a6c6bfa387f1f723eaf3e2b8cea7ade.jpg) +(a) + +![](images/7f38c4c793f91295146d7bad5180bf3b3f425290f463784c11ed297b5c1d65e7.jpg) +(b) + +![](images/dd2d932fc39730b724ff3fe8f66518d5931b9a852dfb23d70ea2d2c2af61eb84.jpg) +(c) + +![](images/2b0c349812a10a127c290fcc16c9404b73e0427177c0b85d234e77b471126cb9.jpg) +(d) + +![](images/3e50040bd42a28a733cca95bdff63842d3fc052a221392354e486d6c63ecba1a.jpg) +(a) + +![](images/bae4eda98a3e72860104248c0ffa3969bb12f8f88353d3f50ba0523c5b0755f3.jpg) +Figure 4. Comparison of three methods (MGLM, Geo-FARM, and MRGE) for different settings of $\bar{\psi}$ ( $\bar{\psi} \in \{0,5,10,15,20,25,30\}$ ): (a) Median SSGE; (b) Frobenius norm $\|B - \Gamma_{f(\hat{\mu})}^{f(\mu)}\hat{B}\|_F$ ; (c) geodesic distance between $f(\mu)$ and $f(\hat{\mu})$ ; and (d) MAD of $\triangle_{\psi}$ . +(b) + +![](images/2d189f3edd6553fa6489a6c336c9693bcfcdb8532b90bfe0b07bd23b880ebee8.jpg) +(c) +Figure 5. Comparison the performance of Geo-FARM with MGLM on pre-aligned pre-shapes with $\psi_{i} = \tilde{\psi}_{i}x_{i1}$ and $\tilde{\psi}_i\sim U(-\bar{\psi},\bar{\psi})$ (a) Median SSGE; (b) Frobenius norm $\| B - \Gamma_{f(\hat{\mu})}^{f(\mu)}\hat{B}\| _F$ ; and (c) geodesic distance between $f(\mu)$ and $f(\hat{\mu})$ + +is more robust compared to other two approaches in terms of both prediction accuracy and parameter estimation accuracy; (iii) although MRGE considers detecting and correcting the gross errors on pre-shapes through penalization approach, its performance is almost as worse as MGLM because it is very sensitive to the data structure and choice of tuning parameter; (iv) Geo-FARM shows great performance in detecting the nuisance rotations for all different scenarios. Therefore, our Geo-FARM shows its great power in both misalignment detection and parameter estimation. + +Next, we compare our Geo-FARM with the typical procedure that conducts the geodesic regression analysis on pre-aligned manifold valued data [39]. Specifically, for comparison with our Geo-FARM, the simulated pre-shapes are first aligned to their Karcher mean, then the MGLM is adopted to conduct the regression analysis on the pre-aligned data. Here the individual rotation angle $\psi_{i}$ is generated through $\psi_{i} = \tilde{\psi}_{i} * x_{i1}$ , where $\tilde{\psi}_{i}$ is uniformly generated from $[- \bar{\psi}, \bar{\psi}]$ . This simulation mechanism indicates that the nuisance transformations are correlated to the covariate information. The simulation results for all different scenarios are presented in Figure 5. It can be found that, our Geo-FARM outperforms the pre-alignment based approach in terms of + +the estimation accuracy, which means that our Geo-FARM benefits from the fact that the estimate of the nuisance transformation can be refined based on all the available information including pre-shapes and covariates. + +Finally, we investigate the robustness of our Geo-FARM in choosing the number of latent factors. Three different scenarios are considered here: $\bar{\psi} = 0$ , $\bar{\psi} = 10$ , and $\bar{\psi} = 20$ . We manually specified four different values for $q$ , i.e., 0, 1, 2, and 3, where 2 is the ground truth in our simulation settings. The four loss functions defined above are considered here as well. The simulation results for different choices of $q$ are presented in Figure 6. Couple of findings are listed here: (i) when no latent factors are specified in our Geo-FARM (an isotropic covariance structure used instead), the estimation performance gets worse and worse when the misalignment is getting severe; (ii) when the latent factor structure is considered but the number of factors is misspecified, the estimation performance of our Geo-FARM almost keeps the same as that when $q$ is set to the true value. Therefore, the latent factor structure in our Geo-FARM is of great importance while the choice of the number of factors is not that critical with respect to the estimation performance. + +![](images/d545e98fb1dc6ddc2bc80d04fee1d5aa373c965ab9b32b0a7cb9b2235aa01e9d.jpg) +(a) + +![](images/6f9cf73d52fcfddfc5239975dc79044afbe36e972874fde2d51bd5b18c74122f.jpg) +(b) +Figure 6. Comparison the performance of Geo-FARM for different choices of $q$ (i.e., 0, 1, 2, and 3, where 2 is the ground truth in our simulation settings) under three scenarios (Scenario A: $\bar{\psi} = 0$ , Scenario B: $\bar{\psi} = 10$ , and Scenario C: $\bar{\psi} = 20$ ): (a) Median SSGE; (b) Frobenius norm $\| B - \Gamma_{f(\hat{\mu})}^{f(\mu)}\hat{B}\| _F$ ; (c) geodesic distance between $f(\mu)$ and $f(\hat{\mu})$ ; and (d) MAD of $\triangle_{\psi}$ . + +![](images/02f72612927971bbe93df1f30d70cf7bd779bf3a79f804d1bb6281890e10c131.jpg) +(c) + +![](images/af306def8a9564a27a134ee2482010b416acd233f7341d007cd791e0e2b1ae57.jpg) +(d) + +# 3.3. Real data analysis + +Here we apply Geo-FARM on ADNI CC CC contour data, where the pre-shape data were extracted by removing the translation and scaling information from the original landmarks. In addition, three covariates of interest are included in the regression model, i.e., gender, age (standardized), diagnostic status (AD), and an interaction term $\mathrm{age} \times \mathrm{AD}$ . Then a sequence of estimated shapes from age 50 to age 95 is presented for each of the four subgroups (1. Male & NC; 2. Female & NC; 3. Male & AD; and 4. Female & AD) in Figure 7. + +![](images/a489988e78ffed88cca52f39e6b038e74bc23897dcfce9719a93b094652b1dd7.jpg) +Figure 7. Estimated shapes from age 55 (blue) to age 95 (red) is presented for each of the four subgroups (1. Male & NC; 2. Female & NC; 3. Male & AD; and 4. Female & AD). + +Comparing the sequences of estimated shapes from different sub-groups, some differences can be found between the normal control groups and AD groups. In order to investigate the relationship between the pre-shape responses and all the covariates of interest. The hypothesis testing problem is (16) considered and the test statistics along with the p-values are reported in Table 2. It can be found that, there are strong AD effect and age-dependent AD effect on the shape responses while the gender effect is not significant. + +Finally, we would like to compare the pre-aligned preshapes and the post-aligned pre-shapes derived from GeoFARM in terms of the mean shape. Here we adopt the bootstrap hypothesis testing approach through the R package shapes, where the number of bootstrap is set to 500. Then the test statistic is 0.0209 and the related p-value is 0.0412, + +Table 2. Hypothesis testing results. + +
genderageADage×AD
test stat.101.21118.37131.61128.75
p-value0.3650.06930.01110.0172
+ +which indicates that there is significant difference between the pre-aligned pre-shapes and the post-aligned pre-shapes in terms of the mean shape. In other word, our Geo-FARM does borrow covariate information in learning the nuisance transformations. + +# 4. Conclusion + +This paper proposes a geodesic factor regression model for misaligned pre-shape responses, where the additional nuisance rotational effects are built within the proposed model and learned based on both pre-shapes and covariates of interest. In addition, the spatial correlation structure is specified through a low dimensional representation including latent variables on the tangent space and isotropic error terms. Both Monte Carlo simulation studies and real data analysis on ADNI CC contour data show that the proposed model outperforms most existing approaches. + +# A. Preliminaries from differential geometry + +Let $\mathcal{M}$ be a $d_{\mathcal{M}}$ -dimensional complete Riemannian manifold with distance function $\mathrm{dist}_{\mathcal{M}}$ . We denote the tangent space at $y \in \mathcal{M}$ by $T_y\mathcal{M}$ and the inner product of $u, v \in T_y\mathcal{M}$ by $\langle u, v \rangle$ . For any $v \in T_y\mathcal{M}$ , there is a unique geodesic curve $\gamma : [0,1] \to \mathbb{R}$ , with initial conditions $\gamma(0) = y$ and $\gamma'(0) = v$ . The geodesic is only guaranteed to exist in a neighborhood of $y$ , where the largest neighborhood is denoted by $\mathcal{N}_y \in \mathcal{M}$ . The exponential map at $y$ , $\mathrm{Exp}(y, \cdot): T_y\mathcal{M} \to \mathcal{N}_y$ , is locally diffeomorphic and defined as $\mathrm{Exp}(y, v) = \gamma(1)$ . The log map $\mathrm{Log}(y, \cdot): \mathcal{N}_y \to T_y\mathcal{M}$ is defined as the inverse of exponential map. For any $y' \in \mathcal{N}_y$ , the Riemannian distance $\mathrm{dist}_{\mathcal{M}}(y, y') = \| \mathrm{Log}(y, y') \|$ . + +# References + +[1] K. Ahn, J. Derek Tucker, W. Wu, and A. Srivastava. Elastic handling of predictor phase in functional regression models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 324-331, 2018. +[2] GJ A Amaral, IL Dryden, and Andrew T A Wood. Pivotal bootstrap methods for k-sample problems in directional statistics and shape analysis. Journal of the American Statistical Association, 102(478):695-707, 2007. +[3] Alvin H Bachman, Sang Han Lee, John J Sirdtis, and Babak A Ardekani. Corpus callosum shape and size changes in early alzheimer's disease: a longitudinal mri study using the oasis brain database. Journal of Alzheimer's Disease, 39(1):71-78, 2014. +[4] Jérôme Bolte, Shoham Sabach, and Marc Teboulle. Proximal alternating linearized minimization for nonconvex and nonsmooth problems. Mathematical Programming, 146(1-2):459-494, 2014. +[5] Joseph-Fréderic Bonnans, Jean Charles Gilbert, Claude Lemarechal, and Claudia A Sagastizábal. Numerical optimization: theoretical and practical aspects. Springer Science & Business Media, 2006. +[6] F. L. Bookstein. Morphometric Tools for Landmark Data: Geometry and Biology. Cambridge University Press, 1991. +[7] Emil Cornea, Hongtu Zhu, Peter Kim, Joseph G Ibrahim, and Alzheimer's Disease Neuroimaging Initiative. Regression models on riemannian symmetric spaces. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(2):463-482, 2017. +[8] Luciano da Fona Costa and Roberto Marcond Cesar Jr. Shape classification and analysis: theory and practice. CRC Press, 2018. +[9] Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1):1-22, 1977. +[10] Ian L Dryden and Kanti V Mardia. Statistical shape analysis: with applications in $R$ , volume 995. John Wiley & Sons, 2016. +[11] Bradley Efron and Robert J Tibshirani. An introduction to the bootstrap. CRC press, 1994. +[12] Sahar Elahi, Alvin H Bachman, Sang Han Lee, John J Sirdis, Babak A Ardekani, and Alzheimer's Disease Neuroimaging Initiative. Corpus callosum atrophy rate in mild cognitive impairment and prodromal alzheimer's disease. Journal of Alzheimer's Disease, 45(3):921-931, 2015. +[13] Bruce Fischl. Freesurfer. Neuroimage, 62(2):774-781, 2012. +[14] P. T. Fletcher. Geodesic regression and the theory of least squares on riemannian manifolds. International journal of computer vision, 105(2):171-185, 2013. +[15] P Thomas Fletcher, Conglin Lu, Stephen M Pizer, and Sarang Joshi. Principal geodesic analysis for the study of nonlinear statistics of shape. IEEE transactions on medical imaging, 23(8):995-1005, 2004. + +[16] Søren Hauberg. Directional statistics with the spherical normal distribution. In 2018 21st International Conference on Information Fusion (FUSION), pages 704-711. IEEE, 2018. +[17] Jacob Hinkle, Prasanna Muralidharan, P Thomas Fletcher, and Sarang Joshi. Polynomial regression on riemannian manifolds. In European Conference on Computer Vision, pages 1-14. Springer, 2012. +[18] Matthew D Hoffman and Andrew Gelman. The no-turn sampler: adaptively setting path lengths in hamiltonian monte carlo. J. Mach. Learn. Res., 15(1):1593-1623, 2014. +[19] Chao Huang. Advanced Statistical Learning Methods for Heterogeneous Medical Imaging Data. PhD thesis, The University of North Carolina at Chapel Hill, 2019. +[20] Chao Huang, Martin Styner, and Hongtu Zhu. Clustering high-dimensional landmark-based two-dimensional shape data. Journal of the American Statistical Association, 110(511):946-961, 2015. +[21] D. G. Kendall, D. Barden, T. K. Carne, and H. Le. Shape and shape theory. Wiley, 1999. +[22] H. J. Kim, N. Adluru, M. D. Collins, M. K. Chung, B. B. Bendlin, S. C. Johnson, R. J. Davidson, and V. Singh. Multivariate general linear models (mglm) on riemannian manifolds with applications to statistical analysis of diffusion weighted images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2705-2712, 2014. +[23] Richard A Levine and George Casella. Implementations of the monte carlo em algorithm. Journal of Computational and Graphical Statistics, 10(3):422-439, 2001. +[24] Lizhen Lin, Niu Mu, Pokman Cheung, David Dunson, et al. Extrinsic gaussian processes for regression and classification on manifolds. Bayesian Analysis, 14(3):887-906, 2019. +[25] Lizhen Lin, Brian St. Thomas, Hongtu Zhu, and David B Dunson. Extrinsic local regression on manifold-valued data. Journal of the American Statistical Association, 112(519):1261-1273, 2017. +[26] Radford M. Neal. MCMC using Hamiltonian dynamics. In Steve Brooks, Andrew Gelman, Galin Jones, and Xiao-Li Meng, editors, Handbook of Markov Chain Monte Carlo, chapter 5, pages 113-162. Chapman and Hall/CRC, 2011. +[27] Lynn K Paul, Warren S Brown, Ralph Adolphs, J Michael Tyszka, Linda J Richards, Pratik Mukherjee, and Elliott H Sherr. Agenesis of the corpus callosum: genetic, developmental and functional aspects of connectivity. Nature Reviews Neuroscience, 8(4):287-299, 2007. +[28] Xavier Pennec. Intrinsic statistics on riemannian manifolds: Basic tools for geometric measurements. Journal of Mathematical Imaging and Vision, 25(1):127, 2006. +[29] Xavier Pennec, Stefan Sommer, and Tom Fletcher. Riemannian Geometric Statistics in Medical Image Analysis. Academic Press, 2019. +[30] William H Press, Saul A Teukolsky, William T Vetterling, and Brian P Flannery. Numerical recipes 3rd edition: The art of scientific computing. Cambridge university press, 2007. +[31] Salem Said, Hatem Hajri, Lionel Bombrun, and Baba C Vemuri. Gaussian distributions on riemannian symmetric + +spaces: statistical learning with structured covariance matrices. IEEE Transactions on Information Theory, 64(2):752-772, 2017. +[32] Xiaoyan Shi, Martin Styner, Jeffrey Lieberman, Joseph G Ibrahim, Weili Lin, and Hongtu Zhu. Intrinsic regression models for manifold-valued data. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 192-199. Springer, 2009. +[33] Ha-Young Shin and Hee-Seok Oh. Robust geodesic regression. arXiv preprint arXiv:2007.04518, 2020. +[34] C. G. Small. The Statistical Theory of Shape. Springer, 1996. +[35] Anuj Srivastava, Shantanu H Joshi, Washington Mio, and Xiuwen Liu. Statistical shape analysis: Clustering, learning, and testing. IEEE Transactions on pattern analysis and machine intelligence, 27(4):590-602, 2005. +[36] A. Srivastava and E. Klassen. Functional and Shape Data Analysis. Springer Series in Statistics, 2016. +[37] Dimosthenis Tsagkasoulis and Giovanni Montana. Random forest regression for manifold-valued responses. Pattern Recognition Letters, 101:6-13, 2018. +[38] Clement Vachet, Benjamin Yvernault, Kshamta Bhatt, Rachel G Smith, Guido Gerig, Heather Cody Hazlett, and Martin Styner. Automatic corpus callosum segmentation using a deformable active fourier contour model. In SPIE Medical Imaging, volume 8317, pages 831707-831707-7. International Society for Optics and Photonics, 2012. +[39] J. L. Wang, J. M. Chiou, and H. G. Müller. Functional data analysis. Annual Review of Statistics and Its Application, 3:257-295, 2016. +[40] Laurent Younes. *Shapes and diffeomorphisms*, volume 171. Springer, 2010. +[41] Miaomiao Zhang and Tom Fletcher. Probabilistic principal geodesic analysis. In Advances in Neural Information Processing Systems, pages 1178-1186, 2013. +[42] X. Zhang, X. Shi, Y. Sun, and L. Cheng. Multivariate regression with gross errors on manifold-valued data. IEEE transactions on pattern analysis and machine intelligence, 41(2):444-458, 2018. +[43] Youshan Zhang. Bayesian geodesic regression onriemannian manifolds. arXiv preprint arXiv:2009.05108, 2020. \ No newline at end of file diff --git a/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/images.zip b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..006e2a566792188cdcab964e7c983e36e0d6c358 --- /dev/null +++ b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77453bbd9ab2f42b939abc9fd2be5bf1225bb1415e944843c6fa3428d12ec68f +size 348471 diff --git a/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/layout.json b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..085a07bcd0e63cc06249e03878655ac1bf53157f --- /dev/null +++ b/geofarmgeodesicfactorregressionmodelformisalignedpreshaperesponsesinstatisticalshapeanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed54c8c50a6fc8d3bbfdb3d1a04c8fbb09de0de21d117b5e8675c6a7d880268c +size 590824 diff --git a/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_content_list.json b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c84459ece33421c8300ffa0bf4f3f8e717bb5a58 --- /dev/null +++ b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e335882881b0e14d5d499484453592d11706034640efe3947cdbbddd4a449042 +size 82876 diff --git a/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_model.json b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..46af9297d0148901fc6cb21d97e9f1ac5a1fca6d --- /dev/null +++ b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:271f7e77b5d3e453833c37d259b4cd90461b940eb5a602bd47d1f9c752350527 +size 106846 diff --git a/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_origin.pdf b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7fcfd3515fe7b33b868daddd0c0a49a4c082e887 --- /dev/null +++ b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/293edb5a-2107-407a-b017-c5c969e97ca4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ce897de6d7074978335f021cfc18fa332bce00d06d40ce37ff7687dda4ee6ff +size 4560300 diff --git a/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/full.md b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9ed6467aebf2663176cf86e96321e8517649659e --- /dev/null +++ b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/full.md @@ -0,0 +1,350 @@ +# GeoSim: Realistic Video Simulation via Geometry-Aware Composition for Self-Driving + +Yun Chen $^{1*}$ Frieda Rong $^{1,3*}$ Shivam Duggal $^{1*}$ Shenlong Wang $^{1,2}$ Xinchen Yan $^{1}$ Sivabalan Manivasagam $^{1,2}$ Shangjie Xue $^{1,4}$ Ersin Yumer $^{1}$ Raquel Urtasun $^{1,2}$ $^{1}$ Uber Advanced Technologies Group $^{2}$ University of Toronto $^{3}$ Stanford University $^{4}$ Massachusetts Institute of Technology + +{chenyuntc, shivamduggal.9507, skywalkeryxc, meyumer}@gmail.com, rongf@cs.stanford.edu, {slwang, manivasagam, urtasun}@cs.toronto.edu, sjxue@mit.edu + +# Abstract + +Scalable sensor simulation is an important yet challenging open problem for safety-critical domains such as self-driving. Current works in image simulation either fail to be photorealistic or do not model the 3D environment and the dynamic objects within, losing high-level control and physical realism. In this paper, we present GeoSim, a geometry-aware image composition process which synthesizes novel urban driving scenarios by augmenting existing images with dynamic objects extracted from other scenes and rendered at novel poses. Towards this goal, we first build a diverse bank of 3D objects with both realistic geometry and appearance from sensor data. During simulation, we perform a novel geometry-aware simulation-by-composition procedure which 1) proposes plausible and realistic object placements into a given scene, 2) renders novel views of dynamic objects from the asset bank, and 3) composes and blends the rendered image segments. The resulting synthetic images are realistic, traffic-aware, and geometrically consistent, allowing our approach to scale to complex use cases. We demonstrate two such important applications: long-range realistic video simulation across multiple camera sensors, and synthetic data generation for data augmentation on downstream segmentation tasks. Please check https://tmux.top/publication/geosim/ for high-resolution video results. + +# 1. Introduction + +Walking along an empty pavement on a silent Sunday morning, one can easily fantasize how busy it could look during rush hour on a weekday, or how a parked car might look when driving on a different street. Humans are capable of + +recreating the experience of visually perceiving objects and scenes to generate new visual data in their minds. Such an ability allows us to formulate novel scenarios and synthesize events in our heads without experiencing it directly. + +Researchers have devoted significant effort towards enhancing computers with the capability of creating pictures by replicating visual content [68]. This brings immense value to many industries, such as film making, robot simulation, augmented reality, and teleconferencing. In the literature, two main paradigms exist: computer graphics approaches and image editing methods. Computer graphics models the image generation process with physics, by first creating a virtual 3D world and then mimicking how light is transmitted within the world to produce a realistic scene rendering. + +To produce visually appealing results, physics-based rendering requires a significant amount of computing resources, costly manual asset creation, and physical modeling [1]. Images produced by existing real-time rendering engines [22, 53, 19], still have a significant realism gap, reducing their impact in robot simulation and data augmentation for training. Data-driven image editing methods such as image composition [38, 43, 16, 20, 5] and generative image synthesis [72, 75, 71, 11, 35, 56] have received significant attention over the past few years. They focus on pushing realism through generative models trained from large-scale visual data. However, most of the efforts do not correspond to an underlying realistic 3D world, and as a consequence, the generated 2D contents are not directly useful for applications such as 3D gaming and robot simulation. + +In this paper, we propose GeoSim, a realistic image manipulation framework that inserts dynamic objects into existing videos. GeoSim exploits a combination of both data-driven approaches and computer graphics to generate assets inexpensively while maintaining high visual quality through physically grounded simulation. In particular, by leveraging low-cost bounding box annotations and sensor data captured + +![](images/7696b4a456ac601249f642513ccc046c7196c346ee5e01b9f64b70fb342fe505.jpg) +Figure 1: Realistic video simulation via geometry-aware composition for self-driving. We proposed a novel data-driven image manipulation approach that inserts dynamic objects into existing videos. Our resulting synthetic video footages are highly realistic, layout-aware, and geometrically consistent, allowing image simulation to scale to complex use cases. + +![](images/7117bf36afdd802ab53b8b8b898b93e18319b78356600cd3a2a76b91b672be80.jpg) + +by a self-driving fleet driving around multiple U.S. cities, GeoSim builds a fully-textured large-scale 3D assets bank. While self-driving data is widely available [25, 9, 7, 64], it is non-trivial to automatically build these assets due to the sparsity of the 3D observations, occlusions, shadows, limited viewpoints, and lighting changes. Our asset reconstruction is robust to these challenges, as we ensure consistency across multiple observations in time and learn a strong shape prior to regularize our assets. GeoSim then exploits the 3D scene layout (from high-definition (HD) maps and LiDAR data) to add vehicles in plausible locations and make them behave realistically by considering the full scene. Finally, using this new 3D scene, GeoSim performs image-based rendering to properly handle occlusions, and neural network-based image in-painting to ensure the inserted object seamlessly blends in by filling holes, adjusting color inconsistencies due to lighting changes, and removing sharp boundaries. + +Using GeoSim, our resulting synthetic images and video footages are realistic, dynamically plausible, and geometrically consistent. We showcase two important applications: long-range realistic video simulation across multiple camera sensors and synthetic labeled data generation for training self-driving perception algorithms. Our approach outperforms prior work on both qualitative and quantitative realism metrics. We also see significant gains on perception performance when leveraging GeoSim images. These experiments suggest the potential of GeoSim for a plethora of applications, such as realistic safety verification, data augmentation, Sim2Real, augmented reality, and automatic video editing. + +# 2. Related Work + +Simulation for Robot Learning: Sensor simulation has received wide attention in the literature [60, 19, 59, 2, 61, 62, 6, 17, 74, 41, 62, 47] for its applications in training and evaluating robotic agents. Sensor simulation systems should be efficient and scalable in order to enable such applications. Many automatic approaches [61, 62, 17, 74, 41] have been proposed to generate indoor environments. Unconstrained outdoor scenes such as the urban driving setting tackled here + +bring additional challenges due to the scale of the scene, weather, lighting, presence of fast moving objects, and large viewpoint changes arising from sensor motion. In the context of autonomous driving, simulation engines [19, 60, 59] based on rendered 3D models allow the combinatorial generation of scenarios with varying configurations of vehicle attributes, traffic, and weather conditions. However, these methods often have limited diversity in scene content due to the manual design of 3D assets and still have a Real2Sim gap. Data-driven sensor simulation offers a scalable alternative that can capture the complexity of the real world. Many methods [46, 23, 67, 76, 4, 52] have been proposed to directly leverage real-world data for sensor simulation in the autonomous driving domain, typically by augmenting existing recorded data to generate corresponding sensor measurements for novel scene configurations. However, previous works either focus on LiDAR [52, 23, 67], rely on CAD model registration, constraining the set of dynamic objects that can be simulated [46], or require additional effort to scale to high-resolution images [76]. In contrast, we combine data-driven simulation techniques with the image-based rendering techniques in simulation engines. This enables us to construct a scalable, geometrically consistent, and realistic camera simulation system. + +Image Synthesis and Manipulation: Image synthesis and manipulation methods offer another route to sensor simulation. Existing work mainly focused on generating 2D images from intermediate representations including scene graphs [35, 30], surface normal maps [72], semantic segmentations [32, 82, 11, 71, 58, 56, 54], and images with different styles [37]. These methods create high-resolution images but with noticeable artifacts in texture and object shape. Rather than generating the full image in one shot, [49, 29, 44] utilize a conditional image generator for scene manipulation. In particular, [49] proposed a spatial-transformer GAN that overlays the target objects on top of existing scene layouts by iteratively adjusting 2D affine transformations. [29] introduced a hierarchical image generation pipeline that is capable of inserting and removing one object at a time. This + +![](images/92ef874370d5f9afaedc04615a612750cfcc83778cb048ab8df81b5ba9962c23.jpg) +Figure 2: Realistic 3D assets creation. Left: multi-view multi-sensor reconstruction network; Right: 3D asset samples. For each sample we show one of the source images and the 3D mesh. + +![](images/ced068a8cbb0656fcf2aa3c5188c1aa40fe09ca4d249bc5317d429b40541dd96.jpg) + +improves realism, but using purely a network-based image synthesis approach has difficulty handling complex physics such as lighting changes. [5] attempts to combine data driven approaches with graphics knowledge, using an image-based neural renderer and image decomposition to improve the synthetic result. Our work builds on this direction of leveraging graphics with real world data. We perform image-based rendering and neural in-painting to adjust for differences between the original image and the image texture of the inserted actor. Furthermore, GeoSim is 3D layout-aware, allowing for controllable and realistic scene modification. + +Video Synthesis and Manipulation: Image simulation alone is insufficient for generating new scenarios with realistic video. One way prior works have extended image synthesis approaches to video generation is by including the past and adding regularization to ensure temporal consistency for realistic object motion. Conditional video generation methods [70, 51, 8, 24] take sequential semantic masks, depth maps or trajectory pose data as inputs, which can then be semantically modified to generate the current video frame. [21] performs 2D-aware image composition via generative modeling of objects and learned dynamics. Automatic video manipulation approaches [45, 31] insert foreground objects or object videos into existing videos in a seamless manner. Unlike most prior work, our image-composition approach is 3D layout-aware and handles occlusions. Thus, by combining our image composition with automatic trajectory generation methods [63, 66], we easily extend to automatic and scalable controllable video simulation with high realism. + +3D Reconstruction and View Synthesis: Our neural network-based 3D asset creation step reconstructs 3D shape from camera imagery and LiDAR in order to synthesize novel views of dynamic objects. View synthesis and 3D reconstruction are well-studied open problems [68], with varying approaches on the relationship between geometry and appearance and possible geometric representations. Image-based rendering methods [27] focus on combining 2D textures to directly render novel views. Appearance flow-based approaches [81, 55, 65] seek to learn unconstrained pixel-level displacements, whereas [13, 83] encode geometric information in latent representations and [36] takes advantage + +of strong shape priors. Recently, advancements in differentiable rendering [50, 39] and open-source libraries have enabled classical graphics rendering to serve as anizable module, allowing for better learning of 3D and visual representations [12, 79]. + +# 3. Realistic 3D Assets Creation + +In this paper we propose a novel image manipulation approach that inserts dynamic objects into an existing video footage and generates a high-quality video of the augmented scene that is geometrically and semantically consistent with the scene. Key to the success of such an approach is the availability of realistic 3D assets that contain accurate pose, shape and texture. Here we argue that rather than using artists to create these assets, we can leverage data captured by self-driving vehicles to reconstruct the objects around us. This is a much more scalable approach, as many self-driving datasets are available [9, 64, 25], each containing many thousands of unique assets that could potentially be reconstructed. In Sec. 3.1 we first describe how we leverage both LiDAR and camera sensor data from multiple viewpoints to generate realistic 3D vehicle assets using an asset reconstruction network. Sec. 3.2 describes our self-supervised learning procedure to train the network. + +# 3.1. Multi-Sensor 3D Asset Reconstruction + +Reconstructing 3D dynamic objects in the wild is challenging: dynamic objects are often partially observed due to the sparsity of the sensor observations and occlusions, they are seen from a limited set of viewpoints, and they appear distorted due to lighting and shadows. To tackle these challenges, we propose a novel, learning-based, multi-view, multi-sensor reconstruction approach for 3D dynamic objects that does not require any ground-truth 3D-shape for training. Instead, we exploit weak annotations in the form of 3D bounding boxes, which are readily available in most self-driving datasets. + +More formally, let $\{\mathbf{B}_{i,j}\}_{\forall j}$ be the set of 3D bounding boxes where the i-th object is visible over $j$ views in the recorded snippet. Let $\{\mathbf{I}_{i,j}\}_{\forall j}$ be the associated set of cropped images, and $\{\mathbf{X}_{i,j}\}_{\forall j}$ be the associated set of li + +![](images/3a1125092d7113ec3ac8b69a3e458e510c206f10afff0e8634df6c6909b743fd.jpg) +Figure 3: 3D-aware object placement, segment retrieval, and temporal simulation. + +dar points recorded inside $\{\mathbf{B}_{i,j}\}$ , transformed to a single canonical frame and let $\mathbf{X}_i$ be the set of aggregated LiDAR points across all views. Our 3D reconstruction network then processes the LiDAR points and image inputs in two streams that are later fused to produce the shape of the object. We refer the reader to Fig. 2 for an illustration. We represent the shape as a 3D mesh $\mathbf{M}_i = \{\mathbf{V}_i, \mathbf{F}_i\}$ where $\mathbf{V}_i$ and $\mathbf{F}_i$ are the faces and vertices of the mesh, respectively. In addition, we also store $\{\mathbf{I}_{i,j}, \mathbf{S}_{i,j}\}_{\forall j}$ to encode object appearance, where $\mathbf{S}_{i,j}$ is the extracted object's silhouette obtained from a pre-trained instance segmentation model [40]. We use this later on to perform novel-view warping. + +Network Architecture: Our backbone consists of two submodules. A convolutional network takes each cropped camera image as input and outputs a corresponding feature map. The feature maps from multiple cameras are then aggregated into a one-dimensional latent representation using max-pooling. A similar latent representation is extracted from the input LiDAR point cloud using a PointNet network [57]. The LiDAR and camera features are then passed through an MLP to output the final shape. Instead of employing a learned PCA shape space from CAD models to predict the shape of cars [42], we take inspiration from [36] and parameterize the 3D shape as a category-specific canonical mean shape with per-vertex deformations. This parameterization encodes a categorical prior and ensures the completeness of the shape under partial observations. + +# 3.2. Self-Supervised Learning + +Note that we do not have supervision about the shape. We thus train our approach end-to-end in an self-supervised manner to obtain the parameters of the reconstruction network and the mean shape. Our training objective encodes the agreement between the 3D shape and the camera and LiDAR observations, as well as a regularization term. + +$$ +\ell_ {\mathrm {t o t a l}} = \sum_ {i} \{\ell_ {\mathrm {s i l}} (\mathbf {M} _ {i}; \mathbf {P} _ {i}, \mathbf {I} _ {i}) + \ell_ {\mathrm {l i d a r}} (\mathbf {M} _ {i}; \mathbf {X} _ {i}) + \ell_ {\mathrm {r e g}} (\mathbf {M} _ {i}) \} +$$ + +where $i$ ranges over all the training objects. The silhouette loss measures the consistency between the 2D silhouette (automatically generated using the state-of-the-art object segmentation method PointRend [40]) and the silhouette of + +the rendered 3D shape. + +$$ +\ell_ {\mathrm {s i l}} \left(\mathbf {M} _ {i}; \mathbf {P} _ {i}, \mathbf {I} _ {i}\right) = \sum_ {j} \left\| \mathbf {S} _ {i, j} - \tau \left(\mathbf {M} _ {\mathbf {i}, \mathbf {j}}, \mathbf {P} _ {\mathbf {i}, \mathbf {j}}\right) \right\| _ {2} ^ {2} +$$ + +where $\mathbf{S}_{\mathbf{i},\mathbf{j}} \in \mathbb{R}^{H \times W}$ is the 2D silhouette, $j$ ranges over multiple views, and $\tau(\mathbf{M},\mathbf{P})$ is a differentiable neural rendering operator [12] that renders a differentiable mask on the camera image given a projection matrix $\mathbf{P}$ . The LiDAR loss represents the consistency between the accumulated LiDAR point cloud and the mesh vertices, defined as the asymmetric Chamfer distance + +$$ +\ell_ {\text {l i d a r}} \left(\mathbf {M} _ {\mathbf {i}}, \mathbf {X} _ {\mathbf {i}}\right) = \sum_ {\mathbf {x} \in \mathbf {X} _ {i}} \min _ {\mathbf {v} \in \mathbf {V} _ {i}} \| \mathbf {x} - \mathbf {v} \| _ {2} ^ {2} +$$ + +In addition, we also minimize a set of regularizers to enforce prior knowledge over the predicted 3D shape, namely local smoothness on the vertices as well as normals. This includes 1) a Laplacian regularization which preserves local geometry and prevents intersecting faces; 2) mesh normal regularization which enforces smoothness of local surfaces; 3) edge regularization which penalizes long edges. Please refer to supp. material for details. + +# 4. Geometry-Aware Image Simulation + +Here we describe our image simulation by composition approach that places novel objects into an existing 3D scene and generates a high-quality video sequence of the composition. Our approach takes as input camera video footage, LiDAR point clouds, and an HD map in the form of a lane graph and automatically outputs a video with novel objects inserted into the scene. Note that the input sensory data and HD maps we employ are readily available in most self-driving platforms, which are the application domain we tackle in this paper. Importantly, our simulation takes into account both geometric occlusions by other actors and the background, plausibility of the locations and motions as well as the interactions with other dynamic agents and thus avoids collision for the newly inserted objects. + +Towards this goal, we first infer the location of all objects in the scene by performing 3D object detection and tracking [48]. For each new object to be inserted we select where to place it as well as which asset to use based on the HD + +map and the existing detected traffic. We then utilize an intelligent traffic model for our newly placed object such that its motion is realistic, takes into account the interactions with other actors and avoids collision. The output of this process defines the new scenario to be rendered. We then use a novel-view rendering with 3D occlusion reasoning w.r.t. all elements in the scene, to create the appearance of the novel objects in the new image. Finally, we utilize a neural network to fill in the boundary of the inserted objects, create any missing texture and handle inconsistent lighting. Fig. 1 outlines our approach. + +# 4.1. Scenario Generation + +We want to place new objects in existing images such that they are plausible in terms of their scale, location, orientation and motion. Towards this goal, we design a 3D sampling procedure, which takes advantage of the priors we have about how vehicles behave in our cities. Note that it is difficult to achieve similar levels of realism with 2D object insertion. We thus exploit HD maps that contain the location of the lanes in bird's eye view (BEV), and parameterize the object placement as a tuple $(x,y,\theta)$ defining the object center and orientation in BEV, which we later convert to a 6DoF pose using the local ground elevation. + +Note that our object samples should have realistic physical interactions with existing objects, respect the flow of traffic, and be visible in the camera's field of view. To achieve this, we randomly sample a placement $(x,y)$ from the lane regions lying within the camera's field of view and retrieve the orientation from the lane. We reject all samples that result in collision with other actors or background objects. The aforementioned process provides the placement of the object in the initial frame. To simulate plausible placements over time for video simulation, we use the Intelligent Driver Model (IDM) [63, 66] fitted to a kinematic model following [26], to update the simulated object's state for realistic interactions with surrounding traffic. Fig. 3 depicts the full procedure of placement and kinematics simulation. + +So far we have selected where to place an object and how is going to move, but we still need to select which object to place. In order to minimize the artifacts when rendering our assets, we propose to retrieve objects from the asset bank that were viewed with similar viewpoints and distance to the camera in the original footage. The former avoids the need to deal with large unseen object regions while the latter avoids utilizing assets that have been captured at lower resolution. Please refer to the supp. for the specific scoring criteria. Objects are then sampled (as opposed to a hard max) according to a categorical distribution weighted by their inverse score. Once a segment is retrieved for a desired placement, we perform collision checking using the retrieved object shape to ensure that the placement is valid. + +# 4.2. Occlusion-Aware Neural Rendering + +Now that we have selected a source object and its corresponding camera image based on the segment retrieval mechanism defined above, we proceed to render this source object into the target scene. Since the object's target pose might differ from the original observed poses, we cannot simply paste the image segment from the source to the target. Thus we proposed to utilize the asset's 3D shape to warp the source to the novel target view. + +Novel-view Warping: Let $\mathbf{M}$ be the selected object's 3D mesh, $\mathbf{I}_s$ be the source object's camera image, and $\mathbf{P}_s / \mathbf{P}_t$ be the source/target camera matrices. We first render $\mathbf{M}_s$ at the selected target viewpoint to generate the corresponding target depth map, $\mathbf{D}_t$ . Then using the rendered depth map and source camera image $\mathbf{I}_s$ , we generate the object's 2D texture map using the inverse warping operation [69, 33] as: + +$$ +\mathbf {I} _ {\mathrm {t}} = \mathbf {I} _ {\mathrm {s}} (\pi (\pi^ {- 1} (\mathbf {D} _ {\mathrm {t}}, \mathbf {P} _ {\mathrm {t}}), \mathbf {P} _ {\mathrm {s}})), \text {w h e r e} \quad \mathbf {D} _ {\mathrm {t}} = \psi (\mathbf {M}, \mathbf {P} _ {\mathrm {t}}), +$$ + +$\psi$ is a differentiable neural renderer [12] that produces a depth image given the 3D mesh $\mathbf{M}$ and camera matrix $\mathbf{P}$ ; $\pi$ is the perspective projection and $\pi^{-1}$ is the inverse projection that takes the depth image and camera matrix as input and outputs the 3D points. + +**Shadow Generation:** Inserting an object into a scene will not only change the pixels where the object is present, but can also change the rest of the scene (i.e. shadows and ambient occlusion). We improve the perceptual quality of the image by approximating these effects with image based rendering. While recent works [73, 78] learn shadow synthesis from scene context with a neural network, we render shadows with a graphics engine as geometry is available. To estimate the shadow casted by each inserted object, we construct a virtual scene with the inserted object and a ground plane and exploit image-based rendering [18], where the environment light comes from a real-world HDRI. We render the scene with and without the inserted objects, and add the shadow by blending in the background image intensities with the ratio of the two rendered images intensities. As lighting estimation by manually waving a shadow-casting stick [15] is not applicable, we select a cloudy HDRI to cast shadows. In practice, we find this produces reasonable results. Please refer to the supp. for illustration. + +Occlusion Reasoning: An inserted object must respect occlusions from the existing scene elements. Vegetation, fences, and other dynamic objects, for example, may have irregular or thin boundaries, complicating occlusion reasoning. We employ a simple strategy to determine occlusions of the inserted objects and their shadow in the target scene by comparing their depth w.r.t the depth map of the existing 3D scene (see Fig. 4). To achieve this, we first estimate the target image's dense depth map through a depth completion + +![](images/99cded56dfa9023fddb900d043ea68e9ff34998c89d2c5e8f0a29b5b1b4a8dcf.jpg) +Background Scene + Object + +![](images/2e36d315e3e04bf2dc0e8cc35a6fc697f0a5d843a7bac8cc0588c638f3649c19.jpg) +Dense Depth + +![](images/7b818f4895bb48c4c5c40c39b27555f9798043439fdda2d4e93ac64036a98e48.jpg) +Proposal Canvas +Figure 4: Geometry-aware composition with occlusion reasoning followed by an image synthesis module. + +![](images/a1b7b32a32cdf72e163b97185d005a37f93067f6a3f0cf533aeaa86fe84b30dd.jpg) +SynNet + +![](images/b6c141ff671b2cc0b409dcbcdb981d800ab57dfce685f7f852eb56ad7949113a.jpg) +Final Result + +network [14]. The input is the RGB image and a sparse depth map acquired by projecting the LiDAR sweep onto the image. Using the rendered depth of the object, the occlusion mask is then computed by evaluating for each object pixel if the target image's depth is smaller than the corresponding object pixel's depth. + +Post-Composition Synthesis: After occlusion reasoning, the rendered image may still look unrealistic as the inserted segment may have inconsistent illumination and colorbalancing w.r.t the target scene, discrepancies at the boundaries, and missing regions that were not available in the source view. To solve these issues, we leverage an image synthesis network to naturally blend the source segment to the target scene (see Fig. 4). Our network takes the target background image $\mathbf{B}_t$ , rendered target object $\mathbf{I}_t$ as well as the object binary silhouette $\mathbf{S}_t$ as input, and outputs the final image that naturally composes the background and rendered object. Our synthesis network architecture is similar to [77], which is a generative image in-painting network except that we take the rendered object mask as additional input. Our network is trained using images with instance segmentation masks inferred by [40] in the target scene. Data augmentation, including random occlusion, color jittering, random contrast and saturation is applied to mimic the differences among real-world images. Two loss functions are adopted, namely perceptual loss [34] to ensure the generated output's fidelity, as well as GAN loss to boost the realism of the in-painted region as well as the lighting consistency. Please refer to supp. for more details. + +# 5. Experimental Evaluation + +In this section we first introduce our experimental setting. We then compare GeoSim against a comprehensive set of image simulation baselines in visual realism through perceptual quality scores and human A/B tests, and in downstream tasks such as semantic segmentation. We also showcase our method generating multi-camera and temporally consistent video simulation. While our method can be adapted to handle most rigid objects, in our experiments we showcase vehicles, the most relevant objects in self driving. + +# 5.1. Experimental Details + +We utilize two large-scale self-driving datasets (UrbanData and Argoverse [9]) to showcase GeoSim. + +**UrbanData:** We collected a real-world dataset by having a fleet of self-driving cars drive in two major cities in North America. We labeled 16,500 snippets, where each snippet contains 25 seconds (~250 frames, sampled at $10\mathrm{Hz}$ ) of video with 7 cameras, a 64-beam LiDAR sensor, and HD maps. We use 4500 for reconstruction and synthesis network training, 7000 for depth completion training, and 5000 for perceptual quality and downstream evaluation. Please see supp. for the full breakdown. + +Argoverse: We also evaluate on the Argoverse training split which contains 65 snippets from 2 different cities. We use the provided HD maps for vehicle placement. We directly adopt the 3D assets built from UrbanData, as Argoverse is too small for diverse asset creation. We train our image synthesis network on Argoverse, where 80k frames are sampled for training and 16k are sampled for evaluation. + +Asset Bank Creation: We created automatically a large object bank of $\sim 8000$ vehicles, from cameras, LiDAR data and 3D bounding boxes using our 3D reconstruction network on UrbanData. Each successfully reconstructed object is registered in our 3D asset bank, with its 1) 3D mesh; 2) images; and 3) object pose in ego-vehicle-centric coordinates. We use a pre-trained instance segmentation to get the inferred instance mask [40], a LiDAR detector [48] to acquire other actors' bounding boxes for collision avoidance (Sec. 4.1), and a depth completion network [14] to get dense depth for occlusion reasoning (Sec. 4.2). + +Baselines: We compare our method against several deep learning based end-to-end 2D image synthesis and augmentation baselines [44, 71, 29, 56]. Unlike GeoSim, these methods cannot perform placement directly and require an input mask based on the object's shape and pose that denotes the area to synthesize. We therefore use [44] to insert object instances at the semantic level in a background semantic image. We then generate high resolution images from this augmented scene representation with three different approaches: (1) Holistic image generation ("SPADE"): we use the state-of-the-art conditional image generation model SPADE [56] to generate the entire image given the semantic mask. (2) Retrieval-based generation ("Cut-Paste"): given the new object's 2D mask, we retrieve the most similar example from a bank of 2D object images. The similarity is defined using + +![](images/e7cd3db68224ed17d6dac1f98f97c803e034d4c204c7ac375480a3b9dee47a1c.jpg) +SPADE + +![](images/3219ef75a29f0f004659ca0aab315de033d50b6fea60635cb34519d867f99d8e.jpg) +Guided-Editing + +![](images/17a2b5aa60f88925a7070b6b8bdbae795c0e66d3273d4c26c2dd80c35990e7cd.jpg) +Cut-Paste + +![](images/b848cc1a5f63872ae82148df69e26f71f4789887437de8b716042a83a9e80f8a.jpg) +CAD + +![](images/c478b64e9a504fc35cd2ae3463dcc189db643cc26deea7c49c72e597854a9957.jpg) +GeoSim + +![](images/1a191110e50dd722c7acf5a3fd703771aa9e67ce949ee99e7bf0b20e9f172aa2.jpg) + +![](images/cce1410c72193b6cc15a3bdbd2f26bfff21959f26a7fef52e85bc623923a4e00.jpg) + +![](images/b64a567c2dd1ee93c9364bf267e7494a916974314807d231b89b3e5b76f468b3.jpg) + +![](images/99718578d009deaa15a077c4d5c471caf370a7c41561ecb9ab7060f2b2a59fd0.jpg) + +![](images/d48292189156a8656c6ae6042f3a381184a851e03c18eb85afc0ca5e6dc301c2.jpg) + +![](images/94686b62c761d24eadf53376917afa0f982e257469547b0f595d64c533e4843c.jpg) +Figure 5: Qualitative comparison of image simulation approaches. + +![](images/1d12cc814ed0b9665b937af3f186841cff89957003a3521d59593d3f305ac2e6.jpg) + +![](images/05666480d5c1a5ee821b089abaf35eb7fe44b0507b87340c4d035b6a2de95a55.jpg) + +![](images/ee8274fd1dd61cc1ca09d6d8082392938c96c5c7661a4267bfcc3dc64faafad7.jpg) + +![](images/6642987f9d4c770b0bf371e075063e045e9f4346cf93db9dd4b69c7923f93a74.jpg) + +![](images/9734fbd3a83ebb33dd057ab0f8c07c23902e7eb56bf16db98f36506195991f72.jpg) +CAD + +![](images/3ab1b6b6d298c98e65ec728b16f297e58d3c95555fb6fd27c826624913fec766.jpg) +GeoSim + +![](images/7f773e22f1758b29b7eb03761ec99544d69247285768aeb127ea3db86136865b.jpg) + +![](images/74518b7fc8004200c06911f2c2658d211527c15b12068d7292a9a22b9b3641af.jpg) + +![](images/204409169851de32bc6391d18086c3b1437e025fbd49ae78349162cc6be23f52.jpg) +Figure 6: Qualitative comparison of image simulation approaches on Argoverse dataset. + +![](images/9d15eeee5433d43cd81aba2fa3909ed2b9496b46d3b71e2f1b9de9d3ba34a924.jpg) + +semantic mask IOU. The rest of the background comes from the corresponding real image; and (3) Guided semantic image editing ("Guided-Editing"): we use [29] to in-paint the tight bounding box region of the added object. Additionally, we compare against a graphics-based CAD model insertion baseline ("CAD"), in spirit of [3] with the following differences: 1) we use our 3D placement in order to produce more realistic layout-aware insertion; 2) unlike the original work, we do not have environment lighting maps and instead use a HDRI captured on a cloudy day. + +# 5.2. Perceptual Quality Evaluation + +Human Study: To verify the realism of our approach, we conduct a human A/B test, where we show a pair of images + +generated from different approaches on the same background image, one from GeoSim and another one from a competing algorithm. We then ask the human judges to click the one they believe is more realistic. In total, 13 human judges participated and labeled $\sim 1500$ image pairs. Tab. 1 shows the human preference score for each algorithm, which measures the percentage of participants who prefer our GeoSim results over each baseline method. Results on Argoverse are presented in Tab. 3. The A/B test confirms that our method produces drastically more realistic images than the baselines. The minimum $p$ -value in the A/B test is $1.64\mathrm{e}\text{-} 18$ , demonstrating statistical significance. Please see the detailed A/B test interface and instructions in supp. + +Perceptual Quality Score: We further use the Fréchet Inception Distance (FID) [28] between the synthesized images and the ground-truth images as an automatic measure of image quality. We report the FID on the full image for GeoSim and the baselines in Tab. 1. Our method significantly outperforms all competing methods on FID. + +Qualitative Comparison: Fig. 5 compares simulated images. Note that GeoSim is significantly more realistic than the baselines. While one can easily and quickly detect the added object in other methods due to unrealistic generation with smeared cars ("SPADE", "Guided-Editing"), or geometrically invalid results ("Cut-Paste"), or unrealistic appearance ("CAD"), one must look closely at GeoSim images to distinguish the added objects from the real ones. In Fig. 6, we show qualitative examples on Argoverse, where GeoSim obtains very high visual quality. This demonstrates GeoSim's potential to generalize across datasets. + +Effect of Rendering Approach: We evaluate the importance of using a hybrid rendering module proposed in our method, compared to using solely physics-based rendering or 2D synthesis with 3D placement constant across all approaches). As shown in Tab. 2, our proposed geometry-aware + +
MethodHuman Score (%)FID
SPADE [56]99.343.2
Guided Editing [29]94.320.3
Cut-Paste [20]98.522.1
CAD [2]94.317.3
GeoSim-14.3
+ +Table 1: Perceptual quality evaluation. Human score: % of participants who prefer our GeoSim results over baseline. + +
ApproachShadowHuman Score (%)FID
PhysicsYes94.217.3
2D Synthesis-75.713.7
Geo SynthesisNo71.913.7
Geo SynthesisYes-14.3
+ +Table 2: Ablation on rendering options for GeoSim. Human score: % of participants who prefer our GeoSim results over baseline. + +
MethodHuman Score (%)FID
CAD84.028.3
GeoSim-24.5
+ +synthesis significantly outperforms all other approaches on human scores. Additionally, enhancing hybrid-rendering with shadows significantly boosts the realism for humans, but such improvements are not reflected in FID score. This suggests there still exists a gap between computational perceptual quality measurements and humans' criteria. Please see supp. for ablation of other GeoSim components. + +Video Simulation: We showcase in the supp. video GeoSim's ability to simulate highly realistic and temporally consistent video for multiple cameras. + +Failure Cases: While most GeoSim-simulated images are high-quality, there is room for improvement. We find four major failure cases: (1) incorrect occlusion relationships in a complex scene, (2) irregular reconstructed mesh, (3) inaccurate object pose, usually caused by map error and (4) illumination failure due to illumination differences between rendered segment and target scene. Besides, we also notice blank pixel artifacts in long range video simulation, which are caused by inverse warping textures from source viewpoints which are far from the target viewpoint. Please refer to the supp. for qualitative examples. + +# 5.3. Downstream Perception Task + +We now investigate data augmentation, where we use labeled real data combined with GeoSim to get performance + +Table 3: Results on Argoverse. Human score: % of participants who prefer our GeoSim results over baseline. + +
MethodPSPNet [80]DeepLabv3 [10]
mIOUcarIOUmIOUcarIOU
Real93.587.894.088.7
Real+GeoSim95.391.294.289.2
+ +Table 4: Sim2Real on semantic segmentation. + +![](images/68229dff21c9e29a89c1b9c44927856646a34136653d2d7e59caf9286ad9b38d.jpg) +Figure 7: GeoSim for data augmentation. Left: image before augmentation. Middle: image after augmentation. Right: augmented semantic annotation. + +gains, without the cost of large scale annotations (as seen in Fig. 7). We first train a segmentation model on labeled real data with around 2000 images. We then use GeoSim to augment these images with inserted vehicles, obtaining 9879 additional training examples in total. We re-train the segmentation model on both real and augmented data for the same number of iterations. We evaluate the performance on real data and report the results on Tab. 4. With these additional training images, we can further boost perception performance by $3.4\%$ (or $0.4\%$ on DeepLabv3 [10]) for car category and $1.8\%$ (or $0.2\%$ on DeepLabv3 [10]) for overall mIOU on PSPNet [80]. Importantly we can show consistent improvements across two segmentation models. + +# 6. Conclusion + +In this work we presented a novel geometry-guided simulation procedure for flexible generation and rendering of synthetic scenes. Not only is our approach the first of its kind to fully take into consideration physical realism for dynamic object placement into images, it also bypasses the need for manual 3D asset creation and achieves greater visual realism than competing alternatives. Moreover, we demonstrated improvements in downstream tasks through applications of our technique to semantic segmentation. There are many exciting follow-up directions opened up by this work such as sim2real, autonomous system evaluation, video editing, etc. and we look forward to future extensions of GEOsIM. + +# References + +[1] Corona renderer, 2020. 1 +[2] Hassan Abu Alhaija, Siva Karthik Mustikovela, Lars Mescheder, Andreas Geiger, and Carsten Rother. Augmented Reality Meets Computer Vision: Efficient Data Generation for Urban Driving Scenes. arXiv, 2017. 2, 8 +[3] Hassan Abu Alhajja, Siva Karthik Mustikovela, Lars Mescheder, Andreas Geiger, and Carsten Rother. Augmented reality meets computer vision: Efficient data generation for urban driving scenes. IJCV, 2018. 7 +[4] Alexander Amini, Igor Gilitschenski, Jacob Phillips, Julia Moseyko, Rohan Banerjee, Sertac Karaman, and Daniela Rus. Learning Robust Control Policies for End-to-End Autonomous Driving From Data-Driven Simulation. RA-L, 2020. 2 +[5] Anand Bhattachad and David A Forsyth. Cut-and-paste neural rendering. arXiv, 2020. 1, 3 +[6] Konstantinos Bousmalis, Alex Irpan, Paul Wohlhart, Yunfei Bai, Matthew Kelcey, Mrinal Kalakrishnan, Laura Downs, Julian Ibarz, Peter Pastor, Kurt Konolige, et al. Using simulation and domain adaptation to improve efficiency of deep robotic grasping. In ICRA, 2018. 2 +[7] 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. arXiv, 2019. 2 +[8] Caroline Chan, Shiry Ginosar, Tinghui Zhou, and Alexei A Efros. Everybody dance now. In CVPR, 2019. 3 +[9] Ming-Fang Chang, John W Lambert, Patsorn Sangkloy, Jagjeet Singh, Slawomir Bak, Andrew Hartnett, De Wang, Peter Carr, Simon Lucey, Deva Ramanan, and James Hays. Argoverse: 3d tracking and forecasting with rich maps. In CVPR, 2019. 2, 3, 6 +[10] Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. arXiv, 2017. 8 +[11] Qifeng Chen and Vladlen Koltun. Photographic Image Synthesis with Cascaded Refinement Networks. arXiv, 2017. 1, 2 +[12] Wenzheng Chen, Jun Gao, Huan Ling, Edward Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to predict 3d objects with an interpolation-based differentiable renderer. In NIPS, 2019. 3, 4, 5 +[13] Xu Chen, Jie Song, and Otmar Hilliges. Monocular Neural Image Based Rendering with Continuous View Control. arXiv, 2019. 3 +[14] Yun Chen, Bin Yang, Ming Liang, and Raquel Urtasun. Learning joint 2d-3d representations for depth completion. In ICCV, 2019. 6 +[15] Yung-Yu Chuang, Dan B Goldman, Brian Curless, David H. Salesin, and Richard Szeliski. Shadow matting and compositing. ACM Trans. Graph., 2003. 5 +[16] Wenyan Cong, Jianfu Zhang, Li Niu, Liu Liu, Zhixin Ling, Weiyuan Li, and Liqing Zhang. Dovenet: Deep image harmonization via domain verification. In CVPR, 2020. 1 + +[17] Erwin Coumans and Yunfei Bai. Pybullet, a python module for physics simulation for games, robotics and machine learning. *GitHub repository*, 2016. 2 +[18] Paul Debevec. Rendering synthetic objects into real scenes: Bridging traditional and image-based graphics with global illumination and high dynamic range photography. In Proceedings of the 25th Annual Conference on Computer Graphics and Interactive Techniques, 1998. 5 +[19] Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. Carla: An open urban driving simulator. In Conference on robot learning, 2017. 1, 2 +[20] Debidatta Dwibedi, Ishan Misra, and Martial Hebert. Cut, paste and learn: Surprisingly easy synthesis for instance detection. In ICCV, 2017. 1, 8 +[21] Sébastien Ehrhardt, Oliver Groth, Aron Monszpart, Martin Engelcke, Ingmar Posner, Niloy Mitra, and Andrea Vedaldi. Relate: Physically plausible multi-object scene synthesis using structured latent spaces. NeurIPS, 2020. 3 +[22] Epic Games. Unreal engine. 1 +[23] Jin Fang, Dingfu Zhou, Feilong Yan, Tongtong, Feihu Zhang, Yu Ma, Liang Wang, and Ruigang Yang. Augmented LiDAR Simulator for Autonomous Driving. arXiv, 2019. 2 +[24] Oran Gafni, Lior Wolf, and Yaniv Taigman. Vid2game: Controllable characters extracted from real-world videos. arXiv, 2019. 3 +[25] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The kitti dataset. *IJRR*, 2013, 2, 3 +[26] J Gonzales, F Zhang, K Li, and F Borrelli. Autonomous drifting with onboard sensors. In Advanced Vehicle Control: Proceedings of the 13th International Symposium on Advanced Vehicle Control (AVEC16), 2016. 5 +[27] Peter Hedman, Julien Philip, True Price, Jan-Michael Frahm, George Drettakis, and Gabriel Brostow. Deep blending for free-viewpoint image-based rendering. TOG, 2018. 3 +[28] 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. arXiv, 2017. 7 +[29] Seunghoon Hong, Xinchen Yan, Thomas Huang, and Honglak Lee. Learning Hierarchical Semantic Image Manipulation through Structured Representations. arXiv, 2018. 2, 6, 7, 8 +[30] Seunghoon Hong, Dingdong Yang, Jongwook Choi, and Honglak Lee. Inferring semantic layout for hierarchical text-to-image synthesis. In CVPR, 2018. 2 +[31] Abdul-Wahab Sami Ibrahim and Sarab Mhamed Taher. Inserting virtual static object with geometry consistency into real video. In Journal of Physics: Conference Series, 2020. 3 +[32] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. 2 +[33] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial Transformer Networks. arXiv, 2016. 5 +[34] Justin Johnson, Alexandre Alahi, and Fei-Fei Li. Perceptual losses for real-time style transfer and super-resolution. CoRR, 2016. 6 + +[35] Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. In CVPR, 2018. 1, 2 +[36] Angjoo Kanazawa, Shubham Tulsiani, Alexei A. Efros, and Jitendra Malik. Learning Category-Specific Mesh Reconstruction from Image Collections. arXiv, 2018. 3, 4 +[37] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. 2 +[38] Kevin Karsch, Varsha Hedau, David Forsyth, and Derek Hoiem. Rendering synthetic objects into legacy photographs. TOG, 2011. 1 +[39] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3D Mesh Renderer. arXiv, 2017. 3 +[40] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In CVPR, 2020. 4, 6 +[41] Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. Ai2-thor: An interactive 3d environment for visual ai. arXiv, 2017. 2 +[42] Abhijit Kundu, Yin Li, and James M. Rehg. 3d-rcnn: Instance-level 3d object reconstruction via render-and-compare. In CVPR, 2018. 4 +[43] Jean-François Lalonde, Derek Hoiem, Alexei A Efros, Carsten Rother, John Winn, and Antonio Criminisi. Photo clip art. TOG, 2007. 1 +[44] Donghoon Lee, Sifei Liu, Jinwei Gu, Ming-Yu Liu, Ming-Hsuan Yang, and Jan Kautz. Context-aware synthesis and placement of object instances. In NIPS, 2018. 2, 6 +[45] D. Lee, T. Pfister, and M. Yang. Inserting videos into videos. In CVPR, 2019. 3 +[46] Wei Li, Chengwei Pan, Rong Zhang, Jiaping Ren, Yuexin Ma, Jin Fang, Feilong Yan, Qichuan Geng, Xinyu Huang, Huajun Gong, Weiwei Xu, Guoping Wang, Dinesh Manocha, and Ruigang Yang. AADS: Augmented Autonomous Driving Simulation using Data-driven Algorithms. Science Robotics, 2019. 2 +[47] Xueting Li, Sifei Liu, Kihwan Kim, Xiaolong Wang, Ming-Hsuan Yang, and Jan Kautz. Putting humans in a scene: Learning affordance in 3d indoor environments. In CVPR, 2019. 2 +[48] Ming Liang, Bin Yang, Wenyuan Zeng, Yun Chen, Rui Hu, Sergio Casas, and Raquel Urtasun. Pnpnet: End-to-end perception and prediction with tracking in the loop. In CVPR, 2020. 4, 6 +[49] Chen-Hsuan Lin, Ersin Yumer, Oliver Wang, Eli Shechtman, and Simon Lucey. ST-GAN: Spatial Transformer Generative Adversarial Networks for Image Compositing. arXiv, 2018. 2 +[50] Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. Soft Rasterizer: A Differentiable Renderer for Image-based 3d Reasoning. arXiv, 2019. 3 +[51] Arun Mallya, Ting-Chun Wang, Karan Sapra, and Ming-Yu Liu. World-consistent video-to-video synthesis. In ECCV, 2020.3 +[52] Sivabalan Manivasagam, Shenlong Wang, Kelvin Wong, Wenyuan Zeng, Mikita Sazanovich, Shuhan Tan, Bin Yang, Wei-Chiu Ma, and Raquel Urtasun. Lidarsim: Realistic lidar simulation by leveraging the real world. CVPR, 2020. 2 + +[53] Mark Martinez, Chawin Sitawarin, Kevin Finch, Lennart Meincke, Alex Yablonski, and Alain Kornhauser. Beyond grand theft auto v for training, testing and enhancing deep learning in self driving cars. arXiv, 2017. 1 +[54] Sangwoo Mo, Minsu Cho, and Jinwoo Shin. Instagram: Instance-aware image-to-image translation. arXiv, 2018. 2 +[55] Eunbyung Park, Jimei Yang, Ersin Yumer, Duygu Ceylan, and Alexander C. Berg. Transformation-Grounded Image Generation Network for Novel 3d View Synthesis. arXiv, 2017. 3 +[56] Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In CVPR, 2019. 1, 2, 6, 8 +[57] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. arXiv, 2016. 4 +[58] Xiaojuan Qi, Qifeng Chen, Jiaya Jia, and Vladlen Koltun. Semi-parametric Image Synthesis. arXiv, 2018. 2 +[59] Stephan R. Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun. Playing for Data: Ground Truth from Computer Games. arXiv, 2016. 2 +[60] 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. 2 +[61] Manolis Savva, Angel X Chang, Alexey Dosovitskiy, Thomas Funkhouser, and Vladlen Koltun. Minos: Multimodal indoor simulator for navigation in complex environments. arXiv, 2017. 2 +[62] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In ICCV, 2019. 2 +[63] Jens Schulz, Constantin Hubmann, Julian Löchner, and Darius Burschka. Interaction-Aware Probabilistic Behavior Prediction in Urban Environments. arXiv, 2018. 3, 5 +[64] 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. 2, 3 +[65] Shao-Hua Sun, Minyoung Huh, Yuan-Hong Liao, Ning Zhang, and Joseph J Lim. Multi-view to novel view: Synthesizing novel views with self-learned confidence. In ECCV, 2018.3 +[66] Simon Suo, Sebastian Regalado, Sergio Casas, and Raquel Urtasun. Trafficsim: Learning to simulate realistic multi-agent behaviors. arXiv, 2021. 3, 5 +[67] Abhijeet Tallavajhula, Cetin Mericli, and Alonzo Kelly. Off-road lidar simulation using data driven terrain primitives. In ICRA, 2018. 2 +[68] Ayush Tewari, Ohad Fried, Justus Thies, Vincent Sitzmann, Stephen Lombardi, Kalyan Sunkavalli, Ricardo MartinBrualla, Tomas Simon, Jason Saragih, Matthias NieBner, Rohit Pandey, Sean Fanello, Gordon Wetzstein, Jun-Yan Zhu, Christian Theobalt, Maneesh Agrawala, Eli Shechtman, Dan B. Goldman, and Michael Zollhöfer. State of the Art on Neural Rendering. arXiv, 2020. 1, 3 + +[69] Shubham Tulsiani, Richard Tucker, and Noah Snavely. Layer-structured 3d scene inference via view synthesis. In ECCV, 2018. 5 +[70] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. In NeurIPS, 2018. 3 +[71] 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. arXiv, 2017. 1, 2, 6 +[72] Xiaolong Wang and Abhinav Gupta. Generative image modeling using style and structure adversarial networks. In ECCV, 2016. 1, 2 +[73] Yifan Wang, Brian Curless, and Steve Seitz. People as Scene Probes. arXiv, 2020. 5 +[74] Fei Xia, Amir R. Zamir, Zhiyang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson Env: Real-World Perception for Embodied Agents. In CVPR, 2018. 2 +[75] Chao Yang, Xin Lu, Zhe Lin, Eli Shechtman, Oliver Wang, and Hao Li. High-Resolution Image Inpainting using MultiScale Neural Patch Synthesis. arXiv, 2016. 1 +[76] Zhenpei Yang, Yuning Chai, Dragomir Anguelov, Yin Zhou, Pei Sun, Dumitru Erhan, Sean Rafferty, and Henrik Kretzschmar. SurfelGAN: Synthesizing Realistic Sensor Data for Autonomous Driving. arXiv, 2020. 2 +[77] Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas Huang. Free-Form Image Inpainting with Gated Convolution. arXiv, 2019. 6 +[78] Shuyang Zhang, Runze Liang, and Miao Wang. Shadowgan: Shadow synthesis for virtual objects with conditional adversarial networks. Computational Visual Media, 2019. 5 +[79] Yuxuan Zhang, Wenzheng Chen, Huan Ling, Jun Gao, Yinan Zhang, Antonio Torralba, and Sanja Fidler. Image gans meet differentiable rendering for inverse graphics and interpretable 3d neural rendering. arXiv, 2020. 3 +[80] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017. 8 +[81] Tinghui Zhou, Shubham Tulsiani, Weilun Sun, Jitendra Malik, and Alexei A. Efros. View Synthesis by Appearance Flow. arXiv, 2016. 3 +[82] 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 +[83] Jun-Yan Zhu, Zhoutong Zhang, Chengkai Zhang, Jiajun Wu, Antonio Torralba, Joshua B. Tenenbaum, and William T. Freeman. Visual Object Networks: Image Generation with Disentangled 3D Representation. arXiv, 2018. 3 \ No newline at end of file diff --git a/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/images.zip b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..879ac067ca2640aa26fc37556e10eb7bdb6bf3cb --- /dev/null +++ b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71bb4d2c471f5cc11eb9a2e5452877af8a4dca9fa48d7ff2ea64510237249219 +size 571747 diff --git a/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/layout.json b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c082324b8af0332d38932274bc53cd731cc6e28e --- /dev/null +++ b/geosimrealisticvideosimulationviageometryawarecompositionforselfdriving/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b42ed92d16490e1168a636ed5d88d5aef126674b97c2c6e7d72b0a0bcbb88eb +size 419672 diff --git a/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_content_list.json b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..65a07c134d795d275248b9e9ee0238a43bf426ad --- /dev/null +++ b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:963f7ecd5b2aef40fbfb6e0cf2884d1826977d31328187696e37fe771d3e2055 +size 76992 diff --git a/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_model.json b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ff11f594535282a7f0fc6648a18cbabc6d1a7bd3 --- /dev/null +++ b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00b77019be2eb16923e80e1da552fbf8a69bc1d7098cce5198b5faf8dc256613 +size 92513 diff --git a/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_origin.pdf b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9431869ead3c253fc2c3a2352b70cb6b033aaf11 --- /dev/null +++ b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/16ddc3cc-0b5b-44d4-a202-1a4603354cbe_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca6ffefb212db81467550914214bae78e4528e1a81f24d04a3b143792a8638b1 +size 1935967 diff --git a/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/full.md b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a9dc4de8e7394f0b7729fb327086b5465808f17c --- /dev/null +++ b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/full.md @@ -0,0 +1,299 @@ +# Glance and Gaze: Inferring Action-aware Points for One-Stage Human-Object Interaction Detection + +Xubin Zhong $^{1}$ Xian Qu $^{1}$ Changxing Ding $^{1,2*}$ Dacheng Tao $^{3}$ + +$^{1}$ South China University of Technology $^{2}$ Pazhou Lab, Guangzhou $^{3}$ The University of Sydney + +{eexubin, eequxian.scut}@mail.scut.edu.cn, chxding@scut.edu.cn, dacheng.tao@sydney.edu.au + +# Abstract + +Modern human-object interaction (HOI) detection approaches can be divided into one-stage methods and two-stage ones. One-stage models are more efficient due to their straightforward architectures, but the two-stage models are still advantageous in accuracy. Existing one-stage models usually begin by detecting predefined interaction areas or points, and then attend to these areas only for interaction prediction; therefore, they lack reasoning steps that dynamically search for discriminative cues. In this paper, we propose a novel one-stage method, namely Glance and Gaze Network (GGNet), which adaptively models a set of action-aware points (ActPoints) via glance and gaze steps. The glance step quickly determines whether each pixel in the feature maps is an interaction point. The gaze step leverages feature maps produced by the glance step to adaptively infer ActPoints around each pixel in a progressive manner. Features of the refined ActPoints are aggregated for interaction prediction. Moreover, we design an action-aware approach that effectively matches each detected interaction with its associated human-object pair, along with a novel hard negative attentive loss to improve the optimization of GGNet. All the above operations are conducted simultaneously and efficiently for all pixels in the feature maps. Finally, GGNet outperforms state-of-the-art methods by significant margins on both V-COCO and HICODET benchmarks. Code of GGNet is available at https://github.com/SherlockHolmes221/GGNet. + +# 1. Introduction + +Human-Object Interaction (HOI) detection is one of the fundamental tasks in human-centric scene understanding. It involves not only detecting persons and objects in an image, but also the interactions (verbs) between each human-object pair. The output of an HOI detection model can be represented as a set of triplets in the form of , and each triplet is also referred to as a single HOI category. For example, there are two HOI categories in Figure 1, i.e. and . + +According to the order in which object detection and interaction detection is performed, modern HOI detection methods can be divided into one-stage and two-stage approaches. Two-stage methods must perform the object detection first and then identify the interactions between each possible human-object pair. However, because the two stages are separated in this approach, these methods are usually inefficient. By contrast, one-stage methods can per + +form object detection and interaction detection in parallel by first defining interaction areas (e.g. a union box or a single point). Generally speaking, one-stage methods tend to be more efficient and structurally elegant, but two-stage methods are more accurate at present. + +One of the key issues for one-stage methods is the way to represent the "interaction area" for each human-object pair [1]. Existing approaches usually define this area artificially and the interaction area often face the semantic ambiguity problem. For example, as shown in Figure 1(a), InteractNet [3] utilizes a human bounding box to represent the area of all interactions involving the person, meaning that object-specific information is ignored. UnionDet [1] addresses this problem by utilizing the union box for each human-object pair as their interaction region. However, union boxes may overlap significantly with each other (Figure 1(b)), which introduces ambiguity between pairs. For its part, PPDM [10] utilizes the middle point of each human-object pair as the interaction point (Figure 1(c)). Although interaction points are less likely to overlap with each other under this approach, a single interaction point is often vague to represent complex interactions between a human-object pair. + +With the predefined interaction areas discussed above, existing one-stage methods usually attend to the interaction area only once to predict the interaction categories. Recent works [24], [26] have revealed that the eyes of human beings usually move around an object to discover more cues regarding its location. Similarly, when it comes to HOI detection, people often first glance at the scene to identify possible human-object pairs with any interaction; they then search for cues around each pair, and finally gaze at discriminative areas to identify the interaction class. + +Accordingly, inspired by the above observation, we herein propose a novel model, named Glance and Gaze Network (GGNet), which adaptively infers a set of action-aware points (ActPoints) to represent the interaction area (Figure 1(d)). GGNet mimics the two steps taken by humans to identify human-object interactions: Glance and Gaze. First, GGNet quickly determines whether each pixel in the feature maps is an interaction point; we call it the glance step. Based on the feature maps in the glance step, the subsequent gaze step searches for a set of ActPoints around each pixel. This step then progressively proceeds to refine the location of these ActPoints. In brief, this step comprises two sub-steps, in which the coarse location and location residuals of ActPoints are inferred, respectively. Finally, GGNet aggregates features of the refined ActPoints to predict interaction categories at the interaction points. + +We further propose an action-aware point matching (APM) approach designed to match each interaction with its associated human-object pair. This matching process specifies the location of both the human and object instances for each interaction. Existing interaction point-based methods + +tend to employ a single location regressor shared by all interaction categories [10], [20]; however, we observe that the interaction category affects the spatial layout of one human-object pair. We accordingly propose to assign each interaction category a unique location regressor, which is proven in the experimentation section to be a more effective approach. + +Finally, we propose a novel focal loss, namely Hard Negative Attentive (HNA) loss, to further promote the performance of GGNet. As there are massive numbers of negative samples for each interaction classifier of the interaction point-based methods [10], [20], a serious imbalance problem exists between the positive and negative samples for each interaction category. We thus develop an efficient approach to address this problem by inferring and highlighting hard negative samples. Hard negatives are inferred between meaningful HOI categories containing the same object. For example, we can infer a hard negative sample "repair bicycle" according to the labeled positive sample "carry bicycle", unless "repair bicycle" is labeled as positive; in this way, the decision boundary between easily confused interaction categories can be clarified. + +Both APM and HNA loss can be readily applied to other interaction point-based HOI detection methods. We conduct extensive experiments on the two most popular HOI detection databases, i.e. V-COCO [31] and HICO-DET [30]. Experimental results demonstrate that our proposed GGNet consistently outperforms start-of-the-art methods. + +# 2. Related Works + +Two-Stage Methods. Most existing HOI detection methods belong to the two-stage category. These methods typically perform object detection first, then pair the human and object proposals for interaction recognition. Various types of features are utilized to promote the detection accuracy: for example, human-object spatial feature encoded using their bounding box locations are widely adopted in two-stage methods [5], [6], [7], [11], [34], [13], [12]. In line with this, Liu et al. [8] introduced a mechanism that encodes the fine-grained spatial layout of human-object pairs. The spatial layout is obtained using human parsing and object segmentation tools. Wan et al. [7] and Zhou et al. [16] utilized key points on the human body to crop human part features. Different model structures have also been developed to promote HOI detection performance. For example, several recent works have utilized graph convolutional networks to integrate human and object appearance features [11], [19], [21], [9]. Moreover, Gao et al. [12] and Wang et al. [13] made use of attention mechanisms to capture context information. Other works have also investigated the semantic meaning of verbs and the relationships between them: for example, Zhong et al. [14, 38] promoted HOI detection accuracy by overcoming the so-called verb polysemy problem, while Kim et al. [15] modeled the relation + +![](images/916abe10053eaea0a3786c3991f4a2694a1c9ce3f62bd47c4dea6c031db86bcd.jpg) +Figure 2. Overview of GGNet in the training stage. GGNet includes three main tasks, namely interaction prediction, human-object pair matching, and object detection. The three tasks share the same backbone model. The interaction prediction task includes one Glance step and two Gaze steps. The two Gaze steps infer a set of ActPoints for each pixel in feature maps. By aggregating their features into the interaction point, the second Gaze step is able to predict interactions more robustly. The human-object pair matching task is realized by the Action-aware Point Matching (APM) module, which bridges the interaction prediction and object detection tasks. In the testing stage, the glance step and the first gaze step are only utilized to infer ActPoints, while the other layers of the two steps are removed. $\oplus$ denotes the element-wise addition operation. Best viewed in color. + +ship between interaction categories by means of action co-occurrence matrices, which were then utilized to promote HOI detection performance. Although two-stage methods are flexible to include diverse features, they divide object detection and interaction prediction into two sequential steps, which is typically very time-consuming. + +One-Stage Methods. Some early HOI detection works [2], [3] devised end-to-end models based on the Faster R-CNN object detector [4]. Although these methods are more efficient than most two-stage methods, they adopt the same human appearance features for predicting different interactions, meaning that object-specific information in different human-object pairs is ignored. Recent works, moreover, have proposed to perform object detection and interaction prediction in parallel branches. For example, Liao et al. [10] and Wang et al. [20] defined the middle point of each human-object pair as their interaction point, which is capable of roughly capturing both human and object appearance features. These authors then detect interaction points in the interaction prediction branch. Kim et al. [1] represented the interaction location of one human-object pair using the union box, then detect union boxes using networks that are similar to anchor-based object detection models [4], [25], [32]. These recent one-stage methods can substantially improve HOI detection efficiency; however, as illustrated in Figure 1, their definitions of the interaction areas or points remain relatively coarse and may thus introduce ambiguity into HOI detection. + +In this paper, to handle the semantic ambiguity problem associated with interaction areas, we propose to represent these area using a set of dynamic ActPoints. These ActPoints are adaptively inferred around each interaction point, after which their features are aggregated to improve the interaction recognition accuracy. + +# 3. Methods + +# 3.1. Overview + +The architecture of GGNet is illustrated in Figure 2. Similar to PPDM [10], GGNet breaks HOI detection into three main tasks, namely interaction prediction, human-object pair matching, and object detection. These three tasks all share the same backbone. The second task bridges the first and the third tasks via associating each detected interaction with a single human-object pair. The object detection task is realized according to [10]. GGNet improves the interaction prediction task with a novel glance-and-gaze strategy. It also promotes the accuracy of the second task with an Action-aware Point Matching (APM) module. + +# 3.2. Glance and Gaze Network + +As illustrated in Figure 2, given an input image $\mathbf{I} \in R^{H \times W \times 3}$ , the output feature maps of the backbone can be expressed as $\mathbf{F} \in R^{\frac{H}{d} \times \frac{W}{d} \times C}$ , where $d$ denotes the output stride of backbone and $C$ denotes the number of channels. + +In this paper, we adopt the same definition of interac + +tion point as [10], [20], which is also illustrated in Figure 1(c). GGNet handles the semantic ambiguity problem of the single interaction point by further inferring a set of action-aware points (ActPoints). ActPoints adaptively capture more contextual information, and their features are aggregated to predict the interaction category. The set of ActPoints around one interaction point can be represented as: + +$$ +\mathcal {P} = \left\{\left(x _ {k}, y _ {k}\right) \right\} _ {k = 1} ^ {n}, \tag {1} +$$ + +where $n$ is the total number of ActPoints sampled for an interaction. We empirically set $n$ as 25. The location of ActPoints are inferred progressively by mimicking human's visual system [24] with one glance step and two gaze steps. Glance Step. In this step, GGNet quickly determines whether each pixel in $\mathbf{F}$ is an interaction point. As shown in Figure 2, this step is realized using a $3 \times 3$ convolutional (Conv) layer with ReLU, followed by a $1 \times 1$ Conv layer and a sigmoid layer. The size of heatmaps produced by the sigmoid layer is $\frac{H}{d} \times \frac{W}{d} \times V$ , where $V$ denotes the number of interaction categories. We apply a $V$ -dimensional element-wise focal loss [10] to the heatmaps as supervision for the inference of interaction categories. Due to this supervision, the feature maps output by the $3 \times 3$ Conv layer, i.e. $\mathbf{F}^0$ in Figure 2, are action-aware. + +Gaze Step. This step infers the location of ActPoints via two sub-steps, which are referred to as Gaze Step 1 and Gaze Step 2, respectively. In Gaze Step 1, $\mathbf{F}^0$ is employed to predict the coarse location of $n$ ActPoints for each pixel, since features in $\mathbf{F}^0$ have been action-aware. Moreover, as the discriminative power of each ActPoint varies with respect to the target interaction, GGNet also predicts a weight for each ActPoint. Both location and weight prediction are achieved by a $5\times 5$ Conv layer. Next, we aggregate features of ActPoints as well as their weights using one deformable Conv layer [27]. The $5\times 5$ offset field is determined by the number of ActPoints, which are also verified in Table 2. To ensure that the predicted ActPoints are reasonable, the feature maps produced by this sub-step are also used for interaction prediction with the $V$ -dimensional element-wise focal loss as supervision. + +On its own, the above step cannot always obtain precise locations of ActPoints; this is because the above $5 \times 5$ Conv operation has a fixed field of view, while the location of the human and object instances in one pair can vary dramatically. To address this problem, Gaze Step 2 is introduced to refine the location of ActPoints. In more detail, we aggregate the features in $\mathbf{F}^1$ of the coarse ActPoints using one deformable Conv layer, of which the output feature maps are denoted as $\mathbf{G}^1$ . Now, each pixel in $\mathbf{G}^1$ has a larger field of view; $\mathbf{G}^1$ is then send to another $5 \times 5$ Conv layer to predict the residual offsets of ActPoints locations, along with their new weights. As shown in Figure 2, the final position of ActPoints are obtained by summing their coarse location + +![](images/3954f0e46aac86439b812486cf25f3f69b7095af14a0a512eca9cc7c0d43f8e9.jpg) +(a) hold, carry + +![](images/278cee70d86b169b5f413ce14acce8bb77db4226750d2349edafa219f222cbd4.jpg) +(b) ride + +![](images/b31c620a3b1cf3630951cc6819885f98440c7ed21447e8ea98e9ef3c951c62c7.jpg) +(c) kick +Figure 3. Human-object pairs with different interaction categories present different spatial characteristics, i.e. the relative location between one human-object pair. Green points represent interaction points, each yellow arrow specifies the human instance in the pair, while each blue arrow indicates the object instance in the pair. + +and residual offsets. Finally, we aggregate the features of the refined ActPoints as well as their weights using another deformable Conv layer to predict interaction categories for each pixel in $\mathbf{F}^2$ . Similar to Gaze Step 1, the $V$ -dimensional element-wise focal loss is adopted as supervision. + +More formally, $(x_{k}^{(t)},y_{k}^{(t)})$ is updated as follows: + +$$ +\left(x _ {k} ^ {(t)}, y _ {k} ^ {(t)}\right) = \left(x _ {k} ^ {(t - 1)}, y _ {k} ^ {(t - 1)}\right) + \left(\Delta x _ {k} ^ {(t)}, \Delta y _ {k} ^ {(t)}\right), \tag {2} +$$ + +$$ +\left(\Delta x _ {k} ^ {(t)}, \Delta y _ {k} ^ {(t)}\right) = T _ {\text {o f f s e t}} ^ {(t)} \left(\mathbf {G} ^ {t - 1}\right), \tag {3} +$$ + +where $t$ stands for the $t$ -th gaze step, while $(\Delta x_k^{(t)}, \Delta y_k^{(t)})$ denotes the predicted offset with respect to the $k$ -th Act-Point's location in the last step. Moreover, we set the initial location of all $n$ ActPoints as $(0, 0)$ and set $\mathbf{G}^0$ as $\mathbf{F}^0$ . $T_{offset}^{(t)}$ is a Conv layer, whose kernel size is equal to the square root of $n$ . More details of the glance and gaze network can be confirmed from our open-source project. + +Action-aware Point Matching. To compose one HOI instance, each detected interaction point is associated with one human-object pair. Existing works [10], [20] adopt a single regressor shared by all interaction categories for this association process. However, as shown in Figure 3, human-object pairs with different interactions also differ in terms of spatial characteristics. Therefore, we propose the action-aware point matching (APM) module that assigns a unique location regressor for each interaction category. + +As illustrated in Figure 2, APM is attached to $\mathbf{F}^0$ . It includes one $3 \times 3$ and one $1 \times 1$ Conv layers. The latter layer acts as regressors. Each regressor outputs a 2-dimensional offset to human point (object point) with respect to the interaction point. Therefore, the output dimension of this layer is $\frac{H}{d} \times \frac{W}{d} \times 4V$ . In line with [10], we utilize these predicted offsets to match the target human (object) proposal during inference. This process will be detailed in Section 3.4. + +# 3.3. Hard Negative Attentive Loss + +Recent one-stage methods [10], [20] adopt the elementwise focal loss [35], [33] on the output heatmaps as super- + +vision to train their models. However, the heatmap size for each interaction category is $\frac{H}{d} \times \frac{W}{d}$ , which is often a large number. Therefore, there are massive negative samples in each heatmap, which brings in the problem of imbalance between positive and negative samples. Moreover, because of the long-tailed distribution of interaction categories [30], [31], some interaction categories have very limited positive samples, which further exacerbates the imbalance problem. Based on the above observation, we propose a novel hard negative attentive (HNA) loss to guide the model to focus more on hard negative samples for each respective interaction category. + +Definition of Hard Negatives. We infer hard negatives between meaningful HOI categories that share the same object class. For example, we can infer a hard negative sample $\langle \text{human repair bicycle} \rangle$ for the "repair" category according to a labeled positive sample $\langle \text{human carry bicycle} \rangle$ , if $\langle \text{human repair bicycle} \rangle$ is indeed not labeled as positive. We do not infer hard negatives from meaningless HOI categories that have never appeared in the training set of each database, e.g. $\langle \text{human eat bicycle} \rangle$ and $\langle \text{human drink bicycle} \rangle$ . The inferred sample of $\langle \text{human repair bicycle} \rangle$ can be highlighted as a hard negative in the interaction heatmap for "repair" category. + +Loss Formulation. First, we introduce the Gaussian heatmap masks $\mathbf{M} \in [-1, 1]^{\frac{H}{d} \times \frac{W}{d} \times V}$ , which are used to mark both positive samples and hard negative samples. For a ground truth HOI sample $(v_i, o_i)$ with an interaction point located at $(x_i, y_i)$ , $M_{x_i y_i v_i}$ is set to 1 and it is also used as the center of a Gaussian distribution in the $v_i$ -th channel of M. The value of the elements in this distribution is within [0, 1]. The interaction category and object category for this HOI sample are denoted as $v_i$ and $o_i$ , respectively. + +Second, we infer a set of HOI samples $\{(v_j,o_i)\}$ as hard negatives for the $v_{j}$ -th interaction category, with the help of the labeled positive sample $(v_{i},o_{i})$ . If $(v_{j},o_{i})$ is not labeled as a positive sample, then we set $M_{x_iy_iv_j}$ as -1 and it is also used as the center of another Gaussian distribution in the $v_{j}$ -th channel of M. The value of the elements in this distribution is within $[-1,0]$ . + +We repeat the above two operations for each ground truth sample. The value of remaining elements in $\mathbf{M}$ is set to 0. Finally, the HNA loss can be represented as follows: + +$$ +\mathcal {L} = - \frac {1}{N} \sum_ {x y v} \left\{ \begin{array}{c l} (1 - P _ {x y v}) ^ {\alpha} \log \left(P _ {x y v}\right) & \text {i f} M _ {x y v} = 1, \\ (1 - M _ {x y v}) ^ {\beta} \left(P _ {x y v}\right) ^ {\alpha} & \\ \log (1 - P _ {x y v}) & \text {i f} M _ {x y v} = - 1, \\ (1 - M _ {x y v}) ^ {\gamma} \left(P _ {x y v}\right) ^ {\alpha} & \\ \log (1 - P _ {x y v}) & \text {o t h e r w i s e}, \end{array} \right. \tag {4} +$$ + +where $N$ is the number of ground truth interaction points in an image. $P_{xyv}$ is the predicted score for the interaction category $v$ at point $(x,y)$ . $\beta$ is set as 7, $\alpha$ , $\gamma$ , and the pa + +rameters of the Gaussian distribution are set following [10]. + +# 3.4. Training and Inference + +Training. The overall loss function for GGNet can be represented as follows: + +$$ +\mathcal {L} _ {h o i} = \mathcal {L} _ {g a z e 2} + \lambda_ {1} \left(\mathcal {L} _ {\text {g l a n c e}} + \mathcal {L} _ {\text {g a z e 1}} + \mathcal {L} _ {m}\right) + \mathcal {L} _ {d}, \tag {5} +$$ + +where + +$$ +\mathcal {L} _ {m} = \mathcal {L} _ {m h} + \mathcal {L} _ {m o}, \tag {6} +$$ + +$$ +\mathcal {L} _ {d} = \mathcal {L} _ {h} + \mathcal {L} _ {o} + \lambda_ {2} \mathcal {L} _ {w h} + \mathcal {L} _ {o f f}. \tag {7} +$$ + +$\lambda_{2}$ is set to 0.1 following [10]; $\lambda_{1}$ is set to 0.1, which is analyzed in the supplementary file. $\mathcal{L}_{glance}$ , $\mathcal{L}_{gaze1}$ and $\mathcal{L}_{gaze2}$ denote the HNA loss for the glance step, and each of two gaze steps, respectively. $\mathcal{L}_{mh}$ and $\mathcal{L}_{mo}$ stand for the L1 loss for matching human and object points in the AP-M module, respectively. $\mathcal{L}_d$ stands for the object detection loss. $\mathcal{L}_h$ and $\mathcal{L}_o$ are the focal loss functions to predict human and object locations. $\mathcal{L}_{wh}$ and $\mathcal{L}_{off}$ denote the L1 loss for object size and center offset predictions, respectively. $\mathcal{L}_m$ and $\mathcal{L}_d$ are realized in the same way as [10]. + +Inference. We use the output of Gaze Step 2 to obtain interaction points; while the final score is the multiplication result of interaction prediction score from Gaze step 2 and object detection scores of the associated human-object pair. The following point matching process is the same as that in [10]. First, a set of interaction $\hat{S}^i$ , human $\hat{S}^h$ and object points $\hat{S}^o$ are respectively selected based on their prediction confidence scores. The number of points in $\hat{S}^i$ , $\hat{S}^h$ , and $\hat{S}^o$ is set to 100, respectively. Second, we associate each predicted interaction point $(\hat{x}^i, \hat{y}^i) \in \hat{S}^i$ with a human point $(\hat{x}_{opt}^h, \hat{y}_{opt}^h) \in \hat{S}^h$ and an object point $(\hat{x}_{opt}^o, \hat{y}_{opt}^o) \in \hat{S}^o$ according to the predicted subject and object offsets by APM, respectively: + +$$ +\begin{array}{l} (\hat {x} _ {o p t} ^ {h}, \hat {y} _ {o p t} ^ {h}) = \underset {(\hat {x} ^ {h}, \hat {y} ^ {h}) \in \hat {\mathcal {S}} ^ {h}} {\arg \min } \frac {1}{P _ {(\hat {x} ^ {h} , \hat {y} ^ {h})} ^ {h}} \\ \left(\left| \left(\hat {x} ^ {i}, \hat {y} ^ {i}\right) - \left(\hat {d} _ {\left(\hat {x} ^ {i}, \hat {y} ^ {i}\right)} ^ {h x}, \hat {d} _ {\left(\hat {x} ^ {i}, \hat {y} ^ {i}\right)} ^ {h y}\right) - \left(\hat {x} ^ {h}, \hat {y} ^ {h}\right) \right|\right), \tag {8} \\ \end{array} +$$ + +where $P_{(\hat{x}^h,\hat{y}^h)}^h$ denotes the object detection score for human point $(\hat{x}^h,\hat{y}^h)$ ; $(\hat{d}_{(\hat{x}^i,\hat{y}^i)}^{hx},\hat{d}_{(\hat{x}^i,\hat{y}^i)}^{hy})$ denotes the predicted offset from the interaction point to the human point by APM. The optimal object point $(\hat{x}_{opt}^o,\hat{y}_{opt}^o)$ can be inferred similarly. + +# 4. Experimental Setup + +# 4.1. Datasets and Evaluation Metrics + +V-COCO. V-COCO was constructed based on the MS-COCO database [29]. Its training and validation sets contain 5,400 images, while its testing set includes 4,946 images. It covers 80 object categories, 26 interaction categories and 234 HOI categories. The mean average precision of Scenario 1 role $(mAP_{role})$ [31] is used for evaluation. + +Table 1. Ablation studies on each component of GGNet. DLA-34 is adopted as backbone for experiments on HICO-DET. + +
MethodsComponentsmAP
HNA LossGaze # 1Gaze # 2APMV-COCOHICO-DET (DT)
Our Baseline----51.0620.16
Incremental✓---52.5120.58
✓✓--54.0321.05
✓✓✓-54.4321.54
Drop-one-out-✓✓✓53.5521.03
✓--✓52.6021.19
✓✓-✓54.2121.65
✓✓✓-54.4321.54
GGNet✓✓✓✓54.7222.03
+ +HICO-DET. HICO-DET [30] is a large-scale HOI detection dataset with more than 150,000 annotated instances. It contains 38,118 and 9,658 images for training and testing, respectively. There are a total of 80 object categories, 117 verb categories, and 600 HOI categories. Those HOI categories with fewer than 10 training samples are referred to as "rare" categories and the remaining ones are called as "non-rare" categories; specifically, there are 138 rare and 462 non-rare categories in total. There are two modes of mAP on HICO-DET, namely the Default (DT) mode and the Known-Object (KO) mode. In DT mode, each HOI category is evaluated on all testing images; while in KO mode, one HOI is only evaluated on images that contain its associated object category. + +# 4.2. Implementation Details + +We use the Hourglass-104 model [28], pre-trained on the MS-COCO [29], as the backbone of GGNet. Moreover, we adopt a lightweight network, named DLA-34 [36], as the backbone to perform ablation studies on HICO-DET for shortening experimental cycle. GGNet is trained using the Adam optimizer with an initial learning rate of 1.5e-5 (1.5e-4) and batch size of 7 (23) on V-COCO (HICO-DET) for 120 epochs. For all the experiments, the learning rate is reduced by multiplying 0.1 at the 90th epoch. Resolution of input images is $512 \times 512$ and the output stride $d$ of backbone is set to 4. + +# 5. Experimental Results and Discussion + +# 5.1. Ablation Studies + +We perform ablation studies on both V-COCO and HICO-DET datasets to demonstrate the effectiveness of each component of GGNet. Our baseline is constructed by removing the gaze steps from GGNet, and replacing the HNA loss and APM module with their counterparts in PPDM [10]. Experimental results are tabulated in Table 1. + +Effectiveness of the HNA Loss. As analyzed in Section 3.3, a serious problem of imbalance exists between positive and negative samples for each interaction category. We therefore propose the HNA loss to handle this problem by highlighting the hard negative samples. The adoption of HNA loss promotes the performance of our model by $1.45\%$ + +Table 2. Comparisons with variants of the Gaze Step on V-COCO. + +
# ActPoints# Gaze StepSharingAProle
91-53.54
251-54.32
491-53.81
251-54.21
252-54.72
253-54.34
252✓54.43
+ +$(0.42\%)$ mAP on V-COCO (HICO-DET). + +We further evaluate the optimal value of the hyperparameters $\beta$ in the HNA loss. The experimental results are provided in the supplementary material. + +Effectiveness of the Glance-Gaze Strategy. The glance-and-gaze strategy is developed to infer ActPoints to represent the interaction area for one human-object pair. The Gaze Step 1 is found to promote the HOI detection performance by $1.52\%$ and $0.47\%$ in terms of mAP on V-COCO and HICO-DET. Moreover, when the ActPoints is refined by Gaze Step 2, the performance is further improved by $0.40\%$ and $0.49\%$ mAP on V-COCO and HICO-DET, respectively. + +Effectiveness of APM. As the interaction category affects the human-object spatial layout in an HOI instance, we propose the APM module that assigns each interaction category a unique location regressor to facilitate matching of both the human and object points. The adoption of APM promotes the performance of our model by $0.29\%$ and $0.49\%$ in terms of mAP on V-COCO and HICO-DET, respectively. + +Drop-one-out Study. We further perform a drop-one-out study in which each proposed component is removed individually. In particular, as Gaze Step 2 is built based on Gaze Step 1, we remove both Gaze Steps 1 and 2 in the experiment where "Gaze # 1" is dropped out. These experimental results further demonstrate that each proposed component is indeed effective at promoting HOI detection performance. + +# 5.2. Comparisons with Variants of GGNet + +Comparisons with Variants of the Gaze Step. We compare the performance of gaze step with some possible variants by changing the number of ActPoints, the number of gaze steps, and whether layers are shared in different gaze steps. Experimental results are summarized in Table 2. + +First, we set the number of gaze steps to 1 and change the number of ActPoints. As the results show, our model achieves the best performance when the number of ActPoints is 25; this may be because a small number of ActPoints is insufficient to cover the entire interaction area, while too many ActPoints will increase the complexity of searching their locations. + +Second, we compare the performance of different numbers of gaze steps. The number of ActPoints is set to 25 here. When the number of gaze steps increases from 1 to 2, our model is promoted by $0.51\%$ in terms of mAP; no + +Table 3. Comparisons with variants of feature aggregation on V-COCO. "I", "H", and "O" denote the features of interaction point, human center point, and object center point, respectively. + +
MethodsAProle
I (our baseline)51.06
I + H51.84
I + O51.71
I + H + O52.32
ActPoints w/o glance and gaze51.66
ActPoints + glance and gaze53.25
+ +tably, the performance is not further promoted through the addition of more gaze steps, which may be because this increases the difficulty of model optimization. + +Third, we try sharing the parameters of the two $3 \times 3$ Conv layers that generate $\mathbf{F}^1$ and $\mathbf{F}^2$ in Figure 2. As Table 2 shows, the performance of our model decreases by $0.29\%$ in terms of mAP. One reason for this is that Gaze Step 2 captures more fine-grained features for interaction prediction; therefore, it is better for the two gaze steps to adopt independent Conv layers. + +Comparisons with Variants of Feature Aggregation In two-stage methods, it is a common practice to aggregate features of the human instance, the object instance, and their union box for interaction prediction purposes [7], [17], [14]. Accordingly, in this experiment, we compare the performance of the above feature aggregation approach with our proposed glance-and-gaze strategy. The experimental results are tabulated in Table 3. All methods in this table are constructed based on our baseline model. Here, “ $\mathrm{I} + \mathrm{H}$ ” (“ $\mathrm{I} + \mathrm{O}$ ”) means that we concatenate the features of each pixel in $\mathbf{F}^0$ (in Figure 2) with those of one human (object) center point. “ $\mathrm{I} + \mathrm{H} + \mathrm{O}$ ” denotes that both features of the human and object center points are aggregated. The human and object center points are obtained via the point matching strategy in [10]. Moreover, “ActPoints w/o glance and gaze” means that we adopt one deformable Conv layer to aggregate features of the predicted coarse ActPoints on $\mathbf{F}^0$ for interaction prediction. The structure of these models is outlined in more detail in the supplementary material. + +From the above, we can make the following observations. First, performance is promoted when either human or object features are aggregated. However, one person may interact with different objects, while a single object may also be interacted by multiple persons. Therefore, features for the center points of human and object instances may lack specific information for each human-object pair. By contrast, our proposed ActPoints adaptively capture features in the discriminative area for each human-object pair; therefore, it outperforms "I + H + O" by $0.93\%$ mAP. Second, when the glance and gaze steps are omitted, the performance of ActPoints drops by $1.59\%$ mAP. These comparisons demonstrate the effectiveness of our proposed glance-and-gaze strategy. + +Table 4. Performance comparisons on V-COCO. $\circ$ denotes methods that are reproduced using their open-source codes. 'A', 'P', 'S', and 'L' represent the appearance feature, human pose feature, spatial feature, and language feature, respectively. + +
MethodsFeatureAProle
Two-StageiCAN [12]A+S45.3
RPNN [16]A+S+P47.5
TIN (RPDCD) [6]A+S+P47.8
VCL [17]A+S48.3
C-HOI [37]A+S48.3
DRG [19]A+S+L51.0
VSGNet [11]A+S51.7
PMFNet [7]A+S+P52.0
PD-Net [14]A+S+P+L52.6
ACP [15]A+S+P+L52.9
FCMNet [8]A+S+P+L53.1
ConsNet [18]A+S+L53.2
One-StageInteractNet [3]A40.0
UnionDet [1]A47.5
IP-Net [20]A51.0
PPDM-Hourglass° [10]A51.1
GGNet-HourglassA54.7
+ +# 5.3. Comparisons with State-of-the-Art Methods + +We compare the performance of GGNet with state-of-the-art methods on both V-COCO and HICO-DET. + +As shown in Table 4, GGNet outperforms all state-of-the-art methods by significant margins on V-COCO. In particular, with the same backbone model, GGNet outperforms one of the most recent one-stage methods, i.e. PPDM [10] by a large margin of $3.6\%$ in terms of mAP. Moreover, although recent two-stage methods adopt various types of features to promote HOI detection performance, GGNet still outperforms all of these by at least $1.5\%$ in terms of mAP while utilizing appearance features only. + +As shown in Table 5, on HICO-DET, GGNet still outperforms state-of-the-art methods by clear margins in different settings of "Backbone Sharing". In particular, GGNet outperforms PPDM [10], by $1.74\%$ $(2.78\%)$ , $2.70\%$ $(3.58\%)$ and $1.50\%$ $(2.64\%)$ mAP in DT (KO) mode for the full, rare and non-rare HOI categories, respectively. Moreover, GGNet outperforms one of the best two-stage methods, i.e. PD-Net [38], by $1.10\%$ mAP in DT mode. Again, it is worth noting that PD-Net utilizes four types of features while GGNet employs the appearance feature only. + +As Table 5 shows, several recent two-stage methods have adopted two separate backbones for object detection and interaction prediction. In particular, two approaches have fine-tuned both backbones on the HICO-DET databases, thereby achieving superior performance [19], [17] (marked with $\diamond$ in Table 5). For its part, however, GGNet has a single shared backbone for object detection and interaction prediction. To facilitate fair comparison, we further test the performance of GGNet with the same object detection results provided by the object detector in DRG [19]; this setting is denoted as $\mathrm{GGNet}^{\ddagger}$ . As shown in Table 5, $\mathrm{GGNet}^{\ddagger}$ outperforms $\mathrm{DRG}^{\diamond \ddagger}$ [19] by a large margin of $4.64\%$ ( $5.52\%$ ) mAP in DT (KO) mode. + +Table 5. Performance comparisons on HICO-DET. "Backbone Sharing" represents methods that use the same feature backbone for object detection and interaction detection. denotes two-stage methods that first pre-train their object detectors on COCO, and then further fine-tune the object detectors on HICO-DET. denotes methods that use the same object detection results during inference. + +
MethodsBackbone SharingFeatureDT ModeKO Mode
FullRareNon-RareFullRareNon-Rare
Two-StageNo-Frills [5]✓A+S+P17.1812.1718.68---
DRG [19]-A+S+L19.2617.7419.7123.4021.7523.89
Peyre et al. [23]✓A+S+L19.4014.6020.90---
VCL [17]-A+S19.4316.5520.2922.0019.0922.87
FCMNet [8]-A+S+P+L20.4117.3421.5622.0418.9723.12
ACP [15]✓A+S+P+L20.5915.9221.98---
PD-Net [14]✓A+S+P+L20.8115.9022.2824.7818.8826.54
DJ-RN [22]-A+S+P+L21.3418.5322.1823.6920.6424.60
ConsNet [18]✓A+S+L22.1517.1223.65---
PD-Net [38]✓A+S+P+L22.3717.6123.7926.8621.7028.44
VCL°[17]-A+S23.6317.2125.5525.9819.1228.03
DRG°‡ [19]-A+S+L24.5319.4726.0427.9823.1129.43
One-StageShen et al. [2]✓A+P6.464.247.12---
InteractNet [3]✓A9.947.1610.77---
UnionDet [1]✓A17.5811.7219.3319.7614.6821.27
Our Baseline-Hourglass✓A21.4313.4623.8124.2916.4026.65
PPDM-Hourglass [10]✓A21.7313.7824.1024.5816.6526.84
GGNet-Hourglass✓A23.4716.4825.6027.3620.2329.48
PPDM-Hourglass† [10]-A26.5019.3528.6329.2422.1831.34
GGNet-Hourglass‡-A29.1722.1330.8433.5026.6734.89
+ +The above comparisons also show that the adoption of a separate object detector can significantly promote GGNet's performance. This may be because the object detection and interaction prediction tasks conflict with each other, as they require different features. It is also worth noting that adopting two backbones does not alter the one-stage nature of GGNet, as the object detection and interaction prediction tasks still run in parallel, regardless of whether or not they adopt the same backbone. The above experiments further justify the effectiveness of GGNet. + +# 5.4. Qualitative Visualization Results + +Figure 4 visualizes the interaction points and ActPoints predicted by GGNet. Here, three images are randomly chosen from V-COCO. We can observe that the interaction points, i.e. the green points in first column, are often located in the background area; therefore, their own features are vague to represent the interaction category. In comparison, ActPoints capture cues from discriminative object and human parts, both of which are important for interaction prediction. Moreover, the ActPoints refined by Gaze Step 2 are usually located at more important object and human parts than the ActPoints sampled by Gaze Step 1. In the supplementary material, we also present qualitative comparisons between GGNet and PPDM in terms of HOI detection results. + +# 6. Conclusion + +Existing one-stage HOI detection methods typically utilize the features of predefined interaction areas for interaction prediction, while these artificially defined areas are usually vague to represent interactions. In this paper, we propose a novel one-stage network, namely GGNet, which + +![](images/f4a07ae150720f21d82c6828bdaf77061f2ed6a59bb9f2fc124e13de7d272e45.jpg) +Figure 4. Visualization of results in glance and gaze steps. The first column shows the detected interaction point in the Glance Step; the second and third columns visualize the adaptively sampled ActPoints by Gaze Step 1 and Step 2, respectively. The color of each ActPoint reflects its weight, i.e. discriminative power. + +adaptively samples a set of action-aware points (ActPoints) via glance and gaze steps. We also propose an action-aware point matching approach that robustly matches target human and objects for each detected interaction. Moreover, a novel hard negative attentive loss is devised to improve the optimization of GGNet. Extensive experiments results show that GGNet outperforms start-of-the-arts on both V-COCO and HICO-DET datasets. + +Acknowledgement This work was supported by the NSF of China under Grant 62076101, 61702193, and U1801262, and the Program for Guangdong Introducing Innovative and Entrepreneurial Teams under Grant 2017ZT07X183. + +# References + +[1] B. Kim, T. Choi, J. Kangly, H. J. Kim. UnionDet: Union-Level Detector Towards Real-Time Human-Object Interaction Detection. In ECCV, 2020. +[2] L. Shen, S. Yeung, J. Hoffman, G. Mori, and F. Li. Scaling Human-Object Interaction Recognition Through Zero-Shot Learning. In WACV, 2018. +[3] G. Gkioxari, R. Girshick, P. Dollár, and K. He. Detecting and recognizing human-object interactions. In CVPR, 2018. +[4] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. +[5] T. Gupta, A. Schwing, and D. Hoiem. No-Frills Human-Object Interaction Detection: Factorization, Layout Encodings, and Training Techniques. In ICCV, 2019. +[6] Y. Li, S. Zhou, X. Huang, L. Xu, Z. Ma, H. Fang, Y. Wang, and C. Lu. Transferable Interactiveness Knowledge for Human-Object Interaction Detection. In CVPR, 2019. +[7] B. Wan, D. Zhou, Y. Liu, R. Li, and X. He. Pose-aware Multi-level Feature Network for Human Object Interaction Detection. In ICCV, 2019. +[8] Y. Liu, Q. Chen, and A. Zisserman. Amplifying key cues for human-object-interaction detection. In EC-CV, 2020. +[9] S. Qi, W. Wang, B. Jia, J. Shen, and S. Zhu. Learning human-object interactions by graph parsing neural networks. In ECCV, 2018. +[10] Y. Liao, S. Liu, F. Wang, Y. Chen, C. Qian, and J. Feng. Ppdm: Parallel point detection and matching for real-time human-object interaction detection. In CVPR, 2020. +[11] O. Ulutan, A. Iftekhar, and B. Manjunath. VSGNet: Spatial Attention Network for Detecting Human Object Interactions Using Graph Convolutions. In CVPR, 2020. +[12] C. Gao, Y. Zou, and J. Huang. ican: Instance-centric attention network for human-object interaction detection. In BMVC, 2018. +[13] T. Wang, R. Anwer, M. Khan, F. Khan, Y. Pang, L. Shao, and J. Laaksonen. Deep Contextual Attention for Human-Object Interaction Detection. In IC-CV, 2019. +[14] X. Zhong, C. Ding, X. Qu, and D. Tao. Polysemy deciphering network for human-object interaction detection. In ECCV, 2020. + +[15] D. Kim, X. Sun, J. Choi, S. Lin, and I. Kweon. Detecting Human-Object Interactions with Action Cooccurrence Priors. In ECCV, 2020. +[16] P. Zhou, and M. Chi. Relation parsing neural network for human-object interaction detection. In ICCV, 2019. +[17] Z. Hou, X. Peng, Y. Qiao, and D. Tao. Visual Compositional Learning for Human-Object Interaction Detection. In ECCV, 2020. +[18] Y. Liu, J. Yuan, and C. Chen. ConsNet: Learning Consistency Graph for Zero-Shot Human-Object Interaction Detection. In ACM MM, 2020. +[19] C. Gao, J. Xu, Y. Zou, and J. Huang. DRG: Dual Relation Graph for Human-Object Interaction Detection. In ECCV, 2020. +[20] T. Wang, T. Yang, M. Danelljan, F. Khan, X. Zhang, and J. Sun. Learning Human-Object Interaction Detection using Interaction Points. In CVPR, 2020. +[21] B. Xu, Y. Wong, J. Li, Q. Zhao, and M. Kankanhalli. Learning to Detect Human-Object Interactions With Knowledge. In CVPR, 2019. +[22] Y. Li, X. Liu, H. Lu, S. Wang, J. Liu, J. Li, and C. Lu. Detailed 2D-3D Joint Representation for Human-Object Interaction. In CVPR, 2020. +[23] J. Peyre, I. Laptev, C. Schmid, and J. Sivic. Detecting unseen visual relations using analogies. In ICCV, 2019. +[24] H. Deubel, W. Schneider and others. Saccade target selection and object recognition: Evidence for a common attentional mechanism. In Vision research, 1996. +[25] T. Lin, P. Dollar, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In CVPR, 2017. +[26] S. Lan, Z. Ren, Y. Wu, L. Davis, and G. Hua. SaccadeNet: A Fast and Accurate Object Detector. In CVPR, 2020. +[27] X. Zhu, H. Hu, S. Lin, and J. Dai. Deformable convnets v2: More deformable, better results. In CVPR, 2019. +[28] A. Newell, K. Yang, and J. Deng. Stacked hourglass networks for human pose estimation. In ECCV, 2016. +[29] T. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollar, and C. Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014. +[30] Y. Chao, Y. Liu, X. Liu, H. Zeng, and J. Deng. Learning to detect human-object interactions. In WACV, 2018. +[31] S. Gupta, and J. Malik. Visual semantic role labeling. In arXiv preprint arXiv:1505.04474, 2015. + +[32] T. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar. Focal loss for dense object detection. In ICCV, 2017. +[33] H. Law, and J. Deng. Cornernet: Detecting objects as paired keypoints. In ECCV, 2018. +[34] X. Lin, C. Ding, J. Zeng, and D. Tao. Gps-net: Graph property sensing network for scene graph generation. In CVPR, 2020. +[35] X. Zhou, D. Wang, and P. Krajhenbuhl. Objects as points. In arXiv preprint arXiv:1904.07850, 2019. +[36] F. Yu, D. Wang, E. Shelhamer, and T. Darrell. Deep layer aggregation. In CVPR, 2018. +[37] T. Zhou, W. Wang, S. Qi, H. Ling, and J. Shen. Cascaded human-object interaction recognition. In CVPR, 2020. +[38] X. Zhong, C. Ding, X. Qu, and D. Tao. Polysemy Deciphering Network for Robust Human-Object Interaction Detection. In IJCV, 2021. \ No newline at end of file diff --git a/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/images.zip b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..46d2cff0392fd86eb916c2579edf52b38f3d3196 --- /dev/null +++ b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:197137f8723eaee450855163378a9e9640bb22cf3671a55b51fb89ad0645e3a6 +size 403805 diff --git a/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/layout.json b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f7bde59102e7e97da2006ae0396d1fd7a395a595 --- /dev/null +++ b/glanceandgazeinferringactionawarepointsforonestagehumanobjectinteractiondetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd203a96560f1f12a364a188edfc7c6e01ad633d1eb1f012ac112893e2f09e5a +size 405458 diff --git a/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_content_list.json b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..21bcd9dd4df50e95773c893142111b7ebe4dfae5 --- /dev/null +++ b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d808bce23bbb62a5fa6a3879c1992a7de6740cd87985c150e63dddfec6405667 +size 82501 diff --git a/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_model.json b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a1170fe4ba8cb409e2410b7dc044f4be0de0eba7 --- /dev/null +++ b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6057e1da3a245169199ef706a017a73d70e598a9518ba87e3b7e0a96a1d6e0ab +size 100765 diff --git a/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_origin.pdf b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1dce9a079dfb1dc5011768893394d3da2293b42a --- /dev/null +++ b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/302a52f4-8ec7-4f83-9b73-84cd7f89e95d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e198a113704e991128fa192f06ad623d06208a1d044e2e85db5dc0690496ccb +size 5576876 diff --git a/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/full.md b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/full.md new file mode 100644 index 0000000000000000000000000000000000000000..de5d0b6266fa154e1a2aa1e30c17bf4dcac5315f --- /dev/null +++ b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/full.md @@ -0,0 +1,343 @@ +# Glancing at the Patch: Anomaly Localization with Global and Local Feature Comparison + +Shenzhi Wang $^{1}$ Liwei Wu $^{1}$ Lei Cui $^{1}$ Yujun Shen $^{2}$ + +$^{1}$ SenseTime Research $^{2}$ The Chinese University of Hong Kong + +{wangshenzhi, wuliwei, cuilei}@sensetime.com sy116@ie.cuhk.edu.hk + +# Abstract + +Anomaly localization, with the purpose to segment the anomalous regions within images, is challenging due to the large variety of anomaly types. Existing methods typically train deep models by treating the entire image as a whole yet put little effort into learning the local distribution, which is vital for this pixel-precise task. In this work, we propose an unsupervised patch-based approach that gives due consideration to both the global and local information. More concretely, we employ a Local-Net and Global-Net to extract features from any individual patch and its surrounding respectively. Global-Net is trained with the purpose to mimic the local feature such that we can easily detect an abnormal patch when its feature mismatches that from the context. We further introduce an Inconsistency Anomaly Detection (IAD) head and a Distortion Anomaly Detection (DAD) head to sufficiently spot the discrepancy between global and local features. A scoring function derived from the multi-head design facilitates high-precision anomaly localization. Extensive experiments on a couple of real-world datasets suggest that our approach outperforms state-of-the-art competitors by a sufficiently large margin. + +# 1. Introduction + +Anomaly detection has received broad attention in recent years due to its wide applications in industrial inspection [6, 7, 48, 11, 10, 32], medical diagnosis [51, 5, 46, 42], and surveillance [27, 30, 36]. Its primary goal is to identify anomalies from normal samples, usually treated as a bi-classification problem. Considering the ambiguous definition of anomaly types as well as the great imbalance between sufficient normal data and scarce abnormal data, a common practice is to learn the distribution of anomaly-free data and then use it as a criterion to detect outliers [43, 38, 42, 41, 14, 48]. + +Recent development of deep neural networks has significantly advanced this task with a more powerful capability + +![](images/26941c4e7a3151e25b530fc1340b034f76f3c1a08186f46d22200b5719764cd9.jpg) +(a) + +![](images/6dd44ac59eac6a0d4e83fa79c2cbae03da917835bd4c5d2f3a510cae7497c054.jpg) +Figure 1. (a) Anomaly localization results where our approach can precisely segment the anomalous regions. From top to bottom: abnormal samples, ground-truth, and anomaly score maps produced by our algorithm. (b) Concept diagram of global and local feature comparison. Local-Net and Global-Net are employed to extract features from a patch and its surrounding respectively. Multiple anomaly detection heads are designed to determine whether the global and local features match or not. + +in representation learning [7, 48, 28]. Most existing algorithms deploy deep models to spot anomalies at the instance level (i.e., abnormal images belongs to different categories against normal ones) by extracting global feature from the entire image [14, 38, 49, 22, 37, 43, 2]. However, in many real cases, the anomalies simply differ from the regular data at some local areas [6, 32], as shown in Fig. 1a. From this perspective, localizing the anomalous regions at the pixel level is far more practical. + +To solve this pixel-precise task, one feasible solution is to adopt generative models, such as Generative Adversarial Networks (GANs) [42, 41, 47] and Auto-Encoders + +(AEs) [8, 11, 12, 51], which can produce images with per-pixel generation. But these approaches still treat each training image as a whole, omitting the learning of local information. An alternative solution is to pick patches from the image and then perform inspection on every patch to see whether there exists a defect [7, 10]. But this kind of approach does not consider the correlation between the patch and its surrounding. As a result, they can only detect the anomalous patches that have some flaws inside, but fail to handle the ordinary patches that are placed in the wrong position, like the second example shown in Fig. 1a where the top cable should be in green color. + +In this work, we propose a novel framework for unsupervised anomaly localization with due consideration to both the global and local information. At the training stage, given a normal image, we randomly crop a patch and introduce a Local-Net and Global-Net to extract features from this patch and its surrounding respectively, as shown in Fig. 1b. Concretely, we develop the global feature to match the local feature, encouraging the Global-Net to conjecture the feature of the missing patch based on the context. For this purpose, we learn Global-Net jointly with an Inconsistency Anomaly Detection (IAD) head and a Distortion Anomaly Detection (DAD) head, leading to a fused metric to better measure the similarity between the global and local features. At the inference stage, a scoring function developed from the multi-head feature comparison is capable of producing an adequate score map from a test image to help localize anomalous regions, as shown in Fig. 1a. In summary, our contributions are: + +- We propose a novel unsupervised anomaly localization approach by collecting both the global and local information from training data. In particular, the local feature extracted from an image patch is regressed by the global feature extracted from its surrounding. +- We introduce the multi-head feature comparison where the IAD head targets at spotting the mismatch between patches and surroundings while the DAD head aims to detect subtle defects occurring in the patch. We further derive a scoring function from this multi-head design, facilitating high-precision anomaly localization. +- We achieve state-of-the-art performances on a couple of real-world datasets, significantly surpassing existing methods. For example, on the recent MVTec AD dataset [6], which is specifically designed to benchmark the anomaly localization task, we beat the second competitor by $4.7\%$ improvement (i.e., from $91.4\%$ to $96.1\%$ ) under the per-region-overlap (PRO) metric [6]. + +# 2. Related Work + +We summarize existing anomaly detection methods into two categories: compress-based and reconstruct-based. + +Compress-based. Compress-based methods typically project raw images [7, 10, 22, 48] or high-dimensional features [38, 43] into a low-dimensional feature space, where normal and abnormal examples are much more distinguishable. For this purpose, SVDD [38] considers a distance-minimize objective, which extracts the shared feature from normal examples while avoiding them to be the same. Based on [38], Yi and Yoon [48] propose a patch-based SVDD that contains multiple cores rather than a single core in [38], enabling anomaly segmentation. Bergmann et al. [7] utilize a pre-trained teacher network to embed image patches and estimate the anomaly score with a collection of student networks. Kwon et al. [22] argue that normal and abnormal images are more distinguishable at the backward gradient space. Some other methods [42, 41, 34] discover the underlying data distribution with the help of Generative Adversarial Networks (GANs). After training a GAN on normal data, they determine whether a test sample is anomalous based on the discriminator output. + +Reconstruct-based. Reconstruct-based approaches assume that normal images can be described by a unified distribution in image space. They commonly utilize AutoEncoders [40, 11, 20, 50, 17, 14, 36, 32] or GANs [49, 46, 37, 39, 5] to learn the distribution underlying normal data and then make the decision based on whether a test sample can be well recovered or not. To improve the reconstruction sharpness, prior work [11, 12] introduces the skip connections that provide the decoder with more spatial information. Gong et al. [14] and Park et al. [36] believe that limiting the generalization ability is vital in finding novel images, and hence propose a memory-based autoencoder to reconstruct images from features. Xia et al. [46] learn the image reconstruction from the image segmentation map instead of the original input. Pseudo-anomalies are also widely used to improve the performance of anomaly detection. Zaheer et al. [49] take the images reconstructed by old generators as another kind of anomalies. Huang et al. [20] apply data augmentation to improve the attribute restoration ability of the reconstruction model. + +Discussion. Different from the above approaches, which learn representation either from a patch (local) or from the entire image (global), our algorithm gives due consideration to both the global and the local information and makes decision based on the comparison between local and global features. A recent work [35] also proposes to aggregate local and global information for anomaly detection. In particular, it employs the embedding learned from the compress-based method as the global information and treat the image recovered by the reconstructed-based method as the local information. Differently, we extract the local information from an image patch and the global information from its surrounding, forming an one-on-one matching. + +![](images/5be2647fe23b02ceb67e42b10153320589a1280fea1fbd61b85354e6483be05a.jpg) +Figure 2. Anomaly Localization Framework. (a) At the training stage, a Local-Net and Global-Net are employed to extract features from an image patch and its surrounding respectively. The Global-Net is jointly learned with an Inconsistency Anomaly Detection (IAD) head and a Distortion Anomaly Detection (DAD) head to mimic the output from the Local-Net. (b) At the inference stage, a scoring function is developed based on the feature comparison results produced by the IAD-head and DAD-head. Anomaly scores corresponding to different patches are aggregated together into an anomaly score map for anomaly localization. + +# 3. Method + +Given a training set of normal images $\{\mathbf{I}_1, \mathbf{I}_2, \dots, \mathbf{I}_n\}$ , and a test set containing both anomaly and anomaly-free images $\{\mathbf{I}_1', \mathbf{I}_2', \dots, \mathbf{I}_m'\}$ , the goal is to identify test images as normal or abnormal, and further localize the anomalous regions in abnormal samples. + +In the following sections, we first discuss how to extract the local and global features from an image (Sec. 3.1), then explain the Inconsistency Anomaly Detection head (IAD-head) and the Distortion Anomaly Detection head (DAD-head) used for feature comparison (Sec. 3.2), and finally introduce the way to produce an anomaly score map from a test image at the inference stage (Sec. 3.3). + +# 3.1. Local and Global Feature Extraction + +In this part, we introduce how to extract the local and the global feature from a patch and its surrounding, as shown in Fig. 2a. + +Local Feature Extraction. We use Local-Net, a lightweight neural network, to embed image patches into local features. Since shallow networks distilled from deep networks trained on classification tasks show promising results in anomaly detection [7, 33, 32], we distill Local-Net from pre-trained ResNet-18 [19]. Concretely, Local-Net is first distilled on ImageNet [13], and then fine-tuned on a particular training set. Knowledge distillation loss [7] and compactness loss [44] are utilized in distillation and finetuning. Here, the knowledge distillation loss is defined as + +$$ +l _ {k} = \left\| \mathcal {D} \left(\mathcal {L} (\mathbf {p})\right) - \mathcal {R} (\mathbf {p}) \right\| _ {2} ^ {2}, \tag {1} +$$ + +where $\mathbf{p}$ is the image patch and $\| \cdot \| _2$ denotes the $\ell_2$ + +norm. $\mathcal{L}(\cdot)$ and $\mathcal{R}(\cdot)$ stand for Local-Net and the teacher model (i.e., the pre-trained ResNet-18) respectively. $\mathcal{D}(\cdot)$ is a decoder to ensure $\mathcal{L}(\cdot)$ and $\mathcal{R}(\cdot)$ to have same output dimension. + +The compactness loss is formulated as + +$$ +l _ {c} = \sum_ {i \neq j} c _ {i j}, \tag {2} +$$ + +where $c_{ij}$ represents the $(i,j)$ entry in the correlation matrix over the Local-Net outputs $\mathcal{L}(\mathbf{p})$ within a mini-batch. + +Overall, the Local-Net is optimized with + +$$ +l _ {\text {l o c a l}} = \lambda_ {k} l _ {k} + \lambda_ {c} l _ {c}, \tag {3} +$$ + +where $\lambda_{k}$ and $\lambda_{c}$ are loss weights to balance different terms. After distillation and fine-tuning, the local feature $\mathbf{Z}_l$ can be extracted by the Local-Net as + +$$ +\mathbf {Z} _ {l} = \mathcal {L} (\mathbf {p}). \tag {4} +$$ + +Note that the learning of the Local-Net is referred as pretraining in our framework. During the training of Global-Net and DAD-head, as discussed below, parameters of the Local-Net are fixed. + +Global Feature Extraction. Another deep model, named Global-Net, is employed to extract the global feature from the surrounding of the patch $\mathbf{I} \backslash \mathbf{p}$ . To prevent the local feature from disturbing the global feature, we apply partial convolution [25] to our Global-Net. Specifically, for every convolutional layer in the Global-Net, the convolution operation at every location is formulated as + +$$ +x ^ {\prime} = \left\{ \begin{array}{l l} \mathbf {W} ^ {\mathbf {T}} (\mathbf {X} \odot \mathbf {M}) \frac {\operatorname {s u m} (\mathbf {1})}{\operatorname {s u m} (\mathbf {M})} + b, & \text {i f} \operatorname {s u m} (\mathbf {M}) > 0 \\ 0, & \text {o t h e r w i s e .} \end{array} \right. \tag {5} +$$ + +Here, $\odot$ represents the element-wise product, $\mathbf{X}$ denotes the input feature map, and $\mathbf{M}$ is the binary mask in current layer. For every pooling layer, feature map is updated as the normal pooling, and $\mathbf{M}$ is refreshed with the binary version of the mask's pooling result. The initial mask $\mathbf{M_0}$ is defined as a binary matrix where the patch's pixels are zero and the others are one. Therefore, Global-Net $\mathcal{G}(\cdot)$ can extract global feature $\mathbf{Z}_g$ without peeking at the patch, as formulated below: + +$$ +\mathbf {Z} _ {g} = \mathcal {G} (\mathbf {I}, \mathbf {M} _ {\mathbf {0}}). \tag {6} +$$ + +# 3.2. Anomaly Detection Heads + +In this part, we introduce two anomaly detection heads, i.e., the Inconsistency Anomaly Detection head (IAD-head) and the Distortion Anomaly Detection head (DAD-head). As shown in Fig. 2a, IAD-head and DAD-head accept the local feature and the global feature extracted from the patch and its surrounding and make comparison between these two features. + +Inconsistency Anomaly Detection Head. Inconsistency anomaly detection head (IAD-head) is designed to detect the inconsistency between the local feature $\mathbf{Z}_l$ and the global feature $\mathbf{Z}_g$ with + +$$ +l _ {\mathrm {I A D}} = \frac {1}{n} \left\| \mathbf {Z} _ {l} - \mathbf {Z} _ {g} \right\| _ {2} ^ {2}, \tag {7} +$$ + +where $n$ is the dimension of both the local feature and the global feature. + +We assume that in normal images local and global features are consistent, while in abnormal images the situation is the contrary. Therefore, in the training process, $l_{\mathrm{IAD}}$ is utilized as a loss to close the distance between $\mathbf{Z}_l$ and $\mathbf{Z}_g$ . During inference, $l_{\mathrm{IAD}}$ serves as a scoring function to indicate the global-local inconsistency lying in the patch, which will be discussed in Sec. 3.3. + +Distortion Anomaly Detection Head. Distortion anomaly detection head (DAD-head) is a trainable head, which aims to detect the distortions in images, e.g., bent grids and cut carpets. Compared with the IAD-head that focuses on the mismatch between the patch and its surrounding, the DAD-head is capable of spotting tiny defects localized in the patch. Concretely, the DAD-head exploits a number of fully-connected layers to determine whether distortions exist in the patch. In addition to the original patch $\mathbf{p}$ , we introduce a negative patch $\mathbf{p}^{-}$ following [28, 11], which is generated by adding a random small stain on $\mathbf{p}$ . The reason for constructing negative patches in this way is to maintain the majority of the patch and introduce only tiny differences, encouraging the DAD-head to spot small distortions. The features extracted from $\mathbf{p}$ and $\mathbf{p}^{-}$ are equiprobably fed into the DAD-head together with the global feature $\mathbf{Z}_g$ . Then the DAD-head determines whether + +the input local feature is $\mathbf{Z}_l$ or $\mathbf{Z}_l^-$ by producing a positive probability + +$$ +p = \mathcal {C} \left(\mathbf {Z} ^ {*}, \mathbf {Z} _ {g}\right), \tag {8} +$$ + +where $\mathcal{C}(\cdot, \cdot)$ is the classification network in the DAD-head. $\mathbf{Z}^*$ can be either local feature $\mathbf{Z}_l$ or negative local feature $\mathbf{Z}_l^-$ . During training, the classifier in the DAD-head is supervised by a cross-entropy loss as + +$$ +l _ {\mathrm {D A D}} = - (y \log (p) + (1 - y) \log (1 - p)), \tag {9} +$$ + +where $y$ is the target output of the classifier, i.e., 0 for the positive patch and 1 for the negative patch. + +Training Objective. The total training loss for the GlobalNet and the DAD-head is + +$$ +l = l _ {\mathrm {I A D}} + \lambda_ {l} l _ {\mathrm {D A D}}, \tag {10} +$$ + +where $\lambda_{t}$ is a loss weight to balance different energies. Intuitively, $l_{\mathrm{IAD}}$ guides the Global-Net to imagine the local distribution, while $l_{\mathrm{DAD}}$ encourages the Global-Net to learn a more distinguishable representation. Meanwhile, the DAD-head is trained to find the subtle differences between normal and distorted patches. + +# 3.3. Anomaly Localization + +Scoring Function. At the inference stage, we feed local feature $\mathbf{Z}_l$ and global feature $\mathbf{Z}_g$ into the IAD-head to generate the inconsistency anomaly score + +$$ +s _ {\mathrm {I A D}} = \frac {1}{n} \left\| \mathbf {Z} _ {l} - \mathbf {Z} _ {g} \right\| _ {2} ^ {2}. \tag {11} +$$ + +We also feed them into the DAD-head to produce the distortion anomaly score + +$$ +s _ {\mathrm {D A D}} = 1 - \mathcal {C} \left(\mathbf {Z} _ {l}, \mathbf {Z} _ {g}\right). \tag {12} +$$ + +Finally, our scoring function integrates these two scores: + +$$ +s = \lambda_ {s} s _ {\mathrm {I A D}} + (1 - \lambda_ {s}) s _ {\mathrm {D A D}}, \tag {13} +$$ + +where $\lambda_{s}$ is a hyper-parameter to balance the inconsistency anomaly score $s_{\mathrm{IAD}}$ and the distortion anomaly score $s_{\mathrm{DAD}}$ . We set $\lambda_{s} = 0.8$ in our experiments. Detailed study on $\lambda_{s}$ can be found in Sec. 4.4. + +Anomaly Score Map. With the scoring function to assign the anomaly score to a particular patch, we further propose a pipeline to aggregate the anomaly scores for different patches into an anomaly score map. Concretely, we generate image patches one after another, and organize them in a raster-scan order, as shown in Fig. 2b. Overlap is allowed between two adjacent image patches. We assign an anomaly score for each patch with the scoring function in Eq. (13), and construct an anomaly score map for the entire image with the inverse distance weighted (IDW) interpolation. + +# 4. Experiments + +In this section, we study our model's performance on pixel-level anomaly detection task (Sec. 4.2), and image-level one-class classification task (Sec. 4.3). Qualitative and quantitative results show our approach attains state-of-the-art performance compared with other methods. + +# 4.1. Datasets + +MVTec AD. MVTec AD [6] is a real-world industrial image anomaly detection dataset with 5354 high-resolution images in 15 categories. The training set has 3629 normal images, and the test set contains 1725 normal or abnormal images. The ground truth in the test set includes both labels and anomaly masks. We follow the original dataset split of MVTec AD, i.e., use only anomaly-free images in training, and test on both normal and abnormal images. + +CIFAR-10. CIFAR-10 [21] includes 60000 tiny images with 10 classes. In each class, 5000 images are used for training, and the other 1000 images for testing. We follow the protocol in GradCon [22] to split dataset for one-class classification task. Specifically, based on the original training-test split of CIFAR-10, we construct the training set from images of one class as inliers, and build the test set from inlier images and the same number of outlier images randomly sampled from other classes. + +# 4.2. Pixel-level Anomaly Localization + +We evaluate our approach's localization ability on the pixel-level anomaly detection task. Both qualitative and quantitative results are provided. + +Setup. For pre-training Local-Net, following [7], we first distill Local-Net from pre-trained ResNet-18 on ImageNet [13], and then fine-tune it into the specific category in MVTec AD with the same loss as that in distillation. When training Global-Net and DAD-head, we randomly crop patch $\mathbf{p}$ from the image, and add some random stains on the patch to produce $\mathbf{p}^{-}$ . Then Global-Net and DAD-head are trained with the loss in Eq. (10). At inference stage, image patches are cropped in a roster-scan order, and the anomaly score $s$ for each patch is estimated according to Eq. (13) with $\lambda_{s} = 0.8$ . Finally, anomaly score maps of images are constructed as discussed in Sec. 3.3. More implementation details can be found in Supplementary Material. + +Baselines. We have two parts of competitors. The first part is baselines in [6, 7], including the 1-NN classifier [3], the One-Class SVM (OCSVM) [43], the K-Means classifier [29], deterministic autoencoder with $l_{2}$ -reconstruction error as the anomaly score ( $l_{2}$ -AE) [16], variational autoencoder with reconstruction probability as the anomaly score (VAE) [4], CNN-Feature Dictionary (CNN-FD) [32], the SSIM-Autoencoder (SSIM-AE) [8] and AnoGAN [42]. The results for above methods are all reported in [6, 7]. The + +![](images/e27dd2ebcbf7a713d1fcefb600ade3056a1099d03c4babcfd7392b691f02ddd1.jpg) +Image Ground-Truth Score Map + +![](images/d1989eaf5617a67d1310e00e0b12b9acb810771358f41bf87f7c6d4c9e8ff956.jpg) + +![](images/e7f1c4385ce09cc5d4c7ff98f98066a49e07e6e9b4496c343c5a5da1e1e1d4dc.jpg) + +![](images/a1a2341c4f7fca47351be087c5f89fb075bcfea9d9ebca10de42c043240de5c4.jpg) +Figure 3. Qualitative anomaly localization results on MVTec AD dataset [6]. For each example, the images from left to right are the defective image, the ground-truth, and the anomaly score map produced by our algorithm. Zoom in for details. + +![](images/7553ba3ef95a4b346a6768a5a78b0346e204f38afdfb1de50687d34838a248ea.jpg) +Image Ground-Truth Score Map + +![](images/6630a2a83bfeb337a518ff5e6aee8f56c4498913220d85ccf8ae75b8b4aa1a2c.jpg) + +![](images/a538d4c88e0e846c7c976a26736a741b3e2c8cd4b93c868e997d33071153aa0e.jpg) + +![](images/e2e72b449b462ed27bd85c32e8af568b59cc9cfe9b3fcf57d0519520a28b06b1.jpg) + +second part is recently peer-reviewed models, including teacher-student (TS) [7], Visually Explained Variational Autoencoder (VAVAE) [26], Superpixel Masking and Inpainting (SMAI) [23], Gradient Descent Reconstruction with VAEs (GDR) [12], Encoding Structure-Texture Relation with P-Net for AD (P-Net) [51]. The results for models in the second part are reported in the original papers. + +Qualitative Results. Fig. 3 shows our qualitative results in MVTec AD [6]. Our approach satisfactorily addresses all kinds of anomalies and further locates the subtle defects. More anomaly localization results can be found in Supplementary Material. + +To further illustrate the importance of the global and local feature comparison in anomaly localization, in Fig. 4 we qualitatively compare our model with TS [7], which only utilizes the local feature of the patch. When encountering some hard anomalies which seems totally normal in any single patch, e.g., misplacement, swapping and bend in Fig. 4, local feature based models cannot detect the anomalies, while our method handles them excellently. + +Quantitative Results in PRO. We follow the protocol in [6, 7], and use the per-region-overlap (PRO) as the evaluation metric. Unlike other per-pixel metrics, PRO weights ground-truth regions equally regardless of region sizes [7]. Specifically, as described in TS [7], we increase the threshold until the average per-pixel false positive rate reaches $30\%$ . For each threshold, we calculate the PRO value, i.e., the average ratio of the area detected as anomalous in each anomaly connected component. And the final metric is the normalized area under the PRO curve. + +We compare our results with all the baselines that report the PRO metric. Tab. 1 shows the comparison results. Our method outperforms the other methods by a wide margin. + +Table 1. Comparison results among different anomaly detection methods in the pixel-level anomaly localization task on MVTec AD dataset [6]. Competitors include 1-NN [3], OC-SVM [43], K-Means [29], $l_{2}$ -AE [16], VAE [4], SSIM-AE [8], AnoGAN [42], CNN-FD [32] and TS [7]. The results of baselines are borrowed from [6, 7]. Per-region-overlap (PRO) [7] is used as the evaluation metric. + +
Category1-NNOC-SVMK-Meansl2-AEVAESSIM-AEAnoGANCNN-FDTSOurs
TextureCarpet0.5120.3550.2530.4560.5010.6470.2040.4690.8790.977
Grid0.2280.1250.1070.5820.2240.8490.2260.1830.9520.932
Leather0.4460.3060.3080.8190.6350.5610.3780.6410.9450.909
Tile0.8220.7220.7790.8970.8700.1750.1770.7970.9460.883
Wood0.5020.3360.4110.7270.6280.6050.3860.6210.9110.941
ObjectBottle0.8980.8500.4950.9100.8970.8340.6200.7420.9310.968
Cable0.8060.4310.5130.8250.6540.4780.3830.5580.8180.980
Capsule0.6310.5540.3870.8620.5260.8600.3060.3060.9680.960
Hazelnut0.8610.6160.6980.9170.8780.9160.6980.8440.9650.962
Metal Nut0.7050.3190.3510.8300.5760.6030.3200.3580.9420.967
Pill0.7250.5440.5140.8930.7690.8300.7760.4600.9610.978
Screw0.6040.6440.5500.7540.5590.8870.4660.2770.9421.000
Toothbrush0.6750.5380.3370.8220.6930.7840.7490.1510.9330.961
Transistor0.6800.4960.3990.7280.6260.7250.5490.6280.6660.999
Zipper0.5120.3550.2530.8390.5490.6650.4670.7030.9510.992
Mean0.6400.4790.4230.7900.6390.6940.4430.5150.9140.961
+ +Specifically, in comparison with TS [7], the state-of-the-art competitor, our model exceeds greatly in categories such as the cable and transistor. This is identical with our observation in Fig. 4, for TS fails in the anomaly cases involved with global and local feature comparison. + +Quantitative Results in Pixel-level AUROC. We further provide quantitative results on pixel-level AUROC [6]. The comparison with all the baselines that report pixel-level AUROC is shown in Tab. 2. Our model substantially surpasses other methods in pixel-wise AUROC ( $\geq 2\%$ ). This conclusion is consistent with that in PRO results above. + +Discussion. Recall that, for each category in the MVtec AD dataset, we train a separate model only on the normal data with exactly the same configuration (e.g., hyperparameters like learning rate, training epochs, etc.). Results in Tab. 1 and Tab. 2 show that our approach is generalizable to various types of data, suggesting strong robustness. + +# 4.3. Image-level Anomaly Detection + +To further prove that our method is able to handle various tasks in anomaly detection, our model is applied to image-level anomaly detection task. Here we present the results of unsupervised one-class classification on CIFAR-10 [21].1 + +Setup. During pre-training, the distillation process is the same as that in Sec. 4.2, and when fine-tuning on each category of CIFAR-10, we resize each image into the patch size, which functions as the image patch in Sec. 4.2. + +During training Global-Net and DAD-head, every single image is reshaped to the patch size and the image size, denoted as $\mathbf{I_L}$ and $\mathbf{I_G}$ , respectively. Then we input $\mathbf{I_L}$ and + +![](images/d450fcb5ed1838e71333068b43b63108a5c45cd1a87e8b1658a7490c3fd959a2.jpg) +Figure 4. Qualitative comparisons on MVTec AD dataset [6] between TS [7], which considers only local patches for anomaly localization, and our approach. Through adequately utilizing both the global and the local information, we manage to identify the transistor shift (first row), the cable swap (second row), and metal nut bend (third row) anomalies that are omitted by TS. + +$\mathbf{I}_{\mathbf{G}}$ into Local-Net and Global-Net to generate the local and global feature. The negative local feature is produced by feeding a random different image (resized into the patch size) into Local-Net. The other procedures are the same as those in the experiments on MVTec AD. Further details can be found in Supplementary Material. + +Baselines. Our competitors include OC-SVM [43], KDE [9], $l_{2}$ -AE [16], VAE [4], pixelCNN [45], LSA [1], AnoGAN [42], DSVDD [38], OCGAN [37], and GradCon [22]. The results of baselines are borrowed from [37, 22]. + +Quantitative Results in AUROC. Image-level AUROC comparisons with baselines on CIFAR-10 are shown in + +Table 2. Comparison results among different anomaly detection methods in the pixel-level anomaly localization task on MVTec AD dataset [6]. Competitors include SSIM-AE [8], $l_{2}$ -AE [16], AnoGAN [42], CNN-FD [32], VEVAE [26], SMAI [23], GDR [12] and P-Net [51]. The results of SSIM-AE, $l_{2}$ -AE, AnoGAN and CNN-FD are borrowed from the MVTec AD paper [6], and the results of VEVAE, SMAI, GDR and P-Net are reported in their original papers. Pixel-level AUROC is utilized as the evaluation metric. + +
CategorySSIM-AEl2-AEAnoGANCNN-FDVEVAESMAIGDRP-NetOurs
TextureCarpet0.870.590.540.720.780.880.740.570.96
Grid0.940.900.580.590.730.970.960.980.78
Leather0.780.750.640.870.950.860.930.890.90
Tile0.590.510.50.930.800.620.650.970.80
Wood0.730.730.620.910.770.800.840.980.81
ObjectBottle0.930.860.860.780.870.860.920.990.93
Cable0.820.860.780.790.900.920.910.700.94
Capsule0.940.880.840.840.740.930.920.840.90
Hazelnut0.970.950.870.720.980.970.980.970.84
Metal Nut0.890.860.760.820.940.920.910.790.91
Pill0.910.850.870.680.830.920.930.910.93
Screw0.960.960.80.870.970.960.951.000.96
Toothbrush0.920.930.900.770.940.960.990.990.96
Transistor0.900.860.800.660.930.850.920.821.00
Zipper0.880.770.780.760.780.900.870.900.99
Mean0.860.820.740.780.860.890.890.890.91
+ +Tab. 3. Our method considerably exceeds the second state-of-the-art, GradCon [22], by $4.1\%$ in image-level AUROC. The results show that our model is adaptive to different settings of anomaly detection. + +# 4.4. Analysis on Multi-head Feature Comparison + +In this section, we first conduct ablation study on IAD-head and DAD-head, and further analyze the different discriminative ability in view of these two heads. + +Ablation Study. To evaluate the effectiveness of joint scoring function of the IAD-head and DAD-head, i.e., Eq. (13), we vary $\lambda_{s}$ from 0.0 to 1.0, and calculate the PRO metric on each category. According to Eq. (13), larger $\lambda_{s}$ results in greater proportion of $s_{\mathrm{IAD}}$ in the synthetic anomaly score $s$ , while the proportion of $s_{\mathrm{DAD}}$ decreases accordingly. In the extreme case, $s$ will degenerate into $s_{\mathrm{DAD}}$ or $s_{\mathrm{IAD}}$ if $\lambda_{s}$ equals 0 or 1, respectively. + +Tab. 4 shows the PRO results of our method under different values of $\lambda_{s}$ . Overall, multi-head scoring function performs better than single-head ones, with $4.9\%$ and $0.7\%$ increase compared to single DAD-head and single IAD-head scoring function, respectively. More concretely, categories of textures (e.g., carpet, grid and wood) enjoy greater improvement than those of objects after applying multi-head scoring function. We infer this is because much more repetitive patterns are contained in textures than in objects, and multi-head strategy is conducive to a more distinguishable feature representation, enhancing our model's anomaly localization ability greatly on textures. + +However, it should be noticed that in Tab. 4, the overall + +performances of single DAD-head are worse than those of single IAD-head for both texture and object classes. The reason might be that the performance of DAD-head is highly correlative with the way to construct negative patches. That is, if the construction approach is similar to the real anomalies, DAD-head might perform better, otherwise might perform worse. In our experiment, to involve no priori knowledge, we utilize a simple negative patch construction approach and apply the same method to all the different classes, yet DAD-head still shows great potential in cooperation with IAD-head. To further improve performance of DAD-head, we encourage users to modify the negative patch construction way according to the real-world scenarios. + +Feature Visualization. To better understand the different discriminative abilities in view of IAD-head and DAD-head, we visualize the global and local features under the metrics of IAD-head and DAD-head. Fig. 5 shows the feature visualization for the texture and object. We randomly crop 800 patches from both texture-type (i.e., carpet) and object-type (i.e., cable) defective images, and utilize t-SNE [31] to visualize the features of the abnormal patches and their surroundings. As shown in Fig. 5a, compared with IAD-head, DAD-head is more discriminative on the texture, presenting a clear boundary between anomalies' local and global features. On the contrary, Fig. 5b illustrates that IAD-head separates abnormal local and global features better than DAD-head on the object. Different discriminative abilities of IAD-head and DAD-head ensure excellent performance of the multi-head anomaly detection mechanism in various situations. + +![](images/20f158eb867ace23f618c57a9593c2ad68b905aa3c328124eafb768330d5f563.jpg) +(a) Texture feature visualization + +![](images/6f4f9e06bb3139ff86439d7413e666abc6669250d52f813e32cdede188e9bcde.jpg) +Figure 5. Visualization of the global and local features under the metrics provided by the two anomaly detection heads, i.e., IAD-head and DAD-head. Abnormal patches selected from 800 patches in MVTec AD dataset [6], together with their surroundings, are used for both texture-type (i.e., carpet) and object-type (i.e., cable) visualization. The color map indicates the ratio of the ground-truth anomalous area to each individual patch. Triangles and circles stand for the global and local features respectively. It turns out that texture features are more distinguishable in the view of DAD-head while object features can be better differentiated by IAD-head. + +![](images/c597d85a9d72500ca31a7e5cf4eb51b52719e6b2234bdaf2e5c9d290c73c20f6.jpg) +(b) Object feature visualization + +![](images/f4507a21364d343f46b70d13f59822e7a15146bfbb86f7751433390eda4659c5.jpg) + +![](images/b3e3bc2fccd63c3e704ca04d7eaff55580e8d7ce086a2e34d33e92cfba17d666.jpg) + +Table 3. Comparison results among different one-class classification methods in the image-level anomaly detection task on CIFAR-10 [21]. Competitors include OC-SVM [43], KDE [9], $l_{2}$ -AE [16], VAE [4], PixelCNN [45], LSA [1], AnoGAN [42], DSVDD [38], OCGAN [37] and GradCon [22]. The results of baselines are borrowed from [22, 37]. Image-level AUROC is utilized as the evaluation metric. + +
Normal ClassOC-SVMKDEl2-AEVAEPixelCNNLSAAnoGANDSVDDOCGANGradConOurs
Airplane0.6300.6580.4110.6340.7880.7350.6710.6170.7570.7600.791
Automobile0.4400.5200.4780.4420.4280.5800.5470.6590.5310.5980.703
Bird0.6490.6570.6160.6400.6170.6900.5290.5080.6400.6480.675
Cat0.4870.4970.5620.4970.5740.5420.5450.5910.6200.5860.561
Deer0.7350.7270.7280.7430.5110.7610.6510.6090.7230.7330.739
Dog0.5000.4960.5130.5150.5710.5460.6030.6570.6200.6030.638
Frog0.7250.7580.6880.7450.4220.7510.5850.6770.7230.6840.732
Horse0.5330.5640.4970.5270.4540.5350.6250.6730.5750.5670.674
Ship0.6490.6800.4870.6740.7150.7170.7580.7590.8200.7840.814
Truck0.5080.5400.3780.4160.4260.5480.6650.7310.5540.6780.722
Mean0.5860.6100.5360.5830.5510.6410.6180.6480.6570.6640.705
+ +Table 4. Results of ablation study on the multi-head scoring function. $\lambda_{s}$ in Eq. (13) varies from 0.0 to 1.0 with step 0.2. The categories having better performance with multi-head scoring functions than with single-head ones is highlighted in boldface. Per-region-overlap (PRO) is used as the evaluation metric. + +
Category0.00.20.40.60.81.0
Carpet0.9630.9660.9680.9720.9770.965
Grid0.8680.8820.9070.9320.9320.894
Leather0.8990.9020.9090.9110.9090.896
Tile0.9510.9200.9050.8950.8830.874
Wood0.8320.9000.9250.9410.9410.920
Bottle0.9280.9560.9650.9660.9680.965
Cable0.9410.9800.9910.9890.9800.961
Capsule0.8430.8840.9100.9370.9600.978
Hazelnut0.9370.9370.9490.9570.9620.964
Metal Nut0.9210.9300.9410.9560.9670.971
Pill0.8750.9350.9580.9710.9780.978
Screw0.9480.9860.9960.9991.0001.000
Toothbrush0.8970.9130.9340.9480.9610.966
Transistor0.8830.9350.9720.9930.9990.997
Zipper0.9950.9950.9950.9940.9920.974
Mean0.9120.9350.9480.9570.9610.954
+ +# 5. Conclusion and Discussion + +In this work, we propose an unsupervised anomaly localization approach with due consideration to both the global and the local information from an image. Two anomaly detection heads are introduced to sufficiently spot the discrepancy between global and local features. With the scoring function developed from such multi-head design, we achieve high-precision anomaly localization, significantly surpassing state-of-the-art alternatives. + +However, there still remains some future work worth exploration. On one hand, our approach uses a fixed patch size regardless of the anomaly type. To further improve the robustness under various anomaly scales, techniques such as score map averaging [7] and feature pyramid [24] could be considered. On the other hand, Local-Net in our work is distilled from a deep model pre-trained on ImageNet. Self-supervised learning methods [18, 15] might be of benefit to getting a better representation on specific datasets. Nevertheless, our approach sheds light on a promising direction by relating the individual patches with their surroundings for the anomaly localization task. + +# References + +[1] Davide Abati, Angelo Porrello, Simone Calderara, and Rita Cucchiara. Latent space autoregression for novelty detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 6, 8 +[2] Samet Akcay, Amir Atapour-Abarghouei, and Toby P Breckon. Ganomaly: Semi-supervised anomaly detection via adversarial training. In Asian Conf. Comput. Vis., 2018. 1 +[3] Naomi S Altman. An introduction to kernel and nearest-neighbor nonparametric regression. The American Statistician, 1992. 5, 6 +[4] Jinwon An and Sungzoon Cho. Variational autoencoder based anomaly detection using reconstruction probability. Special Lecture on IE, 2015. 5, 6, 8 +[5] Christoph Baur, Benedikt Wiestler, Shadi Albarqouni, and Nassir Navab. Deep autoencoding models for unsupervised anomaly segmentation in brain mr images. In International MICCAI Brainlesion Workshop, 2018. 1, 2 +[6] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 1, 2, 5, 6, 7, 8 +[7] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Uninformed students: Student-teacher anomaly detection with discriminative latent embeddings. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 2, 3, 5, 6, 8 +[8] Paul Bergmann, Sindy Löwe, Michael Fauser, David Sattlegger, and Carsten Steger. Improving unsupervised defect segmentation by applying structural similarity to autoencoders. arXiv preprint arXiv:1807.02011, 2018. 2, 5, 6, 7 +[9] Christopher M Bishop. Pattern recognition and machine learning. Springer, 2006. 6, 8 +[10] Wen-Hsuan Chu and Kris M Kitani. Neural Batch Sampling with Reinforcement Learning for Semi-Supervised Anomaly Detection. PhD thesis, Carnegie Mellon University Pittsburgh, 2020. 1, 2 +[11] Anne-Sophie Collin and Christophe De Vleeschouwer. Improved anomaly detection by training an autoencoder with skip connections on images corrupted with stain-shaped noise. arXiv preprint arXiv:2008.12977, 2020. 1, 2, 4 +[12] David Dehaene, Oriel Frigo, Sébastien Combrexelle, and Pierre Eline. Iterative energy-based projection on a normal data manifold for anomaly localization. arXiv preprint arXiv:2002.03734, 2020. 2, 5, 7 +[13] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conf. Comput. Vis. Pattern Recog., 2009. 3, 5 +[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 Int. Conf. Comput. Vis., 2019. 1, 2 +[15] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Do + +ersch, 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.8 +[16] Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In IEEE Conf. Comput. Vis. Pattern Recog., 2006. 5, 6, 7, 8 +[17] Simon Hawkins, Hongxing He, Graham Williams, and Rohan Baxter. Outlier detection using replicator neural networks. In International Conference on Data Warehousing and Knowledge Discovery, 2002. 2 +[18] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 8 +[19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. 3 +[20] Chaoqin Huang, Fei Ye, Jinkun Cao, Maosen Li, Ya Zhang, and Cewu Lu. Attribute restoration framework for anomaly detection. arXiv preprint arXiv:1911.10676, 2019. 2 +[21] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 5, 6, 8 +[22] Gukyeong Kwon, Mohit Prabhushankar, Dogancan Temel, and Ghassan AlRegib. Backpropagated gradient representations for anomaly detection. In Eur. Conf. Comput. Vis., 2020. 1, 2, 5, 6, 7, 8 +[23] Zhenyu Li, Ning Li, Kaitao Jiang, Zhiheng Ma, Xing Wei, Xiaopeng Hong, and Yihong Gong. Superpixel masking and inpainting for self-supervised anomaly detection. In Brit. Mach. Vis. Conf., 2020. 5, 7 +[24] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 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 Eur. Conf. Comput. Vis., 2018. 3 +[26] Wenqian Liu, Runze Li, Meng Zheng, Srikrishna Karanam, Ziyan Wu, Bir Bhanu, Richard J Radke, and Octavia Camps. Towards visually explaining variational autoencoders. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 5, 7 +[27] W. Liu, D. Lian W. Luo, and S. Gao. Future frame prediction for anomaly detection - a new baseline. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 1 +[28] Philipp Liznerski, Lukas Ruff, Robert A Vandermeulen, Billy Joe Franks, Marius Kloft, and Klaus-Robert Müller. Explainable deep one-class classification. arXiv preprint arXiv:2007.01760, 2020. 1, 4 +[29] Stuart Lloyd. Least squares quantization in pmc. IEEE transactions on information theory, 1982. 5, 6 +[30] Cewu Lu, Jianping Shi, and Jiaya Jia. Abnormal event detection at 150 fps in matlab. In Int. Conf. Comput. Vis., 2013. 1 +[31] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 2008. 7 + +[32] Paolo Napoletano, Flavio Piccoli, and Raimondo Schettini. Anomaly detection in nanofibrous materials by cnn-based self-similarity. Sensors, 2018. 1, 2, 3, 5, 6, 7 +[33] 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. 3 +[34] Duc Tam Nguyen, Zhongyu Lou, Michael Klar, and Thomas Brox. Anomaly detection with multiple-hypotheses predictions. In Int. Conf. Mach. Learn., 2019. 2 +[35] Lihai Nie, Laiping Zhao, and Keqiu Li. Glad: Global and local anomaly detection. In 2020 IEEE International Conference on Multimedia and Expo (ICME), 2020. 2 +[36] Hyunjong Park, Jongyoun Noh, and Bumsub Ham. Learning memory-guided normality for anomaly detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 2 +[37] Pramuditha Perera, Ramesh Nallapati, and Bing Xiang. O-rgan: One-class novelty detection using gans with constrained latent representations. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 1, 2, 6, 8 +[38] Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas Deecke, Shoaib Ahmed Siddiqui, Alexander Binder, Emmanuel Müller, and Marius Kloft. Deep one-class classification. In Int. Conf. Mach. Learn., 2018. 1, 2, 6, 8 +[39] Mohammad Sabokrou, Mohammad Khalooei, Mahmood Fathy, and Ehsan Adeli. Adversarily learned one-class classifier for novelty detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 2 +[40] Mayu Sakurada and Takehisa Yairi. Anomaly detection using autoencoders with nonlinear dimensionality reduction. In Proceedings of the MLSDA 2014 2nd Workshop on Machine Learning for Sensory Data Analysis, 2014. 2 +[41] Thomas Schlegl, Philipp Seebock, Sebastian M Waldstein, Georg Langs, and Ursula Schmidt-Erfurth. f-anogan: Fast unsupervised anomaly detection with generative adversarial networks. Medical image analysis, 2019. 1, 2 +[42] Thomas Schlegl, Philipp Seeböck, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International conference on information processing in medical imaging, 2017. 1, 2, 5, 6, 7, 8 +[43] Bernhard Scholkopf, Robert C Williamson, Alex Smola, John Shawe-Taylor, and John Platt. Support vector method for novelty detection. Adv. Neural Inform. Process. Syst., 1999. 1, 2, 5, 6, 8 +[44] Yurun Tian, Bin Fan, and Fuchao Wu. L2-net: Deep learning of discriminative patch descriptor in euclidean space. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 3 +[45] Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelCNN decoders. In Adv. Neural Inform. Process. Syst., 2016. 6, 8 +[46] Yingda Xia, Yi Zhang, Fengze Liu, Wei Shen, and Alan Yuille. Synthesize then compare: Detecting failures and anomalies for semantic segmentation. arXiv preprint arXiv:2003.08440, 2020. 1, 2 + +[47] Sri Kalyan Yarlagadda, David Guera, Paolo Bestagini, Fengqing Maggie Zhu, Stefano Tubaro, and Edward J Delp. Satellite image forgery detection and localization using gan and one-class classifier. Electronic Imaging, 2018. 1 +[48] Jihun Yi and Sungroh Yoon. Patch svdd: Patch-level svdd for anomaly detection and segmentation. In Asian Conf. Comput. Vis., 2020. 1, 2 +[49] Muhammad Zaigham Zaheer, Jin-ha Lee, Marcella Astrid, and Seung-Ik Lee. Old is gold: Redefining the adversarially learned one-class classifier training paradigm. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 2 +[50] Chong Zhou and Randy C Paffenroth. Anomaly detection with robust deep autoencoders. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2017. 2 +[51] 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. arXiv preprint arXiv:2008.03632, 2020. 1, 2, 5, 7 \ No newline at end of file diff --git a/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/images.zip b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5366006d4e36b10e5e6027a6f84b9e5e452f65c6 --- /dev/null +++ b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e82c256c821e244b2d89bb34d375a223aaae1b44718fae831b4821191480c8ea +size 741852 diff --git a/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/layout.json b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..609ef505bbd6920775dfdff3c0901592542b4e58 --- /dev/null +++ b/glancingatthepatchanomalylocalizationwithglobalandlocalfeaturecomparison/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9a3d4a1a2f0994e38f728675e2badd6e4f9c3130af716bab07970385bea4972 +size 401662 diff --git a/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_content_list.json b/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..854954cbe8c3cd923f63f3c8933aa481d19a2b33 --- /dev/null +++ b/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58622dcafd9df29f570ae7488162461210fc0ab2e99c159f8179554af37f6435 +size 78988 diff --git a/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_model.json b/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ddbd300b5af24321e35288b81b8eff95853dbc78 --- /dev/null +++ b/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aea7fc1185a0a695eda908cdbcd1ad6bebc247a3a03dd4a72693c1a3ad16984b +size 100593 diff --git a/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_origin.pdf b/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7104d3719aae6af21dbccb33cc29821fe304e561 --- /dev/null +++ b/global2localefficientstructuresearchforvideoactionsegmentation/5119d903-c236-45a0-84fc-46ea16288f76_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae8ce0b5b79ab7fd4a105cd79de83c6cbddd49f469bf7e4edcbda865a1f909c6 +size 445302 diff --git a/global2localefficientstructuresearchforvideoactionsegmentation/full.md b/global2localefficientstructuresearchforvideoactionsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..74398be86a8cff1fc65b1c3d4160d44748405931 --- /dev/null +++ b/global2localefficientstructuresearchforvideoactionsegmentation/full.md @@ -0,0 +1,320 @@ +# Global2Local: Efficient Structure Search for Video Action Segmentation + +Shang-Hua Gao $^{1*}$ Qi Han $^{1*}$ Zhong-Yu Li $^{1}$ +Pai Peng $^{2}$ Liang Wang $^{3}$ Ming-Ming Cheng $^{1\dagger}$ +TKLNDST, CS, Nankai University $^{1}$ Tencent $^{2}$ NLPR $^{3}$ + +http://mmcheng.net/g21search + +# Abstract + +Temporal receptive fields of models play an important role in action segmentation. Large receptive fields facilitate the long-term relations among video clips while small receptive fields help capture the local details. Existing methods construct models with hand-designed receptive fields in layers. Can we effectively search for receptive field combinations to replace hand-designed patterns? To answer this question, we propose to find better receptive field combinations through a global-to-local search scheme. Our search scheme exploits both global search to find the coarse combinations and local search to get the refined receptive field combination patterns further. The global search finds possible coarse combinations other than human-designed patterns. On top of the global search, we propose an expectation guided iterative local search scheme to refine combinations effectively. Our global-to-local search can be plugged into existing action segmentation methods to achieve state-of-the-art performance. The source code is publicly available on http://mmcheng.net/g21search. + +# 1. Introduction + +Action recognition segments the action of each video frame, playing an important role in computer vision applications such as clips tagging [59], video surveillance [8, 9], and anomaly detection [54]. While conventional works [4, 17, 18, 56] have continuously refresh the recognition performance of short trimmed videos containing a single activity, segmenting each frame densely in long untrimmed videos remains challenging as those videos contain many activities with different temporal lengths. Temporal convolutional networks (TCN) [12, 16, 35, 40, 65] are widely adapted in action segmentation tasks with their ability to capture both long-term and short-term information. Appropriate receptive fields in layers are crucial for TCN as large recep- + +![](images/74c2498bd1c3736bd8dcbde1050e8a028d8093e0abd2a57809638947ee294567.jpg) +Figure 1. Search space comparison between searching for network architecture and receptive field combinations. Left: Network architecture search mostly search for several operations with different functions. Right: The search space of receptive field combinations is huge. The white, green, blue nodes and orange shade represent the dilation rate candidates, the sparse search space in global search, one of the global searched results, and the local search space. + +tive fields contribute to long-term dependencies while small receptive fields benefit the local details. State-of-the-art (SOTA) methods [5, 29, 39, 40, 65] rely on human-designed receptive field combinations, i.e., dilation rate or pooling size in each layer, to make the trade-off between capturing long and short term dependencies. Questions have raised: Are there other effective receptive field combinations that perform comparable or better than hand-designed patterns? Will the receptive field combinations vary among different datasets? To answer those questions, we propose to find the possible receptive field combinations in a coarse-to-fine scheme through the global-to-local search. + +As shown in Fig. 1, unlike the existing network architecture search spaces [3, 27, 43] that only contain several operation options within a layer, the available search space of receptive field combinations could be huge. Suppose a TCN has $L$ convolutional layers and $D$ possible receptive fields in each layer. There are $D^{L}$ possible combinations, i.e., the number of possible receptive field combinations in MS-TCN [12] is $1024^{40}$ . Directly apply network architecture searching algorithms [27, 41, 43, 66] to such a huge search space is impractical. For example, conventional reward-based searching methods [42, 47, 66] are not suitable for CNN-based models with a huge search + +space. The model training and performance evaluation of each possible combination are too costly. Differentiable architecture searching methods (DARTS) [3, 41, 43] rely on shared big networks to save training time, thus only supporting several operators within a layer due to the model size constraint. Moreover, they heavily depend on the initial combination and fail to find new combinations with a huge difference from the initial one. While our goal is to explore effective receptive field combinations other than human-designed patterns in the huge search space, those algorithms are either too costly or cannot support the large search space. + +To explore the search space with low cost, we exploit both a genetic-based global search to find the coarse receptive field combinations and an expectation guided iterative (EGI) local search to get the refined combinations. Specifically, we follow the MS-TCN [12] to use dilation rates to determine layers' receptive fields. A genetic-based global search scheme is proposed to find coarse combinations within a sparsely sampled search space at an affordable cost. The global search discovers various combinations that achieve even better performance than human designings but have completely different patterns. Based on the global-searched coarse combinations, we propose the local search to determine fine-grained dilation rates. Our proposed convolutional weight-sharing scheme enforces learned dilation weights to approximate the probability mass distribution for calculating the expectation of dilation rates. The expectation guided searching transfer the discrete dilation rates into a distribution, allowing fine-grained dilation rates searching. With an iteratively searching process, the local search gradually finds more effective fine-grained receptive field combinations with low cost. Our proposed global-to-local search scheme can be plugged into existing models, surpassing human-designed structures with impressive performance gain. In summary, we make two major contributions: + +- The expectation guided iterative local search scheme enables searching fine-grained receptive field combinations in the dense search space. +- The global-to-local search discovers effective receptive field combinations with better performance than hand-designed patterns. + +# 2. Related Work + +# 2.1. Action Segmentation + +Many approaches have been proposed for modeling dependencies for action segmentation. Early works [13-15] mostly model the changing state of appearance and actions with sliding windows [2, 30, 51]. Thus they mainly focus on short-term dependencies. Capturing both short-term and + +long-term dependencies then gradually becomes the focus of action segmentation. + +Sequential Model. Sequential models capture long-short term dependencies in an iterative form. Vo and Bobick [64] apply the Bayes network to segment actions represented with the stochastic context-free grammar. Tang et al. [63] use a hidden Markov model to model transitions between states and durations. Later, hidden Markov models are combined with context-free grammar [32], Gaussian mixture model [33], and recurrent networks [34, 50] to model long-term action dependencies. Cheng et al. [7] apply the sequence memorizer to capture long-range dependencies in visual words learned from the video. However, these sequential models are inflexible in parallel modeling long-term dependencies and usually suffer from information forgetting [12, 40]. + +Multi-stream Architecture. Some researchers [10, 49, 57, 58] utilize multi-stream models to model dependencies from both the long and short term. Richard and Gall employ [49] dynamic programming to inference models composed of length model, language model, and action classifier. Singh et al. [57] learn short video chunks representation with a two-stream network and pass these chunks to a bi-directional network to predict action segmentation results sequentially. A three-stream architecture is proposed in [58], which contains egocentric cues, spatial and temporal streams. Tricornet [10] utilizes a hybrid temporal convolutional and recurrent network to capture local motion and memorize long-term action dependencies. CoupledGAN [19] uses a GAN model to utilize multi-modal data to better model human actions' evolution. Capturing long-short term information with multiple streams increases the computational redundancy. + +Temporal Convolutional Network. Recently, temporal convolutional networks (TCN) are introduced to model dependencies of different ranges within a unified structure by adjusting receptive fields and can process long videos in parallel. Lea et al. [35] propose the encoder-decoder style TCN for action segmentation to capture long-range temporal patterns and apply the dilated convolution to enlarge the receptive field. TDRN [37] further introduces the deformable convolution to process the full-resolution residual stream and low-resolution pooled stream. MS-TCN [12,40] utilizes multi-stage dilated TCNs with hand-designed dilation rate combinations to capture information from various temporal receptive fields. However, the adjustment of receptive fields still relies on human design, which may not be appropriate. Our proposed efficient receptive field combinations searching scheme can automatically discover more efficient structures, improving these TCN based methods. + +Complementary Techniques. Instead of capturing long-term and short-term information, some works [11, 65] further improve the action segmentation performance with boundary refinement. Li et al. [11] utilize an iterative training procedure with transcript refinement and soft boundary assignment. Wang et al. [65] leverage semantic boundary information to refine the prediction results. Other researchers focus on action segmentation under the weakly supervised [11, 33, 50] or unsupervised [55] settings. These works still rely on the efficient TCN to model the action dependencies, thus complementing the proposed method. + +# 2.2. Network Architecture Search + +The genetic algorithm [45] has achieved remarkable performance on a wide range of applications. Many genetic-based methods are recently introduced for the neural networks architecture search of vision tasks [42, 44, 47, 61, 66]. An evolutionary coding scheme is proposed in Genetic CNN [66] to encode the network architecture to a binary string. A hierarchical representation is presented by Liu et al. [42] to constrain the search space. Real et al. [47] regularize the evolution by an age property selection operation. Sun et al. [61] introduce a variable-length encoding method for effective architecture designing. However, the genetic algorithm requires the training of each candidate, consuming too much computational cost when faced with a huge search space. + +Differentiable architecture search [43] saves the training time by introducing a large network containing subnetworks with different searching options. The importance of searched blocks is determined by gradient backpropagation [53]. This differentiable search idea is further extended [67] to deal with semantic segmentation [41] and other tasks beyond image classification [3]. However, these network architecture search methods are designed for finding a limited number of operations such as convolution, ReLU, batch normalization, short connection, etc. Thus, they cannot handle the huge receptive field combinations search space. In this paper, we propose a global search to handle the huge search space with sparse sampling. The expectation guided iterative local search then transfers the sparse search space of receptive fields into the dense one for fine-level searching. + +# 3. Method + +The pipeline of our proposed global-to-local search method has two components: (i) a genetic-based global search algorithm that produces coarse but competitive combinations of the receptive fields; (ii) an expectation guided iterative local search scheme that locally refines the global-searched coarse structures. + +# 3.1. Description + +Our objective is to efficiently search for optimal receptive field combinations for the given dataset. The receptive field can be represented with multiple forms, such as the dilation rate, kernel size, pooling size, stride, and the stack number of layers. In this work, we mainly follow the MSTCN [12] to formulate the receptive fields using the combinations of dilation rates in layers and propose to evolve these combinations during the searching process. Note that other receptive field representations can also be applied to the proposed global-to-local search with some minor adjustments. + +Suppose a TCN has $L$ convolutional layers and $D = \{d_1, d_2, \dots, d_N\}$ is the possible dilation-rates/receptive-fields in each layer. The combination of receptive fields is represented with $C = \{c_1, \dots, c_l, \dots, c_L\}$ , where $l \in [1, L]$ is the index of layers with dilated convolutions, and $c_l \in D$ is the receptive field of each layer. There are $|D|^L$ possible combinations of receptive fields, i.e., the possible receptive field combinations in MS-TCN [12] is $1024^{40}$ when dilation rates ranging from 1 to 1024. Directly searching for effective combinations in such a large search space is impractical. We thus decompose the searching process into the global and local search to find the combination in a coarse-to-fine manner. + +# 3.2. Global Search + +The objective of the global search is to find the coarse receptive field combinations with affordable cost. Therefore, we reduce the search space by sparsely sampling the dilation rates within layers. Multiple sparse discrete sampling strategies such as uniform sampling, gradually sparse sampling, and gradually dense sampling can be applied to sparse the search space. A gradually sparse sampling scheme from small to large dilation rates is appropriate for the action segmentation task. Because small receptive fields benefit the extraction of precise local details while large receptive fields contribute to coarse long-term dependencies of video sequences. Therefore we formulate the receptive field space in global search as: + +$$ +D _ {g} = \left\{d _ {i} = k ^ {i}, i \in [ 0, 1, \dots T ] \right\}, \tag {1} +$$ + +where $k$ is the controller of the search space sparsity, and $T$ determines the largest available receptive field. With the same maximum receptive field, $|D_g| \ll |D|$ . The search space is greatly reduced. i.e., when set $k = 2$ , and set the maximum receptive field to 1024 as in MS-TCN, the search space is reduced from $1024^{40}$ to $11^{40}$ . + +However, the reduced space of receptive field combinations can still be huge, unaffordable for a brute force search. We propose a genetic algorithm [45] based method to find coarse combinations that are competitive or even better than + +![](images/3ea7ba04c776759595d39fc09bb1325f48c4f9610432d289a9e5fb41b386e406.jpg) +Figure 2. Illustration of one iteration in our genetic-based global search algorithm. + +human designing. We illustrate one iteration of our proposed genetic-based global search in Fig. 2. We now detail the selection, crossover, mutation process within our proposed global search method. + +Selection. The population of receptive field combinations can be described as a group of candidate structures $P = \{C_i, i \in [1, M]\}$ , where $C_i$ is the candidate structure in the global search space, and $M$ is the number of individuals in the population. The selection operation selects individuals to be kept in $P$ based on the estimated performance of each structure $C_i$ , denoted by $E(C_i)$ : + +$$ +E \left(C _ {i}\right) = f \left(V \mid C _ {i}, \theta_ {n}\right), \tag {2} +$$ + +where $f(\cdot)$ is the evaluation metric detailed in Sec. 4, and $V, \theta_{n}$ are the cross-validation set and model trained with $n$ epochs, respectively. + +Crossover. This operation generates new samples of receptive field combinations. Every two combinations in the population are exchanged to born new patterns of the combination while maintaining the local structures. Each $C_i$ will be selected for the crossover operation with probability $p(C_i)$ : + +$$ +p \left(C _ {i}\right) = \frac {E \left(C _ {i}\right)}{\sum_ {i} ^ {M} E \left(C _ {i}\right)}. \tag {3} +$$ + +Instead of randomly exchanging individual points, we choose to exchange random segments of the receptive field combination since the representation ability lies in the combination patterns. Specifically, we randomly choose two anchors and exchange combinations within anchors to generate new samples. + +Mutation. The mutation operation avoids getting stuck in local optimal results by choosing an individual with probability $p_m$ and randomly changing a value within the selected combination. + +The global search process can be summarised as Algorithm (1), and a simple example is given in Fig. 2. With the coarse search space and the global search method, we can find receptive field combinations with different patterns than human-designed structures while having similar or even better performance. We further propose the local search to locally find the more efficient combinations on top of the global-searched structures. We show in Tab. 5 that + +# Algorithm 1 Global Search. + +Input: Iterations $N$ , training epoch $n$ , randomly initialized $P$ , mutation probability $p_m$ , and population size $M$ ; for iter in $[1, N]$ do + +Select individuals for crossover based on Eqn. (3) and crossover for every two selected individuals; + +Mutate the new individuals with probability $p_m$ ; + +Training each individual with $n$ epochs; + +Select the top $M$ individuals based on Eqn. (2) as the new population $P$ ; + +end for + +return $P$ + +local search heavily relies on the initial structure, revealing the importance of global search. + +# 3.3. Expectation Guided Iterative Local Search + +The local search aims to find more efficient receptive field combinations in a fine-grained level at a low cost. A naive approach is to sample finer-grained dilation rates near the initial dilation rate searched by the global search and apply existing DARTS algorithms [3, 43] to choose for the proper one. However, even with the good initial structure provided by the global search, the available range of fine-grained dilation rates is still large. Existing search algorithms are designed for searching sparse operators with several choices in each layer, thus cannot handle dilation rates with hundreds of choices. While too sparsely sampling is in conflict with our goal of searching for the finer-grained receptive fields. Also, DARTS methods search operators with different functionality [43], while the searching on receptive fields only contains one functional dimension. Different subsets in the dataset sometimes prefer different searching options. Searching within a functional dimension enables us to determine dilation rates with the expectation of all subsets instead of choosing the option required by one majority subset. Therefore, we propose an expectation guided iterative (EGI) local search scheme to determine the finer-level dilation rates on top of the global-searched structures. + +Suppose that the receptive field of a layer $l$ is $D_{l}$ . For a dataset, once we get the probability mass distribution of dilation rates around $D_{l}$ , we can obtain the expected dilation rate with the weighted average of the dilation rates required by all subsets. However, the probability mass of di + +![](images/a1a307d2b50977977113dda74f9f08db06b4cf185bf9846664c136c6d20b5bfb.jpg) +Figure 3. The approximated probability mass function of dilation rates is determined by the multi-dilated convolutional layer with shared weights. $d_{i}$ is the dilation rate and $\alpha_{i}$ is the PMF in Eqn. (4). + +lation rates for the dataset is inaccessible. Therefore, we utilize a convolutional weight-sharing scheme to enforce the learned importance weights of dilation rates to approximate the probability mass. To get the approximated probability mass function of dilation rates, we first evenly sample $S$ dilation rates near the initial dilation rate $D_{l}$ within the range of $[D_l\pm \Delta D_l]$ . The set of available dilation rates within this layer is $T_{l} = \{d_{i}|i\in [1,S]\}$ , where $d_{i} = D_{l} - \Delta D_{l} + (i - 1)\cdot 2\Delta D_{l} / (S - 1)$ . $\Delta D_{l}$ is the finer controller of the search space that is smaller than the sampling sparsity in the global search. + +Algorithm 2 Expectation Guided Iterative Local Search. +Input: Iterations $N$ , initial receptive fields $\overline{D}$ Initialize model using given $D$ . +for iter in [1, N] do Construct $T_{l}$ for each layer based on $D$ Train model to get the PMF in Eqn. (4); Obtain new dilation rates through Eqn. (6); Update $D$ end for return local-searched $D$ + +With the dilation rates set $T_{l}$ , we propose a multi-dilated layer composed of a shared convolutional weight and multiple branches with different dilation rates, as shown in Fig. 3. Each branch has a unique weight to determine the importance of the dilation rate. During the searching process, the weights are updated with the gradient backpropagation to reflect the receptive field requirements of the dataset. Existing DARTS schemes [43, 67] have separated weights in each branch. In contrast, our convolutional weight-sharing strategy forces the model to learn the approximated probability of receptive fields and ease the model convergence. Specifically, the dilation rates in the multi-dilated convolutional layer are set to $T_{l}$ . Apart from the shared convolutional $\theta$ , the multi-dilated layer contains weight $W =$ + +![](images/4041ae775a5077540e727cb5ffaad173b2fb109c6a5280064e7cd4b8e034ca4b.jpg) +Figure 4. Visualization of receptive field combinations changes during the EGI local searching process. + +$\{w_{1}, w_{2}, \dots, w_{i}, i \in [1, S]\}$ to determine the importance of the dilation rates. $W$ is unbounded, thus cannot be directly used to determine the dilation rates probability. Therefore, we propose a normalization function to get the approximated probability mass function $PMF(d_{i})$ of dilation rates through normalizing $w_{i}$ : + +$$ +P M F \left(d _ {i}\right) = \alpha_ {i} = \frac {\left| w _ {i} \right|}{\sum_ {i} ^ {S} \left| w _ {i} \right|}. \tag {4} +$$ + +With the probability mass function, given the input feature $x$ , the output $y$ of the multi-dilated convolutional layer can be written as follows: + +$$ +y = \sum_ {i} ^ {S} \alpha_ {i} \Psi (x, d _ {i}, \theta), \tag {5} +$$ + +where $\Psi (x,d_i,\theta)$ is the convolutional operation with the shared weight $\theta$ and dilation rate $d_{i}$ . $\alpha_{i}$ is updated with gradient optimization. Once we get the probability mass function, the newly searched dilation rate $D_l^{\prime}$ is obtained with the expectation: + +$$ +D _ {l} ^ {\prime} = \left\lfloor \sum_ {d _ {i} \in T _ {l}} P M F \left(d _ {i}\right) \cdot d _ {i} \right\rfloor . \tag {6} +$$ + +To reduce the computational cost during the local search process, we reduce the number of dilation rates in $T_{l}$ to 3 by default and apply the iterative search scheme to find the more suitable dilation rate based on the $D_{l}^{\prime}$ from the last iteration. The local search process can be summarised as Algorithm (2). Furthermore, Fig. 4 visualizes the dilation rates changes during the local searching process. + +# 4. Experiments + +We introduce the implementation details, verify the effectiveness, and analyze the property of our proposed global-to-local search scheme in this section. + +
BreakFast50SaladsGTEA
F@{10,25,50}EditAccF@{10,25,50}EditAccF@{10,25,50}EditAcc
MS-TCN [12]52.648.137.961.766.376.374.064.567.980.787.585.474.681.479.2
Reproduce69.163.750.169.967.378.875.364.471.477.887.183.670.481.175.5
Global72.266.051.571.069.279.376.568.171.981.289.187.174.484.278.6
Local74.969.055.273.370.780.378.069.873.482.289.987.375.884.678.5
+ +Table 1. Performance of the global and local searching stages of our global-to-local searching method using MS-TCN [12] as the baseline. + +
#Cls#Vid#FrameScene
GTEA [15]11281115daily activities
50Salads [60]175011552preparing salads
BreakFast [31]4817122097cooking breakfast
+ +# 4.1. Implementation Details + +Structure Searching and Training. Our proposed method is implemented with the PyTorch [46], MindSpore [1], and Jitter [28] frameworks. Following existing works [12,40], features are first extracted from videos using the I3D network [4] and then passed to action segmentation models to get the temporal segmentation. Since our proposed global-to-local search scheme is model-agnostic, the training settings for model evaluation, i.e., training epochs, optimizer, learning rate, batch size, keep the same with the cooperation methods [5, 40, 65]. In the global search stage, we set the total iterations $N = 100$ , $k = 2$ in Eqn. (1), the initialized population size $M = 50$ , and mutation probability $p_m = 0.2$ . The $T$ in Eqn. (1) is set to 10, indicating the maximum dilation rate of the global search space is 1024. We observe that 5 epochs of training can reflect the structure performance, and therefore models are trained with 5 epochs for evaluation. In the EGI local search stage, $\Delta D_l$ and $S$ are set to be $0.1D_l$ and 3, respectively. We train the model for 30 epochs during local search and update the structure every 3 epochs. + +Datasets. Following [5, 12, 40, 65], we evaluate our proposed method on three popular action segmentation datasets: Breakfast [31], 50Salads [60], and GTEA [15]. The details of the three datasets are summarised in Tab. 2. As far as we know, the Breakfast dataset is the largest public dataset for action segmentation task, which has a larger number of categories and samples compared with the other two datasets. So we perform our ablations mainly on the Breakfast dataset if not otherwise stated. Following common settings [5, 12, 40, 65], we perform 4-fold cross-validation for the Breakfast and GTEA dataset and 5-fold cross-validation for the 50Salads dataset. + +Table 2. Details of three action segmentation datasets. #Cls and #Vid are the numbers of classes and videos, respectively. #Frame is the average frames of videos. + +
BreakFastF@0.1F@0.25F@0.5EditAcc
ED-TCN [35]----43.3
HTK (64) [32]----52.0
TCFPN [11]----56.3
GRU [50]----60.6
GTRM [29]57.554.043.358.765.0
MS-TCN [12]52.648.137.961.766.3
Ours-MS-TCN74.969.055.273.370.7
MS-TCN++ [40]64.158.645.965.667.6
Ours†-MS-TCN++72.466.853.570.269.6
BCN [65]68.765.555.066.270.4
Ours†-BCN72.569.960.269.072.9
SSTDA [5]75.069.155.273.770.2
Ours‡-SSTDA76.369.954.674.570.8
+ +Table 3. Cooperating with SOTA methods. We perform the whole search pipeline based on MS-TCN [12]. Because of the limited computing resources, we only perform the EGI local search on MS-TCN++ [40] and BCN [65], denoted by $\dagger$ . SSTDA [5] uses MS-TCN [12] as a backbone, so we directly add our searched structure to SSTDA, denoted by $\ddagger$ . + +Evaluation Metrics. We follow previous works [5,12,40, 65] to use the frame-wise accuracy (Acc), segmental edit score (Edit) [35], and segmental F1 score [38] at temporal intersection over union with thresholds 0.1, 0.25, 0.5 (F@0.1, F@0.25, F@0.5) as our evaluation metrics. + +# 4.2. Performance Evaluation + +Global2Local Search. Our proposed global-to-local search aims to find new combinations of receptive fields better than human designings. We mainly take MS-TCN [12] as our baseline architecture to perform the global-to-local search. When testing the MS-TCN on the Breakfast dataset, we train all models with the batch size 8 to save training time. The reproduced results shown in Tab. 1 indicates that large batch size achieves much better performance. Tab. 1 shows that global-to-local searched structures achieve considerable performance improvements than human-designed baselines, i.e., the searched structure surpasses the reproduced baseline with $5.8\%$ in terms of $\mathrm{F@0.1}$ . The global-to-local search focuses on the receptive field combinations, thus can cooperate with existing SOTA action segmentation methods to further improve their performance. As shown in Tab. 3, on the large scale BreakFast dataset, global-to-local search consistently boosts the performance of MS + +![](images/3997e4b6e04bc122ae083f46bb919d1b9c1fc776c52cf9a4f701e4d85c5cae2c.jpg) +Figure 5. Performance comparison between our proposed genetic-based search and random search during the global search stage. + +
BreakFastF@0.1F@0.25F@0.5EditAcc
DARTS73.867.652.872.869.3
Ours74.969.055.273.370.7
+ +Table 4. Performance of our proposed EGI local search and previous DARTS [43]. + +TCN++ [40], BCN [65], and SSTDA [5]. Also, we give comparisons on two small scale datasets, 50Salads and GTEA dataset in Tab. 10 and supplementary, proving the effectiveness of our proposed global-to-local search. + +Global Search. Global search reduces the computational cost with the sparse search space and our proposed genetic-based searching scheme. Fig. 5 shows the performance change of models during the global searching process. Compared with the random search, the genetic-based global search converges faster. The standard division of model performance searched by genetic-based search is smaller than the random search, showing the stability of our proposed search scheme. The visualized well-performed global-searched structures shown in the supplementary prove that the global search discovers various structures completely different from human-designed patterns. Tab. 5 also shows that the local search heavily relies on global-searched structures to achieve better performance. + +Local Search. Based on the global-searched structures, our proposed EGI local search aims to fine-tune the receptive field in a finer search space. Compared with the DARTS [43] method that only supports several search options, the EGI local search iteratively finds the accurate dilations in a dense space, obtaining structures with better performance, as shown in Tab. 4. As shown in Tab. 6, EGI local search is insensitive to the number of sampling dilation rates $S$ , as it searches dilation rates with the expectation. Tab. 5 shows that the EGI local search can boost the performance of randomly generated, human-designed, and global-searched structures. Still, the performance of the local-searched structures is related to the initial structures, as local search focuses on searching for receptive fields within a finer local search space. We visualize the + +
BreakFastF@0.1F@0.25F@0.5EditAcc
random67.761.848.368.467.0
random + local73.667.853.772.369.9
baseline [12]69.163.750.171.069.2
baseline + local74.168.555.372.370.2
global72.266.051.871.569.4
global + local74.969.055.273.370.7
+ +Table 5. Performance of the EGI local search initialized by different structures. + +
BreakFastF@0.1F@0.25F@0.5EditAcc
S = 274.868.955.073.470.4
S = 374.969.055.273.370.7
S = 474.968.855.173.370.9
+ +Table 6. Ablation of the value of $S$ in the EGI local search. + +
BreakFastF@0.1F@0.25F@0.5EditAcc
sigmoid72.766.952.771.869.4
softmax73.267.252.071.669.7
Eqn. (4)74.969.055.273.370.7
+ +Table 7. Ablation of possible probability mass functions in EGI local search. + +searching process of the iterative local search in Fig. 4. The dilation rates for each layer gradually converge to a suitable state during the iterative searching process. Tab. 7 verifies different ways to get the approximated probability mass function $PMF(d_{i})$ from weight $w$ . Eqn. (4) is more superior than the sigmoid function and softmax function as it maintains the probability distribution while the other two functions change the distribution non-linearly. + +# 4.3. Observations + +In this section, we try to exploit the common knowledge contained in the global-to-local searched structures. + +Connections between Receptive Fields and Data. We want to know if receptive field combinations vary among data. Therefore, we evaluate the generalization ability of the searched structures on the subsets of the same dataset and different datasets, respectively. Within the BreakFast dataset, we perform the global-to-local search on one fold and then evaluate the searched structures on other folds. Tab. 9 shows that there is almost no obvious performance gap on different folds, indicates that receptive field combinations almost have no difference within a dataset. However, when search and evaluate structures across different datasets, different structures searched on different datasets have a large performance gap as shown in Tab. 8. We can conclude that different data distribution will result in different receptive field combinations. We visualize the structures searched from different datasets in Fig. 6. The structure searched on 50Salads dataset trends to have larger re + +![](images/bc7f783c0d7c9d5f092163574c0dbf003c5b551844b07baabc622b76868af902.jpg) +Figure 6. Visualization of the global-to-local searched structures of three datasets with the MS-TCN baseline. Each row represents the dilations of one structure, which contains four stages. + +![](images/1d800e0e6ae0e686a33804eb16adb6565faf578c3b3927d68e3a3808e5a588ea.jpg) +Figure 7. Visualization of average dilation rates in each stage and the range of performance of global-searched structures. + +ceptive fields, while the structure searched on the GTEA dataset has smaller receptive fields. The number of video frames shown in Tab. 2 is positively correlated with receptive fields. Longer videos need larger receptive fields to capture the context. We also show more searched structures in the supplementary. + +Receptive Fields for Different Stages. Our global-to-local search is based on MS-TCN. MS-TCN contains four stages, and all stages share the same receptive field combination in human designing. The visualized searched structures shown in Fig. 6 demonstrate that different stages have different receptive field combinations, which conflicts with human designing. We further count the average receptive fields of each stage among all individuals. The range of performance and the average dilation rates of each stage are shown in Fig. 7. The average dilation rate in the first stage of MS-TCN tends to be large on high-performance structures. In contrast, the average dilation rate in the third stage of MS-TCN is relatively small on high-performance structures. We assume that the first stage of MS-TCN requires large receptive fields to get the long-term context for coarse prediction, while the following stages need small receptive fields to refine the results locally. + +# 5. Conclusion + +We propose a global-to-local search scheme to search for effective receptive field combinations in a coarse-to-fine scheme. The global search discovers effective receptive field combinations with better performance than hand designings but completely different patterns. The expec + +
MS-TCNArch-50SaladsArch-GTEAArch-BF
50Salads67.175.468.872.6
GTEA83.882.488.985.6
BF69.975.172.576.4
+ +Table 8. Cross-validation performance (F@0.1) of searched structures among the fold 1 of different datasets. Arch-dataset indicates the structure is searched on which dataset. + +
BreakFastArch-1Arch-2Arch-3Arch-4
fold176.476.376.275.7
fold274.175.375.174.6
fold376.176.676.175.4
fold471.772.172.071.8
+ +Table 9. Cross-validation performance (F@0.1) of searched structures among different folds of the BreakFast dataset. Arch-n means the structure is searched on fold n. + +
50SaladsF@0.1F@0.25F@0.5EditAcc
Spatial CNN [36]32.327.118.924.854.9
Bi-LSTM [57]62.658.347.055.655.7
Dilated TCN [35]52.247.637.443.159.3
ST-CNN [36]55.949.637.145.959.4
TUnet [52]59.355.644.850.660.6
ED-TCN [35]68.063.952.659.864.7
TResNet [26]69.265.054.460.566.0
TricorNet [10]70.167.256.662.867.5
TRN [37]70.265.456.363.766.9
TDRN [37]72.968.557.266.068.1
MS-TCN [12]76.374.064.567.980.7
Ours-MS-TCN80.378.069.873.482.2
+ +Table 10. Comparison with SOTA on the 50Salads dataset. + +tation guided iterative local search scheme enables searching fine-grained receptive field combinations in the dense search space. Our proposed global-to-local search can be plugged into multiple tasks, i.e., action segmentation, probabilistic forecasting [6], classification [20, 21, 24], segmentation [22, 23, 62], detection [25, 48] methods to further boost the performance. + +Acknowledgement This research was supported by the Major Project for New Generation of AI under Grant No. 2018AAA0100400, NSFC (61922046), and S&T innovation project from Chinese Ministry of Education. We thank MindSpore [1] for the partial support of this work. + +# References + +[1] Mindspore. http://www.mindspore.cn, 2020. 6, 8 +[2] Subhabrata Bhattacharya, Mahdi M Kalayeh, Rahul Sukthankar, and Mubarak Shah. Recognition of complex events: Exploiting temporal dynamics between underlying concepts. In CVPR, pages 2235-2242, 2014. 2 +[3] Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct neural architecture search on target task and hardware. In ICLR, 2019. 1, 2, 3, 4 +[4] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, pages 6299-6308, 2017. 1, 6 +[5] Min-Hung Chen, Baopu Li, Yingze Bao, Ghassan Al-Regib, and Zsolt Kira. Action segmentation with joint self-supervised temporal domain adaptation. In CVPR, pages 9454–9463, 2020. 1, 6, 7 +[6] Yitian Chen, Yanfei Kang, Yixiong Chen, and Zizhuo Wang. Probabilistic forecasting with temporal convolutional neural network. Neurocomputing, 399:491-501, 2020. 8 +[7] Yu Cheng, Quanfu Fan, Sharath Pankanti, and Alok Choudhary. Temporal sequence modeling for video event detection. In CVPR, pages 2227-2234, 2014. 2 +[8] Robert T. Collins, Alan J Lipton, and Takeo Kanade. Introduction to the special section on video surveillance. IEEE TPAMI, 22(8):745-746, 2000. 1 +[9] Robert T Collins, Alan J Lipton, Takeo Kanade, Hironobu Fujiyoshi, David Duggins, Yanghai Tsin, David Tolliver, Nobuyoshi Enomoto, Osamu Hasegawa, Peter Burt, et al. A system for video surveillance and monitoring. VSAM final report, 2000:1-68, 2000. 1 +[10] Li Ding and Chenliang Xu. Tricornet: A hybrid temporal convolutional and recurrent network for video action segmentation. arXiv preprint arXiv:1705.07818, 2017. 2, 8 +[11] Li Ding and Chenliang Xu. Weakly-supervised action segmentation with iterative soft boundary assignment. In CVPR, pages 6508-6516, 2018. 3, 6 +[12] Yazan Abu Farha and Jurgen Gall. Ms-tcn: Multi-stage temporal convolutional network for action segmentation. In CVPR, pages 3575-3584, 2019. 1, 2, 3, 6, 7, 8 +[13] Alireza Fathi, Ali Farhadi, and James M Rehg. Understanding egocentric activities. In ICCV, pages 407-414. IEEE, 2011. 2 +[14] Alireza Fathi and James M Rehg. Modeling actions through state changes. In CVPR, pages 2579-2586, 2013. 2 +[15] Alireza Fathi, Xiaofeng Ren, and James M Rehg. Learning to recognize objects in egocentric activities. In CVPR, pages 3281-3288. IEEE, 2011. 2, 6 +[16] Mohsen Fayyaz and Jurgen Gall. Sct: Set constrained temporal transformer for set supervised action segmentation. In CVPR, pages 501-510, 2020. 1 +[17] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In ICCV, pages 6202-6211, 2019. 1 +[18] Christoph Feichtenhofer, Axel Pinz, and Richard P Wildes. Spatiotemporal multiplier networks for video action recognition. In CVPR, pages 4768-4777, 2017. 1 + +[19] Harshala Gammulle, Tharindu Fernando, Simon Denman, Sridha Sridharan, and Clinton Fookes. Coupled generative adversarial network for continuous fine-grained action segmentation. In IEEE WACV, pages 200-209. IEEE, 2019. 2 +[20] Shang-Hua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip Torr. Res2net: A new multi-scale backbone architecture. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1-1, 2021. 8 +[21] Shang-Hua Gao, Qi Han, Duo Li, Pai Peng, Ming-Ming Cheng, and Pai Peng. Representative batch normalization with feature calibration. In CVPR, 2021. 8 +[22] Shang-Hua Gao, Yong-Qiang Tan, Ming-Ming Cheng, Chengze Lu, Yunpeng Chen, and Shuicheng Yan. Highly efficient salient object detection with 100k parameters. In ECCV, 2020. 8 +[23] Yuchao Gu, Lijuan Wang, Ziqin Wang, Yun Liu, MingMing Cheng, and Shao-Ping Lu. Pyramid constrained self-attention network for fast video salient object detection. In AAAI, pages 10869-10876, 2020. 8 +[24] Yu-Chao Gu, Li-Juan Wang, Yun Liu, Yi Yang, Yu-Huan Wu, Shao-Ping Lu, and Ming-Ming Cheng. Dots: Decoupling operation and topology in differentiable architecture search. In CVPR, 2021. 8 +[25] Qi Han, Kai Zhao, Jun Xu, and Ming-Ming Cheng. Deep hough transform for semantic line detection. In ECCV, 2020. 8 +[26] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 8 +[27] 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 ICCV, pages 1314-1324, 2019. 1 +[28] Shi-Min Hu, Dun Liang, Guo-Ye Yang, Guo-Wei Yang, and Wen-Yang Zhou. Jittor: a novel deep learning framework with meta-operators and unified graph execution. Science China Information Sciences, 63(12):1-21, 2020. 6 +[29] Yifei Huang, Yusuke Sugano, and Yoichi Sato. Improving action segmentation via graph-based temporal reasoning. In CVPR, pages 14024-14034, 2020. 1, 6 +[30] Svebor Karaman, Lorenzo Seidenari, and Alberto Del Bimbo. Fast saliency based pooling of fisher encoded dense trajectories. In ECCV, volume 1, page 5, 2014. 2 +[31] Hilde Kuehne, Ali Arslan, and Thomas Serre. The language of actions: Recovering the syntax and semantics of goal-directed human activities. In CVPR, pages 780-787, 2014. 6 +[32] Hilde Kuehne, Juergen Gall, and Thomas Serre. An end-to-end generative framework for video segmentation and recognition. In IEEE WACV, pages 1-8. IEEE, 2016. 2, 6 +[33] Hilde Kuehne, Alexander Richard, and Juergen Gall. Weakly supervised learning of actions from transcripts. Comput. Vis. and Image Understanding, 163:78-89, 2017. 2, 3 +[34] Hilde Kuehne, Alexander Richard, and Juergen Gall. A hybrid rnn-hmm approach for weakly supervised temporal action segmentation. IEEE TPAMI, 2018. 2 + +[35] Colin Lea, Michael D Flynn, Rene Vidal, Austin Reiter, and Gregory D Hager. Temporal convolutional networks for action segmentation and detection. In CVPR, pages 156-165, 2017. 1, 2, 6, 8 +[36] Colin Lea, Austin Reiter, René Vidal, and Gregory D Hager. Segmental spatiotemporal cnns for fine-grained action segmentation. In ECCV, pages 36-52. Springer, 2016. 8 +[37] Peng Lei and Sinisa Todorovic. Temporal deformable residual networks for action segmentation in videos. In CVPR, pages 6742-6751, 2018. 2, 8 +[38] Haoxiang Li, Zhe Lin, Xiaohui Shen, Jonathan Brandt, and Gang Hua. A convolutional neural network cascade for face detection. In CVPR, pages 5325-5334, 2015. 6 +[39] Jun Li and Sinisa Todorovic. Set-constrained viterbi for setsupervised action segmentation. In CVPR, pages 10820-10829, 2020. 1 +[40] Shi-Jie Li, Yazan AbuFarha, Yun Liu, Ming-Ming Cheng, and Juergen Gall. Ms-tcn++: Multi-stage temporal convolutional network for action segmentation. IEEE TPAMI, pages 1-1, 2020. 1, 2, 6, 7 +[41] Chenxi Liu, Liang-Chieh Chen, Florian Schroff, Hartwig Adam, Wei Hua, Alan L Yuille, and Li Fei-Fei. Autodeplab: Hierarchical neural architecture search for semantic image segmentation. In CVPR, pages 82–92, 2019. 1, 2, 3 +[42] Hanxiao Liu, Karen Simonyan, Oriol Vinyals, Chrisantha Fernando, and Koray Kavukcuoglu. Hierarchical representations for efficient architecture search. In ICLR, 2018. 1, 3 +[43] Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. In ICLR, 2019. 1, 2, 3, 4, 5, 7 +[44] Zhichao Lu, Ian Whalen, Vishnu Boddeti, Yashesh Dhebar, Kalyanmoy Deb, Erik Goodman, and Wolfgang Banzhaf. Nsga-net: neural architecture search using multi-objective genetic algorithm. In Proceedings of the Genetic and Evolutionary Computation Conference, pages 419-427, 2019. 3 +[45] Melanie Mitchell. An introduction to genetic algorithms. MIT press, 1998. 3 +[46] 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 8026-8037, 2019. 6 +[47] Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In AAAI, volume 33, pages 4780-4789, 2019. 1, 3 +[48] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. arXiv preprint arXiv:1506.01497, 2015. 8 +[49] Alexander Richard and Juergen Gall. Temporal action detection using a statistical language model. In CVPR, pages 3131-3140, 2016. 2 +[50] Alexander Richard, Hilde Kuehne, and Juergen Gall. Weakly supervised action learning with rn based fine-to-coarse modeling. In CVPR, pages 754-763, 2017. 2, 3, 6 + +[51] Marcus Rohrbach, Sikandar Amin, Mykhaylo Andriluka, and Bernt Schiele. A database for fine grained activity detection of cooking activities. In CVPR, pages 1194-1201. IEEE, 2012. 2 +[52] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Int. Conf. Medical image computing and computer-assisted intervention, pages 234-241. Springer, 2015. 8 +[53] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by back-propagating errors. nature, 323(6088):533-536, 1986. 3 +[54] Venkatesh Saligrama and Zhu Chen. Video anomaly detection based on local statistical aggregates. In CVPR, pages 2112-2119. IEEE, 2012. 1 +[55] Fadime Sener and Angela Yao. Unsupervised learning and segmentation of complex activities from video. In CVPR, pages 8368-8376, 2018. 3 +[56] Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. In NeurIPS, pages 568-576, 2014. 1 +[57] Bharat Singh, Tim K Marks, Michael Jones, Oncel Tuzel, and Ming Shao. A multi-stream bi-directional recurrent neural network for fine-grained action detection. In CVPR, pages 1961-1970, 2016. 2, 8 +[58] Suriya Singh, Chetan Arora, and CV Jawahar. First person action recognition using deep learned descriptors. In $CVPR$ , pages 2620-2628, 2016. 2 +[59] Mohammad Soleymani, Jeroen Lichtenauer, Thierry Pun, and Maja Pantic. A multimodal database for affect recognition and implicit tagging. IEEE Trans. Affect. Comput., 3(1):42-55, 2011. 1 +[60] Sebastian Stein and Stephen J McKenna. Combining embedded accelerometers with computer vision for recognizing food preparation activities. In The ACM International Joint Conference on Pervasive and Ubiquitous Computing, pages 729-738, 2013. 6 +[61] Yanan Sun, Bing Xue, Mengjie Zhang, Gary G Yen, and Jiancheng Lv. Automatically designing cnn architectures using the genetic algorithm for image classification. IEEE Trans. Cybernetics, 2020. 3 +[62] Yong-Qiang Tan, Shang-Hua Gao, Xuan-Yi Li, Ming-Ming Cheng, and Bo Ren. Vecroad: Point-based iterative graph exploration for road graphs extraction. In CVPR, 2020. 8 +[63] Kevin Tang, Li Fei-Fei, and Daphne Koller. Learning latent temporal structure for complex event detection. In CVPR, pages 1250–1257. IEEE, 2012. 2 +[64] Nam N Vo and Aaron F Bobick. From stochastic grammar to bayes network: Probabilistic parsing of complex activity. In CVPR, pages 2641-2648, 2014. 2 +[65] Zhenzhi Wang, Ziteng Gao, Limin Wang, Zhifeng Li, and Gangshan Wu. Boundary-aware cascade networks for temporal action segmentation. In ECCV, 2020. 1, 3, 6, 7 +[66] Lingxi Xie and Alan Yuille. Genetic cnn. In ICCV, pages 1379-1388, 2017. 1, 3 +[67] Arber Zela, Thomas Elsken, Tonmoy Saikia, Yassine Marrakchi, Thomas Brox, and Frank Hutter. Understanding and robustifying differentiable architecture search. In ICLR, 2020. 3, 5 \ No newline at end of file diff --git a/global2localefficientstructuresearchforvideoactionsegmentation/images.zip b/global2localefficientstructuresearchforvideoactionsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..574f3a850f0fd574faf838b14b9ab0616c1d9272 --- /dev/null +++ b/global2localefficientstructuresearchforvideoactionsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:088ec71693a022e1f41e118bdd7362ca54e1eb3bd6ccc3fe3e2119a488e56dd3 +size 516233 diff --git a/global2localefficientstructuresearchforvideoactionsegmentation/layout.json b/global2localefficientstructuresearchforvideoactionsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..403137fbd4f9c6e042fe078b73eba8a9d452b07d --- /dev/null +++ b/global2localefficientstructuresearchforvideoactionsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:077745ba58b01527eba39ebfa6c16478d5e09abaa246c15adb91e63bee88d39e +size 409560 diff --git a/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_content_list.json b/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..da3bd05cf8014f9a728b83fe8a0c75bcdb5f3794 --- /dev/null +++ b/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d382ac23cebe1dc32d2c42d16b66064f913b514f62a3b936a2c7214a31eddae0 +size 81759 diff --git a/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_model.json b/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..af57d653ed9e6b0acbda0ad018c56ff87b24f515 --- /dev/null +++ b/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2202ab71aaa09b83fd3856b9494c8c103b4c40af781c91ac19342ca3e4c4bf1 +size 103341 diff --git a/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_origin.pdf b/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..90e386ef1c5eaba2a8a38f205372c5f62cb74592 --- /dev/null +++ b/globallyoptimalrelativeposeestimationwithgravityprior/4f7387a6-c5f1-4ad3-86dc-41984e83f4c4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39cd72887bfa2250af829097845264d1a0b8a1c0098fc5e11f0c21d42f56153f +size 1375651 diff --git a/globallyoptimalrelativeposeestimationwithgravityprior/full.md b/globallyoptimalrelativeposeestimationwithgravityprior/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6d549d5343d34c26c9a6904c06b78bb316ffa102 --- /dev/null +++ b/globallyoptimalrelativeposeestimationwithgravityprior/full.md @@ -0,0 +1,402 @@ +# Globally Optimal Relative Pose Estimation with Gravity Prior + +Yaqing Ding $^{1}$ , Daniel Barath $^{2,3,4}$ , Jian Yang $^{1}$ , Hui Kong $^{1}$ , Zuzana Kukelova $^{2}$ + +$^{1}$ School of Computer Science and Engineering, Nanjing University of Science and Technology $^{2}$ Visual Recognition Group, Faculty of Electrical Engineering, Czech Technical University in Prague $^{3}$ MPLab, SZTAKI, Budapest, $^{4}$ Department of Computer Science, ETH Zurich + +dingyaqing@njust.edu.cn + +# Abstract + +Smartphones, tablets and camera systems used, e.g., in cars and UAVs, are typically equipped with IMUs (inertial measurement units) that can measure the gravity vector accurately. Using this additional information, the $y$ -axes of the cameras can be aligned, reducing their relative orientation to a single degree-of-freedom. With this assumption, we propose a novel globally optimal solver, minimizing the algebraic error in the least squares sense, to estimate the relative pose in the over-determined case. Based on the epipolar constraint, we convert the optimization problem into solving two polynomials with only two unknowns. Also, a fast solver is proposed using the first-order approximation of the rotation. The proposed solvers are compared with the state-of-the-art ones on four real-world datasets with approx. 50000 image pairs in total. Moreover, we collected a dataset, by a smartphone, consisting of 10933 image pairs, gravity directions and ground truth 3D reconstructions. The source code and dataset are available at https://github.com/yaqding/optPose_gravity + +# 1. Introduction + +Finding the relative pose between two cameras is one of the fundamental geometric vision problems with many applications, for example, in structure-from-motion [42, 40, 39, 2, 52, 44], visual localization [53, 48], and SLAM [34]. The robust relative pose estimation is usually done in a hypothesize and test framework, such as RANSAC [12]. + +Locally optimized (LO) RANSAC [7, 31] and its variants, such as Graph-Cut RANSAC [3], USAC [41], have shown a significant improvement in terms of accuracy and convergence compared to the standard RANSAC [12]. The key idea of these RANSAC variants is to apply a local optimization step to refine each so-far-the-best model using non-minimal samples. The main benefit of using a non-minimal sample is that it allows for averaging out observational noise in the measurements. Besides improving the + +![](images/f200c059d45315f2fbed239c2432dc365269743a676f8fe1b645f20430ab9a64.jpg) +Figure 1: Two cameras $\mathbf{C}_1$ and $\mathbf{C}_2$ with known gravity directions $\mathbf{g}_1$ , $\mathbf{g}_2$ observing $n \geq 4$ points $\mathbf{X}_1, \ldots, \mathbf{X}_n$ . The objective is to find the relative pose of the cameras. + +accuracy, this often speeds up the robust estimation via finding an accurate model early and, thus, triggering the termination criterion. Both minimal and non-minimal solvers play important roles in the LO-RANSAC framework. + +Minimal solutions to the relative pose estimation with different camera configurations have been well-studied in the literature. For instance, given two calibrated cameras, the relative pose can be efficiently recovered from five point correspondences [38, 28, 21]. Recently, point plus direction-based methods have shown benefits. The basic idea of such methods is to align one axis (e.g., $y$ -axis) of the cameras with the common reference direction, e.g., the gravity vector. The relative orientation reduces to 1-DoF, and the relative pose can be estimated from only three point correspondences [13, 37, 49, 43, 10, 9]. + +While the problem of estimating the absolute camera pose from a non-minimal set of correspondences (the PnP problem) has received a lot of attention and many efficient and globally optimal solutions were published [24, 56, 25, 35, 36, 51, 57, 50], this does not hold for the relative pose estimation problem, also known as the $N$ -point problem. The main reason is the fact that the N-point problem results in a more complicated optimization than the PnP problem. + +The most commonly used non-minimal relative pose solver is the well-known direct linear transformation (DLT) method [22]. This method can be used to estimate the essential or the fundamental matrix from 8 (the well-known 8-point algorithm [17]) or more point correspondence. The DLT method assumes that the matrix elements are linearly independent. Therefore, this method does not minimize a properly defined error in the 5D space of essential matrices for calibrated cameras, and a correct essential matrix has to be recovered from the approximate DLT solution [22]. + +Therefore, several approaches that directly minimize an energy function defined in the 5D space of relative poses have been published recently. However, these approaches either do not guarantee a global optimum [18, 23, 32] or are too slow for practical applications [19, 6, 20]. + +Kneip et al. [26] presented an eigenvalue-based formulation that is minimizing an algebraic error for the relative pose problem, which is after eliminating the relative translation, parameterized in the 3-dimensional space of relative rotations. However, the proposed iterative Levenberg-Marquardt solution does not guarantee optimality and it requires a reasonably good initialization. The certifiably globally optimal solution to the eigenvalue-based formulation of relative pose estimation problem was proposed in [5]. This solution minimizes the algebraic error in the space of rotations and translations and formulates the problem as a quadratic program (QCQP) that is solved using a Semidefinite Program (SDP) relaxation. This method does not provide good pose estimates for forward motion. The solution was later extended to globally optimal essential matrix estimation for generalized cameras [55]. The globally optimal solution for the N-point problem [5] was recently improved in [54]. The proposed formulation results in QCQP, however, in fewer variables and constraints than the formulation in [5]. The solver is 2-3 orders of magnitude faster than [5]. + +In this paper, to estimate the relative pose globally optimally in real-time, we assume that the views share a common reference direction. This case is relevant since smartphones, tablets and camera systems used, e.g., in cars and UAVs, are typically equipped with IMUs (inertial measurement units) that can measure the gravity vector accurately. With this assumption, the relative rotation is reduced to 1-DoF and the N-point relative pose problem is significantly simplified. The main contributions of this paper are: + +- We propose a novel real-time globally optimal solver that minimizes the algebraic error in the least squares sense and estimates the relative pose of calibrated cameras with known gravity direction from N-point correspondences $(N \geq 4)$ . Based on the epipolar constraint, we convert the optimization problem into solving two polynomials with only two unknowns and we propose two different efficient solutions to such a system. +- In addition, we consider that for mobile robots, au + +tonomous driving cars and UAVs, the relative rotation is small and, thus, we propose a solver estimating the linearized rotation efficiently. + +- In extensive real and synthetic experiments we show an improvement in terms of accuracy and speed over the state-of-the-art non-minimal N-point relative pose solvers. Moreover, we present a novel dataset with 10993 image pairs taken by a smartphone with known gravity direction and ground truth 3D reconstructions. + +# 2. Background + +Suppose that we are given 3D point $\mathbf{X}_i$ observed in two calibrated views. Let $\mathbf{m}_i = [u_i, v_i, 1]^\top$ and $\mathbf{m}_i' = [u_i', v_i', 1]^\top$ be its projections in the two images in their homogeneous form. Since the gravity direction can be calculated from, e.g. an IMU, we can, without loss of generality, align the $y$ -axes of the cameras with the gravity direction. These alignments are done by rotation matrices $\mathbf{R}$ and $\mathbf{R}'$ , giving rotated image points $\mathbf{p}_i' = \mathbf{R}'\mathbf{m}_i'$ , $\mathbf{p}_i = \mathbf{R}\mathbf{m}_i$ . After applying the rotations to the projected 2D points, we get + +$$ +\lambda_ {i} ^ {\prime} \mathbf {p} _ {i} ^ {\prime} = \lambda_ {i} \mathbf {R} _ {y} \mathbf {p} _ {i} + \mathbf {t}, \tag {1} +$$ + +with + +$$ +\mathbf {R} _ {y} = \left[ \begin{array}{c c c} \cos \theta & 0 & \sin \theta \\ 0 & 1 & 0 \\ - \sin \theta & 0 & \cos \theta \end{array} \right], \tag {2} +$$ + +where $\theta$ is the unknown rotation angle around the vertical axis after the alignment by the gravity direction, $\mathbf{t}$ is the unknown translational vector and $\lambda_{i},\lambda_{i}^{\prime}$ are unknown depths. Vectors $\lambda_i^\prime \mathbf{p}_i^\prime$ $\lambda_{i}\mathbf{R}_{y}\mathbf{p}_{i}$ and $\mathbf{t}$ are always coplanar. Therefore, the scalar triple product of these three vectors should be zero, and we obtain + +$$ +\left(\left[ \mathbf {p} _ {i} ^ {\prime} \right] \times \mathbf {R} _ {y} \mathbf {p} _ {i}\right) ^ {\top} \mathbf {t} = 0. \tag {3} +$$ + +In this case, the depth parameters $\lambda_{i},\lambda_{i}^{\prime}$ are eliminated. Rotation matrix $\mathbf{R}_y$ (2) can be reparameterized as + +$$ +\mathbf {R} _ {y} = \frac {1}{1 + y ^ {2}} \left[ \begin{array}{c c c} 1 - y ^ {2} & 0 & 2 y \\ 0 & 1 + y ^ {2} & 0 \\ - 2 y & 0 & 1 - y ^ {2} \end{array} \right], \tag {4} +$$ + +where $y = \tan \frac{\theta}{2}$ . This parameterization introduces a degeneracy for a $180^{\circ}$ rotation which can be ignored in real applications [29, 11]. The objective is to estimate the relative pose parameters $\theta$ and $\mathbf{t}$ globally optimally in the overdetermined case, i.e., from $N \geq 4$ point correspondences. + +# 3. Problem Formulation + +Let us assume that we are given $N$ point correspondences. By stacking the constraints (3) for $N$ correspondences in a matrix, we obtain + +$$ +\mathbf {A} ^ {\top} \mathbf {t} = 0, \tag {5} +$$ + +where $\mathbf{A}$ is a $3\times N$ matrix with its $i^{th}$ column of form + +$$ +\mathbf {A} _ {i} = \left[ \mathbf {p} _ {i} ^ {\prime} \right] _ {\times} \mathbf {R} _ {y} \mathbf {p} _ {i}. \tag {6} +$$ + +The minimal case $N = 3$ results in $\operatorname{det}(A) = 0$ with up to 4 solutions, which has been well-studied in the literature [13, 37, 9, 49]. We mainly focus on the case where $N \geq 4$ . In the case when the point correspondences are contaminated by noise, the objective is to find the least squares optimal solution of (5). The problem is formalized as follows: + +$$ +\arg_ {\mathbf {R} _ {y}, \mathbf {t}} \min \mathbf {t} ^ {\top} \mathbf {C} \mathbf {t}, \tag {7} +$$ + +where $\mathbf{C} = \mathbf{A}\mathbf{A}^{\top}$ is a $3\times 3$ symmetric matrix + +$$ +\mathbf {C} = \left[ \begin{array}{l l l} c _ {1 1} & c _ {1 2} & c _ {1 3} \\ c _ {1 2} & c _ {2 2} & c _ {2 3} \\ c _ {1 3} & c _ {2 3} & c _ {3 3} \end{array} \right]. \tag {8} +$$ + +The elements of $\mathbf{C}$ are univariate polynomials in $y$ . Eq. (7) is equivalent to minimizing the smallest eigenvalue of $\mathbf{C}$ as + +$$ +\arg_ {\mathbf {R} _ {y}} \min \alpha_ {\min } (\mathbf {C}). \tag {9} +$$ + +Note, that (9) is a similar eigenvalue-based formulation to the one used in [26]. However, thanks to the special form of $\mathbf{R}_y$ , it results in a simpler optimization problem in 1D space instead of the 3D space of full rotations. Therefore, it can be solved globally optimally by efficiently computing all its stationary points, compared to [26] where an iterative solution was proposed. The three eigenvalues of $3\times 3$ matrix $\mathbf{C}$ should satisfy the following cubic constraint + +$$ +\alpha^ {3} - f _ {1} \alpha^ {2} + f _ {2} \alpha - f _ {3} = 0, \tag {10} +$$ + +where + +$$ +\begin{array}{l} f _ {1} = \operatorname {t r a c e} (\mathbf {C}), \\ f _ {2} = c _ {1 1} c _ {2 2} + c _ {1 1} c _ {3 3} + c _ {2 2} c _ {3 3} - c _ {1 2} ^ {2} - c _ {1 3} ^ {2} - c _ {2 3} ^ {2}, \tag {11} \\ \end{array} +$$ + +$$ +f _ {3} = \det (\mathbf {C}), +$$ + +are univariate rational functions in $y$ (Eq. (11) can be derived by expanding $\operatorname{det}(\mathbf{C} - \alpha \mathbf{I}) = 0$ ). For the sake of simplicity, let us replace $\alpha_{min}$ with $\alpha$ . The necessary condition for minimizing the smallest eigenvalue of $\mathbf{C}$ is that derivative $\frac{\mathrm{d}\alpha}{\mathrm{d}y}$ should be zero. In (10), $f_{1}, f_{2}, f_{3}$ and $\alpha$ are functions of $y$ . Thus, using the assumption $\frac{\mathrm{d}\alpha}{\mathrm{d}y} = 0$ , the derivative of (10) gives us + +$$ +\frac {\mathrm {d} f _ {1}}{\mathrm {d} y} \alpha^ {2} - \frac {\mathrm {d} f _ {2}}{\mathrm {d} y} \alpha + \frac {\mathrm {d} f _ {3}}{\mathrm {d} y} = 0. \tag {12} +$$ + +Rational function $f_{1}$ (11) can be rewritten as $f_{1} = \frac{g_{1}}{\delta^{2}}$ , where $g_{1}$ is a quartic polynomial in $y$ and $\delta = 1 + y^{2}$ . On the other hand, due to the inner associations in the elements of matrix $\mathbf{C}$ , $f_{2}$ can be rewritten as $f_{2} = \frac{g_{2}}{\delta^{3}}$ , and $f_{3}$ can be + +written as $f_{3} = \frac{g_{3}}{\delta^{4}}$ , where $g_{2}, g_{3}$ are polynomials of degree 6 and 8, respectively. Hence, the derivatives of $f_{1}, f_{2}, f_{3}$ can be rewritten as + +$$ +\frac {\mathrm {d} f _ {1}}{\mathrm {d} y} = \frac {h _ {1}}{\delta^ {3}}, \frac {\mathrm {d} f _ {2}}{\mathrm {d} y} = \frac {h _ {2}}{\delta^ {4}}, \frac {\mathrm {d} f _ {3}}{\mathrm {d} y} = \frac {h _ {3}}{\delta^ {5}}, \tag {13} +$$ + +where $h_1, h_2, h_3$ are polynomials in $y$ of degree $\{4, 6, 8\}$ , respectively. Substituting the formulas into (10) and (12), multiplying (10) by $\delta^4$ and (10) by $\delta^5$ , and substituting $\beta = \delta \alpha$ , we obtain the following two polynomial equations in two unknowns $\{\beta, y\}$ . + +$$ +\begin{array}{l} \delta \beta^ {3} - \beta^ {2} g _ {1} + \beta g _ {2} - g _ {3} = 0, \tag {14} \\ \beta^ {2} h _ {1} - \beta h _ {2} + h _ {3} = 0. \\ \end{array} +$$ + +Our objective is to solve these equations efficiently. + +# 4. Globally Optimal Solver + +A straightforward way of solving the system of two polynomial equations in two unknowns (14) is to use the Gröbner basis method [8] and generate a specific solver using an automatic generator, e.g., [27, 29, 30]. Using [29], we obtained a Gröbner basis solver with a template of size $17 \times 45$ for the Gauss-Jordan elimination and 28 solutions. However, our experiments on real-world and synthetic data showed that this solver becomes unstable when we are given more than 30 point correspondences, which is almost always the case in real applications. The reason is that the matrix for the Gauss-Jordan elimination is often ill-conditioned. Therefore, to find a stable solution, we use the hidden variable technique [8] instead. + +By treating $y$ as a hidden variable, i.e., by considering $y$ as a coefficient and hiding it into the coefficient matrix, we can rewrite our system (14) as + +$$ +\left[ \begin{array}{c c c c} - g _ {3} & g _ {2} & - g _ {1} & \delta \\ h _ {3} & - h _ {2} & h _ {1} & 0 \end{array} \right] \left[ \begin{array}{c} 1 \\ \beta \\ \beta^ {2} \\ \beta^ {3} \end{array} \right] = 0, \tag {15} +$$ + +where $g_{1},\ldots ,g_{3},h_{1},\ldots ,h_{3}$ and $\delta$ are polynomials in $y$ . With this formulation we have two equations with 4 monomials. Therefore, to easily solve this system by "linearizing" it, we need to add additional equations to (15) to obtain as many equations as monomials. In our case, we only need to multiply the first equation by $\beta$ , and the second equation by $\{\beta ,\beta^2\}$ . In this way, we obtain 5 equations with 5 monomials, which can be written as + +$$ +\mathbf {B} (y) \boldsymbol {\omega} = \mathbf {0}, \tag {16} +$$ + +where $\omega = [1\beta \beta^{2}\beta^{3}\beta^{4}]^{\top}$ and $\mathbf{B}(y)$ is the $5\times 5$ matrix + +$$ +\mathbf {B} (y) = \left[ \begin{array}{c c c c c} - g _ {3} & g _ {2} & - g _ {1} & \delta & 0 \\ h _ {3} & - h _ {2} & h _ {1} & 0 & 0 \\ 0 & - g _ {3} & g _ {2} & - g _ {1} & \delta \\ 0 & h _ {3} & - h _ {2} & h _ {1} & 0 \\ 0 & 0 & h _ {3} & - h _ {2} & h _ {1} \end{array} \right], \tag {17} +$$ + +whose elements are polynomials in $y$ . Next, we will present two solutions to (16). + +Sturm Sequence Solution. Since the matrix $\mathbf{B}(y)$ has a right null vector, the determinant of $\mathbf{B}(y)$ must vanish. The sparse structure of $\mathbf{B}(y)$ allows us to use the Laplace expansion to obtain $\operatorname*{det}(\mathbf{B}(y))$ , which is a univariate polynomial in $y$ of degree 28. Then, the Sturm sequence method is used to find the real roots of the obtained univariate polynomial, which is fast and efficient. For more details about the Sturm root bracketing, we refer the reader to [15]. + +Polynomial Eigenvalue Solution. Note, that (16) is essentially a polynomial eigenvalue problem (PEP) of degree 8, which can be written as + +$$ +\left(y ^ {8} \mathbf {B} _ {8} + y ^ {7} \mathbf {B} _ {7} + \dots + \mathbf {B} _ {0}\right) \boldsymbol {\omega} = 0, \tag {18} +$$ + +where $\mathbf{B}_8, \mathbf{B}_7, \dots, \mathbf{B}_0$ are $5 \times 5$ coefficient matrices. PEP (18) can be transformed to an eigenvalue problem $\mathbf{D}\psi = z\psi$ , with $z = 1/y$ , $\psi = [\omega, z\omega, \dots, z^7\omega]^\top$ , and $40 \times 40$ matrix $\mathbf{D}$ of the form + +$$ +\mathbf {D} = \left[ \begin{array}{c c c c} \mathbf {0} & \mathbf {I} & \dots & \mathbf {0} \\ \mathbf {0} & \mathbf {0} & \dots & \mathbf {0} \\ \dots & \dots & \dots & \mathbf {I} \\ - \mathbf {B} _ {0} ^ {- 1} \mathbf {B} _ {8} & - \mathbf {B} _ {0} ^ {- 1} \mathbf {B} _ {7} & \dots & - \mathbf {B} _ {0} ^ {- 1} \mathbf {B} _ {1} \end{array} \right]. \tag {19} +$$ + +Note, that this eigenvalue formulation is a relaxation of the original problem (15) that does not consider the monomial dependences in $\psi$ , and therefore, it introduces some spurious solutions. Six of these spurious solutions can be, however, easily removed. These solutions correspond to zero eigenvalues of matrix $\mathbf{D}$ that are generated by zero columns in matrices $\mathbf{B}_2$ and $\mathbf{B}_1$ . After removing these columns and corresponding rows, the size of $\mathbf{D}$ reduces to $34 \times 34$ . The real eigenvalues of $\mathbf{D}$ , which can be computed from real Schur decomposition, are the solutions to $z = 1 / y$ . Note, that we don't need to compute the eigenvectors of the $40 \times 40$ matrix $\mathbf{D}$ since $\alpha_{min}(9)$ and the translation vector can be extracted from the eigenvalues and eigenvectors of the $3 \times 3$ matrix $\mathbf{C}$ . This polynomial eigenvalue solution is slower than the solution based on Sturm sequences, however, as we will show in experiments, it is more stable. + +# 5. Linearized Solver + +In visual odometry and SLAM applications, the relative rotation between consecutive frames is often small or negligible. Therefore, the first-order Taylor expansion usually + +leads to a reasonably good approximation for rotation. In this case, the rotation matrix can be simplified as + +$$ +\mathbf {R} _ {y} = \left[ \begin{array}{c c c} 1 & 0 & \theta \\ 0 & 1 & 0 \\ - \theta & 0 & 1 \end{array} \right], \tag {20} +$$ + +and the elements of matrix $\mathbf{C}$ (8) are quadratic polynomials in $\theta$ . Similar to (14), we may obtain two polynomials with respect to $\{\theta, \alpha\}$ as follows: + +$$ +\alpha^ {3} - f _ {1} \alpha^ {2} + f _ {2} \alpha - f _ {3} = 0, \tag {21} +$$ + +$$ +g _ {1} \alpha^ {2} - g _ {2} \alpha + g _ {3} = 0, +$$ + +where $f_{1}, f_{2}, f_{3}$ are polynomials in $\theta$ of degree $\{2, 4, 6\}$ , and $g_{1} = \frac{\mathrm{d}f_{1}}{\mathrm{d}\theta}, g_{2} = \frac{\mathrm{d}f_{2}}{\mathrm{d}\theta}, g_{3} = \frac{\mathrm{d}f_{3}}{\mathrm{d}\theta}$ are polynomials in $\theta$ of degree $\{1, 3, 5\}$ , respectively. This formulation is simpler than (14), since the polynomials have lower degrees. This system has up to 15 real solutions and the Gröbner basis solver generated using [29] has a template matrix of size $15 \times 30$ . This solver is, however, unstable. Therefore, we use the Sturm sequence and the polynomial eigenvalue technique [28] as for the non-linearized solver to generate a efficient and stable solvers for (20). The main steps are the same as in Section 4. The only difference is that we only need to find the roots of a univariate polynomial in degree 15 or eigenvalues of a $21 \times 21$ matrix. + +# 6. Experiments + +We studied the performance of the proposed PEP-based optimal (OPT) and linearized (LIN) solvers and their variants based on Sturm sequences (OPT(S)) and (LIN(S)) on synthetic and real-world images. In the comparison, we included the closely related work of Ding et al. (3PC) [9] and the globally optimal SDP solution (SDP) [54]. In addition, we compared the proposed solver with the 5PC algorithm [46] and the normalized 8PC solver [17] with and without a final Levenberg-Marquardt [33] numerical optimization $(8\mathrm{PC} + \mathrm{LM})$ . We did not include $3\mathrm{PC} + \mathrm{LM}$ and $5\mathrm{PC} + \mathrm{LM}$ since their performance was similar to $8\mathrm{PC} + \mathrm{LM}$ . + +# 6.1. Synthetic Evaluation + +We chose the following setup to generate synthetic data. First, 200 random 3D points and 200 image pairs with random poses were generated. The focal length $f_{g}$ of the camera was set to 1000 pixels. The parameters which were changed to test the performance are the noise level $(\sigma)$ in the image point locations, the baseline (t) between two cameras, the number of points $(N)$ used for the solvers, the field of view (FOV) of the camera, and the noise level $\tau$ in the gravity direction. The default setting: $\sigma = 1$ pixel, $t = 5\%$ of the average scene depth, $N = 20$ , $\mathrm{FOV} = 90^{\circ}$ , and $\tau = 0^{\circ}$ . It is reasonable to assume that we have an + +![](images/3b90338d9b97d1c97eafd238ae3166272976a3661d664433a794c31d98a7fb22.jpg) +Figure 2: The $\log_{10}$ processing time in milliseconds plotted as the function of the point number used for the estimation. + +almost perfect measurement of the gravity direction, since we obtain the gravity vector by applying a low-pass filter to isolate the force of gravity from the raw accelerometer data. The performance of the solvers was tested by modifying the value of a single parameter from the aforementioned ones. The rotation error was defined as the angle difference between the estimated rotation and the ground truth rotation as $\arccos\left(\left(\mathrm{tr}(\mathbf{R}_g\mathbf{R}_e^\top) - 1\right) / 2\right)$ , where $\mathbf{R}_g$ and $\mathbf{R}_e$ are the ground truth and estimated rotations, respectively. The translation error was measured as the angle between the estimated and ground truth translation vectors, since the estimated translation is recovered only up to scale. + +Solver accuracy. Fig. 3 and Fig. 4 report the rotation (top row) and translation (bottom) errors under different configurations. From Fig. 3, we can see that the proposed optimal solver (OPT) outperforms all the existing methods in the case when the gravity direction is perfect. However, in real applications, the gravity vector isolated from the raw accelerometer data may not be perfect, and we also studied the performance under increased gravity direction noise. Since accelerometers used in cars and modern smartphones have noise levels around $0.06^{\circ}$ (or an expensive "good" accelerometers have less than $0.02^{\circ}$ ), we added noise to roll and pitch angles for both views with a maximum value of $0.2^{\circ}$ . Fig. 4 shows that our OPT solver is still comparable to the SOTA even when the noise level is up to $0.2^{\circ}$ . Due to the lack of space and for batter readability of graphs we do not include results of OPT(S), LIN and LIN(S) solvers here. The results of these solvers, including the results for increasing relative rotation, forward motion, and stability experiments are in the supplementary material. + +Complexity analysis and running times. The processing times of the solvers are shown in Fig. 2. The proposed Sturm sequences-based optimal OPT(S) and linearized LIN(S) ones are two orders of magnitude faster than the SDP optimal solver of [54]. Also, they are an order of magnitude faster than the minimal 3PC solver [9]. The + +following table contains the main operations performed by the proposed solvers, together with their running times in $\mu$ s. The second column shows the size of the matrix for the Gauss-Jordan elimination, the third column shows the size of the matrix for the eigenvalue decomposition, and the fourth one shows the degree of the univariate polynomial solved by Sturm sequences. + +
SolverG-JEigenSturmTime (μs)
OPT5 × 3434 × 34-115
OPT(S)--2824
LIN5 × 2121 × 21-54
LIN(S)--1513
+ +# 6.2. Real-world Experiments + +In order to test the proposed technique on real-world data, we chose the Malaga $[4]^1$ , KITTI $[14]^2$ and ETH3D $[45]^3$ datasets. Malaga was gathered entirely in urban scenarios with car-mounted sensors, including one high-resolution stereo camera and five laser scanners. We used the sequences of one high-resolution camera and every 10th frame from each sequence. The proposed solvers were applied to every consecutive image pair. The ground truth paths were composed using the GPS coordinates provided in the dataset. In total, 9,064 image pairs were used from the dataset. The KITTI odometry benchmark consists of 22 stereo sequences. Only 11 sequences (00-10) are provided with ground truth trajectories for training. We therefore used these 11 sequences to evaluate the compared solvers. In total, 23190 image pairs were used. The ETH3D dataset covers a variety of indoor and outdoor scenes. Ground truth geometry has been obtained using a high-precision laser scanner. A DSLR camera as well as a synchronized multicamera rig with varying field-of-view was used to capture images. In total, we used 5162 image pairs. + +For testing non-minimal solvers on real-world data, we chose a locally optimized RANSAC, i.e., Graph-Cut RANSAC [3] (GC-RANSAC). In GC-RANSAC (and other locally optimized RANSACs), two different solvers are used: (a) one for estimating the pose from a minimal sample and (b) one for fitting to a larger-than-minimal sample when doing final pose polishing on all inliers or in the local optimization step. For (a), the main objective is to solve the problem using as few correspondences as possible since the processing time depends exponentially on the number of correspondences required for the pose estimation. We tested two minimal solvers, the 5PC algorithm of Stewenius et al. [47] and the 3PC method of Ding et al. + +1https://www.mrpt.org/MalagaUrbanDataset +2http://www.cvlabs.net/datasets/kitti +3https://www.eth3d.net/ +4https://github.com/danini/graph-cut-ransac + +![](images/cf41b771b741f6a51fc0e0d9cf8fd7a79ee90bd1cb09ab68d4746aa9d29fc0c0.jpg) +(a) + +![](images/6ff562c26dc683214c46bade8500fec8375e0de5a43d4cd5f0aad55ffd0f4b36.jpg) +(b) + +![](images/c25c85276e02eb3567c56635479853fc33244963c3e83dfe83844fc905f622d4.jpg) +(c) + +![](images/211dc382ac8272532d20858a70b79809abde9907095f6a76b1c1c26e626c49c1.jpg) +(d) + +![](images/29784dab2b341023a15300b08ceae30acfd3fb76965e879444213c9b9efc2e20.jpg) +(e) + +![](images/ff946fa49f4cf80ab78e866dd6c74d04ecda70d99dd7c260d27676e0816989a1.jpg) +(f) + +![](images/3a8919c81e887d2f1fb3a0722621eed8a9b73ad707e0c3b34ecfd4f56b13fab6.jpg) +(g) +Figure 3: Top: rotation error in degrees. Bottom: translation error in degrees. The columns show the error of the solvers against increasing (a) image noise, (b) baseline, (c) correspondence number, and (d) field-of-view. We use the following default values for the parameters not tested in a figure: std. of the image noise is $\sigma = 1$ px; length of the baseline $= 10\%$ scene depth; number of correspondences $\mathrm{N} = 20$ ; field of view $\mathrm{FOV} = 90^{\circ}$ , the std. of the gravity directional noise $\tau = 0^{\circ}$ . + +![](images/02a7dd5262c682692438c2c0e03d64daaf758ef244010115634e1503fc615615.jpg) +(h) + +![](images/c7db51c724a6f5f194c8be47b2441544a950e48b7135dd4b4e3d8d5f3124872f.jpg) +(a) +Figure 4: Rotation and translation errors in degrees. Default settings with increased roll and pitch noise. + +![](images/c7dd537aa1721415c46f9bd83a572c481013c5643bd3be0ac179f68e792cb022.jpg) +(b) + +[9] exploiting the gravity direction similarly to our method. The purpose of (b) is to estimate the pose parameters as accurately as possible. In (b), we tested the proposed solvers, the normalized 8PC algorithm [17], the 5PC solver [47], and the 3PC method of Ding et al. [9]. We excluded [54] from the real-world tests since it is extremely slow, even when implemented in $\mathrm{C}++$ , as reported in Fig. 2. + +The cumulative distribution functions (CDF) of the rotation and translation errors (in degrees) on the three tested datasets are shown in Fig. 5. Being accurate is interpreted as a curve close to the top-left corner. The proposed OPT, LIN, OPT(S), and LIN(S) solvers are always among the top-performing methods. Interestingly, the LIN solver leads to the most accurate rotations and translations on these + +scenes. Since these datasets contain image pairs with relatively small baseline and, thus, small pose change between the frames, it is not a surprise that LIN is accurate. Moreover, since the OPT solver finds the optimum of an algebraic error, which might not always coincide with the minimum of the geometric one, it can happen that LIN solver leads to better pose estimates than the OPT solver. The average errors are reported in Table 1. All of the proposed solvers lead to more accurate results than the other compared methods. The most accurate results are obtained by the combination of 5PC and LIN. + +# 6.3. Phone Dataset + +To further illustrate the usefulness of the proposed solvers, we tested them on images from a phone where the gravity directions are obtained from the built-in IMU. Since we have not found such datasets, we decided to build one using images captured by a smartphone (iPhone 6s). We captured 6 sequences at @30Hz with the rear camera. The corresponding IMU data were captured at @100Hz with the phone's sensor (costs less than a dollar). We then synchronized the images and IMU data based on their timestamps. In order to obtain a ground truth, which can be used to test pose solvers, we applied the RealityCapture [1] software. A total of 10993 image pairs with synchronized gravity direction, ground truth poses, calibrations and 3D reconstructions were obtained. Example images are shown in Fig. 6. + +The CDFs of the compared solvers are shown in the left + +![](images/28d32f2190f3bcb991bde8b292ce1e575333e2ffa9de65f97c227e7c4a730c02.jpg) + +![](images/a1783e5fd42ec2dce277d18f84343b15fa694d863974cae0fe221a14aee3cd58.jpg) + +![](images/b20b76c133d818a6681d28a3bf03b76e53da8dc145ba8ff16bc94e4f65f2ee5e.jpg) + +![](images/d95fe4cb238ddfa14eba6caac53d7cb1abf1f9a87a35986adb9036edaf8ed74d.jpg) + +![](images/2834024d9d3865668ce9d3808d8414bc3172e04b40a61cdcb41ffc2112a7a98d.jpg) +(a) Malaga + +![](images/0af1d60dc7446986c54898966d7573c048e3123a647edb77613f9e96b14918b1.jpg) +(b) KITTI + +![](images/c55cd7b8818bd5ee752274fd91025d0fe3d009461b0616dfe2eb76cb91a2edbf.jpg) +(c) ETH3D +Figure 5: The cumulative distribution functions of the rotation and translation errors (in degrees) of GC-RANSAC combined by different minimal and non-minimal solvers on datasets Malaga (9,064 image pairs), KITTI (23,190) and ETH3D (5,162). Being accurate is interpreted as a curve close to the top-left corner. + +two plots of Fig. 7a. The same trend can be seen as before, i.e., the proposed optimal and linearized solvers lead to the most accurate rotations and translations. However, OPT and LIN leads to similar accuracy on this dataset. This is due to having slightly bigger view changes than in the datasets designed for autonomous driving. The bigger view changes increase the approximative nature of solver LIN and, thus, make its results marginally less accurate. Still, it is one of the top-performing methods in terms of accuracy. + +![](images/74044f866c79f69307ef37a0723dc3cad09cd7c7d87ac039c432c9a0dd658588.jpg) +Figure 6: Images from the captured phone dataset. It consists of a total of 10993 image pairs with synchronized gravity directions, ground truth poses and 3D reconstructions. + +# 6.4. Processing Times + +The CDFs of the processing times of the robust estimation on all the 47863 image pairs from all datasets are in + +Fig. 7b. The proposed solvers based on Sturm sequences are the fastest ones. The optimal solver (OPT), compared to the other ones are the slowest method, while the linearized (LIN) solver has comparable speed to the other methods. It is important to mention that even the slowest combination (i.e., $5\mathrm{PC} + \mathrm{OPT}$ ) has an average run-time of $61~\mathrm{ms}$ . Therefore, all tested combinations lead to real-time performance. + +# 7. Extensions and Discussion + +General case. The proposed technique can be, in theory, applied to the general case (without gravity prior). In this case, for the Cayley parameterization of the rotation, the elements of the matrix $\mathbf{C}$ are polynomials in $x,y,z$ . The three eigenvalues of $\mathbf{C}$ have to satisfy (10), but now there are three partial derivatives $\frac{\partial\alpha}{\partial x},\frac{\partial\alpha}{\partial y},\frac{\partial\alpha}{\partial z}$ that should be zero. This gives four polynomials with respect to four unknowns $\{\alpha ,x,y,z\}$ . Using Macaulay2 [16], we found that this system of polynomials has more than 2,000 solutions. A solver to such a system is impractical since the eigenvalue decomposition of a matrix of size 2, $000\times 2$ 000 is extremely slow. However, it means that there are more than 2,000 stationary points. Hence, locally optimized methods (e.g., [26] or + +![](images/108ba5a57fb27987d9ecb3fd78daae3676c45f4672efc9aa490ec469665606a8.jpg) + +![](images/c28e2a40da0ff854f354756d1217c5d53cbd9fb7612934d63d990d2351ebbc9c.jpg) +(a) + +![](images/896bb25c051017094e0f2bebc4d86bd4b7bc0b0a661009c8f081021bd6b6b559.jpg) +Figure 7: (a) The cumulative distribution functions (CDF) of the rotation and translation errors (in degrees) of GC-RANSAC combined by different minimal and non-minimal solvers on the captured phone dataset consisting of 10993 image pairs. Being accurate or fast is interpreted as a curve close to the top-left corner. (b) The CDF of the processing times (in seconds) of the robust estimation on all datasets (47, 863 image pairs). + +![](images/7918bcea4cb71d2fb66755c91e3e91caefddf4bc2b0387e9f1464bf0a0278fb7.jpg) +(b) + +
m> mMalagaKITTIETH3Davg
εRεtεRεtεRεt
3PCOPT2.619.860.041.970.3323.946.46
3PCOPT(S)3.0210.170.041.990.3827.457.18
3PCLIN2.619.580.041.970.3122.316.14
3PCLIN(S)2.9910.170.041.960.4025.596.86
3PC3PC2.9912.391.004.750.7024.997.80
3PC5PC2.896.770.253.221.8234.608.26
3PC8PC2.434.460.102.111.1437.808.01
5PCOPT2.413.590.051.900.4128.716.18
5PCOPT(S)2.493.730.051.910.4431.116.62
5PCLIN2.413.490.051.890.3726.865.85
5PCLIN(S)2.473.740.041.880.4629.326.32
5PC3PC3.6910.441.135.180.9429.398.46
5PC5PC2.724.790.273.302.1536.748.33
5PC8PC2.493.230.112.111.1839.468.10
+ +Table 1: The avg. rotation and translation errors (in degrees) of GC-RANSAC [3] combined with different pose solvers are reported on datasets Malaga, KITTI, ETH3D (in total, 47,863 image pairs). Columns 1-2 show the solvers used for minimal $(m)$ and non-minimal $(>m)$ fitting: the proposed optimal solvers OPT/OPT(S), LIN/LIN(S), 3PC [9], 5PC [47], and 8PC [17]. The best results are shown in red, the second bests are in blue. The cumulative distribution functions of the errors are shown in Fig. 5. + +# $8\mathrm{PC} + \mathrm{LM})$ may get stucked in these minima. + +Planar motion. In case of planar camera motion, which is usual scenario for unmanned ground vehicles with rigidly mounted cameras, we have constraint $t_y = 0$ . Therefore, the middle row and column of the matrix $\mathbf{C}$ in (9) can be removed. Matrix $\mathbf{C}$ becomes a $2 \times 2$ matrix, where the two eigenvalues should satisfy quadratic constraint $\alpha^2 - f_1\alpha +$ + +$f_{2} = 0$ , where $f_{1} = \operatorname{trace}(\mathbf{C})$ and $f_{2} = \det(\mathbf{C})$ . The remaining steps are similar to Sec. 4, and there are up to 8 solutions. In this case, the polynomial eigenvalue solution needs to find the eigenvalues of a $10 \times 10$ matrix. + +Forward motion. In our experiments, we observed that the globally optimal solvers [54, 5] estimate inaccurate poses in the case of forward motion. For this motion, the proposed globally optimal solvers return the best results. Due to the lack of space we included the experiments for forward motion in the supplementary material. + +# 8. Conclusions + +We propose globally optimal solutions for estimating the relative pose of two cameras, aligned by the gravity direction, from a larger-than-minimal set of point correspondences. All of the proposed solvers, even the linearized ones, lead to results superior to the state-of-the-art in terms of accuracy on approx. 50k image pairs from four widely-used datasets. The techniques based on linearization or Sturm sequences lead to extremely fast estimation with an average of $22\mathrm{ms}$ run-time (i.e., total RANSAC time) with no or negligible deterioration in the accuracy. Moreover, we captured a new dataset consisting of more than 10k photos taken by a smartphone with a gravity sensor. + +Acknowledgments. This research was supported by the National Science Fund of China (Grant No. U1713208), the "111" Program B13022, the OP VVV funded project CZ.02.1.01/0.0/0.0/16_019/0000765 "Research Center for Informatics", the ERC-CZ grant MSMT LL1901, and by the Ministry of Innovation and Technology NRDI Office within the framework of the Autonomous Systems National Laboratory Program. + +# References + +[1] RealityCapture. http://www.capturningreality.com. 6 +[2] Sameer Agarwal, Yasutaka Furukawa, Noah Snavely, Ian Simon, Brian Curless, Steven M Seitz, and Richard Szeliski. Building rome in a day. Communications of the ACM, 2011. 1 +[3] Daniel Barath and Jiří Matas. Graph-cut RANSAC. In Computer Vision and Pattern Recognition (CVPR), 2018. 1, 5, 8 +[4] J.-L. Blanco-Claraco, F.-Á. Moreno-Duenas, and J. G. Jiménez. The málaga urban dataset: High-rate stereo and lidar in a realistic urban scenario. International Journal of Robotics Research (IJRR), 2014. 5 +[5] Jesus Briales, Laurent Kneip, and Javier Gonzalez-Jimenez. A certifiably globally optimal solution to the non-minimal relative pose problem. In Computer Vision and Pattern Recognition (CVPR), 2018. 2, 8 +[6] Graziano Chesi. Camera displacement via constrained minimization of the algebraic error. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2008. 2 +[7] Ondej Chum, Jií Matas, and Josef Kittler. Locally optimized ransac. In Joint Pattern Recognition Symposium, 2003. 1 +[8] David A. Cox, John Little, and Donal O'shea. Using algebraic geometry. Springer Science & Business Media, 2006. 3 +[9] Yaqing Ding, Jian Yang, and Hui Kong. An efficient solution to the relative pose estimation with a common direction. In 2020 IEEE International Conference on Robotics and Automation, 2020. 1, 3, 4, 5, 6, 8 +[10] Yaqing Ding, Jian Yang, Jean Ponce, and Hui Kong. An efficient solution to the homography-based relative pose problem with a common reference direction. In International Conference on Computer Vision (ICCV), 2019. 1 +[11] Yaqing Ding, Jian Yang, Jean Ponce, and Hui Kong. Minimal solutions to relative pose estimation from two views sharing a common direction with unknown focal length. In Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[12] Martin A. Fischler and Robert C. Bolles. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 1981. 1 +[13] Friedrich Fraundorfer, Petri Tanskanen, and Marc Pollefeys. A minimal case solution to the calibrated relative pose problem for the case of two known orientation angles. In European Conference on Computer Vision (ECCV), 2010. 1, 3 +[14] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In Computer Vision and Pattern Recognition (CVPR), 2012. 5 +[15] Walter Gellert, M. Hellwich, H Kästner, and H Küstner. The VNR concise encyclopedia of mathematics. Springer Science & Business Media, 2012. 4 +[16] Daniel R. Grayson and Michael E. Stillman. Macaulay 2, a software system for research in algebraic geometry, 2002. 7 +[17] Richard Hartley. In defence of the 8-point algorithm. In International Conference on Computer Vision (ICCV), 1995. 2, 4, 6, 8 + +[18] Richard Hartley. Minimizing algebraic error in geometric estimation problems. In International Conference on Computer Vision (ICCV), 1998. 2 +[19] Richard Hartley and Fredrik Kahl. Global optimization through searching rotation space and optimal estimation of the essential matrix. In International Conference on Computer Vision (ICCV), 2007. 2 +[20] Richard Hartley and Fredrik Kahl. Global optimization through rotation space search. International Journal of Computer Vision, 2009. 2 +[21] Richard Hartley and Hongdong Li. An efficient hidden variable approach to minimal-case camera motion estimation. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2012. 1 +[22] Richard Hartley and Andrew Zisserman. Multiple view geometry in computer vision. Cambridge university press, 2003. 2 +[23] Uwe Helmke, Knut Hüper, Pei Yean Lee, and John Moore. Essential matrix estimation using gauss-newton iterations on a manifold. International Journal of Computer Vision, 2007. 2 +[24] Joel A. Hesch and Stergios I. Roumeliotis. A direct least-squares (dls) method for pnp. In International Conference on Computer Vision (ICCV), 2011. 1 +[25] Laurent Kneip, Hongdong Li, and Yongduek Seo. Upnp: An optimal o (n) solution to the absolute pose problem with universal applicability. In European Conference on Computer Vision (ECCV), 2014. 1 +[26] Laurent Kneip and Simon Lynen. Direct optimization of frame-to-frame rotation. In International Conference on Computer Vision (ICCV), 2013. 2, 3, 7 +[27] Zuzana Kukelova, Martin Bujnak, and Tomas Pajdla. Automatic generator of minimal problem solvers. In European Conference on Computer Vision (ECCV), 2008. 3 +[28] Zuzana Kukelova, Martin Bujnak, and Tomas Pajdla. Polynomial eigenvalue solutions to minimal problems in computer vision. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2012. 1, 4 +[29] Viktor Larsson, Kalle Åström, and Magnus Oskarsson. Efficient solvers for minimal problems by syzygy-based reduction. In Computer Vision and Pattern Recognition (CVPR), 2017. 2, 3, 4 +[30] Viktor Larsson, Magnus Oskarsson, Kalle Åström, Alge Wallis, Zuzana Kukelova, and Tomas Pajdla. Beyond gröbner bases: Basis selection for minimal solvers. In Computer Vision and Pattern Recognition (CVPR), 2018. 3 +[31] Karel Lebeda, Jin Matas, and Ondrej Chum. Fixing the locally optimized RANSAC-full experimental evaluation. In British Machine Vision Conference (BMVC), 2012. 1 +[32] Yi Ma, Jana Košecá, and Shankar Sastry. Optimization criteria and geometric algorithms for motion and structure estimation. International Journal of Computer Vision, 2001. 2 +[33] Jorge J. Moré. The levenberg-marquardt algorithm: implementation and theory. In Numerical analysis. 1978. 4 +[34] Raul Mur-Artal and Juan D Tardós. Orb-slam2: An opensource slam system for monocular, stereo, and rgb-d cameras. IEEE Transactions on Robotics, 2017. 1 + +[35] Gaku Nakano. Globally optimal dls method for pnp problem with Cayley parameterization. In *British Machine Vision Conference (BMVC)*, 2015. 1 +[36] Gaku Nakano. A versatile approach for solving pnp, pnpf, and pnpfr problems. In European Conference on Computer Vision (ECCV), 2016. 1 +[37] Oleg Naroditsky, Xun S. Zhou, Jean Gallier, Stergios I. Roumeliotis, and Kostas Daniilidis. Two efficient solutions for visual odometry using directional correspondence. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2012. 1, 3 +[38] David Nister. An efficient solution to the five-point relative pose problem. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2004. 1 +[39] Marc Pollefeys, David Nister, J-M Frahm, Amir Akbarzadeh, Philippines Mordohai, Brian Clipp, Chris Engels, David Gallup, S-J Kim, Paul Merrell, et al. Detailed real-time urban 3d reconstruction from video. International Journal of Computer Vision (IJCV), 2008. 1 +[40] Marc Pollefeys, Luc Van Gool, Maarten Vergauwen, Frank Verbiest, Kurt Cornelis, Jan Tops, and Reinhard Koch. Visual modeling with a hand-held camera. International Journal of Computer Vision (IJCV), 2004. 1 +[41] Rahul Raguram, Ondrej Chum, Marc Pollefeys, Jiri Matas, and Jan-Michael Frahm. Usac: a universal framework for random sample consensus. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2013. 1 +[42] Carsten Rother. Multi-view reconstruction and camera recovery using a real or virtual reference plane. PhD thesis, Numerisk analysis och datalogi, 2003. 1 +[43] Olivier Saurer, Pascal Vasseur, Rémi Boutteau, Cédric Demonceaux, Marc Pollefeys, and Friedrich Fraundorfer. Homography based egomotion estimation with a common direction. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2017. 1 +[44] Johannes L. Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In Computer Vision and Pattern Recognition (CVPR), 2016. 1 +[45] Thomas Schops, Johannes L Schonberger, Silvano Galliani, Torsten Sattler, Konrad Schindler, Marc Pollefeys, and Andreas Geiger. A multi-view stereo benchmark with high-resolution images and multi-camera videos. In Computer Vision and Pattern Recognition (CVPR), 2017. 5 +[46] H. Stewenius, C. Engels, and D. Nistér. Recent developments on direct relative orientation. Journal of Photogrammetry and Remote Sensing, 2006. 4 +[47] Henrik Stewénius, David Nister, Fredrik Kahl, and Frederik Schaffalitzky. A minimal solution for relative pose with unknown focal length. In Computer Vision and Pattern Recognition (CVPR), 2005. 5, 6, 8 +[48] Linus Svärm, Olof Enqvist, Fredrik Kahl, and Magnus Oskarsson. City-scale localization for cameras with known vertical direction. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2016. 1 +[49] Chris Sweeney, John Flynn, and Matthew Turk. Solving for relative pose with a partially known rotation is a quadratic eigenvalue problem. International Conference on 3D Vision (3DV), 2014. 1, 3 + +[50] George Terzakis and Manolis Lourakis. A consistently fast and globally optimal solution to the perspective-n-point problem. In European Conference on Computer Vision (ECCV), 2020. 1 +[51] Ping Wang, Guili Xu, Yuehua Cheng, and Qida Yu. A simple, robust and fast method for the perspective-n-point problem. Pattern Recognition Letters, 2018. 1 +[52] Changchang Wu. Towards linear-time incremental structure from motion. In International Conference on 3D Vision (3DV), 2013. 1 +[53] Bernhard Zeisl, Torsten Sattler, and Marc Pollefeys. Camera pose voting for large-scale image-based localization. In International Conference on Computer Vision (ICCV), 2015. 1 +[54] Ji Zhao. An efficient solution to non-minimal case essential matrix estimation. Trans. Pattern Analysis and Machine Intelligence (PAMI), 2020. 2, 4, 5, 6, 8 +[55] Ji Zhao, Wanting Xu, and Laurent Kneip. A certifiably globally optimal solution to generalized essential matrix estimation. In Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[56] Yinqiang Zheng, Yubin Kuang, Shigeki Sugimoto, Kalle Astrom, and Masatoshi Okutomi. Revisiting the pnp problem: A fast, general and optimal solution. In International Conference on Computer Vision (ICCV), 2013. 1 +[57] Lipu Zhou and Michael Kaess. An efficient and accurate algorithm for the perspective-n-point problem. In International Conference on Intelligent Robots and Systems (IROS), 2019. 1 \ No newline at end of file diff --git a/globallyoptimalrelativeposeestimationwithgravityprior/images.zip b/globallyoptimalrelativeposeestimationwithgravityprior/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0d79e37c86ee3c7b7646597c949c2b235e3dff57 --- /dev/null +++ b/globallyoptimalrelativeposeestimationwithgravityprior/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dedae05897e7b94bbe07559205d56dd83444c4e8cb304d6f2e44161163f1076a +size 715723 diff --git a/globallyoptimalrelativeposeestimationwithgravityprior/layout.json b/globallyoptimalrelativeposeestimationwithgravityprior/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9e25153fdef745bdaee3afc5548cb963026f966f --- /dev/null +++ b/globallyoptimalrelativeposeestimationwithgravityprior/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57057413b3a6ed7015cd3ab431a3733ef84d410b17e09f34c7e229a32d742e98 +size 517922 diff --git a/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_content_list.json b/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..07347b6327981500d3f3b0380f9a089e6a95f4f5 --- /dev/null +++ b/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82adf3d73f5082154bec574cfe21c7be2ae4c668e5f8792ea8e6907400268d7e +size 91961 diff --git a/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_model.json b/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8fdd07a610694585c59161ef900f49ac6558842f --- /dev/null +++ b/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1de9b91f077c03e8f08b3bdf71d98fd83557be5f85fda38f94b382c6d6a1239 +size 116170 diff --git a/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_origin.pdf b/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d1b1cc1158e8519a8c2b232599248e8ab4fe87fc --- /dev/null +++ b/globaltransportforfluidreconstructionwithlearnedselfsupervision/76a985cc-1f60-4eb1-a70f-f144e5ddc921_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cf5d0079b4cc080183109143ddb8bb9715a4d56304a8dc2a6e8d675cc450c50 +size 1479544 diff --git a/globaltransportforfluidreconstructionwithlearnedselfsupervision/full.md b/globaltransportforfluidreconstructionwithlearnedselfsupervision/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d89bdd05d26edd7662000d5c307906ca4418a72b --- /dev/null +++ b/globaltransportforfluidreconstructionwithlearnedselfsupervision/full.md @@ -0,0 +1,394 @@ +# Global Transport for Fluid Reconstruction with Learned Self-Supervision + +# Erik Franz +Technical University of Munich + +erik.franz@tum.de + +# Barbara Solenthaler +ETH Zurich + +solphthaler@inf.ethz.ch + +# Nils Thuerey +Technical University of Munich + +nils.thuurey@tum.de + +![](images/b265793449837426bf948b631ce8cf906e2ea9b7eefdc385b2e35c58ebb4ac52.jpg) +Figure 1: We propose a novel algorithm that reconstructs the motion $\mathbf{u}^{0..F}$ of a single initial state $\rho^0$ over the full course of $F$ frames of an input sequence, i.e., its global transport. Based on a learned self-supervision, our algorithm yields a realistic motion for highly under-constrained scenarios such as a single input view. + +# Abstract + +We propose a novel method to reconstruct volumetric flows from sparse views via a global transport formulation. Instead of obtaining the space-time function of the observations, we reconstruct its motion based on a single initial state. In addition we introduce a learned self-supervision that constrains observations from unseen angles. These visual constraints are coupled via the transport constraints and a differentiable rendering step to arrive at a robust end-to-end reconstruction algorithm. This makes the reconstruction of highly realistic flow motions possible, even from only a single input view. We show with a variety of synthetic and real flows that the proposed global reconstruction of the transport process yields an improved reconstruction of the fluid motion. + +# 1. Introduction + +The ambient space for many human activities and manufacturing processes is filled with fluids whose motion we can only observe indirectly [53, 61, 72, 79]. Once passive markers, e.g., in the form of ink or dye, are injected into the fluid, it is possible to draw conclusions about the transport induced by the motion of the fluid. This form of motion reconstruction is highly important for a large variety of applications, from medical settings [59], over engineering [67] to visual effects [15], but at the same time poses huge challenges. + +Fluids on human scales are typically turbulent, and exhibit a highly complex mixture of translating, shearing, and rotating motions [60]. In addition, the markers by construction need to be sparse or transparent in order not to fully occupy and occlude the observed volume. Several works have alleviated these challenges with specialized hardware [18, 77] or by incorporating the established physical model for fluids, the Navier-Stokes equations, into the reconstruction [11, 21]. However, despite improvements in terms of quality of the reconstruction, the high non-linearity of the reconstruction problem coupled with ambiguous observations can cause the optimizations to find undesirable minimizers that deviate from ground truth motions. + +In order to obtain a solution, existing approaches compute volumetric observations over time [21, 9, 79]. Hence, despite including a physical model, the observed quantities represent unknowns per time step, and are allowed to deviate from the constraints of the model. We make a central observation: when enforcing the physical model over the course of the complete trajectory of the observed fluid, the corresponding reconstructions yield a motion that better adheres to the ground truth. Thus, instead of a sequence, our reconstruction results in a single initial state of the density. This state is evolved via a global transport over time purely by the physical model and the temporal reconstruction of the motion field. In addition to an improved reconstruction of the motion, this strict differentiable physics prior [7, 28] allows us to work with very sparse observations, with only a single viewpoint in the extreme. + +In order to better constrain the degrees of freedom in this single-viewpoint scenario, we propose a method inspired by generative adversarial networks (GANs) [19, 76]. Due to the complete lack of observations from other viewpoints, we make use of a small dataset of example motions, and train a convolutional neural network alongside the motion reconstruction that serves as a discriminator. This discriminator is evaluated for randomly sampled viewpoints in order to provide image space constraints that are coupled over time via our global transport formulation. + +While existing works also typically focus on linear image formation models [30, 22], we combine the visual and transport constraints with a fully differentiable volumetric rendering pipeline. We account for complex lighting effects, such as absorption and self-shadowing, which are key elements to capture the visual appearance of many real-world marker observations. + +To summarize, the main contributions of our work are: + +- A global multi-scale transport optimization via a differentiable physical model that yields purely transport-based reconstructions. +- A learned visual prior to obtain motions from very sparse and single input views. +- The inclusion of differentiable rendering with explicit lighting and volumetric self-shadowing. + +To the best of our knowledge, these contributions make it possible for the first time to construct a fluid motion from sparse views in an end-to-end optimization, even from a single viewpoint. An overview is given in Figure 1. + +# 2. Related Work + +Flow Reconstruction Reconstructing fluid flows from observations has a long history in science and engineering. A wide variety of methodologies have been proposed, ranging from Schlieren imaging [6, 2, 1], over particle imaging velocimetry (PIV) methods [20, 12], to laser scanners [24, 16] and structured light [23] and light path [33] approaches. Especially PIV has been widely used, and seen a variety of extensions and improvements, such as synthetic apertures [3], specialized lighting setups [77], and algorithms for custom hardware setups [14]. In the following, we focus on visible light capturing approaches, as they avoid the reliance on specialized, and often expensive hardware. + +This capturing modality is especially interesting in conjunction with sparse reconstructions, e.g., medical tomography settings often favor view sparsity [68, 4, 66]. Here, the highly under-constrained setting of a large number of degrees of freedom of a dense grid to be reconstructed from a very small number of input views is highly challenging for reconstruction algorithms. One avenue to obtain a reduced + +solution space is to introduce physical priors. For fluids, the Navier-Stokes equations [60] represent a well-established physical model for incompressible fluids. $E.g.$ , the adjoint method was used for gradient-based optimization of volumetric flows, such as fluid control [48]. On the other hand, Gregson et al. [21] introduced a multi-view convex optimization algorithm that makes use of a discrete advection step and a divergence-free projection. This approach was extended to incorporate view-interpolation to obtain additional constraints [79]. Convex optimization was also used for the reconstruction from sparse views [9], or specialized single view reconstruction [8]. However, this requires a hand-crafted regularizer to suppress depth-aligned motions. In contrast, we rely on gradients provided by deep-learning methods for our reconstructions. And while several of these methods introduce transport terms for inter-frame constraints, none introduces an "end-to-end" constraint that yields a single, physical transport process from an initial state to the last observed frame. Such gradient propagation through PDEs is also being explored in differentiable physical simulation [28]. + +3D Reconstruction and Appearance Solving the tomography for static scattering volumetric media has been studied via inverse scattering [17] or for large-scale cloud-scapes [43]. Although we target volumetric reconstruction, our goals also partially align with settings where a clearly defined surface is visible, e.g., reconstructions of 3D geometry [54, 42], including its deformation [78]. Mesh-based methods were proposed to create a deformation of a labeled template mesh [35], or of spherical prototypes [37]. While marker density volumes do not exhibit a clear surface, they share similarities with voxel-based reconstructions [58, 52]. In addition, learned representations [69, 45, 70, 51] have the flexibility to encode information about transparent materials and their reflectance properties, and temporally changing deformations [50, 55]. + +In conjunction with sparse-view reconstructions, regularization becomes increasingly important to obtain a meaningful solution. One line of work has employed different forms of appearance transfer [10, 32], e.g., to match the histograms of fluid reconstructions [57], while others have proposed view interpolations via optical flow [79]. In the context of style transfer for natural images, learned approaches via GANs [19, 62] were shown to be especially powerful [81, 36]. GANs were likewise employed in fluid synthesis settings [76], and we propose a learned discriminator that works alongside a single flow reconstruction process. + +A similar idea was used for single-view tomographic reconstruction of static objects: The approach by Henzler et al. [26] was extended to include a learned discriminator for a specific class of objects [25] to constrain unseen views. We extend this approach to sequences, and show that the + +concept of learned self-supervision provides a highly useful building block for physical reconstructions. + +Differentiable Rendering Computing derivatives of pixels in an image with respect to input variables is essential for many inverse problems. Several fast but approximate differentiable rendering methods have been presented that model simple light transport effects [46, 38]. Physics-based neural renderers account for secondary effects, such as shadows and indirect light. Li et al. [44] presented the first general-purpose differentiable ray tracer, and Nimier et al. [56] a versatile MCMC renderer that was, among other examples, applied to smoke densities. Neural renderers [71] were used for 3D reconstruction problems, e.g., to render an explicit scene representation [25] or to synthesize novel views [51]. + +In the context of fluid simulations, differentiable renderers were used with and without differentiable solvers to optimize robotic controllers [63], to initialize a water wave simulator [29], and to transfer a style from an input image onto a 3D density field [39, 40]. Additive, i.e., linear, lighting models were often used for flow reconstruction [9, 79]. They are suitable for thin marker densities that have little absorption under uniform lighting conditions. In contrast, our method employs a differentiable rendering model that handles non-linear attenuation and self-shadowing. + +# 3. Method + +The central goal of our algorithm is to reconstruct a space-time sequence of volumetric fluid motions $\mathbf{u}$ such that a passively transported field of marker density $\rho$ matches a set of target images. These targets are given as $c\in C$ calibrated input views $I_{c}^{t}$ for a time sequence of $\pmb{F}$ frames with $\{t|t\in \mathbb{N}_0,t < F\}$ . We represent $\rho$ and $\mathbf{u}$ as dense Eulerian grids, which are directly optimized through iterative gradient updates calculated from the proposed loss functions and propagated through the full sequence to achieve a solution that adheres to a global transport formulation. + +# 3.1. Physical Prior + +We derive our method on the basis of a strong physical prior given by the Navier-Stokes equations that describe the motion of an incompressible fluid: + +$$ +\mathbf {u} _ {t} + \mathbf {u} \cdot \nabla \mathbf {u} = - \nabla p + \nu \nabla^ {2} \mathbf {u}, \text {s . t .} \nabla \cdot \mathbf {u} = 0. \tag {1} +$$ + +In addition to the fluid velocity $\mathbf{u}$ , $p$ denotes the pressure and $\nu$ the kinematic viscosity. We implement these equations via a differentiable transport operator $\mathcal{A}(s, \mathbf{u})$ that can advect a generic field $s$ (can be $\rho$ or $\mathbf{u}$ ) using a velocity field $\mathbf{u}$ . For the discretized operator $\mathcal{A}$ we use a second-order transport scheme to preserve small-scale content on the transported fields [65]. Details are in Appendix A.3. + +Global Density Transport Optimization Given an initial density $\rho^0$ , the state $\rho^t$ at time $t$ is given by + +$$ +\rho^ {t} := \mathcal {A} ^ {t} \left(\rho^ {0}\right) = \mathcal {A} \left(\mathcal {A} \left(\mathcal {A} \left(\rho^ {0}, \mathbf {u} ^ {0}\right), \mathbf {u} ^ {1}\right) \dots , \mathbf {u} ^ {t - 1}\right) \tag {2} +$$ + +and we only optimize $\rho^0$ and the velocity sequence $\{\mathbf{u}^0,\dots ,\mathbf{u}^{t - 1}\}$ , instead of optimizing all $\rho^t$ individually, as done by previous approaches. With this formulation we enforce a correct transport over the entire fluid flow trajectory, resulting in a reconstructed motion that better adheres to Equation (1). For optimization, all $\rho^t$ are constrained by a composite loss $\mathcal{L}_{\rho}$ , that we detail in Section 4. Thus, the gradient for $\rho^0$ is the sum of derivatives of $\mathcal{L}_{\rho}$ , of all frames $t\in F$ , w.r.t. to the density of the first frame: + +$$ +\nabla \rho_ {\mathcal {A}} ^ {0} = \sum_ {t = 0} ^ {F} \frac {\partial \mathcal {L} _ {\rho} \left(\rho^ {t}\right)}{\partial \rho^ {0}} = \sum_ {t = 0} ^ {F} \frac {\partial \mathcal {A} ^ {t} \left(\rho^ {0}\right)}{\partial \rho^ {0}} \frac {\partial \mathcal {L} _ {\rho} \left(\mathcal {A} ^ {t} \left(\rho^ {0}\right)\right)}{\partial \mathcal {A} ^ {t} \left(\rho^ {0}\right)}. \tag {3} +$$ + +Back-propagation of the gradients $\nabla \rho^{t + 1}$ through every transport step $\mathcal{A}(\rho^t,\mathbf{u}^t)$ takes the iterative form + +$$ +\nabla \rho_ {\mathcal {A}} ^ {t} = \nabla \rho^ {t} + \frac {\partial \mathcal {A} \left(\rho^ {t} , \mathbf {u} ^ {t}\right)}{\partial \rho^ {t}} \nabla \rho_ {\mathcal {A}} ^ {t + 1} \tag {4} +$$ + +where $\nabla \rho^t = \partial \mathcal{L}_\rho (\rho^t) / \partial \rho^t$ are the individual per-frame gradients and $\nabla \rho_{\mathcal{A}}^{F - 1} = \nabla \rho^{F - 1}$ . In practice, we found that using an exponential moving average (EMA) with decay $\beta$ to accumulate the gradients, i.e., + +$$ +\nabla \rho_ {\mathcal {A}} ^ {t} = (1 - \beta) \nabla \rho^ {t} + \beta \frac {\partial \mathcal {A} \left(\rho^ {t} , \mathbf {u} ^ {t}\right)}{\partial \rho^ {t}} \nabla \rho_ {\mathcal {A}} ^ {t + 1}, \tag {5} +$$ + +leads to better defined structures and smoother motion. This construction, which we will refer to as global transport formulation, requires an initial velocity sequence to create $\mathcal{A}^t (\rho^0)$ , which we acquire from a forward-only pre-optimization pass, as described in Section 4. The velocity also receives gradients $\nabla \mathbf{u}_{\mathcal{A}}^{t} = \sum_{i = t}^{F}\partial \mathcal{L}_{\rho}(\rho^{i}) / \partial \mathbf{u}^{t} = \partial \mathcal{A}(\rho^{t},\mathbf{u}^{t}) / \partial \mathbf{u}^{t}\nabla \rho_{\mathcal{A}}^{t + 1}$ from the back-propagation through the density advection. Those are, however, not backpropagated further through velocity self-advection. + +Transport Losses A per-frame transport loss that takes the general form of + +$$ +\mathcal {L} _ {\mathcal {A} (s)} = \left| \mathcal {A} \left(s ^ {t - 1}, \mathbf {u} ^ {t - 1}\right) - s ^ {t} \right| ^ {2} + \left| \mathcal {A} \left(s ^ {t}, \mathbf {u} ^ {t}\right) - s ^ {t + 1} \right| ^ {2} \tag {6} +$$ + +connects $s^t$ to the previous and subsequent frames at times $t - 1$ and $t + 1$ . The self-advection loss $\mathcal{L}_{\mathcal{A}(\mathbf{u})}$ induces temporal coherence in the velocity fields while the density transport loss $\mathcal{L}_{\mathcal{A}(\rho)}$ is used to build the initial velocity sequence. Despite the inclusion of and back-propagation through the global transport via Equation (5), both still contribute important gradients that help to reconstruct the inflow region and the motion within the visual hull, which we + +show with an ablation in Appendix B.2. The divergence-free constraint of Equation (1) is enforced by additionally minimizing + +$$ +\mathcal {L} _ {\mathrm {d i v}} = \left| \nabla \cdot \mathbf {u} \right| ^ {2}. \tag {7} +$$ + +# 3.2. Differentiable Rendering + +To connect the physical priors to the target observations we leverage recent progress in GD-based differentiable rendering [37, 25]. We employ a non-linear image formation (IF) model that includes attenuation and shadowing to handle varying lighting conditions and denser material while still being able to solve the underlying tomographic reconstruction problem. Our rendering operator $\mathcal{R}()$ creates the image seen from view $c$ of the density $\rho$ given the outgoing light $L$ at each point in the volume by solving the integral + +$$ +\mathcal {R} (\rho , \boldsymbol {L}, c) = \int_ {\mathrm {n}} ^ {\mathrm {f}} \boldsymbol {L} (x) e ^ {- \int_ {\mathrm {n}} ^ {x} \rho (a) d a} d x \tag {8} +$$ + +for each pixel-ray $\mathrm{n} \rightarrow \mathrm{f}$ of the image, using the Beer-Lambert law for absorption [13]. + +The outgoing light $L$ is computed from point lights $p \in P$ at positions $x_{p}$ with inverse-square falloff and single-scattering as well as ambient lighting to approximate the effect of multi-scattering. The intensities are $i_{p}$ and $i_{a}$ , respectively. The total outgoing light at point $x$ is given as + +$$ +\boldsymbol {L} _ {\rho} (x) = i _ {a} \rho (x) + \sum_ {p \in P} i _ {p} \rho (x) \frac {1}{1 + \left| \left| x _ {p} - x \right| \right| _ {2}} e ^ {- \int_ {x _ {p}} ^ {x} \rho (a) d a}. \tag {9} +$$ + +In practice we employ ray-marching to approximate the shadowing term and render the image and its transparency. Implementation details and an evaluation of the rendering model can be found in Appendix A.4. + +With this formulation we can constrain the renderings of the reconstruction to the target images $\mathbf{I}_c^t$ with + +$$ +\mathcal {L} _ {\text {t a r}} = \frac {1}{c} \sum_ {c \in C} \left| I _ {c} ^ {t} - \mathcal {R} \left(\rho^ {t}, L _ {\rho^ {t}}, c\right) \right| ^ {2}. \tag {10} +$$ + +# 3.3. Learned Self-Supervision + +Our physical priors and rendering constraints enable the reconstruction of a physically correct flow even from sparse views. However, $\rho$ , and therefore the transport, are increasingly under-constrained with fewer views, and the huge space of indistinguishable solutions can lead to a mismatch between real and computed motions, severely reducing accuracy when using only a single view. To address these ambiguities, we train a fully convolutional neural network alongside the motion reconstruction that serves as a discriminator between images of real and reconstructed smoke. This discriminator learns to transfer features of real flows to the reconstruction via their visual projections over the + +course of the optimization. While the discriminator can not recover the true volumetric structure pertaining to a given sample, it constrains the results to be plausible w.r.t. the given target samples. We chose the RaLSGAN (relativistic average least squares) loss variant [34] as our discriminator loss for increased training stability: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathcal {D}} (\rho , l) := \mathbb {E} _ {r \sim R} \left[ \left(\mathcal {D} \left(\boldsymbol {I} _ {r}\right) - \mathbb {E} _ {f \sim \Omega} \mathcal {D} \left(\hat {\boldsymbol {I}} _ {f}\right) - l\right) ^ {2} \right] \tag {11} \\ + \mathbb {E} _ {f \sim \Omega} \left[ \left(\mathcal {D} (\hat {\boldsymbol {I}} _ {f}) - \mathbb {E} _ {r \sim R} \mathcal {D} (\boldsymbol {I} _ {r}) + l\right) ^ {2} \right]. \\ \end{array} +$$ + +$\pmb{I}_r$ are randomly sampled from a set of reference images $R$ , and $\hat{\pmb{I}}_f \coloneqq \mathcal{R}(\rho, \pmb{L}_{\rho}, f)$ are rendered random views of the reconstruction. The label $l$ is 1 when training the discriminator, and $-1$ when using it as a loss to optimize the density via $\partial \mathcal{L}_{\mathcal{D}}(\rho, -1) / \partial \rho$ . This auxiliary loss term provides gradients for the optimization process and in this way constrains the large space of possible solutions for the fluid motion. Further details are given in Appendix A.2. + +Extending the discriminator in the temporal domain via a triplet of inputs $(I^{t - i},I^t,I^{t + i})$ was proposed for fluid in other contexts [76]. We show in Section 5.2 that such an extension does not yield benefits as our transport priors already successfully constrain the physicality of the motion. + +# 3.4. Additional Constraints + +During reconstruction we restrict the density to the visual hull $\pmb{H}$ constructed from the target views $C$ . After background subtraction the targets are turned into a binary mask, and projected into the volume $(\mathcal{R}^{-1})$ to create the hull via intersection: + +$$ +\boldsymbol {H} ^ {t} := \bigcap_ {c \in \boldsymbol {C}} \mathcal {R} ^ {- 1} \left(H \left(\boldsymbol {I} _ {c} ^ {t} - \epsilon\right), c\right), \tag {12} +$$ + +with $H$ being the Heaviside step function. Using the visual hull as hard constraint avoids residual density and tomography artifacts in outer regions of the reconstruction volume. For single-view reconstruction the hull is constructed using auxiliary image hulls created by rotation of the original view around a symmetry axis of the physical setup (Appendix A.5). While this hull is itself not physically correct, it constraints the solution to plausible shapes. + +As we focus on fluid convection scenarios such as rising smoke plumes, we model dedicated inflow regions for $\rho$ that are degrees of freedom, optimized together with the flow. We allow for free motions via Neumann boundary conditions for $\mathbf{u}$ . + +To reduce the non-linearity of the transport constraints, we follow a commonly employed multi-scale approach [49, 21] that first optimizes larger structures without being affected by local gradients of small-scale features. This is especially important for the global formulation, as + +![](images/100a5b5652dab55822c7f0288e0ce577cf0f2212ad1e6f47740955de32b2b192.jpg) +Figure 2: Multi-view evaluation with synthetic data: (a-e) Ablation with reference shown in (f). The different versions of the ablation (details in Section 5.1) continually improve density reconstruction and motion. (g-i) Comparison with previous work ScalarFlow [9], TomoFluid [79], and NeuralVolumes [45]. Our method in (e) yields an improved density reconstruction, in addition to a coherent and physical transport (see also Table 1a). + +![](images/1ab9f8845c569afc9e4e44e19f27a198171cf41b4151766d51750f97f5760846.jpg) + +it enables the optimization of large-scale displacements when constructing the velocity field, and makes it easier to handle larger features in the density content, without details obstructing the velocity transport gradients, as $\partial \mathcal{A}(s,\mathbf{u}) / \partial \mathbf{u}$ depends on the spatial gradients of $s$ (see also Appendix A.3). + +# 4. Reconstruction Framework + +To reconstruct a specific flow, the density $\rho$ and velocity $\mathbf{u}$ are first initialized with random values inside the visual hull $\pmb{H}$ . We alternately update $\rho$ and $\mathbf{u}$ via Adam iterations [41]. The targets $\pmb{I}_c^t$ for the rendering loss are given as image sequences with their corresponding camera calibrations $\pmb{C}$ . When using targets with a background, we composite the background and the reconstruction using the accumulated attenuation of the volume in order to match the appearance of the targets. While we experimented with optimizing the lighting (Appendix A.4.4), we use light positions and intensities that were determined empirically in our reconstructions. Below we give an overview of our framework, while algorithmic details and parameter settings are given in Appendix A.1. + +Pre-Optimization Pass We run a single forward pass to obtain a density sequence $\tilde{\rho}$ as initial guess, and to compute an initial velocity sequence as starting point for the global transport optimization from Section 3.1. The density is computed via tomography using $\mathcal{L}_{\mathrm{tar}}$ and the visual hull $H$ without transport constraints. The velocities $\mathbf{u}^t$ are optimized using $\tilde{\rho}^t$ and $\tilde{\rho}^{t + 1}$ via the density transport $\mathcal{L}_{\mathcal{A}(\rho)}$ and $\mathcal{L}_{\mathrm{div}}$ . To improve temporal coherence in this step the frames are initialized from the transported previous frame before optimization: $\tilde{\rho}^t \coloneqq \mathcal{A}(\tilde{\rho}^{t - 1}, \mathcal{A}(\mathbf{u}^{t - 2}))$ , $\mathbf{u}^t \coloneqq \mathcal{A}(\mathbf{u}^{t - 1}, \mathbf{u}^{t - 1})$ , for which the initial velocity $\mathbf{u}^0$ is constructed using the multi-scale scheme of Section 3.1. The initial density sequence $\tilde{\rho}$ is discarded when the global transport constraints are introduced. + +Coupled Reconstruction The main part of the reconstruction couples the observations over time by incorporating the remaining priors, namely $\mathcal{L}_{\mathcal{A}(\rho)}$ for the density and $\mathcal{L}_{\mathcal{A}(\mathbf{u})}$ for velocity. Combined, for the density loss in Equation (3) this yields $\mathcal{L}_{\rho} = \mathcal{L}_{\mathrm{tar}} + \mathcal{L}_{\mathcal{A}(\rho)} + \mathcal{L}_{\mathcal{D}}(\rho, -1)$ . Subsequent iterations of the optimizer run over the whole sequence, updating degrees of freedom for all time steps. When optimizing via the global transport formulation (Eq. (5)) the degrees of freedom for densities are reduced to $\rho^0$ , and a density sequence is created by advecting $\rho^0$ forward before updating the velocities via backpropagation through the sequence while accumulating the gradients for $\rho^0$ . The multi-scale approach is realized by synchronously increasing the resolution for all densities and velocities of the complete sequence with an exponential growth factor of $\eta = 1.2$ in fixed intervals. Target and rendering resolution for $\mathcal{L}_{\mathrm{tar}}$ and $\mathcal{D}$ are adjusted in accordance with the multi-scale resolutions. + +# 5. Results and Evaluation + +We use a synthetic data set with known ground truth motion to evaluate the performance for multiple target views, before evaluating real data for the single-view case. For all cases below, please see the supplemental video for details. The differences of the velocity reconstructions are especially apparent when seen in motion. The video and source code can be found on the project website. + +# 5.1. Multi-view Reconstructions + +We simulate a fluid flow with a publicly available Navier-Stokes solver [47] with a resolution of $128 \times 196 \times 128$ . Observations are generated for 120 frames over time with 5 viewpoints spread over a 120 degree arc using real calibrations. + +Ablation We first illustrate our algorithm with an ablation study. A qualitative comparison of these versions is shown + +![](images/8f3703dad60cc881b88b330e020dd51820efb4135e4655a3755e42e7bcb16643.jpg) +Figure 3: Other methods for multi-view reconstruction (a,b) compared to our approach (c), versus the nearest target from a $30^{\circ}$ rotated viewpoint (d). Even for the new viewpoint, our reconstruction matches the structures of the target, while the other methods produce overly smooth reconstructions. The SF [9] result is representative for TF [79] here. + +![](images/362385dd10df66190225603b8543d0a1d58a0b19bd52f4df049b4d9f08cbc4c3.jpg) + +![](images/7bea5436e3f5689bcd3d481d000d19ef5b864123c47705cd8323a524e14f06b9.jpg) + +![](images/37c14ec145424c4ca283cda2f9d86dca9bf68096da3fed57ec5e2aa5e42ff763.jpg) +Figure 4: Evaluation of transport accuracy for an initial state (a) advected with the velocity reconstructions of TF (b) and SF (c). Our result (d) is closest to the reference in (e). + +in Figure 2. The simplest single version uses the single pass described in Section 4. It yields a very good reconstruction of the input views, and low image space and volumetric errors for $\rho^H$ and $I_{\mathrm{rand}}$ in Table 1, respectively, but strong tomographic artifacts. Due to the known deficiencies of direct metrics like RMSE for complex signals, we additionally compute SSIM [74] and LPIPS [80] metrics for $I_{\mathrm{rand}}$ . Although the single-pass version has good SSIM and LPIPS scores, it results in incoherent and unphysical motions over time. This is visible in terms of the metric $\mathcal{A}(\rho)^H$ in Table 1, which measures how well the motion from one frame explains the next state, i.e., $\mathcal{A}(\rho)^H = |\mathcal{A}(\rho^{t - 1}) - \rho^t|_2$ . + +The forward reconstruction (Section 4) introduces a temporal coupling, and yields slight improvements in terms of temporal metrics and reduces the artifacts. Next, enabling coupling (version C) over time by optimizing the sequence with transport losses greatly improves the transport accuracy to approx. $25\%$ of the error of the forward version. Version C-MS in Table 1 activates multi-scale reconstruction during the coupled optimization and yields an improved reconstruction of larger structures, at the expense of an increased transport error. With version Glob-Trans we arrive at our global transport optimization, as described in Section 3.1. It results in sharper reconstructions, matching the perceived sharpness of the reference. This version achieves very good reconstructions in terms of density errors, and ensures a correct transport in terms of $\mathcal{A}(\rho)^H$ up to numerical precision, see Table 1. + +State of the Art We compare our global transport approach to three state of the art methods. Specifically, we compare with ScalarFlow (SF) [9] and TomoFluid (TF) [79] as representatives of physics-based reconstruction methods, and NeuralVolumes (NV) [45] as a purely visual, learning-based method. We use the synthetic data set from before, while targets are rendered in accordance with each method for fairness. Quantitative results are summarized in Table 1, + +![](images/e5781d12eb21a5bdfc6e9ae0db759e715a8cb15636621785dc391c8e03f59f9f.jpg) + +![](images/bf6c5aa0f1ce8fecedff46c34232892cff66a07cb3c1bd3917ef09832ed9d479.jpg) + +![](images/76a5e57321cff13e9bbf9f99df112c21cdda406bcd494b11778bf48f207ea9fc.jpg) + +![](images/5b36984a16d3c8d7e774ab0c9abcdf7b2fa24c8ad24c2561e46f7a7512832b75.jpg) + +![](images/d6dc32fe1ad30b1448a30ac32f65d96665ad1913a2de00adb4d83ae7235acdd8.jpg) + +while qualitative comparisons are depicted in Figure 2 (g-i). + +The SF reconstruction [9] employs physical priors in a single forward pass, similar to a constrained physics-based simulation. This leads to a temporally coherent velocity, but underperforms in terms of matching the target views. Note that SF has a natural advantage for the velocity reconstruction metrics in Table 1 for $\mathbf{u}^H$ as it is based on the same solver used to produce the synthetic data (see Appendix B). The TF method [79] improves upon this behavior by employing an optimization with physical priors, similar to the coupled variant of our ablation. However, due to its reliance on inter-frame motions and spatio-temporal smoothness, the computed motion is temporally incoherent. It additionally relies on a view-interpolation scheme to constrain intermediate view directions, which can be severely degraded far from the target views, e.g., as shown in Figure 2 (h), and hinder convergence. The purely visual neural scene representation of NV [45] does not employ physical priors. Despite encoding a representation over time by relying on inputs from the observed sequence for the inference of new views, it does not contain information about the motion between consecutive frames. To compute volumetric samples that are comparable, we extract a density by discarding black occlusions. While the measurements for $\rho$ are in a similar range as our approach, the image space errors for $I_{\mathrm{rand}}$ are larger, despite not providing velocities. + +Compared to all three previous methods, our global-transport approach outperforms the others in terms of image space reconstruction and most volumetric metrics in Table 1. This is also highlighted in Figure 3, where we compare a target frame qualitatively to a nearby target view. Most importantly, our method reconstructs a temporally consistent motion over the full duration of the observed sequence - a key property for retrieving a realistic fluid motion. We highlight this behavior with an additional test in Figure 4, where an initial state is advected over the course of 120 steps with the optimized velocity sequence. Our approach yields the closest match with the reference configuration. + +
MetricsA(ρ)HρHuHIrand
MethodRMSE↓RMSE↓SSIM↑RMSE↓SSIM↑PSNR↑LPIPS↓
Single0.13521.3000.5990.4530.14841.51.0203
Forward0.12222.4290.4640.4630.16539.81.0281
C0.02912.2680.5020.4520.18040.26.0244
C-MS0.05051.3090.5850.4450.16741.59.0186
Glob-Trans1.4e-71.8440.5330.4520.17139.86.0257
SF [9]1.573*2.8140.3280.4400.22035.80.0529
TF [79]0.38791.7070.4730.5440.08230.19.0492
NV [45]N/A2.0020.337N/AN/A27.77.0674
+ +(a) Multi-view: mean volume and image statistics and errors for synthetic data. + +
MetricsTarget views\(I_{rand}\)
MethodPSNR↑LPIPS↓FID↓
Forward29.42.0538164.6
C-MS28.31.0541166.7
Glob-Trans27.29.0484151.2
Full27.40.0489140.3
\(\text{Full} + \mathcal{D}_t\)27.49.0478147.3
pGAN [25]22.91.0891185.4
+ +(b) Single-view: mean image statistics evaluated for five new random views. + +Table 1: Error metrics for multi-view (left) and single-view cases (right). $\mathcal{A}(\rho)^H$ denotes the motion difference $\mathcal{A}(\rho^{t - 1}) - \rho^t$ , $\rho^H$ and $\mathbf{u}^H$ denote volumetric errors; all of these are measured inside the visual hull. $I_{\mathrm{rand}}$ measures differences to rendered targets using 32 random views. Bold numbers denote best scores for full algorithms, i.e., without ablation variants. The * for $\mathcal{A}(\rho)^H$ of SF indicates resampling the velocities to the same grid resolution as other methods for comparison. + +![](images/8bbceacdd42bae7f8734047366f1793071bb59dd6c34ba3cf343ec2010600273.jpg) +Figure 5: Single-view reconstructions of a captured fluid (target at $0^{\circ}$ ). Top & middle: density from a $90^{\circ}$ side view. Bottom: rendered visualization at $60^{\circ}$ . Our version with discriminator (d) yields coherent and sharp flow structures, preventing any smearing along the unconstrained direction (a, b) or streak artefacts (c). Temporal supervision [76] has no added benefit (e), while the purely learning-based method [25] fails to generate coherent features (f). + +# 5.2. Single-View Reconstruction + +We demonstrate the learned self-supervision, i.e., the efficacy of the discriminator loss, on a reconstruction of 120 frames from a real capture [9]. To evaluate the results from unconstrained directions we also include FID measurements [27] in Table 1 (b). + +Ablation Results of the single-view ablation for an unseen view at a $90^{\circ}$ angle are shown in Figure 5. Here, the forward variant (a) highlights the under-constrained nature of the single-view reconstruction problem with strong smearing along depth. The coupling version (b) refines the reconstructed volumes, but still contains noticeable striping artifacts as well as a lack of details. Our global transport + +![](images/50d628b6eb1a6f9ac9eeb1169fabd0706270b074649363fa8a1f5c3b6755ac47.jpg) +Figure 6: Unseen view of a single-view reconstruction: (a) previous work, our algorithm without (b) and with discriminator (c). The discriminator in (c) yields an improved reconstruction of small to medium scale structures in the flow that match the style of an example flow (d). + +![](images/f27015c21eb08c7d54fd4c50edc76039ac75a0e4100ffa555a1258118d2fa573.jpg) + +![](images/ecd24f14e3b7831cec8579f404256ec6cdb090d683259bb44cd1541292b5c21c.jpg) + +![](images/7010e37451f796195946abcaa2cd1a5925bfff4ce259ed2561f111ab043529c0.jpg) + +formulation (c) resolves these artifacts and yields a plausible motion, which, however, does not adhere to the motions observed in the input views. The full version (d) introduces the methodology explained in Section 3.3, and arrives at our full algorithm including global transport and the discriminator network. It not only sharpens the appearance of the plume, but also makes the flow more coherent by transferring information about the real-world behavior to unseen views. This is depicted in Figure 6 (c), where flow details closely match the style of an example view (d). + +State of the Art Only few works exist that target volumetric single-view reconstructions over time. As two representatives, we evaluate the temporal discriminator $D_{t}$ proposed in previous work for fluid super-resolution [76], and the Platonic GAN approach for volumetric single view reconstructions [25]. + +The temporal self-supervision $(\mathrm{Full} - D_t)$ [76] was proposed for settings without physical priors. We have extended our full algorithm with this method, and note that it does not yield substantial improvements for the optimized motion, see Figure 5 (e). This highlights the capabilities of the global transport, which already strongly constrains the + +solution. Thus, a further constraint in the form of a temporal self-supervision has little positive influence, and slightly deteriorates the FID results in Table 1 (b). + +The Platonic GAN (pGAN) was proposed for learning 2D supervision per class of reconstructed objects. We have used this approach to pre-train a network for per-frame supervision of the rising smoke case of our single-view evaluation yielding improvements in terms of depth artifacts. However, due to the lack of constraints over time, the solutions are incoherent, and do not align with the input sequence, leading to an FID of more than 180. + +In contrast, the solution of our full algorithm yields a realistically moving sequence that very closely matches the input view while yielding plausible motions even for highly unconstrained viewing directions. This is reflected in the FID measurements in Table 1 (b), where our full algorithm outperforms the other versions with a score of 140.3. We found the discriminator to be especially important for noisy, real-world data, where hard, model-based constraints can otherwise lead to undesired minima in the optimization process. Both comparisons highlight their importance of learned self-supervision for single-view reconstructions, and their capabilities in combination with strong priors for the physical motion. + +# 5.3. Real Data Single-View Reconstructions + +We show two additional real flow scenarios reconstructed from single viewpoints with our full algorithm in Figure 7. For each case, our method very closely recovers the single input view, as shown in the top row of each case. In addition, the renderings from a new viewpoint in the bottom row highlight the realistic motion as seen from unconstrained viewpoints. Here, our optimization successfully computes over 690 million degrees of freedom, i.e., grid cells, in a coupled fashion for the wispy smoke case. Resolution details are given in Appendix B, while the supplemental video shows these reconstructions in motion. Interestingly, we found it beneficial to re-train the discriminator alongside each new reconstruction. Reusing a pretrained network yields inferior results, which indicates that the discriminator changes over the course of the reconstruction to provide feedback for different aspects of the solution. + +# 6. Discussion and Conclusions + +We have presented a first method to recover an end-to-end motion of a fluid sequence from a single input view. This is achieved with a physical prior in the form of the global transport formulation, a differentiable volumetric renderer and a learned self-supervision for unseen angles. + +Our single-view method comes with the limitation that the learned self-supervision assumes that the flow looks similar to the input view from unseen angles. The discriminator can only make the results look plausible by trans + +![](images/9bf30e1bc60eb3d426ce2d0e788a88659eace508801e380cfdddc914556a6695.jpg) + +![](images/8c4b057190727d444ab6a233284a0a87c413f6cba82a6dc6badc936d8d4bc4c1.jpg) + +![](images/d64783021169bfdf16a031461d68ab40ab150134be60668066113bbb58957ba3.jpg) + +![](images/73fa5e3f3f9f31784e6891639b5067a80972b79d601dcd99dc87eee4b4f26c75.jpg) + +![](images/0223528a42be7e84ae1c73113c17f320083d88b391e327bd76305b561fcc2bf5.jpg) + +![](images/930ed18d1c48ac50085ec0abecf402f8027b5a056e04e763b95a8388972a08d4.jpg) + +![](images/b20a4016bb811ceec8c36192d193ae5c59fde09341f4358da105d63dd18d6f79.jpg) +Figure 7: Additional single-view reconstructions. Top left: input views, top right: reconstruction from input view, bottom: different viewpoint with modified lighting. Our algorithm successfully reconstructs realistic motions for wispy smoke (a), as well as thicker volumes (b). + +![](images/c956562a781d9f429e2d216e89443abc27fe2759466686d05ea7deb629e8e491.jpg) + +ferring the visual style of the given references. Physical correctness is induced by the direct, physical transport constraints. However, fluid flow naturally exhibits self similarity, and the discriminator performs significantly better than re-using the same input for constraints from multiple angles. Dissipation effects are not modeled in our approach, and would thus lead to errors in $\mathcal{L}_{\mathrm{div}}$ or $\mathcal{L}_{A(\rho)}$ . We further do not support objects/obstacles immersed in the flow. Additionally, we rely on positional information about the inflow into the reconstruction domain. Jointly optimizing for inflow position and flow poses an interesting challenge for future work. For our full method we have measured an average reconstruction time of $\sim 30$ minutes per frame using a single GPU, more details are in Appendix A.9. + +In conclusion, our method makes an important step forward in terms of physics- and learning-based reconstruction of natural phenomena. We are especially excited about future connections to generative models and other physical phenomena, such as turbulent flows [73], liquids [64], or even elastic objects[75]. + +# 7. Acknowledgements + +This work was supported by the Siemens/IAS Fellowship Digital Twin, and the ERC Consolidator Grant SpaTe (CoG-2019-863850). + +# References + +[1] Bradley Atcheson, Wolfgang Heidrich, and Ivo Ihrke. An evaluation of optical flow algorithms for background oriented schlieren imaging. *Experiments in Fluids*, 46(3):467-476, Mar 2009. +[2] Bradley Atcheson, Ivo Ihrke, Wolfgang Heidrich, Art Tevs, Derek Bradley, Marcus Magnor, and Hans-Peter Seidel. Time-resolved 3d capture of non-stationary gas flows. ACM Trans. Graph., 27(5), Dec. 2008. +[3] Jesse Belden, Tadd T Truscott, Michael C Axiak, and Alexandra H Techet. Three-dimensional synthetic aperture particle image velocimetry. Measurement Science and Technology, 21(12):125403, 2010. +[4] Yang Chen, Zhou Yang, Yining Hu, Guanyu Yang, Yongcheng Zhu, Yinsheng Li, Wufan Chen, Christine Toumoulin, et al. Thoracic low-dose ct image processing using an artifact suppressed large-scale nonlocal means. Physics in Medicine & Biology, 57(9):2667, 2012. +[5] Blender Online Community. *Blender - a 3D modelling and rendering package*. Blender Foundation, Blender Institute, Amsterdam, 2020. +[6] S.B. Dalziel, G.O. Hughes, and B.R. Sutherland. WholeField Density Measurements by 'Synthetic Schlieren'. Experiments in Fluids, 28:322-335, 2000. +[7] Filipe de Avila Belbute-Peres, Kevin Smith, Kelsey Allen, Josh Tenenbaum, and J Zico Kolter. End-to-end differentiable physics for learning and control. In Advances in neural information processing systems, 2018. +[8] M.-L. Eckert, W. Heidrich, and N. Thuerey. Coupled Fluid Density and Motion from Single Views. Computer Graphics Forum, 37(8):47-58, 2018. +[9] Marie-Lena Eckert, Kiwon Um, and Nils Thuerey. ScalarFlow: A large-scale volumetric data set of real-world scalar transport flows for computer animation and machine learning. ACM Transactions on Graphics (TOG), 38(6):1-16, 2019. +[10] Alexei A Efros and William T Freeman. Image quilting for texture synthesis and transfer. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pages 341-346, 2001. +[11] Gerrit E Elsinga, Fulvio Scarano, Bernhard Wieneke, and Bas W van Oudheusden. Tomographic particle image velocimetry. *Experiments in fluids*, 41(6):933-947, 2006. +[12] Gerrit E Elsinga, Fulvio Scarano, Bernhard Wieneke, and Bas W van Oudheusden. Tomographic particle image velocimetry. *Experiments in fluids*, 41(6):933-947, 2006. +[13] Klaus Engel, Markus Hadwiger, Joe M Kniss, Aaron E Lefohn, Christof Rezk Salama, and Daniel Weiskopf. Realtime volume graphics. In ACM Siggraph 2004 Course Notes, pages 29-es. 2004. +[14] Timothy W Fahringer, Kyle P Lynch, and Brian S Thurow. Volumetric particle image velocimetry with a single plenoptic camera. Measurement Science and Technology, 26(11):115201, 2015. +[15] Ronald Fedkiw, Jos Stam, and Henrik Wann Jensen. Visual simulation of smoke. In Eugene Fiume, editor, Proceedings + +of SIGGRAPH 2001, Computer Graphics Proceedings, Annual Conference Series, pages 15-22. ACM, ACM Press / ACM SIGGRAPH, 2001. +[16] Christian Fuchs, Tongbo Chen, Michael Goesele, Holger Theisel, and Hans-Peter Seidel. Density estimation for dynamic volumes. Computers & Graphics, 31(2):205-211, 2007. +[17] Ioannis Gkioulekas, Anat Levin, and Todd Zickler. An evaluation of computational imaging techniques for heterogeneous inverse scattering. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, Computer Vision – ECCV 2016, pages 685–701, Cham, 2016. Springer International Publishing. +[18] E. Goldhahn and J. Seume. The Background Oriented Schlieren Technique: Sensitivity, Accuracy, Resolution and Application to a Three-Dimensional Density Field. Experiments in Fluids, 43(2-3):241-249, 2007. +[19] Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. stat, 1050:10, 2014. +[20] I. Grant. Particle Image Velocimetry: a Review. Proceedings of the Institution of Mechanical Engineers, 211(1):55-76, 1997. +[21] James Gregson, Ivo Ihrke, Nils Thuerey, and Wolfgang Heidrich. From capture to simulation: connecting forward and inverse problems in fluids. ACM Trans. Graph., 33(4):139, 2014. +[22] James Gregson, Michael Krimerman, Matthias B Hullin, and Wolfgang Heidrich. Stochastic tomography and its applications in 3d imaging of mixing fluids. ACM Trans. Graph., 31(4):52-1, 2012. +[23] Jinwei Gu, S.K. Nayar, E. Grinspun, P.N. Belhumeur, and R. Ramamoorthi. Compressive Structured Light for Recovering Inhomogeneous Participating Media. IEEE Trans. Pattern Analysis and Mach. Int., 35(3):555-567, 2013. +[24] Tim Hawkins, Per Einarsson, and Paul Debevec. Acquisition of time-varying participating media. ACM Trans. Graph., 24(3):812-815, 2005. +[25] Philipp Henzler, Niloy J. Mitra, and Tobias Ritschel. Escaping Plato's Cave: 3D Shape From Adversarial Rendering. In Proceedings of the IEEE International Conference on Computer Vision, pages 9984-9993, 2019. +[26] Philipp Henzler, Volker Rasche, Timo Ropinski, and Tobias Ritschel. Single-image Tomography: 3D Volumes from 2D Cranial X-Rays. Computer Graphics Forum, 37(2):377-388, 2018. +[27] 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. +[28] Philipp Holl, Nils Thuerey, and Vladlen Koltun. Learning to Control PDEs with Differentiable Physics. In International Conference on Learning Representations, 2020. +[29] Yuanming Hu, Luke Anderson, Tzu-Mao Li, Qi Sun, Nathan Carr, Jonathan Ragan-Kelley, and Fredo Durand. Differen + +tiable programming for physical simulation. In International Conference on Learning Representations, 2020. +[30] Ivo Ihrke and Marcus Magnor. Image-based tomographic reconstruction of flames. In ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pages 365-373. Eurographics Association, 2004. +[31] Amirul Islam, Sen Jia, and D. B. Neil Bruce. How much position information do convolutional neural networks encode. International Conference on Learning Representations, 2020. +[32] Omar Javed, Khurram Shafique, and Mubarak Shah. Appearance modeling for tracking in multiple non-overlapping cameras. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05), volume 2, pages 26-33. IEEE, 2005. +[33] Yu Ji, Jinwei Ye, and Jingyi Yu. Reconstructing gas flows using light-path approximation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2013. +[34] Alexia Jolicoeur-Martineau. The relativistic discriminator: A key element missing from standard GAN. In International Conference on Learning Representations, 2018. +[35] Angjoo Kanazawa, Shubham Tulsiani, Alexei A. Efros, and Jitendra Malik. Learning Category-Specific Mesh Reconstruction from Image Collections. In Proceedings of the European Conference on Computer Vision (ECCV), pages 371-386, 2018. +[36] 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, pages 4401-4410, 2019. +[37] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3D Mesh Renderer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3907-3916, 2018. +[38] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. +[39] Byungsoo Kim, Vinicius C. Azevedo, Markus Gross, and Barbara Solenthaler. Transport-based neural style transfer for smoke simulations. ACM Transactions on Graphics, 38(6):1-11, nov 2019. +[40] Byungsoo Kim, Vinicius C. Azevedo, Markus Gross, and Barbara Solenthaler. Lagrangian neural style transfer for fluids. ACM Transactions on Graphics, 39(4), July 2020. +[41] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015. +[42] Anestis Koutsoudis, Blaz Vidmar, George Ioannakis, Fotis Arnaoutoglou, George Pavlidis, and Christodoulos Chamzas. Multi-image 3d reconstruction data evaluation. Journal of Cultural Heritage, 15(1):73-79, 2014. +[43] Aviad Levis, Yoav Y. Schechner, Amit Aides, and Anthony B. Davis. Airborne three-dimensional cloud tomography. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), December 2015. + +[44] Tzu-Mao Li, Miika Aittala, Frédo Durand, and Jaakko Lehtinen. Differentiable monte carlo ray tracing through edge sampling. ACM Trans. Graph. (Proc. SIGGRAPH Asia), 37(6):222:1-222:11, 2018. +[45] Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural Volumes: Learning Dynamic Rendering Volumes from Images. ACM Transactions on Graphics, 38(4):1-14, 2019. +[46] Matthew M. Loper and Michael J. Black. OpenDR: An approximate differentiable renderer. In Computer Vision – ECCV 2014, volume 8695 of Lecture Notes in Computer Science, pages 154–169, Sept. 2014. +[47] MantaFlow, 2018. http://mantaflow.com. +[48] Antoine McNamara, Adrien Treuille, Zoran Popovic, and Jos Stam. Fluid control using the adjoint method. ACM Trans. Graph., 23(3):449-456, Aug. 2004. +[49] Enric Meinhardt-Llopis, Javier Sánchez Pérez, and Daniel Kondermann. Horn-schunck optical flow with a multi-scale strategy. Image Processing on line, 2013:151-172, 2013. +[50] 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. +[51] 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. +[52] Gyeongsik Moon, Ju Yong Chang, and Kyoung Mu Lee. V2v-posenet: Voxel-to-voxel prediction network for accurate 3d hand and human pose estimation from a single depth map. In Proceedings of the IEEE conference on computer vision and pattern Recognition, pages 5079-5088, 2018. +[53] Nigel JW Morris and Kiriakos N Kutulakos. Dynamic refraction stereo. IEEE transactions on pattern analysis and machine intelligence, 33(8):1518-1531, 2011. +[54] Przemyslaw Musialski, Peter Wonka, Daniel G Aliaga, Michael Wimmer, Luc Van Gool, and Werner Purgathofer. A survey of urban reconstruction. In Computer graphics for rum, volume 32(6), pages 146-177. Wiley Online Library, 2013. +[55] Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Occupancy flow: 4d reconstruction by learning particle dynamics. In Proceedings of the IEEE International Conference on Computer Vision, pages 5379-5389, 2019. +[56] Merlin Nimier-David, Delio Vicini, Tizian Zeltner, and Wenzel Jakob. Mitsuba 2: A retargetable forward and inverse renderer. Transactions on Graphics (Proceedings of SIGGRAPH Asia), 38(6), Dec. 2019. +[57] Makoto Okabe, Yoshinori Dobashi, Ken Anjyo, and Rikio Onai. Fluid volume modeling from sparse multi-view images by appearance transfer. ACM Transactions on Graphics, 34(4):1-10, 2015. +[58] Jeremie Papon, Alexey Abramov, Markus Schoeler, and Florentin Worgotter. Voxel cloud connectivity segmentation-supervoxels for point clouds. In Proceedings of the IEEE + +conference on computer vision and pattern recognition, pages 2027-2034, 2013. +[59] Charles S Peskin. Flow patterns around heart valves: a numerical method. Journal of computational physics, 10(2):252-271, 1972. +[60] Stephen B Pope. Turbulent flows, 2001. +[61] Yiming Qian, Minglun Gong, and Yee-Hong Yang. Stereobased 3d reconstruction of dynamic fluid surfaces by global optimization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1269-1278, 2017. +[62] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. Proc. ICLR, 2016. +[63] Connor Schenck and Dieter Fox. Spnets: Differentiable fluid dynamics for deep neural networks. In Conference on Robot Learning, volume 87 of Proceedings of Machine Learning Research, 2018. +[64] Connor Schenck and Dieter Fox. Spnets: Differentiable fluid dynamics for deep neural networks. In Conference on Robot Learning, pages 317-335, 2018. +[65] Andrew Selle, Ronald Fedkiw, ByungMoon Kim, Yingjie Liu, and Jarek Rossignac. An Unconditionally Stable MacCormack Method. Journal of Scientific Computing, 35(2):350-371, 2008. +[66] Tiancheng Shen, Xia Li, Zhisheng Zhong, Jianlong Wu, and Zhouchen Lin. R-net: Recurrent and recursive network for sparse-view ct artifacts removal. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 319-327. Springer, 2019. +[67] M Shur, PR Spalart, M Strelets, and A Travin. Detached-eddy simulation of an airfoil at high angle of attack. In Engineering turbulence modelling and experiments 4, pages 669-678. Elsevier, 1999. +[68] Emil Y Sidky and Xiaochuan Pan. Image reconstruction in circular cone-beam computed tomography by constrained, total-variation minimization. Physics in Medicine & Biology, 53(17):4777, 2008. +[69] 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. +[70] 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. +[71] Ayush Tewari, Ohad Fried, Justus Thies, Vincent Sitzmann, Stephen Lombardi, Kalyan Sunkavalli, Ricardo Martin-Brualla, Tomas Simon, Jason Saragih, Matthias Nießner, Rohit Pandey, Sean Fanello, Gordon Wetzstein, Jun-Yan Zhu, Christian Theobalt, Maneesh Agrawala, Eli Shechtman, Dan B Goldman, and Michael Zollhöfer. State of the art on neural rendering, 2020. +[72] Simron Thapa, Nianyi Li, and Jinwei Ye. Dynamic fluid surface reconstruction using deep neural network. In Proceed- + +ings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 21-30, 2020. +[73] Kiwon Um, Robert Brand, Philipp Holl, and Nils Fei, Raymond Thuerey. Solver-in-the-loop: Learning from differentiable physics to interact with iterative pde-solvers. Advances in Neural Information Processing Systems, 2020. +[74] 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. +[75] Sebastian Weiss, Robert Maier, Daniel Cremers, Rudiger Westermann, and Nils Thuerey. Correspondence-free material reconstruction using sparse surface constraints. pages 4686-4695, 2020. +[76] You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A temporally coherent, volumetric GAN for superresolution fluid flow. ACM Transactions on Graphics, 37(4):95:1-95:15, 2018. +[77] Jinhui Xiong, Ramzi Idoughi, Andres A Aguirre-Pablo, Abdulrahman B Aljedaani, Xiong Dun, Qiang Fu, Sigurdur T Thoroddsen, and Wolfgang Heidrich. Rainbow particle imaging velocimetry for dense 3d fluid velocity imaging. ACM Trans. Graph., 36(4):36, 2017. +[78] Guangming Zang, Ramzi Idoughi, Ran Tao, Gilles Lubineau, Peter Wonka, and Wolfgang Heidrich. Space-time tomography for continuously deforming objects. ACM Trans. Graph., 37(4), July 2018. +[79] Guangming Zang, Ramzi Idoughi, Congli Wang, Anthony Bennett, Jianguo Du, Scott Skeen, William L. Roberts, Peter Wonka, and Wolfgang Heidrich. TomoFluid: Reconstructing Dynamic Fluid from Sparse View Videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. IEEE, 2020. +[80] 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. +[81] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223-2232, 2017. \ No newline at end of file diff --git a/globaltransportforfluidreconstructionwithlearnedselfsupervision/images.zip b/globaltransportforfluidreconstructionwithlearnedselfsupervision/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..18242bfa61e6d6b6fabc162ca065ed7b7510989d --- /dev/null +++ b/globaltransportforfluidreconstructionwithlearnedselfsupervision/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ea4fdf9015556923d6a15c0258f46e0eb5d049535036c5465c20a5214ce9cd8 +size 389765 diff --git a/globaltransportforfluidreconstructionwithlearnedselfsupervision/layout.json b/globaltransportforfluidreconstructionwithlearnedselfsupervision/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2d0c58ff6950b17f95c92f7e77ba280c91238362 --- /dev/null +++ b/globaltransportforfluidreconstructionwithlearnedselfsupervision/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71514b28f6bed6c1ddc9ae57267d9d4b7d0bdc24934370928a61d591cae3790d +size 495696 diff --git a/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_content_list.json b/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..174bef76fd97ca4059b8de9ae468f9a33c16c2fa --- /dev/null +++ b/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b4045c45c857c8daf92642a84da7f5e56e421f5531a0077911035f60eb780c1 +size 74445 diff --git a/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_model.json b/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a2aaeb01104a20c331569f0bc168283968d8d04f --- /dev/null +++ b/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4d8e64c9be9e616dc43c70ca0cdd4f9603eebc23b0ab2065e661e38d913e608 +size 95597 diff --git a/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_origin.pdf b/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4ebf2e9d9dcbc9ce0a56e0482d336505bdeb0884 --- /dev/null +++ b/goalorientedgazeestimationforzeroshotlearning/0d4bd236-1f19-4468-a172-1a43faf6c411_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4487157c4fcc046dd47b44ca2f8a7409229204d4f91d59af6bcbf42fffd4b382 +size 2507100 diff --git a/goalorientedgazeestimationforzeroshotlearning/full.md b/goalorientedgazeestimationforzeroshotlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e919cdd2c6eeb3b3280763cc58527d72c3b4b77c --- /dev/null +++ b/goalorientedgazeestimationforzeroshotlearning/full.md @@ -0,0 +1,297 @@ +# Goal-Oriented Gaze Estimation for Zero-Shot Learning + +Yang Liu\*, Lei Zhou\*,1, Xiao Bai†,1, Yifei Huang2, Lin Gu3,2, Jun Zhou4, Tatsuya Harada2,3 + $^{1}$ School of Computer Science and Engineering, State Key Laboratory of Software Development Environment, Jiangxi Research Institute, Beihang University, Beijing, China, $^{2}$ The University of Tokyo, $^{3}$ RIKEN AIP, Tokyo, Japan, $^{4}$ Griffith University, Australia + +# Abstract + +Zero-shot learning (ZSL) aims to recognize novel classes by transferring semantic knowledge from seen classes to unseen classes. Since semantic knowledge is built on attributes shared between different classes, which are highly local, strong prior for localization of object attribute is beneficial for visual-semantic embedding. Interestingly, when recognizing unseen images, human would also automatically gaze at regions with certain semantic clue. Therefore, we introduce a novel goal-oriented gaze estimation module (GEM) to improve the discriminative attribute localization based on the class-level attributes for ZSL. We aim to predict the actual human gaze location to get the visual attention regions for recognizing a novel object guided by attribute description. Specifically, the task-dependent attention is learned with the goal-oriented GEM, and the global image features are simultaneously optimized with the regression of local attribute features. Experiments on three ZSL benchmarks, i.e., CUB, SUN and AWA2, show the superiority or competitiveness of our proposed method against the state-of-the-art ZSL methods. The ablation analysis on real gaze data CUB-VWSW also validates the benefits and accuracy of our gaze estimation module. This work implies the promising benefits of collecting human gaze dataset and automatic gaze estimation algorithms on high-level computer vision tasks. The code is available at https://github.com/osierboy/GEM-ZSL. + +# 1. Introduction + +With prior knowledge on seen classes, humans have a remarkable ability to recognize novel classes using shared and distinct attributes of both seen and unseen classes. Inspired by this cognitive competence, zero-shot learning (ZSL) was proposed as a challenging image classification setting to mimic the human cognitive process [32]. Given the seman + +tic descriptions of both seen and unseen classes but only the training images of seen classes, ZSL aims to classify test images of unseen classes. + +Based on the classes that a model sees in the test phase, ZSL can be categorized into conventional or generalized setting. In conventional ZSL, the test images belong only to unseen classes. For the more practical and challenging generalized ZSL (GZSL) setting, the test images may belong to both seen and unseen classes. The semantic descriptions (attributes) are shared information between seen and unseen classes, which ensure the knowledge transferring. Early works [3, 4, 14, 40, 45] on ZSL build embedding between seen classes and their attributes. Then unseen classes are classified by the nearest neighbor search in the embedding space. These embedding based methods usually have a large bias towards seen classes under the GZSL setting, since the embedding is learned only by seen classes samples. To solve this problem, by leveraging the generative models [17, 30, 29], many feature generation approaches [31, 57, 62, 46, 47, 37] have been proposed to generate unseen classes, than convert ZSL into a conventional classification problem. + +Most of the existing embedding or feature generation based methods extract global features from pre-trained or end-to-end trainable models. However, only the global image features cannot effectively represent the fine-grained information between seen and unseen images, which is important for ZSL. More recently, attention based end-to-end models [59, 68, 67, 60] have tried to exploit the semantic vector as guidance to learn more discriminative part features. However, they simply learn regions embedding of different attribute features but neglect the importance of discriminative attribute localization [50, 61]. + +Very interestingly, when facing an unseen object with the guidance of an attribute description, humans are capable of paying attention to parts of the object with discriminative attributes, which is the gaze behavior. Karessli et al. [27] proved that gaze data is useful in ZSL since they provide an effective prior that can naturally capture the localized discriminative attribute. Inspired by the human gaze mech- + +![](images/5bc5b857adea61e96bab05453303a50734515e37483be0a6a4832ae4fe643bd2.jpg) +Figure 1. Illustration of the proposed method. Our GEM-ZSL is an end-to-end trainable model with two main parts, a gaze estimation module and a plain ZSL backbone. For the gaze estimation module, the projected word vector of each attribute by Word Encoder is first utilized as query to guide the localized attribute learning. The ground truth attributes $\varphi(y)$ of specific seen class are simultaneously used as supervision in the Attribute Localization module. Then, an Attention Transition module is utilized to calibrate the attention regions by real gaze data with a designed gaze loss. Finally, the plain ZSL backbone learns the global image feature which is jointly optimized with the localized attribute, and the backbone accomplishes zero-shot recognition in a Cosine Metric Space. + +anism, we propose a novel goal-oriented Gaze Estimation Method for Zero-Shot Learning (GEM-ZSL). As shown in Figure 1, we first design an attribute description-oriented gaze estimation module (GEM) to learn different attribute regions. The GEM consists of three sub-modules, attention module (AM), attention transition (AT) module and attribute localization (AL) module. The AM is based on bilinear pooling which is widely used in the visual question answering task [15, 64]. We use the projected word vector of attributes as query to guide the learning process for the localization of the discriminative attribute. The ground truth attributes of specific seen class are simultaneously used as supervision by the mean squared error (MSE) of the AL module. Then an AT module is utilized to calibrate the attention regions by real gaze data (if available) with a designed gaze loss. In this way, we can learn the part feature with localized discriminative attribute that humans subconsciously pay attention to. Finally, the joint global features learned by an image encoder (IE), the local features and the class semantic embedding are used to learn a cosine metric space, which helps to reduce the intra-class variance and improve the recognition of unseen classes when compared to dot product similarity. + +The contribution of this paper can be summarized as follows: (1) We propose a novel goal-oriented gaze estimation method to mimic the human cognitive process for recogni-zing unseen classes. With the guidance of attribute description, the proposed method can predict the human gaze that can be transformed to attribute attention for zero-shot recognition. (2) We demonstrate the effectiveness of our + +method for improving the localization of discriminative attributes, which further enhances the discrimination of the global features for ZSL task. (3) Comprehensive experiments over three ZSL benchmarks, i.e., CUB, AWA2 and SUN, show that our method can achieve superior or competitive performance compared with the state-of-the-art ZSL methods. In addition, the quantitative and qualitative results on gaze estimation experiment also validate the effectiveness of our GEM. + +# 2. Related Works + +# 2.1. Early ZSL + +Early ZSL methods [3, 14, 45, 4, 55, 58, 65] focus on learning a mapping between visual and semantic spaces to transfer semantic knowledge from seen classes to unseen classes. However, these methods usually achieve relatively unsatisfied results, since they adopt global features or exploit shallow models. In more recent, end-to-end deep models [40, 35, 48, 36] achieve better performance. These methods constrain loss on the attributes of seen classes to allow learning of more discriminative global features. However, they neglect to focus on the parts of features which are intrinsically discriminative for ZSL. + +# 2.2. Part-based ZSL + +More relevant to this work is the recently part-based ZSL methods [24, 59, 68, 60, 61] that utilize attribute descriptions as guidance to learn discriminative part features. These methods have achieved remarkable improvements on + +ZSL. In order to improve the GZSL, APN [61] applies calibrated stacking (CS) [9] in test phase to reduce the seen class scores by a constant factor, which can significantly improve the GZSL performance. RGEN [60] designs a balance loss by pursuing the maximum response consistency among seen and unseen outputs in the training phase, which requires the attributes of unseen classes during training. Compared with these methods, our GEM-ZSL improves the localization of discriminative attributes by goal-oriented gaze estimation for the first time. In addition, only the attributes of seen classes are used in the model training. + +# 2.3. Gaze Estimation + +Since human gaze directly represents attention and thus the important spatial regions, many works try to estimate where humans will look given an image. Earlier works [19, 1, 11, 2] try to model saliency in the images that are likely to attract human attention. These methods typically use feature integration theory [51] to fuse various bottom-up cues. More recently researchers begin to use deep learning models for the estimation of human gaze [26, 41, 53]. However, these models only consider the bottom-up information which is not suitable for ZSL since they cannot focus on the fine-grained discriminative regions. Some newly proposed methods [22, 21] leverage top-down task-specific cues for estimating human gaze. However these methods are typically designed for some specific tasks and need large amount of training data. In this work, to solve the ZSL task, we exploit the attribute description as guidance to design a novel goal-oriented gaze estimation module. + +# 3. The Proposed Method + +In this section, we first define the problem setting, notations and then present the details of each module of our method. + +# 3.1. Problem Setting and Notations + +ZSL aims to recognize novel classes by transferring semantic knowledge from seen classes $(\mathcal{Y}^S)$ to unseen classes $(\mathcal{Y}^U)$ . The image spaces of seen and unseen classes can be defined as $\mathcal{X} = \mathcal{X}^S \cup \mathcal{X}^U$ . $\mathcal{S} = \{(\mathbf{x}, y, \varphi(y)) | \mathbf{x} \in \mathcal{X}^S, y \in \mathcal{Y}^S, \varphi(y) \in \phi^S\}$ denotes the training set, where $\mathbf{x}$ is an image in $\mathcal{X}^S$ , $y$ is its class label which is available during training, and $\varphi(y) \in \mathbb{R}^K$ is the class semantic embedding, i.e., a class-level attribute vector annotated with $K$ different visual attributes. The unseen testing set is $\mathcal{U} = \{(\mathbf{x}^u, u, \varphi(u)) | \mathbf{x}^u \in \mathcal{X}^U, u \in \mathcal{Y}^U, \varphi(u) \in \phi^U\}$ , where $u$ denote unseen class labels. The seen classes and unseen classes are disjoint, i.e., $\mathcal{Y}^S \cap \mathcal{Y}^U = \emptyset$ . Here, $\phi = \phi^S \cup \phi^U$ is used to transfer information between seen and unseen classes. In the conventional ZSL, the task is to predict the label of images from unseen classes, i.e., $\mathcal{X}^U \to \mathcal{Y}^U$ . However, in more realistic and challenging + +setup of GZSL, the aim is to predict images from both seen and unseen classes, i.e., $\mathcal{X}\to \mathcal{Y}^U\cup \mathcal{Y}^S$ + +As shown in Figure 1, our end-to-end trained model consists of two parts, Gaze Estimation Module (GEM) and a plain ZSL backbone. Specifically, GEM consists of Word Encoder (WE) module, Attention Module (AM), Attribute Localization (AL) module and Attention Transition (AT) module. The plain ZSL backbone is an Image Encoder (IE) with a Cosine Metric Space for the nearest neighbor search. Firstly, IE is used to extract the global feature of the image. Then, GEM learns the part feature with localized discriminative attribute that humans subconsciously pay attention to. Finally, the joint global and local feature and the class semantic embedding are used to learn a cosine metric space. + +# 3.2. Cosine Metric Learning + +Visual feature extraction. We leverage the Image Encoder (IE) implemented by a convolutional neural network to map the seen class image $\mathbf{x}$ into a feature representation $f(\mathbf{x})\in \mathbb{R}^{H\times W\times C}$ , where $H$ , $W$ and $C$ are the height, width and channel of the feature, respectively. Then, global average pooling is applied over the $H$ and $W$ to learn a global discriminative feature $h(\mathbf{x})\in \mathbb{R}^C$ . + +Cosine similarity for classification. We use a linear layer $\mathbf{V} \in \mathbb{R}^{C \times K}$ to map the visual feature $h(\mathbf{x})$ into the semantic space. Different from previous work that [61] uses dot product to compute class logits of the projected visual feature and every class embedding, we consider the cosine similarity [16, 38] that can bound and reduce the variance of the neurons and thus result in models with better generalization capability [33]. The output of the cosine metric is scaled similarity score of the projected visual feature $h(\mathbf{x})$ and $y$ -th class semantic embedding $\varphi(y)$ . Then we define our classification score function as + +$$ +p (y | \mathbf {x}) = \frac {\exp (\sigma \cos \left(h (\mathbf {x}) ^ {T} \mathbf {V} , \varphi (y)\right))}{\sum_ {\hat {y} \in \mathcal {Y} ^ {S}} \exp (\sigma \cos \left(h (\mathbf {x}) ^ {T} \mathbf {V}, \varphi (\hat {y})\right))} \tag {1} +$$ + +where $\sigma$ is the scaling factor. The classification loss $L_{CLS}$ is defined as + +$$ +\mathcal {L} _ {C L S} = - \log \frac {\exp (\sigma \cos (h (\mathbf {x}) ^ {T} \mathbf {V} , \varphi (y)))}{\sum_ {\hat {y} \in \mathcal {Y} ^ {S}} \exp (\sigma \cos (h (\mathbf {x}) ^ {T} \mathbf {V} , \varphi (\hat {y})))} (2) +$$ + +We find empirically that using the image feature and class semantic embedding normalization in the cosine similarity helps to reduce the intra-class variance and improve the accuracy of unseen classes when compared to dot product similarity. + +# 3.3. Gaze Estimation Module + +Although cosine similarity shows better performance than the dot product similarity, the global features learned from cosine-based image encoder may still be biased to seen + +![](images/94b13030a0443ef09c75b7458058fdc4abd652708b3533574699f655ab7e0298.jpg) +Figure 2. The structure of attention module and attention transition module. It is based on the bilinear pooling mechanism. The feature map (key) and word vector (query) are shown as the shape of their tensor, i.e. $H \times W \times C$ for key and $K \times C$ for query. $\otimes$ denotes matrix multiplication. The softmax operation is performed on each row. + +classes and weaken the discriminative attributes information. We propose a gaze estimation module (GEM) to learn the part feature with localized discriminative attribute that humans subconsciously pay attention to. + +Word encoder. To learn local features, the attribute semantic vectors $\mathbf{e} = \{\mathbf{e}_k\}_{k=1}^K$ are utilized to guide the learning of the localized discriminative attribute, where $\mathbf{e}_k$ denotes the average GloVe [43] representations of words in the $k$ -th attribute, e.g., "brown eye" and "plain head". Then, a single hidden layer MLP is used to convert the attribute word vector $\mathbf{e}$ into visual attribute feature $E(\mathbf{e}) \in \mathbb{R}^{K \times C}$ . + +Attention module. To acquire part features with localized discriminative attribute, we design an attribute descriptions-oriented attention module to learn the different attribute regions. As shown in Figure 2, AM is based on bilinear pooling mechanism which is widely used in the visual question answering task [15, 64]. We use the projected word vector of attributes $E(\mathbf{e})$ as a query to guide learning localized discriminative attribute. The inputs of AM are query $E(\mathbf{e}) \in \mathbb{R}^{K \times C}$ and key $f(\mathbf{x}) \in \mathbb{R}^{H \times W \times C}$ . Firstly, AM reshapes the dimension of key into $HW \times C$ and transposes it into $C \times HW$ . Then, AM performs matrix multiplication and softmax operation on query and key. The $k$ -th attribute query captures related attribute part of image and produces $A(\mathbf{x})^k$ that contains the $k$ -th localized attribute information. After transposing and reshaping the feature, the attribute feature map $A(\mathbf{x}) \in \mathbb{R}^{H \times W \times K}$ is acquired. The localized discriminative attribute is expected to concentrate to a peak region rather than disperses on other locations. We use Dis- + +![](images/7a94bd8626543a272644ed5e9cb78cf07e44e6e13c2871be9079790006a90a4b.jpg) +Figure 3. The predicted gaze map $g(\mathbf{x})$ and human gaze $G(\mathbf{x})$ matching method. We utilize the Hungarian algorithm which calculates the $l1$ distance between $g(\mathbf{x})$ and $G(\mathbf{x})$ , and matches them one-to-one. + +tance loss [66] on each attention map $A(\mathbf{x})^k$ to constrain the discriminative attribute localization, such that + +$$ +\mathcal {L} _ {D i s} = \sum_ {k = 1} ^ {K} \sum_ {i = 1} ^ {H} \sum_ {j = 1} ^ {W} A (\mathbf {x}) _ {i, j} ^ {k} \left(\left\| i - \tilde {i} \right\| ^ {2} + \left\| j - \tilde {j} \right\| ^ {2}\right) \tag {3} +$$ + +where $(\tilde{i},\tilde{j}) = \arg \max_{i,j}A(\mathbf{x})^k$ denotes the coordinate for the maximum value in $A(\mathbf{x})^k$ . We can learn a more concentrated attention map by this objective function. + +Attribute localization. We predict the location of the attributes response value $a(\mathbf{x})$ by global max pooling over the $H$ and $W$ on $A(\mathbf{x})$ . Then $a(\mathbf{x})$ is optimized by the Mean Square Error (MSE) with the supervision of the ground truth attributes $\varphi(y)$ + +$$ +\mathcal {L} _ {M S E} = \left\| a (\mathbf {x}) - \varphi (y) \right\| _ {2} ^ {2} \tag {4} +$$ + +where $y$ is the ground truth class. We make the local features correspond to discriminative attributes by minimizing the MSE loss, which improves the discriminative attribute localization. + +Attention transition. To acquire the part feature with discriminative attribute of human gaze, we propose an AT module to convert attribute feature map $A(\mathbf{x}) \in \mathbb{R}^{H \times W \times K}$ to gaze map $g(\mathbf{x}) \in \mathbb{R}^{H \times W \times D}$ , where $D$ represents the number of gaze heatmaps. We have true human gaze $G(\mathbf{x}) \in \mathbb{R}^{H \times W \times D}$ of image $\mathbf{x}$ to enable supervised learning. The AT is implemented by a learnable $1 \times 1$ convolution operation and a sigmoid function, which fuses different attributes information and converts them into a region of human attention. To optimize the gaze map that incorporates the discriminative attribute regions, we propose a new gaze loss. + +Firstly, we use the Hungarian algorithm (Figure 3) to match $G(\mathbf{x})$ and $g(\mathbf{x})$ , where the matched gaze map and its ground truth are termed $\tilde{g}(\mathbf{x})$ and $\tilde{G}(\mathbf{x})$ , respectively. Then we use a binary cross-entropy loss across all the pixels as + +$$ +\begin{array}{l} \mathcal {L} _ {G a z e} = - \frac {1}{D \times H \times W} \sum_ {d = 1} ^ {D} \sum_ {i = 1} ^ {H} \sum_ {j = 1} ^ {W} \left\{\tilde {G} (\mathbf {x}) _ {i, j} ^ {d} \log \left(\tilde {g} (\mathbf {x}) _ {i, j} ^ {d}\right) \right. \\ \left. + (1 - \tilde {G} (\mathbf {x}) _ {i, j} ^ {d}) \log (1 - \tilde {g} (\mathbf {x}) _ {i, j} ^ {d}) \right\} \tag {5} \\ \end{array} +$$ + +Our full model optimizes the CNN backbone and the overall loss of the proposed model is defined as + +$$ +\mathcal {L} = \mathcal {L} _ {C L S} + \lambda_ {1} \mathcal {L} _ {D i s} + \lambda_ {2} \mathcal {L} _ {M S E} + \lambda_ {3} \mathcal {L} _ {G a z e} \tag {6} +$$ + +where $\lambda_{1},\lambda 2$ and $\lambda_3$ are hyper-parameters for Distance loss, Mean Square Error loss and Gaze loss, respectively. Particularly, $\lambda_3 = 0$ when gaze ground truth is not available. The joint training improves the representation of the discriminative attribute that is critical for zero-shot generalization. + +# 3.4. Zero-Shot Recognition + +After training of the full model, we use the learned cosine metric space for zero-shot recognition. The test image $\mathbf{x}$ is embedded to the cosine metric space by the visual-semantic embedding layer, and then the classifier searches for the class embedding $\varphi(\hat{u})$ with the highest compatibility via + +$$ +\hat {u} = \underset {u \in \mathcal {Y} ^ {U}} {\arg \max } \cos (h (\mathbf {x}) ^ {T} \mathbf {V}, \varphi (u)) \tag {7} +$$ + +For the GZSL setting, the test images may belong to both seen and unseen classes. Since there are only seen classes during training phase, the predicted results of GZSL will have a large bias towards seen classes [9]. To mitigate this problem, we apply calibrated stacking (CS) [9] to reduce the seen class scores by a calibration factor $\gamma$ . Specifically, the GZSL classifier is defined as + +$$ +\hat {y} = \underset {\tilde {y} \in \mathcal {Y} ^ {U} \cup \mathcal {Y} ^ {S}} {\arg \max } (\sigma \cos (h (\mathbf {x}) ^ {T} \mathbf {V}, \varphi (\tilde {y})) - \gamma \mathbb {I} [ \tilde {y} \in \mathcal {Y} ^ {S} ]) \tag {8} +$$ + +where $\mathbb{I} = 1$ if $\tilde{y}$ is a seen class and 0 otherwise. + +# 3.5. Implementation Details + +The proposed GEM-ZSL is an end-to-end trainable model. The Image Encoder is ResNet101 [20] pretrained on ImageNet [12]. The SGD [7] optimizer is adopted in the model training. The momentum is set to 0.9, and the weight decay is $10^{-5}$ . The learning rate is $10^{-3}$ . We set $\lambda_{1}$ to 0.2 and $\lambda_{2}$ to 1.0. When we have gaze attention, $\lambda_{3}$ is set to 0.1. The factor $\gamma$ is set to 3.5 for AWA2 and 0.7 for CUB and SUN. We use an episode-based training method to sample $M$ categories and $N$ images for each category in a minibatch, we iterate 300 batches for each epoch, and train the model 20 epochs. We set $M = 16$ and $N = 2$ for all three datasets. + +# 4. Experiments + +We evaluated our framework on three widely used zero-shot learning benchmark datasets, including CUB-200-2011 (CUB) [54], SUN attribute (SUN) [42] and Animals with Attributes 2 (AWA2) [56]. The pre-defined attributes on each dataset were used as the semantic descriptors. Moreover, we adopted the Proposed Split (PS) [56] to divide all classes into seen and unseen classes on each dataset. + +The performance of ZSL is evaluated by average per-class Top-1 (T1) accuracy. In GZSL, since the test set is composed of seen and unseen images, the Top-1 accuracy evaluated respectively on seen classes, denoted as S, and unseen classes, denoted as U. Their harmonic mean, defined as $\mathbf{H} = (2\times \mathbf{S}\times \mathbf{U}) / (\mathbf{S} + \mathbf{U})$ [56], are used to evaluate the performance of GZSL. + +# 4.1. Comparison with the State-of-the-Art + +We selected recent state-of-the-art ZSL methods for comparison, which include methods without end-to-end training such as PSR [5], RN [49], SP-AEN [10], IIR [8], TCN [25], E-PGN [63], DAZLE [23], f-CLSWGAN [57], cycle-CLSWGAN [13], CADA-VAE [46], OCD-CVAE [28], RFF-GZSL [18], IZF [47], and LsrGAN [52], where the last seven methods are feature generation based models, and end-to-end methods QFSL [48], LDF [34], SGMA [68], AREN [59], LF-GAA [36], DVBE [39], RGEN [60], and APN [61]. + +Table 1 shows the results of different methods on three datasets. Our GEM-ZSL achieves competitive performance compared with the state-of-the-art methods. On CUB dataset, GEM-ZSL outperforms all the compared methods with a large margin for both ZSL and GZSL. Since CUB is a more challenging fine-grained dataset which requires local discriminative attributes, the results prove the effectiveness of our localized attribute learning model. For AWA2 dataset, our GEM-ZSL can also achieve competitive result which is only slightly lower than RGEN. However, the balance loss of RGEN requires the attributes of unseen classes during training which is not used in our GEM-ZSL. Without the balance loss, the harmonic mean for RGEN on AWA2 will dramatically decrease to $14.7\%$ . On SUN dataset, the feature generation based model significantly outperforms the other methods. As SUN dataset contains more than 700 categories, the generative model can bring more features for generalization to unseen classes. Compared with the other non-generation based methods, the performance of our GEM-ZSL is competitive. + +# 4.2. Ablation Study + +Component analysis. We conducted ablation experiments to verify the effectiveness of the proposed modules. Table 2 shows the influence of each model compo + +Table 1. Results (%) of the state-of-the-art ZSL and GZSL. The first part is non end-to-end methods, the second part is feature generation methods and the third part is end-to-end methods. The best and the second best results are marked in red and blue, respectively. + +
MethodsCUBSUNAWA2
ZSLGZSLZSLGZSLZSLGZSL
T1USHT1USHT1USH
PSR(CVPR'18) [5]56.024.654.333.961.420.837.226.763.820.773.832.3
RN(CVPR'18) [49]55.638.161.147.0----64.230.093.445.3
SP-AEN(CVPR'18) [10]55.434.770.646.659.224.938.630.3----
IIR(ICCV'19) [8]63.855.852.353.063.547.930.436.867.948.583.261.3
TCN(ICCV'19) [25]59.552.652.052.361.531.237.334.071.261.265.863.4
E-PGN(CVPR'20) [63]72.452.061.156.2----73.452.683.564.6
DAZLE(CVPR'20) [23]65.956.759.658.1-52.324.333.2-60.375.767.1
f-CLSWGAN(CVPR'18) [57]57.343.757.749.760.842.636.639.4----
cycle-CLSWGAN(ECCV'18) [13]58.445.761.052.360.049.433.640.0----
CADA-VAE(CVPR'19) [46]-51.653.552.4-47.235.740.6-55.875.063.9
OCD-CVAE(CVPR'20) [28]60.344.859.951.363.544.842.943.871.359.573.465.7
RFF-GZSL(1-NN)(CVPR'20) [18]-50.679.161.7-56.642.848.7----
IZF(ECCV'20) [47]67.152.768.059.468.452.757.054.874.560.677.568.0
LsrGAN(ECCV'20) [52]60.348.159.153.062.544.837.740.9----
QFSL(CVPR'18) [48]58.833.348.139.456.230.918.523.163.552.172.860.7
LDF(CVPR'18) [34]67.526.481.639.9--------
SGMA(NeurIPS'19) [68]71.036.771.348.5--------
AREN(CVPR'19) [59]71.863.269.066.060.640.332.335.967.954.779.164.7
LFGAA(ICCV'19) [36]67.636.280.950.061.518.540.025.368.127.093.441.9
DVBE(CVPR'20) [39]-64.473.268.5-44.141.642.8-62.777.569.4
RGEN(ECCV'20) [60]76.160.073.566.163.844.031.736.873.667.176.571.5
APN(NeurIPS'20) [61]72.065.369.367.261.641.934.037.668.456.578.065.5
GEM-ZSL(Ours)77.864.877.170.462.838.135.736.967.364.877.570.6
+ +Table 2. Results (\%) of ZSL and GZSL ablation study on CUB, SUN and AWA2. The baseline is the Image Encoder and dot product distance with cross-entropy loss. We analyzed the performance of each module of our model. + +
MethodsCUBSUNAWA2
T1HT1HT1H
Baseline67.861.554.730.963.562.7
+LMSE69.963.156.131.564.364.9
+LDis70.564.956.931.764.665.2
+cos77.870.462.836.967.370.6
+ +nent. Firstly, we train a baseline model that contains Image Encoder with cross-entropy loss. We use the dot product to compute class logits of the projected visual feature and every class embedding. Then, we add gaze estimation module, mean square error loss and distance loss functions gradually. Finally, the cosine similarity is added to the model. We can see that our proposed GEM improves the Top-1 accuracy (T1) of ZSL over the baseline consistently by $10.0\%$ (CUB), $8.1\%$ (SUN), $3.8\%$ (AWA2), and the harmonic mean accuracy $(\mathbf{H})$ of GZSL over the baseline + +Table 3. Results (\%) of ZSL ablation study for attention transition with gaze loss. + +
MethodsSet 1Set 2Set 3Set 4Avg.
GEM w/o LGaze43.545.542.140.742.9
GEM w LGaze44.945.243.641.243.7
+ +by $8.9\%$ (CUB), $6.0\%$ (SUN), $7.9\%$ (AWA2) respectively. Remarkably, when cosine distance is used to measure the similarity of the projected visual feature and class semantic embedding, the performance of our model can be greatly improved. Since the cosine metric can bound and reduce the variance of the neurons and thus result in models with better generalization capability [33]. + +To verify the influence of attention transition, we used CUB-VWSW gaze dataset with captured gaze points [27]. We performed Gaussian blur on the gaze points to obtain the gaze heatmap as gaze ground truth. Then we randomly selected two categories for each bird family as unseen categories. The other categories were used as seen categories. All seen categories were used to train the model with gaze + +![](images/4894cc0a15665462e8a8cf6f5bbc8def58d100e0171d99e988ef16ec723ffd3e.jpg) +(a) H + +![](images/f44d74c3e6f4da5e13c073a696dd451bbdd2c6206eb57d2a94728e48a059ec8a.jpg) +(b) T1 + +![](images/d466325b1506876dc1cb0bf788f34682b13ea478516e71aa489d5d2e2ab7d4d3.jpg) +Figure 4. The influence of $\sigma$ with different values of ZSL (T1) and GZSL (H) results (\%) on CUB, SUN and AWA2. +Figure 5. The influence of learnable $\sigma$ on ZSL (T1) and GZSL (H) results (\%). $\sigma$ is set to 20. During the model training, the performance increases with a slight fluctuation of $\sigma$ . + +loss, and the unseen categories were used as a test set to verify model performance. We repeated the above operation for four times and took the average value of T1 to ensure robustness. Table 3 shows the influence of AT with gaze loss, and we can see that AT improves the ZSL accuracy. + +Effect of scaling factor $\sigma$ . Figure 4 shows the results of H and T1 when varying $\sigma$ over $\{10, 15, 20, 25, 30\}$ under GZSL/ZSL for our model. Our method achieves the best performance on CUB and AWA2 when $\sigma$ is 20. The best results are reached for SUN when $\sigma$ is 25. We further explore the performance of the model when $\sigma$ is a learnable parameter. Figure 5 shows the relationship between model performance and $\sigma$ during the model training. We initialize $\sigma$ to 20, and it changes slightly with the iteration of training. Therefore, we fixed $\sigma$ to 20 for CUB and AWA2 and 25 for SUN in our experiments. + +Training method analysis. An episode-based training method is used in our experiments to make the model gain better generalization ability. For each mini-batch, we sample $M$ categories and $N$ images for each category. We + +Table 4. Influence of training method on GZSL results $(\%)$ . $\mathcal{R}$ represents random sampling training method with mini-batch of 64, $\mathcal{E}$ represents episode-based training method. + +
Training MethodM-wayN-shotCUBSUNAWA2
R--62.334.966.4
8260.627.046.9
8364.227.861.8
8458.527.262.3
12262.533.168.2
E12368.735.865.1
12465.534.567.4
16270.436.970.6
16368.336.768.3
16469.134.869.3
+ +vary the value of $M$ with $\{8,12,16\}$ and the value of $N$ with $\{2,3,4\}$ , and observe the $\mathbf{H}$ under these values. To further analyze the performance of the episode-based training method, we compare its performance with the random sampling training method with a mini-batch of 64. Table 4 shows that the episode-based training method has better performance than the random sampling training method. The model can be generalized to the recognition of all categories only by learning the seen categories. When $M = 16$ and $N = 2$ , the model can get the highest accuracy. + +# 4.3. GEM Evaluation + +Quantitative results. We use two standard evaluation metrics for gaze estimation: Area Under the Curve (AUC) [6] and Normalized Scanpath Saliency (NSS) [44]. AUC is the area under a curve of true positive rate versus false positive rate for different thresholds on the estimated gaze map. NSS is a simple correspondence measure between saliency maps and ground truth, computed as the average normalized saliency at fixated locations. We + +![](images/6820acc19a5325138ad31e4499e03d13d82ca9e034b76a1f67f20db28f2e05a6.jpg) +Figure 6. Visualization of predicted gaze maps of randomly selected unseen images on CUB-VWSW from different gaze estimation methods. + +Table 5. Results of different methods for gaze estimation on unseen images of CUB-VWSW dataset. + +
MethodsAUCNSS
GBVS [19]0.7931.003
GP [22]0.8361.430
GEM (Ours)0.9142.244
+ +compared our GEM with two gaze estimation baselines include: bottom-up saliency prediction method Graph Based Visual Saliency (GBVS) [19] and top-down task-specific Gaze Prediction (GP) [22]. Table 5 shows the results of different methods for gaze estimation on the unseen images of CUB-VWSW dataset. We can see that our GEM achieves better gaze estimation results. + +Qualitative analysis. Figure 6 shows the qualitative results of different gaze estimation methods on randomly selected unseen images from CUB-VWSW dataset. Our GEM can detect more accurate attribute regions that humans pay more attention to compared with both the bottom-up method GBVS and top-down method GP. These regions are helpful to distinguish different categories. Because our model is zero-shot learning targeted, GEM can learn more refined category attribute areas. In the visualization results, the predicted gaze maps are more concentrated than ground + +truth maps. In general, these results demonstrate that the GEM plays an important role in improving the accuracy of attribute parts prediction. + +# 5. Conclusion + +In this paper, a novel goal-oriented gaze estimation method has been introduced to improve ZSL tasks. To mimic human cognitive process with unseen classes, the GEM learns the discriminative attributes with semantic query-guided attention and real human gaze (if available) supervision. Finally, the localized discriminative attributes improve the global image feature representation for ZSL. Our GEM-ZSL achieves superior or competitive performance on three ZSL benchmarks which demonstrates the effectiveness of the discriminative attributes learned by the GEM. Our work shows the promising benefits of collecting human gaze dataset and automatic gaze estimation algorithms on computer vision tasks. For the future work, further investigation on the discriminative attribute localization for ZSL is an intrinsic and important direction. + +Acknowledgement This work was supported by the National Natural Science Foundation of China project no. 61772057, Beijing Natural Science Foundation (4202039), the support funding Jiangxi Research Institute of Beihang University, and JST ACT-X Grant Number JPMJAX190D, Japan. + +# References + +[1] Radhakrishna Achanta, Sheila Hemami, Francisco Estrada, and Sabine Susstrunk. Frequency-tuned salient region detection. In CVPR, pages 1597-1604, 2009. 3 +[2] Yong Deok Ahn and Suk-Ju Kang. Backlight dimming based on saliency map acquired by visual attention analysis. Displays, 50:70-77, 2017. 3 +[3] Zeynep Akata, Florent Perronnin, Zaid Harchaoui, and Cordelia Schmid. Label-embedding for attribute-based classification. In CVPR, pages 819–826, 2013. 1, 2 +[4] Zeynep Akata, Scott Reed, Daniel Walter, Honglak Lee, and Bernt Schiele. Evaluation of output embeddings for fine-grained image classification. In CVPR, pages 2927-2936, 2015. 1, 2 +[5] Yashas Annadani and Soma Biswas. Preserving semantic relations for zero-shot learning. In CVPR, pages 7603-7612, 2018. 5, 6 +[6] Ali Borji, Hamed R Tavakoli, Dicky N Sihite, and Laurent Itti. Analysis of scores, datasets, and models in visual saliency prediction. In ICCV, pages 921-928, 2013. 7 +[7] Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT'2010, pages 177-186. Springer, 2010. 5 +[8] Yannick Le Cacheux, Herve Le Borgne, and Michel Crucianu. Modeling inter and intra-class relations in the triplet loss for zero-shot learning. In ICCV, pages 10333-10342, 2019. 5, 6 +[9] Wei-Lun Chao, Soravit Changpinyo, Boqing Gong, and Fei Sha. An empirical study and analysis of generalized zero-shot learning for object recognition in the wild. In ECCV, pages 52-68. Springer, 2016. 3, 5 +[10] Long Chen, Hanwang Zhang, Jun Xiao, Wei Liu, and Shih-Fu Chang. Zero-shot visual recognition using semantics-preserving adversarial embedding networks. In CVPR, pages 1043-1052, 2018. 5, 6 +[11] Ming-Ming Cheng, Niloy J Mitra, Xiaolei Huang, Philip HS Torr, and Shi-Min Hu. Global contrast based salient region detection. PAMI, pages 569-582, 2014. 3 +[12] 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. 5 +[13] Rafael Felix, Vijay BG Kumar, Ian Reid, and Gustavo Carneiro. Multi-modal cycle-consistent generalized zero-shot learning. In ECCV, pages 21-37, 2018. 5, 6 +[14] Andrea Frome, Greg S Corrado, Jon Shlens, Samy Bengio, Jeff Dean, Marc'Aurelio Ranzato, and Tomas Mikolov. Devise: A deep visual-semantic embedding model. In NeurIPS, pages 2121-2129, 2013. 1, 2 +[15] Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. In EMNLP, pages 457-468, 2016. 2, 4 +[16] Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, pages 4367-4375, 2018. 3 +[17] 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. 1 +[18] Zongyan Han, Zhenyong Fu, and Jian Yang. Learning the redundancy-free features for generalized zero-shot object recognition. In CVPR, pages 12865-12874, 2020. 5, 6 +[19] Jonathan Harel, Christof Koch, and Pietro Perona. Graph-based visual saliency. In NeurIPS, pages 545-552, 2007. 3, 8 +[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 5 +[21] Yifei Huang, Minjie Cai, Zhenqiang Li, Feng Lu, and Yoichi Sato. Mutual context network for jointly estimating egocentric gaze and action. TIP, 29:7795-7806, 2020. 3 +[22] Yifei Huang, Minjie Cai, Zhenqiang Li, and Yoichi Sato. Predicting gaze in egocentric video by learning task-dependent attention transition. In ECCV, pages 754-769, 2018. 3, 8 +[23] Dat Huynh and Ehsan Elhamifar. Fine-grained generalized zero-shot learning via dense attribute-based attention. In CVPR, pages 4483-4493, 2020. 5, 6 +[24] Zhong Ji, Yanwei Fu, Jichang Guo, Yanwei Pang, Zhongfei Mark Zhang, et al. Stacked semantics-guided attention model for fine-grained zero-shot learning. In NeurIPS, pages 5995-6004, 2018. 2 +[25] Huajie Jiang, Ruiping Wang, Shiguang Shan, and Xilin Chen. Transferable contrastive network for generalized zero-shot learning. In ICCV, pages 9765-9774, 2019. 5, 6 +[26] Ming Jiang, Shengsheng Huang, Juanyong Duan, and Qi Zhao. Salicon: Saliency in context. In CVPR, pages 1072-1080, 2015. 3 +[27] Nour Karessli, Zeynep Akata, Bernt Schiele, and Andreas Bulling. Gaze embeddings for zero-shot image classification. In CVPR, pages 4525-4534, 2017. 1, 6 +[28] Rohit Keshari, Richa Singh, and Mayank Vatsa. Generalized zero-shot learning via over-complete distribution. In CVPR, pages 13300-13308, 2020. 5, 6 +[29] Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In NeurIPS, pages 10215-10224, 2018. 1 +[30] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 1 +[31] Vinay Kumar Verma, Gundeep Arora, Ashish Mishra, and Piyush Rai. Generalized zero-shot learning via synthesized examples. In CVPR, pages 4281-4289, 2018. 1 +[32] Christoph H Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In CVPR, pages 951-958, 2009. 1 +[33] Kai Li, Martin Renqiang Min, and Yun Fu. Rethinking zero-shot learning: A conditional visual classification perspective. In ICCV, pages 3583-3592, 2019. 3, 6 +[34] Yan Li, Junge Zhang, Jianguo Zhang, and Kaiqi Huang. Discriminative learning of latent features for zero-shot recognition. In CVPR, pages 7463-7471, 2018. 5, 6 +[35] Shichen Liu, Mingsheng Long, Jianmin Wang, and Michael I Jordan. Generalized zero-shot learning with deep calibration network. In NeurIPS, pages 2005–2015, 2018. 2 + +[36] Yang Liu, Jishun Guo, Deng Cai, and Xiaofei He. Attribute attention for semantic disambiguation in zero-shot learning. In ICCV, pages 6698-6707, 2019. 2, 5, 6 +[37] Yang Liu, Lei Zhou, Xiao Bai, Lin Gu, Tatsuya Harada, and Jun Zhou. Information bottleneck constrained latent bidirectional embedding for zero-shot learning. arXiv preprint arXiv:2009.07451, 2020. 1 +[38] Chunjie Luo, Jianfeng Zhan, Xiaohe Xue, Lei Wang, Rui Ren, and Qiang Yang. Cosine normalization: Using cosine similarity instead of dot product in neural networks. In ICANN, pages 382-391, 2018. 3 +[39] Shaobo Min, Hantao Yao, Hongtao Xie, Chaoqun Wang, Zheng-Jun Zha, and Yongdong Zhang. Domain-aware visual bias eliminating for generalized zero-shot learning. In CVPR, pages 12664-12673, 2020. 5, 6 +[40] Pedro Morgado and Nuno Vasconcelos. Semantically consistent regularization for zero-shot recognition. In CVPR, pages 6060-6069, 2017. 1, 2 +[41] Junting Pan, Elisa Sayrol, Xavier Giro-i Nieto, Kevin McGuinness, and Noel E O'Connor. Shallow and deep convolutional networks for saliency prediction. In CVPR, pages 598-606, 2016. 3 +[42] Genevieve Patterson and James Hays. Sun attribute database: Discovering, annotating, and recognizing scene attributes. In CVPR, pages 2751-2758, 2012. 5 +[43] Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In EMNLP, pages 1532-1543, 2014. 4 +[44] Robert J Peters, Asha Iyer, Laurent Itti, and Christof Koch. Components of bottom-up gaze allocation in natural images. Vision research, pages 2397-2416, 2005. 7 +[45] Bernardino Romera-Paredes and Philip Torr. An embarrassingly simple approach to zero-shot learning. In ICML, pages 2152-2161, 2015. 1, 2 +[46] Edgar Schonfeld, Sayna Ebrahimi, Samarth Sinha, Trevor Darrell, and Zeynep Akata. Generalized zero-and few-shot learning via aligned variational autoencoders. In CVPR, pages 8247-8255, 2019. 1, 5, 6 +[47] Yuming Shen, Jie Qin, Lei Huang, Li Liu, Fan Zhu, and Ling Shao. Invertible zero-shot recognition flows. In ECCV, pages 614-631, 2020. 1, 5, 6 +[48] Jie Song, Chengchao Shen, Yezhou Yang, Yang Liu, and Mingli Song. Transductive unbiased embedding for zero-shot learning. In CVPR, pages 1024-1033, 2018. 2, 5, 6 +[49] 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, pages 1199-1208, 2018. 5, 6 +[50] Tristan Sylvain, Linda Petrini, and Devon Hjelm. Locality and compositionality in zero-shot learning. In ICLR, 2020. 1 +[51] Anne M Treisman and Garry Gelade. A feature-integration theory of attention. Cognitive psychology, 12(1):97-136, 1980. 3 +[52] Maunil R Vyas, Hemanth Venkateswara, and Sethuraman Panchanathan. Leveraging seen and unseen semantic relationships for generative zero-shot learning. In ECCV, pages 70–86, 2020. 5, 6 + +[53] Wenguan Wang, Jianbing Shen, Jianwen Xie, Ming-Ming Cheng, Haibin Ling, and Ali Borji. Revisiting video saliency prediction in the deep learning era. PAMI, 2019. 3 +[54] Peter Welinder, Steve Branson, Takeshi Mita, Catherine Wah, Florian Schroff, Serge Belongie, and Pietro Perona. Caltech-ucsd birds 200. 2010. 5 +[55] Yongqin Xian, Zeynep Akata, Gaurav Sharma, Quynh Nguyen, Matthias Hein, and Bernt Schiele. Latent embeddings for zero-shot classification. In CVPR, pages 69-77, 2016. 2 +[56] Yongqin Xian, Christoph H Lampert, Bernt Schiele, and Zeynep Akata. Zero-shot learning—a comprehensive evaluation of the good, the bad and the ugly. PAMI, pages 2251–2265, 2018. 5 +[57] Yongqin Xian, Tobias Lorenz, Bernt Schiele, and Zeynep Akata. Feature generating networks for zero-shot learning. In CVPR, pages 5542-5551, 2018. 1, 5, 6 +[58] Yongqin Xian, Bernt Schiele, and Zeynep Akata. Zero-shot learning-the good, the bad and the ugly. In CVPR, pages 4582-4591, 2017. 2 +[59] Guo-Sen Xie, Li Liu, Xiaobo Jin, Fan Zhu, Zheng Zhang, Jie Qin, Yazhou Yao, and Ling Shao. Attentive region embedding network for zero-shot learning. In CVPR, pages 9384-9393, 2019. 1, 2, 5, 6 +[60] Guo-Sen Xie, Li Liu, Fan Zhu, Fang Zhao, Zheng Zhang, Yazhou Yao, Jie Qin, and Ling Shao. Region graph embedding network for zero-shot learning. In ECCV, pages 562-580, 2020. 1, 2, 3, 5, 6 +[61] Wenjia Xu, Yongqin Xian, Jiuniu Wang, Bernt Schiele, and Zeynep Akata. Attribute prototype network for zero-shot learning. In NeurIPS, 2020. 1, 2, 3, 5, 6 +[62] Hyeonwoo Yu and Beomhee Lee. Zero-shot learning via simultaneous generating and learning. In NeurIPS, pages 46-56, 2019. 1 +[63] Yunlong Yu, Zhong Ji, Jungong Han, and Zhongfei Zhang. Episode-based prototype generating network for zero-shot learning. In CVPR, pages 14035-14044, 2020. 5, 6 +[64] Zhou Yu, Jun Yu, Jianping Fan, and Dacheng Tao. Multimodal factorized bilinear pooling with co-attention learning for visual question answering. In ICCV, pages 1821–1830, 2017. 2, 4 +[65] Li Zhang, Tao Xiang, and Shaogang Gong. Learning a deep embedding model for zero-shot learning. In CVPR, pages 2021-2030, 2017. 2 +[66] Heliang Zheng, Jianlong Fu, Tao Mei, and Jiebo Luo. Learning multi-attention convolutional neural network for fine-grained image recognition. In ICCV, pages 5209–5217, 2017. 4 +[67] Pengkai Zhu, Hanxiao Wang, and Venkatesh Saligrama. Generalized zero-shot recognition based on visually semantic embedding. In CVPR, pages 2995-3003, 2019. 1 +[68] Yizhe Zhu, Jianwen Xie, Zhiqiang Tang, Xi Peng, and Ahmed Elgammal. Semantic-guided multi-attention localization for zero-shot learning. In NeurIPS, pages 14943–14953, 2019. 1, 2, 5, 6 \ No newline at end of file diff --git a/goalorientedgazeestimationforzeroshotlearning/images.zip b/goalorientedgazeestimationforzeroshotlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b3db5c3bf1cdd1a86c2e66bb3a59b5554cd98a35 --- /dev/null +++ b/goalorientedgazeestimationforzeroshotlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:375dd56cc4877a082fbeaeda380cdb9b4960fbcd7ae90b0ee23a930aa3695b4b +size 726016 diff --git a/goalorientedgazeestimationforzeroshotlearning/layout.json b/goalorientedgazeestimationforzeroshotlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..89eec866c53d3384b57adc09a21915012b44a768 --- /dev/null +++ b/goalorientedgazeestimationforzeroshotlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c02c8b206f9e7d39ce63446bb838f32084f6331880274b541649b4eefe6b0cec +size 415013 diff --git a/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_content_list.json b/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..45d98745c2afc803da56382980e3f8848cb4fc07 --- /dev/null +++ b/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18e5a6c4aaa248bdd44e212ab0d3682f4db070453effe456dee8bfddd81743b7 +size 90715 diff --git a/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_model.json b/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9a564c98d8931d224918c2642598f0f54f0d7115 --- /dev/null +++ b/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7dad744bba6131087c43b8c6217b0ebba2e5edb54cdf48200e8ae665f2fed820 +size 112865 diff --git a/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_origin.pdf b/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..672d771a4aaa661e2ad44ead9eebb6005d1a8507 --- /dev/null +++ b/gradientbasedalgorithmsformachineteaching/1e96533e-07b6-436f-a0d8-300071d1fe71_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:228b5aee6f003cb101ebcae649a7b1d0622c5fd652b803336e1da9498e61741c +size 561835 diff --git a/gradientbasedalgorithmsformachineteaching/full.md b/gradientbasedalgorithmsformachineteaching/full.md new file mode 100644 index 0000000000000000000000000000000000000000..04cc392db23f681b1aee670b5668fed7242625d8 --- /dev/null +++ b/gradientbasedalgorithmsformachineteaching/full.md @@ -0,0 +1,447 @@ +# Gradient-based Algorithms for Machine Teaching + +Pei Wang + +UC, San Diego + +pew062@ucsd.edu + +Kabir Nagrecha + +UC, San Diego + +kabir.nagrecha@gmail.com + +Nuno Vasconcelos + +UC, San Diego + +nuno@ucsd.edu + +# Abstract + +The problem of machine teaching is considered. A new formulation is proposed under the assumption of an optimal student, where optimality is defined in the usual machine learning sense of empirical risk minimization. This is a sensible assumption for machine learning students and for human students in crowdsourcing platforms, who tend to perform at least as well as machine learning systems. It is shown that, if allowed unbounded effort, the optimal student always learns the optimal predictor for a classification task. Hence, the role of the optimal teacher is to select the teaching set that minimizes student effort. This is formulated as a problem of functional optimization where, at each teaching iteration, the teacher seeks to align the steepest descent directions of the risk of (1) the teaching set and (2) entire example population. The optimal teacher, denoted MaxGrad, is then shown to maximize the gradient of the risk on the set of new examples selected per iteration. MaxGrad teaching algorithms are finally provided for both binary and multiclass tasks, and shown to have some similarities with boosting algorithms. Experimental evaluations demonstrate the effectiveness of MaxGrad, which outperforms previous algorithms on the classification task, for both machine learning and human students from MTurk, by a substantial margin. + +# 1. Introduction + +The success of deep learning has been driven, in large part, by the availability of large and carefully curated datasets for tasks such as image recognition [8, 22], action recognition [19, 11], object detection [24], etc. These datasets usually contain everyday objects, actions, or scenes and can be scalably annotated on crowdsourcing platforms such as Amazon Mechanical Turk (MTurk). This is, however, usually not true for expert domains, such as biology or medical imaging. While data collection can still be easy in these domains, annotations require highly specialized and domain specific knowledge. This is beyond the reach of crowdsourcing annotators. On the other hand, annotation by specialists is usually too expensive and rarely feasible at a large scale. + +![](images/462d39b6c7ff0561a3bc2e629860507d22a3b88368be1368b834440bbd9f9fa4.jpg) +Figure 1: MaxGrad is an iterative machine teaching algorithm. At each iteration, the teacher selects new examples from a large dataset, to complement a small teaching set used by a student to learn a task. Examples are selected by comparing the current student model to the optimal model for the large dataset. The optimal student uses the teaching set to update his/her model and feeds back its predictions to the teacher. + +This has motivated extensive research in alternative and less label-intensive forms of learning, including few-shot learning [42, 1], transfer learning [21, 46], semi-supervised learning [47, 23], and self-supervised learning [35, 20]. However, these approaches usually underperform supervised learning from large and fully labeled datasets. In result, there has recently been interest in machine teaching algorithms capable of training crowdsourced annotators to label data from specialized domains. + +The goal of machine teaching is to design systems that can teach students efficiently and automatically. Machine teaching is a broad research problem [52], where humans can utilize domain knowledge to teach machines or vice-versa. In this work, we restrict the discussion to the narrow task of image classification, where a machine teaches human learners to discriminate between different image classes. Although the proposed ideas are general, we target the application of teaching image annotators in crowd-sourcing platforms. This exploits the fact that a relatively small annotated dataset can be leveraged to train crowd workers, which can then annotate large numbers of images, enabling scalable supervised learning of image classifiers. While classification has been the task of choice for much machine teaching work, it should be noted that several other tasks and applications have also been investigated [6, 5, 44]. + +The machine teaching set-up considered in this work is + +the iterative interaction set-up of Figure 1. At each iteration, the teacher selects new examples from a large dataset, to complement a small set of examples, known as the teaching set, which is used by the student to learn the target task. By comparing the current student model and the optimal model for the large dataset, the teacher seeks to select the examples that most help the student learn. The central question in this set-up is how to select the teaching set. Ideally, this set should pack as much information for class discrimination as possible into the smallest number of examples. + +In the literature, there have been many attempts to design optimal teaching algorithms [39, 26, 27, 30]. This usually requires the assumption of certain student properties. Although past works have proposed different student models, these frequently rely on assumptions that are questionable for the crowdsourced annotation context. For example, a popular assumption [39, 29, 7] is that the student only has access to a countable set of hyperplane hypotheses. While justified by the fact that human students have limited ability and memory, this assumption overly underestimates their learning ability. In fact, several machine teaching works explicitly assume that students have limited capacity or are otherwise sub-optimal learners [30, 18, 39, 50]. This is not supported by studies with real students, which found that humans have strong learning ability [13, 9, 15, 38]. + +In this work, we assume that the student is an optimal learner. Optimality is defined in the standard machine learning sense, i.e. that the student learns a predictor of minimum empirical risk in the teaching set. This always holds for machine learning students, which are defined in this way, and is sensible for human students, who usually do not underperform machine learning students, especially on few-shot learning scenery in practice. It does assume that students are engaged in the learning task, i.e. giving their best effort. This is sensible in the crowdsourcing scenario, where students are free-willing participants rated by their task performance. We show that, if allowed unbounded effort, the optimal student will always learn the optimal predictor for the task. This implies that the only role of the teacher is to optimize learning speed, i.e. select the teaching examples that enable the student to learn with least effort. + +We then formulate the search for the optimal teacher as a problem of functional optimization where, at each teaching iteration, the teacher aims to align the steepest descent direction of the teaching set risk with that of the empirical risk over the entire example population. This is shown to have as optimal solution the MaxGrad teacher, which maximizes the gradient of the risk on the set of new examples selected per iteration. MaxGrad teaching algorithms are finally provided for both binary and multiclass tasks, and shown to have some similarities with boosting algorithms [33, 12, 34]. Experimental evaluations demonstrate the effectiveness of MaxGrad, which outperforms previous algorithms on the + +classification task, for both machine learning and human students from MTurk. + +# 2. Related work + +Simulated studies: In the past two decades, a variety of algorithms have been proposed to model the teacher-student interaction and seek the optimal teaching sequence. [3] explored several heuristics for the selection of the teaching set, based on insights derived from active learning, including a preference for points closest to the boundary, a handcrafted indicator of classification difficulty, curriculum learning, and a coverage model. [31] explored the use of recurrent neural networks as models of student learning. [51] modeled student learning as a Bayesian update process. [2, 32] used reinforcement learning based models to develop teaching policies for computer-based tutoring systems. All these methods have been developed and evaluated with synthetic data or handcrafted features, and did not explore the teaching of human learners with natural images. Note that there are some related algorithm families to machine teaching, including active learning [37, 45], few-shot learning [42, 41], curriculum learning [4, 14] and knowledge distillation [17]. For example, the main difference from active learning is that in the latter the learner selects examples without knowing the ground truth. In machine teaching, examples are selected by the teacher, who knows all labels. We recommend [26, 52] for extensive comparisons. + +Human studies: Most of existing literature on human evaluations only work on simple binary classification problems [50, 39, 40]. A representative is STRICT [39]. It simulates the student as a hyperplane in a finite hypothesis space. The learning process is modeled as a Markov chain, assuming that learners perform a random walk in hypothesis space, according to the teacher's feedback. Expected error rate is the criterion for teaching set selection. Since its minimization is NP-hard, a surrogate objective is optimized in a greedy manner. Following STRICT, many extensions or generalizations have been proposed [40, 29, 7]. For example, beyond pure label feedback, methods have been proposed to account for feature-based feedback, both for synthetic data [40] and real images [29], using an attribution map [49]. [29] also extended STRICT to multiclass problems. + +Alternatively to STRICT, [26, 27] modeled teaching as an iterative process and the learner as a linear classifier, which is updated at each iteration based uniquely on the example seen at that iteration. Beyond [26], [27] treats the student network as a black-box, which more closely resembles real student learning. [18] approximates the student's class conditional distribution given the teaching set with a Gaussian random field but it is designed for online learning, a different setting from that studied in this paper. All these methods assume that the learner is sub-optimal or has limited capacity. However, there is little evidence to support this. On the + +contrary, many studies have found that humans have strong learning ability [13, 9, 15, 38], which is also intuitive. We argue that assuming an optimal learner is more sensible in very specialised domains, at least for image classification in the crowdsourcing context. + +Feature space: The practical implementation of machine teaching requires a feature extractor to implement the simulated student. Since several prior works were introduced before the popularization of deep learning, they rely on handcrafted features [39, 7]. These are unlikely to be close to human perception and tend to produce low-accuracy classifiers. More recently, it has become standard practice to use features extracted by a deep convolutional network, which is a better model of human perception [36, 10, 48] and produces better classifiers. This is a practice that we also adopt. However, previous works have used networks fine-tuned on a dataset from the target domain [29]. This vastly simplifies the teaching problem, as it is equivalent to assuming that the student already is an expert in the target domain before the teaching starts. We instead rely on a model pretrained on ImageNet. This reflects the assumption that the student is competent in generic image classification tasks, but has no experience in the target domain. This assumption usually holds for the crowdsourced setting, whenever the target domain requires specific expertise. + +Other approaches: Recently, several works have investigated the use of explanations during the teaching phase, to improve teaching performance. The results are so far inconclusive, as these works show limited improvements [29, 7, 40], particularly in light of the noise inherent to human evaluations, or even a negative impact [29, 7]. While MaxGrad could in principle be combined with visual explanations, we leave this for future work. There have also been proposals for interactive online machine teaching [18], where the selection of teaching examples is not based on a simulated student, but derived from the responses of human users in real-time. However, online updates are costly and difficult to scale to large numbers of simultaneous users. The extension of the ideas used to derive MaxGrad to this setting is a topic that we intend to investigate in the future. + +# 3. Gradient-Based Machine Teaching + +In this section, we introduce the MaxGrad algorithm. + +# 3.1. Machine Teaching + +In machine teaching for classification, the goal of the teacher is to assemble a teaching set $\mathcal{L} = \{(x_i^l,y_i^l)\}_{i = 1}^K$ of examples $x_{i}^{l}$ and class labels $y_{i}^{l}$ , which a student uses to learn a classifier. In this paper, we adopt the pool-based teaching setting [52]. This assumes that the teacher has access to a much larger example dataset $\mathcal{D} = \{(x_1,y_1),\ldots ,(x_N,y_N)\}$ from which it selects a subset to assemble $\mathcal{L}$ . This is different from synthesis teaching where the teaching examples + +are synthetically generated. Pool-based teaching is more realistic for image labeling applications, because artificial images may appear nonsensical to a (human) student. The goal of machine teaching is to enable the student to learn the optimal predictor $f^{*}(x)$ for the entire example population $\mathcal{D}$ , from the smallest teaching set $\mathcal{L}$ , i.e. the smallest possible number of teaching examples $K$ . + +As usual in machine learning, the optimal predictor $f^{*}$ is defined as the predictor that minimizes the risk $\mathcal{R}_{\mathcal{D}}[f]$ associated with a loss function on $\mathcal{D}$ . The details of the loss function depend on the task. For simplicity, we discuss binary classification firstly and extend all ideas to the multiclass setting in section 3.5. For binary classification, $y \in \mathcal{Y} = \{-1, +1\}$ , $f(x)$ maps $x \in \mathcal{X}$ to $\mathbb{R}$ and the optimal predictor is + +$$ +f ^ {*} = \arg \min _ {f} \mathcal {R} _ {\mathcal {D}} [ f ] = \arg \min _ {f} \sum_ {\left(x _ {i}, y _ {i}\right) \in \mathcal {D}} \phi \left(y _ {i} f \left(x _ {i}\right)\right), \tag {1} +$$ + +where $\phi(.)$ is a margin loss function. This predictor is assumed known to the teacher. + +The end-goal of the teacher is to assemble the teaching set $\mathcal{L} \subset \mathcal{D}$ that achieves the best trade-off between two conflicting requirements: the student learns the optimal predictor $f^{*}$ while spending the least effort. This reflects the fact that longer teaching sequences lead to better student performance, but the student has a limited set of learning resources, e.g., a limited attention span. For example, image annotators on crowd-sourcing platforms are well known to drop tasks that are too tedious to master. In this work, we assume that student effort is proportional to the cardinality of the teaching set $|\mathcal{L}|$ . This leads to the formulation of the optimal teacher as the one which minimizes some distance $d(f^{*}, f^{s})$ between the predictor $f^{s}$ learned by the student from $\mathcal{L}$ and the optimal predictor $f^{*}$ , under a constraint on student effort $|\mathcal{L}| \leq \zeta$ . + +# 3.2. The optimal student assumption + +In this work, we rely on the assumption that the student is an optimal learner. + +Definition 1 The student is an optimal learner with respect to loss $\phi$ if and only if, given a teaching set $\mathcal{L}$ , it learns the predictor that minimizes the risk defined by $\phi$ and $\mathcal{L}$ + +$$ +\mathcal {R} _ {\mathcal {L}} [ f ] = \sum_ {(x _ {i}, y _ {i}) \in \mathcal {L}} \phi (y _ {i} f (x _ {i})). \tag {2} +$$ + +Note that the risk of (2) is defined over $\mathcal{L}$ , the teaching set that the student has access to, not the entire population $\mathcal{D}$ . The optimal student assumption holds trivially when the student is a machine learning algorithm, because learning algorithms are designed to minimize (2). Since human learners tend to perform at least as well as machine learning algorithms for most tasks, it is a sensible assumption for + +human students as well. Under this definition of student, the machine teaching problem can then be formalized as a bilevel optimization problem. + +Definition 2 Under the assumption of an optimal learner with respect to loss $\phi$ , a teacher is optimal if and only if it produces the teaching set + +$$ +\mathcal {L} ^ {*} = \arg \min _ {\mathcal {L}} d \left(f ^ {*}, f ^ {s} (\mathcal {L})\right) \tag {3} +$$ + +$$ +f ^ {s} (\mathcal {L}) = \arg \min _ {f} \sum_ {\left(x _ {i}, y _ {i}\right) \in \mathcal {L}} \phi \left(y _ {i} f \left(x _ {i}\right)\right). \tag {4} +$$ + +$$ +| \mathcal {L} | \leq \zeta \tag {5} +$$ + +where $f^{*}$ is given by (1), $d(.,.)$ is a distance function, and $\zeta$ a bound on student effort to process the examples in $\mathcal{L}$ . + +In what follows, the teaching process is assumed to be iterative. + +Definition 3 An iterative machine teaching procedure iterates between a step of example selection, by the teacher, and a learning step by the student. At iteration $t$ , the teacher produces a teaching set $\mathcal{L}^t$ , which the student uses to learn a predictor $f^t(x)$ . The teacher then selects from $\mathcal{D}^t = \mathcal{D} - \mathcal{L}^t$ the examples to add to $\mathcal{L}^t$ in order to produce $\mathcal{L}^{t+1}$ . The student starts the process with an initial predictor $f^0(x)$ . This can be derived from prior experience or $f^0(x) = 0$ . + +The following result is an immediate consequence of these definitions. + +Corollary 1 Consider the iterative machine teaching procedure of Definition 3 and assume that the teacher selects at least one new example per learning iteration. If $\zeta$ is large enough, the optimal student of Definition 1 is guaranteed to learn the optimal predictor $f^{*}$ of (1) after a finite number of iterations. + +Proof See Appendix A.1. + +In summary, for an optimal student and a sufficient level of effort, the distance $d(f^{*},f^{s})$ of (3) always converges to zero. It follows that the only role of the teacher is to optimize learning speed, i.e. select the set of examples that enable the student to learn with the least effort. We next define an optimal teacher from this point of view. This, however, requires a brief review of basic concepts in functional optimization. + +# 3.3. Functional optimization + +Given two vector spaces $\mathcal{X},\mathcal{Y}$ and a differentiable function $R:\mathcal{X}\to \mathcal{Y}$ , the differential $dR(u,\psi)$ of $R$ at $u\in \mathcal{X}$ in the direction $\psi \in \mathcal{X}$ is given by + +$$ +d R (u, \psi) = \left. \frac {d}{d \tau} R (u + \tau \psi) \right| _ {\tau = 0}. \tag {6} +$$ + +For example, the margin loss function $\mathcal{M}(f) = \phi(y(x)f(x))$ has differential $d\mathcal{M}(f,\psi) = y\phi'(yf)\psi$ . Given a set of directions $\Psi = \{\psi_1, \ldots, \psi_n\}$ such that $\psi_i \in \mathcal{X}, \forall i$ , the gradient of $R$ with respect to $\Psi$ at $u$ is the vector + +$$ +\nabla_ {\Psi} R (u) = \left(\langle d R (u, \psi_ {1}), \psi_ {1} \rangle , \dots , \langle d R (u, \psi_ {n}), \psi_ {n} \rangle\right) ^ {T}. \tag {7} +$$ + +Let $Sp(\Psi)$ be the span of $\Psi$ and $\gamma$ a direction in $Sp(\Psi)$ , i.e. $\gamma = \sum_{i} \alpha_{i} \psi_{i}$ for some vector $\alpha$ . The derivative of $R$ at $u$ along direction $\gamma \in Sp(\Psi)$ is + +$$ +\partial_ {\gamma} R (u) = \left\langle \nabla_ {\Psi} R, \alpha \right\rangle , \tag {8} +$$ + +where $< \alpha, \beta> = \int \alpha(x)\beta(x)dx$ when $\alpha$ and $\beta$ are functions and $< \alpha, \beta> = \sum_{i}\alpha_{i}\beta_{i}$ when they are finite dimensional vectors. + +A dataset $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^n$ , defines a set of canonical directions $\Psi(\mathcal{D}) = \{\delta(x - x_i)\}_{i=1}^n$ , where $\delta(x)$ is the Dirac delta function. The differentials of the margin loss along these directions are $d\mathcal{M}(f, \psi_k) = y\phi'(yf)\delta(x - x_k)$ and the empirical risk + +$$ +R _ {\mathcal {D}} (f) = \sum_ {\left(x _ {i}, y _ {i}\right) \in \mathcal {D}} \phi \left(y _ {i} f \left(x _ {i}\right)\right) = \sum_ {\left(x _ {i}, y _ {i}\right) \in \mathcal {D}} \mathcal {M} \left(f \left(x _ {i}\right)\right) \tag {9} +$$ + +has gradient + +$$ +\nabla_ {\Psi (\mathcal {D})} R _ {\mathcal {D}} (f) = \left(w _ {1}, \dots , w _ {n}\right) ^ {T}, \quad w _ {i} = y _ {i} \phi^ {\prime} \left(y _ {i} f \left(x _ {i}\right)\right) (1 0) +$$ + +where $\phi^\prime$ is the derivative of $\phi$ . For any function $g$ in the span of $\Psi (\mathcal{D})$ , i.e. + +$$ +g (x) = \sum_ {i} g \left(x _ {i}\right) \delta \left(x - x _ {i}\right), \tag {11} +$$ + +the derivative of the risk at $f$ along the direction of $g$ is + +$$ +\partial_ {g} R _ {\mathcal {D}} (f) = \sum_ {(x _ {i}, y _ {i}) \in \mathcal {D}} w _ {i} g \left(x _ {i}\right). \tag {12} +$$ + +The risk $R_{\mathcal{D}}(f)$ is minimized at $f^{*}$ if $\partial_g R_{\mathcal{D}}(f^*) = 0, \forall g \in Sp(\Psi(\mathcal{D}))$ , which holds if + +$$ +\nabla_ {\Psi (\mathcal {D})} R _ {\mathcal {D}} \left(f ^ {*}\right) = 0. \tag {13} +$$ + +# 3.4. The optimal teacher + +With these results we are ready to introduce a criterion for teacher optimality, under the iterative teaching procedure of Definition 3. We start by introducing the set of permissible choices for the teaching set, i.e the set of teaching sets that the teacher is allowed to choose from at iteration $t$ . Under the iterative teaching procedure, $\mathcal{L}^t = \mathcal{L}^{t-1} \cup \mathcal{N}^t$ , i.e. the teacher augments $\mathcal{L}^{t-1}$ with a set of examples $\mathcal{N}^t$ not contained in it, which we denote as the novel examples of + +![](images/fcb8e14e14120ec9bd302a363dc8ed2df91b6f3e9e7915dc41ac6ab5dc9467b5.jpg) +Figure 2: Left: at iteration $t$ , the teacher has access to the population risk $R_{\mathcal{D}}(f^t)$ and corresponding steepest descent direction. Right: the student can only learn from the teaching set $\mathcal{L}^{t-1}$ of iteration $t-1$ and the newly selected examples $\mathcal{N}$ . MaxGrad selects $\mathcal{N}$ so that the steepest descent direction on $\mathcal{L}^t = \mathcal{L}^{t-1} \cup \mathcal{N}$ , i.e. $\partial R_{\mathcal{L}^{t-1} \cup \mathcal{N}}(f^t)$ is closest to $g^*$ . + +iteration $t$ . The set of permissible choices includes all such novel sets + +$$ +\mathcal {P} ^ {t} (\tau) = \left\{\mathcal {N} \subset \mathcal {D} ^ {t - 1} \mid | \mathcal {N} | \leq \tau \right\} \tag {14} +$$ + +The parameter $\tau$ upper-bounds the student effort per teaching iteration, enabling the teacher to control the trade-off between number of teaching iterations and student effort. Since, the total effort spent up to iteration $t$ is upper-bounded by $t\tau$ , it follows from (5) that the student can learn for up to $T = \zeta/\tau$ iterations. In the iterative setting, it is easier to control the level of effort per iteration than the overall level of effort $\zeta$ . In fact, the standard practice in the literature [39, 29, 26] is to allow a single novel example per iteration, i.e. set $\tau = 1$ , and then limit the number of iterations $T$ . The definition of set of permissible choices above loosens this constraint. + +The question for the teacher is how to select the set of novel examples $\mathcal{N}^t$ is some optimal way. We next introduce the definition of optimality used in this work. + +Definition 4 Consider the iterative machine teaching procedure of Definition 3, with optimal student of Definition 1. Let $g^{*}$ be the direction of steepest descent of the population risk + +$$ +g ^ {*} = \arg \min _ {g \in S p (\mathcal {D}), | | g | | = 1} \partial_ {g} R _ {\mathcal {D}} (f ^ {t}) \tag {15} +$$ + +and $\mathcal{P}^t$ be the set of permissible choices for iteration $t$ . The optimal teacher selects the set of novel examples + +$$ +\mathcal {N} ^ {t} = \arg \max _ {\mathcal {N} \in \mathcal {P} ^ {t}} \left\langle g ^ {*}, h ^ {*} \left(\mathcal {L} ^ {t - 1} \cup \mathcal {N}\right) \right\rangle \tag {16} +$$ + +where + +$$ +h ^ {*} (\mathcal {L}) = \arg \min _ {h \in S p (\mathcal {L}), | | h | | = 1} \partial_ {h} R _ {\mathcal {L}} \left(f ^ {t}\right) \tag {17} +$$ + +is the direction of steepest descent on the teaching set risk. The teaching set is then updated into $\mathcal{L}^t = \mathcal{L}^{t - 1}\cup \mathcal{N}^t$ + +This definition encodes the fact that the ideal teaching set $\mathcal{L}^t$ would allow the student to give steepest descent steps + +on the population risk $R_{\mathcal{D}}$ , to enable the fastest progress towards $f^{*}$ . However, the student does not have access to $\mathcal{D}$ , only to $\mathcal{L}^{t - 1}$ and a set of novel examples from $\mathcal{P}^t$ . The optimal teacher of (16) selects the novel set $\mathcal{N}^t \in \mathcal{P}^t$ that leads to the teaching set $\mathcal{L}^t$ whose steepest descent direction $h^{*}(\mathcal{L}^{t})$ is closest to the steepest descent direction $g^{*}$ of $\mathcal{D}$ . This is illustrated in Figure 2. + +To derive the solution of (16), we leverage the following property of functional derivatives. + +Lemma 1 For any decomposition of $\mathcal{D} = \mathcal{A} \cup \mathcal{B}$ into two disjoint subsets $\mathcal{A}$ and $\mathcal{B}$ (such that $\mathcal{A} \cap \mathcal{B} = \emptyset$ ) and any direction $g \in Sp(\Psi(\mathcal{D}))$ + +$$ +\partial_ {g} R _ {\mathcal {D}} (f) = \partial_ {g} R _ {\mathcal {A}} (f) + \partial_ {g} R _ {\mathcal {B}} (f). \tag {18} +$$ + +Proof See Appendix A.2. + +The following result uses this property to show that, given what the optimal student has learned until iteration $t$ , the derivative of the population risk is independent of the teaching set $\mathcal{L}^{t-1}$ already studied. + +Lemma 2 Consider the iterative machine teaching procedure of Definition 3. Then, the predictor $f^t$ learned by the optimal student of Definition 1 at iteration $t$ is such that, for any direction $g$ in $Sp(\Psi(\mathcal{D}))$ + +$$ +\partial_ {g} R _ {\mathcal {D}} \left(f ^ {t}\right) = \partial_ {g} R _ {\mathcal {D} ^ {t - 1}} \left(f ^ {t}\right). \tag {19} +$$ + +Proof See Appendix A.3. + +The following theorem uses these results to derive the example selection strategy of the optimal teacher. + +Theorem 1 Consider the iterative machine teaching procedure of Definition 3, with optimal student as in Definition 1, and set of permissible choices of (14). The optimal teacher of Definition 4 selects the teaching set $\mathcal{L}^t = \mathcal{L}^{t - 1}\cup \mathcal{N}^t$ with novel examples + +$$ +\begin{array}{l} \mathcal {N} ^ {t} = \arg \max _ {\mathcal {N} \in \mathcal {P} ^ {t}} \left\| \nabla_ {\Psi (\mathcal {N})} ^ {T} R _ {\mathcal {N}} (f ^ {t}) \right\| ^ {2} (20) \\ = \arg \max _ {\mathcal {N} \in \mathcal {P} ^ {t}} \sum_ {\left(x _ {i}, y _ {i}\right) \in \mathcal {N}} w _ {i} ^ {2} (21) \\ \end{array} +$$ + +where $w_{i} = \phi^{\prime}(y_{i}f^{t}(x_{i}))$ + +Proof See Appendix A.4. + +The theorem shows that the optimal teacher strategy is to select the set of novel examples $\mathcal{N}$ available in $\mathcal{P}^t$ of largest risk gradient. For this reason, we denote the teacher as the MaxGrad teacher. Since, for margin losses, $\phi^\prime$ has largest magnitude for negative arguments, $w_{i}$ is largest for examples + +# Algorithm 1 MaxGrad + +Input Data $\mathcal{D} = \{(x_i,y_i)\}_{i = 1}^N$ , codewords $\mathcal{V}$ , max iter. $T$ , effort $\tau$ . + +1: Initialization: $\mathcal{L}^0\gets \emptyset ,f^1,\mathcal{D}^0\gets \mathcal{D}$ +2: for $t = \{1, \dots, T\}$ do +3: compute $\xi_{i}$ for all examples in $\mathcal{D}^{t - 1}$ . +4: order examples by decreasing $\xi_{i}$ and select top $\tau$ to create $\mathcal{N}^t$ . +5: teaching set update: $\mathcal{L}^t\gets \mathcal{L}^{t - 1}\cup \mathcal{N}^t$ +6: student update: $f^{t + 1} = f^{*}(\mathcal{L}^{t})$ . +7: $\mathcal{D}^t\gets \mathcal{D}^{t - 1}\backslash \mathcal{N}^t$ +8: end for + +# Output $\mathcal{L}^t$ + +
binary
γ{-1,+1}
ξi(φ'(yi ft(xi)))2
f*(Lt)arg minf ∑(xi,yi)∈Lt φ(yif(xi))
+ +
multi-class
y{y1, ..., yc}, yi ∈ Rd
xiwi2 ||yci - ∑k≠ci yi kεk(xi, ci)||2
wi∑k≠ci φ′[1/2{ft(xi), yc - yk}
εk(x, c)φ′[1/2{ft(x), yc - yk}] / ∑k≠c φ′[1/2{ft(x), yc - yk}]
φ(v)e-v
f*(Lt)arg minf ∑(xi,yi)∈Lt ∑l=1, l≠yi C φ{1/2{yyi - yl, f(xi)}
+ +of negative margin, i.e. which are incorrectly classified by the current student predictor $f^t$ . Hence, $w_i$ is a measure of how difficult each example is, under the current state of student knowledge. Similarly $\mathcal{H}(\mathcal{N}) = \sum_{(x_i,y_i)\in \mathcal{N}}w_i^2$ measures the difficulty, for the student, of the novel examples in $\mathcal{N}$ . It follows from (21) that the MaxGrad teacher always selects the hardest set of novel examples in $\mathcal{P}^t$ . Furthermore, since $\mathcal{H}(\mathcal{N})$ is a sum of non-negative terms, it is an increasing function of $|\mathcal{N}|$ . This implies that the teacher has a preference for larger sets of novel examples. As long as there are examples that the student has not mastered $(w_i > 0)$ , it will choose a set of $\tau$ examples per iteration. Hence, $|\mathcal{N}^t| = \tau$ for all $t < T$ and the overall learning complexity is $T\tau$ . This implies that the number of iterations is upper bounded by $\zeta/\tau$ , which makes it equivalent to specifying a maximum level of effort $\zeta$ or a maximum number of iterations $T$ for the teaching process. Finally, because the set of permissible choices includes all novel sets of cardinality $\tau$ , the solution of (21) is trivial: it suffices to compute $w_i$ for all examples in $\mathcal{D}^{t-1}$ and select the $\tau$ examples of largest $w_i^2$ . The resulting machine teaching procedure is summarized by Algorithm 1. + +# 3.5. Multi-class extension + +We have discussed binary classification tasks, were $f(x) \in \mathbb{R}$ , class labels $y \in \{-1, 1\}$ , the margin of example $(x, y)$ is defined as $yf(x)$ and a margin loss is a function $\phi(yf(x))$ for some decreasing $\phi \in \mathbb{R}^+$ . All ideas can be generalized for the $C$ -class case, by extending these definitions. A common generalization is to use a $d$ -dimensional predictor, $f(x) \in \mathbb{R}^d$ , a set of $C$ class label codewords $y^c \in \mathcal{Y} = \{y^1, \dots, y^C\}$ , where $y^c \in \mathbb{R}^d$ , and define the margin of example $x$ with respect to class $y^k$ as + +$$ +\mathcal {M} \left(y ^ {k}, f (x)\right) = \min _ {l \neq k} \frac {1}{2} \left\langle y ^ {k} - y ^ {l}, f (x) \right\rangle . \tag {22} +$$ + +A family of margin losses is then defined as [33] + +$$ +L \left[ y ^ {k}, f (x) \right] = \sum_ {l = 1, l \neq k} ^ {C} \phi \left(\frac {1}{2} \left\langle y ^ {k} - y ^ {l}, f (x) \right\rangle\right), \tag {23} +$$ + +where $\phi : \mathbb{R} \to \mathcal{R}^+$ are strictly positive. A theoretical discussion of the properties of these losses can be found in [33]. The empirical risk then becomes + +$$ +R _ {\mathcal {D}} (f) = \sum_ {(x _ {i}, y _ {i}) \in \mathcal {D}} L \left[ y ^ {y _ {i}}, f \left(x _ {i}\right) \right]. \tag {24} +$$ + +and, given a dataset $\mathcal{D} = \{(x_i,c_i)\}$ and a corresponding set of directions $\Psi (\mathcal{D}) = \{\psi_1,\ldots ,\psi_n\}$ such that $\psi_{i} = \delta (x - x_{i})$ the gradient of $R_{\mathcal{D}}(f)$ evaluated at $f^t$ with respect to $\Psi (\mathcal{D})$ has entries + +$$ +\left[ \nabla_ {\Psi (\mathcal {D})} R _ {\mathcal {D}} \left(f ^ {t}\right) \right] _ {i} = w _ {i} \left(y ^ {c _ {i}} - \sum_ {k \neq c _ {i}} y ^ {k} \epsilon_ {k} \left(x _ {i}, c _ {i}\right)\right), \tag {25} +$$ + +with + +$$ +w _ {i} = \sum_ {k \neq c _ {i}} \phi^ {\prime} \left[ \frac {1}{2} \left\langle f ^ {t} \left(x _ {i}\right), y ^ {c _ {i}} - y ^ {k} \right\rangle \right] \tag {26} +$$ + +$$ +\epsilon_ {k} (x, c) = \frac {\phi^ {\prime} \left[ \frac {1}{2} \left\langle f ^ {t} (x) , y ^ {c} - y ^ {k} \right\rangle \right]}{\sum_ {k \neq c} \phi^ {\prime} \left[ \frac {1}{2} \left\langle f ^ {t} (x) , y ^ {c} - y ^ {k} \right\rangle \right]}. \tag {27} +$$ + +Note that $\left[\nabla_{\Psi (\mathcal{D})}R_{\mathcal{D}}(f^t)\right]_i$ is a d-dimensional vector. The gradient norm of (21) is then + +$$ +\begin{array}{l} \left| \left| \nabla_ {\Psi (\mathcal {N})} ^ {T} R _ {\mathcal {N}} \left(f ^ {t}\right) \right| \right| ^ {2} = \sum_ {\left(x _ {i}, c _ {i}\right) \in \mathcal {N}} \left| \left| \left[ \nabla_ {\Psi (\mathcal {D})} R _ {\mathcal {D}} \left(f ^ {t}\right) \right] _ {i} \right| \right| ^ {2} (2 8) \\ = \sum_ {\left(x _ {i}, c _ {i}\right) \in \mathcal {N}} \xi_ {i} \tag {29} \\ \end{array} +$$ + +where $\xi_{i} = w_{i}^{2}||y^{c_{i}} - \sum_{k\neq c_{i}}y^{k}\epsilon_{k}(x_{i},c_{i})||^{2}$ . In this work, we adopt the exponential loss by setting $\phi (v) = e^{-v}$ , leading to the multi-class version of Algorithm 1 for the implementation of the optimal multi-class teacher. + +# 4. Connections to boosting + +The algorithm above has certain similarities with boosting. Note that the weights of (10) are the weights of boosting + +![](images/cc9d470f77af50dbce3c8595673e8830d203eb2e9de45bfd7191b8e3c972a27d.jpg) +(a) butterflies +(b) Chinese Characters + +![](images/434fb3fb633fe7341d8f8223a322ff49be09a41ebfb66405e5a8d0cf18d1119f.jpg) +Figure 3: Example images from our two datasets + +at the end of the iteration that produces $f$ as strong classifier. Boosting then selects the weak learner $g^{*}$ that maximizes (12), adds this to $f$ to produce the new strong classifier and iterates. Since examples of large weight are those worse classified by $f$ , the algorithm focuses on the hardest examples (for the currently learned classifier) to pick the next weak learner. The MaxGrad teacher does essentially the same. In this case, $f^t$ is the predictor currently learned by the optimal student, and the teacher selects the hardest examples for the student. However, in boosting, this is used to perform one learning iteration and select one weak learner. In machine teaching, the student is assumed to be able to fully learn $\mathcal{L}^t$ , i.e. does not simply perform a gradient iteration on $R_{\mathcal{D}}(f^t)$ but actually solves (4). If, for example, the student is a machine learning algorithm, this can be done by implementing the complete boosting algorithm on $R_{\mathcal{L}^t}(f)$ . While boosting uses the entire example population $\mathcal{D}$ to perform a boosting iteration and select a single weak learner, the machine teaching algorithm selects the best set $\mathcal{N}^t$ of $\tau$ novel examples to add to $\mathcal{L}^t$ and performs any number of boosting iterations needed to solve the new teaching set $\mathcal{L}^t = \mathcal{L}^{t-1} \cup \mathcal{N}^t$ . In summary, while boosting assumes a weak learner with access to the entire dataset $\mathcal{D}$ , the machine teaching algorithm assumes a strong learner with access to the limited information available in $\mathcal{L}^t$ . + +# 5. Experiments + +Dataset: MaxGrad was evaluated on two datasets, Butterflies and Chinese Characters illustrated in Figure 3. Butterflies [29] is a fine-grained multi-class dataset of images of five butterfly species, captured in a large variety of settings, from the iNaturalist dataset [43]. It is a challenging dataset due to the large intra-class image diversity, low image resolution, and high similarity of some of the species. Chinese Characters [25, 18] consists of three similar Chinese characters: Grass, Mound, and Stem. The images vary in difficulty, due to a large variety of handwriting styles and image qualities. We use the training-testing split of [29] on both cases. The data is accessible in [28]. The teaching set is selected from the training set. + +Implementation details: Both datasets were subject to standard normalizations. The pre-trained ResNet-18 [16] on ImageNet is used to simulate the student. This is equivalent to assuming a student that starts from a good generic understanding of image classification. The student learners are trained 10 epochs by gradient descent with batch size equal to $|\mathcal{L}^t|$ and weight decay of $1e - 4$ . The learning rate is set to $1e - 4$ with 0.9 momentum. For fair comparison with + +![](images/6dcc67c8d8fc79cbcd1bc23e9d9423fdeddcb3a52548684f85c91dc1c4e7824c.jpg) +(a) butterflies +Figure 4: Test set accuracy of simulated students as a function of teaching iterations. + +![](images/cdfbe4c4acebd692546bca08a62edca966ad89489acfd08fff22c0059a027641.jpg) +(b) Chinese Characters + +
ButterfliesChinese Char.
RANDOM65.2047.05
STRICT [39]65.0051.51
EXPLAIN [29]68.3365.44
omniIMT* [26]70.07(18.30)64.36(19.58)
imiIMT* [26]72.70(17.63)64.46(23.72)
bbIMT* [27]76.09(18.05)64.37(19.57)
RANDOM*63.15(18.17)51.53(24.47)
MaxGrad80.33(19.76)81.89(12.93)
+ +Table 1: Test set accuracies for MTurk learners. Methods with superscript “*” represent our implementations. For top RANDOM, value is from [29]. Values are presented by mean(std). + +other methods [26, 39, 29, 27], novel sets of size $\tau = 1$ were used in all experiments, i.e. a single example is selected per iteration. + +# 5.1. Evaluation with simulated learners + +We start with evaluations on simulated learners, i.e. a classifier. This enables a simple evaluation setting and fully reproducible experiments. Figure 4 shows the accuracies of student networks taught with examples selected randomly (RANDOM), by STRICT [39], EXPLAIN [29], omniscient teacher (omniIMT) [26], imitation teacher (imiIMT) [26], black-box IMT (bbIMT) [27], and MaxGrad. While student performance improves with teaching set size for all methods, MaxGrad has the fastest growth and the best performance for all iterations. The gains are significant: in butterflies and characters it achieves an accuracy at 15 iterations that others do not reach before 20 iterations. Of all algorithms, it is also the only to stably outperform RANDOM. + +# 5.2. Evaluation with real learners + +We next tested the algorithm on MTurk users. Note that a student network was still used to assemble the teaching set, which was then used to train MTurkers. In this case, the student network was trained without any stochasticity. We used gradient descent and gave up data augmentation techniques (e.g. random crops or flips) that are not accessible to the human students. The codewords $y^{c}$ of Algorithm 1 were initialized with the canonical basis and refined during the student optimization. + +The MTurk experiments followed the setting of [29, 39], using 40 workers per dataset. The teaching process consists + +of two phases, teaching and testing. Before teaching, workers were shown a brief introduction to the teaching task. In the teaching stage, they were shown a sequence of 20 images. At each iteration, they were asked to select a category from a list of candidate options, and received feedback declaring their choice 'Correct' or 'Incorrect,' as well as the true class. Upon this, learners had to wait for a minimum of 2 seconds before proceeding to the next iteration. After teaching, 20 randomly selected test images were assigned to each learner, who was asked to classify them. These random images were different per learner and no feedback was provided as they were classified. + +Table 1 reports the accuracy of image classification by the students on the test set. The results shown in the top third of the table (RANDOM, STRICT and EXPLAIN) are taken from [29]. For completeness, we repeated the experiments with random image selection, which produced similar results, as shown in the bottom third. The remaining three results of previous methods (center third of the table) are obtained with our own implementation. MaxGrad significantly outperforms the previous approaches, achieving gains of almost 5 (17) points on Butterflies (Chinese characters). Finally, we observe that human test accuracy is higher than that of the simulated student used to collect the training set, shown in Figure 4. This confirms that the optimal student assumption is realistic for human learners. + +# 5.3. Comparison with related methods + +We use simulated learners to compare MaxGrad to related algorithms beyond the machine teaching literature: curriculum learning [4, 14], active learning [37, 45] and passive learning. Curriculum learning (CL) orders training examples by complexity. The student is introduced to easier examples first and then harder ones. CL has been empirically shown to accelerate and improve learning. In active learning (AL), the student actively selects examples to be annotated. The annotator can be seen as an oracle teacher. Passive learning (PL) denotes standard supervised learning on the whole training set. Two representative methods, [14] for CL and [45] for AL, are adopted for comparison, with the results of Figure 5. + +To compare to CL and AL, we plot the curves of test set accuracy v.s. teaching example number. MaxGrad outperforms the two algorithms substantially. This is not surprising, because CL only sees a few (20) easy examples and cannot generalize to hard ones during testing. It requires long-term training on the whole dataset to reach good accuracy. The weaker performance of AL is explained by the fact that the examples are selected by the student not the teacher. The teacher only labels them. Hence, the teaching set is not globally optimal. To compare with PL, we plot the curves of test accuracy vs teaching iteration. MaxGrad ascends faster than PL after 10 (7) iterations on butterflies (characters). This suggests that, when only a limited number of iterations + +![](images/d98ee59ccac3616c3974285faf9a9bf5cc3cba5f63d15e9e75df6cf913209f2a.jpg) +(a) butterflies + +![](images/793e68f9088db82ac9d1566b92f9f6eb38795885915b563e360e478b48ce5f0a.jpg) +(b) Chinese Characters + +![](images/23d93437ee13c6a04db21293a0c8689b7dc1babf1bbbe83f44bc32ad43a7bc3d.jpg) +Figure 5: Test set accuracy of simulated students as a function of teaching iterations (teaching example number). +Figure 6: Randomly selected teaching sequence from the Butterflies teaching set + +is allowed, teaching with a MaxGrad teaching set is more efficient than with the whole training set. + +# 5.4. Sample Images + +To gain some intuition about the teaching sets selected by MaxGrad, we show a (randomly selected) sequence of 5 teaching examples from Butterflies in Figure 6. It can be seen that, beyond a few "normal" images that teach students the appearance of the concepts, the algorithm selects images with unusual poses, low-resolution, and even camouflage. This is consistent with MaxGrad's example selection based on large negative margins. These images force the students to focus attention on features that are essential for class discrimination, speeding up the learning process. The improved student performance suggests some degree of overlap between the criteria used by MaxGrad and humans to assess example difficulty. + +# 6. Conclusion + +In this paper, we have proposed MaxGrad, a new gradient-based machine teaching algorithm derived from the optimal student assumption. We have demonstrated its effectiveness on both synthetic and human student teaching experiments. While we have not considered the integration of teaching and explanations yet, MaxGrad can be generalized to accommodate the latter. For example, explanations can be merged with classifier training using attention mechanisms. This is left for future research. + +Acknowledgement This work was partially funded by NSF awards IIS-1924937, IIS-2041009, a gift from Amazon, a gift from Qualcomm, and NVIDIA GPU donations. We also acknowledge and thank the use of the Nautilus platform for some of the experiments discussed above. + +# References + +[1] Antreas Antoniou and Amos J Storkey. Learning to learn by self-critique. In Advances in Neural Information Processing Systems, pages 9936-9946, 2019. +[2] Ji Hyun Bak, Jung Yoon Choi, Athena Akrami, Ilana Witten, and Jonathan W Pillow. Adaptive optimal training of animal behavior. In Advances in neural information processing systems, pages 1947-1955, 2016. +[3] Sumit Basu and Janara Christensen. Teaching classification boundaries to humans. In Twenty-Seventh AAAI Conference on Artificial Intelligence, 2013. +[4] 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. +[5] Cory J Butz, Shan Hua, and R Brien Maguire. A web-based intelligent tutoring system for computer programming. In IEEE/WIC/ACM International Conference on Web Intelligence (WI'04), pages 159-165. IEEE, 2004. +[6] Maya Cakmak and Manuel Lopes. Algorithmic and human teaching of sequential decision tasks. In Twenty-Sixth AAAI Conference on Artificial Intelligence, 2012. +[7] Yuxin Chen, Oisin Mac Aodha, Shihan Su, Pietro Perona, and Yisong Yue. Near-optimal machine teaching via explanatory teaching sets. In International Conference on Artificial Intelligence and Statistics, pages 1970-1978, 2018. +[8] 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. +[9] Sharon J Derry and Debra A Murphy. Designing systems that train learning ability: From theory to practice. Review of educational research, 56(1):1-39, 1986. +[10] Michael Eickenberg, Alexandre Gramfort, Géral Varoquaux, and Bertrand Thirion. Seeing it all: Convolutional network layers map the function of the human visual system. NeuroImage, 152:184-194, 2017. +[11] 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. +[12] Yoav Freund, Robert Schapire, and Naoki Abe. A short introduction to boosting. Journal-Japanese Society For Artificial Intelligence, 14(771-780):1612, 1999. +[13] Elena L Grigornko, Robert J Sternberg, and Madeline E Ehrman. A theory-based approach to the measurement of foreign language learning ability: The canal-f theory and test. The Modern Language Journal, 84(3):390-405, 2000. +[14] Guy Hacohen and Daphna Weinshall. On the power of curriculum learning in training deep networks. ICML, 2019. +[15] Nile W Hatch and Jeffrey H Dyer. Human capital and learning as a source of sustainable competitive advantage. Strategic management journal, 25(12):1155-1178, 2004. +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceed- + +ings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +[17] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. +[18] Edward Johns, Oisin Mac Aodha, and Gabriel J Brostow. Becoming the expert-interactive multi-class machine teaching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2616–2624, 2015. +[19] 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. +[20] Alexander Kolesnikov, Xiaohua Zhai, and Lucas Beyer. Revisiting self-supervised visual representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1920-1929, 2019. +[21] Simon Kornblith, Jonathon Shlens, and Quoc V Le. Do better imagenet models transfer better? In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2661-2671, 2019. +[22] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Tom Duerig, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. arXiv preprint arXiv:1811.00982, 2018. +[23] Dong Li, Wei-Chih Hung, Jia-Bin Huang, Shengjin Wang, Narendra Ahuja, and Ming-Hsuan Yang. Unsupervised visual representation learning by graph-based consistent constraints. In European Conference on Computer Vision, pages 678-694. Springer, 2016. +[24] 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. +[25] Cheng-Lin Liu, Fei Yin, Da-Han Wang, and Qiu-Feng Wang. Casia online and offline chinese handwriting databases. In 2011 International Conference on Document Analysis and Recognition, pages 37-41. IEEE, 2011. +[26] Weiyang Liu, Bo Dai, Ahmad Humayun, Charlene Tay, Chen Yu, Linda B Smith, James M Rehg, and Le Song. Iterative machine teaching. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 2149-2158. JMLR.org, 2017. +[27] Weiyang Liu, Bo Dai, Xingguo Li, Zhen Liu, James M Rehg, and Le Song. Towards black-box iterative machine teaching. International Conference on Machine Learning, 2018. +[28] Oisin Mac Aodha, Shihan Su, Yuxin Chen, Pietro Perona, and Yisong Yue. https://github.com/macaodha/explain_teach/tree/master/data. +[29] Oisin Mac Aodha, Shihan Su, Yuxin Chen, Pietro Perona, and Yisong Yue. Teaching categories to human learners with visual explanations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3820-3828, 2018. + +[30] Kaustubh R Patil, Jerry Zhu, Łukasz Kopeć, and Bradley C Love. Optimal teaching for limited-capacity human learners. In Advances in neural information processing systems, pages 2465-2473, 2014. +[31] Chris Piech, Jonathan Bassen, Jonathan Huang, Surya Ganguli, Mehran Sahami, Leonidas J Guibas, and Jascha Sohl-Dickstein. Deep knowledge tracing. In Advances in neural information processing systems, pages 505-513, 2015. +[32] Anna N Rafferty, Emma Brunskill, Thomas L Griffiths, and Patrick Shafto. Faster teaching via pomdp planning. Cognitive science, 40(6):1290-1332, 2016. +[33] Mohammad Saberian and Nuno Vasconcelos. Multiclass boosting: Margins, codewords, losses, and algorithms. Journal of Machine Learning Research, 20(137):1-68, 2019. +[34] Mohammad J Saberian and Nuno Vasconcelos. Multiclass boosting: Theory and algorithms. In Advances in Neural Information Processing Systems, pages 2124-2132, 2011. +[35] Jonathan Sauder and Bjarne Sievers. Self-supervised deep learning on point clouds by reconstructing space. In Advances in Neural Information Processing Systems, pages 12942-12952, 2019. +[36] Katja Seeliger, Matthias Fritsche, Umut Güçlü, Sanne Schoenmakers, J-M Schoffelen, SE Bosch, and MAJ Van Gerven. Convolutional neural network-based encoding and decoding of visual object recognition in space and time. NeuroImage, 180:253-266, 2018. +[37] Burr Settles. Active learning literature survey. Technical report, University of Wisconsin-Madison Department of Computer Sciences, 2009. +[38] Herbert A Simon. Bounded rationality and organizational learning. Organization science, 2(1):125-134, 1991. +[39] Adish Singla, Ilija Bogunovic, Gábor Bartók, Amin Karbasi, and Andreas Krause. Near-optimally teaching the crowd to classify. In ICML, volume 1, page 3, 2014. +[40] Shihan Su, Yuxin Chen, Oisin Mac Aodha, Pietro Perona, and Yisong Yue. Interpretable machine teaching via feature feedback. 2017. +[41] Qianru Sun, Yaoyao Liu, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning for few-shot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 403-412, 2019. +[42] 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 Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1199-1208, 2018. +[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. +[44] Luis Von Ahn. Duolingo: learn a language for free while helping to translate the web. In Proceedings of the 2013 international conference on Intelligent user interfaces, pages 1-2, 2013. + +[45] Dan Wang and Yi Shang. A new active labeling method for deep learning. In 2014 International joint conference on neural networks (IJCNN), pages 112-119. IEEE, 2014. +[46] Wei Ying, Yu Zhang, Junzhou Huang, and Qiang Yang. Transfer learning via learning to transfer. In International Conference on Machine Learning, pages 5085-5094, 2018. +[47] Lu Yu, Vacit Oguz Yazici, Xialei Liu, Joost van de Weijer, Yongmei Cheng, and Arnau Ramisa. Learning metrics from teachers: Compact networks for image embedding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2907-2916, 2019. +[48] Astrid A Zeman, J Brendan Ritchie, Stefania Bracci, and Hans Op de Beeck. orthogonal representations of object shape and category in deep convolutional neural networks and human visual cortex. Scientific Reports, 10(1):1-12, 2020. +[49] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. +[50] Yao Zhou, Arun Reddy Nelakurthi, and Jingrui He. Unlearn what you have learned: Adaptive crowd teaching with exponentially decayed memory learners. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2817-2826, 2018. +[51] Jerry Zhu. Machine teaching for bayesian learners in the exponential family. In Advances in Neural Information Processing Systems, pages 1905-1913, 2013. +[52] Xiaojin Zhu, Adish Singla, Sandra Zilles, and Anna N Rafferty. An overview of machine teaching. arXiv preprint arXiv:1801.05927, 2018. \ No newline at end of file diff --git a/gradientbasedalgorithmsformachineteaching/images.zip b/gradientbasedalgorithmsformachineteaching/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6f0d0daedb3ace3df0e6df27ba52af7519e66c7b --- /dev/null +++ b/gradientbasedalgorithmsformachineteaching/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67d40b965b32011c5e956210a2e36e131b6b5c41cf7c9c7fd742f46c3c69f8e6 +size 363477 diff --git a/gradientbasedalgorithmsformachineteaching/layout.json b/gradientbasedalgorithmsformachineteaching/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5e7c923bad477a65da994b2475dabba9f91a65a0 --- /dev/null +++ b/gradientbasedalgorithmsformachineteaching/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a1c39223e6380ac5f7a86dae305f9226101e757a881a83194ec4d9380633225 +size 556053 diff --git a/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_content_list.json b/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..358a5b50972febaf5c30675e39a55f7d899c49e8 --- /dev/null +++ b/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47e7df0ff599cd4c588d2df9e388d17bba129420bd05aac9a088a45ea057c1af +size 76601 diff --git a/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_model.json b/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a0e208ee89ffd06b73d45cc528a3ad10dad4e6ab --- /dev/null +++ b/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c29c66ea52e02a7dabf79b192d9d5bc53485ace430cfc078ce2da70171af9bd +size 96145 diff --git a/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_origin.pdf b/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7d65259ff6aa3d557419b0c8917dff4d42b8870f --- /dev/null +++ b/gradientforwardpropagationforlargescaletemporalvideomodelling/8071de7d-56be-4bc4-8882-7ca6049bdc69_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76bbc297d8ab14249aa8ebff8142785474f4cfafddc873758b862cfa6797b3c5 +size 4114896 diff --git a/gradientforwardpropagationforlargescaletemporalvideomodelling/full.md b/gradientforwardpropagationforlargescaletemporalvideomodelling/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ba523ec660eb95bf4a639ac8ad852bf8df67338a --- /dev/null +++ b/gradientforwardpropagationforlargescaletemporalvideomodelling/full.md @@ -0,0 +1,284 @@ +# Gradient Forward-Propagation for Large-Scale Temporal Video Modelling + +Mateusz Malinowski* DeepMind + +Dimitrios Vytiniotis DeepMind + +Grzegorz Świrszcz DeepMind + +Viorica Pătrăucean DeepMind + +João Carreira DeepMind + +# Abstract + +How can neural networks be trained on large-volume temporal data efficiently? To compute the gradients required to update parameters, backpropagation blocks computations until the forward and backward passes are completed. For temporal signals, this introduces high latency and hinders real-time learning. It also creates a coupling between consecutive layers, which limits model parallelism and increases memory consumption. In this paper, we build upon Sideways, which avoids blocking by propagating approximate gradients forward in time, and we propose mechanisms for temporal integration of information based on different variants of skip connections. We also show how to decouple computation and delegate individual neural modules to different devices, allowing distributed and parallel training. The proposed Skip-Sideways achieves low latency training, model parallelism, and, importantly, is capable of extracting temporal features, leading to more stable training and improved performance on real-world action recognition video datasets such as HMDB51, UCF101, and the large-scale Kinetics-600. Finally, we also show that models trained with Skip-Sideways generate better future frames than Sideways models, and hence they can better utilize motion cues. + +# 1. Introduction + +Popular deep video models generally rely on spatiotemporal convolutional networks (3D CNNs) [12, 18, 52, 55, 63] or recurrent networks [16, 24, 34] that are trained with backpropagation (BP) using stochastic gradient descent (SGD) [7, 19, 29, 33, 46, 57, 58, 60, 64]. This is a powerful training paradigm but also an expensive one as it needs to store all the activations in memory to compute Jacobian tensors for the gradient calculations. First, all the activations are computed in the forward mode, from the beginning to the end of the sequence. Next, gradients are computed in the reverse direction, from the end to the beginning. All that + +severely limits the scale at which we can train temporal models on large-volume sequences such as videos. Therefore, typically these video models are trained on short video clips (about 2.5s at usual frame rate), in offline batch mode. + +Sideways [38] is a recent training technique for video models that decouples the computation along the depth of the network and introduces computation steps. As a new frame is fed into the processing pipeline, each layer independently updates the internal state of the network by computing new activations and gradients. Next, these are passed to the layers above and below in the next computation step (see Figure 1 left). Moreover, the information cannot be backpropagated to the same units that produced the activations as this happened in the past computation steps. One may say that "everything flows forward in time", including the backward pass. Due to these properties, Sideways is more biologically plausible than the regular backprop, as it does not block the computation and respects the arrow of time. + +Although Sideways, as originally proposed, operates in a temporal forward fashion, it is not a temporal model per se, as it has access only to the present frame at each time step. This results in improved memory efficiency similar to single-frame models, making it suitable for real-time applications. However, this comes with the cost of not integrating information temporally, which limits the expressive power of the resulting models. + +In this work, we show that it is possible for models to process one frame at a time similar to Sideways, while still being able to extract temporal features. We do this by introducing shortcut (skip) connections in addition to direct connections between the layers of the model. We study the training dynamics of the resulting training procedure, which we call Skip-Sideways, and show that shortcut connections lead to more stable training and higher accuracy. + +Regular skip connections [21] alter the information flow along the data path of the network by allowing activations to 'skip' layers, creating data shortcuts. In the proposed Skip-Sideways, activations and gradients along the shortcut connections are also sent forward in time, effectively creating data paths across time, making it possible to extract + +temporal features. This change not only extends the modelling space, which subsumes spatio-temporal models, but also gives an interesting perspective on shortcut connections that are typically associated with vanishing or exploding gradients [20, 23], or ensembles [56]. + +To validate the proposed setting, we train a traditional image architecture, e.g., VGG [49], on action recognition datasets [31, 50], including a large-scale one - Kinetics-600 [12] - by encapsulating the neural modules in Skip-Sideways units. Since there is no data dependency between units at any one time step, they can process the data in a depth-asynchronous fashion, maximising parallelism. This results in a significant speed-up and reduced latency. The efficiency of the whole network depends only on the worst-case efficiency of an individual Skip-Sideways unit. + +To the best of our knowledge, Skip-Sideways is the first alternative to backpropagation, more biologically plausible, that is successfully used to train video models at scale. + +# 2. Related Work + +Pipelined training. We are inspired by recent works on pipelining during inference [11] and training [26, 38]. In particular, Sideways [38] derives approximate backpropagation rules by taking advantage of the smoothness of the input signal. Even though the authors show that training is possible even with the mismatch between gradients and activations, their method is unable to learn about scene dynamics during training and inference, and has not yet been demonstrated outside of small-scale settings. $G_{\text{Pipe}}$ [26] is another training procedure that does exact backprop by splitting batches into micro-batches, allowing more efficient training. However, it maintains a 'bubble' to ensure gradient correctness (Figure 2 in [26]), hence it cannot use all the hardware resources in parallel, it needs to store activations, still blocks input frames, and due to the 'bubble' the performance is not the same across all frames in the sequence. + +Shortcut connections. Skip connections have become ubiquitous design elements in modern neural networks [8, 9, 20, 21, 25, 45, 51, 53]. These modules were originally introduced to improve training dynamics, by allowing layers to learn residual representations w.r.t. their preceding layers. This alleviates the modelling burden and results in better propagation of gradients to shallower layers through shortcut connections. Here, the skip connections do not only shortcut between layers along depth, but also along time, by sending activations forward in time [11, 36]. In this way, we can turn frame-based models into spatio-temporal ones. + +Alternatives to backpropagation (BP). Even though BP is the most commonly used method for training neural networks, multiple works have shown its limitations. BP's biological plausibility is questionable [5, 6, 30, 35], as the chain rule blocks computations during the forward and backward passes and uses symmetric weights in both passes [41] + +- this operating regime is unlikely to exist in biological systems. Moreover, this also results in high-latency and low throughput in training and deployment of temporal models [11, 38], as it unnecessarily couples consecutive layers of the neural network architecture, limiting model parallelism and increasing both memory and energy consumption. + +Various decoupling strategies [1, 2, 3, 4, 11, 14, 15, 27, 37, 38, 41, 42] deal with some shortcomings of BP, but are often applied to visually simpler domains, or static images, or require extra buffers, or investigate solely a biological aspect. Here, we are interested in decoupling rules that work well at scale and are applicable to temporally smooth input signals such as videos, that have slowly varying features [62]. + +Spatio-temporal models. Spatio-temporal convolutional neural networks (3D CNNs) [12, 18, 52, 55, 63] have become popular recently, mostly due to their performance. However, since they process the whole sequence at once, they are unsuitable for real-time applications and are expensive for representing longer videos, as their memory footprint and training latency grow with the length of the sequence when trained with BP. Recurrent neural networks (RNN) [16, 24, 34] aggregate information over time and are more suitable for online and causal settings. However, the same memory and latency problems encountered when training 3D CNNs with BP are also present here as RNNs require costly backprop-through-time (BPTT) for training [47, 57, 59]. BPTT scales linearly with the length of the input signal and requires propagation of information forward and backward in time. Likewise, causal 3D CNNs[43] still uses costly BP training that has to be done offline. In our work, we investigate the setting where: (1) models learn in real-time, (2) with a direct access only to present data frame, (3) the information (activations, gradients) is sent only forward in time, (4) the training latency is low, and (5) we can distribute and parallelize computations. + +Recent works [5, 11, 22, 38] model temporal connectivities between modules by connecting consecutive layers at different time steps. Such a structure has implications on learning representation [5, 22] and efficiency [11, 38] as it allows depth-parallel computations of activations and pseudo-gradients. Our work belongs to the latter category and we leave learning representation as a future direction. + +Forward propagation in time. Regular training of temporal models with BP or BPTT suffers from the timing problem. The common assumption is that the computation of activations and gradients and their propagation are instantaneous [6, 38] – this is not physically possible. Real Time Recurrent Learning (RTRL) [39, 40, 61] and Sideways [38] attempt to mitigate this issue. RTRL computes correct gradients in the forward mode. However, this approach scales poorly for larger input signals as it requires costly high-rank tensor computations. Sideways and our Skip-Sideways, on the other hand, use approximate gradients in the derivations. + +# 3. Background + +This section formalizes the learning problem and briefly describes Sideways [38] - the method upon which we build. Notation. We use the same notation as [38]. We denote input temporal sequences by $\pmb{x} = (\pmb{x}^{[t]})_{t=1}^{K}$ , $\pmb{x}^{[t]} \in \mathbb{R}^d$ and outputs by $\pmb{y} = (\pmb{y}^{[t]})_{t=1}^{K}$ , $\pmb{y}^{[t]} \in \mathbb{R}^{d_y}$ . To compute Jacobians we use the following notation. Let $\frac{\partial h_l}{\partial h_{l-1}}(\pmb{h}_{l-1}, \pmb{\theta}_l) = \left.\frac{\partial H(h, \pmb{\theta})}{\partial h}\right|_{h=h}$ be the Jacobian tensor of $H(h, \theta)$ with respect to the variable $h$ evaluated at $h = h$ , $\theta = \pmb{\theta}$ . Note that, we use bold fonts to distinguish between formal and actual values of the variables. We present complete notation in the supplementary material. + +Real-time learning. We are mostly interested in efficient, low-latency training, suitable for real-time applications. Therefore, we propose the following real-time constraints on our learning problem. We assume that the model has no direct access to future data, i.e. causal setting, and has limited direct access to its past inputs. That is, at time-step $t$ the learning problem is just as a function of $\{(x^{[t - k]},y^{[t - k]}),\ldots ,(x^{[t]},y^{[t]})\}$ . In this work, we only investigate the case with $k = 0$ . Moreover, training needs to also scale gracefully to longer sequences, so ideally the memory consumption is independent of the inputs sequence length, and the training does not block computations allowing processing the stream of input data at sufficiently high frame-rate without dropping or buffering input frames. In our case, we use 25fps, which is common in video modelling. + +Reverse and forward automatic differentiation. BP implements reverse mode for gradient calculation. This allows for efficient gradient calculations by keeping all the tensors low-rank. More precisely, in the reverse mode, we always combine low-rank gradients with higher-rank Jacobian tensors yielding low-rank outputs. That is, if $\nabla_{h_l}l\in \mathbb{R}^n$ and $\frac{\partial h_l}{\partial h_{l - 1}} (h_{l - 1},\pmb {\theta}_l)\in \mathbb{R}^{n^2}$ , we have $\nabla_{h_l}l\frac{\partial h_l}{\partial h_{l - 1}} (\pmb {h}_{l - 1},\pmb {\theta}_l)\in \mathbb{R}^n$ as opposed to the forward mode $\frac{\partial h_l}{\partial h_{l - 1}} (h_{l - 1},\pmb {\theta}_l)\frac{\partial h_{l + 1}}{\partial h_l} (h_l,\pmb {\theta}_{l + 1})\in \mathbb{R}^{n^2}$ implemented by RTRL [61]. The downside of BP is that it has to store in memory the activations over time until the gradients/Jacobians can be computed. + +Sideways alters the chain rule of regular BP. It does so by taking into account the passage of time to evaluate individual components of the chain rule at different time steps. The easiest way to think about it is through the composition of two functions. BP assumes the whole process is instantaneous and, in practice, it blocks computations. Therefore, if $F = G \circ H(\pmb{x}^{[1]}),$ we have $\frac{\partial f}{\partial x}(\pmb{x}^{[1]}) = \frac{\partial g}{\partial h} (H(\pmb{x}^{[1]}) \cdot \frac{\partial h}{\partial x} (\pmb{x}^{[1]})$ . In this way BP combines Jacobians of the same input frame. In contrast, Sideways [38] avoids blocking computations by combining Jacobians of different input frames and computing approximate gradients; we will refer to these approximate gradients as pseudo-gradients in the following. For the composition above, Sideways com + +putes $\frac{\partial f}{\partial x} (\pmb{x}^{[1]}) = \frac{\partial g}{\partial h} (H(\pmb{x}^{[1]}))\cdot \frac{\partial h}{\partial x} (\pmb{x}^{[2]})$ , so that two inputs can be processed at the same time, and it approximates BP if $\pmb{x}^{[1]}\approx \pmb{x}^{[2]}$ . Figure 1 (left) illustrates the idea. Note that since there are no vertical arrows to introduce dependencies, all the layers of the network can be executed in parallel using an appropriate distributed hardware setting. The error introduced by this scheme is difficult to formally quantify. Sideways relies on the fact that the input sequences are smooth and are sampled with a sufficiently high frame-rate, which was empirically shown to hold for real videos and hence validating Sideways. We assume the same here. + +# 4. Skip-Sideways + +Single-frame (2D) CNNs do not have access to motion information other than perhaps through motion blur or semantics. The same holds for Sideways1. This narrow temporal receptive field motivates us to extend Sideways by introducing shortcut connections. Figures 1 and 2 illustrate the difference between Sideways and Skip-Sideways. We can see that due to the temporal aggregation happening in the forward propagation of both activations and pseudo-gradients through the shortcut connections, individual units have indirect access to more frames. Moreover, their receptive fields increase linearly with the depth of the network, similarly to 3D CNNs with stride 1 [12, 28, 54, 55]. We formalise the forward propagation of activations and pseudo-gradients with shortcut connections in the next paragraphs. + +Forward-propagation of activations (FA). Skip-Sideways has two types of connections: direct connections, similar to Sideways depicted in Figure 2 with solid arrows, and shortcut connections shown in Figure 2 right, with dotted arrows. In this setting, one unit can receive information from several shallower units, e.g., to pool activations from two units, following formula is used: + +$$ +\boldsymbol {\gamma} _ {l} ^ {[ t ]} = \boldsymbol {h} _ {l - 1} ^ {[ t - 1 ]} \oplus \tau \boldsymbol {h} _ {l - 2} ^ {[ t - 1 ]} \tag {1} +$$ + +where $\oplus$ is a fusion operator (either addition or concatenation), and $\tau$ denotes the operation to match dimensions between $h_{l-1} \in \mathbb{R}^{d_{l-1}}$ and $h_{l-2} \in \mathbb{R}^{d_{l-2}}$ , e.g., max-pool or tile. We can also extend the notation above to $k$ units, i.e., + +$$ +\boldsymbol {\gamma} _ {l} ^ {[ t ]} = \boldsymbol {h} _ {l - 1} ^ {[ t - 1 ]} \oplus \tau \boldsymbol {h} _ {l - 2} ^ {[ t - 1 ]} \oplus \dots \oplus \tau^ {k - 1} \boldsymbol {h} _ {l - k} ^ {[ t - 1 ]} +$$ + +where $\tau^2 = \tau \circ \tau$ and $\circ$ is composition. For the sake of clarity, we keep our discussion constrained to two blocks only. Note that Sideways uses a special case when $\gamma_l^{[t]} = h_{l - 1}^{[t - 1]}$ . + +The choice of fusion operator $\oplus$ in Equation 1 subtly influences the training behaviour. Both addition and concatenation are used in the literature, e.g., addition in ResNets [21], + +![](images/5d1a22d3285bb16effdc6e4d97383eb485da2dc466c7fe9a2834f4f4cfe5bd31.jpg) +Figure 1: Sideways (left) and our Skip-Sideways (right) unrolled over computation steps. The coloured squares indicate data frames. Circles indicate neural modules inside Sideways or Skip-Sideways units. We exemplify a fragment that corresponds to the forward pass from $\pmb{x}^{[t_1]}$ (dotted arrows) along with the backward pass (solid arrows). In Skip-Sideways, green arrows illustrate that the information is sent to different units in the next computation step. Red arrows illustrate how information is integrated from different units in the previous computation step. Empty circles indicate units outside of the exemplified fragment. Circles with a single colour indicate where the information has originated from. Circles with multiple colours indicate how the information is combined together in the backward pass (we only exemplify a few such units). Individual colours of these multi-coloured circles indicate where the information has originated from. For instance, combining 'blue gradient' with 'yellow activations' yields 'blue-yellow gradient' (6th computation step and second-last unit). Circles with the red border show the temporal receptive field of the top unit during the forward pass in Skip-Sideways. Best viewed in color. + +![](images/6934292900869686e974397ef9ab36bc70f275a290e7d115f6ba3d181975f6fa.jpg) + +and concatenation in U-NET [48]. Addition is a commutative operation which might prevent the network from differentiating between activations coming from direct or shortcut connections. Concatenation, on the other hand, does not suffer from this ambiguity and allows the network to learn appropriate weights to aggregate the information coming from direct and shortcut connections, respectively. Note also that concatenation is well suited to pool over units with different numbers of channels as $\pmb{h}_l \oplus \pmb{h}_k \in \mathbb{R}^{d_l} \oplus \mathbb{R}^{d_k} \cong \mathbb{R}^{d_l + d_k}$ and therefore we do not need to perform extra operations to match the channel dimension; this comes however with an increase in the number of model parameters. We report experiments and ablations for both fusion options. + +Forward propagation of pseudo-gradients. To account for the aggregation of activations through shortcut connections, we distribute pseudo-gradients using shortcut connections that mirror their counterparts. Figure 2 shows that a single Sideways unit (red circle in the left figure) takes activations $\pmb{h}_{l-1}^{[t-1]}$ and pseudo-gradient $\widetilde{\nabla}_l^{t-1} l$ as inputs, combines them, and outputs new activations $\pmb{h}_l^{[t]}$ and pseudo-gradients $\widetilde{\nabla}_{l-1}^{t} l$ that are next sent towards the future computation steps upwards and downwards, respectively. + +In Skip-Sideways (Figure 2, right), we integrate activations from direct and shortcut connections, $\pmb{h}_{l-1}^{[t-1]}$ , $\tau \pmb{h}_{l-2}^{[t-1]}$ together with pseudo-gradients $\widetilde{\nabla}_{h_l}^{t-1} l$ and $\widetilde{\nabla}_{\tau h_l}^{t-1} l$ . Next, the neural unit processes such information and redistributes activations through direct and shortcut connections, $\pmb{h}_l^{[t]}$ and $\tau \pmb{h}_l^{[t]}$ , together with the corresponding pseudo-gradients, + +$\widetilde{\nabla}_{h_{l-1}}^t l$ and $\widetilde{\nabla}_{\tau h_{l-2}}^t l$ . + +Using total derivative, we can write formally the forward propagation of pseudo-gradients used in Skip-Sideways: + +$$ +\widetilde {\nabla} _ {\gamma_ {l}} ^ {t} l = \left(\widetilde {\nabla} _ {h _ {l}} ^ {t - 1} l + \widetilde {\nabla} _ {\tau h _ {l}} ^ {t - 1} l\right) \cdot \frac {\partial h _ {l}}{\partial \gamma_ {l}} \left(\boldsymbol {h} _ {l - 1} ^ {[ t - 1 ]}, \boldsymbol {h} _ {l - 2} ^ {[ t - 1 ]}, \boldsymbol {\theta} _ {l}\right) (2) +$$ + +$$ +\tilde {\nabla} _ {h _ {l - 1}} ^ {t} l = \quad \tilde {\nabla} _ {\gamma l} ^ {t} l \cdot \frac {\partial \gamma_ {l}}{\partial h _ {l - 1}} \left(\boldsymbol {h} _ {l - 1} ^ {[ t - 1 ]}, \boldsymbol {h} _ {l - 2} ^ {[ t - 1 ]}\right) \tag {3} +$$ + +$$ +\widetilde {\nabla} _ {\tau h _ {l - 2}} ^ {t} l = \quad \widetilde {\nabla} _ {\gamma l} ^ {t} l \cdot \frac {\partial \gamma_ {l}}{\partial h _ {l - 2}} \left(\boldsymbol {h} _ {l - 1} ^ {[ t - 1 ]}, \boldsymbol {h} _ {l - 2} ^ {[ t - 1 ]}\right) \tag {4} +$$ + +$$ +\widetilde {\nabla} _ {\theta_ {l}} ^ {t} l = \left(\widetilde {\nabla} _ {h _ {l}} ^ {t - 1} l + \widetilde {\nabla} _ {\tau h _ {l}} ^ {t - 1} l\right) \cdot \frac {\partial h _ {l}}{\partial \theta_ {l}} \left(\boldsymbol {h} _ {l - 1} ^ {[ t - 1 ]}, \boldsymbol {h} _ {l - 2} ^ {[ t - 1 ]}, \boldsymbol {\theta} _ {l}\right) (5) +$$ + +where rules 3 and 4 'redistribute' the pseudo-gradients during their forward propagation. + +Note that we deliberately define shortcut connections in the way that the approximation comes only from the temporal misalignment between pseudo-gradients and Jacobians also present in Sideways. + +# 5. Experiments + +Tasks and datasets. We show the benefits of using the proposed setting Skip-Sideways over BP and Sideways using two tasks: action recognition and future frame prediction, and on three datasets: HMDB51 [31], UCF101 [50], and Kinetics-600 (K600) [12]. In the action recognition task, a single action, represented as a class, is present throughout an entire video sequence, i.e., $\pmb{y}^{[t]} = \pmb{y}^{[t - 1]}$ for all $t$ . In the future frame prediction task, the ground truth output $\pmb{y}^{[t]}$ changes at each time-step $t$ . All videos have frame-rate of about 25fps, so that they satisfy our assumptions regarding smoothness + +![](images/5480ac1cbfd63b5608a46086d9f24fd84cc9eff598702c9d79ea02b9f497a516.jpg) +Figure 2: Illustration of the data flow of Sideways (left) and Skip-Sideways (right). The red circle in the center represents a single unit. It takes activations and pseudo-gradients from the previous step as inputs, processes them, and sends new activations and pseudo-gradients to the next computation step. + +![](images/ea1b9a3b67726cda1476242175501547e6f1b5ac3f775d1b87d6d74ccc3a9636.jpg) + +and slowly varying features. HMDB51 and UCF101 are used in Sideways, so for comparison, we use these same datasets in our ablation studies. To showcase our method Skip-Sideways in large-scale settings, we use Kinetics-600 dataset. We use resolutions $112 \times 112$ and $224 \times 224$ and train on 64 frames for HMDB51, UCF101, and on 32 frames for K600, with standard input augmentation [12]. + +As we are interested in an alternative to BP that is more scalable and suitable for video modeling, we train all the models from scratch; using features pre-trained with standard BP would defeat the goal of the study. Better results are reported in the literature, but those works use non-causal settings, or use extra features such as flow, extra modalities, different backbones, or various pre-training techniques. These directions are orthogonal to our work, where we investigate alternatives to BP on temporal sequences, in the real-time setting, with no access to future frames. + +Distributed setup. For our experiments, we use a distributed hardware with 8 devices, and we split the network modules among these available devices. As visual backbones in Sideways, Skip-Sideways, and in baselines trained with standard BP, we use VGG8 [49] for the HMDB51 and UCF101 experiments to have direct comparison with Sideways, and a deeper VGG16 for the Kinetics-600 (K600) experiments. VGG8, having 8 modules, runs as a fully-parallel model when distributed on our hardware, whereas for VGG16, we assign pairs of consecutive modules to every device. The computation for the modules on the same device happens in sequence using regular BP, and the Skip-Sideways direct and shortcuts connections are applied between devices. We provide more details about the experimental setting in the supplementary material. + +Baselines. We have implemented multiple baselines for our experiments. First, we re-implemented causal 3D VGG16 + +based on [43]. This baseline is close to our Skip-Sideways as it does not see future frames and it is capable of extracting temporal features. However, it is trained with regular BP. + +As results for Sideways on large-scale datasets like Kinetics-600 are not reported in the literature, we have re-implemented Sideways. We have obtained slightly better results than those reported in the original paper [38]. We include the results from our implementation throughout this section. + +For comparison with existing works in terms of hardware efficiency, we also implemented a video model using GPipe-style training [26]. We provide the details of the implementation in the supplementary material. + +For the reconstruction task, we use a simple 16-layer deep convolutional model, without pooling or striding, hence maintaining full-resolution throughout the depth of the model; we denote this model as Full-Res. We depart from the traditional encoder-decoder design for two main reasons. First, we hypothesize that preserving higher spatial resolution is important for a dense prediction task like reconstruction. Second, and more interesting in the context of our work, even though typically such a design decision would lead to prohibitively expensive (memory- or speedwise) training, we can readily afford to train such models by distributing Skip-Sideways units to different devices, using the distributed hardware efficiently. We include further details of the architecture in the supplementary material. + +# 5.1. Results + +Skip-Sideways vs Sideways. Table 1 shows our main results comparing our proposed Skip-Sideways to Sideways [38]. Skip-Sideways significantly improves over Sideways, about 4, 2, and 6 per cent points (pp) respectively, showing the benefit of the temporal integration of information. + +
HMDB51UCF101K600
Sideways [38]27.362.555.7
Skip-Sideways31.464.561.8
+ +Table 1: Skip-Sideways vs Sideways [38] on HMDB51, UCF101, and Kinetics-600 (K600); resolution $112 \times 112$ . We use VGG8 for HMDB51 and UCF101, and VGG16 for K600. We report accuracy in %. Skip-Sideways uses concatenation as aggregation operator. + +
AblationFusionHMDB51UCF101
Sideways [38]-27.362.5
Skip-Sidewaysadd29.662.8
Skip-Sidewaysconcat31.464.5
FA-Skip-Sidewaysconcat29.761.9
+ +Table 2: Ablations on HMDB51, UCF101; resolution $112 \times$ 112. We use VGG8 for HMDB51 and UCF101. We use addition (add) or concatenation (concat) operator to integrate activations. We report accuracy in %. + +
AblationHMDB51UCF101
reg.widereg.wide
Sideways [38]27.327.862.564.6
Skip-Sideways31.431.564.566.0
+ +Table 3: Regular vs. wide models trained with Sideways or Skip-Sideways. Wide Sideways has the same number of parameters as Skip-Sideways. Accuracy of the latter is superior (27.8 vs 31.4). We report accuracy in %. + +
Training256 frames
Sideways + VGG1640
Skip-Sideways + VGG1640
BP + 3D VGG16-
BP + 3D VGG16 (Remat)1
+ +Table 4: The largest batch-size that can be fit into a single GPU under the same setting, for different training schemes. Fitting a batch-size 1 for 3D VGG16 results in out-of-memory (OOM) error. (Remat) uses rematerialization [32]. + +Ablations. Our ablation studies justify different design choices used in Skip-Sideways and compare the results with Sideways in Table 2. + +As the first analysis, we investigate the effect of using shortcut connections only in the forward pass to aggregate activations, without distributing the pseudo-gradients as de + +tailed in Section 4. We report the results in Table 2, 4th row, FA-Skip-Sideways. Although FA-Skip-Sideways improves the results slightly over Sideways, re-distributing the pseudo-gradients as proposed in our full Skip-Sideways brings considerable additional improvement. + +The choice of fusion operator is important, with a clear preference towards concatenation, i.e., Skip-Sideways with concatenation outperforms the Sideways baseline by about 4 and 2 per cent points (pp), respectively, and on K600 by 6 pp (see Table 1). + +To rule out that the increased performance of Skip-Sideways with concatenation is due to the larger number of parameters rather than the temporal integration of information, we run experiments with wider VGG8, so that this wider VGG8 and Skip-Sideways with concatenation have similar number of parameters. We report these results in Table 3. For HMDB51, we can see larger improvement by 3.6pp by adding shortcut connections than merely by adding more parameters. The results are less clear for UCF101 where models benefit from more parameters. Nonetheless, in both cases, training with Skip-Sideways significantly improves the results over Sideways. + +Stability. Similar to the original Sideways paper [38], we study the training stability with respect to the input frame-rate, learning rate, and the number of video cuts ('montage'). We have found that Skip-Sideways training is slightly more stable than Sideways. Interestingly, lower input frame-rate affects less the Skip-Sideways performance compared to Sideways, which collapses when the frame rate drops. This robustness shows the benefit of faster data paths obtained through shortcut connections. More details on this analysis are included in the supplementary material ('Stability'), where we also show that the method converges for lower learning rates under reasonable smoothness assumptions. + +Memory consumption. Our training scheme significantly reduces memory consumption compared to the standard BP training. This is because Skip-Sideways is a temporal training scheme that forward-propagates all the information (activations and pseudo-gradients), without the need to store activations throughout the sequence length like in BPTT. To illustrate this behaviour, we have trained 3D VGG16 (with BP), Sideways, and Skip-Sideways, and we measured the maximal possible batch-size on a single Quadro P5000 (16GB) in all three settings, for the same sequence length. Table 4 shows that Sideways and Skip-Sideways training allows for much larger batches, whereas BP training has resulted in out-of-memory error. This result opens the door to dealing with long videos, beyond the commonly used 2-3 second clips, or to methods that need very large batches such as contrastive methods [13], or alternative and more expensive architectural designs such as Full-Res. Note that Skip-Sideways has a memory usage similar to Sideways even though, advantageously, the former has a temporal receptive + +field growing linearly with the number of Skip-Sideways units, whereas the Sideways's temporal receptive field is one. Speedup. Besides the important memory savings, another important practical advantage of our proposed training mechanism is the increased speedup obtained due to model parallelism. Table 5 shows our results where we distribute each Skip-Sideways unit on a different device (with 8 devices in total). We compare Skip-Sideways with the regular BP (running on a single device²) and its distributed version, GPipe [26], running on 8 devices. The number of steps per second reported in Table 5 represent the number of whole training iterations per second, including: fetching data³, forward and backward passes, and weight updates. As we can see, Skip-Sideways is almost three times faster than the regular BP training and about two times faster than GPipe. It is also the only one that satisfies our real-time requirements (Section 3) as it can process frames at 25fps, it is causal, and is independent of the sequence length, being able to scale to potentially infinite sequences. Moreover, we also compare our model parallelism with batch parallelism (the last two rows in Table 5), where we train the network with total batch-size 8 distributed among eight devices. Note that these parallelism schemes are complementary and Skip-Sideways can also be used with batch-parallelism. In the supplementary material we provide more results. + +Skip-Sideways vs BP. In Table 6, we compare VGG16 trained with Skip-Sideways to other models trained with BP. Since Skip-Sideways is a causal model, for fair comparison, we have implemented a causal equivalent of 3D VGG16 and trained it with BP. First, we can see that there is little difference between I3D [10, 12], an established model for action recognition, and a 3D CNN with the VGG16 backbone [49] that we denote as 3D VGG16 (see 1st and 2nd rows). Hence using 3D VGG16 for action recognition is a sensible choice. Next, we can observe that there is a significant decrease in accuracy when transforming the 3D VGG16 into a causal one (1st and 3rd rows). Our Skip-Sideways (last row) outperforms the causal 3D VGG16 showing that it is a valid and competitive training mechanism, while being real-time. We have also found that using another visual backbone (InceptionNet) gives similar results to VGG16. + +Note that the state-of-the-art results on Kinetics-600 are about $83\%$ [17, 44]. As mentioned above, these results are generally obtained using various mechanisms that are orthogonal to our work. Here, we use standard visual backbones and focus on alternative to BP training that satisfies real-time requirements and is more scalable. + +Future frame prediction. Future frame prediction is our second task. Figure 3 shows results when training models + +
steps +secDevices
Skip-Sideways + VGG162.31
Skip-Sideways + VGG163.62
Skip-Sideways + VGG167.28
GPipe [26] + VGG164.28
BP + 3D VGG161.91
BP + 3D VGG16 (Remat)1.51
BP + Causal 3D VGG162.41
BP + I3D [12]2.91
BP + 3D VGG16 (Batch-paral.)5.58
BP + I3D (Batch-paral.)6.58
+ +with Sideways, Skip-Sideways. As expected, motion is a powerful cue to predict future video frames, and thereof our Skip-Sideways training significantly outperforms Sideways training in terms of L2-loss (Table 7). We can observe that Sideways produces blurry video frames, as it is unable to extract motion futures to reduce uncertainty over where the pixels will be moving in future frames. On the contrary, the predictions obtained with Skip-Sideways are much sharper. + +Table 5: Speed comparisons of various training strategies and architectures in number of steps per second. Column devices indicates the number of parallel devices used for distributed training. All models use K600, 32 frames, resolution $224 \times 224$ , and batch-size 8. (Remat) denotes rematerialization [32]. The last two rows are exceptions and use batch-size 1 per device. We use space-to-depth transformation. + +
Kinetics-600BackboneCausalAccuracy
BP3D VGG16N72.3
BPI3D [10, 12]N71.9
BPCausal 3D VGG16Y64.2
Skip-SidewaysVGG16Y67.3
+ +Table 6: Results on Kinetics-600. We use resolution $224 \times$ 224 and total batch-size 256 in our experiments. + +
Kinetics-600L2-Error
Sideways [38]0.107
Skip-Sideways0.073
BP-
+ +Table 7: Results of Full-Res on Kinetics-600, trained with batch size 64, $112 \times 112$ , to predict future frames at time-step $t + 8$ , given the frames up to time-step $t$ . We report pixel error as L2-norm. Training with BP in this configuration results in out-of-memory (OOM) error. + +![](images/36d8c0da65071f1253acbc6b4aa1101097b476c5dc62b9cd5e2ac67380772fc5.jpg) +Figure 3: Qualitative results for two video sequences from the validation fold of Kinetics-600, where the models need to generate the frame at step $t + 8$ into future given frames up to $t$ . From top to bottom: input frames, ground-truth output frames, predictions of Full-Res trained with Sideways, predictions of Full-Res trained with Skip-Sideways. We can observe that the predictions of the model trained with Sideways are blurry and semantically similar to inputs, indicating that the model lags behind. On the contrary, the predictions of the model trained with Skip-Sideways are sharper and semantically closer to the ground-truth output frames. We use resolution $224 \times 224$ . + +# 6. Conclusion + +Alternatives to regular training based on backprop face many challenges as most of the existing frameworks and hardware systems are developed to optimise training based on backprop. Yet, even with all the existing optimisations, regular backprop has limitations as it does not scale up with the sequence length. It keeps large buffers of activations or gradients, and couples consecutive layers of the network, which blocks model parallelism along the depth of the model. These result in high latency systems, which may be unsuitable for real-time vision. In this work, we show that there are possible alternatives to backprop that reduce coupling between layers, decrease latency, allow for depth-parallelism, and can integrate information temporally, to obtain accuracy + +comparable to standard 3D CNNs. Our work is the first to showcase an alternative to backprop at scale and we hope that we will inspire further research into hardware architectures and software implementations that go beyond the standard backprop paradigm. As future work, we will investigate different architecture designs, mechanisms to augment the proposed Skip-Sideways with long-term memory capabilities [24], and investigate similar mechanisms for learning better representations. + +Acknowledgements. We thank Carl Doersch, Tom Hennigan, Jacob Menick, Simon Osindero, and Andrew Zisserman for their advice throughout the duration of the project and the anonymous CVPR reviewers for their feedback on the submission. + +# References + +[1] David Balduzzi, Hastagiri Vanchinathan, and Joachim Buhmann. Kickback cuts backprop's red-tape: Biologically plausible credit assignment in neural networks. In AAAI Conference on Artificial Intelligence, 2015. +[2] Eugene Belilovsky, Michael Eickenberg, and Edouard Oyallon. Decoupled greedy learning of cnns. arXiv preprint arXiv:1901.08164, 2019. +[3] Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in neural information processing systems (NeurIPS), pages 153-160, 2007. +[4] Yoshua Bengio, Dong-Hyun Lee, Jorg Bornschein, Thomas Mesnard, and Zhouhan Lin. Towards biologically plausible deep learning. arXiv preprint arXiv:1502.04156, 2015. +[5] Alessandro Betti and Marco Gori. Backprop diffusion is biologically plausible. arXiv preprint arXiv:1912.04635, 2019. +[6] Alessandro Betti, Marco Gori, and Giuseppe Marra. Backpropagation and biological plausibility. arXiv preprint arXiv:1808.06934, 2018. +[7] Léon Bottou and Yann L Cun. Large scale online learning. In Advances in Neural Information Processing Systems (NeurIPS), 2004. +[8] William L Briggs, Steve F McCormick, et al. A multigrid tutorial, volume 72. Siam, 2000. +[9] Víctor Campos, Brendan Jou, Xavier Giró-i Nieto, Jordi Torres, and Shih-Fu Chang. Skip rnn: Learning to skip state updates in recurrent neural networks. arXiv preprint arXiv:1708.06834, 2017. +[10] Joao Carreira, Eric Noland, Chloe Hillier, and Andrew Zisserman. A short note on the kinetics-600 human action dataset. arXiv preprint arXiv:1907.06987, 2019. +[11] João Carreira, Viorica Patraucean, Laurent Mazare, Andrew Zisserman, and Simon Osindero. Massively parallel video networks. In European Conference on Computer Vision (ECCV), 2018. +[12] João Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017. +[13] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. +[14] Anna Choromanska, Benjamin Cowen, Sadhana Kumaravel, Ronny Luss, Mattia Rigotti, Irina Rish, Brian Kingsbury, Paolo DiAchille, Viatcheslav Gurev, Ravi Tejwani, et al. Beyond backprop: Online alternating minimization with auxiliary variables. In International Conference on Machine Learning (ICML), 2019. +[15] Wojciech Czarnecki, Grzegorz Świrszcz, Max Jaderberg, Simon Osindero, Oriol Vinyals, and Koray Kavukcuoglu. Understanding synthetic gradients and decoupled neural interfaces. In International Conference on Machine Learning (ICML), 2017. + +[16] Debidatta Dwibedi, Pierre Sermanet, and Jonathan Tompson. Temporal reasoning in videos using convolutional gated recurrent units. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 1111-1116, 2018. +[17] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2020. +[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 (ICCV), pages 6202-6211, 2019. +[19] 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. +[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision (ECCV), pages 630-645. Springer, 2016. +[22] Geoffrey Hinton. How to represent part-whole hierarchies in a neural network. arXiv preprint arXiv:2102.12627, 2021. +[23] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, Jürgen Schmidhuber, et al. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001. +[24] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. +[25] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Conference on Computer Vision and Pattern Recognition (CVPR), pages 4700-4708, 2017. +[26] Yanping Huang, Yonglong Cheng, Dehao Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V. Le, and Zhifeng Chen. Gpipe: Efficient training of giant neural networks using pipeline parallelism. In Advances in Neural Information Processing Systems (NeurIPS), 2018. +[27] Zhouyuan Huo, Bin Gu, and Heng Huang. Training neural networks using features replay. In Advances in Neural Information Processing Systems (NeurIPS), pages 6659-6668, 2018. +[28] 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 (TPAMI), 35(1):221-231, 2012. +[29] Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. +[30] Jonas Kubilius, Martin Schrimpf, Aran Nayebi, Daniel Bear, Daniel LK Yamins, and James J DiCarlo. Cornet: modeling the neural mechanisms of core object recognition. BioRxiv, 2018. + +[31] Hildegard Kuehne, Hueihan Jhuang, Estíbaliz Garrote, Tomaso Poggio, and Thomas Serre. Hmdb: a large video database for human motion recognition. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2011. +[32] Ravi Kumar, Manish Purohit, Zoya Svitkina, Erik Vee, and Joshua Wang. Efficient rematerialization for deep networks. Advances in Neural Information Processing Systems (NeurIPS), 2019. +[33] Yann LeCun, D Touresky, G Hinton, and T Sejnowski. A theoretical framework for back-propagation. In Proceedings of the 1988 connectionist models summer school, volume 1, pages 21-28. CMU, Pittsburgh, Pa: Morgan Kaufmann, 1988. +[34] Zhenyang Li, Kirill Gavrilyuk, Efstratios Gavves, Mihir Jain, and Cees GM Snoek. Videolstm convolves, attends and flows for action recognition. Computer Vision and Image Understanding, 166:41-50, 2018. +[35] Timothy P Lillicrap, Daniel Cownden, Douglas B Tweed, and Colin J Akerman. Random synaptic feedback weights support error backpropagation for deep learning. Nature Communications, 7, 2016. +[36] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019. +[37] Sindy Löwe, Peter O'Connor, and Bastiaan Veeling. Putting an end to end-to-end: Gradient-isolated learning of representations. In Advances in Neural Information Processing Systems (NeurIPS), 2019. +[38] Mateusz Malinowski, Grzegorz Swiszcz, Joao Carreira, and Viorica Patraucean. Sideways: Depth-parallel training of video models. In Computer Vision and Pattern Recognition (CVPR), 2020. +[39] Jacob Menick, Erich Elsen, Utku Evci, Simon Osindero, Karen Simonyan, and Alex Graves. A practical sparse approximation for real time recurrent learning. arXiv preprint arXiv:2006.07232, 2020. +[40] Asier Mujika, Florian Meier, and Angelika Steger. Approximating real-time recurrent learning with random kronecker factors. In Advances in Neural Information Processing Systems (NeurIPS), pages 6594-6603, 2018. +[41] Arild Nokland. Direct feedback alignment provides learning in deep neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2016. +[42] Arild Nøkland and Lars Hiller Eidnes. Training neural networks with local error signals. arXiv preprint arXiv:1901.06656, 2019. +[43] Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyls, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016. +[44] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +[45] Brian D Ripley. Pattern recognition and neural networks. Cambridge university press, 2007. + +[46] Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, 1951. +[47] AJ Robinson and Frank Fallside. The utility driven dynamic error propagation network. University of Cambridge Department of Engineering Cambridge, 1987. +[48] O. Ronneberger, P.Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention (MIC-CAI), volume 9351 of LNCS, pages 234–241. Springer, 2015. (available on arXiv:1505.04597 [cs.CV]). +[49] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations (ICLR), 2015. +[50] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012. +[51] Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015. +[52] Jonathan Stroud, David Ross, Chen Sun, Jia Deng, and Rahul Sukthankar. D3d: Distilled 3d networks for video action recognition. In The IEEE Winter Conference on Applications of Computer Vision, pages 625-634, 2020. +[53] Richard Szeliski. Locally adapted hierarchical basis preconditioning. In ACM SIGGRAPH 2006 Papers, pages 1135-1143, 2006. +[54] Graham W Taylor, Rob Fergus, Yann LeCun, and Christoph Bregler. Convolutional learning of spatio-temporal features. In European conference on computer vision (ECCV), pages 140-153. Springer, 2010. +[55] 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 (ICCV), pages 4489-4497, 2015. +[56] Andreas Veit, Michael J Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In Advances in neural information processing systems (NeurIPS), pages 550-558, 2016. +[57] P. Werbos. Backpropagation through time: what does it do and how to do it. In Proceedings of IEEE, volume 78, 1990. +[58] Paul J Werbos. Applications of advances in nonlinear sensitivity analysis. In System modeling and optimization, pages 762-770. Springer, 1982. +[59] Paul J Werbos. Generalization of backpropagation with application to a recurrent gas market model. Neural networks, 1(4):339-356, 1988. +[60] Paul John Werbos. The Roots of Backpropagation: From Ordered Derivatives to Neural Networks and Political Forecasting. Wiley-Interscience, New York, NY, USA, 1994. +[61] Ronald J Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270-280, 1989. +[62] Laurenz Wiskott and Terrence J Sejnowski. Slow feature analysis: Unsupervised learning of invariances. Neural computation, 14(4):715-770, 2002. + +[63] Saining Xie, Chen Sun, Jonathan Huang, Zhuowen Tu, and Kevin Murphy. Rethinking spatiotemporal feature learning for video understanding. arXiv preprint arXiv:1712.04851, 1(2):5, 2017. +[64] Tong Zhang. Solving large scale linear prediction problems using stochastic gradient descent algorithms. In International Conference on Machine learning (ICML). ACM, 2004. \ No newline at end of file diff --git a/gradientforwardpropagationforlargescaletemporalvideomodelling/images.zip b/gradientforwardpropagationforlargescaletemporalvideomodelling/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..249444cc9d0268c963d6f19ccbb730309e671a98 --- /dev/null +++ b/gradientforwardpropagationforlargescaletemporalvideomodelling/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb8e1817b1177fcc4ea0aef4bbe182c1742f92990d14da47566d13d50d9fe902 +size 466669 diff --git a/gradientforwardpropagationforlargescaletemporalvideomodelling/layout.json b/gradientforwardpropagationforlargescaletemporalvideomodelling/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..88c8aa128c194aafb71341b872d88b1d9d15cf09 --- /dev/null +++ b/gradientforwardpropagationforlargescaletemporalvideomodelling/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:427c666e9d4d7aafe70d33f6fbef1beadb88bd6f910f706c16eae083300d431b +size 347245 diff --git a/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_content_list.json b/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4b8d8764565935fe1698897cfcf8e3931a032f24 --- /dev/null +++ b/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc23738b3fa7238fb06d48fbc3b376f315c760a163276146b0c0365875acb068 +size 67575 diff --git a/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_model.json b/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2ddf2a4d347df62d1fac52f94ea7587ead41466f --- /dev/null +++ b/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5aebdb262a3ba2de89daa18b79956ede427048dd625c812c1dd282b7f094027b +size 81290 diff --git a/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_origin.pdf b/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9135bb792fad932e9736fc331b5b9bc4fd1c645c --- /dev/null +++ b/graphattentiontracking/49f5c3b5-fd7f-4512-89f2-8d7efc468a8c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26bf3c7a4c0d9ee3f24b4c1016117380f8f743456688df4853c85c0de7015538 +size 1534994 diff --git a/graphattentiontracking/full.md b/graphattentiontracking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..34f7a407b37bb6e28f311af7f0a24c11ef5f905b --- /dev/null +++ b/graphattentiontracking/full.md @@ -0,0 +1,276 @@ +# Graph Attention Tracking + +Dongyan Guo†, Yanyan Shao†, Ying Cui†*, Zhenhua Wang†, Liyan Zhang‡, Chunhua Shen† +† Zhejiang University of Technology, China +‡ Nanjing University of Aeronautics & Astronautics, China +° Monash University, Australia +e-mail: cuiying@zjut.edu.cn + +# Abstract + +Siamese network based trackers formulate the visual tracking task as a similarity matching problem. Almost all popular Siamese trackers realize the similarity learning via convolutional feature cross-correlation between a target branch and a search branch. However, since the size of target feature region needs to be pre-fixed, these cross-correlation base methods suffer from either reserving much adverse background information or missing a great deal of foreground information. Moreover, the global matching between the target and search region also largely neglects the target structure and part-level information. + +In this paper, to solve the above issues, we propose a simple target-aware Siamese graph attention network for general object tracking. We propose to establish part-to-part correspondence between the target and the search region with a complete bipartite graph, and apply the graph attention mechanism to propagate target information from the template feature to the search feature. Further, instead of using the pre-fixed region cropping for template-feature-area selection, we investigate a target-aware area selection mechanism to fit the size and aspect ratio variations of different objects. Experiments on challenging benchmarks including GOT-10k, UAV123, OTB-100 and LaSOT demonstrate that the proposed SiamGAT outperforms many state-of-the-art trackers and achieves leading performance. Code is available at: https://git.io/SiamGAT + +# 1. Introduction + +General object tracking is a fundamental but challenging task in computer vision. In recent years, mainstream trackers focus on Siamese network based architectures [10, 15, 16, 33], which achieve state-of-the-art performance as well as a good balance between tracking accuracy and efficiency. These trackers first employ a Siamese network for feature extraction. Then they develop a tracking-head + +![](images/2d472773f581aeb1e29a4856aafdda5f41fd4c13d2d6acf67d5948399f4d6889.jpg) + +![](images/beb14ee8fb2941884516c77dee2597795bcad03b70c8016dd7051162674cdccd.jpg) + +![](images/6f4864f19e81319602ef11a3783258cb1baeb37217ad5da2d454064a4b9e0b0b.jpg) +SiamGAT + +![](images/3603698fd9af03f9db1800eb703acf10be0757853dd8cdf9e61e8eaa3926e7d9.jpg) + +![](images/9552902755bdf3f143f7ff2f826db251a2cc636493081b1ee056ec3badde6956.jpg) + +![](images/0d3c6036ca9ff02be198f64e4ea4a78ac5b7b54b1c41e106967616cc758a368c.jpg) +SiamCAR + +![](images/c0c0eec4a52e1e0c9985ae8f0fca616b6842a6440b180e2c5ff120580525520a.jpg) + +![](images/b7d8a29aaffcac068ccf73fa02806233bd7f73b63f08be5fafb3cf79007b4c45.jpg) + +![](images/87f69bcaf6d691ac2671af39c6f98e43449d3a166f1f94b7c3a9dc6d876ab579.jpg) +1 +SiamRPN++ +Figure 1 - Comparisons of our SiamGAT with state-of-the-art trackers on three challenging sequences from GOT-10k. Benefiting from the effective target information propagating, our SiamGAT successfully handles the challenges such as shape deformation, similar distractors and extreme aspect-ratio changes. Compared with the baseline SiamCAR (green), our SiamGAT (red) remarkably improves the tracking accuracy (zoom in for a better view). + +network for object information decoding from one or more similarity maps (or so-called response maps) obtained by information embedding between the template-branch and the search-branch. How to embed the information of the two branches to obtain informative response maps is a key issue, since information passed from the template to the search region is critical to the accurate localization of the object. Almost all current state-of-the-art Siamese trackers like SiamRPN [16], SiamRPN++ [15], SiamFC++ [33] and SiamCAR [10] utilize a cross-correlation based layer for information embedding, which takes convolution on deep features as the basic operation. Despite their great success, some important drawbacks exist with such cross-correlation based trackers: 1) The size of convolution kernel is prefixed. As shown in Figure 2, a common processing is crop + +![](images/cdb288c880a4dd4717e26b4ab87f5176c17a6bf89a3d7c66fbfb687b4b2b23af.jpg) +Figure 2 - Illustration of traditional cross-correlation based similarity learning methods. The target is marked by red boxes. The CNN features of the target, the background and the search region correspond to green, white and blue cycles respectively. An important problem is that the template feature obtained by fixed-region cropping (labeled by the yellow box) may introduce much background information or miss a great deal of foreground information, especially when the aspect ratio of the target changes drastically. Moreover, during tracking, the target shape and pose are constantly changing, but the global matching fails to consider the invariant part-level information and the transforming body shape. + +ping the central $m \times m$ region on the template feature map to generate the target feature, which is treated as the convolution kernel. However, when solving tracking tasks with different object scales or aspect ratios, this pre-fixed feature region may suffer from either reserving lots of background information or missing a great deal of foreground information, which consequently leads to inaccurate information embedding. 2) The target feature is treated as a whole for similarity computation with the search region. However, during tracking the target often yields large rotation, pose variation and heavy occlusions, and performing such a global matching with variable target is not robust. 3) Because of 2), the information embedding between the template and search region is a global information propagating process, in which the information transmitted from the template to the search region is limited and the information compression is excessive. Our key observations are as follows: 1) The information embedding should be target-aware, that is, adaptive to the size and aspect ratio variations of targets during tracking. 2) The information embedding should be performed by learning the part-level relations (instead of global matching), as part features tend to be invariant against shape and pose variations, thus being more robust. + +Aiming at solving these issues, we leverage graph attention networks [28, 34] to design an part-to-part information network. + +tion embedding network for object tracking. We demonstrate that the information embedding between template and search region can be modeled with a complete bipartite graph, which encodes the relations between template nodes and search nodes by applying a graph attention mechanism [28]. With learned attentive scores, each search node can effectively aggregate target information from the template. All search nodes then yield a response map with rich information for the subsequent decoding task. With such designs, we propose a graph attention module (GAM) to realize part-to-part information propagating instead of global information propagating between the template and search region. Instead of using the whole template as a convolution kernel, this part-to-part similarity matching can greatly alleviate the effect of shape-and-pose variations of targets. Further, instead of using the pre-fixed region cropping, we investigate a target-aware template computing mechanism to fit the size and aspect-ratio variations of different objects. With the introduced GAM that enables the target-aware strategy for information embedding, we present a novel tracking framework, termed Siamese Graph Attention Tracking (SiamGAT) network, for general object tracking. + +Since this work mainly argues that an effective information embedding algorithm can enhance the performance of the tracking head, the proposed SiamGAT simply consists of three essential blocks, without using any feature fusion, data enhancement or other strategies to enhance the performance. We evaluate our SiamGAT on several challenge benchmarks, including GOT-10k [14], OTB-100 [31], UAV123 [21] and LaSOT [7]. Without bells and whistles, the proposed tracker achieves leading performance compared with state-of-the-art trackers. Our main contributions are as follows. + +- We propose a graph attention module (GAM) to realize part-to-part matching for information embedding. Compared with the traditional cross-correlation based approaches, the proposed GAM can greatly eliminate their drawbacks and effectively pass target information from template to search region. +- We propose a target-aware Siamese Graph Attention Tracking (SiamGAT) network with GAM for general object tracking. The framework is simple yet effective. Compared with previous works using pre-fixed global feature matching, the proposed model is adaptive to the size and aspect-ratio variations of different objects. +- Experiments on multiple challenging benchmarks including GOT-10k, UAV123, OTB-100 and LaSOT demonstrate that the proposed SiamGAT outperforms many state-of-the-art trackers and achieves leading performance. + +# 2. Related Work + +In recent years, Siamese based trackers have drawn great attention for their superior performance. The main structure of these trackers can be summarized as three parts: a Siamese network for feature extraction of the template and search region, a similarity matching module for information embedding of the two Siamese branches, and a tracking head for feature decoding from the similarity maps. Many researchers devote to optimizing the Siamese model for better feature representation, or designing new tracking head for more effective bounding box regression. However, few work has been done on information embedding. + +The pioneering method SiamFC [2] constructs a Siamese network model for feature extraction and utilizes a cross-correlation layer (Xcorr) to embed the two branches. It takes the template features as kernels to directly perform convolution operation on the search region and obtains a single channel response map. In essence, the correlation here can be regarded as a similarity calculation between the template and the search region, and the obtained response map is a similarity map for target location prediction. Following this similarity-learning work, many researchers try to enhance the Siamese model for feature representation but still leverage the cross-correlation for information embedding [11, 12, 30, 9]. DSiam [11] adds online learning modules to address the target appearance variation and background suppression transformation to improve feature representation. It focuses on enhancing the model updating ability, while the location of object is still computed based on the single channel response map. SA-Siam [12] utilizes a twofold Siamese network to train a semantic branch and an appearance branch. Each branch is a similarity-learning Siamese network, trained separately but combined at the testing time to complement each other. RASNet [30] introduces the spatial attention and channel attention mechanisms to enhance the discriminative capacity of the deep model. GCT [9] adopts a spatial-temporal graph convolutional network for target modeling. Since multiple scales are searched during test to handle the scale-variation of objects, these Siamese trackers are time-consuming. + +Leveraging the region proposal network (RPN) [24] (proposed for object detection), Li et al. [16] propose the Siamese region proposal network SiamRPN. They add two branches for region proposal at the end of the Siamese feature extraction network: one classification branch for background-foreground classification of anchors, and one regression branch for proposal refinement. To embed the information of anchors, SiamRPN [16] conducts an up-channel cross-correlation-layer (Up-Xcorr) by cascading multiple independent cross-correlation layers to output multi-channel response maps. Based on SiamRPN [16], DaSiamRPN [37] designs a distractor-aware module to perform incremental learning and obtains much more discrimin + +inative features against semantic distractors. To tackle data imbalance, C-RPN [8] proposes to cascade a sequence of RPNs from deep high-level to shallow low-level layers in a Siamese network. Easy negative anchors can be filtered out in earlier cascade stage and hard samples are preserved across stages. Both SiamRPN++ [15] and SiamDW [35] investigate to deepen neural networks to improve the tracking performance. These RPN based trackers have achieved great success on performance as well as discarding traditional multi-scale tests. The chief drawback is that they are sensitive to hyper-parameters associated with anchors. + +Apart from deepening the Siamese network, SiamRPN++ [15] also presents a depth-wise cross-correlation layer (DW-Xcorr) to embed information of the target template and the search region branches. Specifically, it performs a channel-by-channel correlation operation with the feature maps of the two branches. By replacing the up-channel cross correlation with the depth-wise cross correlation, imbalance of parameter distribution of the two branches is resolved, which makes the training procedure more stable and the information association more efficient for the prediction of bounding box. Later works in this vein devote to eliminate the negative effects of anchors. A number of anchor-free trackers, such as SiamFC++ [33], SiamCAR [10], SiamBAN [3] and Ocean [36] are proposed, which achieve state-of-the-art tracking performance. They share the general idea tackling the tracking task as a joint classification and regression problem, and take one or multiple heads to directly predict objectiveness and regress bounding boxes from response maps in a per-pixel-prediction manner. Ocean [36] further applies an online-updating module to dynamically adapt the tracker. By discarding anchors and proposals, these anchor-free trackers extricate from the tedious hyper-parameter-tuning and the requirement of providing prior information (e.g., data scale and ratio distribution) for the dataset. + +Liao et al. [18] observed that traditional cross-correlation operation brings much background information, which may overwhelm the target feature and results in sensitivity to similar distracters. To solve this issue, they propose a pixel-to-global matching method to suppress the interference of background. However, similar to cross-correlation, this PG-correlation still takes a fixed-scale cropped region as the template feature. + +# 3. Method + +In this section, we present a detailed description for the proposed SiamGAT framework. The most important investigation of this work is that the performance of the Siamese trackers can be significantly improved with much effective information propagating from the target template to search region. In the following, we first introduce our Graph Attention Module which establishes the part-to-part correspond + +![](images/0f9e23c8d69cc459da43e9e3c038851336e14fe6bf27290091a79731a96224d3.jpg) +Figure 3 – Overview of the proposed method. (a) The network architecture of SiamGAT. It consists of three primary blocks: a Siamese sub-network for feature extraction, a graph attention module for target information embedding, and a classification-regression sub-network for target localization. (b) Illustration of the proposed graph attention module. The representation of each search node is reconstructed by aggregating information from all neighboring target nodes with attention mechanism. Note that the number of target nodes is not fixed but varies with different target templates via a target-aware area selection mechanism. + +![](images/4c89900e9b92515da9328b37d9591cd5f7edf3e6191812e551fac5b07544e4a9.jpg) + +dence between the Siamese branches. Then we present the target-aware graph attention tracker. An overview of our framework is illustrated in Figure 3. + +# 3.1. Graph Attention Information Embedding + +Existing correlation based information embedding methods [2, 16, 15] take the whole target feature as a unity to match with the search features. As this operation neglects the part-level correspondence between the target and the search regions, the matching is inaccurate under shape-and-pose variances of targets. Besides, this global matching manner may greatly compress the target information propagating to the search feature. In order to address these problems, we establish the part-to-part correspondence between the target template and the search region with a complete bipartite graph. + +Given two images of a template patch $T$ and a search region $S$ , we first employ a Siamese feature extraction network to obtain two feature maps $F_{t}$ and $F_{s}$ . To generate a graph, we consider each $1 \times 1 \times c$ grid of the feature map as a node (part), where $c$ represents the number of feature channels. Let $V_{t}$ be a node set including all nodes of $F_{t}$ , and let $V_{s}$ be another node set of $F_{s}$ . Inspired by the graph attention networks [28], we use a complete bipartite graph $G = (V,E)$ to model the part-level relations between the target and search region, where $V = V_{s} \cup V_{t}$ and $E = \{(u,v)|\forall u \in V_{s},\forall v \in V_{t}\}$ . We further define two sub-graphs of $G$ by $G_{t} = (V_{t},\emptyset)$ and $G_{s} = (V_{s},\emptyset)$ . + +For each $(i,j)\in E$ , let $e_{ij}$ denote the correlation score of node $i\in V_s$ and node $j\in V_t$ : + +$$ +e _ {i j} = f \left(\mathbf {h} _ {s} ^ {i}, \mathbf {h} _ {t} ^ {j}\right), \tag {1} +$$ + +where $\mathbf{h}_s^i\in \mathbb{R}^c$ and $\mathbf{h}_t^j\in \mathbb{R}^c$ are feature vectors of node $i$ and node $j$ . Since the more similar is a location in the search region to the local features of the template, the more likely + +it is the foreground, and more target information should be passed to there. For this reason, we hope that the score $e_{ij}$ is proportional to the similarity of the two node features. We can simply use the inner product between features as the similarity measurement. In order to adaptively learn a better representation between the nodes, we first apply linear transformations to the node features and then take the inner product between transformed feature vectors to calculate the correlation score. Formally, + +$$ +f \left(\mathbf {h} _ {s} ^ {i}, \mathbf {h} _ {t} ^ {j}\right) = \left(W _ {s} \mathbf {h} _ {s} ^ {i}\right) ^ {T} \left(W _ {t} \mathbf {h} _ {t} ^ {j}\right), \tag {2} +$$ + +where $W_{s}$ and $W_{t}$ are the linear transformation matrices. + +In order to balance the amount of information sent to the search region, we normalize $e_{ij}$ with the softmax function: + +$$ +a _ {i j} = \frac {\exp \left(e _ {i j}\right)}{\sum_ {k \in V _ {t}} \exp \left(e _ {i k}\right)}. \tag {3} +$$ + +Intuitively, $a_{ij}$ measures how much attention the tracker should pay to part $i$ , according to the viewpoint of part $j$ . + +Leveraging the attentions that passed from all nodes in $G_{t}$ to the $i$ -th node in $G_{s}$ , we compute the aggregated representation for node $i$ with + +$$ +\mathbf {v} _ {i} = \sum_ {j \in V _ {t}} a _ {i j} W _ {v} \mathbf {h} _ {t} ^ {j}, \tag {4} +$$ + +where $W_{v}$ is a matrix for linear transformation. + +Finally, we can fuse the aggregated feature with the node feature $\mathbf{h}_s^i$ to obtain a more powerful feature representation empowered by target information: + +$$ +\hat {\mathbf {h}} _ {s} ^ {i} = \operatorname {R e L U} \left(\mathbf {v} _ {i} \| \left(W _ {v} \mathbf {h} _ {s} ^ {i}\right)\right), \tag {5} +$$ + +where $\parallel$ represents vector concatenation. + +We compute all $\hat{\mathbf{h}}_s^i\forall i\in V_s$ in parallel, which yields a response map for subsequent task. + +# 3.2. Target-Aware Graph Attention Tracking + +Traditional Cross-correlation based methods are constrained by pre-fixed kernel sizes. They simply crop the center region of template $F_{t}$ as the target feature to match with the search region $F_{s}$ , which delivers much background information to the response map, especially when the template target is given in extreme aspect ratios. As a new information embedding method to replace Cross-correlation, the proposed graph attention module (GAM) can be unrestricted to the constraint and meanwhile operated with a variable template. In the following, we present our target-aware visual tracking framework. + +In order to produce a variable template which adaptively fits different object scales and aspect-ratios, we investigate a target-aware template-feature-area selection mechanism under the supervision of labeled bounding box $B_{t}$ in the template patch. By projecting $B_{t}$ onto the feature map $F_{t}$ , we can attain a region of interest $R_{t}$ . Only the pixels in $R_{t}$ are taken as the template feature: + +$$ +\hat {F} _ {t} = \left[ F _ {t} (i, j,:) \right] _ {(i, j) \in R _ {t}}. \tag {6} +$$ + +Through this simple operation, the obtained feature map $\hat{F}_t$ is a tensor of dimensions $(w,h,c)$ , where $w$ and $h$ correspond to the width and height of the template bounding box $B_t$ , and $c$ is the number of channels of $F_t$ . + +Each element $\hat{F}_t(i,j,:)$ is considered as a node in the template subgraph $G_{t}$ . Meanwhile, each element $F_{s}(m,n,:)$ is considered as a node in the search subgraph $G_{s}$ . These two subgraphs serve as inputs to the Graph Attention Module for information embedding. As elements in $G_{t}$ are arranged in a grid pattern on the feature map $\hat{F}_t$ , we can implement the linear transformations in Section 3.1 with $1\times 1$ convolutions. Then all correlation scores could be calculated by matrix multiplication, which is expected to greatly improve the efficiency. + +In experiments, we observe that applying a batch normalization after each convolution can effectively improve the performance. However, the dimensions $w$ and $h$ corresponding to different tracking objects cannot be predetermined, thus we cannot directly apply the batch normalization operation with the scale variable $\hat{F}_t$ . To solve the problem, we recompute $\hat{F}_t$ as follows: + +$$ +\hat {F} _ {t} (i, j,:) = \left\{ \begin{array}{l l} F _ {t} (i, j,:) & \text {i f} (i, j) \in R _ {t}, \\ 0 & \text {o t h e r w i s e .} \end{array} \right. \tag {7} +$$ + +Besides keeping the scale invariant, this target-aware idea renders the proposed method extendable to tasks which require non-rectangular ROIs (e.g., instance-segmentation in videos). + +Incorporating the target-aware region selection, we construct our tracking network with the proposed GAM for effective information embedding. As shown in Figure 3(a), our SiamGAT simply consists of three blocks: a Siamese network for feature extraction, a tracking head for target bounding box prediction and a GAM block to bridge them. + +Numerous works demonstrated that trackers can greatly benefit from better feature extraction method [20, 15]. By replacing the classical HOG features and color features with deep CNN features, tracking accuracy has seen significant improvement [20]. Later, deepening the backbone networks and fusing features of multiple layers have further improved the tracking performance [15]. Since GoogLeNet [26] is able to learn multi-scale feature representations with much fewer parameter and faster reasoning speed, here we adopt GoogLeNet as our backbone (an ablation is performed as well to study the performance of SiamGAT using different backbones). + +Encouraged by the success of anchor-free trackers, we leverage the classification-regression head network from SiamCAR [10] to be the tracking head. It contains two branches: a classification branch predicting the category information for each location, and a regression branch computing the target bounding box at this location. The two branches share the same response map output by GAM. + +# 4. Experiment + +# 4.1. Implementation Details + +The proposed SiamGAT is implemented in Pytorch on 4 RTX-2080Ti cards. Unless specified, the modified GoogLeNet( Inception v3) [26] is adopted as the backbone network for feature extraction. The backbone is initialized with the weights that pretrained on ImageNet [25]. The training batch size is set as 76 and totally 20 epochs are trained with stochastic gradient descent (SGD). We use a learning rate that linearly increased from 0.005 to 0.01 for the first 5 warmup epochs and then exponentially decayed to 0.0005 for the rest 15 epochs. For the first 10 epochs, we freeze the parameters in the backbone to train the graph attention network and the head network. For the rest 10 epochs, we freeze stage 1 and 2 of GoogLeNet, and fine-tune stage 3 and 4. + +We adopt COCO [19], ImageNet DET [25], ImageNet VID [25], YouTube-BB [23] and GOT-10k [14] as the training set for experiments on OTB100 [31] and UAV123 [21]. Specifically, for experiments on GOT-10k [14] and LaSOT [7], the model is respectively trained with only the specified training set provided by their official websites for fair comparison. In both training and testing processes, we use pre-fixed scales with $127 \times 127$ pixels for the template patch and $287 \times 287$ pixels for search regions. During testing, only the object in the initial frame of a sequence is adopted as + +
DatasetBackboneTarget-awareEmbedding TypeSuccessPrecisionFPS
UAV123AlexNet✓GAM0.5920.779165
GoogLeNet✓GAM0.6460.84370
GoogLeNet×GAM0.6260.82271
GoogLeNet×DW-Xcorr0.6150.81574
+ +Table 1 - Ablation study on UAV123. Target-aware represents whether the template feature area is pre-fixed or adaptively selected with the object aspect ratio. + +![](images/bda68628905596ce38376c7ac16dd29ac45bc064b8e503644bd0320f2ba889e9.jpg) +Figure 4 - Comparisons with state-of-the-art tracker on UAV123 [21] in terms of precision plots of OPE and success plots of OPE. + +![](images/e91e11cbf6889468849acb479335165c9c57ebb913424393247ab520115a5cbe.jpg) + +the template patch and fixed for the whole tracking period of this sequence. The search region in the current frame is adopted as the input of the search branch. + +# 4.2. Ablation Study + +Backbone architecture. We evaluate our network with both shallow and deep backbone architectures for visual tracking. Table 1 shows the tracking performance with AlexNet and GoogLeNet as backbones. Different backbones greatly affect the speed and performance of the tracker. By replacing AlexNet with GoogLeNet, the success is improved by $5.4\%$ from $59.2\%$ to $64.6\%$ , the precision is increased by $6.4\%$ from $77.9\%$ to $84.3\%$ . While the tracking speed decreases from 165 FPS to 70 FPS, which still meets the real-time requirement. It is worth pointing out that, the SiamGAT using AlexNet as the backbone also achieves a competitive performance while its precision and success are $1.1\%$ and $3.5\%$ higher than SiamRPN [16], whose results are shown in Figure 4. Clearly, the proposed approach can achieve a trade-off between accuracy and efficiency with different backbones. + +Target-aware vs. pre-fixed template area selection. To investigate the impact of template area selection, we train two models with GAM on GoogLeNet. One is trained with the traditional fixed-region cropping target features (Center- + +cropped), and another is trained with the target-aware selected features. As shown in Table 1, the proposed target-aware feature area selecting mechanism brings $2.0\%$ and $2.1\%$ performance gains respectively on success and precision. The main reason is that the target-aware mechanism is able to effectively eliminate the background information and enhance the foreground representation, which helps to obtain more accurate target feature area than fixed-region cropping. As a new way to replace X-corr for information embedding, GAM enables the target-aware strategy and they are complementary to improve the tracking performance. + +Comparison with DW-Xcorr. To conduct a comparison with cross-correlation based methods, here we replace the target-aware GAM with the popular DW-Xcorr layer [15], which achieves the best performance among cross-correlation based methods. Since the target feature area needs to be pre-fixed in the cross-correlation based methods, target-aware feature area selection cannot be applied with these methods. Here DW-Xcorr takes the center-cropped feature of the template. As shown in Table 1, compared with DW-Xcorr, the GAM with target-aware mechanism brings $3.1\%$ and $2.8\%$ performance gains respectively on success and precision, while the GAM with pre-fixed region only brings $1.1\%$ and $0.7\%$ performance gains. The + +
TrackerAOSR0.5SR0.75
CFNet [27]0.2930.2650.087
MDNet [22]0.2990.3030.099
ECO [4]0.3160.3090.111
CCOT [6]0.3250.3280.107
GOTURN [13]0.3470.3750.124
SiamFC [2]0.3480.3530.098
SiamRPN_R18 [16]0.4830.5810.270
SPM [29]0.5130.5930.359
SiamRPN++ [15]0.5170.6150.329
ATOM [5]0.5560.6340.402
SiamCAR [10]0.5790.6770.437
SiamFC++ [33]0.5950.6950.479
D3S [1]0.5970.6760.462
Ocean-offline [36]0.5920.6950.473
Ocean-online [36]0.6110.7210.473
SiamGAT (ours)0.6270.7430.488
+ +Table 2 – Evaluation on GOT-10k [14] in terms of average overlap and success rate. + +results further demonstrate that the pre-fixed region of target features has become the bottleneck for accurate target-information-propagating. Benefiting from the GAM architecture, our method enables the target-aware region selection, which is adaptive to different aspect ratios of objects. + +# 4.3. Evaluation on UAV123 + +The UAV123 dataset contains a total of 123 video sequences and all sequences are fully annotated with upright bounding boxes. Objects in the dataset suffer from occlusions, fast motion, illumination and large scale variations, which pose challenges to the trackers. A comparison with state-of-the-art trackers is shown in Figure 4 in terms of the precision and success plots of OPE. Our tracker outperforms all other trackers for both metrics. Compared with the baseline SiamCAR, our tracker improves the performance by $3.0\%$ in precision and $2.3\%$ in success. + +# 4.4. Evaluation on GOT-10k + +To evaluate the generalization of our tracker, we test it on the GOT-10k (Generic Object Tracking Benchmark) and compare it with state-of-the-art trackers. GOT-10k is a challenging large-scale dataset which contains more than 10,000 videos of moving objects in real-world. It is also challenging in terms of zero-class-overlap between the provided training subset and testing subset. For fair comparison, we follow the protocol of GOT-10k that only training our model with its training subset. We evaluate SiamGAT on GOT-10k and compare it with state-of-the-art trackers including SiamCAR [10], Ocean [36], SiamFC++ [33], D3S [1], SiamRPN++ [15], SPM [29], SiamRPN [16] + +![](images/e31796b6edee0b87cc4ca82fb090e109d6ece52d3b1cf192081694f1e84dfa8f.jpg) +Figure 5 - Comparison with state-of-the-art trackers on OTB-100 [32] in terms of success plots of OPE. + +![](images/4d03c604cd99983281498a083d3841d820c82806cb62f0b76d86948d9b71e325.jpg) +Figure 6 - Evaluation with each single attribute on OTB-100 [32] in terms of success. + +and other baselines. As shown in Table 2, the proposed SiamGAT performs best in terms of all metrics. Compared with the baseline SiamCAR, our tracker improves by $4.8\%$ , $6.6\%$ and $5.1\%$ respectively in terms of $AO$ , $SR_{0.5}$ and $SR_{0.75}$ . Impressively, it even outperforms the online update tracker 'Ocean' and improves the scores respectively by $1.6\%$ , $2.2\%$ and $1.5\%$ with a much simple network architecture, which validates the generalization ability of our tracker on unseen classes. Some qualitative results and comparisons are provided by Figure 1, which demonstrates that our SiamGAT is able to predict more accurate bounding boxes of targets. + +![](images/9006fb94440c9576127589283dece0092d9c2ea59d1eaeed936d0f2c6ad092a1.jpg) +Figure 7 - Comparison with state-of-the-art trackers on LaSOT [7] in terms of the normalized precision, precision and success plots of OPE. + +![](images/d131ccfc7eeaeac032e99b4c35f72aa0f6effbbf20f70fa39d1e0e865b4370d7.jpg) + +![](images/66a6058bb1a8c5af80ba0359a6987d8612edd8085fa21fbb72c0fd35837b7878.jpg) + +# 4.5. Evaluation on OTB-100 + +OTB-100 is one of the most classical benchmarks that provides a fair test-bed on robustness. All sequences in the dataset are labeled with 11 interference attributes, including illumination variation (IV), scale variation (SV), occlusion (OCC), deformation (DEF), motion blur (MB), fast motion (FM), in-plane rotation (IPR), out-of-plane rotation (OPR), out-of-view (OV), low resolution (LR) and background clutter (BC). A comparison with state-of-the-art trackers is shown in Figure 5 in terms of success plots of OPE. Our SiamGAT reaches a success score of $71.0\%$ that surpasses all other trackers. An evaluation on different attributes is shown by Figure 6. Our tracker can better handle the challenges like deformation (DEF), out-of-plane rotation (OPR), occlusion (OCC), illumination variation (IV), in-plane rotation (IPR) and scale variation (SV), which may cause large shape and pose variations of the object. Regarding to fast motion (FM), out-of-view (OV), low resolution (LR) which may cause extreme appearance variations, the proposed tracker obtains a lower score than the baseline SiamCAR. The results demonstrate that the proposed tracker can achieve robust performance against shape and pose variations. + +# 4.6. Evaluation on LaSOT + +To further evaluate the proposed approach on a more challenging dataset, we conduct experiments on LaSOT [7], which is a large-scale, high-quality, and densely annotated dataset for long-term tracking. To mitigate potential class bias, it provides the same number of sequences for each category. The results on LaSOT are shown in Figure 7. Our SiamGAT is the second best only behind the online tracker Ocean-online [36] but surpasses the long-term tracker GlobalTrack [17] by $3.6\%$ in normalized precision, $0.2\%$ in precision and $1.8\%$ in success. Compared with Ocean-offline [36] which is much more complex than SiamGAT in terms of network architecture, SiamGAT performs 2.3 points bet + +ter in normalized precision, 0.4 in precision and 1.3 in success. The results indicate that the proposed tracker is competitive for long-term tracking tasks. Moreover, up to our investigation, both attentive and target-aware properties of the proposed tracker allow more efficient online tracking without model updating. Online tracking modules can be easily integrated in future. + +# 5. Conclusion + +In this paper, we have presented a novel target-aware Siamese Graph Attention network, termed SiamGAT, for general object tracking. The proposed method explores information embedding for the object tracking task via a graph attention module (GAM). We provide theoretical and empirical evidences that how GAM establishes part-to-part correspondence and enables each part of the search region to aggregate information from the target. Instead of using the traditional cross-correlation based information embedding method, our GAM realizes part-level information propagating between the two Siamese branches and yields a much effective information embedding map. By incorporating a target-aware template region selection mechanism that can adaptively fit with different object scales and aspect ratios, the proposed approach enables more generalizable visual tracking. Without bells and whistles, our SiamGAT outperforms state-of-the-art trackers by clear margins on multiple main-stream benchmarks including GOT-10k, UAV123, OTB-100 and LaSOT. + +# Acknowledgements + +This work was in part supported in part by the National Natural Science Foundation of China (Grant No. 62002325, 61802348, 61772268) and the Natural Science Foundation of Jiangsu Province (Grant No. BK20190065). CS and his employer received no financial support for the research, authorship, and/or publication of this article. + +# References + +[1] L. Alan, M. Jiri, and K. Matej. D3s - a discriminative single shot segmentation tracker. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 7 +[2] L. Bertinetto, J. Valmadre, J.F. Henriques, A. Vedaldi, and P.H. Torr. Fully-convolutional siamese networks for object tracking. In Eur. Conf. Comput. Vis., 2016. 3, 4, 7 +[3] Z.D. Chen, B.N. Zhong, G.R. Li, S.P. Zhang, and R.R. Ji. Siamese box adaptive network for visual tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 3 +[4] M. Danelljan, G. Bhat, F.S. Khan, and M. Felsberg. Eco: Efficient convolution operators for tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 7 +[5] M. Danelljan, G. Bhat, F.S. Khan, and M. Felsberg. Accurate tracking by overlap maximization. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 7 +[6] M. Danelljan, A. Robinson, F.S. Khan, and M. Felsberg. Beyond correlation filters: learning continuous convolution operators for visual tracking. In *Eur. Conf. Comput. Vis.*, 2016. 7 +[7] H. Fan, L.T. Lin, F. Yang, P. Chu, G. Deng, S.J. Yu, H.X. Bai, Y. Xu, C.Y. Liao, and H.B. Ling. Lasot: A high-quality benchmark for large-scale single object tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 2, 5, 8 +[8] H. Fan and H.B. Ling. Siamese cascaded region proposal networks for real-time visual tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 3 +[9] J.Y. Gao, T.Z. Zhang, and C.S. Xu. Graph convolutional tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 3 +[10] D.Y. Guo, J. Wang, Y. Cui, Z. H. Wang, and S.Y. Chen. Siamcar: Siamese fully convolutional classification and regression for visual tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 3, 5, 7 +[11] Q. Guo, W. Feng, C. Zhou, R. Huang, L. Wan, and S. Wang. Learning dynamic siamese network for visual object tracking. In Int. Conf. Comput. Vis., 2017. 3 +[12] A. F. He, C. Luo, X.M. Tian, and W.J. Zeng. A twofold siamese network for real-time object tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 3 +[13] D. Held, S. Thrun, and S. Savarese. Learning to track at 100 fps with deep regression networks. In Eur. Conf. Comput. Vis., 2016. 7 +[14] L.H. Huang, X. Zhao, and K.Q. Huang. Got-10k: A large high-diversity benchmark for generic object tracking in the wild. IEEE Trans. Pattern Anal. Mach. Intell., 2018. 2, 5, 7 +[15] B. Li, W. Wu, Q. Wang, F.Y. Zhang, J.L. Xing, and J.J. Yan. Siamrpn++: Evolution of siamese visual tracking with very deep networks. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 1, 3, 4, 5, 6, 7 +[16] B. Li, J.J. Yan, W. Wu, Z. Zhu, and X.L. Hu. High performance visual tracking with siamese region proposal network. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 1, 3, 4, 6, 7 +[17] Kaiqi Huang Lianghua Huang, Xin Zhao. Globaltrack: A simple and strong baseline for long-term tracking. In AAAI Conf. Artificial Intelligence, 2020. 8 + +[18] B.Y. Liao, C.Y. Wang, Y.Y. Wang, Y.N. Wang, and J. Yin. Pg-net: Pixel to global matching network for visual tracking. In Eur. Conf. Comput. Vis., 2020. 3 +[19] T.Y. Lin, M. Michael, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollar, and C.L. Zitnick. Microsoft coco: Common objects in context. In Eur. Conf. Comput. Vis., 2014. 5 +[20] B. Luca, V. Jack, G. Stuart, M. Ondrej, and T. Philip HS. Staple: Complementary learners for real-time tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. 5 +[21] M. Muller, N. Smith, and B. Ghanem. A benchmark and simulator for uav tracking. In Eur. Conf. Comput. Vis., 2016. 2, 5, 6 +[22] H. Nam and B. Han. Learning multi-domain convolutional neural networks for visual tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. 7 +[23] E. Real, J. Shlens, S. Mazzocchi, X. Pan, and V. Vanhoucke. Youtube-boundingboxes: A large high-precision human-annotated data set for object detection in video. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 5 +[24] S.Q. Ren, K.M. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell., (6):1137-1149, 2017. 3 +[25] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, and M. Bernstein. Imagenet large scale visual recognition challenge. Int. J. Comput. Vis., 2015. 5 +[26] Szegedy, Christian, Vanhoucke, Vincent, Ioffe, Sergey, Shlens, Jonathon, Wojna, and Zbigniew. Rethinking the inception architecture for computer vision. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. 5 +[27] J. Valmadre, L. Bertinetto, J.F. Henriques, A. Vedaldi, and P.H. Torr. End-to-end representation learning for correlation filter based tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 7 +[28] Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In Int. Conf. Learn. Represent., 2018. 2, 4 +[29] G.T. Wang, C. Luo, Z.W. Xiong, and W.J. Zeng. Spmtracker: Series-parallel matching for real-time visual object tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 7 +[30] Q. Wang, T. Zhu, J. Xing, J. Gao, W. Hu, and S. Maybank. Learning attentions: residual attentional siamese network for high performance online visual tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 3 +[31] Y. Wu, J.W. Lim, and M.H. Yang. Online object tracking: A benchmark. In IEEE Conf. Comput. Vis. Pattern Recog., 2013. 2, 5 +[32] Y. Wu, J. Lim, and M.H. Yang. Object tracking benchmark. IEEE Trans. Pattern Anal. Mach. Intell., 37(9):1834, 2015. 7 +[33] Y.D. Xu, Z.Y. Wang, Z.X. Li, Y. Yuan, and G. Yu. Siamfc++: Towards robust and accurate visual tracking with target estimation guidelines. In AAAI Conf. Artificial Intelligence, 2020. 1, 3, 7 + +[34] C. Zhang, G.S. Lin, F.Y. Liu, J.S. Guo, Q.Y. Wu, and R. Yao. Pyramid graph networks with connection attention for region-based one-shot semantic segmentation. In Int. Conf. Comput. Vis., 2019. 2 +[35] Z.P. Zhang and H.W. Peng. Deeper and wider siamese networks for real-time visual tracking. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 3 +[36] Z.P. Zhang, H.W. Peng, J.L. Fu, B. Li, and W.M. Hu. Ocean: Object-aware anchor-free tracking. In Eur. Conf. Comput. Vis., 2020. 3, 7, 8 +[37] Z. Zhu, Q. Wang, B. Li, W. Wu, J.J. Yan, and W.M. Hu. Distractor-aware siamese networks for visual object tracking. In Eur. Conf. Comput. Vis., 2018. 3 \ No newline at end of file diff --git a/graphattentiontracking/images.zip b/graphattentiontracking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bc6d44a63ec4d4787c6fc94b265139e4c446ef29 --- /dev/null +++ b/graphattentiontracking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5395430866d07bdf82488df3f07cff0f8a03b6dbd2921dc3acd1182f064641e +size 560847 diff --git a/graphattentiontracking/layout.json b/graphattentiontracking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ac3729d0faa79d770f7c98389708880a2af913e6 --- /dev/null +++ b/graphattentiontracking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe69ae74c47ec8d9379b9bcda57f769d23bf820d61f88da168bb4749862d5275 +size 345118 diff --git a/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_content_list.json b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..201d6fe6ab45c24a398e666fb98aa7dca7e455a0 --- /dev/null +++ b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fb52dcece31a421a608721aeaa5aba21006375ebf25e424ff443ad2c39cf56b +size 81057 diff --git a/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_model.json b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2632392aa2bb63b530f82e4d2e6aa3e1cbc85f87 --- /dev/null +++ b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:844ab41598d3aa2b0443ebb7abfd6956e510add470eeb809bf3cc548834e5428 +size 99172 diff --git a/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_origin.pdf b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b5962fdcede7f815c2278ead282b8116f5dc697c --- /dev/null +++ b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/5ea3b573-5962-4fcd-bc25-36ca213400bd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ea4ac4a548c80c6771622d019b4f7afdfab89796c4e095acd89031e649eb96b +size 5147324 diff --git a/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/full.md b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..01bf85cb644404c59a59651ce20c1e56c9e2338f --- /dev/null +++ b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/full.md @@ -0,0 +1,335 @@ +# Graph-based High-Order Relation Discovery for Fine-grained Recognition + +Yifan Zhao $^{1}$ Ke Yan $^{2}$ Feiyue Huang $^{2}$ Jia Li $^{1,3*}$ + +$^{1}$ State Key Laboratory of Virtual Reality Technology and Systems, SCSE, Beihang University + $^{2}$ Tencent Youtu Lab, Shanghai, China + $^{3}$ Peng Cheng Laboratory, Shenzhen, China + +{zhaoyf, jiali}@buaa.edu.cn, {kerwinyan, garyhuang}@tencent.com + +# Abstract + +Fine-grained object recognition aims to learn effective features that can identify the subtle differences between visually similar objects. Most of the existing works tend to amplify discriminative part regions with attention mechanisms. Besides its unstable performance under complex backgrounds, the intrinsic interrelationship between different semantic features is less explored. Toward this end, we propose an effective graph-based relation discovery approach to build a contextual understanding of high-order relationships. In our approach, a high-dimensional feature bank is first formed and jointly regularized with semantic- and positional-aware high-order constraints, endowing rich attributes to feature representations. Second, to overcome the high-dimension curse, we propose a graph-based semantic grouping strategy to embed this high-order tensor bank into a low-dimensional space. Meanwhile, a group-wise learning strategy is proposed to regularize the features focusing on the cluster embedding center. With the collaborative learning of three modules, our module is able to grasp the stronger contextual details of fine-grained objects. Experimental evidence demonstrates our approach achieves new state-of-the-art on 4 widely-used fine-grained object recognition benchmarks. + +# 1. Introduction + +Fine-grained object recognition focuses on distinguishing and classifying objects of a basic-level category into subclasses, which is a challenging task due to the subtle visual differences among different classes. Benefiting from the strong perceptual capability of deep neural networks, handling subtle variances using visual features [42, 34, 49, 19] has made significant progress. In particular we consider two popular families of methods in + +![](images/73132d2ed43b379f3853ac10cffc31b8849972f18c7e8852a255151925a481cb.jpg) +Figure 1. The motivation of proposed approach. Our proposed approach first exploits the structurally channel-aware relationship b) into a high-dimensional graph embedding. Then these relation nodes are grouped into low-dimensional space d) with a semantic grouping strategy, forming the final grouped activations f). + +tackling this problem, i.e., discriminative part learning and feature representation learning. + +Studies of the first family [48, 42, 34, 6] usually deal with the fine-grained categorization problem by localizing distinct parts. Some representative methods tend to utilize the part detectors [13, 18] or segmentation parsers [19, 21] in different categorization tasks. With accurate part parsing results obtained, satisfactory performance for fine-grained classifiers could also be achieved simultaneously. Besides methods using manual annotations, attention-based approaches [19, 42, 34, 6, 31] show its ability in discovering object parts during weakly-supervised training. However, part localizations using attention mechanisms perform unreliable results under complex scenarios. As networks fail to capture the correct part localizations, further strengthening these regions would lead to catastrophic overfitting. + +The other family of approaches [28, 46, 36, 49] usually tackle the classification problem as a representation learning task. As object parts emerge naturally in different feature channels [14] during the weakly-supervised classification task, exploiting mutual relationships among different channels [36, 12, 3, 50] is meaningful and beneficial for fine-grained feature representations. As one of the predominant methods, bilinear pooling [28] exploits the second-order classification features from two different networks. Moreover, Zheng et al. [49] propose a trilinear attention mechanism, using third-order pooling to build channel relationships. However, high order features would lead to high dimensions (e.g., $C \times C$ dimensions for homogeneous features $\mathbf{X} \cdot \mathbf{X}^{\top}$ , $\mathbf{X} \in \mathbb{R}^{C \times W \times H}$ ), bringing in heavy computation burden and overfitting risks. Thus two major concerns arise: 1) how to build global relation scopes using high-order relationships and 2) how to embed the high-dimension features in a low-dimension manifold? + +In this paper, we propose a graph-based relation discovery (GaRD) approach to excavating finer relational attributes from intrinsic network features. As illustrated in Fig. 1, different from previous research, our approach tackles the representative feature learning in an expansion and compression manner. Inspired by the emerging semantic parts in class activation maps (Fig. 1 b)), our expansion motif is to construct contextual relationships among multiple feature channels by learning high-order representations. However, the tentative nature of channel-aware mechanisms [28, 49] tends to omit the spatially structural information and use averaged logits to represent each channel. To overcome this natural defect, we propose a relation-discovery module where the structural relations are constructed by employing a position-aware gating operation, providing high-order spatial enhancement for further channel interactions. Meanwhile, heterogeneous features from different levels are adopted to build a cross-channel relation with positional enhanced features. Finally, a mix-order tensor bank $\mathbf{T} \in \mathbb{R}^{C_1 \times C_2}$ is formed, endowing rich features but resulting in redundant high dimensions. + +To address this problem, existing classification models compress high-dimension features with feature factorizations [27] or low-rank representations [23]. Despite their performance deficiencies, semantic relationships among different features are less taken into consideration, which is crucial in fine-grained vision tasks. To explore the semantic relationships, we first formulate the mix-order tensor into a graph representation in Fig. 1 c) and then propose a graph grouping module to adaptively embed the high-order relation matrices into a low-dimension manifold. The graph convolutional layer efficiently encodes this relation matrix with a densely-connected relational graph. To rederive these nodes into different groups, we adopt an auxiliary graph layer to learn the grouping rules based on their + +semantic similarities. Hence the mix-order feature bank is embedded in a low-dimension manifold while retaining its rich semantic relationships for fine-grained recognition. Beyond these two modules, we first advocate employing the group-wise training mechanism for fine-grained image classification without additional regularizations, which utilize the center of grouped images instead of per image samples for gradient descent. This mechanism alleviates overfitting and gradient anomalies caused by hard samples. Experimental evidence demonstrates the proposed approach achieves state-of-the-art results on four popular benchmark datasets, i.e., CUB-200-2011 [38], Stanford-Cars [25], Aircrafts [30], and NAbirds [37]. + +In summary, our contribution is threefold: 1) We propose a novel graph-based relation discovery (GaRD) approach for fine-grained recognition, which adaptively exploits the relation-aware feature embeddings to enhance the discriminative representation abilities. 2) We propose to learn the positional and semantic feature relationships with an effective relation-discovery module, and learn a semantic grouping rule to cluster the high-order relationships. 3) We propose a simple yet effective group-wise learning strategy to update gradient using cluster center prototypes, alleviates overfitting and anomalies caused by hard samples. + +# 2. Related Work + +Discriminative part learning. Deep CNN has its natural ability in localization discriminative in the wake of the learning process of classification. Visual parts emerge naturally [14] during the gradient backward process. In turn, accurate localizing these discriminative parts can be of great help to the recognition task. Previous pioneer works [17, 47, 18, 41, 13, 15] tend to utilize the bounding box information by weak supervisions and manual annotations. For example, Zhang et al. [47] propose part-based R-CNNs to localize and detect the whole object and related parts, enforcing learned geometric constraints for accurate representation. Lam et al. [26] proposed a sequential search for informative parts with bounding box annotations and embedded the heuristic function into the LSTM network. Recent part-based methods [19, 42, 34, 6, 31] usually handle these tasks using attention mechanisms to visualize the class activation maps. For example, a dual-stage attention framework [42] is conducted to filter part patches that are most relevant to the semantic object. Simon et al. [34] propose an unsupervised part model discovery method for deep neural activation maps. In this method, deep neural activation maps are used to exploit the channels of classification networks as a part detector. Fu et al. [10] propose a hierarchical structure to automatically locate the most useful part by adopting an attention proposal sub-network. + +Feature representation learning. Leading by bilinear pooling techniques [28], feature representation meth + +![](images/d3026845ad373d7bd12ee78a593fb7d4b383d4a1a326519e4fe728d5cd400d4c.jpg) +Figure 2. The proposed graph-based relation discovery (GaRD) approach consists of three essential modules: the relation-discovery module to extract rich relation-aware high-dimension features, the graph-based semantic grouping module to find low-dimension feature embeddings, and the group-wise learning strategy is adopted to update the gradient using class centers. + +ods [46, 36, 49, 45] in high-order shows stronger generalization and categorization abilities. For example, compact bilinear features [11] are proposed to reduce the feature dimensions by compacting two homogeneous tensor sketches. Kong et al. [23] proposed a low-rank representation method, capturing second-order statistics with Frobenius norm projection. Besides these efforts, Zheng et al. [49] proposed to adopt the trilinear attention with the third-order pooling to construct the channel attention responses. There are some other methods [3, 40, 36, 20, 4, 29] focusing on the multi-scale or multi-channel representations. OSME [36] module applies an effective multi-attention multi-class constraint to regularize the feature learning. Chang et al. [3] propose a mutual interaction mechanism to exploit the feature relation across different channels. Beyond the above methods, exploiting different pooling techniques [46] and building feature regularizations [8, 9] also greatly enhance the final feature representations. Different from these aforementioned researches, in this paper, we propose to discover the high-order relationship while learning a semantic grouping for discriminative feature representations. + +# 3. Approach + +In this section, we introduce a graph-based relation discovery (GaRD) approach for fine-grained recognition in Fig. 2. The first key idea of our approach is to exploit inter-relations among different semantic and structural features in Section 3.1, depicting this relation with high-order rich features. As these features are catastrophic high + +dimensional which are usually hard to optimize, we present a new graph-based semantic grouping module to embed these features in a compact space in Section 3.2. Beyond these improvements, in Section 3.3, we propose a group-wise learning strategy to alleviate the outliers in the gradient descent optimization. + +# 3.1. Relation Discovery + +Given an input image $\mathcal{I}$ , let $\mathbf{X} \in \mathbb{R}^{W \times H \times C}$ be the $C$ -dimensional with $H \times W$ feature planes encoded by a backbone network $\mathbf{X} = \Phi(\mathcal{I})$ . Thus the most common way for classification is to embed the final feature $\mathbf{X}$ by using global pooling operations (GAP or GMP), calculating mean or maximum values on the $H \times W$ feature plane. + +High-order attentions. Adopting mean or maximum pooling operations usually fails to capitalize on the interactions among different semantic channels. To exploit the semantic response among channels in Fig. 3 a), second-order matrices $\mathbf{F}^r$ for each location $(i,j)$ builds an inter-channel relationship by transposing itself $\Phi_A(\cdot) \in \mathbb{R}^{WH \times C_A}$ and multiplying with another CNN stream $\Phi_B(\cdot) \in \mathbb{R}^{WH \times C_B}$ . The final features then pass a fully-connected (f c) layer for the final $N_{cls}$ -way classification: + +$$ +\begin{array}{l} \mathbf {F} ^ {r} = \frac {1}{W H} \sum_ {i = 1} ^ {W} \sum_ {j = 1} ^ {H} \operatorname {v e c} \left(\Phi_ {A} (\mathcal {I}) _ {i, j} ^ {\top} \Phi_ {B} (\mathcal {I}) _ {i, j}\right), \tag {1} \\ \mathbf {F} ^ {b} = \mathbf {W} \cdot \mathbf {F} ^ {r} + \mathbf {b}, \\ \end{array} +$$ + +where $\mathsf{vec}:\mathbb{R}^{C_A\times C_B}\to \mathbb{R}^{C_A C_B\times 1}$ denotes the vector + +![](images/4892bbefd221903e41f7d97581b78d1f4a31242805584ae46bd10493558484b4.jpg) + +![](images/5b10ceda6f198f45d56ce2184716241947b6e3d0d60e3fa0f2b11a78deefca0c.jpg) + +![](images/8aa011bf1cc5ea626b87281a94b92b68751e210d19001173270a67ed55c64f98.jpg) +Figure 3. Illustrations of different mutual attention methods. a) Bilinear pooling [28]: building channel-aware second-order relations, using vectorized features. b) Trilinear attention [49]: third-order channel relations, preserving the original feature shape. c) Our relation-discovery module: joint positional and channel-relation aware, forming a relational Tensor bank. + +ization of second-order matrices. $\mathbf{W} \in \mathbb{R}^{C_A C_B \times N_{cls}}$ is the learnable weight of the fc layer. Although rich features are obtained, learning such high-dimension features can easily lead to inferior optimization. Inspired by the nonlocal operations, trilinear attention-based methods [49, 12] regard the cross channel relationships as an attention map $\mathbf{X}^{\top} \mathbf{X} \in \mathbb{R}^{C \times C}$ , generated from the same feature map (see Fig. 3 b). The channel-aware attention map then attaches different importance to the original feature $\mathbf{X}$ , resulting in the third-order results $S(\mathbf{X}^{\top} \mathbf{X}) \mathbf{X}^{\top} \in \mathbb{R}^{WH \times C}$ where $S$ denotes the softmax normalization. + +Joint relation discovery. The first drawback of cross-channel relations lies in the omitting of positional information. As in Eqn. (1), each pixel is treated equally with an averaged summation over $W \times H$ . However, as object parts emerge automatically in network features, encoding original features with positional importance is thus necessary. The positional attention weights can be represented as: + +$$ +\mathbf {P} = \mathcal {N} \left(\mathcal {M} \left(\frac {1}{C} \sum_ {\mathrm {i} = 1} ^ {C} \mathbf {X} _ {i} ^ {\top} \varphi \left(\mathbf {X} _ {i}\right)\right)\right) \in \mathbb {R} ^ {W H \times W H}, \tag {2} +$$ + +where $\mathcal{M}(x) = \mathrm{sign}(x)x^{-1 / 2}$ and $\mathcal{N}(x) = x / ||x||_2^2$ are the moment and L2 normalization respectively. In addition, different network layers present object semantics in different scales, where the latter one has a larger receptive field. Leveraging cross-layer semantics also enhances the representation of multi-scale learning. Here we use $\varphi (\mathbf{X})$ denote the latter layer than $\mathbf{X}$ from the same ResNet stage. Thus $\mathbf{P}$ serves as an attention weight to find the spatial correla + +tions across different layers. The positional weights then strengthen the original feature with a spatial attention and then pass an adaptive gating operation to select (symbol $S$ in Fig. 3) the most useful features when occurring different samples: + +$$ +\mathbf {E} _ {i} = \mathcal {G} \left(\sum_ {c = 1} ^ {C} \mathbf {P} _ {c}\right) \cdot \left(\mathbf {P} _ {i} \mathbf {X} _ {i} ^ {\top}\right) + \mathbf {X} _ {i}, \tag {3} +$$ + +where $\mathcal{G}(\mathbf{P})\in \mathbb{R}^1$ denotes the gating weight generated by a fc layer. The gating operation is generated based on the spatial perceptions to form the positional aware features. + +The second drawback is that the cross-channel interactions in trilinear attentions are described implicitly, using a re-weighting mechanism for each channel. This attention mechanism can be regarded as denoising or high-pass filtering operations. Although features are maintained in original shape $\mathbb{R}^{W\times H\times C}$ , the relationship matrix across different semantic channels is omitted. Thus we propose to use the rich relation-aware representation instead of the common feature map, using an explicit tensor bank $\mathcal{T}$ for relation description. After obtaining the positional enhanced feature $\mathbf{E}$ , the relation matrix can be built by similar operations: + +$$ +\mathcal {T} = \mathcal {N} \left(\mathcal {M} \left(\frac {1}{W H} \sum_ {\mathrm {i} = 1} ^ {W H} \mathbf {E} ^ {\top} \varphi \left(\mathbf {X} _ {i}\right)\right)\right) \in \mathbb {R} ^ {C _ {N} \times C}, \tag {4} +$$ + +where $C_N$ denotes the channel dimension of positional aware attention. Unlike conventional bilinear pooling methods that perform vectorization or matrix factorization, we construct a tensor bank $\mathcal{T}$ with $C_N$ tensors. Each tensor has the same $C$ -dimensions for semantic mappings which are corresponded to the original feature channels. + +# 3.2. Graph-based Tensor Grouping + +The most common method to embed a high-dimension feature $\mathcal{T} \in \mathbb{R}^{C_N \times C}$ is to employ MLPs with fc layers. However, as mentioned in Eqn. (1), this embedding $\mathbf{W}$ would introduce enormous learnable parameters $C^2 \times N_{cls}$ , which are usually hard to optimize for fine-grained classification tasks with limited data. Thus a natural concern arises, how to embed the tensor bank into a low-dimension embedding and keep its semantic mapping as well? + +When the tensor bank $\mathcal{T} = \{\mathbf{x}_1,\dots ,\mathbf{x}_{C_N}\}$ is constructed, it can be formulated as a graph with $C_N$ nodes of $C$ dim. As it stands, it is the dimension of attention parts $C_N$ that leads to the optimization complexity. Notably, it can be found that these nodes essentially share much mutual information, e.g., responding to the same object part in CAM [33]. We thus propose to aggregate these features based on their similarity using Kipf's et al. [22] Graph Convolutional Networks. The pair-wise adjacent relationship + +between different nodes can be defined as: + +$$ +\mathbf {A} _ {i, j} = \frac {\tau (\mathbf {x} _ {i}) ^ {\top} \cdot \tau (\mathbf {x} _ {j})}{\| \tau (\mathbf {x} _ {i}) \| \| \tau (\mathbf {x} _ {j}) \|}, \tag {5} +$$ + +where $\tau (\cdot)$ denotes a $1\times 1$ convolution layer for dimensional transformation. The final adjacent matrix can be defined by adding self-loop as $\widetilde{\mathbf{A}} = \mathbf{A} + \mathbf{I}$ and $\mathbf{I}\in \mathbb{R}^{C_N\times C_N}$ is an identity matrix. With this dense-connected GCN operation, each node can be updated by this similarity-based aggregation: + +$$ +\mathbf {H} = \operatorname {R e L U} \left(\widetilde {\mathbf {D}} ^ {- \frac {1}{2}} \widetilde {\mathbf {A}} \widetilde {\mathbf {D}} ^ {- \frac {1}{2}} \mathbf {T} \mathbf {W} ^ {g}\right). \tag {6} +$$ + +$\mathbf{W}^g \in \mathbb{R}^{C \times d_h}$ is the learnable graph weights with the hidden dimension $d_h$ , and $\widetilde{\mathbf{D}} = \sum_j \widetilde{\mathbf{A}}_{\mathbf{i},\mathbf{j}}$ is the diagonal matrix for normalization. $\mathbf{T}$ denotes the matrix form of the tensor bank $\mathcal{T}$ . Thus the feature of each node is updated by this message passing operation. The other aim of graph embedding operation [2, 44] is to form multiple groups to get the contextual understanding. We further propose to learn these grouping rules by learning a new graph convolutional layer, which is desired to find an embedding $\mathbb{R}^{C_N \times d_h} \to \mathbb{R}^{C_r \times d_h}$ . Hence we use the aggregated features with its adjacent matrix to form this embedding $\mathbf{G}$ : + +$$ +\mathbf {G} = \operatorname {R e L U} \left(\widetilde {\mathbf {D}} ^ {- \frac {1}{2}} \widetilde {\mathbf {A}} \widetilde {\mathbf {D}} ^ {- \frac {1}{2}} \mathbf {H} \mathbf {W} ^ {e m b}\right). \tag {7} +$$ + +$\mathbf{W}^{emb} \in \mathbb{R}^{d_h \times C_r}$ is the graph weights. Thus $\mathbf{G} \in \mathbb{R}^{C_N \times C_r}$ defines a mapping function of each node from original feature space to form the new graphlets: + +$$ +\mathbf {Z} = \mathbf {H} ^ {\top} \frac {e ^ {\mathbf {G} _ {i , j}}}{\sum_ {j = 1} ^ {C _ {r}} e ^ {\mathbf {G} _ {i , j}}} \in \mathbb {R} ^ {d _ {h} \times C _ {r}}, \tag {8} +$$ + +where $C_r$ is the number of new embedded graphlets. i.e. the original high-dimension relational matrices are clustered into $C_r$ semantic groups, while $C_r$ is set as $\lfloor C_N / r \rfloor$ empirically. We conduct a softmax operation in the group dimension, indicating that each new group is composed of a probabilistic combination of original $C_N$ Nodes. In this manner, the high-order tensor bank $\mathcal{T}$ can be easily assigned in a low-dimension manifold, and mapped by both channel dimension and node dimension. The grouped feature $\mathbf{Z}$ is then performed with residual connections to construct the final embedding $\widetilde{\mathbf{Z}} = \mathbf{Z} + \mathbf{H}$ . Similar to conventional classification tasks, thus these embedding can be measured by passing the final pooling layer, i.e., GMP and GAP, and a classifier to predict the probability of $N_{cls}$ classes. + +# 3.3. Group-wise Learning + +Few research efforts have paid their attention to the exploitation on pair-wise relationships [36, 35, 32] or introducing pair-wise confusions [8] in fine-grained recognition tasks. As shown in Fig. 4 a), methods of the first + +![](images/d152033fe1e0837005872a5b091cc5dfa7ab21e8e6a4d5104f77ef30b2ce7a0a.jpg) +a) N-pair Triplet + +![](images/05187a331d0174f40cf872cde5c81da4895d274753b1c74e8fca499904d8721c.jpg) +b) Pair-wise Relation + +![](images/0752205a875bc30c0d9ae61a428ef461dca3bf85f4727e28ef76613362ec4e02.jpg) +Figure 4. Illustrations of three typical pair-wise regularizations: a) Pair-wise triplet regularization [35, 36], b) Pair-wise relations [8], and c) proposed group-wise learning. + +group [36, 35] proposed to constrain the intra-class similarity and inter-class dissimilarities, which samples an anchor image (denotes as $\mathcal{A}$ ) to find negative and positive pairs. In Fig. 4 b), pair-wise relations [8] are proposed to regularize features from different classes $\mathcal{F}_1$ and $\mathcal{F}_2$ in similar distributions. Despite their high-computation costs in sampling pairs, the group-wise correlations are less explored, which sometimes results in a bad feature embedding due to the restriction of data distributions. + +To revisit the fine-grained recognition task from a new perspective, here we propose a group-wise learning strategy in Fig. 4 c). One clear problem in fine-grained classification is the overfitting of hard cases. A preferable class cluster should be centralized by representative samples while omits the outlying hard samples. Unlike previous works using pair-wise constraints, we propose to use the groupwise training in each mini-batch during gradient descent. It means that we use the center of multiple samples of the specific class as a mean feature for updating the network parameters. This operation can be naturally embedded in the network with the cross-entropy loss function $\mathcal{L}_{\mathrm{CE}}$ . A typical group-wise learning loss in a minibatch is first random select $N$ classes and then sample $K$ images in each class, thus the loss function can be represented as: + +$$ +\mathcal {L} _ {\text {B a t c h}} = \frac {1}{N K} \sum_ {n = 1} ^ {N} \sum_ {k = 1} ^ {K} \mathcal {L} _ {\mathrm {C E}} \left(\mathcal {F} \left(\mathbf {y} _ {n} \mid \mathcal {I} _ {n, k}\right), \mathbf {y} _ {n}\right), \tag {9} +$$ + +where $\mathcal{F}$ and $\mathbf{y}$ denote the embedded features and labels. With this group-wise training mechanism, networks tend to form clustered embeddings of each class rather than discrete instance-level ones. + +# 4. Experiments + +# 4.1. Experimental settings + +Dataset. In this paper, we conduct experiments on four public popular benchmarks: 1) CUB-200-2011 [38] contains 11,788 images from 200 wild bird species, which is the widely-used benchmark for its representativeness, 2) Stanford-Cars [25] contains 16,185 images of 196 car subcategories, 3) FGVC-Aircraft [30] contains 10,000 images of 100 aircraft classes and 4) NA-birds [37] is a large dataset with 48,562 images for over 555 bird classes. We follow the standard dataset partition as in the original works. + +Implementation details. We adopt ResNet-50 [16] network pretrained on ImageNet [5] as our backbone for all experiments. We use the SGD optimizer with the initial learning rate of $8e - 4$ annealed by 0.1 every 60 epochs (overall 240 epochs) and momentum is set as 0.9. The training and testing protocol follow the state-of-the-art works [29, 4, 50] using random cropping of $448 \times 448$ in training and center crop during inference. We adopt the commonly used techniques, i.e.random cropping and erasing, left-right flipping, color jittering for data augmentation. For fair comparisons, we report results of ResNet-50 with identical training and data augmentation protocols as our baseline. Our model is trained end-to-end without any part or bounding box annotations on 2 NVIDIA Titan Xp GPUs for acceleration. We set $N = 4$ , $K = 4$ with a batchsize of 16 in the group-wise training for the first three datasets and set $N$ as 8 for the larger NA-birds dataset. We select $10\%$ of the training set as validation for fine-tuning the hyperparameters. + +# 4.2. Comparison with State-of-the-art + +CUB-200-2011 dataset. Here we roughly divide the model into two typical types, i.e. methods using part localization cues and feature-based representation learning. The comparison results with 16 state-of-the-art methods are exhibited in Tab. 1. It is noted that multi-crop enhancement is adopted in previous works [10, 48, 43] to boost performance. It can be seen that the part-based methods achieve comparable results with the feature-based model, which indicates that learning a preferable feature embedding is the key problem in fine-grained classification. + +FGVC-Aircraft dataset. Tab. 2 reports the results on FGVC-Aircraft dataset. Similar to the performance on CUB, recent feature-based learning methods DCL [4] and Cross-X [29] achieves the accuracy of $93.0\%$ and $92.7\%$ , which is much higher than the previous work [28] of $84.1\%$ . Note that many of the performance gains in recent models may come from different training schemes or backbone networks. We report the ResNet-50 baseline in Tab. 5 with an accuracy of $90.7\%$ , which is higher than the earlier works. Starting from this high-baseline, our final model achieves the performance of $94.3\%$ , which is a clear improvement + +Table 1. Performance on CUB-200-2011 dataset. 1-Stage: one-stage end-to-end training methods. †: using additional annotation. ‡: introducing multiple backbone layers. + +
TypeMethod1-stageAccuracy
Part BasedPA-CNN† [24]✓84.3%
RA-CNN [10]85.3%
MA-CNN [48]86.5%
Interpret [19]87.3%
NTSNet [43]87.5%
DF-GMM [40]88.8%
S-LSTM‡ [13]90.4%
Feature BasedBilinear [28]✓84.0%
MAMC [36]✓86.5%
MaxEnt-Dense161 [9]✓86.5%
PC-Dense161 [8]✓86.9%
HBP [45]✓87.1%
DFL-CNN [39]✓87.4%
Cross-X [29]✓87.7%
DCL [4]✓87.8%
TASN [49]87.9%
ACNet [20]✓88.1%
S3N [6]✓88.5%
Ours (ResNet50)✓89.6%
+ +Table 2. Performance on FGVC-Aircraft dataset. 1-Stage: one-stage end-to-end training methods. + +
TypeMethod1-stageAccuracy
Part BasedRA-CNN [10]✓88.2%
MA-CNN [48]89.9%
NTSNet [43]91.4%
DF-GMM [40]93.8%
Feature BasedBilinear [28]✓84.1%
PC-Dense161 [8]✓89.2%
MaxEnt-Dense161 [9]✓89.8%
DFL-CNN [39]✓92.0%
ACNet [20]✓92.4%
Cross-X [29]✓92.7%
S3N [6]✓92.8%
DCL [4]✓93.0%
API-Net [50]✓93.0%
PMG [7]✓93.4%
Ours (ResNet50)✓94.3%
+ +compared to state-of-the-art works [4, 29]. + +Stanford-Cars dataset. Stanford-Cars [25] is a real-world dataset composed of 196 car categories. While the CUB dataset contains more complex scenarios or background confusions. As shown in Tab. 3, it can be easily found that the earlier pioneer works [48, 36, 9] achieve high results over $92.8\%$ , making these methods undifferentiated in recognition abilities. However, our model still shows a clear improvement of state-of-the-art models. + +NA-birds dataset. Compared to CUB-200-2011, NAbirds [37] is a relatively larger dataset with over 500 sub + +Table 3. Performance on Stanford-Cars dataset. †: additional bounding box or segmentation annotation. 1-Stage: one-stage end-to-end training methods. + +
TypeMethod1-stageAccuracy
Part BasedPA-CNN† [24]✓92.8%
MA-CNN [48]92.8%
NTSNet [43]93.9%
DF-GMM [40]94.8%
Feature BasedBilinear [28]✓91.3%
PC-Dense161 [8]✓92.9%
MaxEnt-Dense161 [9]✓93.0%
MAMC [36]✓93.0%
HBP [45]✓93.7%
TASN [49]93.7%
DFL-CNN [39]✓93.8%
Cross-X [29]✓94.5%
DCL [4]✓94.5%
ACNet [20]✓94.6%
S3N [6]✓94.7%
Ours (ResNet50)✓95.1%
+ +Table 4. Performance on NA-birds dataset. 1-Stage: one-stage end-to-end training methods. †: using additional annotations. + +
TypeMethod1-stageAccuracy
PartPN† [37]MGE-CNN [46]75.0%88.0%
Feature BasedAlexNet-fc6 [37]Bilinear [28]Presence† [1]ResNet-50 [16]PC-Dense161 [8]MaxEnt-Dense161 [9]API-Net [50]Cross-X [29]✓35.0%80.9%81.5%82.2%82.8%83.0%86.2%86.2%
Ours (ResNet50)✓88.0%
+ +categories. Previous networks usually face difficulties to handle the classification of enormous sub-categories. Note that the performance of ResNet-50 in this table is reported by [29]. Recent feature-based methods [50, 29] shows its generalization ability in handling this task, reaching $86.2\%$ . Comparing to these methods, our model shows a clear improvement with the top-1 accuracy of $88.0\%$ , verifying the generalization ability of the proposed approach. + +# 4.3. Performance Analysis + +Effects of different components. To evaluate the effectiveness of proposed modules, we first employ ResNet-50 with the identical training protocol as baseline model, e.g., $85.4\%$ on CUB dataset. It can be found in Tab. 5 that adopting the bilinear pooling [28] for relation embedding, the performance boost by $2\%$ . While exploiting the relation discovery module can notably improve the baseline + +Table 5. Ablation studies of our different components on three benchmarks. $\mathcal{M}_{Rel}$ , $\mathcal{M}_{Graph}$ , $\mathcal{M}_{Group}$ denotes the proposed relation-discovery module, graph grouping module and group-wise learning respectively. + +
\( {\mathcal{M}}_{Rel} \)\( {\mathcal{M}}_{Graph} \)\( {\mathcal{M}}_{Group} \)CUBAircraftNAbirds
---85.4%90.7%83.2%
Bilinear--87.0%92.2%85.5%
✓--88.1%92.6%86.9%
✓-✓88.8%93.7%87.4%
✓✓✓89.6%94.3%88.0%
+ +![](images/dc4f8139516be2a82c1213391f9eaa6310bb2f7d86e217289b8a87b83de98e4e.jpg) + +![](images/ae5d9c834081a73179a41fb564b043e6fee9db56e743d4bdbd01138331c4085b.jpg) +a) Image + +![](images/7b1f3dabb64d393bbffc528141df52fd44d577e702b9983223ef6e67b515810b.jpg) + +![](images/efa4ecb99d091b3bb60b540e4ae53c07af027bb502fa38bd0a206276a9c4a522.jpg) +b) Baseline + +![](images/a8b1d6b2a410cb9a8b495859bd4e4d0b90b014d0835c7f23fd31b69a37d0c8e8.jpg) + +![](images/1a3bf0653e4c44a91043ac1a87bf0d3d7e63fbc1d339ea160089d0c530c9cdfc.jpg) +c) Trilinear + +![](images/c5fe385637156f658e58c12819fe01a4782badbb2aa9738bf14e562860a00ec6.jpg) + +![](images/407511d83614e2c0f43fe06c83ff65a8be4d66ab5b38083521cde319ffd294ca.jpg) +d) Ours +Figure 6. Illustration of three feature embedding strategies: a) baseline, b) trilinear attention [49], and c) Our model. + +performance. Besides, the group-wise training strategies also improve the focusing attention, providing a stable improvement on final results. Based on this high-performance baseline, we further add the graph-based grouping strategy instead of the basic fusion operations, which provides a steady improvement. + +Effects of feature embedding. The most crucial issue in feature-based learning approaches is to find appropriate feature embeddings. We explore different kinds of settings in Tab. 6. Starting from the baseline, we re-implement the trilinear attention [49] on our high baseline settings, which improves the attention regions and forms a global scope for object recognition (Fig. 6). + +Another main exploration is to find embedding ways of our relation module, it is interesting that using MLP with fc layers to learn this high embedding would lead to inferior performance of $88.1\%$ compared to the simple mean aggregation embedding of $88.6\%$ . Moreover, we simply remove the spatial enhancement in constructing high order relationships, resulting in $0.5\%$ lower result. Applying the single-level aggregation without multiple layers will also slightly harm the final performance. On the other hand, we replace the mean aggregation strategy with a static graph embedding (denoted as static). This densely-connected graph is then degraded as learnable fc layers and leads to inferior results. While our final model with graph-based message + +![](images/0d0c844b4fd2e74ebc42de5a288b635497ab5f4204e9e8d0b24a6fcdff9bddd6.jpg) +(a) Referred Channels + +![](images/e2248e3e5f6c51acc24debbf0f7b364283e4934e8783be652562568e9818a267.jpg) +Figure 5. Class activation visualizations of baseline (left) and our model (right). a) and d) are referred top channels generated by baseline and our model. b) and e) are the class activation map of all channels, and c) and f) are the guided gradient of baseline and our model. + +![](images/d624eace7fc9fce6162a1c5b41c99b28e227bedff068fc7f5531961e3b515ea6.jpg) + +![](images/958b6e97bbef349e40b5c121576744f0870225a458be4ec58b65dfd7c7525c3b.jpg) +(b) Full CAM + +![](images/b792a8693272ce82c9354d151a95df61b934cdb2e3c799b028ebc92d48d37891.jpg) +(c) Guided Grad. + +![](images/3ce874869a4e5a6b5095b5ecda77e981b08998ea7d3b8a526f092e23695c23f6.jpg) +(d) Referred Channels + +![](images/e6c84240160566a0d20cab1e5948a99492fbf5b25bbc51b92c72682fa2a18001.jpg) + +![](images/1c587a1d67886ab1fb8abee7a09ac4b39fda58d8da38212846b02c0e9d628e67.jpg) + +![](images/77edd0c81f4dd136d7ca11b8107d7df0367e887bffb72b09ab3e6b6a61ee19ca.jpg) +(e) Full CAM + +![](images/e4fd7c8daded25589a9c37ca790c19d0add724f7f650ac567653d968678f4805.jpg) +(f) Guided Grad. + +Table 6. Performance analysis of feature extraction and feature embedding methods on CUB-200-2011 benchmark. Static: replacing the graph embedding $\mathbf{A}$ with a $C_N$ -by- $C_N$ matrix of ones. + +
Feature ExtractionEmbeddingAccuracy
Baseline (ResNet50)GAP85.4%
+MGroupGAP86.4%
+MGroup+Trilinear [49]GAP86.7%
+MGroup+Bilinear [28]MLP87.0%
+MGroup+MRel (w/o spatial)Mean Agg.88.1%
+MGroup+MRel (w/o multi-level)Mean Agg.88.3%
+MGroup+MRelMean Agg.88.6%
+MGroup+MRelStatic88.5%
+MGroup+MRelGraph89.6%
+ +passing shows a preferable high-performance of $89.6\%$ . + +What makes a network recognize objects visually? With this question in our mind, we exhibit the visualization results generated by Grad-CAM [33]. The referred three channels of baseline and our model are shown in Fig. 5 (a). It is shown that different channels of our model focus on different object parts, e.g., tail, torso and head of one specific bird. This verifies that constructing inter-channel relationships is beneficial for global object understanding. Despite the noisy regions in baseline (a), the full class activation region of all channels in (b) are always focused on a small specific head region, which greatly restricted the contextual perceiving of objects. In addition, we also present the guided gradient in (c) and (f) for comparison. It shows that the gradient of baseline model focuses on a small region of objects, which would usually lead to overfitting issues. + +In Fig. 6, we also present the full activation maps of all channels of three representative models, i.e. baseline, tri-linear regularizations [49], and our model. It is clear that using higher-order relationship greatly helps the global un + +Table 7. Hyper parameter experiments on graph embedding dim $C_N$ and group num $C_r$ on CUB-200-2011 benchmark. + +
\((C_N,C_r)\)(2048,64)(1024,64)(512,64)(512,32)
Acc.88.7%89.0%89.6%89.1%
+ +derstanding. Compared to Fig. 6 c), our model generates clearer object boundaries with less noisy regions and provides higher recognition performance. + +Hyperparams. As two main factors in our experiments, the embedding nodes dimension $C_N$ and reduced semantic groups $C_r$ are two main factors that affect the grouping performance. Tab. 7 reveals that constructing higher dimensions nodes with 2048 would be hard for optimization. In experiments, we set $C_N = 512$ and $C_r = 64$ to achieve a performance trade-off with limited data. + +# 5. Conclusions + +In this paper, we propose to exploit mix-order relationships in representing fine-grained features with three strategies. The first relation-discovery module exploits the positional enhanced inter-channel relations to form a high-order matrix. Then a graph-based grouping module is proposed to embed this high-order matrix into a low-dimensional manifold. We propose a group-wise training mechanism to update the gradient using group center. Experimental evidence demonstrates the proposed approach achieves new state-of-the-art in fine-grained recognition tasks. + +# Acknowledgment + +This work was supported by grants from National Natural Science Foundation of China (No.61922006), Baidu Academic Collaboration Program and also sponsored by CAAI-Huawei MindSpore Open Fund. + +# References + +[1] Oisin Mac Aodha, Elijah Cole, and Pietro Perona. Presence-only geographical priors for fine-grained image classification. In IEEE International Conference on Computer Vision (ICCV), pages 9595-9605, 2019. 7 +[2] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In 2nd International Conference on Learning Representations, ICLR, 2014. 5 +[3] Dongliang Chang, Yifeng Ding, Jiyang Xie, Ayan Kumar B-hunia, Xiaoxu Li, Zhanyu Ma, Ming Wu, Jun Guo, and Yi-Zhe Song. The devil is in the channels: Mutual-channel loss for fine-grained image classification. IEEE Transactions on Image Processing, 29:4683-4695, 2020. 2, 3 +[4] Yue Chen, Yalong Bai, Wei Zhang, and Tao Mei. Destruction and construction learning for fine-grained image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5157-5166, 2019. 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 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 248-255, 2009. 6 +[6] Yao Ding, Yanzhao Zhou, Yi Zhu, Qixiang Ye, and Jianbin Jiao. Selective sparse sampling for fine-grained image recognition. In IEEE International Conference on Computer Vision (ICCV), pages 6599-6608, 2019. 1, 2, 6, 7 +[7] Ruoyi Du, Dongliang Chang, Ayan Kumar Bhunia, Jiyang Xie, Zhanyu Ma, Yi-Zhe Song, and Jun Guo. Fine-grained visual classification via progressive multi-granularity training of jigsaw patches. In European Conference on Computer Vision (ECCV), pages 153-168, 2020. 6 +[8] Abhimanyu Dubey, Otkrist Gupta, Pei Guo, Ramesh Raskar, Ryan Farrell, and Nikhil Naik. Pairwise confusion for fine-grained visual classification. In European Conference on Computer Vision (ECCV), pages 70-86, 2018. 3, 5, 6, 7 +[9] Abhimanyu Dubey, Otkrist Gupta, Ramesh Raskar, and Nikhil Naik. Maximum-entropy fine grained classification. In Advances in Neural Information Processing Systems (NeurIPS), pages 637–647, 2018. 3, 6, 7 +[10] Jianlong Fu, Heliang Zheng, and Tao Mei. Look closer to see better: Recurrent attention convolutional neural network for fine-grained image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4438-4446, 2017. 2, 6 +[11] Yang Gao, Oscar Beijbom, Ning Zhang, and Trevor Darrell. Compact bilinear pooling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 317-326, 2016. 3 +[12] Yu Gao, Xintong Han, Xun Wang, Weilin Huang, and Matthew Scott. Channel interaction networks for fine-grained image categorization. In AAAI Conference on Artificial Intelligence (AAAI), pages 10818-10825, 2020. 2, 4 +[13] Weifeng Ge, Xiangru Lin, and Yizhou Yu. Weakly supervised complementary parts models for fine-grained image classification from the bottom up. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3034-3043, 2019. 1, 2, 6 + +[14] Abel Gonzalez-Garcia, Davide Modolo, and Vittorio Ferrari. Do semantic parts emerge in convolutional neural networks? International Journal of Computer Vision, 126(5):476-494, 2018. 2 +[15] Bing He, Jia Li, Yifan Zhao, and Yonghong Tian. Part-regularized near-duplicate vehicle re-identification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3997–4005, 2019. 2 +[16] 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. 6, 7 +[17] Xiangteng He and Yuxin Peng. Weakly supervised learning of part selection model with spatial constraints for fine-grained image classification. In Thirty-first AAAI conference on artificial intelligence, 2017. 2 +[18] Shaoli Huang, Zhe Xu, Dacheng Tao, and Ya Zhang. Part-stacked cnn for fine-grained visual categorization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1173-1182, 2016. 1, 2 +[19] Zixuan Huang and Yin Li. Interpretable and accurate fine-grained recognition via region grouping. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8662-8672, 2020. 1, 2, 6 +[20] Ruyi Ji, Longyin Wen, Libo Zhang, Dawei Du, Yanjun Wu, Chen Zhao, Xianglong Liu, and Feiyue Huang. Attention convolutional binary neural tree for fine-grained visual categorization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 10468-10477, 2020. 3, 6, 7 +[21] Mahdi M Kalayeh, Emrah Basaran, Muhittin Gokmen, Mustafa E Kamasak, and Mubarak Shah. Human semantic parsing for person re-identification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1062–1071, 2018. 1 +[22] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, ICLR, 2017. 4 +[23] Shu Kong and Charless Fowlkes. Low-rank bilinear pooling for fine-grained classification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 365-374, 2017. 2, 3 +[24] Jonathan Krause, Hailin Jin, Jianchao Yang, and Li Fei-Fei. Fine-grained recognition without part annotations. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5546-5555, 2015. 6, 7 +[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. 2, 6 +[26] Michael Lam, Behrooz Mahasseni, and Sinisa Todorovic. Fine-grained recognition as hsnet search for informative image parts. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2520-2529, 2017. 2 +[27] Yanghao Li, Naiyan Wang, Jiaying Liu, and Xiaodi Hou. Factorized bilinear models for image recognition. In IEEE + +International Conference on Computer Vision (ICCV), pages 2079-2087, 2017. 2 +[28] Tsung-Yu Lin, Aruni RoyChowdhury, and Subhransu Maji. Bilinear cnn models for fine-grained visual recognition. In IEEE International Conference on Computer Vision (ICCV), pages 1449-1457, 2015. 2, 4, 6, 7, 8 +[29] Wei Luo, Xitong Yang, Xianjie Mo, Yuheng Lu, Larry S Davis, Jun Li, Jian Yang, and Ser-Nam Lim. Cross-x learning for fine-grained visual categorization. In IEEE International Conference on Computer Vision (ICCV), pages 8242-8251, 2019. 3, 6, 7 +[30] Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013. 2, 6 +[31] Adria Recasens, Petr Kellnhofer, Simon Stent, Wojciech Matusik, and Antonio Torralba. Learning to zoom: a saliency-based sampling layer for neural networks. In European Conference on Computer Vision (ECCV), pages 51-66, 2018. 1, 2 +[32] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 815-823, 2015. 5 +[33] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In IEEE International Conference on Computer Vision (ICCV), pages 618-626, 2017. 4, 8 +[34] Marcel Simon and Erik Rodner. Neural activation constellations: Unsupervised part model discovery with convolutional networks. In IEEE International Conference on Computer Vision (ICCV), pages 1143-1151, 2015. 1, 2 +[35] Kihyuk Sohn. Improved deep metric learning with multiclass n-pair loss objective. In Advances in Neural Information Processing Systems (NeurIPS), pages 1857-1865, 2016. 5 +[36] Ming Sun, Yuchen Yuan, Feng Zhou, and Errui Ding. Multi-attention multi-class constraint for fine-grained image recognition. In European Conference on Computer Vision (ECCV), pages 805–821, 2018. 2, 3, 5, 6, 7 +[37] Grant Van Horn, Steve Branson, Ryan Farrell, Scott Haber, Jessie Barry, Panos Ipeirotis, Pietro Perona, and Serge Belongie. Building a bird recognition app and large scale dataset with citizen scientists: The fine print in fine-grained dataset collection. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 595-604, 2015. 2, 6, 7 +[38] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 2, 6 +[39] Yaming Wang, Vlad I Morariu, and Larry S Davis. Learning a discriminative filter bank within a cnn for fine-grained recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4148-4157, 2018. 6, 7 +[40] Zhihui Wang, Shijie Wang, Shuhui Yang, Haojie Li, Jianjun Li, and Zezhou Li. Weakly supervised fine-grained image + +classification via gaussian mixture model oriented discriminative learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 9749-9758, 2020. 3, 6, 7 +[41] Xiu-Shen Wei, Chen-Wei Xie, Jianxin Wu, and Chunhua Shen. Mask-cnn: Localizing parts and selecting descriptors for fine-grained bird species categorization. Pattern Recognition, 76:704-714, 2018. 2 +[42] Tianjun Xiao, Yichong Xu, Kuiyuan Yang, Jiaxing Zhang, Yuxin Peng, and Zheng Zhang. The application of two-level attention models in deep convolutional neural network for fine-grained image classification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 842-850, 2015. 1, 2 +[43] Ze Yang, Tiange Luo, Dong Wang, Zhiqiang Hu, Jun Gao, and Liwei Wang. Learning to navigate for fine-grained classification. In European Conference on Computer Vision (ECCV), pages 420-435, 2018. 6, 7 +[44] 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 (NeurIPS), pages 4800-4810, 2018. 5 +[45] Chaojian Yu, Xinyi Zhao, Qi Zheng, Peng Zhang, and Xinge You. Hierarchical bilinear pooling for fine-grained visual recognition. In European Conference on Computer Vision (ECCV), pages 574-589, 2018. 3, 6, 7 +[46] Lianbo Zhang, Shaoli Huang, Wei Liu, and Dacheng Tao. Learning a mixture of granularity-specific experts for fine-grained categorization. In IEEE International Conference on Computer Vision (ICCV), pages 8331-8340, 2019. 2, 3, 7 +[47] Ning Zhang, Jeff Donahue, Ross Girshick, and Trevor Darrell. Part-based r-cnns for fine-grained category detection. In European Conference on Computer Vision (ECCV), pages 834-849. Springer, 2014. 2 +[48] Heliang Zheng, Jianlong Fu, Tao Mei, and Jiebo Luo. Learning multi-attention convolutional neural network for fine-grained image recognition. In IEEE International Conference on Computer Vision (ICCV), pages 5209–5217, 2017. 1, 6, 7 +[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 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5012-5021, 2019. 1, 2, 3, 4, 6, 7, 8 +[50] Peiqin Zhuang, Yali Wang, and Yu Qiao. Learning attentive pairwise interaction for fine-grained classification. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI, pages 13130-13137, 2020. 2, 6, 7 \ No newline at end of file diff --git a/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/images.zip b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..252a3a499825f0b245f6f0ee6d6b85cfc3e9e483 --- /dev/null +++ b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6ae549992561f8419d4a178d40e60d43b8ac6238bd4d8a1c955610c17d17d8e +size 746908 diff --git a/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/layout.json b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ffcc100c50e947a85b7faacc2f69a8bcfdf75aad --- /dev/null +++ b/graphbasedhighorderrelationdiscoveryforfinegrainedrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e203436dbece80d10ab555efdf899dcf954467c47ef3d8d623f80fb881d20177 +size 428063 diff --git a/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_content_list.json b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a23990f808689612dfeff36bd0c2d4db45bcdfe9 --- /dev/null +++ b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de2bfbb8e45fc7c389d5483f34e69ad9561bfda0c59c518b205f158da1663ea4 +size 73604 diff --git a/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_model.json b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..95296d7928c205f9a62db2a05bbfffebb34d581d --- /dev/null +++ b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3d3a24162ced175bbb5658d519b2f82510b2fc17f25260ef720f9c00da4d316 +size 88481 diff --git a/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_origin.pdf b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..56fb6b8a140f5640123b20e49038a59bfb4e0624 --- /dev/null +++ b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/4b3bf7cc-5148-47bf-a8dd-7cdfd58686d1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa9f2a674cc6ef2279f3ba837984d1735335e495a3451e8f8ac3c07f43ed704c +size 6954827 diff --git a/graphbasedhighorderrelationmodelingforlongtermactionrecognition/full.md b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1f6f09d111946ca14dd6ecdf850091493713cc11 --- /dev/null +++ b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/full.md @@ -0,0 +1,291 @@ +# Graph-based High-order Relation Modeling for Long-term Action Recognition + +Jiaming Zhou $^{1,5}$ , Kun-Yu Lin $^{1}$ , Haoxin Li $^{3}$ , Wei-Shi Zheng $^{1,2,4*}$ + +$^{1}$ School of Computer Science and Engineering, Sun Yat-sen University, China $^{2}$ Peng Cheng Laboratory, Shenzhen 518005, China + +$^{3}$ School of Electronics and Information Technology, Sun Yat-sen University, China + +4Key Laboratory of Machine Intelligence and Advanced Computing, Ministry of Education, China +5Pazhou Lab, Guangzhou, China + +jia ming zhou@outlook.com, kunyulin14@outlook.com, lihaoxin05@gmail.com, wszheng@ieee.org + +# Abstract + +Long-term actions involve many important visual concepts, e.g., objects, motions, and sub-actions, and there are various relations among these concepts, which we call basic relations. These basic relations will jointly affect each other during the temporal evolution of long-term actions, which forms the high-order relations that are essential for long-term action recognition. In this paper, we propose a Graph-based High-order Relation Modeling (GHRM) module to exploit the high-order relations in the long-term actions for long-term action recognition. In GHRM, each basic relation in the long-term actions will be modeled by a graph, where each node represents a segment in a long video. Moreover, when modeling each basic relation, the information from all the other basic relations will be incorporated by GHRM, and thus the high-order relations in the long-term actions can be well exploited. To better exploit the high-order relations along the time dimension, we design a GHRM-layer consisting of a Temporal-GHRM branch and a Semantic-GHRM branch, which aims to model the local temporal high-order relations and global semantic high-order relations. The experimental results on three long-term action recognition datasets, namely, Breakfast, Charades, and MultiThumos, demonstrate the effectiveness of our model. + +# 1. Introduction + +In the computer vision community, there have been many studies on action recognition. Approaches such as two-stream networks [24], Inflated-3D networks (I3D) [2], and temporal segment networks (TSN) [28] have shown their effectiveness for action recognition. The actions these studies mainly focus on are from pre-trimmed clips of videos + +![](images/f67cecc9699fe44971a9fb509fc295da1bad34a520f798fafefce0246cfe4cf2.jpg) +Figure 1. 10 frames selected from the long video $Q948H$ in Charades [23] show "A person sits on a bed, grabs a book off of a table, finds a picture in the book, puts the book back, and stares at the picture". The purple and cyan cues show two basic relation instances, and there are some connections between them. As the woman opens the book but then closes it quickly without reading it, we can infer that the picture is found from this book. Additionally, the woman does not put the book and picture back together, so she may going to look at the picture. Therefore, the information in these two basic relation instances can affect each other. + +and last only a few seconds, which we call short-term actions. However, the videos we are usually exposed to in daily life are more complex long videos, so trimming short-term actions from those long videos is very time-consuming and labor-intensive. More importantly, trimming short-term actions from long videos without considering the possible internal relations between them will prevent action recognition research from achieving the goal of understanding complex human behaviors. + +In contrast to short-term actions, long-term actions [10, 11, 32] are actions in untrimmed videos that have a very long execution time. A long-term action generally contains multiple sub-actions, among which some complicated relations may exist. The goal of long-term action recognition is to identify the long-term action or to identify all sub-actions that occur during the execution of the long-term ac + +tion. Thus, only long-term action category labels or all sub-action category labels need to be provided for long-term action recognition task, which will largely reduce the cost of dataset annotation. Therefore, long-term action recognition provides a feasible way for us to understand complex human behaviors. + +In the long-term actions, there are many important visual concepts, e.g., objects, motions, and sub-actions. Various relations may exist among these visual concepts, such as relations between humans and objects, relations between sub-actions, etc., which we call basic relations. These basic relations will jointly affect each other during the temporal evolution of long-term actions, which forms the high-order relations in the long-term actions. Therefore, exploiting the high-order relations in long-term actions from these basic relations is the key to recognizing long-term actions. In the example from the Charades [23] dataset shown in Figure 1, we can find two visual cues in this long video. The purple cue shows an instance of the basic relation, i.e., "grab a book $\rightarrow$ open the book $\rightarrow$ close the book $\rightarrow$ put the book back". The cyan cue shows another instance of the basic relation, i.e., "find a picture $\rightarrow$ hold the picture $\rightarrow$ stare at the picture". There are some connections between these two basic relation instances, which forms the high-order relations. For example, there is a connection between the actions open the book, close the book in the first basic relation instance and the action find a picture in the second basic relation instance, as finding a picture from a book makes it reasonable that a person would open the book but then close it quickly without reading it. Similarly, the actions close the book, put the book back in the first instance can provide a clue for the action stare at the picture in the second instance. Therefore, for long-term action recognition, it is important to model each basic relation well. More importantly, to exploit the high-order relations in the long-term actions, the information from all the other basic relations should be incorporated while modeling each basic relation. + +In this work, we propose a novel Graph-based High-order Relation Modeling (GHRM) module, which exploits the high-order relations from the basic relations in the long-term actions for recognition. In GHRM, each basic relation in the long-term actions will be modeled by a graph convolutional module, with each segment in a long video as a graph node. As these basic relations can affect each other and then form the high-order relations during the temporal evolution of long-term actions, GHRM will incorporate the information from all the other basic relations when modeling each basic relation, thus the high-order relations in the long-term actions can be well exploited. To better exploit the high-order relations in the long-term actions along the time dimension, our model constructs the GHRM-layer based on the GHRM module, which considers both the local + +temporal high-order relations and the global semantic high-order relations by using a Temporal-GHRM branch and a Semantic-GHRM branch, respectively. The Temporal-GHRM branch reasons the graph locally to leverage the temporal context between neighboring segments, while the Semantic-GHRM branch will reason the graph globally to leverage the semantic context between segments without the limitation of temporal distance. + +To summarize, the main contributions of this work are: + +- A novel GHRM module is proposed to exploit the high-order relations from the basic relations in the long-term actions. +- A GHRM-layer consisting of a Temporal-GHRM branch and a Semantic-GHRM branch is designed to model the local temporal high-order relations and the global semantic high-order relations in the long-term actions. + +Our proposed model achieves state-of-the-art performance on three popular long-term action recognition datasets: Breakfast [15], Charades [23], and MultiThumos [31], which demonstrates the effectiveness of our model. + +# 2. Related Work + +# 2.1. Action Recognition + +From the perspective of the duration of actions, action recognition can be divided into short-term and long-term action recognition. Short-term actions usually refer to actions that last only a few seconds, while long-term actions are often minute-long. + +Short-term Action Recognition. Videos in short-term action datasets (e.g., UCF101 [25], HMDB-51 [16], SomethingV2 [9]) are usually pre-trimmed and last only a few seconds. Early works such as Karpathy et al. [13] aimed to recognize short-term actions using 2D CNN. Later, many works [1, 24, 27] utilized the motion features to capture the local dynamics on the time dimension. The temporal cues in action recognition are important: some works [2, 26] extended the 2D CNN to 3D CNN to model the dependencies in the time dimension, and others [5, 6, 19] introduced RNN to learn temporal patterns by treating action recognition as a sequence modeling problem. + +Long-term Action Recognition. As more long-term action recognition datasets (e.g., Breakfast [15], Charades [23]) have been proposed, many researchers have turned their attention to long-term action recognition. Sigurdss et al. [22] stacked CRF on top of the CNN output to model long-term temporal relations. TRN [34] explored the multi-scale temporal relations among video segments. Non-local networks [29] inserted non-local blocks into 3D CNN to capture long-range dependencies. Timeception [10] built multiscale convolutional layers on top of CNN features that can recognize complex actions with long-range temporal depen + +dencies. RhyRNN [32] designed a specific RNN structure to ease the gradient flow in a long sequence. However, all these methods struggle to exploit the high-order relations in the long-term actions and ignore either local temporal relations or global semantic relations in the long-term actions. + +# 2.2. Graph Convolutional Networks + +The graph convolutional networks (GCN) [14] defined the convolution operation on non-Euclidean structures, which have shown effectiveness in relation modeling and have been widely used in many research areas in computer vision, such as image recognition [4, 17], object detection [18, 21], and action recognition [3, 7, 30]. However, most of these GCN-based approaches are not effective enough for long-term action recognition, as they do not consider the multiple basic relations in the long-term actions. Zhang et al. [33] deduced multi-kinds of global semantic relations of an action using multiple graphs, but they did not consider the relations between these graphs while reasoning on each graph. In this paper, our proposed GHRM can incorporate the information from all the other basic relations while modeling each basic relation, thus the information in different graphs will be fused to exploit the high-order relations in the long-term actions. + +# 3. Our Approach + +We denote a long video with $L$ frames by $V = \{v_{1}, v_{2}, \dots, v_{L-1}, v_{L}\}$ . Each long video may have two kinds of ground-truths: i) the long-term action category ground-truth is $Y^{la} \in \{0, 1, \dots, M-2, M-1\}$ , where $M$ is the number of long-term action categories in the dataset; ii) the sub-action category ground-truth can be given by the vector $Y^{sa} \in \{0, 1\}^{N}$ , where $N$ is the number of sub-action categories in the dataset. The long-term action recognition task aims to recognize the category of the long-term action $Y^{la}$ or categories of all sub-actions $Y^{sa}$ in a long video. + +# 3.1. Model Overview + +In this paper, we propose a model to exploit the high-order relations in the long-term actions. Figure 2 illustrates the framework of our model. For a long video with $L$ frames, our model first uniformly samples $T$ segments where each segment has $S$ consecutive frames. Then we use a feature extractor (e.g., I3D [2]) to extract the segment features $X = \{x_{1}, x_{2}, \dots, x_{T - 1}, x_{T}\}$ , where $x_{t} \in \mathbb{R}^{C}$ is the feature of the $t$ -th segment and $C$ is the feature dimension. Based on the segment features, our model learns the feature $X_{in}$ by constructing multiple graphs, which will be the input of stacked GHRM-layers to exploit the high-order relations in the long-term actions. In addition, our GHRM-layer contains a Temporal-GHRM branch and a Semantic-GHRM branch to model the local temporal high-order relations and global semantic high-order relations respectively, + +![](images/9180b6e8226c19e7fe9a60fbd948b84f46153553c94a4315863447e8c82356e9.jpg) +Figure 2. Illustration of our framework for long-term action recognition. We first use a backbone model to extract the segment features from a long video. Then multiple graphs are constructed on the embedded extracted features. Features from all graphs will be fed into GHRM-layer to exploit the high-order relations in long-term actions. Our GHRM-layer contains a Temporal-GHRM branch and a Semantic-GHRM branch to capture the local temporal relations and the global semantic relations respectively. The output features from these two complementary branches will be added together as the input of the next GHRM-layer. After each GHRM-layer, we downsample the segment features in the time dimension to half of the original size. Finally, a graph fusion layer and a classification layer will be applied to recognize the long-term actions. + +and features from these two branches will be fused as the input of the next GHRM-layer. Finally, we fuse these graphs and use a classification layer to recognize the long-term actions. In the following, we will elaborate on our model. + +# 3.2. Graph-based High-order Relation Modeling + +In this subsection, we describe our Graph-based High-order Relation Modeling (GHRM) module, which aims to exploit the high-order relations in the long-term actions. For each basic relation in the long-term actions, our GHRM constructs a graph to model it. These basic relations will affect each other during the temporal evolution of long-term actions, which forms the high-order relations. GHRM would incorporate the information from all the other basic relations during graph reasoning for each basic relation, thus the high-order relations in the long-term actions can be well exploited. The overall graph structure of our GHRM and how GHRM models the high-order relations will be introduced in the following. + +# 3.2.1 Graph Structure + +To model multiple basic relations in the long-term actions, GHRM first constructs a graph on the extracted feature $X\in \mathbb{R}^{T\times C}$ for each basic relation, where each node represents a segment in a long video. We denote these $K$ graphs by $\mathrm{G} = \{\mathcal{G}^1 (\mathcal{V}^1,\mathcal{E}^1),\mathcal{G}^2 (\mathcal{V}^2,\mathcal{E}^2),\dots ,\mathcal{G}^K (\mathcal{V}^K,\mathcal{E}^K)\}$ , where $K$ is the total number of basic relations that we want to model and $\mathcal{G}^i (\mathcal{V}^i,\mathcal{E}^i)$ is the $i$ -th graph used to model the $i$ -th basic relation. In the $i$ -th graph, $\mathcal{V}^i$ , and $\mathcal{E}^i$ denote the vertex and edge sets, respectively. Each segment node $x_{u}\in \mathbb{R}^{C}$ is + +![](images/37de40ca70a6c79484753e05e08590bdae0d3c4e3ccad1afd7956d4df161dc71.jpg) +Figure 3. An overview of our proposed GHRM module. There are a total of $K$ graphs for modeling $K$ basic relations in the long-term actions. For each graph $\mathcal{G}^i$ , GHRM first calculates its adjacent matrix $\mathcal{A}^i$ with the function $g^i$ which would incorporate the information from all the other graphs. Then, the aggregated feature $X_{agg}^{i}$ of the segment nodes in each graph $\mathcal{G}^i$ is obtained based on its adjacent matrix $\mathcal{A}^i$ . Finally, the new representation of the segment nodes $X_{out}^{i}$ in each graph $\mathcal{G}^i$ will be calculated by the embedding function $\rho^i$ , which can also incorporate the information from all the other graphs. Best viewed in color. + +a vertex in $\mathcal{V}^i$ , and $\mathcal{E}_{(u,v)}^i \in \{0,1\}$ in $\mathcal{E}^i$ indicates whether there is an edge between the $u$ -th segment node $x_u^i$ and the $v$ -th segment node $x_v^i$ in the $i$ -th graph. + +The graph reasoning process of GHRM is illustrated in Figure 3. For each graph $\mathcal{G}^i (\mathcal{V}^i,\mathcal{E}^i)$ , we first calculate its adjacent matrix $\mathcal{A}^i$ by incorporating the information from the other graphs. Then node aggregation will be performed to obtain the aggregated feature $X_{agg}^{i}$ of the segment nodes in each graph $\mathcal{G}^i$ based on its adjacent matrix $\mathcal{A}^i$ . Finally, GHRM utilizes an embedding layer $\rho^i$ , which can also incorporate the information from all the other graphs to obtain the new representation of the segment nodes $X_{out}^{i}$ in each graph $\mathcal{G}^i$ (the adjacent matrix $\mathcal{A}^i$ and the embedding layer $\rho^i$ are the key to modeling the high-order relations, which will be shown later). + +Thus, our GHRM can be formulated as follows for each graph $\mathcal{G}^i (\mathcal{V}^i,\mathcal{E}^i)$ : + +$$ +X _ {a g g} ^ {i} = \mathcal {A} ^ {i} X _ {i n} ^ {i}, \tag {1} +$$ + +$$ +X _ {o u t} ^ {i} = \rho^ {i} \left(X _ {a g g} ^ {1}, \dots , X _ {a g g} ^ {K}\right). +$$ + +In Equation (1), the input feature $X_{in}^{i}\in \mathbb{R}^{T\times C}$ represents the segment nodes in the $i$ -th graph, which could be $f^{i}(X)$ where $f^{i}$ is a learnable layer used to embed the extracted feature $X$ . $\mathcal{A}^i\in \mathbb{R}^{T\times T}$ is the adjacency matrix of the $i$ -th graph. $X_{agg}^{i}\in \mathbb{R}^{T\times C}$ is the aggregated node feature in the $i$ -th graph. $\rho^i$ is the embedding layer which would incorporate the information from other graphs to embed the aggregated node feature $X_{agg}^{i}$ in the $i$ -th graph. $X_{out}^{i}\in \mathbb{R}^{T\times C}$ is the new hidden representation of the segment nodes in the $i$ -th graph. + +# 3.2.2 High-order Relation Modeling + +To exploit the high-order relations in the long-term actions, our proposed GHRM aims to incorporate the information from all the other graphs through the adjacent matrix $\mathcal{A}^i$ and the embedding layer $\rho^i$ in the $i$ -th graph $\mathcal{G}^i$ during graph reasoning for the $i$ -th basic relation. + +- Construction of Adjacent Matrix $\mathcal{A}^i$ . The adjacent matrix in the graph reflects the degree of correlation between graph nodes, which represents the relation modeled by the graph. Our GHRM uses a graph to model each basic relation in the long-term actions. These basic relations will jointly affect each other and then form the high-order relations during the temporal evolution of long-term actions. Therefore, we consider the influence of the information from all the other graphs when constructing the adjacent matrix $\mathcal{A}^i$ for each graph $\mathcal{G}^i$ . For the $u$ -th segment node $x_u^i \in \mathbb{R}^C$ and the $v$ -th segment node $x_v^i \in \mathbb{R}^C$ in the $i$ -th graph, GHRM will calculate the connection strength value $\mathcal{A}_{(u,v)}^i$ between them as: + +$$ +\mathcal {A} _ {(u, v)} ^ {i} = \left\{ \begin{array}{l l} \frac {\exp \left(g ^ {i} \left(x _ {u}\right) ^ {T} g ^ {i} \left(x _ {v}\right)\right)}{\sum_ {w = 1} ^ {T} \exp \left(g ^ {i} \left(x _ {u}\right) ^ {T} g ^ {i} \left(x _ {w}\right)\right)}, & \text {i f} \mathcal {E} _ {(u, v)} ^ {i} = 1, \\ 0, & \text {i f} \mathcal {E} _ {(u, v)} ^ {i} = 0, \end{array} \right. (2) +$$ + +$$ +g ^ {i} (x _ {u}) = W ^ {i} [ (x _ {u} ^ {1}) ^ {T}, \dots , (\beta^ {i} (x _ {u} ^ {i})) ^ {T}, \dots , (x _ {u} ^ {K}) ^ {T} ]. +$$ + +When there is an edge between segment nodes $x_{u}^{i}$ and $x_{v}^{i}$ , i.e., $\mathcal{E}_{(u,v)}^{i} = 1$ in $\mathcal{E}^i$ , $\mathcal{A}_{(u,v)}^i$ is calculated as the inner product with softmax. And when there is no edge between these two nodes, i.e., $\mathcal{E}_{(u,v)}^i = 0$ , $\mathcal{A}_{(u,v)}^i$ is set as 0. In Equation (2), $W^{i}\in \mathbb{R}^{C\times (K\cdot C)}$ is the parameter of embedding layer $g^{i}$ , which transforms the feature $x_{u}$ into the $i$ -th relation space, and the feature $x_{u}\in \mathbb{R}^{K\cdot C}$ is concatenated from + +the $u$ -th segment nodes in all graphs ( $\beta^i$ is the embedding layer for segment nodes in the $i$ -th graph), so the connection strength value $\mathcal{A}_{(u,v)}^i$ between segment nodes $x_u^i$ and $x_v^i$ in the $i$ -th graph will be affected by all the other graphs. Therefore, the information from other graphs will be incorporated to exploit the high-order relations. + +- Embedding Layer $\rho^i$ . The embedding layer of GCN will embed the aggregated feature of the segment nodes to the new hidden representation. GHRM can incorporate the information from other graphs while embedding the aggregated feature $X_{agg}^{i}\in \mathbb{R}^{T\times C}$ in each graph $\mathcal{G}^i$ as follows: + +$$ +\begin{array}{l} \rho^ {i} \left(X _ {a g g} ^ {1}, \dots , X _ {a g g} ^ {K}\right) = \delta \left(X _ {a g g} \mathcal {W} ^ {i}\right) \\ = \delta \left(\left[ X _ {a g g} ^ {1}, \dots , \gamma^ {i} \left(X _ {a g g} ^ {i}\right), \dots , X _ {a g g} ^ {K} \right] \mathcal {W} ^ {i}\right), \tag {3} \\ \end{array} +$$ + +where $\delta$ is a nonlinear function. $\mathcal{W}^i\in \mathbb{R}^{(K\cdot C)\times C}$ is the parameter of embedding layer $\rho^i$ in the $i$ -th graph. $X_{agg}\in \mathbb{R}^{T\times (K\cdot C)}$ is the concatenated aggregated node feature that incorporates information from all the other graphs, thus the high-order relations can be exploited. $\gamma^i$ is the embedding layer for aggregated node feature $X_{agg}^{i}$ in the $i$ -th graph. + +Remark. By utilizing the adjacent matrix $\mathcal{A}^i$ in Equation (2) and the embedding layer $\rho^i$ in Equation (3) to reason each graph $\mathcal{G}^i(\mathcal{V}^i, \mathcal{E}^i)$ , the information from all the other graphs can be incorporated, thus the high-order relations in long-term actions can be well exploited. Compared with GHRM, Vanilla-GCN (a group of standard GCNs [14]) can also use multiple separated graphs to model the basic relations in the long-term actions, which can be seen as a degenerated version of our proposed GHRM. However, Vanilla-GCN will not consider the information exchange between these graphs, which makes itself lack the ability to exploit the high-order relations in the long-term actions. + +# 3.3. Structure of GHRM-layer + +To better exploit the high-order relations in the long-term actions along the time dimension, our model constructs the GHRM-layer based on the GHRM module, which takes both the local temporal high-order relations and global semantic high-order relations into consideration. GHRM-layer contains two complementary branches: the Temporal-GHRM branch, which reasons the graph locally to leverage the temporal context between neighboring segments, and the Semantic-GHRM branch, which reasons the graph globally to leverage the semantic context between segments without the limitation of temporal distance. + +- Temporal-GHRM. The temporal relations between neighboring segments in videos are important to understand the long-term actions. Temporal-GHRM leverages the temporal context in a long video by defining temporal edges $\mathcal{E}^i$ in each graph $\mathcal{G}^i(\mathcal{V}^i, \mathcal{E}^i)$ . For the $u$ -th segment node $x_u^i$ in the $i$ -th graph, Temporal-GHRM restricts its temporal + +neighboring nodes $x_{v}^{i}$ in the $i$ -th graph in a local manner: + +$$ +\mathcal {E} _ {(u, v)} ^ {i} = \left\{ \begin{array}{l l} 1, & \text {i f} | u - v | \leq \left\lfloor \frac {W}{2} \right\rfloor , \\ 0, & \text {o t h e r w i s e}, \end{array} \right. \tag {4} +$$ + +where $W$ is the window size that refers to the number of neighboring nodes connected by each segment node. + +- Semantic-GHRM. In addition to the temporal relations between neighboring segments, there are also rich semantic relations that may exist in any pair of segments (regardless of the temporal distance between segments) in a long video. Semantic-GHRM leverages the semantic context in a long video using a complete graph: + +$$ +\mathcal {E} _ {(u, v)} ^ {i} = 1, \tag {5} +$$ + +which means that each pair of segment nodes in each graph has an edge connected. + +Our GHRM-layer takes the feature $X_{in}^{i}\in \mathbb{R}^{T\times C}$ of each graph $\mathcal{G}^i$ together as the input, i.e. $X_{in}\in \mathbb{R}^{K\times T\times C}$ . The input feature $X_{in}$ will flow to the Temporal-GHRM branch and the Semantic-GHRM branch to capture the local temporal high-order relations and the global semantic high-order relations, respectively. And the output features $X_{out}^{T}\in \mathbb{R}^{K\times T\times C}$ and $X_{out}^{S}\in \mathbb{R}^{K\times T\times C}$ from these two branches will be fused into $X_{out}\in \mathbb{R}^{K\times T\times C}$ by adding, which will then serve as the input of the next GHRM-layer. + +# 3.4. Graph Fusion and Classification Header + +As GHRM can incorporate the information from other graphs during graph reasoning, the relations modeled by each graph after the stacked GHRM-layers are already high-order relations. Thus, we fuse these graphs in the following effective way. For the segment nodes $X^i \in \mathbb{R}^{T \times C}$ in each graph $\mathcal{G}^i$ , we first use a learnable layer $f^i: \mathbb{R}^C \to \mathbb{R}^{\hat{C}}$ to reduce the feature dimension to $\hat{C}$ . Then all graphs will be fused into a single graph $\mathcal{G}^F$ with segment nodes $X^F \in \mathbb{R}^{T \times \tilde{C}}$ by concatenating the corresponding node from all graphs, i.e., $X^F = [f^1(X^1), \dots, f^K(X^K)]$ , where $\tilde{C} = K \cdot \hat{C}$ . After Graph Fusion, we will feed the segment nodes $X^F$ into the final classification header to predict the category of the long-term action $Y^{la}$ or the categories of all sub-actions $Y^{sa}$ in a long video. + +# 4. Experiments + +In this section, we first introduce the metrics used in long-term action recognition and present the details of three long-term action datasets: Breakfast [15], Charades [23], and MultiThumos [31]. Then we will demonstrate the effectiveness of our model and compare it with the state-of-the-arts. After that, we also conduct ablation studies to show the effect of each component of our model. Finally, we compare our GHRM module with Vanilla-GCN quantitatively and qualitatively. + +
MethodsmAP(%)Acc(%)
Kinetics [2] pre-trained backbone
I3D [2]47.0558.61
ActionVLAD [8]60.2065.48
Timeception [10]61.8267.07
VideoGraph [11]63.1469.45
Ours65.8675.49
Breakfast fine-tuned backbone
I3D [2]61.1974.83
Ours73.8989.01
+ +Table 1. Long-term action recognition results on Breakfast. For the Kinetics pre-trained I3D backbone, our proposed model outperforms the state-of-the-art method VideoGraph [11] by $2.72\%$ in mAP and $6.04\%$ in Acc. Using the fine-tuned I3D backbone, our model achieves $73.89\%$ in mAP and $89.01\%$ in Acc, respectively. + +
MethodsModalitymAP (%)
C3D [26]RGB10.9
Two-stream [24]RGB + Flow18.6
Two-stream + LSTM [24]RGB + Flow17.8
ActionVLAD [8]RGB + iDT21.0
Temporal Fields [22]RGB + Flow22.4
TRN [34]RGB25.2
3D ResNet-50 + GCN [30]RGB + RP37.5
3D ResNet-101 + NL [29]RGB37.5
I3D [2]RGB32.9
Timeception [10]RGB37.2
VideoGraph [11]RGB37.8
OursRGB38.3
+ +Table 2. Long-term action recognition results on Charades. Our model outperforms the I3D baseline and Non-local Networks by $5.4\%$ and $0.8\%$ in mAP, respectively. Moreover, compared with the state-of-the-art method VideoGraph, it achieves $0.5\%$ improvement in mAP. + +# 4.1. Metrics and Datasets + +Recognition metrics. The goal of the long-term action recognition task is to recognize the category of long-term action or the categories of all sub-actions in a long video. Therefore, we use Accuracy (Acc) as the evaluation metric for long-term action classification and Mean Average Precision (mAP) for sub-action classification. + +Breakfast. The Breakfast dataset has 1712 breakfast preparation-related long videos. These videos record 52 unique participants, each conducting 10 distinct cooking activities captured in 18 different kitchens. Overall, there are 48 different sub-actions, where each video contains 6 sub-actions and lasts 2.3 minutes on average. We use the same split method as proposed in [10] which has 1357 long + +videos for training and 355 for testing. As both the long-term action category labels and the sub-action category labels are provided, we evaluate our model with both the Acc and mAP metrics. + +Charades. Charades is a large dataset with 9848 annotated long videos, 7985 for training and 1863 for testing. These long videos record 267 people's casual daily activities in 15 types of indoor scenes. On average each video is 30 seconds long and has 6.8 sub-actions. Charades has 157 sub-action classes. As Charades only provides sub-action category labels, we follow Hussein et al. [10] to evaluate our model using the mAP metric. + +MultiThumos. The MultiThumos dataset is a complex untrimmed dataset which contains 413 long videos, 200 for training and 213 for testing, with a total duration of 30 hours. It is extended from Thumos14 [12] by providing dense and multi-label annotations for the videos. There are a total of 65 sub-actions in MultiThumos, with an average of 11 sub-actions in each video. The metric mAP is used for evaluation on this dataset. + +# 4.2. Implementation Details + +We use PyTorch [20] to implement our model. Following the experimental settings in [10], for a long video with $L$ frames, we uniformly sample 64 segments with 8 consecutive frames in each segment, thus a total of 512 frames will be sampled from each long video. The segment features are extracted from the output of the last pooling layer of the I3D network [2], so the size of each segment feature is 1024 with the spatial dimension maxpooled. To make our GHRM module more efficient and lightweight, we adopt a channel sharing strategy on layer $g^{i}$ in Equation (2) and layer $\rho^i$ in Equation (3) during graph reasoning for each graph $\mathcal{G}^i$ . The window size $W$ in Temporal-GHRM is 7. We use stochastic gradient descent with a momentum of 0.9 to optimize our model. The batch size is 32 and the learning rate is 0.5. The weight decay is set as $10^{-4}$ . Similar to [10], the backbone model in our framework will not be end-to-end trained. See more details in the supplementary material. + +# 4.3. Comparison with the State-of-the-art + +Breakfast: Table 1 compares the long-term action recognition results of our model and several related methods on the Breakfast dataset by stacking four GHRM-layers with 32 graphs on I3D backbone. As shown in Table 1, for the Kinetics [2] pre-trained I3D backbone, our model outperforms the I3D baseline by $18.81\%$ in mAP and $16.88\%$ in Acc, and outperforms the state-of-the-art method VideoGraph [11] by $2.72\%$ in mAP and $6.04\%$ in Acc. We also fine-tune the I3D on the Breakfast dataset to extract better visual features. Using the fine-tuned I3D as the backbone, our model achieves $73.89\%$ in mAP and $89.01\%$ in Acc, which is a large improvement over the fine-tuned I3D. + +
MethodsmAP (%)
I3D [2]72.43
Timeception [10]74.79
Ours79.89
+ +![](images/72ad77bc9572f9fadb71de552f1ce18f33a2f1c2e88b7e47f1286c05090f35f3.jpg) +Figure 4. Comparison of the effects of using different numbers of GHRM-layers. Our model achieves the best results on Charades and Breakfast using two and four GHRM-layers respectively. + +![](images/b4aa47b1a2c4126d066a1d091b90c09764b91cdc703342b16ae8abfd0109109d.jpg) + +Charades: We compare our model with both short-term and long-term action recognition methods by stacking two GHRM-layers with 64 graphs on the I3D backbone. As shown in Table 2, our model outperforms the I3D baseline and Non-local Networks [29] which uses a stronger backbone by $5.4\%$ and $0.8\%$ in mAP, respectively. Moreover, our model outperforms the state-of-the-art long-term action recognition method VideoGraph [11], achieving state-of-the-art performance on this large dataset. + +MultiThumos: We use MultiThumos as the third long-term action recognition dataset to demonstrate the effectiveness of our model. By stacking four GHRM-layers with 64 graphs on the Kinetics pre-trained I3D backbone, we achieve state-of-the-art performance on MultiThumos. As shown in Table 3, our model can reach $79.89\%$ in mAP, which exceeds the state-of-the-art method Timeception [10] by $5.10\%$ in mAP. + +# 4.4. Ablation Studies + +Number of GHRM-layers. Stacking multiple GHRM-layers is effective for modeling the long-term relations in long videos. In Figure 4, we show the effects of using different numbers of GHRM-layers on the Charades and Breakfast datasets. The results show that stacking two and four GHRM-layers are sufficient for the Charades and Breakfast datasets respectively. By stacking more GHRM-layers, the performance on Breakfast can be continuously boosted, while it does not on Charades. The reason is that the average duration of the videos in Breakfast is 2.3 minutes, which is + +Table 3. Long-term action recognition results on MultiThumos. Our model outperforms the I3D baseline and the state-of-the-art method Timeception by $7.46\%$ and $5.10\%$ in mAP respectively. + +
Number of GraphsmAP on BreakfastmAP on Charades
K=861.236.5
K=1663.137.5
K=3265.938.0
K=6465.738.3
K=12863.838.1
+ +Table 4. mAP(%) comparisons of different numbers of graphs used in GHRM. We achieve the best results on Breakfast and Charades when using 32 and 64 graphs respectively. + +
ModelsmAP on BreakfastmAP on Charades
I3D47.132.9
Semantic-GHRM56.436.7
Temporal-GHRM62.937.3
Ours65.938.3
+ +Table 5. The effects of the Temporal-GHRM branch and SemanticGHRM branch of our model. The mAP(%) results on both Breakfast and Charades drop remarkably when either branch is removed. + +much longer than 0.5 minutes in Charades. + +Number of Graphs. Our GHRM uses a graph to model each basic relation in the long-term actions, so we analyze the effects of using different numbers of graphs in GHRM on both Breakfast and Charades. As shown in Table 4, our model achieves the best result on Breakfast with 32 graphs, but 64 graphs are needed for achieving the best result on Charades. As the long-term actions in Charades are more diverse, which requires our model to use more graphs on this dataset. + +Model Components. Our GHRM-layer contains a Temporal-GHRM branch and a Semantic-GHRM branch that aim to model the local temporal high-order relations and global semantic high-order relations, respectively. We ablate these two branches by removing one of them. As shown in Table 5, the results on both Breakfast and Charades drop remarkably when either branch is removed, which demonstrates that our Temporal-GHRM branch and Semantic-GHRM branch are complementary. + +# 4.5. Comparison with Vanilla-GCN + +Both Vanilla-GCN and the proposed GHRM module use multiple graphs to model the basic relations in long-term actions. Our GHRM can exploit the high-order relations in the long-term actions by incorporating the information from all the other graphs when reasoning on each graph, while the Vanilla-GCN fails to exploit the high-order relations due to the lack of information exchange between multiple graphs. To further demonstrate the effectiveness of modeling high-order relation on long-term action recognition, we replace our GHRM module with Vanilla-GCN for quantitative and + +![](images/fde84ab14338d21e426fcef13f241e4e8211e26a85512828a98acc76646ef253.jpg) +(a) Vanilla-GCN + +![](images/05459b4e4bd07b6eeddfa83e9628dde0e44e23e56320740a91686aeaadae2a0a.jpg) +(b) GHRM + +![](images/57972c1593c28f6bb4b8f3bf1e104c1ca1400267f1006fa48f508983e9d8c59b.jpg) +Figure 5. Visualizations of the adjacent matrices in Vanilla-GCN and GHRM. Figure (a) shows 8 adjacent matrices in Vanilla-GCN that have very similar patterns. Figure (b) shows 8 adjacent matrices in GHRM that have very diverse patterns. +Charades +Figure 6. Comparison between GHRM and Vanilla-GCN using different numbers of graphs on both Charades and Breakfast. Regardless of how many graphs are used, GHRM is much better than Vanilla-GCN. And with more graphs used, the performance of our GHRM generally increases, while the performance of Vanilla-GCN does not. + +![](images/d337b7b4768d2411ddf3175353c592dad9efabede7f8440baccc23cb3260eb4b.jpg) +Breakfast + +qualitative comparisons. + +Quantitative Analysis. In Figure 6, we compare the performance of our GHRM and Vanilla-GCN on both Charades and Breakfast with different numbers of graphs $K$ . As shown in this figure, regardless of how many graphs are used to model the basic relations in long-term actions, our GHRM performs much better than Vanilla-GCN. Moreover, with more graphs used, the performance of our GHRM generally increases, while the performance of Vanilla-GCN does not. These results demonstrate high-order relation modeling is effective to recognize the long-term actions. + +Qualitative Analysis. Figure 5 shows 8 adjacent matrices of a video sample produced by Vanilla-GCN and GHRM respectively (randomly selected from the 16 semantic adjacent matrices in both modules). Figure 5 (a) shows 8 adjacent matrices in Vanilla-GCN which have very similar patterns, while Figure 5 (b) shows 8 adjacent matrices in GHRM that have diverse patterns. This phenomenon indicates that different graphs can interact with each other in GHRM, such that different basic relations will be figured out and the high-order relations in the long-term actions can + +be naturally exploited. See more visualizations in the supplementary material. + +# 5. Conclusions + +In this paper, we propose a Graph-based High-order Relation Modeling (GHRM) module to tackle the task of long-term action recognition. Long-term actions involve many visual concepts, and there are many basic relations among these concepts. As these basic relations will affect each other and then form the high-order relations during the temporal evolution of long-term actions, our proposed GHRM incorporates information from all the other basic relations when modeling each basic relation, thus the high-order relations in the long-term actions can be well exploited from these basic relations. Furthermore, to better model the high-order relations in the long-term actions along the time dimension, a GHRM-layer consisting of a Temporal-GHRM branch and a Semantic-GHRM branch is designed to model the local temporal high-order relations and the global semantic high-order relations in the long-term actions. The experimental results on three popular long-term action recognition datasets (i.e., Breakfast, Charades, and MultiThumos) have demonstrated the effectiveness of our proposed model. + +# 6. Acknowledgement + +This work was supported partially by the National Key Research and Development Program of China (2018YFB1004903), NSFC(U1911401,U1811461), Guangdong Province Science and Technology Innovation Leading Talents (2016TX03X157), Guangdong NSF Project (No. 2020B1515120085, No. 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] Hakan Bilen, Basura Fernando, Efstratios Gavves, and Andrea Vedaldi. Action recognition with dynamic image networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. 2 +[2] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In IEEE Conference on Computer Vision and Pattern Recognition, 2017. 1, 2, 3, 6, 7 +[3] Yunpeng Chen, Marcus Rohrbach, Zhicheng Yan, Shuicheng Yan, Jiashi Feng, and Yannis Kalantidis. Graph-based global reasoning networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 3 +[4] Zhao-Min Chen, Xiu-Shen Wei, Peng Wang, and Yanwen Guo. Multi-label image recognition with graph convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 3 +[5] Jeff Donahue, Lisa Anne Hendricks, Marcus Rohrbach, Subhashini Venugopalan, Sergio Guadarrama, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. 2 +[6] Wenbin Du, Yali Wang, and Yu Qiao. Recurrent spatial-temporal attention network for action recognition in videos. IEEE Transactions on Image Processing, 2017. 2 +[7] Junyu Gao, Tianzhu Zhang, and Changsheng Xu. I know the relationships: Zero-shot action recognition via two-stream graph convolutional networks and knowledge graphs. In The Thirty-Third AAAI Conference on Artificial Intelligence, 2019. 3 +[8] Rohit Girdhar, Deva Ramanan, Abhinav Gupta, Josef Sivic, and Bryan C. Russell. Actionvlad: Learning spatio-temporal aggregation for action classification. In IEEE Conference on Computer Vision and Pattern Recognition, 2017. 6 +[9] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fründ, Peter Yianilos, Moritz Mueller-Freitag, Florian Hoppe, Christian Thurau, Ingo Bax, and Roland Memisevic. The "something something" video database for learning and evaluating visual common sense. In IEEE International Conference on Computer Vision, 2017. 2 +[10] Noureldien Hussein, Efstratios Gavves, and Arnold W. M. Smeulders. Timeception for complex action recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 1, 2, 6, 7 +[11] Noureldien Hussein, Efstratios Gavves, and Arnold W. M. Smeulders. Videograph: Recognizing minutes-long human activities in videos. CoRR, 2019. 1, 6, 7 +[12] Haroon Idrees, Amir R Zamir, Yu-Gang Jiang, Alex Gorban, Ivan Laptev, Rahul Sukthankar, and Mubarak Shah. The thumos challenge on action recognition for videos "in the wild". Computer Vision and Image Understanding, 2017. 6 +[13] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Fei-Fei Li. Large-scale video classification with convolutional neural networks. In IEEE + +Conference on Computer Vision and Pattern Recognition, 2014. 2 +[14] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In the 5th International Conference on Learning Representations. OpenReview.net, 2017. 3, 5 +[15] Hilde Kuehne, Ali Bilgin Arslan, and Thomas Serre. The language of actions: Recovering the syntax and semantics of goal-directed human activities. In IEEE Conference on Computer Vision and Pattern Recognition, 2014. 2, 5 +[16] Hildegard Kuehne, Hueihan Jhuang, Estfibaliz Garrote, Tomaso A. Poggio, and Thomas Serre. HMDB: A large video database for human motion recognition. In IEEE International Conference on Computer Vision, 2011. 2 +[17] Qing Li, Xiaojiang Peng, Yu Qiao, and Qiang Peng. Learning label correlations for multi-label image recognition with graph networks. Pattern Recognition Letters, 2020. 3 +[18] Ao Luo, Xin Li, Fan Yang, Zhicheng Jiao, Hong Cheng, and Siwei Lyu. Cascade graph neural networks for rgb-d salient object detection. In European Conference on Computer Vision, 2020. 3 +[19] Bo Pang, Kaiwen Zha, Hanwen Cao, Chen Shi, and Cewu Lu. Deep RNN framework for visual sequential applications. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 2 +[20] 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 +[21] Weijing Shi and Raj Rajkumar. Point-gnn: Graph neural network for 3d object detection in a point cloud. In IEEE Conference on Computer Vision and Pattern Recognition, 2020. 3 +[22] Gunnar A. Sigurdsson, Santosh Kumar Divvala, Ali Farhadi, and Abhinav Gupta. Asynchronous temporal fields for action recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2017. 2, 6 +[23] 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, 2016. 1, 2, 5 +[24] Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. In the 27th International Conference on Neural Information Processing Systems, 2014. 1, 2, 6 +[25] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. CoRR, 2012. 2 +[26] Du Tran, Lubomir D. Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In IEEE International Conference on Computer Vision, 2015. 2, 6 +[27] Heng Wang, Alexander Kläser, Cordelia Schmid, and Cheng-Lin Liu. Action recognition by dense trajectories. In IEEE Conference on Computer Vision and Pattern Recognition, 2011. 2 + +[28] 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, 2019. 1 +[29] Xiaolong Wang, Ross B. Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2018. 2, 6, 7 +[30] Xiaolong Wang and Abhinav Gupta. Videos as space-time region graphs. In European Conference on Computer Vision, 2018. 3, 6 +[31] 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, 2018. 2, 5 +[32] Tianshu Yu, Yikang Li, and Baoxin Li. Rhyrnn: Rhythmic RNN for recognizing events in long and complex videos. In European Conference on Computer Vision, 2020. 1, 3 +[33] Jingran Zhang, Fumin Shen, Xing Xu, and Heng Tao Shen. Temporal reasoning graph for activity recognition. IEEE Transactions on Image Processing, 2020. 3 +[34] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In European Conference on Computer Vision, 2018. 2, 6 \ No newline at end of file diff --git a/graphbasedhighorderrelationmodelingforlongtermactionrecognition/images.zip b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5912ac3230e09e33ab9ad47937294f83ac98ee9a --- /dev/null +++ b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8f55661eb6146c5272a6b95c57f1ed51078251018fbf963695488809fa41164 +size 388204 diff --git a/graphbasedhighorderrelationmodelingforlongtermactionrecognition/layout.json b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..56dbcb8c68ef28ab6b9d37017b8c80ea79d19aea --- /dev/null +++ b/graphbasedhighorderrelationmodelingforlongtermactionrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85c1b17f3e795288416e3c79136d1942201d7a29c5bb02ddb45bcb9d001a5a59 +size 432388 diff --git a/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_content_list.json b/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0450f11b947f54d4ff699c962324cd8e05574f47 --- /dev/null +++ b/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:240b20363c1b158a7a27474b83f937a9e2196a155272b6b6b765eac7ebabf33f +size 79431 diff --git a/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_model.json b/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9975663c6b363730dc8d2359d053e3f8c3ca1686 --- /dev/null +++ b/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aef41b0c643abd2f728f3e4f0884bf2517a1acf702b9b96cd7115c4533835c8 +size 100612 diff --git a/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_origin.pdf b/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..798375d846f264c65d7ef9d0f3eb62628364fe58 --- /dev/null +++ b/graphstackedhourglassnetworksfor3dhumanposeestimation/49979181-62ff-484b-a607-f1b949049b6e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afe15ce71ad88853cd6eb406cb941a01d09489d490c0dc1fd7d7ed95bdcddb9d +size 713063 diff --git a/graphstackedhourglassnetworksfor3dhumanposeestimation/full.md b/graphstackedhourglassnetworksfor3dhumanposeestimation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3267fbad65e926da27e5b8833891100e305025eb --- /dev/null +++ b/graphstackedhourglassnetworksfor3dhumanposeestimation/full.md @@ -0,0 +1,308 @@ +# Graph Stacked Hourglass Networks for 3D Human Pose Estimation + +Tianhan Xu, Wataru Takano + +Osaka University + +xth430@gmail.com, takano@sigmath.es.osaka-u.ac.jp + +# Abstract + +In this paper, we propose a novel graph convolutional network architecture, Graph Stacked Hourglass Networks, for 2D-to-3D human pose estimation tasks. The proposed architecture consists of repeated encoder-decoder, in which graph-structured features are processed across three different scales of human skeletal representations. This multiscale architecture enables the model to learn both local and global feature representations, which are critical for 3D human pose estimation. We also introduce a multi-level feature learning approach using different-depth intermediate features and show the performance improvements that result from exploiting multi-scale, multi-level feature representations. Extensive experiments are conducted to validate our approach, and the results show that our model outperforms the state-of-the-art. + +# 1. Introduction + +In recent years, with the application of deep learning methods, the performance of 2D human pose estimation has been greatly improved. Recent works show that using such detected 2D joints positions, the 3D human pose can also be efficiently and accurately regressed [27]. Due to the graph structure formed by the topology of the human skeleton, many attempts have been made to use the generalized form of CNN: Graph Convolutional Networks (GCN), to perform the regression task of 2D-to-3D human pose estimation [48, 7, 23]. Since the graph convolution has a good feature extraction capability for the graph-structured data, the GCN-based approaches work well and some of them achieve the state-of-the-art results in the 2D-to-3D human pose estimation task. + +However, the existing GCN-based approaches have the following limitations: First, the graph convolutions exploit all node information, which can be seen as that all features are processed at only "one scale". Thus it is difficult to extract features that can represent spatial local and global information and limits the representation capabilities. Second, most existing approaches use a straightforward archi + +tecture of sequentially connecting the graph convolution layers (Fig. 4 (Top)). Such a model architecture does not take advantage of the benefits of model depth, such as intermediate features at each depth, and therefore limits its performance. + +The core issue mentioned above is that the features extracted by existing architecture are oversimple, which limits the expressiveness of the model. Features with greater representation capabilities, such as multi-scale and multi-level features, are commonly used in image-related tasks. For multi-scale features, they denote the information from small to large resolutions of the image features, thus bringing rich image understanding from local to global [5, 22], while multi-level features denote the latent representations in different depths of the latent space, bringing important semantic information at all levels from shallow to deep. The introduction of the above multi-scale and multi-level features can enrich the performance of the model. However, because the upsampling and downsampling operations required for multi-scale features are defined on the image, and the graph has an irregular structure, such methods cannot be directly applied to the graph-structured data. + +To address these issues, we propose a novel architecture for 2D-to-3D human pose estimation: Graph Stacked Hourglass Networks. Specifically, we do not focus on specific graph convolution operations, but rather consider how to integrate them in the architecture which gives the best performance improvement. Given the advantages of the 2D human pose estimation approaches, proposed architecture adopts the repeated encoder-decoder applicable to the graph-structured data for multi-scale feature extraction, as well as the intermediate features at each depth of the model for multi-level feature extraction. Such multi-scale and multi-level feature information makes the model more expressive and enables the model to achieve high-precision 3D human pose estimation. + +Our work makes the following contributions. First, we propose Graph Hourglass modules suitable for extracting multi-scale human skeletal features, which includes novel pooling and unpooling operations considering human skeletal structure, called Skeletal Pool and Skeletal Unpool. + +![](images/336fa8dd3dbe5599f32482fbc3e4284fa7bf116f6e271c651b71c719ca6b29bf.jpg) +0. Pelvis +1. R. Hip +2.R.Knee +3. R. Ankle +4. L. Hip +5. L. Knee +6. L. Ankle +7. Thorax +8 Neck +9. Head +10.1. Shoulder +11. L. Elbow +12. L. Wrist +13.R.Shoulder +14.R.Elyer +4.R. Elbow 15.R.Wrist +(a) + +![](images/d296f9d8c7474d3a421048841037325b9df47e99b0a1ba49eb928cf76aeef47c.jpg) +High (16 joints) +Mid (8 joints) +(b) + +![](images/0975036ec0f1b1cc7e003d9afb7dc33bd57d7f9cbaede15606a9725e22c9f985.jpg) +Low (4 joints) + +![](images/affc8a1c3cb04e1a804eb502c49abd8b744e0ff585d3722fe565d9a56bf37344.jpg) +(c) +Figure 1. Description of the skeletal structure of the human body. (a) The human skeletal graph structure consisting of 16 joints used in this paper. (b) Illustration of Skeletal Pool. A pair of joints composed of the same color, mapped by the max pooling operation to corresponding joints in lower scale skeletal structure. Here we define three different scales of skeletal structures, containing 16, 8, and 4 joints, respectively. (c) Illustration of Skeletal Unpool. When reverting to a higher scale skeletal structure, we duplicate the features of the lower scale joints and assign them to the two corresponding joints in the higher scale skeletal structure. + +Second, we introduce Graph Stacked Hourglass Networks (GraphSH) consisting of the proposed Graph Hourglass module, which incorporates multi-level feature representations at various depths of the architecture. Our architecture incorporates multi-scale, multi-level features and a priori knowledge of the human skeleton, achieving impressive performance improvement for 2D-to-3D human pose estimation tasks. + +# 2. Related Work + +3D Human Pose Estimation. Predicting the 3D human pose from images or videos has been an essential topic in computer vision for a long time. In the early days, handcrafted features, perspective relationships, and geometric constraints were used to predict 3D human pose [42, 32, 1, 14]. In recent years, with the development of deep learning, there has been an increase in using deep neural networks for image-to-3D human pose estimation [43, 44, 34, 41, 47, 8]. + +Some methods regress 3D human pose directly from images. Tekin et al. [43] propose a method that first train an autoencoder to learn the latent representation of the 3D human pose, then use CNN to regress the image with the latent representation, and finally connect the trained CNN with the decoder to achieve the prediction from image to 3D human pose. Pavlakos et al. [34] exploit voxel to discretize representations of the space around the human body and use 3D heatmaps to estimate 3D human pose. + +There are also methods that break the problem down into two steps: first predicting 2D human joints from the image, and then using the 2D joints information to predict 3D human pose. Our approach falls into this category. Martinez et al. [27] propose a simple yet effective baseline for 3D hu + +man pose estimation that uses only 2D joints information but get highly accurate results, showing the importance of 2D joints information for 3D human pose estimation. Since the human skeleton's topology can be viewed as a graph structure, there has been increasing use of Graph Convolutional Networks (GCN) for 2D-to-3D human pose estimation tasks [48, 7, 23]. + +Graph Convolutional Networks. Graph Convolutional Networks (GCN) are used to perform convolution operations on graph-structured data, such as human skeleton, thus enabling effective feature extraction. The early simple GCN is the 'vanilla' GCN proposed by Kipf and Welling [17], which consists of a simple graph convolution operation that performs the transformation and aggregation of graph-structured data, and it becomes the basic model for various graph convolution later on. The following GCNs are based on this model with some improvements and are applied to 2D-to-3D human pose estimation. Zhao et al. [48] propose Semantic Graph Convolution (SemGConv), which has learnable adjacency matrix parameters, enabling the model to learn the semantic relationships between the human joints. In the two graph convolutions just introduced, each node information is transformed using the same weight matrix and then aggregated. Liu et al. [23] point out that sharing the same weight by all nodes limits the representation capabilities of graph convolution, and propose a new method that, first transforming each node information using different weights and then aggregating them together, called Pre-Aggregation Graph Convolution (PreAggr). They also introduce an approach that decouples the self-connections in the graph and use separate weight to compute the self-information transformation. + +The GCN using the above graph convolution for 3D hu + +![](images/e6800fe4c27811af4441024ed8e74acd1299406bf6ae98fc788572438b974435.jpg) +Figure 2. Illustration of the Graph Hourglass Module. The skeletal scale is reduced by graph convolution and skeletal pooling, upsampled by skeletal unpooling after reaching the lowest scale, and finally restored to the original skeletal scale. As the skeletal scale decrease, we increase the number of channels $(64\to 96\to 128$ in our experiments). Each graph convolution layer is followed by Batch Normalization [13] and ReLU activation [29]. Residual connections are used between features at each scale. Note that the inputs and outputs of the hourglass module maintain the same shape. + +man pose estimation, however, only use a straightforward overall architecture, as in Fig. 4 (Top). Such a simple architecture prevents the model from using the multi-scale, multi-level features common in image-based tasks, limiting the performance of the model. + +Multi-scale and Multi-level Learning. Multi-scale and multi-level features learning drives advances in a wide variety of image-based tasks [37, 24]. Multi-scale feature learning refers to integrating features in different resolutions to provide a better understanding within the spatial domain. Feature Pyramid Network (FPN) [22] is a powerful multi-scale feature extractor and achieves encouraging results in object detection tasks. In the task of 2D human pose estimation from image, Hourglass structure for extracting multi-scale features allows the model to learn both local and global features, which are essential for human pose understanding. (e.g., spatial configuration relationships between human joints) [31, 30, 40]. Multi-level feature learning, on the other hand, represents the use of features at various depths of the network. Some methods use a skip layer to incorporate features from the intermediate layer of the network and then combine them into the output layer [3, 25]. Zhao et al. [49] incorporate multi-scale and multi-level features, combining image pyramids of different depths to extract higher feature representations. + +These image-based methods take advantage of the fact that images can be easily scaled up and down and the richness of intermediate features, thus enabling multi-scale and multi-level feature extraction. However, due to the graph structure's irregularity, it is not trivial to scale it up or down like an image, so such approaches have not been applied much to tasks with graph-structured data. + +In the next section, we present our proposed novel graph convolutional network architecture that integrates multiscale and multi-level features of the graph-structured data. + +# 3. Graph Stacked Hourglass Networks + +# 3.1. Hourglass Module + +Our approach is inspired by Stacked Hourglass Networks proposed by Newell et al. [31] for estimating 2D human pose from images, which exploits repeated hourglass-like encoder-decoder architecture. We aim to extend such an hourglass structure to the graph for extracting multi-scale features of the graph-structured data. + +Using deep neural networks for computer vision tasks, multi-scale features of the image are essential for image understanding. Since images have large amounts of information at high resolution, the model can extract much detailed information from them. Alternatively, while the image is at low resolution, the model can better extract globalized information. The hourglass structure, accompanied by downsampling and upsampling operations, enables the image features to go through all resolutions so that crucial information can be extracted at all scales. Previous works have shown that this hourglass structure has strong feature extraction capabilities, especially for tasks requiring both local and global information, such as human pose estimation [31, 30]. Moreover, stacking such a structure enables repeated feature extraction and enhances model performance. + +Our motivation is to extend such a structure with powerful multi-scale feature extraction capabilities to graph-structured data to achieve highly accurate 2D-to-3D human pose estimation. In the hourglass structure, downsampling and upsampling of the data are implemented by pooling and unpooling operations, respectively. Such operations are easy to define on the images because of their regularized structure, but there is no consistent way to define them on the graph. On this point, there are some previous works regarding pooling and unpooling operations on the graph [9, 18]. However, these pooling and unpooling operations are defined on the more generalized arbitrary-shaped + +![](images/367ff1ca6cf408b1f7d71b6755e5b76e31ab9eb092596ff159a3edad54f1a3bb.jpg) +Figure 3. The overall architecture of our network. The input 2D joints are fed into the hourglass module after the pre-processed graph convolution layer, and the outputs of the hourglass module are both processed as intermediate features, and also fed into the subsequent hourglass modules, except the last one. All the intermediate features are concatenated and entered into the SE block [12], then the final feature is passed through a 1x1 convolutional layer to output the final 3D pose prediction. The number of the convolution module indicates the number of channels of the output. Our network takes a 4-stacking approach. The input and output of the hourglass module keep the dimension of 64 channels. Note that the graph structure is maintained throughout the whole network. + +graph structure, while the human skeletal graph used in this study has a fixed structure as shown in Fig. 1(a). Here, we exploit this property to propose pooling and unpooling methods applicable to the human skeletal graph, called Skeletal Pooling and Skeletal Unpooling. + +Skeletal pooling. According to the property of the human body structure, we group the human body nodes in pairs, where the corresponding two nodes' features are fused into one node in the lower-scale skeleton structure, using max pooling operation. With repeated pooling operation, we can obtain three different scales of skeletal structures containing 16, 8, and 4 nodes, respectively, and each of them corresponds to a different graph structure. For relatively lower-scale graph representations, we use more channels to encode information to prevent information degradation. The illustration of skeletal pooling and the three-scales skeleton graph structures are shown in Fig. 1(b). + +Skeletal unpooling. We use unpooling operation to restore lower-scale skeletal structures to their original size, enabling them to fuse higher-scale skeletal information and pass it to subsequent processing. We adopt a very simple approach: since lower-scale nodes are generated by two grouped higher-scale nodes, in unpooling operation, we duplicate the feature representations of the lower-scale node and assign them to corresponding two nodes to recover the higher-scale skeletal representations. The illustration of skeletal unpooling is shown in Fig. 1(c). + +Graph hourglass design. Using the above skeletal pooling and unpooling operations, we propose a novel graph hourglass module applicable to human skeleton representation. The detailed hourglass structure is shown in Fig. 2. For the same scale of the skeletal structure, we applied the residual connections [11] to pass information and prevent the vanishing gradient problem. Note that our hourglass structure does not depend on the specific graph convolution. + +tion layer, so arbitrary graph convolution operation can be implemented on our model, such as the three introduced in Sect. 2. + +Graph U-Nets proposed by Gao et al. [9] is the closest work to our architecture, but differs in two ways. First, [9] uses an input-related dynamic pooling operation so that different pooled skeletal structures are obtained depending on the input. Our method utilizes a priori knowledge of human skeletal structure, and this approach is more suitable for feature extraction of specific skeletal structures while ensuring the stability of pooling. Second, we use more channels at relatively low scales of skeleton representation to reduce information loss due to scale changes and make our architecture more expressive, while Graph U-Nets uses the same number of channels at all scales. + +# 3.2. Multi-scale and Multi-level Features + +Features are extracted at multi-scales as the hourglass module processes the information across three skeletal structures. As multi-scale features that can represent information on the spatial aspect of the graph, we believe that multi-level features in terms of the depth of latent space can also bring valuable information to the final prediction. Specifically, we integrate the intermediate features at each depth level of the network for the final 3D human pose estimation. As shown in Fig. 3, we use the spatial 1x1 convolution to reduce the channels of intermediate features and concatenate them into an overall feature representation $\mathbf{f}_{cat}$ . For the architecture that stacks $n$ hourglass modules, the overall feature can be represented as: + +$$ +\mathbf {f} _ {c a t} = \operatorname {C o n c a t} \left(\mathbf {f} _ {1}, \mathbf {f} _ {2}, \dots , \mathbf {f} _ {n}\right) \in \mathbb {R} ^ {K \times C}, \mathbf {f} _ {i} \in \mathbb {R} ^ {K \times \frac {C}{n}}. \tag {1} +$$ + +Here $K$ is the number of joints, and $C$ represents the number of input and output channels of the hourglass module + +$(C = 64$ in our experiments). Then, we follow the Squeeze- and Excitation block (SE block) [12] to enhance important semantic information in multi-level features. SE block computes the channel-wise weights of the overall feature, and since the overall feature is concatenated by multi-level features along the channel axis, this block enables the model to extract the more semantically meaningful feature representations among each intermediate feature. Specifically, first we use global average pooling to transform the overall feature $\mathbf{f}_{cat} \in \mathbb{R}^{K \times C}$ into a channel-wise statistics $\mathbf{z} \in \mathbb{R}^C$ ; then we use $\mathbf{z}$ to calculate the channel-wise dependency $\mathbf{s}$ as follows: + +$$ +\mathbf {s} = \operatorname {S i g m o i d} \left(\mathbf {W} _ {2} \operatorname {R e L U} \left(\mathbf {W} _ {1} \mathbf {z}\right)\right). \tag {2} +$$ + +Here $\mathbf{W_1}\in \mathbb{R}^{\frac{C}{r}\times C},\mathbf{W_2}\in \mathbb{R}^{C\times \frac{C}{r}}$ , and $r$ indicates reduction ratio $(r = 8$ in our experiments). Finally, the features of each channel are weighted by s as follows. + +$$ +\tilde {\mathbf {f}} _ {c a t} = \mathbf {f} _ {c a t} \odot \mathbf {s}, \tag {3} +$$ + +The output feature of SE block $\tilde{\mathbf{f}}_{cat}$ is then fed to the output layer for final prediction. + +# 3.3. Network Architecture + +As in previous works [31, 30], our backbone network consists of the proposed graph hourglass module stacked. + +The input 2D joint information is first mapped to the latent feature space via a pre-processing graph convolution layer. The features that through the hourglass module are fed into the 1x1 convolution layer to be transformed into intermediate features, and also passed to the next hourglass module, except the last one. All the intermediate features are concatenated into the final feature, and the SE block adjusts its channel-wise weights, and which is then fed into the output convolution layer and mapped to the output space. Our overall network structure is shown in Fig. 3. + +In the following experiments, our model uses PreAggr [23] as the graph convolution layer, with 4-stacking hourglass approaches and latent space of 64 channels. + +# 4. Experiments + +In this section, we first describe the experimental setup for 2D-to-3D human pose estimation tasks. Next, we introduce the dataset used and its evaluation protocols. Then several ablation studies are conducted regarding the proposed architecture. Finally, we show our experimental results and comparisons with state-of-the-art methods. + +# 4.1. 2D-to-3D human pose estimation + +Our goal is to predict 3D joint positions in the camera coordinate system with given 2D joint positions in the pixel + +![](images/156179efff040118868960bd144901419a5516e7cf117505d2e176d121f0b1d8.jpg) + +![](images/eece169605888a1444060f85b1312109a01085321d3c3bd8b6123046df93c633.jpg) +Figure 4. Comparison of the model architecture. Top: Most used Sequential Residual blocks architecture (SeqRes) for GCN-based 2D-to-3D human pose estimation [23, 48, 7]. The rectangles represent the graph convolution layers. Bottom: Proposed Graph Stacked Hourglass Networks architecture. Multi-scale, multi-level features are indicated in the figure. Refer to Fig. 3 for detailed architecture. + +coordinate system. Specifically, 2D joints consisting of $K$ nodes are described by $\mathbf{x} \in \mathbb{R}^{K \times 2}$ , the corresponding 3D joints are $\mathbf{y} \in \mathbb{R}^{K \times 3}$ . The model aims to learn a mapping $f^{*}: \mathbb{R}^{K \times 2} \to \mathbb{R}^{K \times 3}$ that minimizes the errors over a dataset containing $N$ poses. + +$$ +f ^ {*} = \underset {f} {\operatorname {a r g m i n}} \frac {1}{N} \sum_ {i = 1} ^ {N} \mathcal {L} \left(f \left(\mathbf {x} _ {i}\right), \mathbf {y} _ {i}\right). \tag {4} +$$ + +In this study, Mean Squared Error (MSE) is used as a loss function $\mathcal{L}$ for training. + +# 4.2. Datasets and Evaluation Protocols + +Datasets. The Human3.6M dataset [15] is the most widely used dataset in the 3D human pose estimation tasks. It uses motion captures to obtain the 3D pose information of the subjects and 4 cameras with different orientations to record the corresponding video image information. The provided camera parameters allow us to obtain the ground truth of the corresponding 2D joint coordinates in each image frame. The dataset provides 3.6 million images by recording 11 professional actors performing 15 different actions, such as eating, walking, etc. In the following experiments, we mainly use the Human3.6M for training and testing. The MPI-INF-3DHP test set [28] provides images in three different scenarios: studio with a green screen (GS), studio without green screen (noGS) and outdoor scene (Outdoor). We use this dataset to test the generalization capabilities of our proposed architecture. + +Evaluation protocols. For the Human3.6M, There are two evaluation protocols used in previous works [27, 48, 23, 7]. Protocol #1 uses the Mean Per Joint Position Error (MPJPE) in millimeter as evaluation metric, which calculates the Euclidean distance error between the predic + +
MethodparamsMPJPE (mm)
gPool/gUnpool [9]3.70M40.6
SAGPool [18]/gUnpool [9]3.70M41.5
w/o Pool/Unpool6.86M38.2
Skeletal Pool/Unpool3.70M35.8
+ +Table 1. Ablation study of pool/unpool operation. Various methods of graph pool/unpool are used, and the method that remove the pool/unpool layer is also added for comparison. + +
MethodparamsMPJPE (mm)
No ML-F3.70M38.0
ML-F w/o SE block3.70M37.1
ML-F w/ SE block (Ours)3.70M35.8
+ +tion and the ground truth after the origin (pelvis) alignment. Protocol #2 aligns the prediction with the ground truth by rigid transformation and then calculates the error. In this study, we use Protocol #1 to evaluate our approach since performance under both protocols is usually consistent and Protocol #1 is more appropriate for our experimental setup. For the MPI-INF-3DHP test set, we follow previous works [26, 7] and use 3D-PCK and AUC as evaluation metrics. + +# 4.3. Implementation Details + +Our implementation follows the settings of previous works [27, 48, 23]. As introduced in [35], we normalize the coordinates of the 2d and 3d joints and align the root joint (pelvis) to the origin. + +In our experiments, we use a 4-stacked hourglass architecture. Previous works typically use 128 as the number of channels [48, 7, 23], but due to the relative complexity of our model architecture, we use 64 channels to keep the number of parameters at the same scale as previous works. We use Adam [16] as the optimizer with an initial learning rate set to 0.0001 and decay by 0.92 per 20,000 iterations. We use a mini-batch size of 256. Since the learning of graph-structured data is very prone to overfitting, we apply Dropout [39] with a dropout probability of 0.25 to all graph convolutional layers within the hourglass module. The entire training follows an end-to-end fashion. + +# 4.4. Ablation Study + +Pooling and Unpooling. Pooling and unpooling layers play an important role in the hourglass module. + +Due to the graph structure's irregularity, there is no consistent way to pool graph-structured data, so we compare the impact of different pooling methods on model perfor + +Table 2. Ablation study of multi-level features (ML-F). With almost the same number of parameters, our proposed approach using multi-level features with SE block achieves the best results. + +
MethodparamsMPJPE (mm)
Vanilla [17]SeqRes0.14M94.4
GraphSH0.22M59.1
SemGConv [48]SeqRes0.27M52.5
GraphSH0.44M39.2
PreAggr [23]SeqRes4.22M37.8
GraphSH3.70M35.8
+ +Table 3. Comparison of Sequential Residual blocks (SeqRes) (Fig. 4 (Top)) and Graph Stacked Hourglass (GraphSH) architectures on 2d-to-3d human pose estimation errors. Three different graph convolution operations are used. + +mance. Here we compare the performance of three graph pooling operations: gPool [9], SAGPool [18], and our proposed Skeletal Pool. + +The first two pooling methods take the same idea: calculate the scores of each node by some operation, and keep the part of the node with the higher score. Such pooling methods are initially designed for more general graph pooling situations, with the benefit that pooling operations can be defined for different graph-structured inputs. However, since the human skeleton used in this study has a fixed graph structure, it does not take advantage of the benefits of these pooling approaches. Moreover, since these pooling methods are input-dependent, different subgraphs are generated based on different inputs, which not only introduces computational complexity but also makes it difficult for the model to learn valuable features stably. + +Compared to the above pooling methods that require computation, our pooling approach is more like methods that focus on geometric information of graph structure (e.g., edges, nodes), such as mesh sampling [36] or edge contraction [10] in mesh convolution. Specifically, We follow the node grouping method in [48] to perform pooling operations on paired nodes. In their work, the features lose their graph structure after pooling. We extend their grouping concept by designing three subgraph structures of the human body consisting of 16, 8, and 4 nodes, respectively. Such a pooling approach not only exploits the topology of the human skeleton, which is more interpretable relative to other pooling approaches, but also, due to its simplicity, greatly reduces the computational complexity of the pooling layer and improves the speed of training and inference. Moreover, the two pooling methods mentioned above completely discard some nodes' information, resulting in some degree of information loss. Instead, our proposed Skeletal Pool refers to the concept of image pooling, which performs a maximum pooling operation between two nodes, thus can summarize the information of both nodes. + +Regarding unpooling, in Graph U-Net [9], the gUnpool operation assigns zero vectors to nodes that are not selected at the time of pooling, which loses much valuable infor + +
Protocol #1Direct.DiscussEatingGreetPhonePhotoPosePurch.SittingSittingD.SmokeWaitWalkD.WalkWalkT.Avg.
Lee et al. [19] ECCV'18 (†)40.249.247.852.650.175.050.243.055.873.954.155.658.243.343.352.8
Pavillo et al. [35] CVPR'19 (†)45.246.743.345.648.155.144.644.357.365.847.144.049.032.833.946.8
Cai et al. [4] ICCV'19 (†)44.647.445.648.850.859.047.243.957.961.949.746.651.337.139.448.8
Xu et al. [45] CVPR'20 (†)37.443.542.742.746.659.741.345.152.760.245.843.147.733.737.145.6
Martinez et al. [27] ICCV'1751.856.258.159.069.578.455.258.174.094.662.359.165.149.552.462.9
Tekin et al. [44] ICCV'1754.261.460.261.279.478.363.181.670.1107.369.370.374.351.863.269.7
Sun et al. [41] ICCV'17 (+)52.854.854.254.361.867.253.153.671.786.761.553.461.647.153.459.1
Yang et al. [47] CVPR'18 (+)51.558.950.457.062.165.449.852.769.285.257.458.443.660.147.758.6
Fang et al. [8] AAAI'1850.154.357.057.166.673.353.455.772.888.660.357.762.747.550.660.4
Pavlakos et al. [33] CVPR'18 (+)48.554.454.552.059.465.349.952.965.871.156.652.960.944.747.856.2
Zhao et al. [48] CVPR'1948.260.851.864.064.653.651.167.488.757.773.265.648.964.851.960.8
Sharma et al. [38] ICCV'1948.654.554.255.762.272.050.554.370.078.358.155.461.445.249.758.0
Ci et al. [7] ICCV'19 (+)(*)46.852.344.750.452.968.949.646.460.278.951.250.054.840.443.352.7
Liu et al. [23] ECCV'2046.352.247.350.755.567.149.246.060.471.151.550.154.540.343.752.4
Ours45.249.947.550.954.966.148.546.359.771.551.448.653.939.944.151.9
+ +Table 4. Quantitative evaluation results using MPJPE in millimeter on Human3.6M [15] under Protocol #1, no rigid alignment or transform applied in post-processing. CPN [6] detections 2D keypoints are used as input. (+) uses extra data from MPII [2]. (†) uses temporal information. Best in bold. + +
Protocol #1Direct.DiscussEatingGreetPhonePhotoPosePurch.SittingSittingD.SmokeWaitWalkD.WalkWalkT.Avg.
Zhou et al. [50] ICCV'19 (+)34.442.436.642.138.239.834.740.245.660.839.042.642.029.831.739.9
Ci et al. [7] ICCV'19 (+)(*)36.338.829.737.834.642.539.832.536.239.534.438.438.231.334.236.3
Martinez et al. [27] ICCV'1745.246.743.345.648.155.144.644.357.365.847.144.049.032.833.946.8
Zhao et al. [48] CVPR'1937.849.437.640.945.141.440.148.350.142.253.544.340.547.339.043.8
Liu et al. [23] ECCV'2036.840.333.036.337.545.039.734.940.347.737.438.538.629.632.037.8
Ours35.838.131.035.335.843.237.331.738.445.535.436.736.827.930.735.8
+ +Table 5. Quantitative evaluation results using MPJPE in millimeter on Human3.6M [15] under Protocol #1, no rigid alignment or transform applied in post-processing. Ground truth 2D keypoints are used as input. (+) uses extra data from MPII [2]. (*) uses pose scales in both training and testing. Best in bold. + +mation and results in more sparse features. Experimental results show that such an unpooling operation is not suitable for understanding structures with few nodes like the human skeleton. On the contrary, our proposed Skeletal Unpool operation copies and assigns the node features in the lower-scale graph representation to the corresponding two nodes in the higher-scale graph, passes them into the following graph convolutional layer, makes our model have better representation capability. + +We conduct experiments based on three pool/unpool settings, and the results are shown in Table 1. We also add a comparison that removes all the pool/unpool layers to validate the importance of the proposed skeletal pool/unpool approaches. Note that we use ground truth 2D joints as input in this and the following ablation experiments to eliminate the influence of the 2D human pose detector. + +Multi-scale and Multi-level Features. Multi-scale feature extraction is achieved by pooling and unpooling in the hourglass module that transforms features across three different scales. For comparison, we remove all pooling and unpooling layers in our architecture, which means that the features are always processed at the highest scale. The results in Table 1 show that multi-scale features derived from skeletal pooling and unpooling can improve model performance. For multi-level features, our architecture concate + +nates each level's intermediate features and feeds them into the SE block to obtain the final overall feature. We compare three different settings: (1) No multi-level features are used. At this point the model simply connect all the hourglass modules sequentially, and the last hourglass modules is connected to the final output layer of 1x1 convolution. (2) Remove the SE block that calculates the weights of each intermediate feature. (3) Our proposed GraphSH architecture. Results are shown in Table 2. + +Stacked Hourglass Architecture. To verify that our architecture has better performance than the simple Sequential Residual blocks (denoted as SeqRes) in previous works [48, 23, 7], we use Vanilla Graph Convolution, Semantic Graph Convolution (SemGConv), and Pre-aggregation Graph Convolution (PreAggr) introduced in Sect. 2 as convolution layers in our GraphSH architecture, respectively, and compare them to the corresponding SeqRes models. To make the comparison fair, we reduce the number of channels in the convolution to 64, so that the overall number of parameters is at the same scale as the SeqRes model. Results are shown in Table 3. + +The results show that the model using our architecture performs better even though we use fewer channels than other GCN-based approaches. Our architecture does not rely on specific graph convolution layers, which suggests + +![](images/ddbee12b6866ad62b1f4b74835b5e51475894dbfd08e27fb3d57dd14dcb523ef.jpg) +Figure 5. Qualitative results of our method on Human3.6M [15]. + +![](images/b9b45118428b74724de448ce135ec27e34ead3b4b521ac7e32c668474d623b3c.jpg) + +that any graph convolution layers for 3D human pose estimation can be applied to our architecture and improve its performance compared to the SeqRes architecture. + +Moreover, our hourglass module can be seen as a well-integrated, high-performance graph convolution module, indicating that our hourglass module is general and can be easily extended to other tasks using graph convolution, such as action recognition [46, 20], motion prediction [21], etc. + +# 4.5. Comparison with the State-of-the-Art + +We use two types of 2D joint detection data for evaluation: Cascaded Pyramid Network (CPN) [6] detections and ground truth 2D keypoints, the results are shown in Table 4 and Table 5, respectively. Among the other methods, some use temporal information [19, 35, 4, 45], some use additional data for training [41, 47, 33], and some use 3D pose scale in both training and testing [7]. These results suggest that our approach outperforms the state-of-the-art. + +Table 5 show that when given precise 2D joint information, the performance improvement of our model is significant, outperforming other GCN-based methods by a large margin. Therefore, we believe that in combination with methods that refine detected 2D joint information, such as deep kinematic analysis [45], the performance of our method on noisy 2D joints can be enhanced even more. Compared to the second-place method [23] (4.38M), our model uses fewer parameters (3.70M), showing that our architecture can extract more important features, which provides a better understanding of the human pose. + +To evaluate the generalization capabilities of our ap- + +
Training dataGSnoGSOutdoorAll (PCK)All (AUC)
Martinez [27]H36M49.842.531.242.517.0
Mehta [28]H36M70.862.358.864.731.7
Yang [47]H36M+MPII---69.032.0
Zhou [51]H36M+MPII71.164.772.769.232.5
Luo [26]H36M71.359.465.765.633.2
Ci [7]H36M74.870.877.374.036.7
Zhou [50]H36M+MPII75.671.380.375.338.0
OursH36M81.581.775.280.145.8
+ +Table 6. Results on the MPI-INF-3DHP test set [28]. + +proach to domain shift, we apply the model trained on the Human3.6M to the MPI-INF-3DHP test set. Results are shown in Table 6. Although we train the model using only the Human3.6M, our approach outperforms the others, indicating that our architecture has strong generalization capabilities to unseen datasets. + +The qualitative results of our method are shown in Fig. 5. + +# 5. Conclusions + +We present a novel architecture for 2D-to-3D human pose estimation, the Graph Stacked Hourglass Networks (GraphSH). With our unique skeletal pooling and skeletal unpooling scheme, together with the proposed architecture which has powerful multi-scale and multi-level feature extraction capabilities on graph-structured data, our method achieves accurate 2D-to-3D human pose estimation outperforming the state-of-the-art. As future work, we hope to introduce temporal multi-frame features in our architecture for further improvement. + +# References + +[1] A. Agarwal and B. Triggs. Recovering 3d human pose from monocular images. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(1):44-58, 2006. 2 +[2] M. Andriluka, L. Pishchulin, P. Gehler, and B. Schiele. 2d human pose estimation: New benchmark and state of the art analysis. 2014 IEEE Conference on Computer Vision and Pattern Recognition, pages 3686-3693, 2014. 7 +[3] G. Bertasius, J. Shi, and L. Torresani. Deepedge: A multiscale bifurcated deep network for top-down contour detection. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4380-4389, 2015. 3 +[4] 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. 7, 8 +[5] Zhaowei Cai, Quanfu Fan, Rogerio S. Feris, and Nuno Vasconcelos. A unified multi-scale deep convolutional neural network for fast object detection. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, Computer Vision - ECCV 2016, pages 354-370, Cham, 2016. Springer International Publishing. 1 +[6] Y. Chen, Z. Wang, Y. Peng, Z. Zhang, G. Yu, and J. Sun. Cascaded pyramid network for multi-person pose estimation. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7103-7112, 2018. 7, 8 +[7] Hai Ci, Chunyu Wang, Xiaoxuan Ma, and Yizhou Wang. Optimizing network structure for 3d human pose estimation. In International Conference on Computer Vision, pages 915-922, 2019. 1, 2, 5, 6, 7, 8 +[8] 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 AAAI Conference on Artificial Intelligence (AAAI), 2018. 2, 7 +[9] Hongyang Gao and Shuiwang Ji. Graph u-nets. In International Conference on Machine Learning, pages 2083-2092, 2019. 3, 4, 6 +[10] Michael Garland and Paul S. Heckbert. Surface simplification using quadric error metrics. In Proceedings of the 24th Annual Conference on Computer Graphics and Interactive Techniques. ACM Press/Addison-Wesley Publishing Co., 1997. 6 +[11] Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. 4 +[12] J. Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7132-7141, 2018. 4, 5 +[13] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis R. Bach and David M. Blei, editors, ICML, volume 37 of JMLR Workshop and Conference Proceedings, pages 448-456. JMLR.org, 2015. 3 + +[14] C. Ionescu, F. Li, and C. Sminchisescu. Latent structured models for human pose estimation. In 2011 International Conference on Computer Vision, pages 2220-2227, 2011. 2 +[15] 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. 5, 7, 8 +[16] Diederick P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. 6 +[17] Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. In Proceedings of the 5th International Conference on Learning Representations, ICLR '17, 2017. 2, 6 +[18] J. Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In ICML, 2019. 3, 6 +[19] K. Lee, I. Lee, and S. Lee. Propagating lstm: 3d pose estimation based on joint interdependency. In ECCV, 2018. 7, 8 +[20] Maosen Li, Siheng Chen, Xu Chen, Ya Zhang, Yanfeng Wang, and Qi Tian. Actional-structural graph convolutional networks for skeleton-based action recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 8 +[21] Yan-Ran Li, Lingteng Qiu, L. Wang, Fangde Liu, Z. Wang, Sebastian Iulian Poiana, Xiaosong Yang, and J. Zhang. Densely connected gcn model for motion prediction. Computer Animation and Virtual Worlds, 31, 2020. 8 +[22] T. Lin, P. Dollar, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 936-944, 2017. 1, 3 +[23] 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. European Conference on Computer Vision (ECCV), pages 1-17, 2020. 1, 2, 5, 6, 7, 8 +[24] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott E. Reed, Cheng-Yang Fu, and Alexander C. Berg. SSD: single shot multibox detector. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, Computer Vision - ECCV 2016 - 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part I, volume 9905 of Lecture Notes in Computer Science, pages 21-37. Springer, 2016. 3 +[25] 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. 3 +[26] Chenxu Luo, Xiao Chu, and Alan Yuille. Orinet: A fully convolutional network for 3d human pose estimation. In BMVC, 2018. 6, 8 +[27] J. Martinez, Rayat Hossain, J. Romero, and J. Little. A simple yet effective baseline for 3d human pose estimation. 2017 IEEE International Conference on Computer Vision (ICCV), pages 2659-2668, 2017. 1, 2, 5, 6, 7, 8 + +[28] 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 3D Vision (3DV), 2017 Fifth International Conference on. IEEE, 2017. 5, 8 +[29] V. Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010. 3 +[30] Alejandro Newell, Zhiao Huang, and Jia Deng. Associative embedding: End-to-end learning for joint detection and grouping. 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 2277-2287. Curran Associates, Inc., 2017. 3, 5 +[31] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, Computer Vision - ECCV 2016 - 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part VIII, volume 9912 of Lecture Notes in Computer Science, pages 483-499. Springer, 2016. 3, 5 +[32] Takuya Ohashi, Yosuke Ikegami, Kazuki Yamamoto, Wataru Takano, and Yoshihiko Nakamura. Video Motion Capture from the Part Confidence Maps of Multi-Camera Images by Spatiotemporal Filtering Using the Human Skeletal Model. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2018. 2 +[33] G. Pavlakos, X. Zhou, and K. Daniilidis. Ordinal depth supervision for 3d human pose estimation. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7307-7316, 2018. 7, 8 +[34] Georgios Pavlakos, Xiaowei Zhou, Konstantinos G Derpanis, and Kostas Daniilidis. Coarse-to-fine volumetric prediction for single-image 3D human pose. In Computer Vision and Pattern Recognition (CVPR), 2017. 2 +[35] Dario Pavllo, Christoph Feichtenhofer, David Grangier, and Michael Auli. 3d human pose estimation in video with temporal convolutions and semi-supervised training. In Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 6, 7, 8 +[36] Anurag Ranjan, Timo Bolkart, Soubhik Sanyal, and Michael J. Black. Generating 3D faces using convolutional mesh autoencoders. In European Conference on Computer Vision (ECCV), volume Lecture Notes in Computer Science, vol 11207, pages 725-741. Springer, Cham, Sept. 2018. 6 +[37] O. Ronneberger, P.Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention (MICCAI), volume 9351 of LNCS, pages 234-241. Springer, 2015. 3 +[38] S. Sharma, P. T. Varigonda, P. Bindal, A. Sharma, and A. Jain. Monocular 3d human pose estimation by generation and ordinal ranking. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 2325-2334, 2019. 7 +[39] 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 +[40] 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. 3 +[41] X. Sun, J. Shang, S. Liang, and Y. Wei. Compositional human pose regression. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 2621-2630, 2017. 2, 7, 8 +[42] Wataru Takano and Yoshihiko Nakamura. Action database for categorizing and inferring human poses from video sequences. Robotics and Autonomous Systems, 70:116 - 125, 2015. 2 +[43] Bugra Tekin, Isinsu Katircioglu, Mathieu Salzmann, Vincent Lepetit, and Pascal Fua. Structured prediction of 3d human pose with deep neural networks. In Richard C. Wilson, Edwin R. Hancock, and William A. P. Smith, editors, Proceedings of the British Machine Vision Conference 2016, BMVC 2016, York, UK, September 19-22, 2016. BMVA Press, 2016. 2 +[44] Bugra Tekin, Pablo Marquez-Neila, Mathieu Salzmann, and Pascal Fua. Learning to fuse 2d and 3d image cues for monocular body pose estimation. ICCV, pages 3961–3970, 2017. 2, 7 +[45] 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 (CVPR), June 2020. 7, 8 +[46] Sijie Yan, Yuanjun Xiong, and Dahua Lin. Spatial temporal graph convolutional networks for skeleton-based action recognition. In AAAI, 2018. 8 +[47] W. Yang, W. Ouyang, X. Wang, J. Ren, H. Li, and X. Wang. 3d human pose estimation in the wild by adversarial learning. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5255-5264, 2018. 2, 7, 8 +[48] Long Zhao, Xi Peng, Yu Tian, Mubbasir Kapadia, and Dimitris N. Metaxas. Semantic graph convolutional networks for 3d human pose regression. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3425-3435, 2019. 1, 2, 5, 6, 7 +[49] Qijie Zhao, Tao Sheng, Yongtao Wang, Zhi Tang, Ying Chen, Ling Cai, and Haibing Ling. M2det: A single-shot object detector based on multi-level feature pyramid network. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI, 2019. 3 +[50] K. Zhou, Xiaoguang Han, N. Jiang, Kui Jia, and Jiangbo Lu. Hemlets pose: Learning part-centric heatmap triplets for accurate 3d human pose estimation. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 2344-2353, 2019. 7, 8 +[51] Xingyi Zhou, Qixing Huang, Xiao Sun, Xiangyang Xue, and Yichen Wei. Towards 3d human pose estimation in the wild: A weakly-supervised approach. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017. 8 \ No newline at end of file diff --git a/graphstackedhourglassnetworksfor3dhumanposeestimation/images.zip b/graphstackedhourglassnetworksfor3dhumanposeestimation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4c78db5553761d000647766ae6ab89b55ce8f04 --- /dev/null +++ b/graphstackedhourglassnetworksfor3dhumanposeestimation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddb8bb85111eaad972a2c5bf835ff393c59695b52c6e4179cc4638b16829c4aa +size 535847 diff --git a/graphstackedhourglassnetworksfor3dhumanposeestimation/layout.json b/graphstackedhourglassnetworksfor3dhumanposeestimation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..afa0629b79e255ad8e78ef25b1233ec1bf3c5dec --- /dev/null +++ b/graphstackedhourglassnetworksfor3dhumanposeestimation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:006b442c0e8bcc7c75baf63d09b45d5c463f4f82aaa367ab5d0e900472401edd +size 334970 diff --git a/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_content_list.json b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6c2edc1b496e760037ab1ce643e8d3b6bc1c7449 --- /dev/null +++ b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a79fcd3e3c55b564ab35c584ea6eed8616fc1445d1628473923b0437f52aa8e6 +size 80693 diff --git a/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_model.json b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e2980f0b377392ee3d3ea1b94df2f53b0a7ad15f --- /dev/null +++ b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ad30af5fb505ad8e6ee1992b041ca8ff05f8b5be15f6c5a57c9c3de6193c3c8 +size 105217 diff --git a/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_origin.pdf b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..42bc0a754e3567cf3e3d7975ca06e7335baa2e92 --- /dev/null +++ b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/2c1d8b68-314c-487a-b02e-2f23102bf0fa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ba7068030d64d429d888582ca815e11f39aed387fa20741edd88cf038decfcf +size 1023746 diff --git a/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/full.md b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..317b69e3e0cf79fa815b1bb641a9447161402dcd --- /dev/null +++ b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/full.md @@ -0,0 +1,277 @@ +# Greedy Hierarchical Variational Autoencoders for Large-Scale Video Prediction + +Bohan Wu, Suraj Nair, Roberto Martín-Martín, Li Fei-Fei†, Chelsea Finn† +Stanford University, Stanford, CA 94305 + +{bohanwu, surajn, robertom, feifeili, cbfinn}@cs.stanford.edu + +# Abstract + +A video prediction model that generalizes to diverse scenes would enable intelligent agents such as robots to perform a variety of tasks via planning with the model. However, while existing video prediction models have produced promising results on small datasets, they suffer from severe underfitting when trained on large and diverse datasets. To address this underfitting challenge, we first observe that the ability to train larger video prediction models is often bottlenecked by the memory constraints of GPUs or TPUs. In parallel, deep hierarchical latent variable models can produce higher quality predictions by capturing the multi-level stochasticity of future observations, but end-to-end optimization of such models is notably difficult. Our key insight is that greedy and modular optimization of hierarchical autoencoders can simultaneously address both the memory constraints and the optimization challenges of large-scale video prediction. We introduce Greedy Hierarchical Variational Autoencoders (GHVAEs), a method that learns high-fidelity video predictions by greedily training each level of a hierarchical autoencoder. In comparison to state-of-the-art models, GHVAEs provide $17 - 55\%$ gains in prediction performance on four video datasets, a 35-40% higher success rate on real robot tasks, and can improve performance monotonically by simply adding more modules. Visualization and more details are at https://sites.google.com/view/ghvae. + +# 1. Introduction + +A core aspect of intelligence is the ability to predict the future. Indeed, if equipped with an accurate video prediction model, an intelligent agent such as a robot may be able to perform a variety of tasks using raw pixel inputs. For example, algorithms such as visual foresight [1] can leverage an action-conditioned video + +![](images/05b6dfae1f431b39f39269974c29aa204562910bf78422a3ec451444c9865aab.jpg) +Figure 1: Greedy Hierarchical Variational Autoencoders (GHVAEs). Unlike traditional hierarchical variational autoencoders (VAEs), a GHVAE model trains each encoder-decoder module greedily using the frozen weights of the previously-trained modules. Greedy training circumvents fitting the entire model into memory and enables larger models to be trained within the same GPU or TPU memory. Further, greedy training improves the optimization stability of such a hierarchical model by breaking the bidirectional dependencies among individual latent variables. As a result, given the current image, $x_{t}$ , GHVAE predicts a more accurate next image, $\hat{x}_{t + 1}$ , than a hierarchical VAE. Each module is optimized sequentially, and all modules are used at test time. + +prediction model to plan a sequence of actions that accomplish the desired task objective. Importantly, such video prediction models can in principle be trained with broad, unlabeled datasets, and building methods that can learn from large, diverse offline data is a recipe that has seen substantial success in visual [2] and language [3] + +understanding. However, learning an accurate video prediction model from large and diverse data remains a significant challenge. The future visual observations of the world are hierarchical [4], high-dimensional, and uncertain, demanding the model to accurately represent the multi-level stochasticity of future pixels, which can include both low-level features (e.g. the texture of a table as it becomes unoccluded by an object) and higher-level attributes (e.g. how an object will move when touched), such as the top images in Fig. 1. + +To capture the stochasticity of the future, prior works have proposed a variety of stochastic latent variable models [5, 6, 7]. While these methods generated reasonable predictions for relatively small video prediction datasets such as the BAIR robot pushing dataset [8], they suffer from severe underfitting in larger datasets in the face of practical GPU or TPU memory constraints [9]. On the other hand, while hierarchical variational autoencoders (VAEs) can in principle produce higher-quality predictions by capturing multiple levels of stochasticity, the bidirectional dependency between individual hierarchical latent variables (higher-level variables influence the lower level and vice versa) potentially creates an unsolved problem of optimization instability as the number of hierarchical latent variables in the network increases [10, 11]. + +The key insight of this work is that greedy and modular optimization of hierarchical autoencoders can simultaneously address both the memory constraints and the optimization challenges of learning accurate large-scale video prediction. On one hand, by circumventing end-to-end training, greedy machine learning allows sequential training of sub-modules of the entire video prediction model, enabling much larger models to be learned within the same amount of GPU or TPU memory. On the other hand, optimizing hierarchical VAEs in a greedy and modular fashion breaks the bidirectional dependency among individual latent variables. As a result, these variables can remain stable throughout the entire training process, resolving the typical instability of training deep hierarchical VAEs. + +With this key insight, this paper introduces Greedy Hierarchical VAEs ("GHVAEs" hereafter) (Fig. 1)- a set of local latent VAE modules that can be sequentially stacked and trained in a greedy, module-by-module fashion, leading to a deep hierarchical variational video prediction model that in practice admits a stable optimization and in principle can scale to large video datasets. As evaluated in Section 4, GHVAEs outperform state-of-the-art video prediction models by $17 - 55\%$ in FVD score [12] on four different datasets, and by $35 - 40\%$ success rate on two real robotic manipulation tasks when used for planning. In addition, our empirical and + +theoretical analyses find that GHVAE's performance can improve monotonically as the number of GHVAE modules in the network increases. In summary, the core contribution of this work is the use of greedy machine learning to improve both the optimization stability and the memory efficiency of hierarchical VAEs, leading to significant gains in both large-scale video prediction accuracy and real robotic task success rates. + +# 2. Related Work + +The Underfitting Challenge of Large-Scale Video Prediction. Resolving the underfitting challenge of large-scale video prediction can lead to powerful generalization in visual foresight [13, 14, 15, 16, 8, 1, 17, 18, 19, 20], which performs model-based robotic control [21, 22, 23] via action-conditioned video prediction [24, 25, 26, 27]. Initially, video prediction [28, 29, 30, 31, 32, 33, 34, 11, 35] has been tackled by a deterministic model [36, 37, 38, 39, 40, 30, 41, 42, 43, 44, 45, 46]. VAEs were later adopted to model the stochasticity of future visual observations [47, 5, 48, 49]. Nevertheless, modeling the stochasticity of the real world using a trajectory-based latent variable model leads to blurry predictions inadvertently. This problem is then addressed by two lines of orthogonal work-VAE-GANs [6] and timestep-based latent variable models [7]. While these methods resolve blurry predictions in small-scale video datasets such as the BAIR robot pushing dataset [8], they suffer from severe underfitting in large-scale, multi-domain, or multi-robot datasets, such as RoboNet [50] and RoboTurk [51]. In parallel, Villegas et al. [9] validate that higher model capacity leads to greater prediction fidelity. This raises the question of how to learn larger models to meet the underfitting challenge of large-scale video prediction. On the other hand, Castrejon et al. [11] apply dense connections to hierarchical VAEs to address the optimization challenge of fitting hierarchical variational video prediction models. While this work outperforms the state-of-the-art in relatively small video datasets, it was unable to scale its hierarchical VAE up substantially due to deep optimization problems [10, 11]. Other works have also attempted to address the underfitting challenge of large-scale video prediction through other angles. For example, one line of work attempts to represent pixels as discrete as opposed to continuous distributions [52, 53]. Other works predict forward alternative quantities such as object-centric representations [54, 55, 56, 57, 58, 59] and goal-centric representations [60]. Unlike these approaches, our method scales to large real-world video datasets without requiring additional inductive biases. + +![](images/67d6a32db110d2dae63b0abbf5a204d183fb19dac7111b5c05fa982f3e0b817d.jpg) +Figure 2: Training procedure and architecture for a three-module GHVAE. In Stage 1, all first-module weights $(\mathcal{W}_{enc}^{1},\mathcal{W}_{dec}^{1},\mathcal{W}_{prior}^{1},\mathcal{W}_{post}^{1})$ are trained end-to-end. In Stage 2, all weights from the first module are frozen and the second module is trained. In Stage 3, all first and second-module weights are frozen, and only the third module is trained, so on and so forth. The video prediction quality for $x_{t + 1}$ improves as more modules are added. The legends in the figure denote the four components in each GHVAE module (encoder, decoder, prior, and posterior) and whether each component is frozen (tilted red bars) or used only for training and not at test time (dashed as opposed to solid lines). To limit the number of spatial dimensions that requires prediction from the prior network, only the prior and posterior in the final, $K^{th}$ GHVAE module are used. The action $a_{t}$ is included in action-conditioned video prediction and excluded in action-free video prediction. + +Greedy Machine Learning. Greedy machine learning [61, 62, 63, 64, 65, 66] was first introduced to provide a good weight initialization for deep networks to escape bad local optima during end-to-end back-propagation. As originally proposed, each greedy module of a deep network is stacked on top of the preceding greedy module and trained locally based on the features extracted from the preceding module. Subsequently, greedy machine learning has been applied to pre-training good feature extractors and stacked autoencoders [67, 68, 69, 70, 71, 72] for downstream tasks in vision, sound, and language [73, 74, 75]. Trained via self-supervised learning, these feature extractors and autoencoders excelled at capturing and preserving time-invariant information in sequential data such as videos. In contrast, we propose a video prediction method that uses a hierarchy of latent variables to explicitly model time-variant information about the future. Finally, greedy training of generative adversarial networks (GANs) is proposed to generate high-quality, high-resolution single-images [76]. Unlike these prior works, we propose a greedy approach to training large-scale video prediction models that simultaneously addresses the memory constraints and the optimization challenges of hierarchical VAEs. + +Hierarchical Variational Autoencoders. Hierarchical [77] and sequential VAEs [78] were recently introduced to improve generative modeling in various + +vision tasks such as video prediction [11] and image generation [79]. They are known to have optimization challenges [10], mainly due to the bidirectional dependency among the individual latent variables. When optimized end-to-end, the hierarchical VAE needs to keep each latent variable useful for the video prediction task at hand throughout the entire training process, while preserving the dependent relationships among these variables simultaneously. To this end, previous works introduced a variety of inductive biases such as dense connections [11], ladder structures [80], bidirectional inference [81], progressive lossy compression [82, 83], and spectral regularization [79] to alleviate such optimization difficulties specific to hierarchical VAEs. These approaches have largely been successful in the context of image generation, while we study the more difficult video prediction problem. Unlike these approaches, we propose a greedy training scheme that significantly alleviates the optimization challenges of conditional hierarchical VAEs. + +# 3. Greedy Hierarchical VAEs (GHVAEs) + +Overview. To develop an expressive yet stably optimized video prediction model, we introduce Greedy Hierarchical VAEs (Fig. 2), which are locally optimized VAE modules that can be stacked together sequentially to incrementally add capacity to the model. To train a stack of modules without needing to fit the + +entire model into memory, each module is optimized locally using the frozen weights of the previously-trained modules. Concretely, a GHVAE model has multiple GHVAE modules. Each GHVAE module has four convolutional sub-networks: an encoder, a decoder, a prior network, and a posterior inference network. In the remainder of this section, we overview mathematical notation, describe each of these model components in detail, derive the training objective for each module as a variational lower bound, and theoretically analyze the implications of greedy training. + +Notation. This paper uses $K$ to denote the total number of GHVAE modules in the network, $\mathcal{W}^k,k\in [1,K]$ to denote the $k^{th}$ GHVAE module, $\mathcal{W}^k = \{\mathcal{W}_{enc}^k,\mathcal{W}_{dec}^k,\mathcal{W}_{prior}^k,\mathcal{W}_{post}^k\}$ to denote the $k^{th}$ module's encoder, decoder, prior network, and posterior inference network respectively, $x_{t}\in \mathcal{X} = \mathbb{R}^{H^{0}\times W^{0}\times C^{0}}$ to represent the RGB image observation (height $H^0$ width $W^0$ channel $C^0 = 3$ ) at the current timestep $t$ $h_t^k\in \mathcal{H}^k = \mathbb{R}^{H^k\times W^k\times C_\mathcal{H}^k}$ to denote the hidden variable encoded by the $k^{th}$ module for the current timestep $t$ $z_{t + 1}^{k}\in \mathcal{Z}^{k} = \mathbb{R}^{H^{k}\times W^{k}\times C_{\mathcal{Z}}^{k}}$ to denote the $k^{th}$ stochastic latent variable used to explicitly model the stochasticity of the future observation at timestep $t + 1$ $a_{t}\in \mathcal{A}$ to denote the agent's action at the current timestep $t$ in the case of action-conditioned video prediction, and $T$ to denote the model's roll-out horizon during training. + +Encoder. Shown as grey downward arrows in Fig. 2, the $K$ encoders in a GHVAE model incrementally map from $x_{t}$ to $h_t^K$ and serve as part of both the VAE model and the posterior inference network. For the encoder design, it is important to recall that VAEs treat each dimension of a stochastic latent variable as independent (i.e. the mean-field approximation). However, convolutional embeddings of images contain significant spatial correlations due to the low frequency of natural images, violating this approximation. To mitigate this challenge, we design the encoder architecture to incrementally compress the spatial dimensions of the embeddings while simultaneously significantly expanding the channel dimensions of the embeddings. This allows the model, at its deepest layer, to store plenty of information (including spatial information) without strongly-correlated dimensions. Concretely, the $k^{th}$ encoder $\mathcal{W}_{enc}^k$ maps from $h_t^{k-1}$ to $h_t^k$ (except for the first encoder $\mathcal{W}_{enc}^0$ , which maps $x_t$ to $h_t^1$ ), and incrementally compresses the height and width, $H^k < H^{k-1}$ , $W^k < W^{k-1}$ , while expanding the channels $C_{\mathcal{H}}^k > C_{\mathcal{H}}^{k-1}$ . + +Decoder. Shown as blue arrows in Fig. 2, the $K$ + +decoders in a GHVAE model incrementally map from the deepest stochastic latent variable $z_{t+1}^{K}$ back to $x_{t+1}$ to predict the next image. Since encoding significant information in stochastic latent variables is difficult, we aim to allow the stochastic latent variables to only capture new information about the future that is absent from the past. In other words, any partial information of the future that exists in $h_{t}^{k}$ does not need to be predicted and thus should not be contained in $z_{t+1}^{k}$ . Hence, the decoder in the deepest latent space, $\mathcal{W}_{dec}^{K}$ , takes as input both $h_{t}^{K}$ and the posterior latent variable $z_{t+1}^{K}$ , so that the network can borrow information directly from the past. Similarly, each decoder $\mathcal{W}_{dec}^{k} \in \{\mathcal{W}_{dec}^{1} \ldots \mathcal{W}_{dec}^{K-1}\}$ takes as input both $h_{t}^{k}$ and $h_{t+1}^{k+1}$ and predicts $h_{t+1}^{k}$ (except for $\mathcal{W}_{dec}^{1}$ , which predicts $x_{t+1}$ ). Mirroring the encoders, these decoders incrementally expand the height and width, while compressing the channels. + +Prior Network. Shown as green arrows in Fig. 2, the prior network $\mathcal{W}_{prior}^k$ maps $h_t^k$ and $a_{t}$ to the mean and variance of a diagonal Gaussian distribution for $z_{t + 1}^{k}$ to model the stochasticity of future observations. The prior network is recurrent-convolutional and used both at train and test time. Empirically, using all $K$ stochastic latent variables $z_{t + 1}^{1}\dots z_{t + 1}^{K}$ leads to excessive stochasticity and degrades performance as the number of GHVAE modules increases. Therefore, one key design choice is that while a $K$ -module GHVAE uses all $K$ stochastic latent variables during training (i.e., $z_{t + 1}^{1\dots K}$ , one for each module) to sequentially learn the multi-level stochasticity of future observations, only the latent variable at the deepest level, $z_{t + 1}^{K}$ , is used at test time and requires prediction from the prior network. This greedy training strategy allows each decoder to propagate uncertainty from the deepest layer to the shallower layers, and ultimately back to the pixel space. As a result, GHVAEs can implicitly model the multi-level stochasticity of future observations without explicitly using multiple stochastic latent variables at test time, and can maximally compress the latent space spatially module-by-module such that $h_t^K$ and $z_{t + 1}^{K}$ contain as few spatial dimensions as possible. Because the deepest encoder will have the fewest spatial dimensions, the only stochastic latent variable $z_{t + 1}^{K}$ will have the least spatial correlations. + +Posterior Inference Network. Although the encoder and decoder have minimized spatial dimensions in the deepest hidden layer $h^K$ , the encoding process has produced a high channel dimension $C_{\mathcal{H}}^K$ for $h^K$ . To improve the quality of prediction by the prior network, the channels in $h^K$ may need to be downsized + +to reduce the required output dimensions of the prior network. Hence, shown as brown arrows in Fig. 2, the posterior inference network maps the current module's hidden variable $h_{t + 1}^k$ to the mean and variance of a diagonal Gaussian distribution over the stochastic latent variable $z_{t + 1}^k$ . When modules are added, a new posterior inference network and a new prior network for the new latent space are trained based on the latest module's representation. $z_{t + 1}^k$ is a posterior latent variable, since both $h_{t + 1}^k$ and $z_{t + 1}^k$ are encoded from the ground truth future observation $x_{t + 1}$ as opposed to the predicted next observation. For this reason, the recurrent-convolutional posterior network is only available at train time and not used for inference at test time. + +Optimization. In this section, we use $p^k$ to denote the VAE model and $q^k$ to denote the variational distribution. The encoder, the decoder, and the prior network are all part of the model $p^k$ , and both the encoder and the posterior inference network are part of $q^k$ . The training process of a $K$ -module GHVAE model is split into $K$ training phases, and only the $k^{th}$ GHVAE module is trained during phase $k$ , where $k \in [1, K]$ . GHVAE's training objective for the $k^{th}$ module is: + +$$ +\max _ {\mathcal {W} ^ {k}} \sum_ {t = 0} ^ {T - 1} \mathcal {L} _ {g r e e d y} ^ {k} \left(x _ {t + 1}\right) \tag {1} +$$ + +where $\mathcal{L}_{greedy}^k (x_{t + 1})$ is GHVAE's Evidence Lower-Bound (ELBO) with respect to the current module $\mathcal{W}^k$ at timestep $t + 1$ : + +$$ +\begin{array}{l} \mathcal {L} _ {g r e e d y} ^ {k} (x _ {t + 1}) = \mathbb {E} _ {q ^ {k} (z _ {t + 1} ^ {k} | x _ {t + 1})} [ \log p ^ {k} (x _ {t + 1} \mid x _ {t}, z _ {t + 1} ^ {k}) ] ^ {2}) \\ - D _ {K L} \left(q ^ {k} \left(z _ {t + 1} ^ {k} \mid x _ {t + 1}\right) \| p ^ {k} \left(z _ {t + 1} ^ {k} \mid x _ {t}, a _ {t}\right)\right) \\ \end{array} +$$ + +where $p^k \equiv p_{\mathcal{W}_{enc,dec,prior}^{1* \ldots k-1^*,k}}$ , $q^k \equiv q_{\mathcal{W}_{enc,post}^{1* \ldots k-1^*,k}}$ , and $\mathcal{W}^{1^* \ldots k-1^*}$ are the frozen, greedily trained weights of all preceding GHVAE modules. + +To improve training stability, we use a fixed standard deviation for the posterior latent variable distribution $q^{k}(z_{t + 1}^{k}\mid x_{t + 1})$ in the KL divergence term in Eq. 2. + +Theoretical Guarantees. GHVAE's ELBO manifests two theoretical guarantees. + +1) ELBO Validity: Sequentially optimizing each GHVAE module in the network is equivalent to maximizing a lower-bound of the ELBO for training all GHVAE modules end-to-end. This suggests that GHVAE's ELBO is valid: + +Theorem 1 (ELBO Validity) For any $k \in \mathbb{Z}^+$ and any set of frozen, greedily or end-to-end trained weights + +$$ +\mathcal {W} ^ {1 ^ {*} \dots k - 1 ^ {*}}, +$$ + +$$ +\begin{array}{l} \log p(x _ {t + 1}) \geq \max _ {\mathcal {W} ^ {1 \dots k - 1, k}} \mathcal {L} _ {e 2 e} ^ {k} (x _ {t + 1}) \\ \geq \max _ {\mathcal {W} ^ {k}} \mathcal {L} _ {g r e e d y} ^ {k} \left(x _ {t + 1}\right) \tag {3} \\ \end{array} +$$ + +where $\mathcal{L}_{e2e}^k (x_{t + 1})$ is GHVAE's ELBO for timestep $t + 1$ when optimized end-to-end. More formally, $\mathcal{L}_{e2e}^k (x_{t + 1})$ is $\mathcal{L}_{greedy}^k (x_{t + 1})$ in Eq. 2, except that the VAE model $p^k\equiv p_{\mathcal{W}_{enc,dec,prior}^{1\dots k - 1,k}}$ and the variational distribution $q^{k}\equiv q_{\mathcal{W}_{enc,post}^{1\dots k - 1,k}}$ + +2) Monotonic Improvement: Adding more modules can only raise (as opposed to lower) GHVAE's ELBO, which justifies and motivates maximizing the number of modules in a GHVAE model: + +Theorem 2 (Monotonic Improvement) For any $k \in \mathbb{Z}^{+}$ and any set of frozen, greedy or end-to-end trained weights $\mathcal{W}^{1^* \dots k - 1^*}$ , + +$$ +\begin{array}{l} \log p \left(x _ {t + 1}\right) \geq \mathcal {L} _ {\text {g r e e d y}} ^ {k} \left(x _ {t + 1}; \mathcal {W} ^ {1 ^ {*} \dots k - 1 ^ {*}}\right) \\ \geq \mathcal {L} ^ {k - 1} \left(x _ {t + 1}; \mathcal {W} ^ {1 ^ {*} \dots k - 1 ^ {*}}\right) \tag {4} \\ \end{array} +$$ + +where $\mathcal{L}^{k - 1}\in \{\mathcal{L}_{greedy}^{k - 1},\mathcal{L}_{e2e}^{k - 1}\}$ and $\mathcal{L}_{greedy}^k$ is initialized with the weights $\mathcal{W}^{1^*\ldots k - 1^*}$ . Further details of the GHVAE method and mathematical proofs for these two theorems are in Appendix A and C respectively. + +# 4. Experimental Evaluation and Analysis + +We conduct video prediction and real robot experiments to answer six key questions about GHVAEs: 1) How do GHVAEs compare to state-of-the-art models in video prediction? 2) Can GHVAEs achieve monotonic improvement in video prediction accuracy by simply adding more modules, as Theorem 2 suggests? 3) Does training a GHVAE model end-to-end outperform training greedily per module, as Theorem 1 suggests? 4) Does the high expressivity of GHVAEs cause overfitting during training? 5) How important is the learned prior network to GHVAEs' performance? 6) Does the high expressivity of GHVAEs improve real robot performance? Visualizations and videos are at https://sites.google.com/view/ghvae, and more qualitative results are in Appendix B. + +Video Prediction Performance. To answer the first question, this paper evaluates video prediction methods across five metrics: Fréchet Video Distance (FVD) [12], Structural Similarity Index Measure (SSIM), + +Table 1: GHVAE vs. SVG' video prediction test performance (mean ± standard error). GHVAE outperforms SVG' on all datasets across all metrics. "Human" denotes human preferences between the two methods. + +
DatasetMethodVideo Prediction Test Performance
FVD ↓PSNR ↑SSIM ↑LPIPS ↓Human
RoboNetGHVAEs95.2±2.624.7±0.289.1±0.40.036±0.00192.0%
SVG' [9]123.2±2.623.9±0.187.8±0.30.060±0.0088.0%
KITTIGHVAEs552.9±21.215.8±0.151.2±2.40.286±0.01593.3%
SVG' [9]1217.3 [9]15.0 [9]41.9 [9]0.327±0.0036.7%
Human3.6MGHVAEs355.2±2.926.7±0.294.6±0.50.018±0.00286.6%
SVG' [9]429.9 [9]23.8 [9]88.9 [9]0.028±0.00613.4%
+ +Table 2: GHVAE vs. Hier-VRNN test performance on CityScapes (mean ± standard error). All convolutional layers in the 6-module GHVAE are downsized by $40\%$ to fit into 16GB GPU memory for fair comparison. + +
MethodFVD ↓SSIM ↑LPIPS ↓
GHVAEs418.0±5.074.0±0.40.193±0.014
Hier-VRNN [11]567.5 [11]62.8 [11]0.264 [11]
+ +Peak Signal-to-noise Ratio (PSNR), Learned Perceptual Image Patch Similarity (LPIPS) [84], and human preference. FVD and human preference both measure overall visual quality and temporal coherence without reference to the ground truth video. PSNR, SSIM, and LPIPS measure similarity to the ground-truth in different spaces, with LPIPS most accurately representing human perceptual similarity. To stress-test each method's ability to learn from large and diverse offline video datasets, we use four datasets: RoboNet [50] to measure prediction of object interactions, KITTI [85] and Cityscapes [86] to evaluate the ability to handle partial observability, and Human3.6M [87] to assess prediction of structured motion. This paper compares GHVAEs to SVG' [7, 9] and Hier-VRNN [11], which are two state-of-the-art prior methods that use non-hierarchical and hierarchical VAEs respectively. While SAVP [6] is another prior method, we empirically found that SAVP underperforms SVG' on these datasets, and therefore omitted SAVP results for simplicity. All metrics are summarized via the mean and standard error over videos in the test set. + +For SVG' in particular, this paper compares to "SVG' $(\mathrm{M} = 3,\mathrm{K} = 5)$ " [9], which is the largest and best-performing SVG' model that Villegas et al. [9] evaluate and the largest version of SVG' that can fit into a 24GB GPU with a batch size of 32. SVG' $(\mathrm{M} = 3,\mathrm{K} = 5)$ has 3x larger convolutional LSTMs and 5x larger encoder and decoder convolutional networks compared to the original SVG [7] and significantly outperforms the original SVG by $40 - 60\%$ in FVD scores [9]. Since Villegas et al. [9] reported the FVD, SSIM, and PSNR performance of "SVG' $(\mathrm{M} = 3,\mathrm{K} = 5)$ " on KITTI and Human3.6M, we + +Table 3: Ablation 1: GHVAEs improve monotonically from 2, to 4, and to 6 modules when greedily optimized. + +
# of +ModulesRoboNet Video Prediction Test Performance
FVD ↓PSNR ↑SSIM ↑LPIPS ↓
695.2±2.624.7±0.289.1±0.40.036±0.001
4151.2±2.324.2±0.187.5±0.40.059±0.006
2292.4±11.123.5±0.286.4±0.20.106±0.010
+ +directly compare to their results using the same evaluation methodology. For RoboNet and for evaluating LPIPS and human preference, we re-implement SVG' and report the corresponding performance. In Table 1, the 6-module GHVAE model outperforms SVG' across all three datasets across all metrics. Most saliently, we see a $17 - 55\%$ improvement in FVD score and a $13 - 45\%$ improvement in LPIPS. Further, we see that humans prefer predictions from the GHVAE model more than $85\%$ of the time. + +To compare to Hier-VRNN [11], we use the Cityscapes driving dataset [86]. Since Castrejon et al. [11] already report FVD, SSIM, and LPIPS performance on Cityscapes, we directly compare against these results using the same evaluation setting. Table 2 indicates that GHVAEs outperform Hier-VRNN by $26\%$ in FVD, $18\%$ in SSIM, and $27\%$ in LPIPS for Cityscapes when the number of modules reaches six. + +These results indicate that GHVAEs significantly outperform state-of-the-art video prediction models, including hierarchical and non-hierarchical models. The strong performance of GHVAEs mainly originates from the capacity to learn larger models with a stable optimization within the same amount of GPU or TPU memory. For example, even though both GHVAE and SVG' consume 24GB of memory during training, GHVAE contains 599 million parameters while SVG' has 298 million. Next, we perform several ablations to better understand the good performance of GHVAEs. + +Ablation 1: Monotonic Improvement and Scalability of GHVAEs. Given that GHVAEs can be stacked sequentially, it becomes important to determine whether GHVAEs can achieve mono + +Table 4: Ablation 2: On RoboNet, GHVAEs perform better when optimized greedily than when trained end-to-end. + +
OptimizationRoboNet FVD ↓Video Prediction TestPerformance LPIPS ↓
PSNR ↑SSIM ↑
End-to-end Training509.9±6.221.2±0.383.5±1.00.148±0.004
Greedy Training95.2±2.624.7±0.289.1±0.40.036±0.001
Greedy Training + End-to-End Fine-tuning91.1±3.125.0±0.289.5±0.50.032±0.003
+ +tonic improvement by simply adding more GHVAE modules, as suggested by Theorem 2. We observe in Table 3 that increasing the number of GHVAE modules from 2, to 4, to eventually 6 improves performance across all metrics. These results validate Theorem 2 and suggest that greedily adding more modules increases performance monotonically in practice and enables GHVAEs to scale to large datasets. + +Ablation 2: Greedy vs. End-to-End Optimization of GHVAEs. End-to-end learning is conventionally preferred over greedy training when GPU or TPU memory constraints are loose. To examine whether this pattern also holds for GHVAEs, we trained a 6-module GHVAE model end-to-end using two 48GB GPUs (since the end-to-end model does not fit in 24GB GPUs) across five separate trials. In addition, we conducted a second experiment in which we fine-tune the greedily trained GHVAE model end-to-end using two 48GB GPUs. We found in Table 4 that the model was unable to converge to any good performance in any single run compared to the greedy setting. Qualitatively, when optimized end-to-end, GHVAE models need to update each module to improve video prediction quality while preserving the interdependency among individual hidden variables simultaneously, which can lead to optimization difficulties [10]. Even if GHVAEs can be optimized end-to-end, limited GPU or TPU memory capacity will still make it infeasible to train as the number of modules grows beyond six. However, end-to-end fine-tuning does lead to minor performance gains as indicated by row "GHVAEs (End-to-End Fine-Tuning, Abl. 2)". These two experiments imply that greedy training of GHVAEs leads to higher optimization stability than end-to-end training from scratch. They also indicate that end-to-end training of GHVAE can outperform greedy training as suggested by Theorem 1, so long as the GHVAE model is first pre-trained greedily. + +Ablation 3: Train-Test Comparison for GHVAEs. Since GHVAEs aim to tackle the underfitting challenge of large-scale video prediction, we now study whether GHVAEs have started to overfit to the training data. We observe in Table 5 that for + +Table 5: Ablation 3: Train vs. test performance for a 6-module GHVAE. We observe slight overfitting in all datasets except RoboNet. + +
DatasetTrain / TestVideo Prediction Performance
FVD ↓PSNR ↑SSIM ↑LPIPS ↓
RoboNetTrain94.4±3.924.9±0.389.3±0.70.036±0.002
Test95.2±2.624.7±0.289.1±0.40.036±0.001
KITTITrain453.5±12.519.4±0.261.4±1.60.209±0.006
Test552.9±21.215.8±0.151.2±2.40.286±0.015
Human 3.6MTrain258.9±6.828.6±0.396.4±0.10.015±0.002
Test355.2±2.926.7±0.294.6±0.50.018±0.002
CityscapesTrain401.8±5.425.2±0.174.9±0.10.194±0.006
Test418.0±5.025.0±0.174.0±0.40.193±0.014
+ +Table 6: Ablation 4: Using a learned prior in GHVAEs substantially outperforms a uniform prior particularly in action-conditioned video prediction. + +
DatasetLearned / UniformVideo PredictionTest Performance
FVD ↓PSNR ↑SSIM ↑LPIPS ↓
RoboNetLearned95.2±2.624.7±0.289.1±0.40.036±0.001
Uniform281.4±1.622.1±0.385.0±0.40.58±0.007
KITTILearned552.9±21.215.8±0.151.2±2.40.286±0.015
Uniform823.3±12.013.0±0.246.9±0.30.291±0.005
Human 3.6MLearned355.2±2.926.7±0.294.6±0.50.018±0.002
Uniform391.6±11.126.3±0.393.0±0.30.021±0.002
CityscapesLearned418.0±5.025.0±0.174.0±0.40.193±0.014
Uniform495.2±1.824.7±0.169.1±0.40.220±0.005
+ +RoboNet, a 6-module GHVAE's training performance is similar to its test performance across all four metrics, implying little overfitting. For KITTI, Human3.6M, and Cityscapes, we observe that train performance is better than test performance across most metrics, indicating some overfitting. We hypothesize that this is due to the smaller sizes of these three datasets compared to RoboNet, and, for Human3.6M, because the test set corresponds to two unseen human subjects. + +Ablation 4: Performance Contribution of Learned Prior. One of GHVAEs' insights is to predict forward the stochastic latent variable only at the deepest layer. Therefore, it may be important to quantify the contribution of the learned prior network to the overall performance. We observe in Table 6 that using a learned prior significantly outperforms using a uniform diagonal Gaussian prior particularly for action-conditioned datasets. We hypothesize that this is because a learned prior contains information about the action while a uniform prior does not. + +Real Robot Performance. Finally, we evaluate whether improved video prediction performance translates to greater success on downstream tasks. We consider two manipulation tasks: Pick&Wipe and Pick&Sweep on a Franka Emika Panda robot arm. Concretely, each method is given a small, autonomously collected training dataset of 5000 videos of random robot interactions with diverse objects such as those in the + +![](images/2d9613f422c873fa7a38f3cd467e5551830f96731c2ff14e3f4ac21a81dddd92.jpg) +(a) Train: Random Interaction +Figure 3: Real Robot Experimental Setup. The Franka robot is equipped with a $45^{\circ}$ black RGB camera. We pre-train each model on RoboNet and fine-tune on an autonomously collected dataset of 5000 videos of the robot's random interactions with objects in the bin (Fig. 4a). Using the trained GHVAE video prediction model, the Franka robot is tested across two tasks: Pick&Wipe (top and bottom left of bin in Fig. 4b) and Pick&Sweep (top and bottom right of bin in Fig. 4b). All tasks are evaluated on objects, tools, and containers never seen during training. + +![](images/3f7adcc8ac2772956e91eba397cd03d3eafc3d0c249248f2cf4454b872981d74.jpg) +(b) Test: Unseen Objects + +dark-grey tabletop bin in Fig. 4a. At test time, to measure generalization, all objects, tools, and containers used are never seen during training. Empirically, training directly on this small 5000-video dataset leads to poor generalization to novel objects at test time for all methods. Thus, to enable better generalization, all networks are first pretrained on RoboNet [50] and subsequently fine-tuned on this 5000-video dataset. In both tasks, the robot is given a single $64 \times 64$ RGB goal image to indicate the task goal, with no hand-designed rewards provided. The model rollout horizon for each video prediction method is 10, with two prior context frames and a sequence of 10 future actions provided as input. All real-robot results are evaluated across 20 trials. For planning, we perform random shooting (details in Appendix B) with a 4-dimensional action space, which contains three scalars for the $[x,y,z]$ end-effector translation and one binary scalar for opening vs. closing its parallel-jaw gripper. + +In the first Pick&Wipe task, the robot needs to pick a wiping tool (e.g. sponge, table cloth, etc.) up and wipe all objects off the plate using the wiping tool. The task is successful if the robot picks the wiping tool up and wipe all objects off the plate using the wiping tool within 50 timesteps. In the second Pick&Sweep task, the robot is required to pick a sweeping tool (e.g. dustpan sweeper, table cloth, or sponge, etc.) up and sweep an object into the dustpan. The task is successful if the target object is swept into the dustpan within 50 + +Table 7: GHVAE vs. SVG' real robot performance + +
MethodTest Task Success Rate
Pick&Wipe TasksPick&Sweep Tasks
GHVAEs90.0%85.0%
SVG'50.0%50.0%
+ +timesteps. At the beginning of each task, the wiping or sweeping tool is not yet in the robot's gripper, which makes the tasks more difficult. Table 7 reveals that a 6-Module GHVAE model outperforms SVG' by $40\%$ and $35\%$ in success rate for Pick&Wipe and Pick&Sweep respectively. For Pick&Wipe, SVG' produces blurry predictions especially when the robot and the plate overlap in the image. This reduces SVG's ability to predict the best action sequence for wiping objects off the plate. In contrast, GHVAE empirically produces accurate predictions of the robot's motion and the position of the wiping tool and the objects. For Pick&Sweep, SVG' has difficulty predicting the movement of the object during the robot's sweeping motion, leading to more frequent task failures. In contrast, GHVAE predicts plausible robot sweep motions and object movements, reaching an $85\%$ success rate. These results indicate that GHVAEs not only lead to better video prediction performance but that they lead to better downstream performance on real robotic manipulation tasks. + +# 5. Conclusion + +This paper introduces Greedy Hierarchical VAEs (GHVAEs), which are local VAE modules that can be stacked sequentially and optimized greedily to construct an expressive yet stably optimized hierarchical variational video prediction model. This method significantly outperforms state-of-the-art hierarchical and non-hierarchical video prediction methods by $17 - 55\%$ in FVD score across four video datasets and by $35 - 40\%$ in real-robot task success rate. Furthermore, GHVAE achieves monotonic improvement by simply stacking more modules. By addressing the underfitting challenge of large-scale video prediction, this work makes it possible for intelligent agents such as robots to learn from large-scale offline video datasets and generalize across a wide range of complex visuomotor tasks through accurate visual foresight. + +While GHVAEs exhibit monotonic improvement, experimenting with GHVAEs beyond six modules is an important direction for future work to better understand the full potential of this method. On the other hand, leveraging this method to enable robotic agents to learn much harder and longer-horizon manipulation and navigation tasks is also an important future direction. Finally, it would be interesting to explore the use of GHVAEs for other generative modeling problems. + +# References + +[1] F. Ebert, C. Finn, S. Dasari, A. Xie, A. Lee, and S. Levine, "Visual foresight: Model-based deep reinforcement learning for vision-based robotic control," arXiv preprint arXiv:1812.00568, 2018. 1, 2 +[2] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, "Imagenet: A large-scale hierarchical image database," in 2009 IEEE conference on computer vision and pattern recognition, 2009, pp. 248-255. 1 +[3] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei, "Language models are few-shot learners," 2020. 1 +[4] S. E. Palmer, “Hierarchical structure in perceptual representation,” Cognitive psychology, vol. 9, no. 4, pp. 441–474, 1977. 2 +[5] M. Babaeizadeh, C. Finn, D. Erhan, R. H. Campbell, and S. Levine, "Stochastic variational video prediction," *ICLR*, 2018. 2 +[6] A. X. Lee, R. Zhang, F. Ebert, P. Abbeel, C. Finn, and S. Levine, "Stochastic adversarial video prediction," arXiv preprint arXiv:1804.01523, 2018. 2, 6 +[7] E. Denton and R. Fergus, "Stochastic video generation with a learned prior," ser. Proceedings of Machine Learning Research, J. Dy and A. Krause, Eds., vol. 80, 2018, pp. 1174-1183. 2, 6 +[8] F. Ebert, S. Dasari, A. X. Lee, S. Levine, and C. Finn, “Robustness via retrying: Closed-loop robotic manipulation with self-supervised learning,” in Conference on Robot Learning (CoRL), 2018. 2 +[9] R. Villegas, A. Pathak, H. Kannan, D. Erhan, Q. V. Le, and H. Lee, "High fidelity video prediction with large stochastic recurrent neural networks," in Advances in Neural Information Processing Systems, 2019, pp. 81-91. 2, 6 +[10] C. K. Sønderby, T. Raiko, L. Maaløe, S. K. Sønderby, and O. Winther, “How to train deep variational autoencoders and probabilistic ladder networks,” in 33rd International Conference on Machine Learning (ICML), 2016. 2, 3, 7 +[11] L. Castrejon, N. Ballas, and A. Courville, "Improved conditional vrnns for video prediction," in The IEEE International Conference on Computer Vision (ICCV), 2019. 2, 3, 6, 16 +[12] T. Unterthiner, S. van Steenkiste, K. Kurach, R. Marinier, M. Michalski, and S. Gelly, “Towards accurate generative models of video: A new metric & challenges,” arXiv preprint arXiv:1812.01717, 2018. 2, 5 +[13] B. Boots, A. Byravan, and D. Fox, "Learning predictive models of a depth camera & manipulator from raw execution traces," in 2014 IEEE International Conference on Robotics and Automation (ICRA), 2014, pp. 4021-4028. 2 +[14] C. Finn and S. Levine, "Deep visual foresight for planning robot motion," in 2017 IEEE International Conference on Robotics and Automation (ICRA), 2017, pp. 2786-2793. 2 +[15] N. Kalchbrenner, A. Oord, K. Simonyan, I. Danihelka, O. Vinyals, A. Graves, and K. Kavukcuoglu, "Video pixel networks," in International Conference on Machine Learning, 2017, pp. 1771-1779. 2 + +[16] F. Ebert, C. Finn, A. X. Lee, and S. Levine, "Self-supervised visual planning with temporal skip connections," in Conference on Robot Learning (CoRL), 2017. 2 +[17] A. Xie, F. Ebert, S. Levine, and C. Finn, "Improvisation through physical understanding: Using novel objects as tools with visual foresight," in Robotics: Science and Systems (RSS), 2019. 2 +[18] C. Paxton, Y. Barnoy, K. Katyal, R. Arora, and G. D. Hager, "Visual robot task planning," in 2019 International Conference on Robotics and Automation (ICRA), 2019, pp. 8832-8838. 2 +[19] S. Nair and C. Finn, "Hierarchical foresight: Self-supervised learning of long-horizon tasks via visual subgoal generation," ICLR, 2020. 2 +[20] S. Nair, M. Babaeizadeh, C. Finn, S. Levine, and V. Kumar, "Trass: Time reversal as self-supervision," in 2020 IEEE International Conference on Robotics and Automation (ICRA), 2020, pp. 115-121. 2 +[21] A. S. Polydoros and L. Nalpantidis, “Survey of model-based reinforcement learning: Applications on robotics,” Journal of Intelligent & Robotic Systems, vol. 86, no. 2, pp. 153–173, 2017. 2 +[22] A. massoud Farahmand, A. Shademan, M. Jagersand, and C. Szepesvári, "Model-based and model-free reinforcement learning for visual servoing," in 2009 IEEE International Conference on Robotics and Automation, 2009, pp. 2917-2924. 2 +[23] M. Zhang, S. Vikram, L. Smith, P. Abbeel, M. Johnson, and S. Levine, "Solar: Deep structured representations for model-based reinforcement learning," in International Conference on Machine Learning, 2019, pp. 7444-7453. 2 +[24] J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. Singh, “Action-conditional video prediction using deep networks in atari games,” in Advances in neural information processing systems, 2015, pp. 2863–2871. 2 +[25] N. Hirose, A. Sadeghian, F. Xia, R. Martin-Martin, and S. Savarese, "Vunet: Dynamic scene view synthesis for traversability estimation using an rgb camera," IEEE Robotics and Automation Letters, vol. 4, no. 2, pp. 2062-2069, 2019. 2 +[26] N. Hirose, F. Xia, R. Martin-Martin, A. Sadeghian, and S. Savarese, "Deep visual mpc-policy learning for navigation," IEEE Robotics and Automation Letters, vol. 4, no. 4, pp. 3184-3191, 2019. 2 +[27] M. S. Nunes, A. Dehban, P. Moreno, and J. Santos-Victor, "Action-conditioned benchmarking of robotic video prediction models: a comparative study," in 2020 IEEE International Conference on Robotics and Automation (ICRA), 2020, pp. 8316-8322. 2 +[28] M. Mathieu, C. Couprie, and Y. LeCun, “Deep multi-scale video prediction beyond mean square error,” in ICLR, 2016. 2 +[29] W. Lotter, G. Kreiman, and D. Cox, "Deep predictive coding networks for video prediction and unsupervised learning," arXiv preprint arXiv:1605.08104, 2016. 2 +[30] X. Liang, L. Lee, W. Dai, and E. P. Xing, "Dual motion gan for future-flow embedded video prediction," in Proceedings of the IEEE International Conference on Computer Vision, 2017, pp. 1744-1752. 2 +[31] J. Xu, B. Ni, and X. Yang, "Video prediction via selective sampling," in Advances in Neural Information Processing Systems, 2018, pp. 1705-1715. 2 + +[32] J.-T. Hsieh, B. Liu, D.-A. Huang, L. F. Fei-Fei, and J. C. Niebles, “Learning to decompose and disentangle representations for video prediction,” in Advances in Neural Information Processing Systems, 2018, pp. 517–526. 2 +[33] F. A. Reda, G. Liu, K. J. Shih, R. Kirby, J. Barker, D. Tarjan, A. Tao, and B. Catanzaro, "Sdc-net: Video prediction using spatially-displaced convolution," in Proceedings of the European Conference on Computer Vision (ECCV), 2018, pp. 718-733. 2 +[34] J. Xu, B. Ni, Z. Li, S. Cheng, and X. Yang, "Structure preserving video prediction," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018, pp. 1460-1469. 2 +[35] Y. Ye, M. Singh, A. Gupta, and S. Tulsiani, "Compositional video prediction," in Proceedings of the IEEE International Conference on Computer Vision, 2019, pp. 10353-10362. 2 +[36] J. Walker, A. Gupta, and M. Hebert, “Dense optical flow prediction from a static image,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 2443–2451. 2 +[37] C. Finn, I. Goodfellow, and S. Levine, "Unsupervised learning for physical interaction through video prediction," in Advances in neural information processing systems, 2016, pp. 64-72. 2 +[38] X. Jia, B. De Brabandere, T. Tuytelaars, and L. V. Gool, "Dynamic filter networks," in Advances in neural information processing systems, 2016, pp. 667-675. 2 +[39] T. Xue, J. Wu, K. Bouman, and B. Freeman, "Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks," in Advances in neural information processing systems, 2016, pp. 91-99. 2 +[40] J. Walker, C. Doersch, A. Gupta, and M. Hebert, "An uncertain future: Forecasting from static images using variational autoencoders," in European Conference on Computer Vision. Springer, 2016, pp. 835-851. 2 +[41] A. Byravan and D. Fox, "Se3-nets: Learning rigid body motion using deep neural networks," in 2017 IEEE International Conference on Robotics and Automation (ICRA), 2017, pp. 173-180. 2 +[42] C. Vondrick and A. Torralba, "Generating the future with adversarial transformers," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017, pp. 1020-1028. 2 +[43] J. Van Amersfoort, A. Kannan, M. Ranzato, A. Szlam, D. Tran, and S. Chintala, "Transformation-based models of video sequences," arXiv preprint arXiv:1701.08435, 2017. 2 +[44] Z. Liu, R. A. Yeh, X. Tang, Y. Liu, and A. Agarwala, "Video frame synthesis using deep voxel flow," in Proceedings of the IEEE International Conference on Computer Vision, 2017, pp. 4463-4471. 2 +[45] B. Chen, W. Wang, and J. Wang, "Video imagination from a single image with transformation generation," in Proceedings of the on Thematic Workshops of ACM Multimedia 2017, 2017, pp. 358-366. 2 +[46] C. Lu, M. Hirsch, and B. Scholkopf, “Flexible spatiotemporal networks for video prediction,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017, pp. 6523–6531. 2 +[47] R. Shu, J. Brofos, F. Zhang, H. H. Bui, M. Ghavamzadeh, and M. Kochenderfer, "Stochastic video prediction with conditional density estimation," in ECCV Workshop on Action and Anticipation for Visual Learning, vol. 2, 2016. 2 + +[48] N. Wichers, R. Villegas, D. Erhan, and H. Lee, “Hierarchical long-term video prediction without supervision,” International Conference on Machine Learning (ICML), 2018. 2 +[49] J.-Y. Franceschi, E. Delasalles, M. Chen, S. Lamprier, and P. Gallinari, "Stochastic latent residual video prediction," arXiv preprint arXiv:2002.09219, 2020. 2 +[50] S. Dasari, F. Ebert, S. Tian, S. Nair, B. Bucher, K. Schmeckpeper, S. Singh, S. Levine, and C. Finn, "Robonet: Large-scale multi-robot learning," in CoRL, 2019. 2, 6, 8 +[51] A. Mandlekar, Y. Zhu, A. Garg, J. Booher, M. Spero, A. Tung, J. Gao, J. Emmons, A. Gupta, E. Orbay, S. Savarese, and L. Fei-Fei, "Roboturk: A crowdsourcing platform for robotic skill learning through imitation," in Conference on Robot Learning, 2018. 2 +[52] A. Van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves et al., "Conditional image generation with pixelCNN decoders," in Advances in neural information processing systems, 2016, pp. 4790-4798. 2 +[53] T. Salimans, A. Karpathy, X. Chen, and D. P. Kingma, "PixelCNN++: A pixelCNN implementation with discretized logistic mixture likelihood and other modifications," in ICLR, 2017. 2 +[54] M. Janner, S. Levine, W. T. Freeman, J. B. Tenenbaum, C. Finn, and J. Wu, “Reasoning about physical interactions with object-oriented prediction and planning,” in International Conference on Learning Representations, 2018. 2 +[55] K. Greff, R. L. Kaufman, R. Kabra, N. Watters, C. Burgess, D. Zoran, L. Matthey, M. Botvinick, and A. Lerchner, "Multiobject representation learning with iterative variational inference," in International Conference on Machine Learning, 2019, pp. 2424-2433. 2 +[56] N. Watters, L. Matthey, M. Bosnjak, C. P. Burgess, and A. Lerchner, "Cobra: Data-efficient model-based rl through unsupervised object discovery and curiosity-driven exploration," arXiv preprint arXiv:1905.09275, 2019. 2 +[57] R. Veerapaneni, J. D. Co-Reyes, M. Chang, M. Janner, C. Finn, J. Wu, J. Tenenbaum, and S. Levine, “Entity abstraction in visual model-based reinforcement learning,” in Conference on Robot Learning, 2019, pp. 1439–1456. 2 +[58] T. Kipf, E. van der Pol, and M. Welling, “Contrastive learning of structured world models,” in International Conference on Learning Representations, 2019. 2 +[59] M. Engelcke, A. R. Kosiorek, O. P. Jones, and I. Posner, "Genesis: Generative scene inference and sampling with object-centric latent representations," in International Conference on Learning Representations, 2019. 2 +[60] S. Nair, S. Savarese, and C. Finn, “Goal-aware prediction: Learning to model what matters,” International Conference on Machine Learning (ICML), 2020. 2 +[61] J. J. Verbeek, N. Vlassis, and B. Kröse, "Efficient greedy learning of gaussian mixture models," Neural computation, vol. 15, no. 2, pp. 469-485, 2003. 3 +[62] G. E. Hinton, S. Osindero, and Y.-W. Teh, “A fast learning algorithm for deep belief nets,” Neural Computation, vol. 18, no. 7, pp. 1527-1554, 2006. 3 +[63] Y. Bengio, P. Lamblin, D. Popovici, and H. Larochelle, "Greedy layer-wise training of deep networks," in Advances in neural information processing systems, 2006, pp. 153-160. 3 +[64] T. Haarnoja, K. Hartikainen, P. Abbeel, and S. Levine, "Latent space policies for hierarchical reinforcement learning," arXiv preprint arXiv:1804.02808, 2018. 3 + +[65] E. Belilovsky, M. Eickenberg, and E. Oyallon, “Greedy layerwise learning can scale to imagenet,” in International conference on machine learning, 2019, pp. 583-593. 3 +[66] M. Malinowski, G. Swirszcz, J. Carreira, and V. Patraucean, "Sideways: Depth-parallel training of video models," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 3 +[67] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, P.-A. Manzagol, and L. Bottou, "Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion." Journal of machine learning research, vol. 11, no. 12, 2010. 3 +[68] J. Masci, U. Meier, D. Ciresan, and J. Schmidhuber, "Stacked convolutional auto-encoders for hierarchical feature extraction," in International conference on artificial neural networks. Springer, 2011, pp. 52-59. 3 +[69] J. Zhang, S. Shan, M. Kan, and X. Chen, "Coarse-to-fine auto-encoder networks (cfan) for real-time face alignment," in European conference on computer vision. Springer, 2014, pp. 1-16. 3 +[70] V. Kumar, G. C. Nandi, and R. Kala, "Static hand gesture recognition using stacked denoising sparse autoencoders," in 2014 Seventh International Conference on Contemporary Computing (IC3), 2014, pp. 99-104. 3 +[71] E. P. Iijina et al., "Classification of human actions using pose-based features and stacked auto encoder," Pattern Recognition Letters, vol. 83, pp. 268-277, 2016. 3 +[72] D. Singh and C. K. Mohan, "Deep spatio-temporal representation for detection of road accidents using stacked autoencoder," IEEE Transactions on Intelligent Transportation Systems, vol. 20, no. 3, pp. 879-887, 2018. 3 +[73] Y. Qi, Y. Wang, X. Zheng, and Z. Wu, "Robust feature learning by stacked autoencoder with maximum current-tropy criterion," in 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2014, pp. 6716-6720. 3 +[74] S. Löwe, P. O'Connor, and B. Veeling, “Putting an end to end-to-end: Gradient-isolated learning of representations,” in Advances in Neural Information Processing Systems, 2019, pp. 3039–3051. 3 +[75] S. Löwe, P. O'Connor, and B. S. Veeling, “Greedy infomax for self-supervised representation learning,” 2019. 3 +[76] T. Karras, T. Aila, S. Laine, and J. Lehtinen, "Progressive growing of gans for improved quality, stability, and variation," arXiv preprint arXiv:1710.10196, 2017. 3 +[77] C. K. Sønderby, T. Raiko, L. Maaløe, S. K. Sønderby, and O. Winther, “Ladder variational autoencoders,” in Advances in neural information processing systems, 2016, pp. 3738–3746. 3 +[78] S. Zhao, J. Song, and S. Ermon, “Towards deeper understanding of variational autoencoding models,” arXiv preprint arXiv:1702.08658, 2017. 3 +[79] A. Vahdat and J. Kautz, "Nvae: A deep hierarchical variational autoencoder," arXiv preprint arXiv:2007.03898, 2020. 3 +[80] S. Zhao, J. Song, and S. Ermon, “Learning hierarchical features from generative models,” in 33rd International Conference on Machine Learning (ICML), 2016. 3 +[81] L. Maaloe, M. Fraccaro, V. Lievin, and O. Winther, "Biva: A very deep hierarchy of latent variables for generative modeling," in Advances in neural information processing systems, 2019, pp. 6551-6562. 3 + +[82] J. Ho, A. Jain, and P. Abbeel, “Denoising diffusion probabilistic models,” arXiv preprint arxiv:2006.11239, 2020. 3 +[83] J. Song, C. Meng, and S. Ermon, “Denoising diffusion implicit models,” arXiv:2010.02502, October 2020. 3 +[84] R. Zhang, P. Isola, A. A. Efros, E. Shechtman, and O. Wang, "The unreasonable effectiveness of deep features as a perceptual metric," in CVPR, 2018. 6 +[85] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun, “Vision meets robotics: The kitti dataset,” International Journal of Robotics Research (IJRR), 2013. 6 +[86] M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele, “The cityscapes dataset for semantic urban scene understanding,” in Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 6 +[87] C. Ionescu, D. Papava, V. Olaru, and Sminchisescu Cristian, "Human3.6m: Large scale datasets and predictive methods for 3d human sensing in natural environments," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 36, no. 7, pp. 1325-1339, 2014. 6 \ No newline at end of file diff --git a/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/images.zip b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a59ee98f689c3de3a35cca693bac3ae9fa59f665 --- /dev/null +++ b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4b8a9e5b127dca2b0a01e12237e22bef5114bcd207f8accfa77d8d0e7d030f8 +size 464275 diff --git a/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/layout.json b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d31eae92c59001b28510d171449978eec6c19a8d --- /dev/null +++ b/greedyhierarchicalvariationalautoencodersforlargescalevideoprediction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94703b48aff7c90cf60bc5f062a30800e07aeaada028219e13f66a59ad046b76 +size 425688 diff --git a/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_content_list.json b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9c82514b520e48a3bc17c5bc717e1ceabff0b7ef --- /dev/null +++ b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2d34a079545b09b21e5abc14f21ef144318803ae83b783e7e1f77fc8c935bee +size 95623 diff --git a/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_model.json b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2e29c0e5babbbf4789ea83d7e5fcb0f07d6c0f82 --- /dev/null +++ b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15d31776eddcf92471903da9dc0ebdd09ab85e8728bd5de60cb136b38a77cb8e +size 125220 diff --git a/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_origin.pdf b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..693bb344335a1b3a74c8decde2bffd6305225c8d --- /dev/null +++ b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/8a0251fc-9b27-477b-9e7c-3ab88a65bbc3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b561e1e895a539a94058fc4db7423809629ee5ec7a12420882fc7969117bbeeb +size 1472991 diff --git a/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/full.md b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3ee4d47d9716664b1c52ebe525585d4d1f5edd36 --- /dev/null +++ b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/full.md @@ -0,0 +1,449 @@ +# GrooMeD-NMS: Grouped Mathematically Differentiable NMS for Monocular 3D Object Detection + +Abhinav Kumar, Garrick Brazil, Xiaoming Liu +Michigan State University, East Lansing, MI, USA + +[kumarab6, brazilga, liuxm]@msu.edu + +https://github.com/abhilkumar/groomed_nms + +![](images/1fb1d7ae9b8a55e417e732ee63e6b1b0dcd9f4577958e6677e4755a51edd7dbe.jpg) +(a) Conventional NMS Pipeline + +![](images/a50123ffd15ec60a2339278d5cee063ba306376f8e4af2d462042dbf58f51d43.jpg) +(b) GrooMeD-NMS Pipeline +Figure 1: Overview of our method. (a) Conventional object detection has a mismatch between training and inference as it uses NMS only in inference. (b) To address this, we propose a novel GrooMeD-NMS layer, such that the network is trained end-to-end with NMS applied. s and r denote the score of boxes $\mathcal{B}$ before and after the NMS respectively. O denotes the matrix containing IoU $_{2D}$ overlaps of $\mathcal{B}$ . $\mathcal{L}_{before}$ denotes the losses before the NMS, while $\mathcal{L}_{after}$ denotes the loss after the NMS. (c) GrooMeD-NMS layer calculates $\mathbf{r}$ in a differentiable manner giving gradients from $\mathcal{L}_{after}$ when the best-localized box corresponding to an object is not selected after NMS. + +![](images/1de948fbebc2f4009845a5eeeeed4b9b2222eda7a1d1a432dde53e6b28a8f475.jpg) +(c) GrooMeD-NMS layer + +# Abstract + +Modern 3D object detectors have immensely benefited from the end-to-end learning idea. However, most of them use a post-processing algorithm called Non-Maximal Suppression (NMS) only during inference. While there were attempts to include NMS in the training pipeline for tasks such as 2D object detection, they have been less widely adopted due to a non-mathematical expression of the NMS. In this paper, we present and integrate GrooMeD-NMS - a novel Grouped Mathematically Differentiable NMS for monocular 3D object detection, such that the network is trained end-to-end with a loss on the boxes after NMS. We first formulate NMS as a matrix operation and then group and mask the boxes in an unsupervised manner to obtain a simple closed-form expression of the NMS. GrooMeDNMS addresses the mismatch between training and inference pipelines and, therefore, forces the network to select the best 3D box in a differentiable manner. As a result, GrooMeD-NMS achieves state-of-the-art monocular 3D object detection results on the KITTI benchmark dataset performing comparably to monocular video-based methods. + +# 1. Introduction + +3D object detection is one of the fundamental problems in computer vision, where the task is to infer 3D information of the object. Its applications include augmented reality [2, 68], robotics [43, 74], medical surgery [70], and, more recently path planning and scene understanding in autonomous driving [17, 35, 46, 77]. Most of the 3D object detectors [17, 35, 44, 46, 77] are extensions of the 2D object detector Faster R-CNN [69], which relies on the end-to-end learning idea to achieve State-of-the-Art (SoTA) object detection. Some of these methods have proposed changing architectures [46, 76, 77] or losses [10, 18]. Others have tried incorporating confidence [12, 76, 77] or temporal cues [12]. + +Almost all of them output a massive number of boxes for each object and, thus, rely on post-processing with a greedy [65] clustering algorithm called Non-Maximal Suppression (NMS) during inference to reduce the number of false positives and increase performance. However, these works have largely overlooked NMS's inclusion in training leading to an apparent mismatch between training and inference pipelines as the losses are applied on all boxes before NMS but not on final boxes after NMS (see Fig. 1(a)). + +We also find that 3D object detection suffers a greater mismatch between classification and 3D localization compared to that of 2D localization, as discussed further in Sec. A3.2 of the supplementary and observed in [12, 35, 76]. Hence, our focus is 3D object detection. + +Earlier attempts to include NMS in the training pipeline [31,32,65] have been made for 2D object detection where the improvements are less visible. Recent efforts to improve the correlation in 3D object detection involve calculating [77, 79] or predicting [12, 76] the scores via likelihood estimation [40] or enforcing the correlation explicitly [35]. Although this improves the 3D detection performance, improvements are limited as their training pipeline is not end to end in the absence of a differentiable NMS. + +To address the mismatch between training and inference pipelines as well as the mismatch between classification and 3D localization, we propose including the NMS in the training pipeline, which gives a useful gradient to the network so that it figures out which boxes are the best-localized in 3D and, therefore, should be ranked higher (see Fig. 1(b)). + +An ideal NMS for inclusion in the training pipeline should be not only differentiable but also parallelizable. Unfortunately, the inference-based classical NMS and SoftNMS [8] are greedy, set-based and, therefore, not parallelizable [65]. To make the NMS parallelizable, we first formulate the classical NMS as matrix operation and then obtain a closed-form mathematical expression using elementary matrix operations such as matrix multiplication, matrix inversion, and clipping. We then replace the threshold pruning in the classical NMS with its softer version [8] to get useful gradients. These two changes make the NMS GPU-friendly, and the gradients are backpropagated. We next group and mask the boxes in an unsupervised manner, which removes the matrix inversion and simplifies our proposed differentiable NMS expression further. We call this NMS as Grouped Mathematically Differentiable Non-Maximal Suppression (GrooMeD-NMS). + +In summary, the main contributions of this work include: + +- This is the first work to propose and integrate a closed-form mathematically differentiable NMS for object detection, such that the network is trained end-to-end with a loss on the boxes after NMS. +- We propose an unsupervised grouping and masking on the boxes to remove the matrix inversion in the closed-form NMS expression. +- We achieve SoTA monocular 3D object detection performance on the KITTI dataset performing comparably to monocular video-based methods. + +# 2. Related Work + +3D Object Detection. Recent success in 2D object detection [26, 27, 48, 67, 69] has inspired people to infer 3D information from a single 2D (monocular) image. How- + +ever, the monocular problem is ill-posed due to the inherent scale/depth ambiguity [82]. Hence, approaches use additional sensors such as LiDAR [35, 75, 88], stereo [45, 87] or radar [58, 84]. Although LiDAR depth estimations are accurate, LiDAR data is sparse [33] and computationally expensive to process [82]. Moreover, LiDARs are expensive and do not work well in severe weather [82]. + +Hence, there have been several works on monocular 3D object detection. Earlier approaches [15,23,61,62] use hand-crafted features, while the recent ones are all based on deep learning. Some of these methods have proposed changing architectures [46, 49, 82] or losses [10, 18]. Others have tried incorporating confidence [12, 49, 76, 77], augmentation [80], depth in convolution [10, 22] or temporal cues [12]. Our work proposes to incorporate NMS in the training pipeline of monocular 3D object detection. + +Non-Maximal Suppression. NMS has been used to reduce false positives in edge detection [72], feature point detection [29, 53, 57], face detection [85], human detection [11, 13, 20] as well as SoTA 2D [26, 48, 67, 69] and 3D detection [4, 12, 17, 76, 77, 82]. Modifications to NMS in 2D detection [8, 21, 31, 32, 65], 2D pedestrian detection [42, 51, 73], 2D salient object detection [91] and 3D detection [76] can be classified into three categories – inference NMS [8, 76], optimization-based NMS [3, 21, 42, 73, 86, 91] and neural network based NMS [30–32, 51, 65]. + +The inference NMS [8] changes the way the boxes are pruned in the final set of predictions. [76] uses weighted averaging to update the $z$ -coordinate after NMS. [73] solves quadratic unconstrained binary optimization while [3, 42, 81] and [91] use point processes and MAP based inference respectively. [21] and [86] formulate NMS as a structured prediction task for isolated and all object instances respectively. The neural network NMS use a multi-layer network and message-passing to approximate NMS [31, 32, 65] or to predict the NMS threshold adaptively [51]. [30] approximates the sub-gradients of the network without modelling NMS via a transitive relationship. Our work proposes a grouped closed-form mathematical approximation of the classical NMS and does not require multiple layers or message-passing. We detail these differences in Sec. 4.2. + +# 3. Background + +# 3.1. Notations + +Let $\mathcal{B} = \{b_i\}_{i=1}^n$ denote the set of boxes or proposals $b_i$ from an image. Let $\mathbf{s} = \{s_i\}_{i=1}^n$ and $\mathbf{r} = \{r_i\}_{i=1}^n$ denote their scores (before NMS) and rescores (updated scores after NMS) respectively such that $r_i, s_i \geq 0 \forall i$ . $\mathcal{D}$ denotes the subset of $\mathcal{B}$ after the NMS. Let $\mathbf{O} = [o_{ij}]$ denote the $n \times n$ matrix with $o_{ij}$ denoting the 2D Intersection over Union (IoU $_{2D}$ ) of $b_i$ and $b_j$ . The pruning function $p$ decides how to rescore a set of boxes $\mathcal{B}$ based on IoU $_{2D}$ overlaps + +Algorithm 1: Classical/Soft-NMS [8] +Input: s: scores, O: IoU2D matrix, $N_{t}$ : NMS threshold, $p$ : pruning function, $\tau$ : temperature +Output: d: box index after NMS, r: scores after NMS +1 begin +2 $\mathbf{d} \gets \{\}$ +3 $\mathbf{t} \gets \{1, \dots, |\mathbf{s}|\}$ ▷ All box indices +4 $\mathbf{r} \gets \mathbf{s}$ +5 while t ≠ empty do +6 $\nu \gets \text{argmax } \mathbf{r}[t]$ ▷ Top scored box +7 $\mathbf{d} \gets \mathbf{d} \cup \nu$ ▷ Add to valid box index +8 $\mathbf{t} \gets \mathbf{t} - \nu$ ▷ Remove from t +9 for i ← 1 : |t| do +10 | $r_{i} \gets (1 - p_{\tau}(\mathbf{O}[\nu, i])) r_{i}$ ▷ Rescore +11 end +12 end +13 end + +of its neighbors, sometimes suppressing boxes entirely. In other words, $p(o_{i}) = 1$ denotes the box $b_{i}$ is suppressed while $p(o_{i}) = 0$ denotes $b_{i}$ is kept in $\mathcal{D}$ . The NMS threshold $N_{t}$ is the threshold for which two boxes need in order for the non-maximum to be suppressed. The temperature $\tau$ controls the shape of the exponential and sigmoidal pruning functions $p$ . $v$ thresholds the rescores in GrooMeD and Soft-NMS [9] to decide if the box remains valid after NMS. + +$\mathcal{B}$ is partitioned into different groups $\mathcal{G} = \{\mathcal{G}_k\}$ . $\mathcal{B}_{\mathcal{G}_k}$ denotes the subset of $\mathcal{B}$ belonging to group $k$ . Thus, $\mathcal{B}_{\mathcal{G}_k} = \{b_i\} \forall b_i \in \mathcal{G}_k$ and $\mathcal{B}_{\mathcal{G}_k} \cap \mathcal{B}_{\mathcal{G}_l} = \phi \forall k \neq l$ . $\mathcal{G}_k$ in the subscript of a variable denotes its subset corresponding to $\mathcal{B}_{\mathcal{G}_k}$ . Thus, $\mathbf{s}_{\mathcal{G}_k}$ and $\mathbf{r}_{\mathcal{G}_k}$ denote the scores and the rescores of $\mathcal{B}_{\mathcal{G}_k}$ respectively. $\alpha$ denotes the maximum group size. + +$\vee$ denotes the logical OR while $\lfloor x\rfloor$ denotes clipping of $x$ in the range [0, 1]. Formally, + +$$ +\lfloor x \rceil = \left\{ \begin{array}{l l} 1, & x > 1 \\ x, & 0 \leq x \leq 1 \\ 0, & x < 0 \end{array} \right. \tag {1} +$$ + +$|s|$ denotes the number of elements in $s$ . $\triangleleft$ in the subscript denotes the lower triangular version of the matrix without the principal diagonal. $\odot$ denotes the element-wise multiplication. $\mathbf{I}$ denotes the identity matrix. + +# 3.2. Classical and Soft-NMS + +NMS is one of the building blocks in object detection whose high-level goal is to iteratively suppress boxes which have too much IoU with a nearby high-scoring box. We first give an overview of the classical and Soft-NMS [8], which are greedy and used in inference. Classical NMS uses the idea that the score of a box having a high $\mathrm{IoU}_{2\mathrm{D}}$ overlap with any of the selected boxes should be suppressed to zero. That is, it uses a hard pruning $p$ without any temperature $\tau$ . Soft-NMS makes this pruning soft via temperature $\tau$ . Thus, + +Algorithm 2: GrooMeD-NMS +Input: s: scores, O: IoU2D matrix, $N_{t}$ : NMS threshold, $p$ : pruning function, $v$ : valid box threshold, $\alpha$ : maximum group size +Output: d: box index after NMS, r: scores after NMS +1 begin +2 s, index $\leftarrow$ sort(s, descending=True) Sort s +3 O $\leftarrow$ O[index][:, index] Sort O +4 O $\leftarrow$ lower(O) Lower △ular matrix +5 P $\leftarrow$ p(O) Prune matrix +6 I $\leftarrow$ Identity(|s|) Identity matrix +7 G $\leftarrow$ group(O, $N_{t}, \alpha$ ) Group boxes B +8 for $k \leftarrow 1: |\mathcal{G}|$ do +9 M $_{\mathcal{G}_k}$ $\leftarrow$ zeros (|G|, |G|) Prepare mask +10 M $_{\mathcal{G}_k}$ [, G[k[1]]] $\leftarrow 1$ First col of M $_{\mathcal{G}_k}$ +11 r $_{\mathcal{G}_k}$ $\leftarrow$ [(I $_{\mathcal{G}_k}$ - M $_{\mathcal{G}_k}$ ⊙ P $_{\mathcal{G}_k}$ ) s $_{\mathcal{G}_k}$ ] Rescore +12 end +13 d $\leftarrow$ index[r >= v] Valid box index +14 end + +Algorithm 3: Grouping of boxes +Input: O: sorted IoU2D matrix, $N_{t}$ : NMS threshold, $\alpha$ : maximum group size +Output: G: Groups +1 begin +2 $\mathcal{G} \gets \{\}$ +3 t $\leftarrow \{1,\dots ,\mathbf{O}.shape[1]\}$ ▷ All box indices +4 while t ≠ empty do +5 u $\leftarrow$ O[:, 1] > Nt ▷ High overlap indices +6 v $\leftarrow$ t[u] ▷ New group +7 nGk $\leftarrow$ min(|v|, $\alpha$ ) +8 G.insert(v[: nGk]) ▷ Insert new group +9 w $\leftarrow$ O[:, 1] ≤ Nt ▷ Low overlap indices +10 t $\leftarrow$ t[w] ▷ Keep w indices in t +11 O $\leftarrow$ O[w][:, w] ▷ Keep w indices in O +12 end +13 end + +classical and Soft-NMS only differ in the choice of $p$ . We reproduce them in Alg. 1 using our notations. + +# 4. GrooMeD-NMS + +Classical NMS (Alg. 1) uses argmax and greedily calculates the rescore $r_i$ of boxes $\mathcal{B}$ and, is thus not parallelizable or differentiable [65]. We wish to find its smooth approximation in closed-form for including in the training pipeline. + +# 4.1. Formulation + +# 4.1.1 Sorting + +Classical NMS uses the non-differentiable hard argmax operation (Line 6 of Alg. 1). We remove the argmax by hard sorting the scores $s$ and $O$ in decreasing order (lines 2-3 of Alg. 2). We also try making the sorting soft. Note that we require the permutation of $s$ to sort $O$ . Most soft sorting + +methods [6,7,60,63] apply the soft permutation to the same vector. Only two other methods [19, 64] can apply the soft permutation to another vector. Both methods use $\mathcal{O}(n^2)$ computations for soft sorting [7]. We implement [64] and find that [64] is overly dependent on temperature $\tau$ to break out the ranks, and its gradients are too unreliable to train our model. Hence, we stick with the hard sorting of s and O. + +# 4.1.2 NMS as a Matrix Operation + +The rescoring process of the classical NMS is greedy set-based [65] and only considers overlaps with unsuppressed boxes. We first generalize this rescoring by accounting for the effect of all (suppressed and unsuppressed) boxes as + +$$ +r _ {i} \approx \max \left(s _ {i} - \sum_ {j = 1} ^ {i - 1} p \left(o _ {i j}\right) r _ {j}, 0\right) \tag {2} +$$ + +using the relaxation of logical OR $\bigvee$ operator as $\sum$ [38,47]. See Sec. A1 of the supplementary material for an alternate explanation of (2). The presence of $r_j$ on the RHS of (2) prevents suppressed boxes from influencing other boxes hugely. When $p$ outputs discretely as $\{0,1\}$ as in classical NMS, scores $s_i$ are guaranteed to be suppressed to $r_i = 0$ or left unchanged $r_i = s_i$ thereby implying $r_i \leq s_i \forall i$ . We write the rescores $\mathbf{r}$ in a matrix formulation as + +$$ +\left[ \begin{array}{l} r _ {1} \\ r _ {2} \\ r _ {3} \\ \vdots \\ r _ {n} \end{array} \right] \approx \max \left(\left[ \begin{array}{l} c _ {1} \\ c _ {2} \\ c _ {3} \\ \vdots \\ c _ {n} \end{array} \right], \left[ \begin{array}{l} 0 \\ 0 \\ 0 \\ \vdots \\ 0 \end{array} \right]\right), \tag {3} +$$ + +with + +$$ +\left[ \begin{array}{c} c _ {1} \\ c _ {2} \\ c _ {3} \\ \vdots \\ c _ {n} \end{array} \right] = \left[ \begin{array}{c} s _ {1} \\ s _ {2} \\ s _ {3} \\ \vdots \\ s _ {n} \end{array} \right] - \left[ \begin{array}{c c c c} 0 & 0 & \dots & 0 \\ p \left(o _ {2 1}\right) & 0 & \dots & 0 \\ p \left(o _ {3 1}\right) & p \left(o _ {3 2}\right) & \dots & 0 \\ \vdots & \vdots & \vdots & \vdots \\ p \left(o _ {n 1}\right) & p \left(o _ {n 2}\right) & \dots & 0 \end{array} \right] \left[ \begin{array}{c} r _ {1} \\ r _ {2} \\ r _ {3} \\ \vdots \\ r _ {n} \end{array} \right]. \tag {4} +$$ + +The above two equations are written compactly as + +$$ +\mathbf {r} \approx \max (\mathbf {s} - \mathbf {P r}, \mathbf {0}), \tag {5} +$$ + +where $\mathbf{P}$ , called the Prune Matrix, is obtained when the pruning function $p$ operates element-wise on $\mathbf{O}_{\perp}$ . Maximum operation makes (5) non-linear [41] and, thus, difficult to solve. However, to avoid recursion, we use + +$$ +\mathbf {r} \approx \left\lfloor (\mathbf {I} + \mathbf {P}) ^ {- 1} \mathbf {s} \right], \tag {6} +$$ + +as the solution to (5) with $\mathbf{I}$ being the identity matrix. Intuitively, if the matrix inversion is considered division in (6) + +and the boxes have overlaps, the rescores are the scores divided by a number greater than one and are, therefore, lesser than scores. If the boxes do not overlap, the division is by one and rescores equal scores. + +Note that the $\mathbf{I} + \mathbf{P}$ in (6) is a lower triangular matrix with ones on the principal diagonal. Hence, $\mathbf{I} + \mathbf{P}$ is always full rank and, therefore, always invertible. + +# 4.1.3 Grouping + +We next observe that the object detectors output multiple boxes for an object, and a good detector outputs boxes wherever it finds objects in the monocular image. Thus, we cluster the boxes in an image in an unsupervised manner based on $\mathrm{IoU}_{2\mathrm{D}}$ overlaps to obtain the groups $\mathcal{G}$ . Grouping thus mimics the grouping of the classical NMS, but does not rescore the boxes. As clustering limits interactions to intra-group interactions among the boxes, we write (6) as + +$$ +\mathbf {r} _ {\mathcal {G} _ {k}} \approx \left\lfloor \left(\mathbf {I} _ {\mathcal {G} _ {k}} + \mathbf {P} _ {\mathcal {G} _ {k}}\right) ^ {- 1} \mathbf {s} _ {\mathcal {G} _ {k}} \right]. \tag {7} +$$ + +This results in taking smaller matrix inverses in (7) than (6). + +We use a simplistic grouping algorithm, i.e., we form a group $\mathcal{G}_k$ with boxes having high $\mathrm{IoU}_{2\mathrm{D}}$ overlap with the top-ranked box, given that we sorted the scores. As the group size is limited by $\alpha$ , we choose a minimum of $\alpha$ and the number of boxes in $\mathcal{G}_k$ . We next delete all the boxes of this group and iterate until we run out of boxes. Also, grouping uses $\mathrm{IoU}_{2\mathrm{D}}$ since we can achieve meaningful clustering in 2D. We detail this unsupervised grouping in Alg. 3. + +# 4.1.4 Masking + +Classical NMS considers the $\mathrm{IoU}_{2\mathrm{D}}$ of the top-scored box with other boxes. This consideration is equivalent to only keeping the column of $\mathbf{O}$ corresponding to the top box while assigning the rest of the columns to be zero. We implement this through masking of $\mathbf{P}_{\mathcal{G}_k}$ . Let $\mathbf{M}_{\mathcal{G}_k}$ denote the binary mask corresponding to group $\mathcal{G}_k$ . Then, entries in the binary matrix $\mathbf{M}_{\mathcal{G}_k}$ in the column corresponding to the top-scored box are 1 and the rest are 0. Hence, only one of the columns in $\mathbf{M}_{\mathcal{G}_k} \odot \mathbf{P}_{\mathcal{G}_k}$ is non-zero. Now, $\mathbf{I}_{\mathcal{G}_k} + \mathbf{M}_{\mathcal{G}_k} \odot \mathbf{P}_{\mathcal{G}_k}$ is a Frobenius matrix (Gaussian transformation) and we, therefore, invert this matrix by simply subtracting the second term [28]. In other words, $(\mathbf{I}_{\mathcal{G}_k} + \mathbf{M}_{\mathcal{G}_k} \odot \mathbf{P}_{\mathcal{G}_k})^{-1} = \mathbf{I}_{\mathcal{G}_k} - \mathbf{M}_{\mathcal{G}_k} \odot \mathbf{P}_{\mathcal{G}_k}$ . Hence, we simplify (7) further to get + +$$ +\mathbf {r} _ {\mathcal {G} _ {k}} \approx \left\lfloor \left(\mathbf {I} _ {\mathcal {G} _ {k}} - \mathbf {M} _ {\mathcal {G} _ {k}} \odot \mathbf {P} _ {\mathcal {G} _ {k}}\right) \mathbf {s} _ {\mathcal {G} _ {k}} \right]. \tag {8} +$$ + +Thus, masking allows to bypass the computationally expensive matrix inverse operation altogether. + +We call the NMS based on (8) as Grouped Mathematically Differentiable Non-Maximal Suppression or GrooMeD-NMS. We summarize the complete GrooMeDNMS in Alg. 2 and show its block-diagram in Fig. 1(c). + +![](images/3d81e01d432382adc3771566c02bdd0404966c501edfb08e4296f20933555cbc.jpg) +Figure 2: Pruning functions $p$ of the classical and GrooMeD-NMS. We use the Linear and Exponential pruning of the Soft-NMS [8] while training with the GrooMeD-NMS. + +GrooMeD-NMS in Fig. 1(c) provides two gradients - one through s and other through O. + +# 4.1.5 Pruning Function + +As explained in Sec. 3.1, the pruning function $p$ decides whether to keep the box in the final set of predictions $\mathcal{D}$ or not based on IoU2D overlaps, i.e., $p(o_i) = 1$ denotes the box $b_i$ is suppressed while $p(o_i) = 0$ denotes $b_i$ is kept in $\mathcal{D}$ . + +Classical NMS uses the threshold as the pruning function, which does not give useful gradients. Therefore, we considered three different functions for $p$ : Linear, a temperature $(\tau)$ -controlled Exponential, and Sigmoidal function. + +- Linear Linear pruning function [8] is $p(o) = o$ . +- Exponential Exponential pruning function [8] is $p(o) = 1 - \exp \left(-\frac{o^2}{\tau}\right)$ . +- Sigmoidal Sigmoidal pruning function is $p(o) = \sigma \left( \frac{o - N_t}{\tau} \right)$ with $\sigma$ denoting the standard sigmoid. Sigmoidal function appears as the binary cross entropy relaxation of the subset selection problem [60]. + +We show these pruning functions in Fig. 2. The ablation studies (Sec. 5.4) show that choosing $p$ as Linear yields the simplest and the best GrooMeD-NMS. + +# 4.2. Differences from Existing NMS + +Although no differentiable NMS has been proposed for the monocular 3D object detection, we compare our GrooMeD-NMS with the NMS proposed for 2D object detection, 2D pedestrian detection, 2D salient object detection, and 3D object detection in Tab. 1. No method described in Tab. 1 has a matrix-based closed-form mathematical expression of the NMS. Classical, Soft [8] and Distance-NMS [76] are used at the inference time, while GrooMeD-NMS is used during both training and inference. Distance-NMS [76] updates the $z$ -coordinate of the box after NMS as the weighted average of the $z$ -coordinates of top- $\kappa$ boxes. QUBO-NMS [73], Point-NMS [42, 81], and MAP-NMS [91] are not used in end-to-end training. [3] proposes a trainable Point-NMS. The Structured-SVM based NMS [21,86] rely on structured SVM to obtain the rescores. + +Table 1: Overview of different NMS. [Key: Train= End-to-end Trainable, Prune= Pruning function, #Layers= Number of layers, Par= Parallelizable] + +
NMSTrainRescorePrune #LayersPar
Classical××Hard-O(|G|)
Soft-NMS [8]××Soft-O(|G|)
Distance-NMS [76]××Hard-O(|G|)
QUBO-NMS [73]×Optimization×--
Point-NMS [42, 81]×Point Process×--
Trainable Point-NMS [3]✓Point Process×--
MAP-NMS [91]×MAP×--
Structured-NMS [21, 86]×SSVM×--
Adaptive-NMS [51]××Hard>1O(|G|)
NN-NMS [31, 32, 65]✓Neural Network×>1O(1)
GrooMeD-NMS (Ours)✓MatrixSoft1O(|G|)
+ +Adaptive-NMS [51] uses a separate neural network to predict the classical NMS threshold $N_{t}$ . The trainable neural network based NMS (NN-NMS) [31, 32, 65] use a separate neural network containing multiple layers and/or message-passing to approximate the NMS and do not use the pruning function. Unlike these methods, GrooMeD-NMS uses a single layer and does not require multiple layers or message passing. Our NMS is parallel up to group (denoted by $\mathcal{G}$ ). However, $|\mathcal{G}|$ is, in general, $<<|B|$ in the NMS. + +# 4.3. Target Assignment and Loss Function + +Target Assignment. Our method consists of M3D-RPN [10] and uses binning and self-balancing confidence [12]. The boxes' self-balancing confidence are used as scores $\mathbf{s}$ , which pass through the GrooMeD-NMS layer to obtain the rescores $\mathbf{r}$ . The rescores signal the network if the best box has not been selected for a particular object. + +We extend the notion of the best 2D box [65] to 3D. The best box has the highest product of $\mathrm{IoU}_{2\mathrm{D}}$ and $\mathrm{gIoU}_{3\mathrm{D}}$ [71] with ground truth $g_{l}$ . If the product is greater than a certain threshold $\beta$ , it is assigned a positive label. Mathematically, + +$$ +\operatorname {t a r g e t} \left(b _ {i}\right) = \left\{ \begin{array}{l l} 1, & \text {i f} \exists g _ {l} \text {s t} i = \operatorname {a r g m a x} q \left(b _ {j}, g _ {l}\right) \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {9} +$$ + +with $q(b_{j}, g_{l}) = \mathrm{IoU}_{2\mathrm{D}}(b_{j}, g_{l}) \left( \frac{1 + \mathrm{IoU}_{3\mathrm{D}}(b_{j}, g_{l})}{2} \right)$ . $\mathrm{gIoU}_{3\mathrm{D}}$ is known to provide signal even for non-intersecting boxes [71], where the usual $\mathrm{IoU}_{3\mathrm{D}}$ is always zero. Therefore, we use $\mathrm{gIoU}_{3\mathrm{D}}$ instead of regular $\mathrm{IoU}_{3\mathrm{D}}$ for figuring out the best box in 3D as many 3D boxes have a zero $\mathrm{IoU}_{3\mathrm{D}}$ overlap with the ground truth. For calculating $\mathrm{gIoU}_{3\mathrm{D}}$ , we first calculate the volume $V$ and hull volume $V_{hull}$ of the 3D boxes. $V_{hull}$ is the product of $\mathrm{gIoU}_{2\mathrm{D}}$ in Birds Eye View (BEV), removing the rotations and hull of the $Y$ dimension. $\mathrm{gIoU}_{3\mathrm{D}}$ is then given by + +$$ +\mathrm {g I o U} _ {\mathrm {3 D}} \left(b _ {i}, b _ {j}\right) = \frac {V \left(b _ {i} \cap b _ {j}\right)}{V \left(b _ {i} \cup b _ {j}\right)} + \frac {V \left(b _ {i} \cup b _ {j}\right)}{V _ {h u l l} \left(b _ {i} , b _ {j}\right)} - 1. \tag {10} +$$ + +Loss Function. Generally the number of best boxes is less than the number of ground truths in an image, as there could + +be some ground truth boxes for which no box is predicted. The tiny number of best boxes introduces a far-heavy skew than the foreground-background classification. Thus, we use the modified AP-Loss [14] as our loss after NMS since AP-Loss does not suffer from class imbalance [14]. + +Vanilla AP-Loss treats boxes of all images in a minibatch equally, and the gradients are back-propagated through all the boxes. We remove this condition and rank boxes in an image-wise manner. In other words, if the best boxes are correctly ranked in one image and are not in the second, then the gradients only affect the boxes of the second image. We call this modification of AP-Loss as Image-wise AP-Loss. In other words, + +$$ +\mathcal {L} _ {\text {I m a g e w i s e}} = \frac {1}{N} \sum_ {m = 1} ^ {N} \mathrm {A P} \left(\mathbf {r} ^ {(m)}, \operatorname {t a r g e t} \left(\mathcal {B} ^ {(m)}\right)\right), \tag {11} +$$ + +where $\mathbf{r}^{(m)}$ and $\mathcal{B}^{(m)}$ denote the rescores and the boxes of the $m^{\mathrm{th}}$ image in a mini-batch respectively. This is different from previous NMS approaches [30-32, 65], which use classification losses. Our ablation studies (Sec. 5.4) show that the Imagewise AP-Loss is better suited to be used after NMS than the classification loss. + +Our overall loss function is thus given by $\mathcal{L} = \mathcal{L}_{before} + \lambda \mathcal{L}_{after}$ where $\mathcal{L}_{before}$ denotes the losses before the NMS including classification, 2D and 3D regression as well as confidence losses, and $\mathcal{L}_{after}$ denotes the loss term after the NMS, which is the Imagewise AP-Loss with $\lambda$ being the weight. See Sec. A2 of the supplementary material for more details of the loss function. + +# 5. Experiments + +Our experiments use the most widely used KITTI autonomous driving dataset [25]. We modify the publicly-available PyTorch [59] code of Kinematic-3D [12]. [12] uses DenseNet-121 [34] trained on ImageNet as the backbone and $n_h = 1,024$ using 3D-RPN settings of [10]. As [12] is a video-based method while GrooMeD-NMS is an image-based method, we use the best image model of [12] henceforth called Kinematic (Image) as our baseline for a fair comparison. Kinematic (Image) is built on M3D-RPN [10] and uses binning and self-balancing confidence. + +Data Splits. There are three commonly used data splits of the KITTI dataset; we evaluate our method on all three. + +Test Split: Official KITTI 3D benchmark [1] consists of 7,481 training and 7,518 testing images [25]. + +Val 1 Split: It partitions the 7,481 training images into 3,712 training and 3,769 validation images [12, 16, 77]. + +Val 2 Split: It partitions the 7,481 training images into 3,682 training and 3,799 validation images [89]. + +Training. Training is done in two phases - warmup and full [12]. We initialize the model with the confidence prediction branch from warmup weights and finetune using the + +Table 2: $\mathrm{AP}_{3\mathrm{D}|R_{40}}$ and $\mathrm{AP}_{\mathrm{BEV}|R_{40}}$ comparisons on the KITTI Test Cars (IoU3D ≥ 0.7). Previous results are quoted from the official leader-board or from papers.[Key: Best, Second Best]. + +
MethodAP3D|R40(↑)APBEV|R40(↑)
EasyModHardEasyModHard
FQNet [49]2.771.511.015.403.232.46
ROI-10D [56]4.322.021.469.784.913.74
GS3D [44]4.472.902.478.416.084.94
MonoGRNet [66]9.615.744.2518.1911.178.73
MonoPSR [39]10.767.255.8518.3312.589.91
MonoDIS [79]10.377.946.4017.2313.1911.12
UR3D [76]15.588.616.0021.8512.519.20
M3D-RPN [10]14.769.717.4221.0213.6710.23
SMOKE [52]14.039.767.8420.8314.4912.75
MonoPair [18]13.049.998.6519.2814.8312.89
RTM3D [46]14.4110.348.7719.1714.2011.99
AM3D [55]16.5010.749.5225.0317.3214.91
MoVi-3D [80]15.1910.909.2622.7617.0310.86
RAR-Net [50]16.3711.019.5222.4515.0212.93
M3D-SSD [54]17.5111.468.9824.1515.9312.11
DA-3Ddet [90]16.7711.508.93---
D4LCN [22]16.6511.729.5122.5116.0212.55
Kinematic (Video) [12]19.0712.729.1726.6917.5213.10
GrooMeD-NMS (Ours)18.1012.329.6526.1918.2714.05
+ +self-balancing loss [12] and Imagewise AP-Loss [14] after our GrooMeD-NMS. See Sec. A3.1 of the supplementary material for more training details. We keep the weight $\lambda$ at 0.05. Unless otherwise stated, we use $p$ as the Linear function (this does not require $\tau$ ) with $\alpha = 100$ . $N_{t}, v$ and $\beta$ are set to 0.4 [10, 12], 0.3 and 0.3 respectively. + +Inference. We multiply the class and predicted confidence to get the box's overall score in inference as in [36, 76, 83]. See Sec. 5.2 for training and inference times. + +Evaluation Metrics. KITTI uses $\mathrm{AP}_{3\mathrm{D}|R_{40}}$ metric to evaluate object detection following [77, 79]. KITTI benchmark evaluates on three object categories: Easy, Moderate and Hard. It assigns each object to a category based on its occlusion, truncation, and height in the image space. The $\mathrm{AP}_{3\mathrm{D}|R_{40}}$ performance on the Moderate category compares different models in the benchmark [25]. We focus primarily on the Car class following [12]. + +# 5.1. KITTI Test 3D Object Detection + +Tab. 2 summarizes the results of 3D object detection and BEV evaluation on KITTI Test Split. The results in Tab. 2 show that GrooMeD-NMS outperforms the baseline M3D-RPN [10] by a significant margin and several other SoTA methods on both the tasks. GrooMeD-NMS also outperforms augmentation based approach MoVi-3D [80] and depth-convolution based D4LCN [22]. Despite being an image-based method, GrooMeD-NMS performs competitively to the video-based method Kinematic (Video) [12], outperforming it on the most-challenging Hard set. + +# 5.2. KITTI Val 1 3D Object Detection + +Results. Tab. 3 summarizes the results of 3D object detection and BEV evaluation on KITTI Val 1 Split at two + +Table 3: ${\mathrm{{AP}}}_{\mathrm{{3D}} \mid {R}_{40}}$ and ${\mathrm{{AP}}}_{\mathrm{{BEV}} \mid {R}_{40}}$ comparisons on KITTI Val 1 Cars. [Key: Best, Second Best]. + +
MethodIoU3D ≥ 0.7IoU3D ≥ 0.5
AP3D|R40(↑)APBEV|R40(↑)AP3D|R40(↑)APBEV|R40(↑)
EasyModHardEasyModHardEasyModHardEasyModHard
MonoDR [5]12.507.344.9819.4911.518.72------
MonoGRNet [66] in [18]11.907.565.7619.7212.8110.1547.5932.2825.5052.1335.9928.72
MonoDIS [79] in [77]11.067.606.3718.4512.5810.66------
M3D-RPN [10] in [12]14.5311.078.6520.8515.6211.8848.5635.9428.5953.3539.6031.77
MoVi-3D [80]14.2811.139.6822.3617.8715.73------
MonoPair [18]16.2812.3010.4224.1218.1715.7655.3842.3937.9961.0647.6341.92
Kinematic (Image) [12]18.2813.5510.1325.7218.8214.4854.7039.3331.2560.8744.3634.48
Kinematic (Video) [12]19.7614.1010.4727.8319.7215.1055.4439.4731.2661.7944.6834.56
GrooMeD-NMS (Ours)19.6714.3211.2727.3819.7515.9255.6241.0732.8961.8344.9836.29
+ +Table 4: $\mathrm{AP}_{3\mathrm{D}|R_{40}}$ and $\mathrm{AP}_{\mathrm{BEV}|\mathcal{R}_{40}}$ comparisons with other NMS on KITTI Val 1 Cars (IoU3D ≥ 0.7). [Key: C= Classical, S= Soft-NMS [8], D= Distance-NMS [76], G=GrooMeD-NMS] + +
MethodInfer NMSAP3D|R40(↑)APBEV|R40(↑)
EasyModHardEasyModHard
Kinematic (Image)C18.2813.5510.1325.7218.8214.48
Kinematic (Image)S18.2913.5510.1325.7118.8114.48
Kinematic (Image)D18.2513.5310.1125.7118.8214.48
Kinematic (Image)G18.2613.5110.1025.6718.7714.44
GrooMeD-NMSC19.6714.3111.2727.3819.7515.93
GrooMeD-NMSS19.6714.3111.2727.3819.7515.93
GrooMeD-NMSD19.6714.3111.2727.3819.7515.93
GrooMeD-NMSG19.6714.3211.2727.3819.7515.92
+ +![](images/4308a466552e73f27354d15d383df682245daa3e178bc89988aa53be7302d9a3.jpg) +(a) Linear Scale +Figure 3: Comparison of $\mathrm{AP}_{\mathrm{3D}}$ at different depths and $\mathrm{IoU}_{\mathrm{3D}}$ matching thresholds on KITTI Val 1 Split. + +![](images/b742017cff2b2768571d37b21c31383efd38ffe35a9cb23a0400e8f663fad28f.jpg) +(b) Log Scale + +$\mathrm{IOU}_{3\mathrm{D}}$ thresholds of 0.7 and 0.5 [12, 18]. The results in Tab. 3 show that GrooMeD-NMS outperforms the baseline of M3D-RPN [10] and Kinematic (Image) [12] by a significant margin. Interestingly, GrooMeD-NMS (an image-based method) also outperforms the video-based method Kinematic (Video) [12] on most of the metrics. Thus, GrooMeD-NMS performs best on 6 out of the 12 cases (3 categories $\times 2$ tasks $\times 2$ thresholds) while second-best on all other cases. The performance is especially impressive since the biggest improvements are shown on the Moderate and Hard set, where objects are more distant and occluded. + +$\mathrm{AP}_{3\mathrm{D}}$ at different depths and $\mathrm{IoU}_{3\mathrm{D}}$ thresholds. We next compare the $\mathrm{AP}_{3\mathrm{D}}$ performance of GrooMeD-NMS and Kinematic (Image) on linear and log scale for objects at different depths of [15, 30, 45, 60] meters and $\mathrm{IoU}_{3\mathrm{D}}$ matching criteria of $0.3 \rightarrow 0.7$ in Fig. 3 as in [12]. Fig. 3 shows that GrooMeD-NMS outperforms the Kinematic (Image) [12] at all depths and all $\mathrm{IoU}_{3\mathrm{D}}$ thresholds. + +Comparisons with other NMs. We compare with the clas- + +![](images/eaa2c97cdb52db801cfa496d4e8b31ef07972386fd957b9fc8c1e7e0097d70f4.jpg) +Figure 4: Score-IoU3D plot after the NMS. + +sical NMS, Soft-NMS [8] and Distance-NMS [76] in Tab. 4. More detailed results are in Tab. 8 of the supplementary material. The results show that NMS inclusion in the training pipeline benefits the performance, unlike [8], which suggests otherwise. Training with GrooMeD-NMS helps because the network gets an additional signal through the GrooMeD-NMS layer whenever the best-localized box corresponding to an object is not selected. Interestingly, Tab. 4 also suggests that replacing GrooMeD-NMS with the classical NMS in inference does not affect the performance. + +Score-IoU3D Plot. We further correlate the scores with IoU3D after NMS of our model with two baselines - M3D-RPN [10] and Kinematic (Image) [12] and also the Kinematic (Video) [12] in Fig. 4. We obtain the best correlation of 0.345 exceeding the correlations of M3D-RPN, Kinematic (Image) and, also Kinematic (Video). This proves that including NMS in the training pipeline is beneficial. + +Training and Inference Times. We now compare the training and inference times of including GrooMeD-NMS in the pipeline. Warmup training phase takes about 13 hours to train on a single 12 GB GeForce GTX Titan-X GPU. Full training phase of Kinematic (Image) and GrooMeD-NMS takes about 8 and 8.5 hours respectively. The inference time per image using classical and GrooMeD-NMS is 0.12 and 0.15 ms respectively. Tab. 4 suggests that changing the NMS from GrooMeD to classical during inference does not alter the performance. Then, the inference time of our method is the same as 0.12 ms. + +# 5.3. KITTI Val 2 3D Object Detection + +Tab. 5 summarizes the results of 3D object detection and BEV evaluation on KITTI Val 2 Split at two $\mathrm{IOU}_{\mathrm{3D}}$ thresh + +Table 5: ${\mathrm{{AP}}}_{\mathrm{{3D}} \mid {R}_{40}}$ and ${\mathrm{{AP}}}_{\mathrm{{BEV}} \mid {R}_{40}}$ comparisons on KITTI Val 2 Cars. [Key: Best, *= Released, †= Retrained]. + +
MethodIoU3D ≥ 0.7IoU3D ≥ 0.5
AP3D|R40(↑)APBEV|R40(↑)AP3D|R40(↑)APBEV|R40(↑)
EasyModHardEasyModHardEasyModHardEasyModHard
M3D-RPN [10]*14.5710.077.5121.3615.2211.2849.1434.4326.3953.4437.7929.36
Kinematic (Image) [12]†13.5410.217.2420.6015.1411.3051.5336.5528.2656.2040.0231.25
GrooMeD-NMS (Ours)14.7210.877.6722.0316.0511.9351.9136.7828.4056.2940.3131.39
+ +Table 6: Ablation studies of our method on KITTI Val 1 Cars. + +
Change from GrooMeD-NMS model:IoU3D ≥ 0.7IoU3D ≥ 0.5
ChangedFrom → ToAP3D|R40(↑)APBEV|R40(↑)AP3D|R40(↑)APBEV|R40(↑)
EasyModHardEasyModHardEasyModHardEasyModHard
TrainingConf+NMS→No Conf+No NMS16.6612.109.4023.1517.4313.4851.4738.5830.9856.4842.5334.37
Conf+NMS→Conf+No NMS19.1613.8910.9627.0119.3314.8457.1241.0732.7961.6044.5835.97
Conf+NMS→No Conf+NMS15.0211.218.8321.0716.2712.7748.0136.1829.9653.8240.9433.35
InitializationNo Warmup15.3311.688.7821.3216.5912.9349.1537.4230.1154.3241.4433.48
Pruning FunctionLinear→Exponential, τ = 112.819.267.1017.0712.179.2529.5820.4215.8832.0622.1617.20
Linear→Exponential, τ = 0.5 [8]18.6313.8510.9827.5220.1415.7656.6441.0132.7961.4344.7336.02
Linear→Exponential, τ = 0.118.3413.7910.8827.2619.7115.9056.9841.1632.9662.7745.2336.56
Linear→Sigmoidal, τ = 0.117.4013.219.8026.7719.2614.7655.1540.7732.6360.5644.2335.74
Group+MaskGroup+Mask→No Group18.4313.9111.0826.5319.4615.8355.9340.9832.7861.0244.7736.09
Group+Mask→Group+No Mask18.9913.7410.2426.7119.2114.7755.2140.6932.5561.7444.6736.00
LossImagewise AP→Vanilla AP18.2313.7310.2826.4219.3114.7654.4740.3532.2060.9044.0835.47
Imagewise AP→BCE16.3412.749.7322.4017.4613.7052.4639.4031.6858.2243.6035.27
Inference NMS ScoresClass*Pred→Class18.2613.3610.4925.3918.6415.1252.4438.9931.357.3742.8934.68
Class*Pred→Pred17.5112.849.5524.5517.8513.6352.7837.4829.3758.3041.2632.66
—GrooMeD-NMS (best model)19.6714.3211.2727.3819.7515.9255.6241.0732.8961.8344.9836.29
+ +olds of 0.7 and 0.5 [12, 18]. Again, we use M3D-RPN [10] and Kinematic (Image) [12] as our baselines. We evaluate the released model of M3D-RPN [10] using the KITTI metric. [12] does not report Val 2 results, so we retrain on Val 2 using their public code. The results in Tab. 5 show that GrooMeD-NMS performs best in all cases. This is again impressive because the improvements are shown on Moderate and Hard set, consistent with Tabs. 2 and 3. + +# 5.4. Ablation Studies + +Tab. 6 compares the modifications of our approach on KITTI Val 1 Cars. Unless stated otherwise, we stick with the experimental settings described in Sec. 5. Using a confidence head (Conf+No NMS) proves beneficial compared to the warmup model (No Conf+No NMS), which is consistent with the observations of [12, 76]. Further, GrooMeD-NMS on classification scores (denoted by No Conf + NMS) is detrimental as the classification scores are not suited for localization [12, 35]. Training the warmup model and then finetuning also works better than training without warmup as in [12] since the warmup phase allows GrooMeD-NMS to carry meaningful grouping of the boxes. + +As described in Sec. 4.1.5, in addition to Linear, we compare two other functions for pruning function $p$ : Exponential and Sigmoidal. Both of them do not perform as well as the Linear $p$ possibly because they have vanishing gradients close to overlap of zero or one. Grouping and masking both help our model to reach a better minimum. As described in Sec. 4.3, Imagewise AP loss is better than the + +Vanilla AP loss since it treats boxes of two images differently. Imagewise AP also performs better than the binary cross-entropy (BCE) loss proposed in [30-32, 65]. Using the product of self-balancing confidence and classification scores instead of using them individually as the scores to the NMS in inference is better, consistent with [36, 76, 83]. Class confidence performs worse since it does not have the localization information while the self-balancing confidence (Pred) gives the localization without considering whether the box belongs to foreground or background. + +# 6. Conclusions + +In this paper, we present and integrate GrooMeD-NMS - a novel Grouped Mathematically Differentiable NMS for monocular 3D object detection, such that the network is trained end-to-end with a loss on the boxes after NMS. We first formulate NMS as a matrix operation and then do unsupervised grouping and masking of the boxes to obtain a simple closed-form expression of the NMS. GrooMeDNMS addresses the mismatch between training and inference pipelines and, therefore, forces the network to select the best 3D box in a differentiable manner. As a result, GrooMeD-NMS achieves state-of-the-art monocular 3D object detection results on the KITTI benchmark dataset. Although our implementation demonstrates monocular 3D object detection, GrooMeD-NMS is fairly generic for other object detection tasks. Future work includes applying this method to tasks such as LiDAR-based 3D object detection and pedestrian detection. + +# References + +[1] The KITTI Vision Benchmark Suite. http://www.cvlabs.net/datasets/kitti/eval_object.php?obj_benchmark=3d. Accessed: 2020-10-11.6 +[2] Hassan Alhaija, Siva Mustikovela, Lars Mescheder, Andreas Geiger, and Carsten Rother. Augmented reality meets computer vision: Efficient data generation for urban driving scenes. IJCV, 2018. 1 +[3] Samaneh Azadi, Jiashi Feng, and Trevor Darrell. Learning detection with diverse proposals. In CVPR, 2017. 2, 5 +[4] Wentao Bao, Bin Xu, and Zhenzhong Chen. MonoFENet: Monocular 3D object detection with feature enhancement networks. IEEE Transactions on Image Processing, 2019. 2 +[5] Deniz Beker, Hiroharu Kato, Mihai Adrian Morariu, Takahiro Ando, Toru Matsuoka, Wadim Kehl, and Adrien Gaidon. Monocular differentiable rendering for self-supervised 3D object detection. In ECCV, 2020. 7 +[6] Quentin Berthet, Mathieu Blondel, Olivier Teboul, Marco Cuturi, Jean-Philippe Vert, and Francis Bach. Learning with differentiable perturbed optimizers. In NeurIPS, 2020. 4 +[7] Mathieu Blondel, Olivier Teboul, Quentin Berthet, and Josip Djolonga. Fast differentiable sorting and ranking. In ICML, 2020. 4 +[8] Navaneeth Bodla, Bharat Singh, Rama Chellappa, and Larry Davis. Soft-NMS-improving object detection with one line of code. In ICCV, 2017. 2, 3, 5, 7, 8, 14 +[9] Navaneeth Bodla, Bharat Singh, Rama Chellappa, and Larry Davis. Soft-NMS implementation. https://github.com/bharatsingh430/soft-nms/blob/master/lib/nms/cpu_nms.pyx#L98, 2017. Accessed: 2021-01-18. 3 +[10] Garrick Brazil and Xiaoming Liu. M3D-RPN: Monocular 3D region proposal network for object detection. In ICCV, 2019. 1, 2, 5, 6, 7, 8, 13, 14 +[11] Garrick Brazil and Xiaoming Liu. Pedestrian detection with autoregressive network phases. In CVPR, 2019. 2 +[12] Garrick Brazil, Gerard Pons-Moll, Xiaoming Liu, and Bernt Schiele. Kinematic 3D object detection in monocular video. In ECCV, 2020. 1, 2, 5, 6, 7, 8, 13, 14, 15, 16 +[13] Garrick Brazil, Xi Yin, and Xiaoming Liu. Illuminating pedestrians via simultaneous detection & segmentation. In ICCV, 2017. 2 +[14] Kean Chen, Weiyao Lin, Jianguo Li, John See, Ji Wang, and Junni Zou. AP-Loss for accurate one-stage object detection. TPAMI, 2020. 6 +[15] Xiaozhi Chen, Kaustav Kundu, Ziyu Zhang, Huimin Ma, Sanja Fidler, and Raquel Urtasun. Monocular 3D object detection for autonomous driving. In CVPR, 2016. 2 +[16] Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Andrew Berneshawi, Huimin Ma, Sanja Fidler, and Raquel Urtasun. 3D object proposals for accurate object class detection. In NeurIPS, 2015. 6 +[17] Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia. Multi-view 3D object detection network for autonomous driving. In CVPR, 2017. 1, 2 + +[18] Yongjian Chen, Lei Tai, Kai Sun, and Mingyang Li. MonoPair: Monocular 3D object detection using pairwise spatial relationships. In CVPR, 2020. 1, 2, 6, 7, 8 +[19] Marco Cuturi, Olivier Teboul, and Jean-Philippe Vert. Differentiable ranks and sorting using optimal transport. In NeurIPS, 2019. 4 +[20] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In CVPR, 2005. 2 +[21] Chaitanya Desai, Deva Ramanan, and Charless Fowlkes. Discriminative models for multi-class object layout. IJCV, 2011. 2, 5 +[22] Mingyu Ding, Yuqi Huo, Hongwei Yi, Zhe Wang, Jianping Shi, Zhiwu Lu, and Ping Luo. Learning depth-guided convolutions for monocular 3D object detection. In CVPR Workshops, 2020. 2, 6 +[23] Sanja Fidler, Sven Dickinson, and Raquel Urtasun. 3D object detection and viewpoint estimation with a deformable 3D cuboid model. In NeurIPS, 2012. 2 +[24] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The KITTI dataset. *IJRR*, 2013. 15 +[25] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the KITTI vision benchmark suite. In CVPR, 2012. 6 +[26] Ross Girshick. Fast R-CNN. In ICCV, 2015. 2 +[27] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. 2 +[28] Gene Golub and Charles Loan. Matrix computations. 2013. 4 +[29] Christopher Harris and Mike Stephens. A combined corner and edge detector. In Alvey vision conference, 1988. 2 +[30] Paul Henderson and Vittorio Ferrari. End-to-end training of object class detectors for mean average precision. In ACCV, 2016. 2, 6, 8 +[31] Jan Hosang, Rodrigo Benenson, and Bernt Schiele. A convnet for non-maximum suppression. In $GCPR$ , 2016. 2, 5, 6, 8 +[32] Jan Hosang, Rodrigo Benenson, and Bernt Schiele. Learning non-maximum suppression. In CVPR, 2017. 2, 5, 6, 8, 15 +[33] Peiyun Hu, Jason Ziglar, David Held, and Deva Ramanan. What you see is what you get: Exploiting visibility for 3D object detection. In CVPR, 2020. 2 +[34] Gao Huang, Zhuang Liu, Laurens Maaten, and Kilian Weinberger. Densely connected convolutional networks. In CVPR, 2017. 6 +[35] Tengteng Huang, Zhe Liu, Xiwu Chen, and Xiang Bai. EP-Net: Enhancing point features with image semantics for 3D object detection. In ECCV, 2020. 1, 2, 8 +[36] Kang Kim and Hee Lee. Probabilistic anchor assignment with iou prediction for object detection. In ECCV, 2020. 6, 8 +[37] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 13 +[38] Emile Krieken, Erman Acar, and Frank Harmelen. Analyzing differentiable fuzzy logic operators. arXiv preprint arXiv:2002.06100, 2020.4, 12 + +[39] Jason Ku, Alex Pon, and Steven Waslander. Monocular 3D object detection leveraging accurate proposals and shape reconstruction. In CVPR, 2019. 6 +[40] Abhinav Kumar, Tim Marks, Wenxuan Mou, Ye Wang, Michael Jones, Anoop Cherian, Toshiaki Koike-Akino, Xiaoming Liu, and Chen Feng. LUVLi face alignment: Estimating landmarks' location, uncertainty, and visibility likelihood. In CVPR, 2020. 2 +[41] Animesh Kumar and Vinod Prabhakaran. Estimation of bandlimited signals from the signs of noisy samples. In ICASSP, 2013. 4, 13 +[42] Donghoon Lee, Geonho Cha, Ming-Hsuan Yang, and Songhwai Oh. Individualness and determinantal point processes for pedestrian detection. In ECCV, 2016. 2, 5 +[43] Sergey Levine, Peter Pastor, Alex Krizhevsky, Julian Ibarz, and Deirdre Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. *IJRR*, 2018. 1 +[44] Buyu Li, Wanli Ouyang, Lu Sheng, Xingyu Zeng, and Xiaogang Wang. GS3D: An efficient 3D object detection framework for autonomous driving. In CVPR, 2019. 1, 6 +[45] Peiliang Li, Xiaozhi Chen, and Shaojie Shen. Stereo R-CNN based 3D object detection for autonomous driving. In CVPR, 2019. 2 +[46] Peixuan Li, Huaici Zhao, Pengfei Liu, and Feidao Cao. RTM3D: Real-time monocular 3D detection from object keypoints for autonomous driving. In ECCV, 2020. 1, 2, 6 +[47] Tao Li and Vivek Srikumar. Augmenting neural networks with first-order logic. In ACL, 2019. 4, 12 +[48] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. TPAMI, 2018. 2 +[49] Lijie Liu, Jiwen Lu, Chunjing Xu, Qi Tian, and Jie Zhou. Deep fitting degree scoring network for monocular 3D object detection. In CVPR, 2019. 2, 6 +[50] Lijie Liu, Chufan Wu, Jiwen Lu, Lingxi Xie, Jie Zhou, and Qi Tian. Reinforced axial refinement network for monocular 3D object detection. In ECCV, 2020. 6 +[51] Songtao Liu, Di Huang, and Yunhong Wang. Adaptive NMS: Refining pedestrian detection in a crowd. In CVPR, 2019. 2, 5 +[52] Zechen Liu, Zizhang Wu, and Roland Toth. SMOKE: Single-stage monocular 3D object detection via keypoint estimation. In CVPR Workshops, 2020. 6 +[53] David Lowe. Distinctive image features from scale-invariant keypoints. IJCV, 2004. 2 +[54] Shujie Luo, Hang Dai, Ling Shao, and Yong Ding. M3DSSD: Monocular 3D single stage object detector. In CVPR, 2021. 6 +[55] Xinzhu Ma, Zhihui Wang, Haojie Li, Pengbo Zhang, Wanli Ouyang, and Xin Fan. Accurate monocular 3D object detection via color-embedded 3D reconstruction for autonomous driving. In ICCV, 2019. 6 +[56] Fabian Manhardt, Wadim Kehl, and Adrien Gaidon. Roi10D: Monocular lifting of 2D detection to 6 pose and metric shape. In CVPR, 2019. 6 + +[57] Krystian Mokolajczyk and Cordelia Schmid. Scale & affine invariant interest point detectors. IJCV, 2004. 2 +[58] Frank Moosmann, Oliver Pink, and Christoph Stiller. Segmentation of 3D LiDAR data in non-flat urban environments using a local convexity criterion. In Intelligent Vehicles Symposium, 2009. 2 +[59] 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 NeurIPS, 2019. 6 +[60] Max Paulus, Dami Choi, Daniel Tarlow, Andreas Krause, and Chris Maddison. Gradient estimation with stochastic softmax tricks. In NeurIPS, 2020. 4, 5 +[61] Nadia Payet and Sinisa Todorovic. From contours to 3D object detection and pose estimation. In ICCV, 2011. 2 +[62] Bojan Pepik, Michael Stark, Peter Gehler, and Bernt Schiele. Multi-view and 3D deformable part models. TPAMI, 2015. 2 +[63] Marin Pogančić, Anselm Paulus, Vit Musil, Georg Martius, and Michal Rolinek. Differentiation of blackbox combinatorial solvers. In ICLR, 2019. 4 +[64] Sebastian Prillo and Julian Eisenschlos. Softsort: A continuous relaxation for the argsort operator. In ICML, 2020. 4 +[65] Sergey Prokudin, Daniel Kappler, Sebastian Nowozin, and Peter Gehler. Learning to filter object detections. In $GCPR$ , 2017. 1, 2, 3, 4, 5, 6, 8, 12 +[66] Zengyi Qin, Jinglu Wang, and Yan Lu. MonoGRNet: A geometric reasoning network for 3D object localization. In AAAI, 2019. 6, 7 +[67] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, 2016. 2 +[68] Konstantinos Rematas, Ira Kemelmacher-Shlizerman, Brian Curless, and Steve Seitz. Soccer on your tabletop. In CVPR, 2018. 1 +[69] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 1, 2 +[70] David Rey, Gérard Subsol, Herve Delingette, and Nicholas Ayache. Automatic detection and segmentation of evolving processes in 3D medical images: Application to multiple sclerosis. Medical Image Analysis, 2002. 1 +[71] 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. 5 +[72] Azriel Rosenfeld and Mark Thurston. Edge and curve detection for visual scene analysis. IEEE Transactions on Computers, 1971. 2 +[73] Sitapa Rujikietgumjorn and Robert Collins. Optimized pedestrian detection for multiple and occluded people. In CVPR, 2013. 2, 5 + +[74] Ashutosh Saxena, Justin Driemeyer, and Andrew Ng. Robotic grasping of novel objects using vision. IJRR, 2008. 1 +[75] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. PointR-CNN: 3D object proposal generation and detection from point cloud. In CVPR, 2019. 2 +[76] Xuepeng Shi, Zhixiang Chen, and Tae-Kyun Kim. Distance-normalized unified representation for monocular 3D object detection. In ECCV, 2020. 1, 2, 5, 6, 7, 8, 14, 15 +[77] Andrea Simonelli, Samuel Bulò, Lorenzo Porzi, Manuel Antequera, and Peter Kontschieder. Disentangling monocular 3D object detection: From single to multi-class recognition. TPAMI, 2020. 1, 2, 6, 7 +[78] Andrea Simonelli, Samuel Bulò, Lorenzo Porzi, Peter Kontschieder, and Elisa Ricci. Demystifying pseudo-LiDAR for monocular 3D object detection. arXiv preprint arXiv:2012.05796, 2020. 14 +[79] Andrea Simonelli, Samuel Bulò, Lorenzo Porzi, Manuel López-Antequera, and Peter Kontschieder. Disentangling monocular 3D object detection. In ICCV, 2019. 2, 6, 7 +[80] Andrea Simonelli, Samuel Bulò, Lorenzo Porzi, Elisa Ricci, and Peter Kontschieder. Towards generalization across depth for monocular 3D object detection. In ECCV, 2020. 2, 6, 7 +[81] Samik Some, Mithun Das Gupta, and Vinay Namboodiri. Determinantal point process as an alternative to NMS. In BMVC, 2020. 2, 5 +[82] Yunlei Tang, Sebastian Dorn, and Chiragkumar Savani. Center3D: Center-based monocular 3D object detection with joint depth understanding. arXiv preprint arXiv:2005.13423, 2020. 2 +[83] Lachlan Tychsen-Smith and Lars Petersson. Improving object localization with fitness NMS and bounded IoU loss. In CVPR, 2018. 6, 8 +[84] Alexandru Vasile and Richard Marino. Pose-independent automatic target detection and recognition using 3D laser radar imagery. Lincoln laboratory journal, 2005. 2 +[85] Paul Viola and Michael Jones. Rapid object detection using a boosted cascade of simple features. In CVPR, 2001. 2 +[86] Li Wan, David Eigen, and Rob Fergus. End-to-end integration of a convolution network, deformable parts model and non-maximum suppression. In CVPR, 2015. 2, 5 +[87] Yan Wang, Wei-Lun Chao, Divyansh Garg, Bharath Hariharan, Mark Campbell, and Kilian Weinberger. Pseudo-LiDAR from visual depth estimation: Bridging the gap in 3D object detection for autonomous driving. In CVPR, 2019. 2 +[88] Pengxiang Wu, Siheng Chen, and Dimitris Metaxas. MotionNet: Joint perception and motion prediction for autonomous driving based on bird's eye view maps. In CVPR, 2020. 2 +[89] Yu Xiang, Wongun Choi, Yuanqing Lin, and Silvio Savarese. Subcategory-aware convolutional neural networks for object proposals and detection. In WACV, 2017. 6 +[90] Xiaoqing Ye, Liang Du, Yifeng Shi, Yingying Li, Xiao Tan, Jianfeng Feng, Errui Ding, and Shilei Wen. Monocular 3D object detection via feature domain adaptation. In ECCV, 2020.6 +[91] Jianming Zhang, Stan Sclaroff, Zhe Lin, Xiaohui Shen, Brian Price, and Radomir Mech. Unconstrained salient ob + +ject detection via proposal subset optimization. In CVPR, 2016, 2, 5 \ No newline at end of file diff --git a/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/images.zip b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f3b9f54f41bf0d4304aaed358005ddf193ceeb46 --- /dev/null +++ b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0855eb8fc9116938cb1c59b3fba82f8e4a381eabe4c4e38949655dd5878fc700 +size 712582 diff --git a/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/layout.json b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..86ebb084717e5fab9965e400a740e63e4ba46210 --- /dev/null +++ b/groomednmsgroupedmathematicallydifferentiablenmsformonocular3dobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14948cdb3f7dfc0601ca5d547ee25908858d92c93340f8563250b914a01ce772 +size 607478 diff --git a/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_content_list.json b/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e084ba9aa0b03df57715b0040dcc6cd352e17aef --- /dev/null +++ b/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35881f4232c05a8e4d672b5d9f05d4340d01b62756ca86bc90c0bdf2bfbca5b2 +size 80544 diff --git a/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_model.json b/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2438f2ee71fa4a3604bac263727dca9cb73f6b2e --- /dev/null +++ b/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c332c2f938e3b88820de28948ad3c1693f53d09bed7c95136a87f4043a30fec2 +size 102104 diff --git a/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_origin.pdf b/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b45720dda507ba309001e1dd66b4a208b99e2cc3 --- /dev/null +++ b/groupawarelabeltransferfordomainadaptivepersonreidentification/8dbc79f4-6765-4cc4-981a-0ab1b32087d1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a99feb9b89e74876f45a315320eed1db029ede96fe02823663f0ecd18a60b9e +size 661135 diff --git a/groupawarelabeltransferfordomainadaptivepersonreidentification/full.md b/groupawarelabeltransferfordomainadaptivepersonreidentification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8a7dbd8f0be886cdfd9dc8ac42c26b889bb00420 --- /dev/null +++ b/groupawarelabeltransferfordomainadaptivepersonreidentification/full.md @@ -0,0 +1,311 @@ +# Group-aware Label Transfer for Domain Adaptive Person Re-identification + +Kecheng Zheng $^{1*}$ , Wu Liu $^{2*}$ , Lingxiao He $^{2}$ , Tao Mei $^{2}$ , Jiebo Luo $^{3}$ , Zheng-Jun Zha $^{1\dagger}$ + +1University of Science and Technology of China, 2AI Research of JD, 3University of Rochester zkcys001@mail.ustc.edu.cn, {liuwu1,helingxiao3,tmei} @jd.com, jluo@cs.ROchester.edu, zhazj@ustc.edu.cn + +# Abstract + +Unsupervised Domain Adaptive (UDA) person re-identification (ReID) aims at adapting the model trained on a labeled source-domain dataset to a target-domain dataset without any further annotations. Most successful UDA-ReID approaches combine clustering-based pseudo-label prediction with representation learning and perform the two steps in an alternating fashion. However, offline interaction between these two steps may allow noisy pseudo labels to substantially hinder the capability of the model. In this paper, we propose a Group-aware Label Transfer (GLT) algorithm, which enables the online interaction and mutual promotion of pseudo-label prediction and representation learning. Specifically, a label transfer algorithm simultaneously uses pseudo labels to train the data while refining the pseudo labels as an online clustering algorithm. It treats the online label refinery problem as an optimal transport problem, which explores the minimum cost for assigning $M$ samples to $N$ pseudo labels. More importantly, we introduce a group-aware strategy to assign implicit attribute group IDs to samples. The combination of the online label refining algorithm and the group-aware strategy can better correct the noisy pseudo label in an online fashion and narrow down the search space of the target identity. The effectiveness of the proposed GLT is demonstrated by the experimental results (Rank-1 accuracy) for Market1501→DukeMTMC (82.0%) and DukeMTMC→Market1501 (92.2%), remarkably closing the gap between unsupervised and supervised performance on person re-identification. + +# 1. Introduction + +Person re-identification (ReID) [27, 50, 19] is the important task of matching person images captured from nonoverlapping camera networks, which is widely used in prac + +![](images/d1dae6adf9ca260a765c753154a4673146b4b563f26e652b4165e10b2a321602.jpg) +Figure 1. Illustration of conventional methods and our group-aware label transfer method. In our method, each instance is assigned to multiple prototypes with different granularity for generating multi-group pseudo labels, and then the noisy multi-group pseudo labels are online refined. With guidance of refined multi-group pseudo labels, our method can learn an embedding space that encodes the semantic multi-granularity structure of data. + +![](images/a5c18d3936be35d43a537e6ba0034a3cbd75b638fe8ae0fda4bf2e92534dfc69.jpg) + +tical applications such as automatic surveillance, content-based retrieval, and behavior analysis [7, 23, 52, 48, 44, 24, 30, 12, 28, 17, 29]. It has been proved that existing approaches can achieve remarkable performance when the training and testing data are collected from the same application scenario but often fail to generalize well to other scenarios due to the inevitable domain gaps. Therefore, it is necessary for both academia and industry to study the Unsupervised Domain Adaptive (UDA) person re-identification problem. + +Existing UDA ReID approaches [14, 26, 35, 45, 55] typically include three steps: feature pre-training with labeled source domain data, clustering-based pseudo-label prediction for the target domain data, and feature representation learning/fine-tuning with the pseudo-labels. The last two steps are usually iteratively conducted to strengthen or promote each other. However, the first problem is that the pseudo-labels assigned through clustering usually contain + +incorrect labels due to the divergence/domain gap between the source and target data, and the imperfect nature of the clustering algorithm. Such noisy labels may mislead the feature learning and harm the domain adaptation performance. Although the label refining objective in clustering is tractable, it is an offline time-consuming scheme as it requires a pass over the entire dataset. Therefore, online refining those incorrect samples when training can help model learn more robust and accurate representation. + +Another problem is that the target domain lacks ID information, so it is difficult to cluster the person images according to human identity. However, in the real world, each person has their own characteristics in his or her appearance. There may be common appearances shared by a group of people but they are not the same identity (e.g. two men with the same red coats and similar black pants as shown in Fig. 1). Therefore, group-based description [21] that involves common characteristics in a pseudo group, can be useful to narrow down the set of candidates and beneficial to identify the exact persons [47, 3, 2]. This group-aware strategy can cluster a person into multi-group clustering prototypes, and is able to efficiently embed a significant number of people and briefly describe an unknown person. Inspired by this, as shown in Fig. 1, combining the online label refining algorithm with the group-aware strategy may be beneficial to the success of domain adaptation. + +In this paper, we propose a Group-aware Label Transfer (GLT) algorithm that facilitates the online interaction and mutual promotion of the pseudo labels prediction and feature learning. Specifically, our method simultaneously uses pseudo labels to train the data while online refining the pseudo labels via the label transfer algorithm. This label transfer algorithm regards the resulting label refining problem as optimal transport, which explores the minimum cost for assigning M samples to N pseudo labels. This problem can therefore be solved by the Sinkhorn-Knopp algorithm [6] of linear programming in polynomial time. Meanwhile, the label transfer algorithm is scalable, which can be trained with several batches or the whole dataset and can scale to unlimited amounts of data. More importantly, we introduce a group-aware strategy to assign implicit attribute group IDs to samples. Explicit grouping requires manual annotation. Therefore, we adopt a group-aware clustering algorithm to generate multi-group pseudo labels. By adopting the concept of grouping, the ReID network can reduce the search space and flexibly embed a significant number of identities into an embedding feature. As shown in Fig. 1, we combine the online label refining algorithm with the multi-group pseudo labels. The combination of the online label refining algorithm and the group-aware strategy can better correct the noisy pseudo label online and narrow down the search space of the target identity and predict more accurate pseudo labels. In addition, we design a target instance mem + +ory bank combined with weighted contrastive loss [36] to make the model more powerful for features representation. The proposed GLT framework achieves state-of-the-art performance on Market-to-Duke, Duke-to-Market, Market-to-MSMT, and Duke-to-MSMT with unsupervised domain adaptation, and in particular the i.e. Duke-to-Market performances (92.2 Rank-1 and 79.5 mAP) are almost comparable with the supervised learning performances (94.1 Rank-1 and 85.7 mAP). Our method significantly closes gap between unsupervised and supervised performance on person re-identification, i.e., 92.2 vs. 94.1 top-1 accuracy in DukeMTMC to Market1501 transfer. + +The main contributions of this paper can be summarized in four aspects: + +- We make the first attempt towards integrating clustering and feature learning in a unified framework through the label transfer method for UDA-ReID. It can online refine the predicted pseudo labels to improve the feature representation ability of the model on the target domain. +- We propose a group-aware feature learning strategy based on label transfer to refine multi-group pseudo labels, which provides good latent pseudo-label groups for improving the quality of representation learning. +- The GLT framework achieves significant performance improvements compared to state-of-the-art approaches on Market $\rightarrow$ Duke, Duke $\rightarrow$ Market, Market $\rightarrow$ MSMT, Duke $\rightarrow$ MSMT ReID tasks. Even for the supervised learning methods, our algorithm is remarkably closing the gap. + +# 2. Related Work + +Clustering-based Methods in general generate hard or soft pseudo labels based on clustering results and then fine-tune/train the models based on the pseudo labels [11, 51, 42, 14, 43, 55, 13, 20, 4, 8, 49], which are widely used due to their superior performance. PUL [11] iteratively obtains the hard clustering labels and trains the model in a self-training manner. SSG [42] exploits the potential similarity of the global and local body parts, respectively, to build multiple independent clusters. PAST [51] develop a self-training method with progressive augmentation framework to promote the model performance progressively. + +Pseudo label noises caused by unsupervised clustering are always an obstacle to UDA Re-ID. Such noisy labels would mislead the feature learning and impede the achievement of high performance. Recently, some methods introduce mutual learning among two or three collaborative networks to mutually exploit the refined soft pseudo labels of the peer networks as supervision [14, 46]. To suppress the noises in the pseudo labels, NRMT [53] maintains two + +![](images/aeb009194fc520c599ec8763dc6432861b3a0b66416d016cea2c92963bf66f22.jpg) +Figure 2. Illustration of our group-aware label transfer framework (GLT), where the group-aware label transfer module and the ReID model are alternately optimized to improve each other towards the final objective of accurate person re-ID. In the model pre-training stage, we pre-train the network on source domain labeled data. Then, in the group-aware clustering stage, we perform clustering algorithm on the unlabeled target data using the multi-group strategy and assign multi-group pseudo labels based on the clustering results. In the label online refining stage, the label transfer algorithm treats the resulting label refining problem as an optimal transport problem, and refine the multi-group pseudo labels by Sinkhorn-Knopp algorithm [6] of linear programming. In the joint fine-tuning stage, we use the refined multi-group pseudo labels to train the networks. Stage 3 and Stage 4 are performed alternatively in the online scheme. + +networks during training to perform collaborative clustering and mutual instance selection, which reduces the fitting to noisy instances by using mutual supervision and the reliable instance selection. These approaches need mutual learning of two or more networks and are somewhat complicated. Besides, the selection of reliable instances in NRMT [53] is a hard selection, which requires a careful determination of threshold parameters and may lose the chance of exploiting useful information of the abandoned samples. + +Domain translation based methods [9, 40] consider to translate target images by the source images. Then they use these translated source-to-target images and their corresponding ground-truth identities to fine-tune the target-domain model. PTGAN [40] utilizes the color consistency to impose pixel-level constraints during the domain translation. SPGAN [9] further minimizes the feature-level similarities between translated images and the original ones. This kind of approach does not apply to real-world scenarios, because the GAN-based method is hardly used to train and may introduce extra computing cost. + +Memory bank based methods have been widely used for unsupervised representation learning which facilitates the introduction of contrastive loss [15] for the general tasks. He et al. [15] leverage the memory bank to better train the model to exploit the similarity between a sample and the + +instances in the global memory bank. Wang et al. [39] propose using the memory bank to facilitate hard negative instance mining across batches. ECN [55] leverages memory bank to enforce exemplar-invariance, camera-invariance, and neighborhood-invariance over global training data (instead of the local batch) for UDA person ReID. We introduce contrastive loss to the target instance memory bank to enable the joint optimization of positive pairs and negative pairs for a query/anchor sample over all the samples in the memory bank, which serves as our strong baseline. + +# 3. Group-aware Label Transfer + +We first introduce the overall architecture, then derive our group-aware label transfer framework and finally introduce the memory bank with weighted contrastive loss. + +# 3.1. Clustering-based Method Revisit + +**Formulation.** Unsupervised domain adaptive person re-identification aims at adapting the model trained on a source domain dataset with annotations to another unlabeled target domain dataset. Formally, given the source domain data $\mathbb{D}_s = \left\{(\pmb{x}_i^s,\pmb{y}_i^s)|_{i=1}^{N_s}\right\}$ with the manual annotation, we can access target domain images $\mathbb{D}_t = \left\{\pmb{x}_i|_{i=1}^{N_t}\right\}$ without any + +ground-truth labels. $N_{s}$ and $N_{t}$ denote the number of the labeled source data and the unlabeled target data, respectively. + +Overview. Deep-cluster framework is the general pipeline due to the conciseness and effectiveness of this framework. To be specific, a ReID model $F(\cdot|\theta)$ firstly is pre-trained via a supervised task on source domain images, where $\theta$ denotes the parameters of network. Then we adopt this well-pretrained model to extract the features of target domain images which denote as $\{f_i = F(x_i|\theta)\}_{i=1}^{N_t} \in \mathbb{R}^D$ . After that, the target domain images are grouped into $K$ classes by clustering algorithm. Let $\{\tilde{y}_i\}_{i}^{N_t} \in \{1,\dots,K\}$ denote the pseudo labels generated by target domain images $\{x_i\}_{i}^{N_t}$ , which contain the noisy label due to the imperfect nature of clustering algorithm. + +To calculate a identification loss, a classification head $FC_{k}:\mathbb{R}^{D}\to \mathbb{R}^{K}$ is adopted to convert the embedding feature to a score vector, in the form of $p(\tilde{y}_i|\boldsymbol {x}_i) =$ softmax $(FC(F(\boldsymbol {x}_i|\boldsymbol {\theta}))$ . The network parameters $\theta$ and a learnable target-domain classifier $FC_{k}$ are then optimized with respect to a cross-entropy loss $\mathcal{L}_{id}(\pmb {\theta})$ and a triplet loss $\mathcal{L}_{tri}(\pmb {\theta})$ in the form of, + +$$ +\mathcal {L} _ {i d} (\boldsymbol {\theta}) = - \frac {1}{m _ {t}} \sum_ {i = 1} ^ {m _ {t}} \log p \left(\tilde {y} _ {i} \mid \boldsymbol {x} _ {i}\right), \tag {1} +$$ + +$$ +\mathcal {L} _ {t r i} (\boldsymbol {\theta}) = \frac {1}{m _ {t}} \sum_ {i = 1} ^ {m _ {t}} \max \left(0, s _ {i} ^ {n} - s _ {i} ^ {p} + m\right), +$$ + +where $m_t$ is the mini-batch size of target data, $s_i^p$ denotes the hardest positive cosine similarity, $s_i^n$ denotes the hardest negative cosine similarity, scripts $i, p$ and $j, n$ indicate the indices of hardest positive and negative feature in each mini-batch for the sample $x_i$ , and $m = 0$ denotes the triplet distance margin. + +Such two steps, pseudo label generation by clustering and feature learning with pseudo labels, are alternated until the training converges. However, because of the domain gap, the pseudo-labels are not always reliable and there are noisy labels. This would mislead the feature representation learning towards learning noisy information. So, we need to adopt an online clustering strategy to refine those samples with wrong pseudo labels. As illustrated in Fig. 2, the framework is alternated to gradually train the ReID model on the target domain with the guidance of pseudo labels. + +# 3.2. Online Clustering by Group-aware Label Transfer + +Each image $\pmb{x}_i$ is transformed into $\pmb{f}_i$ by a ReID model. We then compute a group probability $\pmb{p}_i$ from this feature by mapping $\pmb{f}_i$ to a set of $K$ trainable prototype vectors, + +$C = \{c_{1}, c_{2}, \ldots, c_{K}\}$ . We denote the matrix by $C$ whose columns are the $\{c_{1}, c_{2}, \ldots, c_{K}\}$ . Then, the pseudo labels $Q \in [0, 1]^{K \times N}$ are adopted to supervise the group probability $P$ , and we use Label Transfer to online update the pseudo labels as training goes on. We now first introduce how to update the prototypes online. + +Prototype Prediction Problem. Our prototypes can be implemented by a non-parametric prototypical classifier or a parametric linear classifier. The optimization can be viewed to optimize the cluster-assignment probability through the cross-entropy loss, where the prototypes $C$ represent the trainable weights for a linear classifier. With K-means clustering, the linear classifier has a fixed set of weights as the mean vectors for the representations in each cluster. + +The prototypes are learned by the non-parametric or a parametric way noted above. Here, we will introduce the prototype prediction problem. Firstly, we rewrite the cross-entropy loss of eq. (1) by encoding the labels as posterior distributions $q(\tilde{y}_i|\boldsymbol{x}_i) \in \mathbf{Q}$ , which is generated by clustering algorithm: + +$$ +\mathcal {L} _ {g} (p, q; \boldsymbol {\theta}) = - \frac {1}{N} \sum_ {N} q (\tilde {y} _ {i} | \boldsymbol {x} _ {i}) \log p (\tilde {y} _ {i} | \boldsymbol {x} _ {i}), \tag {2} +$$ + +$$ +\text {w h e r e} p \left(\tilde {y} _ {i} \mid \boldsymbol {x} _ {i}\right) = \frac {\exp \left(\frac {1}{\tau} \boldsymbol {f} _ {i} \boldsymbol {c} _ {k}\right)}{\sum_ {k ^ {\prime}} \exp \left(\frac {1}{\tau} \boldsymbol {f} _ {i} \boldsymbol {c} _ {k ^ {\prime}}\right)}, +$$ + +where $\tau$ is a temperature parameter. If we set the posterior distributions $q(\tilde{y}_i|\boldsymbol{x}_i) = \delta (\tilde{y}_i - y_i)$ to be deterministic, this eq. (2) is similar to the general cross-entropy loss. We can use a non-parametric prototypical classifier performs or a parametric linear classifier to update the prototypes. This loss function is jointly minimized respect to the prototypes $C$ and the image encoder parameters $\theta$ . + +Online Refining Pseudo Labels via Label Transfer. On the Clustering-based UDA methods, inevitable noisy labels caused by the clustering procedure bring a negative effect on network training. To address this issue, we propose a label transfer method to correct the noisy pseudo labels in an online training scheme by combining the representation learning and clustering algorithm. The general pipeline alternately tackles the optimization of $\mathbf{q}$ and representational learning $\mathbf{p}$ . However, separate optimizations cannot well generate accurate pseudo labels in representational learning because of restraining the interaction of these two steps. In order to make our method online, we try to utilize the prototypes and group probability to refine noisy pseudo labels. We compute refinery pseudo labels using the prototypes $C$ such that all the examples in a batch are equally partitioned by the prototypes. This equipartition constraint ensures that the refinery pseudo labels for different images in several + +batches or a whole dataset are distinct, which preventing the trivial solution where every image has the same pseudo label: + +$$ +\begin{array}{l} \min _ {p, q} \mathcal {L} _ {g} (p, q; \boldsymbol {\theta}) \forall \tilde {y} _ {i}: q (\tilde {y} _ {i} | \boldsymbol {x} _ {i}) \in \{0, 1 \} \\ \sum_ {i = 1} ^ {N} q \left(\tilde {y} _ {i} = k \mid \boldsymbol {x} _ {i}\right) = \frac {N}{k}, \tag {3} \\ \end{array} +$$ + +where each sample $x_{i}$ is assigned to exactly one label and the $N$ data points are split among the $K$ classes for alleviating a trivial solution. Inspired by [1], they enforce an equal partition by constraining the matrix $Q$ to belong to the transportable prototype. We also propose to adapt their solution to work onthe whole dataset by restricting the transportable prototype. + +The objective in eq. (3) is combinatorial in $q$ and thus is very difficult to optimize by an end-to-end manner. However, the optimal transport algorithm [6] is able to solve this issue. Let $P_{\tilde{y}_i,i} = p(\tilde{y}_i|\boldsymbol{x}_i)\frac{1}{N}$ be the $(i,\tilde{y}_i)$ element of $K\times N$ matrix as the joint probabilities estimated by the model, which represents the group probability that the $i$ -th sample is predicted to become the $\tilde{y}_i$ -th pseudo-label. Similarly, $Q_{y_i,i} = q(\tilde{y}_i|\boldsymbol{x}_i)\frac{1}{N}$ is $K\times N$ matrix as the pseudo label matrix. Using the notation of [6], we relax matrix $Q$ to be an element of the transportable prototype: + +$$ +\begin{array}{l} H (\boldsymbol {w}, \boldsymbol {c}) := \left\{\boldsymbol {Q} \in \mathbb {R} _ {+} ^ {K \times N} | \boldsymbol {Q} \cdot \boldsymbol {1} = \boldsymbol {w}, \boldsymbol {Q} ^ {\top} \cdot \boldsymbol {1} = \boldsymbol {c} \right\}, \\ \boldsymbol {c} = \frac {1}{N} \cdot \mathbf {1}, \boldsymbol {w} = \frac {1}{N} \cdot \mathbf {1}, \tag {4} \\ \end{array} +$$ + +where $\mathbf{1}$ are vectors of all ones of the appropriate dimensions, so that $c$ and $w$ are the marginal projections of matrix $Q$ onto its rows and columns, respectively. In our case, we require $Q$ to be a matrix of conditional probability distributions that is similar to the number distribution of source domain. + +In practice, the computational complexity is enormous, including millions of data points and thousands of classes. Traditional algorithms for solving this problem are difficult to be applied. Thus, we adopt the Sinkhorn-Knopp algorithm [6] to address this issue. This amounts to introducing a regularization term: + +$$ +\min _ {\boldsymbol {Q} \in H (\boldsymbol {w}, \boldsymbol {c})} \left\langle \boldsymbol {Q}, - \log \boldsymbol {P} \right\rangle + \frac {1}{\lambda} \mathrm {H} (\boldsymbol {Q}), \tag {5} +$$ + +where $\langle .\rangle$ is the Frobenius dot-product between two matrices, $\pmb{R}$ denotes to the number distribution of source domain, $\langle Q, -\log P\rangle = -\frac{1}{N}\sum_{i=1}^{N}\sum_{\tilde{y}_i=1}^{K}q(\tilde{y}_i|\pmb{x}_i)\log p(\tilde{y}_i|\pmb{x}_i)$ , log is applied element-wise, $\mathrm{H}$ is the entropy function, $\mathrm{H}(Q) = -\sum_{q\in Q}q\log q$ and $\lambda$ is a parameter that controls the smoothness of the mapping. We find that using a low $\lambda$ can have a strong entropy regularization, which generally leads to a trivial solution where all samples collapse into an + +# Algorithm 1 Group-aware Label Transfer + +Require: Source domain data $\mathbb{D}_s = \left\{(\pmb{x}_i^s,\pmb{y}_i^s)|_{i = 1}^{N_s}\right\}$ , target domain images $\mathbb{D}_t = \left\{\pmb{x}_i|_{i = 1}^{N_t}\right\}$ , multi-group $k$ values $\{k_1,\dots ,k_M\}$ ; +1: Pre-training source-domain encoder $F(\cdot |\pmb{\theta})$ by minimizing Eq. (1) on $\mathbb{D}_s$ ; +2: Generating multi-group pseudo labels $\{\pmb{Q}_{k_m}\} |_{m = 1}^M$ by clustering the target domain features $\{F(\pmb{x}_i|\pmb{\theta})\} |_{i = 1}^{N_t}$ +3: for $i$ in [1, iterations] do +4: Updating parameters $\theta$ by the gradient descent of objective function equation (11) under the guidance of multi-group pseudo labels $\{Q_{k_m}\}_{m = 1}^M$ ; +5: for $k_{m}$ in $\{k_1,\dots ,k_M\}$ do +6: Extracting the multi-group probability matrix $P_{k_m}$ of target images $\mathbb{D}_t$ by the current model $F(\cdot|\theta)$ ; +7: while $||\alpha_{j - 1} - \alpha_j||_1 < 0.1$ do +8: $\pmb{\alpha}_{j}\gets \left[\pmb{P}_{k_{m}}^{\lambda}\beta_{j - 1}\right]^{-1},\pmb{\beta}_{j}\gets \left[\pmb{\alpha}_{j - 1}^{\top}\pmb{P}_{k_{m}}^{\lambda}\right]^{-1};$ +9: end while +10: $Q_{k_m}^{\lambda} = \operatorname{diag}(\alpha)P_{k_m}^{\lambda}\operatorname{diag}(\beta)$ # Refining noisy multi-group pseudo labels; +11: end for +Refining the multi-group pseudo labels $Q_{km} = Q_{km}'$ ; +12: end for + +unique representation and are all assigned uniformly to all prototypes. Hence, in practice we keep a high $\lambda$ . According to the Sinkhorn-Knopp algorithm [1], this minimizer of regularization term of eq. (5) can be written as: + +$$ +\boldsymbol {Q} = \operatorname {d i a g} (\alpha) \boldsymbol {P} ^ {\lambda} \operatorname {d i a g} (\beta) = \operatorname {d i a g} (\alpha) \left(\boldsymbol {C} ^ {T} \boldsymbol {F}\right) ^ {\lambda} \operatorname {d i a g} (\beta), \tag {6} +$$ + +where $\pmb{F} = [f_{1},\dots ,f_{N}]$ denotes to the feature vectors of images, $\pmb{C} = [c_{1},\dots ,c_{K}]$ denotes to the prototypes of pseudo labels, $\alpha$ and $\beta$ are two renormalization vectors of scaling coefficients, the resulting matrix $Q$ is also a probability matrix that represents the refining pseudo labels (see [6] for a derivation). By the iterative Sinkhorn-Knopp algorithm [1], the vectors $\alpha$ and $\beta$ can be obtained via a simple matrix scaling iteration: + +$$ +\forall y: \alpha_ {y} \leftarrow \left[ \boldsymbol {P} ^ {\lambda} \beta \right] _ {y} ^ {- 1} \quad \forall i: \beta_ {i} \leftarrow \left[ \alpha^ {\top} \boldsymbol {P} ^ {\lambda} \right] _ {i} ^ {- 1}, \tag {7} +$$ + +where $\alpha_0 = c$ and $\beta_0 = w$ . When $\lambda$ is very large, optimizing eq. (7) is mostly equivalent to optimizing eq. (6). However, even for intermediate values of lambda, the results still tend to approximate the optimal solution [6]. In the original optimal transport problem, $\lambda$ adjust the balance between the convergence speed and optimum approximation. In our case, we only regard the $\lambda$ as the hype-parameter, because we are more interested in obtaining a better performance in the final clustering and representation learning results, rather than solving the optimal transport problem. + +After using a group probability matrix $P$ to update the pseudo label matrix $Q$ , we use the current $Q$ as the pseudo label to train the ReID model for optimizing the group probability $P$ . Such two steps, pseudo label prediction and feature learning with pseudo labels are alternated until the training converges. + +Group-aware Label Transfer. The actual identification number $k$ of the target domain is unknown, and it is hard to use the one value of $k$ to generate accurate pseudo labels. Therefore, group-based description [21] that involves common characteristics in the pseudo groups, can be useful to narrow down the set of candidates, which is beneficial to identify the exact unlabeled persons. This group-aware strategy can cluster a person into multi-group clustering prototypes, which is able to efficiently embed a significant number of people and briefly describe an unknown person. Then, we introduce the group-aware strategy to assign implicit attribute group IDs to samples. + +In our formulation, we firstly adopt the multi-k setting $\{k_{1},\ldots ,k_{M}\}$ to generate the multi-group pseudo label via multi-k K-means. Then, we use them to train the ReID model: + +$$ +\mathcal {L} _ {G} = - \frac {1}{N} \sum_ {m = 1} ^ {M} \sum_ {N} q _ {k _ {m}} (\tilde {y} _ {i} | \boldsymbol {x} _ {i}) \log p _ {k _ {m}} (\tilde {y} _ {i} | \boldsymbol {x} _ {i}), \tag {8} +$$ + +Based on the multi-group pseudo labels, the group-aware label transfer module adopts the multi-group optimization strategy to refine these pseudo labels. The different groups of pseudo labels have different classification heads, while sharing the parameters of feature extractor $\theta$ among them. In formulation, we optimize the multi-group objective functions of the eq. (9). + +$$ +\sum_ {m = 1} ^ {M} \min _ {\boldsymbol {Q} _ {k _ {m}} \in H _ {k _ {m}}} \left(\left\langle \boldsymbol {Q} _ {k _ {m}}, - \log \boldsymbol {P} _ {k _ {m}} \right\rangle + \frac {1}{\lambda} \mathrm {H} (\boldsymbol {Q} _ {k _ {m}})\right), +$$ + +$$ +\begin{array}{l} H _ {k _ {m}} := \left\{\boldsymbol {Q} _ {k _ {m}} \in \mathbb {R} _ {+} ^ {K _ {m} \times N} | \boldsymbol {Q} _ {k _ {m}} \cdot \boldsymbol {1} = \boldsymbol {r}, \boldsymbol {Q} _ {k _ {m}} ^ {\top} \cdot \boldsymbol {1} = \boldsymbol {c} \right\}, \tag {9} \\ \boldsymbol {c} = \frac {1}{N} \cdot \mathbf {1}, \boldsymbol {r} = \frac {1}{N} \cdot \mathbf {1}, \\ \end{array} +$$ + +where $\{P_{k_m} = C_{k_m}^T\cdot F\}_{m = 1}^M$ denotes to the multi-group probability and $\{C_{k_m}\}_{m = 1}^M$ denotes to the multi-group prototypes. Each update involves $M$ matrix-vector multiplication with complexity $\mathcal{O}(MNK)$ , so it is relatively quick. + +# 3.3. Target Instance Memory Bank + +We first describe our target instance memory bank module, with an updating mechanism. Then we show that a weighting scheme focusing on informative pairs is beneficial for contrastive loss with multiple positive samples. + +Updating mechanism. We adopt the memory bank [16] to remember the previous feature embeddings. We maintain the memory bank as a queue of data samples while minibatches of samples arrive. This allows us to reuse feature embeddings from the immediately preceding mini-batch. The size of our memory banks can be much larger than the typical mini-batch size and can be set flexibly and independently to hyperparameters. The samples in the memory bank are progressively replaced. In addition, the current + +mini-batch are enqueued into the dictionary and the oldest mini-batch in the queue are removed. The dictionary always represents a sampled subset of all data, and the extra computation to maintain this dictionary is manageable. In conjunction with this, it is beneficial to remove the oldest mini-batch as it has the most outdated features and is therefore the most inconsistent with the latest key. + +Weighted contrastive loss. We use the cosine distance to calculate the similarity $s$ of features between mini-batch and memory bank. Moreover, given a query/anchor sample, we split the samples to $L$ negative pairs and $K$ positive pairs according to the pseudo labels, where weighted contrastive loss [36] is suitable for this issue. Thus, weighted contrastive loss is proposed to better calculate the loss in terms of multiple positive samples, which is beneficial for the optimization of model: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathcal {W C L}} = \log [ 1 + \sum_ {j = 1} ^ {L} \exp \left(\gamma \alpha_ {j} ^ {n} \left(s _ {j} ^ {n} - m\right)\right) \tag {10} \\ \sum_ {i = 1} ^ {P} \exp \left(- \gamma \alpha_ {k} ^ {p} \left(s _ {k} ^ {p} - 1 + m)\right) \right], \\ \end{array} +$$ + +where $\alpha_{j}^{n} = [m + s_{j}^{n}]_{+}$ and $\alpha_{k}^{p} = [1 + m - s_{k}^{p}]_{+}$ are nonnegative weighting factors respectively, $[\cdot ]_{+}$ is the "cut-off at zero" operation, $m$ refers to a margin in order to better separate similarity, $\gamma$ is a scale factor, and $L$ and $P$ denote the number of negative pairs and positive pairs in the memory bank for the sample $x_{i}$ of mini-batch. + +We integrate the losses mentioned above. The total loss could be formulated as: + +$$ +\mathcal {L} _ {\text {t a r g e t}} = \lambda_ {t r i} \mathcal {L} _ {T R I} + \lambda_ {g} \mathcal {L} _ {G} + \lambda_ {w c l} \mathcal {L} _ {W C L}. \tag {11} +$$ + +where $\lambda_{tri}$ , $\lambda_g$ , and $\lambda_{wcl}$ are weighting factors. + +# 4. Experiments + +# 4.1. Datasets + +We mainly evaluate our method on three person ReID datasets, including DukeMTMC-reID [34], Market-1501 [54] and MSMT17 [40]. DukeMTMC-reID [34] consists of 36,411 images which include 702 identities for training and 702 identities for testing, where all images are captured from 8 cameras. Market-1501 [54] contains 12,936 images of 751 identities for training and 19,281 images of 750 identities for testing, which are captured by 6 cameras. MSMT [40] contains 126,441 images of 4101 identities, of which 1041 identities are used for training, and these images are captured by 15 cameras. We adopt Mean average precision (mAP) and CMC top-1/5/10 accuracy as evaluation. + +Table 1. Performance comparison to the unsupervised domain adaptive person Re-ID state-of-the-art methods on DukeMTMC-reID [34], Market-1501 [54] and MSMT17 [40] datasets. "BOT" denotes to "bag of tricks" method [31], which is a strong baseline in the ReID task. + +
MethodsDukeMTMC→Market1501Market1501→DukeMTMC
mAPtop-1top-5top-10mAPtop-1top-5top-10
UMDL [32] (CVPR'16)12.434.552.659.67.318.531.437.6
PTGAN [40] (CVPR'18)-38.6-66.1-27.4-50.7
PUL [11] (TOMM'18)20.545.560.766.716.430.043.448.5
TJ-AIDL [38] (CVPR'18)26.558.274.881.123.044.359.665.0
SPGAN [9] (CVPR'18)22.851.570.176.822.341.156.663.0
ATNet [26](CVPR'19)25.655.773.279.424.945.159.564.2
SPGAN+LMP [10](CVPR'18)26.757.775.882.426.246.462.368.0
CFSM [5] (AAAI'19)28.361.2--27.349.8--
BUC [25] (AAAI'19)38.366.279.684.527.547.462.668.4
ECN [55] (CVPR'19)43.075.187.691.640.463.375.880.4
UCDA [33] (ICCV'19)30.960.4--31.047.7--
PDA-Net [22] (ICCV'19)47.675.286.390.245.163.277.082.5
PCB-PAST [51] (ICCV'19)54.678.4--54.372.4--
SSG [42] (ICCV'19)58.380.090.092.453.473.080.683.2
ACT [41] (AAAI'20)60.680.5--54.572.4--
MPLP+MMCL [37] (CVPR'20)60.484.492.895.051.472.482.985.0
DAAM [18] (AAAI'20)48.871.382.486.353.177.889.993.7
AD-Cluster [45] (CVPR'20)68.386.794.496.554.172.682.585.5
MMT [14] (ICLR'20)71.287.794.996.965.178.088.892.5
NRMT [53](ECCV'20)71.787.894.696.562.277.886.989.5
B-SNR+GDS-H [20](ECCV'20)72.589.3--59.776.7--
MEB-Net [46](ECCV'20)76.089.996.097.566.179.688.392.2
Source Pretrain33.965.379.284.035.253.367.773.1
Our GLT79.592.296.597.869.282.090.292.8
Supervised learning (BOT [31])85.794.1--75.886.2--
MethodsMarke1501→MSMT17DukeMTMC→MSMT17
mAPtop-1top-5top-10mAPtop-1top-5top-10
PTGAN [40] (CVPR'18)2.910.2-24.43.311.8-27.4
ENC [55] (CVPR'19)8.525.336.342.110.230.241.546.8
SSG [42] (ICCV'19)13.231.6-49.613.332.2-51.2
DAAM [18] (AAAI'20)20.844.5--21.646.7--
MMT [14] (ICLR'20)22.949.263.168.823.350.163.969.8
Source Pretrain7.319.829.434.511.231.542.347.7
Our GLT26.556.667.572.027.759.570.174.2
Supervised learning (BOT [31])48.372.3--48.372.3--
+ +# 4.2. Implementation Details + +Training data organization. For our joint training strategy, each mini-batch contains 64 source-domain images of 4 ground-truth identities (16 for each identity) and 64 target-domain images of 4 pseudo identities. The pseudo identities are assigned by the clustering algorithm. All images are resized to $256 \times 128$ , and random perturbations are applied to each image, e.g. randomly erasing, cropping and flipping. + +Hyper-parameters. We tune the hyper-parameters of the proposed framework on the task of Market $\rightarrow$ Duke, and the chosen hyper-parameters are directly applied to all the other tasks. ADAM optimizer is adopted to optimize the networks with weighting factors $\lambda_{tri} = 1$ , $\lambda_g = 1$ , $\lambda_{mcl} = 0.05$ and the triplet margin $m = 0.3$ . The initial learning rates $(lr)$ are set to 0.00035. The source-domain pre-training iterates for 30 epochs and the learning rate decreases to 1/10 of its previous value every 10 epochs. We use the K-means to initialize the pseudo label, and we utilize the group-aware + +label transfer to refine the pseudo label per epoch. We set $k = \{500, 1000, 1500, 2000\}$ for all datasets in the K-means setting. + +# 4.3. Comparison with the State-of-the-art Methods + +We compare our proposed GLT with the state-of-the-art methods on four domain adaptation settings in Tab. 1, i.e. Duke $\rightarrow$ Market, Market $\rightarrow$ Duke, Market $\rightarrow$ MSMT, and Duke $\rightarrow$ MSMT. Specifically, we surpass the clustering-based SSG [42] by considerable margins of $21.2\%$ , $15.8\%$ , $13.3\%$ , and $14.4\%$ improvements in terms of mAP on these four tasks with simpler network architectures and no extra computation of local features. DAAM [18] also adopts the clustering-based pipeline with the guidance of attention mechanism and our method shows a noticeable $30.7\%$ , $15.1\%$ , $5.7\%$ and $6.1\%$ improvements in terms of mAP on these four tasks without the help of attention mechanism. Meanwhile, our GLT adopts the one model to + +significantly surpass the two-model methods MMT [14] that uses the same backbone, showing a noticeable $8.3\%$ , $4.1\%$ , $3.6\%$ and $4.4\%$ improvements in terms of mAP. Our GLT significantly outperforms the second best UDA method MEB-Net by $3.5\%$ and $3.1\%$ in mAP accuracy, for Duke $\rightarrow$ Market, Market $\rightarrow$ Duke, respectively. Moreover, without any manual annotations, our unsupervised domain adaptive method significantly bridges the gap between unsupervised and supervised performance on person re-identification, i.e., $92.2\%$ vs. $94.1\%$ top-1 accuracy in Duke $\rightarrow$ Market task [31]. + +# 4.4. Ablation Studies + +In this section, we evaluate each component of our proposed framework by conducting ablation studies on Duke $\rightarrow$ Market and Market $\rightarrow$ Duke tasks. The experimental results are shown in Tab. 2. + +Effectiveness of proposed components. We conduct extensive ablation studies to investigate the effectiveness of the proposed components in Tab. 2, i.e., label transfer, group-aware label transfer, and target instance memory bank. When introducing the label transfer algorithm, the performance is improved by $7.8\%$ rank-1 accuracy and $6.9\%$ mAP on Duke $\rightarrow$ Market task. By sensibly adopting memory bank with weighted contrastive loss, better representation learning enables the model to increase the rank-1 accuracy from $88.1\%$ to $89.0\%$ and mAP from $66.4\%$ to $68.2\%$ , respectively. By taking account of the group-aware label transfer, the performance is improved by $11.3\%$ rank-1 accuracy and $3.0\%$ mAP, which indicates that the group-aware label transfer can provide good latent pseudo-label groups for improving the quality of representation learning. In addition, group-aware strategy without the guidance of label transfer brings a little improvement due to the lack of label transfer for pseudo label refinery. This illustrates the importance of group-aware label transfer module, not just group-aware strategy. These experimental results prove the necessity and effectiveness of our group-aware label transfer for correcting noise pseudo labels. + +Effectiveness of loss functions. We validate the effectiveness of multi-group ID loss, weighted contrastive loss and triplet loss in our proposed GLT framework. Triplet loss brings $3.2\%$ and $2.1\%$ improvements in terms of mAP, and weighted contrastive loss brings $2.6\%$ and $2.8\%$ improvements in terms of mAP in the Market $\rightarrow$ Duke and Duke $\rightarrow$ Market tasks, respectively. Triplet loss utilizes the hardest information within a mini-batch of instance pairs in each iteration. Meanwhile, Weighted contrastive loss in the memory bank mines the global negative and positive instances among the samples of whole dataset. The both losses can help each other. + +Table 2. Ablation studies for our proposed framework on individual components. TMB: target instance memory bank. G: baseline with the multi-group pseudo labels. LT: label transfer. GLT: group-aware label transfer. + +
MethodsDuke→Market
mAPtop-1top-5top-10
Supervised learning85.794.1--
Source Pretrain38.565.779.284.0
Baseline59.580.390.493.0
Baseline + G63.084.791.493.7
Self-labeling [1]40.966.680.686.3
Baseline + TMB62.482.191.894.9
Baseline + LT66.488.194.496.2
Baseline + TMB + LT68.289.094.596.1
Baseline + G + TMB65.284.394.896.7
Baseline + G + GLT78.791.496.797.4
Baseline + G + TMB + GLT79.592.296.597.8
+ +Table 3. Evaluation of the effectiveness of triplet loss and weighted contrastive loss, "w/o WCL" denotes to using the weighted contrastive loss [16]. + +
Loss FunctionsDuke→MarketMarket→Duke
mAPtop-1mAPtop-1
GLT w/o TRI loss77.390.967.181.2
GLT w/o WCL loss77.990.866.480.7
GLT79.592.269.282.0
+ +# 5. Conclusion + +To solve the problem of UDA person ReID, we propose a novel framework, the group-aware label transfer method (GLT), to combine the accurate pseudo-label prediction and effective ReID representation learning in one unified optimization objective. The holistic and immediate interaction between these two steps in the training process can greatly help the UDA person ReID task. To achieve this goal, we consider the online label refinement problem as an optimal transport problem, which explores the minimal cost of assigning M samples to N pseudo labels. More importantly, we introduce a group-aware strategy to assign implicit attribute group IDs to samples. The combination of the online label refining algorithm and the group-aware strategy can better correct the noisy pseudo label in an online fashion and narrow down the search space of the target identity. Our method not only achieves state-of-the-art performance but also significantly closes the gap between supervised and unsupervised performance on person re-identification. + +# 6. Acknowledgement + +This work was supported by the National Key R&D Program of China under Grand No. 2020AAA0103800 and National Natural Science Foundation of China (NSFC) under Grants U19B2038. + +# References + +[1] Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. In ICLR, 2020. 5, 8 +[2] Junjie Cai, Zheng-Jun Zha, Meng Wang, Shiliang Zhang, and Qi Tian. An attribute-assisted reranking model for web image search. TIP, 24(1):261-272, 2014. 2 +[3] Junjie Cai, Zheng-Jun Zha, Wengang Zhou, and Qi Tian. Attribute-assisted reranking for web image retrieval. In ACM MM, pages 873-876, 2012. 2 +[4] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. 2 +[5] Xiaobin Chang, Yongxin Yang, Tao Xiang, and Timothy M Hospedales. Disjoint label space transfer learning with common factorised space. In AAAI, 2019. 7 +[6] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NeurIPS, pages 2292-2300, 2013. 2, 3, 5 +[7] Yongxing Dai, Xiaotong Li, Jun Liu, Zekun Tong, and Ling-Yu Duan. Generalizable person re-identification with relevance-aware mixture of experts. In CVPR, 2021. 1 +[8] Yongxing Dai, Jun Liu, Yan Bai, Zekun Tong, and Ling-Yu Duan. Dual-refinement: Joint label and feature refinement for unsupervised domain adaptive person re-identification. arXiv preprint arXiv:2012.13689, 2020. 2 +[9] Weijian Deng, Liang Zheng, Qixiang Ye, Guoliang Kang, Yi Yang, and Jianbin Jiao. Image-image domain adaptation with preserved self-similarity and domain-dissimilarity for person re-identification. In CVPR, pages 994–1003, 2018. 3, 7 +[10] Weijian Deng, Liang Zheng, Qixiang Ye, Guoliang Kang, Yi Yang, and Jianbin Jiao. Image-image domain adaptation with preserved self-similarity and domain-dissimilarity for person re-identification. In CVPR, 2018. 7 +[11] Hehe Fan, Liang Zheng, Chenggang Yan, and Yi Yang. Unsupervised person re-identification: Clustering and finetuning. TOMM, 14(4):1-18, 2018. 2, 7 +[12] Chuang Gan, Naiyan Wang, Yi Yang, Dit-Yan Yeung, and Alex G Hauptmann. Devnet: A deep event network for multimedia event detection and evidence recounting. In CVPR, pages 2568-2577, 2015. 1 +[13] Chuang Gan, Ting Yao, Kuiyuan Yang, Yi Yang, and Tao Mei. You lead, we exceed: Labor-free video concept learning by jointly exploiting web videos and images. In CVPR, pages 923-932, 2016. 2 +[14] Yixiao Ge, Dapeng Chen, and Hongsheng Li. Mutual meanteaching: Pseudo label refinery for unsupervised domain adaptation on person re-identification. In ICLR, 2020. 1, 2, 7, 8 +[15] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, pages 9729-9738, 2020. 3 + +[16] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 6, 8 +[17] 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 ICCV, pages 8450–8459, 2019. 1 +[18] Yangru Huang, Peixi Peng, Yidong Li Yi Jin, Junliang Xing, and Shiming Ge. Domain adaptive attention model for unsupervised cross-domain person re-identification. In AAAI, 2020. 7 +[19] Yukun Huang, Zheng-Jun Zha, Xueyang Fu, and Wei Zhang. Illumination-invariant person re-identification. In ACM MM, pages 365–373, 2019. 1 +[20] Xin Jin, Cuiling Lan, Wenjun Zeng, and Zhibo Chen. Global distance-distributions separation for unsupervised person re-identification. In ECCV, 2020. 2, 7 +[21] Yonghyun Kim, Wonpyo Park, Myung-Cheol Roh, and Jongju Shin. Groupface: Learning latent groups and constructing group-based representations for face recognition. In CVPR, pages 5621-5630, 2020. 2, 6 +[22] Yu-Jhe Li, Ci-Siang Lin, Yan-Bo Lin, and Yu-Chiang Frank Wang. Cross-dataset person re-identification via unsupervised pose disentanglement and adaptation. In ICCV, 2019. 7 +[23] Shengcai Liao, Yang Hu, Xiangyu Zhu, and Stan Z Li. Person re-identification by local maximal occurrence representation and metric learning. In CVPR, pages 2197–2206, 2015. 1 +[24] Ji Lin, Chuang Gan, Kuan Wang, and Song Han. Tsm: Temporal shift module for efficient and scalable video understanding on edge devices. TPAMI, 2020. 1 +[25] Yutian Lin, Xuanyi Dong, Liang Zheng, Yan Yan, and Yi Yang. A bottom-up clustering approach to unsupervised person re-identification. In AAAI, 2019. 7 +[26] Jiawei Liu, Zheng-Jun Zha, Di Chen, Richang Hong, and Meng Wang. Adaptive transfer network for cross-domain person re-identification. In CVPR, pages 7202–7211, 2019. 1, 7 +[27] Jiawei Liu, Zheng-Jun Zha, Xuejin Chen, Zilei Wang, and Yongdong Zhang. Dense 3d-convolutional neural network for person re-identification in videos. TOMM, 15(1s):1-19, 2019. 1 +[28] Wu Liu, Cheng Zhang, Huadong Ma, and Shuangqun Li. Learning efficient spatial-temporal gait features with deep learning for human identification. Neuroinformatics, 16(3):457-471, 2018. 1 +[29] Xinchen Liu, Wu Liu, Meng Zhang, Jingwen Chen, Lianli Gao, Chenggang Yan, and Tao Mei. Social relation recognition from videos via multi-scale spatial-temporal reasoning. In CVPR, pages 3566-3574, 2019. 1 +[30] Xiang Long, Gerard De Melo, Dongliang He, Fu Li, Zhizhen Chi, Shilei Wen, and Chuang Gan. Purely attention based local feature integration for video classification. TPAMI, 2020. 1 + +[31] H. Luo, W. Jiang, Y. Gu, F. Liu, X. Liao, S. Lai, and J. Gu. A strong baseline and batch normalization neck for deep person re-identification. TMM, pages 1–1, 2019. 7, 8 +[32] Peixi Peng, Tao Xiang, Yaowei Wang, Massimiliano Pontil, and Yonghong Tian. Unsupervised cross-dataset transfer learning for person re-identification. In CVPR, 2016. 7 +[33] Lei Qi, Lei Wang, Jing Huo, Luping Zhou, Yinghuan Shi, and Yang Gao. A novel unsupervised camera-aware domain adaptation framework for person re-identification. In ICCV, 2019. 7 +[34] Ergys Ristani, Francesco Solera, Roger Zou, Rita Cucchiara, and Carlo Tomasi. Performance measures and a data set for multi-target, multi-camera tracking. In ECCVW, pages 17-35, 2016. 6, 7 +[35] Liangchen Song, Cheng Wang, Lefei Zhang, Bo Du, Qian Zhang, Chang Huang, and Xinggang Wang. Unsupervised domain adaptive re-identification: Theory and practice. arXiv preprint arXiv:1807.11334, 2018. 1 +[36] Yifan Sun, Changmao Cheng, Yuhan Zhang, Chi Zhang, Liang Zheng, Zhongdao Wang, and Yichen Wei. Circle loss: A unified perspective of pair similarity optimization. In CVPR, 2020. 2, 6 +[37] Dongkai Wang and Shiliang Zhang. Unsupervised person re-identification via multi-label classification. In CVPR, 2020. 7 +[38] Jingya Wang, Xiatian Zhu, Shaogang Gong, and Wei Li. Transferable joint attribute-identity deep learning for unsupervised person re-identification. In CVPR, pages 2275–2284, 2018. 7 +[39] Xun Wang, Haozhi Zhang, Weilin Huang, and Matthew R Scott. Cross-batch memory for embedding learning. In CVPR, pages 6388-6397, 2020. 3 +[40] Longhui Wei, Shiliang Zhang, Wen Gao, and Qi Tian. Person transfer gan to bridge domain gap for person re-identification. In CVPR, pages 79–88, 2018. 3, 6, 7 +[41] Fengxiang Yang, Ke Li, Zhun Zhong, Zhiming Luo, Xing Sun, Hao Cheng, Xiaowei Guo, Feiyue Huang, Rongrong Ji, and Shaozi Li. Asymmetric co-teaching for unsupervised cross domain person re-identification. In AAAI, 2019. 7 +[42] Fu Yang, Wei Yunchao, Wang Guanshuo, Zhou Yuqian, Shi Honghui, and Huang Thomas. Self-similarity grouping: A simple unsupervised cross domain adaptation approach for person re-identification. In ICCV, 2019. 2, 7 +[43] Hong-Xing Yu, Wei-Shi Zheng, Ancong Wu, Xiaowei Guo, Shaogang Gong, and Jian-Huang Lai. Unsupervised person re-identification by soft multilabel learning. In CVPR, 2019. 2 +[44] Zheng-Jun Zha, Jiawei Liu, Di Chen, and Feng Wu. Adversarial attribute-text embedding for person search with natural language query. TMM, 22(7):1836-1846, 2020. 1 +[45] Yunpeng Zhai, Shijian Lu, Qixiang Ye, Xuebo Shan, Jie Chen, Rongrong Ji, and Yonghong Tian. Ad-cluster: Augmented discriminative clustering for domain adaptive person re-identification. In CVPR, 2020. 1, 7 + +[46] Yunpeng Zhai, Qixiang Ye, Shijian Lu, Mengxi Jia, Rongrong Ji, and Yonghong Tian. Multiple expert brainstorming for domain adaptive person re-identification. In ECCV, 2020. 2, 7 +[47] Hanwang Zhang, Zheng-Jun Zha, Shuicheng Yan, Jingwen Bian, and Tat-Seng Chua. Attribute feedback. In ACM MM, pages 79-88, 2012. 2 +[48] Jing Zhang and Dacheng Tao. Empowering things with intelligence: A survey of the progress, challenges, and opportunities in artificial intelligence of things. IEEE Internet of Things Journal, 2020. 1 +[49] Qiming Zhang, Jing Zhang, Wei Liu, and Dacheng Tao. Category anchor-guided unsupervised domain adaptation for semantic segmentation. In NeurIPS, pages 433-443, 2019. 2 +[50] Wei Zhang, Shengnan Hu, Kan Liu, and Zhengjun Zha. Learning compact appearance representation for video-based person re-identification. TCVT, 29(8):2442-2452, 2018. 1 +[51] Xinyu Zhang, Jiewei Cao, Chunhua Shen, and Mingyu You. Self-training with progressive augmentation for unsupervised cross-domain person re-identification. In ICCV, 2019. 2, 7 +[52] Yiheng Zhang, Dong Liu, and Zheng-Jun Zha. Improving triplet-wise training of convolutional neural network for vehicle re-identification. In ICME, pages 1386–1391, 2017. 1 +[53] Fang Zhao, Shengcai Liao, Guo-Sen Xie, Jian Zhao, Kai-hao Zhang, and Ling Shao. Unsupervised domain adaptation with noise resistible mutual-training for person re-identification. In ECCV, 2020. 2, 3, 7 +[54] Liang Zheng, Liyue Shen, Lu Tian, Shengjin Wang, Jingdong Wang, and Qi Tian. Scalable person re-identification: A benchmark. In ICCV, pages 1116–1124, 2015. 6, 7 +[55] Zhun Zhong, Liang Zheng, Zhiming Luo, Shaozi Li, and Yi Yang. Invariance matters: Exemplar memory for domain adaptive person re-identification. In CVPR, 2019. 1, 2, 3, 7 \ No newline at end of file diff --git a/groupawarelabeltransferfordomainadaptivepersonreidentification/images.zip b/groupawarelabeltransferfordomainadaptivepersonreidentification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e50446c7123bc319a7cc35f33f142cf1afc8833d --- /dev/null +++ b/groupawarelabeltransferfordomainadaptivepersonreidentification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fcb700f400c67664cb2df1d816a8214974bddccdbb344197d4ed9482f2e7bf4 +size 480683 diff --git a/groupawarelabeltransferfordomainadaptivepersonreidentification/layout.json b/groupawarelabeltransferfordomainadaptivepersonreidentification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..568e9016a51bb8297dea9cf8ba74eb2f1e999ede --- /dev/null +++ b/groupawarelabeltransferfordomainadaptivepersonreidentification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:186c5551c3b258545ee8039156221a26f5ee8e27c5710e668daaf91d180f507e +size 469224 diff --git a/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_content_list.json b/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5acf9e32642034fa6d5ba9d5af9789dc5edbc357 --- /dev/null +++ b/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4778d100363415a9575250d434a18690429044f79f4b193f7b0c3fc991e12ac0 +size 85840 diff --git a/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_model.json b/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c892fc381acf538bd010f0610b63b9373f67335b --- /dev/null +++ b/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c24c716360c11da52e08fd2d366f8bc0cb68a5d7caa2a36484440a2cf910a7c +size 110204 diff --git a/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_origin.pdf b/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a984892c64e05efaf858eb561850e06f39459d6b --- /dev/null +++ b/groupcollaborativelearningforcosalientobjectdetection/e7088b43-9d2a-4c5b-99a3-0694fa37c723_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:119c08204238036fd505c5496334dfdf6052f31c2aef864c9a944bc179879ad6 +size 3140507 diff --git a/groupcollaborativelearningforcosalientobjectdetection/full.md b/groupcollaborativelearningforcosalientobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0129d62d7af35f9cd7cf9cfab6facc624b7ee2e1 --- /dev/null +++ b/groupcollaborativelearningforcosalientobjectdetection/full.md @@ -0,0 +1,360 @@ +# Group Collaborative Learning for Co-Salient Object Detection + +Qi Fan $^{1,3,*}$ Deng-Ping Fan $^{2,\dagger}$ Huazhu Fu $^{2}$ Chi-Keung Tang $^{1}$ Ling Shao $^{2}$ Yu-Wing Tai $^{1,3}$ $^{1}$ HKUST $^{2}$ Inception Institute of Artificial Intelligence + +fanqics@gmail.com, dengpfan@gmail.com, hzfu@ieee.org, cktang@cs.ust.hk, ling.shao@inceptionai.org, yuwing@gmail.com + +# Abstract + +We present a novel group collaborative learning framework (GCoNet) capable of detecting co-salient objects in real time (16ms), by simultaneously mining consensus representations at group level based on the two necessary criteria: 1) intra-group compactness to better formulate the consistency among co-salient objects by capturing their inherent shared attributes using our novel group affinity module; 2) inter-group separability to effectively suppress the influence of noisy objects on the output by introducing our new group collaborating module conditioning the inconsistent consensus. To learn a better embedding space without extra computational overhead, we explicitly employ auxiliary classification supervision. Extensive experiments on three challenging benchmarks, i.e., CoCA, CoSOD3k, and Cosal2015, demonstrate that our simple GCoNet outperforms 10 cutting-edge models and achieves the new state-of-the-art. We demonstrate this paper's new technical contributions on a number of important downstream computer vision applications including content aware co-segmentation, co-localization based automatic thumbnails, etc. Code has been made publicly available: https://github.com/fanq15/GCoNet. + +# 1. Introduction + +Co-salient object detection (CoSOD) targets at detecting common salient objects sharing the same attributes given a group of relevant images. CoSOD is more challenging than the standard salient object detection (SOD) task [1, 2, 3] and RGB-D SOD [4, 5, 6, 7], because CoSOD needs to distinguish co-occurring objects across multiple images [8] in presence of other objects. That is, both intra-class compactness and inter-class separability should be simultaneously maximized. With this favorable feature CoSOD is thus often employed as a pre-processing + +![](images/334e4247eaf6c50afb4c756599cd8ee84eb6b02b364ceaa71a78b97d71f7e5f9.jpg) +Figure 1. t-SNE [18] visualization of consensuses, where each point represents one consensus of an image group. Highlighted here are two similar but different groups (guitar & violin) to illustrate the effectiveness of GCoNet. The consensus strategy in traditional CoSOD model (CoEGNet [8]) tends to cluster consensuses together even they belong to different groups, resulting in ambiguous co-saliency detection. In contrast, our consensus strategy with effective inter-group constraint enables higher diversity with a very large group variance ( $d_2 \gg d_1$ ) and thus better inter-group separability. + +step for various computer vision tasks, such as image retrieval [9], image quality assessment [10], collection-based crops [11], co-segmentation [12, 13], semantic segmentation [14], image surveillance [15], video analysis [16], video co-localization [17], etc. + +Previous works attempt to leverage the consistency among relevant images to facilitate CoSOD within an image group by exploring different shared cues [19, 20, 21] or semantic connections [22, 23, 24]. Some of them [25, 26] use predicted saliency maps by computing various inter-image cues to discover co-salient objects. Other works [8, 27] exploit a unified network to jointly optimize co-saliency information and saliency maps. + +Despite their promising results, most current models only extract their CoSOD representations in an individual group, which introduces a number of limitations. First, images from the same group contain similar foregrounds (i.e., co-salient objects) only provide positive relations while lacking the negative relations between different objects. Training the model only using positive pairs may lead to overfitting and result in ambiguous results for outlier images. Moreover, the number of images in a group is typically limited (20 to 40 images for most CoSOD datasets), so using a single group cannot provide enough information for learning a discriminative representation. Finally, individual groups also fall short in offering high-level semantic information, which is necessary for distinguishing noisy objects during inference in complex real-world scenarios. + +To address the above issues, we propose a novel group collaborative learning framework (GCoNet) to mine the semantic correlation between different image groups. The proposed GCoNet consists of three important components: group affinity module (GAM), group collaborating module (GCM) and auxiliary classification module (ACM), which simultaneously learn the intra-group compactness and inter-group separability. The GAM makes the network learn the consensus feature within the same image group, while the GCM discriminates target attributes between different groups, thus enabling the model to be trained on the existing large-scale SOD datasets. We further improve the feature representation at a global semantic level through our ACM on each image to learn a better embedding space. In summary, our contributions are: + +- We introduce a novel group collaborative learning strategy to address the CoSOD problem, and validate its effectiveness with extensive ablation studies. +- We design a novel unified Group Collaborative Learning Network (GCoNet) for CoSOD by simultaneously considering intra-group compactness and inter-group separability to mine the consensus representation. +- Our group affinity module (GAM) and group collaborating module (GCM) collaborate with each other to achieve better intra- and inter-group collaborative learning. The auxiliary classification module (ACM) further promotes learning at a global semantic level. +- Extensive experiments on three challenging CoSOD benchmarks, i.e., CoCA, CoSOD3k, and Cosal2015, show that our GCoNet achieves the new state-of-the-art. Furthermore, we present two downstream applications based on our technical contributions, i.e., cosegmentation and co-localization. + +# 2. Related Work + +The traditional salient object detection task [28, 29, 30, 31, 32] targets at directly segmenting salient object in each image separately, while CoSOD aims to segment the common salient objects across several relevant images. Previous works mainly exploit inter-image cues to detect co-salient objects. Early CoSOD methods explore the inter-image correspondence between image-pairs [19, 33] or a group of relevant images [34] based on shallow handcrafted descriptors [17, 35]. They employ different approaches to mine the inter-image relationships using constraints or heuristic characteristics. Several studies attempt to capture the inter-image constraints by employing an efficient manifold ranking scheme [36] to obtain guided saliency maps, or using a global association constraint with clustering [20], or translational alignment [11]. Other works attempt to formulate the semantic attributes shared among images in a group from the high-level features in the heuristic characteristics, using multiple saliency cues and self-adaptive weights [21], regional histograms and constrasts [37], metric learning by optimizing a new objective function [23], or pairwise similarity ranking and linear programming [38]. + +Recently deep-based models simultaneously explore the intra- and inter-image consistency in a supervised manner with different approaches, such as graph convolution networks (GCN) [39, 40, 41], self-learning methods [22, 42], inter-image co-attention with PCA projection [8] or recurrent units [43], correlation techniques [44], quality measurement [45], or co-clustering [46]. Some methods exploit multi-task learning to simultaneously optimize the co-saliency detection and co-segmentation [47] or co-peak search [13]. Other works explore hierarchical features from multi-scale [48], multi-stage [49], or multi-layer [50] features. Another notable research line is to explore groupwise semantic representation (consensus) which is used to detect co-salient regions for each image. There are different methods to capture the discriminative semantic representation, such as group attentional semantic aggregation [51], gradient feedback [27], co-category association [52], united fully convolutional network [53, 54], or integrated multilayer graph [55]. Methods are proposed to solve the CoSOD problem in a semi-supervised [56] or unsupervised manner [24, 57, 58, 59], and studies [60, 61] are availalbe on co-saliency detection from a single image. + +Previous works have focused on intra-group (intra- and inter-image) cues for capturing common attributes of cosalient objects. The inter-group information has received less attention, although CODW [62] focuses on visually similar neighbor. Recently Zhang et al. [27] utilized a jigsaw training to implicitly exploit other images to facilitate group training. But their model still targets intra-group learning. Our method differs from existing models in the exploration of inter-group relations for discriminating fea + +![](images/2aa4910d9fc066d1cf875f977b05ce04b204d23305fe550025314e6dbae4fbe3.jpg) +Figure 2. Pipeline of the proposed Group Collaborative Learning Network (GCoNet). Images in two groups are first processed by a weight-shared encoder. Then we employ the group affinity module (GAM, see Figure 3 for more details) to conduct intra-group collaborative learning for each group to generate a consensus, which is collaborated with the original feature maps to segment co-salient objects using the decoder. In addition, the original feature maps and consensuses of both groups are fed to the group collaborating module (GCM, see Figure 4) to conduct the inter-group collaborative learning. Moreover an auxiliary classification module (ACM) is applied to obtain the high-level semantic representation. The GCM and ACM are only used for training and are removed at inference. + +ture learning at a group level explicitly and semantically. + +# 3. Group Collaborative Learning Network + +# 3.1. Architecture Overview + +Given a group of $N$ relevant images $\{I_1, I_2, \dots, I_n\}$ containing common salient objects of a certain class, CoSOD aims to detect them simultaneously and output the cossaliency maps. Unlike existing CoSOD methods which only depend on the information within the image group, we propose a novel group collaborative learning network (GCoNet) to mine the consensus representations at both intra- and inter-group level. + +Figure 2 illustrates the flowchart of our GCoNet. First, an encoder network is used to extract feature maps $\mathcal{F}_1 = \{F_{1,n}\}_{n=1}^N$ , $\mathcal{F}_2 = \{F_{2,n}\}_{n=1}^N \in \mathbb{R}^{N \times C \times H \times W}$ for two image groups, where $C$ is the channel number and $H \times W$ is the spatial size. Then, a group affinity module (GAM) is used to combine all single-image features to distill the consensus feature $E_1^a, E_2^a \in \mathbb{R}^{1 \times C \times 1 \times 1}$ ( $C = 512$ in our experiments) from $\mathcal{F}_1, \mathcal{F}_2$ , representing the common attributes of the co-salient objects for each group. Simultaneously, a group collaborating module (GCM) is applied to enhance the image representation for discriminating the target attributes between different image groups. Finally, we further improve the high-level semantic representation of images using an auxiliary classification module (ACM) to learn a better embedding space. The resulting collaborative features are then fed to a decoder network to produce the co-saliency maps $\mathcal{M}_1, \mathcal{M}_2$ . + +# 3.2. Group Affinity Module + +Intuitively, common objects from the same class always share some similarity in appearance and have high similarity in features, which have been widely employed in many tasks. Inspired by self-supervised video tracking methods [63, 64, 65, 66], which propagate the segmentation masks of target objects based on the pixel-wise correspondences between two adjacent frames, we extend this idea to the CoSOD task by computing the global affinity among all images in a group. + +For any two image features $\{F_{1,n}, F_{1,m}\} \in \mathcal{F}_1^2$ and without losing generality we drop the group subscript, we can use the inner product to compute their pixel-wise correlations: + +$$ +S _ {(n, m)} = \theta \left(F _ {n}\right) ^ {T} \phi \left(F _ {m}\right), \tag {1} +$$ + +where $\theta, \phi$ are linear embedding functions $(3 \times 3 \times 512$ convolutional layer). The affinity map $S_{(n,m)} \in \mathbb{R}^{HW \times HW}$ efficiently captures the commonality of co-salient objects in the image pair $(n,m)$ . Then we can generate $F_{n}$ 's affinity map $A_{n \leftarrow m} \in \mathbb{R}^{HW \times 1}$ by finding the maxima for each of $F_{n}$ 's pixel conditioned on $F_{m}$ which alleviates the influence of noisy correlation values in the map. + +Similarly, we can extend the local affinity of two images to the global affinity of all images in the group. Specifically, we compute the affinity map $S_{\mathcal{F}} \in \mathbb{R}^{NHW \times NHW}$ between all image features $\mathcal{F}$ using Eq. 1. Then, we find the maxima for each image $A_{\mathcal{F}}' \in \mathbb{R}^{NHW \times N}$ from $S_{\mathcal{F}}$ , and average all the maxima of $N$ images to generate the global affinity attention map $A_{\mathcal{F}} \in \mathbb{R}^{NHW \times 1}$ . In this way, the affinity attenuation is given by + +![](images/71160e3c88ff72c052b058b12d1efb4cddff2c4384e3d3dd6fa02dfea0eb204b.jpg) +Figure 3. Group Affinity Module. We first exploit the affinity attention to generate the attention maps for the input features by collaborating all images in group. Subsequently, the maps are multiplied with the input features to generate the consensus for the group. Then the obtained consensus is used to coordinate the original feature maps and is also fed to the GCM for inter-group collaborative learning. + +tion map is globally optimized on all images thus alleviating the influence of occasional co-occurring bias. Then, we use a softmax operation to normalize $A_{\mathcal{F}}$ and reshape it to generate the attention map $A_{S} \in \mathbb{R}^{N \times (1 \times H \times W)}$ . We multiply $A_{S}$ with the original feature $\mathcal{F}$ to produce the attention feature maps $\mathcal{F}^a \in \mathbb{R}^{N \times C \times H \times W}$ . Finally, all the attention feature maps $\mathcal{F}^a$ for the whole group are used to produce the attention consensus $E^a$ by average pooling along both the batch and spatial dimensions, as shown in Figure 3. + +The global affinity module focuses on capturing the commonality among co-salient objects within the same group and therefore improves the intra-group compactness of the consensus representation. Such intra-group compactness alleviates the disturbance of co-occurring noise and enables the model to concentrate on the co-salient regions. This allows the shared attributes of co-salient objects to be better captured and therefore results in better consensus representation. The obtained attention consensus $E^{a}$ is combined with the original feature maps $\mathcal{F}$ through depth-wise correlation [67, 68] to achieve efficient information association. The resulting feature maps $\mathcal{F}^{out}$ are fed to the decoder to predict co-saliency maps $\mathcal{M}_{n}$ for each image. The loss function is: + +$$ +\mathcal {L} _ {\text {s a l}} = \frac {1}{N} \sum_ {n} ^ {N} \mathcal {L} _ {\text {s i o u}} \left(\mathcal {M} _ {n}, \mathcal {G} _ {n}\right), \tag {2} +$$ + +where $\mathcal{L}_{\mathrm{siou}}$ is the soft IoU loss [28, 69] and $\mathcal{G}_n$ denotes the ground-truth label for each image in the group. + +# 3.3. Group collaborating module (GCM) + +Most CoSOD methods tend to focus on the intra-group compactness of the consensus, but the inter-group separability is equally crucial for distinguishing distracting objects, especially when processing complex images with more than one salient objects. To enhance the discriminative representations between different groups, we propose a simple but effective module, i.e., the GCM, by learning to encode the inter-group separability. + +Given two image groups with the corresponding features $\{\mathcal{F}_1,\mathcal{F}_2\}$ and attention consensus $\{E_1^a,E_2^a\}$ obtained + +![](images/168fb5457b36d19f92d6ecca2719258e6b89df251bd08ce5b0e12e0f4af0ff21.jpg) +Figure 4. Group collaborating module. The original feature maps and consensuses of both groups are fed to the GCM. The predicted output conditioned on the consistent feature and consensus (from the same group) is supervised with the available ground-truth labels. Otherwise, it is supervised by the all-zero maps. + +from the GAM, we apply an intra- and inter-group cross-multiplication. Specifically, the intra-group multiplication deals with the features and their consensus: $\mathcal{F}_1^1 = \mathcal{F}_1\cdot E_1^a$ and $\mathcal{F}_2^2 = \mathcal{F}_2\cdot E_2^a$ for the intra-group collaboration, while the inter-group multiplication acts on the features and consensus of different groups, i.e., $\mathcal{F}_1^2 = \mathcal{F}_1\cdot E_2^a$ and $\mathcal{F}_2^1 = \mathcal{F}_2\cdot E_1^a$ , to express the inter-group interaction. The intra-group representation $\mathcal{F}^{+} = \{\mathcal{F}_{1}^{1},\mathcal{F}_{2}^{2}\}$ is exploited to predict the co-saliency maps, and the inter-group representation $\mathcal{F}^{-} = \{\mathcal{F}_{1}^{2},\mathcal{F}_{2}^{1}\}$ is employed to provide a consensus with group separability. Specifically, we feed $\{\mathcal{F}^{+},\mathcal{F}^{-}\}$ to a small convolutional network with an upsampling layer and produce the saliency map $\{\mathcal{M}^{+},\mathcal{M}^{-}\} ^3$ with different supervision signals: we use ground-truth labels to supervise $\mathcal{F}^{+}$ , while all-zero maps are used for $\mathcal{F}^{-}$ . The loss function is: + +$$ +\mathcal {L} _ {\mathrm {c t m}} = \frac {1}{N} \sum_ {n} ^ {N} \mathcal {L} _ {\mathrm {F L}} \left(< \mathcal {M} _ {n} ^ {+}, \mathcal {M} _ {n} ^ {-} >, < \mathcal {G} _ {n}, \mathcal {G} _ {n} ^ {0} >\right), \tag {3} +$$ + +where $\mathcal{L}_{\mathrm{FL}}$ is the focal loss [70], $\mathcal{G}_n$ is the ground-truth, $\mathcal{G}_n^0$ is the all-zero map and $< \cdot >$ denotes the concatenation operation. + +Our GCM thus encourages the consensus to distinguish different groups with high inter-group separability to iden- + +Table 1. Quantitative ablation studies of our GCoNet on the effectiveness of the GAM (group affinity module), GCM (group collaborating module), ACM (auxiliary classification module) and their combinations. + +
IDModulesCoCA [27]CoSOD3k [8]Cosal2015 [62]
GAMGCMACMEφmax↑Sα↑Fβmax↑ε↓Eφmax↑Sα↑Fβmax↑ε↓Eφmax↑Sα↑Fβmax↑ε↓
10.6180.5910.4190.1900.8110.7640.7210.1080.8620.8180.8000.087
2✓0.6630.6050.4420.1600.8230.7720.7360.0990.8730.8250.8150.079
3✓0.6660.6160.4520.1560.8390.7880.7480.0870.8770.8340.8230.074
4✓0.6510.6060.4420.1670.8290.7790.7370.0940.8750.8320.8200.076
5✓✓0.7190.6500.5040.1260.8500.7980.7660.0780.8840.8420.8370.070
✓✓✓0.7600.6730.5440.1050.8600.8020.7770.0710.8880.8450.8470.068
+ +tify distractors in complex environment. Another advantage is that this module enables the model to be trained on the existing SOD datasets, whose images typically contain only one dominating object. We can discard this module during inference without introducing additional computational overhead. + +# 3.4. Auxiliary Classification Module (ACM) + +To obtain more discriminative features for consensus, we also introduce an ACM to facilitate high-level semantic representation learning. Specifically, we add a classification predictor with a global average pooling layer and one fully connected layer to the backbone to classify $F_{n}$ to the corresponding class $\mathcal{V}_n$ . In the Euclidean feature space, the classification supervision can separate classes by introducing a large margin, and cluster samples belonging to the same class. Therefore, it enables the model to generate more representative features and benefits the consensus learning for intra-group compactness and inter-group separability. The loss function is: + +$$ +\mathcal {L} _ {\mathrm {c l s}} = \mathcal {L} _ {\mathrm {c e}} \left(\mathcal {Y} _ {n}, \hat {\mathcal {Y}} _ {n}\right), \tag {4} +$$ + +where $\mathcal{L}_{\mathrm{ce}}$ is the cross-entropy loss and $\hat{\mathcal{V}_n}$ is the groundtruth class label. + +# 3.5. End-to-end Training + +During training, the GAM, GCM, and ACM are jointly trained with the backbone in an end-to-end manner. The whole framework is optimized by integrating all the aforementioned loss functions: + +$$ +\mathcal {L} = \lambda_ {1} \mathcal {L} _ {\text {s a l}} + \lambda_ {2} \mathcal {L} _ {\text {c t m}} + \lambda_ {3} \mathcal {L} _ {\text {c l s}}, \tag {5} +$$ + +where $\lambda_1, \lambda_2$ , and $\lambda_3$ are hyperparameter weights to balance the loss functions. + +# 4. Experiments + +# 4.1. Implementation Details + +We use VGG-16 [71] with Feature Pyramid Network (FPN) [72] as our backbone. For fair comparison, we follow GICD [27] and use the DUTS [73] dataset as our training set. The group labels derived from GICD [27] are used to group the images during training. In each training episode, + +we randomly pick two different groups with 16 samples4 in each group to train the network. The images are all resized to $224 \times 224$ for training and testing, and the output saliency maps are resized to the original size for evaluation. The network is trained over 50 epochs in total with the Adam optimizer. The initial learning rate is set to $10e - 4$ , $\beta_{1} = 0.9$ and $\beta_{2} = 0.99$ . The whole training takes around four hours and the inference speed on the image pair groups5 is $16 \, \text{ms}$ . The platform for training and inference is equipped with 56 Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz and a Nvidia GeForce GTX 1080Ti. + +# 4.2. Evaluation Datasets and Metrics + +We employ three challenging datasets for evaluation: CoCA [27], CoSOD3k [74], and Cosal2015 [62]. The last is a large dataset widely used in the evaluation of CoSOD methods. The first two were recently proposed for challenging real-world co-saliency evaluation, with the images usually containing multiple common and non-common objects against a complex background. Following the advice of recent large-scale benchmark work [74], we do not use iCoseg [75] and MSRC [76] for evaluation, because they usually provide only one salient object in an image and are not very suitable for evaluating CoSOD models. We use maximum E-measure $E_{\phi}^{\max}$ [77], S-measure $S_{\alpha}$ [78], maximum F-measure $F_{\beta}^{\max}$ [79], and mean absolute error (MAE) $\epsilon$ [80] to evaluate methods in our experiments. + +# 4.3. Ablation Studies + +In this section, we study the effectiveness of each component in our approach (Table 1) and investigate how they contribute to a good consensus feature. + +Effectiveness of GAM. The global co-attention module is a fundamental component of our model, which is designed to capture the common attributes of co-salient objects in an image group for better intra-group compactness. Compared to the baseline model with only the vanilla consensus extracted by an average pooling operation, GAM improves the performance on all metrics and datasets. To get a deeper un + +Table 2. Quantitative comparison results between our GCoNet and other methods. “↑” (“↓”) means that the higher (lower) is better. Co = CoSOD models, Sin = Single-SOD models. The symbol * denotes traditional CoSOD algorithms. + +
MethodPub. & YearTypeCoCA [27]CoSOD3k [8]Cosal2015 [62]
\(E_{\phi}^{\max \uparrow}\)\(S_{\alpha} \uparrow\)\(F_{\beta}^{\max \uparrow}\)\(\epsilon \downarrow\)\(E_{\phi}^{\max \uparrow}\)\(S_{\alpha} \uparrow\)\(F_{\beta}^{\max \uparrow}\)\(\epsilon \downarrow\)\(E_{\phi}^{\max \uparrow}\)\(S_{\alpha} \uparrow\)\(F_{\beta}^{\max \uparrow}\)\(\epsilon \downarrow\)
CBCD* [20]TIP 2013Co0.6410.5230.3130.1800.6370.5280.4660.2280.6560.5440.5320.233
GWD [54]IJCAI 2017Co0.7010.6020.4080.1660.7770.7160.6490.1470.8020.7440.7060.148
RCAN [43]IJCAI 2019Co0.7020.6160.4220.1600.8080.7440.6880.1300.8420.7790.7640.126
CSMG [48]CVPR 2019Co0.7330.6270.4990.1140.8040.7110.7090.1570.8420.7740.7840.130
BASNet [28]CVPR 2019Sin0.6440.5920.4080.1950.8040.7710.7200.1140.8490.8220.7910.096
PoolNet [29]CVPR 2019Sin0.6400.6020.4040.1770.7990.7710.7090.1130.8480.8230.7850.094
EGNet [30]ICCV 2019Sin0.6480.6030.4040.1780.7930.7620.7020.1190.8430.8180.7860.099
SCRN [81]ICCV 2019Sin0.6420.6120.4130.1640.8050.7710.7160.1130.8500.8170.7830.098
GICD [27]ECCV 2020Co0.7150.6580.5130.1260.8480.7970.7700.0790.8870.8440.8440.071
CoEGNet [8]TPAMI 2021Co0.7170.6120.4930.1060.8250.7620.7360.0920.8820.8360.8320.077
GCoNet (Ours)CVPR 2021Co0.7600.6730.5440.1050.8600.8020.7770.0710.8870.8450.8470.068
+ +![](images/44b2fcd8f8e9fc8b873a976ae8a49975aa94098a6bfb3b5505cc5ddec1ac0427.jpg) +Figure 5. Visualization of affinity attention maps learned by GAM using intra-group collaborative learning across all images in each group. Masks are sensitive to co-salient regions with shared attributes, which benefits the consensus representation learning. + +derstanding of our GAM module, we visualize the learned attention masks in Figure 5. We find that our global co-attention effectively alleviates the influence of co-occurring noise and focuses on co-salient regions in the image groups, e.g., in both the monkey and bicycle groups, there are some co-occurring persons in some images, but our GAM is not adversely influenced. The global view of GAM enables the most common objects to be detected, while the local pairwise co-attention cannot distinguish them in the local view. + +Effectiveness of GCM. The group collaborating module is designed to enable the consensus inter-group separability to distinguish distracting objects from non-common objects. After equip the model with GCM, significant performance improvement (ID-1 versus ID-3) is obtained in Table 1 especially on the challenging CoCA [27] dataset whose images usually contain multiple uncommon and common objects. To investigate the consensus characteristics when the model is trained with the GCM, we visualize the consensus using t-SNE [18] on the CoCA dataset, and compare with the vanilla consensus without the GCM. As shown in Figure 1, the vanilla consensuses (top: CoEGNet [8]) tend to cluster together, even if they belong to different groups, resulting in ambiguous co-saliency detection, especially for objects belonging to similar but different groups. In contrast, the consensuses trained with the GCM (bottom: our method) is more diverse with a higher group variance, for more effec + +tive inter-group separability. For quantitative comparison, we evaluate the cosine similarity $(\downarrow$ lower is better) of the consensus of "guitar" and "violin", and ours (0.32) is much better than CoEGNet (0.75). + +Effectiveness of ACM. As shown in Table 1, the classification module introduces better backbone features for the consensus with the auxiliary classification supervision. The ACM improves the baseline performance on all metrics and datasets. This cost-free improvement does not change the network architecture and does not introduce extra computational overhead at inference time, thus has substantial potential to other models and tasks to take advantage of the multi-task learning and more representative features. + +# 4.4. Competing Methods + +Since not all CoSOD models have publicly released codes, we only compare our GCoNet with one representative traditional algorithm (CBCD) and five deep-based CoSOD models, including GWD [82], RCAN [43], CSMG [48], GICD [27], and CoEGNet [8]. Following the current state-of-the-art model [27], we also compare with four cutting-edge deep salient object detection (SOD) models: BASNet [28], PoolNet [29], EGNet [30] and SCRN [81]. More complete leaderboard can be found in recent standard benchmark works [8, 74]. + +![](images/b42954a7dee2d15880087eb4ad44bbd3924cf16152816c3128c9959590e57806.jpg) +Figure 6. Qualitative comparisons of our GCoNet and other methods. "GT" denotes GroundTruth. + +Quantitative Results. Table 2 tabulates the quantitative results of our model and state-of-the-art methods. Our model outperforms all of them in all metrics, especially on the challenging CoCA and CoSOD3k datasets. Among these three datasets, CoCA is the most challenging, since the images typically contain other multiple objects in addition to the co-salient objects which are even smaller in size. Our model capitalizes on our better consensus and significantly outperforms other methods especially the SOD methods which are trapped in distinguishing many distracting objects instead. CoSOD3k has similar attributes, and our model still performs much better than other models on this dataset. Cosal2015 is the easiest dataset because its images typically only contain one co-salient object, and therefore the SOD algorithms can easily handle this dataset. Our model cannot take full advantage of the better consensus on this dataset and the improvement is not as significant as on other datasets. + +Qualitative Results. Figure 6 shows the saliency maps generated by different methods for qualitative comparison. In these difficult examples, each image contains other multiple objects in addition to the co-salient objects. As aforementioned, the SOD methods can only detect salient objects and fail to distinguish co-salient objects due to their intrinsic limitation. The CoSOD methods perform better than the SOD methods owing to their consensus for distinguishing + +co-salient regions. However, limited by the their weak consensus, they are still unable to handle the challenging cases. Our model introduces an effective consensus through optimizing intra-group compactness and inter-group separability, and therefore performs much better on detecting co-salient objects. + +# 5. Discussion of Module Cooperation + +Our three modules are closely interdependent and mutually reinforced for improving co-saliency detection performance. Combining the GAM and GCM can significantly improve the performance compared to the individual modules. Without the GAM the vanilla consensus is not robust against noise caused by uncommon objects and background, and the low-quality consensus cannot take full advantage of the GCM which heavily relies on the consensus for distinguishing different objects. On the other hand, although the consensus can capture common attributes with the help of the GAM, it is difficult to distinguish different groups without the GCM especially for similar groups. Overall, the GAM produces better consensus with high intra-group compactness to detect co-saliency objects, while the GCM further endows the consensus with inter-group separability for better discriminative ability. Adding ACM, the consensus can benefit from more representative features leveraged by the multi-task learning. + +![](images/a5510c32cd03e9fa8ee6645dff4ab26e44c6e602bbded51585573bda2f66bbf1.jpg) + +![](images/9017c6f421358d64cda5ff9e5a04f302033344523e4844e5c72864a3e159b252.jpg) + +![](images/e9dc1232a6a9ca500149ea641a823c8d92e59ca0e1899ae311626e62da804848.jpg) +Input + +![](images/6d689d73ec113844f12d352614bf8e5d8111f0249713dea2b199711b59409e0d.jpg) + +![](images/5c40323babbcbb16aed081e64a7b3e3b5810a5a256970f218e3f04ba1338fc97.jpg) + +![](images/b3a07987e02ccb3399ad4633a24205982827560704f9b5fb52380fb7e4b5bc78.jpg) +GT + +![](images/e5d18dcbe6c07628d45ddd23175081778381b043d553b9e53f4912b91ea3ec4c.jpg) + +![](images/30f0d81f2243fe519eafb25e02d570e25b244dca6812527fcd7ca051c0bfce13.jpg) + +![](images/a2950a84f9137d6bd569b4c1097dc89c6249d243ac4e0ea3ab974fb857d2fcd3.jpg) +Baseline +Figure 7. Qualitative ablation studies of our GCNet on different modules and their combinations. + +![](images/f8669b8c19624d2f5036b851fb8b5aeb126b8e9b9a143dd99bf5ecde46189807.jpg) + +![](images/934e7e2c842f9a03bb254db8c7dbc08bc65432a3f78d4ec67dbf0971e1f8653a.jpg) + +![](images/3795842d816d5ebf40db9e04ffb589ec9fe7bceecfde3697c15c8adb2d3f817f.jpg) ++GAM + +![](images/81de0d942a507f267a97e51bd07d61e17ba0c1bca0d41aa0a6aa65a3486e650c.jpg) + +![](images/45e5feb343c829b60d9f9b6716479c7c5bb778909e1d97a0cd8fcc0eeac21d70.jpg) + +![](images/df03ddc9611cdade6c5a135dbb7a93edfc6e2cb7d79fc54420a32b90c80b9334.jpg) ++GCM + +![](images/1a7944fa5d8c519170d26f425673a274d57d2edf187b046ccc7cc2a11b081dfc.jpg) + +![](images/c491e4f1d123304b4254fd1b154510642c6486737eb2004bcd56dcdd5ada9575.jpg) + +![](images/59b790d8b1ee649ba3b04a515580ba2d0d6d69bdf7fe8755e010404fbd5b0206.jpg) ++GAM & GCM + +![](images/f4a68b121eb7ca815e61a96650c9c2adf903ea3a798c4696d3bdf1fdfc5250d2.jpg) + +![](images/cb3f4d1e7e623f5002f53a04485a3d50770d7f4cfffc7e6dbb79ea707bb32f0a.jpg) + +![](images/67429d9eaca44fd7d52b9682e8a524feec8c7c0e3b70df65b84b8c515fd9e1f3.jpg) +Ours + +![](images/a575471fea1180aa89b3337f3c5a7bbf6170cdb9ab97099dfa036182c81c5f69.jpg) + +![](images/119e7f8d102ffdef48be8e3cebd3e38e0fa5481f948cac46378c7525858550d7.jpg) +Figure 8. Application 1. Content aware object co-segmentation visual results ("GT car") obtained by our GCoNet. + +![](images/953effefc36346e218e472c29857ccabd905c07b976f952a553670a1dde455a6.jpg) + +![](images/c8273dee04ab08de76cca283dabab8ce0157f841e7383f027ffdcea6428b81df.jpg) + +![](images/2cf4c50cc53e6d5e820e193d2753087911c4e96fdd1ac755246627621c13a111.jpg) + +![](images/4c0431b38daad9af92bdc22d90691310a45d8816d933fe587c3523c3372a190c.jpg) + +![](images/2aea720acd3089c3e7ca199c3899bfc847d428f8b23e63f28cd1a73a9f5d14c9.jpg) + +![](images/a5b4df61444dc4c3bfcb944b25b12965c81c97eca45f81060aaed0206849fa24.jpg) +Figure 9. Application 2. Co-location based automatic thumbnails ("Raccoon") generated by our GCoNet. + +![](images/4a73c8253a09ba78dc14e00d39ffc9a077bf5442416d95c8682928b5015263c9.jpg) + +![](images/f6bf4f981cf0ba9d189efcdfb551000cb69c5665553980f1caacc5d3c4ce99b9.jpg) + +![](images/6e32739829e009b62207705022043fc9cff268db7d3f1a4d77c61076eb7bb45d.jpg) + +![](images/1e3eff776c3235561c2bd6a69367b92b09c4d4d5791582fdec10dbf3f2970f5d.jpg) + +Figure 7 qualitatively analyse their cooperation. The baseline model detects uncommon objects, while the GAM and GCM can slightly ameliorate their adverse influence. When combining the GAM and GCM, the model can effectively capture co-salient objects with the ACM further boosting the co-salient object detection result. + +# 6. Downstream Applications + +Here, we show how the extracted co-saliency map can be utilized to generate high-quality segmentation masks for selected closely related downstream image processing tasks. + +Application #1: Content-Aware Co-Segmentation. Co-saliency maps have been previously used in pre-processing for unsupervised object segmentation. In our implementation, we first manually select a group of images from the internet by keyword search. Then, co-saliency maps are generated by our GCoNet to automatically mine the salient + +content of the specific group. Similar to Cheng et al. [26], we also utilize GrabCut [83] to obtain the final segmentation results. To initialize GrabCut, we simply choose adaptive threshold [84] to binarize the saliency maps. Figure 8 shows the results of the content-aware object co-segmentation which should benefit existing e-commerce applications requiring background replacement. + +Application #2: Automatic Thumbs nails. The idea of paired-image thumbnails is derived from the seminal work [11]. With the same goal, we present a CNN-based photographic triage application which is valuable for sharing images with friends on the website. As shown in Figure 9, we first generate the yellow box based on the cossaliency map obtained by our GCoNet. Then, we simply enlarge the yellow box to get a larger red box. Finally, we adopt the collection-aware crops technique [11] to produce the results $(2^{nd}$ row). + +# 7. Conclusion + +In this paper, we investigate a novel group collaborative learning framework (GCoNet) for CoSOD. We find that group-level consensus can introduce effective semantic information to benefit the representation of both the intra-group compactness and inter-group separability for CoSOD. Our experiments quantitatively and qualitatively demonstrate the advantage of our GCoNet which outperforms existing state-of-the-art models. In addition, our GCoNet achieves real-time speed (16ms) which can greatly benefit many applications such as co-segmentation, colocalization, and among others. + +# Acknowledgments + +This research was supported in part by Kuaishou Technology, the Research Grant Council of the Hong Kong SAR under grant No. 16201420, and National Natural Science Foundation of China (No. U1936210). We would like to thank the anonymous reviewers for their useful feedbacks. + +# References + +[1] Deng-Ping Fan, Ming-Ming Cheng, Jiang-Jiang Liu, Shang-Hua Gao, Qibin Hou, and Ali Borji. Salient objects in clutter: Bringing salient object detection to the foreground. In ECCV, pages 186-202, 2018. +[2] Mingchen Zhuge, Deng-Ping Fan, Nian Liu, Dingwen Zhang, Dong Xu, and Ling Shao. Salient object detection via integrity learning. arXiv preprint arXiv:2101.07663, 2021. +[3] Xuebin Qin, Deng-Ping Fan, Chenyang Huang, Cyril Diagne, Zichen Zhang, Adrià Cabeza Sant'Anna, Albert Suárez, Martin Jagersand, and Ling Shao. Boundary-aware segmentation network for mobile and web applications. arXiv preprint arXiv:2101.04704, 2021. +[4] Tao Zhou, Deng-Ping Fan, Ming-Ming Cheng, Jianbing Shen, and Ling Shao. Rgb-d salient object detection: A survey. CVM, pages 1-33, 2021. +[5] Deng-Ping Fan, Zheng Lin, Zhao Zhang, Menglong Zhu, and Ming-Ming Cheng. Rethinking rgb-d salient object detection: Models, data sets, and large-scale benchmarks. IEEE TNNLS, 2021. +[6] Jing Zhang, Deng-Ping Fan, Yuchao Dai, Saeed Anwar, Fatemeh Saleh, Sadegh Aliakbarian, and Nick Barnes. Uncertainty inspired rgb-d saliency detection. arXiv preprint arXiv:2009.03075, 2020. +[7] Zuyao Chen, Runmin Cong, Qianqian Xu, and Qingming Huang. Dpanet: Depth potentiality-aware gated attention network for rgb-d salient object detection. TIP, 2020. +[8] Deng-Ping Fan, Tengpeng Li, Zheng Lin, Ge-Peng Ji, Dingwen Zhang, Ming-Ming Cheng, Huazhu Fu, and Jianbing Shen. Re-thinking co-salient object detection. TPAMI, 2021. +[9] Ming-Ming Cheng, Niloy J Mitra, Xiaolei Huang, and ShiMin Hu. Salientshape: group saliency in image collections. TVC, 30(4):443-453, 2014. +[10] Xiaochuan Wang, Xiaohui Liang, Bailin Yang, and Frederick WB Li. No-reference synthetic image quality assessment with convolutional neural network and local image saliency. CVM, 5(2):193-208, 2019. +[11] David E Jacobs, Dan B Goldman, and Eli Shechtman. Cosaliency: Where people look when comparing images. In ACM UIST, pages 219-228, 2010. +[12] Wenguan Wang and Jianbing Shen. Higher-order image co-segmentation. TMM, 18(6):1011-1021, 2016. +[13] Kuang-Jui Hsu, Yen-Yu Lin, and Yung-Yu Chuang. Deepco3: Deep instance co-segmentation by co-peak search and co-saliency detection. In CVPR, 2019. +[14] Yu Zeng, Yunzhi Zhuge, Huchuan Lu, and Lihe Zhang. Joint learning of saliency detection and weakly supervised semantic segmentation. In ICCV, 2019. +[15] Zhifan Gao, Chenchu Xu, Heye Zhang, Shuo Li, and Victor Hugo C de Albuquerque. Trustful internet of surveillance things based on deeply represented visual co-saliency detection. IoT-J, 7(5):4092-4100, 2020. + +[16] Koteswar Rao Jerripothula, Jianfei Cai, and Junsong Yuan. Efficient video object co-localization with co-saliency activated tracklets. TCSVT, 29(3):744-755, 2018. +[17] Koteswar Rao Jerripothula, Jianfei Cai, and Junsong Yuan. Cats: Co-saliency activated tracklet selection for video colocalization. In ECCV, 2016. +[18] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. JMLR, 9(Nov):2579-2605, 2008. +[19] Hongliang Li and King Ngi Ngan. A co-saliency model of image pairs. TIP, 20(12):3365-3375, 2011. +[20] Huazhu Fu, Xiaochun Cao, and Zhuowen Tu. Cluster-based co-saliency detection. TIP, 22(10):3766-3778, 2013. +[21] Xiaochun Cao, Zhiqiang Tao, Bao Zhang, Huazhu Fu, and Wei Feng. Self-adaptively weighted co-saliency detection via rank constraint. TIP, 23(9):4175-4186, 2014. +[22] Dingwen Zhang, Deyu Meng, and Junwei Han. Co-saliency detection via a self-paced multiple-instance learning framework. TPAMI, 39(5):865-878, 2016. +[23] Junwei Han, Gong Cheng, Zhenpeng Li, and Dingwen Zhang. A unified metric learning-based framework for cosaliency detection. TCSVT, 28(10):2473-2483, 2017. +[24] Kuang-Jui Hsu, Chung-Chi Tsai, Yen-Yu Lin, Xiaoning Qian, and Yung-Yu Chuang. Unsupervised cnn-based co-saliency detection with graphical optimization. In ECCV, 2018. +[25] Wenbin Zou, Kidiyo Kpalma, Zhi Liu, and Joseph Ronsin. Segmentation driven low-rank matrix recovery for saliency detection. In BMVC, 2013. +[26] Ming-Ming Cheng, Niloy J Mitra, Xiaolei Huang, Philip HS Torr, and Shi-Min Hu. Global contrast based salient region detection. TPAMI, 37(3):569-582, 2014. +[27] Zhao Zhang, Wenda Jin, Jun Xu, and Ming-Ming Cheng. Gradient-induced co-saliency detection. In ECCV, 2020. +[28] Xuebin Qin, Zichen Zhang, Chenyang Huang, Chao Gao, Masood Dehghan, and Martin Jagersand. Basnet: Boundary-aware salient object detection. In CVPR, 2019. +[29] Jiang-Jiang Liu, Qibin Hou, Ming-Ming Cheng, Jiashi Feng, and Jianmin Jiang. A simple pooling-based design for real-time salient object detection. In CVPR, 2019. +[30] Jia-Xing Zhao, Jiang-Jiang Liu, Deng-Ping Fan, Yang Cao, Jufeng Yang, and Ming-Ming Cheng. Egnet: Edge guidance network for salient object detection. In ICCV, 2019. +[31] Shang-Hua Gao, Yong-Qiang Tan, Ming-Ming Cheng, Chengze Lu, Yunpeng Chen, and Shuicheng Yan. Highly efficient salient object detection with 100k parameters. In ECCV, 2020. +[32] Kai Zhao, Shanghua Gao, Wenguan Wang, and Ming ming Cheng. Optimizing the F-measure for threshold-free salient object detection. In ICCV, 2019. +[33] Hwann-Tzong Chen. Preattentive co-saliency detection. In ICIP, 2010. + +[34] Xiaochun Cao, Yupeng Cheng, Zhiqiang Tao, and Huazhu Fu. Co-saliency detection via base reconstruction. In ACM MM, 2014. +[35] Kai-Yueh Chang, Tyng-Luh Liu, and Shang-Hong Lai. From co-saliency to co-segmentation: An efficient and fully unsupervised energy minimization model. In CVPR, 2011. +[36] Yijun Li, Keren Fu, Zhi Liu, and Jie Yang. Efficient saliency-model-guided visual co-saliency detection. SPL, 22(5):588-592, 2014. +[37] Zhi Liu, Wenbin Zou, Lina Li, Liquan Shen, and Olivier Le Meur. Co-saliency detection based on hierarchical segmentation. SPL, 21(1):88-92, 2013. +[38] Hongliang Li, Fanman Meng, and King Ngi Ngan. Cosalient object detection from multiple images. TMM, 15(8):1896-1909, 2013. +[39] Bo Jiang, Xingyue Jiang, Ajian Zhou, Jin Tang, and Bin Luo. A unified multiple graph learning and convolutional network model for co-saliency estimation. In ACM MM, 2019. +[40] Bo Jiang, Xingyue Jiang, Jin Tang, Bin Luo, and Shilei Huang. Multiple graph convolutional networks for co-saliency detection. In ICME, 2019. +[41] Kaihua Zhang, Tengpeng Li, Shiwen Shen, Bo Liu, Jin Chen, and Qingshan Liu. Adaptive graph convolutional network with attention graph clustering for co-saliency detection. In CVPR, 2020. +[42] Dingwen Zhang, Junwei Han, Jungong Han, and Ling Shao. Cosaliency detection based on intrasaliency prior transfer and deep intersaliency mining. TNNLS, 27(6):1163-1176, 2015. +[43] Bo Li, Zhengxing Sun, Lv Tang, Yunhan Sun, and Jinlong Shi. Detecting robust co-saliency with recurrent co-attention neural network. In IJCAI, 2019. +[44] Wen-Da Jin, Jun Xu, Ming-Ming Cheng, Yi Zhang, and Wei Guo. Icnet: Intra-saliency correlation network for co-saliency detection. In NeurIPS, 2020. +[45] Koteswar Rao Jerripothula, Jianfei Cai, and Junsong Yuan. Quality-guided fusion-based co-saliency estimation for image co-segmentation and colocalization. TMM, 20(9):2466-2477, 2018. +[46] Xiwen Yao, Junwei Han, Dingwen Zhang, and Feiping Nie. Revisiting co-saliency detection: A novel approach based on two-stage multi-view spectral rotation co-clustering. TIP, 26(7):3196-3209, 2017. +[47] Chung-Chi Tsai, Weizhi Li, Kuang-Jui Hsu, Xiaoning Qian, and Yen-Yu Lin. Image co-saliency detection and co-segmentation via progressive joint optimization. TIP, 28(1):56-71, 2018. +[48] Kaihua Zhang, Tengpeng Li, Bo Liu, and Qingshan Liu. Cosaliency detection via mask-guided fully convolutional networks with multi-scale label smoothing. In CVPR, 2019. +[49] Min Li, Shizhong Dong, Kun Zhang, Zhifan Gao, Xi Wu, Heye Zhang, Guang Yang, and Shuo Li. Deep learning intra-image and inter-images features for co-saliency detection. In BMVC, 2018. + +[50] Jingru Ren, Zhi Liu, Xiaofei Zhou, Cong Bai, and Guangling Sun. Co-saliency detection via integration of multi-layer convolutional features and inter-image propagation. Neurocomputing, 371:137-146, 2020. +[51] Qijian Zhang, Runmin Cong, Junhui Hou, Chongyi Li, and Yao Zhao. Coadnet: Collaborative aggregation-and-distribution networks for co-salient object detection. In NeurIPS, 2020. +[52] Chong Wang, Zheng-Jun Zha, Dong Liu, and Hongtao Xie. Robust deep co-saliency detection with group semantic. In AAAI, 2019. +[53] Lina Wei, Shanshan Zhao, Omar El Farouk Bourahla, Xi Li, Fei Wu, and Yueting Zhuang. Deep group-wise fully convolutional network for co-saliency detection with graph propagation. TIP, 28(10):5052-5063, 2019. +[54] Lina Wei, Shanshan Zhao, Omar El Farouk Bourahla, Xi Li, and Fei Wu. Group-wise deep co-saliency detection. In IJ-CAI, 2017. +[55] Dong-ju Jeong, Insung Hwang, and Nam Ik Cho. Co-salient object detection based on deep saliency networks and seed propagation over an integrated graph. TIP, 27(12):5866-5879, 2018. +[56] Xiaoju Zheng, Zheng-Jun Zha, and Liansheng Zhuang. A feature-adaptive semi-supervised framework for co-saliency detection. In ACM MM, 2018. +[57] Dingwen Zhang, Junwei Han, and Yu Zhang. Supervision by fusion: Towards unsupervised learning of deep salient object detector. In ICCV, 2017. +[58] Kuang-Jui Hsu, Yen-Yu Lin, and Yung-Yu Chuang. Coattention cnns for unsupervised object co-segmentation. In IJCAI, 2018. +[59] Bo Li, Zhengxing Sun, Quan Wang, and Qian Li. Cosaliency detection based on hierarchical consistency. In ACM MM, 2019. +[60] Hongkai Yu, Kang Zheng, Jianwu Fang, Hao Guo, Wei Feng, and Song Wang. Co-saliency detection within a single image. In AAAI, 2018. +[61] Shaoyue Song, Hongkai Yu, Zhenjiang Miao, Dazhou Guo, Wei Ke, Cong Ma, and Song Wang. An easy-to-hard learning strategy for within-image co-saliency detection. Neurocomputing, 358:166-176, 2019. +[62] Dingwen Zhang, Junwei Han, Chao Li, Jingdong Wang, and Xuelong Li. Detection of co-salient objects by looking deep and wide. IJCV, 120(2):215-232, 2016. +[63] Carl Vondrick, Abhinav Shrivastava, Alireza Fathi, Sergio Guadarrama, and Kevin Murphy. Tracking emerges by colorizing videos. In ECCV, 2018. +[64] Zihang Lai and Weidi Xie. Self-supervised learning for video correspondence flow. In BMVC, 2019. +[65] Xiaolong Wang, Allan Jabri, and Alexei A Efros. Learning correspondence from the cycle-consistency of time. In CVPR, 2019. + +[66] Zihang Lai, Erika Lu, and Weidi Xie. Mast: A memory-augmented self-supervised tracker. In CVPR, 2020. +[67] 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. +[68] Qi Fan, Wei Zhuo, Chi-Keung Tang, and Yu-Wing Tai. Few-shot object detection with attention-rpn and multi-relation detector. In CVPR, 2020. +[69] Zhuwen Li, Qifeng Chen, and Vladlen Koltun. Interactive image segmentation with latent diversity. In CVPR, 2018. +[70] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In ICCV, 2017. +[71] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. +[72] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017. +[73] Lijun Wang, Huchuan Lu, Yifan Wang, Mengyang Feng, Dong Wang, Baocai Yin, and Xiang Ruan. Learning to detect salient objects with image-level supervision. In CVPR, 2017. +[74] Deng-Ping Fan, Zheng Lin, Ge-Peng Ji, Dingwen Zhang, Huazhu Fu, and Ming-Ming Cheng. Taking a deeper look at the co-salient object detection. In CVPR, 2020. +[75] Dhruv Batra, Adarsh Kowdle, Devi Parikh, Jiebo Luo, and Tsuhan Chen. icoseg: Interactive co-segmentation with intelligent scribble guidance. In CVPR, 2010. +[76] John Winn, Antonio Criminisi, and Thomas Minka. Object categorization by learned universal visual dictionary. In ICCV, 2005. +[77] Deng-Ping Fan, Ge-Peng Ji, Xuebin Qin, and Ming-Ming Cheng. Cognitive vision inspired object segmentation metric and loss function. SSI, 2021. +[78] Deng-Ping Fan, Ming-Ming Cheng, Yun Liu, Tao Li, and Ali Borji. Structure-measure: A new way to evaluate foreground maps. In ICCV, 2017. +[79] Radhakrishna Achanta, Sheila Hemami, Francisco Estrada, and Sabine Susstrunk. Frequency-tuned salient region detection. In CVPR, 2009. +[80] Ming-Ming Cheng, Jonathan Warrell, Wen-Yan Lin, Shuai Zheng, Vibhav Vineet, and Nigel Crook. Efficient salient region detection with soft image abstraction. In ICCV, 2013. +[81] Zhe Wu, Li Su, and Qingming Huang. Stacked cross refinement network for edge-aware salient object detection. In ICCV, 2019. +[82] Bo Li, Zhengxing Sun, Qian Li, Yunjie Wu, and Anqi Hu. Group-wise deep object co-segmentation with co-attention recurrent neural network. In ICCV, 2019. +[83] Carsten Rother, Vladimir Kolmogorov, and Andrew Blake. Interactive foreground extraction using iterated graph cuts. ACM TOG, 23:3, 2012. + +[84] Houwen Peng, Bing Li, Weihua Xiong, Weiming Hu, and Rongrong Ji. Rgbd salient object detection: a benchmark and algorithms. In ECCV, 2014. \ No newline at end of file diff --git a/groupcollaborativelearningforcosalientobjectdetection/images.zip b/groupcollaborativelearningforcosalientobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..683fd68832b6d71d4b8bd8555a06071bd977e78c --- /dev/null +++ b/groupcollaborativelearningforcosalientobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f3e737071ef1b3f0871e44b8f3012d4c1c6783d29197f10c9e4294dbea8f21 +size 785548 diff --git a/groupcollaborativelearningforcosalientobjectdetection/layout.json b/groupcollaborativelearningforcosalientobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..640d20479d5a22af83ec4ccd52f9d81a89cc783f --- /dev/null +++ b/groupcollaborativelearningforcosalientobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60d42b8b28b6a50948c952a42af68d8f86b4440c21c4e972d7d6e36a89e89273 +size 466510 diff --git a/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_content_list.json b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2c5b6c8078d7ef798367285bc8a9a7d17cb4ee44 --- /dev/null +++ b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64c574f5d72a85b450a03a3ad3a1d2d002131a637df25152267ce4f916c22c3b +size 88346 diff --git a/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_model.json b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3e28cc72afa6a26671c73727d313b85e802684b9 --- /dev/null +++ b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d9a4540034f805431639fef0c677cc8a7386ed8d2c6d2ae1dd5e6817527b8ec +size 110836 diff --git a/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_origin.pdf b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0bf770524f834221941a60e4935c84685a568153 --- /dev/null +++ b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/92d33f84-0d5e-4470-99ee-c0d238f56cf9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93dc2306ebed65284e279a55083c335e197124647b8fc0b73bf8a13c241d83de +size 2723321 diff --git a/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/full.md b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/full.md new file mode 100644 index 0000000000000000000000000000000000000000..eee791df327d0b797c16be47653feeac5c178bfa --- /dev/null +++ b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/full.md @@ -0,0 +1,373 @@ +# Group Whitening: Balancing Learning Efficiency and Representational Capacity + +Lei Huang $^{1,3}$ Yi Zhou $^{2}$ Li Liu $^{3}$ Fan Zhu $^{3}$ Ling Shao $^{3}$ + +$^{1}$ SKLSDE, Institute of Artificial Intelligence, Beihang University, Beijing, China + +$^{2}$ MOE Key Laboratory of Computer Network and Information Integration, Southeast University, China + +3Inception Institute of Artificial Intelligence (IIAI), Abu Dhabi, UAE + +# Abstract + +Batch normalization (BN) is an important technique commonly incorporated into deep learning models to perform standardization within mini-batches. The merits of BN in improving a model's learning efficiency can be further amplified by applying whitening, while its drawbacks in estimating population statistics for inference can be avoided through group normalization (GN). This paper proposes group whitening (GW), which exploits the advantages of the whitening operation and avoids the disadvantages of normalization within mini-batches. In addition, we analyze the constraints imposed on features by normalization, and show how the batch size (group number) affects the performance of batch (group) normalized networks, from the perspective of model's representational capacity. This analysis provides theoretical guidance for applying GW in practice. Finally, we apply the proposed GW to ResNet and ResNeXt architectures and conduct experiments on the ImageNet and COCO benchmarks. Results show that GW consistently improves the performance of different architectures, with absolute gains of $1.02\% \sim 1.49\%$ in top-1 accuracy on ImageNet and $1.82\% \sim 3.21\%$ in bounding box AP on COCO. + +# 1. Introduction + +Batch normalization (BN) [24] represents a milestone technique in deep learning [15, 52, 59], and has been extensively used in various network architectures [15, 52, 66, 51, 18]. BN standardizes the activations within a mini-batch of data, which improves the conditioning of optimization and accelerates training [24, 4, 46]. Further, the stochasticity of normalization introduced along the batch dimension is believed to benefit generalization [59, 48, 22]. However, this stochasticity also results in differences between the training distribution (using mini-batch statistics) and the test distribution (using estimated population statistics) [23], which is believed to be the main cause of BN's small-batch-size problem — BN's error increases rapidly as the batch size becomes smaller [59]. To address this issue, a number of approaches have been proposed [59, 43, 37, 23, 56, 50, 7]. One + +representative method is group normalization (GN), which divides the neurons into groups and then applies the standardization operation over the neurons of each group, for each sample, independently. GN provides a flexible solution to avoid normalization along the batch dimension, and benefits visual tasks limited to small-batch-size training [59, 29]. + +As a widely used operation in data pre-processing, whitening not only standardizes but also decorrelates the data [31], which further improves the conditioning of the optimization problem [31, 58, 12, 20]. A whitened input has also been shown to make the gradient descent updates similar to the Newton updates for linear models [31, 58, 20]. Motivated by this, Huang et al. [20] proposed batch whitening (BW) for deep models, which performs whitening on the activations of each layer within a mini-batch. BW has been shown to achieve better optimization efficiency and generalization than BN [20, 22, 41]. However, BW further amplifies the disadvantage of BN in estimating the population statistics, where the number of parameters to be estimated with BW is quadratic to the number of neurons/channels. Thus, BW requires a sufficiently large batch size to work well. + +To exploit whitening's advantage in optimization, while avoiding its disadvantage in normalization along the batch dimension, this paper proposes group whitening (GW). GW divides the neurons of a sample into groups for standardization over the neurons in each group, and then decorrelates the groups. Unlike BW, GW has stable performance for a wide range of batch sizes, like GN, and thus can be applied to a variety of tasks. GW further improves the conditioning of optimization of GN with its whitening operation. + +One important hyperparameter of GW is the group number. We observe that GW/GN has a significantly degenerated training performance when the group number is large, which is similar to the small-batch-size problem of BW/BN. We attribute this to the constraints on the output imposed by the normalization operation, which affect the model's representational capacity. As such, this paper defines the constraint number of normalization (as will be discussed in Section 4) to quantitatively measure the magnitude of the constraints provided by normalization methods. With the support of the constraint number, we analyze how the + +batch size (group number) affects the model's representational capacity for batch (group) normalized networks. Our analysis also presents a new viewpoint for understanding the small-batch-size problem of BN. + +We apply the proposed GW to two representative deep network architectures (ResNet [15] and ResNeXt [60]) for ImageNet classification [45] and COCO object detection and instance segmentation [35]. GW consistently improves the performance for both architectures, with absolute gains of $1.02\% \sim 1.49\%$ in top-1 accuracy for ImageNet and $1.82\% \sim 3.21\%$ in bounding box AP for COCO. + +# 2. Preliminaries + +For simplicity, we first consider the $d$ -dimensional input vector $\mathbf{x}$ , which will be generalized to a convolutional input in the subsequent section. Let $\mathbf{X} \in \mathbb{R}^{d \times m}$ be a data matrix denoting the mini-batch input of size $m$ in a given layer. + +Standardization. During training, batch normalization (B-N) [24] standardizes the layer input within a mini-batch, for each neuron, as: + +$$ +\widehat {\mathbf {X}} = \phi_ {B N} (\mathbf {X}) = \Lambda_ {d} ^ {- \frac {1}{2}} \left(\mathbf {X} - \mu_ {d} \mathbf {1} ^ {T}\right). \tag {1} +$$ + +Here, $\mu_{d} = \frac{1}{m}\mathbf{X}\mathbf{1}$ and $\Lambda_{d} = \mathrm{diag}(\sigma_{1}^{2},\dots,\sigma_{d}^{2}) + \epsilon \mathbf{I}$ , where $\sigma_{i}^{2}$ is the variance over mini-batches for the $i$ -th neuron, $\mathbf{1}$ is a column vector of all ones, and $\epsilon >0$ is a small number to prevent numerical instability. During inference, the population statistics $\{\widehat{\Lambda}_d^{-\frac{1}{2}},\hat{\mu}_d\}$ are required for deterministic inference, and they are usually calculated by running average over the training iterations, as follows: + +$$ +\left\{ \begin{array}{l} \hat {\mu} _ {d} = (1 - \lambda) \hat {\mu} _ {d} + \lambda \mu_ {d}, \\ \widehat {\Lambda} _ {d} ^ {- \frac {1}{2}} = (1 - \lambda) \widehat {\Lambda} _ {d} ^ {- \frac {1}{2}} + \lambda \Lambda_ {d} ^ {- \frac {1}{2}}. \end{array} \right. \tag {2} +$$ + +Such an estimation process can limit the usage of BN in recurrent neural networks [30, 10], or harm the performance for small-batch-size training [23, 59]. + +To avoid the estimation of population statistics shown in Eqn. 2, Ba et al. proposed layer normalization (LN) [4] to standardize the layer input within the neurons for each training sample, as: + +$$ +\widehat {\mathbf {X}} = \phi_ {L N} (\mathbf {X}) = \left(\mathbf {X} - \mathbf {1} \mu_ {m} ^ {T}\right) \Lambda_ {m} ^ {- \frac {1}{2}}. \tag {3} +$$ + +Here, $\mu_{m} = \frac{1}{d}\mathbf{X}^{T}\mathbf{1}$ and $\Lambda_{m} = \mathrm{diag}(\sigma_{1}^{2},\dots,\sigma_{m}^{2}) + \epsilon \mathbf{I}$ , where $\sigma_{i}^{2}$ is the variance over the neurons for the $i$ -th sample. LN has the same formulation during training and inference, and is extensively used in natural language processing tasks [55, 65, 62]. + +Group normalization (GN) [59] further generalizes LN, dividing the neurons into groups and performing the standardization within the neurons of each group independently, for each sample. Specifically, defining the group division operation as $\Pi : \mathbb{R}^{d \times m} \mapsto \mathbb{R}^{c \times gm}$ , where $g$ is the group + +![](images/9aea79aae35ba1d1e06b1450fa4ebcf5e843aa78b2b766b919e1244b8088ba56.jpg) +(a) + +![](images/ede0dbf1709ee0f5f00526dbdb7bc9b55728e20c936b406ce406c9f9442f3a33.jpg) +(b) +Figure 1. Effects of batch size (group number) for batch (group) normalized networks. We train a four-layer multilayer perceptron (MLP) with 256 neurons in each layer, for MNIST classification. We evaluate the training (thick 'plus' with solid line) and validation (thin 'plus' with dashed line) accuracies at the end of 50 training epochs. Note that 'BW-C16' indicates group-based BW with 16 neurons in each group. We vary the batch size and group number in (a) and (b), respectively. These results are obtained using a learning rate of 0.1, but we also obtain similar observations for other learning rates. Please see the supplementary materials (SM) for details. + +number and $d = gc$ , GN can be represented as follows: + +$$ +\widehat {\mathbf {X}} = \phi_ {G N} (\mathbf {X}; g) = \Pi^ {- 1} \left(\phi_ {L N} \left(\Pi (\mathbf {X})\right)\right), \tag {4} +$$ + +where $\Pi^{-1}: \mathbb{R}^{c \times gm} \mapsto \mathbb{R}^{d \times m}$ is the inverse operation of $\Pi$ . It is clear from Eqn. 4 that LN is a special case of GN with $g = 1$ . By changing the group number $g$ , GN is more flexible than LN, enabling it to achieve good performance on visual tasks limited to small-batch-size training (e.g., object detection and segmentation [59]). + +Whitening. To exploit the advantage of whitening over standardization in improving the conditioning of optimization, Huang et al. proposed decorrelated BN [20], which performs zero-phase component analysis (ZCA) whitening to normalize the layer input within a mini-batch, as: + +$$ +\phi_ {Z C A} ^ {W} (\mathbf {X}) = \Sigma_ {d} ^ {- \frac {1}{2}} \left(\mathbf {X} - \mu_ {d} \mathbf {1} ^ {T}\right) = \mathbf {D} \Lambda^ {- \frac {1}{2}} \mathbf {D} ^ {T} \left(\mathbf {X} - \mu_ {d} \mathbf {1} ^ {T}\right), \tag {5} +$$ + +where $\Lambda = \mathrm{diag}(\tilde{\sigma}_1,\dots ,\tilde{\sigma}_d)$ and $\mathbf{D} = [\mathbf{d}_1,\dots,\mathbf{d}_d]$ are the eigenvalues and associated eigenvectors of $\Sigma$ i.e. $\Sigma = \mathbf{D}\Lambda \mathbf{D}^T$ and $\Sigma = \frac{1}{m} (\mathbf{X} - \mu_d\mathbf{1}^T)(\mathbf{X} - \mu_d\mathbf{1}^T)^T +\epsilon \mathbf{I}$ is the covariance matrix of the centered input. One crucial problem in Eqn. 5 is the eigen-decomposition, which is computationally expensive on a GPU and numerically instable. To address this issue, iterative normalization ('ItN') [22] was proposed to approximate the ZCA whitening matrix $\Sigma_{d}^{-\frac{1}{2}}$ using Newton's iteration [5]: + +$$ +\phi_ {I t N} ^ {W} (\mathbf {X}) = \Sigma_ {d} ^ {- \frac {1}{2}} \left(\mathbf {X} - \mu_ {d} \mathbf {1} ^ {T}\right) = \frac {\mathbf {P} _ {T}}{\sqrt {t r \left(\Sigma_ {d}\right)}} \left(\mathbf {X} - \mu_ {d} \mathbf {1} ^ {T}\right), \tag {6} +$$ + +where $tr(\Sigma_d)$ indicates the trace of $\Sigma_d$ and $\mathbf{P}_T$ is calculated iteratively as: + +$$ +\left\{ \begin{array}{l} \mathbf {P} _ {0} = \mathbf {I} \\ \mathbf {P} _ {k} = \frac {1}{2} \left(3 \mathbf {P} _ {k - 1} - \mathbf {P} _ {k - 1} ^ {3} \Sigma_ {d} ^ {N}\right), k = 1, 2, \dots , T. \end{array} \right. \tag {7} +$$ + +Here, $\Sigma_d^N = \frac{\Sigma_d}{tr(\Sigma_d)}$ . Other BW methods also exist for calculating the whitening matrix [20, 49]; please refer to [27, 21] for more details. + +It is necessary for BW to estimate the population statistics of the whitening matrix $\widehat{\Sigma}_d^{-\frac{1}{2}}$ during inference, like BN. However, the number of independent parameters in $\widehat{\Sigma}_d^{-\frac{1}{2}}$ of BW is $\frac{d(d + 1)}{2}$ , while $\widehat{\Lambda}_d^{-\frac{1}{2}}$ of BN is $d$ . This amplifies the difficulty in estimation and requires a sufficiently large batch size for BW to work well (Figure 1). Although group-based BW [20] — where neurons are divided into groups and BW is performed within each one — can relieve this issue, it is still sensitive to the batch size (Figure 1) due to its inherent drawback of normalizing along the batch dimension. + +# 3. Group Whitening + +We propose group whitening (GW). Given a sample $\mathbf{x} \in \mathbb{R}^d$ , GW performs normalization as: + +$$ +G r o u p d i v i s i o n: \mathbf {X} _ {G} = \Pi (\mathbf {x}; g) \in \mathbb {R} ^ {g \times c}, \tag {8} +$$ + +$$ +W h i t e n i n g: \widehat {\mathbf {X}} _ {G} = \Sigma_ {g} ^ {- \frac {1}{2}} \left(\mathbf {X} _ {G} - \mu_ {g} \mathbf {1} ^ {T}\right), \tag {9} +$$ + +Inverse group division: $\hat{\mathbf{x}} = \Pi^{-1}(\widehat{\mathbf{X}}_G)\in \mathbb{R}^d$ (10) + +where $\Pi : \mathbb{R}^d \mapsto \mathbb{R}^{g \times c}$ and its inverse transform $\Pi^{-1}: \mathbb{R}^{g \times c} \mapsto \mathbb{R}^d$ . We can use different whitening operations [20, 49, 27] in Eqn. 9. Here, we use ZCA whitening (Eqn. 5) and its efficient approximation 'ItN' (Eqn 6), since they work well on discriminative tasks [20, 22, 41, 47, 64]. We provide the full algorithms (forward and backward passes) and PyTorch [42] implementations in the SM. + +GW avoids normalization along the batch dimension, and it works stably across a wide range of batch sizes (Figure 1). GW also ensures that the normalized activation for each sample has the properties: $\widehat{\mathbf{X}}_G\mathbf{1} = \mathbf{0}$ and $\frac{1}{c}\widehat{\mathbf{X}}_G\widehat{\mathbf{X}}_G^T = \mathbf{I}$ , which should improve the conditioning, like BW, and benefit training. We conduct several experiments to validate this, and the results in Figure 2 show that the group whitened output (by GW) has significantly better conditioning than the group standardized one (by GN), which is similar to normalization along the batch dimension [20]. Note that the condition number of BW is 1. We also find that GN/GW has better conditioning with increasing group number. Besides, we find that BN has better conditioning than GN/GW, which suggests that normalizing along the batch dimension is better for decorrelating the data than normalizing along the channel dimension. + +Convolutional layer. For the convolutional input $\mathbf{X} \in \mathbb{R}^{d \times m \times H \times W}$ , where $\mathrm{H}$ and $\mathrm{W}$ are the height and width of the feature maps, BN and BW consider each spatial position in a feature map as a sample [24] and normalize over the unrolled input $\mathbf{X} \in \mathbb{R}^{d \times mHW}$ . In contrast, LN and GN view each spatial position in a feature map as a neuron [59] and normalize over the unrolled input $\mathbf{X} \in \mathbb{R}^{dHW \times m}$ . Following GN, GW also views each spatial position as a neuron, i.e., GW operations (Eqns. 8, 9 and 10) are performed for each sample with unrolled input $\mathbf{x} \in \mathbb{R}^{dHW}$ . + +![](images/ae757719a4480bfb0b1a34f12b5eaf512ad9eeea5e51f6a14d228c8e6d899c13.jpg) +Group number + +![](images/0b0edc327f260e322c6e70874c7e7c85b9529b034f1e81a2acb1ab8b7691284e.jpg) +Group number +(b) +Figure 2. Conditioning analysis on the normalized output. We simulate the activations $\mathbf{X} = f(\mathbf{X}_0) \in \mathbb{R}^{256 \times 1024}$ using a network $f(\cdot)$ , where $\mathbf{X}_0$ is sampled from a Gaussian distribution. We evaluate the more general condition number with respect to the percentage: $\kappa_p = \frac{\lambda_{max}}{\lambda_p}$ , where $\lambda_p$ is the $pd$ -th eigenvalue (in descending order) and $d$ is the total number of eigenvalues. We show the $\kappa_{90\%}$ of the covariance matrix of $\widehat{\mathbf{X}}$ normalized by GN/GW, while varying the group number. 'Base' and 'BN' indicate the condition number for $\mathbf{X}$ and the batch normalized output, respectively. We use a one-layer and two-layer MLP as $f(\cdot)$ , in (a) and (b), respectively. Please refer to SM for more results. + +Computational complexity. For a convolutional minibatch input $\mathbf{X} \in \mathbb{R}^{d \times m \times H \times W}$ , GW using ZCA whitening (Eqn. 5) costs $2mHW\, dg + mO(g^3)$ . Using the more efficient 'ItN' operation (Eqn. 6), GW costs $2mHW\, dg + mTg^3$ where T is the iteration number. The $3 \times 3$ convolution with the same input and output feature maps costs $9mHW\, d^2$ . The relative cost of GW for a $3 \times 3$ convolution is $\frac{2g}{9d} + \frac{Tg^3}{9HW\, d^2}$ . + +Difference from group-based BW. Our method is significantly different from the group-based BW [20], in which the whitening operation is also applied within mini-batch data. Specifically, group-based BW has difficulty in estimating the population statistics, as discussed in Section 2. Note that group-based BW is reduced to BN if the channel number in each group $c = 1$ , while GW is reduced to GN if the group number $g = 1$ . + +# 4. Revisiting the Constraint of Normalization + +The normalization operation ensures that the normalized output $\widehat{\mathbf{X}} = \phi (\mathbf{X})\in \mathbb{R}^{d\times m}$ has a stable distribution. This stability of distribution can be implicitly viewed as the constraints imposed on $\widehat{\mathbf{X}}$ , which can be represented as a system of equations $\Upsilon_{\phi}(\widehat{\mathbf{X}})$ . For example, BN provides the constraints $\Upsilon_{\phi_{BN}}(\widehat{\mathbf{X}})$ as: + +$$ +\sum_ {j = 1} ^ {m} \widehat {\mathbf {X}} _ {i j} = 0 a n d \sum_ {j = 1} ^ {m} \widehat {\mathbf {X}} _ {i j} ^ {2} - m = 0, f o r i = 1, \dots , d. \tag {11} +$$ + +Here, we define the constraint number of normalization to quantitatively measure the magnitude of the constraints provided by the normalization method. + +Definition 1 Given the input data $\mathbf{X} \in \mathbb{R}^{d \times m}$ , the constraint number of a normalization operation $\phi(\cdot)$ , referred to as $\zeta(\phi; \mathbf{X})$ , is the number of independent equations in $\Upsilon_{\phi}(\widehat{\mathbf{X}})$ . + +![](images/23a8b0be766e9001e1e8a15edbbe58c85d22f9765fa07d51fd7d334dd6843001.jpg) + +![](images/69f4e3f8ce39db55c853d068cb896f20a38c6cd7debb8b7aaf4a1b9983a2264c.jpg) + +![](images/ef4638256d0074190d91959850d7a18fd648a80f1204d75ba69d5dbd301e29f0.jpg) + +![](images/4a7cfc34c5a8a6007585bfc8e97c15c7e7c42644232396b192e88787a8b39232.jpg) + +![](images/f4f531e1957fde045da6eab3d967701698714befe658bc85879b9039aecd0601.jpg) + +![](images/922b07e957092583c87ae31cc73b6e8f59fe5463d11d890f79337ad988174a0f.jpg) +Figure 3. Illustration of the normalized output of GN/BN. We perform normalization over 1,680 examples sampled from a Gaussian distribution, varying the channel number for each group $c$ of GN (the upper subfigures) and the batch size $m$ of BN (the lower subfigures). We plot the bivariate histogram (using hexagonal bins) of the normalized output in the two-dimensional subspace, and marginal histograms (using rectangular bins) in the one-dimensional subspace. + +![](images/c45f0afeeaa049330fae4ec57a5ee8e6067986803408ee57359caad59072e341.jpg) + +![](images/469cb329a7374672de6948c9dfeecacbed58165f7c179e7a77e63eb4bf225ea0.jpg) + +![](images/b974b652e1c670e2c4339565695785671907561fad726c2ccc9e894d789f7493.jpg) + +![](images/531048469c2f16256bd3e136d47a541262cd9a1af8804784f137c827b5367c1d.jpg) + +
Normalization along a batchNormalization along a group of neurons
BNBWGNGW
ζ(φ; X)2dd(d+3)/22gmmg(g+3)/2
ζ(φ; D)2Nd/mNd(d+3)/2m2gNNg(g+3)/2
Ranges of m/gm≥2m≥d+3/2g≤d/2g≤√8d+9-3/2
+ +Table 1. Summary of $\zeta (\phi ;\mathbf{X})$ $\zeta (\phi ;\mathbb{D})$ and ranges of $m / g$ for normalization methods. The analysis can be naturally extended to CNN, following how BN (GN) extends from MLP to CNN shown in Section 3. For examples, the number of neurons to be normalized for GN/GW is $d = d^{\prime}HW$ , and the number of samples to be normalized for BN/BW is $m = m^{\prime}HW$ , given the input $\mathbf{X}\in \mathbb{R}^{d^{\prime}\times m^{\prime}\times H\times W}$ for CNN. + +As an example, we have $\zeta(\phi_{BN};\mathbf{X}) = 2d$ from Eqn. 11. Furthermore, given training data $\mathbb{D}$ of size $N$ , we consider the optimization algorithm with batch size $m$ (we assume $N$ is divisible by $m$ ). We calculate the constraint number of normalization over the entire training data $\zeta(\phi; \mathbb{D})$ . Table 1 summarizes the constraint numbers of the main normalization methods discussed in this paper (please refer to the SM for derivation details). We can see that the whitening operation provides significantly stronger constraints than the standardization operation. Besides, the constrains get stronger for BN (GN), when reducing (increasing) the batch size (group number). + +# 4.1. Constraint on Feature Representation + +BN's benefits in accelerating the training of DNNs are mainly attributed to two reasons: 1) The distribution is more stable when fixing the first and second momentum of the activations, which reduces the internal covariant shifts [24]; 2) The landscape of the optimization objective is better conditioned [20, 46], by improving the conditioning of the activation matrix with normalization. Based on these arguments, GW/GN should have better performance when increasing the group number, due to the stronger constraints and bet- + +ter conditioning. However, we experimentally observe that GN/GW has significantly degenerated performance when the group number is too large (Figure 1 (b)), which is similar to the small-batch-size problem of BN/BW. We investigate the reason behind this phenomenon. + +We first show that the batch size/group number has a value range, which can be mathematically derived. The normalization operation can be regarded as a way to find a solution $\widehat{\mathbf{X}}$ satisfying the constraints $\Upsilon_{\phi}(\widehat{\mathbf{X}})$ . To ensure the solution is feasible, it must satisfy the following condition: + +$$ +\zeta (\phi ; \mathbf {X}) \leq \chi (\widehat {\mathbf {X}}), \tag {12} +$$ + +where $\chi (\widehat{\mathbf{X}}) = md$ is the number of variables in $\widehat{\mathbf{X}}$ . Based on Eqn. 12, we have $m > = 2$ for BN to ensure a feasible solution. We also provide the ranges of batch size/group number for other normalization methods in Table 1. Note that the batch size $m$ should be larger than or equal to $d$ to achieve a numerically stable solution for BW when using ZCA whitening in practice [20]. This also applies to GW, where $g$ should be less than or equal to $\sqrt{d}$ . + +We then demonstrate that normalization eventually affects the feature representation in a certain layer. Figure 3 shows + +the histogram of normalized output $\widehat{\mathbf{X}}$ , by varying $c$ of $\mathrm{GN}^2$ and $m$ of BN. We observe that: 1) the values of $\widehat{\mathbf{X}}$ are heavily constrained if $c$ or $m$ is too small, e.g., the value of $\widehat{\mathbf{X}}$ is constrained to be $\{-1, +1\}$ if $c = 2; 2)$ $\widehat{\mathbf{X}}$ is not Gaussian if $c$ or $m$ is too small, while BN/GN aims to produce a normalized output with a Gaussian distribution. We believe that the constrained feature representation caused by GN/GW with a large group number is the main factor leading to the degenerated performance of a network. Besides, we also observe that the normalized output of GN is more correlated than that of BN, which supports the claim that BN is more capable of improving the conditioning of activations than GN, as shown in Section 3. + +We also seek to quantitatively measure the representation of a feature space. Given a set of features $\widetilde{\mathbb{D}}\in \mathbb{R}^{d\times N}$ extracted by a network, we assume the examples of $\widetilde{\mathbb{D}}$ belong in a $d$ -dimensional hypercube $V = [-1,1]^d$ (we can ensure that this assumption holds by dividing the maximum absolute value of each dimension). Intuitively, a powerful feature representation implies that the examples from $\widetilde{\mathbb{D}}$ spread over $V$ with large diversity, while a weak representation indicates that they are limited to certain values without diversity. We thus define the diversity of $\widetilde{\mathbb{D}}$ based on the information entropy as follows, which can empirically indicate the representation ability of the feature space to some degree: + +$$ +\Gamma_ {d, T} (\widetilde {\mathbb {D}}) = \sum_ {i = 1} ^ {T ^ {d}} p _ {i} \log p _ {i}. \tag {13} +$$ + +Here, $V$ is evenly divided into $T^d$ bins, and $p_i$ denotes the probability of an example belonging to the $i$ -th bin. We can thus calculate $\Gamma_{d,T}(\widetilde{\mathbb{D}})$ by sampling enough examples. However, calculating $\Gamma_{d,T}(\widetilde{\mathbb{D}})$ with reasonable accuracy requires $O(T^{d})$ examples to be sampled from a $d$ -dimensional space. We thus only calculate $\Gamma_{2,T}(\widetilde{\mathbb{D}})$ in practice by sampling two dimensions, and average the results. We show the diversity of group (batch) normalized features by varying the channels of each group (batch size) in Figure 4, from which we can obtain similar conclusions as in Figure 3. + +In summary, our qualitative and quantitative analyses show that group/batch based normalizations have low diversity of feature representations when $c / m$ is small. We believe these constrained feature representations affect the performance of a network, and can lead to significantly deteriorated results when the representation is over-constrained. + +# 4.2. Effect on Representational Capacity of Model + +The constraints introduced by normalization are believed to affect the representational capacity of neural networks [24], and thus the learnable scale and shift parameters are used to recover the representations [24, 4, 20, 59]. However, such an argument is seldom validated by either theoretical or + +![](images/ea9fa5a5b9d7c231f58745b9486f690ae6ea4f7a08ca8c2d2f787e59d81731cd.jpg) +Figure 4. Diversity of group (batch) normalized features when varying the channels per group (batch size). We sample $N = 1,680,000$ examples and use $1,000^2$ bins. We use the sampled Gaussian data as features in (a) and the output of a one-layer MLP in (b). Here, 'Base' indicates the diversity of unnormalized features. + +![](images/b4e3a9887a2479bdfd6ca76de11aecfd964e39d494e1a93370c1fc3ca3eb02ad.jpg) + +empirical analysis. Theoretically analyzing the complexity measure (e.g., VC dimensions [54] or the number of linear regions [40, 61]) of the representational capacity of neural networks with normalization is a challenging task, because normalized networks do not follow the assumptions for calculating linear regions or VC dimensions. Here, we conduct preliminary experiments, seeking to empirically show how normalization affects the representational capacity of a network, by varying the constraints imposed on the feature. + +We follow the non-parametric randomization tests fitting random labels [67] to empirically compare the representational capacity of neural networks. To rule out the optimization benefits introduced by normalization, we first conduct experiments using a linear classifier, where normalization is also inserted after the linear module. We train over 1,000 epochs using stochastic gradient descent (SGD) with a batch size of 16, and report the best training accuracy among the learning rates in $\{0.001, 0.005, 0.01, 0.05, 0.1\}$ in Figure 5 (a). We observe that GN and GW have lower training accuracy than when normalization is not used, which suggests that normalization does indeed reduce the model's representational capacity in this case. Besides, the accuracy of GN/GW decreases as the group number increases. This suggests that the model may have weaker representational ability when increasing the constraints on the feature. Note that we have the same observations regardless of whether or not the learnable scale and shift parameters of GN/GW are used. + +To further consider the trade-off between the benefits of normalization on optimization and its constraints on representation, we conduct experiments on the one-layer and four-layer MLPs. The results are shown in Figure 5 (b) and (c), respectively. We observe that the model with GN/GW has significantly degenerated training accuracy when $g$ is too large, which means that a large group number heavily limits the model's representational capacity by constraining the feature representation, as discussed in Section 4.2. We note that GW is more sensitive to the group number than GN. The main reason is that $\zeta(\phi_{GW};\mathbb{D})$ is quadratic to $g$ while $\zeta(\phi_{GN};\mathbb{D})$ is linear to it, from Table 1. Besides, we observe that GN and GW still have lower training accuracy than 'Base' on the one-layer MLP, but higher accuracy on + +![](images/f048b508de00c83b18ed059488c10d2a0a76d50e3eef511b19ff20e70ad43a2c.jpg) +(a) Linear classifier + +![](images/b237f378db78d03f82e91aa028fee716f50bd3d7ce0d8ad2db2dfc29c866739f.jpg) +(b) One-layer MLP +Figure 5. Comparison of model representational capacity when fitting random labels [67] on MNIST dataset using different architectures. We vary the group number of GN/GW and evaluate the training accuracy. 'Base' indicates the model without normalization. (a) Linear classifier; (b) One-layer MLP with 256 neurons in each layer; (c) Four-layer MLP with 1,280 neurons in each layer. + +![](images/9ff0d386d80f292aedbc434fdc9d2792e9c757e0b20e4b9076d9f50ca8d6cd74.jpg) +(c) Four-layer MLP + +the four-layer MLP if the group number $g$ is not too large. This suggests that the benefits of normalization on optimization dominate if the model's representation is not too limited. We also observe that the best training accuracy of GW is higher than that of GN. We attribute this to the fact that the whitening operation is better for improving the conditioning of optimization, compared to standardization. We also conduct similar experiments on convolutional neural networks (CNNs). Pleaser refers to the SM for details. + +# 4.3. Discussion of Previous Work + +Previous analyses on BN are mainly derived from the perspective of optimization [46, 33, 28, 8]. One argument is that BN can improve the conditioning of the optimization problem [46, 8, 13, 26, 11], either by avoiding the rank collapse of pre-activation matrices [11, 19] or alleviating the pathological sharpness of the landscape [46, 26, 19]. This argument has been further investigated by computing the spectrum of the Hessian for a large-scale dataset [13]. The improved conditioning enables large learning rates, thus improving the generalization [6, 38]. Another argument is that BN is scale invariant [24, 4], enabling it to adaptively adjust the learning rate [9, 17, 1, 8, 68, 32], which stabilizes and further accelerates training [24, 4]. Other analyses focus on investigating the signal and gradient propagation, either by exploiting mean-field theory [63, 57], or a neural tangent kernel (NTK) [25]. + +Different from these works, we are the first to investigate how BN/GN affects a model's representational capacity, by analyzing the constraint on the representation of internal features. This opens new doors in analyzing and understanding normalization methods. We also investigate how batch size affects the training performance of batch normalized networks (Figure 1 (a)), from the perspective of a model's representational capacity. Several works [48, 22, 21] have shown that batch size is related to the magnitude of stochasticity [2, 53] introduced by BN, which also affects the model's training performance. However, the stochasticity analysis [22] is specific to normalization along the batch dimension, and cannot explain why GN with a large group number has significantly worse performance (Figure 1 (b)). Our work provides a unified analysis for batch and group + +![](images/1c45ee9e7b0608f13bae482ec24654b3f7166909d872f1d669ec96d87de807ef.jpg) +(a) Training accuracy +Figure 6. Effects of group number of GW/GN on ResNet-50 for ImageNet classification. We evaluate the top-1 training and validation accuracies. + +![](images/94cc95879904d739651fc7fbbf314c40491a2a25e090533f9fb28ab4551562fb.jpg) +(b) Validation accuracy + +normalized networks. + +# 5. Large-Scale Visual Recognition Tasks + +We investigate the effectiveness of our proposed GW on large-scale ImageNet classification [45], as well as COCO object detection and segmentation [35]. We use the more efficient and numerically stable 'ItN' (with $T = 5$ ) [22] to calculate the whitening matrix for both GW and BW, in all experiments. Our implementation is based on PyTorch [42]. + +# 5.1. ImageNet Classification + +We experiment on the ImageNet dataset with 1,000 classes [45]. We use the official 1.28M training images as a training set, and evaluate the top-1 accuracy on a single-crop of $224 \times 224$ pixels in the validation set with 50k images. We investigate the ResNet [15] and ResNeXt [60] models. + +# 5.1.1 Ablation Study on ResNet-50 + +We follow the same experimental setup as described in [15], except that we use two GPUs and train over 100 epochs. We apply SGD with a mini-batch size of 256, momentum of 0.9 and weight decay of 0.0001. The initial learning rate is set to 0.1 and divided by 10 at 30, 60 and 90 epochs. Our baseline is the 50-layer ResNet (ResNet-50) trained with BN [24]. + +Effects of group number. We investigate the effects of group number for GW/GN, which we use to replace the B-N of ResNet-50. We vary the group number $g$ ranging in $\{8, 16, 32, 64, 128\}$ (we use the channel number if it is less than the group number in a given layer), and report the training and validation accuracies in Figure 6. We can see that + +
S1S1-B1S1-B2S1-B3S1-B12
Baseline (BN)76.2376.2376.2376.2376.23
BW [22]76.58 (↑0.35)76.68 (↑0.45)76.86 (↑0.63)76.53 (↑0.30)76.60 (↑0.37)
BWΣ [21]76.63 (↑0.40)76.80 (↑0.57)76.76 (↑0.53)76.52 (↑0.29)76.71 (↑0.48)
GW76.76 (↑0.53)77.62 (↑1.39)77.72 (↑1.49)77.47 (↑1.24)77.45 (↑1.22)
+ +Table 2. Effects of position when applying GW on ResNet-50 for ImageNet classification. We evaluate the top-1 validation accuracy on five architectures (S1, S1-B1, S1-B2, S1-B3 and S1-B12). + +
MethodResNet-50ResNet-101ResNeXt-50ResNeXt-101
Baseline (BN) [24]76.2377.6977.0179.29
GN [59]75.71 (↓0.52)77.20 (↓0.49)75.69 (↓1.32)78.00 (↓1.29)
BWΣ [21]77.21 (↑0.98)78.27 (↑0.58)77.29 (↑0.28)79.43 (↑0.14)
GW77.72 (↑1.49)78.71 (↑1.02)78.43 (↑1.42)80.43 (↑1.14)
+ +Table 3. Comparison of validation accuracy on ResNets [15] and ResNeXts [60] for ImageNet. Note that we use an additional layer for $\mathrm{BW}_{\Sigma}$ to learn the decorrelated features, as recommended in [21]. + +GW has consistent improvement over GN in training accuracy, across all values of $g$ , which indicates the advantage of the whitening operation over standardization in terms of optimization. Besides, GW also has better validation accuracy than GN. We believe this may be because the stronger constraints of GW contribute to generalization. We also observe that both GN and GW have significantly reduced training accuracy when the group number is too large (e.g., $g = 128$ ), which is consistent with the previous results in Figure 5. + +Positions of GW. Although GW $(g = 64)$ provides slight improvement over the BN baseline (76.32% vs. 76.23%), it has a 90% additional time cost $^3$ on ResNet-50. Based on the analysis in Section 4, it is reasonable to only partially replace BN with GW in networks, because 1) normalization within a batch or a group of channels both have their advantages in improving the optimization and generalization; 2) whitening can achieve better optimization efficiency and generalization than standardization [20], but at a higher computational cost [20, 22, 49]. + +Here, we investigate the position at which to apply GW $(g = 64)$ in ResNet-50. ResNet and ResNeXt are both composed primarily of a stem layer and multiple bottleneck blocks [15]. We consider: 1) replacing the BN in the stem layer with GW (referred to as 'S1'); and 2) replacing the $1^{st}$ , $2^{nd}$ , $1^{st} \& 2^{nd}$ , and $3^{rd}$ BNs in all the bottleneck blocks, which are referred to as 'B1', 'B2', 'B12' and 'B3', respectively. We investigate five architectures, S1, S1-B1, S1-B2, S1-B3 and S1-B12, which have 1, 17, 17, 17 and 33 GW modules, respectively. We also perform experiments using BW [22] and $\mathrm{BW}_{\Sigma}$ [21] (employing a covariance matrix to estimate the population statistics of BW) for contrast. + +We report the results in Table 2. $\mathrm{BW} / \mathrm{BW}_{\Sigma}$ improve their BN counterparts on all architectures by a clear margin, which demonstrates the advantage of the whitening operation over standardization [22]. GW provides significant improvements + +over $\mathrm{BW} / \mathrm{BW}_{\Sigma}$ on S1-B1, S1-B2, S1-B3 and S1-B12 (an absolute improvement of $0.9\%$ on average). We attribute this to the advantage of GW in avoiding the estimation of population statistics. We also observe that GW has a slightly worse performance on S1-B12 than on S1-B1/S1-B2. We believe there is a trade-off between GW and BN, in terms of affecting the model's representational capacity, optimization efficiency and generalization. + +We also investigate the effect of inserting a GW/BW layer after the last average pooling (before the last linear layer) to learn the decorrelated feature representations, as proposed in [22]. This can slightly improve the performance $(0.10\%)$ on average) when using GW, though the net gain is smaller than using BW $(0.22\%)$ or $\mathrm{BW}_{\Sigma}$ $(0.43\%)$ . Please refer to the SM for details. + +# 5.1.2 Validation on Larger Models + +In this section, we further validate the effectiveness of GW on ResNet-101 [15], ResNeXt-50 and ResNeXt-101 [60]. We apply GW ( $g = 64$ ) in these models following the S1-B2 architecture, which achieves the best performance (Table 2) without significantly increasing the computational cost (it is only increased by roughly $23\%$ ). For comparison, we also apply $\mathrm{BW}_{\Sigma}$ following the 'S1-B2' architecture, combining the learning of decorrelated features [21] ( $\mathrm{BW}_{\Sigma}$ has a slightly improved performance compared to BW [21]). Our baselines are the original networks trained with BN, and we also provide the results trained with GN. + +The results are shown in Table 3. We can see that 1) our method improves the baseline (BN) by a significant margin (between $1.02\%$ and $1.49\%$ ); and 2) $\mathrm{BW}_{\Sigma}$ has consistently better performance than BN, but the net gain is reduced on wider networks (RexNeXt-50 and ResNeXt-101), which is probably caused by the difficulty in estimating the population statistics. We also conduct experiments using more advanced training strategies (e.g., cosine learning rate decay [36], label smoothing [16] and mixup [69]) and GW again improves the baseline consistently. Please refer to the SM for details. + +
2fc head box4conv1fc head box
MethodAPbboxAPbbox50APbbox75APbboxAPbbox50APbbox75
BN†36.3158.3938.8336.3957.2239.56
GN36.62(↑0.31)58.91(↑0.52)39.32(↑0.49)37.86(↑1.47)58.96(↑1.74)40.76(↑1.20)
GW38.13(↑1.82)60.63(↑2.24)41.08(↑2.25)39.60(↑3.21)61.12(↑3.90)43.25(↑3.69)
+ +Table 4. Detection results (%) on COCO using the Faster R-CNN framework implemented in [39]. We use ResNet-50 as the backbone, combined with FPN. All models are trained by 1x lr scheduling (90k iterations), with a batch size of 16 on eight GPUs. + +
Method\(AP^{bbox}\)\(AP^{bbox}\)\(50\)\(AP^{bbox}\)\(75\)\(AP^{mask}\)\(AP^{mask}\)\(50\)\(AP^{mask}\)\(75\)
\(BN^{\dagger}\)42.2463.0046.1937.5359.8239.96
GN42.18(↓0.06)63.22(↑0.22)46.00(↓0.19)37.54(↑0.01)60.18(↑0.36)39.99(↑0.03)
GW44.41(↑2.17)65.36(↑2.36)48.67(↑2.48)39.17(↑1.64)62.13(↑2.31)41.95(↑1.99)
+ +Table 5. Detection and segmentation results (%) on COCO using the Mask R-CNN framework implemented in [39]. We use ResNeXt-101 as the backbone, combined with FPN. All models are trained by 1x lr scheduling (180k iterations), with a batch size of 8 on eight GPUs. + +# 5.2. Object Detection and Segmentation on COCO + +We fine-tune the models trained on ImageNet for object detection and segmentation on the COCO benchmark [35]. We experiment on the Faster R-CNN [44] and Mask R-CNN [14] frameworks using the publicly available codebase 'maskrcnn-benchmark' [39]. We train the models on the COCO train2017 set and evaluate on the COCO val2017 set. We report the standard COCO metrics of average precision (AP), $\mathrm{AP}_{50}$ , and $\mathrm{AP}_{75}$ for bounding box detection $(\mathrm{AP}^{bbox})$ and instance segmentation $(\mathrm{AP}^{m})$ [35]. For BN, we use its frozen version (indicated by $BN^{\dagger}$ ) when fine-tuning for object detection [59]. + +Results on Faster R-CNN. For the Faster R-CNN framework, we use the ResNet-50 models pre-trained on ImageNet (Table 3) as the backbones, combined with the feature pyramid network (FPN) [34]. We consider two setups: 1) we use the box head consisting of two fully connected layers ('2fc') without a normalization layer, as proposed in [34]; 2) following [59], we replace the '2fc' box head with '4conv1fc', which can better leverage GN, and apply GN/GW to the FPN and box head. We use the default hypeparameter configurations from the training scripts provided by the codebase [39] for Faster R-CNN. The results are reported in Table 4. The GW pre-trained model improves $BN^{\dagger}$ and GN by $1.82\%$ and $1.51\%$ AP, respectively. By adding GW/GN to the FPN and '4conv1fc' head box, GW improves $BN^{\dagger}$ and GN by $3.21\%$ and $1.74\%$ AP, respectively. + +Results on Mask R-CNN. For the Mask R-CNN framework, we use the ResNeXt-101 [60] models pre-trained on ImageNet (Table 3) as the backbones, combined with FPN. We use the '4conv1fc' box head, and apply GN/GW to the FPN, box head and mask head. We again use the default hyperparameter configurations from the training scripts provided by the codebase for Mask R-CNN [39]. The results are shown in Table 5. GW achieves $44.41\%$ in box AP and $39.17\%$ in mask AP, an improvement over $BN^{\dagger}$ of $2.17\%$ and $1.64\%$ , respectively. + +Small-batch-size training of BNs. Here, we further show that the network mixed with BNs and GWs can still work well under small-batch-size scenarios. As illustrated in [23], one main cause of BN's small-batch-size problem is the inaccurate estimation between training and inference distributions, which is amplified for a network with increased BN layers (these inaccuracies are compounded with depth). We believe inserting GW (which ensures the same distribution between training and inference) between consecutive BN layers will 'break' these compounding inaccuracies, thus relieving the small-batch-size problem of BNs in a network. We train Faster R-CNN from scratch and use normal BN that is not frozen. We follow the same setup as in the previous experiment (e.g., two images/GPUs). We find that using all BNs only obtains $25.10\%$ AP, while $28.37\%$ AP is achieved using our mixture of BNs and GWs (the S1-B2 architecture). Note that using all GNs (GWs) obtains $28.19\%$ $(28.79\%)$ AP. This experiment further validates that our mixture of BNs and GWs may also help mitigate the small-batch-size problem of the BNs in a network. + +# 6. Conclusion and Future Work + +In this paper, we proposed group whitening (GW), which combines the advantages of normalization within a group of channels and the whitening operation. The effectiveness of GW was validated on large-scale visual recognition tasks. Furthermore, we also analyzed the feature constraints imposed by normalization methods, enabling further understanding of how the batch size (group number) affects the performance of batch (group) normalized networks from the perspective of representational capacity. This analysis can provide theoretical guidance for applying GW and other normalization methods in practice. It would be interesting to build a unified framework to further investigate the effects of normalization in representation, optimization and generalization, by combining the proposed constraint analysis with the previous conditioning analysis [31, 19] and stochasticity analysis [3, 21]. Our GW has also the potentialities to be used as a basic module in the switchable normalization methods [37, 41, 70] to improve their performance. + +# References + +[1] Sanjeev Arora, Zhiyuan Li, and Kaifeng Lyu. Theoretical analysis of auto rate-tuning by batch normalization. In ICLR, 2019. 6 +[2] Andrei Atanov, Armenii Ashukha, Dmitry Molchanov, Kirill Neklyudov, and Dmitry Vetrov. Uncertainty estimation via stochastic batch normalization. In ICLR Workshop, 2018. 6 +[3] Hossein Azizpour, Mattias Teye, and Kevin Smith. Bayesian uncertainty estimation for batch normalized deep networks. In International Conference on Machine Learning (ICML), 2018. 8 +[4] Lei Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 1, 2, 5, 6 +[5] Dario A. Bini, Nicholas J. Higham, and Beatrice Meini. Algorithms for the matrix pth root. Numerical Algorithms, 39(4):349-378, Aug 2005. 2 +[6] Johan Bjorck, Carla Gomes, and Bart Selman. Understanding batch normalization. In NeurIPS, 2018. 6 +[7] Tianle Cai, Shengjie Luo, Keyulu Xu, Di He, Tie-yan Liu, and Liwei Wang. Graphnorm: A principled approach to accelerating graph neural network training. arXiv preprint arXiv:2009.03294, 2020. 1 +[8] Yongqiang Cai, Qianxiao Li, and Zuowei Shen. A quantitative analysis of the effect of batch normalization on gradient descent. In ICML, 2019. 6 +[9] Minhyung Cho and Jaehyung Lee. Riemannian approach to batch normalization. In NeurIPS, 2017. 6 +[10] Tim Coolijmans, Nicolas Ballas, César Laurent, and Aaron C. Courville. Recurrent batch normalization. In ICLR, 2017. 2 +[11] Hadi Daneshmand, Jonas Kohler, Francis Bach, Thomas Hofmann, and Aurelien Lucchi. Theoretical understanding of batch-normalization: A markov chain perspective. arXiv preprint arXiv:2003.01652, 2020. 6 +[12] Guillaume Desjardins, Karen Simonyan, Razvan Pascanu, and koray kavukcuoglu. Natural neural networks. In NeurIPS, 2015. 1 +[13] Behrooz Ghorbani, Shankar Krishnan, and Ying Xiao. An investigation into neural net optimization via hessian eigenvalue density. In ICML, 2019. 6 +[14] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross B. Girshick. Mask R-CNN. In ICCV, 2017. 8 +[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 1, 2, 6, 7 +[16] Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. In CVPR, 2019. 7 +[17] Elad Hoffer, Ron Banner, Itay Golan, and Daniel Soudry. Norm matters: efficient and accurate normalization schemes in deep networks. In NeurIPS, 2018. 6 +[18] Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. In CVPR, 2017. 1 +[19] Lei Huang, Jie Qin, Li Liu, Fan Zhu, and Ling Shao. Layerwise conditioning analysis in exploring the learning dynamics of dnns. In ECCV, 2020. 6, 8 + +[20] Lei Huang, Dawei Yang, Bo Lang, and Jia Deng. Decorrelated batch normalization. In CVPR, 2018. 1, 2, 3, 4, 5, 7 +[21] Lei Huang, Lei Zhao, Yi Zhou, Fan Zhu, Li Liu, and Ling Shao. An investigation into the stochasticity of batch whiten-ing. In CVPR, 2020. 2, 6, 7, 8 +[22] Lei Huang, Yi Zhou, Fan Zhu, Li Liu, and Ling Shao. Iterative normalization: Beyond standardization towards efficient whitening. In CVPR, 2019. 1, 2, 3, 6, 7 +[23] Sergey Ioffe. Batch renormalization: Towards reducing minibatch dependence in batch-normalized models. In NeurIPS, 2017. 1, 2, 8 +[24] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 1, 2, 3, 4, 5, 6, 7 +[25] Arthur Jacot, Franck Gabriel, and Clément Hongler. Freeze and chaos for dnns: an ntk view of batch normalization, checkerboard and boundary effects. arXiv preprint arXiv:1907.05715, 2019. 6 +[26] Ryo Karakida, Shotaro Akaho, and Shun-ichi Amari. The normalization method for alleviating pathological sharpness in wide neural networks. In NeurIPS. 2019. 6 +[27] Agnan Kessy, Alex Lewin, and Korbinian Strimmer. Optimal whitening and decorrelation. The American Statistician, 72(4):309-314, 2018. 2, 3 +[28] Jonas Kohler, Hadi Daneshmand, Aurelien Lucchi, Thomas Hofmann, Ming Zhou, and Klaus Neymeyr. Exponential convergence rates for batch normalization: The power of length-direction decoupling in non-convex optimization. In AISTATS, 2019. 6 +[29] Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. In ECCV, 2020. 1 +[30] César Laurent, Gabriel Pereyra, Philemon Brakel, Ying Zhang, and Yoshua Bengio. Batch normalized recurrent neural networks. In ICASSP, 2016. 2 +[31] Yann LeCun, Léon Bottou, Genevieve B. Orr, and Klaus-Robert Müller. Efficient backprop. In Neural Networks: Tricks of the Trade, pages 9-50, 1998. 1, 8 +[32] Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for batch normalized networks. In ICLR, 2020. 6 +[33] Xiangru Lian and Ji Liu. Revisit batch normalization: New understanding and refinement via composition optimization. In AISTATS, 2019. 6 +[34] Tsung-Yi Lin, Piotr Dólar, Ross B. Girshick, Kaiming He, Bharath Hariharan, and Serge J. Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 8 +[35] 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, 2014. 2, 6, 8 +[36] Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with restarts. In *ICLR*, 2017. 7 +[37] Ping Luo, Jiamin Ren, and Zhanglin Peng. Differentiable learning-to-normalize via switchable normalization. arXiv preprint arXiv:1806.10779, 2018. 1, 8 + +[38] Ping Luo, Xinjiang Wang, Wenqi Shao, and Zhanglin Peng. Towards understanding regularization in batch normalization. In ICLR, 2019. 6 +[39] Francisco Massa and Ross Girshick. maskrcnn-benchmark: Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch. https://github.com/facebookresearch/maskrcnn-benchmark, 2018. Accessed: 09-26-2019. 8 +[40] Guido F Montufar, Razvan Pascanu, Kyunghyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks. In NeurIPS, 2014. 5 +[41] Xingang Pan, Xiaohang Zhan, Jianping Shi, Xiaou Tang, and Ping Luo. Switchable whitening for deep representation learning. In ICCV, 2019. 1, 3, 8 +[42] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NeurIPS Autodiff Workshop, 2017. 3, 6 +[43] Mengye Ren, Renjie Liao, Raquel Urtasun, Fabian H. Sinz, and Richard S. Zemel. Normalizing the normalizers: Comparing and extending network normalization schemes. In ICLR, 2017. 1 +[44] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 8 +[45] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. 2, 6 +[46] Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization? In NeurIPS, 2018. 1, 4, 6 +[47] Wenqi Shao, Shitao Tang, Xingang Pan, Ping Tan, Xiaogang Wang, and Ping Luo. Channel equilibrium networks for learning deep representation. In ICML, 2020. 3 +[48] Alexander Shekhotsov and Boris Flach. Stochastic normalizations as bayesian learning. In ACCV, 2018. 1, 6 +[49] Aliaksandr Siarohin, Enver Sangineto, and Nicu Sebe. Whitening and coloring batch transform for gans. In ICLR, 2019. 2, 3, 7 +[50] Saurabh Singh and Abhinav Shrivastava. Evalnorm: Estimating batch normalization statistics for evaluation. In ICCV, 2019. 1 +[51] Christian Szegedy, Sergey Ioffe, and Vincent Vanhoucke. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, 2017. 1 +[52] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016. 1 +[53] Mattias Teye, Hossein Azizpour, and Kevin Smith. Bayesian uncertainty estimation for batch normalized deep networks. In ICML, 2018. 6 + +[54] Vladimir N Vapnik. An overview of statistical learning theory. IEEE transactions on neural networks, 10(5):988-999, 1999. 5 +[55] 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 +[56] Guangrun Wang, Jiefeng Peng, Ping Luo, Xinjiang Wang, and Liang Lin. Kalman normalization: Normalizing internal representations across network layers. In NeurIPS, 2018. 1 +[57] Mingwei Wei, James Stokes, and David J. Schwab. Meanfield analysis of batch normalization. arXiv preprint arXiv:1903.02606, 2019. 6 +[58] Simon Wiesler and Hermann Ney. A convergence analysis of log-linear training. In NeurIPS, 2011. 1 +[59] Yuxin Wu and Kaiming He. Group normalization. In ECCV, 2018. 1, 2, 3, 5, 7, 8 +[60] Saining Xie, Ross B. Girshick, Piotr Dólar, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017. 2, 6, 7, 8 +[61] Huan Xiong, Lei Huang, Mengyang Yu, Li Liu, Fan Zhu, and Ling Shao. On the number of linear regions of convolutional neural networks. In ICML, 2020. 5 +[62] Jingjing Xu, Xu Sun, Zhiyuan Zhang, Guangxiang Zhao, and Junyang Lin. Understanding and improving layer normalization. In NeurIPS, 2019. 2 +[63] Greg Yang, Jeffrey Pennington, Vinay Rao, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. A mean field theory of batch normalization. In ICLR, 2019. 6 +[64] Chengxi Ye, Matthew Evanusa, Hua He, Anton Mitrokhin, Tom Goldstein, James A. Yorke, Cornelia Fermuller, and Yiannis Aloimonos. Network deconvolution. In ICLR, 2020. 3 +[65] Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V Le. Qanet: Combining local convolution with global self-attention for reading comprehension. In ICLR, 2018. 2 +[66] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016. 1 +[67] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017. 5, 6 +[68] Guodong Zhang, Chaoqi Wang, Bowen Xu, and Roger B. Grosse. Three mechanisms of weight decay regularization. In ICLR, 2019. 6 +[69] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018. 7 +[70] Ruimao Zhang, Zhanglin Peng, Lingyun Wu, Zhen Li, and Ping Luo. Exemplar normalization for learning deep representation. In CVPR, 2020. 8 \ No newline at end of file diff --git a/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/images.zip b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..638723674b90de9a57567b8049e106d8f9dc2141 --- /dev/null +++ b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a9c04cdc7e007a864cc7d10302f47957366bcec34ac0cc17fa51bc44f7c11df +size 439947 diff --git a/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/layout.json b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9163020b31056d467076ca8559c68da3216a39de --- /dev/null +++ b/groupwhiteningbalancinglearningefficiencyandrepresentationalcapacity/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c2762a3eb056b9489c083e4f77cb30105e54e0f87242c31f7911aadbd4ef964 +size 540623 diff --git a/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_content_list.json b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..60512ab4fbba7b4c901f14010facd74e38dbb4bd --- /dev/null +++ b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c55e37061d52639ec0396fb356b798b68986e06b40535412b274f154b54fc426 +size 78181 diff --git a/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_model.json b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c736e9de47e948413d482c9cd4c32954ba735cbc --- /dev/null +++ b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b79464cdb61839708ba1685a2947601d5312c47cc03cf4b0954467d95b259f0b +size 94683 diff --git a/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_origin.pdf b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a280bac8e0f95f7bd8ea5c3581bedf81c5c4d78c --- /dev/null +++ b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/0bf65dde-56f4-4fb0-b84e-6212d5b0c07e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae2dc0c9d8b5bc2662c73336e9c136107720d08b881f4457d09fd27b24cd614 +size 3899984 diff --git a/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/full.md b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/full.md new file mode 100644 index 0000000000000000000000000000000000000000..20c698f5a9bd311f5cf3877a3c1f4f20854b8d6c --- /dev/null +++ b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/full.md @@ -0,0 +1,341 @@ +# Guided Integrated Gradients: an Adaptive Path Method for Removing Noise + +Andrei Kapishnikov, Subhashini Venugopalan, Besim Avci, Ben Wedin, Michael Terry, Tolga Bolukbasi Google Research + +{kapishnikov, vsubhashini, besim, wedin, michaelterry, tolgab}@google.com + +# Abstract + +Integrated Gradients (IG) [29] is a commonly used feature attribution method for deep neural networks. While IG has many desirable properties, the method often produces spurious/noisy pixel attributions in regions that are not related to the predicted class when applied to visual models. While this has been previously noted [27], most existing solutions [25, 17] are aimed at addressing the symptoms by explicitly reducing the noise in the resulting attributions. In this work, we show that one of the causes of the problem is the accumulation of noise along the IG path. To minimize the effect of this source of noise, we propose adapting the attribution path itself - conditioning the path not just on the image but also on the model being explained. We introduce Adaptive Path Methods (APMs) as a generalization of path methods, and Guided IG as a specific instance of an APM. Empirically, Guided IG creates saliency maps better aligned with the model's prediction and the input image that is being explained. We show through qualitative and quantitative experiments that Guided IG outperforms other, related methods in nearly every experiment. + +# 1. Introduction + +As deep neural network computer vision models are integrated into critical applications such as healthcare and security, research on explaining these models has intensified. Feature attribution techniques strive to explain which inputs the model considers to be most important for a given prediction, making them useful tools in debugging models or understanding what they have likely learned. However, while a plethora of techniques have been developed [24, 29, 13, 9, 20], there are still behaviors of these attribution techniques that remain to be understood. In this context, our work is focused on studying the source of noise in attributions produced by path-integral-based methods [27]. + +Gradient-based feature attribution techniques [24, 22] are of particular interest in our work. The main idea behind these techniques is that the partial derivative of the output + +(a) Input image +![](images/6cd140be45befce82b34157558acfe7cde4bf16f0ddfae4d55a2474a996db760.jpg) +Figure 1: Comparing feature attribution for Integrated Gradients and Guided Integrated Gradients. Both (b) and (c) use a black baseline to explain the "house finch" prediction. While (b) has attributions on the bird, there is substantial noise in the attributions compared to (c). This work studies the source of noise, and presents Guided IG as a solution. + +![](images/4b5890f6e8320442748f32918cf7e41d9390f4ae8d6ae9f008a0f927b52acb3c.jpg) +(b) IG attributions + +![](images/dc2a35dc3221d35c11199e8b56758042f17602bf5ebd284477d4cd0b4669b99b.jpg) +(c) Guided IG + +with respect to the input is considered as a measure of the sensitivity of the network for each input dimension. While early methods [24] use the gradients multiplied by the input as a feature attribution technique, more recent methods exploit gradients of the activation maps [22], or integrate gradients over a path [29]. This work studies Integrated Gradients (IG) [29], a commonly used method that is based on game-theoretic ideas in [1]. IG avoids the problem of diminishing influences of features due to gradient saturation, and has desirable theoretical properties. + +One commonly observed problem while calculating Integrated Gradients for vision models is the noise in pixel attribution (Figure 1) originating from gradient accumulation [11, 25, 27, 30] along the integration path. A few possible explanations for this noise have been put forth: (a) high curvature of the output manifold [7]; (b) approximation of the integration with Riemann sum; and (c) choice of baselines [30, 27]. Our experiments indicate that one source of attribution noise comes from regions of correlated, high-magnitude gradients on irrelevant pixels found along the straight line integration path. Our findings correlate with observations in [7], which state that the model surface plays a large role in determining the magnitude of attribution values. + +Methods have been proposed to explicitly reduce the noise in attributions. SmoothGrad [25] averages attributions over multiple samples of the input, created by adding Gaussian noise to the original input. The aggregation im + +![](images/4ea547c41d65dd1de298707927d8098bc3df94ab28be4bfa5c22185eac9f0002.jpg) +(a) Schematic + +![](images/bdf1010911ef579ce2cf6b4c34ae2b0ad7da5b68fc0150ca41f9b74419caa2de.jpg) +(b) IG attributions + +![](images/8aabf40980d906201aab052a13d61a01d70bf81a2b95821a942fb4754683c970.jpg) +(c) Guided IG attributions +Figure 2: Comparing IG and Guided IG's paths and results. (a): For IG, a straight line path from baseline to input is followed (red dotted line), regardless of changes in gradients. For Guided IG, the path is chosen by selecting features that have the smallest absolute value of corresponding partial derivatives (cyan dotted line). Guided IG's goal is to reduce the accumulation of gradients caused by nearby very high/very low prediction examples. (b) and (c): Snapshots of attributions for the flower pot class for Integrated Gradients (center) and Guided IG (right) at alpha values of 0.1, 0.5, and 1.0. The top rows show graphs of the softmax prediction for flower pot as a function of alpha. The second row shows the input image produced by each technique at the three different alpha values. Note that IG's straight line path affects all pixels equally (e.g., see $\alpha = 0.5$ ), while Guided IG reveals the least important features, first. The third row shows each technique's attributions for each of the three alpha values, with Guided IG showing less noise outside the area of the image occupied by the flower pot. + +proves the overall true signal in the attribution. XRAI [12] aggregates attributions within segments to reduce the outlier effect. Sturmfels et al. suggest the choice in baseline is a contributing factor, and propose different baselines as a potential solution [27]. [30] integrate over the frequency dimension by blurring the input image, thereby reducing perturbation artifacts along the attribution path. Dombrowski et al. smooth the network output by converting RLUs to softplus [7]. + +While the above methods address noise in the attributions by manipulating the input (or the baseline), ours examines the entire path of integration. As mentioned in [29], each path from the baseline to the input constitutes a different attribution method; the methods discussed above [29, 25, 12, 27] choose the straight line path, while [30] choose the "blur" path when integrating gradients. In this work, instead of determining the path based on the input and baseline alone, we propose adaptive path methods (APMs) that adapt the path based on the input, baseline, and the model being explained. Our intuition is that model-agnostic paths, such as the straight line, are susceptible to travel through regions that have irregular gradients, resulting in noisy attributions. We posit that adapting the integration path based on the model can avoid selecting samples from anomalous regions when determining attributions. + +We propose Guided Integrated Gradients (Guided IG), an attribution method that integrates gradients along an adaptive path determined by the input, baseline, and the + +model. Guided IG defines a path from the baseline towards the input, moving in the direction of features that have the lowest absolute value of partial derivatives. At each step, Guided IG selects the features (pixel intensities) with the lowest absolute value of partial derivatives (e.g., bottom $10\%$ ), and moves only that subset closer to the intensity in the input image, leaving all others unchanged. As the intensity of specific pixels (features) becomes equal to that in the input image being explained, they are no longer candidates for selection. The attributions resulting from this approach are considerably less noisy. Experiments highlight that Guided IG outperforms other, related methods in nearly every experiment. Our main contributions are as follows: + +- We propose Adaptive Path Methods (APMs) a generalization of path methods [29] that consider the model and input when determining the attribution path. +- We introduce Guided IG, an attribution technique that is an instance of an adaptive path method, and describe its theoretical properties. +- We present experimental results that show Guided IG outperforms other attribution methods quantitatively and reduces noise in the final explanations. + +# 2. Related Work + +Literature on explanation and attribution methods has grown in the last few years, with a few broad categories of approaches: Black-box methods and methods that per + +turb the input [20, 9, 8, 19]; methods utilizing backpropagation [29, 22, 4, 2]; methods that visualize intermediate layers [26, 31, 24, 16, 18]; and techniques that combine these different approaches [12, 25, 3]. Our work extends and improves upon Integrated Gradients [29], a popular technique applicable to many different types of models. Accordingly, we focus on perturbation and back-propagation-based methods. + +Black-box methods such as [20, 9, 8, 19] are model agnostic, and rely on perturbing or modifying the input instance and observing the resulting changes on the model's output. While [20] uses segmentation-based masking of input, [19] generates random smooth masks to determine salient input segments or regions. [9, 8] apply multiple perturbations such as adding noise, or blurring, and optimize over the model output to learn the mask. All of these methods typically require several iterations/evaluations of the model to identify salient regions (or pixels) for a single input. As BlurIG shows [30], perturbations can introduce artifacts (i.e., information not in the original image), adversely affecting the validity of the output. + +Back-propagation methods [29, 22, 4, 2] examine the gradients of the model with respect to an input instance to determine pixel-level attribution. These methods produce a saliency map by weighing the gradient contributions from layers in the network to individual pixels, or entire regions. Our work specifically builds on the path-based Integrated Gradients in [29]. Specifically, our work addresses the issue of noise in pixel attribution in IG, which is highlighted by [25, 12, 27]. While [25] addresses this issue by adding noise-based perturbations to the input, and averaging attributions over the perturbed input samples, [12] aggregates attributions of regions by considering a segmentation of the input. In contrast to these previous methods, our paper addresses this issue of noise by optimizing the path along which the gradients are aggregated. + +# 3. High Gradient Impact on IG Attribution + +In this section, we provide a summary of the Integrated Gradients method, then describe how highly-correlated gradients can introduce noise to IG's attributions. We also show how model-agnostic paths (e.g., a straight line path) can contribute to this problem. + +# 3.1. Integrated Gradients + +For visual models, given an image $x$ , IG calculates attributions per pixel (feature) $i$ by integrating the gradients of the function/model $(F)$ output w.r.t. pixel $i$ as in Eqn. 1. + +$$ +I G _ {i} (x) = \int_ {\alpha = 0} ^ {1} \frac {\partial F (\gamma (\alpha))}{\partial \gamma_ {i} (\alpha)} \frac {\partial \gamma_ {i} (\alpha)}{\partial \alpha} d \alpha \tag {1} +$$ + +![](images/c23f4270c6c3df54da8792847183f35f560b9c91bea7c3104a203ce9f838b966.jpg) +(a) Input image + +![](images/4e918b4fc03af2858cc6b29e749c4ca7a2aeaf57171214062d7edf1af51995d2.jpg) +(b) Directional $\Delta$ + +![](images/ba6b65996e83dd44e426b2a045224b55edf91a81d43dcc32720d431cc0068526.jpg) +(c) Gradient +Figure 3: Differences in magnitude of directional derivative and total gradients. (a): The input image. (b): Signed directional derivative $(\Delta)$ magnitude on the straight-line path from the black baseline to the input image, using the input image from (a). The area under the curve is equal to the total attribution. (c): Magnitude of gradients along the straight-line path, using the input image from (a). Even as the magnitude of directional derivatives is close to 0 from $0.3 < \alpha < 1.0$ , the magnitude of gradients is high, leading to possible gradient accumulation. + +where $\frac{\partial F(x)}{\partial x_i}$ is the gradient of $F$ along the $i^{th}$ feature and $\gamma (\alpha)$ represent images along some integral path $(\alpha \in [0,1])$ . In [29, 25, 12, 17], $\gamma (\alpha)$ is a function that modifies the intensity of pixels from a baseline image $\gamma (\alpha = 0)$ (e.g., a black, white, or random noise image), to that of the input being explained $\gamma (\alpha = 1) = x$ . + +# 3.2. Noise Originating from Model-Agnostic Paths + +In assessing IG's outputs, one can observe noise in the attributions (e.g., Figure 1). Recent work has investigated this noise and accredited it to the selection of baseline [27] or gradient accumulation in saturated regions [17]. Concurring with [7], we observe that the model's surface is also an important factor. + +Looking at the matrix of partial derivatives of the output w.r.t. the input image, we observe that the partial derivatives have a higher by-order-of-magnitude $L_{2}$ norm in comparison to the norm of the directional derivative (in the direction of the integration path) matrix (see Figure 3). This implies that the influence of the inputs not contributing to the output may dominate the gradient map at any integral point. One would hope that gradient vectors pointing to different (incorrect) directions will cancel each other out when the whole path is integrated, but that is not always the case as gradient vectors tend to correlate (e.g., see Figure 5). To put it plainly, spurious pixels that don't contribute to the model output end up having non-zero attributions depending on the model geometry (Figure 4). + +A straight path, where pixel intensities are uniformly interpolated between a baseline and the input, is susceptible to travel through areas where the gradient norm is high and not pointing towards the integration path (indicated by a low cosine similarity between $\nabla F(x)$ and $\vec{d} x$ ). This issue can be minimized by averaging over multiple straight paths [25, 12] or limiting the impact of noise by splitting the path into multiple segments [17]. However, these ap + +proaches sidestep an important issue: attribution methods based on model-agnostic paths will highly depend on surface geometry. + +![](images/fa5c0a3fdcd2e33912e9639f2232f44f882c457397fe714e06c0ae67ecd63f9d.jpg) +Figure 4: High gradients along the straight-line path from baseline (A) to input (E). At any point (B) of the path, it is possible to find points (C) and (D) that are in very close proximity to (B) and have very low (C) and very high prediction scores (D) respectively. Even though these points are part of the path, their close proximity to (B) implies the presence of high gradients along the straight line path. + +![](images/ad69682e3d6aa7f25baf7f8df2090799fb1ea7454f986cca62edd432db91465b.jpg) +Figure 5: Correlation of gradients along the attribution path. Gradients for the Integrated Gradients (blue) and Guided IG (orange) path were calculated for the image from Figure 1. Each subplot shows cosine similarity between gradients at alpha=[0.1, 0.5, 0.9] to the gradients at all other steps of the integration path for IG and GIG. For each graph, the point chosen is indicated with a dashed vertical line. + +# 4. Adaptive Paths and Guided IG + +We introduce adaptive path methods (APMs), a generalization of path methods (PMs), to address the limitations of model-agnostic paths. An APM is similar to the definition of path methods (as in [29]), with the additional property that the path can depend on the model function. Adaptive path methods are a superset of path methods, and are defined as follows. + +Definition: Let $F:\mathbb{R}^N\to \mathbb{R}$ be a function of $X = \{x_{1},\ldots ,x_{N}\}$ . Let $X^{B} = \{x_{1}^{B},\dots,x_{N}^{B}\}$ be the baseline input. Let $X^{I} = \{x_{1}^{I},\dots,x_{N}^{I}\}$ be the input that requires explanation. Let path $c$ be parameterized by a path function + +$\gamma^{F} = (\gamma_{1}^{F}, \dots, \gamma_{N}^{F})$ such that $x_{i} = \gamma_{i}^{F}(\alpha)$ , where $\alpha \in [0,1]$ and $\gamma_{i}(0) = x_{i}^{B}$ and $\gamma_{i}(1) = x_{i}^{I}$ . The adaptive path method attribution of feature $x_{i}$ over curve $c$ for any input $x^{I}$ , is defined as + +$$ +a _ {i} ^ {\gamma^ {F}} (X ^ {I}) = \int_ {\alpha = 0} ^ {1} \frac {\partial F (\gamma^ {F} (\alpha))}{\partial \gamma_ {i} ^ {F} (\alpha)} \frac {\partial \gamma_ {i} ^ {F} (\alpha)}{\partial \alpha} d \alpha . \tag {2} +$$ + +As with any path method, an APM also satisfies Implementation Invariance, Sensitivity, and Completeness axioms defined in Sundararajan et al. [29]. Below, we expand on these properties for a specific instance of an adaptive path method, Guided IG. + +# 4.1. Desired Characteristics + +To alleviate the effect of accumulation of attribution in directions of high gradients unrelated to the input (sec. 3.2), we wish to define a path that avoids those (input) regions causing anomalies in the model behavior. We can call this $(\ell_{noise})$ , and one way to minimize over this is as follows + +$$ +\gamma^ {F *} = \arg \min _ {\gamma^ {F} \in \Gamma} \ell_ {\text {n o i s e}} \tag {3} +$$ + +$$ +\ell_ {n o i s e} = \sum_ {i = 1} ^ {N} \int_ {\alpha = 0} ^ {1} \left| \frac {\partial F (\gamma^ {F} (\alpha))}{\partial \gamma_ {i} ^ {F} (\alpha)} \frac {\partial \gamma_ {i} ^ {F} (\alpha)}{\partial \alpha} \right| d \alpha +$$ + +By minimizing $\ell_{noise}$ at every feature (pixels $i\cdots N$ ) we can hopefully avoid high gradient directions. However, before we can define $\gamma^{F}(\alpha)$ precisely, optimizing the above objective requires knowing the prediction surface of the neural network $F$ at every point in the input space, which is infeasible. So, we propose a greedy approximation method called Guided Integrated Gradients. + +# 4.2. Guided IG + +Guided IG is an instance of an adaptive path method. As with IG, the path $(c)$ starts at the baseline $(X^{B})$ and ends at the input being explained $(X^{I})$ . However, instead of moving features (pixel intensities) in a fixed direction (all pixels incremented identically) towards the input, we make a choice at every step. At each step, we find a subset $\mathbb{S}$ of features (pixels) that have the lowest absolute value of the partial derivatives (e.g., the smallest $10\%$ ) among those features (pixels) that are not yet equal to the input (image pixel intensity). The next step in the path is determined by moving only those pixels in $\mathbb{S}$ closer to their corresponding intensities in the input image. The path ends when all feature values (intensities of all pixels) match the input. Formally, + +- Let $F: R^{N} \to R$ be a function of $X = \{x_{1}, \ldots, x_{N}\}$ . + +The Guided IG integration path, $GIG_{(X^S,X^E,F)}$ , is defined based on the starting point $(X^{S})$ , the ending point $(X^{E})$ + +and the direction vector at every point of the curve: + +$$ +\left[ \begin{array}{l} X ^ {S} = X ^ {B} \\ X ^ {E} = X ^ {I} \\ \frac {\partial \gamma_ {i} ^ {F} (\alpha)}{\partial \alpha} = \left\{ \begin{array}{l l} x _ {i} ^ {I} - x _ {i} ^ {B} & , \text {i f} i \in \mathbb {S}, \\ 0 & , \text {o t h e r w i s e .} \end{array} \right. \end{array} \right. \tag {4} +$$ + +$\mathbb{S}$ is calculated for every point of curve $c$ , and contains features that have the lowest absolute value of the corresponding partial derivative among the features that have not yet reached the input values. More formally, + +$$ +\mathbb {S} = \{i | \forall j: y _ {i} \leq y _ {j} \} \equiv \arg \min _ {i} (Y) \tag {5} +$$ + +$$ +y _ {i} = \left\{ \begin{array}{l l} \left| \frac {\partial F (X)}{\partial x _ {i}} \right| & , \text {i f} i \in \{j \mid x _ {j} \neq x _ {j} ^ {I} \} \\ \infty & , \text {o t h e r w i s e .} \end{array} \right. \tag {6} +$$ + +Guided IG path length. Only features in subset $\mathbb{S}$ are changed at every point of the Guided IG path. Hence in the general case, the $L_{2}$ norm of the Guided IG path is greater than the norm of the straight-line path. The Cauchy-Schwarz inequality provides the upper boundary of the path length: $||GIG||_2\leq \sqrt{N}\cdot ||IG||_2$ , where GIG is the Guided IG path and IG is the straight line path. In terms of the $L_{1}$ norm, the lengths of the paths are always equal, i.e. $||GIG||_1 = ||IG||_1$ . The equality is true because at every point of the Guided IG path individual features of the input are either not changed or changed in the direction of the input. + +Efficient approximation. Guided IG can be efficiently approximated using a Riemann sum with the same asymptotic time complexity as the computation of Integrated Gradients. In domains like images, the number of features is high; therefore, it is not practical to select only one feature at every step. Hence, at every step, the approximation algorithm selects a fraction of features (we use $10\%$ ) with the lowest absolute gradient values and moves the selected features toward the input. At every step, the algorithm reduces the $L_{1}$ distance to the input by the value that is inversely proportional to the number of steps. The higher the number of the steps is, and the lower the fraction is, the closer the approximation is to the true value of Guided IG attribution. We provide our implementation in the Supplement. + +Since Guided IG path is computed dynamically, it is not possible to parallelize the computation for a single input. Parallelization is still possible when calculating attribution for multiple independent inputs (batches). + +# 4.3. Bounded Guided IG + +The optimal solution path to Equation (3) is unbounded and can deviate infinitely off the baseline-input region. + +However, it can be advantageous to stay close to the shortest path. First, staying close to the baseline-input region decreases the likelihood of crossing areas that are too out-of-distribution. Second, it can be computationally cheaper to numerically approximate the integral of a shorter path. + +To this end, we modify the objective in Eqn. 3 to additionally minimize the accumulated distance to the straight-line path $(\ell_{distance})$ . The new objective can then be defined as: + +$$ +\gamma^ {F *} = \arg \min _ {\gamma^ {F} \in \Gamma} \ell_ {\text {n o i s e}} + \lambda \ell_ {\text {d i s t a n c e}} \tag {7} +$$ + +$$ +\ell_ {d i s t a n c e} = \int_ {\alpha = 0} ^ {1} \left| \left| \gamma^ {F} (\alpha) - \gamma^ {I G} (\alpha) \right| \right| d \alpha , +$$ + +where $\gamma^{IG}(\alpha)$ is the parameterized straight-line path and $\lambda$ is the coefficient that balances the two components. For very large values of $\lambda$ (e.g. $\lambda = \infty$ ), the solution of this objective reduces to the shortest path (same as the IG path). Setting $\lambda = 0$ , would give us Eqn. 3, which can be thought of as an unbounded version. + +One approximation of this objective is limiting the maximum distance that the Guided IG path can deviate from the straight line path at any point1. We introduce the concept of anchors as a simple way of achieving this. We divide the straight-line path between the baseline $X^{B}$ and the input $X^{I}$ into $K + 1$ segments and compute Guided IG for each segment separately, effectively forcing the Guided IG path to intersect with the shortest path at $K$ anchor locations. We call this the anchored Guided IG. Accordingly, selecting a higher number of anchors corresponds to optimizing for a higher value of $\lambda$ in Equation 7, making the results of Guided IG closer to IG. On the other hand, when the number of anchors is zero we have the unbounded algorithm described previously. To put it concretely, for the $k^{th}$ segment, its starting $(X_{k}^{S})$ and ending $(X_{k}^{E})$ point can be set as + +- $X_{k}^{S} = (X^{I} - X^{B})(k - 1) / (K + 1) + X^{B}$ , and +$X_{k}^{E} = (X^{I} - X^{B})(k) / (K + 1) + X^{B}$ + +We then define Guided IG with $K$ anchors as: + +$$ +G I G _ {(X ^ {S}, X ^ {E}, F)} (K) = \sum_ {k = 1} ^ {K + 1} G I G _ {(X _ {k} ^ {S}, X _ {k} ^ {E}, F)}. +$$ + +Since the integral is a linear operator, summing the integrals of each individual segment is the same as taking the integral of the whole path. For simplicity, we will ignore the other terms and refer to Guided IG with $K$ anchor points as $GIG(K)$ in the rest of the paper. + +Sometimes, having zero anchors is more favorable as there can be cases where anchors overlap with the high gradient regions on the shortest path. The more anchors there are, the more likely it is to hit a high gradient region and accumulate noise, while staying closer to the shortest path. We will show the effect of anchors in the Results section in more detail. + +# 4.4. Axiomatic Properties of Guided IG + +Guided IG satisfies a subset of desired axioms as IG[29]. We note the ones we satisfy below. As with any path integral in a conservative vector field, Guided IG satisfies the completeness axiom that can be summarized by Eq. (8) (where $a_{i}$ denotes the attribution per pixel/feature) + +$$ +\sum_ {i = 1} ^ {N} a _ {i} = F \left(X ^ {I}\right) - F \left(X ^ {B}\right) \tag {8} +$$ + +Since Guided IG satisfies completeness, it also satisfies Sensitivity(a) (see [29] for the proof). Sensitivity(b)[10] is also satisfied because the partial derivative of a function with respect to a dummy variable is always zero at any point of the path. As a result, the value of the integral in Eq. (2) is always zero for any such variable. + +In the appendix, we provide a proof that Guided IG is Symmetry-Preserving. Symmetry guarantees that if $F(x,y) = F(y,x)$ for all $x$ and $y$ then both $x$ and $y$ should always be assigned equal attribution. The important remark here is that this does not contradict the uniqueness of the IG method. IG satisfies Symmetry for any function; however, given a function, it may be possible to find other paths that satisfy Symmetry. In practice, we always calculate attributions for a given function, e.g., a neural network model. + +Guided IG satisfies the Implementation Invariance axiom; thus, it always produces identical attributions for two functionally equivalent networks. Guided IG preserves the invariance since it only relies on the function gradients and does not depend on the internal structure of the network. There may be other properties that are worth further study such as additivity and uniqueness, please refer to [28]. + +# 5. Experiments and Results + +We evaluate Guided IG by first observing its behavior in attributing a closed path, then examine its performance using common benchmarks, datasets, and models. + +# 5.1. Attribution of a Closed Path + +One challenge in evaluating attribution methods is the lack of ground truth for the attributions themselves [17]. The Completeness axiom guarantees that the sum of all feature attributions for any path is equal to the difference between the function value at the input and the function value at the baseline. Therefore, the sum of all attributions for a + +![](images/fc01ed1c85d7aa5471520fbf433365966fd222a9a8211f1f31c05b965d9efe5a.jpg) +Figure 6: Attribution of closed paths. By calculating the attribution path of the input image with itself via random points, we create an attribution path that in theory should be zero. + +closed path is equal to zero. However, Completeness does not define the values of individual feature attributions, only the sum. We can, however, axiomatically define the ground truth attribution for all features as the average attribution values of all possible paths from the baseline to the input. This definition is similar to Shapley values [23] that are also defined in terms of a sum of all possible paths. Using the axiomatic definition of the ground truth attribution, we can now prove that the ground truth attribution for a closed path $A \to A$ is zero for all features. + +Proof. Let $P$ be a set of all possible paths from point $A$ to point $A$ . Let $a$ denote attribution. For any path $p \in P$ , there exists a counterpart reverse path $p'$ such that $a_i(p) + a_i(p') = 0$ for all features $i$ . Since every path has a counterpart reverse path cancelling its attributions, the average attribution values of individual features are 0. Q.E.D. + +We can build a random path $A \to B \to C \to A$ and consider it as an estimator of ground truth attribution of path $A \to A$ . Using the path integral additive property, we can break the path into sub-segments, i.e., $a(A \to B \to C \to A) = a(A \to B) + a(B \to C) + a(C \to A)$ . Now, we can apply a path method on every segment and treat the sum as an estimation of the ground truth. Figure 6 gives an illustration of the idea. + +We apply this technique to calculate the attribution of each segment using both IG and Guided IG. We sample 50 random paths on 200 random images from the ImageNet validation dataset, for the total of 10,000 path samples. We calculate the mean of the squared error for individual features and average the error across all images, pixels, and channels. The results in Table 1 show that applying Guided IG results in lower error compared to IG. + +
MobileNetInceptionResNet
IG3.817e-075.938e-076.707e-07
Guided IG7.320e-081.442e-071.857e-07
+ +Table 1: Closed path mean squared error for IG and Guided IG. + +
(AUC) MethodImageNetOpen Images ResNetDR [14]
MobileNetInceptionResNet
Edge0.6110.6100.6110.6060.643
Gradients0.6140.6340.6500.5050.801
IG0.6290.6550.6690.5570.833
Blur IG0.6520.6620.6630.6190.830
GIG (0)0.7050.7120.7110.6300.619
GIG (20)0.6910.6960.7060.6240.863*
GradCAM0.7760.7610.7550.4740.837
Smoothgrad
+IG0.7420.7730.7810.6620.637
+GIG(0)0.7450.7760.7760.6490.632
+GIG(20)0.7670.7950.7990.6850.645
XRAI
+IG0.7310.7650.7620.6310.793
+GIG(0)0.838*0.829*0.821*0.7180.630
+GIG(20)0.8080.8190.8090.719*0.831
+ +# 5.2. Quantitative evaluation + +Metrics We compare Guided IG attributions with other attribution methods by employing the AUC-ROC metric as described in [5]. The metric treats the attributions as classifier prediction scores. Ground truth is provided by human annotators. The sliding threshold determines the proportion of features that are assigned to the "true" class. By changing the threshold, the ROC curve is drawn and the AUC of that curve is calculated. + +Additionally, we also use the Softmax Information Curve (SIC AUC) metric from [12]. This method directly measures how well the model performs without using human evaluation. It does so by revealing only the regions that are highlighted by the attribution method and measuring the model's softmax score. The key idea is that the attribution method that has better focus on where the model is truly looking should reach the softmax value faster than another one that is less focused on the correct region. Therefore, this metric evaluates the attribution method from the model's perspective without any human involvement. + +Methods We compare our method against four baselines: edge detector, vanilla Gradients [24], IG, and Blur IG [30] (with max $\sigma = 35$ ). We compare both the unbounded version of Guided IG (listed as GIG(0), where the number of anchors is in parentheses), and variants with anchors (e.g., GIG(20)). The edge detector saliency for an individual pixel is calculated as the average absolute difference between the intensity of the pixel and the intensity of its nearest eight adjacent neighbours. We used 200 steps and the black baseline for all methods that required these parameters. + +# 5.2.1 Datasets + +We evaluated our approach on two datasets of natural images, and one dataset of medical images (described below), and report results in Table 2. + +ImageNet [21] We used images from the standard validation set. We only included images that had ground truth + +Table 2: We report the mean AUC values for different methods using the black baseline for the methods compared. Higher is better. bold indicates highest in each group, * indicates highest overall. + +
(AUC) MethodImageNet-InceptionOpenImagesDR
blackb+w2-rndblackb+w2-rndblackb+w2-rnd
IG0.6550.6670.6890.5570.5720.6000.8330.8240.791
Blur IG0.6620.6620.6620.6190.6190.6190.8300.8300.830
GIG(0)0.7120.7380.7220.6300.6250.6070.6190.5440.510
GIG(10)0.7020.7220.7090.6260.6360.6170.8500.8370.751
GIG(20)0.6960.7140.7040.6240.6390.6170.8630.8500.792
GIG(40)0.6900.7060.6980.6150.6340.6130.865*0.8510.794
XRAI
+IG0.7650.8200.8430.6310.6970.7470.7930.8100.793
+GIG(0)0.8290.854*0.8430.7180.7140.6740.6300.6290.573
+GIG(20)0.8190.8520.8510.7190.7640.7440.8310.8310.788
+GIG(40)0.8150.8520.8490.7090.768*0.7490.8290.8310.795
+ +Table 3: AUC-ROC values for ImageNet Inception model, the Open Images ResNet model, and the DR model, using 3 different choices of baseline - black, black and white, and 2 random (note that BlurIG does not need a baseline); and 4 different anchored versions of GIG $(\mathrm{K} = \{0,10,20,40\})$ . Higher is better, values in bold are highest in each column, $^*$ is highest on dataset. + +
(SIC AUC) +MethodImageNetOpen Images +ResNet
MobileNetInceptionResNet
Edge0.3000.3710.4050.537
Gradients0.3680.4310.5100.595
IG0.4020.4990.5440.694
Blur IG0.4110.501.5600.659
GIG(0)0.4230.5160.5500.634
GIG(20)0.4530.5460.5840.701
GIG(40)0.4530.5510.5920.734
GradCAM0.6910.7390.7630.662
XRAI
+IG0.6710.7360.7550.843
+GIG(40)0.6920.7520.7710.866
+ +Table 4: SIC AUC results [12] for Guided IG and other methods. All methods use black and white baseline if they require it. Values in bold are the highest. + +annotation and were predicted as one of the top 5 classes by the corresponding model. We calculated the AUC-ROC metric for the ImageNet dataset using three pre-trained models: Mobilenet_v2 (n=4016), Inception_v2 (n=3965) and Resnet_v2 (n=3838).2 + +Open Images [15] We evaluated on 5000 random images from the validation set of the Open Images dataset. As with ImageNet, we only included images that had ground truth annotation and were predicted as one of the top 5 classes by the corresponding model. + +Medical Images [6] We also compare our method on a model trained to predict Diabetic Retinopathy (DR). Specifically, we use the Inception-v4 DR classification model from [14]. We examine the results on a sample of 165 images from the validation set [6]. + +From Tables 2 and 4, we can see Guided IG outperforms other methods. Also, Smoothgrad [25] and Guided IG are likely reducing the same sources of noise, so we only see a marginal improvement when combining the two methods. However, adding anchors (e.g., GIG(20)), shows a substantial improvement in performance. We also note + +![](images/bc0bc17bd88b2ce94fca1420193f03dda385923276c027d30ed655cc5a7c1057.jpg) +(a) IG attribution + +![](images/2f3917a05f450616d3f52b54fae2cc9762feb35e1b620112b301eed107a12991.jpg) +(b) Guided IG attribution +Figure 7: Comparison of IG and Guided IG on a retina image [6] used in diagnosing diabetic retinopathy. + +that smoothing does not seem to be a good strategy on the DR dataset where sparser attributions may be preferred; this can also be observed with XRAI, but to a lesser extent. The XRAI method aggregates attributions to image segments, and hence when combined with Guided IG, it shows the best performance on most models. + +# 5.2.2 Effect of baseline choice + +For path methods, there are different options one can choose for the baseline. Table 3 examines the effect of choosing a black baseline, (average over a) black and a white baseline, and (the average over) 2 random baselines. While a black+white baseline is generally a better choice, with GIG(0), we can see that much of the improvement (over IG) is observed on a single black baseline itself. + +# 5.2.3 Effect of number of anchors + +We also report the performance of anchored versions of Guided IG. Table 3 examines all the models on 4 different choice of anchors $K = \{0,10,20,40\}$ (where 0 is simply the unbounded version of Guided IG.) For natural images, it appears that Guided IG without any anchors is a better choice. On the DR dataset, Guided IG seems reliant on anchor points along the straight line path. Overall, Guided IG with a black or black+white baseline and 20 anchor points leads to consistently good performance on the evaluated metrics across all models and datasets. + +# 5.3. Qualitative Results + +Figure 8 shows a sampling of results for IG and Guided IG (more in Appendix) with Inception v2 as the model. As can be seen in these figures, Guided IG generally clusters its attributions around the predicted class object with comparatively less noise in other areas of the image. We provide additional qualitative results including failure examples, proof of symmetry, and pseudocode in the Supplement. + +# 6. Discussion + +Experimental results from Tables 2 and 3 show that adapting the path to avoid high gradient information allows Guided IG to perform better than other tested methods. From Table 3, we can also observe that Guided IG performs well irrespective of the choice of baseline. + +![](images/667c76d6c1a5443bf0fc2acc0bd9babe18a71fe0af8595ba925f5b37fa0c48df.jpg) +Figure 8: Visual comparison of GIG and IG. See how GIG is more focused around the basketball compared to IG. + +In the experimental results, we observe some variation in Guided IG's performance as a function of the number of anchor points. In many cases, these differences are relatively minor; from our experimental results, 20 anchor points may be a reasonable default value to use for this technique. Additionally, while our implementation employs anchor points to prevent paths from becoming too long, there are other ways one could achieve this goal. For example, one could "bound" the path to prevent it from straying too far from the straight line path of IG. Future work could explore alternative methods like this to ensure adaptive paths reduce accumulation of noise, without sacrificing either attribution quality or performance. + +Guided IG demonstrates only one instance of an APM; there may exist other APM instances that are better suited for particular tasks, domains, models. Moreover, while we evaluated Guided IG on visual models and datasets, the same or different variants may be better suited for other modalities such as text or graph models. + +# 7. Conclusion + +This paper introduces the concept of Adaptive Path Methods (APMs) as an alternative to straight line paths in Integrated Gradients. We motivate APMs by observing how attribution noise can accumulate along a straight line path. APMs form the basis for Guided IG, a technique that builds on IG and adapts the path of integration to avoid introduction of attribution noise along the path, while still optionally minimizing the path length to back-off to a straight path. We demonstrate that Guided IG achieves improved results on common attribution metrics for image models. Opportunities for future work include understanding and investigating Guided IG on other modalities, such as text or graph models. + +Acknowledgements We thank Frederick Liu for his technical contributions to the saliency evaluation framework, experiments and feedback, and members of the Google Brain team for feedback on a draft of this work. + +# References + +[1] R. J. AUMANN and L. S. SHAPLEY. Values of Non-Atomic Games. Princeton University Press, 1974. +[2] Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. 2015. +[3] David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6541-6549, 2017. +[4] Alexander Binder, Gregoire Montavon, Sebastian Bach, Klaus-Robert Müller, and Wojciech Samek. Layer-wise relevance propagation for neural networks with local renormalization layers. CoRR, 2016. +[5] Zoya Bylinskii, Tilke Judd, Aude Oliva, Antonio Torralba, and Frédo Durand. What do different evaluation metrics tell us about saliency models? CoRR, abs/1604.03605, 2016. +[6] Jorge Cuadros and George Bresnick. Eyepacs: an adaptable telemedicine system for diabetic retinopathy screening. Journal of Diabetes Science and Technology, 3(3):509-516, 2009. +[7] Ann-Kathrin Dombrowski, Maximillian Alber, Christopher Anders, Marcel Ackermann, Klaus-Robert Müller, and Pan Kessel. Explanations can be manipulated and geometry is to blame. In Advances in Neural Information Processing Systems 32. 2019. +[8] Ruth Fong, Mandela Patrick, and Andrea Vedaldi. Understanding deep networks via extremal perturbations and smooth masks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2950-2958, 2019. +[9] Ruth C Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. In Proceedings of the IEEE International Conference on Computer Vision, pages 3429-3437, 2017. +[10] E. Friedman. Paths and consistency in additive cost sharing. International Journal of Game Theory, 32:501-518, 2004. +[11] Amirata Ghorbani, Abubakar Abid, and James Zou. Interpretation of neural networks is fragile. Proceedings of the AAAI Conference on Artificial Intelligence, 33, 10 2017. +[12] Andrei Kapishnikov, Tolga Bolukbasi, Fernanda Viégas, and Michael Terry. Xrai: Better attributions through regions. In Proceedings of the IEEE International Conference on Computer Vision, pages 4948-4957, 2019. +[13] Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, and Rory Sayres. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav), 2017. +[14] J. Krause, V. Gulshan, E. Rahimy, P. Karth, K. Widner, G. S. Corrado, L. Peng, and D. R. Webster. Grader Variability and the Importance of Reference Standards for Evaluating Machine Learning Models for Diabetic Retinopathy. Ophthalmology, 125(8):1264-1272, 08 2018. +[15] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan + +Popov, Matteo Malloci, Alexander Kolesnikov, and et al. The open images dataset v4. International Journal of Computer Vision, 128(7):19561981, Mar 2020. +[16] Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5188-5196, 2015. +[17] Vivek Miglani, Narine Kokhlikyan, Bilal Alsallakh, Miguel Martin, and Orion Reblitz-Richardson. Investigating saturation effects in integrated gradients, 2020. +[18] Alexander Mordvintsev, Christopher Olah, and Mike Tyka. Inceptionism: Going deeper into neural networks. 2015. +[19] Vitali Petsiuk, Abir Das, and Kate Saenko. Rise: Randomized input sampling for explanation of black-box models, 2018. +[20] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135-1144. ACM, 2016. +[21] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. arXiv:1409.0575 [cs], Sept. 2014. arXiv: 1409.0575. +[22] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision, pages 618-626, 2017. +[23] Lloyd S Shapley. A value for n-person games. Contributions to the Theory of Games, 2(28):307-317, 1953. +[24] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. CoRR, 2013. +[25] Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda B. Viégas, and Martin Wattenberg. Smoothgrad: removing noise by adding noise. ArXiv, abs/1706.03825, 2017. +[26] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net, 2014. +[27] Pascal Sturmfels, Scott Lundberg, and Su-In Lee. Visualizing the impact of feature attribution baselines. Distill, 2020. https://distill.pub/2020/attribute-baselines. +[28] Mukund Sundararajan and Amir Najmi. The many shapley values for model explanation. In International Conference on Machine Learning, pages 9269-9278. PMLR, 2020. +[29] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In ICML, 2017. +[30] Shawn Xu, Subhashini Venugopalan, and Mukund Sundararajan. Attribution in scale and space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +[31] Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. Lecture Notes in Computer Science, page 818833, 2014. \ No newline at end of file diff --git a/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/images.zip b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d0573b4c6d67e08186d3cc9d8b4c4fe07b103c09 --- /dev/null +++ b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfa1e71197d0adb6befada96ca498b2da61109535d652e3884049dd270c3bfe6 +size 435075 diff --git a/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/layout.json b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..bff86abef26ef63eb6eecd4b0d9a61fe3a74c755 --- /dev/null +++ b/guidedintegratedgradientsanadaptivepathmethodforremovingnoise/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ede24de7ccc8f6408088106701be2bd4de1755d7a5f0aef56752ceacae7315ac +size 390382 diff --git a/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_content_list.json b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..78cbf117c30223fabbbf4187d60246b743534b2a --- /dev/null +++ b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:718a69a7e0685a1659d18c30a6504f8e927aac7b587cc6859a342e9884338e05 +size 76419 diff --git a/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_model.json b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_model.json new file mode 100644 index 0000000000000000000000000000000000000000..20924d7ccc92c5a795517d4baa49270fdc7d6cf5 --- /dev/null +++ b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35cbce08e1a3eb7d14edb10c3f3568b2a67d9582a7476672985e24c973586cbd +size 93442 diff --git a/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_origin.pdf b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4b6e8bb8b8bbc970e0f45b9f74a7d79826778acf --- /dev/null +++ b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/43705aa3-985f-4e7f-8e3b-ed831bd38957_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:109060484e600e3aa817c5373177570220278e40e7a08e3f3565e0cdba547a16 +size 1740520 diff --git a/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/full.md b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d1f301108296275703a4b56e24bfec47dd61c319 --- /dev/null +++ b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/full.md @@ -0,0 +1,365 @@ +# Guided Interactive Video Object Segmentation Using Reliability-Based Attention Maps + +Yuk Heo + +Korea University + +yukheo@mcl.korea.ac.kr + +Yeong Jun Koh + +Chungnam National University + +yjkoh@cnu.ac.kr + +Chang-Su Kim + +Korea University + +changsukim@korea.ac.kr + +# Abstract + +We propose a novel guided interactive segmentation (GIS) algorithm for video objects to improve the segmentation accuracy and reduce the interaction time. First, we design the reliability-based attention module to analyze the reliability of multiple annotated frames. Second, we develop the intersection-aware propagation module to propagate segmentation results to neighboring frames. Third, we introduce the GIS mechanism for a user to select unsatisfactory frames quickly with less effort. Experimental results demonstrate that the proposed algorithm provides more accurate segmentation results at a faster speed than conventional algorithms. Codes are available at https://github.com/yuk6heo/GIS-RAmap. + +# 1. Introduction + +Video object segmentation (VOS) is a task to cut out objects of interest in a video. It is useful in various applications such as video editing, video summarization, video inpainting, and self-driving cars. VOS is challenging since it should deal with multiple objects, object deformation, and object occlusion. Because of this difficulty, semi-supervised VOS, which uses a fully annotated segmentation mask in the first frame, has been widely researched. This approach can improve the segmentation performance but requires a lot of time and effort for annotations (e.g. around 79 seconds per instance [4]). Also, it does not have a fallback mechanism when unsatisfactory results are obtained. + +Interactive VOS adopts user-friendly annotations, e.g. scribbles, which are simple enough to provide repeatedly. Figure 1 shows the round-based interactive VOS process. First, a user selects a target frame and draws scribble annotations on it. After extracting query object information from the scribbles, the algorithm obtains segmentation results for all frames. Second, the user finds a frame with unsatisfactory results and then provides additional scribbles. The algorithm then exploits both sets of scribbles to refine the VOS results. This is repeated until the user is satisfied. + +![](images/c90518bdb6e096b04a45f3740d5f2036d63c5c4b2d3d4063211d4404a4c04809.jpg) +Figure 1: Illustration of the round-based interactive VOS. The proposed algorithm greatly reduces the inspection time, by guiding users to select a frame for annotations efficiently and effectively. It is recommended to watch the supplementary video with a real-time demo of the proposed guided interactive system. + +Recently, an automatic simulation scheme of the round-based interactive VOS was designed in [4]. However, the simulation is significantly different from real applications in that it immediately determines segmentation results to correct, by comparing them with the ground-truth. In contrast, a real user should spend considerable time to inspect the results and select poorly segmented regions. Since conventional interactive VOS algorithms [7, 20, 22, 24] have been developed based on the simulation in [4], they do not consider the time for finding unsatisfactory results in practice. In contrast, we propose a guided interactive segmentation (GIS) algorithm for video objects, which guides users to find poorly segmented regions quickly and effectively. + +Moreover, although interactive VOS can use the information in $N$ annotated frames in the $N$ th round, the conventional algorithms [7, 20] do not exploit those multiple annotated frames thoroughly. Heo et al. [7] simply average the features from multiple annotated frames. Miao et al. [20] use only the best matching result between a target frame and multiple annotated frames. On the contrary, we analyze the reliability of each annotated frame to refine segmentation results in a target frame more accurately. + +In this paper, we propose the GIS algorithm using reliability-based attention (R-attention) maps. First, we transfer query object information from annotated frames to a target frame using R-attention maps, which represent pixel-wise reliability of the annotated frames. Next, we perform intersection-aware propagation to propagate segmentation results to neighboring frames sequentially. Third, we compute a guidance score, called R-score, to reduce or remove the processing time for selecting the frame to be annotated in each round. Experimental results demonstrate that the proposed GIS algorithm outperforms recent state-of-the-arts in both the interactive VOS simulation in [4] and real-world applications. + +This paper has three main contributions: + +1. Two novel operators to exploit multiple annotations and neighboring results are developed for VOS: R-attention and intersection-aware propagation modules. +2. We propose the notion of guidance in interactive VOS. +3. The proposed GIS algorithm outperforms the state-of-the-arts significantly in both speed and accuracy. + +# 2. Related Work + +Unsupervised VOS: It is a task to find primary objects [14] without any user annotations in video sequences. Traditional approaches [13, 15, 16, 25, 34] use motion, object proposals, or saliency to solve this problem. Recently, with the availability of big VOS datasets [26, 38], many deep-learning-based unsupervised methods [11, 18, 30, 35, 39-41] have been proposed. + +Semi-supervised VOS: In semi-supervised VOS, a user provides fully annotated masks for target objects at the first frame. Many algorithms have been developed to extract significant features for target objects using user annotations. Early deep learning methods [1, 3, 19, 32] focused on fine-tuning networks using annotation masks at the first frames. Instead of the computationally demanding fine-tuning, some algorithms employ optical flow for initial segment propagation [12] or motion feature extraction [9]. Also, networks to refine segmentation results in previous frames without using motion have been developed in [17, 21]. Instead of the first frame, optimal frames to be annotated in semi-supervised VOS were determined in [6]. Matching-based algorithms [5, 10, 23, 24, 31] perform pixelwise feature matching between annotated and target frames to segment out target objects. For example, key-value memory operations based on non-local networks [36] are performed in [23, 24] to perform the matching between a target frame and already segmented frames. In [37], the selection network, which predicts scores of previously segmented frames, is used to choose the frames for segmentation propagation. + +Interactive VOS: It aims at achieving satisfactory VOS re + +sults through an iterative process of drawing simple annotations, such as scribbles, point clicks, or bounding boxes. Early interactive VOS algorithms [27, 28, 33] constructed graph models, by connecting pixels with edges and then assigning edge weights using hand-craft features. Segmentation results for query objects were then obtained by graph optimization techniques. + +Recently, deep-learning methods have been developed for interactive VOS. Benard and Gygli [2] used point clicks to extract an object mask in a single frame and apply a semi-supervised VOS algorithm to propagate the mask. Chen et al. [5] employed pixel-wise metric learning to cut out a query object using a few point clicks. Caelles et al. [4] introduced a round-based interactive VOS process and the automatic simulation algorithm to mimic human interactions in real applications. Many recent interactive algorithms [7,20,22,24] follow this round-based process. + +Oh et al. [22] developed two segmentation networks for interactive VOS: the first one estimates target object regions from user interactions and the second one propagates the segmentation results to neighboring frames. Miao et al. [20] proposed networks to obtain segmentation results through both interaction and propagation. They employed global and local distance maps in [31] to match a target frame to an annotated frame and the previous frame, respectively. Heo et al. [7] designed global and local transfer modules to effectively transfer features in annotated and previous frames to a target frame. Oh et al. [24] encoded annotation regions into keys and values in a non-local manner. These interactive VOS algorithms [7, 20, 22, 24], however, have limitations. First, they do not consider the processing time to select the poorest segmentation results, on which additional annotations are provided. Second, they do not fully exploit the property that scribble data in multiple annotated frames have different reliability and different relevance to a target frame. + +# 3. Proposed Algorithm + +The proposed algorithm cuts query objects off in a video $\mathcal{I} = \{I_1,\dots ,I_T\}$ with $T$ frames interactively using sparse annotations (scribbles or points) in each segmentation round. Let $I_{a_i}$ at time instance $a_i$ be the annotated frame in the $i$ th round. First, the segmentation is performed bidirectionally starting from $I_{a_1}$ . Subsequently, in the $N$ -th round, it is also done bidirectionally, but using all previously annotated frames $\mathcal{I}_a = \{I_{a_1},\ldots ,I_{a_N}\}$ . + +Figure 2 shows how the proposed algorithm segments a target frame $I_{t}$ . First, we encode $I_{t}$ into the frame feature $\mathbf{F}_t$ . Second, we obtain the interfused object feature $\mathbf{G}_t$ by combining query object information in all annotated frames in $\mathcal{I}_a$ using the R-attention module. Third, using the neighbor frame $I_{n} \in \{I_{t - 1}, I_{t + 1}\}$ and its segmentation result $Y_{n}$ , we perform the intersection-aware propagation to yield the + +![](images/3823c7b2499d645e4a9899b5f3d46d03df0e9e9e4b0f3c6f66ce8787871dd649.jpg) +Figure 2: An overview of the proposed GIS algorithm. + +overlapped object feature $\mathbf{H}_t$ . Last, the segmentation head decodes these three features $\mathbf{F}_t, \mathbf{G}_t$ , and $\mathbf{H}_t$ to generate the segmentation result $Y_t$ of the target frame $I_t$ . + +Moreover, we propose a novel guidance mechanism for interactive VOS. From the R-attention module, we extract the reliability map $R_{t}$ to represent pixel-wise reliability of the segmentation result $Y_{t}$ . Also, by averaging these pixelwise scores, we obtain the R-score $r_t$ . These guidance data $R_{t}$ and $r_t$ enable a user to select a less reliable frame and provide annotations on it more quickly and more effectively. + +# 3.1. Interfused Object Feature + +As in [7], we transfer segmentation information in each annotated frame into a target frame. However, whereas [7] combines the information from multiple annotated frames simply through averaging, we fuse transferred object features based on their reliability levels. To this end, we develop the R-attention module. + +Transition matrix computation: We encode each annotated frame $I_{a_i} \in \mathcal{I}_a$ into $\mathbf{F}_{a_i}$ to obtain the annotated frame feature set $\mathcal{F}_a = \{\mathbf{F}_{a_1}, \dots, \mathbf{F}_{a_N}\}$ . Each frame feature is an $HW \times C_1$ matrix, in which each row contains the $C_1$ -dimensional feature vector for a pixel. Here, $H \times W$ is the spatial resolution of the feature. Then, using the $i$ th annotated feature $\mathbf{F}_{a_i}$ and the target feature $\mathbf{F}_t$ , we obtain the transition matrix + +$$ +\mathbf {A} _ {a _ {i} \rightarrow t} = \operatorname {s o f t m a x} \left(\phi_ {A} \left(\mathbf {F} _ {t}\right) \times \phi_ {A} \left(\mathbf {F} _ {a _ {i}}\right) ^ {T}\right) \tag {1} +$$ + +of size $HW \times HW$ . Here, $\phi_A$ is a feature transform, implemented by a learnable $1 \times 1$ convolution, to reduce the dimension of each row vector from $C_1$ to $C_2$ . Note in Fig- + +ure 2 that a frame feature is used by different modules. To adapt the same feature for different purposes, we employ multiple feature transforms, including $\phi_A$ . + +In (1), the softmax operation is applied to each column. Thus, $\mathbf{A}_{a_i\rightarrow t}$ is a positive matrix with each column adding to 1. It is hence the transition matrix [29], whose entry in row $r$ and column $c$ represents the probability that the $c$ th pixel in $I_{a_i}$ is mapped to the $r$ th pixel in $I_t$ . We compute the transition matrices from all annotated frames to $I_t$ to yield the transition matrix set $\mathcal{A}_{a\to t} = \{\mathbf{A}_{a_1\to t},\dots ,\mathbf{A}_{a_N\to t}\}$ . + +Object feature transfer: We use annotations on $I_{a_i}$ to generate an object saliency map via a sparse-to-dense network in Figure 3. We adopt A-Net [7], the encoder of which is based on SE-ResNet50 [8], as the sparse-to-dense network. To form the feature of the query object, we combine three intermediate features: R3 and R5 features from the encoder and the context feature of the penultimate layer of the decoder. After making their spatial resolutions identical, we convolve and then concatenate them. Then, the concatenated feature passes through another convolution layer to form the object feature $\mathbf{E}_{a_i}$ of size $HW \times C_3$ . Consequently, the object feature set $\mathcal{E}_a = \{\mathbf{E}_{a_1},\dots,\mathbf{E}_{a_N}\}$ is obtained from the $N$ annotated frames. + +We transfer all object features in $\mathcal{E}_a$ to the target frame $I_{t}$ by + +$$ +\mathbf {E} _ {t \mid a _ {i}} = \mathbf {A} _ {a _ {i} \rightarrow t} \times \mathbf {E} _ {a _ {i}} \tag {2} +$$ + +using the transition matrix $\mathbf{A}_{a_i\to t}$ in (1). Thus, we have the transferred object feature set $\mathcal{E}_{t|a} = \{\mathbf{E}_{t|a_1},\dots ,\mathbf{E}_{t|a_N}\}$ , which encodes the object information in $I_{t}$ approximately. Since the reliability of the transition matrix $\mathbf{A}_{a_i\to t}$ is different for each $i$ , it is unreasonable to exploit $\mathbf{E}_{t|a_i}$ equally + +![](images/0b0bc9dbed9488135a60f67de752c28098eefea95660e7e3f08cfc2b6cb7c50b.jpg) +Figure 3: A diagram of the object feature extraction. + +![](images/eaa73fc8effdb883b70b3d51fa35b23ef5cca7f12a13b63ab9661bdc154d1fa1.jpg) +Figure 4: A diagram of the R-attention module. + +for the query object segmentation. To address this issue, we propose the R-attention mechanism. + +R-attention: Figure 4 shows how to generate R-attention maps. Similar to (2), let $\mathbf{F}_{t_2|t_1} = \mathbf{A}_{t_1\to t_2}\times \phi_R(\mathbf{F}_{t_1})$ denote the transferred frame feature from $I_{t_1}$ to $I_{t_2}$ , where $\phi_R$ is a feature transform. We obtain the feature difference matrix + +$$ +\mathbf {D} _ {t \mid a _ {i}} = \left[ \mathbf {F} _ {t \mid a _ {i}} - \mathbf {F} _ {t \mid t} \right] ^ {\circ 2} \tag {3} +$$ + +where $\circ 2$ is the entry-wise power operator. Note that its entry $\mathbf{D}_{t|a_i}(p,c)$ equals the squared distance between the $c$ th feature components of pixel $p$ in $\mathbf{F}_{t|a_i}$ and $\mathbf{F}_{t|t}$ . Ideally, all entries in $\mathbf{D}_{t|a_i}$ should be near zero, because both $\mathbf{F}_{t|a_i}$ and $\mathbf{F}_{t|t}$ represent the same frame $I_t$ . However, they are not in practice, since the transition matrix $\mathbf{A}_{a_i\to t}$ in (2) is imperfect. For the same reason, the transferred object feature $\mathbf{E}_{t|a_i}$ in (2) may be unreliable. Hence, we define the reliability map $R_{t|a_i}$ for $\mathbf{E}_{t|a_i}$ as + +$$ +R _ {t \mid a _ {i}} (p) = \frac {1}{\max _ {c} \mathbf {D} _ {t \mid a _ {i}} (p , c) + \epsilon} \quad \text {f o r e a c h} p, \tag {4} +$$ + +where $\epsilon$ is a small positive number to prevent division by zero. A large value of $R_{t|a_i}(p)$ indicates that the $p$ th row vector (i.e. feature vector for pixel $p$ ) in $\mathbf{E}_{t|a_i}$ is reliable. + +By applying the softmax function over the $N$ reliability maps, we generate the R-attention map $M_{t|a_i}$ for the transferred object feature $\mathbf{E}_{t|a_i}$ , which is given by + +$$ +M _ {t \mid a _ {i}} (p) = \frac {\exp R _ {t \mid a _ {i}} (p)}{\sum_ {k = 1} ^ {N} \exp R _ {t \mid a _ {k}} (p)} \quad \text {f o r e a c h} p. \tag {5} +$$ + +![](images/a9d406efa31916511244dbd85e83d6c65314c4a2f8201c081b0b9c8a98363855.jpg) +Figure 5: A diagram of the intersection-aware propagation. + +Next, we obtain the interfused object feature $\mathbf{G}_t$ by fusing all transferred object features using the R-attention maps, + +$$ +\mathbf {G} _ {t} = \sum_ {i = 1} ^ {N} M _ {t | a _ {i}} \otimes \mathbf {E} _ {t | a _ {i}} \tag {6} +$$ + +where $\otimes$ means that $M_{t|a_i}$ is multiplied entry-wise to each column in $\mathbf{E}_{t|a_i}$ . Through this R-attention mechanism, the interfused feature $\mathbf{G}_t$ contains more reliable information about the query object than each individual $\mathbf{E}_{t|a_i}$ does. + +Furthermore, by aggregating $R_{t|a_1},\ldots ,R_{t|a_N}$ , we generate the overall reliability map $R_{t}$ by + +$$ +R _ {t} (p) = \max _ {i} \exp \left(R _ {t | a _ {i}} (p) - \frac {1}{\epsilon}\right). \tag {7} +$$ + +Note from (4) and (7) that each $R_{t}(p)$ is in the range [0, 1], with 1 indicating the maximum reliability level. A high $R_{t}(p)$ means that the interfused feature vector for pixel $p$ in $\mathbf{G}_{t}$ is reliable. Because $\mathbf{G}_{t}$ plays an essential role in segmenting the target frame $I_{t}$ , $R_{t}(p)$ also represents the reliability of the segmentation result. Section ?? describes how to use $R_{t}$ to guide the interactive VOS process. + +# 3.2. Overlapped Object Feature + +When segmenting the target frame $I_{t}$ , the segmentation result $Y_{n}$ of the neighbor frame $I_{n} \in \{I_{t - 1}, I_{t + 1}\}$ is available according to the segmentation direction. We exploit this neighbor information to delineate the query object in $I_{t}$ more accurately. As shown in Figure 5, we first obtain the neighbor similarity + +$$ +\mathbf {S} _ {t} = \exp \left(- \left[ \phi_ {S} (\mathbf {F} _ {t}) - \phi_ {S} (\mathbf {F} _ {n}) \right] ^ {\circ 2}\right) \tag {8} +$$ + +using a feature transform $\phi_S$ . $\mathbf{S}_t$ represents how similar the features of $I_{t}$ and $I_{n}$ are to each other. A row vector in $\mathbf{S}_t$ tends to have entries near one, when the corresponding pixel belongs to the intersection of the same object between the adjacent frames, as illustrated in Figure 6. + +Next, we convert $\mathbf{F}_n$ via another feature transform $\phi_Y$ and concatenate it with $Y_{n}$ . We convolve this concatenated signal to yield $\mathbf{Y}_n$ that represents the query object in $I_{n}$ . We then concatenate $\mathbf{S}_t$ and $\mathbf{Y}_n$ and use another convolution layer to obtain the overlapped object feature $\mathbf{H}_t$ . Note that $\mathbf{S}_t$ indicates the overlapped region (or intersection) of the query object in $I_{n}$ and $I_{t}$ . Therefore, we combine $\mathbf{S}_t$ and + +![](images/93c07c244e4299c3accc85e76c6b15e021c76af4d279da4237a983201c0fb388.jpg) +Figure 6: An example of the neighbor similarity $\mathbf{S}_t$ . The green pixels belong to the intersection, whereas the blue ones do not. + +$\mathbf{Y}_n$ to recognize the query object feature in the overlapped region, and hand over this information to the target frame $I_{t}$ via $\mathbf{H}_t$ . This intersection-aware propagation of object information enables the segment head to exploit the neighbor information selectively and reliably. + +Last, we use the frame feature $\mathbf{F}_t$ , the interfused object feature $\mathbf{G}_t$ , and the overlapped object feature $\mathbf{H}_t$ to obtain the segmentation mask $Y_t$ . + +# 3.3. Guided Interactive VOS Process + +In the first round, to segment the target frame $I_{t} = I_{a_{1}}$ , we set $I_{n} = I_{a_{1}}$ and substitute $Y_{n}$ with the saliency map of $I_{t}$ generated by the sparse-to-dense network. This is because there is no neighbor frame already segmented. After performing the segmentation of $I_{a_{1}}$ , we propagate the segmentation mask $Y_{a_{1}}$ bidirectionally to segment the other frames. In the second round, sparse annotations are given on $I_{a_{2}}$ to refine its segmentation result $Y_{a_{2}}$ , which is also propagated bidirectionally until another annotated frame is met. This is repeated until the user is satisfied with the VOS result. Figure 7 illustrates this process. + +Suppose that there are $K$ query objects with their annotations. Then, for each query object in each target frame $I_{t}$ , the segmentation head uses the three features $\mathbf{F}_t$ , $\mathbf{G}_t$ , $\mathbf{H}_t$ to estimate the object probability map. Consequently, we have $\hat{Y}_{t,1}, \dots, \hat{Y}_{t,K}$ , where $\hat{Y}_{t,k}$ denotes the probability map for the $k$ th query object. By applying the soft aggregation scheme [23] to these maps and then allocating each pixel to the background or the query object with the highest probability, we yield the binary segmentation masks $Y_{t,1}, \dots, Y_{t,K}$ at the target frame. + +In interactive VOS, it is important to enable the user to provide annotations quickly with less effort. Therefore, after performing the segmentation in each round, we compute the R-score $r_t$ of each frame $I_t$ , + +$$ +r _ {t} = \frac {\alpha}{\| \mathcal {U} _ {t} \|} \sum_ {p \in \mathcal {U}} R _ {t} (p) + \frac {1 - \alpha}{\| \mathcal {O} _ {t} \|} \sum_ {p \in \mathcal {O}} R _ {t} (p) \tag {9} +$$ + +where $\mathcal{U}_t$ is the set of pixels in the entire frame and $\mathcal{O}_t$ is the union set of pixels in the segmented object regions. When $\alpha = 0$ , the pixel-wise reliability in (7) is averaged over the foreground segments only. When $\alpha = 1$ , it is averaged over + +![](images/4f84b12166ca3ca72d986d3f5f7aafc07e068b88d449f0b1faef7f9b2fc5a941.jpg) +Figure 7: Illustration of the interactive VOS process. + +the entire frame. In this work, $\alpha$ is set to 0.5 to consider all pixels but also to emphasize the foreground segments. + +Guided selection of annotated frames: In practice, it takes considerable time to find the most poorly segmented frame and provide annotations. To alleviate this problem, from the second round, the R-scores $\{r_1,\dots,r_T\}$ are used to guide the user to provide additional annotations for the next round. Instead of a time-consuming search over the entire video, the user can select the frames for annotations in two ways. + +- RS1: The single frame with the lowest R-score is chosen for next annotations. +- RS4: The four frames with the lowest R-scores are determined subject to the constraint that their time distances are at least $T / 10$ . In the interactive VOS simulation, the most poorly segmented frame is selected among the four frames, by comparing the segmentation results with the ground-truth. In real applications, users are provided with the segmentation results of these four guided frames only. Then, the user chooses a frame among them and provides annotations. The interactive process terminates, when the user is satisfied with the guided frames. + +# 3.4. Implementation Details + +Network details: To encode each frame $I_{t}$ to the frame feature $\mathbf{F}_t$ , we employ SE-ResNet50 [8] from the first layer to R4 with an output stride 8. Thus, $H$ and $W$ in Section 3.1 are $\frac{1}{8}$ of the height and width of an input frame, respectively. The dimension $C_1$ of each frame feature vector is 1,024, while the dimensions $C_2$ of output vectors of the four feature transforms $\phi_A, \phi_R, \phi_S$ , and $\phi_Y$ are equally set to 128. Also, $C_3$ for $\mathbf{E}_t, \mathbf{G}_t$ , and $\mathbf{H}_t$ is set to 256. For the segmentation head, we adopt the decoder architecture in [7]. + +Training: We use the training sets of DAVIS2017 [26] and YouTube-VOS [38]. To emulate the first round, we randomly form a mini-sequence by taking five consecutive frames (one annotated frame and four target frames) from a video sequence. To emulate the second round, we pick one additional frame as the second annotated frame. In the training, we proceed up to the second round due to limited + +Table 1: Comparative assessment of the proposed algorithm with the state-of-the-art interactive VOS algorithms on the DAVIS2017 validation set. The best results are boldfaced. + +
AUC-JJ@60sAUC-J&FJ&F@60s
Oh et al. [22]0.6910.7340.7780.787
Miao et al. [20]0.7490.7610.7870.795
Heo et al. [7]0.7710.7900.8090.827
Oh et al. [24]--0.8390.848
Proposed-GT0.8170.8260.8530.863
Proposed-RS10.8180.8270.8550.864
Proposed-RS40.8200.8290.8560.866
+ +GPU memories. To imitate sparse annotations, we use two types: 1) random points and 2) scribble generation in [4]. More implementation details are in the supplementary document. + +# 4. Experimental Results + +First, we compare the proposed GIS algorithm with the state-of-the-art interactive VOS algorithms. Second, we analyze the proposed algorithm through various ablation studies and visualization of feature maps. Third, we perform a user study to demonstrate the effectiveness of the proposed algorithm in real applications. + +# 4.1. Comparative Assessment + +Interactive VOS simulation is conducted on two datasets: DAVIS2017 [26] and YouTube-IVOS. + +DAVIS2017: In the DAVIS interactive VOS simulation [4], human interactions are emulated up to 8 rounds by an algorithm. In each round, after VOS is performed, the algorithm determines the frame with the poorest performance, by comparing the segmentation results with the groundtruth, and provides additional annotations on it. We follow this procedure for the comparison with conventional algorithms. We also follow the two guided procedures RS1 and RS4 in Section 3.3 to confirm the effectiveness of R-scores. The validation set of 30 video sequences in DAVIS2017 is used for the assessment. For each video sequence, three distinct initial scribbles are provided, which means that the performance is averaged over 90 interactive VOS trials. + +We quantify the segmentation performance using the region similarity (J) and the contour accuracy (F). We measure the area under the curve (AUC) of a performance-versus-time graph from 0 to 488 seconds for J score (AUC-J) or for joint J and F scores (AUC-J&F). Also, we measure the performance at 60 seconds for J score (J@60s) or for joint J and F scores (J&F@60s) to assess how accurately the segmentation is carried out within 60 seconds. + +Table 1 compares the proposed GIS algorithm with the recent state-of-the-art algorithms [7, 20, 22, 24], in which + +![](images/08c89106393a0841f431937d8a7354841f239b6344882821423ac649b7f5b9bf.jpg) +Figure 8: Comparison of J&F scores on the DAVIS2017 validation set according to the rounds. + +Proposed-GT, Proposed-RS1, and Proposed-RS4 denote the settings when the ground-truth, RS1, and RS4 are used to choose frames to be annotated in next rounds, respectively. Note that Proposed-GT has the same experimental conditions as the conventional algorithms [7, 20, 22, 24]. In Proposed-RS4, the DAVIS algorithm selects the poorest frame among the four guided frames using the ground-truth. In all settings, the DAVIS algorithm provides annotations. The scores of the conventional algorithms are provided by the respective authors. It can be observed from Table 1 that the proposed algorithm outperforms the state-of-the-arts by significant margins in all metrics. In other words, the proposed algorithm performs the best in both accuracy and speed. Also, Proposed-RS1 and Proposed-RS4 perform better than Proposed-GT, by employing R-scores and selecting annotated frames effectively. Figure 8 shows the J&F scores according to the rounds. The proposed algorithm yields the best score in every round with no exception. + +YouTube-IVOS: For extensive experiments, we construct the YouTube-IVOS dataset from YouTube-VOS [38], which is the largest VOS dataset. For the DAVIS algorithm to emulate user interactions, ground-truth segmentation masks are needed. Since the validation set in YouTube-VOS does not provide the ground-truth, we sample 200 videos from its training set to compose YouTube-IVOS. For each video, we generate four different initial annotations by varying the number of point clicks. Specifically, we randomly pick 5, 10, 20, and 50 point clicks from the ground-truth mask for each query object and then use those clicks as annotations in the first round. The interactive VOS is performed up to 4 rounds, since the performance is saturated in early rounds due to the short lengths of the YouTube-VOS videos. + +Table 2 compares the average J&F scores of the proposed algorithm with those of Miao et al. [20] and Heo et al. [7] according to the rounds. Notice that [22] and [24] are not compared in this test, because their full source codes are unavailable. In this test, the proposed GIS network and the Heo et al.'s network are trained without the 200 videos in YouTube-IVOS. We see that the proposed algorithm outperforms the other algorithms meaningfully in all rounds. + +Table 2: Comparative assessment of the proposed algorithm with the state-of-the-art interactive VOS algorithms on the Youtube-IVOS dataset. + +
J&F-1stJ&F-2ndJ&F-3rdJ&F-4th
Miao et al. [20]0.5250.6200.6740.706
Heo et al. [7]0.6430.7210.7680.797
Proposed-GT0.6720.7540.8060.830
+ +![](images/455e4c1ed661c6723efbbf2032e6980b2a0e779334a27b61b062b9477344569d.jpg) +(a) + +![](images/739ad613cf4adf15d8de9f5c264a9725dfa2f7469ed3b66ead30f7a5b70cc6a5.jpg) +(b) +Figure 9: Ablation study results on the DAVIS2017 validation set. + +# 4.2. Analysis + +Ablation study: We analyze the effectiveness of three components in the proposed algorithm: + +(1) R-attention (RA) +(2) Intersection-aware propagation (IAP) +(3) R-score guidance with four candidate frames (RS4) + +Figure 9 plots the J&F scores of four settings A, B, C, and D, combining these three components, on the DAVIS2017 validation set. First, using R-attention maps, the overall performance in every round increases significantly (gaps between A and B). Also, the intersection-aware propagation improves the performance especially in early rounds (gaps between B and C). The R-score guidance affects the performance only slightly (gaps between C and D), because in this test the computer searches the frames to be annotated using the ground-truth. In real applications, the R-score guidance enables human users to search the frames efficiently and thus reduces the overall segmentation time, as will be verified in later experiments. + +Intersection-aware propagation: We compare the proposed IAP module with two existing propagation methods: the local distance map (LDM) in [20] and the local transfer module (LTM) in [7]. LDM matches each pixel in a target frame to a local region in a neighbor frame at the feature level to estimate a local distance map, while LTM transfers the segmentation result of a neighbor frame based on the local affinity. In Table 3, the baseline means the proposed network without IAP. In other words, the baseline uses only the frame feature $\mathbf{F}_t$ and the interfused object feature $\mathbf{G}_t$ + +Table 3: Comparison of the proposed intersection-aware propagation (IAP) module with conventional local propagation methods on the DAVIS2017 validation dataset. + +
J&F-1stJ&F-3rdJ&F-5thFPS
Baseline0.7170.8210.8399.26
Baseline+LDM [20]0.7270.8240.8448.23
Baseline+LTM [7]0.7300.8280.8468.69
Baseline+IAP0.7370.8320.8508.72
+ +for the segmentation. We plug LDM or LTM into the baseline. Table 3 compares the J&F scores in 1st, 3rd, and 5th rounds and the segmentation speeds (frames per second, FPS). Compared with LDM and LTM, the proposed IAP helps the baseline network to achieve higher segmentation accuracies and a faster speed. + +R-attention maps: Figure 10 illustrates R-attention maps $M_{t|a_i}$ in (5). Specifically, the first and second rows in Figure 10 show the R-attention maps of the first annotation at $I_{a_1}$ and the second annotation at $I_{a_2}$ , respectively. We sample time instances $t_1 \sim t_5$ uniformly between $a_1$ and $a_2$ . Note that R-attention values depend on the pixel-wise feature similarities between annotated and target frames. For instance, $M_{t_4|a_1}$ has low R-attention values on the query objects (cart and two people), which have significantly different appearance and sizes between $I_{a_1}$ and $I_{t_4}$ . Also, $M_{t_3|a_2}$ has low R-attention values around the plywood ramp that almost disappears in $I_{a_2}$ . This example indicates that R-attention module faithfully provides the reliability information of the transferred object feature from the annotated frame to the target frame. + +Reliability maps and R-scores: Examples of reliability maps and R-scores are in Figure 11. In the first round, a poor segmentation result for a woman marked in yellow is obtained, because she is partly occluded by a man riding a bike. Thus, the proposed algorithm yields the reliability map that has low values within the black box containing the woman. As the segmentation result is refined in subsequent rounds, the reliability map has higher values and the R-score gets larger. This means that both the reliability map $R_{t}$ in (4) and the R-score $r_t$ in (9) are good indicators of how accurately the target frame $I_{t}$ is segmented. + +# 4.3. User Study + +We conducted a user study to assess the proposed GIS algorithm in real applications. We recruited 12 volunteers, who provided scribbles iteratively until they were satisfied. We measured the average time in seconds per video (SPV), including the time for providing scribbles, the running time of the algorithm, and the time for finding unsatisfactory frames. Also, we measured the average rounds per video (RPV) and the average J&F score over all video sequences. + +![](images/cebfd8f834307b3fddec25cddb72f18fb8777285dd315cb29fa1ded232f43e8e.jpg) + +![](images/36d5e54f5943cb3c426069223576efe0f456049c764fee4bab28388ad2a2c75e.jpg) + +![](images/4e87a5ff2aaffb1f8bb6e136864243114d2ff693388779ad148e3d39cef10c65.jpg) + +![](images/a207a24c3f2350f661424e4b07b46c874126888c6332cf7545327da06970805c.jpg) + +![](images/300ee1b798c2939ba93d9d26e42fd38ac1fbebb9d4a5569288f574c42a7a45eb.jpg) + +![](images/b63683c16564776e01012803d8e0b5d0d9a40fc9ce646ae4f97a91a893ba0b7c.jpg) + +![](images/c3d65c6ac71b4ed132bdf6cff12ef3ebc04883a213a1caae1b9c2e1e2b3d316f.jpg) + +![](images/d5f453ceb6f20abfd3d31b64fc2cbb8c89b70a230dc939d06f2a21eece312acd.jpg) + +![](images/8cca86a8f60406b2946c3c19b6774fc86888ab2894278864ce348fa2ffb74727.jpg) + +![](images/cd669c7c34545d7870bbb9d262b7d1fea7b555cc4ceac4c2eed075e6f30f8927.jpg) + +![](images/98b58a4e9ad50dc42ea0c3684b37b3d0028aa3b85738057fabc86f3c5a0098df.jpg) + +![](images/13666edc2be46c05a2ec095502b4d9c586edc44031b298d1cb11922323d4f776.jpg) + +![](images/6a86da277baef2bdb5090bff97d376ddce6b654c59738cc4b3bc81574210183f.jpg) +Figure 10: Visualization of R-attention maps and segmentation results on the "soapbox" sequence in the second round. + +![](images/9f1ef2f9f183a7e1edac5a80d69f3a4c1468be4f14bc08ef3539875998810af6.jpg) + +![](images/cc2dc7484b6d0fcffd2ec28bed48164791a14ed6125255e9a02d1e50b118b230.jpg) + +![](images/f45663454b0c6f0316f263dfc33a2ff31a5baa6b6c622baaed92428f5d18f8a0.jpg) + +![](images/65449e679a06cc67823d79b224dbcd4a5bf8d88c4e5c0b5bdf2cc774f25083c7.jpg) + +![](images/198ca4d2ae0d6f2f629eff29fe6967de5e982c51bd452390a9b13c0ace8e37bb.jpg) + +![](images/f0fb4ebf52037d718ec3e8ed5240a69039b1d8d024f2a051d1dc4058c210c657.jpg) + +![](images/f767f150c55a4f788b5732fbc1800b290dc72a4ff00ea0fb99e000108c91c463.jpg) +Figure 11: The reliability maps and R-scores for the 33rd frame of the "India" video in the first, third, and eighth rounds. The number in the upper right corner of each reliability map is the R-score. + +Table 4 compares these user study results on the validation set in DAVIS2017 [26]. 'Proposed w/o RS' denotes the proposed algorithm without using R-scores. All three settings of the proposed algorithm outperform the state-of-the-art algorithm [7] in all metrics. This indicates that the proposed algorithm requires less running time and less interaction, while providing better segmentation results. Proposed-RS1 and Proposed-RS4 require less time to complete the process than 'Proposed w/o RS' with only negligible performance degradation, by removing or reducing the time for selecting unsatisfactory frames as shown in Figure 12. Especially, the total time for segmenting a video is significantly reduced in Proposed-RS1, which needs no time for inspection. + +# 5. Conclusions + +We proposed the novel GIS algorithm for video objects based on R-attention and intersection-aware propagation. First, the interfused object feature is extracted by transferring query object information from annotated frames to a target frame using the R-attention module. Second, the overlapped object feature is obtained via the intersection-aware propagation using a neighbor frame. Then, the segmentation is performed using the frame feature, interfused + +Table 4: User study results. + +
SPV(s)RPVJ&F
Heo et al. [7]66.832.420.769
Proposed w/o RS46.011.890.794
Proposed-RS134.591.820.789
Proposed-RS437.101.690.794
+ +![](images/13ae31b327d0bbfd0489c76d1a57912eb19c15b62522a7a5b14e56085dcdda04.jpg) +Figure 12: The total time and the inspection time for selecting unsatisfactory frames per video. Each user is represented by each mark. + +object feature, and overlapped object feature. Moreover, we developed the GIS mechanism that enables users to determine next annotated frames quickly. Experimental results showed that the proposed algorithm outperforms the conventional algorithms significantly. + +# Acknowledgements + +This work was supported in part by the National Research Foundation of Korea (NRF) grant funded by MSIT, Korea (No. NRF-2018R1A2B3003896), in part by MSIT, Korea, under the ITRC support program (IITP-2020-2016-0-00464) supervised by the IITP, and in part by the NRF grant funded by MSIT, Korea (No. NRF-2019R1F1A1062907). + +# References + +[1] L. Bao, B. Wu, and W. Liu. CNN in MRF: Video object segmentation via inference in a CNN-based higher-order spatiotemporal MRF. In CVPR, 2018. +[2] A. Benard and M. Gygli. Interactive video object segmentation in the wild. 2017. +[3] S. Caelles, K.-K. Maninis, J. Pont-Tuset, L. Leal-Taixe, D. Cremers, and L. Van Gool. One-shot video object segmentation. In CVPR, 2017. +[4] S. Caelles, A. Montes, K.-K. Maninis, Y. Chen, L. Van Gool, F. Perazzi, and J. Pont-Tuset. The 2018 DAVIS challenge on video object segmentation. In arXiv:1803.00557, 2018. +[5] Y. Chen, J. Pont-Tuset, A. Montes, and L. Van Gool. Blazingly fast video object segmentation with pixel-wise metric learning. In CVPR, 2018. +[6] B. A. Griffin and J. J. Corso. BubbleNets: Learning to select the guidance frame in video object segmentation by deep sorting frames. In CVPR, 2019. +[7] Y. Heo, Y. J. Koh, and C.-S. Kim. Interactive video object segmentation using global and local transfer modules. In ECCV, 2020. +[8] J. Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In CVPR, 2018. +[9] P. Hu, G. Wang, X. Kong, J. Kuen, and Y.-P. Tan. Motion-guided cascaded refinement network for video object segmentation. In CVPR, 2018. +[10] Y.-T. Hu, J.-B. Huang, and A. G. Schwing. Videomatch: Matching based video object segmentation. In ECCV, 2018. +[11] S. D. Jain, B. Xiong, and K. Grauman. Fusionseg: Learning to combine motion and appearance for fully automatic segmentation of generic objects in videos. In CVPR, 2017. +[12] W.-D. Jang and C.-S. Kim. Online video object segmentation via convolutional trident network. In CVPR, 2017. +[13] W.-D. Jang, C. Lee, and C.-S. Kim. Primary object segmentation in videos via alternate convex optimization of foreground and background distributions. In CVPR, 2016. +[14] Y. J. Koh, W.-D. Jang, and C.-S. Kim. POD: Discovering primary objects in videos based on evolutionary refinement of object recurrence, background, and primary object models. In CVPR, 2016. +[15] Y. J. Koh and C.-S. Kim. Primary object segmentation in videos based on region augmentation and reduction. In CVPR, 2017. +[16] Y. J. Koh, Y.-Y. Lee, and C.-S. Kim. Sequential clique optimization for video object segmentation. In ECCV, 2018. +[17] H. Lin, X. Qi, and J. Jia. AGSS-VOS: Attention guided single-shot video object segmentation. In ICCV, 2019. +[18] X. Lu, W. Wang, C. Ma, J. Shen, L. Shao, and F. Porikli. See more, know more: Unsupervised video object segmentation with co-attention Siamese networks. In CVPR, 2019. +[19] K.-K. Maninis, S. Caelles, Y. Chen, J. Pont-Tuset, L. Leal-Taixe, D. Cremers, and L. Van Gool. Video object segmentation without temporal information. IEEE Trans. Pattern Anal. Mach. Intell., 41(6):1515-1530, 2018. +[20] J. Miao, Y. Wei, and Y. Yang. Memory aggregation networks for efficient interactive video object segmentation. In CVPR, 2020. + +[21] S. W. Oh, J.-Y. Lee, K. Sunkavalli, and S. J. Kim. Fast video object segmentation by reference-guided mask propagation. In CVPR, 2018. +[22] S. W. Oh, J.-Y. Lee, N. Xu, and S. J. Kim. Fast user-guided video object segmentation by interaction-and-propagation networks. In CVPR, 2019. +[23] S. W. Oh, J.-Y. Lee, N. Xu, and S. J. Kim. Video object segmentation using space-time memory networks. In ICCV, 2019. +[24] S. W. Oh, J.-Y. Lee, N. Xu, and S. J. Kim. Space-time memory networks for video object segmentation with user guidance. IEEE Trans. Pattern Anal. Mach. Intell., 2020. +[25] A. Papazoglou and V. Ferrari. Fast object segmentation in unconstrained video. In ICCV, 2013. +[26] J. Pont-Tuset, F. Perazzi, S. Caelles, P. Arbeláez, A. Sorkine-Hornung, and L. Van Gool. The 2017 DAVIS Challenge on Video Object Segmentation. In arXiv:1704.00675, 2017. +[27] B. L. Price, B. S. Morse, and S. Cohen. LIVEcut: Learning-based interactive video segmentation by evaluation of multiple propagated cues. In ICCV, 2009. +[28] N. Shankar Nagaraja, F. R. Schmidt, and T. Brox. Video segmentation with just a few strokes. In ICCV, 2015. +[29] G. Strang. Linear transformations. In Introduction to Linear Algebra, 5th Ed., 2016. +[30] P. Tokmakov, K. Alahari, and C. Schmid. Learning motion patterns in videos. In CVPR, 2017. +[31] P. Voigtlaender, Y. Chai, F. Schroff, H. Adam, B. Leibe, and L.-C. Chen. FEELVOS: Fast end-to-end embedding learning for video object segmentation. In CVPR, 2019. +[32] P. Voigtlaender and B. Leibe. Online adaptation of convolutional neural networks for video object segmentation. In BMVC, 2017. +[33] J. Wang, P. Bhat, R. A. Colburn, M. Agrawala, and M. F. Cohen. Interactive video cutout. ACM Trans. Graphics, 24(3):585-594, 2005. +[34] W. Wang, J. Shen, and F. Porikli. Saliency-aware geodesic video object segmentation. In CVPR, 2015. +[35] W. Wang, H. Song, S. Zhao, J. Shen, S. Zhao, S. C. Hoi, and H. Ling. Learning unsupervised video object segmentation through visual attention. In CVPR, 2019. +[36] X. Wang, R. Girshick, A. Gupta, and K. He. Non-local neural networks. In CVPR, 2018. +[37] R. Wu, H. Lin, X. Qi, and J. Jia. Memory selection network for video propagation. In ECCV, 2020. +[38] N. Xu, L. Yang, Y. Fan, D. Yue, Y. Liang, J. Yang, and T. Huang. YouTube-VOS: A large-scale video object segmentation benchmark. In arXiv:1809.03327, 2018. +[39] Z. Yang, Q. Wang, L. Bertinetto, S. Bai, W. Hu, and P. H. S. Torr. Anchor diffusion for unsupervised video object segmentation. In ICCV, 2019. +[40] M. Zhen, S. Li, L. Zhou, J. Shang, H. Feng, T. Fang, and L. Quan. Learning discriminative feature with crf for unsupervised video object segmentation. ECCV, 2020. +[41] T. Zhou, J. Li, S. Wang, R. Tao, and J. Shen. MATNet: Motion-attentive transition network for zero-shot video object segmentation. IEEE Trans. Image Process., 29:8326-8338, 2020. \ No newline at end of file diff --git a/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/images.zip b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..19bd20a7ab33fcef507357642fab8a9f6bfe2a54 --- /dev/null +++ b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c33c6862952c474a2a7800cf906a523d5b6fd4be6d0516dcfbdb05e881e5d9de +size 570105 diff --git a/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/layout.json b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..02994c6de95552012016ade1425ea21316414764 --- /dev/null +++ b/guidedinteractivevideoobjectsegmentationusingreliabilitybasedattentionmaps/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f933be466016df900e4e81ef744aec1268407aa32b823791ae59c0ba17560f42 +size 496213 diff --git a/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_content_list.json b/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..00141010b258dc09cea05fe99eb73eb1b4fdb352 --- /dev/null +++ b/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:185acc766d576c7419cd90d026101c6e997f02cc9dbc4fa3683bae9ab0de1845 +size 79868 diff --git a/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_model.json b/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5f9a2778d185a2614199cae8f04650b3a6e04b1b --- /dev/null +++ b/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9683e2c6f5fcd1e8d33bb9520f9e711b243ee2fbe59550cb76fb543dc0ec27ef +size 97207 diff --git a/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_origin.pdf b/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..70adba345f0649a09ee4f4b6dfe41c9307cb6dac --- /dev/null +++ b/hallucinationimprovesfewshotobjectdetection/4c2b2f6e-f34f-4749-9adf-98684a5bf972_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:745cafe06754007fba430d6e2e7b55add5c3a0f0bdb1cda0b902fecc956c19ca +size 1302520 diff --git a/hallucinationimprovesfewshotobjectdetection/full.md b/hallucinationimprovesfewshotobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8712dc72e23ae5749469fc2f84acb89f482789aa --- /dev/null +++ b/hallucinationimprovesfewshotobjectdetection/full.md @@ -0,0 +1,284 @@ +# Hallucination Improves Few-Shot Object Detection + +Weilin Zhang Yu-Xiong Wang University of Illinois at Urbana-Champaign + +{weilinz2, yxw}@illinois.edu + +# Abstract + +Learning to detect novel objects from few annotated examples is of great practical importance. A particularly challenging yet common regime occurs when there are extremely limited examples (less than three). One critical factor in improving few-shot detection is to address the lack of variation in training data. We propose to build a better model of variation for novel classes by transferring the shared within-class variation from base classes. To this end, we introduce a hallucinator network that learns to generate additional, useful training examples in the region of interest (RoI) feature space, and incorporate it into a modern object detection model. Our approach yields significant performance improvements on two state-of-the-art few-shot detectors with different proposal generation procedures. In particular, we achieve new state of the art in the extremely-few-shot regime on the challenging COCO benchmark. + +# 1. Introduction + +Modern deep convolutional neural networks (CNNs) rely heavily on large amounts of annotated images [29]. This data-hungry nature limits their applicability to some practical scenarios such as autonomous driving, where the cost of annotating examples is prohibitive, or which involve never-before-seen concepts [9,51]. By contrast, humans can rapidly grasp a new concept and make meaningful generalizations, even from a single example [31]. To bridge this gap, there has been a recent resurgence of interest in few-shot or low-shot learning that aims to learn novel concepts from very few labeled examples [8, 10, 34, 37, 42]. + +Despite notable successes, most of the existing work has focused on simple classification tasks with artificial settings and small-scale datasets [34, 37]. However, few-shot object detection, a task of great practical importance that learns an object detector from only a few annotated bounding box examples [18, 38, 39], is far less explored. Few-shot detection requires determining where an object is as well as what it is (and handling distracting background regions [13], etc.), and is much harder than few-shot classification. The most + +![](images/78454f96ea5e423b08eec50ad9c6539250863be3a9cc6aaf4ae18263cf92845e.jpg) +Figure 1. Learning to detect a novel class, fennec fox, from a single training example (i.e., 1-shot detection) using a serial detector. The region proposal network (RPN) generates a few high intersection-over-union (IoU) boxes for the detector's classifier. The pink circle represents the classifier decision boundary learned from these boxes. Due to a lack of sample variation, the decision boundary is not accurately estimated. With hallucinated examples (image in backlash) produced by our hallucinator, the classifier learns a better decision boundary (the dotted circle), thus being able to potentially correct previously misclassified instances. + +difficult regime occurs when there are very limited examples (less than 3) for novel classes (Figure 1), which is a common yet extremely challenging case in the real world. + +While few-shot classification approaches are helpful (e.g., [2, 4, 18, 33, 41]), few-shot detection is much more than a straightforward application of few-shot classification approaches. The state-of-the-art two-stage fine-tuning approach (TFA) [38] learns a better representation for few-shot detection, through (1) pre-training on base classes with abundant data and then only fine-tuning the box classifier and regressor on novel classes, and (2) introducing instance-level feature normalization to the box classifier during fine-tuning. Despite the improvement, its performance in the extremely low-data regime is still far from satisfying. + +We argue that, to fully improve extremely-few-shot detection performance, a key factor is to effectively deal with the lack of variation in training data. This is because for an object detector to be accurate, its classifier must build a useful model of variation in appearance with very few examples. More concretely, a modern object detector first finds promising image locations, typically boxes, using a region proposal network (RPN) [28], then passes promising boxes + +through a classifier to determine what object is present, and finally performs various cleanup operations such as nonmaximum suppression (NMS), aimed at avoiding duplicate predictions and improving localization. Now assume that the detector must learn to detect a novel category from a single example (Figure 1). The only way the classifier can build a model of the category's variation in appearance is by learning from the high intersection-over-union (IoU) boxes reported by the RPN. Although there is variation of boxes produced by the RPN, the variation from a single example is too weak to train the classifier for the novel class. + +To overcome this issue, one strategy is to adjust the learning procedure for RPN, so that it reports highly informative boxes. Contemporary work [48] achieves this by training multiple RPN's be somewhat redundant and cooperating. Hence, if one RPN misses a highly informative box, another will get it. This cooperating RPN's (CoRPNs) approach, while helpful, is still insufficient. In the extremely-few-shot regime, all positive novel class proposals produced by the multiple RPN's are only slightly modified from and thus similar to the few available positive instances (with light-weighted cropping and scaling operations); their variation is significantly limited for building a strong classifier. + +In this paper, we propose a different perspective on building a model of variation for novel classes, by transferring the shared within-class variation from base classes. In fact, many modes of variation in the visual world (e.g., camera pose, lighting changes, and even articulation) are shared across categories and can generalize to unseen classes [30]. While such within-class variation is difficult to be encoded through the proposal generation procedure, it can be effectively captured by learning to hallucinate examples [40]. + +To this end, we introduce a hallucinator network into a modern object detection model. The hallucinator network performs data hallucination for the box classifier in the learned region of interest (RoI) feature space. We train the hallucinator on data-abundant base classes, encoding the rich structure of their shared modes of variation. We then use the learned hallucinator to generate additional novel class examples and thus produce an augmented training set for building better classifiers, as shown in Figure 1. + +Note that the existing strategy for training the hallucinator in few-shot classification [40] is coupled with a complicated meta-learning process, making it difficult to apply to state-of-the-art few-shot detectors like TFA [38] or CoRPNs [48]. We overcome this challenge by introducing a much simpler yet effective training procedure: we train our hallucinator and the detector's classifier in an EM-like (expectation-maximization) manner, where a "strongest possible" classifier is trained first with all the available base class data; the hallucinator is then trained under the guidance of this already-trained classifier; and finally, the classifier is re-trained and refined based on the set of augmented + +examples (with hallucinated examples) on novel classes. + +Our contributions are three-fold. (1) We investigate a critical yet under-explored issue in extremely-few-shot detection (e.g., as few as one) – the lack of variation in training data. (2) We propose a novel data hallucination based approach to address this issue, which effectively transfers shared modes of within-class variation from base classes to novel classes. Our approach is simple, general, and can work with different region proposal procedures. (3) Our approach significantly outperforms the state-of-the-art TFA [38] and most recent cooperating RPN's [48] detectors in the extremely-few-shot regime. Our code is available at https://github.com/pppplin/HallucFsDet. + +# 2. Related Work + +Object Detection: Modern detectors are typically based on convolutional neural networks with two types of architectures - serial detection [12] and parallel detection [25]. Both families run a region proposal process [5, 36] that determines whether an image region contains an object or not. They differ in when to run the region proposal process. Serial detectors (or two-stage detectors) first generate promising region proposals and then feed each proposal box to a classifier that predicts if the region contains an object. Serial detectors include R-CNN [13] and its variants, such as Fast R-CNN [12], Faster R-CNN [28], Mask R-CNN [15], SPP-Net [16], FPN [21], and DCN [3]. + +Parallel detectors (or one-stage detectors) run the region proposal process and the classification process simultaneously. Parallel detectors are usually faster than serial detectors at the expense of decreasing accuracy, since the classifier has no prior knowledge of whether a box contains an object. Representative parallel detectors are variants of YOLO [1, 25, 26, 27], SSD [23], CornerNet [19], and ExtremeNet [49]. Our work introduces a general data hallucination strategy to improve the detection performance in the few-shot regime. While we mainly focus on serial detectors in this paper since they achieve state-of-the-art few-shot detection performance, we believe that our strategy applies to parallel detectors as well, which we leave as future work. + +Few-Shot Object Detection: Advanced few-shot detectors are usually built in a serial fashion [7,38,39,43,44,45]. One line of work focuses on learning better feature representations through metric learning [20, 33, 46], in ways of modeling multi-modal distributions in each class [33], restoring negative information [46], and reserving adequate margin space among novel classes [20]. Modified fin-tuning techniques have also been explored. For example, a regularized fine-tuning approach is proposed to transfer knowledge from a pre-trained detector to a few-shot detector [2]. Recently, a simple two-stage fine-tuning approach has been shown to outperform more sophisticated methods [38]. Other work seeks improvements by applying + +meta-learning techniques, such as learning a meta-model to reweight pre-trained features given few-shot data [18] and attaching meta-learned classifiers to Faster R-CNN [39,45]. + +Another line of work focuses on improving the proposal generation process, by introducing attention mechanisms and generating class-aware features for classifiers [7, 17, 24, 35, 44, 48]. Some work modifies the proposal ranking process and ranks proposals based on similarity with query images [7, 17]. An RPN ensemble method is proposed to avoid missing highly informative proposal boxes [48]. Contrastive-aware object proposal encodings are further learned to reduce the possibility of misclassifying novel class objects to confusable classes [35]. Additional information has also been shown helpful, such as semantic relations [50] and multi-scale representations [43]. Orthogonal to existing work, we address few-shot detection by hallucinating additional data and enriching sample variation. + +Data Hallucination: Despite recent progress on learning to hallucinate examples to deal with data scarcity [11, 14, 32, 40, 47], much of the work has focused on classification tasks and performed in a learned feature space. Novel class features are generated by learning shared feature transformations from base classes [14]. Pairwise deformations between examples of the same class are captured and used to generate novel class instances [32]. A meta-learner and a hallucinator are combined and jointly optimized to boost recognition performance [40]. Our approach builds on the feature space hallucination framework of [40], but makes significant modifications to the hallucinator architecture and the hallucination procedure. To the best of our knowledge, our work is the first to demonstrate the effectiveness of data hallucination for few-shot detection. + +# 3. Our Approach + +We believe that hallucination would improve any few-shot detection models with standard architectures. In this section, we focus on improving two state-of-the-art few-shot detectors with different region proposal mechanisms. + +Few-Shot Object Detection Setting and Evaluation Procedure: We follow the few-shot detection setting and the standard evaluation procedure introduced in [18, 38]. Classes are split into two sets: base classes $C_{\mathrm{b}}$ and novel classes $C_{\mathrm{n}}$ . Both models which we study adopt a two-stage fine-tuning procedure [38]. A model is trained on base classes in the first stage and is then fine-tuned on novel classes in the second stage. In the first stage, the model only detects base classes – the model is a $|C_{\mathrm{b}}|$ -way detector. In the second stage, the model is expanded as a $(|C_{\mathrm{b}}| + |C_{\mathrm{n}}|)$ -way detector. In order to maintain performance on base classes while learning to detect novel class instances, the detector is fine-tuned on a balanced few-shot dataset containing both novel and base classes. Finally, we compare mean average precision (AP) on novel classes. + +![](images/c50796ef3d98f276f8256b0e068bcf6b666d0396a7546325e82ba2905bd0de2a.jpg) +Figure 2. Illustration of the two-stage fine-tuning approach (TFA) [38] under the Faster R-CNN framework. In stage 1, the whole model is trained with base class images. In stage 2, only the classifier and the bounding box regressor in the RoI head are fine-tuned with novel class images. A module in blue is trained during the corresponding stage, while a module in gray is frozen. + +# 3.1. Few-Shot Object Detection Models + +Two-stage Fine-tuning Approach (TFA): A two-stage fine-tuning approach is introduced [38] under the widely-used Faster R-CNN framework, which significantly improves few-shot detection performance. As a serial detector, Faster R-CNN consists of a backbone, a region proposal network (RPN), a region of interest (RoI) pooling layer, an RoI feature extractor, a bounding box classifier, and a bounding box regressor (Figure 2). The last four components together construct the RoI head. The backbone extracts image features, which are passed through the RPN to produce promising areas with potential objects. The RoI head then transforms, classifies, and refines potential object boxes into labeled boxes. TFA modifies the standard Faster R-CNN by using a cosine similarity based classifier to reduce intra-class variance for few-shot learning. TFA uses an ImageNet [29] pre-trained ResNet-101 with a feature pyramid network [21] as the backbone. As shown in Figure 2, in the first stage, TFA trains the whole model using base class images. In the second stage, only the classifier and the bounding box regressor in the RoI head are fine-tuned using novel class instances, with the rest of the model frozen. + +Cooperating RPN's (CoRPNs): An improved proposal generation mechanism based on RPN ensemble is proposed in CoRPNs [48], which produces highly informative proposal boxes for few-shot detection. As shown in Figure 3, CoRPNs train multiple distinct but cooperating RPN's so that if one RPN misses a highly informative proposal box, another one will get it. Except the proposal generation procedure, CoRPNs share the same model architecture and training strategy with TFA. Specifically, CoRPNs train $N$ RPN's by a modified RPN classification loss + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {C E}} ^ {j ^ {*}} + \mathcal {L} _ {\mathrm {d i v}} + \mathcal {L} _ {\mathrm {c o o p}}, \tag {1} +$$ + +where $\mathcal{L}_{\mathrm{CE}}^{j^*}$ is a binary cross-entropy loss of a selected RPN + +![](images/f338abe5abb227d1ba537c0e7e6cdb18599ee09c911e6709b68c9a38de4c9cbe.jpg) + +![](images/ff7a860845244062e4d46a9fc252c2e959fb06e216a987ad06949338b89810a1.jpg) +Figure 3. Illustration of cooperating RPN's (CoRPNs) [48]. Left: the standard RPN structure in Faster R-CNN. Right: CoRPNs with $N$ RPN classifiers. +Figure 4. Illustration of the RoI head structure with a hallucinator module. The hallucinator is inserted right before the classifier. The hallucinated examples are appended to the original training examples to train the classifier. The bounding box regressor is not affected by the hallucinator. + +$j^{*}$ . CoRPNs select the most certain RPN for every box. For instance, each anchor box will get the RPN $j^{*}$ 's score that has a probability closer to either 0 or 1. The selected RPN $j^{*}$ gets this box's gradient at training. + +The divergence loss $\mathcal{L}_{\mathrm{div}}$ encourages RPN's to be different, and the cooperation loss $\mathcal{L}_{\mathrm{coop}}$ enforces RPN's to cooperate by setting a lower bound for every RPN's response to a foreground box. $\mathcal{L}_{\mathrm{div}}$ is defined as + +$$ +\mathcal {L} _ {\mathrm {d i v}} = - \log (\det (\Sigma (\mathcal {F}))), \tag {2} +$$ + +which is the negative log of the covariance matrix on every RPN's prediction to proposal boxes. For foreground box $i$ and RPN $j$ , the cooperation loss is + +$$ +\mathcal {L} _ {\text {c o o p}} ^ {i, j} = \max \left\{0, \phi - f _ {i} ^ {j} \right\}, \tag {3} +$$ + +where $\phi$ is the lower bound of every RPN's response to a foreground box, and $f_{i}^{j}$ is RPN j's response to the box i. $\mathcal{L}_{\mathrm{coop}}$ is averaged over all RPN's and foreground boxes. + +# 3.2. Few-Shot Object Detection with Hallucination + +We introduce a hallucinator network $H$ with parameters $\phi$ that learns to generate additional examples for novel classes by leveraging the shared within-class feature variation from base classes. As shown in Figure 4, hallucination happens in the RoI head feature space. The hallucinator takes as input available training examples and generates hallucinated examples. The set of hallucinated examples $S_{\mathrm{gen}}$ is then treated as additional training examples for learning the classifier on novel classes. Specially, given a seed example $x_{i}^{c_{k}}$ of category $c_{k}$ , the hallucinator generates a hallucinated example by + +$$ +\widetilde {x _ {i} ^ {c _ {k}}} = H \left(\mu_ {c _ {k}}, x _ {i} ^ {c _ {k}}, \varepsilon ; \phi\right), \tag {4} +$$ + +![](images/11665140b2140e8e38c3e5e68e9c21d48eaa91b828377afb29294551885bc42e.jpg) +Figure 5. Our EM-style training procedure for an RoI head with a hallucinator module. Upper: how to train the hallucinator. The hallucinator is trained based on the classification loss on the hallucinated examples. All other modules are frozen when training the hallucinator. Lower: how to train the classifier and the bounding box regressor. Both the original training examples and the hallucinated examples are used to train the classifier. Only the original training examples are used to train the bounding box regressor. The EM-style training iterates between the two processes. A gray module indicates that it is frozen. + +where $\mu_{c_k}$ is the class prototype of $c_k$ , which is the mean of all instances from $c_k$ , and $\varepsilon$ is a per-example noise vector. Note that our hallucinator formulation is different from [40]: we introduce an additional input $\mu_{c_k}$ to explicitly capture the global category information. For $\widetilde{x_i^{c_k}}$ , its label $y_i$ is the same as the seed example's category $c_k$ . Assuming that we already have a trained box classifier, we directly use the classifier's (cross-entropy) classification loss on all hallucinated examples to train the hallucinator: + +$$ +L _ {\text {h a l l u c}} (\phi) = \sum_ {i \in S _ {\text {g e n}}} \left(- w _ {y _ {i}} ^ {T} \widetilde {x _ {i} ^ {c _ {k}}} + \log \sum_ {k} e ^ {w _ {k} ^ {T} \widetilde {x _ {i} ^ {c _ {k}}}}\right), \tag {5} +$$ + +where $w_{y_i}$ and $w_k$ are the already-learned classifier's weights on corresponding categories. This hallucination loss enforces the hallucinated examples to loosely "agree with" the trained classifier. In addition, since we take as input class prototypes, our hallucinator is implicitly regularized and thus not simply copying the seed examples. Compared with [40] which uses a complicated meta-learning process, we substantially simplify the training procedure. + +# 3.3. Training the Hallucinator and the Classifier + +As illustrated in Figure 5, we propose an EM-style (expectation-maximization) training procedure to train the hallucinator and the detector's classifier: when training the hallucinator, the classifier is frozen; when training the classifier (and the box regressor), the hallucinator is frozen. Compared with end-to-end joint training, this iterative strategy improves the cooperation between the hallucinator and the classifier, thus producing examples that are more useful for building the few-shot classifier. + +Training on Base Classes: In the stage of training on base classes, we first train the plain detector without the hallucinator in a standard way as before. We then insert the hallucinator into the detector, and freeze all model components except the hallucinator. Now, the hallucination will be performed in the pre-trained, fixed RoI head feature space. And the classifier is already trained on base classes using all available examples. We then use this base class classifier to guide the training of the hallucinator. + +Note that, different from few-shot classification, the proposal generation process in detection produces several proposal boxes around an object, making a few training examples available even in the 1-shot scenario. We randomly sample these training examples as seed examples for the hallucinator. Consider a training batch $S$ which consists of $n$ base classes. For each class in the batch, the hallucinator generates $m$ examples, and $m$ is fixed for all batches. The set of hallucinated examples $S_{\mathrm{gen}}$ is used to train the hallucinator based on the loss function (5). + +Fine-Tuning on Novel Classes: After training the hallucinator on base classes, we move on to the stage of fine-tuning the classifier and hallucinator on a few-shot dataset containing both base and novel classes. We freeze all model components prior to the hallucinator. Each training batch $S$ initially consists of an imbalanced set of foreground box examples $S_{\mathrm{pos}}$ and background box examples $S_{\mathrm{neg}}$ , with background examples being the majority: $S = [S_{\mathrm{pos}}; S_{\mathrm{neg}}}$ . The hallucinator generates a set of additional examples $S_{\mathrm{gen}}$ for novel classes. Without changing the number of examples in total, we randomly replace $|S_{\mathrm{gen}}|$ background examples by $S_{\mathrm{gen}}$ to obtain a refined training batch + +$$ +\widetilde {S} = \left[ S _ {\text {p o s}}, S _ {\text {g e n}}; S _ {\text {n e g}} ^ {\prime} \right]. \tag {6} +$$ + +By doing so, we also partially alleviate the imbalance issue between foreground and background examples. After training the classifier on the refined dataset with hallucinated examples, we fine-tune the hallucinator using the classifier based on Eq. (5), then we use the fine-tuned hallucinator to fine-tune the classifier again, and so on. We stop this procedure after one or two iterations (i.e., the classifier is finetuned at most twice); empirically, we found that additional iterations do not further improve the performance. + +# 4. Experiments + +# 4.1. Implementation Details + +Datasets and Evaluation Metrics: We evaluate on two widely-used few-shot detection benchmarks: MS-COCO [22] and PASCAL VOC $(07 + 12)$ [6]. For a fair comparison, the same base/novel category splits, train/test splits, and novel class instances [18, 38] are used for training and evaluation. Consistent with recent work [18, 38], we report AP50 for three different base/novel splits under shots 1, 2, 3, 5, and 10 on PASCAL VOC; we report AP, AP50, + +and AP75 under shots 1, 2, and 3 on COCO. Note that we particularly focus on the extremely-few-shot regime. + +Baselines: We mainly focus on the comparison with two state-of-the-art few-shot detectors - TFA [38] and CoRPNs [48], and evaluate the effectiveness and generalizability of our hallucinator when combined with them. For both our models and the main baselines, we use Faster R-CNN [28] as our base model. Following [38], we use an ImageNet pre-trained ResNet-101 with a feature pyramid network [21] as the backbone. All our experiments, including those with the main baselines, have ground-truth boxes appended as training examples in the RoI head. As reported in [38], including ground-truth boxes leads to a $0.5\%$ AP gain on COCO. In addition, we compare with a variety of baselines, including concurrent work on few-shot detection. + +Evaluation Procedure: Both our models and the main baselines are $(|C_{\mathrm{b}}| + |C_{\mathrm{n}}|)$ -way few-shot detectors. And we evaluate them on both base and novel classes under the standard evaluation procedure [38], as described in Section 3. Some other baselines like [17] were initially evaluated under different procedures. For a fair comparison, all reported numbers for those methods are the re-evaluated results under the standard evaluation procedure. + +Note that, following [38], the fine-tuning stages on PASCAL VOC and COCO are slightly different. On PASCAL VOC, the classifier's weights on novel classes are randomly initialized and directly trained using a balanced dataset with base and novel classes. On COCO, we first train a $|C_{\mathrm{n}}|$ -way classifier on novel class instances. The trained classifier is used as an initialization of the classifier's weights on novel classes. We then train a $(|C_{\mathrm{b}}| + |C_{\mathrm{n}}|)$ -way classifier using a balanced few-shot dataset with base and novel classes. + +Hallucinator Architecture: We use a two-layer MLP (multi-layer perceptron) with ReLU as the hallucinator. Given that the inputs to the hallucinator are a class prototype, a seed example, and random noise, the input size is three times the feature size; the output size of each linear layer is the same size as the input feature. The seed example is randomly sampled from all examples in a training batch. The input noise is dataset-dependent. For each dataset, we calculate the mean and standard deviation of pre-trained input features and use those to sample the input noise. + +We pre-compute base class prototypes using all available examples before training the hallucinator. During training the hallucinator, we do not update these base class prototypes. In a different manner, we construct novel class prototypes dynamically, when using the learned hallucinator to train classifiers on novel classes. Specifically, novel class prototypes are computed by using both the training and hallucinated examples (in contrast to that only training examples are used for base class prototypes). For a novel class, whenever a new training example comes in or a new example is generated, its corresponding prototype will be up- + +
MethodNovel Set 1Novel Set 2Novel Set 3
shot=123510shot=123510shot=123510
OursCoRPNs w/ cos + Halluc47.044.946.554.754.726.331.837.437.441.240.442.143.351.449.6
Main baselineCoRPNs w/ cos [48]44.438.546.454.155.725.729.537.336.241.335.841.844.651.649.6
OursTFA w/ cos + Halluc45.144.044.755.055.923.227.535.134.939.030.535.141.449.049.3
Main baselineTFA w/ cos [38]39.836.144.755.756.023.526.934.135.139.130.834.842.849.549.8
FRCN+ft-full [38]15.220.329.040.145.513.420.628.632.438.819.620.828.742.242.1
Meta R-CNN [45]19.925.535.045.751.510.419.429.634.845.414.318.227.541.248.1
CoAE* [17]12.714.614.818.221.74.411.320.518.019.06.37.69.515.019.0
MPSR [43]41.743.151.455.261.824.429.539.239.947.835.640.642.348.049.7
Other baselinesFsDetView [44]24.235.342.249.157.421.624.631.937.045.721.230.037.243.849.6
NP-RepMet [46]37.840.341.747.349.441.643.043.447.449.133.338.039.841.544.8
FSCE [35]44.243.851.461.963.427.329.543.544.250.237.241.947.554.658.5
CME [20]41.547.550.458.260.927.230.241.442.546.834.339.645.148.351.5
SRR-FSD [50]47.850.551.355.256.832.535.339.140.843.840.141.544.346.946.4
+ +Table 1. Few-shot detection performance (AP50) on PASCAL VOC novel classes under three base/novel splits. We follow the standard evaluation procedure in [38]. The main comparison focuses on combining hallucination (denoted as 'Halluc') with two state-of-the-art few-shot detectors: TFA and CoRPNs with cosine classifier (denoted as 'w/ cos'). All models build upon Faster R-CNN with ResNet-101 backbone. 'CoRPNs + Halluc' and CoRPNs share the same hyper-parameter settings; and the RPN outputs in 'CoRPNs + Halluc' are the same as CoRPNs. Similarly, 'TFA + Halluc' and TFA share the same RPN outputs. Hallucination yields significant improvements in the extremely-few-shot regime (1-shot and 2-shot). In higher shots, hallucination maintains comparable results to its baselines. In addition, we compare with other state-of-the-art methods, including some concurrent work. *Model re-evaluated under the standard procedure. Results in red are the best, results in blue are the second-best, and results in bold are the better ones in comparison with the corresponding baseline. + +dated. Despite somewhat inconsistency between base and novel classes for constructing prototypes, we found that this strategy exploits all available examples and empirically achieves the best performance. + +Hallucinator Initialization: Following a similar strategy as in [40], we initialize the hallucinator by using block diagonal identity matrices plus small random noise. The initialization noise is sampled from a normal distribution with a zero mean and a standard deviation of 0.02. As a form of regularization, this identity initialization ensures that the initially hallucinated examples are not too far away from the seed examples and thus do not degrade the performance. + +Hyper-Parameter Settings: On PASCAL VOC, we train the hallucinator with batch size 16 and learning rate 0.02 for 8,000 iterations. We decay the learning rate by ratio 0.1 at 2,000 and 6,000 iterations. On COCO, we train the hallucinator with batch size 64 and learning rate 0.02 for 21,200 iterations. We decay the learning rate by ratio 0.1 at 6,400 and 19,200 iterations. + +Number of Hallucinated Examples: When training the classifier on novel classes, the hallucinator produces a fixed number $(m)$ of examples per category in each training batch. For simplicity, we set $m$ to be the same as the average number of per-class training examples (i.e., RoI features), averaged over the training batches. On PASCAL VOC, there are roughly 20 training examples per class (with batch size 16), and we thus hallucinate 20 examples per class accordingly for all experiments. We keep this number on COCO as well. In the ablation study, we show that by tuning the number of hallucinated examples, the performance gets further improved. Note that this number should + +change when the number of images per batch varies. + +# 4.2. Main Results + +Comparison with Main Baselines TFA and CoRPNs: Tables 1 and 2 summarize the results for novel classes on PASCAL VOC and COCO, respectively. We have the following key observations. + +(1) Hallucination improves the performance over the main baselines by large margins in the extremely-few-shot regime. On PASCAL VOC, hallucination yields substantial improvements in 1-shot and 2-shot scenarios. On the more challenging COCO benchmark, hallucination consistently improves performance when combined with both baselines. +(2) Our hallucination strategy is general and applicable to different types of detectors regardless of RPN outputs. This is because hallucination provides additional, useful sample variation that is independent of RPN outputs. +(3) On PASCAL VOC (Table 1), hallucination demonstrates slightly different behaviors when combined with CoRPNs or TFA: while hallucination consistently improves CoRPNs in the extremely-few-shot regime, it is not always helpful for TFA in some cases (though hallucination also does not hurt). A possible explanation is that our hallucinator tends to be conservative, making the hallucinated examples still close to the original seed training examples. Hence, in the cases (e.g., novel sets 2 and 3) where the training and test examples are quite distinct, the hallucinated examples produced from the training examples could not help build a better classifier for detecting the test examples. In such cases, a more aggressive hallucinator is desired to generate examples that are further away from the seed ex + +
Method1-shot2-shot3-shot
APAP50AP75APAP50AP75APAP50AP75
OursCoRPNs w/ cos + Halluc4.47.54.95.69.95.97.213.37.4
Main baselineCoRPNs w/ cos [48]4.17.24.45.49.65.67.113.27.2
OursTFA w/ cos + Halluc3.86.54.35.09.05.26.912.67.0
Main baselineTFA w/ cos [38]3.45.83.84.68.34.86.612.16.5
Other baselinesMPSR** [43]2.34.12.33.56.33.45.29.55.1
FsDetView [44]3.28.91.44.913.32.36.718.62.9
+ +Table 2. Few-shot detection performance on COCO novel classes in 1, 2, and 3-shot scenarios. See the caption of Table 1 for details. Hallucination consistently improves both baselines in all settings. 'CoRPNs + Halluc' achieves the state-of-the-art results in most cases. **Model evaluated using the public code and the pre-trained detector on base classes. + +
Method1-shot fine-tuned2-shot fine-tuned3-shot fine-tuned
APAP50AP75APAP50AP75APAP50AP75
OursCoRPNs w/ cos + Halluc32.352.434.434.555.337.034.755.137.5
Main baselineCoRPNs w/ cos [48]34.155.136.534.755.337.334.855.237.6
OursTFA w/ cos + Halluc31.550.833.932.852.435.433.352.836.4
Main baselineTFA w/ cos [38]34.154.736.434.755.137.634.754.837.9
Other baselinesMPSR** [43]12.117.114.214.420.716.915.823.318.3
FsDetView [44]2.47.01.04.411.92.24.913.62.2
+ +amples. The ablation study in Section 4.3 investigates this issue in more depth and supports our observation. + +(4) The performance gain of hallucination diminishes as the number of training examples increases. In higher-shot scenarios, our current hallucination does not bring in additional within-class variation beyond the given training examples, and is thus no longer beneficial. Note that, however, hallucination does not hurt the performance in 5/10-shot scenarios – performance variation is within $95\%$ confidence interval over multiple random samples according to [38]. Given that a single hallucinator is trained in our case, we might need different hallucinators or hallucination strategies in different sample size regimes. + +Comparison with Other State-of-the-Art Methods: Tables 1 and 2 show that our approach is superior or comparable to other few-shot detection methods. In particular, we achieve very competitive results in the extremely-few-shot regime. We believe that our effort is orthogonal to concurrent work; our hallucination strategy can be combined with other methods to further improve their performance. + +Base Class Performance: Table 3 presents the detection results on base classes, evaluated after fine-tuning with novel class instances. We observe that hallucination improves novel class performance at the expense of slight degradation of performance on base classes. This issue could be potentially addressed by using a smaller fine-tuning learning rate for the classifier components of base classes (which have been already well-trained). More notably, compared with other state-of-the-art methods such as MPSR [43] and FsDetView [44], we achieve a significantly better trade-off between novel and base class performance. + +Table 3. Detection performance on COCO base classes, after fine-tuning with a balanced dataset (1, 2, and 3-shots) containing base and novel class instances. Hallucination slightly degrades base class performance compared with CoRPNs and TFA, but it substantially outperforms state-of-the-art MPSR and FsDetView. **Model evaluated using the public code and the pre-trained detector on base classes. + +
MethodNovel Set 1Novel Set 2Novel Set 3
Joint training38.522.233.6
EM w/ 1 iter46.724.538.5
EM w/ 2 iter47.026.340.4
+ +Table 4. Comparison (1-shot AP50) of different training procedures for CoRPNs with hallucination on PASCAL VOC. All procedures use the same hallucinator architecture. EM-style training significantly outperforms joint training under all base/novel splits. The second EM iteration also consistently improves performance. + +# 4.3. Ablation Studies + +EM vs. Joint Training Procedures: Table 4 shows that, with the same hallucinator architecture, our EM-style training procedure significantly outperforms joint training, indicating that joint training might be greedy in this case. In addition, 2 EM-iterations outperform 1 iteration, and we found that more iterations do not improve the performance. + +Conservative vs. Aggressive Hallucinators: In the main experiments, we show that a conservative hallucinator is not always helpful and in some cases, we need a more aggressive hallucinator. Here we build such an aggressive hallucinator by changing the hallucination space. As shown in Figure 4, the original hallucinator generates examples directly in the operational space of the classifier (i.e., in the feature space after the box head and right before the classifier); this makes it conservative and reluctant to produce the kinds of examples that drastically change the classifier decision boundaries. By contrast, our new hallucinator generates examples in the feature space before the box head and accordingly, it becomes a three-layer convo + +
MethodNovel Set 1Novel Set 2Novel Set 3
TFA [38]39.823.530.8
TFA + Halluc, Conservative45.123.230.5
TFA + Halluc, Aggressive40.829.333.7
+ +Table 5. Analysis of conservative and aggressive hallucinators: 1-shot AP50 on PASCAL VOC under three base/novel splits. The aggressive hallucinator brings substantial improvements over TFA on novel sets 2 and 3 without hurting the performance on novel set 1. The conservative hallucinator significantly outperforms TFA on novel set 1, and performs comparably on the other two novel sets. + +
Method#HallucAP50
CoRPNs [48]044.4
CoRPNs + Halluc147.1
247.0
348.0
547.9
1047.8
2047.0
+ +lutional network. Now, the box head makes allowances for errors in the hallucination, and the hallucinator becomes more aggressive and allows radical change of classifiers. We also make some additional modifications as follows: (1) we jointly train the aggressive hallucinator with other model components, and (2) we use a cosine prototypical network loss [34] computed on held-out validation examples with hallucinated prototypes as additional guidance to train the hallucinator. Table 5 shows that the aggressive hallucinator significantly helps the cases where the performance of the conservative hallucinator is lagging. Importantly, neither of the two hallucinator variants hurts the performance. + +Number of Hallucinated Examples: Our hallucinator generates a fixed number of examples per class in each training batch (20 examples in the main results). Table 6 investigates the impact of the number of hallucinated examples. As it increases from 0 to 20, the performance gradually improves and then saturates and drops slightly. Note that the drop is still within $95\%$ confidence interval over multiple random samples according to [38]. This is because even if we produce a small number of hallucinated examples per training batch (e.g., 3), after many iterations, the cumulative number of hallucinated examples is large enough. + +Results with Fully-Connected Classifiers: We use cosine classifiers in the main results. Table 7 shows detection results using fully-connected classifiers. Hallucination improves CoRPNs in all 1-shot cases, suggesting the effectiveness of hallucination irrespective of the classifier choice. + +Performance Gain Analysis: We investigate where our performance gain comes from. The detection AP can be improved in two ways: (1) more boxes are correctly identified, i.e., true positive rate goes up; (2) fewer boxes are misclassified, i.e., false positive rate goes down. As shown + +Table 6. Impact of the number of hallucinated examples on 1-shot detection (AP50) under PASCAL VOC novel set 1. + +
MethodNovel Set 1Novel Set 2Novel Set 3
CoRPNs w/ fc [48]40.820.429.4
CoRPNs w/ fc + Halluc44.223.031.5
+ +Table 7. 1-shot detection performance (AP50) on PACAL VOC novel classes with fully-connected classifiers ('w/ fc'). CoRPNs and 'CoRPNs + Halluc' use the same set of hyper-parameters and share the same RPN outputs. 'CoRPNs + Halluc' outperforms CoRPNs under all three base/novel splits. + +
Novel Set 1Avg. True Positive Boxes (↑)Avg. False Positive Boxes (↓)
TFA [38]118.94096.6
TFA + Halluc132.03309.3
CoRPNs [48]133.93440.6
CoRPNs + Halluc137.03041.1
Novel Set 2
TFA [38]76.8897.1
TFA + Halluc69.5844.9
CoRPNs [48]78.7920.1
CoRPNs + Halluc77.1826.6
Novel Set 3
TFA [38]109.32043.2
TFA + Halluc113.61461.4
CoRPNs [48]110.31704.7
CoRPNs + Halluc117.61345.0
+ +Table 8. Average total number of true positive boxes and false positive boxes in novel classes for different 1-shot models on PASCAL VOC. Hallucination increases the number of true positive boxes in most cases and decreases the number of false positive boxes, with a larger improvement in the false positive rate. + +in Table 8, hallucination both increases the number of true positives in most cases and always decreases the number of false positives. We find that the scale of improvements on false positives is larger than the scale of improvements on true positives. A possible explanation is that hallucination generates close-to-boundary examples, and improves decision boundaries. Many misclassified boxes are eliminated, since we have a better estimation of decision boundaries. + +# 5. Conclusion and Future Work + +This paper tackles the lack of sample variation problem in few-shot detection. We introduce a hallucinator network to generate additional feature-level training examples. Experimental evaluation demonstrates that data hallucination, as a general strategy, can be incorporated into different types of detectors and substantially improves few-shot detection. Our analysis further shows that different design choices will change the behavior of the hallucinator. + +Our method is one possible instantiation of the data hallucination strategy. We believe that further refinements of the proposed hallucinator architectures and exploration of a more dedicated control of training procedure could lead to a more effective hallucinator with better performance. Finally, it is a promising avenue to continue this line of work for other visual recognition tasks beyond object detection. + +# References + +[1] Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao. YOLOv4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020. 2 +[2] Hao Chen, Yali Wang, Guoyou Wang, and Yu Qiao. LSTD: A low-shot transfer detector for object detection. In AAAI, 2018. 1, 2 +[3] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017. 2 +[4] Xuanyi Dong, Liang Zheng, Fan Ma, Yi Yang, and Deyu Meng. Few-example object detection with model communication. IEEE TPAMI, 41(7):1641-1654, 2019. 1 +[5] Ian Endres and Derek Hoiem. Category independent object proposals. In ECCV, 2010. 2 +[6] Mark Everingham, Luc Van Gool, Christopher K. I. Williams, John Winn, and Andrew Zisserman. The PASCAL visual object classes (VOC) challenge. *IJCV*, 88(2):303–338, 2010. 5 +[7] Qi Fan, Wei Zhuo, Chi-Keung Tang, and Yu-Wing Tai. Few-shot object detection with attention-RPN and multi-relation detector. In CVPR, 2020. 2, 3 +[8] Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE TPAMI, 28(7):594-611, 2006. 1 +[9] Michael Fink. Acquiring a new class from a few examples: Learning recurrent domain structures in humans and machines. PhD thesis, The Hebrew University of Jerusalem, 2011. 1 +[10] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017. 1 +[11] Hang Gao, Zheng Shou, Alireza Zareian, Hanwang Zhang, and Shih-Fu Chang. Low-shot learning via covariance-preserving adversarial augmentation networks. In NeurIPS, 2018. 3 +[12] Ross Girshick. Fast R-CNN. In ICCV, 2015. 2 +[13] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. 1, 2 +[14] Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In ICCV, 2017. 3 +[15] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask R-CNN. In ICCV, 2017. 2 +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE TPAMI, 37(9):1904-1916, 2015. 2 +[17] Ting-I Hsieh, Yi-Chen Lo, Hwann-Tzong Chen, and Tyng-Luh Liu. One-shot object detection with co-attention and co-excitation. In NeurIPS, 2019. 3, 5, 6 +[18] Bingyi Kang, Zhuang Liu, Xin Wang, Fisher Yu, Jiashi Feng, and Trevor Darrell. Few-shot object detection via feature reweighting. In ICCV, 2019. 1, 3, 5 +[19] Hei Law and Jia Deng. CornerNet: Detecting objects as paired keypoints. In ECCV, 2018. 2 + +[20] Bohao Li, Boyu Yang, Chang Liu, Feng Liu, Rongrong Ji, and Qixiang Ye. Beyond max-margin: Class margin equilibrium for few-shot object detection. In CVPR, 2021. 2, 6 +[21] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 2, 3, 5 +[22] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dolkar, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014. 5 +[23] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C. Berg. SSD: Single shot multibox detector. In ECCV, 2016. 2 +[24] Anton Osokin, Denis Sumin, and Vasily Lomakin. OS2D: One-stage one-shot object detection by matching anchor features. In ECCV, 2020. 3 +[25] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, 2016. 2 +[26] Joseph Redmon and Ali Farhadi. YOLO9000: Better, Faster, Stronger. In CVPR, 2017. 2 +[27] Joseph Redmon and Ali Farhadi. YOLOv3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018. 2 +[28] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 1, 2, 5 +[29] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet large scale visual recognition challenge. IJCV, 115(3):211-252, 2015. 1, 3 +[30] Ruslan Salakhutdinov, Joshua Tenenbaum, and Antonio Torralba. One-shot learning with a hierarchical nonparametric Bayesian model. In ICML Workshop on Unsupervised and Transfer Learning, 2012. 2 +[31] Lauren A Schmidt. Meaning and compositionality as statistical induction of categories and constraints. PhD thesis, Massachusetts Institute of Technology, 2009. 1 +[32] Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Abhishek Kumar, Rogerio Feris, Raja Giryes, and Alex Bronstein. Delta-encoder: An effective sample synthesis method for few-shot object recognition. In NeurIPS, 2018. 3 +[33] Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Sharathchandra Pankanti, Rogerio Feris, Abhishek Kumar, Raja Giries, and Alex M. Bronstein. RepMet: Representative-based metric learning for classification and one-shot object detection. In CVPR, 2019. 1, 2 +[34] Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017. 1, 8 +[35] Bo Sun, Banghuai Li, Shengcai Cai, Ye Yuan, and Chi Zhang. FSCE: Few-shot object detection via contrastive proposal encoding. In CVPR, 2021. 3, 6 + +[36] Koen van de Sande, Jasper Uijlings, Theo Gevers, and Arnold Smeulders. Segmentation as selective search for object recognition. In ICCV, 2011. 2 +[37] Oriol Vinyals, Charles Blundell, Timothy P. Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In NeurIPS, 2016. 1 +[38] Xin Wang, Thomas E. Huang, Trevor Darrell, Joseph E Gonzalez, and Fisher Yu. Frustratingly simple few-shot object detection. In ICML, 2020. 1, 2, 3, 5, 6, 7, 8 +[39] Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Metalearning to detect rare objects. In ICCV, 2019. 1, 2, 3 +[40] Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, 2018. 2, 3, 4, 6 +[41] Yu-Xiong Wang and Martial Hebert. Model recommendation: Generating object detectors from few samples. In CVPR, 2015. 1 +[42] Yu-Xiong Wang and Martial Hebert. Learning to learn: Model regression networks for easy small sample learning. In ECCV, 2016. 1 +[43] Jiaxi Wu, Songtao Liu, Di Huang, and Yunhong Wang. Multi-scale positive sample refinement for few-shot object detection. In ECCV, 2020. 2, 3, 6, 7 +[44] Yang Xiao and Renaud Marlet. Few-shot object detection and viewpoint estimation for objects in the wild. In ECCV, 2020. 2, 3, 6, 7 +[45] Xiaopeng Yan, Ziliang Chen, Anni Xu, Xiaoxi Wang, Xiaodan Liang, and Liang Lin. Meta R-CNN: Towards general solver for instance-level low-shot learning. In ICCV, 2019. 2, 3, 6 +[46] Yukuan Yang, Fangyun Wei, Miaojing Shi, and Guoqi Li. Restoring negative information in few-shot object detection. In NeurIPS, 2020. 2, 6 +[47] Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio Bengio, and Yangqiu Song. MetaGAN: An adversarial approach to few-shot learning. In NeurIPS, 2018. 3 +[48] Weilin Zhang, Yu-Xiong Wang, and David A. Forsyth. Cooperating RPN's improve few-shot object detection. arXiv preprint arXiv:2011.10142, 2020. 2, 3, 4, 5, 6, 7, 8 +[49] Xingyi Zhou, Jiacheng Zhuo, and Philipp Krahenbuhl. Bottom-up object detection by grouping extreme and center points. In CVPR, 2019. 2 +[50] Chenchen Zhu, Fangyi Chen, Uzair Ahmed, and Marios Savvides. Semantic relation reasoning for shot-stable few-shot object detection. In CVPR, 2021. 3, 6 +[51] Xiangxin Zhu, Dragomir Anguelov, and Deva Ramanan. Capturing long-tail distributions of object subcategories. In CVPR, 2014. 1 \ No newline at end of file diff --git a/hallucinationimprovesfewshotobjectdetection/images.zip b/hallucinationimprovesfewshotobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cef3af6c7d0b2420ba62630eea6038317c4bd1e3 --- /dev/null +++ b/hallucinationimprovesfewshotobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9733c0bc7adb6eddff4b0e0b1106678edee68ed22ef4ed02e56fa94d4d00e426 +size 423315 diff --git a/hallucinationimprovesfewshotobjectdetection/layout.json b/hallucinationimprovesfewshotobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..bc577daa4adee1dafa661bc21af9e7221f426754 --- /dev/null +++ b/hallucinationimprovesfewshotobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5def3e63204bc1c1addd2aefba7c3bab274d34fd58b4fae800bc5fb789c0839 +size 332268 diff --git a/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_content_list.json b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..885bccb031d3df42ea0264bee92ccac806022e98 --- /dev/null +++ b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89faf565a6ea568b92f153e1d9a92fe16d5bfb216eb821674c876e4335fa660f +size 77241 diff --git a/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_model.json b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d32ae5723eba505923445d78aeae3a2aeb3aae59 --- /dev/null +++ b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d64f4b4a01a341b240a12b2c0af6ef726d78659b0c227b73102564333f69027e +size 95590 diff --git a/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_origin.pdf b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1575f5bc57004c2e12a382548975cd4fe949cd31 --- /dev/null +++ b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/9998bb73-2d28-43ab-90ac-c5f283c115b0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cd5b5c441acc624a48e2b36c161a4cea800775062d1036b0e85ee151891f20a +size 1503149 diff --git a/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/full.md b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..923f1ada36724b5f5a3a341328f09aa1bc57883f --- /dev/null +++ b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/full.md @@ -0,0 +1,255 @@ +# Hardness Sampling for Self-Training Based Transductive Zero-Shot Learning + +Liu Bo, $^{12}$ Qiulei Dong, $^{134}$ Zhanyi Hu $^{12}$ $^{1}$ National Laboratory of Pattern Recognition, CASIA + $^{2}$ School of Future Technology, UCAS $^{3}$ School of Artificial Intelligence, UCAS $^{4}$ Center for Excellence in Brain Science and Intelligence Technology, CAS liubo2017@ia.ac.cn {qldong,huzy}@nlpr.ia.ac.cn, Corresponding author:Qiulei Dong + +# Abstract + +Transductive zero-shot learning (T-ZSL) which could alleviate the domain shift problem in existing ZSL works, has received much attention recently. However, an open problem in T-ZSL: how to effectively make use of unseen-class samples for training, still remains. Addressing this problem, we first empirically analyze the roles of unseen-class samples with different degrees of hardness in the training process based on the uneven prediction phenomenon found in many ZSL methods, resulting in three observations. Then, we propose two hardness sampling approaches for selecting a subset of diverse and hard samples from a given unseen-class dataset according to these observations. The first one identifies the samples based on the class-level frequency of the model predictions while the second enhances the former by normalizing the class frequency via an approximate class prior estimated by an explored prior estimation algorithm. Finally, we design a new Self-Training framework with Hardness Sampling for T-ZSL, called STHS, where an arbitrary inductive ZSL method could be seamlessly embedded and it is iteratively trained with unseen-class samples selected by the hardness sampling approach. We introduce two typical ZSL methods into the STHS framework and extensive experiments demonstrate that the derived T-ZSL methods outperform many state-of-the-art methods on three public benchmarks. Besides, we note that the unseen-class dataset is separately used for training in some existing transductive generalized ZSL (T-GZSL) methods, which is not strict for a GZSL task. Hence, we suggest a more strict T-GZSL data setting and establish a competitive baseline on this setting by introducing the proposed STHS framework to T-GZSL. + +# 1. Introduction + +Recently, zero-shot learning (ZSL), which aims to recognize unseen-class samples given a set of labeled seen-class samples and the semantic features of both the seen and un- + +seen classes, has attracted increasing attention in the fields of machine learning and computer vision. The key to ZSL is to learn an appropriate mapping between visual and semantic features, which could be adapted to the unseen-class domain. + +According to whether the unlabeled unseen-class samples are available for training, the existing ZSL methods could be divided into two categories: inductive ZSL (I-ZSL) methods [5, 49, 42, 17, 51, 12, 13, 36, 20, 22, 10] where only the labeled seen-class samples are available for training and transductive ZSL (T-ZSL) methods [35, 33, 43, 18, 28, 46, 38, 39, 25] where both the labeled seen-class samples and the unlabeled unseen-class samples are available for training. As pointed out in [15, 38, 46, 25] that the I-ZSL methods generally suffer from the domain shift problem that the learned model from the seen-class domain may not be suitable for the unseen-class one. In contrast to the I-ZSL methods, the T-ZSL methods could alleviate the domain shift problem to some extent due to the used unseen-class samples. However, it still remains the following open problem for T-ZSL: how to make use of unlabeled unseen-class samples for training more effectively? + +Addressing this problem, we firstly investigate the prediction accuracies of unseen classes on the public dataset by several popular I-ZSL methods, finding an uneven prediction phenomenon that for each of these methods, its prediction accuracies of some unseen classes are considerably different from those of the other unseen classes, that is to say, it is relatively harder to classify some unseen classes but easier to classify the others. The uneven prediction phenomenon encourages us to further investigate the roles of unseen-class samples with different degrees of classification hardness in the training process, resulting in three observations: When unseen-class samples are available for training, (1) samples from 'hard' classes are more effective for improving the performance of a given ZSL method than those from 'easy' classes; (2) the predicted pseudo labels of the hard classes are less noisy than those of the easy classes; (3) the diversity of hard classes is beneficial to improve the + +performance of a given ZSL method. + +According to the above observations, we explore two hardness sampling approaches for automatically selecting a subset of diverse and hard samples from the given set of unseen-class samples. The first one selects unseen-class samples according to the class-level frequency of the model predictions, while the second uses an explored prior estimation algorithm to estimate the approximate prior of unseen classes, and then selects unseen-class samples according to the normalized class-level frequency by the approximate prior. Finally, we design a new Self-Training framework with Hardness Sampling for T-ZSL, called STHS, where an arbitrary I-ZSL method could be seamlessly embedded and it is iteratively updated with an automatically selected unseen-class subset by one of the two explored hardness sampling approaches. + +A popular data setting in the transductive generalized ZSL(T-GZSL) used in many existing works [28, 43, 39] is that the testing unseen-class dataset is separately used for training, implying that it has been known whether a given sample is an unseen-class one or not. However, evaluations on this setting are not able to strictly reflect the ability of a T-GZSL method for handling the GZSL task, because in a GZSL task we only know that the testing dataset contains both seen-class and unseen-class data, but we indeed do not know whether a given sample belongs to the unseen classes or not. Hence, we present a more strict T-GZSL data setting where the unseen-class and seen-class samples are indistinguishable in both training and testing stages and establish a competitive baseline on this setting by introducing the proposed STHS framework to T-GZSL. + +In sum, our contributions are three-fold: + +- We empirically find three factors which are helpful for improving the performance of a given ZSL method when unseen-class samples are available for training. According to these factors, two hardness sampling approaches are proposed, which could effectively select diverse and hard samples from the given set of unseen-class samples. +- We design the STHS framework for T-ZSL, where various T-ZSL methods could be easily derived. Our experimental results demonstrate that when two typical I-ZSL methods are introduced into the proposed STHS framework respectively, the derived T-ZSL methods achieve superior performances than many state-of-the-art methods. +- We propose a more strict data setting to evaluate T-GZSL methods, and establish a competitive baseline on this setting by generalizing the STHS framework to T-GZSL. + +# 2. Related Work + +# 2.1. Inductive Zero-Shot Learning + +Existing inductive ZSL methods focused on learning a mapping between visual features and semantic features using seen-class data, which could be roughly divided into two categories: the embedding-based methods and the generative methods. Among the embedding-based methods, some works [5, 1, 2, 29, 40, 32, 44, 52, 11, 21] projected visual features into a semantic feature space by a linear or nonlinear function for object classification, which are impeded by the hubness problem. While some other works [3, 49, 24, 48] proposed to map semantic features into a visual feature space to alleviate the hubness problem. The generative methods [42, 26, 17, 28, 47, 51, 4, 9, 31, 50, 34, 19] utilized a conditional GAN to generate fake unseen-class samples and then these fake samples were used to train a classifier to classify real unseen-class samples. + +# 2.2. Transductive Zero-Shot Learning + +Recently, transductive ZSL methods [38] have been proposed to alleviate the domain shift problem in the inductive ZSL methods. Fu et al. [6] proposed a method where visual features and semantic features were projected into a multi-view embedding space and then a hyper-graph was constructed using the unlabeled data for label propagation. Kodirov et al. [15] utilized an unsupervised domain adaptation method with sparse coding to alleviate the domain shift problem. Song et al. [33] proposed a method where the sum of probabilities on unseen classes is encouraged to be relatively larger for unseen-class data. More recently, several generative methods [25, 28, 43, 39] have been proposed, where a conditional generator was used to generate seen/unseen class samples and two discriminators were used to discriminate fake/real seen-class and unseen-class samples respectively. In addition, a few works [46, 18] learned a more generalized visual-semantic mapping by iteratively training the model with a fixed number of pseudolabeled unseen-class samples. It has to be pointed out that although our method also employs an iterative training scheme, our main concern is to investigate the roles of different unseen-class samples in the training process and how to select pseudo-labeled samples more effectively to improve an arbitrary I-ZSL method, which is totally different from [46, 18]. + +# 3. Methodology + +We begin by introducing the definition of ZSL. Assume that we have a seen-class dataset $\mathcal{D}_{tr}^{S} = \{(x_{n},y_{n})\}_{n = 1}^{N}$ for training, where $x_{n}\in \mathbf{R}^{V}$ is a visual feature and $y_{n}$ is the class label of $x_{n}$ , belonging to the seen-class label set $Y^{S}$ , and $N$ is the sample number. The semantic feature set $E = \{e_y\in \mathbf{R}^S\mid y\in Y\}$ is also given, where $Y$ is the total + +![](images/50ae6d8a75f89e4df19be96008908c5c83deefb4f27ff57ddda5df62ceb64a99.jpg) +Figure 1. A: the uneven prediction phenomenon. B: the ACCs of models retrained with additional easy-class, hard-class and all-unseen-class data. C: the Precisions of the easy classes, hard classes, and all unseen classes. D: the ACCs of the models retrained with additional Top-1, Top-2, Top-4 hard-class data. + +![](images/07bb76f2a41089e9dab4b4b8f9b7c287ddd7e9baa154c027eb8dc2871a739df8.jpg) + +class label set which includes not only the seen-class label set $Y^{S}$ but also the unseen-class label set $Y^{U}$ disjoint with $Y^{S}$ . Given a test set $X$ , in the conventional ZSL, the task is to learn a mapping $F: X \to Y^{U}$ with the training set and semantic feature set, while in the generalized ZSL, the task is to learn a mapping $F: X \to Y$ . We denote the unlabeled unseen-class dataset by $\mathcal{D}^{U}$ and unlabeled seen-class dataset by $\mathcal{D}^{S}$ in the testing stage respectively. For the transductive ZSL, we assume that the testing unseen-class dataset $\mathcal{D}^{U}$ is available in the training stage. For the transductive generalized ZSL, we assume that the testing unseen-class dataset $\mathcal{D}^{U}$ and testing seen-class dataset $\mathcal{D}^{S}$ are both available in the training stage. + +In this section, we propose a Self-Training framework with Hardness Sampling (STHS) for T-ZSL, where a base I-ZSL model is iteratively trained with an automatically selected pseudo-labeled unseen-class subset. In the STHS framework, the core problem is how to select pseudolabeled samples from the given unseen-class dataset for retraining. Addressing this problem, we firstly analyze the uneven prediction phenomenon in 4 existing ZSL methods and make three observations about the roles of unseen-class samples with different degrees of hardness in the training process. Then, we propose two hardness sampling methods according to these observations. Finally, we introduce the details of the STHS framework. + +# 3.1. Influence of Unseen-Class Samples on Training + +Here we empirically investigate the influence of unseen-class samples on training ZSL models when the unlabeled unseen-class dataset is available. At the very beginning, we calculate the per-class accuracies on AWA2 [41] of 4 typical ZSL methods, including DEM [49] (a semantic-visual embedding-based method), AREN [44] (a visual-semantic + +embedding-based method), f-CLSWGAN [42] (a generative method), and CADA-VAE [31] (a generative method). The results are shown in Figure 1 A. From Figure 1 A, we find an uneven prediction phenomenon that some unseen classes have very high accuracies while the others have very low accuracies. Here, we name the unseen classes with high accuracies as easy classes and those with low accuracies as hard classes. The uneven prediction phenomenon encourages us to further investigate the roles of unseen-class samples with different degrees of hardness in the training process from 3 aspects as: + +Are Hard and Easy Classes Equally Important for Training? To answer this question, we perform a contrastive experiment on AWA2 [41] using DEM [49] and f-CLSWGAN [42]. Specifically, for each method, we firstly train a model with the training set (only including seen-class data) and then make predictions on the unlabeled unseen-class dataset with the trained model. Then, we compute the accuracies of all unseen classes. According to these per-class accuracies, we determine the Top-6 easy classes and Top-6 hard classes. Next, we randomly select a fixed number of samples in the following 3 manners: 1) from the Top-6 easy classes, 2) from the Top-6 hard classes, 3) from all the unseen classes, and add them into the training set respectively. Finally we retrain three models with the three datasets respectively. Note that the true labels instead of the predicted pseudo labels of unseen-class samples are used in the model retraining since this experiment is to investigate whether the hard and easy classes are equally important, which needs to exclude other potential factors, such as label noise. After retraining, we evaluate the ZSL performance of each retrained model by average per-class Top-1 accuracy (ACC). The results of DEM and f-CLSWGAN are reported in Figure 1 B. As shown in Figure 1 B, the red, green, and blue bars show the ACCs of the models retrained with additional easy-class, hard-class, and all-unseen-class data respectively. We find that the model retrained with additional hard-class data has the best performance for both methods. This demonstrates that the hard classes play a more important role for improving the performance of a given ZSL method than the easy classes. + +Do Pseudo Labels of Hard and Easy Classes Have Equal Level of Noise? In the above experiment, we retrain the models using the true labels of unseen-class samples. However, in practice, what we could indeed have are only the predicted pseudo labels. Here we investigate whether the pseudo labels of easy-class and hard-class samples have equal level of noise? To answer this question, we evaluate the noise level of pseudo labels predicted by DEM [49] and f-CLSWGAN [42] on AWA2 [41] using Precision metric. In the multi-class case, precision of the class C is equal to the ratio of the true C-class samples to all the samples predicted as the class C. Specifically, for each method, we + +firstly train a model with the training set and then obtain the predictions on unseen-class dataset using the trained model. Then, we compute the per-class precisions and per-class accuracies, and obtain the Top-6 easy classes and Top-6 hard classes according to the per-class accuracies. Finally, we compare the average per-class precision (Precision) of the Top-6 easy classes, Precision of the Top-6 hard classes, and Precision of all unseen classes. The results of DEM and fCLSWGAN are shown in Figure 1 C, where the red, green, and blue bars show the Precisions of the Top-6 easy classes, Top-6 hard classes, and all unseen classes respectively. We observe that the Precision of the Top-6 hard classes is significantly higher than those of the other two for both methods. This indicates that the pseudo labels of hard classes are less noisy than those of the easy classes. + +Is Class Diversity Helpful for Training? We have experimentally demonstrated that the hard-class samples are more important and less noisy than the easy-class samples. The following question is naturally raised: When the number of available unseen-class samples is given, how to select unseen-class samples is more helpful for training, selecting them from a few hardest classes or selecting them from diverse hard classes? Here we analyze the influence of class diversity on improving the ZSL performance by performing an experiment via DEM [49] and f-CLSWGAN [42] on AWA2 [41]. Specifically, for each method, we firstly compute the hardness level of each unseen class according to the per-class accuracies. Then, we select three groups of unseen-class samples with the same sample number, which are from the Top-1, Top-2 and Top-4 hard classes respectively. We add the three groups of data into the training set and retrain three models respectively. Finally, we evaluate the ZSL performance of each retrained model by ACC. The results of DEM and f-CLSWGAN are reported in Figure 1 D, where the red, green, blue bars show the ACCs of the model retrained with the additional Top-1, Top-2 and Top-4 hard-class data respectively. We find that the model retrained with the Top-4 hard-class data has the best performance for both methods. This demonstrates that the diversity of hard classes is beneficial to improve the performance of ZSL methods. + +# 3.2. Hardness Sampling + +According to the three observations in Section 3.1, we speculate that it is helpful to boost the ZSL performance by selecting pseudo-labeled unseen-class samples from diverse hard classes. However, the hard classes are identified with true labels of unseen classes in the above experiments, which are unavailable in practice. Hence, the remaining key problem is how to identify the hard-class samples from a given unseen-class dataset. In this section, we explore two hardness sampling approaches to tackle this problem. + +Class-Frequency Based Selection. Here we present the class-frequency based selection (CFBS) method to select diverse hard-class samples, consisting of two steps: (1) identifying the hard classes and (2) uniformly sampling the hard-class instances. To identify the hard classes, we propose a CFBS metric. Specifically, suppose we have a model $F$ and its predictions on the unseen-class dataset $\mathcal{D}^U$ are denoted by $P$ . We firstly compute the class frequency of the predictions $P$ as follows: + +$$ +\{f ^ {1}, \dots , f ^ {c}, \dots , f ^ {C} \} = \mathcal {H} (P) \tag {1} +$$ + +where $\mathcal{H}(\cdot)$ is the histogram function followed by a normalization function, whose bin number is the unseen-class number $C$ and $f^c$ is the frequency of pseudo label $c$ predicted by the model $F$ . A smaller $f^c$ means that the class $c$ is rarely predicted by the model, which to some extent indicates that the class $c$ is not familiar to the model, i.e. it is hard for the model. Hence, we employ the $f^c$ as the metric of class hardness and obtain the hardness level of each unseen class as follows: + +$$ +\left\{d ^ {1}, \dots , d ^ {i}, \dots , d ^ {C} \right\} = \operatorname {a r g s o r t} \left(\left\{f ^ {1}, \dots , f ^ {c}, \dots , f ^ {C} \right\}\right) \tag {2} +$$ + +where $d^{i}$ is the $i$ -th hardest class, and $\mathrm{argsort}(\cdot)$ ranks the inputs in an ascending order and return the indexes of sorted inputs. According to Equation 2, we select the Top- $K$ classes $\{d^i\}_{1}^K$ as the hard classes. Then, we randomly sample $n$ instances from each hard class $d^{i}$ with replacement and finally obtain a subset $\bar{\mathcal{D}}^U$ of pseudo-labeled unseen-class data which contains $n*K$ instances in total. + +Note that the rationality of the CFBS metric stems from the characteristics of the deep neural networks that the networks are prone to predict the inputs as the classes that they are familiar with. In other words, if a class is rarely predicted by a model, it very likely indicates that the model has seen little data or similar data from the class, i.e. this class is a hard class for the model. + +Prior-Normalized Class-Frequency Based Selection. The CFBS metric has its shortcoming. In the case of extremely unbalanced dataset, for a class $c$ with very small number of instances, even if the model is very familiar with this class, the metric $f^c$ is still very small, i.e. this class will be wrongly taken as a hard class. Similarly, for a class $c$ with very large number of instances, the metric $f^c$ is also ineffective. To overcome this shortcoming, we propose the prior-normalized class-frequency based selection (PN-CFBS) method, which enhances the CFBS method by replacing the CFBS metric by a PN-CFBS metric. Specifically, suppose we have the prior probability $p^c$ of the class $c$ and its class frequency $f^c$ can be obtained using Equation 1, we define the prior-normalized class frequency of the class $c$ as $\hat{f}^c = \frac{f^c}{p^c}$ . Then, we obtain the hardness level of each unseen class $\{\hat{d}^i\}_1^C$ in the same way with Equation 2. Sim + +ilar to the CFBS method, we could identify the hard classes and select the pseudo-labeled unseen-class subset $\bar{\mathcal{D}}^U$ . + +However, the class prior in the PN-CFBS metric is usually unknown for most datasets. Hence, we propose a classification-clustering consistency based method (3C method) to estimate the approximate class prior for the PN-CFBS method. Specifically, we firstly perform clustering on the unseen-class dataset and obtain the clustering predictions $P_{clu}$ . At the same time, we classify the unseen-class dataset with the model $F$ and obtain the classification predictions $P_{cls}$ . Then, as shown in Figure 2, we construct two prediction graphs $G_{clu}$ and $G_{cls}$ using $P_{clu}$ and $P_{cls}$ respectively, where if and only if the nodes have the same label, they will be connected by edges. Next, we construct a sub-graph $G_{sub}$ based on $G_{clu}$ and $G_{cls}$ in the manner that if and only if one edge consistently exists in both $G_{clu}$ and $G_{cls}$ , the edge and the corresponding nodes will be preserved in $G_{sub}$ . As a result, the sub-graph $G_{sub}$ has two properties: clustering property and semantic property. The clustering property comes from $G_{clu}$ , which could reflect the class prior information. As shown in Figure 2, the subgraph $G_{sub}$ keeps most nodes in the cluster. The semantic property comes from $G_{cls}$ , which gives the nodes in $G_{sub}$ semantic pseudo labels. As shown in Figure 2, the colors of the nodes in $G_{sub}$ show the pseudo labels. Suppose the pseudo labels of the nodes in $G_{sub}$ are denoted by $P_{sub}$ , we finally use $P_{sub}$ to estimate the approximate prior for unseen classes as follow: + +$$ +\{\hat {p} ^ {1}, \dots , \hat {p} ^ {c}, \dots , \hat {p} ^ {C} \} = \mathcal {H} (P _ {s u b}) \tag {3} +$$ + +where $\hat{p}^c$ is the estimated approximate prior of the class $c$ . In practice, $\hat{p}^c$ will be used to compute the PN-CFBS metric via $\hat{f}^c = \frac{f^c}{\hat{p}^c}$ . Note that the proposed 3C method does not devote itself to estimate the exact class prior of a dataset, it is rather designed to work together with the PN-CFBS method for identifying hard classes, where the class prior is not necessary to be very exact, since the PN-CFBS method is only required to compute the order of the prior-normalized class frequencies instead of their exact values. + +Compared with the CFBS metric, the PN-CFBS metric is effective on the extremely unbalanced dataset. However, we regard the PN-CFBS metric as a supplement for the CFBS metric when faced with extremely unbalanced dataset because: 1) the CFBS metric has considerable ability to deal with relatively unbalanced dataset since the CFBS method does not require the exact values of class frequencies, but their order; 2) the estimation of class prior for a dataset is a tough open problem, which affects the performance of PN-CFBS metric to some extent. + +# 3.3. STHS Framework + +In this section, we introduce the overall STHS framework. Suppose we have a base I-ZSL model $F_{0}$ at the + +![](images/9fd7987101c52e21be184104a65f1a03721548000603d4183ec5b460d9ec32d1.jpg) +Figure 2. Illustration of the classification-clustering consistency based approximate prior estimation. + +# Algorithm 1 STHS + +Input: $\mathcal{D}_{tr}^{S},\mathcal{D}^{U}$ + +Output: Predictions $P_T$ on $\mathcal{D}^U$ ; + +1: Initialization: train the base model $F_{0}$ with $\mathcal{D}_{tr}^{S}$ , obtain $\mathcal{D}_1$ using CFBS or PN-CFBS; +2: for $t = 1$ to T do +3: Re-train $F_{t}$ with the training set $\mathcal{D}_t$ +4: Make predictions $P_{t}$ on $\mathcal{D}^U$ using the trained $F_{t}$ ; +5: Update the training set as $\mathcal{D}_{t + 1}$ using CFBS or PN-CFBS based on $P_{t}$ +6: end for +7: return $P_T$ ; + +beginning and the whole training process includes $T$ iterative steps. At the $t$ -th $(t \in \{1, 2, \dots, T\})$ step, we firstly train the model $F_{t}$ with the training set $\mathcal{D}_{t}$ which consists of two parts: the seen-class dataset $\mathcal{D}_{tr}^{S}$ and the selected pseudo-labeled unseen-class subset $\bar{\mathcal{D}}_{t}^{U}$ . Then, we make predictions on the unseen-class dataset $\mathcal{D}^{U}$ using the trained model $F_{t}$ and these predictions $P_{t}$ are used to select a new pseudo-labeled unseen-class subset $\bar{\mathcal{D}}_{t+1}^{U}$ via the proposed hardness sampling approaches to update the training set as $\mathcal{D}_{t+1}$ which is used to re-train the base model at the $t+1$ -th step. Considering that the pseudo labels contain more noise at the beginning of iterative training, we select the pseudolabeled unseen-class subset in a step-wise incremental manner. Specifically, we select $[M/T] * t$ samples at the $t$ -th step, where $M$ is the number of samples in $\mathcal{D}^{U}$ and $[\cdot]$ is a down-round function. The overall algorithm is presented at Algorithm 1. Note that an arbitrary I-ZSL method could be embedded into the proposed STHS framework, here we introduce two typical ZSL models, S2V (an embedding-based method) and WGAN (a generative method) as the base models in the STHS framework, and the derived methods are named as STHS-S2V and STHS-WGAN respectively. The overall diagrams of STHS-S2V and STHS-WGAN and more details about S2V and WGAN are presented in the supplementary materials due to the limited space. + +# 4. Experimental Results + +# 4.1. Experimental Setup + +Datasets and Evaluation Protocol. We evaluate the proposed STHS-S2V and STHS-WGAN on three public + +benchmarks, including AWA2 [41], CUB [37], SUN [27]. AWA2 contains 37,322 images from 50 animal classes and each class is annotated with 85 attributes. CUB contains 11,788 images from 200 fine-grained birds species and 312 attributes are annotated for each species. SUN includes 14,340 images belonging to 717 scene classes and each class is annotated with 102 attributes. As done in most existing methods, the class-level attributes are used as semantic features in the proposed methods. The visual features which are extracted by the ImageNet1000 pre-trained ResNet101 [7] are used as model inputs. We evaluate the proposed methods with the the proposed split (PS) [41]. The standard split (SS) is not used since some unseen classes in SS have been seen by the ImageNet1000 pretrained ResNet101. In the conventional ZSL, average per-class Top-1 accuracy (ACC) on unseen classes is adopted to evaluate performance. In the generalized ZSL, ACCs on unseen classes and seen classes are firstly computed and then the harmonic mean of the two ACCs is computed to evaluate performance. + +Implementation Details and Comparative Methods. The based models, S2V and WGAN of our methods STHS-S2V and STHS-WGAN are implemented by slightly simplifying DEM [49] and f-CLSWGAN [42] respectively. The iterative step $T$ of STHS-S2V are $\{4,8,11\}$ on AWA2, CUB, and SUN respectively, while $T$ of STHS-WGAN are $\{4,6,4\}$ on AWA2, CUB, and SUN respectively. The number of hard classes $K$ are the same for both methods, which are $\{8,45,54\}$ on AWA2, CUB, and SUN respectively. For the clustering of unseen-class data, we firstly perform dimension reduction on them via t-SNE [23] technique and then perform clustering with Gaussian Mixture Model (GMM). At each iterative step, STHS-S2V is trained by $\{5,30,30\}$ epochs with learning rate as $\{0.001,0.0005,0.001\}$ and batch size as $\{128,128,128\}$ on AWA2, CUB, and SUN respectively. STHS-WGAN is trained by $\{20,40,40\}$ epochs on AWA2, CUB, and SUN respectively, with same learning rate 0.0002 and same batch size 128. The fake features generated in STHS-WGAN are used to train a feature classifier by 30 epochs with learning rate as 0.0002 and batch size as 256 on all the three datasets. Our code is available at the Github website + +The proposed STHS-S2V and STHS-WGAN are compared with the state-of-the-art ZSL methods, including 14 most recent competitive I-ZSL methods [5, 40, 16, 49, 42, 17, 51, 12, 13, 20, 22, 36, 24, 10] and 13 competitive T-ZSL methods [1, 35, 45, 33, 30, 43, 18, 28, 46, 38, 39, 14, 25]. + +# 4.2. Conventional ZSL Results + +Here we evaluate the proposed STHS-S2V and STHS-WGAN in the conventional ZSL on AWA2, CUB and SUN with PS data split and compare them with 25 existing meth + +Table 1. Comparative results (ACC) in the conventional ZSL setting on AWA2, CUB and SUN. + +
MethodAWA2CUBSUN
IDEVISE59.752.056.5
LATEM55.849.355.3
SAE54.133.340.3
DEM67.151.761.9
f-CSLWGAN-57.360.8
LiGAN-58.861.7
ABP70.458.561.5
TCN71.259.561.5
OCD-GZSL71.360.363.5
APNet68.057.762.3
DE-VAE69.363.164.0
LsrGAN-60.362.5
TALE-tran70.754.555.7
GFZSL78.650.064.0
DSRL72.848.756.8
QFSL79.772.158.3
GMN-64.664.3
f-VAEGAN-D289.871.170.1
GXE83.261.363.5
SABR-T88.974.067.5
PREN78.666.462.8
VSC81.771.062.2
ADA78.6-65.5
SDGN93.474.968.4
TF-VAEGAN92.174.770.9
STHS-S2V(Ours)91.471.270.9
STHS-WGAN(Ours)94.977.467.5
+ +ods. The corresponding results are reported in Table 1 where the methods marked by $\mathcal{I}$ are I-ZSL methods while those marked by $\mathcal{T}$ are T-ZSL methods. The results of comparative methods are cited from the original papers or public results [41]. Since the base I-ZSL methods, S2V and WGAN are obtained by slightly simplifying DEM [49] and f-CLSWGAN [42] respectively, we do not report their results due to the limited space. As seen from Table 1, STHS-WGAN significantly outperforms the comparative methods in most cases and STHS-S2V also achieves comparable performances with the most recent state-of-the-art methods. Specifically, STHS-WGAN achieves improvements about $1.5\%$ and $2.5\%$ on AWA2 and CUB respectively. All the improvements demonstrate that the proposed methods can effectively select pseudo-labeled unseen-class samples for transductive learning. In addition, the performance differences between STHS-S2V and STHS-WGAN tell us that the base model has an effect on the final performance of the STHS framework. We also note that STHS-WGAN achieves a relatively inferior performance on SUN. This is because that the base model in STHS-WGAN has relatively inferior performance on SUN. + +# 4.3. Generalized ZSL Results + +We perform the generalized ZSL (GZSL) with the derived methods from the STHS framework on AWA2, CUB and SUN under PS data split using two different settings. In the first setting, we follow the existing transductive generalized ZSL (T-GZSL) methods [28, 43, 39], where the testing unseen-class dataset $\mathcal{D}^U$ is separately used to train the model and the testing seen-class dataset $\mathcal{D}^S$ and testing unseen-class dataset $\mathcal{D}^U$ are compounded at the testing stage. In a more strict data setting, the testing seen-class dataset $\mathcal{D}^S$ and testing unseen-class dataset $\mathcal{D}^U$ are always indistinguishable for a GZSL task. Hence we propose a + +Table 2. Comparative results in the generalized ZSL setting on AWA2, CUB and SUN. $\mathrm{U} =$ unseen-class ACC, $\mathrm{S} =$ seen-class ACC, $\mathrm{H} =$ Harmonic mean of unseen-class and seen-class ACCs. + +
MethodAWA2CUBSUN
USHUSHUSH
If-CLSWGAN---43.757.749.742.636.639.4
DASCN---45.959.051.642.438.540.3
DVBE63.670.867.053.260.256.545.037.240.7
DAZLE60.375.767.156.759.658.152.324.333.2
OCD-GZSL59.573.465.744.859.951.344.842.943.8
APNet54.883.966.448.155.951.735.440.637.8
DE-VAE58.878.967.452.556.354.345.936.940.9
LsrGAN---48.159.153.044.837.740.9
TALE-tran12.673.021.523.545.130.919.922.621.2
GFZSL---24.945.832.2---
DSRL---17.339.024.017.725.020.7
GMN---60.270.665.057.140.747.5
f-VAEGAN-D284.888.686.761.465.163.260.641.949.6
GXE80.290.084.857.068.762.345.458.151.0
SABR-T79.791.085.067.273.770.358.841.548.6
PREN32.488.647.435.255.843.135.427.230.8
VSC71.988.279.233.186.147.929.962.940.6
SDGN88.889.389.169.970.270.162.046.052.8
TF-VAEGAN87.389.688.469.972.171.062.447.153.7
STHS-S2V(Ours)91.492.391.871.274.572.870.744.854.8
STHS-WGAN(Ours)94.992.393.677.474.575.967.544.853.9
+ +more strict data setting to evaluate T-GZSL methods. Here we perform GZSL using the first setting for fair comparison with the existing methods. In addition, we present the details in the more strict setting in section 4.5. + +In the first setting, since the testing unseen-class dataset $\mathcal{D}^U$ could be separately used to train the model, we firstly use the seen-class dataset $\mathcal{D}_{tr}^S$ and the testing unseen-class dataset $\mathcal{D}^U$ to train an out-of-distribution (OOD) detector [8]. Then, we train an unseen-class domain classifier using STHS-S2V or STHS-WGAN and train the seen-class domain classifier with seen-class dataset. At the testing stage, the inputs are firstly classified by the OOD detector. Then, the data classified as seen classes and unseen classes are further classified by the seen-class domain classifier and unseen-class domain classifier respectively. We compare the proposed methods with 23 existing methods. The results are reported in Table 2. As seen from Table 2, STHS-S2V and STHS-WGAN both significantly outperform the comparative methods. Specifically, STHS-S2V achieves improvements about $2.7\%$ , $1.8\%$ , and $1.1\%$ on AWA2, CUB and SUN respectively, while STHS-WGAN achieves improvements about $4.5\%$ , $4.9\%$ , and $0.2\%$ on AWA2, CUB and SUN respectively. These improvements demonstrate that the proposed STHS framework can select effective unseen-class samples for transductive learning. + +# 4.4. Discussions and Ablation + +The Identification of Hard Classes. To show that the proposed two hardness metrics are able to identify the hard classes at each iterative step in the self-training process, we firstly rank the unseen classes from hard to easy via the proposed two hardness metrics (CFBS and PN-CFBS) and compute the per-class Top-1 accuracies of unseen classes. We consider the front half of the ranked unseen classes as hard classes and the back half as easy classes. Then we + +![](images/15ea2dd09205c70f8aba016ae5cc28288ad953ef0911a5eb8d65e29dd8dc38dc.jpg) + +![](images/17bfbf3ebf24350f77307759e70db1f6999804d1e40b16e59f904d2e5e118097.jpg) +Figure 3. A: the ACCs of hard classes and easy classes in the self-training process. B: the Precisions of hard classes and easy classes in the self-training process. + +compute the average per-class Top-1 accuracies of 1) the hard classes and 2) the easy classes. Specifically, we conduct the experiments using STHS-S2V and STHS-WGAN on AWA2, CUB and SUN in the conventional ZSL setting. AWA2 is used to simulate extremely unbalanced dataset, hence the PN-CFBS metric is used on AWA2 while the CFBS metric is used on both CUB and SUN. The results of STHS-S2V are shown in Figure 3 A. From Figure 3 A, we can see that the CFBS metric and PN-CFBS metric have the ability to identify the hard classes at each iterative step. In addition, we also find that the difference between accuracies of hard classes and easy classes becomes smaller as the iterative training goes. This indicates that the uneven prediction problem is reduced by the proposed methods. The results of STHS-WGAN are consistent with the results of STHS-S2V, hence we do not present them here due to limited space. + +The Noise Level of Identified Hard Classes. To demonstrate that the identified hard classes by the proposed two hardness metrics have less noisy pseudo labels than the easy classes at each iterative step in the self-training process, we compute the average per-class precision (Precision) of 1) the hard classes and 2) the easy classes. The identification of the hard classes and easy classes is accomplished using the method in the above subsection. The experiments are conducted using STHS-S2V and STHS-WGAN on AWA2, CUB and SUN in the conventional ZSL setting. The results of STHS-S2V are shown in Figure 3 B. Figure 3 B shows us that the hard classes identified by the proposed metrics always have significantly less noisy + +pseudo labels than the easy classes. Since the results of STHS-WGAN are consistent with those of STHS-S2V, we do not report them here due to limited space. + +The Effect of Hardness Sampling. Here we analyze the effect of the two proposed hardness sampling approaches, CFBS and PN-CFBS. We compute the average per-class Top-1 accuracy (ACC) of a model trained with CFBS, ACC of a model trained with PN-CFBS, and ACC of a model trained with random sampling (RS). The experiments are conducted in the conventional ZSL setting on AWA2, CUB and SUN, using STHS-S2V and STHS-WGAN. The results are reported at Table 3. From Table 3, we can see that the performances with hardness sampling significantly outperforms those with RS, which demonstrates the effectiveness of the proposed hardness sampling. In addition, Table 3 indicates that PN-CFBS could significantly improve the performance against CFBS when the dataset (AWA2) is extremely unbalanced. We also observe that the performances of PN-CFBS are slightly inferior than those of CFBS on CUB and SUN. On the one hand, this result demonstrates that CFBS has considerable ability to deal with relatively unbalanced dataset. On the other hand, this result indicates that the performance of PN-CFBS is affected by the prior estimation since the prior estimation of a dataset with large number of classes and small number of per-class instances is a hard problem. Anyway, the STHS framework with both CFBS and PN-CFBS could achieve significant improvements against many existing ZSL methods, which demonstrates their effectiveness. + +# 4.5. A More Strict T-GZSL Data Setting + +In many existing T-GZSL works [28, 43, 39], a popular data setting is that the testing unseen-class dataset $\mathcal{D}^U$ is separately used for training, implying that it has been known whether a given sample is an unseen-class (or seen-class) one or not. However, the testing unseen-class dataset $\mathcal{D}^U$ and testing seen-class dataset $\mathcal{D}^S$ are indistinguishable in a GZSL task. Given this, we propose a more strict data setting to evaluate the T-GZSL methods, where the testing seen-class dataset $\mathcal{D}^S$ and testing unseen-class dataset $\mathcal{D}^U$ are indistinguishable at both training and testing stages. We generalize the proposed STHS framework to T-GZSL and establish a baseline on this setting. Specifically, we introduce the WGAN model as the base GZSL model and the derived method is denoted as STHS-GZSL. At each iterative step, the model performs GZSL on the compound testing seen-class dataset $\mathcal{D}^S$ and testing unseen-class dataset $\mathcal{D}^U$ and an unseen-class subset $\bar{\mathcal{D}}^U$ is selected with the proposed hardness sampling methods. The experiments are conducted on AWA2, CUB, and SUN. The results are reported at Table 4. As a contrast, we also report the results of 1) the base I-ZSL model WGAN(Inductive); 2) the WGAN model self-trained with random sampling, named + +Table 3. Comparative results with different sampling methods on AWA2, CUB and SUN. + +
MethodS2VWGAN
AWA2CUBSUNAWA2CUBSUN
RS85.066.066.787.573.163.1
CFBS88.971.270.989.877.467.5
PN-CFBS91.470.070.094.974.565.5
+ +Table 4. Comparative results in the more strict T-GZSL data setting on AWA2, CUB and SUN. + +
MethodAWA2CUBSUN
USHUSHUSH
WGAN52.276.662.152.946.749.644.030.736.2
ST-WGAN-RS75.182.778.759.768.863.941.935.938.6
STHS-GZSL85.481.083.265.167.466.245.136.240.2
+ +as ST-WGAN-RS(Tansductive). Comparing the results at Table 4 and Table 2, we can see that the T-GZSL performances decrease significantly when the testing unseen-class dataset could not be separately used to train the model. This decrease is reasonable since the compounded testing seen-class dataset and testing unseen-class dataset will make the transductive training more difficult by, for instance, increasing the noise level of pseudo labels. Even so, the STHS-GZSL still provides a competitive baseline for T-GZSL. In addition, the model using the proposed hardness sampling significantly outperforms the model using random sampling, which demonstrates that the proposed hardness sampling is also effective in T-GZSL. + +# 5. Conclusion + +In this paper, we propose a Self-Training framework with Hardness Sampling (STHS) for T-ZSL, where the core problem is how to select diverse hard-class samples for iterative training. Addressing this problem, we first empirically analyze the roles of unseen-class samples with different level of hardness in the training process, based on the uneven prediction phenomenon found in many ZSL methods. Then, we propose two hardness sampling techniques which can identify the hard-class samples based on the class frequency and prior-normalized class frequency of model predictions. We introduce two typical I-ZSL methods into the STHS framework and extensive experimental results on three public benchmarks demonstrate that the derived methods significantly outperform many state-of-the-art methods. Besides, we propose a more strict data setting to evaluate T-GZSL and establish a competitive baseline on this setting by generalizing the proposed STHS framework to T-GZSL. + +# 6. Acknowledgements + +This work was supported by the National Natural Science Foundation of China (NSFC) under Grants (61991423, U1805264) and the Strategic Priority Research Program of the Chinese Academy of Sciences (XDB32050100). + +# References + +[1] Zeynep Akata, Florent Perronnin, Zaid Harchaoui, and Cordelia Schmid. Label-embedding for image classification. IEEE TPAMI, 38(7):1425-1438, 2015. 2, 6 +[2] Zeynep Akata, Scott Reed, Daniel Walter, Honglak Lee, and Bernt Schiele. Evaluation of output embeddings for fine-grained image classification. In CVPR, pages 2927-2936, 2015. 2 +[3] Soravit Changpinyo, Wei-Lun Chao, and Fei Sha. Predicting visual exemplars of unseen classes for zero-shot learning. In ICCV, pages 3476-3485, 2017. 2 +[4] Zhengming Ding and Hongfu Liu. Marginalized latent semantic encoder for zero-shot learning. In CVPR, pages 6191-6199, 2019. 2 +[5] Andrea Frome, Greg S Corrado, Jon Shlens, Samy Bengio, Jeff Dean, Tomas Mikolov, et al. Devise: A deep visual-semantic embedding model. In NIPS, pages 2121-2129, 2013. 1, 2, 6 +[6] Yanwei Fu, Timothy M. Hospedales, Tao Xiang, and Shaogang Gong. Transductive multi-view zero-shot learning. IEEE TPAMI, 37(11):2332-2345, 2015. 2 +[7] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 6 +[8] Dan Hendrycks, Mantas Mazeika, and Thomas G. Dietterich. Deep anomaly detection with outlier exposure. In ICLR, 2019. 7 +[9] He Huang, Changhu Wang, Philip S Yu, and Chang-Dong Wang. Generative dual adversarial network for generalized zero-shot learning. In CVPR, pages 801-810, 2019. 2 +[10] Dat Huynh and Ehsan Elhamifar. Fine-grained generalized zero-shot learning via dense attribute-based attention. In CVPR, pages 4483-4493, 2020. 1, 6 +[11] Zhong Ji, Yanwei Fu, Jichang Guo, Yanwei Pang, Zhongfei Mark Zhang, et al. Stacked semantics-guided attention model for fine-grained zero-shot learning. In NIPS, pages 5995-6004, 2018. 2 +[12] Huajie Jiang, Ruiping Wang, Shiguang Shan, and Xilin Chen. Transferable contrastive network for generalized zero-shot learning. In ICCV, pages 9765-9774, 2019. 1, 6 +[13] Rohit Keshari, Richa Singh, and Mayank Vatsa. Generalized zero-shot learning via over-complete distribution. In CVPR, pages 13300-13308, 2020. 1, 6 +[14] Varun Khare, Divyat Mahajan, Homanga Bharadhwaj, V. Verma, and P. Rai. A generative framework for zero-shot learning with adversarial domain adaptation. WACV, pages 3090-3099, 2020. 6 +[15] Elyor Kodirov, Tao Xiang, Zhen-Yong Fu, and Shaogang Gong. Unsupervised domain adaptation for zero-shot learning. In ICCV, pages 2452-2460, 2015. 1, 2 +[16] Elyor Kodirov, Tao Xiang, and Shaogang Gong. Semantic autoencoder for zero-shot learning. In CVPR, pages 3174-3183, 2017. 6 +[17] J. Li, Mengmeng Jing, K. Lu, Z. Ding, Lei Zhu, and Zi Huang. Leveraging the invariant side of generative zero-shot learning. CVPR, pages 7394-7403, 2019. 1, 2, 6 + +[18] Kai Li, Martin Renqiang Min, and Yun Fu. Rethinking zero-shot learning: A conditional visual classification perspective. In ICCV, pages 3583-3592, 2019. 1, 2, 6 +[19] Bo Liu, Qialei Dong, and Zhanyi Hu. Zero-shot learning from adversarial feature residual to compact visual feature. In AAAI, pages 11547-11554, 2020. 2 +[20] Lu Liu, Tianyi Zhou, Guodong Long, Jing Jiang, and Chengqi Zhang. Attribute propagation network for graph zero-shot learning. In AAAI, pages 4868-4875, 2020. 1, 6 +[21] Yang Liu, Jishun Guo, Deng Cai, and Xiaofei He. Attribute attention for semantic disambiguation in zero-shot learning. In ICCV, pages 6698-6707, 2019. 2 +[22] Peirong Ma and X. Hu. A variational autoencoder with deep embedding model for generalized zero-shot learning. In AAAI, 2020. 1, 6 +[23] L. V. D. Maaten and Geoffrey E. Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9:2579-2605, 2008. 6 +[24] Shaobo Min, Hantao Yao, Hongtao Xie, Chaoqun Wang, Zheng-Jun Zha, and Yongdong Zhang. Domain-aware visual bias eliminating for generalized zero-shot learning. In CVPR, pages 12661-12670, 2020. 2, 6 +[25] Sanath Narayan, A. Gupta, F. Khan, Cees G. M. Snoek, and L. Shao. Latent embedding feedback and discriminative features for zero-shot classification. ArXiv, abs/2003.07833, 2020. 1, 2, 6 +[26] Jian Ni, Shanghang Zhang, and Haiyong Xie. Dual adversarial semantics-consistent network for generalized zero-shot learning. In NIPS, pages 6143-6154, 2019. 2 +[27] Genevieve Patterson and James Hays. Sun attribute database: Discovering, annotating, and recognizing scene attributes. In CVPR, pages 2751-2758, 2012. 6 +[28] Akanksha Paul, Narayanan C Krishnan, and Prateek Munjal. Semantically aligned bias reducing zero shot learning. In CVPR, pages 7056-7065, 2019. 1, 2, 6, 8 +[29] Bernardino Romera-Paredes and Philip Torr. An embarrassingly simple approach to zero-shot learning. In ICML, pages 2152-2161, 2015. 2 +[30] Mert Bulent Sariyildiz and Ramazan Gokberk Cinbis. Gradient matching generative networks for zero-shot learning. In CVPR, pages 2168-2178, 2019. 6 +[31] Edgar Schonfeld, Sayna Ebrahimi, Samarth Sinha, Trevor Darrell, and Zeynep Akata. Generalized zero-and few-shot learning via aligned variational autoencoders. In CVPR, pages 8247-8255, 2019. 2, 3 +[32] Richard Socher, Milind Ganjoo, Christopher D Manning, and Andrew Ng. Zero-shot learning through cross-modal transfer. In NIPS, pages 935-943, 2013. 2 +[33] Jie Song, Chengchao Shen, Yezhou Yang, Yang Liu, and Mingli Song. Transductive unbiased embedding for zero-shot learning. In CVPR, pages 1024-1033, 2018. 1, 2, 6 +[34] Vinay Kumar Verma, Dhanajit Brahma, and Piyush Rai. Meta-learning for generalized zero-shot learning. In AAAI, pages 6062-6069, 2020. 2 +[35] Vinay Kumar Verma and Piyush Rai. A simple exponential family framework for zero-shot learning. In ECML-KDD, pages 792-808. Springer, 2017. 1, 6 + +[36] M. R. Vyas, Hemanth Venkateswara, and S. Panchanathan. Leveraging seen and unseen semantic relationships for generative zero-shot learning. In ECCV, 2020. 1, 6 +[37] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 6 +[38] Ziyu Wan, Dongdong Chen, Yan Li, Xingguang Yan, Junge Zhang, Yizhou Yu, and Jing Liao. Transductive zero-shot learning with visual structure constraint. In NIPS, pages 9972-9982, 2019. 1, 2, 6 +[39] Jiamin Wu, Tianzhu Zhang, Zheng-Jun Zha, Jiebo Luo, Yongdong Zhang, and Feng Wu. Self-supervised domain-aware generative network for generalized zero-shot learning. In CVPR, pages 12767-12776, 2020. 1, 2, 6, 8 +[40] Yongqin Xian, Zeynep Akata, Gaurav Sharma, Quynh Nguyen, Matthias Hein, and Bernt Schiele. Latent embeddings for zero-shot classification. In CVPR, pages 69-77, 2016. 2, 6 +[41] Yongqin Xian, Christoph H Lampert, Bernt Schiele, and Zeynep Akata. Zero-shot learning-a comprehensive evaluation of the good, the bad and the ugly. IEEE TPAMI, 2018. 3, 4, 6 +[42] Yongqin Xian, Tobias Lorenz, Bernt Schiele, and Zeynep Akata. Feature generating networks for zero-shot learning. In CVPR, pages 5542-5551, 2018. 1, 2, 3, 4, 6 +[43] Yongqin Xian, Saurabh Sharma, Bernt Schiele, and Zeynep Akata. f-vaegan-d2: A feature generating framework for any-shot learning. In CVPR, pages 10275-10284, 2019. 1, 2, 6, 8 +[44] Guo-Sen Xie, Li Liu, Xiaobo Jin, Fan Zhu, Zheng Zhang, Jie Qin, Yazhou Yao, and Ling Shao. Attentive region embedding network for zero-shot learning. In CVPR, pages 9384-9393, 2019. 2, 3 +[45] M. Ye and Yuhong Guo. Zero-shot classification with discriminative semantic representation learning. CVPR, pages 5103-5111, 2017. 6 +[46] Meng Ye and Yuhong Guo. Progressive ensemble networks for zero-shot recognition. In CVPR, pages 11728-11736, 2019. 1, 2, 6 +[47] Hyeonwoo Yu and Beomhee Lee. Zero-shot learning via simultaneous generating and learning. In NIPS, pages 46-56, 2019. 2 +[48] Yunlong Yu, Zhong Ji, Jungong Han, and Zhongfei Zhang. Episode-based prototype generating network for zero-shot learning. In CVPR, pages 14032-14041, 2020. 2 +[49] Li Zhang, Tao Xiang, and Shaogang Gong. Learning a deep embedding model for zero-shot learning. In CVPR, pages 2021-2030, 2017. 1, 2, 3, 4, 6 +[50] Yizhe Zhu, Mohamed Elhoseiny, Bingchen Liu, Xi Peng, and Ahmed Elgammal. A generative adversarial approach for zero-shot learning from noisy texts. In CVPR, pages 1004-1013, 2018. 2 +[51] Yizhe Zhu, Jianwen Xie, Bingchen Liu, and Ahmed Elgammal. Learning feature-to-feature translator by alternating back-propagation for generative zero-shot learning. In ICCV, pages 9844-9854, 2019. 1, 2, 6 + +[52] Yizhe Zhu, Jianwen Xie, Zhiqiang Tang, Xi Peng, and Ahmed Elgammal. Semantic-guided multi-attention localization for zero-shot learning. In NIPS, pages 14917–14927, 2019. 2 \ No newline at end of file diff --git a/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/images.zip b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0f22ea31770d291123db68d09c89094c626c926c --- /dev/null +++ b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:693db819cf137848bec10bcaf00e2369222c505a73312efde4d4f7bc44257bc2 +size 223000 diff --git a/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/layout.json b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..32ff22377fb78c8a62952041080806e91a54a57b --- /dev/null +++ b/hardnesssamplingforselftrainingbasedtransductivezeroshotlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b6bd8f7754a1344aa6cb604f7185030d00a7b7892fa3988f5b2fd443c2f3565 +size 412511 diff --git a/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_content_list.json b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..19857340e85096fd603c8387979352054bf2ac07 --- /dev/null +++ b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7d2169010c01ec263734c3832f2bd85ca0eb09d6d407633ea95983fae361ea7 +size 76621 diff --git a/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_model.json b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fdb23836f5478c0d475e988772b78119829c7435 --- /dev/null +++ b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4de40a9fb038a798c3f654142e597ae73a7e7ae4f906448e70977c1b6dedb88 +size 99701 diff --git a/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_origin.pdf b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6107e6e29f3b1b2b44153cc0299f48d2e10d79d0 --- /dev/null +++ b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/a85421e5-933c-4e6b-b224-34bf4cb70caf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c031f7583454094c008eeac3b47efb488d1955985aeb1c01d738fb644331ad2b +size 6405979 diff --git a/harmonioussemanticlinedetectionviamaximalweightcliqueselection/full.md b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..89eac599df73aa9d9017930b58e61a07df599a7d --- /dev/null +++ b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/full.md @@ -0,0 +1,426 @@ +# Harmonious Semantic Line Detection via Maximal Weight Clique Selection + +Dongkwon Jin, Wonhui Park Korea University + +dongkwonjin,whpark@mcl.korea.ac.kr + +Seong-Gyun Jeong 42dot.ai + +seonggyun.jeong@42dot.ai + +Chang-Su Kim +Korea University + +changsukim@korea.ac.kr + +# Abstract + +A novel algorithm to detect an optimal set of semantic lines is proposed in this work. We develop two networks: selection network (S-Net) and harmonization network (H-Net). First, S-Net computes the probabilities and offsets of line candidates. Second, we filter out irrelevant lines through a selection-and-removal process. Third, we construct a complete graph, whose edge weights are computed by H-Net. Finally, we determine a maximal weight clique representing an optimal set of semantic lines. Moreover, to assess the overall harmony of detected lines, we propose a novel metric, called HIoU. Experimental results demonstrate that the proposed algorithm can detect harmonious semantic lines effectively and efficiently. Our codes are available at https://github.com/dongkwonjin/SemanticLine-MWCS. + +# 1. Introduction + +A semantic line [16, 19] is defined as a meaningful line, separating different semantic regions in a scene, which is approximated by an end-to-end straight line. A group of semantic lines in an image can be regarded as optimal, when they convey the composition of the image harmoniously, as shown in Figure 1(e). Thus, in an optimal set, the lines should harmonize with one another. + +Semantic lines provide important visual cues in high-level image understanding [7,9,12,18,20,21,36]. In photography, semantic lines, such as horizontal, vertical, and symmetric ones, are essential composition components. Harmony of such lines are closely related to subjective quality of a photograph [7, 18, 20]. In autonomous driving systems [9, 12, 13], boundaries of road lanes and sidewalks should be detected reliably to control vehicle maneuvers, which can be also described by semantic lines. Moreover, dominant parallel lines intersect at vanishing points [21,36] under perspective projection, conveying depth impression. They are also semantic lines [16]. However, it is challenging to detect semantic lines, which are often unobvious and implied by complex boundaries of semantic regions. + +![](images/dddda0bb54062f51ed6f9bd7161dd8187dae5ded6fa0494d8d61f0b60a52910b.jpg) +Figure 1: In each scene, straight lines approximating region boundaries are shown in (a). Among them, three subsets of lines are shown in (b), (c), and (d), which are insufficient, over-segmenting, and sub-optimal for describing the composition of the scene, respectively. In contrast, an optimal set of semantic lines in (e) convey the composition of the scene harmoniously. + +![](images/a5a858468514f0a1336521985b2800347ea03bbe031f4438d47f674dd67b8dc1.jpg) + +![](images/fc7adc9fb3bd702dbc8ffa15c9abc5f0a1e9d4fe512860c746a43bb93747ef10.jpg) + +![](images/219af2e420136e21c2a805365438bec64262b4101dc9967afc6c25a1067e0319.jpg) + +Many techniques have been developed to detect line segments in a scene by exploiting hand-crafted features [1, 4, 23, 28] or deep features [15, 22, 31, 37]. However, they may extract redundant short line segments or focus on identifying obvious line structures in man-made environments. Recently, several attempts have been made to detect semantic lines [10, 16, 19, 29, 32]. Horizon lines, which are a specific type of semantic lines, have been estimated by CNN-based methods [29, 32]. In [10, 16, 19], semantic line detectors have been proposed. They have two stages: line detection and refinement. In the detection stage, deep line features are extracted to classify line candidates, but implied lines may be undetected or the computational cost for extracting discriminative features can be too high. In the refinement stage, redundant lines are removed through non-maximum suppression (NMS) or pairwise comparison. Although these techniques provide promising results, they may fail to consider the harmony between detected lines and thus may yield sub-optimal results, as shown in Figure 1(d). + +In this paper, a novel algorithm to detect an optimal set + +![](images/a75b5568fbd3aa5a2c3b96e74c344c23e5f26258e4e97a5b5201de7b6d76f0dc.jpg) +Image + +![](images/296e9368debb9d23cf7c03cd9959283a3eb0e59468fa05538c9841b837711ec0.jpg) +(a) Line probability and offset computation + +![](images/5a6e4af7c378f0b2b40eac9a6cc2484c2cf3a12ea466ec215cc260bbd3bad5b0.jpg) +(b) Selection and removal + +![](images/c1f51a1d357706af2e6b55ec1080df3d45d0bc07bc8629497cca0a7eb82da308.jpg) +Selected lines + +![](images/dc7f26ab47bc4c7c25fefd435ffac36a3c3706264d1fddff68a4a21407c1aea8.jpg) +(c) Edge weight estimation + +![](images/f8e844ea55a1ff15f5df0aadf15ee2fdb0cb68d459313b5a818c317a53f1ba0a.jpg) +(d) Finding maximal weight clique +Figure 2: Overview of the proposed algorithm. + +of harmonious semantic lines is proposed based on maximal weight clique selection (MWCS). We formulate the detection as finding a maximal weight clique in a complete graph [3, 8]. To this end, we design two networks: selection network (S-Net) and harmonization network (H-Net). Given an image and a set of line candidates, S-Net first computes the classification probability and regression offsets of each candidate. Second, we filter out irrelevant lines by performing a selection-and-removal process. Third, we construct a complete graph, in which the node set contains the selected lines. H-Net computes its edge weights. Finally, we determine a maximal weight clique representing harmonious semantic lines. Experimental results demonstrate that the proposed algorithm can detect harmonious semantic lines accurately and efficiently. + +This work has the following major contributions: + +- We formulate the semantic line detection as finding an maximal weight clique in a complete graph. +- We develop two networks, S-Net and H-Net, to construct the complete graph. +- We introduce a novel metric, called HIoU, to assess the overall harmony of semantic lines, which is more reasonable than the existing metrics in [10, 19]. +- The proposed algorithm yields competitive semantic line detection performance to the state-of-the-art DRM technique [16], while reducing the computational complexity by a factor of $\frac{1}{20}$ . + +# 2. Related Work + +# 2.1. Line segment detection + +Line segments give important visual cues for image semantics. In line segment detection [1,4,23,28], many short + +segments are detected using low-level features, such as image gradients. This approach, however, may not discriminate meaningful lines from noisy ones. To utilize higher-level features, deep learning methods have been proposed [15, 22, 31, 37]. In [15], a line heat map and junctions were predicted by networks. Then, a wireframe was obtained by connecting the junctions based on the heat map. In [37], a line candidate was generated by connecting two junctions and then was classified into either a salient one or not. In [31], attraction field maps were computed by a network to deal with local ambiguity and class imbalance in line segment detection. In [22], a network was trained with a Hough transform block to combine local information with global line priors. These methods [15, 27, 31, 37] focus on detecting obvious lines in man-made environments. + +# 2.2. Semantic line detection + +Semantic lines, located near the boundaries of semantic regions, represent the layout and composition of images. Several methods [5, 10, 16, 19, 29, 32] have been developed to detect implied but semantically meaningful lines. In [5, 29, 32], horizon lines were detected by CNNs, which were refined by exploiting vanishing points or using soft labels of line parameters. In [19], Lee et al. proposed the first semantic line detector. They devised a line pooling layer to extract local features along each line candidate. Those features were fed into classification and regression layers to detect semantic lines. Then, an NMS scheme was performed to remove redundant lines, based on the edge detector [30]. In [16], Jin et al. extracted more discriminative line features by designing a region pooling layer and the mirror attention module. Then, they selected the most semantic lines and removed redundant lines alternately through pairwise ranking and matching. In [10], Han et al. transformed line features into a Hough parametric space to facilitate parallel + +processing of multiple line candidates. Then, they trained a network to predict a line probability map, which was used to determine semantic lines by computing the centroids of connected components. + +# 2.3. Road lane detection + +In autonomous driving systems, it is important to reliably detect the boundaries of road lanes, sidewalks, or crosswalks. Early methods [2, 11, 12, 35] used hand-crafted low-level features to extract lanes. Recently, to cope with complicated road scenes, attempts have been made to detect road lanes using deep semantic segmentation frameworks [13, 14, 24, 25]. In [24], Pan et al. proposed a network to learn spatial relationship of lanes through message passing between convolution layers. In [14], a network was designed to generate attention maps at different layers, which were used to refine the output of deeper ones. In [13], the inter-region affinity graph was constructed to transfer structural relationship between lanes from teacher to student networks. In [25], to achieve a high processing speed, a network was developed to identify the location of each lane on a predefined set of rows only. + +# 3. Proposed Algorithm + +Figure 2 is an overview of the proposed algorithm, which contains S-Net and H-Net. First, given an image and a set of line candidates, S-Net computes the line probability and the regression offsets of each candidate. Second, irrelevant candidates are filtered out through a selection-and-removal process. Third, a complete graph, whose node set consists of the selected lines, is constructed and its edge weights are computed by H-Net. Finally, a maximal weight clique, representing harmonious semantic lines, is determined. + +# 3.1. Problem formulation + +Semantic lines in an image can be regarded as optimal if they convey the composition of the image harmoniously. In other words, in an optimal set, every pair of semantic lines should harmonize with each other. As in Figure 3(b), a pair of semantic lines should direct visual attention to meaningful regions. In contrast, in Figure 3(c), two lines are redundant or inharmonious. Based on this observation, we formulate the semantic line detection as finding a maximal weight clique in a complete graph [3, 8]. In the complete graph, detected lines form the node set, and each edge weight represents how harmonious the associated two lines are. Thus, by finding a maximal weight clique, we find an optimal set of harmonious semantic lines. + +# 3.2. Node selection: filtering line candidates + +It is computationally infeasible to construct a complete graph for all line candidates. Therefore, we select reliable nodes only by filtering line candidates. + +![](images/51d4f6400ed672cbdb373c4980d75fbab09b1d9becbbcfb522083a2c15ffdb5c.jpg) +(a) Line set + +![](images/767945781b7c9ee51ee60bf71374ea0ded5d5f1accec33661d92908380c7b419.jpg) +(b) Positive pair + +![](images/f29a1d03634513a42e5c37e7789b831f91f27fc324b534686e9db842bdae976a.jpg) +Figure 3: In a line set, a pair of lines can be harmonious and draw visual attention to meaningful regions as in (b). In contrast, they can be redundant or inharmonious as in (c). + +![](images/650f0844ba737e285abe7f5b3b754397e724b1f802b5b06a2368990afc81eb2c.jpg) +(c) Negative pair + +Line candidate generation: A line candidate, which is an end-to-end straight line in an image, can be parameterized by polar coordinates in the Hough space [10, 17, 22]. Let $\mathbf{l} = (\rho, \varphi)$ denote a line, where $\rho$ is its distance from the center of the image and $\varphi$ is its angle from the $x$ -axis. Then, we generate $N$ line candidates, denoted by $\mathbf{l}_n = (\rho_n, \varphi_n)$ , $1 \leq n \leq N$ , by quantizing $\rho$ and $\varphi$ uniformly. + +S-Net: For each line candidate, we compute its classification probability and regression offsets. To this end, we develop S-Net based on the conventional line detectors [10, 16, 19]. Figure 4(a) shows the architecture of S-Net. From an image, S-Net extracts a convolutional feature map $X = [X^{1},X^{2},\ldots ,X^{C}] \in \mathbb{R}^{H\times W\times C}$ , where $H,W$ , and $C$ denote the feature height, the feature width, and the number of channels. Then, the line feature map $Y = [Y^{1},Y^{2},\dots ,Y^{C}] \in \mathbb{R}^{N\times C}$ is obtained by averaging the features of pixels along $\mathbf{l}_n$ ; + +$$ +Y ^ {c} (n) = \frac {1}{| \mathbf {l} _ {n} |} \sum_ {\mathbf {p} \in \mathbf {l} _ {n}} X ^ {c} (\mathbf {p}) \tag {1} +$$ + +for $1 \leq n \leq N$ and $1 \leq c \leq C$ , where $|\mathbf{l}_n|$ denotes the number of pixels along $\mathbf{l}_n$ . We then obtain the probability vector $P$ and the line offset matrix $O$ by + +$$ +P = \sigma \left(f _ {1} (Y)\right) \quad \text {a n d} \quad O = f _ {2} (Y) \tag {2} +$$ + +where $f_{1}$ and $f_{2}$ are fully-connected layers of sizes $C \times 1$ and $C \times 2$ for classification and regression, respectively, and $\sigma(\cdot)$ is the sigmoid activation function. For the $n$ th line candidate $\mathbf{l}_n = (\rho_n, \varphi_n)$ , $P_n$ indicates the probability that it is semantic, and $O_n = \Delta \mathbf{l}_n = (\Delta \rho_n, \Delta \varphi_n)$ is the offset vector for line refinement in Section 3.4. + +The architecture and training process of S-Net are described in detail in the supplemental document. + +Selection and removal: In the conventional algorithms [10, 16, 19], to detect semantic lines, only the line candidates with probabilities higher than a threshold are selected and then post-processed (e.g. non-maximum suppression). However, this may cause false negatives, which have low probabilities because of being implicit but are semantic nonetheless. To reduce such false negatives, instead + +![](images/8ebddc1919facc92d20f8848e70e869126b4493157999bd3817a2432d052b0d5.jpg) +(a) S-Net + +![](images/61bf8f11f986af3c5120ca01af11c33cf3604ee1c094a35e5580618b13b4783c.jpg) +(b) H-Net +Figure 4: Architecture of S-Net and H-Net: (a) S-Net takes an image and line candidates and extracts the line feature map. The classification probabilities and regression offsets of the line candidates are then computed by two fully connected layers. (b) H-Net takes an image and a line pair $(i,j)$ to extract local and inter-region features. Two types of regression layers are used to compute the harmony score $h_{ij}$ . + +of thresholding, we perform the selection-and-removal process in Figure 2(b). We select the most reliable line $\mathbf{l}_i\star$ by + +$$ +i ^ {\star} = \arg \max _ {i} P _ {i} \tag {3} +$$ + +and then remove overlapping lines with the selected one. Specifically, we remove 24 lines within the $5 \times 5$ grid centered at $\mathbf{l}_i\star$ in the Hough space [10, 22]. We perform this process $K$ times to compose the node set of $K$ selected lines. Figure 5(b) and (e) show such selected lines on the image and Hough spaces, respectively. + +# 3.3. Edge weighting: harmony score estimation + +Inter-region correlation: To tell positive pairs in Figure 3(b) from negative pairs in Figure 3(c), we design the inter-region-correlation (IRC) module that analyzes the regions separated by a pair of lines. + +Let $\mathcal{R}_i, 1 \leq i \leq M$ , denote the regions separated by two lines. There can be three or four regions, i.e. $M = 3$ or 4. We extract the regional feature vector $\mathbf{r}_i$ of $\mathcal{R}_i$ by + +$$ +\mathbf {r} _ {i} = \frac {1}{| \mathcal {R} _ {i} |} \sum_ {\mathbf {p} \in \mathcal {R} _ {i}} X (\mathbf {p}). \tag {4} +$$ + +We compute the softmax probability $a_{i}$ of the area $|\mathcal{R}_i|$ to scale the regional feature vectors, and then concatenate the scaled vectors into + +$$ +R = \left[ a _ {1} \mathbf {r} _ {1}, a _ {2} \mathbf {r} _ {2}, a _ {3} \mathbf {r} _ {3}, a _ {4} \mathbf {r} _ {4} \right] \tag {5} +$$ + +of size $C \times 4$ . If $M = 3$ , we fill in the rightmost vector with zeros. Then, $R$ is fed into a fully connected layer to yield + +the IRC feature. + +H-Net: We develop H-Net using the IRC module. It takes an image and a pair of lines, indexed by $i$ and $j$ , to yield the harmony score $h_{ij}$ ranging from 0 to 1. Figure 4(b) shows the H-Net architecture. The convolution layers of VGG16 [26] are used as the feature extractor, which is followed by three parallel branches of the IRC module and line pooling layers. We employ the line pooling layers to perform the pooling in (1) for lines $i$ and $j$ , respectively. We use two types of regression layers: one for yielding the IRC score of the two lines (Reg1), and the other for computing unary reliability of each line (Reg2). Finally, we compute the harmony score $h_{ij}$ by multiplying the IRC score with the average of the unary reliability levels. + +We configure the training data for H-Net as follows. It is assumed that every pair of ground-truth semantic lines in an image harmonize with each other. Thus, we declare such pairs as positive, while the others as negative. In other words, a line pair $(i,j)$ is positive only if both lines $i$ and $j$ are semantic. Then, the harmony score $\bar{h}_{ij}$ is annotated as 1 or 0 depending on whether the pair $(i,j)$ is positive or not. However, this strict definition of a positive pair causes a class imbalance: there are too few positive pairs. Thus, we disturb the line locations of each positive pair and annotate the corresponding harmony score $\bar{h}_{ij}$ to be proportional to $e^{-(d_i^2 +d_j^2)}$ , where $d_{i}$ and $d_{j}$ denote the disturbances of lines $i$ and $j$ . Also, the loss function for training H-Net is defined as $\ell_{\mathrm{H}} = (h_{ij} - \bar{h}_{ij})^2$ , where $\bar{h}_{ij}$ is the ground-truth harmony score and $h_{ij}$ is its estimate. The supplemental document describes the training process and architecture of H-Net in more detail. + +# 3.4. Graph optimization: finding harmonious lines + +Graph construction: We construct a complete graph $G = (\mathcal{V}, \mathcal{E})$ , in which the node set $\mathcal{V} = \{v_1, v_2, \ldots, v_K\}$ represents the $K$ lines selected using S-Net in Section 3.2. Every pair of lines are connected by an edge in the edge set $\mathcal{E} = \{(v_i, v_j) : i \neq j\}$ . Each edge is assigned a weight $w(v_i, v_j) = h_{ij}$ by H-Net in Section 3.3. Figure 5(f) visualizes a complete weighted graph. + +MWCS: As mentioned earlier, a set of semantic lines is optimal, if any two lines in the set are harmonious with each other. Thus, finding such an optimal set is equivalent to finding a clique of nodes [8], which are mutually connected and have a maximal sum of weights (i.e. harmony scores). + +Let $\theta$ denote a clique, represented by the index set of member nodes. Then, we define the harmonization energy $E_{\mathrm{harmony}}(\theta)$ of clique $\theta$ as + +$$ +E _ {\text {h a r m o n y}} (\theta) = \sum_ {i \in \theta} \sum_ {j \in \theta , j > i} w \left(v _ {i}, v _ {j}\right) \tag {6} +$$ + +which is the sum of all edge weights in $\theta$ . Finding the clique that maximizes this energy is NP-hard [6]. However, in this + +![](images/8fdc69278d052775a3635822ead37aa6fdbefbe9ac1b252971b096abd6db1a9a.jpg) +(a) + +![](images/b996d3488c86f154680a0699a2631de9badcd9b108117dc0f4d8c984cd33dd49.jpg) +(b) + +![](images/cf3b3713d6a03e5b928897bcacbf49d95ed3fde1d0eb96b03ce08c25d518f8dd.jpg) +(c) +Figure 5: Illustration of the proposed algorithm: (a) input image, (b) selected lines through the selection-and-removal process, (c) semantic lines, (d) probabilities of line candidates in the Hough space, (e) node set corresponding to the selected lines, (f) complete graph, (g) maximal clique. In (f), an edge is depicted in green or red depending on whether its weight is above the threshold $\kappa$ in (8) or not. As the weight approaches zero, the transparency increases. + +![](images/8e42c74821d4c73c7c8ccfd3f6af22c0c2d489eecd0114db56235d84d293d7e7.jpg) +(d) + +![](images/f77ac8b6abac19bb4da1a2590db5632e0e5f13aeb3e82a6b1fcbda7f83cf9f9e.jpg) +(e) + +![](images/b1766c953cacac580cb6ae370f2155db6d06b03ff9df7ced9b3ba679633402bf.jpg) +(f) + +![](images/4cb0ca551847ad925ae3a3d02b640bf808cde7f95dfb9b72627bf94ced56a31b.jpg) +(g) + +work, $K$ is set to be a small number. The default $K$ is 8. There are about $2^{K}$ possible cliques, which are also manageable. Thus, exhaustive search is adopted to find a maximal weight clique. First, we generate the set of possible cliques $\Theta = \{\theta_t\}$ in the graph $G$ , where each clique $\theta_t$ consists of more than two nodes. Then, we select the maximal weight clique $\theta^{\star}$ that maximizes the harmonization energy: + +$$ +\theta^ {*} = \arg \max _ {\theta_ {t} \in \Theta} E _ {\text {h a r m o n y}} (\theta_ {t}) \tag {7} +$$ + +subject to a constraint + +$$ +\min _ {i, j \in \theta} w \left(v _ {i}, v _ {j}\right) > \kappa \tag {8} +$$ + +where $\kappa$ is a threshold. If there is no clique satisfying the constraint, we select the maximal single-node clique $\theta^{\star} = \{i^{\star}\}$ by + +$$ +i ^ {\star} = \arg \max _ {i} h _ {i i}. \tag {9} +$$ + +The self-harmony score $h_{ii}$ is obtained by applying the same line as duplicated input to H-Net. + +After obtaining the set of harmonious semantic lines, we refine each line by + +$$ +\mathbf {l} _ {v _ {i}} + \Delta \mathbf {l} _ {v _ {i}} \tag {10} +$$ + +where $\Delta \mathbf{l}_{v_i}$ denotes the offset vector, generated by the regression layer of S-Net. Figure 5(c) and (g) show the set of harmonious semantic lines on the image and Hough spaces. + +# 4. Experimental Results + +# 4.1. Datasets + +SEL [19]: It is the first semantic line dataset, containing 1,750 outdoor images, which are split into 1,575 training and 175 testing images. Each semantic line is annotated by the coordinates of two end points on an image boundary. + +SEL Hard [16]: It is a more challenging dataset for testing semantic line detectors. It contains 300 test images, selected from the ADE20K segmentation dataset [34]. Its semantic lines are less obvious and more severely occluded in more cluttered scenes. + +SL5K [33]: It is a rich and diverse dataset in terms of the number of lines and scene categories. It is composed of 4,000 training and 1,000 testing images. + +CULane [24]: It is a dataset for road lane detection, containing 88,000 training images. Its 34,680 test images are classified into 9 categories. For each image, the pixel-wise mask for up to 4 road lanes is provided. The proposed algorithm is tested on 3,911 test images in the 'no lane' category, in which each lane is highly implied or even invisible. + +# 4.2. Metrics + +Conventional metrics: There are two existing metrics to assess semantic line detection results: mIoU [19] and EA-score [10]. In the mIoU metric, a detected line is regarded as correct if its mIoU score with the ground-truth semantic line is greater than a threshold $\tau$ as illustrated in Figure 6(a). In the EA-score, a detected line is regarded as correct if its similarity with the ground-truth is greater than the threshold as shown in Figure 6(b). The similarity is composed of two factors $S_{d}$ and $S_{\theta}$ , which are based on the Euclidean distance between the midpoints of the lines and the angular distance of the lines, respectively. In both metrics, the precision and the recall are computed by + +$$ +\text {P r e c i s i o n} = \frac {N _ {l}}{N _ {l} + N _ {e}}, \quad \text {R e c a l l} = \frac {N _ {l}}{N _ {l} + N _ {m}} \tag {11} +$$ + +where $N_{l}$ is the number of correctly detected semantic lines, $N_{e}$ is the number of false positives, and $N_{m}$ is the number of false negatives. Then, the F-measure is computed by + +$$ +F - m e a s u r e = \frac {2 \times \text {P r e c i s i o n} \times \text {R e c a l l}}{\text {P r e c i s i o n} + \text {R e c a l l}}. \tag {12} +$$ + +The area under curve (AUC) performances of the precision, recall, F-measure curves are measured in the entire range of the threshold $\tau$ , which are denoted by AUC_P, AUC_R, and AUC_F, respectively [19]. + +However, these metrics measure only the positional accuracy of each detected line. They do not consider how harmonious multiple detected lines are with one another in a scene. Hence, they may yield misleading scores, as exemplified in Figure 7. + +HIoU metric: We propose the harmony-based intersection-over-union (HIoU) metric to assess the overall harmony of detected lines. Detected lines tend to convey harmonious impression about the composition of an image, when their + +![](images/2c84c52c8dbe2ef0f7bb4abe04877600a4d3c2808490fca619cd49b1637dbdd6.jpg) +Detection result + +![](images/f18f7434606d08fe1e5f0a2243039d232e1f03d2114c162a3a5b813393003a78.jpg) +Ground-truth + +![](images/53a0ef78675fbe9ea3a5c39b0c573d8e194524860652a74838ce3a73f161c24e.jpg) +$\mathrm{mIoU} = \frac{\mathrm{IoU}(R,R^{\prime}) + \mathrm{IoU}(Q,Q^{\prime})}{2}$ +(a) mIoU metric +Figure 6: Illustration of two existing metrics of mIoU [19] and EA-score [10] and the proposed HIoU metric. + +![](images/91f1bc34b861eb94bcc101aa3c4107e58f277ebbd5004a1cb80800f6fdde7a83.jpg) + +$\mathcal{R}^{\prime}) + \mathrm{IoU}(Q,Q^{\prime})$ 2 + +![](images/2511781119e40963348dec0b49534965be98eccce9b766ead0ebf78483a1d750.jpg) +$\mathrm{EA} = (S_{\theta}(l_1,l_2)\cdot S_d(l_1,l_2))^2$ +(b) EA-score + +![](images/09b13ccfe13f6c8b4fc596b3a7a27a07035299e31209bcdc3d84f624366cfa88.jpg) +$\mathrm{HIOu} = \frac{\mathrm{IoU}(s_4,t_1) + \mathrm{IoU}(s_2,t_1) + \cdots + \mathrm{IoU}(t_3,s_5)}{9}$ +(c) HIoU metric + +Table 1: Comparison of the AUC and HIoU scores (\%) on the SEL and SEL_Hard datasets. The processing speeds in frames per second (fps) are also compared. For the AUC scores, the mIoU metric is used. + +
SELSEL_Hardfps
AUC_PAUC_RAUC_FH IoUAUC_PAUC_RAUC_FH IoU
SLNet [19]80.7284.5082.5777.8774.2270.6872.4159.717.35
DHT [10]89.2778.5383.5679.6283.5567.9875.0963.3930.30
DRM [16]85.4487.1686.2980.2387.1977.6982.1768.831.05
Proposed89.6184.2186.8381.0387.6072.5679.3865.9921.74
+ +![](images/b3d8d46e40836d9a4f6e527fc799cc13c72a8ca330846be1d6b8a9b9c483d055.jpg) + +EA-score +HIoU + +![](images/8cf0eccf1a3c01a7a1f77b648189778049572569c52f56526036dd264b607cef.jpg) +0.90 +0.90 +0.79 + + +# +$\approx$ +0.68 + +> + +![](images/c63566eac7767cb3c8e726d35f0dd1653f7f78e9b0a9af7b8859bb2eb817f9f4.jpg) +Detection result II +0.88 +0.81 +0.59 + +division of the image is consistent with the division by the ground-truth. Suppose that the set of detected lines and the set of ground-truth lines divide the image into regions $S = \{s_1, s_2, \ldots, s_N\}$ and $T = \{t_1, t_2, \ldots, t_M\}$ , respectively. Then, we define HIoU as + +$$ +\mathrm {H I o U} = \frac {\sum_ {i = 1} ^ {N} \max _ {k} \operatorname {I o U} \left(s _ {i} , t _ {k}\right) + \sum_ {j = 1} ^ {M} \max _ {k} \operatorname {I o U} \left(t _ {j} , s _ {k}\right)}{N + M}. \tag {13} +$$ + +In other words, for each $s_i$ , we find the matching $t_k$ and measure their IoU. Similarly, for each $t_j$ , we find its IoU with the matching $s_k$ . Then, the average of these bidirectional matching IoU's becomes the HIoU score. Figure 6(c) illustrates how to compute an HIoU score. Figure 7 shows that HIoU assesses detected lines more reasonably + +![](images/6b0051c55cd399171e85bbb12d20d3d482a5d631248956185139a6e0d6cb0f81.jpg) +Figure 7: Comparison of mIoU [19], EA-score [10], and the proposed HIoU metric: There are two detection results for the same ground-truth. In result I, the position of each detected line is different from the ground-truth, but the detected lines convey the composition of the image relatively well. In result II, two detected lines match the ground-truth exactly, but they are not harmonious with the remaining one. As a group, they are inferior to result I. Since mIoU and EA-score consider only the accuracy of each individual line, they do not tell the difference between these two results and provide only marginally different scores. In contrast, HIoU quantifies the superiority of result I correctly. +Figure 8: Comparison of the precision, recall, and F-measure curves in terms of the threshold $\tau$ on the SEL dataset. The mIoU metric is used. + +![](images/9e95764815f17c71b58f790f3767438bfed203a65b1c84b744dfcda29d9adad5.jpg) + +![](images/4fe1651547ad16f5b8f336f411014a32410f09c0bca5852bb3f0c2e8471fb9e2.jpg) + +than the existing metrics do, by considering the harmony among the detected lines. + +# 4.3. Comparative assessment + +We compare semantic line detection results of the proposed algorithm with those of the conventional SLNet [19], DHT [10], and DRM [16]. + +Comparison on SEL: Figure 8 compares the precision, recall, and F-measure curves of the proposed algorithm and the conventional algorithms on the SEL dataset. Table 1 reports the AUC performances of these curves. The proposed algorithm provides a poorer recall but a better precision than the conventional algorithms. F-measure is the harmonic mean of recall and precision. Note that the proposed algorithm outperforms all conventional algorithms in terms of F-measure and HIoU. + +Comparison on SEL_Hard: Table 1 also compares the results on SEL_Hard. For this comparison as well, we use the same algorithms that are trained using the training images in the SEL dataset. As mentioned previously, SEL_Hard images are much more complicated than SEL images. Also, many of SEL images contain only one semantic line. Thus, + +![](images/abf3a47a373e4c81a8c1926595603856d31810aa9a23cdcdf6f8ec0f77eda954.jpg) +Figure 9: Comparison of semantic line detection results. The left three images are from SEL, and the others from SEL_Hard. + +Table 2: Comparison of the EA-scores (Precision, Recall, F-measure) on the SL5K dataset. + +
PrecisionRecallF-measureHIoU
Zhao et al. [33]70.374.572.3-
Proposed79.481.480.374.1
+ +it is challenging to use only SEL images to learn the harmony between lines in more complicated SEL_Hard images. Nevertheless, the proposed algorithm yields competitive results to DRM, which performs the best but demands a too high computational cost. Note that the proposed algorithm is about 20 times faster than DRM. Moreover, the proposed algorithm outperforms DRM in terms of AUC_P. + +Figure 9 compares detection results on the SEL and SEL_Hard datasets. The conventional algorithms detect redundant lines near object boundaries or fail to detect implied semantic lines. In contrast, the proposed algorithm detects as well as obvious semantic lines more reliably, while ensuring the harmony between detected lines. + +Comparison on SL5K: Table 2 compares the performances on the SL5K dataset. Zhao et al. [33] report the performances of their algorithm in the EA-score metric only, and their training codes or model parameters are not available. Thus, we compare the results in the EA-score metric only, as done in [33]. We see that the proposed algorithm outperforms Zhao et al. by significant margins 9.1, 6.9, and 8.0 in terms of precision, recall, and F-measure, respectively. Also, the proposed algorithm yields the HIoU score of 74.1. Figure 10 shows some detection results. + +![](images/85652ca4de8d87ec6b59d7f61157e14b486675d72992630d5379b378e3241e93.jpg) +Figure 10: Detection results of the proposed algorithm on the SL5K dataset. + +Comparison on CULane: We compare the proposed algorithm with the conventional road lane detectors [14, 25] on the 'no lane' category in CULane, in which lanes are implicit or invisible. Conventional techniques are based on the segmentation framework and the ground-truth is also given as a binary mask for each lane. Thus, for comparison, we declare the most overlapping line with the segmentation mask of each lane as a semantic line. The experimental settings are described in detail in the supplemental document. Figure 11 shows some ground-truth semantic lines and compares their detection results. Although the lines are extremely unobvious, the proposed algorithm detects them more reliably than the conventional detectors. Table 3 compares the AUC and HIoU scores. Note that, unlike the conventional detectors, the proposed algorithm does not use the information of the maximum number of lanes in a scene. The conventional algorithms poorly recall implied or invisible lanes. The proposed algorithm is slightly less pre + +![](images/596d2cfaaab80afa0645593744c6bcd5d0cfa19b0ee18fc0282839bceb5e28d7.jpg) +Figure 11: Comparison of semantic line detection results on the CULane dataset ('no lane' category). + +Table 3: Comparison of the AUC and HIoU scores $(\%)$ on the 'no lane' category in the CULane dataset. + +
AUC_PAUC_RAUC_FHIoU
UFS [25]93.0083.4787.9872.68
SAD [14]93.6484.2088.6774.77
Proposed92.4391.6692.0476.46
+ +Table 4: Ablation studies for the S-Net, H-Net, and MWCS process on the SEL dataset. + +
AUC_FH IoU
I.S-Net77.7569.03
II.S-Net+H-Net+MWCS(w/o IRC)84.6679.14
III.S-Net+H-Net+MWCS(w/o offset)86.6080.33
IV.S-Net+H-Net+MWCS86.8381.03
+ +cise, but provides significantly higher recall and F-measure scores than the conventional detectors. Also, the proposed algorithm yields a better HIoU score than the conventional detectors, by exploiting the harmonious property of road lanes, such as parallelness and equal width between adjacent lanes. + +Running time analysis: Table 1 also compares the running times. We use a PC with Intel Core i5-8500 CPU and NVIDIA RTX 2080 ti GPU. Note that SLNet and DRM require a lot of time to extract discriminative line features. Especially, DRM is the slowest method at 1.05 fps, because its mirror attention module and iterative ranking-and-matching process are too demanding. The proposed algorithm and DHT are much faster. Although DHT is the fastest, its recall performance is not competitive. + +# 4.4. Ablation studies + +We conduct ablation studies to analyze the efficacy of the proposed S-Net, H-Net, and MWCS process on the SEL + +dataset. Table 4 compares several ablated methods. Method I uses S-Net only to detect semantic lines, in which the selection-and-removal process is performed iteratively until the maximum probability becomes lower than 0.5. Method II uses H-Net and the MWCS process as well, but H-Net is trained without employing the IRC module. In Method III, line offsets are not used to refine detection results. Method I is significantly inferior to the other methods, indicating that both H-Net and MWCS are essential for detecting harmonious semantic lines. Also, by comparing II with IV, we see that the inter-region correlation feature is effective for estimating the harmony between two lines. Also, from III with IV, note that the performance is improved by refining detected lines using regression offsets. + +# 5. Conclusions + +We proposed a novel semantic line detector. First, we developed S-Net to compute the line probabilities and offsets of line candidates. Second, we filtered out irrelevant lines through a selection-and-removal process. Third, we constructed a complete graph, whose edge weights were computed by H-Net. Finally, we determined a maximal weight clique representing a group of harmonious semantic lines. Also, to assess the overall harmony of detected lines, we proposed a novel metric called HIoU. It was experimentally demonstrated that the proposed algorithm can detect harmonious semantic lines effectively and efficiently. + +# Acknowledgements + +This work was supported in part by the National Research Foundation of Korea (NRF) through the Korea Government (MSIT) under grant NRF-2018R1A2B3003896 and in part by the 42dot Inc. + +# References + +[1] Cuneyt Akinlar and Cihan Topal. EDLines: A real-time line segment detector with a false detection control. Pattern Recog. Lett., 32(13):1633-1642, 2011. +[2] Mohamed Aly. Real time detection of lane markers in urban streets. In IEEE Intelligent Vehicles Symposium, pages 7-12. IEEE, 2008. +[3] Gary Chartrand and Ping Zhang. Chromatic Graph Theory. CRC press, 2019. +[4] Agnès Desolneux, Lionel Moisan, and Jean-Michel Morel. Meaningful alignments. Int. J. Comput. Vis., 40(1):7-23, 2000. +[5] Raul Diaz and Amit Marathe. Soft labels for ordinal regression. In Proc. IEEE CVPR, 2019. +[6] Corinne Feremans, Martine Labbe, and Gilbert Laporte. Generalized network design problems. European Journal of Operational Research, 148(1):1-13, 2003. +[7] Michael Freeman. The Photographer's Eye: Composition and Design for Better Digital Photos. Focal Press, 2007. +[8] Jonathan Gross and Jay Yellen. Graph Theory and Its Applications. CRC Press, 2007. +[9] Chunzhao Guo, Takayuki Yamabe, and Seiichi Mita. Robust road boundary estimation for intelligent vehicles in challenging scenarios based on a semantic graph. In Intelligent Vehicles Symposium. IEEE, 2012. +[10] Qi Han, Kai Zhao, Jun Xu, and Ming-Ming Cheng. Deep Hough transform for semantic line detection. In Proc. ECCV, 2020. +[11] Yinghua He, Hong Wang, and Bo Zhang. Color-based road detection in urban traffic scenes. IEEE Transactions on Intelligent Transportation Systems, 5(4):309-318, 2004. +[12] Aharon Bar Hillel, Ronen Lerner, Dan Levi, and Guy Raz. Recent progress in road and lane detection: A survey. Mach. Vis. Appl., 25(3):727-745, 2014. +[13] Yuenan Hou, Zheng Ma, Chunxiao Liu, Tak-Wai Hui, and Chen Change Loy. Inter-region affinity distillation for road marking segmentation. In Proc. IEEE CVPR, 2020. +[14] Yuenan Hou, Zheng Ma, Chunxiao Liu, and Chen Change Loy. Learning lightweight lane detection CNNs by self attention distillation. In Proc. IEEE ICCV, 2019. +[15] Kun Huang, Yifan Wang, Zihan Zhou, Tianjiao Ding, Shenghua Gao, and Yi Ma. Learning to parse wireframes in images of man-made environments. In Proc. IEEE CVPR, 2018. +[16] Dongkwon Jin, Jun-Tae Lee, and Chang-Su Kim. Semantic line detection using mirror attention and comparative ranking and matching. In Proc. ECCV, 2020. +[17] Nahum Kiryati, Yuval Eldar, and Alfred M Bruckstein. A probabilistic Hough transform. Pattern Recog., 24(4):303-316, 1991. +[18] Bert Krages. Photography: The Art of Composition. Simon and Schuster, 2012. +[19] Jun-Tae Lee, Han-Ul Kim, Chul Lee, and Chang-Su Kim. Semantic line detection and its applications. In Proc. IEEE ICCV, 2017. + +[20] Jun-Tae Lee, Han-Ul Kim, Chul Lee, and Chang-Su Kim. Photographic composition classification and dominant geometric element detection for outdoor scenes. J. Vis. Commun. Image Represent., 55:91-105, 2018. +[21] Seokju Lee, Junsik Kim, Jae Shin Yoon, Seunghak Shin, Oleksandr Bailo, Namil Kim, Tae-Hee Lee, Hyun Seok Hong, Seung-Hoon Han, and In So Kweon. VPGNet: Vanishing point guided network for lane and road marking detection and recognition. In Proc. IEEE ICCV, 2017. +[22] Yancong Lin, Silvia L Pintea, and Jan C van Gemert. Deep Hough-transform line priors. In Proc. ECCV, 2020. +[23] Jiri Matas, Charles Galambos, and Josef Kittler. Robust detection of lines using the progressive probabilistic Hough transform. Comput. Vis. Image Understand., 78(1):119-137, 2000. +[24] Xingang Pan, Jianping Shi, Ping Luo, Xiaogang Wang, and Xiaou Tang. Spatial As Deep: Spatial CNN for traffic scene understanding. In Proc. AAAI, 2018. +[25] Zequn Qin, Huanyu Wang, and Xi Li. Ultra fast structure-aware deep lane detection. In Proc. ECCV, 2020. +[26] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Proc. ICLR, 2015. +[27] Yi Sun, Xushen Han, and Kai Sun. Sem-LSD: A learning-based semantic line segment detector. arXiv preprint arXiv:1909.06591, 2019. +[28] Rafael Grompone Von Gioi, Jeremie Jakubowicz, Jean-Michel Morel, and Gregory Randall. LSD: A fast line segment detector with a false detection control. IEEE Trans. Pattern Anal. Mach. Intell., 32(4):722-732, 2008. +[29] Scott Workman, Menghua Zhai, and Nathan Jacobs. Horizon lines in the wild. In Proc. BMVC, 2016. +[30] Saining Xie and Zhuowen Tu. Holistically-nested edge detection. In Proc. IEEE ICCV, 2015. +[31] Nan Xue, Song Bai, Fudong Wang, Gui-Song Xia, Tianfu Wu, and Liangpei Zhang. Learning attraction field representation for robust line segment detection. In Proc. IEEE CVPR, 2019. +[32] Menghua Zhai, Scott Workman, and Nathan Jacobs. Detecting vanishing points using global image context in a non-manhattan world. In Proc. IEEE CVPR, 2016. +[33] Kai Zhao, Qi Han, Chang-Bin Zhao Zhang, Jun Xu, and Ming-Ming Cheng. Deep Hough transform for semantic line detection. arXiv preprint arXiv:2003.04676, 2020. +[34] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ADE2020K dataset. In Proc. IEEE CVPR, 2017. +[35] Shengyan Zhou, Yanhua Jiang, Junqiang Xi, Jianwei Gong, Guangming Xiong, and Huiyan Chen. A novel lane detection based on geometrical model and gabor filter. In IEEE Intelligent Vehicles Symposium, pages 59-64. IEEE, 2010. +[36] Yichao Zhou, Haozhi Qi, Jingwei Huang, and Yi Ma. NeurVPS: Neural vanishing point scanning via conic convolution. In Proc. NIPS, 2019. +[37] Yichao Zhou, Haozhi Qi, and Yi Ma. End-to-end wireframe parsing. In Proc. IEEE ICCV, 2019. \ No newline at end of file diff --git a/harmonioussemanticlinedetectionviamaximalweightcliqueselection/images.zip b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5efdf2f38118c8869a664fdab6dcc9d1a0e48816 --- /dev/null +++ b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4cd09c70f1b6137fbf72b45ba0142c4d29f0e4ef85d9690d1c27d344d8635e5 +size 810581 diff --git a/harmonioussemanticlinedetectionviamaximalweightcliqueselection/layout.json b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9c48554fdcf57354f691e87a9981ff4b86ff641f --- /dev/null +++ b/harmonioussemanticlinedetectionviamaximalweightcliqueselection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3796ec509754966819cb538ff5538328a25aa5049847c3379711b594ab71f7e6 +size 480618 diff --git a/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_content_list.json b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a76ba1e9ce6fb510917840d3edc6bcca1b959ad8 --- /dev/null +++ b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cacd5b833cf2b3a40224a1bf2eda6431b19dc3a1c93840c0c552aadac862fbd +size 88588 diff --git a/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_model.json b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_model.json new file mode 100644 index 0000000000000000000000000000000000000000..db431746ddf1d46bcb255ce5270559e882604c3b --- /dev/null +++ b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3633c01c35beddc6153c41d41f14eb34539fe95db9d9eee8ae96423d2c673b11 +size 111011 diff --git a/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_origin.pdf b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d216cf39a956e563a66ef716f6fc9d4236451345 --- /dev/null +++ b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/6c304096-ab45-472c-a463-cd7b090a1547_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9356f8a3194441dd3c9b38d78632d814e579a848bbe43f0ceb5ae6dde1cfdd3 +size 3204540 diff --git a/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/full.md b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ed4f1e8655e00e0c04113e919b64567f5fdca814 --- /dev/null +++ b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/full.md @@ -0,0 +1,403 @@ +# HCRF-Flow: Scene Flow from Point Clouds with Continuous High-order CRFs and Position-aware Flow Embedding + +Ruibo Li $^{1,2}$ , Guosheng Lin $^{1,2*}$ , Tong He $^{3}$ , Fayao Liu $^{4}$ , Chunhua Shen $^{3}$ $^{1}$ S-Lab, Nanyang Technological University, Singapore + +$^{2}$ School of Computer Science and Engineering, Nanyang Technological University, Singapore + $^{3}$ University of Adelaide, Australia $^{4}$ Institute for Infocomm Research, A*STAR, Singapore +E-mail: ruibo001@e.ntu.edu.sg, gslin@ntu.edu.sg + +# Abstract + +Scene flow in 3D point clouds plays an important role in understanding dynamic environments. Although significant advances have been made by deep neural networks, the performance is far from satisfactory as only per-point translational motion is considered, neglecting the constraints of the rigid motion in local regions. To address the issue, we propose to introduce the motion consistency to force the smoothness among neighboring points. In addition, constraints on the rigidity of the local transformation are also added by sharing unique rigid motion parameters for all points within each local region. To this end, a high-order CRFs based relation module (Con-HCRFs) is deployed to explore both point-wise smoothness and region-wise rigidity. To empower the CRFs to have a discriminative unary term, we also introduce a position-aware flow estimation module to be incorporated into the Con-HCRFs. Comprehensive experiments on FlyingThings3D and KITTI show that our proposed framework (HCRF-Flow) achieves state-of-the-art performance and significantly outperforms previous approaches substantially. + +# 1. Introduction + +Scene flow estimation [37] aims to provide dense or semi-dense 3D vectors, representing the per-point 3D motion in two consecutive frames. The information provided has proven invaluable in analyzing dynamic scenes. Although significant advances have been made in the 2D optical flow, the counterpart in 3D point cloud is far more challenging. This is partly due to the irregularity and sparsity of the data, but also due to the diversity of the scene. + +As pointed out in [17], most of the structures in the visual world are rigid or at least nearly so. Many previous top-performing approaches [13, 5, 45, 26] simplify this task as a + +![](images/2c2a4d2172b67df7a1f3ed733b48c34a05b4a9e8fda4f32efe5396d424b3a600.jpg) +(a) + +![](images/cf11d628e0798be10504607f2bd9c59e8d09a4e0987e0a887c24ce1346d77df6.jpg) +(b) + +![](images/25439a31fcbac928f0c2c547f1bcae5d32479b0dd4709b3f6d1b275a1cdf55f1.jpg) +(c) +Figure 1. The warped point cloud at the next frame based on different scene flow. Green points represent the point cloud at frame $t$ . Red points are the warped results at frame $t + 1$ by adding scene flow back to corresponding green points. (a) scene flow produced by FlowNet3D [13]; (b) scene flow produced by FlowNet3D and refined by a conventional CRF; (c) scene flow produced by FlowNet3D and refined by our continuous high order CRFs; (d) ground truth scene flow. The local structure of the warped point cloud is distorted in Flownet3d and the conventional CRF but preserved in our method. + +![](images/ddab29329d29c096d8eda38995ce326375a233f991bad6d81adb35ceed5f2f52.jpg) +(d) + +regression problem by estimating a point-wise translational motion. Although promising results have been achieved, the performance is far from satisfactory as the potential rigid motion constraints existing in the local region are ignored. As shown in Fig. 1(a), the results generated by the FlowNet3D [13] are deformed and fail to maintain the local geometric smoothness. A straightforward remedy is to utilize pair-wise regularization to smooth the flow prediction. However, ignoring the potential rigid transformations + +makes it hard to maintain the underlying spatial structure, as presented in Fig. 1(b). + +To address this issue, we propose a novel framework termed HCRF-Flow, which consists of two components: a position-aware flow estimation module (PAFE) for perpoint translational motion regression and a continuous high-order CRFs module (Con-HCRFs) for the refinement of the per-point predictions by considering both spatial smoothness and rigid transformation constraints. Specifically, in Con-HCRFs, a pairwise term is designed to encourage neighboring points with similar local structure to have similar motions. In addition, a novel high order term is designed to encourage each point in a local region to take a motion obeying the shared rigid motion parameters, i.e., translation and rotation parameters, in this region. + +In point cloud scene flow estimation, it is challenging to aggregate the matching costs, which are calculated by comparing one point with its softly corresponding points. To encode this knowledge into the embedding features, we propose a position-aware flow embedding layer in the PAFE module. In the aggregation step, we introduce a pseudo matching pair that is applied to calculate the difference of the matching cost. For each softly corresponding pair, both its position information and the matching cost difference will be considered to output weights for aggregation. + +Our main contributions can be summarized as follows: + +- We propose a novel scene flow estimation framework HCRF-Flow by combining the strengths of DNNs and CRFs to perform a per-point translational motion regression and a refinement with both pairwise and region-level regularization; +- Formulating the rigid motion constraints as a high order term, we propose continuous high-order CRFs (Con-HCRFs) to model the interaction of points by imposing point-level and region-level consistency constraints. +- We present a novel position-aware flow estimation layer to build reliable matching costs and aggregate them based on both position information and matching cost differences. +- Our proposed HCRF-Flow significantly outperforms the state-of-the-art on both FlyingThing3D and KITTI Scene Flow 2015 datasets. In particular, we achieve Acc3DR scores of $95.07\%$ and $94.44\%$ on FlyingThing3D and KITTI, respectively. + +# 1.1. Related work + +Scene flow from RGB or RGB-D images Scene flow is first proposed in [37] to represent the three-dimensional motion field of points in a scene. Many works [8, 25, 32, 36, 38, 39, 40, 20, 16, 29, 6] try to recover scene flow from stereo + +RGB images or monocular RGB-D images. The local rigidity assumption has been applied in scene flow estimation from images. [39, 40, 20, 16] directly predict the rigidity parameter of each local region to produce scene flow estimates. [38, 29, 6] add a rigidity term into the energy function to constrain the scene flow estimation. Compared with them, our method is different in the following aspects: 1) our method formulates the rigidity constraint as a high order term in Con-HCRFs. It encourages the region-level rigidity of point-wise scene flow rather than directly computing rigidity parameters. Thus, our Con-HCRFs can be easily added to other point cloud scene flow estimation methods as a plug-in module to improve the rigidity of their predictions; 2) our method targets irregular and unordered point cloud data instead of well organized 2D images. + +Deep scene flow from point clouds Some approaches [4, 35] estimate scene from point cloud via traditional techniques. Recently, inspired by the success of deep learning for point clouds, more works [5, 1, 13, 45, 26, 23, 14, 42] have employed DNNs in this field. [13] estimates scene flow based on PointNet++ [28]. [5] proposes a sparse convolution architecture for scene flow learning, [45] designs a coarse-to-fine scene flow estimation framework, and [26] estimates the point translation by point matching. Despite achieving impressive performance, these methods neglect the rigidity constraints and estimate each point's motion independently. Although the rigid motion for each point is computed in [1], the per-point rigid parameter is independently regressed by a DNN without fully considering its geometry constraints. Unlike previous methods, we design a novel Con-HCRFs to explicitly model both spatial smoothness and rigid motion constraints. + +Deep learning on 3D point clouds Many works [27, 28, 34, 18, 44, 15, 41, 7] focus on learning directly on raw point clouds. PointNet [27] and PointNet++ [28] are the pioneering works which use shared Multi-Layer-Perception (MLP) to extract features and a max pooling to aggregate them. [7, 41] use the attention mechanism to produce aggregation weights. [7, 15] encode shape features from local geometry clues to improve the feature extraction. Inspired by these works, we propose a position-aware flow embedding layer to dynamically aggregate matching costs based on both position representations and matching cost differences for better matching cost aggregation. + +Conditional random fields (CRFs) CRFs are a type of probabilistic graphical models, which are widely used to model the effects of interactions among examples in numerous vision tasks [10, 12, 2, 48, 46]. In point cloud processing, previous works [47, 33, 3] apply CRFs to discrete labeling tasks for spatial smoothness. In contrast to the CRFs in these works, the variables of Con-HCRFs are defined in a continuous domain, and two different relations are modeled by Con-HCRFs at the point level and the region level. + +![](images/ae96ada7569d3837586c4bc0e4bc8a4264c288e5e9b1eff52e3e34413f0df552.jpg) +Figure 2. HCRF-Flow architecture. Our HCRF-Flow consists of two components: a PAFE module to produce per-point initial scene flow and a Con-HCRFs module to refine the initial scene flow. Our proposed position-aware flow embedding layer is employed in the PAEF module to encode motion information. We build two different architectures of the PAFE module: one is designed by considering only single-scale feature (similar to FlowNet3D [27]). The other one introduces a pyramid architecture (similar to PointPWC-Net [45]). + +![](images/1bc89df22c9d06466ad2178d4c2d9dbe84800ec939190d55b6e2ee38465aa7bf.jpg) +Figure 3. The details of the position-aware flow embedding layer. + +# 2. HCRF-Flow + +# 2.1. Overview + +In the task of point cloud scene flow estimation, the inputs are two point clouds at two consecutive frames: $\pmb{P}^t = \{\pmb{p}_i^t | i = 1, \dots, n_t\}$ at frame $t$ and $\pmb{P}^{t+1} = \{\pmb{p}_j^{t+1} | j = 1, \dots, n_{t+1}\}$ at frame $t+1$ , where $\pmb{p}_i^t, \pmb{p}_j^{t+1} \in \mathbb{R}^3$ are 3D coordinates of individual points. Our goal is to predict the 3D displacement for each point $i$ in $\pmb{P}^t$ , which describes the motion of each point $i$ from frame $t$ to frame $t+1$ . Unless otherwise stated, we use boldfaced uppercase and lowercase letters to denote matrices and column vectors, respectively. + +As shown in Fig. 2, the HCRF-Flow consists of two components: a PAFE module for per-point flow estimation and a Con-HCRFs module for refinement. For the PAFE module, we try two different architectures, a single-scale architecture referring to FlowNet3D [27] and a pyramid architecture referring to PointPWC-Net [45]. To mix the two point clouds, in the PAFE module, we propose a novel position-aware flow embedding layer to build reliable matching costs and aggregate them to produce flow embeddings that encode the motion information. For better aggregation, we use the position information and the matching cost difference as clues to generate aggregation weights. Sec. 2.2 introduces the details about this layer. In the Con-HCRFs module, we propose novel continuous high order CRFs to refine the coarse scene flow by encouraging both point-level and region-level consistency. More details are given in Sec. 3. + +# 2.2. Position-aware flow embedding layer + +As shown in Fig. 3, the position-aware flow embedding layer aims to produce flow embedding $\pmb{e}_i$ for each point $\pmb{p}_i$ in $P^t$ . For each point $\pmb{p}_i$ , we first find neighbouring points $\mathcal{N}_e(i)$ around $\pmb{p}_i^t$ in $t + 1$ frame $P^{t + 1}$ . Then, following [13], the matching cost between point $\pmb{p}_i^t$ and a softly corresponding point $\pmb{p}_j^{t + 1}$ in $\mathcal{N}_e(i)$ are addressed as: + +$$ +\boldsymbol {h} _ {i j} = h \left(\boldsymbol {f} _ {i} ^ {t}, \boldsymbol {f} _ {j} ^ {t + 1}, \boldsymbol {p} _ {j} ^ {t + 1} - \boldsymbol {p} _ {i} ^ {t}\right), \tag {1} +$$ + +where $\pmb{f}_i^t$ and $\pmb{f}_j^{t + 1}$ are the features for $\pmb{p}_i^t$ and $\pmb{p}_j^{t + 1}$ , respectively. $h$ is a concatenation of its inputs followed by a MLP. After obtaining the matching costs for point $\pmb{p}_i^t$ , two subbranches are followed: position encoding unit and pseudopairing unit, to produce weights for aggregation, as shown in Fig. 3. + +Pseudo-pairing unit When aggregating the matching costs, this unit is designed to automatically select prominent ones by assigning them more weights. To this end, we compare each matching pair with a pseudo stationary pair and use the difference as a clue to measure the importance of this matching pair. The pseudo stationary pair represents the situation when this point does not move, i.e. the softly corresponding point is itself. Based on Eq. 1, the matching cost of the pseudo stationary pair for each point $p_i$ can be defined as: + +$$ +\bar {h} _ {i} = h \left(\boldsymbol {f} _ {i} ^ {t}, \boldsymbol {f} _ {i} ^ {t}, \boldsymbol {p} _ {i} ^ {t} - \boldsymbol {p} _ {i} ^ {t}\right). \tag {2} +$$ + +The matching cost difference between each matching pair and this pseudo pair can be expressed as: + +$$ +\boldsymbol {u} _ {i j} = \boldsymbol {h} _ {i j} - \bar {\boldsymbol {h}} _ {i}. \tag {3} +$$ + +In subsequent aggregation procedure, the matching cost difference $\pmb{u}_{ij}$ will be treated as a feature to produce aggregation weights for each matching cost. + +Position encoding unit Further, to improve the ability of our aggregation, we incorporate the position representations into the aggregation procedure as a significant factor in producing soft weights. Specifically, inspired by [31] and [7], + +for each matching pair $\pmb{p}_i^t$ and $\pmb{p}_j^{t + 1}$ , we utilize 3D Euclidean distance, the absolute and relative coordinates as position information to encode the position representation $s_{ij}$ , which can be expressed as: + +$$ +\boldsymbol {s} _ {i j} = M _ {s} \left(\boldsymbol {p} _ {i} ^ {t} \oplus \boldsymbol {p} _ {j} ^ {t + 1} \oplus \left(\boldsymbol {p} _ {i} ^ {t} - \boldsymbol {p} _ {j} ^ {t + 1}\right) \oplus \left\| \boldsymbol {p} _ {i} ^ {t} - \boldsymbol {p} _ {j} ^ {t + 1} \right\|\right), \tag {4} +$$ + +where $M_{s}(\cdot)$ is a MLP to map the position information into the position representation, $\oplus$ is the concatenation operation, and $\| \cdot \|$ computes the Euclidean distance between the two points. + +Given the matching cost difference and the position representation, we design a shared function $M_{a}(\cdot)$ to produce a unique weight vector for each matching cost for aggregation. Specifically, the function $M_{a}(\cdot)$ is composed of a MLP followed by a softmax operation to normalize the weights across all matching costs in a set. The normalized weight for each matching cost $h_{ij}$ can be written as: + +$$ +\boldsymbol {w} _ {i j} = M _ {a} \left(\boldsymbol {u} _ {i j} \oplus \boldsymbol {s} _ {i j}\right). \tag {5} +$$ + +Therefore, for each point $\pmb{p}_i$ , according to the learned aggregation weights, the final flow embedding for point $\pmb{p}_i^t$ can be expressed as: + +$$ +\boldsymbol {e} _ {i} = \sum_ {j \in \mathcal {N} _ {e} (i)} \boldsymbol {w} _ {i j} \odot \boldsymbol {h} _ {i j}, \tag {6} +$$ + +where $\odot$ is the element-wise multiplication and $\mathcal{N}_e(i)$ is the set of softly corresponding points for point $\pmb{p}_i^t$ in next frame. + +# 3. Continuous High-Order CRFs + +In this section, we introduce the details of our continuous high order CRFs. We first formulate the problem of scene flow refinement. Then, we describe the details of three kinds of potential functions involved in the Con-HCRFs. Lastly, we discuss how to utilize mean field theory to approximate the Con-HCRFs distribution and obtain the final iterative inference algorithm. + +# 3.1. Overview + +Take a point cloud $\pmb{P}$ with $n$ points, indexed $1,2,\dots,n$ . In the scene flow refinement, we attempt to assign every point a refined 3D displacement based on the initial scene flow produced by the PAFE module. Let $\mathbf{Y} = [y_1,y_2,\dots,y_n]$ be a matrix of 3D displacements corresponding to all $n$ points in point cloud $\pmb{P}$ , where each $y_{i}\in \mathbb{R}^{3}$ . Following [12, 30], we model the conditional probability distribution with the following density function $\operatorname*{Pr}(\mathbf{Y}|\mathbf{P}) = \frac{1}{\mathbf{Z}(\mathbf{P})}\exp (-E(\mathbf{Y}|\mathbf{P}))$ . Here $E$ is the energy function and $Z$ is the partition function defined as: $Z(P) = \int_{V}\exp (-E(Y|P))\mathrm{d}Y$ . + +Different from conventional CRFs, the Con-HCRFs proposed in this paper contains a novel high order potential that performs rigid motion constraints in each local region. Specifically, the energy function is defined as: + +![](images/54235b8a75212bdc2fc867bcbc00fff3fb6c9472d3b1386d84b530de231863ae.jpg) +Figure 4. Illustration of Con-HCRFs. Red points and blue points represent the point cloud in frame $t$ and frame $t + 1$ , respectively. The black lines and gray background represent the pairwise relations and the neighborhood in the pairwise term. The dashed boxes cover rigid regions. An arrow with a point represents the rigid motion of a region with rigid motion parameters shared by all the points in it. The rigid motion constraints compose the high order term in Con-HCRFs. + +$$ +\begin{array}{l} E (\boldsymbol {Y} | \boldsymbol {P}) = \sum_ {i} \psi^ {U} \left(\boldsymbol {y} _ {i}, \boldsymbol {P}\right) + \sum_ {i, j \in \mathcal {N} (i)} \psi^ {B} \left(\boldsymbol {y} _ {i}, \boldsymbol {y} _ {j}, \boldsymbol {P}\right) \tag {7} \\ + \sum_ {\mathcal {V} \in \boldsymbol {V} _ {s e t}} \sum_ {i \in \mathcal {V}} \psi^ {S V} (\boldsymbol {y} _ {i}, \boldsymbol {Y} _ {\mathcal {V} - i}, \boldsymbol {P}), \\ \end{array} +$$ + +where $\mathcal{N}(i)$ represents the set of neighboring points of center point $i$ ; $\pmb{V}_{set}$ represents the set of rigid regions in the whole point cloud and $\pmb{Y}_{\mathcal{V} - i}$ is a matrix composed by the scene flow of points belonging to the region $\mathcal{V}$ with the point $i$ excluded. And the point set without the point $i$ is denoted as $\mathcal{V} - i$ . The unary term $\psi^U$ encourages the refined scene flow to be consistent with the initial scene flow. The pairwise term $\psi^B$ encourages neighboring points with similar local structure to take similar displacements. The high order term $\psi^{SV}$ encourages points belonging to the same rigid region to share the same rigid motion parameters. In this paper, we use over-segmentation method to segment the entire point cloud into a series of supervoxels and treat each supervoxel as the rigid region in the high order term. An illustration is shown in Fig. 4. We drop the conditioning on $P$ in the rest of this paper for convenience. + +# 3.2. Potential functions + +Unary potential The unary potential is constructed from the initial scene flow by considering $L^2$ norm: + +$$ +\psi^ {U} \left(\boldsymbol {y} _ {i}\right) = \left\| \boldsymbol {y} _ {i} - \boldsymbol {z} _ {i} \right\| _ {2} ^ {2}, \tag {8} +$$ + +where $z_{i}$ represents the initial 3D displacement at point $i$ produced by PAFE module; $\| \cdot \|_2$ denotes the $L^2$ norm of a vector. + +Pairwise potential The pairwise potential is constructed from $C$ types of similarity observations to describe the relation between pairs of hidden variables $\pmb{y}_i$ and $\pmb{y}_j$ : + +$$ +\psi^ {B} \left(\boldsymbol {y} _ {i}, \boldsymbol {y} _ {j}\right) = \sum_ {c = 1} ^ {C} \alpha_ {c} K _ {i j} ^ {(c)} \| \boldsymbol {y} _ {i} - \boldsymbol {y} _ {j} \| _ {2} ^ {2}, \tag {9} +$$ + +where $K_{ij}^{(c)}$ is a weight to specify the relation between the points $i$ and $j$ ; $\alpha_{c}$ denotes the coefficient for each similarity measure. Specifically, we set weight $K_{ij}^{(c)}$ depending on a Gaussian kernel $K_{ij}^{(c)} = \exp \left(-\frac{\|\pmb{k}_i^c - \pmb{k}_j^c\|^2}{2\theta_c^2}\right)$ , where $\pmb{k}_i^c$ and $\pmb{k}_j^c$ indicate the features of neighboring points $i$ and $j$ associating with similarity measure $c$ ; $\theta_{c}$ is the kernel's bandwidth parameter. In this paper, we use point position and surface normal as the observations to construct two Gaussian kernels. + +High order potential For the high order potential term, we want to explore the effects of interactions among points in a supervoxel. According to the rigid motion constraint, the high order potential term in CRF can be defined as: + +$$ +\psi^ {S V} (\boldsymbol {y} _ {i}, \boldsymbol {Y} _ {\mathcal {V} - i}) = \beta \| \boldsymbol {y} _ {i} - \boldsymbol {g} (\boldsymbol {p} _ {i}, \boldsymbol {Y} _ {\mathcal {V} - i}) \| _ {2} ^ {2}, \tag {10} +$$ + +where $g(\pmb{p}_i, \pmb{Y}_{\mathcal{V} - i})$ is a displacement produced by a function $g(\cdot, \cdot)$ , where shared rigid motion parameters will be computed by $\pmb{Y}_{\mathcal{V} - i}$ and the displacement for point $i$ obeying the shared parameters can be obtained by applying the shared parameters back to the original position $\pmb{p}_i$ . $\beta$ is a coefficient. In the following, we will give details about the computation of $g(\pmb{p}_i, \pmb{Y}_{\mathcal{V} - i})$ . + +In a rigid region $\mathcal{V}$ , given point $i$ , we denote the points in region $\mathcal{V}$ not containing the point $i$ as $P_{\mathcal{V} - i} = \{p_j \in P | j \in \mathcal{V} - i\}$ and the corresponding 3D displacements as $Y_{\mathcal{V} - i} = \{y_j \in Y | j \in \mathcal{V} - i\}$ . The warped positions in the next frame can be obtained by adding the scene flow back to the corresponding positions in frame $t$ : + +$$ +\boldsymbol {D} _ {\mathcal {V} - i} = \left\{\boldsymbol {d} _ {j} \left(\boldsymbol {y} _ {j}\right) = \boldsymbol {p} _ {j} + \boldsymbol {y} _ {j} \mid j \in \mathcal {V} - i \right\}. \tag {11} +$$ + +The possible rigid transformation from $P_{\mathcal{V} - i}$ to $D_{\mathcal{V} - i}$ can be defined as $[R, t]$ where $R \in \mathrm{SO}(3)$ and $t \in \mathbb{R}^3$ . Inspired by the work [43] in point cloud registration, we can minimize the mean-squared error $E^{rigid}(R, t; Y_{\mathcal{V} - i})$ to find the most suitable rigid motion parameters $[R^*(Y_{\mathcal{V} - i}), t^*(Y_{\mathcal{V} - i})]$ to describe the motion $Y_{\mathcal{V} - i}$ : + +$$ +E ^ {r i g i d} (\boldsymbol {R}, \boldsymbol {t}; \boldsymbol {Y} _ {\mathcal {V} - i}) = \frac {1}{N _ {\mathcal {V} - i}} \sum_ {j = 1} ^ {N _ {\mathcal {V} - i}} \| \boldsymbol {R} \boldsymbol {p} _ {j} + \boldsymbol {t} - \boldsymbol {d} _ {j} (\boldsymbol {y} _ {j}) \| _ {2} ^ {2}, \tag {12} +$$ + +$$ +\left[ \boldsymbol {R} ^ {*} (\boldsymbol {Y} _ {\mathcal {V} - i}), \boldsymbol {t} ^ {*} (\boldsymbol {Y} _ {\mathcal {V} - i}) \right] = \arg \min _ {\boldsymbol {R}, \boldsymbol {t}} E ^ {r i g i d} (\boldsymbol {R}, \boldsymbol {t}; \boldsymbol {Y} _ {\mathcal {V} - i}), \tag {13} +$$ + +where $N_{\mathcal{V} - i}$ is the number of points in region $\mathcal{V}$ with the point $i$ excluded. + +Define centers of $P_{\mathcal{V} - i}$ and $D_{\mathcal{V} - i}$ as $\overline{p}_{\mathcal{V} - i} = \frac{1}{N_{\mathcal{V} - i}}\sum_{j = 1}^{N_{\mathcal{V} - i}}p_j$ and $\overline{d}_{\mathcal{V} - i} = \frac{1}{N_{\mathcal{V} - i}}\sum_{j = 1}^{N_{\mathcal{V} - i}}d_j$ respectively. Then the cross-covariance matrix $H_{\mathcal{V} - i}$ can be written as: $H_{\mathcal{V} - i} = \sum_{j = 1}^{N_{\mathcal{V} - i}}(p_j - \overline{p}_{\mathcal{V} - i})(d_j - \overline{d}_{\mathcal{V} - i})^\top$ . Using the singular value decomposition (SVD) to decompose $H_{\mathcal{V} - i} = U_{\mathcal{V} - i}S_{\mathcal{V} - i}V_{\mathcal{V} - i}^\top$ , we can get the closed-form solutions of + +$E_{\mathcal{V} - i}^{rigid}(\cdot ,\cdot)$ , written as: + +$$ +\begin{array}{l} \boldsymbol {R} ^ {*} \left(\boldsymbol {Y} _ {\mathcal {V} - i}\right) = \boldsymbol {V} _ {\mathcal {V} - i} \boldsymbol {U} _ {\mathcal {V} - i} ^ {\top} \tag {14} \\ \boldsymbol {t} ^ {*} (\boldsymbol {Y} _ {\mathcal {V} - i}) = - \boldsymbol {R} ^ {*} (\boldsymbol {Y} _ {\mathcal {V} - i}) \overline {{\boldsymbol {p}}} _ {\mathcal {V} - i} + \overline {{\boldsymbol {d}}} _ {\mathcal {V} - i}. \\ \end{array} +$$ + +When treating the most suitable parameters $\left[\pmb{R}^{*}(\pmb{Y}_{\mathcal{V} - i}),\pmb{t}^{*}(\pmb{Y}_{\mathcal{V} - i})\right]$ as the shared rigid motion parameters by all points in region $\mathcal{V}$ , the displacement that satisfies the rigid motion constraints for point $i$ is given by: + +$$ +\boldsymbol {g} \left(\boldsymbol {p} _ {i}, \boldsymbol {Y} _ {\mathcal {V} - i}\right) = \boldsymbol {R} ^ {*} \left(\boldsymbol {Y} _ {\mathcal {V} - i}\right) \boldsymbol {p} _ {i} + \boldsymbol {t} ^ {*} \left(\boldsymbol {Y} _ {\mathcal {V} - i}\right) - \boldsymbol {p} _ {i}. \tag {15} +$$ + +# 3.3. Inference + +In order to produce the most probable scene flow, we should solve the MAP inference problem for $\operatorname{Pr}(\mathbf{Y})$ . Following [30], we approximate the original conditional distribution $\operatorname{Pr}(\mathbf{Y})$ by mean field theory [9]. Thus, the distribution $\operatorname{Pr}(\mathbf{Y})$ is approximated by a product of independent marginals, i.e., $Q(\mathbf{Y}) = \prod_{i=1}^{n} Q_i(\mathbf{y}_i)$ . By minimizing the KL-divergence between $\operatorname{Pr}$ and $Q$ , the solution for $Q$ can be written as: $\log(Q_i(\mathbf{y}_i)) = \mathrm{E}_{j \neq i}[\operatorname{Pr}(\mathbf{Y})] + \text{const}$ , where $\mathrm{E}_{j \neq i}$ represents an expectation under $Q$ distributions over all variable $\mathbf{y}_j$ for $j \neq i$ . + +Following [30], we represent each $\log (Q_i(\pmb {y}_i))$ as a multivariate normal distribution, the mean field update for mean $\dot{\mu}_i$ and normalization parameter $\sigma_{i}$ can be written as: + +$$ +\sigma_ {i} = \frac {1}{2 \left(1 + 2 \sum_ {c = 1} ^ {C} \sum_ {j \in \mathcal {N} (i)} \alpha_ {c} K _ {i j} ^ {(c)} + \beta\right)}, \tag {16} +$$ + +$$ +\dot {\boldsymbol {\mu}} _ {i} = 2 \sigma_ {i} \left(\boldsymbol {z} _ {i} + 2 \sum_ {c = 1} ^ {C} \sum_ {j \in \mathcal {N} (i)} \alpha_ {c} K _ {i j} ^ {(c)} \boldsymbol {\mu} _ {j} + \beta \boldsymbol {g} \left(\boldsymbol {p} _ {i}, \boldsymbol {M} _ {\mathcal {V} - i}\right)\right), \tag {17} +$$ + +where $M_{\mathcal{V} - i}$ is a set of mean $\pmb{\mu}_{j}$ for all $j\in \mathcal{V} - i$ . $\sigma_{i}$ is the diagonal element of covariance $\Sigma_{i}$ . The detailed derivation of the inference algorithm can be found in supplementary. We observe that there usually exist hundreds of points in a supervoxel, which makes the rigid parameters computed on all points in the supervoxel excluding the point $i$ vary close to the rigid parameters computed on all points in the supervoxel, i.e., $[R^{*}(M_{\mathcal{V} - i}),t^{*}(M_{\mathcal{V} - i})]$ is vary close to $[R^{*}(M_{\mathcal{V}}),t^{*}(M_{\mathcal{V}})]$ . Thus, in practice, we approximate $g(p_i,M_{\mathcal{V} - i})$ in Eq. 17 with $g(p_i,M_{\mathcal{V}})$ , and the approximated mean $\pmb{\mu}_{i}$ is: + +$$ +\boldsymbol {\mu} _ {i} = 2 \sigma_ {i} \left(\boldsymbol {z} _ {i} + 2 \sum_ {c = 1} ^ {C} \sum_ {j \in \mathcal {N} (i)} \alpha_ {c} K _ {i j} ^ {(c)} \boldsymbol {\mu} _ {j} + \beta \boldsymbol {g} \left(\boldsymbol {p} _ {i}, \boldsymbol {M} _ {\mathcal {V}}\right)\right). \tag {18} +$$ + +After this approximation, we only need to calculate a set of rigid motion parameters for each supervoxel rather than for each point, which greatly reduces the time complexity. + +In the MAP inference, since we approximate $\operatorname{Pr}$ with $Q$ , an estimate of each $\pmb{y}_i$ can be obtained by computing the expected value $\pmb{\mu}_i$ of the Gaussian distribution $Q_i$ : + +$$ +\boldsymbol {y} _ {i} ^ {*} = \arg \max _ {\boldsymbol {y} _ {i}} Q _ {i} (\boldsymbol {y} _ {i}) = \boldsymbol {\mu} _ {i}. \tag {19} +$$ + +The inference procedure of our Con-HCRFs can be clearly sketched in Algorithm 1. + +Algorithm 1 Mean field in Con-HCRFs + +Input: Coarse scene flow $Z$ ; Coordinates of point cloud $P$ + +Output: Refined scene flow $\mathbf{Y}^{*}$ + +Procedure: + +1: $\pmb{\mu}_i\gets \pmb{z}_i$ for all $i$ +$\triangleright$ Initialization +2: while not converged do +3: Compute $[R^{*}(M_{\mathcal{V}}),t^{*}(M_{\mathcal{V}})]$ for supervoxel $\nu$ +4: $\hat{\pmb{\mu}}_i\gets \pmb{R}^* (\pmb {M}_\mathcal{V})\pmb {p}_i + \pmb {t}^* (\pmb {M}_\mathcal{V}) - \pmb {p}_i;$ +$\triangleright$ Message passing from supervoxel +5: $\tilde{\pmb{\mu}}_i^{(c)}\gets \sum_{j\in \mathcal{N}(i)}K_{ij}^{(c)}\pmb {\mu}_j;$ +6: $\tilde{\sigma}_i^{(c)}\gets \sum_{j\in \mathcal{N}(i)}K_{ij}^{(c)};$ +$\triangleright$ Message passing from neighboring points +7: $\bar{\pmb{\mu}}_i\gets \pmb {z}_i + 2\sum_c\alpha_c\tilde{\pmb{\mu}}_i^{(c)} + \beta \hat{\pmb{\mu}}_i;$ +8: $\bar{\sigma}_i\gets 1 + 2\sum_c\alpha_c\tilde{\sigma}_i^{(c)} + \beta ;$ +Weighted summing +9: $\pmb{\mu}_i\gets \frac{1}{\sigma_j}\bar{\pmb{\mu}}_i;$ +Normalizing +10: end while +11: $\pmb{y}_i^* \gets \pmb{\mu}_i$ for all $i$ . + +Moreover, thanks to the differentiable SVD function provided by PyTorch [24], the mean field update operation is differentiable in our inference procedure. Therefore, following [49, 46], our mean field algorithm can be fully integrated with deep learning models, which ensures the end-to-end training of the whole framework. + +# 4. Experiments + +In this section, we first train and evaluate our method on the synthetic FlyingThings3D dataset in Sec. 4.1, and then in Sec. 4.2 we test the generalization ability of our method on real-world KITTI dataset without fine-tuning. In Sec. 4.3, we validate the generality of our Con-HCRFs on other networks. Finally, we conduct ablation studies to analyze the contribution of each component in Sec. 4.4. Note that in the following experiments, there are two different architectures of the PAFE module, the single-scale one denoted as PAFE-S and the pyramid one denoted as PAFE. And corresponding HCRF-Flow models are denoted as HCRF-Flow-S and HCRF-Flow, respectively. + +Evaluation metrics. Let $Y^{*}$ denote the predicted scene flow, and $Y_{gt}$ be the ground truth scene flow. The evaluate metrics are computed as follows. EPE3D(m): the main metric, $\| Y^{*} - Y_{gt}\|_{2}$ average over each point. Acc3DS(%): the percentage of points whose EPE3D < 0.05m or relative error < 5%. Acc3DR(%): the percentage of points whose EPE3D < 0.1m or relative error < 10%. Outliers3D(%): the percentage of points whose EPE3D > 0.3m or relative error > 10%. EPE2D(px): 2D End Point Error, which is a + +common metric for optical flow. Acc2D(%): the percentage of points whose EPE2D $< 3px$ or relative error $< 5\%$ . + +# 4.1. Results on FlyingThings3D + +FlyingThings3D [19] is a large-scale synthetic dataset. We follow [5] to build the training set and the test set. Our method takes $n = 8$ , 192 points in each point cloud as input. We train our models on one quarter of the training set (4,910 pairs) and evaluate on the whole test set (3,824 pairs). + +Referring to PointPWC-Net [45], we build a pyramid PAFE module, PAFE, and corresponding HCRF-Flow framework, HCRF-Flow. Note that, compared with original architecture in [45], there are three adjustments in our PAFE: 1) we replace the MLPs in level 0 with a set conv [13]; 2) we replace all PointConvs [44] with set convs [13]; 3) we replace cost volume layers [45] with our position-aware flow embedding layers. In Con-HCRFs, we utilize the algorithm proposed in [11] for supervoxel segmentation. During training, we first train our PAFE with a multi-scale loss function used in [45]. Then we add the Con-HCRFs to PAFE for fine-tuning. More implementation details are in supplementary. + +The quantitative evaluation results on the Flyingthings3D are shown in Table 1. We compare our method with four baseline models: FlowNet3D [13], HPLFlowNet [5], PointPWC-Net [45], and FLOT [26]. As shown in Table 1, our PAFE module outperforms the above four methods. Further, adding Con-HCRFs and fine-tuning on FlyingThings3D, the final method, HCRF-Flow, achieves the best performance on all metrics. Qualitative results are shown in Fig. 5. + +# 4.2. Generalization results on KITTI + +KITTI Scene Flow 2015 [22, 21] is a well-known dataset for 3D scene flow estimation. In this section, in order to evaluate the generalization ability of our method, we train our model on FlyingThings3D dataset and test on KITTI Scene Flow 2015 without fine-tuning. And the desired supervoxel size and the bandwidth parameters in KITTI are the same as those in FlyingThings3D. + +Following [13, 5], we evaluate on all 142 scenes in the training set and remove the points on the ground by height $(< 0.3m)$ for a fair comparison. The quantitative evaluation results on the KITTI are shown in Table 1. Our method outperforms the competing methods, which represents the good generalization ability of our method on real-world data. Fig. 5 shows the qualitative results. + +# 4.3. Generality of Con-HCRFs on other models + +In this section, we study the generalization ability of Con-HCRFs by applying it to the other scene flow estimation models as a post-processing module. We evaluate the performance of our proposed Con-HCRFs with + +Table 1. Evaluation results on FlyingThings3D and KITTI Scene Flow 2015. Our model outperforms all baselines on all evaluation metrics. Especially, the good performance on KITTI shows the generalization ability of our method. + +
DatasetMethodEPE3D↓Acc3DS↑Acc3DR↑Outliers3D↓EPE2D↓Acc2D↑
FlyingThings3DFlowNet3D [13]0.088641.6381.6158.624.714260.10
HPLFlowNet [5]0.080461.4485.5542.874.672367.64
PointPWC-Net [45]0.058873.7992.7634.243.239079.94
FLOT [26]0.052073.2092.7035.70--
Ours (PAFE module)0.053578.9094.9330.512.825383.46
Ours (HCRF-Flow)0.048883.3795.0726.142.565287.04
KITTIFlowNet3D [13]0.106942.7779.7841.384.342457.51
HPLFlowNet [5]0.116947.8377.7641.034.805559.38
PointPWC-Net [45]0.069472.8188.8426.483.006276.73
FLOT [26]0.056075.5090.8024.20--
Ours (PAFE module)0.064680.2993.4720.242.482980.80
Ours (HCRF-Flow)0.053186.3194.4417.972.070086.56
+ +![](images/e0e6dec6618a682a827b863d42c71fe6e32e5a83360e5092b30333a8864a29e0.jpg) + +![](images/c74ca15c5916883165664e7dee2c1310618947c6015e6e4d96d5fa6cca1a99c4.jpg) + +![](images/a622814e1a8958d50f61a576a7a86ced6f0d2ba289379b746b4d2607aaec9816.jpg) + +![](images/dc0d914bf433fe07002d40cb3506249e6d1c0376dc255f1ce51ae6dd764d7c31.jpg) +Figure 5. Qualitative results on FlyingThings3D (top) and KITTI (bottom). Blue points are point cloud at frame $t$ . Green points are the warped results at frame $t + 1$ for the points, whose predicted displacements are measured as correct by Acc3DR. For the incorrect predictions, we use the ground-truth scene flow to replace them. And the ground truth warped results are shown as red points. + +![](images/c69604660585a3f5ea7913317906ad840250897c29a140515d474e2e3e846421.jpg) + +![](images/7be363da1a1010ee2f62d4b5900c001977065b9fa3661f07c94e0a678be0361a.jpg) + +Table 2. Generalization results of Con-HCRFs on FlowNet3D and FLOT models. $\Delta$ denotes the difference in metrics with respect to each original model. Although built upon strong baselines, our proposed Con-HCRFs boost the performance of each baseline by a large margin on the two datasets. + +
DatasetMethodAcc3DS↑ΔAcc3DS
FlyingThings3DFlowNet3D [13]41.630.0
+ Con-HCRFs47.01+ 5.38
FLOT [26]73.200.0
+ Con-HCRFs78.63+ 5.43
KITTIFlowNet3D [13]42.770.0
+ Con-HCRFs46.90+ 4.13
FLOT [26]75.500.0
+ Con-HCRFs85.44+ 9.94
+ +FlowNet3D [13] and FLOT [26], which have shown strong capability on both challenging synthetic data from FlyingThings3D and real Lidar scans from KITTI. The results are presented in Table 2. Although built upon strong baselines, our proposed Con-HCRFs boost the performance of each baseline by a large margin on both datasets, demonstrating the strong robustness and generalization. + +# 4.4. Ablation studies + +In this section, we provide a detailed analysis of every component in our method. All experiments are conducted + +in the FlyThings3D dataset. Besides the pyramid models, PAFE and HCRF-Flow, for comprehensive analysis, we also evaluate the performance of each component when used in single-scale models, PAFE-S and HCRF-Flow-S. These models are designed referring to FlowNet3D [13]. + +Ablation for position-aware flow embedding layer. We explore the effect of the aggregation strategy on our position-aware flow embedding layer. This strategy is introduced to dynamically aggregate the matching costs considering position information and matching cost differences. As shown in Table 3, for the two baselines, when applying both the pseudo-pairing unit and the position encoding unit to the flow embedding layer, the performance in Acc3DS can be improved by around 8. Moreover, to verify the effectiveness of the pseudo pair, we design a naive dynamic aggregation unit, denoted as NDA, which directly produces weights from matching costs rather than the matching cost difference between each matching pair and this pseudo pair. As shown in Table 3, after replacing PP with NDA, the improvement in Acc3DS decreases from 6.79 to 2.62. Thus, the pseudo-pairing unit is a better choice for this task. + +Ablation for Con-HCRFs. To ensure the spatial smoothness and the local rigidity of the final predictions, we propose continuous CRFs with a novel high order term. The ablation results for Con-HCRFs are presented in Table 4. + +Table 3. Ablation study for position-aware flow embedding layer. MP: Maxpooling. PP: pseudo-pairing unit. PE: position encoding unit. NDA: naive dynamic aggregation unit. $\Delta$ denotes the difference in metrics with respect to each baseline model. + +
MethodMP PP PE NDAAcc3DS↑ΔAcc3DS
Single-scale baseline✓41.630.00
+NDA✓44.25 + 2.62
+PP✓48.42+ 6.79
+PP+PE (PAFE-S module)✓✓50.08+ 8.45
Pyramid baseline✓69.940.0
+PP+PE (PAFE module)✓✓78.90+ 8.96
+ +Table 4. Ablation study for Con-HCRFs. *Unary: unary term. +*Pair: pairwise term. *High-order: our proposed high order term. +*naive Region: a naive regional term designed as a reference to verify the effectiveness of our high order term. Δ denotes the difference in metrics with respect to PAFE or PAFE-S module, whose details are introduced in Table 3. † means jointly optimizing Con-HCRFs and PAFE modules. + +
MethodAcc3DS†ΔAcc3DS
PAFE-S module50.080.00
+ (Unary+Pair)50.24+ 0.16
+ (Unary+Pair+naive Region)48.10- 1.98
+ (Unary+Pair+High-order)/Con-HCRFs54.51+ 4.43
+ (Unary+Pair+High-order)/Con-HCRFsf56.29+ 6.21
PAFE module78.900.00
+ (Unary+Pair+High-order)/Con-HCRFs81.39+ 2.49
+ (Unary+Pair+High-order)/Con-HCRFsf83.37+ 4.47
+ +With the help of a pairwise term, denoted as (Unary+Pair), the performance gains a slight improvement due to the fact that this pairwise term aims at spatial smoothness but ignores the potential rigid motion constraints. Our proposed Con-HCRFs module, which formulates the rigid motion constraints as its high order term, boosts the performance by a large margin for PAFE-S and PAFE modules. After jointly optimizing Con-HCRFs and PAFE modules, we observe further improvement. + +Can we replace the rigid motion constraints by a region-level smoothness in a supervoxel? We want to explore whether the rigid motion constraint is a good approach to model the relations among points in a supervoxel. Instead of sharing unique rigid motion parameters, a straightforward approach is to encourage the points among a rigid region to share the same motion, i.e., encourage region-level smoothness in a supervoxel. To this end, we design a naive regional term as: $\psi^{naive}(\pmb{y}_i, \pmb{Y}_{\mathcal{V}}) = \beta \| \pmb{y}_i - \pmb{g}^{naive}(\pmb{p}_i, \pmb{Y}_{\mathcal{V}}) \|^2$ , where $\pmb{g}^{naive}(\pmb{p}_i, \pmb{Y}_{\mathcal{V}})$ is an average of $\pmb{Y}_{\mathcal{V}}$ over all points in $\mathcal{V}$ . The results are shown in Table 4, denoted as (Unary+Pair+naive Region). As it only enforces spatial smoothness in a region and fails to model suitable dependencies among points in this rigid region, this kind of CRFs is ineffective and even worsen the performance. In contrast, when applying our proposed Con-HCRFs, the final scene flow shows significant improvements. + +Speed analysis of Con-HCRFs Table 5 reports the average runtime of each component of Con-HCRFs tested on a + +Table 5. Time consumption of Con-HCRFs. + +
ComponentSupervoxelPairwise termHigh order termTotal
Time (ms)115.112.3100.8228.2
+ +Table 6. The impact of point number of each supervoxel on our method. + +
Desired point number80100140200PAFE-S
EPE3D↓0.08040.07880.07820.07900.0815
+ +single 1080ti GPU. As shown in Table 5, the Con-HCRFs takes 0.2s to process a scene with 8192 points. The speed of Con-HCRFs is similar to DenseCRF [10], which also takes about 0.2s to process a $320 \times 213$ image. Additionally, due to the approximate computation that we apply in the high order term, this term only takes 0.1s for a scene. In contrast, the time for the term will dramatically increase from 0.1s to 14s, if the rigid motion parameters are calculated for each point instead of supervoxel. The large gap of runtime shows that the approximation discussed in Sec. 3.3 can significantly boost the efficiency of our Con-HCRFs. + +Impact of supervoxel sizes. To illustrate the sensitivity to supervoxel sizes, we test our method when facing supervoxels with different point numbers. As shown in Table 6, the method achieves the best performance when the desired point number of each supervoxel is set to a range of 140 to 200. + +# 5. Conclusions + +In this paper, we have proposed a novel point cloud scene flow estimation method, termed HCRF-Flow, by incorporating the strengths of DNNs and CRFs to perform translational motion regression on each point and operate refinement with both pairwise and region-level regularization. Formulating the rigid motion constraints as a high order term, we propose a novel high-order CRF based relation module (Con-HCRFs) considering both point-level and region-level consistency. In addition, we design a position-aware flow estimation layer for better matching cost aggregation. Experimental results on FlyingThings3D and KITTI datasets show that our proposed method performs favorably against comparison methods. We have also shown the generality of our Con-HCRFs on other point cloud scene flow estimation methods. + +# 6. Acknowledgements + +This research was conducted in collaboration with SenseTime. This work is supported by A*STAR through the Industry Alignment Fund - Industry Collaboration Projects Grant. This work 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) and RG22/19 (S). + +# References + +[1] Aseem Behl, Despoina Paschalidou, Simon Donne, and Andreas Geiger. Pointflownet: Learning representations for rigid motion estimation from point clouds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7962-7971, 2019. 2 +[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. 2 +[3] Christopher Choy, JunYoung Gwak, and Silvio Savarese. 4d spatio-temporal convnets: Minkowski convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3075-3084, 2019. 2 +[4] Ayush Dewan, Tim Caselitz, Gian Diego Tipaldi, and Wolfram Burgard. Rigid scene flow for 3d lidar scans. In 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 1765-1770. IEEE, 2016. 2 +[5] Xiuye Gu, Yijie Wang, Chongruo Wu, Yong Jae Lee, and Panqu Wang. Hplflownet: Hierarchical permutohedral lattice flownet for scene flow estimation on large-scale point clouds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3254-3263, 2019. 1, 2, 6, 7 +[6] Michael Hornacek, Andrew Fitzgibbon, and Carsten Rother. Sphereflow: 6 dof scene flow from rgb-d pairs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3526-3533, 2014. 2 +[7] 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. 2, 3 +[8] Frédéric Huguet and Frédéric Devernay. A variational method for scene flow estimation from stereo sequences. In 2007 IEEE 11th International Conference on Computer Vision, pages 1-7. IEEE, 2007. 2 +[9] Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009. 5 +[10] 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. 2, 8 +[11] Yangbin Lin, Cheng Wang, Dawei Zhai, Wei Li, and Jonathan Li. Toward better boundary preserved supervoxel segmentation for 3d point clouds. ISPRS journal of photogrammetry and remote sensing, 143:39-47, 2018. 6 +[12] Fayao Liu, Chunhua Shen, and Guosheng Lin. Deep convolutional neural fields for depth estimation from a single image. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5162-5170, 2015. 2, 4 +[13] Xingyu Liu, Charles R Qi, and Leonidas J Guibas. Flownet3d: Learning scene flow in 3d point clouds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 529-537, 2019. 1, 2, 3, 6, 7 + +[14] Xingyu Liu, Mengyuan Yan, and Jeannette Bohg. Meteornet: Deep learning on dynamic 3d point cloud sequences. In Proceedings of the IEEE International Conference on Computer Vision, pages 9246-9255, 2019. 2 +[15] 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. 2 +[16] Wei-Chiu Ma, Shenlong Wang, Rui Hu, Yuwen Xiong, and Raquel Urtasun. Deep rigid instance scene flow. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3614-3622, 2019. 2 +[17] D Man and A Vision. A computational investigation into the human representation and processing of visual information, 1982. 1 +[18] Jiageng Mao, Xiaogang Wang, and Hongsheng Li. Interpolated convolutional networks for 3d point cloud understanding. In Proceedings of the IEEE International Conference on Computer Vision, pages 1578-1587, 2019. 2 +[19] Nikolaus Mayer, Eddy Ilg, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4040-4048, 2016. 6 +[20] Moritz Menze and Andreas Geiger. Object scene flow for autonomous vehicles. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3061-3070, 2015. 2 +[21] Moritz Menze, Christian Heipke, and Andreas Geiger. Joint 3d estimation of vehicles and scene flow. ISPRS Annals of Photogrammetry, Remote Sensing & Spatial Information Sciences, 2, 2015. 6 +[22] Moritz Menze, Christian Heipke, and Andreas Geiger. Object scene flow. ISPRS Journal of Photogrammetry and Remote Sensing, 140:60-76, 2018. 6 +[23] Himangi Mittal, Brian Okorn, and David Held. Just go with the flow: Self-supervised scene flow estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11177-11185, 2020. 2 +[24] 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 +[25] 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. 2 +[26] Gilles Puy, Alexandre Boulch, and Renaud Marlet. Flot: Scene flow on point clouds guided by optimal transport. arXiv preprint arXiv:2007.11142, 2020. 1, 2, 6, 7 +[27] 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. 2, 3 + +[28] 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. 2 +[29] Julian Quiroga, Thomas Brox, Frédéric Devernay, and James Crowley. Dense semi-rigid scene flow estimation from rgbd images. In European Conference on Computer Vision, pages 567-582. Springer, 2014. 2 +[30] Kosta Ristovski, Vladan Radosavljevic, Slobodan Vucetic, and Zoran Obradovic. Continuous conditional random fields for efficient regression in large fully connected graphs. In Twenty-Seventh AAAI Conference on Artificial Intelligence, 2013. 4, 5 +[31] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018. 3 +[32] Deqing Sun, Erik B Sudderth, and Hanspeter Pfister. Layered rgbd scene flow estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 548-556, 2015. 2 +[33] Lyne Tchapmi, Christopher Choy, Iro Armeni, JunYoung Gwak, and Silvio Savarese. Segcloud: Semantic segmentation of 3d point clouds. In 2017 international conference on 3D vision (3DV), pages 537-547. IEEE, 2017. 2 +[34] 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. 2 +[35] Arash K Ushani, Ryan W Wolcott, Jeffrey M Walls, and Ryan M Eustice. A learning approach for real-time temporal scene flow estimation from lidar data. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pages 5666-5673. IEEE, 2017. 2 +[36] Levi Valgaerts, Andrés Bruhn, Henning Zimmer, Joachim Weickert, Carsten Stoll, and Christian Theobalt. Joint estimation of motion, structure and geometry from stereo sequences. In European Conference on Computer Vision, pages 568-581. Springer, 2010. 2 +[37] Sundar Vedula, Simon Baker, Peter Rander, Robert Collins, and Takeo Kanade. Three-dimensional scene flow. In Proceedings of the Seventh IEEE International Conference on Computer Vision, volume 2, pages 722-729. IEEE, 1999. 1, 2 +[38] Christoph Vogel, Konrad Schindler, and Stefan Roth. 3d scene flow estimation with a rigid motion prior. In 2011 International Conference on Computer Vision, pages 1291-1298. IEEE, 2011. 2 +[39] Christoph Vogel, Konrad Schindler, and Stefan Roth. Piecewise rigid scene flow. In Proceedings of the IEEE International Conference on Computer Vision, pages 1377-1384, 2013. 2 +[40] Christoph Vogel, Konrad Schindler, and Stefan Roth. 3d scene flow estimation with a piecewise rigid scene model. International Journal of Computer Vision, 115(1):1-28, 2015. 2 + +[41] Lei Wang, Yuchun Huang, Yaolin Hou, Shenman Zhang, and Jie Shan. Graph attention convolution for point cloud semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10296-10305, 2019. 2 +[42] 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. 2 +[43] Yue Wang and Justin M Solomon. Deep closest point: Learning representations for point cloud registration. In Proceedings of the IEEE International Conference on Computer Vision, pages 3523-3532, 2019. 5 +[44] 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. 2, 6 +[45] Wenxuan Wu, Zhi Yuan Wang, Zhuwen Li, Wei Liu, and Li Fuxin. Pointpwc-net: Cost volume on point clouds for (self-) supervised scene flow estimation. In European Conference on Computer Vision, pages 88-107. Springer, 2020. 1, 2, 3, 6, 7 +[46] Dan Xu, Elisa Ricci, Wanli Ouyang, Xiaogang Wang, and Nicu Sebe. Multi-scale continuous crfs as sequential deep networks for monocular depth estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5354-5362, 2017. 2, 6 +[47] Bo Yang, Jianan Wang, Ronald Clark, Qingyong Hu, Sen Wang, Andrew Markham, and Niki Trigoni. Learning object bounding boxes for 3d instance segmentation on point clouds. In Advances in Neural Information Processing Systems, pages 6737-6746, 2019. 2 +[48] 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/CVF Conference on Computer Vision and Pattern Recognition, pages 5217–5226, 2019. 2 +[49] Shuai Zheng, Sadeep Jayasumana, Bernardino Romero-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip HS Torr. Conditional random fields as recurrent neural networks. In Proceedings of the IEEE international conference on computer vision, pages 1529-1537, 2015. 6 \ No newline at end of file diff --git a/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/images.zip b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9f467ad6c38f697b72ce34e857d55ac7e18886ce --- /dev/null +++ b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef0f62e26af5115b78bd42e6da970e1d60350780b8b8fa89aa3837e9817cddfc +size 450340 diff --git a/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/layout.json b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ffd7ac4561124a71810eef06e4d90911b1e8e6dc --- /dev/null +++ b/hcrfflowsceneflowfrompointcloudswithcontinuoushighordercrfsandpositionawareflowembedding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0e5dc3f3d84865ce48a055d7633f64ec64c81052f861a9b96e5561a3898b9c5 +size 531698 diff --git a/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_content_list.json b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7aa5ac8144980b8391d3582817277b36257f98cb --- /dev/null +++ b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0569ab8b9743426635f84d077eea5510e31fec643c743c80094bff5f8f318eeb +size 66428 diff --git a/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_model.json b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..21b68a9a1070d2f7e2f6fe0710fe98f14432ad9a --- /dev/null +++ b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d6f2e65bf18f6cd23d01c1e7f6c803303f409c1e206618fd6a5a2f08de04119 +size 81848 diff --git a/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_origin.pdf b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2110c3d2ee134dd7024e495a4957255a74f7e5ec --- /dev/null +++ b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/d44cdeab-86a0-4fd6-9dd8-5b1074d0beb7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0007b5b4c5f50f7433189c62d780038f576f8bb227cd2e0d0d5e57e627508ae +size 1155363 diff --git a/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/full.md b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2c81de6d8633c8e32da1047a20c0e998ea8e5e27 --- /dev/null +++ b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/full.md @@ -0,0 +1,254 @@ +# HDMapGen: A Hierarchical Graph Generative Model of High Definition Maps + +Lu Mi $^{1,2,\dagger,*}$ , Hang Zhao $^{1,*}$ , Charlie Nash $^{3}$ , Xiaohan Jin $^{1}$ , Jiyang Gao $^{1}$ , Chen Sun $^{4}$ , Cordelia Schmid $^{4}$ , Nir Shavit $^{2}$ , Yuning Chai $^{1}$ , Dragomir Anguelov $^{1}$ , Waymo, MIT, DeepMind, Google + +# Abstract + +High Definition (HD) maps are maps with precise definitions of road lanes with rich semantics of the traffic rules. They are critical for several key stages in an autonomous driving system, including motion forecasting and planning. However, there are only a small amount of real-world road topologies and geometries, which significantly limits our ability to test out the self-driving stack to generalize onto new unseen scenarios. To address this issue, we introduce a new challenging task to generate HD maps. In this work, we explore several autoregressive models using different data representations, including sequence, plain graph, and hierarchical graph. We propose HDMapGen, a hierarchical graph generation model capable of producing high-quality and diverse HD maps through a coarse-to-fine approach. Experiments on the Argoverse dataset and an in-house dataset show that HDMapGen significantly outperforms baseline methods. Additionally, we demonstrate that HDMapGen achieves high scalability and efficiency. + +# 1. Introduction + +High Definition maps (HD maps) are electronic maps with precise depictions of the physical roads, usually with an accuracy of centimeters, together with rich semantics of traffic rules, such as one-way-street, stop, yield, etc. HD maps sit at the core of autonomous driving applications as they provide a strong prior for the self-driving robots to localize themselves in the 3D space [4, 34], predict other vehicles' motions [6, 40] and maneuver themselves around [8, 20]. Furthermore, HD maps are critical building blocks of city modeling and simulation. Simulating novel city environments finds a wide range of applications in game design and urban planning. + +Practically, HD maps are constructed according to a strict mapping procedure: first, a fleet of vehicles with mapping sensor suites (containing LiDAR, Radar, and camera) + +![](images/40fcf391d5547c61ee6a16ef13b97174da93d9a53c64a8fd1422140101271238.jpg) +Hierarchical Graph Generated from HDMapGen + +![](images/88f309d517af558b7f367d807e294c7541bc43608ab1873d459d7f676f411b49.jpg) +Corresponding Intersections and Lanes +Figure 1: Left: a hierarchical map graph generated from HDMapGen. One traffic light controlled lane is shown as an example; Right: a map with corresponding intersections and lanes rendered from the hierarchical map graph. + +are sent to capture the scene; then, the sensor data are processed and stitched together to obtain map imagery; finally, human specialists annotate on top of the imagery to provide vectorized representations of the world geometry with semantic attributes. On the other hand, we aim to produce synthetic HD maps in a data-driven way, mainly due to two reasons: (1) building HD maps from the real world is prohibitively expensive; (2) the small number of real-world maps prevent us from testing the generalization capability of self-driving stacks in simulation, such as motion forecasting and motion planning. + +Existing methods in modeling cities and maps are mostly relying on procedural modeling, and hand-crafted generation rules [30], and are therefore not flexible and adaptable to new scenarios. There is no previous attempt to generate HD maps using modern deep generative models to the best of our knowledge. The most related works are those which generate city layouts [10]. Compared to HD maps, city layouts are not suitable for autonomous driving applications since they only contain coarse locations of the roads (with a resolution of roughly 10 meters) and lack details such as lanes of the roads or traffic lights. + +Unique attributes of HD maps pose new challenges to modeling them: (1) HD maps are composed of physical road elements with geometric features, e.g. marked straight lanes and hypothesized turning lanes; (2) Lane maps contain rich semantic attributes, e.g. the direction of lanes, the association between traffic lights and lanes. By addressing these challenges, our major contributions in this work are as follows: + +- We pose a new important and challenging problem to generate HD lane maps in a data-driven way. +- We perform a systematic exploration of modern autoregressive generative models with different data representations and propose HDMapGen, a hierarchical graph generative model that largely outperforms other baselines. +- We evaluate our model on the maps of the public Argoverse dataset and an in-house dataset, covering cities of Miami, Pittsburg, and San Francisco. Results show that our model produces maps with high fidelity, diversity, scalability, and efficiency. + +# 2. Related Work + +# 2.1. Street Map Modeling and Generation + +City street modeling and generation is an important component of computer-aided urban design. Most classical works rely on procedural modeling methods [1, 2, 37, 5, 9, 12, 13, 28, 30, 38]. One of the more well-known methods is the L-system [30], which generates road networks from a sequence of instructions defined by hand-crafted production rules. To impose more control over the generated results, later works proposed to sample from procedural models according to constraints or likelihood functions [33]. However, these methods are still constrained by the rules, therefore are not flexible in terms of generating maps with different city styles. + +In recent years, deep learning methods have been applied to map reconstruction and encoding. Several works [3, 18, 22, 25] attempted to extract and reconstruct road topologies from overhead images. VectorNet [14] and LaneGCN [23] proposed to efficiently encode roads using graph attention networks and graph convolutions, replacing traditional rendering-based models. Chu et al. propose Neural Turtle Graphics (NTG) [10], a generative model to produce roads iteratively. They use an encoder-decoder RNN model that encodes incoming paths into a node and decodes outgoing nodes and edges. The goal of NTG is to generate city-level road layouts. In comparison, we focus on high definition road and lane generation, which is much more challenging. + +# 2.2. Graph Generative Models + +Our model architecture is inspired by the rapid progress in the area of graph generation spearheaded by seminal works such as graph recurrent neural networks (GRNN) [17], graph generative adversarial networks (GraphGAN) [36], variational graph auto-encoder (VGAE) [19], and graph recurrent attention networks (GRAN) [24]. More recently, Cao et al. proposed MolGAN [11], and Samanta et al. proposed NEVAE [31] to generate small molecule graphs. These methods all focus on generating graph topologies, such as adjacency matrices. In comparison, HD lane maps are graphs that come with spatial coordinates and geometric features, which poses another layer of complexity to the generation problem. + +# 2.3. Geometric Data Generation + +Given the geometric nature of maps, another line of related work is geometric data generation. To generate 2D sketch drawings, Ha et al. proposed SketchRNN [16], an RNN model with a VAE structure to sequentially produce sketch strokes following human drawing sequences. To assemble furniture from primitive parts, GRASS [21] and StructureNet [26] adopted several variations of autoencoding models. More recently, Nash et al. proposed PolyGen [27], an autoregressive transformer model that generates 3D furniture meshes. Compared to human sketches, furniture, and molecules, graphs of lane maps usually consist of more nodes and edges. Instead of treating the whole map as a sequence, our method generates a map with a two-level hierarchy, greatly improving the generation quality. + +# 3. Method + +In Section 3.1, we explore different data representations to generate HD maps and demonstrate the efficiency of using hierarchical graph. In Section 3.2, we introduce our autoregressive graph generative model HDMapGen that uses a hierarchical graph as data representation. + +# 3.1. Data Representation + +To provide detailed road information to the autonomous vehicle, HD maps used in applications such as autonomous driving typically contain many essential components, including lanes, boundaries, crosswalks, traffic lights, stop signs, etc. In this work, we focus on generating lanes, which are a core component of HD maps. A lane is usually represented geometrically by its central line as a curve, and the curve is stored as a polyline with a sufficient amount of control points on it to reconstruct the curvature. Our goal is to generate these control points of central lane lines. Meanwhile, each lane has a unique ID. Its predecessor and successor lane IDs are also provided. Moreover, the lanes also + +![](images/f1e16f320d4c59ca80d7136ccb47b7ffda3ddd670268c37d05939c0f727d2618.jpg) +Figure 2: Different data representations of HD maps. Sequence representation leads to a big diagonal adjacency matrix, and it also suffers from revisiting the intersection points multiple times; plain graph representation results in a big sparse adjacency matrix; our proposed hierarchical graph representation gives a smaller and denser adjacency matrix (of the global graph), which reduces generation difficulty and improves efficiency. + +![](images/47a4ffe87de8b932b1882177a64c825dc707023d421e99283c81ad3f39c3a798.jpg) + +![](images/ee0c91b0dc195c6067eed37673749cd10e9540e1b91763d999263e8c401a287e.jpg) + +have semantic attributes such as whether any traffic light controls it or not. + +For lane map generation, there are various ways to represent the lane objects. We explore three different data representations: a sequence, a plain graph, and a hierarchical graph, as shown in Figure 2. We will later show that the hierarchical graph representation that HDMapGen utilizes is the most efficient and scalable. Moreover, it vastly outperforms other representation methods. + +Sequence. While assuming all lines (lanes in our case) are connected, a straightforward representation is to sort all the lines in a map and treat the entire map as one sequence of points. This approach was adopted by SketchRNN [16]. Each point in the sequence has an offset distance in the $x$ and $y$ direction $(\Delta x, \Delta y)$ from the previous point, and a state variable $q \in \{1, 2, 3\}$ . The state $q = 1$ indicates that the next point is starting a new lane object; the state $q = 2$ identifies the next point to continue in the same lane object, and the state $q = 3$ indicates that the entire map generation has completed. One of the major disadvantages of this method is that there is no perfect way to pre-define a sequential ordering of these points. Secondly, to cover an intersection point of multiple lanes requires revisiting that point more than once. Under this representation, an intersection point will be represented as multiple independent points in the sequence. + +Plain Graph. The second baseline is to use a plain graph to represent a map. This strategy was adopted in recent work on road layout generation NTG [10]. Under this representation, a plain graph contains all control points as nodes and all line connections between control points as edges. Moreover, each node has a node attribute of 2D coordinates $(x,y)$ . The points inside a lane object have a degree of two, while the intersection points have a degree greater than two. This representation solves the revisiting issue of + +sequence generation. However, the method is still inefficient due to a large number of control points to guarantee a high-resolution map. To generate an edge between every pair of control points, it resorts to a very large adjacency matrix. + +Hierarchical Graph (HDMapGen). Here, we propose an efficient and scalable alternative to use a hierarchical graph to represent the map. Under this approach, we first construct a global graph with key points as its nodes. Key points are defined as the endpoints of lanes or the intersection points of multiple lanes. Then the edge of the global graph represents whether a lane exists between two key points. Since key points are a small subset $(30\%)$ of original points, which require a much smaller adjacency matrix. In the second step, we represent each lane's curvatures details with a local graph. Each lane is constructed with a uniquely defined sequence of control points between two key points. Given this fixed topology, we could directly predict the coordinates of the local nodes. Moreover, we also predict a corresponding node mask to allow variations of the number of control points during generation. As demonstrated in Figure 2, using a hierarchical graph has a better performance to preserve the natural hierarchical structure information of the HD map. Moreover, it also enables a smaller size of the adjacency matrix and higher efficiency than using plain graph and sequence. + +# 3.2. Autoregressive Modeling + +Autoregressive modeling has achieved remarkable performance in many generation tasks[15, 27], especially for sequential data such as speech [29] and text [32]. More recently, several studies such as GraphRNN [39] and GRAN [24] also took an autoregressive approach for the graph generation. In this work, we also use autoregressive modeling for HD map generation. + +![](images/41e653efb5c7c66a57d843da44fe4f6f246e4f55849d4da92d64e5ae0cabb9d9.jpg) + +![](images/104fe00393ebf1cfe162ac8e4be9b4d07ea9f3adfa26369b246cbf3c3062d436.jpg) +Figure 3: HDMapGen pipeline. At each step, global graph generator (top) produces a new node with its coordinates and its connections to existing nodes, which is a row and a column in the adjacency matrix; local graph generator (bottom) further decodes coordinates of local nodes between the two connected global nodes. We also demonstrate the global graph and the local graph generated from HDMapGen. + +Our proposed HDMapGen is a two-level hierarchical graph generative model, as shown in Figure 3. Firstly, the global graph generation process outputs a graph with both topological structures represented by adjacency matrix $L$ , and the geometric features represented by nodes' spatial coordinates $C$ . Each node of the global graph is generated autoregressively. In our task, we first model the global graph as an undirected graph and later assign the lane direction information as the sequential order in the local graph. At the current step $t$ , the global graph decoder predicts the $C_t$ of this new node at $t$ and all corresponding edges (lanes) $L_{t,s}$ between previously generated nodes $s$ in a single shot, where $s \in [1,t - 1]$ . Then, it constructs a new row $L_{t}$ and column (due to the symmetry for the undirected graph) of the adjacency matrix $L$ . Then, we apply with a local graph decoder, which outputs the curvature details in each lane object $L_{t,s}$ . The local graph outputs for each global edge $L_{t,s}$ are two sequences with a fixed length $W$ of coordinates $\{(C_j)_{t,s}\}$ and valid mask $\{(M_j)_{t,s}\}$ for each local node $j$ , where $j \in [1,W]$ . The mask defines which node is valid to allow a variation of the number of nodes in each local graph. The local graph decoder is also generating the local graphs for all lane objects $L_{t,s}$ in a single shot, which enables very fast and efficient running. We further add another single-shot semantic attribute decoder to predict semantic features of all generated edges $L_{t,s}$ . We introduce the details of the key components of HDMapGen in the following text. + +Global Graph Generation. To apply autoregressive modeling, we firstly factorize the probability of generating adjacency matrix $L$ and coordinates $C$ of the global graph as + +$$ +P (L, C) = \prod_ {t = 1} ^ {T} P \left(L _ {t}, C _ {t} \mid L _ {1}, C _ {1}, \dots , L _ {t - 1}, C _ {t - 1}\right), +$$ + +where $P(L_{t},C_{t}\mid L_{1},C_{1},\dots ,L_{t - 1},C_{t - 1})$ defines that at the current step $t$ , the conditional probability of generating every new node's attributes $C_t$ and its edges $L_{t}$ with nodes generated from all previous steps 1 to $t - 1$ . + +Furthermore, since the process of generating $L_{t}$ and $C_t$ at each step $t$ are not independent, we explore three variants of global graph decoder to study the performance with different priority of generating $L_{t}$ or $C_t$ . We use coordinate-first to refer to generating node coordinate first and then topology, defined as $P(L_{t},C_{t}) = P(L_{t}\mid C_{t})P(C_{t})$ , as shown in Figure 3. And we use topology-first to refer to first generating graph topology and then generate node coordinates, defined as $P(L_{t},C_{t}) = P(C_{t}\mid L_{t})P(L_{t})$ . Another simplified strategy ignores the dependency between nodes and edges is named as independent, defined as $P(L_{t},C_{t}) = P(C_{t})P(L_{t})$ . More details are in Supplementary. + +Inspired by GRAN [24], which has state-of-the-art performance in sample quality and time efficiency, we also incorporate a recurrent graph attention network for the global graph generation. The graph attention module [35] per + +forms the node state update with the attentive message passing, enabling a better representation of global information. In the model, we firstly define an initial node state $E_{s}^{0}$ before the message passing at each step $t$ as $E_{s}^{0} = W_{L}L_{s} + W_{C}C_{s} + b$ , $s \in [1,t - 1]$ , where $W_{L}, W_{C}$ and $b$ are parameters of the MLP encoders taking topology and geometry inputs. Then for all nodes including new node $t$ and nodes $s$ already generated, we perform multiple runs of message passing. For each run $r$ , the message $m_{i,k}^{r}$ between node $i$ and its neighbor node $k \in \mathcal{N}(i)$ is $m_{i,k}^{r} = f(E_{i}^{r} - E_{k}^{r})$ , where $\mathcal{N}(i)$ are the neighbor nodes of $i$ . And a binary mask is defined as $B_{i} = 0$ to indicate if node $i$ is already generated, or defined as $B_{i} = 1$ if under construction at step $t$ . The node state $E_{i}^{r}$ is further concatenated with this mask $B_{i}$ into $\tilde{E}_{i}^{r} = [E_{i}^{r},B_{i}]$ . And the attention weights $a_{ik}^{r}$ for edge $L_{i,k}$ is defined as $a_{ik}^{r} = Sigmoid(g(\tilde{E}_{i}^{r} - \tilde{E}_{i}^{k}))$ . And the node state update is then calculated as $E_{i}^{r + 1} = GRU(E_{i}^{r},\sum_{k\in \mathcal{N}(i)}a_{ik}^{r}m_{ik}^{r})$ . In this experiment, we use MLPs for both $f$ and $g$ . The GNN model has 7 layers and a propagation number of 1. After the message passing is completed, we take the final node states $E_{t}$ and $E_{s}$ after message passing, and use model $MLP(E_{t} - E_{s})$ to decode them into a mixture of Bernoulli distribution for topology outputs $L_{t}$ . And another model $MLP(E_{t})$ is applied to generate a 2D Gaussian mixture model (GMM) for coordinate outputs $C_t$ . The entire model is optimized with the minimization of negative log-likelihood (NLL) for coordinate outputs and binary cross-entropy (BCE) for topology outputs. And for the GMM, we further add a temperature term $\tau$ to control the diversity (variance) during the sampling. The original standard deviation $\sigma_x$ and $\sigma_y$ in GMM are modified into $\sigma_x\tau$ and $\sigma_y\tau$ . We follow the common teacher-forcing strategy for autoregressive model training by providing ground truth of $L_1,C_1,\dots ,L_{t - 1},C_{t - 1}$ as inputs when predicting $P(L_t,C_t)$ , which avoids performing the reparameterization trick for the sampling process during the backpropagation. + +Local Graph Generation. As the local graph to represent the curvature details of lanes always has a unique topology as a sequence of control points, we use a padding vector with a fixed maximum length $W$ to represent the sequence. We model it as a sequence of coordinate output $\{(C_j)_{t,s}\}$ and a corresponding valid mask $\{(M_j)_{t,s}\}$ , where $j \in [1,W]$ . Then the conditional probability of the local graph during generation is defined as $P(\{(C_j)_{t,s}\}, \{(M_j)_{t,s}\} \mid L_{t,s}, C_t, C_s, E_t, E_s)$ . The valid mask enables a variation in the number of nodes in each graph. For the straight lines which have been filtered with redundant control points after map preprocessing, the valid mask $\{(M_j)_{t,s}\}$ is all 0s, while for the lanes at the corner which usually have multiple control points remained to guarantee the smoothness, $\{(M_j)_{t,s}\}$ is likely to have more values of 1. And we use an MLP model to generate the local graph. The models are op + +timized with the minimization of mean square error (MSE) for coordinate output $\{(C_j)_{t,s}\}$ , and with the minimization of BCE for the valid mask $\{(M_j)_{t,s}\}$ . + +Semantic Attribute Generation. Like the local graph generation, we predict an additional attribute, traffic lights feature for the generated edge. Given a lane $L_{t,s}$ between node $t$ and node $s$ , we predict whether the lane is controlled by traffic lights with an additional edge feature decoder using MLP. We train this edge feature decoder for binary classification with the minimization of BCE. + +# 4. Experiments + +In this section, we demonstrate the efficacy of our proposed HDMapGen model to generate high-quality maps. We explore three autoregressive generative models for sequence, plain graph, and hierarchical graph input representations and evaluate generation quality, diversity, scalability, and efficiency. + +# 4.1. Dataset and Implementation Details + +Datasets. We evaluate the performance of our models on two datasets across three cities in the United States. One is the public Argoverse dataset [7], which covers Miami (total size of 204 kilometers of lanes) and Pittsburg (total size of 86 kilometers). We randomly sample 12000 maps with a field-of-view (FoV) of $200m \times 200m$ as the training dataset for Miami and 5000 maps with the same FoV for Pittsburg. We also evaluate an in-house dataset, which covers maps from the city of San Francisco. We train on 6000 maps with a FoV of $120m \times 120m$ . + +Map Preprocessing. The key components of HD maps, the central line of drivable lanes, are usually over-sampled to guarantee a sufficient resolution. However, graph neural network is limited in scalability. So in a pre-processing step, we remove redundant control points with a small variation of curvature in each lane. This step enables us to remove $70\%$ of points while not compromise the map quality. We then define a hierarchical spatial graph based on the preprocessed vector map. We use Depth-First-Search (DFS) to construct the global graph's adjacency matrix and define the generation order for autoregressive modeling. The start node is randomly selected. Then we define the sequence of control points between global nodes as a local graph. The sequential order is the same as the lane direction. + +Implementation Details. HDMapGen uses graph attention neural network as the core part to perform the attentive message passing for graph inputs. We use multi-layer-perceptrons (MLPs) for all other encoding and decoding steps. The graph node coordinates are normalized to $[-1, 1]$ . The model is trained on a single Tesla V100 GPU with the Adam optimizer, where we use an initial learning rate of 0.0001 with a momentum of 0.9. + +# 4.2. Baselines + +We compare the quality of our hierarchical graph generative model HMapGen with a sequence generative model in SketchRNN [16] and a plain graph generative model PlainGen derived from the global generation step of HMapGen. SketchRNN. We map all control points of the lane objects inside each HD map into a sequence for a sequence generative model. Each sequential data point has a pair of 2D coordinates and a state variable to define each line's continuity. We choose an ascending order of spatial coordinates to define the sequential order. We explore conditional and unconditional variants for this model. For the conditional generation, a target map is provided as both input and target as a variational auto-encoder during training. Meanwhile, a target map is still provided as input during sampling. For an unconditional generation, a decoder-only model is trained to generate the target maps. + +PlainGen. The plain graph generative model has the same implementation as the global graph generative model in HDMapGen, and it takes the entire plain graph as inputs. Every control point in the map is taken as a global node in the plain graph. A corresponding edge is constructed to define whether these two nodes are connected. We use DFS to construct the adjacency matrix and define the order of generation. And we explore two variants of coordinate-first and topology-first for this model. + +# 4.3. Qualitative Analysis + +Global Graph Generation. We first show the global graph from HDMapGen in Figure 4. We could see with only a small set of global nodes could represent a typical pattern in HD maps to include two parallel crossroads. We also demonstrate that the diversity of model outputs could be improved by increasing the temperature $\tau$ . While the diversity and realism trade-off still exist during generation, we find an empirical bound of 0.2 for $\tau$ to guarantee high-quality samples in our experiments. + +Local Graph Generation. The local graph represents a sequence of control points that reveal the curvature details of each lane object. For lanes, the density of control points usually increases at the corner of each lane. In Figure 5, we show our model is capable of generating such features to have smooth curves at the corner of each lane. + +Semantic Attribute Generation. As shown in Figure 5, the traffic lights and the traffic light controlled lanes generated from HDMapGen are mostly located on the crossroads and turn roads. The generated semantic attributes are consistent with the real-world urban scenes. + +Comparison with Baselines. In Figure 6, we show the qualitative comparison between our models and other baselines. The results show that the proposed hierarchical graph generative model HDMapGen (both coordinate-first and + +![](images/c1fd3f972401d5a2599b9d6deef6d7673d883137b84c28dda9cc4874b70615de.jpg) +Figure 4: The diversity of the global graph from HDMapGen is improved as temperature $\tau$ increases, but the realism suffers. + +![](images/af8c51a8566e851518d3e7e3eef1ae31aba1fdfd8758ac816dd8dc48e33c19eb.jpg) +Figure 5: Semantic attributes of traffic lights and local graph of lanes controlled by traffic light generated from HDMapGen. + +topology-first) generate the highest quality maps and vastly outperform other methods. They capture the typical features of HD maps, including patterns like the overall layouts, the crossroads, parallel lanes, etc. Moreover, they are capable of generating maps with different city styles. For the maps generated from HDMapGen with the independent model, the problematic crossing of lanes happens frequently, as the model fails to take the dependence of coordinates and topology into account. For PlainGen, we find the model to completely fail for this task, as it is too challenging to generate a graph with a much large number of nodes and edges in this setting, compared to the hierarchical graph. For SketchRNN, we find the model can learn the overall geometric patterns. However, there are a large number of problematic cut-offs or dead-ends occurring in the generated lanes. This is because, during the sequential data generation, it is possible to stop generating a consecutive point at any step and then re-start at any arbitrary location. This property is not an issue for a sketch drawing task. However, for HD map generation, the model needs to guarantee the continuity constraint between generated points. + +# 4.4.Quantitative Analysis + +# 4.4.1 Metrics + +We design four metrics to quantify the generation results: + +Topology fidelity. We use maximum mean discrepancy (MMD) [17] to quantify the similarity with real maps on graph statistics using Gaussian kernels with the first Wasserstein distance. The topology statistics we apply here is the degree distributions and spectrum of graph Laplacian. + +Geometry fidelity. We use geometry features, the length, and orientation of lanes to quantify the similarity with real + +![](images/1ef3f6d348800a4d0fd71a92daf610107b1b0579d9485b11fe9a4bd64fa7ed62.jpg) +Figure 6: HD Maps with different city styles from hierarchical graph generative models HMapGen (coordinate-first, topology-first and independent) outperform plain graph generative model PlainGen, and sequence generative model sketchRNN. + +maps. Then we compute the Fréchet Distance to measure two normal distributions using these features. + +Urban planning. We use the common urban planning features, connectivity to represent node degree, node density within a region, reach as the number of accessible lane within a region to evaluate the transportation plausibility, and convenience as the Dijkstra shortest path length for node pairs of our generated maps compared with real maps [10]. We also use Fréchet Distance to measure two normal distributions of these features. + +As shown in Table 1, HDMapGen (both coordinate-first and topology-first) outperform the baselines on most of the metrics. The results are consistent with the qualitative analysis: SketchRNN has a poor performance in topology-related features, such as the degree. Since problematic cutoffs or dead-ends of lanes frequently happen in SketchRNN, so the generated maps have a very different distribution of node degrees from real maps. PlainGen has a better perfor + +mance in the spectrum of graph Laplacian. As we evaluate topology features by transforming outputs of all models into the plain graph level, which might preserve the intrinsic topology patterns for outputs from PlainGen. + +Diversity. We use a metric quantified by Chamfer distance to quantify the map-wise diversity of the global graph generated from HDMapGen. As shown in Table 2, we evaluate the diversity on two levels, one is the novelty compared to real map ground truth, the other is the internal diversity among output samples. It shows that results generated with varied temperatures are novel compared with real maps. For internal diversity, we could see the Chamfer distance drastically increases as the temperature becomes larger. + +# 4.5. Ablation Studies + +We further conduct ablation studies on the impact of using different dependence and generation priority on three variants of HDMapGen models coordinate-first, topology- + +
MeasurementUrban PlanningGeometry FidelityTopology Fidelity
MetricsFréchet DistanceMMD
FeaturesConne.Densi.Reach.Conve.Len.Orien.Deg.Spec.
Methods10010110110110-110110-110-1
SketchRNNconditional0.5021.2013.4349.42.041.771.034.94
unconditional0.4441.1229.8349.51.641.220.834.74
PlainGentopology-first0.545.1814.5722.61.851.540.170.31
coordinate-first0.394.304.8112.01.640.460.120.29
HMapGenindependent0.314.384.2211.21.490.520.060.54
topology-first0.264.064.479.91.490.370.050.63
coordinate-first0.174.794.7411.81.490.530.070.90
+ +Table 1: Measurements of urban planning, geometry fidelity and topology fidelity on HDMapGen and baselines PlainGen and SketchRNN. Urban planing (features of connectivity, density, reach and convenience) and Geometry (features of the length and orientation of lanes) are quantified with a Fréchet Distance metric. Topology fidelity (features of node degree and spectrum of graph Laplacian) is quantified with a MMD metric. For all metrics, lower is better. Results are evaluated on Argoverse dataset. + +
Temperature0.10.20.30.40.5
DiversityGT11.611.911.111.613.0
DiversityOutput2.754.835.836.628.34
+ +# first and independence. + +We show the ablation results in Table 3. For coordinate-first model, BCE, which quantifies the topology prediction performance, is the best optimized. As after coordinates are generated as a prior, then the topology prediction could be better optimized. Meanwhile, for topology-first model, NLL, which quantifies the geometry prediction performance, is the best optimized with the generated topology as prior. In contrast, independence model is the worst as it fails to model the dependence of coordinate and topology during generation. + +Table 2: Diversity quantified by Chamfer distance (scaling by $10^{4}$ ) for global graph generated from HDMapGen using different temperatures $\tau$ . Novelty is compared to ground truth or among outputs internally. Results are evaluated on our in-house dataset. + +
Metricscoordinate-firsttopology-firstindependent
NLL-5.610-6.142-4.490
BCE0.0010.0500.053
+ +# 4.6. Scalability Analysis + +We further experiment HDMapGen with a FoV of $400m \times 400m$ . As shown in Figure 7, HDMapGen consistently achieves promising results for large graph generation, demonstrating its scalability. + +# 4.7. Latency Analysis + +We show a latency comparison in Table 4. HMapGen achieves a speed-up of ten-fold compared to SketchRNN. HMapGen is much more efficient due to (1) using a + +![](images/d0d7163ad2039f67a20b3ceeff2c8c54ba42974545c0ab05676e00041b8a98bf.jpg) +Figure 7: The global node generation order (from blue to red) and the scalability of our hierarchical graph generative model HDMapGen to generate HD maps with a FoV of $400m \times 400m$ . + +smaller number of nodes to represent a global graph, and (2) utilizing GRAN with state-of-the-art time-efficiency for global graph generation and a single-shot decoder for the local graph generation. + +Table 3: Negative Log likelihood (NLL) and binary cross-entropy (BCE) on the generated global graph from three variants of HDMapGen including coordinate-first, topology-first and independent. Results are evaluated on Argoverse dataset. + +
ModelHMapGenPlainGenSketchRNN
Time [s]0.200.892.28
+ +Table 4: The generation time of an HD map with a FoV of $200m \times 200m$ on Argoverse dataset using HDMapGen, PlainGen, and SketchRNN. HDMapGen is clearly the fastest. + +# 5. Conclusion + +In this work, we introduce a novel and challenging task to generate HD maps in a data-driven way. We performed a systematic exploration for autoregressive generative models with different data representations. Our proposed hierarchical graph generative model HDMapGen largely outperforms other baselines. We further demonstrated the advantages of HDMapGen in generation quality, diversity, scalability, and efficiency on real-world datasets. + +# 6. Acknowledgement + +We would thank Benjamin Sapp and Tianxing He for insightful comments and suggestions. + +# References + +[1] Esri: Cityengine. https://www.esri.com/en-us/arcgis/products/esri-cityengine. +[2] Daniel G Aliaga, Carlos A Vanegas, and Bedrich Benes. Interactive example-based urban layout synthesis. In SIGGRAPH Asia, 2008. +[3] Favyen Bastani, Songtao He, Sofiane Abbar, Mohammad Al-izadeh, Hari Balakrishnan, Sanjay Chawla, Sam Madden, and David DeWitt. Roadtracer: Automatic extraction of road networks from aerial images. In CVPR, 2018. +[4] Sven Bauer, Yasamin Alkhorshid, and Gerd Wanielik. Using high-definition maps for precise urban vehicle localization. In 2016 IEEE 19th International Conference on Intelligent Transportation Systems (ITSC), pages 492-497. IEEE, 2016. +[5] Jan Benes, Alexander Wilkie, and Jaroslav Krivánek. Procedural modelling of urban road networks. Computer Graphics Forum, 2014. +[6] Yuning Chai, Benjamin Sapp, Mayank Bansal, and Dragomir Anguelov. Multipath: Multiple probabilistic anchor trajectory hypotheses for behavior prediction. In CoRL, 2019. +[7] Ming-Fang Chang, John Lambert, Patsorn Sangkloy, Jagjeet Singh, Slawomir Bak, Andrew Hartnett, De Wang, Peter Carr, Simon Lucey, Deva Ramanan, et al. Argoverse: 3d tracking and forecasting with rich maps. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8748-8757, 2019. +[8] Anning Chen, Arvind Ramanandan, and Jay A Farrell. High-precision lane-level road map building for vehicle navigation. In IEEE/ION position, location and navigation symposium, pages 1035–1042. IEEE, 2010. +[9] Guoning Chen, Gregory Esch, Peter Wonka, Pascal Müller, and Eugene Zhang. Interactive procedural street modeling. TOG, 2008. +[10] Hang Chu, Daiqing Li, David Acuna, Amlan Kar, Maria Shugrina, Xinkai Wei, Ming-Yu Liu, Antonio Torralba, and Sanja Fidler. Neural turtle graphics for modeling city road layouts. In Proceedings of the IEEE International Conference on Computer Vision, pages 4522-4530, 2019. +[11] Nicola De Cao and Thomas Kipf. Molgan: An implicit generative model for small molecular graphs. arXiv preprint arXiv:1805.11973, 2018. +[12] Arnaud Emilien, Ulysse Vimont, Marie-Paule Cani, Pierre Poulin, and Bedrich Benes. Worldbrush - interactive example-based synthesis of procedural virtual worlds. TOG, 2015. +[13] Eric Galin, Adrien Peytavie, Éric Guérin, and Bedrich Benes. Authoring hierarchical road networks. Computer Graphics Forum, 2011. +[14] Jiyang Gao, Chen Sun, Hang Zhao, Yi Shen, Dragomir Anguelov, Congcong Li, and Cordelia Schmid. Vectornet: Encoding hd maps and agent dynamics from vectorized representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11525-11533, 2020. +[15] Karol Gregor, Ivo Danihelka, Andriy Mnih, Charles Blundell, and Daan Wierstra. Deep autoregressive networks. + +In International Conference on Machine Learning, pages 1242-1250. PMLR, 2014. +[16] David Ha and Douglas Eck. A neural representation of sketch drawings. arXiv preprint arXiv:1704.03477, 2017. +[17] Ehsan Hajiramezanali, Arman Hasanzadeh, Krishna Narayanan, Nick Duffield, Mingyuan Zhou, and Xiaoning Qian. Variational graph recurrent neural networks. In Advances in neural information processing systems, pages 10701-10711, 2019. +[18] Namdar Homayounfar, Wei-Chiu Ma, Justin Liang, Xinyu Wu, Jack Fan, and Raquel Urtasun. Dagmapper: Learning to map by discovering lane topology. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. +[19] Thomas N Kipf and Max Welling. Variational graph autoencoders. arXiv preprint arXiv:1611.07308, 2016. +[20] Steven M LaValle. Rapidly-exploring random trees: A new tool for path planning. 1998. +[21] Jun Li, Kai Xu, Siddhartha Chaudhuri, Ersin Yumer, Hao Zhang, and Leonidas Guibas. Grass: Generative recursive autoencoders for shape structures. ACM Transactions on Graphics (TOG), 36(4):1-14, 2017. +[22] Zuoyue Li, Jan Dirk Wegner, and Aurélien Lucchi. Polymapper: Extracting city maps using polygons. arXiv:1812.01497, 2018. +[23] Ming Liang, Bin Yang, Rui Hu, Yun Chen, Renjie Liao, Song Feng, and Raquel Urtasun. Learning lane graph representations for motion forecasting. arXiv preprint arXiv:2007.13732, 2020. +[24] Renjie Liao, Yujia Li, Yang Song, Shenlong Wang, Will Hamilton, David K Duvenaud, Raquel Urtasun, and Richard Zemel. Efficient graph generation with graph recurrent attention networks. In Advances in Neural Information Processing Systems, pages 4255-4265, 2019. +[25] Gellert Mattyus, Wenjie Luo, and Raquel Urtasun. Deeproadmapper: Extracting road topology from aerial images. In ICCV, 2017. +[26] Kaichun Mo, Paul Guerrero, Li Yi, Hao Su, Peter Wonka, Niloy Mitra, and Leonidas J Guibas. Structurenet: Hierarchical graph networks for 3d shape generation. arXiv preprint arXiv:1908.00575, 2019. +[27] Charlie Nash, Yaroslav Ganin, SM Eslami, and Peter W Battaglia. Polymer: An autoregressive generative model of 3d meshes. arXiv preprint arXiv:2002.10880, 2020. +[28] G Nishida, I Garcia-Dorado, and D G Aliaga. Example-driven procedural urban roads. Computer Graphics Forum, 2015. +[29] Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016. +[30] Yoav IH Parish and Pascal Müller. Procedural modeling of cities. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pages 301-308, 2001. + +[31] Bidisha Samanta, Abir De, Gourhari Jana, Vicenç Gómez, Pratim Chattaraj, Niloy Ganguly, and Manuel Gomez-Rodriguez. Nevae: A deep generative model for molecular graphs. Journal of Machine Learning Research, 21(114):1-33, 2020. +[32] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104-3112, 2014. +[33] Jerry O Talton, Yu Lou, Steve Lesser, Jared Duke, Radomír Mech, and Vladlen Koltun. Metropolis procedural modeling. TOG, 2011. +[34] Sebastian Thrun. Simultaneous localization and mapping. In Robotics and cognitive approaches to spatial mapping, pages 13-41. Springer, 2007. +[35] Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. +[36] Hongwei Wang, Jia Wang, Jialin Wang, Miao Zhao, Weinan Zhang, Fuzheng Zhang, Xing Xie, and Minyi Guo. Graph-ian: Graph representation learning with generative adversarial nets. arXiv preprint arXiv:1711.08267, 2017. +[37] Benjamin Watson, Pascal Müller, Oleg Veryovka, Andy Fuller, Peter Wonka, and Chris Sexton. Procedural urban modeling in practice. IEEE Computer Graphics and Applications, 28(3):18-26, 2008. +[38] Yong-Liang Yang, Jun Wang, Etienne Vouga, and Peter Wonka. Urban pattern: Layout design by hierarchical domain splitting. ACM Transactions on Graphics (TOG), 32(6):1-12, 2013. +[39] Jiaxuan You, Rex Ying, Xiang Ren, William Hamilton, and Jure Leskovec. Graphrn: Generating realistic graphs with deep auto-regressive models. In ICML, 2018. +[40] Hang Zhao, Jiyang Gao, Tian Lan, Chen Sun, Benjamin Sapp, Balakrishnan Varadarajan, Yue Shen, Yi Shen, Yuning Chai, Cordelia Schmid, et al. Tnt: Target-driven trajectory prediction. arXiv preprint arXiv:2008.08294, 2020. \ No newline at end of file diff --git a/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/images.zip b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..80991251acebf2897c5afea92fda8d906c870a8f --- /dev/null +++ b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7196dd2b4307221fc9bae314503c6645a6622f707bde880dcfea0ed74558754a +size 454680 diff --git a/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/layout.json b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..279857da6f3e09f3752f35ccd5eeae920dda3af1 --- /dev/null +++ b/hdmapgenahierarchicalgraphgenerativemodelofhighdefinitionmaps/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e03f1ff546430ac979b8178ccde43ff3b68025e4d74e96ae0fa3c4bc413dfb34 +size 361038 diff --git a/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_content_list.json b/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d856fee875881512f3e3deed4a9cba21a37ce0cb --- /dev/null +++ b/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:640e490ee6f8373dc9edaa4126ea8db8f6ac9432f1865d3fc0201502fc74b594 +size 67375 diff --git a/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_model.json b/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d89a61ef0a3864d2c90f5dc98024c21b32d18f8a --- /dev/null +++ b/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4cf91d7d00ed08bfddb9a9df8f6a439b57468c5e52336a9ebcd1669afcc04ef +size 81293 diff --git a/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_origin.pdf b/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4a627e9dce728bcb81e6341d2c4f3e1cd78b8373 --- /dev/null +++ b/hdrenvironmentmapestimationforrealtimeaugmentedreality/9e630f2a-b029-47d2-aed8-a599815b525d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbbf561b79d9129b75ab31b1d3fbc56ae1e1a59b67dd34e0f1232ba676c6c6ac +size 4274417 diff --git a/hdrenvironmentmapestimationforrealtimeaugmentedreality/full.md b/hdrenvironmentmapestimationforrealtimeaugmentedreality/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9c1caa02703c686e857d8da79c6d57f3e07bb62c --- /dev/null +++ b/hdrenvironmentmapestimationforrealtimeaugmentedreality/full.md @@ -0,0 +1,254 @@ +# HDR Environment Map Estimation for Real-Time Augmented Reality + +Gowri Somanath Apple + +gowri@apple.com + +Daniel Kurz + +Apple + +daniel_kurz@apple.com + +# Abstract + +We present a method to estimate an HDR environment map from a narrow field-of-view LDR camera image in real-time. This enables perceptually appealing reflections and shading on virtual objects of any material finish, from mirror to diffuse, rendered into a real environment using augmented reality. Our method is based on our efficient convolutional neural network, EnvMapNet, trained end-to-end with two novel losses, ProjectionLoss for the generated image, and ClusterLoss for adversarial training. Through qualitative and quantitative comparison to state-of-the-art methods, we demonstrate that our algorithm reduces the directional error of estimated light sources by more than $50\%$ , and achieves 3.7 times lower Frechet Inception Distance (FID). We further showcase a mobile application that is able to run our neural network model in under 9 ms on an iPhone XS, and render in real-time, visually coherent virtual objects in previously unseen real-world environments. + +# 1. Introduction + +In this work, we discuss video see-through augmented reality (AR) applications, in which virtual objects are superimposed on camera frames of the real environment shown on an opaque display, e.g. on a phone as shown in Fig. 1(e). Creating immersive and believable AR experiences involves many aspects of computer vision and graphics. One of the requirements is visual coherence: the problem of matching visual appearance of rendered objects to their real-world background, such that virtual and real objects become indistinguishable in the composited video. Accomplishing this involves matching various scene and camera properties, such as lighting, geometry, and sensor noise. + +This paper focuseses on creating reflections and lighting for virtual objects by estimating an omnidirectional HDR environment map. To support rendering objects with a variety of geometry, material properties, and dimensions, the environment map must be high dynamic range, and have sufficient image resolution to represent objects and features in the scene. We use the equirectangular projection and + +RGB color space for the environment maps. As shown in Fig. 1(a), the challenge in mobile AR is limited camera field of view (FoV) and motion by the user, hence an application is usually able to accumulate less than 100 degrees effective FoV. A virtual object placed in front of the user, however, is expected to reflect what is behind the camera, and parts which are not present in the captured frames. The problem is thus to estimate, given this incomplete environment map, a plausible estimation for rest of the scene and its lighting. We show that our method is not only able to estimate the light information, but also to synthesize a high resolution completed scene. For instance in the scene shown in Fig. 1(b), the estimated environment map is high resolution, continuous, and a plausible extrapolation of the input. The synthesized parts not only match low frequency information (ambient light temperature and intensity), but also finer details such as the type of light sources (in this case, ceiling area lights). As detailed in Sec. 3, we achieve this context-aware scene completion using the framework of generative adversarial networks (GANs) [12] along with novel loss functions, ProjectionLoss and ClusterLoss, designed for accurate light estimation. + +In mobile AR frameworks [1, 2], we can obtain camera frames, poses and scene geometry, around the 3D location where the virtual object is to be placed. This allows a real-time renderer to create light probes [27] at the 3D location. RGB texture information from the frames can be rendered into an equirectangular image at these probe locations. In this work, we focus on processing the partial environment map at these probes. Our method takes as input a partial environment map that is composed from one or more low dynamic range (LDR) camera frames (8 bit per channel), and outputs a completed environment map that is higher dynamic range (HDR, 16 bit channel). Thus we perform both lifting of input pixels from LDR to HDR, as well as spatial HDR image extrapolation. The output environment map retains the color and details from pixels that were in the input, while filling the unknown pixels with plausible content that is coherent with the known. That is, we want the completed environment map to represent the textures from a plausible real scene. Through detailed quantitative and + +![](images/80e4c280a24dc1ee37218b656e77e4efae908c26530cd7c156675d66d5b1f38a.jpg) +Figure 1. Given a partial LDR environment map from a camera image (a), we estimate a visually coherent and completed HDR map that can be used by graphics engines to create light probes. These enable rendering virtual objects with any material finish into the real environment in a perceptually pleasing and realistic way (b), more similar to ground truth (c) than state-of-the-art methods (d). Our mobile app renders a virtual teapot using our estimated environment map in real-time (e). See supplementary material for videos. + +qualitative comparisons, we demonstrate that our method surpasses the current state-of-the-art to estimate high quality, perceptually plausible, and accurate HDR environment maps. We reduce the directional (angular) error for lights by more than half, and achieve a significantly lower Frechet Inception Distance (FID). + +Related works estimate a subset of the properties, such as lighting direction, color, and intensity using low resolution images [11, 9, 17], parametric lights [15, 9], or LDR environment maps [25]. Methods that estimate both light and texture [10, 17, 23] lack resolution and detail in the estimated environment map. In contrast, our solution provides sufficient details in the image for virtual objects of any material finish including reflective mirrors. To create plausible scene completions, we take inspiration from work in the area GANs for image synthesis. However, most success for GANs has come for datasets with single objects (e.g. faces [16]), using conditional labels [21], or self-supervision [5]. Its direct use for panoramic images of indoor scenes, small datasets with high appearance variation, and ambiguity in semantic labeling, is challenging. We present ClusterLoss, a novel training loss for the discriminator, that allows us to create realistic images with a dataset of only $\sim 2,800$ training images. + +We also observe that each of the previous methods have a different evaluation scheme, are based on respective representations and/or involve subjective user studies. Though subjective plausibility is important for user experience, it makes benchmarking difficult. We present metrics that can be used to quantitatively compare both the lighting and reflection quality of environment maps. + +In summary, we make the following core contributions: + +- We present a method to generate an HDR environment map suitable for both reflections and lighting from a small FoV LDR image or partial environment map. To our knowledge, ours is the first to achieve this for real-time AR applications (under 9ms on iPhone XS). +- We present two novel contributions to the training pipeline in the form of ProjectionLoss for the environment map, and ClusterLoss in the adversarial training. This allows us to reduce the directional error by more than $50\%$ compared to current methods, while achieving 3.7 times lower FID. +- We establish metrics that allow easy quantitative comparisons with related work, and thus provide a systematic benchmark for this emerging area in AR. + +# 2. Related work + +A classical technique to obtain an HDR environment map is to merge images of a mirror sphere in the scene captured under multiple exposure brackets [7]. This can be applied for offline use cases but is unsuitable for real-time mobile AR in arbitrary and novel environments. Some previous works have used additional cues about an object [20, 26], scene geometry [3, 19, 30], or special cases such as sun position estimation [31, 15, 14]. For brevity, we only discuss works that focus on light estimation from small FoV images of general scenes. In this context, works can be divided into two categories: those that focus on light estimation with low dimensional parameters, and those which estimate both lighting and environment maps. + +Garon et al. [11] use spherical harmonics representation for light and depth estimated using the SUNCG dataset $[24]^1$ . Cheng et al. [6] also predict 48 spherical harmonics coefficients from two images captured by the front and rear cameras of a mobile device. Gardner et al. use parametric lights as representation [9]. The parameters are derived using peak finding, region growing, and ellipse fitting on intensity images. Even though use of parametric lights reduces the decoder size, the authors use L2 loss by converting the parameters to an equirectangular image. It is not clear how to extend this method to generate higher quality texture in the environment map that would be consistent with the regressed parameters. We thus choose to have an end-to-end network that directly estimates the HDR environment map. We use the same parametric lights to create quantitative metrics for benchmarking. + +Gardner et al. use equirectangular representation [10] by dividing the task into light position estimation (trained with LDR panoramas), and HDR intensity estimation (trained with Laval HDR Images dataset). This is the work most similar to our method in input-output, representation, and formulation. In contrast to their method, we have a single stage training from an LDR small FoV image to a completed HDR environment map, and using our proposed adversarial training we are able to generate more realistic RGB scene completion for use on reflective virtual objects. Some recent works, like ours, employ an adversarial loss to generate a completed environment map [23, 25] or sphere images [17]. LeGendre et al. captured a special dataset with three spheres of mirror, matte, and diffuse gray finish [17]. They train a network to regress from a camera image to three small $(32 \times 32$ pixel) images representing the sphere segments. This precludes use of the results for high quality reflections. Also, due to the low resolution, the estimate covers mostly the portion of the scene behind the camera. It is useful to render a given frame, but as the camera commonly moves with respect to the virtual object in a AR application, a new estimate has to be inferred frequently. Thus even with the assumption of a static scene, their method would suffer from temporal flickering due to multiple independent estimates. + +Song et al. use a multi-stage ensemble that estimates geometry, LDR completion and HDR illumination [23]. Our method uses a single model, and we do not require depth map per HDR image for training. This makes our method efficient to train and use in real-time mobile AR. The authors do not specify the resolution of the panoramic images, but visual observation shows lack of resolution and artifacts due to the projection from noisy 3D reconstructions. Srinivasan et al. use an input stereo pair to generate the output environment map [25]. They use the LDR images from the synthetically generated InteriorNet dataset [18] to train the + +light estimation, by application of inverse gamma on the tone mapped images. This limits the ability to learn realistic high dynamic range and accurate lighting, as also indicated by their results on mostly specular objects. In contrast, our method does not require stereo input, and estimates an HDR environment map that can be applied for lighting objects with wide range of materials from diffuse to mirror. + +Furthermore, we employ only 2,100 HDR images of the publicly available Laval HDR Images dataset of real environments, a much smaller dataset than the 4.06 million non-public specialized sphere images used in [17], the withdrawn SUNCG used in [24], or the $200,000+$ Matterport images in [23]. The lack of shared code, model weights and use of private datasets make it difficult to make comparisons to these recent methods, that also compare to [10] as we do in our quantitative evaluations. However, we present qualitative comparisons to these works in Sec. 5. + +With the exception of [17], that outputs a $32 \times 32$ low resolution sphere image, no other method has been demonstrated on mobile devices. To the best of our knowledge, we are the first to demonstrate real-time on-device generation of environment maps of high resolution and image quality. + +# 3. Proposed method + +Creating a light probe in a mobile AR application involves two broad stages: first to select a 3D point as center of this probe and project known scene information to an equirectangular environment map with the selected point as camera center; and second to process the partial equirectangular to output a completed HDR environment map. The first requires color and scene geometry knowledge or assumption for projection. In our work, we assume without loss of generality that platform and application-dependent processing can be used for this projection, and obtain the incomplete environment map from the probe center. Using the mobile device pose also helps to ensure that the environment maps are upright or gravity aligned. That is, the floor always appears at the bottom and the ceiling on top. Our focus in this paper is on completion, and LDR to HDR lifting of this incomplete environment map as shown in Fig. 2. + +We use the equirectangular representation $(128\times 256$ pixels) and create a four channel input (RGB-mask). Known pixel intensities are normalized to $[-1.0,1.0]$ , while the unknown pixels are populated with random noise from a uniform distribution $U(-1.0,1.0)$ . The fourth channel is a binary mask with known pixels set to 0. This is input into our network, EnvMapNet, that outputs an HDR RGB image in log scale. The log image is converted to linear values, optionally decomposed into analytical lights, and provided to the renderer. We train our network end-to-end with image-based and adversarial losses, which allows us to handle both the generative aspect for reflection completion as well as light estimation from partial environment map. + +![](images/67d3b2d94f920f9f22700d8f751488966da780d0190a86fe830e7097480764a9.jpg) +Figure 2. Overview of our method: We propose EnvMapNet that estimates completed HDR environment maps from partial input. We train the network end-to-end in an adversarial setup. An offline one-time clustering of the training images is used to provide a supervised classification task for our novel ClusterLoss in the discriminator. The additional adversarial loss, along with our proposed ProjectionLoss, allows our method to generate high quality environment maps for reflection and accurate shading of virtual objects. + +# 3.1. Dataset and processing + +In this work we use two datasets: Laval Indoor HDR dataset [10] and PanoContext LDR panoramicas [32]. We use the author's test split $[10]^2$ for HDR images, resulting in a total of 2,810 training images. The different sources and scenes have large intensity variations and hence are unsuitable for training as-is. We thus employ a log scale on exposure-normalized HDR linear images for the network. The LDR PanoContext images are only used to train the discriminator. For a given linear HDR ground truth image $G_{lin}$ , we compute the training ground truth $G$ as: + +$$ +G = \min (\max (0, \log_ {1 0} (G _ {\text {l i n}} \cdot \alpha + 1)), 2) - 1, \tag {1} +$$ + +We empirically choose $\alpha = 0.2\cdot \overline{G_{lin}}$ to match the middle gray values. The clipping of intensities corresponds to our use of tanh activation for our network, and results in dynamic range of [0, 100] for output linear RGB, given the input LDR images in [0, 1] range. + +# 3.2. Model architecture + +Our model, EnvMapNet, consists of an encoder and decoder with skip connections as shown in Fig. 2. Each is composed of building blocks detailed in Appendix 3. The encoder is composed of five sets of EnvMapNet-conv-block and EnvMapNet-downsample-blocks. The resulting latent vector is convolved with a $1 \times 1$ kernel to output 64 filters. The decoder mirrors the encoder by using EnvMapNet-conv-block and EnvMapNet-upsample-blocks. The final output is produced by a $3 \times 3$ convolution to produce 3 channels for RGB, followed by a tanh activation. + +# 3.3. Image-based losses and ProjectionLoss + +We use a weighted combination of image-based and adversarial losses to train our model end-to-end. We want to + +retain the color for pixels from the known (input) region while hallucinating the rest with a plausible scene completion (typically extrapolation). Guided by the binary mask in the input, we compute an $L1$ loss between the known pixels in the input and corresponding predicted colors. For the completed output, we apply a multi-scale $L2$ loss. This allows the model to coarsely regress the light direction and color, however it does not allow for generation of sharp features for the estimated light sources (as seen in Fig. 1(b) and Fig. 2). To obtain a high contrast HDR result that generates correct shadows $L2$ loss is not sufficient. An ideal solution would be to use a ray tracer to render shadows and penalize the difference between the rendered images using ground truth and predicted maps. This is non-trivial and expensive for end-to-end training. + +Considering only shadow casting, the intensity of a pixel in the shadow is dependent on the integral of the environment map except directions blocked by the object. Thus, any pixel on the shadow plane can be approximated by the integral over the masked environment map. We take inspiration from our intuition above, and Wasserstein distance, and introduce our novel ProjectionLoss. We select a set of randomized binary masks $P$ having the same size as our environment map, and create a one-dimensional vector of length $|P|$ (the number of images in the set) by integrating the pixel intensities in corresponding masked images. On a 0-valued background, the masks contain polygons generated with randomization whose height and width range from $10\%$ to $40\%$ of the corresponding image dimensions and filled with value of 1. For further illustration of ProjectionLoss, and examples of the masks used, see Appendix 4 in supplementary materials. The final loss, termed ProjectionLoss, is the $L1$ distance between the vectors corresponding to predicted and ground truth environment maps. We show this error using $|P| = 50$ projection masks in Fig. 3(a) for each environment map shown in row (c), with the first + +
(a) ProjectionLoss0.370.250.353.130.630.43
(b) AngularError21.422.924.2103.9107.2109.86
(c)
(d)
ReferenceExample 1Example 2Example 3Example 4Example 5Example 6
+ +Figure 3. Representative results for metrics and losses correlated to directional error of estimated lights. Row (a): Proposed projection loss on the environment maps w.r.t Reference (see Sec. 3.3). Row (b): Angular errors in degrees, using parametric lights for each environment map w.r.t Reference (see Sec. 4). Row (c): Environment maps with extracted parametric lights shown as red ellipses. Row (d): Rendering of a rough metallic sphere using the corresponding environment map and viewed from top. + +image being the reference. In Fig. 3(d) we show rendered spheres using the corresponding environment maps. We can see that lower values of ProjectionLoss correlate with both lower angular error and better visual match of lighting direction to the reference. This is also supported in our ablation study results in Sec. 5.2. + +For a ground truth HDR image $G$ , a mask indicating unknown pixels $M$ , a predicted image $I$ , and a set of projection masks $P$ , the final image-based loss is defined as: + +$$ +L o s s _ {p r o j e c t i o n} = | \forall_ {P _ {i} \in P} (\sum (I * P _ {i}) - \sum (G * P _ {i})) | _ {1} +$$ + +$$ +\begin{array}{l} L o s s _ {i m a g e} = w _ {1} | I * M - G * M | _ {1} + w _ {2} | | I - G | | _ {2} \\ + L o s s _ {p r o j e c t i o n} \tag {2} \\ \end{array} +$$ + +ProjectionLoss is related to diffuse convolution or cosine loss used in previous works [10, 23]. While filtered, or down sampled integral can represent diffuse or low frequency lighting information, we find that our formulation is able to capture high frequency lighting better. To further understand the value of ProjectionLoss for lighting estimation, and to compare with other measures, such as SSIM [33] and Mean Squared Error (MSE), we performed a detailed experiment with user study as described in Appendix 4. We first confirmed that SSIM on rendered images is a good baseline for retrieval of images with similar lighting on objects. We then correlated retrieval of similar environment maps using ProjectionLoss, SSIM and MSE. Quantitatively, we found the intersection of top-5 retrievals by SSIM (on the rendered images) and those using ProjectionLoss (on the environment map) to be $1.6 \pm 0.7$ , while it was $0.6 \pm 0.5$ using MSE (on the environment map). Based on the above we believe that our proposed ProjectionLoss effectively trains the model for light estimation, such that the end result for rendering is accurate with respect to ground truth. We also show that MSE on the environment map is insufficient for training accurate light estimation. Its use as a metric of comparison, as done in previous works, would not correlate well with the final application. + +# 3.4. Adversarial loss and ClusterLoss + +To generate perceptually pleasing completions to the scene, we train the model using a GAN loss. Adversarial training was proposed in [12], where a discriminator was trained to classify samples from the training set as "real" and those produced by a generator as "fake". The generator has a loss component for classification of generated samples as "real". The networks are trained using alternate weight update schedule. Since their advent, there have been many improvements on GANs for training stability and result quality. As discussed previously, many of these have focused on single objects such as faces [16] or increased stability using large datasets or architectures [4]. However, we found that training a mobile-friendly GAN architecture with fewer than 3,000 images with high appearance variation resulted in mode collapse or non-convergence. + +It has been shown that providing an additional task to the discriminator using conditional labels or self-supervision can increase stability [21]. Assigning semantic labels (e.g., room types) is non-trivial for panoramic images since the viewpoint could be from between two rooms. Recent work using self-supervision with rotation prediction [5] has been promising. However, for equirectangular images the possible rotations would be flips along the image axis, of which that along the vertical image axis is valid for a scene. + +We thus propose a novel scheme combining the learnings from above methods. We begin with the recognition that our application needs to generate "plausibly similar looking images" as the training set, hence the idea to use appearance features to form a secondary task. We use traditional image patch features (mean color and ORB [22]) and assign a K-means-derived cluster ID to each image (we used $K = 5$ ). Along with the typical real vs. fake classification, the discriminator is supervised to classify the K-means assigned cluster ID for each real image with the proposed ClusterLoss. This allows us to train without additional heuristics or tricks, and avoid mode collapse, as the encoded latents + +are forced to spread out over the appearance clusters. Intuitively it also helps the discriminator focus on a low ambiguity appearance-based task that pays attention to spatial locations and details, thus avoiding cases where a single patch artifact can easily clue the discriminator that the image is fake ("easy wins"). The discriminator is composed of residual blocks as detailed in Appendix 3. We use softmax cross entropy loss for the adversarial training of our model and discriminator $D$ . With $y, p$ indicating the ground truth and predicted one-hot encoded vectors for the cluster classification respectively, our adversarial losses are: + +$$ +L o s s _ {c l u s t e r} = \sum_ {k = 1} ^ {5} y _ {o, k} \log \left(p _ {o, k}\right) \tag {3} +$$ + +$$ +L o s s _ {f a k e r e a l} = \log (D (G)) + \log (1 - D (I)) +$$ + +$$ +L o s s _ {a d v e r s a r i a l} = - \log (D (I)) +$$ + +# 3.5. Implementation and adversarial training + +During training we mask the ground truth images using randomly generated polygonal regions, and provide them as corresponding incomplete input environment map. The regions are of irregular shape and can be non-contiguous to generalize our model to complete any partial input. For input, we tonemap the ground truth HDR environment map by dividing the pixels by the average intensity (exposure compensation), applying a gamma with value of 2.2, and final normalization and clipping of the intensity to $[-1.0, 1.0]$ . The color channels in the unknown pixels are filled with numbers from uniform random distribution in $[-1.0, 1.0]$ range. We use the logarithmic transform from Sec. 3.1 for the ground truth used in evaluation of losses. The components of $Loss_{image}$ are weighted using $w_1 = 0.5$ , $w_2 = 0.01$ . For all image-based losses, we also weight the pixels to compensate for the subtended angle on the sphere. + +$$ +L o s s _ {E n v M a p N e t} = L o s s _ {i m a g e} + +$$ + +$$ +L o s s _ {a d v e r s a r i a l} + L o s s _ {c l u s t e r} \tag {4} +$$ + +$$ +L o s s _ {d i s c r i m i n a t o r} = L o s s _ {f a k e r e a l} + L o s s _ {c l u s t e r} +$$ + +We train the networks by minimizing $Loss_{EnvMapNet}$ and $Loss_{discriminator}$ respectively. We use the Adam optimizer, a batch size of 16, and the learning rate starting at 0.0002, and decayed by half every 50 epochs after the first 100 epochs. We alternate between training the discriminator and EnvMapNet after each mini-batch. + +# 4. Metrics for benchmarking + +Visual coherence in AR aims to give a user the illusion that an inserted virtual object belongs in the real scene. However algorithm development, especially in the domain of deep learning, involves many heuristics and parameter tuning. We therefore believe that establishing quantitative metrics, separate from loss functions, that correlate with the + +target application setting, is important to easily compare different methods. Several previous methods have used MSE on environment maps in RGB, intensity or log formulation as a metric. However, as discussed in Sec. 3.3, it is not well suited to measure accuracy such that the final rendering matches ground truth. + +At the core of it we want to solve for two aspects of the environment map: lighting accuracy and perceptual plausibility. Real-time mobile renderers use analytical (point) lights to cast shadows. Hence lighting accuracy is correlated to direction of top-n dominant light sources. Since we cannot (and should not) generate the exact unseen test room for reflection, measures such as MSE or SSIM [33, 29] for one-to-one image comparisons are unsuitable. Instead we need to use plausibility of the hallucinated scene as a metric. We start with a discussion on lighting accuracy metrics followed by quantitative measures for perceptual quality. Our goal is to define metrics that can be used by any future work to objectively compare techniques. Thus we establish a repeatable benchmark that uses the publicly available Laval HDR dataset [10], and reference implementations of the metrics that we will provide. + +Methods that can extract light sources from environment maps include median cut [8], variance minimization [28], and parametric fitting from peak finding [9]. In the case of mobile AR, real-time renderers need fast decomposition techniques, hence we use the latter method to find centers and extent of light sources. The angular coordinates of the ellipse center are used to measure the directional accuracy with respect to ground truth. For a given HDR environment map, we iteratively find a seed pixel with maximum intensity, and grow the region connected to the seed till we reach $30\%$ of the peak value. This is repeated until the peak value found is less than $90\%$ of the largest. For each such region, we fit an ellipse covering its convex hull. Example images with parametric light fitting are shown in Fig. 3(c). + +To measure the AngularError between the ground truth and estimated environment maps, we extract (at most) five parametric lights from each. For each ground truth light we find the minimal angular error to the predicted light set, and vice-versa. We take the mean over the errors from both ground truth lights and predicted lights, as the final AngularError between the two environment maps. Fig. 3 demonstrates the correlation of the AngularError metric, with examples of low and high errors with respect to a selected reference. We can see that environment maps with lower errors produce similar lighting directions on the reference sphere, compared to those with higher errors, thus making it a suitable metric for comparison. + +To measure perceptual plausibility, user studies are commonly used for their insight into final experience quality. However, user studies are hard to repeat or compare across publications. We take inspiration from work in GANs, that + +![](images/69bbb7f49e96bda23958d6577e08d36c32e0870092984386daea0ccf6d052df7.jpg) +(a) + +![](images/6bd2fb7ee704117c4109f962983aee3f283eaf25d5a373b64dc2d1723a2738b4.jpg) +(c) +Figure 4. Snapshots from our real-time mobile app. (a) A real and virtual rendering of same object, we can see that the lighting direction and color matches closely. (b) Lighting on the virtual mirror finish sphere is coherent with other real objects in the scene and the reflection formed is also a plausible completion to the scene. (c) A virtual lamp on the table, with its top specular highlight matching the direction on the glass object on the lower right. (d)-(e) Virtual metallic spheres with different roughness. See videos in supplementary material. + +![](images/6dff2925567f41781cf1f01e8c3edde9f01feaecd38ad44a17a65f26c88e62c3.jpg) +(d) + +![](images/3a89803c2c1a920c7e3615c55fa92fbb548d8622fce3895b9f5b434bd0b4c9ea.jpg) +(e) + +measure quality of synthesized images using Frechet Inception Distance (FID) [13]. The measure is defined to evaluate similarity of distributions between two image sets, in contrast to perceptual metrics such as SSIM that require a reference image for each given test image. That is, the FID is low between two sets of images that have similar image features, and overall diversity among the different generated samples is the same as in the reference samples. This metric is thus good to demonstrate that not only do the details in any generated environment map match realistic patches from training images, but the set of predicted images also have variety in content without over-fitting. + +# 5. Results + +To show the effectiveness of our method for rendering virtual objects in AR, we start with qualitative results from real-world applications of our model, followed by comparisons to previous work and quantitative benchmark results. + +# 5.1. Qualitative results + +In Fig. 4 we show results from our prototype iOS app used in real-world scenes. We use device pose and plane geometry provided by ARKit [2] to warp the input camera image into a partial environment map. The completed environment map from running our model on the device is then used with SceneKit3 to render the virtual object4. The inference time is under 9 ms on an iPhone XS, allowing updates at high frame rates depending on desired user experience. + +Please see the supplementary material for videos from our application, where we use an update rate of 10fps for our results. Fig. 4(a) shows a real cooker in the right, and a rendered version on the left. Note that the material properties of the brushed steel body do not match exactly. We can clearly see that the lighting direction closely matches the reference real-world object, providing the correct specular highlights. The accurate lighting, combined with perceptually plausible reflection clearly makes the rendering an immersive AR experience. In Fig. 4(b) we render a mirror sphere into a scene to show the impact of generating plausible reflections. Though the input observes a very small part of the environment, we are able to create a believable AR experience by completing the environment map with a detailed scene. Even though it cannot match the actual room in every detail, the perceptual impact and coherence of the virtual object with other objects, such as the mirror on the wall, and metallic tower on the right, is evident. In Fig. 4(c)-(e) we provide more examples of inserted virtual objects that have lighting that is coherent with the real objects in the field of view. + +From the images in Fig. 1 and 4 we highlight a few aspects of our method. For each of the scenes, that vary in time of day and FoV, not only is the light direction coherent with the scene but so is the type/shape/size of light source generated by our method. Fig. 1(e) shows a virtual teapot on a table illuminated with an unseen artificial light. The roughness of the teapot was 0.2, and metalness was 1.0 in SceneKit. The light direction and highlights from our estimate closely match those on the real teapot (blue) and sphere (pool ball) in the scene. In Fig. 4(b) and (d) the light + +
MethodFIDAngularError
EnvMapNet (Ours)52.734.3±18.5
Ours without ProjectionLoss77.739.2±29.9
Ours without ClusterLoss20375.1±25
Gardner et al. [10]197.465.3±24.5
Artist IBL (Fixed)-46.5±15.4
+ +Table 1. Quantitative comparisons and ablation studies (Sec. 5.2). + +sources have appearances closer to that of a window/door that are common and plausible in those environments. + +We show qualitative comparisons to recent work from Srinivasan et al. [25], and their re-implementations of Neural Illumination [23] and Deep Light [17] in Appendix 5. + +# 5.2. Quantitative evaluation and benchmarking + +For quantitative benchmarking we use the metrics detailed in Sec. 4 on the publicly available Laval dataset [10], and show the results in Table 1. We show some example results in Fig. 5 with rendered objects using results and ground truth (GT) environment maps. All images are best seen on a color monitor with magnification. We highly encourage the reader to see Appendix 6 for details and more results with renderings. + +As discussed in Sec. 2, though several methods have focused on light estimation from single images, only a few generate HDR RGB environment maps. Recent techniques that estimate lighting such as [23] and [17], have not shared code, model weights nor use public datasets. There is also a lack of a standard set of metrics for comparison. The method by Gardner et al. [10] is the current state-of-the-art method that is most comparable to our method, uses the same public dataset, and is compared in the above recent works as well. They have provided a web interface to obtain results from their method6. Since we use the same splits for train/test, we provide detailed quantitative and qualitative comparisons with their results. + +We summarize the quantitative metrics in Table 1, calculated over the 250 test images. The results from using our method are reported as EnvMapNet. We introduced two novel loss functions in our method, for which we also conducted ablation studies. For Ours without ProjectionLoss we observe higher angular error than our full model EnvMapNet, as expected from our discussions in Sec. 3.3. When we trained Ours without ClusterLoss, for the discriminator, the model often suffered from instability as discussed in Sec. 3.4, and could not generate textures with fine details, hence the higher FID and angular error. + +The errors for Gardner et al. [10] are higher than our complete pipeline. As shown with example images (Fig. 5 and Appendix 6), the environment map generated by their method lacks fine details for the scenes hence the higher + +![](images/26564fe0f22eec9f5c8cfa704a690403671d44d3880b5f6811ccea8a06b38279.jpg) +Figure 5. Sample benchmarking results (Sec. 5.2 and Appendix 6). + +FID score. The angular error is also higher on average, which could be explained from our experiments in Sec. 3.3 that show MSE loss is insufficient to train for accurate lighting. Both these aspects can be clearly observed to affect the use of the environment maps in rendering objects with both mirror and diffuse finish, along with the cast shadows. + +As a baseline measurement, we consider that AR applications, like games, may use a fixed artist-created environment map for lighting. We obtained such an environment map designed for indoor scenes as detailed in Appendix 2. We calculate the angular error metric with respect to this environment map, and report it in Table 1 as Artist IBL. + +As demonstrated through the various qualitative examples and quantitative benchmarking, our method, with lowest FID and AngularError, can produce high quality environment maps both for visually pleasing reflections, and accurate lighting of the virtual objects. + +# 6. Conclusions + +We presented the first method that, given a small field-of-view LDR camera image, can estimate a high resolution HDR environment map in real-time on a mobile device. The result can be used to light objects of any material finish (mirror to diffuse) for augmented reality. We made two novel contributions in the training of our neural network, with ProjectionLoss for the environment map, and ClusterLoss for the adversarial loss. This enabled our method to synthesize environment maps with accurate lighting and perceptually plausible reflections. We proposed two metrics to measure both these aspects of the estimated environment map. Through qualitative and quantitative comparisons we demonstrated that our method reduces the angular error in parametric light direction by more than $50\%$ , along with a 3.7 times reduction in FID. We showcased a real-world mobile application that is able to run our model in real-time (under 9ms) and render visually coherent virtual objects in novel environments. + +# References + +[1] ARCore. Google LLC, 2021. +[2] ARKit. Apple Inc, 2021. +[3] Dejan Azinović, Tzu-Mao Li, Anton Kaplanyan, and Matthias Nießner. Inverse path tracing for joint material and lighting estimation. In Proc. CVPR, 2019. +[4] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In Proc. ICLR, 2019. +[5] Ting Chen, Xiaohua Zhai, Marvin Ritter, Mario Lucic, and Neil Houlsby. Self-supervised GANs via auxiliary rotation loss. In Proc. CVPR, 2018. +[6] Dachuan Cheng, Jian Shi, Yanyun Chen, Xiaoming Deng, and Xiaopeng Zhang. Learning scene illumination by pairwise photos from rear and front mobile cameras. Computer Graphics Forum, 2018. +[7] Paul Debevec. Rendering synthetic objects into real scenes: Bridging traditional and image-based graphics with global illumination and high dynamic range photography. In Computer Graphics and Interactive Techniques, SIGGRAPH, 1998. +[8] Paul Debevec. A median cut algorithm for light probe sampling. In ACM SIGGRAPH Courses, 2006. +[9] Marc-Andre Gardner, Yannick Hold-Geoffroy, Kalyan Sunkavalli, Christian Gagne, and Jean-Francois Lalonde. Deep parametric indoor lighting estimation. In Proc. ICCV, 2019. +[10] Marc-Andre Gardner, Kalyan Sunkavalli, Ersin Yumer, Xiaohui Shen, Emiliano Gambaretto, Christian Gagné, and Jean-François Lalonde. Learning to predict indoor illumination from a single image. ACM Transactions on Graphics (SIGGRAPH Asia), 2017. +[11] Mathieu Garon, Kalyan Sunkavalli, Sunil Hadap, Nathan Carr, and Jean-Francois Lalonde. Fast spatially-varying indoor lighting estimation. In Proc. CVPR, 2019. +[12] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Proc. NIPS. 2014. +[13] 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 Proc. NIPS, 2017. +[14] Yannick Hold-Geoffroy, Akshaya Athawale, and Jean-François Lalonde. Deep sky modeling for single image outdoor lighting estimation. 2019. +[15] Yannick Hold-Geoffroy, Kalyan Sunkavalli, Sunil Hadap, Emiliano Gambaretto, and Jean-François Lalonde. Deep outdoor illumination estimation. In Proc. CVPR, 2017. +[16] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In Proc. ICLR, 2018. +[17] 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 ACM Transactions on Graphics, 2019. + +[18] Wenbin Li, Sajad Saeedi, John McCormac, Ronald Clark, Dimos Tzoumanikas, Qing Ye, Yuzhong Huang, Rui Tang, and Stefan Leutenegger. Interiornet: Mega-scale multisensor photo-realistic indoor scenes dataset. In Proc. BMVC, 2018. +[19] Robert Maier, Kihwan Kim, Daniel Cremers, Jan Kautz, and Matthias Nießner. Intrinsic3D: High-quality 3D reconstruction by joint appearance and geometry optimization with spatially-varying lighting. In Proc. ICCV, 2017. +[20] Steve Marschner and Donald P. Greenberg. Inverse lighting for photography. In Color Imaging Conference, 1997. +[21] Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional image synthesis with auxiliary classifier GANs. In Proc. ICML, 2017. +[22] E. Rublee, V. Rabaud, K. Konolige, and G. Bradski. Orb: An efficient alternative to sift or surf. In Proc. ICCV, 2011. +[23] Shuran Song and Thomas Funkhouser. Neural illumination: Lighting prediction for indoor environments. Proc. CVPR, 2019. +[24] Shuran Song, Fisher Yu, Andy Zeng, Angel X Chang, Manolis Savva, and Thomas Funkhouser. Semantic scene completion from a single depth image. Proc. CVPR, 2017. +[25] Pratul P. Srinivasan, Ben Mildenhall, Matthew Tancik, Jonathan T. Barron, Richard Tucker, and Noah Snavely. Lighthouse: Predicting lighting volumes for spatially-coherent illumination. In Proc. CVPR, 2020. +[26] Tiancheng Sun, Jonathan T. Barron, Yun-Ta Tsai, Zexiang Xu, Xueming Yu, Graham Fyffe, Christoph Rhemann, Jay Busch, Paul Debevec, and Ravi Ramamoorthi. Single image portrait relighting. ACM Transactions on Graphics, 2019. +[27] UnityTechnologies. Reflection probes, 2021. +[28] Kuntee Viriyothai and Paul Debevec. Variance minimization light probe sampling. SIGGRAPH, 2009. +[29] Z. Wang, E. P. Simoncelli, and A. C. Bovik. Multiscale structural similarity for image quality assessment. In Asilomar Conference on Signals, Systems Computers, 2003. +[30] Edward Zhang, Michael F. Cohen, and Brian Curless. Emptying, refurbishing, and relighting indoor spaces. ACM Transactions on Graphics (SIGGRAPH Asia), 2016. +[31] Jinsong Zhang, Kalyan Sunkavalli, Yannick Hold-Geoffroy, Sunil Hadap, , Jonathan Eisenmann, and Jean-François Lalonde. All-weather deep outdoor lighting estimation. In Proc. CVPR, 2019. +[32] Yinda Zhang, Shuran Song, Ping Tan, and Jianxiong Xiao. Panocontext: A whole-room 3d context model for panoramic scene understanding. In Proc. ECCV, 2014. +[33] 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, 2004. \ No newline at end of file diff --git a/hdrenvironmentmapestimationforrealtimeaugmentedreality/images.zip b/hdrenvironmentmapestimationforrealtimeaugmentedreality/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..da7f419ac8cbc812a3a1f46efee65964b5c9e687 --- /dev/null +++ b/hdrenvironmentmapestimationforrealtimeaugmentedreality/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fe5a535e3c7f878302664591f44a362b80bbe0b3a2667522cac49cdb39627d0 +size 373698 diff --git a/hdrenvironmentmapestimationforrealtimeaugmentedreality/layout.json b/hdrenvironmentmapestimationforrealtimeaugmentedreality/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..eb978c39042ac95843b6e750277eba6024d097ec --- /dev/null +++ b/hdrenvironmentmapestimationforrealtimeaugmentedreality/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:982e66883081b5b447a81079d5fe1b14523136328eaa41a0b890160bf06e89ff +size 282298 diff --git a/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_content_list.json b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cd0de12124d3e3800b51ffa3d437b3ce6c5451da --- /dev/null +++ b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f1996c2d34f2c3a8cc9910ed938101c167928b7a1980ee4fd29a0acdc7ec43f +size 82319 diff --git a/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_model.json b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d32ddf2147062dbd82d8e2a362387f555d127300 --- /dev/null +++ b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:159a88ded2e73a5a3589a19ff2e5ac7bd01e6f3be0f2a7ca2c3e035a533fce63 +size 100624 diff --git a/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_origin.pdf b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8a67e28e3ec8c5599891f782505c802a52338344 --- /dev/null +++ b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/bdcad23a-229e-4500-b87d-bd3289427216_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ce4f70c3e96fa8ac9e984e4f8192368e4fa284d46d500a5eebba3ce1dd450e0 +size 3461207 diff --git a/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/full.md b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..22712b575f74605fb6f522f7a9bcd94a7ccfb280 --- /dev/null +++ b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/full.md @@ -0,0 +1,391 @@ +# Heterogeneous Grid Convolution for Adaptive, Efficient, and Controllable Computation + +Ryuhei Hamaguchi $^{1}$ , Yasutaka Furukawa $^{2}$ , Masaki Onishi $^{1}$ , and Ken Sakurada $^{1}$ $^{1}$ National Institute of Advanced Industrial Science and Technology (AIST) + $^{2}$ Simon Fraser University + +ryuhei.hamaguchi@aist.go.jp, furukawa@sfu.ca, onishi@ni.aist.go.jp, k.sakurada@aist.go.jp + +![](images/f30361fd591f586672d8b7256e8133b8358b5ac5f84819f72c113b57e1b841f6.jpg) +Figure 1. Heterogeneous grid convolution exploits the heterogeneity in the image to enable adaptive, efficient, and controllable computation for a range of image understanding tasks such as semantic segmentation, road extraction, and salient object detection from left to right. + +![](images/513568cbf7a34885b80a8244165afdd08060fa869e295c13197b54a7a08c0132.jpg) + +![](images/fc05ed8d2bf7d470a35a1d0a8998c9b9956a46c487beb3c9443b801f04e0fd08.jpg) + +![](images/2d3ba9a8033f61a9b3c311dbce89278355087ab8a2de7ffbe85ca99ff2c89142.jpg) + +# Abstract + +This paper proposes a novel heterogeneous grid convolution that builds a graph-based image representation by exploiting heterogeneity in the image content, enabling adaptive, efficient, and controllable computations in a convolutional architecture. More concretely, the approach builds a data-adaptive graph structure from a convolutional layer by a differentiable clustering method, pools features to the graph, performs a novel direction-aware graph convolution, and unpool features back to the convolutional layer. By using the developed module, the paper proposes heterogeneous grid convolutional networks, highly efficient yet strong extension of existing architectures. We have evaluated the proposed approach on four image understanding tasks, semantic segmentation, object localization, road extraction, and salient object detection. The proposed method is effective on three of the four tasks. Especially, the method outperforms a strong baseline with more than $90\%$ reduction in floating-point operations for semantic segmentation, and achieves the state-of-the-art result for road extraction. We will share our code, model, and data. + +# 1. Introduction + +Our world is heterogeneous in nature. Looking at a scene from a car (See Fig. 1), the road occupies one third of the + +image with homogeneous textures. At the far end of the road are full of objects such as cars, pedestrians, or road signs. The density of semantic information varies per location. Our attention to the world is also heterogeneous in nature. With a specific task in mind, we focus our attention to a specific portion of an image, for example, tracing a road network in a satellite image. + +While a regular grid feature representation has been successful, such a representation contains redundant information in low density regions, whereas the spatial resolution is insufficient in high density regions. Features should be stored adaptively based on the information density. + +This paper studies a novel "heterogeneous grid convolution", which has the following three advantages. (Adaptive) The node features are adaptively allocated where necessary. (Efficient) The adaptive allocation reduces redundant computations. (Controllable) An agent can focus computation to a region of interest with an additional input. + +There are two technical challenges in learning such a flexible feature representation: (a) how to adaptively allocate nodes while exploiting image heterogeneity, and (b) how to define a convolution operation on a heterogeneous grid structure. We propose a differentiable clustering-based graph pooling for the first challenge and a direction-aware extension of the graph convolution for the second challenge. + +The combination of our graph pooling and direction-aware graph convolution forms a neural model, dubbed + +heterogeneous grid convolution, that can be inserted into any existing CNN architecture. By exploiting the proposed module, we also propose a heterogeneous grid convolutional neural networks (HG-CNNs) as a highly efficient yet strong extension of existing CNN architectures. + +We have evaluated the proposed approach on four image understanding tasks, semantic segmentation, object localization, road extraction, and salient object detection. The proposed HG-CNNs are effective for three of the four tasks; the HG-CNN outperforms strong baselines with fewer floating-point operations (more than $90\%$ reduction) on semantic segmentation; it achieves the state-of-the-art result on road extraction task; it yields compelling performance against state-of-the-arts on salient object detection. The current neural processors (i.e., NPU and GPU) are optimized for regular grid computations, and the proposed module is not necessarily computationally faster or more efficient in practice. However, the paper opens up a new avenue of research, potentially leading to an impact in vertical application domains, such as embedded devices with specialized hardware. We will share all our code and data to promote further research. + +# 2. Related works + +The literature of convolutional neural architecture is massive. The section focuses the description on the graph convolution, the graph pooling, and other closely related enhancement techniques in computer vision. + +Graph convolution: Hammond et al. [12] and Defferrard et al. [9] formulated a convolution operation on graph-structured data based on spectral graph theory, approximating filters in the Fourier domain using Chebyshev polynomials. Kipf and Welling [17] further proposed a first-order approximation of the spectral graph convolution. Since the above works assume general graph data as inputs, they lack the capability of capturing spatial relationships between nodes for embedded graphs. To remedy this, various methods have been proposed [10, 20, 26, 32, 34, 38]. For instance, Spline-CNN [10] extends a regular kernel function to a continuous kernel function using B-spline bases, where convolution weights for the adjacent nodes can be modified according to their relative spatial position. In our experiments, we compare our direction-aware graph convolution to the above methods. + +Ci et al. [7] extends widely used GCN for 3D pose estimation by using different weight parameters for every pair of nodes. However the application of the method is limited to the tasks where the graph structure is pre-defined, e.g., a skeleton body model in 3D pose estimation. + +Graph pooling: Graph pooling is a key operation for learning hierarchical graph representations. DiffPool was proposed as a differentiable graph pooling method, in which + +soft-cluster assignments are directly estimated using graph convolution layers in an end-to-end manner [37]. Other methods defined graph pooling as a node selection problem. In such methods, the top-k representative nodes are selected using a trainable vector $p$ [3] or self-attention mechanism [19]. Whereas the above methods globally select discriminative nodes, AttPool [15] also applies a local attention mechanism to prevent the pooling operation from being stuck within a narrow sub-graph. + +Non-grid representations in computer vision: Graph-based representations have been proposed for modeling long-range dependencies in an image. Li et al. proposed a module that performs graph reasoning on a fully-connected graph acquired from a clustering-based graph projection [21]. Similar ideas are also proposed by [6] and [45]. To reduce the computational complexity of the fully-connected graph reasoning, recent work proposed a dynamic graph message passing that adaptively constructs a local graph for each location of a feature map [46]. These methods aim to refine a regular grid representation by adding an extra graph reasoning module on it, and thus still depend on regular convolution for spatial feature extraction. On the other hand, our aim is to replace the redundant regular convolutions by the proposed HG-Conv that gives a unified method for spatial feature extraction and long-range message passing on compact graph representations. + +Marin et al. proposed a non-uniform downsampling method that learns deformations from uniform sampling points such that the points near semantic boundaries are sampled as many as possible [24]. More recently, Gao et al. proposed a method that constructs an adaptive triangular mesh on an image plane, and applied the method as learnable downsampling on semantic segmentation task [11]. The method predicts deformations from an initial triangular mesh such that each mesh has a small feature variance. These methods differ from our method in two points; 1) they applied conventional regular convolutions after nonuniform downsampling; 2) for this reason, the deformations are restricted so that the regularity of the output are kept. For this purpose, the methods introduced regularization terms. On the other hand, our graph convolution can operate directly on non-uniform inputs, and hence the proposed graph pooling can generate pooling regions of arbitrary shapes and sizes in a purely data adaptive manner. + +PointRend [18] is proposed as a point-based feature refinement module. To generate high-resolution output, the module adaptively samples points from upsampled feature maps and apply MLP to refine the point features. The method is orthogonal to our method. + +Ning et al. [28] proposed an efficient convolution method by reusing computation among similar features. While the method achieves an efficient approximation of a regular convolution, the method cannot be applied on non + +![](images/ae4b14f8a1cde1a160723cff7a201007978f6255b3d8b0d3f82885610204122a.jpg) +Figure 2. Illustration of heterogeneous grid convolution. From input feature map, HG-Conv 1) finds groups of pixels shown in colored grids, 2) computes group feature vectors by taking average inside the groups, 3) performs convolution as direction-wise graph-convolutions over the groups, and 4) copies the group feature vector back to the pixels for each group. + +grid inputs. + +Other enhancement techniques: Dilated convolutions [39, 40] take a strategy of maintaining the feature resolution throughout the networks. Despite being a successful technique [41, 42, 43, 47], Dilated convolutions suffer from large memory consumption and computations due to the high-resolution feature maps. More recently, multi-resolution features [33] or a course-to-fine strategy [1, 4, 22, 23, 29, 31] have been proposed to alleviate the issue. + +Multi-scale feature fusion has been studied for aggregating long-range contextual information [4, 13, 36, 39, 47]. The methods build multi-scale features by applying pyramid pooling [47] or dilated convolutions with different dilation rates [4]. Recent works [5, 41, 42, 43, 44] have proposed adaptive context aggregation methods that are based on the feature relation. For instance, OCNet [42] identifies the context for each pixel by adopting a self-attention mechanism. $A^2$ -Net [5] applies a double attention mechanism, where the key features in a scene are aggregated during the first "gather" attention, and are distributed to each pixel during the second "distribute" attention. + +# 3. Convolution as a set of graph-convolutions + +Convolution is a direction-wise set of graph-convolutions. We first show this not well-known fact, which will allow us to define heterogeneous grid convolution with the language of graph-convolutions towards a simple and efficient implementation in the next section. + +Considering convolution as a message-passing architecture, $(3\times 3)$ convolution passes messages along nine direc + +tions $\Delta = \{\leftarrow ,\rightarrow ,\uparrow ,\downarrow ,\swarrow ,\nearrow ,\searrow ,\odot \}$ (See Fig. 3): + +$$ +\overrightarrow {z _ {p}} = \sum_ {\delta \in \Delta} \overrightarrow {x _ {p + \delta}} W _ {\delta}. \tag {1} +$$ + +$\overrightarrow{x_p}$ is the $(1\times \mathcal{N}_{in})$ input feature vector at pixel $p$ . $\overrightarrow{z_p}$ is the $(1\times \mathcal{N}_{out})$ output feature vector. With abuse of notation $\delta (\in \Delta)$ is a positional displacement for a given direction. $W_{\delta}$ is the $(\mathcal{N}_{in}\times \mathcal{N}_{out})$ kernel matrix for direction $\delta$ . + +Let $X$ and $Z$ denote the set of feature vectors for all the pixels as the $(\mathcal{N}_{pix} \times \mathcal{N}_{in})$ and $(\mathcal{N}_{pix} \times \mathcal{N}_{out})$ matrices, where $\mathcal{N}_{pix}$ is the number of pixels. The above message-passing equation can be written for all the pixels as + +$$ +Z = \sum_ {\delta \in \Delta} \left(D ^ {\delta}\right) ^ {- 1} A ^ {\delta} X W _ {\delta}. \tag {2} +$$ + +$\pmb{A}^{\delta}$ is the $(\mathcal{N}_{pix}\times \mathcal{N}_{pix})$ asymmetric adjacency matrix for direction $\delta$ , that is, $A_{ij}^{\delta}$ is 1 if the $i_{\mathrm{th}}$ pixel is connected to the $j_{\mathrm{th}}$ pixel along direction $\delta$ . $D^{\delta}$ is the $(\mathcal{N}_{pix}\times \mathcal{N}_{pix})$ degree matrix of $\pmb{A}^{\delta}$ : $D_{ii}^{\delta} = \max \left(\sum_{j}\pmb{A}_{ij}^{\delta},\epsilon\right)$ , where $(\epsilon = 1\mathrm{e - }7)$ is used to avoid divide-by-zero in computing its inverse. The formula inside the summation is the widely used graph-convolution formulation by Kipf and Welling [17], which is summed over the message passing directions. + +# 4. Heterogeneous Grid Convolution + +Heterogeneous grid convolution (HG-Conv) is a natural extension of convolution in the heterogeneous grid domain. + +![](images/166f6d5b932678238d2bee63f5957bf23be7815c5de6ceb492513d861a3a45c4.jpg) +Figure 3. Illustration of direction-wise adjacency matrices. Adjacency matrices for group of pixels are defined by the summation of connections between groups. To avoid clutter, we exclude diagonal directions. + +Understanding that the convolution is equivalent to the sum of direction-wise graph-convolutions (Eq. 2), HG-Conv is defined as a four-step process shown in Fig. 2: (1. Clustering) Find groups of pixels sharing similar features; (2. Pooling) Compute the group feature vector by taking the average over its pixels; (3. Graph-convolution) Perform convolution as direction-wise graph-convolutions over the groups; and (4. Unpooling) Copy the group feature vector back to the pixels for each group. The four steps are defined in the following formula: + +$$ +Z = S \sum_ {\delta \in \Delta} \left(\hat {D} ^ {\delta}\right) ^ {- 1} \hat {A} ^ {\delta} \boldsymbol {S} ^ {T} \boldsymbol {X} \boldsymbol {W} _ {\delta}, \tag {3} +$$ + +$$ +\hat {\boldsymbol {A}} ^ {\delta} = \boldsymbol {S} ^ {T} \boldsymbol {A} ^ {\delta} \boldsymbol {S}. \tag {4} +$$ + +$S$ is a $\mathcal{N}_{pix} \times \mathcal{N}_{grp}$ group assignment matrix, where $S_{pg}$ defines an assignment weight from pixel $p$ to group $g$ . $\hat{A}^{\delta}$ is the $\mathcal{N}_{grp} \times \mathcal{N}_{grp}$ adjacency matrix for the groups. $\hat{D}^{\delta}$ is the $\mathcal{N}_{grp} \times \mathcal{N}_{grp}$ degree matrix of $\hat{A}^{\delta}$ . Starting from the stack of input feature vectors $X$ , (1. Clustering) is to compute $S$ ; (2. Pooling) is the left-multiplication of $S^{T}$ ; (3. Graph-convolution) is the left-multiplication of $(\hat{D}^{\delta})^{-1}\hat{A}^{\delta}$ and right-multiplication of the learnable kernel $W_{\delta}$ ; and (4. Unpooling) is the multiplication of $S$ . + +# 4.1. Differentiable clustering + +The group assignment $S$ is computed by sampling cluster centers from input pixels, and associating input features to the cluster centers using differentiable SLIC algorithm [16]. Note that $S$ is a soft-assignment and trainable in an end-to-end manner. The cluster centers are sampled based on "importance" of each pixel. The importance is defined as $L^2$ distance between a pixel's feature and its adjacent features. As an extension, the importance map can be incorporated as an attention map for controlling node allocation as shown later. + +# 4.2. Pooling + +Given the group of pixels, group feature vectors are computed by the average pooling, which can be written as: + +$$ +\hat {\boldsymbol {X}} = \bar {\boldsymbol {S}} ^ {T} \boldsymbol {X}. \tag {5} +$$ + +$\bar{S}$ is a column-wise normalized assignment matrix, i.e., $\bar{S} = S\bar{Z}^{-1}$ and $\bar{Z}_{jj} = \sum_{i}S_{ij}$ . The unpooling operation is + +defined via its transpose: + +$$ +\boldsymbol {X} = \tilde {\boldsymbol {S}} \boldsymbol {X} ^ {\prime} \tag {6} +$$ + +where $\tilde{S}$ is a row-wise normalized matrix, i.e., $\tilde{S} = \tilde{Z}^{-1}S$ and $\tilde{Z}_{ii} = \sum_{j}S_{ij}$ . + +# 4.3. Graph-convolution + +A convolution (Eq. 2) is defined as the left multiplication of the adjacency matrix $A^{\delta}$ (with the inverse of the degree matrix) and the right multiplication of the learnable kernel $W_{\delta}$ . We define a convolution for groups by simply replacing the adjacency matrix of the pixels $A^{\delta}$ with the adjacency matrix of the groups $\hat{A}^{\delta}$ . $\hat{A}_{ij}^{\delta}$ should encode the amount of connections from the $i_{th}$ group to the $j_{th}$ group along direction $\delta$ , in other words, how many pixel-level connections there are along $\delta$ from a pixel in the $i_{th}$ group to a pixel in the $j_{th}$ group. This can be calculated easily by the group assignment matrix $S$ : $\hat{A}^{\delta} = S^{T}A^{\delta}S$ [37]. The convolution for the groups is then given as the left multiplication of $(\hat{D}^{\delta})^{-1}\hat{A}^{\delta}$ and the right-multiplication of $W_{\delta}$ . + +We find that the clusters from differentiable SLIC tend to have complicated shapes and include many small disjoint regions, where Fig. 4 (a) illustrates the situation. Due to the disjoint cluster (depicted in blue), the green cluster is connected to the blue cluster in every direction, which results in a "noisy" group adjacency matrix (Fig. 4 (b)). + +To this end, a "noise-canceling operation" is performed on the group adjacency matrix, which cancels out the connection weight by the weight of the opposite direction (Fig. 4 (c)). Let $\bar{\delta}$ be the opposite direction of $\delta$ , the "noise-canceling" is performed as follows. + +$$ +\hat {\boldsymbol {A}} ^ {\delta} \leftarrow \max \left(\mathbf {0}, \hat {\boldsymbol {A}} ^ {\delta} - \hat {\boldsymbol {A}} ^ {\bar {\delta}}\right) \tag {7} +$$ + +By abuse of notation, $\hat{A}^{\delta}$ is replaced with the refined matrices. In practice, the matrices are further simplified by only keeping the direction with the maximum connection (e.g., only the left-wise connection remains in case of Fig. 4 (c)). We empirically find that taking the strongest direction slightly improves the performance. + +# 4.4. HG convolutional modules and networks + +A standard convolutional architecture design is to repeat convolutional, batch normalization, and ReLU layers. This + +![](images/c64373d3f7884d9b6fbba9baa4cf0d5b66e51b81e9177ab468d21cbf4090ab67.jpg) +Figure 4. Illustration of noise-canceling for adjacency matrices. Pooling on disjoint cluster assignment (a) results in noisy adjacency matrices (b). Noise-canceling operation refines the noisy adjacency by canceling out connections of opposite direction (c). + +design is immediately applicable to HG convolutions: + +$$ +\begin{array}{l} \boldsymbol {Z} _ {0} = \boldsymbol {S} ^ {T} \boldsymbol {X}, (8) \\ \boldsymbol {Z} _ {l} = F _ {\mathrm {B N - R e L U}} \left(\sum_ {\delta \in \Delta} \left(\hat {\boldsymbol {D}} ^ {\delta}\right) ^ {- 1} \hat {\boldsymbol {A}} ^ {\delta} \boldsymbol {Z} _ {l - 1} \boldsymbol {W} _ {\delta}\right), (9) \\ Z = S Z _ {L}. (10) \\ \end{array} +$$ + +This HG-Conv module repeats HG-convolutions, batch normalization, and ReLU L times from $X$ to $Z$ . $F_{\mathrm{BN - ReLU}}$ is a batch normalization layer followed by ReLU activation. HG convolution is capable of incorporating other popular modules in the CNN literature such as residual blocks. Next, we will design a few representative heterogeneous convolutional neural networks (HG-CNNs) by using HG-convolution and other techniques, where the full specifications are referred to the supplementary. + +HG-ResNet: A ResNet [14] is extended by replacing the 4th stage of the network with the HG-Conv module: The pooling (Eq. 8) is inserted at the beginning of stage 4; The subsequent regular convolutions are replaced by the HG-Conv; and The unpooling (Eq. 10) is inserted at the end of the stage. Finally, the module output is concatenated to the stage 3 output and further refined by a $1 \times 1$ convolution. Note that the parameter size is equal to the original ResNet except the final $1 \times 1$ convolution. + +HG-HRNetV2: HRNetV2 [33] is a variant of HRNet that have recently shown outstanding performance on semantic segmentation. Similar to HG-ResNet, the HG-Conv module is applied to the last part of HRNetV2, in particular, all the 4 branches at the last block of stage 4. + +HG-ResUNet: ResUNet is a variant of UNet [31], popular in the field of medical image analysis and remote sensing. We applied the HG-Conv module to the last and the first block of the encoder and decoder, respectively. In the same way as HG-ResNet, the output of each module is concatenated with the input, and refined by $1 \times 1$ convolution. + +# 5. Experiments + +We evaluate the proposed HG-CNNs on four image understanding tasks, semantic segmentation, object localization, road extraction, and salient object detection. On semantic segmentation, the HG-Conv outperforms strong baselines while representing an image with much fewer spatial nodes (less than $2\%$ ) (Sect. 5.1). However, HG-Conv does not perform effectively on object localization, which needs further exploration (Sect. 5.2). On the other two tasks, we demonstrate that the HG-Conv is able to control node allocations based on task-specific attention maps, an extension called "active focus" (Sects. 5.3 and 5.4). + +# 5.1. Semantic Segmentation + +Setup: We build three HG-CNNs based on HG-ResNet and HG-HRNetV2, and compare against their non-HG counterparts. First, we use HG-ResNet to build two HG-CNNs (HG-ResNet-Dilation and HG-ResNet-DCN) by using dilated convolutions and deformable convolutions at the 3rd residual stage. The non-HG counterparts (ResNet-Dilation and ResNet-DCN) are constructed by simply replacing the HG-Conv by dilated convolution and deformable convolution. The third HG-CNN is HG-HRNetV2, where the non-HG counterpart is HRNetV2, which is the start-of-the-art segmentation network. To further boost performance, we add auxiliary segmentation heads to the input of the HGConv modules for all HG-CNNs. + +Unless otherwise noted, we determined the number of groups of HG-Conv as 1/64 of the number of input pixels (i.e., the downsampling rate is set as 1/64). As the HG-Conv adaptively constructs graph representations, the number of floating-point operations varies per image. Although the fluctuation is negligible, we evaluate the FLOPs of the HG-Conv by the average over the validation images. We basically used multi-scale prediction. + +Main results: Fig. 6 compares the performance and the computational complexity of the ResNet models and the HG-ResNet models with various depths (18/34/50/101). The HG-ResNet models outperform the corresponding baselines with much less floating-point operations. Especially on PASCAL-context, HG-ResNet34-DCN outperforms ResNet101-DCN $(+0.7\%)$ with only $10\%$ floating-point operations. Furthermore, Table 1 shows that HG-HRNetV2 outperforms baseline HRNetV2 with less floating-point operations. + +Comparison with other state-of-the-art non-grid convolutions Table 2 shows the comparison against other state-of-the-art non-grid convolutions, DCN [8] and DGMN [46]. In the table, HG-Conv outperforms DCN with less FLOPs. The combination of DCN and HG-conv (DCN at stage 3 and HG-Conv at stage 4) outperforms DGMN with less FLOPs. As for realistic runtime, HG-CNN is not faster than the con + +![](images/5a090b52cde2ed300c311e62596893b1f2542e7f5ade1d3587d314a48b7396a8.jpg) + +![](images/e333dec89b54654258e65d7d50e059ec7dfaec311dc5ccc5fe5340d2783f9f8a.jpg) + +![](images/4686dff73eb3895d9864335feb0a468a9fb76347a2220d0198ffbcbf859b4a7b.jpg) + +![](images/448eaedb6353c30dd8bf505a58913705900f85e427b89e8aa9cc0122a3beb2b3.jpg) + +![](images/bfd89c27a49d19ab59350b304f077503035aa9d6ea7ecd8d30441856cb40f108.jpg) +$A^{\leftarrow}$ ,Left + +![](images/64853cc1b84da8d796441b749c3c2676367f6dfa260142a142ddc6d59edc8f29.jpg) +$A^{\rightarrow}$ ,Right + +![](images/dbc8d8f2b4e6328612afe7b3710e012d98314c8e74a5552f2f154e913265e317.jpg) +$\pmb{A}^{\uparrow}$ ,Up + +![](images/251a7b779b786864d2d25c64f0fce49a2cf47826996f916a23680efe8bd55cb8.jpg) +$\pmb{A}^{\downarrow}$ ,Down + +![](images/834ef86a48e4427673e7ce573eb657b22d5ef702ed25b1bdd4ac7bff1bb6198c.jpg) + +![](images/b370765dd583a7d0a669abbfdf146592a02d64d43456b9dd970d4450080d8469.jpg) +Object-aware active focus + +![](images/981f87176e22057ad93dd154fa8ac155e3e3befe85ef5d91737a36ebf9a45e27.jpg) +Uncertainty-aware active focus + +![](images/3c63aff0cdb10cda8d4291ec17bb2cdc80507dfab89f578f5db8addcda1bc48f.jpg) + +![](images/e1151cac42c0115e83da7f77030ccba57a56e88c7a292b42ae34c4d7c98bd862.jpg) +Importance map + +![](images/3d5d2ea49e70fe6405a0043e0197bc4ffe4a3d2bc58ecffa0f4f5c3d619a1a81.jpg) +Random sampling + +![](images/5e83cf4647410d3ebaa90c6eca3eb70da8ab1f279fd88cf3b003570552af29d6.jpg) +Importance sampling + +![](images/9706732e617c1123a4492148364fdb7b702cbf5ed01a79171ec2a1a999f4cb5d.jpg) +Top-k + random + +![](images/b167262dc62d06d270ba8ee34ee329dc1452864493d1c40b87cdd327fc058196.jpg) +Figure 5. (Top left) Visualization of adjacency matrices before and after noise-canceling. Diagonal directions are excluded to avoid clutter. (Top right) Visualization of active focus for salient object detection. Object-aware attention map and resulting clustering are shown on the left two images, and uncertainty-aware attention map and resulting clustering is shown on the right two images. (Center right) Importance map and sampled cluster centers for each sampling method. (Bottom) Visualization of clustering for outdoor scenes, indoor scenes, and satellite imagery. For the satellite imagery, spatial nodes are focused on road lines (active focus). + +![](images/9479ef1d4f4eba44651d4a05c1aadd0f64e4bceb545d566c758600993afdaa1a.jpg) + +![](images/38cef1f30b1c50ccab56595a909c502772ffa53aa5a2257f94ff952703fa5ee8.jpg) + +![](images/3cc4cf575bfcf1a79498243257053253b0e0061e7a83cb0ac63eb6e84996faa1.jpg) + +![](images/33a2d2d2b9bcd53b94fa49223b77f08423e02fdd29a79171ed1c06a1b1a6bb94.jpg) + +![](images/db2c1c7b7bcc194c4f8ad723ab8ec69a3a064f4b57bb3bef3bb136017204ce5e.jpg) + +ventional CNNs in practice. For instance, "DCN" in Table 2 can process $713 \times 713$ inputs in 14.9 FPS, while "DCN+HG-conv" processes the same inputs in 6.5 FPS. This is because today's processors (GPUs) are optimized for regular grid computations, not for graph processing. We believe that the runtime should be improved by more optimized implementation or specialized hardware. + +In Table 3, we also compared against other irregular convolutions studied in the field of geometric deep learning (e.g., GMMConv [26] and SplineConv [10]). Specifically, we replace the graph-convolution step of the HGConv module with the competing modules (See Table 3). The HG-Conv outperforms the other methods in most cases. Due to engineering challenges, fine-tuning from ImageNet pre-trained models was not possible for some methods. For a fair comparison, we also trained our model from scratch. + +Ablation study: To validate the design choices of the HG-Conv, we conducted several ablation studies. + +(Sampling methods) We compare three sampling methods for the cluster center sampling step of the HG-Conv: random sampling, importance sampling, and a combination of top-k and random sampling [18]. Fig. 5 visualizes the sampled cluster centers, and Table 4 reports the model performances for each sampling method. With random sampling, a large portion of the sampled locations lie on the homogeneous road region, and many objects at the far end are missed. In contrast, the other sampling methods prop + +erly place the cluster centers based on the importance map, which results in better segmentation performance. + +(Downsampling ratio) Table 5 evaluates HG-ResNet with varying downsampling ratio. HG-ResNet outperforms the baseline ResNet with extremely small downsampling ratio. (Noise-canceling) Table 7 demonstrates the effectiveness of noise-canceling operation on the adjacency matrices, which shows clear improvements on two of the three datasets. Max-direction heuristic achieves the well-balanced performance across all of the datasets. The effect of noise-canceling is qualitatively clear in Fig. 5. + +(HG-Conv for 3rd stage) In Table 8, we further convert the 3rd stage of ResNet101 into the HG-Conv. Whereas the performance degrades from $79.9\%$ to $78.1\%$ , the computational cost reduction increases significantly (i.e., from $15.1\%$ to $54.7\%$ ). However, as the result of HG-ResNet34 shows, reducing the depth of HG-ResNet is more effective than applying the HG-Conv at a shallow stage. + +# 5.2. Object Localization + +We also evaluated the proposed method on object localization tasks such as object detection and instance segmentation. For base models, we use Faster R-CNN and Mask R-CNN with FPN. Specifically, we compared two backbones, ResNet-DCN and HG-ResNet-DCN, on COCO dataset. + +Table 9 shows the results of the comparison. While our method achieves $30\%$ reduction in FLOPs, the accuracy of the model is degraded by HG-conv. We leave further explo + +![](images/ca1aff08b5f87aad2890878a05487bd7eb08a40f39acefda5d4d283950d1b53c.jpg) +(a) Cityscapes + +![](images/cd97fa5e1567464be1c0c7ddb3eed2e9d83e6e3af5912f702aaa0dc1d9c393ef.jpg) +(b) ADE20K +Figure 6. Evaluation results of ResNet and HG-ResNet on (a) Cityscapes, (b) ADE20K, and (c) PASCAL-context. The number of floating-point operations are calculated for processing image size of 1, $024 \times 2$ , 048, $473 \times 473$ , and $520 \times 520$ respectively. + +![](images/2c3500866aa18dce9f1eead41bd6f9d5d0f5b42850a84cd500706fdf38bd939b.jpg) +(c) PASCAL-context + +Table 1. Semantic segmentation results of HG-HRNetV2 on Cityscapes, ADE20K, and Pascal-context datasets (mIoU). + +
GFLOPsCityscapesADE20KPASCAL-context
HRNetV2 [33]69681.743.454.0
HG-HRNetV263282.444.254.9
+ +Table 2. Comparison with other non-grid convolution methods on Cityscapes. The models are evaluated at single scale. + +
mIoU#paramsFLOPs
ResNet101-Dilation75.352.07M512.8 G
+ DCN [8]78.1+1.20M+11.3G
+ DGMN [46]79.2+2.61M+24.6G
+ HG-conv78.8+6.29M-78.1G
+ DCN +HG-conv79.5+7.25M-69.1G
+ +Table 3. Comparison with other convolution methods for nonuniform inputs on semantic segmentation tasks (mIoU). The methods are evaluated using HG-ResNet101-dilation. + +
CityscapesADE20KPASCAL-context
w/o transfer
Kipf and Welling [17]75.837.341.7
DynamicEdgeConv [34]77.239.745.9
HG-Conv77.740.644.7
w/ transfer
GMMConv [26]77.240.345.9
SplineConv [10]78.441.245.5
HG-Conv78.842.047.5
+ +ration of HG-Conv on object localization for future work. + +# 5.3. Road Extraction + +Road extraction is a task for extracting road graphs from overhead images. On this task, we demonstrate the "active focus" capability that focuses cluster center allocation around predicted road lines. Active focus is particularly effective for road extraction where targets have thin structure. Finally, we apply the HG-Conv into the previous method, and achieve the state-of-the-art performance. + +Setup: We make two HG-CNNs and their non-HG counterparts in this evaluation. The first pair is HG-ResUNet + +Table 4. Ablation study on sampling methods for the cluster center sampling step of HG-Conv. + +
CityscapesADE20KPASCAL-context
Random sampling79.141.045.8
Importance sampling79.440.546.0
Top-k + random [18]79.041.346.0
+ +Table 5. HG-Conv with different downsampling rates. Results are reported for Cityscapes. The models use deformable convolution. + +
ResNet101HG-ResNet101
Downsampling1/11/161/321/641/128
mIoU78.178.180.379.579.9
GFLOPs (reduction)18261574155815501546
-(13.8%)(14.7%)(15.1%)(15.3%)
+ +and ResUNet, and the second pair is HG-Orientation and Orientation [2] (a current state-of-the-art network for the task). We modified the above models slightly to keep high-resolution information; the stride of the first $7 \times 7$ convolution is decreased to 1, and the max-pooling layer is removed $(^{+})$ . Furthermore, we make two modifications to employ active focus (-Attn): 1) A coarse segmentation head is added on the input feature of the HG-Conv module; and 2) The active focus is employed using the coarse prediction map as attention to focus the cluster center allocation on the road lines. + +Results: Table 10 shows that our method (HG-Orientation+-Attn) achieves the state-of-the-art result on both IoU and APLS metrics. The effectiveness of HG-ResUNet $18^{+}$ is also clear $(+0.6\%)$ and $+0.9\%$ for IoU and APLS, compared to ResUNet $18^{+}$ . The active focus is particularly effective on the task: By focusing spatial nodes on the road lines, the network can utilize high resolution information around road, while propagating contextual information from other regions (see Fig. 5 for visualization). + +# 5.4. Salient Object Detection + +Salient object detection is a task for identifying the object regions that are most attractive for human eyes. On the task, we compare two different types of active focus. + +Table 6. Evaluation of HG-ResUNet and active focus for salient object detection. + +
ECSSDPASCAL-SDUT-OMRONHKU-ISSODDUT-TE
MaxF↑MAE↓MaxF↑MAE↓MaxF↑MAE↓MaxF↑MAE↓MaxF↑MAE↓MaxF↑MAE↓
ResUNet500.9380.04130.8600.06860.7810.06250.9280.03630.8620.10020.8720.0430
HG-ResUNet500.9420.03930.8680.06620.7990.05630.9360.03320.8650.10360.8810.0403
HG-ResUNet50-Attn (object)0.9430.03960.8710.06540.8010.05600.9350.03250.8620.10990.8840.0387
HG-ResUNet50-Attn (uncertainty)0.9430.03950.8670.06610.7940.05610.9340.03310.8660.10980.8840.0382
+ +Table 7. Ablation study on noise-canceling of adjacency matrix. + +
Noise-cancelingMaxDirectionCityscapesADE20KPASCAL-context
✓78.440.445.0
78.541.645.9
✓✓79.041.346.0
+ +Table 8. Application of HG-Conv on shallower stages. The values in parentheses indicate the reduction efficiency of FLOPs compared to ResNet101-DCN. + +
HG-ConvGFLOPsmIoU
ResNet101-DCNnone1,82678.8
HG-ResNet101-DCNstage41,550 (15.1%)79.9
stage3,4827 (54.7%)78.1
HG-ResNet34-DCNstage4122 (93.3%)78.4
+ +Table 9. Results for object localization on COCO val-set. Computational complexity of backbone part is shown on "GFLOPs". + +
BackboneGFLOPsAPboxAP50AP75APmaskAP50AP75
Faster R-CNNResNet5027.638.759.442.2———
HG-ResNet5019.137.058.340.4———
Mask R-CNNResNet5027.640.060.443.936.157.338.6
HG-ResNet5019.139.160.342.935.257.037.5
+ +Table 10. HG-Conv and active focus on road extraction task. + +
IoUAPLS
DeepRoadMapper [25]62.665.6
Topology Loss [27]64.966.0
LinkNet34 [48]62.865.3
Orientation [2]67.273.1
ResUNet1865.269.4
ResUNet18+67.571.0
HG-ResUNet18+68.171.9
HG-ResUNet18+-Attn68.372.3
Orientation+67.876.0
HG-Orientation+ -Attn68.376.4
+ +Setup: ResUNet50 and HG-ResUNet50 are used for the evaluations. For active focus, the coarse segmentation head is attached on the HG-ResUNet50. We experiment two types of attention: "object-aware" and "uncertainty-aware". In object-aware attention, the predicted object mask is used as an attention, which places cluster centers on the object. In uncertainty-aware attention, entropy of the coarse prediction is used as an attention, which places cluster centers where the prediction is uncertain. For detailed training settings, please refer to the supplementary materials. + +Results: Table 6 compares the HG-ResUNet models with baseline ResUNet50. For most datasets, HG-ResUNet50 outperforms the baseline. The object-aware active focus is + +![](images/77f7c3279896a248fbee78d0040d7a00fb145abaf54fb4c2dcc5f3719e7c5012.jpg) +Figure 7. Evaluation results of ResUNet and HG-ResUNet on salient object detection. + +particularly effective for the task. Whereas the uncertainty-aware active focus also performs well, the performance is worse compared to plain HG-ResUNet50 on three out of six datasets (See Fig. 5). + +Comparison to the state-of-the-art methods: Fig 7 compares the baseline and the proposed methods against the previous state-of-the-art. Our method does not achieve the state-of-the-art over all, but performs comparably well for some datasets without using complicated architectures such as iterative refinement modules [30] or edge-aware loss functions [35]. + +# 6. Conclusions + +This paper presents a novel heterogeneous grid convolution (HG-Conv) that builds an adaptive, efficient and controllable representation by exploiting heterogeneity inherent in natural scenes. Our experimental results demonstrate that HG-CNN is capable of reducing computational expenses significantly without much sacrifice to performance, even achieving state-of-the-art for some tasks. HG-CNN is further capable of controlling the focus of computations based on an application-specific attention maps. Our future work is to further explore the potentials of HG-CNN on more applications as well as the use of FPGA hardware, which is flexible and known to be effective for sparse computation. + +# Acknowledgement + +This paper is partially based on results obtained from a project commissioned by the New Energy and Industrial Technology Development Organization (NEDO) and supported by JSPS KAKENHI Grant Number 20H04217. + +# References + +[1] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation. TPAMI, 39(12):2481-2495, 2017. 3 +[2] Anil Batra, Suriya Singh, Guan Pang, Saikat Basu, and C V Jawahar Manohar. Improved Road Connectivity by Joint Learning of Orientation and Segmentation. CVPR, 2019. 7, 8 +[3] Cátárlina Cangea, Petar Velicković, Nikola Jovanović, Thomas Kipf, and Pietro Lio. Towards Sparse Hierarchical Graph Classifiers. NeurIPS Workshop, 2018. 2 +[4] 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. TPAMI, 40(4):834-848, 2018. 3 +[5] Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. $\$A^2$ -Nets: Double Attention Networks. NeurIPS, 2018. 3 +[6] Yunpeng Chen, Marcus Rohrbach, Zhicheng Yan, Shuicheng Yan, Jiashi Feng, and Yannis Kalantidis. Graph-Based Global Reasoning Networks. CVPR, 2019. 2 +[7] Hai Ci, Chunyu Wang, Xiaoxuan Ma, and Yizhou Wang. Optimizing network structure for 3D human pose estimation. ICCV, 2019. 2 +[8] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable Convolutional Networks. ICCV, 2017. 5, 7 +[9] Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering. NeurIPS, 2016. 2 +[10] Matthias Fey, Jan Eric Lenssen, Frank Weichert, and Heinrich Müller. SplineCNN: Fast Geometric Deep Learning with Continuous B-Spline Kernels. CVPR, 2018. 2, 6, 7 +[11] Jun Gao, Zian Wang, Jinchen Xuan, and Sanja Fidler. Beyond Fixed Grid: Learning Geometric Image Representation with a Deformable Grid. ECCV, 2020. 2 +[12] David K. Hammond, Pierre Vandergheynst, and Rémi Gribonval. Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30(2):129-150, 2011. 2 +[13] Junjun He, Zhongying Deng, Lei Zhou, Yali Wang, and Yu Qiao. Adaptive pyramid context network for semantic segmentation. CVPR, 2019. 3 +[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. CVPR, 2016. 5 +[15] Jingjia Huang, Zhangheng Li, Nannan Li, Shan Liu, and Ge Li. AttPool: Towards Hierarchical Feature Representation in Graph Convolutional Networks via Attention Mechanism. ICCV, 2019. 2 +[16] Varun Jampani, Deqing Sun, Ming-Yu Liu, Ming-Hsuan Yang, and Jan Kautz. Superpixel Sampling Networks. ECCV, 2018. 4 + +[17] Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. *ICLR*, 2017. 2, 3, 7 +[18] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. PointRend: Image Segmentation As Rendering. CVPR, 2020. 2, 6, 7 +[19] Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-Attention Graph Pooling. ICML, 2019. 2 +[20] Guohao Li, Matthias Müller, Ali Thabet, and Bernard Ghanem. DeepGCNs: Can GCNs Go as Deep as CNNs? ICCV, 2019. 2 +[21] Yin Li and Abhinav Gupta. Beyond grids: Learning graph representations for visual recognition. NeurIPS, 2018. 2 +[22] Di Lin, Yuanfeng Ji, Dani Lischinski, Daniel Cohen-Or, and Hui Huang. Multi-scale Context Intertwining for Semantic Segmentation. ECCV, 2018. 3 +[23] Guosheng Lin, Anton Milan, Chunhua Shen, and Ian Reid. RefineNet: Multi-Path Refinement Networks for High-Resolution Semantic Segmentation. CVPR, 2017. 3 +[24] Dmitrii Marin, Zijian He, Peter Vajda, Priyam Chatterjee, Sam Tsai, Fei Yang, and Yuri Boykov. Efficient segmentation: Learning downsampling near semantic boundaries. ICCV, 2019. 2 +[25] Gellert Mattyus, Wenjie Luo, and Raquel Urtasun. DeepRoadMapper: Extracting Road Topology from Aerial Images. ICCV, 2017. 8 +[26] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model CNNs. CVPR, 2017. 2, 6, 7 +[27] Agata Mosinska, Pablo Marquez-Neila, Mateusz Kozinski, and Pascal Fua. Beyond the Pixel-Wise Loss for Topology-Aware Delineation. CVPR, 2018. 8 +[28] Lin Ning, Hui Guan, and Xipeng Shen. Adaptive deep reuse: Accelerating CNN training on the fly. ICDE, 2019. 2 +[29] Hyeonwoo Noh, Seunghoon Hong, and Bohyung Han. Learning deconvolution network for semantic segmentation. ICCV, 2015. 3 +[30] Youwei Pang, Xiaqi Zhao, Lihe Zhang, and Huchuan Lu. Multi-scale interactive network for salient object detection. CVPR, 2020. 8 +[31] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation. In MICCAI, 2015. 3, 5 +[32] Przemysław Spurek, Tomasz Danel, Jacek Tabor, Marek Śmieja, Łukasz Struski, Agnieszka Slowik, and Łukasz Maziarka. Geometric Graph Convolutional Neural Networks. ICLR, 2020. 2 +[33] Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, Wenyu Liu, and Bin Xiao. Deep High-Resolution Representation Learning for Visual Recognition. TPAMI, 2020. 3, 5, 7 +[34] 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, 38(5):1-12, oct 2019. 2, 7 + +[35] Zhe Wu, Li Su, and Qingming Huang. Stacked cross refinement network for edge-aware salient object detection. ICCV, 2019. 8 +[36] Maoke Yang, Kun Yu, Chi Zhang, Zhiwei Li, and Kuiyuan Yang. DenseASPP for Semantic Segmentation in Street Scenes. CVPR, 2018. 3 +[37] Rex Ying, Jiaxuan You, Christopher Morris, Xiang Ren, William L. Hamilton, and Jure Leskovec. Hierarchical Graph Representation Learning with Differentiable Pooling. NeurIPS, 2018. 2, 4 +[38] Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware Graph Neural Networks. ICML, 2019. 2 +[39] Fisher Yu and Vladlen Koltun. Multi-Scale Context Aggregation by Dilated Convolutions. In ICLR, 2016. 3 +[40] Fisher Yu, Vladlen Koltun, and Thomas Funkhouser. Dilated residual networks. In CVPR, 2017. 3 +[41] Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-Contextual Representations for Semantic Segmentation. ECCV, 2020. 3 +[42] Yuhui Yuan and Jingdong Wang. OCNet: Object Context Network for Scene Parsing. CoRR, 2018. 3 +[43] Fan Zhang, Yanqin Chen, Zhihang Li, Zhibin Hong, Jingtuo Liu, Feifei Ma, Junyu Han, and Errui Ding. ACFNet: Attentional Class Feature Network for Semantic Segmentation. ICCV, 2019. 3 +[44] Hang Zhang, Han Zhang, Chenguang Wang, and Junyuan Xie. Co-occurrent features in semantic segmentation. CVPR, 2019. 3 +[45] Li Zhang, Xiangtai Li, Anurag Arnab, Kuiyuan Yang, Yunhai Tong, and Philip H. S. Torr. Dual Graph Convolutional Network for Semantic Segmentation. BMVC, 2019. 2 +[46] Li Zhang, Dan Xu, Anurag Arnab, and Philip H.S. Torr. Dynamic graph message passing networks. CVPR, 2020. 2, 5, 7 +[47] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017. 3 +[48] Lichen Zhou, Chuang Zhang, and Ming Wu. D-linknet: Linknet with pretrained encoder and dilated convolution for high resolution satellite imagery road extraction. CVPRW, 2018. 8 \ No newline at end of file diff --git a/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/images.zip b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4d152cf720f15f599d81f1a84144c1cd1e64e6a0 --- /dev/null +++ b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c39dd90df47c2474068f296c5f1fed4439ee4bdce4fa0d365b9cdcb3e22ce59 +size 866320 diff --git a/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/layout.json b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c6584291ec0e5b62b768ffd754449347871f9ec5 --- /dev/null +++ b/heterogeneousgridconvolutionforadaptiveefficientandcontrollablecomputation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd92dc5bd7355fdee6f047cbb5a8659d1e755d2564dc07b257659c811ef9a8d9 +size 459117 diff --git a/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_content_list.json b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0d9cbface7efc166669bfb5a2bf8c22605eb6946 --- /dev/null +++ b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f356ad04422a6e4680cfbb832df57e8cc979f5b1d9739c59d8148a26afe67cc1 +size 72366 diff --git a/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_model.json b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f79620615ee04addd90066f8e6a867646d3d3a2c --- /dev/null +++ b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7396e88ef4934645fd0a62914e7e07996136dd3b4afc7159d8577972e9db5249 +size 87808 diff --git a/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_origin.pdf b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3749090f41e20bdcec530dda97ac983c7eacff32 --- /dev/null +++ b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/1f39b8cc-c26e-4aae-8406-c34ddfd74d4c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e29bf3be034cc8d3bc70d48a9032a39e7dd0c60c4593c728c29c594ba417b1ba +size 1282897 diff --git a/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/full.md b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cad199b9244d3b837c6a23a88d54037f4ad3fdec --- /dev/null +++ b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/full.md @@ -0,0 +1,231 @@ +# Hierarchical and Partially Observable Goal-driven Policy Learning with Goals Relational Graph + +Xin Ye and Yezhou Yang + +Active Perception Group, School of Computing, Informatics, and Decision Systems Engineering, Arizona State University, Tempe, USA + +{xinyel, yz.yang}@asu.edu + +# Abstract + +We present a novel two-layer hierarchical reinforcement learning approach equipped with a Goals Relational Graph (GRG) for tackling the partially observable goal-driven task, such as goal-driven visual navigation. Our GRG captures the underlying relations of all goals in the goal space through a Dirichlet-categorical process that facilitates: 1) the high-level network raising a sub-goal towards achieving a designated final goal; 2) the low-level network towards an optimal policy; and 3) the overall system generalizing unseen environments and goals. We evaluate our approach with two settings of partially observable goal-driven tasks — a grid-world domain and a robotic object search task. Our experimental results show that our approach exhibits superior generalization performance on both unseen environments and new goals1. + +# 1. Introduction + +Goal-driven visual navigation defines a task where an intelligent agent (with an on-board camera) is expected to take reasonable steps to navigate to a user-specified goal in an unknown environment (see Figure 1 left). It is a fundamental yet essential capability for an agent and could serve as an enabling step for other tasks, such as Embodied Question Answering [8] and Vision-and-Language Navigation [3]. Goal-driven visual navigation could be formulated as a partially observable goal-driven task. In this paper, we present a novel Hierarchical Reinforcement Learning approach with a Goals Relational Graph formulation (HRL-GRG) tackling it. Formally, a partially observable goal-driven task yields a $10$ -tuple $< S, A, T, G, R, \Omega, O, G_d, \Phi, \gamma>$ , in which $S$ is a set of states, $A$ is a set of actions, $T: S \times A \times S \to [0,1]$ is a state transition probability function, $G \subseteq S$ is a set of goal states, $R: S \times A \times S \times G \to \mathbb{R}$ is a reward function, + +$\Omega$ is a set of observations that are determined by conditional observation probability $O: S \times \Omega \to [0,1]$ . Similarly, $G_{d}$ is a set of goal descriptions that describe observations with goal recognition probability $\Phi: \Omega \times G_{d} \to [0,1]$ . In particular, $g$ is the goal state of the corresponding goal description $g_{d}$ iff $\Phi(\operatorname{argmax}_{\omega} O(g, \omega), g_{d})$ is larger than a pre-defined threshold. $\gamma \in (0,1]$ is a discount factor. The objective of a partially observable goal-driven task is to maximize the expected discounted cumulative rewards $\mathbb{E}[\sum_{t}^{\infty} \gamma^{t} r_{t+1}(s_{t}, a_{t}, s_{t+1}, g) | s_{t}, g]$ by learning an optimal action policy to select an action $a_{t}$ at the state $s_{t}$ given the observation $o_{t}$ and the goal description $g_{d}$ . + +Classic RL methodology optimizes an agent's decision-making action policy in a given environment [30]. To make RL towards real-world applicable, equipped with deep neural networks, Deep Reinforcement Learning (DRL) [22] algorithms are able to directly take the high dimensional sensory inputs as states $S$ and learn the optimal action policy that generalizes across various states. However, the applicability of most advanced RL algorithms is still limited to domains with fully observed state space $S$ and/or fixed goal states $G$ , which is not the case in reality [22, 21, 20, 29, 11]. + +For real-world applications like visual navigation, an agent's sensory inputs capture the local information of its surrounding environments (a partially observable state space). Additionally, the real-world applications could be subject to goal changes, requiring a system to be goal-adaptive. Therefore, a real-world application can be formulated as a partially observable goal-driven task, that is different from a fully observable goal-driven task [22, 21, 11, 25] or a partially observable task [13, 18, 12]. It requires the agent to be capable of inferring its state in the augmented state space $S \times G$ . Namely, the agent should take actions based on its current relative states with respect to the goal states, which can only be estimated from its sensory observations $\Omega$ and the goal descriptions $G_{d}$ . This is challenging due to 1) the large augmented state space, 2) the different modalities that the observations $\Omega$ and the goal descriptions $G_{d}$ could have. For example, while RGB images are usually taken as the + +observations, semantic labels are more efficient in describing task goals [5]. + +To address the challenges, our HRL-GRG incorporates a novel Goals Relational Graph (GRG), which is designed to learn goal relations from the training data through a Dirichletcategorical process [31] dynamically. In such a way, our model estimates the agent's states in terms of the learned relations between sub-goals that are visible in the agent's current observations and the designated final goal. Furthermore, our HRL-GRG decomposes the partially observable goal-driven task into two sub-tasks: 1) a high-level sub-goal selection task, and 2) a low-level fully observable goal-driven task. Specifically, the high-level layer selects a sub-goal $sg \in G_d$ that is observable in the current sensory input $o$ , i.e. $\Phi(o, sg) > 0$ , and could also contribute to achieving the designated final goal $g \in G_d$ . The objective of the low-level layer is to achieve the observable sub-goal, yielding a well-studied fully observable task [22, 21, 11]. + +Many prior DRL methods tackling partially observable tasks [13, 18, 12] are not designed for goal-driven tasks. Therefore, their learned policies are not goal-adaptive. Adapting to new goals is critical for real-world tasks, such as goal-driven visual navigation [40], robotic object search [38, 36, 5] and room navigation [38]. Current goal-driven visual navigation methods generally neglect the essential role of estimating the agent's state under the partially observable goal-driven settings effectively, thus their performance still leaves much to be desired especially in terms of generalization ability (in-depth discussion in Section 2). Here, we argue and show our novel GRG modeling fills the gap. + +Formally, we define GRG as a complete weighted directed graph $< V, E, W >$ in which $V = G_{d}$ is a set of nodes representing the goals $G_{d}$ , and $E$ is the directed edges connecting two nodes with the weights $W$ . We incorporate GRG into HRL via two aspects: 1) weighing each candidate sub-goal in the high-level layer by $\mathbb{C}(\tau^{*})$ , the cost of the optimal plan $\tau^{*}$ from the sub-goal to the goal over the GRG; 2) terminating the low-level layer referring to the optimal plan $\tau^{*}$ from the proposed sub-goal to the goal over the GRG. To empirically validate the presented system, we start with demonstrating the effectiveness of our method in a grid-world domain where the environments are partially observable and a set of goals following a pre-defined relation are specified as the task goals. The design follows the intuition in real-world applications that certain relations hold in the goal space. For example, in the robotic object search task, users arrange the household objects in accordance with their functionalities. Another example is the indoor navigation task where room layouts are not random. Furthermore, in addition to the grid-world experiment, we also apply our method to tackle the robotic object search task in both the AI2-THOR [15] and the House3D [34] benchmark environments. We show HRL-GRG model exhibits superior perfor + +mance in both experiments over other baseline approaches, with extensive ablation analysis. + +# 2. Related Work + +Research works on partially observable goal-driven tasks are explored typically under the visual navigation scenarios: an agent learns to navigate to user-specified goals with its first-person view visual inputs. Previous works' contributions lie in representation learning of the agent's underlying state and knowledge embedding for goal state inference. + +In [40], the authors present a target-driven DRL model to learn a desired action policy conditioned on both visual inputs and target goals. With a target goal being specified as an image taken at the goal position, their model captures the spatial configuration between the agent's current position and the goal position as the agent's underlying state. However, when the goal position is far away, the inputs of the model lack the information to infer the spatial configurations, and so the model instead memorizes such spatial configurations. As a result, their model relies on a scene-specific layer for every single environment. Similar issues also exist in [33]. [28] represents the agent's current state with respect to the goal state through a semi-parametric topological memory while it requires a pre-exploration stage to build a landmark graph. The authors of [10] locate the goal position in their predicted top-down egocentric free space map. However, the method struggles when the goal is not visible. With more detailed information about the goals, the Vision-and-Language Navigation task has drawn research attention in which a fine-grained language-based visuomotor instruction serves as the goal description for the agent to follow and achieve [2, 9, 32]. Yet, specifying a goal with an image or a visuomotor instruction is inefficient and impractical for real-world applications. Instead, taking a concise semantic concept as a goal description is more desirable [23, 36, 26, 27, 5, 6, 39]. Semantic goals as model inputs, typically come in the form of one-hot encoded vectors or word embeddings. Therefore, goal inputs provide limited information for estimating the agent's states relative to the goal states. + +Since it is non-trivial to incorporate complete information with a goal description as input, others embed task-specific prior knowledge to infer the goal states. In [36, 26, 27], the authors extract object relations from the Visual Genome [16] corpus and incorporate this prior into their models through Graph Convolutional Networks [14]. The extracted object relations encode the co-occurrence of objects based on human annotations from the Visual Genome dataset, which may not be consistent with the target application environments and the agent's understanding of the world. More recently, the authors of [35] come up with the Bayesian Relational Memory (BRM) architecture to capture the room layouts of the training environments from the agent's own experience for room navigation. The BRM further serves as a planner to + +![](images/d9d5fe9f6734bec92c11ede4adca11df460c308825425c8b765959c323906db6.jpg) +Figure 1: Illustrations of the grid-world domain and the robotic object search task (left), and an overview of our method (right). + +propose a sub-goal to the locomotion policy network. Since the proposed sub-goal is still not observable, the authors of BRM train individual locomotion policies for each subgoal to respectively tackle one partially observable task. In such manner, the BRM model's low-level network is not goal-adaptive and still brings about inefficiency and scaling concerns. + +Apart from prior research efforts, we present a novel hierarchical reinforcement learning approach equipped with a GRG formulation for the general partially observable goal-driven task. Our GRG captures the underlying relations among all goals in the goal space and enables our hierarchical model to achieve superior generalization performance by decomposing the task into a high-level sub-goal selection task and low-level fully observable goal-driven task. + +# 3. Hierarchical RL with GRG + +# 3.1. Overview + +Our focus is the partially observable goal-driven task where the agent needs to make a decision of which action to take to achieve a user-specified goal relying on its partial observations. Without loss of generality, we represent the observations $\Omega$ as images, such as the local egocentric top-down maps in the grid-world domain and the first-person view RGB images in the robotic object search task (see Figure 1 left). We specify the goal descriptions $G_{d}$ as categorical labels (goal indices in the grid-world domain and object categories in the robotic object search task). To better illustrate our method, we take the grid-world domain as an example. The agent is asked to move to a goal position indicated by the goal index between obstacles. The agent can only observe a local map of obstacles and goals. The objective is to learn an optimal policy for several goals and + +instances of the grid-world domain which can generalize to new/unseen ones. + +Figure 1 (right) depicts an overview of our method that is composed of a Goals Relational Graph (GRG), a high-level network and a low-level network. At time step $t$ , the agent receives an observation $o_t \in \Omega$ that is a local map of its surrounding obstacles and a set of visible goals $VG = \{vg \mid vg \in G_d \text{ and } \Phi(o_t, vg) > 0\}$ . We take these visible goals as the candidate sub-goals at the time step $t$ , and our high-level network learns a policy to select one from them to achieve the designated final goal $g \in G_d$ . In order to be goal-adaptive, the system weighs each candidate sub-goal in $VG$ by its relation to the designated final goal $g$ , estimated from GRG. As a result, our high-level network proposes a sub-goal $sg_t \in VG$ conditioning on both the observation $o_t$ and the designated final goal $g$ . After the sub-goal $sg_t$ is proposed, our low-level network decides an action $a_t$ conditioning on both the observation $o_t$ and the sub-goal $sg_t$ for the agent to perform. Afterwards, the agent receives a new observation $o_{t+1}$ , and our low-level network repeats $N_t$ times to achieve the sub-goal $sg_t$ until 1) the sub-goal $sg_t$ is achieved; 2) the low-level network terminates itself if a better sub-goal appears in its current observation; 3) the low-level network runs out of a pre-defined maximum number of steps $N_{max}^l$ . Either way, the low-level network collects an $N_t$ -step long trajectory and terminates at the observation $o_{t+N_t}$ . The trajectory updates the GRG. Then, the high-level network takes the control back to propose the next sub-goal. Overall, the process repeats until it either achieves the designated final goal $g$ or reaches a predefined maximum number of actions $N_{max}$ . + +# 3.2. Goals Relational Graph (GRG) + +GRG representation. We formulate GRG as a complete + +weighted directed graph $< V, E, W >$ on all goals in the goal space $G_{d}$ (i.e. $V = G_{d}$ ). For any goal $g_{i}$ and goal $g_{j}$ , we define the weight $w_{ij}$ on the directed edge $(g_{i}, g_{j})$ as a measure of how likely and quickly the goal $g_{j}$ would appear according to $\Phi$ if our low-level network tries to achieve the goal $g_{i}$ . We set the weight $w_{ii} = 1$ and adopt a Dirichlet-categorical model to learn $w_{ij}$ for any $i \neq j$ . + +To be specific, we first assign a random variable $X_{ij}$ to denote what would happen to the goal $g_j$ if our low-level network achieves the goal $g_i$ . Every time when the goal $g_i$ is proposed by our high-level network, our low-level network generates a trajectory that has at most $N_{max}^l$ steps to achieve the goal $g_i$ . It introduces the following $N_{max}^l + 1$ events that $X_{ij}$ may take: + +- Event $k$ ( $1 \leq k \leq N_{max}^{l}$ ): the goal $g_{j}$ appears when $k$ steps are taken by our low-level network. We quantify the event $k$ as $x_{ij,k} = \gamma^{k - 1}$ where $\gamma \in (0,1]$ is the discount factor to denote how close the goal $g_{j}$ to the goal $g_{i}$ . +- Event $N_{max}^{l} + 1$ : the goal $g_{j}$ doesn't appear. We quantify this event as $x_{ij,N_{max}^{l} + 1} = 0$ . + +It is fair to assume that $X_{ij} \sim \text{Cat}(\pmb{\theta}_{ij})$ in which the parameter $\pmb{\theta}_{ij} = (\theta_{ij,1}, \theta_{ij,2}, \dots, \theta_{ij,N_{max}^l + 1}) \sim \text{Dir}(\pmb{\alpha}_{ij})$ is a learnable Dirichlet prior. $\pmb{\alpha}_{ij} = (\alpha_{ij,1}, \alpha_{ij,2}, \dots, \alpha_{ij,N_{max}^l + 1})$ is a concentration hyperparameter representing the pseudo-counts of all event occurrences. Thus, it can be empirically chosen. Lastly, the weight $w_{ij}$ is set as $\mathbb{E}[X_{ij}]$ . + +GRG update. Each time when the low-level network is invoked to achieve the goal $g_{i}$ , we get a trajectory as a sample $\mathcal{D}$ to update the GRG. For any goal $g_{j}$ in our goal space, we count the number of the occurrences of all events and denote it as $c_{ij} = (c_{ij,1}, c_{ij,2}, \dots, c_{ij,N_{max}^{l}} + 1)$ . Since the Dirichlet distribution is the conjugate prior distribution of the categorical distribution, the posterior distribution of the parameter $\theta_{ij}$ , namely $\theta_{ij}|\mathcal{D} \sim Dir(\alpha_{ij} + c_{ij}) = Dir(\alpha_{ij,1} + c_{ij,1}, \alpha_{ij,2} + c_{ij,2}, \dots, \alpha_{ij,N_{max}^{l}} + 1 + c_{ij,N_{max}^{l}} + 1)$ . As a result, the posterior prediction distribution of a new observation $P(X_{ij} = x_{ij,k}|\mathcal{D})$ can be estimated by Equation 1, and the weight $w_{ij} = E(X_{ij}|\mathcal{D}) = \sum_k x_{ij,k}P(X_{ij} = x_{ij,k}|\mathcal{D})$ . + +$$ +P (X _ {i j} = x _ {i j, k} | \mathcal {D}) = \mathbb {E} [ \theta_ {i j, k} | \mathcal {D} ] = \frac {\alpha_ {i j , k} + c _ {i j , k}}{\sum_ {k} (\alpha_ {i j , k} + c _ {i j , k})}. \quad (1) +$$ + +GRG planning. With the GRG being learned and updated, we quantify the relation of a goal $g_{i}$ to a goal $g_{j}$ by the cost $\mathbb{C}(\tau_{i,j}^{*})$ of the optimal plan $\tau_{i,j}^{*}$ searched from $g_{i}$ to $g_{j}$ over the GRG. In particular, suppose $\tau_{i,j} = \{\tau_{1},\tau_{2},\dots,\tau_{M}\}$ is a plan searched from $g_{i}$ to $g_{j}$ over the GRG in which $g_{\tau_m(1\leq m\leq M)}$ is a goal from our goal space $G$ , $\tau_{1} = i$ and $\tau_{M} = j$ , we define the optimal plan $\tau_{i,j}^{*} = \operatorname{argmax}_{\tau_{i,j}}\prod_{m = 1}^{M - 1}w_{\tau_m\tau_{m + 1}}$ . We adopt the cost of the optimal plan $\tau_{i,j}^{*}$ , $\mathbb{C}(\tau_{i,j}^{*}) = \max_{\tau_{i,j}}\prod_{m = 1}^{M - 1}w_{\tau_m\tau_{m + 1}}$ as the measure of the relation from the goal $g_{i}$ to the goal $g_{j}$ . + +# 3.3. Goal-driven High-level Network + +Model formulation. The high-level network selects a sub-goal $sg$ aiming to achieve the designated final goal $g$ . We first introduce an extrinsic reward $r^e$ . Here, we adopt a binary reward as the extrinsic reward to encourage the agent to achieve the final goal. Specifically, the agent receives a reward of 1 if it achieves the final goal $g$ , i.e. $r_t^e (s_{t - 1},a_{t - 1},s_t,g) = 1$ iff the state $s_t$ is the goal $g$ 's state, and 0 otherwise. Thus, the high-level task is formulated as maximizing the Q-value $Q_h^e (s,g,sg) = \mathbb{E}[\sum_t^\infty \gamma^t r_{t + 1}^e |s_t = s,g = g,sg_t = sg]$ , which is the discounted cumulative extrinsic rewards expected over all trajectories starting at the state $s_t$ and the sub-goal $sg_t$ . To approximate $Q_h^e (s,g,sg)$ , we adopt the Q-learning technique [22] to update the parameters of the high-level network $\theta_h$ by Equation 2, where $R_1^e = r^e (s,a,s',g) + \gamma \max_{sg'}Q_h^e (s',g,sg')$ is the 1-step extrinsic return. The sub-goal $sg$ is given by $\mathrm{argmax}_{sg}Q_h^e (s,g,sg)$ towards achieving the final goal $g$ . + +$$ +\theta_ {h} \leftarrow \theta_ {h} - \nabla_ {\theta_ {h}} \left(R _ {1} ^ {e} - Q _ {\theta_ {h}} (s, g, s g)\right) ^ {2}. \tag {2} +$$ + +Network architecture. To approximate $Q_h^e(s, g, sg)$ , we condition the high-level network on the state $s$ , goal $g$ and the sub-goal $sg$ . A widely adopted way is by taking the state $s$ and the goal $g$ as the inputs, and output Q-values that each of them corresponds to a candidate sub-goal $sg$ . Here, since the state $s$ is unknown, we instead take the observation $o$ as the input to our high-level network attempting to estimate the state $s$ simultaneously. To ensure the sub-goal that can be achieved by the low-level network, the sub-goal space at the time $t$ is set as the observable goals within the observation $o_t$ . As a consequence, the sub-goal space varies at each time stamp and is typically much smaller than the goal space. Thus, it is not efficient for the high-level network to calculate as many Q-values as the size of the goal space. Instead, as the sub-goal space is self-contained in the observation $o_t$ , we hereby extract the information of each candidate sub-goal $sg$ from the observation $o_t$ and feed it into the high-level network to output one single Q-value $Q_h^e(s, g, sg)$ specifically for the sub-goal $sg$ . + +Last but not the least, although most prior methods directly take the goal description $g_{d}$ as an additional input to their networks, we notice that the goal description $g_{d}$ , typically in the form of a one-hot vector or word embedding, does not directly provide any information for either inferring the goal state or determining a quality sub-goal. Therefore, we opt to correlate the goal $g$ with each candidate sub-goal $sg$ by their relations. Here, our system plans over the GRG and gets the cost $\mathbb{C}(\tau_{sg,g}^{*})$ of the optimal plan $\tau_{sg,g}^{*}$ from the sub-goal $sg$ to the goal $g$ as described in + +Section 3.2. We multiply the cost $\mathbb{C}(\tau_{sg,g}^{*})$ to the sub-goal input $sg$ elementwise before feeding it into the high-level network to predict its Q-value $Q_h^e (s,g,sg)$ . In such a way, $Q_{h}^{e}(s,g,sg) = Q_{h}^{e}(s,sg\odot \mathbb{C}(\tau_{sg,g}^{*}))$ where the goal $g$ is embedded with beneficial information for the Q-value prediction and the sub-goal selection. As the inputs and the outputs are specified, the remaining architecture of our high-level network is flexible per application. + +# 3.4. Termination-aware Low-level Network + +Model formulation. The objective of the low-level network is to learn an optimal action policy to achieve the proposed sub-goal $sg$ . Similar to the high-level network, we adopt a binary intrinsic reward $r^i$ accordingly that $r_t^i (s_{t - 1},a_{t - 1},s_t,sg) = 1$ iff our low-level network achieves the sub-goal $sg$ , and is otherwise 0. The optimal action policy can then be learned by maximizing the expected discounted cumulative intrinsic rewards $\mathbb{E}[\sum_t^\infty \gamma^t r_{t + 1}^i |s_t,sg_t,a_t]$ . Since the proposed sub-goal $sg_{t}$ is guaranteed to be observable in the observation $o_{t}$ , we have a fully observable goal-driven task that can be efficiently solved by the state-of-the-art reinforcement learning algorithms [22, 21, 11]. + +Adopting a hierarchical model to decompose a complex task into a set of sub-goal-driven simple tasks has been proven to be efficient and effective [19, 24]. Still, it is under the assumption that the goal/sub-goal space is identical to the state space so that any optimal trajectory can be expressed by a sequence of optimal sub-goal-oriented trajectories. In our work, we consider a practical setting in which the goal/sub-goal space is much smaller than the state space, as lots of intermediate states are not of interest in terms of solving the task. Consequently, an optimal trajectory may not be expressed by the limited presented sub-goals on the trajectory as Figure 2 (a) shows. Instead, following the set of available sub-goals proposed could yield a less optimal trajectory as Figure 2 (b) depicts. + +To overcome this issue, we further allow the low-level network to terminate at a valuable state before it achieves the proposed sub-goal. The intuition is that along its way to the sub-goal, the agent may reach a state that is better poised for achieving the final goal. Namely, a state where a better sub-goal appears (see Figure 2 (c)). Some prior methods explore modeling a termination function in their formulations [4] or adding a special "stop" action in the action space for an optimal stop policy [36]. However, they unavoidably increase the exploration difficulty and hurt the sample efficiency. Instead, we terminate our low-level network under the supervision of GRG. Whenever a sub-goal $sg$ is received, an optimal plan $\tau_{sg,g}^{*}$ starting from the sub-goal $sg$ to the goal $g$ over the GRG is generated following Section 3.2. In fact, any goal on the $\tau_{sg,g}^{*}$ other than $sg$ is a better sub-goal for achieving the final goal $g$ , and once it appears, our low- + +level network terminates and returns the control back to the high-level network. + +Network architecture. We implement the termination mechanism in the low-level policy using the GRG which is decoupled from low-level policy learning. Therefore, the low-level network still addresses the standard fully observable goal-driven task, i.e. predicting the optimal action policy from the current observation $o_{t}$ that includes the information of the sub-goal $sg_{t}$ . This can be solved by methods like DQN [22] and A3C [21], without special requirements on the network architecture. + +# 4. Experiments + +Our experiments aim to seek the answers to the following research questions, 1) Is GRG able to capture the underlying relations of all goals? 2) Is GRG able to help solve the new, unseen partially observable goal-driven tasks, and if yes, how? 3) How well does the proposed method work for the goal-driven visual navigation task? To answer the first two questions, we conduct evaluation in an unbiased synthetic grid-world domain. To answer the third question, we apply our system on both AI2-THOR [15] and House3D [34] environments for the robotic object search task. + +# 4.1. Grid-world Domain + +Grid-world generation. We generate a total of 120 grid-world maps of size $16 \times 16$ with randomly placed obstacles taking up around $35\%$ of the space. We arrange 16 goals in the free spaces of each map following a pre-defined pattern to test if our proposed GRG can capture it. Specifically, we randomly place goal $g_{0}$ and goal $g_{8}$ first. Then, for $0 < i < 16$ and $i \neq 8$ , we place goal $g_{i}$ at a random place in the window of size $7 \times 7$ centered at goal $g_{i-1}$ . Figure 1 shows an instance of a grid-world map. We take 100 grid-world maps and 12 goals for training, with the remaining 20 grid-world maps and the corresponding 16 goals are kept for testing. + +Baseline methods. We assume the agent can only observe the window of size $7 \times 7$ centered at its position, which is represented by an image including the map of obstacles and any goal positions. The agent can take one action as moving up/down/left/right, and would stay at the current position if the action leads to collision. Success is defined as the agent reaches the position of the designated goal. For this task, we adopt the DQN [22] algorithm for our low-level network to learn the optimal action policy to achieve the subgoal proposed by our high-level network, and we compare our method with the following baseline methods. + +- ORACLE and RANDOM. The agent always takes the optimal action or a random action respectively. The two + +![](images/baedd10ca05dc6b74baa47110b66f3e55bb4f523953cf48b2bd9a83313d398d5.jpg) +(a) optimal trajectory + +![](images/0cea757bdaac7dd61d661f5efc4529a6b583f24c1c5f7e4fecc02dd3d48bb124.jpg) +(b) trajectory w.o. termination +Figure 2: An illustration of how termination helps. The green triangle denotes the starting position. The stars and the arrows with different colors represent different sub-goals and the corresponding sub-goal-oriented trajectories. Termination helps to express an optimal trajectory with the limited sub-goal space. + +![](images/7a859ed910f8d0564743f69a197ebcd847222e42fce94a82ece10307c1fba4fe.jpg) +(c) trajectory with termination + +Table 1: The performance of all methods on the unseen gird-world maps. + +
MethodSeen GoalsUnseen GoalsOverall
SR↑AS / MS↓SPL↑SR↑AS / MS↓SPL↑SR↑AS / MS↓SPL↑
ORACLE1.0011.81 / 11.811.001.0011.28 / 11.281.001.0010.38 / 10.381.00
RANDOM0.1642.15 / 5.470.030.1542.38 / 4.810.040.1836.62 / 4.690.05
DQN0.2020.28 / 5.470.130.2011.90 / 4.100.150.3216.23 / 5.710.23
H-DQN0.4320.25 / 7.950.280.1926.09 / 6.380.080.4520.84 / 7.160.26
Ours0.5728.71 / 9.030.330.7024.19 / 8.730.450.7424.02 / 8.650.46
+ +![](images/971bac375bc3794ed1c233d30a4beb8dff71ebb9e40dfaa82c8fc51dcc68d9ff.jpg) +Figure 3: A visualization of a GRG learned on the grid-world domain ( $g_{16}$ is the back-up "random" goal). + +methods are taken as performance upper/ lower bounds. DQN. The vanilla DQN implementation that directly maps the observation to the optimal action. To make + +it goal-adaptive, the input observation image contains a channel of the obstacle map and a channel of the designated goal position if it presents. It is empirically shown to be better than embedding the goal with a one-hot vector (see supplementary material). + +- H-DQN. It is a widely adopted hierarchical method [17] modified for our partially observable goal-driven task where both the high-level network and the low-level network adopt a vanilla DQN implementation. The high-level network takes the whole observation as the input to propose a sub-goal that is visible. To be goal-adaptive, the goal is embedded into the high-level network in the form of a one-hot encoded vector. The low-level network is the same as the method DQN (also with ours). + +Baseline comparisons. We specify the maximum number of actions that all methods can take as 100, and for hierarchical methods, i.e. H-DQN and our method, the maximum number of actions that the low-level network can take at each time is 10. We evaluate all methods in terms of the Success Rate (SR), the Average Steps over all successful cases compared to the Minimal Steps over these cases (AS + +Table 2: The ablation studies of our method on the unseen gird-world maps. + +
MethodSeen GoalsUnseen GoalsOverall
SR↑AS / MS↓SPL↑SR↑AS / MS↓SPL↑SR↑AS / MS↓SPL↑
Ours0.5728.71 / 9.030.330.7024.19 / 8.730.450.7424.02 / 8.650.46
-relation0.2633.20 / 6.160.100.3531.93 / 6.840.140.4029.39 / 6.140.18
-termination0.5531.36 / 8.810.270.5827.91 / 8.110.320.6425.56 / 7.880.37
-high-level0.5629.97 / 9.030.310.6523.63 / 8.650.420.6622.86 / 7.860.41
+ +/ MS), and the Success weighted by inverse Path Length (SPL) following [1] and calculated as $\frac{1}{N}\sum_{i = 1}^{N}S_{i}\frac{l_{i}}{\max(l_{i},p_{i})}$ . Here $S_{i}$ is a binary indicator of success in experiment $i$ , $l_{i}$ and $p_i$ are the minimal steps and the steps actually taken by the agent. We randomly sample seen goals, unseen goals and all goals over the unseen grid-world maps, each having 100 samples that yield 100 tasks respectively. We run each method using 5 random seeds. Table 1 reports the results. + +As is shown in Table 1, we can observe that our method outperforms all baseline methods in terms of generalization ability on the unseen grid-world maps as expected. On one hand, the performance of DQN leaves much to be desired for both seen goals and unseen goals. Whereas H-DQN achieves comparable performance to our method for seen goals, but it struggles to generalize towards unseen goals. On the other hand, our proposed method generalizes well to both seen goals and unseen goals, since our GRG captures the underlying relations of all goals, even if some of the goals are not set as the designated goals in the training stage. Figure 3 shows a visualization of the learned GRG, which captures the goal relations well. + +Ablation studies. To investigate how GRG helps to solve the partially observable goal-driven task, we conduct ablation studies for each component. The GRG has two roles: In the high-level network, it weighs each candidate sub-goal by its relation to the final goal before calculating its Q-value. In the low-level network, it is used for early termination. We disable each role and denote them as “-relation” and “-termination” respectively. The results reported in Table 2 clearly show that both of them contribute to the performance of our proposed method, whereas weighing the candidate sub-goals by relations contributes more. Moreover, to show the necessity of the high-level network, we present “-high-level” that removes the high-level network, leaving only the GRG and the low-level network in place. In such a way, a sub-goal is proposed purely based on the graph planning over GRG without taking the current observation into consideration. The results in Table 2 show that it is slightly worse than our proposed method; from which we can infer that 1) the high-level network captures as much information as the GRG; 2) observations still matter since the graph only + +captures the expected relations; and 3) the performance gap could be wider in complex real-world environments. + +# 4.2. Robotic Object Search + +Robotic object search is a challenging goal-driven visual navigation task [36, 38, 23, 26, 37, 27, 5]. It requires an agent to search for and navigate to an instance of a user-specified object category in indoor environments with only its first-person view RGB image. + +A previous method SCENE PRIORS [36] also incorporates object relations as scene priors to improve the robotic object search performance in the AI2-THOR [15] environments. Unlike ours, it extracts the object relations from the Visual Genome [16] corpus and incorporates the relations through Graph Convolutional Networks [14]. Therefore, we compare our method with it in the AI2-THOR environments. AI2-THOR consists of 120 single functional rooms, including kitchens, living rooms, bedrooms and bathrooms, in which we take the first-person view semantic segmentation and depth map as the agent's pre-processed observation. As such, the goal position can be represented by the corresponding channel of the semantic segmentation (a.k.a. $\Phi$ ). In addition, we adopt the A3C [21] algorithm for our low-level network and define the maximum steps it can take at each time as 10. We follow the experimental setting in [36] to implement both SCENE PRIORS [36] and our HRL-GRG. We report the results in Table 4 where we compare the two methods in terms of their performance improvement over the RANDOM method. Table 4 indicates an overfitting issue of the SCENE PRIORS method as reported in [36] as well. At the same time, we observe a superior generalization ability of our method especially to the unseen goals. + +To further demonstrate the efficacy of our method in more complex environments, we conduct robotic object search on the House3D [34] platform. Different from AI2-THOR, each house environment in the House3D has multiple functional rooms that are more likely to occlude the user-specified target object, thus stressing upon the ability of inferring the target object's location on the fly to perform the task well. + +We consider a total of 78 object categories in the House3D environment to form our goal space. The agent moves for- + +Table 3: The performance of all methods in the House3D [34] environment for the robotic object search task. + +
MethodSingle EnvironmentMultiple Environments
Seen GoalsUnseen GoalsSeen Env.Unseen Env.
SR↑SPL↑SR↑SPL↑SR↑SPL↑SR↑SPL↑
RANDOM0.200.050.230.040.390.030.600.05
DQN0.580.270.180.050.420.060.390.04
A3C0.530.180.270.090.480.030.470.03
HRL0.770.150.050.000.430.050.280.02
Ours0.880.330.790.210.760.200.620.10
+ +Table 4: The performance improvement of SCENE PRIORS [36] (top) and our HRL-GRG (bottom) over the RANDOM method in the AI2-THOR [15] environment for the robotic object search task (without stop action). + +
Seen GoalsUnseen Goals
SR↑SPL↑SR↑SPL↑
Seen Env.[36]+0.25+0.16+0.08+0.07
Ours+0.37+0.24+0.33+0.23
Unseen Env.[36]+0.18+0.11+0.12+0.06
Ours+0.33+0.21+0.38+0.23
+ +ward / backward / left / right 0.2 meters, or rotates 90 degrees for each action step. We adopt the encoder-decoder model from [7] to predict both the semantic segmentation and the depth map from the first-person view RGB image and we take both predictions as the agent's partial observation. Furthermore, we adopt the A3C [21] algorithm for the low-level network. We compare our method with the baseline methods introduced in Section 4.1 while we also adopt the A3C algorithm for the low-level network in H-DQN and hereby denoted as HRL. In addition, we include the vanilla A3C approach. + +![](images/b9eb5de31c27a07782c42e513a04ee5b7334dd10e953fc8cdcda76ef7e8aed96.jpg) +Figure 4: The object relations captured by our GRG in the House3D [34] environment for the robotic object search task. Only a small number of objects as nodes and the edges with the weight $\geq 0.5$ are shown. + +We set the maximum steps for all the aforementioned methods to solve the object search task in the House3D environment as 1000, and the maximum steps that the low-level networks of the hierarchical methods (HRL and ours) can take as 50. To better investigate each method's properties, + +we first train and evaluate in a single environment, and show the results in Table 3 (left part). Similar to the grid-world domain, the baseline methods lack generalization ability towards achieving the unseen goals, even though they perform fairly well for the seen ones. The placement of many objects is subject to the users' preference that may require the environment-specific training process. Still, it is desirable for a method to generalize towards the objects in the unseen environments where the placement of the objects is consistent with that in the seen ones (e.g., the objects that are always placed in accordance with their functionalities). We train all the methods in four different environments and test the methods in four other unseen environments. The results presented in Table 3 (right part) show that all the baselines struggle with the object search task under multiple environments even during the training stage. In comparison, our method achieves far superior performance with the help of the object relations captured by our GRG (samples shown in Figure 4). + +# 5. Conclusion + +In this paper, we present a novel hierarchical reinforcement learning approach equipped with a GRG formulation for the partially observable goal-driven task. Our GRG captures the underlying relations among all goals in the goal space through a Dirichlet-categorical model and thus enables graph-based planning. The planning outputs are further incorporated into our two-layer hierarchical RL for proposing sub-goals and early low-level layer termination. We validate our approach on both the grid-world domain and the challenging robotic object search task. The results show our approach is effective and is exceptional in generalizing to unseen environments and new goals. We argue that the joint learning of GRG and HRL boosts the overall performance on the tasks we perform in our experiments, and it may push forward future research ventures in combining symbolic reasoning with DRL. + +Acknowledgements. This work is partially supported by the NSF grant #1750082, and Samsung Research. + +# References + +[1] Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018. 7 +[2] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sünderhauf, Ian Reid, Stephen Gould, and Anton van den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3674-3683, 2018. 2 +[3] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sünderhauf, Ian Reid, Stephen Gould, and Anton van den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[4] Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Thirty-First AAAI Conference on Artificial Intelligence, 2017. 5 +[5] Dhruv Batra, Aaron Gokaslan, Aniruddha Kembhavi, Oleksandr Maksymets, Roozbeh Mottaghi, Manolis Savva, Alexander Toshev, and Erik Wijmans. Objectnav revisited: On evaluation of embodied agents navigating to objects. arXiv preprint arXiv:2006.13171, 2020. 2, 7 +[6] Devendra Singh Chaplot, Dhiraj Prakashchand Gandhi, Abhinav Gupta, and Russ R Salakhutdinov. Object goal navigation using goal-oriented semantic exploration. Advances in Neural Information Processing Systems, 33, 2020. 2 +[7] 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. 8 +[8] Abhishek Das, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Neural modular control for embodied question answering. In Conference on Robot Learning, pages 53-62, 2018. 1 +[9] Daniel Fried, Ronghang Hu, Volkan Cirik, Anna Rohrbach, Jacob Andreas, Louis-Philippe Morency, Taylor Berg-Kirkpatrick, Kate Saenko, Dan Klein, and Trevor Darrell. Speaker-follower models for vision-and-language navigation. In Advances in Neural Information Processing Systems, pages 3314–3325, 2018. 2 +[10] Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2616-2625, 2017. 2 +[11] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018. 1, 2, 5 + +[12] Dongqi Han, Kenji Doya, and Jun Tani. Variational recurrent models for solving partially observable control tasks. arXiv preprint arXiv:1912.10703, 2019. 1, 2 +[13] Maximilian Igl, Luisa Zintgraf, Tuan Anh Le, Frank Wood, and Shimon Whiteson. Deep variational reinforcement learning for pomdpps. arXiv preprint arXiv:1806.02426, 2018. 1, 2 +[14] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. 2, 7 +[15] Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. Ai2-thor: An interactive 3d environment for visual ai. arXiv preprint arXiv:1712.05474, 2017. 2, 5, 7, 8 +[16] 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, 123(1):32-73, 2017. 2, 7 +[17] Tejas D Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in neural information processing systems, pages 3675-3683, 2016. 6 +[18] Alex X Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. arXiv preprint arXiv:1907.00953, 2019. 1, 2 +[19] Andrew Levy, George Konidaris, Robert Platt, and Kate Saenko. Learning multi-level hierarchies with hindsight. arXiv preprint arXiv:1712.00948, 2017. 5 +[20] Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. 1 +[21] Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pages 1928-1937, 2016. 1, 2, 5, 7, 8 +[22] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529-533, 2015. 1, 2, 4, 5 +[23] Arsalan Mousavian, Alexander Toshev, Marek Fišer, Jana Košecka, Ayzaan Wahid, and James Davidson. Visual representations for semantic target driven navigation. In 2019 International Conference on Robotics and Automation (ICRA), pages 8846-8852. IEEE, 2019. 2, 7 +[24] Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pages 3303-3313, 2018. 5 + +[25] Soroush Nasiriany, Vitchyr Pong, Steven Lin, and Sergey Levine. Planning with goal-conditioned policies. In Advances in Neural Information Processing Systems, pages 14843-14854, 2019. 1 +[26] Tai-Long Nguyen, Do-Van Nguyen, and Thanh-Ha Le. Reinforcement learning based navigation with semantic knowledge of indoor environments. In 2019 11th International Conference on Knowledge and Systems Engineering (KSE), pages 1-7. IEEE, 2019. 2, 7 +[27] Yiding Qiu, Anwesan Pal, and Henrik I Christensen. Target driven visual navigation exploiting object relationships. arXiv preprint arXiv:2003.06749, 2020. 2, 7 +[28] Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. arXiv preprint arXiv:1803.00653, 2018. 2 +[29] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. 1 +[30] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. 1 +[31] Stephen Tu. The dirichlet-multinomial and dirichlet-categorical models for bayesian inference. Computer Science Division, UC Berkeley, 2014. 2 +[32] Xin Wang, Qiuyuan Huang, Asli Celikyilmaz, Jianfeng Gao, Dinghan Shen, Yuan-Fang Wang, William Yang Wang, and Lei Zhang. Reinforced cross-modal matching and self-supervised imitation learning for vision-language navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6629-6638, 2019. 2 +[33] Yuechen Wu, Zhenhuan Rao, Wei Zhang, Shijian Lu, Weizhi Lu, and Zheng-Jun Zha. Exploring the task cooperation in multi-goal visual navigation. In Proceedings of the 28th International Joint Conference on Artificial Intelligence, pages 609-615. AAAI Press, 2019. 2 +[34] Yi Wu, Yuxin Wu, Georgia Gkioxari, and Yuandong Tian. Building generalizable agents with a realistic and rich 3d environment. arXiv preprint arXiv:1801.02209, 2018. 2, 5, 7, 8 +[35] Yi Wu, Yuxin Wu, Aviv Tamar, Stuart Russell, Georgia Gkioxari, and Yuandong Tian. Bayesian relational memory for semantic visual navigation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2769-2779, 2019. 2 +[36] Wei Yang, Xiaolong Wang, Ali Farhadi, Abhinav Gupta, and Roozbeh Mottaghi. Visual semantic navigation using scene priors. arXiv preprint arXiv:1810.06543, 2018. 2, 5, 7, 8 +[37] Xin Ye, Zhe Lin, Joon-Young Lee, Jianming Zhang, Shibin Zheng, and Yezhou Yang. Gaple: Generalizable approaching policy learning for robotic object searching in indoor environment. IEEE Robotics and Automation Letters, 4(4):4003-4010, 2019. 7 +[38] Xin Ye, Zhe Lin, Haoxiang Li, Shibin Zheng, and Yezhou Yang. Active object perceiver: Recognition-guided policy learning for object searching on mobile robots. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 6857-6863. IEEE, 2018. 2, 7 + +[39] Xin Ye and Yezhou Yang. Efficient robotic object search via hiam: Hierarchical policy learning with intrinsic-extrinsic modeling. IEEE Robotics and Automation Letters, 2021. 2 +[40] Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In 2017 IEEE international conference on robotics and automation (ICRA), pages 3357-3364. IEEE, 2017. 2 \ No newline at end of file diff --git a/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/images.zip b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e4e564c44e5b69038c8586d745f3e719addc747f --- /dev/null +++ b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7523629e8f29c0a974e54552c4b42b49a813af07dcb9c99f8857e73b770d483b +size 407851 diff --git a/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/layout.json b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..82d0d73e9fcfbdd3021eba71176b909221e5778c --- /dev/null +++ b/hierarchicalandpartiallyobservablegoaldrivenpolicylearningwithgoalsrelationalgraph/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:243ec37f0095282bb3b1d031063d49dcda4f9392fad1e1c9098f9685c73b52f7 +size 432071 diff --git a/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_content_list.json b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e658546500fabce8c200bc58e8026b0f04c4b5cd --- /dev/null +++ b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9eb9b53904813676532be6baae4d41d346acf12494ebc806f07c654ec17a1f4 +size 73677 diff --git a/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_model.json b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3aeb594b0fc3db63c96ec160bc89304313675ce7 --- /dev/null +++ b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6880797c9e35a5b9f815ab537042b2e122aa3f02afbfb7fd671619d476b762e +size 90247 diff --git a/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_origin.pdf b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0104992cfd7fa3c44961a4ecc70067d64ddec50e --- /dev/null +++ b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/ac192d6f-c89a-43e5-984e-41c29c699053_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feab3d68738792a54810b36b3bf43b136d628198a618e9263ef39a4e13b9b22c +size 2095839 diff --git a/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/full.md b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c58699ae0fa978126477a93087fd0e97080f74fe --- /dev/null +++ b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/full.md @@ -0,0 +1,267 @@ +# Hierarchical Layout-Aware Graph Convolutional Network for Unified Aesthetics Assessment + +Dongyu She $^{1}$ , Yu-Kun Lai $^{2}$ , Gaoxiong Yi $^{3}$ , Kun Xu $^{1*}$ + +$^{1}$ Tsinghua University $^{2}$ Cardiff University $^{3}$ Tencent + +# Abstract + +Learning computational models of image aesthetics can have a substantial impact on visual art and graphic design. Although automatic image aesthetics assessment is a challenging topic by its subjective nature, psychological studies have confirmed a strong correlation between image layouts and perceived image quality. While previous state-of-the-art methods attempt to learn holistic information using deep Convolutional Neural Networks (CNNs), our approach is motivated by the fact that Graph Convolutional Network (GCN) architecture is conceivably more suited for modeling complex relations among image regions than vanilla convolutional layers. Specifically, we present a Hierarchical Layout-Aware Graph Convolutional Network (HLA-GCN) to capture layout information. It is a dedicated double-subnet neural network consisting of two LAGCN modules. The first LA-GCN module constructs an aesthetics-related graph in the coordinate space and performs reasoning over spatial nodes. The second LA-GCN module performs graph reasoning after aggregating significant regions in a latent space. The model output is a hierarchical representation with layout-aware features from both spatial and aggregated nodes for unified aesthetics assessment. Extensive evaluations show that our proposed model outperforms the state-of-the-art on the AVA and AADB datasets across three different tasks. The code is available at http://github.com/days1011/HLAGCN. + +# 1. Introduction + +Automatic image aesthetics assessment (IAA) has attracted increasing attention in recent years due to its potential applications, e.g., image retrieval, album photo recommendation, image enhancement [7,14,44], etc. Early efforts focus on extracting elaborately designed hand-crafted features according to the known photographic principles, e.g., the rule-of-thirds [8], color harmony [35], and global + +![](images/fcf4538fbe3d6ffea80a6c03c342476ef8cb467c710c8760c7f6e189f4111922.jpg) +(a) + +![](images/ac5f12c83039c7db8771c2c5f678b315ae86a1d568ed406cdae010dfcc3b48fe.jpg) + +![](images/8e4ddf36d6310cb83670ff4c8222608f5d2678a22c3f937737839541ab9afdea.jpg) +(b) +Figure 1. To capture layout information over the whole input space, we first partition an image into spatial nodes. Features from the disjoint regions (denoted in colors) in the coordinate space are then projected into the latent space for efficient graph reasoning. + +image layout [16, 30]. With the advance of Convolution Neural Networks (CNNs) [20], recent methods aim to map image aesthetics to different types of formulations using CNNs, i.e., binary classification labels [25, 40], aesthetic scores [37] and their distributions [3, 10, 11]. Although significant progress has been achieved, the performance of employing CNNs for IAA is often compromised due to the following two main inherent constraints. + +First, general deep aesthetic models require additional operations (e.g., cropping, warping, or padding) to generate the fixed-size input needed for mini-batch compatibility. However, the altered object aspect ratios or image layouts often impair the image aesthetics and introduce label noise for representation learning. Several methods try to address such limitations by either feeding the original-sized images [10, 29] or incorporating multiple patches [28, 41] into the network, which slows down the training and inference process significantly. Second, the layout information is crucial for assessing visual aesthetics since the appropriate arrangement of visual elements in the photograph can add balance and harmony [31, 46]. For example, Fig. 1 (a) + +shows an example from $DPChallenge^{1}$ , an on-line community for photography amateurs. In this landscape scene, five denoted elements including sky, sailboats, lake and reef, are presented with a comfortable and balanced layout collectively manifesting the high-level aesthetics, which won first place with an average vote of 7.83. However, due to the inherent limitation of the regular receptive field, the convolution operations of CNNs are typically inefficient at capturing relations among distant regions in the coordinate space. + +To address these problems, we propose a double-subnetwork framework based on the Graph Convolution Networks (GCNs) [17], leveraging layout information for assessing visual aesthetics. Specifically, we first use a Fully Convolutional Network (FCN) to preserve the spatial information of the convolutional feature maps, which are viewed as representations of nodes throughout the entire spatial grid. Based on the spatial nodes, we construct an aesthetics graph by connecting every pair of nodes to form edges, and embedding the information regarding content similarity and aspect ratio-embedded spatial relations between nodes as edge weights. Then instead of relying solely on standard convolutions to model aesthetic information, the proposed $1^{\mathrm{st}}$ Layout-Aware Graph Convolutional Network (LA-GCN) module performs graph convolutions on the graph. To enable efficient global reasoning over disjoint regions, we further propose to aggregate nodes with similar semantics in a latent space and perform graph reasoning via the $2^{\mathrm{nd}}$ LA-GCN module, as shown in Fig. 1 (b). By fusing features from both spatial and aggregated nodes, our Hierarchical LA-GCN empowers the GCN model with the capacity of learning hierarchical representation for IAA. + +Our contributions are summarized as follows: First, we present a layout-aware graph convolution module to explicitly relate the aesthetic perception to the image layout attributes in an end-to-end fashion; second, we propose the HLA-GCN (Hierarchical LA-GCN) by extending the LAGCN module to a hierarchical architecture for learning visual representations from both coordinate and latent spaces. Our proposed framework performs favorably against the state-of-the-art methods on the AVA and AADB datasets for unified aesthetics assessment, i.e., quality classification, score regression, and distribution prediction. + +# 2. Related Work + +In this section, we provide a brief review of image aesthetics assessment (IAA) methods [3, 7, 42, 47] especially those on preserving image layouts and compositions as well as graph-based representation learning methods [4, 13, 17, 39] that are closely related to our work. + +Image Aesthetics Assessment Conventional methods design image layouts by approximating simple photogra + +phy composition guidelines, e.g., visual balance, rule of thirds, and diagonal dominance [36, 46, 49], while recent efforts focus on using CNN for learning aesthetic representations [3, 7, 42]. As aesthetics can be influenced by the transformations applied to the input, several existing CNN methods try to overcome the limitations by designing multi-column architectures that take multiple patches as inputs and aggregate their contributions to the aesthetics score [26-29]. Kao et al. [15] propose to learn aesthetic features by dividing the images into different categories and training associated networks capturing different information in terms of scene, object, and texture. In addition, MNA-CNN [29] proposes to preserve compositions by feeding the original image into the network once at a time, which is not mini-batch compatible since images with different aspect ratios cannot be concatenated into batches. Ma et al. [28] propose A-Lamp to crop salient patches from the original image without any transformation, and then build an attribute relation graph over these regions to preserve the spatial layout of the image. As A-Lamp requires a manually designed aggregation structure, Liu et al. [25] propose to use GCN to model the mutual dependencies of the local regions. However, these methods do not explicitly build aesthetics-related graph for modeling complex relations among image regions which is an important cue for aesthetics assessment. + +Graph-based Representation Learning Graph-based methods have shown to be an efficient approach to relation reasoning. Early efforts including CRFs (Conditional Random Fields) [2] and random walk networks [1] are proposed based on the graph model for effective image segmentation. Recently, a great deal of research on generalizing convolution to graph-based data has emerged [5, 17, 24, 34]. Among these methods, the Graph Convolution Network (GCN) [17] serves as a simplified model with a 1-st approximation of the Chebyshev expansion, which restricts the convolution to operating locally. Wang et al. [45] propose to capture relations between regions detected by an object detector via GCN, while Chen et al. [4] propose a generic trainable module Global Reasoning unit for reasoning between disjoint and distant regions. In this paper, we exploit the reasoning power of GCN to build an aesthetics-related graph for relation reasoning in both coordinate and latent spaces. + +# 3. Methodology + +In this section, we first provide an overview of the proposed hierarchical layout-aware graph convolutional network. Then we present the core LA-GCN module and extend the proposed module to a hierarchical architecture for learning aesthetic representations on both coordinate and latent spaces. Finally, we give the problem formulation of unified aesthetic assessment task and loss function. + +![](images/91a91025ef05960e466eede9655d7b21e2ba3a3a46f0c8b9fb09950a70e99d27.jpg) +Figure 2. Illustration of the proposed HLA-GCN framework for unified aesthetics assessment. It takes a warped image associated with its aspect ratio as input, which is passed through the fully convolutional layers of CNN. Each channel-wise vector of the obtained feature maps is viewed as a node representation of the corresponding spatial region. The proposed $1^{\mathrm{st}}$ LA-GCN module is followed to construct the aesthetics graph and perform graph reasoning over all the spatial locations. Then the spatial nodes are aggregated by projecting node representations from the coordinate space to the latent space. Based on the aggregated nodes, the $2^{\mathrm{nd}}$ LA-GCN module constructs a fully-connected graph and performs graph reasoning over significant regions. Finally, the features of both spatial and aggregated nodes are fused as a hierarchical representation for aesthetics prediction. + +# 3.1. Overview + +Motivated by overcoming the inherent limitations of convolution operations, the proposed HLA-GCN aims to model a hierarchical image layout by performing graph reasoning on both coordinate and latent spaces. The architecture of the proposed framework is shown in Fig. 2. Given the input aesthetic image, we view the extracted feature maps as representations of nodes throughout all spatial locations. The proposed framework performs graph reasoning over all the spatial nodes and aggregated significant nodes via two LA-GCN modules. Considering both content and spatial relations, the $1^{\mathrm{st}}$ LA-GCN constructs an aesthetics-related graph and applies graph convolution on all the spatial nodes. By performing graph reasoning in the coordinate space, the proposed framework can model the overall image layout of different visual elements. Furthermore, we propose a node aggregation strategy to aggregate significant nodes in a latent space, where a set of disjoint regions with similar semantics can be projected onto a single representation. The $2^{\mathrm{nd}}$ LA-GCN is employed to perform relation reasoning over the graph constructed in the latent space. Finally, both spatial and aggregated nodes are fused as a hierarchical representation for unified aesthetic assessment. + +# 3.2. Layout-aware GCN Module + +Given the aesthetic image, we first extract the FCN feature map of shape $W \times H \times C$ , where $W$ , $H$ , and $C$ denote the spatial size, i.e., width and height, and the channel-wise + +dimension, respectively. As the spatial information is preserved after FCN, we can view the feature map as node representations $\mathbf{X} = [\mathbf{x}_1,\mathbf{x}_2,\dots ,\mathbf{x}_L]\in \mathbb{R}^{L\times C}$ throughout the entire spatial grid, where $L = W\times H$ denotes the total number of spatial locations. To model relations between regions, we construct an aesthetics-related graph based on the node representations. Then by performing graph convolution on the graph, feature maps can be refined by message passing among nodes, resulting in layout-aware visual representations. + +Graph Building Considering $L$ nodes associated with the node representations $\mathbf{X}$ , we first construct an undirected fully connected graph $G_{c} = (\mathcal{V}_{c},\mathcal{E}_{c},A_{c})$ in the coordinate space. Here, $G_{c}$ is constructed by its nodes $\nu_{c}$ , the set of edges connecting nodes $\mathcal{E}_c$ and adjacent matrix $A_{c}$ describing the edge weights. The adjacent matrix is defined according to two main types of pair-wise relations, i.e., content similarity, and spatial relations, as follows: + +$$ +\mathbf {A} _ {c} = \mathbf {A} ^ {\text {s i m}} + \mathbf {A} ^ {\text {s p a}} \tag {1} +$$ + +Specifically, we first measure the content relations between region nodes using cosine similarity as follows: + +$$ +\operatorname {s i m} \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}\right) = \frac {< \phi \left(\mathbf {x} _ {i}\right) , \phi^ {\prime} \left(\mathbf {x} _ {j}\right) >}{\| \phi \left(\mathbf {x} _ {i}\right) \| \| \phi^ {\prime} \left(\mathbf {x} _ {j}\right) \|}, \tag {2} +$$ + +where $\| \cdot \|$ represents the $\ell_2$ -norm and $< \cdot, \cdot >$ denotes the inner product. Here, $\phi(\mathbf{x}_i) = \omega \mathbf{x}_i$ and $\phi'(\mathbf{x}_j) = \omega' \mathbf{x}_j$ + +are two linear transformations applied for increasing generalization ability [25, 45], and $\omega, \omega' \in \mathbb{R}^{C \times C}$ are learnable parameters that can be optimized via back propagation. After computing the pairwise similarity matrix, we obtain the affinity matrix $\mathbf{A}^{\mathrm{sim}} \in \mathbb{R}^{L \times L}$ and adopt the softmax function for normalization on each row of the matrix by: + +$$ +\mathbf {A} _ {i j} ^ {\text {s i m}} = \frac {\exp \left(s i m \left(\mathbf {x} _ {i} , \mathbf {x} _ {j}\right)\right)}{\sum_ {k = 1} ^ {L} \exp \left(s i m \left(\mathbf {x} _ {i} , \mathbf {x} _ {k}\right)\right)}, \tag {3} +$$ + +where $\exp (\cdot)$ is the exponential function. In addition to visual contents, image aesthetics can also be affected by the spatial composition of visual elements [28, 43]. As stated in Sec. 1, common preprocessing operations (e.g., cropping, warping) alter image composition and may introduce label noise for representation learning. To address the problem, we adopt layout-preserving warping that preserves the aspect ratio information of the original image, as shown in Fig. 3 (a). As most current CNN models only take square images as input (i.e., $W = H$ ), the aspect ratio is computed by $r = \frac{w}{h}$ . We embed the aspect ratio information by considering spatial relations between pairwise nodes in the graph. To be specific, for the $i$ -th node and $j$ -th node, we denote their coordinates in the original feature maps as $(s_i^x,s_i^y)$ and $(s_j^x,s_j^y)$ , where $1\leqslant s_i^x,s_j^x\leqslant W$ and $1\leqslant s_i^y,s_j^y\leqslant H$ . The spatial relation between region nodes is then computed by the aspect-ratio-embedded distance: + +$$ +d i s (i, j) = \left\{ \begin{array}{l l} \sqrt {(\Delta s _ {x} \cdot r) ^ {2} + \Delta s _ {y} ^ {2}}, & \text {i f} r < 1 \\ \sqrt {\Delta s _ {x} ^ {2} + (\frac {\Delta s _ {y}}{r}) ^ {2}}, & \text {i f} r \geqslant 1 \end{array} \right. \tag {4} +$$ + +where $\Delta s_{x} = s_{i}^{x} - s_{j}^{x}$ and $\Delta s_{y} = s_{i}^{y} - s_{j}^{y}$ . Similarly, the affinity matrix $\mathbf{A}^{\mathrm{dis}}\in \mathbb{R}^{L\times L}$ can be obtained with softmax normalization: + +$$ +\mathbf {A} _ {i j} ^ {\mathrm {s p a}} = \frac {\exp (- d i s (i , j))}{\sum_ {k = 1} ^ {L} \exp (- d i s (i , k))}. \tag {5} +$$ + +Intuitively, the spatial relation between nodes shares a similar idea as the receptive field where the features of neighboring nodes are utilized during convolution. Different from convolution considering the receptive field with fixed size (e.g., $3 \times 3$ ), our spatial relation provides a more flexible way that incorporates 'dynamic receptive field' by adjusting the weights of neighbors for images with different aspect ratios. Fig. 3 (b) shows the weights of adjacent matrix by taking the node in the green box as the anchor. As can be seen, the content similarity matrix enables the network to exploit the semantically related regions, while the spatial relation matrix considers a more flexible receptive field according to the original image's aspect ratio. Combining these aesthetics-related attributes, we can obtain the graph $A_{c}$ in Eqn. (1). + +![](images/018967fee52fe4e8a14dacff7ca01fff19b7d0314ea21e460755bbbe1791c185.jpg) +Figure 3. Illustration of layout-aware graph reasoning. For the warped input, we preserve the image aspect ratio by encoding it to the spatial relations, and capturing the semantic information through content similarity. Then the aesthetic graph can be built to guide message passing between the anchor node (denoted in the green bounding box) and the neighbors. Best viewed in color. + +Graph Reasoning After the aesthetics-related graph is constructed, we then perform reasoning on the graph via graph convolutions. Compared with standard convolutions that have the intrinsic limitation on a regular receptive field, the graph convolutions are able to pass messages among neighbors of each node based on defined relations [4, 45]. Formally, the proposed LA-GCN can be formulated as follows, + +$$ +\mathbf {H} _ {c} ^ {(m + 1)} = \sigma (\tilde {\mathbf {A}} _ {c} ^ {(m)} \mathbf {H} _ {c} ^ {(m)} \Theta_ {c} ^ {(m)}), \tag {6} +$$ + +where $\mathbf{H}_c^{(m)}$ is the activation in the $m$ -th layer, and $\mathbf{H}_c^{(0)} = \mathbf{X}, \Theta_c^{(m)} \in \mathbb{R}^{C \times C}$ is the trainable weight matrix of the $m$ -th layer. Note that we add a self-loop to each node in the graph following [4, 23], thus the adjacency matrix of the graph is $\tilde{\mathbf{A}}_c^{(m)} = \mathbf{A}_c^{(m)} + \mathbf{I}$ , where $\mathbf{A}_c^{(m)}$ is computed by Eqn. (1) using the feature map of the current layer $\mathbf{H}_c^{(m)}$ . The identity matrix $\mathbf{I}$ serves as a shortcut connection alleviating the vanishing gradient problem during training, which leads to stable updating during graph message passing. After each layer of graph convolution except for the last layer, we use ReLU as the activation function $\sigma(\cdot)$ on the output. + +# 3.3. Hierarchical Prediction Architecture + +The proposed $1^{\mathrm{st}}$ LA-GCN incorporates the holistic layout attributes via an aesthetics-related graph in the coordinate space $\Omega$ . To describe image layouts effectively, we further aggregate graph nodes to high-level attributes in the latent space $\mathcal{H}$ , where each node is aggregated from a set of disjoint regions in $\Omega$ . Specifically, given the input representation $\mathbf{X} \in \mathbb{R}^{L \times C}$ we first project the original features + +to $\mathbf{Z} \in \mathbb{R}^{K \times C}$ , where $K$ is the number of aggregated nodes in the latent space. Similar to [4], we formulate the projection function as a linear combination (i.e., weighted global pooling) of original features such that the new features can aggregate information from multiple regions. In particular, the feature $\mathbf{z}_i \in \mathbb{R}^{1 \times C}$ of the projected node can be denoted as: $\mathbf{z}_i = \mathbf{b}_i\mathbf{X} = \sum_{j=1}^L b_{ij}\mathbf{x}_j$ , where the weights $\mathbf{B} = [\mathbf{b}_1, \mathbf{b}_2, \dots, \mathbf{b}_K] \in \mathbb{R}^{K \times L}$ are learnable during end-to-end training. We note that the above equation gives a more generic formulation than existing methods [28, 41] that require additional object bounding boxes. + +Based on these $K$ aggregated nodes, we further construct the graph $G_{l} = (\mathcal{V}_{l},\mathcal{E}_{l},A_{l})$ and perform the graph reasoning with the $2^{\mathrm{nd}}$ LA-GCN, denoted as: + +$$ +\mathbf {H} _ {l} ^ {(m + 1)} = \sigma \left(\tilde {\mathbf {A}} _ {l} ^ {(m)} \mathbf {H} _ {l} ^ {(m)} \Theta_ {l} ^ {(m)}\right), \tag {7} +$$ + +where $\mathbf{H}_l^{(m)}$ is the refined representation in the $m$ -th layer, and the initial node representation $\mathbf{H}_l^{(0)} = \mathbf{Z}$ . We denote the trainable weights of LA-GCN as $\Theta_l^{(m)} \in \mathbb{R}^{C \times C}$ . Similarly, $\tilde{\mathbf{A}}_l^{(m)} = \mathbf{A}_l^{(m)} + \mathbf{I}$ . Note that $\mathbf{A}_l^{(m)}$ only considers the content similarity in Eqn. (3) due to the non-Euclidean geometry of the latent space, which is also computed using the feature map of the current layer $\mathbf{H}_l^{(m)}$ . To make the module compatible with the $1^{\mathrm{st}}$ LA-GCN module, we map the output features back of the $2^{\mathrm{nd}}$ LA-GCN to the original coordinate space using reverse projection without sacrificing efficiency or effectiveness [4]. Assuming that the output from the $2^{\mathrm{nd}}$ LA-GCN is $\mathbf{H}_l \in \mathbb{R}^{K \times C}$ , the representations projected in the coordinate space can be obtained by $\widehat{\mathbf{H}}_l = \mathbf{B}^\top \mathbf{H}_l \in \mathbb{R}^{L \times C}$ . Given the outputs $\mathbf{H}_c$ and $\widehat{\mathbf{H}}_l$ from two modules, the global average pooling and fully connected layers are added to each output, mapping the representations to score distributions $\hat{\mathbf{p}}_c, \hat{\mathbf{p}}_l \in \mathbb{R}^S$ . Thus, the final predicted distributions can be denoted as: $\hat{\mathbf{p}} = \frac{\sigma(\hat{\mathbf{p}}_c) + \sigma(\hat{\mathbf{p}}_l)}{2}$ . + +# 3.4. Problem Formulation + +Generally, there are three kinds of aesthetic labels (i.e., the mean score, binary class, and distribution), which are treated as different IAA problems in previous methods [27, 28, 41]. Following a recent trend [47], our objective is to learn a deep network that allows solving all three IAA tasks using a single model trained for the distribution prediction task, which can provide more supervisions about image aesthetics. + +Formally, assuming that we have $N$ sample images, raw annotations are first collected in the form of score histograms and then $\ell_1$ -normalized as the aesthetic score distributions. The ground truth distribution can be denoted as $\mathbf{p} = [p^{(1)}, p^{(2)}, \dots, p^{(S)}]$ , where $\sum_{s=1}^{S} p^{(s)} = 1$ . In AVA [33], the total number of score bins $S$ is 10, and thus + +each vote ranges from 1 to 10. Following the previous methods [3, 42], our framework is optimized to predict the aesthetic score distribution by minimizing the EMD (Earth Mover's Distance) loss [42] with the ordered distribution distance as follows: + +$$ +\mathcal {L} (\mathbf {p}, \hat {\mathbf {p}}) = \left(\frac {1}{S} \sum_ {k = 1} ^ {S} | C D F _ {\mathbf {p}} (k) - C D F _ {\hat {\mathbf {p}}} (k) | ^ {\hat {r}}\right) ^ {1 / \hat {r}}, \tag {8} +$$ + +where $CDF_{\mathbf{p}}(k) = \sum_{i=1}^{k} p^{(i)}$ is the cumulative distribution function. During the inference phase, our framework directly predicts the distribution $\hat{\mathbf{p}}$ , and then aesthetic score $\hat{\mu}$ and binary class $\hat{c}$ can be inferred accordingly. Mean aesthetic scores are formulated as the average rating scores $\hat{\mu} = \sum_{s=1}^{S} s \times \hat{p}^{(s)}$ , and binary class labels $\hat{c} \in \{0,1\}$ can be assigned by thresholding the average score with $\hat{c} = 1 (\hat{\mu} \geqslant \lceil \frac{S}{2} \rceil)$ , where $1(\cdot)$ the indicator function. + +# 4. Experiments + +In this section, we evaluate the proposed method against state-of-the-art algorithms to demonstrate the effectiveness of HLA-GCN for three IAA tasks. + +# 4.1. Datasets + +AVA dataset [33] is the largest publicly available benchmark in the research field of IAA, which contains more than $25k$ images collected from DPChallenge. Each image is rated by an average of 210 users, and the ratings range from 1 to 10 with 10 being the highest aesthetic score. The obtained score histogram is $\ell_1$ -normalized to generate our target training and testing distributions. For the binary aesthetics task, images with average scores smaller than 5 are labeled with low-level aesthetics, and the other images are labeled as high-level aesthetics following the same routine as [25, 29, 42]. We employ the training/test split provided by [22] and randomly sample 2,000 images from the training set for validation. Since some images are not available, our experiments use a total of 235,503 images for training/validation and 19,997 images for testing. + +AADB dataset includes 10,000 photographic images collected from Flickr. Each image is annotated by, on average, five people with integer scores ranging from 1 to 5. Following the previous work [18, 19, 21], we use the standard split with 8,500 images for training, 500 images from validation, and 1,000 images for testing. We normalize the score histogram to generate distributions and discard about 100 images that have only one rating following [47]. + +# 4.2. Experimental Setup + +Training and Implementation We use ResNet-50 and ResNet-101 [9] pretrained on ImageNet [6] as the backbone of our proposed framework. The entire model is optimized by minimizing the EMD loss with $\hat{r} = 2$ using + +Table 1. Comparison with the SOTA methods on AVA. Note that $\dagger$ and $\ddagger$ denote that multi-patches and additional annotations are used for aesthetics assessment, respectively. We also show the backbone and input image size of each method. Here, $\text{Resize}(\cdot)$ denotes that the smaller image dimension of input is resized to a specified dimension while maintaining the original aspect ratio. The results were quoted from their original papers, and $-$ denotes the unreported metrics. The corresponding training and testing splits are also shown. + +
MethodsNetworkImage SizeSplitClassificationScore RegressionDistribution
Accuracy ↑SRCC ↑LCC ↑MSE ↓EMD1 ↓EMD2 ↓
DMA-Net [27]†AlexNet227 × 227from [33]75.4 %-----
MNA-CNN [29]†VGG16224 × 224from [33]77.1 %-----
Zeng et al. [47]ResNet-101384 × 384from [33]80.8 %0.7190.7200.275-0.065
APM [32]ResNet-101Resize(500)from [33]80.3 %0.7090.279-0.061
A-Lamp [28]†VGG16224 × 224from [33]82.5 %-----
MPada[41]†ResNet-18224 × 224from [33]83.0 %-----
RGNet [25]ResNet-101300 × 300from [33]82.5 %-----
Hosu et al. [10]InceptionResNetFull resolutionfrom [33]81.7 %0.7560.757---
NIMA [42]Inception-v2299 × 299random81.5 %0.6120.636-0.050-
AFDC [3]ResNet-50320 × 320random83.0 %0.6490.6710.2710.045-
PA_IAA [22]‡Inception-v3299 × 299from [22]83.7 %0.677--0.047-
PA_IAA [22]‡DenseNet-121224 × 224from [22]82.9 %0.666--0.049-
HLA-GCNResNet-50300 × 300from [22]84.1%0.6560.6780.2640.0450.065
HLA-GCNResNet-101300 × 300from [22]84.6%0.6650.6870.2550.0430.063
+ +Table 2. Comparison results on AADB. Our HLA-GCN is based on the ResNet-50. Note that $-$ denotes the unreported metrics. + +
MethodsSRCCLCCMSEEMD1EMD2
Reg-Net [19]0.678-0.1268--
NIMA [42]0.708----
RGNet [25]0.710----
PAC-Net [18]0.837----
Lee et al. [21]0.879-0.1141--
HLA-GCN0.8990.90370.09800.08420.1093
+ +stochastic gradient descent (SGD) following [42]. During training, we employ the layout-preserving warping introduced in Sec. 3.2, which rescales each image to the size of $300 \times 300$ associated with the original aspect ratio. To avoid over-fitting, common data augmentations [25, 42] are adopted on the rescaled images as preprocessing, including randomly flipping training images horizontally and scaling images 1.05 times followed by random cropping. The size of output feature maps after FCN is $10 \times 10$ , and we first add a $1 \times 1$ convolutional layer to reduce the channel-wise dimension to 1024, which is followed by the $1^{\text{st}}$ LA-GCN with 3 graph convolution blocks and the $2^{\text{nd}}$ LA-GCN with 1 block for representation learning. In practice, we set the number of the aggregated nodes $K$ to be $\frac{1}{4}$ of the number of total nodes following [4], i.e., $K = 25$ . We train the network on a machine with four NVIDIA GeForce GTX 1080 Ti and use a mini-batch size of 100 images running for a total of 20 epochs. The initial learning rate is set to 0.01 for the first 6 epochs and dampened to 0.001 for the rest epochs and we use the default weight decay of $5e^{-4}$ with a momentum of 0.9. + +We implement our proposed framework on two different deep learning platforms: PyTorch [38] and Jittor [12]. Experiments (as shown in Tab. 3) show that the implementation using Jittor yields faster inference than that using Py + +Table 3. Inference speed comparison between PyTorch and Jittor. The boldface denotes the faster framework. Inference speed is the average results running on a single GPU with a batch size of 32. + +
PlatformTime per image (ms/im)Iterations per second (it/s)
PyTorch [38]3.87048.0742
Jitter [12]3.62118.6300
+ +Torch, thanks to the powerful just-in-time compiler of Jittor. Evaluation We employ six commonly used metrics to evaluate three IAA tasks following [42]. Accuracy is reported for binary aesthetic quality classification. For aesthetic score regression, we report Spearman's Rank Correlation Coefficient (SRCC), Linear Correlation Coefficient (LCC) and Mean Squared Error (MSE). For the distribution prediction, EMD with $\hat{r} = 1$ and $\hat{r} = 2$ are both reported, denoted by $\mathrm{EMD}_1$ and $\mathrm{EMD}_2$ , respectively. + +# 4.3. Comparison with State-of-the-Art Results + +Tab. 1 and Tab. 2 show the results of the state-of-the-art aesthetics prediction models on both AVA and AADB datasets. As seen, our proposed HLA-GCN consistently performs favorably against the state-of-the-art methods for the unified aesthetics assessment. For the binary classification task, compared with multiple-patches methods [27-29, 41], our proposed framework achieves better accuracy and alleviates efforts to aggregate sampling prediction by learning discriminative features directly from the complete images. For example, A-Lamp [28] focuses on capturing the spatial layout of images via a complicated path sampling strategy and manually designed aggregation structure, which crops 50 groups of patches from the original image. Our end-to-end framework is much more efficient without feeding multiple cropping patches and outperforms such a + +Table 4. Results on AVA [33] using different variants of the proposed model. Note that all models are based on ResNet-50 and optimized using EMD loss with an input size of ${300} \times {300}$ . Training speed is the average results running on a single GPU with a batch size of 16. + +
Models#ParamsSpeedClassificationScore RegressionDistribution
Accuracy ↑SRCC ↑LCC ↑MSE ↓EMD1 ↓EMD2 ↓
Baseline23.5M6.8281.95 %0.60500.62900.3030.04700.0681
+ GCN [17]36.1M6.0983.60 %0.63000.63700.2830.04600.0664
+ GloRe [4]25.8M5.0583.46 %0.61500.63680.2800.04590.0660
+ LAGCN35.0M6.1583.96 %0.64800.66300.2700.04520.0648
+ LAGCN (w/o s.)35.0M6.2283.67 %0.63200.65300.2740.04560.0665
+ LAGCN (w/o c.)28.8M6.3583.56 %0.62400.64000.2850.04640.0671
+ GCN×248.8M5.6383.95 %0.64020.66200.2690.04540.0654
+ LAGCN×244.6M5.3383.98 %0.64890.67040.2660.04480.0648
+ HLA-GCN (Ours)38.2M5.8384.10 %0.65550.67760.2640.04510.0646
+ +method by $2.1\%$ . For the score regression and distribution prediction tasks, APM [32] and Hosu et al. [10] achieve the best results on SRCC and LCC since they explicitly keep the original image ratio for each image, while slows down the training phase significantly. Compared with the methods that supports mini-batch training on images with different aspect ratios [3, 42], our framework incorporating layout information shows a consistent improvement on all three tasks. On the AADB dataset, our method improves the performance by a large margin, illustrating that our proposed HLA-GCN can learn more discriminative and accurate aesthetic representations, resulting in better generalization ability for unified aesthetics assessment. + +# 4.4. Ablation Study + +To illustrate the effect of individual components, we conduct ablation studies by analyzing the following variants based on the ResNet-50 NIMA model. (1) GCN: this model adds typical GCN [17] after FCN with the same number of blocks (i.e., 3) as our first LA-GCN; (2) GloRe: this model adds Global Reasoning Unit (GloRe) [4] after FCN projecting the same number of nodes (i.e., 25) as our second LA-GCN; (3) LAGCN: this model is a truncated version of our HLA-GCN, in which the second LA-GCN and the fusion are removed. (4) LAGCN (w/o s.): this model follows LAGCN while discarding the spatial relation term in Eqn. (1); (5) LAGCN (w/o c.): this model follows LAGCN while discarding the content similarity term in Eqn. (1); (6) $\mathbf{GCN}^{\times 2}$ : this model replaces the LAGCNs in our HLA-GCN with two typical GCNs; (7) $\mathbf{LAGCN}^{\times 2}$ : this model replaces the second LA-GCN module in our HLA-GCN with the first LA-GCN module. (8) HLA-GCN: this is our proposed framework including all the components. All models are fine-tuned based on ResNet-50 and optimized using EMD loss with an input size of $300 \times 300$ . Tab. 4 shows the ablation study results and computation. The training speed, i.e., images per second, is reported by averaging timing results on a single GPU with a batch size + +![](images/57a109b67ec0a94517f5aae59b0a08b9660eaa755f201190d5bc58ca6108ac67.jpg) +Figure 4. Performance of our proposed HLA-GCN on the AVA validation set using different number of graph convolution blocks. The LCC results and number of model parameters are shown. + +of 16. + +Graph Reasoning Module We first study the case when only a single graph reasoning module is added to the baseline model. We compare the proposed $1^{\mathrm{st}}$ LA-GCN with typical GCN [17] employed in [25] and Global Reasoning Unit [4]. The results show that all graph-based models lead to better representations than the baseline CNN, while our proposed LA-GCN module further improves results by incorporating aesthetics-related attributes in graph reasoning. + +Choice of Adjacency Matrix To verify the effect of the constructed aesthetics-related graph, we directly discard the spatial relation or the content similarity in Eqn. (1) and see how the model performs. We find that SRCC will drop sharply from 0.6480 to 0.6240 without the content similarity while still outperforms the baseline model showing the advance of 'dynamic receptive field'. When the spatial relation matrix is discarded, the performance also declines. Such results demonstrate that both the spatial information and semantic-aware content are significant attributes and complementary for aesthetics assessment. + +Leveraging Multiple Representations To verify that the improvement of HLA-GCN is not just because it has more parameters to the network backbone, we further compare + +![](images/75fd99d83c97c764edc2602ed46ac859578a2ecf91cfdf1e2bc88069ef7e3b0e.jpg) +Figure 5. Aesthetic quality prediction results. The ground truth (GT) and predicted (Pre) scores are shown underneath each image. The specific prediction of the first and second LA-GCNs are also shown in brackets in order. The quality is highlighted in different colors, red and blue denote low-level and high-level aesthetics, respectively. The third row shows several typical failure cases. + +with different double-subnet models. The results show that although stacking GCNs has more parameters, our proposed framework with dedicated design is more effective for learning aesthetic representations. In addition, introducing two LAGCNs in the coordinate space is less effective, mainly due to the overfitting problem. + +Graph Convolution Layers Fig. 4 shows the validation results of our proposed method using different numbers of graph convolution blocks in the $1^{\text{st}}$ LA-GCN. It shows that with the increase of block number from 1 to 3, the performance is boosted, while further increasing the block number leads to no significant improvement. Therefore, we choose to use three blocks of graph convolution for the $1^{\text{st}}$ LA-GCN making a tradeoff between performance and model size. In addition, for the $2^{\text{nd}}$ LA-GCN, we found no significant difference when using more blocks and thus use one block of graph convolution. + +# 4.5. Model Interpretation + +Prediction Results We first show prediction results from the test set of AVA using our proposed HLA-GCN. In Fig. 5, the first row shows the examples that are predicted with low assessment errors. We find that differences between most low-aesthetic and high-aesthetic quality primarily lie in the harmony of the entire image with a clear semantic meaning. When the images are presented with a simple scene, for example, images with clear foreground and background shown in the second row, the prediction of aesthetics can be more ambiguous and difficult. Due to the concise appearance, these images are misclassified to high-aesthetic quality by the first LA-GCN module, while the second LA + +![](images/445adc12f46cffdaad3b25bf6cd9bd0e074f502b1d183b2e5204d074244d39da.jpg) +Figure 6. Qualitative results of Class Activation Maps. Given the input image, we extract FCN features and refined features after the first LA-GCN using our proposed model, and visualize the feature response via CAM. The ground truth aesthetic score is also given above each input image. Best viewed in color. + +GCN module lessens the confidence mainly due to little interaction in the latent space. Besides, we also show several failure cases in the last row, where images that exhibit large prediction errors tend to require a more abstract high-level understanding of semantics. + +Class Activation Maps To visualize aesthetics-specific activation within the model, we directly extract Class Activation Maps (CAM) [48] from our fine-tuned HLA-GCN. The activation of feature maps after FCN and the first LA-GCN module are shown in Fig. 6. As can be seen, the attended region (highlighted in red) is able to cover highly correlated objects in the scene after graph convolution, which illustrates that our proposed module refines the FCN features by incorporating image layout information in the network. + +# 5. Conclusion + +In this paper, we present HLA-GCN, an end-to-end graph-based representation learning framework for image aesthetics assessment. Our proposed method builds a graph representing visual elements and their aesthetics-related attributes, including aspect-ratio-embedded spatial information and semantic-aware contents. By performing graph convolutions, the interactions over the aesthetics-related graph are modeled in both the coordinate space and latent space, leading to the layout-aware hierarchical representation. Extensive evaluations show that our proposed model achieves state-of-the-art performance on the benchmark visual aesthetics datasets. + +Acknowledgements This work was supported by the National Natural Science Foundation of China (No. 61822204, 61521002), and the 2020 Tencent Rhino-Bird Elite Training Program. + +# References + +[1] Gedas Bertasius, Lorenzo Torresani, Stella X. Yu, and Jianbo Shi. Convolutional random walk networks for semantic image segmentation. In CVPR, 2017. 2 +[2] Siddhartha Chandra, Nicolas Usunier, and Iasonas Kokkinos. Dense and low-rank Gaussian CRFs using deep embeddings. In ICCV, 2017. 2 +[3] Qiuyu Chen, Wei Zhang, Ning Zhou, Peng Lei, Yi Xu, Yu Zheng, and Jianping Fan. Adaptive fractional dilated convolution network for image aesthetics assessment. In CVPR, 2020. 1, 2, 5, 6, 7 +[4] Yunpeng Chen, Marcus Rohrbach, Zhicheng Yan, Shuicheng Yan, Jiashi Feng, and Yannis Kalantidis. Graph-based global reasoning networks. In CVPR, 2019. 2, 4, 5, 6, 7 +[5] Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NIPS, 2016. 2 +[6] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. 5 +[7] Yubin Deng, Chen Change Loy, and Xiaou Tang. Image aesthetic assessment: An experimental survey. IEEE Signal Proc. Mag., 34(4):80-106, 2017. 1, 2 +[8] Sagnik Dhar, Vicente Ordonez, and Tamara L Berg. High level describable attributes for predicting aesthetics and interestingness. In CVPR, 2011. 1 +[9] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 5 +[10] Vlad Hosu, Bastian Goldlucke, and Dietmar Saupe. Effective aesthetics prediction with multi-level spatially pooled features. In CVPR, 2019. 1, 6, 7 +[11] Jingwen Hou, Sheng Yang, and Weisi Lin. Object-level attention for aesthetic rating distribution prediction. In ACM MM, 2020. 1 +[12] Shi-Min Hu, Dun Liang, Guo-Ye Yang, Guo-Wei Yang, and Wen-Yang Zhou. Jittor: a novel deep learning framework with meta-operators and unified graph execution. Information Sciences, 63(222103):1-21, 2020. 6 +[13] Jingjia Huang, Zhangheng Li, Nannan Li, Shan Liu, and Ge Li. Attpool: Towards hierarchical feature representation in graph convolutional networks via attention mechanism. In ICCV, 2019. 2 +[14] Dhiraj Joshi, Ritendra Datta, Elena A. Fedorovskaya, Quang-Tuan Luong, James Ze Wang, Jia Li, and Jiebo Luo. Aesthetics and emotions in images. IEEE Signal Proc. Mag., 28(5):94-115, 2011. 1 +[15] Yueying Kao, Kaiqi Huang, and Steve J. Maybank. Hierarchical aesthetic quality assessment using deep convolutional neural networks. Signal Process. Image Commun., 47:500-510, 2016. 2 +[16] Yan Ke, Xiaou Tang, and Feng Jing. The design of high-level features for photo quality assessment. In CVPR, 2006. 1 +[17] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017. 2, 7 + +[18] Keunsoo Ko, Jun-Tae Lee, and Chang-Su Kim. Pac-net: Pairwise aesthetic comparison network for image aesthetic assessment. In ICIP, 2018. 5, 6 +[19] Shu Kong, Xiaohui Shen, Zhe L. Lin, Radomír Mech, and Charless C. Fowlkes. Photo aesthetics ranking network with attributes and content adaptation. In ECCV, 2016. 5, 6 +[20] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In CVPR, 2012. 1 +[21] Jun-Tae Lee and Chang-Su Kim. Image aesthetic assessment based on pairwise comparison: a unified approach to score regression, binary classification, and personalization. In ICCV, 2019. 5, 6 +[22] Leida Li, Hancheng Zhu, Sicheng Zhao, Guiguang Ding, and Weisi Lin. Personality-assisted multi-task learning for generic and personalized image aesthetics assessment. IEEE Trans. Image Process., 29:3898-3910, 2020. 5, 6 +[23] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In AAAI, 2018. 4 +[24] Ruoyu Li, Sheng Wang, Feiyun Zhu, and Junzhou Huang. Adaptive graph convolutional neural networks. In AAAI, 2018. 2 +[25] Dong Liu, Rohit Puri, Nagendra Kamath, and Subhabrata Bhattacharya. Composition-aware image aesthetics assessment. In WACV, 2020. 1, 2, 4, 5, 6, 7 +[26] Xin Lu, Zhe Lin, Hailin Jin, Jianchao Yang, and James Zijun Wang. RAPID: rating pictorial aesthetics using deep learning. In ACM MM, pages 457-466, 2014. 2 +[27] Xin Lu, Zhe Lin, Xiaohui Shen, Radomir Mech, and James Zijun Wang. Deep multi-patch aggregation network for image style, aesthetics, and quality estimation. In ICCV, 2015. 2, 5, 6 +[28] Shuang Ma, Jing Liu, and Chang Wen Chen. A-Lamp: Adaptive layout-aware multi-patch deep convolutional neural network for photo aesthetic assessment. In CVPR, 2017, 1, 2, 4, 5, 6 +[29] Long Mai, Hailin Jin, and Feng Liu. Composition-preserving deep photo aesthetics assessment. In CVPR, 2016. 1, 2, 5, 6 +[30] Luca Marchesotti, Florent Perronnin, Diane Larlus, and Gabriela Csurka. Assessing the aesthetic quality of photographs using generic image descriptors. In ICCV, 2011. 1 +[31] Eftichia Mavridaki and Vasileios Mezaris. A comprehensive aesthetic quality assessment method for natural images using basic rules of photography. In ICIP, 2015. 1 +[32] Naila Murray and Albert Gordo. A deep architecture for unified aesthetic prediction. CoRR, abs/1708.04890, 2017. 6, 7 +[33] Naila Murray, Luca Marchesotti, and Florent Perronnin. AVA: A large-scale database for aesthetic visual analysis. In CVPR, 2012. 5, 6, 7 +[34] Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In ICML, pages 2014-2023, 2016. 2 +[35] Masashi Nishiyama, Takahiro Okabe, Imari Sato, and Yoichi Sato. Aesthetic quality classification of photographs based on color harmony. In CVPR, 2011. 1 + +[36] Pere Obrador, Ludwig Schmidt-Hackenberg, and Nuria Oliver. The role of image composition in image aesthetics. In ICIP, 2010. 2 +[37] Bowen Pan, Shangfei Wang, and Qisheng Jiang. Image aesthetic assessment assisted by attributes through adversarial learning. In AAAI, 2019. 1 +[38] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NIPS, 2019. 6 +[39] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Trans. Neural Networks, 20(1):61-80, 2009. 2 +[40] Kekai Sheng, Weiming Dong, Mengei Chai, Guohui Wang, Peng Zhou, Feiyue Huang, Bao-Gang Hu, Rongrong Ji, and Chongyang Ma. Revisiting image aesthetic assessment via self-supervised feature learning. In AAAI, 2020. 1 +[41] Kekai Sheng, Weiming Dong, Chongyang Ma, Xing Mei, Feiyue Huang, and Bao-Gang Hu. Attention-based multipatch aggregation for image aesthetic assessment. In ACM MM, 2018. 1, 5, 6 +[42] Hossein Talebi and Peyman Milanfar. NIMA: Neural image assessment. IEEE Trans. Image Process., 27(8):3998-4011, 2018. 2, 5, 6, 7 +[43] Yi Tu, Li Niu, Weijie Zhao, Dawei Cheng, and Liqing Zhang. Image cropping with composition and saliency aware aesthetic score map. In AAAI, 2020. 4 +[44] Wenguan Wang, Jianbing Shen, and Haibin Ling. A deep network solution for attention and aesthetics aware photo cropping. IEEE Trans. Pattern Anal. Mach. Intell., 41(7):1531-1544, 2019. 1 +[45] Xiaolong Wang and Abhinav Gupta. Videos as space-time region graphs. In ECCV, 2018. 2, 4 +[46] Lei Yao, Poonam Suryanarayan, Mu Qiao, James Z. Wang, and Jia Li. OSCAR: on-site composition and aesthetics feedback through exemplars for photographers. Int. J. Comput. Vis., 96(3):353-383, 2012. 1, 2 +[47] Hui Zeng, Zisheng Cao, Lei Zhang, and Alan C Bovik. A unified probabilistic formulation of image aesthetic assessment. IEEE Trans. Image Process., 29:1548-1561, 2019. 2, 5, 6 +[48] Bolei Zhou, Aditya Khosla, Ågata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, 2016. 8 +[49] Zihan Zhou, Siqiong He, Jia Li, and James Ze Wang. Modeling perspective effects in photographic composition. In Xiaofang Zhou, Alan F. Smeaton, Qi Tian, Dick C. A. Bulterman, Heng Tao Shen, Ketan Mayer-Patel, and Shuicheng Yan, editors, ACM MM, 2015. 2 \ No newline at end of file diff --git a/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/images.zip b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..97f0031e03922a68775322bc747f5eab587bad43 --- /dev/null +++ b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24a38291a605e9760cc1992b5608b3494e21d020ad0da8b317dc3e61950bc089 +size 488877 diff --git a/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/layout.json b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3d2c23ebb693365d7c96aec6c34ca0d8dd11833e --- /dev/null +++ b/hierarchicallayoutawaregraphconvolutionalnetworkforunifiedaestheticsassessment/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9186d3c25ebea92f334fa4a0d8f6335f49e99bb8bcbdfeb632b4adf330fba87 +size 381456 diff --git a/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_content_list.json b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..14cb32049e206b52cd6e6f49259ba6726fe4d68c --- /dev/null +++ b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c79be4f9089b98e4f6179e1ccecb014e8e453f5f44532f1cc8ef9c8b0489c80 +size 89652 diff --git a/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_model.json b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0524cdd2d1a6af3db6ef0494adef85d1d0f0caf5 --- /dev/null +++ b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a28eb68e628b96bc8a2393c5672ba96356467a9b3870b33b43a0c9e55fb0330b +size 109683 diff --git a/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_origin.pdf b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ffbba439006671f18b0743f3b36717181f94868e --- /dev/null +++ b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/8072d980-bd83-4fbe-b3dc-78821587ec50_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:355948e1d03d41ee45670273119775b82f228103e361d8d87ee92e9113602ae0 +size 4383981 diff --git a/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/full.md b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8ed7d382479f63c74cc4081286a6603dbfff6098 --- /dev/null +++ b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/full.md @@ -0,0 +1,373 @@ +# Hierarchical Lovász Embeddings for Proposal-free Panoptic Segmentation + +Tommi Kerola $^{1*}$ Jie Li $^{2}$ Atsushi Kanehira $^{1}$ Yasunori Kudo $^{1}$ Alexis Vallet $^{1}$ Adrien Gaidon $^{2}$ $^{1}$ Preferred Networks, Inc. $^{2}$ Toyota Research Institute (TRI) + +# Abstract + +Panoptic segmentation brings together two separate tasks: instance and semantic segmentation. Although they are related, unifying them faces an apparent paradox: how to learn simultaneously instance-specific and category-specific (i.e. instance-agnostic) representations jointly. Hence, state-of-the-art panoptic segmentation methods use complex models with a distinct stream for each task. In contrast, we propose Hierarchical Lovász Embeddings, per pixel feature vectors that simultaneously encode instance- and category-level discriminative information. We use a hierarchical Lovász hinge loss to learn a low-dimensional embedding space structured into a unified semantic and instance hierarchy without requiring separate network branches or object proposals. Besides modeling instances precisely in a proposal-free manner, our Hierarchical Lovász Embeddings generalize to categories by using a simple Nearest-Class-Mean classifier, including for non-instance "stuff" classes where instance segmentation methods are not applicable. Our simple model achieves state-of-the-art results compared to existing proposal-free panoptic segmentation methods on Cityscapes, COCO, and Mapillary Vistas. Furthermore, our model demonstrates temporal stability between video frames. + +# 1. Introduction + +Holistic scene understanding is an important task in computer vision, where a model is trained to explain each pixel in an image, whether that pixel describes stuff – uncountable regions of similar texture such as grass, road or sky – or thing – a countable object with individually identifying characteristics, such as people or cars. While holistic scene understanding received some early attention [49, 55, 48], modern deep learning-based methods have mainly tackled the tasks of modeling stuff and things independently under the task names semantic segmentation and instance segmentation. Recently, Kirillov et al. proposed the panoptic quality (PQ) metric for unifying these two parallel tracks into the holistic task of panoptic segmentation [24]. Panoptic segmentation + +![](images/f1c333dd4c7f7102d8950a09c55e3ba25d063cbabd181c7b045fa114b74759e7.jpg) +Figure 1. Example panoptic segmentation using our method (bottom left). Predictions are decoded from our Hierarchical Lovász Embeddings, which encode both instance and class information. The rightmost columns illustrate distances in embedding space between all pixels and a target pixel in red (warmer colors denote smaller distances). We can see the hierarchical structure: pixels on the same instance being closest, and pixels on other instances in the same category being closer than pixels from other categories. + +is a key step for visual understanding, with applications in fields such as autonomous driving or robotics, where it is crucial to know both the locations of dynamically trackable things, as well as static stuff classes. For example, an autonomous car needs to be able to both avoid other cars with high precision, as well as understand the location of the road and sidewalk to stay on a desired path. + +A strong but complex baseline for panoptic segmentation is to run independent methods for semantic segmentation and instance segmentation, and then fusing the results. To improve upon this, previous works combine both tasks in a joint model [52, 23, 27]. Early methods focus more on a joint model and the majority of them leverage two-stage instance detection models [43, 52, 23, 29, 13]; some recent works propose bottom-up [15, 9, 53], yet instance and semantic segmentation are still treated separately. Performing panoptic segmentation as a single task without duplicated information across sub-tasks remains an interesting question. + +Intuitively, instances are contained in semantics, where semantic representations have higher variance in the embedding space to describe a general category, whereas instances have smaller variance to capture object-specific characteristics. This constitutes a natural hierarchical relationship between instances and semantics (cf. Figure 4). + +In this work, we propose to model panoptic segmentation as a unified task via a novel formulation of the problem: learning hierarchical pixel embeddings. Creating a unified embedding for the task opens up the potential of leverag- + +![](images/7ad4deb96be01dd26fa1438a41af063c2808cbbd3c148d7cb5f1068b661db402.jpg) +Figure 2. Overview of our method. We train a single-shot fully convolutional network to predict for each pixel $i$ a hierarchical embedding $\mathbf{e}_i$ as well as an instance seed $s_i$ and variance $\sigma_i$ . The seed map represents probable instance locations, and the variance defines the margins of the hierarchical embedding space. These are used for panoptic decoding of the embedding space. + +ing embedding space analysis as conducted in the natural language processing community [34, 37, 36, 35]. + +Leveraging hierarchical structure for representation learning is well studied [16, 14, 45]. However, previous work has not taken advantage of the semantic-instance visual hierarchy for end-to-end unified scene parsing. In this paper, we leverage advances in structural representation learning and encode "instance" and "category" features in a hierarchical embedding space. By doing so, we reduce the redundant information in the output space and optimize the information efficiency of network parameters for panoptic segmentation. + +Our main contribution is a novel representation learning approach for panoptic segmentation that treats it as a unified task. We propose a simple architecture and loss to learn pixel-wise embeddings to represent instances, object categories and stuff classes, thus enabling unified embedding-based single-shot panoptic segmentation. In particular, we leverage the Lovász hinge loss to learn a structured Hierarchical Lovász Embedding space where categories can be represented with categories jointly. An overview of our method is shown in Figure 2. + +Compared to conventional panoptic segmentation models, our model displays temporal stability between video frames, creating temporal smoothness in predictions that can be directly used in downstream applications such as object tracking and prediction in autonomous driving or mobile robotic systems, where data association is a key component (cf. Figure 8). Experiments on the Cityscapes [10], COCO [30] and Vistas [38] datasets show that our method establishes state-of-the-art results for proposal-free methods, and also yields competitive results compared with two-stage models. + +# 2. Related Work + +Deep learning-based dense prediction tasks have typically focused on either uncountable background or countable foreground objects. Semantic segmentation concerns the pixelwise segmentation of semantics, treating each object class as uncountable. Instance segmentation, on the other hand, focuses explicitly on countable foreground classes, such as per + +sons or cars. For the past few years, these tasks have evolved separately, with little interaction, leading to issues such as trouble with contextual clues in instance segmentation, or the confusion caused by the large variance of person classes in semantic segmentation. Recently, panoptic segmentation was proposed as a new task to bridge the gap between these methods and allow tackling them in a unified manner [24]. Embedding-based methods have recently become popular in the computer vision community for improving object detection [25, 57] and keypoint estimation [42]. In this section, we briefly review representative methods for each task. + +Semantic segmentation. Following the seminal work of Long et al. [33], semantic segmentation is typically treated as a pixel-wise classification task (although exceptions exist [21]), where a fully convolutional network with an encoder-decoder architecture is trained to output a high softmax score for the ground-truth class. There have been several improvements since then. Namely, SegNet [3] introduces unpooling layers for more accurate upsampling in the decoder. Conversely, Deeplab [7] proposed to use a network with dilated convolution instead of a decoder, and leverages pooling to capture global information. PSPNet [56] improves global context by leveraging pyramid pooling and dilated convolution. DeeplabV3+ [8] combines the advantages of pooling and encoder-decoder architectures to better capture contextual information and sharper object boundaries. + +Instance segmentation. Typical high-performing instance segmentation methods are variants of the Mask R-CNN [18] framework [32, 6]. These methods work in two stages, where the first stage computes regions of interest via a region proposal network, conducts non-maximum suppression on the proposed bounding boxes, and then runs a second stage via a head network on each proposal. While yielding high accuracy, these methods are typically too slow for real-time inference. Recently, there has been work addressing the creation of accurate single-shot (proposal-free) instance segmentation methods [2, 39, 15, 50]. In particular, Neven et al. [39] showed how to accurately predict a spatial embedding space + +for instance segmentation. Unlike previous methods, their network operates in a single stage and is able to produce an instance segmentation in a single shot, while having accuracy comparable to the more expensive Mask R-CNN. Their work inspires us to explore the possibility to learn a hierarchical embedding space for panoptic segmentation. + +Panoptic segmentation. The current dominant methods for panoptic segmentation are two-stage frameworks. Kirillov et al. [24] run PSPNet and Mask R-CNN independently to obtain semantics and instance predictions. They subsequently combine these using heuristics. Subsequent work was done to combine the independent networks into one, by adding a semantic segmentation branch to Mask R-CNN [23, 43, 13, 29, 26, 27], but manual heuristics still remained. Other works aim to further remove manual merging heuristics of the semantics and instance predictions. E.g. UPSNet [52] proposes a panoptic head network for merging the predictions, and Liu et al. [31] leverages a spatial ranking module to conduct the merging between the two branches. Yang et al. [54] propose to resolve overlaps via instance relation reasoning. Recently, there has been some work adding a mask head on-top of a transformer to avoid heuristics [5]. + +Single-shot approaches, while less explored [53, 15, 9, 20], are an important complementary direction for panoptic segmentation. These methods demonstrate their potential in both network accuracy [9] and inference efficiency [20]. These existing methods feature separated feature streams for semantic segmentation- and instance-related representation, while in our approach, a unified embedding is used to model both semantic (category) and instance information. That is, our method has in fact the same downstream features showing that this pixel is both $a$ car (instance-agnostic), and also this car (instance-specific), creating a natural and inherent feature representation for panoptic segmentation. + +Embeddings for computer vision. Associative embeddings [41, 42] and variants have been popular for various vision tasks. The embedding space is learned by leveraging push and pull forces between embeddings in the image, depending on ground-truth annotation. The initial paper on associative embeddings [42] used 1-dimensional embeddings. The follow-up work [41] showed that increasing the embedding to be 8-dimensional improved convergence of the network. Embeddings have also been used for lane detection [40], instance segmentation [11, 39], and for instance and semantic segmentation of point clouds [51]. Further, embeddings have been used with success for improving object detection methods, using embedding space as a way to remove human-designed priors [25, 57]. Our proposed method is a variation of a deep nearest class mean (NCM) classifier [17], which has shown some promising results on image classification for replacing typical networks with softmax outputs directly after the last convolutional layer. To the best + +of our knowledge, our work is the first to leverage a deep NCM method for semantics in panoptic segmentation. + +# 3. Panoptic Segmentation with Hierarchical Embeddings + +In this section, we provide detailed discussion on how we learn the proposed embedding space and use the predicted embeddings for panoptic segmentation, based on the framework depicted in Figure 2. We start with problem formulation, and a discussion over the limitation of a current widely used loss in embedding learning for scene parsing. Then we propose the usage of a better alternative to the task with our novel loss for hierarchical embedding space learning. Finally, we describe panoptic decoding on the learned embedding space for creating a panoptic segmentation. + +# 3.1. Problem Formulation + +We formulate the task of panoptic segmentation as an embedding space learning problem, where we want to associate each pixel $\mathbf{x}_i$ with a latent embedding $\mathbf{e}_i$ such that we can decode both the object instance and semantic class correctly from the same single embedding (cf. Figure 4). Our goal is to learn a function $f$ that maps a set of pixels $\mathcal{X}$ , $|\mathcal{X}| = N$ , into a set of embeddings $\mathcal{E}$ such that the embeddings can be partitioned into sets $\mathcal{S}$ and $\mathcal{I}$ , where $\mathcal{S} = \{S_1, \ldots, S_{|\mathcal{C}|}\}$ are the embedding spaces defined by the set of semantic classes $\mathcal{C}$ , and $\mathcal{I} = \{I_1, \ldots\}$ is the embedding subspace defined by the sets of instances such that we have the hierarchy $I_l \subseteq S_k \subseteq \mathcal{E}$ for any instance $l$ with semantic class $k$ . Further, the semantic classes $\mathcal{C}$ are assumed to be divided into thing classes $\mathcal{C}_{\mathrm{thing}}$ and stuff classes $\mathcal{C}_{\mathrm{stuff}}$ . Note that we consider stuff classes to consist of a single instance. + +# 3.2. Baseline - Associative Embeddings + +A popular approach for learning such an embedding is the associative embedding (AE) loss proposed by Newell et al [42] (also known as discriminative loss [11]). The loss uses pull and push terms to attract or repel an embedding $\mathbf{e}_i$ from or to others $\mathbf{e}_j$ depending on the ground-truth pixel label of each embedding, given $L$ instances: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {p u l l}} = \frac {1}{L} \sum_ {l = 1} ^ {L} \frac {1}{| I _ {l} |} \sum_ {j \in \mathcal {I} _ {l}} [ \| \hat {\mathbf {e}} _ {l} - \mathbf {e} _ {j} \| _ {1} - \delta_ {\text {p u l l}} ] _ {+} ^ {2}, (1) \\ \mathcal {L} _ {\text {p u s h}} = \frac {1}{L (L - 1)} \sum_ {l \neq k} [ \delta_ {\text {p u s h}} - \| \hat {\mathbf {e}} _ {l} - \hat {\mathbf {e}} _ {k} \| _ {1} ] _ {+} ^ {2}, (2) \\ \end{array} +$$ + +where $\hat{\mathbf{e}}_l = \frac{1}{|I_l|}\sum_{j\in \mathcal{I}_l}\mathbf{e}_j$ is the instance mean embedding, and $\delta_{\mathrm{pull}}$ , $\delta_{\mathrm{push}}$ are problem-specific hinge hyperparameters and $[\cdot ]_{+}$ is the ReLU function. + +In theory, a set of two AE losses can be used to learn a hierarchical embedding space by enforcing the hinge hyperparameters to be larger for semantic ground-truth than for + +instance ground-truth. While this idea works for toy problems, the disadvantage is that we need to manually define the hinge hyperparameters which employ additional uncertainty and sensitivity in real-world datasets. We have found this difficult to do in practice for real-world datasets such as Cityscapes [10], as depicted in our ablation analysis in Section 4.4. + +# 3.3. Lovász Hinge Loss + +To decrease the requirement for additional hinge hyperparameters, we look into the Lovász hinge loss [4], which acts as a differentiable surrogate for the intersection over union (IoU), a common measure of mask overlap. In panoptic quality (PQ) [24] evaluation, IoU is a common base metric across thing and stuff classes. + +First, we briefly review the Lovász hinge loss. Given a vector of binary ground-truth labels $\mathbf{t} \in \{0,1\}^N$ and predicted labels $\mathbf{y} \in \{0,1\}^N$ , the IoU is defined as IoU( $\mathbf{y}$ , $\mathbf{t}$ ) = $(|\{i:y_i = 1\} \cap \{i:t_i = 1\}|) / (|\{i:y_i = 1\} \cup \{i:t_i = 1\}|)$ , which is a score between 0 and 1, where higher is better. + +As the IoU is a discrete set function, it cannot be optimized via gradient descent, however the Lovász hinge provides a way of creating a continuous and differentiable surrogate function in terms of the prediction errors $\xi_{i}$ for each pixel [4]. Given a continuous prediction vector $\mathbf{p} \in [0,1]^N$ , the binary version of the Lovász hinge loss is defined as + +$$ +\operatorname {L o v a s z B i n a r y} (\mathbf {p}, \mathbf {t}) = \sum_ {i} ^ {N} \xi_ {\pi_ {i}} \Delta_ {i} ^ {\mathrm {I o U}}, \tag {3} +$$ + +with prediction error $\xi$ and IoU difference $\Delta^{\mathrm{IoU}}$ defined as + +$$ +\xi_ {i} = \left\{ \begin{array}{l l} 1 - p _ {i} & t _ {i} = 1 \\ p _ {i} & t _ {i} = 0 \end{array} , \right. \tag {4} +$$ + +$$ +\Delta_ {i} ^ {\mathrm {I o U}} = \operatorname {I o U} \left(\pi_ {1}, \dots , \pi_ {i - 1}\right) - \operatorname {I o U} \left(\pi_ {1}, \dots , \pi_ {i}\right), \tag {5} +$$ + +$\pi =$ indices that sort $\xi$ in descending order. + +Here, with slight abuse of notation, $\mathrm{IoU}(\pi_1,\dots ,\pi_i)$ denotes calculating IoU given the $i$ pixels with the largest prediction error $\xi_{\pi_i}$ . For multi-class prediction, we apply the binary loss in an all-vs-one manner: + +$$ +\operatorname {L o v a s z S o f t m a x} \left(\mathbf {p}, \mathbf {t}\right) = \frac {1}{| C |} \sum_ {c \in C} \operatorname {L o v a s z B i n a r y} \left(\mathbf {p} ^ {c}, \mathbf {t} ^ {c}\right), \tag {6} +$$ + +where $\mathbf{t}^c$ is 1 if the ground-truth class is $c$ , and 0 otherwise. + +# 3.4. Hierarchical Lovász Embeddings + +We propose to leverage the Lovász hinge loss to learn a shared embedding space for both semantics and instances. Given an instance $I_{l}$ , with mean $\pmb{\mu}_{l}$ and variance $\sigma_{l}$ , the score of an embedding $\mathbf{e}_i\in \mathbb{S}^{d - 1}$ lying on the unit hypersphere belonging to instance $I_{l}$ is + +$$ +p _ {l} \left(\mathbf {e} _ {i}\right) = \exp \left(- \frac {d _ {\cos} \left(\mathbf {e} _ {i} , \boldsymbol {\mu} _ {l}\right)}{2 \sigma_ {l} ^ {2}}\right), \tag {7} +$$ + +![](images/9833c35a8f688d665555f3a0000083b68906fb0ed984621cd810312ca18b6dd8.jpg) +Figure 3. Our method predicts hierarchical embeddings that allow for a clear separation of semantics and instances. Top row from left: input image, semantic segmentation, panoptic segmentation, instance segmentation. Bottom row: our 12-dimensional embedding space visualized as RGB channels of 4 images, highlighting the hierarchical structure over categories and instances. + +![](images/a262a257d50cad13ed4a0d5b39e12175c261d415cfc7b6753d8b41f582e3dcc6.jpg) +Car (4 instances) +Figure 4. Our proposed loss groups pixel embeddings (black dots) into a hierarchy of jointly semantic- and instance-specific clusters. The border of each inner circle illustrates the decision boundary for the instance kernel $\phi$ . The outer circle shows the decision boundary for the semantic kernel $\psi$ . + +![](images/0e95288862eb237199ff120f3126a86c261e42c8fe5a7f0832fb45c548c974d1.jpg) +Person (3 instances) Road (semantic=instance) + +![](images/1d2684fec02a6d2b35ea621d6e7699ba0e4b26575d9f88867565a5712880faa3.jpg) + +where $d_{\mathrm{cos}}(\mathbf{a},\mathbf{b}) = 1 - \mathbf{a}^{\top}\mathbf{b}$ denotes the cosine distance. Note that $p_l$ plays both roles of the push and pull terms in the AE loss, as embeddings will be pulled together when the target score increases, and pushed apart otherwise. We use a unit hypersphere to enable the use of cosine distance, which is memory efficient. However, we emphasize that our method is compatible with any distance metric. + +Instance and semantic losses via joint embedding. For instances, we use a spatial kernel to better separate far away objects as + +$$ +\phi_ {l} \left(\mathbf {e} _ {i}\right) = p _ {l} \left(\mathbf {e} _ {i}\right) \exp \left(- \frac {\left\| \boldsymbol {\rho} _ {i} - \boldsymbol {\rho} _ {l} \right\| ^ {2}}{2 \sigma_ {l , \text {s p a t i a l}} ^ {2}}\right), \tag {8} +$$ + +where $\rho_{i}$ is the spatial position of embedding $\mathbf{e}_i$ , and $\sigma_{l,\mathrm{spatial}}$ is a parameter learned by back propagation. + +For handling the learning of semantics, we propose to associate with each semantic class $S_{k}$ , a semantic mean $\pmb{\mu}_{k}$ and semantic variance $\sigma_{k}$ . We can then write the score of an embedding $\mathbf{e}_i$ belonging to this semantic class via the softmax function + +$$ +\psi_ {k} \left(\mathbf {e} _ {i}\right) = \frac {p _ {k} \left(\mathbf {e} _ {i}\right)}{\sum_ {c \in \mathcal {C}} p _ {c} \left(\mathbf {e} _ {i}\right)}. \tag {9} +$$ + +While it is possible to simply use the Gaussian kernel $p_k$ for semantics, preliminary experiments indicated that this is not optimal, as unlike instances, the number of semantic classes are known, and thus the decoding can be done by finding the + +closest embedding to each semantic mean, which motivates the softmax function. + +We define the mean embedding $\mu_{k}$ to be the mean embedding inside each image according to the ground-truth for instance indices $k$ that exist in the current image, and the persistent estimate $\hat{\mu}_k$ of the dataset mean otherwise: + +$$ +\boldsymbol {\mu} _ {k} = \left\{ \begin{array}{l l} \frac {1}{| I _ {k} |} \sum_ {j \in I _ {k}} \mathbf {e} _ {j} & \text {i f k i s a n i n s t a n c e} \\ \hat {\boldsymbol {\mu}} _ {k} & \text {i f k i s a s e m a n t i c c l a s s} \end{array} . \right. \tag {10} +$$ + +Given the predicted instance and semantic scores $\phi_l(\mathbf{e}_i)$ and $\psi_k(\mathbf{e}_i)$ for each embedding $\mathbf{e}_i$ , we can minimize the Lovász hinge loss, to maximize the IoU metric on the training dataset. Our loss functions that act as the push and pull forces to form the hierarchical structure are defined as + +$$ +\mathcal {L} _ {\text {i n s}} = \operatorname {L o v a s z B i n a r y} \left(\phi_ {l} \left(\mathbf {e} _ {i}\right), \mathbf {t} _ {\text {i n s}}\right), \tag {11} +$$ + +$$ +\mathcal {L} _ {\mathrm {s e g}} = \text {L o vá s z S o f t m a x} \left(\psi_ {k} \left(\mathbf {e} _ {i}\right), \mathbf {t} _ {\mathrm {s e g}}\right), \tag {12} +$$ + +which are calculated for all embeddings $\mathbf{e}_i$ , instances $I_l$ and semantics $S_k$ and the ground-truth vectors $\mathbf{t}$ . This will cause the network to pull embeddings belonging to the same class together, and push apart embeddings that belong to different instances. The instance-semantic hierarchy is modeled by letting the network learn variance estimates that properly capture the hierarchy in the shared embedding space, with the semantic variance being larger than the instance variance. + +Auxiliary losses. In addition to the embeddings for each pixel, our network also predicts a sigmoid output $s_i$ for each pixel, estimating the value of the Gaussian kernel $\phi_l(\mathbf{e}_i)$ . As shown in previous work, this "seed" value can be used at the decoding step to help finding an arbitrary number of instances [39]. For each pixel, we calculate + +$$ +\mathcal {L} _ {\text {s e e d}} = \left\{ \begin{array}{l l} \| s _ {i} - \operatorname {s g} [ \phi_ {l} (\mathbf {e} _ {i}) ] \| ^ {2} & i \in I _ {l} \\ \| s _ {i} \| ^ {2} & c _ {i} \in \mathcal {C} _ {\text {s t u f f}} \end{array} , \right. \tag {13} +$$ + +where $\mathrm{sg}[\cdot ]$ is the stop gradient operator, e.g. as used in VQVAE [44]. Note that only instances are predicted to have a seed value, and stuff classes are regressed to zero. + +We also add a loss term for each embedding $\mathbf{e}_i\in \mathcal{I}$ to encourage the predicted instance variances to be similar for the same object, to ease instance separation: + +$$ +\mathcal {L} _ {\text {i n s - v a r}} = \gamma \| \sigma_ {i} - \mathrm {s g} [ \hat {\sigma} _ {l} ] \| ^ {2}, \tag {14} +$$ + +where $\hat{\sigma}_l = \frac{1}{|I_l|}\sum_{j\in I_l}\sigma_j$ to encourage uniform predicted variance, and $\gamma = 10$ + +Similar to previous work by Guerriero et al. [17], we found that the semantic means are difficult to learn via backpropagation, as the update is too slow to catch up with the other parts of the network. Therefore, similar to VQVAE [44], for semantic classes, we add an L2 regression loss + +term to store a persistent representation of each semantic class in the model + +$$ +\mathcal {L} _ {\text {s e g - m e a n}} = \left\| \hat {\boldsymbol {\mu}} _ {k} - \operatorname {s g} \left[ \boldsymbol {\mu} _ {k} ^ {\text {b a t c h}} \right] \right\| ^ {2}, \tag {15} +$$ + +where $\mu_k^{\mathrm{batch}}$ is the batch semantic mean gotten by averaging the predicted embeddings at the ground-truth locations of semantic class $k$ . We illustrate the effect of this VQ-VAE style loss term in our ablation analysis in Section 4.4. The semantic variance $\sigma_k$ is learned via backpropagation. + +Proposed loss. Our proposed loss function is independent of the specific network architecture, and can be used with any standard fully convolutional neural network for semantic segmentation, such as DeeplabV3+ [8] or PSPNet [56]. The final form of our proposed loss function is + +$$ +\mathcal {L} = \mathcal {L} _ {\text {s e g}} + \mathcal {L} _ {\text {s e g - m e a n}} + \mathcal {L} _ {\text {i n s}} + \mathcal {L} _ {\text {i n s - v a r}} + \mathcal {L} _ {\text {s e e d}}, \tag {16} +$$ + +averaged over all pixels $\mathcal{X}$ . Specifically, our network predicts, for each pixel $\mathbf{x}_i$ , a tuple $(\mathbf{e}_i, \sigma_i, s_i)$ , where $\mathbf{e}_i$ is the predicted embedding, $\sigma_i$ is the predicted instance variance, and $s_i$ is the seed probability score. + +Thomson initialization. To increase coverage of the embedding space, we can initialize the means to uniformly cover the unit hypersphere by solving the generalized Thomson problem [47], originally proposed in 1904 for the purpose of determining an electron configuration in physics. We initialize the means as + +$$ +\operatorname {a r g m i n} _ {\left\{\boldsymbol {\mu} _ {k} \right\} _ {\forall k}} \sum_ {i \neq j} \frac {1}{d _ {\cos} \left(\boldsymbol {\mu} _ {i} , \boldsymbol {\mu} _ {j}\right)}. \tag {17} +$$ + +There is no known general solution to this problem, but we can find a local minimum via gradient descent. In our initial experiments, we found that Thomson initialization makes the training more stable. + +# 3.5. Panoptic Decoding + +For predicting semantics and instances from the learned hierarchical embedding space, we use a simple post-processing algorithm. We first assign the semantic class to each pixel via argmax of $\psi_{k}(\mathbf{e}_{i})$ . For thing classes, we first reduce the number of seed candidates $s_i$ by $3 \times 3$ max pooling, similar to CornerNet [25]. Then we threshold the remaining seeds to get an initial set of candidate seeds. Each candidate seed $s_i$ has an associated hierarchical embedding $\mathbf{e}_i$ , so we can use the kernel $\Phi (\mathbf{e}_i,\mathbf{e}_j) = \exp (-d_{\cos}(\mathbf{e}_i,\mathbf{e}_j) / (2\sigma_i^2) - \| \pmb {\rho}_i - \pmb {\rho}_j\| ^2 /(2\sigma_{i,\mathrm{spatial}}^2))$ to calculate the probability of two seeds $(s_i,s_j)$ representing the same instance. We then merge seeds representing the same object based on the probability $\Phi (\mathbf{e}_i,\mathbf{e}_j)$ . We now have one estimated seed $s_i$ per instance. For each $s_i$ , we then estimate + +
MethodBackbonePretrain.\(PQ\)\(PQ_{th}\)\(PQ_{st}\)
Proposal-based
Seamless [43]ResNet50ImageNet60.356.163.3
UPSNet [52]ResNet50ImageNet59.354.662.7
Real-time PS [20]ResNet50ImageNet58.852.163.7
Pan.FPN [23]ResNet50ImageNet57.751.662.2
Attn.-Guid. [29]ResNet50ImageNet56.452.759.0
Li et al. [28]ResNet101ImageNet47.339.652.9
DeGeus [13]ResNet50ImageNet45.939.250.8
Proposal-free
Pan. DeepL. [9]ResNet50ImageNet59.7--
SSAP [15]ResNet50ImageNet57.650.4-
DeeperLab [53]Xception71ImageNet56.5--
DeGeusFast [12]ResNet50ImageNet55.148.360.1
HLE (Ours)ResNet101ImageNet60.651.467.2
HLE (Ours)ResNet50ImageNet59.851.166.1
HLE (Ours)MobileNetV2ImageNet56.045.064.0
+ +the instance mask by thresholding $\Phi (\mathbf{e}_i,\mathbf{e}_k)$ , for all remaining pixel embeddings $\mathbf{e}_k$ , resolving mask disagreement by assigning each pixel to the instance with the highest probability among the estimated seeds. The semantic class of the instance is decided by the seed pixel. For stuff classes, we threshold the value of the semantic kernel $\psi_{k}(\mathbf{e}_{i})$ , to reduce the number of false positives. The panoptic decoding process can be easily optimized in favor of inference speed with little degradation of accuracy (details in the supplementary). + +# 4. Experiments + +# 4.1. Datasets + +We conduct experiments on the Cityscapes [10], COCO [30], and Mapillary Vistas [38] datasets, to evaluate the performance of our model. Cityscapes is an image dataset for autonomous driving, depicting European street-level imagery at $1024 \times 2048$ resolution, labeled with 19 classes, out of which 8 are thing classes. COCO contains various indoor and outdoor images at varying resolutions, with 80 thing classes, and 53 stuff classes. Vistas contains a wide variety of street-level images, at varying resolution, with 37 thing classes and 28 stuff classes. + +# 4.2. Experimental Details + +We evaluate our method using the standard panoptic segmentation metric panoptic quality (PQ) [24]. In the supplementary material, we explain the $PQ$ metric, and include its variations, $PQ^{\dagger}$ [43] and parsing covering (PC) [53], as well as mean Intersection-over-Union (mIoU) and Average Precision (AP). + +On Cityscapes, we only use the fine annotations in training. Our models are trained on the training set (2,975 im + +Table 1. Single-scale experimental results on the Cityscapes validation set. The best ResNet50 result in each category is highlighted. + +
MethodBackbonePretrain.PQ
Proposal-based
Seamless [43]ResNet50ImageNet & Vistas62.6
Proposal-free
SSAP [15]ResNet101ImageNet58.9
Dynam. inst. [2]ResNet101ImageNet55.4
HLE (Ours)ResNet101ImageNet59.4
HLE (Ours)ResNet50ImageNet57.9
+ +Table 2. Experimental results on the Cityscapes test set. + +
MethodBackbonePretrain.\(PQ\)\(PQ_{th}\)\(PQ_{st}\)
Proposal-based
UPSNet [52]ResNet50ImageNet42.548.533.4
Attn.-Guid. [29]ResNet50ImageNet39.649.125.2
Pan. FPN [23]ResNet50ImageNet39.045.928.7
Real-time PS [20]ResNet50ImageNet37.141.031.3
Proposal-free
SSAP [15]ResNet101ImageNet36.5--
Pan. DeepL. [9]ResNet50ImageNet35.1--
DeeperLab [53]Xception71ImageNet33.8--
HLE (Ours)ResNet101ImageNet38.142.831.0
HLE (Ours)ResNet50ImageNet37.141.130.9
+ +Table 3. Single-scale experimental results on the COCO validation set. The best ResNet50 result in each category is highlighted. + +ages) and evaluated on the validation set (500 images). For COCO, the training and validation sets have 118,287 and 5,000 images, respectively. Vistas has 18,000 images in the training set, and 2,000 in the validation set. We use the Adam optimizer [22] with learning rate $10^{-5}$ , polynomial learning rate decay, and test-time flip. We use ResNet50 as a backbone for DeepLabV3+ (pretrained on ImageNet) with an embedding dimension of 12 on Cityscapes, and 128 on COCO and Vistas. During training, we use crop size $1024 \times 2048$ on Cityscapes, and $512 \times 512$ on COCO, and crop around thing classes. The experiments on COCO and Vistas uses a max side length of 640 and 2048 pixels, respectively. We use Optuna [1] to find good hyperparameters for the decoder. + +Network inference on a $1024 \times 2048$ image takes 91 ms running on single NVIDIA V100 Tensor Core GPU. Post-processing takes 113 ms. Alternatively, by running post-processing on a down-sampled embedding space, post-processing speed can be easily sped up to 8 ms at the expense of lowering Cityscapes validation set PQ to 58.4 (details are provided in the supplementary material). On a $800 \times 1300$ COCO image, inference takes 51 ms. Inference speed depends heavily on the backbone used. With a MobileNetV2 backbone, model inference takes 36 ms on Cityscapes. + +# 4.3. Experimental Results + +Our results on Cityscapes, COCO, and Vistas can be seen in Tables 1, 3 and 5, respectively. The best ResNet50 + +
MethodBackbonePretrain.\(PQ\)\(PQ_{th}\)\(PQ_{st}\)
Proposal-based
UPSNet [52]ResNet101ImageNet46.653.236.7
Attn.-Guid. [29]ResNeXt-152ImageNet46.555.832.5
Pan. FPN [23]ResNet50ImageNet40.948.329.7
Proposal-free
SSAP [15]ResNet101ImageNet36.940.132.0
DeeperLab [53]Xception71ImageNet34.337.529.6
DeeperLab [53]Wider MNV2ImageNet28.130.824.1
DeeperLab [53]L. W. MNV2ImageNet24.526.920.9
HLE (Ours)ResNet101ImageNet39.945.032.2
HLE (Ours)ResNet50ImageNet38.242.731.4
+ +Table 4. Experimental results on the COCO test-dev2019 set. + +
MethodBackbonePretrain.\(PQ\)\(PQ_{th}\)\(PQ_{st}\)
Proposal-based
Seamless [43]ResNet50ImageNet37.733.842.9
Proposal-free
Pan. DeepL. [9]ResNet50ImageNet33.3--
DeeperLab [53]Xception71ImageNet32.0--
HLE (Ours)ResNet50ImageNet34.627.843.5
+ +![](images/07c2663c98fbed233b7b6ebbdb0f9cf9678463ab5585397eca7a61f4591b7050.jpg) +Figure 5. Visualization of our method on the Cityscapes validation set. Each pair: (left) input image, (right) panoptic segmentation. + +![](images/7cdeba1fc554a59bd1fa77319d8546b2b99fd5a6e8adb432b23b3d83a49d852b.jpg) +Figure 6. Visualization of our method on the COCO validation set. Each pair: (left) input image, (right) panoptic segmentation. + +result in each category is highlighted. Some examples of our model's outputs can be seen in Figures 5, 6 and 7. For a fair comparison, we report the results on ImageNet-trained models with a ResNet50 for previous works, if possible. We also report some results of our method with alternative backbones [19, 46], to illustrate the change in performance depending on the backbone network. Our method achieves state-of-the-art results among proposal-free methods on all three datasets with the same or even lighter backbone. + +On Cityscapes, we can see that our method is competitive with heavier two-stage methods, such as PanopticFPN [23], + +![](images/3cc3ab7479a2f880c1b6cb93f4064e84783e8bba4c22ce95c097d29ae4ae4ab5.jpg) +Figure 7. Visualization of our method on the Vistas validation set. Each pair: (left) input image, (right) panoptic segmentation. + +Table 5. Single-scale experimental results on the Vistas validation set. The best ResNet50 result in each category is highlighted. + +
Assoc. emb. loss✓
Cross-ent. loss✓✓
Lovász hinge loss✓✓✓✓✓
Sep. seg. branch.✓
Split emb. space✓
Hier. emb. space✓✓✓✓✓
VQ-VAE style✓✓✓✓
Thomson init.✓✓✓✓✓
PQ38.845.050.257.057.058.659.1
+ +Table 6. Ablative results on the Cityscapes validation set. Our proposed model is in the rightmost column. + +and has higher $PQ$ than previous proposal-based methods, such as Panoptic DeepLab [9]. Particularly, note that our method with a ResNet50 backbone network beats DeeperLab that uses a much heavier Xception71 backbone in terms of the $PQ$ metric. + +Notably, we achieve a high $PQ_{\mathrm{st}}$ score, indicating that using embeddings for semantic encoding is a promising direction, especially in panoptic segmentation. We can reason about the rationale that our model achieves top $PQ_{\mathrm{st}}$ results as follows. In our method, we learn both embeddings and variances for each semantic class. Each semantic class is treated in an adaptive manner based on distribution. For example, a larger volume in the embedding space will be assigned to semantic classes with higher variance, compared to direct regression where all classes are treated equally in feature space. An example of the learned hierarchical embedding space can be seen in Figure 3. Our proposed hierarchical embedding is able to encode both semantic and instance level information precisely, although a few mistaken predictions can also be seen. + +We also submitted our model to the Cityscapes test set benchmark, where our method is competitive among both published and unpublished models, despite the big variety in network backbones and extra data included in the current benchmark. The results for peer-reviewed work can be seen in Table 2. The gap between our validation and test set $PQ$ score is not large, indicating that our method generalizes well. While SSAP does not report any ResNet50 result, + +our model has higher PQ than theirs with ResNet101. In the supplementary material, we include Cityscapes results comparison on the metrics $PQ^{\dagger}$ (61.3), $PC$ (76.6), $mIoU$ (77.3) and $AP$ (23.9). + +On COCO, we saw less proposal-free methods reported with similar network scale as shown in Table 3. We present COCO test set results in Table 4. Our method achieves the best performance among proposal-free models. Compared to Cityscapes, the gap between proposal-based and proposal-free models on COCO is much larger, indicating that there is still a demand for further research in order to close this gap. We find the same observation on the Vistas dataset as on COCO, where our proposed method is able to outperform other proposal-free methods. Notably, we find that bottom-up methods tend to under-perform on larger datasets [9, 20, 15], while our proposed hierarchical embedding space-based method is able to generalize better on these datasets. + +# 4.4. Ablative Analysis + +We conduct ablative experiments to better understand design choices we have made for our method. In Table 6, we provide different variations on each key design of our proposed method. For simplicity, we did not conduct hyperparameter search in this experiment. + +First of all, we compared our proposed hierarchical Lovász embeddings with conventional embeddings based on associative embedding or cross entropy loss. As can be seen in the table, Lovász embeddings have vastly better performance than associative embeddings or cross entropy losses. + +Second, we compare with a model that uses a softmax classifier semantic segmentation branch with cross entropy loss, instead of our joint hierarchical embedding space, and still handling instance predictions via the embedding space. We can see that this yields a lower PQ of 57.0, which can be regarded as a naive extension of previous instance segmentation work to panoptic segmentation [39]. Next, we illustrate the benefit of jointly learning the embedding space for both semantics and instances, compared to splitting the embedding space into two halves: one for semantics and the other for instance embeddings. We split the 12-dimensional embedding space of our model into 6 dimensions each for semantics and instances. It can be seen that jointly learning both semantics and instances in the same embedding space leads to higher performance. This interpretation is also strengthened by our method outperforming DeeperLab on the Cityscapes validation set – a method using a split embedding space. + +Finally, we show that VQ-VAE style loss and Thomson initialization for learning the semantic means help improve the model performance. + +# 4.5. Temporal Stability + +As our embeddings are of low dimension, we are interested in seeing whether they exhibit temporal stability when + +![](images/793329c754b5cd6b9d0fea1f132ba629418fe4a2bc3490c12e03bbc28bcbcd8b.jpg) +Figure 8. Our embeddings are temporally stable across video frames. Each row (video frame), from left to right: Input image, panoptic segmentation, first 3 dimensions of the embedding space. Matching pixels in consecutive frames have similar embeddings. + +run on a video. In Figure 8, we show the predicted embedding spaces and panoptic segmentation for a few consecutive frames in the Cityscapes demo video sequence. The figure qualitatively shows that matching pixels in different frames have similar embeddings. We believe this qualitative result indicates the potential of our method towards temporal downstream applications such as multi-object tracking. Temporal stability is important for applications such as tracking in autonomous driving, where flickering false positives can be fatal, and low-dimensional embeddings could be leveraged as a feature for cross-frame data association. We are not aware of other panoptic methods featuring this property. + +# 5. Conclusion + +In this work, we presented a unified output representation for panoptic segmentation leveraging a hierarchically clustered embedding space. Via our proposed hierarchical Lovász hinge loss, we created a simple single-shot model for panoptic segmentation, predicting an embedding space structured into an instance-semantic hierarchy. Our method was shown to achieve state-of-the-art results among proposal-free panoptic segmentation methods, and be competitive with heavier two-stage methods on the Cityscapes, COCO and Vistas datasets. Results indicated that our hierarchical Lovász embeddings are a viable alternative for panoptic segmentation, for both thing and stuff classes. + +We believe that it is an important and promising direction to explore a unified representation for panoptic segmentation. In the future, we will focus on leveraging the structure of the embedding space with self-adaptation to ontology distribution and its downstream applications. + +Acknowledgments This work was supported by Woven Core, Inc. We thank Richard Calland, Aditya Ganeshan, Karim Hamzaoui, Daisuke Okanohara and Shunta Saito for discussions and feedback on the manuscript. + +# References + +[1] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2623-2631. ACM, 2019. 6 +[2] Anurag Arnab and Philip HS Torr. Pixelwise instance segmentation with a dynamically instantiated network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 441-450, 2017. 2, 6 +[3] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence, 39(12):2481-2495, 2017. 2 +[4] Maxim Berman, Amal Rannen Triki, and Matthew B Blaschko. The lovasz-softmax loss: A tractable surrogate for the optimization of the intersection-over-union measure in neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4413–4421, 2018. 4 +[5] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213-229. Springer, 2020. 3 +[6] Liang-Chieh Chen, Alexander Hermans, George Papandreou, Florian Schroff, Peng Wang, and Hartwig Adam. Masklab: Instance segmentation by refining object detection with semantic and direction features. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4013-4022, 2018. 2 +[7] 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. 2 +[8] 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. 2, 5 +[9] Bowen Cheng, Maxwell D Collins, Yukun Zhu, Ting Liu, Thomas S Huang, Hartwig Adam, and Liang-Chieh Chen. Panoptic-deeplab: A simple, strong, and fast baseline for bottom-up panoptic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12475-12485, 2020. 1, 3, 6, 7, 8 +[10] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3213-3223, 2016. 2, 4, 6 +[11] Bert De Brabandere, Davy Neven, and Luc Van Gool. Semantic instance segmentation with a discriminative loss function. arXiv preprint arXiv:1708.02551, 2017. 3 +[12] Daan de Geus, Panagiotis Meletis, and Gijs Dubbelman. Fast panoptic segmentation network. arXiv preprint arXiv:1910.03892, 2019. 6 + +[13] Daan de Geus, Panagiotis Meletis, and Gijs Dubbelman. Single network panoptic segmentation for street scene understanding. In 2019 IEEE Intelligent Vehicles Symposium (IV), 2019. 1, 3, 6 +[14] 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. 2 +[15] Naiyu Gao, Yanhu Shan, Yupei Wang, Xin Zhao, Yinan Yu, Ming Yang, and Kaiqi Huang. Ssap: Single-shot instance segmentation with affinity pyramid. In Proceedings of the IEEE International Conference on Computer Vision, pages 642-651, 2019. 1, 2, 3, 6, 7, 8, 13 +[16] Joshua Goodman. Classes for fast maximum entropy training. In 26th International Conference on Acoustics, Speech, and Signal Processing, 2001. 2 +[17] Samantha Guerriero, Barbara Caputo, and Thomas Mensink. Deepncm: Deep nearest class mean classifiers. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Workshop Track Proceedings, 2018. 3, 5 +[18] 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. 2 +[19] 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. 7 +[20] Rui Hou, Jie Li, Arjun Bhargava, Allan Raventos, Vitor Guizilini, Chao Fang, Jerome Lynch, and Adrien Gaidon. Real-time panoptic segmentation from dense detections. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8523-8532, 2020. 3, 6, 8, 13 +[21] Jyh-Jing Hwang, Stella X Yu, Jianbo Shi, Maxwell D Collins, Tien-Ju Yang, Xiao Zhang, and Liang-Chieh Chen. Seg- sort: Segmentation by discriminative sorting of segments. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7334-7344, 2019. 2 +[22] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 12 2014. 6 +[23] Alexander Kirillov, Ross Girshick, Kaiming He, and Piotr Dollar. Panoptic feature pyramid networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6399-6408, 2019. 1, 3, 6, 7, 13 +[24] Alexander Kirillov, Kaiming He, Ross Girshick, Carsten Rother, and Piotr Dollar. Panoptic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9404-9413, 2019. 1, 2, 3, 4, 6, 12 +[25] Hei Law and Jia Deng. Cornernet: Detecting objects as paired keypoints. In Proceedings of the European Conference on Computer Vision (ECCV), pages 734-750, 2018. 2, 3, 5 +[26] Justin Lazarow, Kwonjoon Lee, and Zhuowen Tu. Learning instance occlusion for panoptic segmentation. arXiv preprint arXiv:1906.05896, 2019. 3 + +[27] Jie Li, Allan Raventos, Arjun Bhargava, Takaaki Tagawa, and Adrien Gaidon. Learning to fuse things and stuff. arXiv preprint arXiv:1812.01192, 2018. 1, 3 +[28] Qizhu Li, Anurag Arnab, and Philip HS Torr. Weakly-and semi-supervised panoptic segmentation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 102-118, 2018. 6, 13 +[29] Yanwei Li, Xinze Chen, Zheng Zhu, Lingxi Xie, Guan Huang, Dalong Du, and Xingang Wang. Attention-guided unified network for panoptic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7026-7035, 2019. 1, 3, 6, 7, 13 +[30] 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, 6 +[31] Huanyu Liu, Chao Peng, Changqian Yu, Jingbo Wang, Xu Liu, Gang Yu, and Wei Jiang. An end-to-end network for panoptic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6172-6181, 2019. 3 +[32] Shu Liu, Lu Qi, Haifang Qin, Jianping Shi, and Jiaya Jia. Path aggregation network for instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8759-8768, 2018. 2, 13 +[33] 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. 2 +[34] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111-3119, 2013. 2 +[35] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39-41, 1995. 2 +[36] Andriy Mnih and Geoffrey E Hinton. A scalable hierarchical distributed language model. In Advances in neural information processing systems, pages 1081-1088, 2009. 2 +[37] Frederic Morin and Yoshua Bengio. Hierarchical probabilistic neural network language model. In Aistats, volume 5, pages 246-252. CiteSeer, 2005. 2 +[38] Gerhard Neuhold, Tobias Ollmann, Samuel Rota Bulò, and Peter Kontschieder. The mapillary vistas dataset for semantic understanding of street scenes. In International Conference on Computer Vision (ICCV), 2017. 2, 6 +[39] Davy Neven, Bert De Brabandere, Marc Proesmans, and Luc Van Gool. Instance segmentation by jointly optimizing spatial embeddings and clustering bandwidth. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8837-8845, 2019. 2, 3, 5, 8 +[40] Davy Neven, Bert De Brabandere, Stamatios Georgoulis, Marc Proesmans, and Luc Van Gool. Towards end-to-end lane detection: an instance segmentation approach. In 2018 IEEE Intelligent Vehicles Symposium (IV), pages 286-291. IEEE, 2018. 3 +[41] Alejandro Newell and Jia Deng. Pixels to graphs by associative embedding. In Advances in neural information processing systems, pages 2171-2180, 2017. 3 + +[42] Alejandro Newell, Zhiao Huang, and Jia Deng. Associative embedding: End-to-end learning for joint detection and grouping. In Advances in Neural Information Processing Systems, pages 2277-2287, 2017. 2, 3 +[43] Lorenzo Porzi, Samuel Rota Bulo, Aleksander Colovic, and Peter Kontschieder. Seamless scene segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8277-8286, 2019. 1, 3, 6, 7, 12, 13 +[44] Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. arXiv preprint arXiv:1906.00446, 2019. 5 +[45] Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7263-7271, 2017. 2 +[46] 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. 7 +[47] JJ Thomson. On the structure of the atom: an investigation of the stability and periods of oscillation of a number of corpuscles arranged at equal intervals around the circumference of a circle; with application of the results to the theory of atomic structure. Philos. Mag., Ser. 6, 7:237-265, 1904. 5 +[48] Joseph Tighe, Marc Niethammer, and Svetlana Lazebnik. Scene parsing with object instances and occlusion ordering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3748-3755, 2014. 1 +[49] Zhuowen Tu, Xiangrong Chen, Alan L Yuille, and Song-Chun Zhu. Image parsing: Unifying segmentation, detection, and recognition. International Journal of computer vision, 63(2):113-140, 2005. 1 +[50] Xinlong Wang, Tao Kong, Chunhua Shen, Yuning Jiang, and Lei Li. SOLO: Segmenting objects by locations. In Proc. Eur. Conf. Computer Vision (ECCV), 2020. 2 +[51] Xinlong Wang, Shu Liu, Xiaoyong Shen, Chunhua Shen, and Jiaya Jia. Associatively segmenting instances and semantics in point clouds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4096-4105, 2019. 3 +[52] Yuwen Xiong, Renjie Liao, Hengshuang Zhao, Rui Hu, Min Bai, Ersin Yumer, and Raquel Urtasun. Upsnet: A unified panoptic segmentation network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8818-8826, 2019. 1, 3, 6, 7, 13 +[53] Tien-Ju Yang, Maxwell D Collins, Yukun Zhu, Jyh-Jing Hwang, Ting Liu, Xiao Zhang, Vivienne Sze, George Papandreou, and Liang-Chieh Chen. Deeperlab: Single-shot image parser. arXiv preprint arXiv:1902.05093, 2019. 1, 3, 6, 7, 12, 13 +[54] Yibo Yang, Hongyang Li, Xia Li, Qijie Zhao, Jianlong Wu, and Zhouchen Lin. Sognet: Scene overlap graph network for panoptic segmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 12637-12644, 2020. 3 + +[55] Jian Yao, Sanja Fidler, and Raquel Urtasun. Describing the scene as a whole: Joint object detection, scene classification and semantic segmentation. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, June 16-21, 2012, pages 702-709, 2012. 1 +[56] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang + +Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2881-2890, 2017. 2, 5 +[57] Xingyi Zhou, Dequan Wang, and Philipp Kriahenbuhl. Objects as points. arXiv preprint arXiv:1904.07850, 2019. 2, 3 \ No newline at end of file diff --git a/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/images.zip b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5fd232e0a00d2a334706c5a57bb13888f56c92ca --- /dev/null +++ b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99b0d72510662fda4415fe47dd54f778147c61bb74140551e7837b03fdd835c5 +size 643114 diff --git a/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/layout.json b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..488a341784a7fc34383c094806f811a5f5af0d21 --- /dev/null +++ b/hierarchicallovaszembeddingsforproposalfreepanopticsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:242459e2ab770f5c5053e1f3f3ee7ed86d1549e8e3e911d58dd081ba0afcb995 +size 448895 diff --git a/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_content_list.json b/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..14cd0a72efab6769ed0163b7cc057473899dab77 --- /dev/null +++ b/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:416aeda006b77791fafc9f018c1dfee921663977483b51ffaee4aa25327a25d0 +size 70222 diff --git a/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_model.json b/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9e17594f9d925980021a9680260167508f717b56 --- /dev/null +++ b/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba31e60954e6ca152ff4df7ed1b267be2ee5e4df1a6406fc5266944e2eb23166 +size 92026 diff --git a/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_origin.pdf b/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b5a3bde4c28fccd148b349fb309201314f0b9248 --- /dev/null +++ b/hierarchicalmotionunderstandingviamotionprograms/1e0d60da-2d04-4635-9504-ef252714625e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d873a54e2804e660858c485682de3a8df230cb33baef10e766103cb254e7231 +size 4984559 diff --git a/hierarchicalmotionunderstandingviamotionprograms/full.md b/hierarchicalmotionunderstandingviamotionprograms/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c65b1dbf66383559a4562017150f118120333d8a --- /dev/null +++ b/hierarchicalmotionunderstandingviamotionprograms/full.md @@ -0,0 +1,341 @@ +# Hierarchical Motion Understanding via Motion Programs + +Sumith Kulal* +Stanford University + +Jiayuan Mao* MIT + +Alex Aiken +Stanford University + +Jiajun Wu +Stanford University + +# Abstract + +Current approaches to video analysis of human motion focus on raw pixels or keypoints as the basic units of reasoning. We posit that adding higher-level motion primitives, which can capture natural coarser units of motion such as "backswing" or "follow-through", can be used to improve downstream analysis tasks. This higher level of abstraction can also capture key features, such as loops of repeated primitives, that are currently inaccessible at lower levels of representation. We therefore introduce Motion Programs, a neuro-symbolic, program-like representation that expresses motions as a composition of high-level primitives. We also present a system for automatically inducing motion programs from videos of human motion and for leveraging motion programs in video synthesis. Experiments show that motion programs can accurately describe a diverse set of human motions and the inferred programs contain semantically meaningful motion primitives, such as arm swings and jumping jacks. Our representation also benefits downstream tasks such as video interpolation and video prediction and outperforms off-the-shelf models. We further demonstrate how these programs can detect diverse kinds of repetitive motion and facilitate interactive video editing. + +# 1. Introduction + +Most current video analysis architectures operate on either pixel-level or keypoint-level transitions that are good at local and short-term motions of human bodies but do not handle higher-level spatial and longer-lasting temporal structures well. We posit that incorporating higher-level reasoning of motion primitives and their relationships enables better video understanding and improved downstream task performance: after seeing a person perform jumping jacks a few times, it's reasonable to predict that they may repeat the same action for a few more iterations. + +We thus introduce a hierarchical motion understanding framework with three levels of abstraction, as shown in Figure 1: + +- Level 1 (Figure 1b) is Keypoints, which are the basis of most current computer vision systems. This level provides low-level priors such as temporal smoothing. +- Level 2 (Figure 1c) is Concrete Motion Programs, a programmatic representation of motion consisting of a sequence of atomic actions or motion primitives, each describing a set of frames for a single action. This level provides priors on primitive level motion. +- Level 3 (Figure 1d) is Abstract Motion Programs, which describe higher-level groupings of the concrete primitives, such as patterns of repetitive motion. This level provides priors on sequences of primitives and their patterns. + +We describe the concrete and abstract levels with simple domain specific languages (DSLs). The Concrete DSL consists of motion primitives such as stationary, linear, and circular movement with necessary spatial and temporal motion parameters. The Abstract DSL includes for-loops for capturing higher-level groupings of primitives. Along with the DSLs, we propose an algorithm to automatically synthesize motion programs from videos. For the sake of brevity, we often refer to motion programs as simply programs. + +To demonstrate the advantages of motion programs, we apply our methods for synthesizing motion programs from videos to three applications: video interpolation (Section 4.2), repetitive segment detection (Section 4.3) and video prediction (Section 4.4). For video interpolation, we demonstrate that when combined with state-of-the-art image synthesis models, such as SepConv [23], motion programs can achieve higher quality interpolations with bigger gaps between frames than previous approaches. For repetitive segment detection, we demonstrate that motion programs can detect and extract repetitive segments of human motion. For video prediction, we show that motion programs can perform longer-range video prediction than HierchVid [29] and HistryRep [32] by identifying repetitive motions. + +To summarize, our contributions are: + +- We introduce a hierarchical motion understanding framework using motion programs. +- We present an algorithm for automatically synthesizing motion programs from raw videos. + +![](images/7c1035185ed2d2d775d59ffc84f74b6e0d69a0fc6a04b13d1973cf234929e281.jpg) +Figure 1. Overview of our hierarchical motion understanding framework. We start with low-level keypoints extracted from raw videos and build higher level motion understanding. Higher levels of abstraction consist of a sequence of motion primitives and their repetitive patterns. Similar motion in repetitive patterns are captured using a probabilistic for-loop body (refer Figure 3). + +- By incorporating motion programs into video synthesis pipelines, we demonstrate higher performance in video interpolation, video prediction and also show how to detect and extract repetitive motion segments. + +# 2. Related Work + +We briefly summarize the most relevant related work in capturing and understanding images and video. + +Program-like representations for visual data. The idea of using programs to represent visual data dates back to the early computer graphics literature on using procedural models to model biological structures [17], 3D shapes [14, 26, 27], and indoor scenes [30, 15, 24]. Recent works integrate the representational power of deep networks with program-like structures in visual data modeling, which enables the application of high-level program-like structures in more complex and noisy environments such as hand-drawn sketches [8] and even natural images [33, 21]. These works have all focused on extracting programmatic descriptions of images, whereas our main contribution is in developing and applying programmatic descriptions of motion to videos. + +Our model also relates to works on using parameterized curves [25, 10, 11] or motion segments that can be recombined [13, 1] for modeling and editing motions. Compared with these works, we focus on inferring program-like repre + +sensation of human motion from raw videos, and introduce abstract motion programs to describe higher-level groupings of low-level motions, which enables us to capture patterns of repetitive motion. As a result, the applications of such representations are different, with our programmatic representation being useful for multiple video manipulation tasks. + +Video synthesis. Substantial progress has recently been made on video processing tasks including video interpolation [19, 12, 18, 23], video extrapolation [29, 7], and video retiming [20, 6]. These methods use deep convolutional neural networks (CNNs) to extract spatial-temporal features of videos. These features are sent to task-specific networks to make predictions of intermediate frames (in video interpolation) or future frames (in video extrapolation). Various methods have been proposed to improve the results by predicting flows [18], predicting blending kernels [23], making future predictions in keypoint spaces [29], and using variational inference to model video stochasticity [7]. Our approach works at a higher level of abstraction and captures structure on longer time scales. We show that the two classes of work can be combined to yield improved results for video interpolation. + +# 3. Hierarchical Motion Understanding + +Our hierarchical motion understanding framework has three levels of increasing abstraction. The first level is repre + +senting motion as a sequence of keypoints. For the next two levels, we use programmatic representations of motion via two simple domain-specific languages (DSLs). + +In Section 3.1, we describe the synthesis and execution of concrete motion programs (Level 2). In Section 3.2, we describe synthesis and execution of abstract motion programs (Level 3). + +Level 1—Keypoints. Representing human motion as a sequence of keypoints is a well-studied problem. Several high-quality, off-the-shelf tools such as AlphaPose [9] and OpenPose [4] take raw video as input and output a sequence of 2D keypoints for each body joint. Sequences of keypoints for a single joint are our first level of abstraction. + +Level 2—Concrete Motion Programs. A concrete motion program is a sequence of motion primitives, where each primitive is either circular, linear, or stationary (not moving) motion of a specific keypoint for a fixed time duration. Table 1 gives a grammar for the DSL. These programs are concrete because the specific kind of motion (e.g., linear) of each primitive in the sequence is explicit as are all the parameters needed to fully describe the motion. + +More specifically, we define three parameterized motion primitives: a circular primitive (circle), a linear primitive (line) and a stationary primitive (stationary). Each primitive has spatial parameters, such as center and radius for circular motion, temporal motion parameters such as velocity and start_angle, and a time duration. In practice, we have found these three simple motion primitives are sufficient to cover a wide variety of use cases. The framework could easily extended with more primitives or more expressive primitives (such as spline curves). The execution model of concrete programs is the obvious one: The keypoint traces out each primitive $p$ in order, beginning in the starting configuration for $p$ and for $p$ 's specified amount of time. + +Level 3—Abstract Motion Programs. Abstract motion programs (see Table 2) consist of sequences and loops of primitive distributions over start, middle, and end points of the motion. Note that the start-middle-end representation does not commit to the type of motion (e.g., circular vs. linear) and in fact a specific distribution might include instances of multiple kinds of motion. To execute an abstract primitive $p$ , we sample the start, middle and end points (as well as other parameters, such as duration) of $p$ 's distribution, pick the concrete primitive $c$ that best fits the sample, and then execute $c$ . Sequences and loops of abstract primitives are then executed by repeating this process for each abstract primitive in the execution sequence. The start-middle-end representation could be extended with more points, but at least three points are needed to distinguish linear from circular motion. + +Abstract motion programs concisely capture complex categories of human motion. For example, "jumping jacks" are easily expressed by a loop with a body consisting of a + +Table 1. DSL of Concrete Programs (Level 2) for describing motion as a sequence of motion primitives. + +
Program → Prim; . . .; Prim
Prim → circle (center: Point, radius: R, angle=(vel: R, start: R), time: Int)
Prim → line (x=(vel: R, start: R), y=(slope: R, intercept: R), time: Int)
Prim → stationary(point: Point, time: Int)
Point → (x: R, y: R)
Int → a positive integer
R → a real number
+ +Table 2. DSL of Abstract Programs (Level 3) for describing motion as a sequence of probabilistic motion primitives with loops. + +
Program → Stmt; ...; Stmt +Stmt → DetPrim | For-Loop (iter: Int) { + ProbPrim; ...; ProbPrim}
DetPrim → {<start, middle, end>: + <Point, Point, Point>, time: Int}
ProbPrim → {<start, middle, end>: + Gaussian(<Point, Point, Point>), + ), time: FreqDist(Int)}
Point → (x: R, y: R) +Int → a positive integer +R → a real number
+ +sequence of primitives describing the up and down motion of a single jumping jack. The fact that the primitives are distributions captures the natural variation that arises in repeated jumping jacks—no two will be exactly the same, but all will be similar within some bounds. + +# 3.1. Concrete Motion Programs + +We now describe how we connect the different levels of our hierarchy. Given a sequence of keypoints we synthesize a concrete motion program, and given a concrete motion program we identify repeating patterns in the sequence of concrete primitives to synthesize the distributions and loops of an abstract motion program. We begin with concrete motion programs. + +Synthesizing single primitives. To fit a single circular primitive to a sequence of keypoints, we first find the best-fit circle of the sequence [3]. We then project the keypoints onto this best-fit curve and find temporal motion parameters (velocity, start_angle) that best approximate the motion of the projected points. The problem can also be solved by jointly optimizing for all parameters, but in practice we observed that this two step approach produced equivalent results with significantly faster running times. We run this process for linear and stationary motion and pick the concrete primitive that minimizes the $\mathcal{L}_2$ error. Some examples of single primitive synthesis are given in Figure 2. + +(a) Golf Swing +![](images/1dc7d278b7ccbf85b696832795484857dce1edb3e1f2249e0b4d1e29fcb7e726.jpg) +(Rwrist +circular_motion( +center=(220.56, 175.67), +radius=108.23, +angle=3.17*t + 79.99, +duration=7) +stationary( +$x = 129.25$ , $y = 121.59,$ +duration=4) +circular motion( +center=(249.49, 169.97), +radius=107.97, +angle $= -6.60^{*}t + - 156.79,$ +duration=4) + +(b) Squat +Figure 2. Examples of synthesized motion primitives. a) This golf swing has three primitives: back-swing, pause and down-swing. b) The squats sequence has a repeating subsequence of three similar primitives: squatting down, standing up and a brief rest in the standing pose. +![](images/b5afdc2e679ba72b955a5c17ea7420ebe8cf84360ef52bf4b40e8fea57b0dbba.jpg) +(Neck ●) +linear_motion( +$x = -0.48^{*}t + 261.61,$ +y=5.13*t + 122.32, +duration=13) +linear_motion( +[ x = 0.69 * t + 256.20, ] +$y = -5.79^{*}t + 182.64,$ +duration=11) +stationary( +$x = 263.26, y = 124.97,$ +duration=3) +... similar motion +repeated for 14 times + +Segmentation and synthesis. A long video is rarely well-described by a single concrete primitive. To synthesize a sequence of primitives, we must segment the keypoint sequence and synthesize a primitive for each segment. We use dynamic programming to segment the input sequence at the best possible locations (i.e., the ones that minimize overall error) and fit individual primitives to each segment, as illustrated in Figure 2. The recurrence relation for the best fit sequence of primitives for the first $n$ keypoints is given as + +$$ +\operatorname {E r r o r} _ {\mathrm {n}} = \min _ {k < n} \left[ \operatorname {E r r o r} _ {\mathrm {k}} + \operatorname {f i t} (\text {k e y p o i n t s} [ k: n ]) + \lambda \right]. \tag {1} +$$ + +Here, $\mathrm{Error_k}$ is the error incurred by the best fit sequence of primitives for the first $k$ keypoints and fit(keypoints[k : n]) returns the error incurred by the best-fit single primitive for keypoints from $k$ to $n$ . The parameter $\lambda$ is a regularization term that controls the granularity of fitted primitives. Note that $\lambda = 0$ results in a degenerate fit with every point labeled as an independent primitive and $\lambda \to \infty$ results in a single primitive. Hence, in practice, we adaptively choose $\lambda$ at runtime to match the range of the keypoint motion by setting $\lambda$ proportional to the covariance of keypoints in a fixed window centered on the current keypoint. + +Multiple keypoints. The segmentation and synthesis algorithm can be generalized from one keypoint trajectory to multiple keypoint trajectories by jointly finding the best + +single segmentation across all the trajectories by minimizing the sum of errors across all keypoints. This approach enforces the useful invariant that programs for all keypoints transition to new primitives simultaneously. Note that this is the only place where we have found it useful to jointly consider all keypoint trajectories; otherwise motion programs are constructed per keypoint. + +Putting it all together, some examples of synthesized primitives after segmentation generated from golf swings and squats are shown in Figure 2. + +# 3.2. Abstract Motion Programs + +The translation from a concrete motion program to an abstract motion program is done in three steps: converting concrete primitives to abstract primitives, loop detection, and loop synthesis. + +Concrete to abstract translation. We first replace each concrete primitive with a deterministic abstract primitive. We do this by obtaining the start, middle and end points of the concrete primitive along with the duration of execution. + +Loop detection. In the second step we detect loops in the sequence of abstract primitives. We use a sliding window of $W$ primitives and attempt to fit loops with different numbers of abstract primitives $l$ in the loop body for each window. For each candidate loop body size $l$ and $W = \langle w_0, \dots, w_n \rangle$ we first group together all the deterministic primitives that + +![](images/c019e8af3d4d42ec3b5ccdd213eb2e48a4fe2b19fa8015c2f54376bb682b2036.jpg) +(a) Concrete Motion Program + +![](images/c9ce43bffa3fdb6a43945574dae63452aaf760f8dcb3b6b1381352835212be60.jpg) +Figure 3. Illustration of rolling up 6 repetitive (alternating) statements into a for-loop of body size 2. We first translate concrete primitives to deterministic abstract primitives and then synthesize for-loops with probabilistic primitives in the body. Concrete primitives are sampled from the probabilistic abstract primitives during execution. + +![](images/1628c04d647690a227ad1dfe61dd2d1cd9cfa7c87beef51a37f64eb21a2d0b1a.jpg) +(b) Intermediate Representation (Start-Mid-End) +(c) Abstract Motion Program (Distributions of Start-Mid-End) + +would be in the $i$ th abstract primitive of the loop body: + +$$ +S _ {i} = \left\{w _ {j} \mid j \% l = i \right\} \text {for} 0 \leq i < l. \tag{2} +$$ + +Now $S_0, \ldots, S_{l-1}$ is easily converted to a loop by fitting a Gaussian distribution to each $S_i$ to create an abstract primitive of the loop body. Note that we could not directly learn such a distribution of parameters for concrete primitives since each set could have more than one primitive type. + +We define the quality of fit for a loop as the average of the Gaussian covariance norms across $S_{i}$ . We threshold the quality and below a certain value mark it as a successful loop detection. To find the maximal loop, we dynamically increase the window size to include more primitives till covariance norms are still below threshold. We search over increasing loop body lengths $l$ until either a loop is successfully detected or we exceed a maximum loop body size. + +Loop synthesis. As the last step, we replace intervals of abstract primitives with the detected for-loop. The number of iterations is set according to the number of lines rolled up and the loop body size. An illustration of translating concrete primitives to abstract primitives and subsequent loop detection is presented in Figure 3. + +# 4. Experiments + +To evaluate the expressive power of both concrete and abstract motion programs, we first evaluate the accuracy of synthesized motion programs (Section 4.1). Second, we evaluate the motion programs on video interpolation and compare it with state-of-the-art models (Section 4.2). Third, we present results for detecting and extracting repetitive motion from long exercise videos (Section 4.3). Finally, we demonstrate interactive manipulation of repetitive motion in videos using abstract motion programs and compare it to video prediction baselines (Section 4.4). + +# 4.1. Motion Program Induction + +Data. We use the GolfDB dataset [22] for evaluating the representative power of concrete programs. We extract videos from swing start to swing end from all 242 face-on real-time golf swing videos. We use a 50-50 train-test split and scale each frame to $512 \times 512$ . + +Analysis. We synthesize concrete motion programs for the train set of GolfDB and compare the synthesized programs with ground-truth poses. On average, we synthesize 3.33 primitives per video where the length of videos averages around 58 frames. In the majority of these videos, the primitives semantically correspond to back-swing, down-swing and follow-through with some stationary primitives at the beginning and the end. We analyse the efficiency, accuracy and temporal consistency of program representation. For efficiency, we compare the average number of parameters needed to represent the programs and the input pose sequence. Programs needed 253 parameters per video, which is much lower compared to 1,623 parameters needed by input poses. For accuracy, we compute the keypoint difference metric (KD) of the program-encoded pose sequence with the input pose; KD is the average distance of keypoints with the ground-truth keypoints in pixel space. We observe that the program-encoded poses differ from the ground-truth poses by 6.25 pixels, an error of only $2.44\%$ . This indicates that motion programs are good approximates of input pose sequence. Due to inherent noise in pose detection, the input poses could at times be noisy. We observe that the motion program representation smoothens out this noise to some degree by. To validate this, we compute the maximum difference in pixels of the pose of a joint in two adjacent frames. We observe that the input pose sequence has a difference of 100.10 pixels while program-encoded pose sequence are much smoother (76.15 pixels). + +![](images/aea8cb509af1d610c9e442a9b9f01286f3afcf1b889ef7dd0b8e46eef342c6e8.jpg) + +![](images/99152a2b275dadb662fc731547d0dd0e6d7011e266390452008c4e09f61f1d98.jpg) + +# 4.2. Video Interpolation + +We leverage motion programs to perform video interpolation and demonstrate the benefit of having primitive-level information in such tasks. + +Data. We evaluate on two datasets, GolfDB (as described above) and PoseWarp [2]. For the PoseWarp dataset, we stitch together continuous frames to obtain 105 videos. We scale each video to $512 \times 512$ and use the training splits specified in the original paper. + +Setup. We take the standard SepConv [23] architecture and modify it to incorporate the program information as shown in Figure 4. We train three variants of SepConv: i) SepConv, as defined in the original paper, that predicts the interpolated frame given left and right frames; ii) SepConv with input pose information of both frames (SepConv w/ heatmaps); iii) SepConv with both input and target pose information (SepConv w/ programs). For the last model, at test time, the target pose information is supplied by a motion program. We synthesize a motion program on input video and generate intermediate poses from executing the program with a finer granularity of time. Note that this information is otherwise not available. We are interested in the first and third model, where the second model is also studied as an ablation. + +For evaluation, we generate programs on the test set of both datasets. For each primitive generated, we sub-sample the frames at different rates (2x/4x/8x) and try to reconstruct the original video by interpolating the remaining frames. Performing 4x interpolation is more challenging than 2x and 8x is even more challenging. + +Metrics. We use the standard PSNR, SSIM [31], and LPIPS [34] image metrics to estimate the fidelity of synthesized videos. We also compute the keypoint difference + +![](images/c17c8d0b63a6a948bbf2f62e7fe67212a11efb565b029563e0f2b65758198aad.jpg) +Figure 4. Evaluation of three video interpolation variants: Top row (SepConv [23]), middle row (SepConv w/ heatmaps) and bottom row (SepConv w/ programs) which is our model where poses for intermediate frames are supplied by motion programs. Middle row (SepConv w/ heatmaps) is evaluated as an ablation study. +Figure 5. Human evaluation of video interpolation across different rates on both datasets. Incorporating motion programs significantly improves upon the baseline for 8x interpolation. + +(KD) metric as before, but now we find the average distance of keypoints detected in synthesized video with the keypoints detected in the ground-truth video. We present KD results for the major motion joints: left elbow, left wrist, right elbow, and right wrist. + +For evaluating the quality of synthesized videos, we also perform human preference studies on Amazon Mechanical Turk (AMT). We randomly showed videos synthesized from both the baseline and our method and ask humans 'Which video looks more realistic?' For each task, 30 subjects were each asked to vote on 30 random videos from the test set. + +Results. The quantitative results are shown in Table 3. We observe that the performance of our model (SepConv w/ programs) is comparable to SepConv at 2x interpolation and improves significantly for 8x interpolation on both datasets. Our model retains higher-level structure better as indicated by the KD metrics. It also generates realistic videos as validated by the human evaluation shown in Figure 5. Figure 6 highlights the qualitative improvements, our model can generate more realistic hands for sparse 8x interpolation. + +![](images/b229a0b1af7fffeb04085ff9be3520cc87b31c55a590f96f98dea11f03886bd3.jpg) + +![](images/ccfd767fb81fa69f7e7e01c748b296ea59099720049c75f38a62c66eb7253333.jpg) +Input (L) + +![](images/65d70752796bae7f416bcdbbdb54c95cd67d6426f98bd152cc718cafa93dc77a.jpg) + +![](images/c2105b79990d74bf0663c589e7fe462a366311c031922938bb7fbb193ea9f59b.jpg) +Input(R) + +![](images/7a1cf6c0076738a327437c85bed2996ec05b4696459b354864201dc3db366c10.jpg) + +![](images/83afaf8f159ae116f1ea808720be873c99e2acdb4555c9e451067a5c184103aa.jpg) +Groundtruth + +![](images/5006f7da5d339e89099fb061a3d23d15d31a980c825aba1490942245614e78da.jpg) + +![](images/be8deeb19a6d6bfb3b3913cd14327b8228e0592258340656b1489ffb7b2e4817.jpg) +SepConv +Figure 6. Qualitative results for $8\mathrm{x}$ video interpolation. We observe that using program information results in uniformly higher image quality. + +![](images/fd16c3a44cc4430df59c939ed7afc267d685463d8762a8cae38771bd72a209c9.jpg) +Diff. Map + +![](images/096e27f64dbdd579db91c8eb0d7cb4e507e946cfc8a01aa518a50c3b700d68f6.jpg) + +![](images/427db71a56930df408833e849d8bc4a0ecb1a04aa3b0db8f3dac55fca6ca6cc3.jpg) +Ours + +![](images/5d00792f057abdebdd7bfac7159c7071fc6eca1a6e66d00b01f1701a82566652.jpg) + +![](images/5c5659ae06e9c43d5d445b0bdc75af15cecd6b28b4ec3f04b1f37a1f74232a09.jpg) + +![](images/6a080a5029cf9371b4ccc0c5f6b54f92064d394dfc232ae340239fc8be1a0468.jpg) +Diff. Map + +![](images/817345647befaba76476097b082fa817d98fd06579c7be4a93f3536c706b3ee5.jpg) + +![](images/5f8537115b6244aa49b879f4bbc65ace665a4893e86040f273fa32e08b0493ef.jpg) +Diff. Map + +Table 3. Comparison of metrics for video interpolation of $2\mathrm{x} / 4\mathrm{x} / 8\mathrm{x}$ subsampling on the GolfDB and PoseWarp test sets. Metrics include keypoint difference in left/right elbow and wrist (lower is better), PSNR, SSIM (higher is better), and LPIPS (lower is better). + +
MethodDatasetKeypoint Difference↓Perceptual Metrics
l-elbowl-wristr-elbowr-wristaveragePSNR↑SSIM↑LPIPS↓
SepConv [23]2.5563.6062.3303.1241.79132.2850.9670.023
SepConv w/ heatmapsPoseWarp 2x2.3573.4902.2672.9101.78832.2460.9680.025
SepConv w/ programs2.2382.9821.9652.5521.65032.6990.9640.021
SepConv [23]3.2633.3483.0773.0482.30834.8600.9810.017
SepConv w/ heatmapsGolfDB 2x3.3953.2893.2112.9352.35535.0460.9820.017
SepConv w/ programs3.2103.2633.3252.9002.43235.5970.9820.015
SepConv [23]3.3194.6252.9263.9332.15130.8340.9550.034
SepConv w/ heatmapsPoseWarp 4x3.0114.3052.7083.6992.08830.820.9550.036
SepConv w/ programs2.7883.4412.4953.0681.93830.3440.9510.032
SepConv [23]4.9875.7914.6204.7973.59830.4880.9580.035
SepConv w/ heatmapsGolfDB 4x4.9275.3514.6704.7833.53230.6060.9590.034
SepConv w/ programs4.4664.7044.0854.0933.09130.9900.9590.031
SepConv [23]5.5209.3494.1327.5273.27527.6590.9230.059
SepConv w/ heatmapsPoseWarp 8x5.3679.2144.6728.4253.41127.6660.9230.06
SepConv w/ programs4.3716.6113.9556.4752.84027.5870.920.054
SepConv [23]10.76215.8528.34014.0756.90025.6720.9080.071
SepConv w/ heatmapsGolfDB 8x10.91416.1358.83915.4847.31725.9180.9130.068
SepConv w/ programs8.49611.1347.1349.9295.66926.5630.9140.062
+ +# 4.3. Extracting Repetitive Segments + +We now evaluate motion programs' ability on automatically extracting repetitive segments from long action clips. + +Data. We use three long (15+ minutes) exercise videos from YouTube, two with cardio and one with Taichi routines. We manually annotated the videos with ground-truth labels for repetitive action segments. + +Results. We generate abstract motion programs on full videos and evaluated the precision and recall of the detected for-loops. We manually annotated the videos with ground-truth labels to compute these metrics. We mark a loop as successfully extracted if the IoM (intersection over minimum) of the detected interval and ground-truth interval is greater than 0.5. The results are in Table 4. We present samples of repetition. + +itive segments extracted in the project webpage. We also present additional qualitative examples for repetitive structure extracted from the AIST++ dance database [16, 28]. + +Error analysis. We observed a few failure cases that contribute to the less than perfect precision and recall. First, our synthesis algorithm is not good at capturing fine small motions. The problem originates with pose detectors, which have low signal-to-noise ratio for small motions. For example, cardio00 has several small jogging motions which we do not mark as loops leading to lower recall values. Synthesis also sometimes produces poor results due to bad keypoint detection from body occlusions. Finally, one would expect that complex 3D human actions in the $z$ -plane are not well-described by 2D keypoints. We present a more detailed analysis with examples in the project webpage. + +Table 4. Comparing the number of detected segments (# det) with ground-truth segments (# gt) on three long exercise videos. + +
Video IDDuration# det# gtPrecisionRecall
cardio0037:10366288.5758.06
cardio0117:51192169.3590.47
taichi0223:22233410067.64
+ +![](images/6b01bea8308783ca94c8d96ed397f2f23641e9e93ea20944314995742d0d322d.jpg) + +![](images/406fa14cc5d2ec834b272ed730dc48bedd4867b4b32ac82bd4eeb4d045428d7b.jpg) + +![](images/07de6a4b3a26420ed58d41ab9ae7af6e30f7ebc3e388622fe6b1c3b680f4aedf.jpg) +Figure 7. Comparison of HierchVid [29] (blue), HistryRep [32] (orange) and ours (green) on video prediction. Top row: $\mathrm{KD}\downarrow$ (keypoint difference), bottom row: LPIPS $\downarrow$ on loops extracted from cardio00 and cardio01. + +![](images/ef34473e9186a78fd82dc9d712325c3ea3549c596e889836840e75a042c85b02.jpg) + +# 4.4. Video Prediction + +Once a set of for-loops has been detected in a video, motion programs enable indefinite extrapolation by executing the synthesized for-loops for additional iterations. This enables an interactive video editing platform, where one could expand or contract the repetitive section. In this section, we evaluate how well the for-loop based video prediction compare to standard baselines. + +Data. For each long video used in the previous section, we extract a dataset of all the detected for-loops. We use an 80-20 train-test split. + +Setup. For each dataset, we use the training set to train our baselines, HierchVid [29] and HistryRep [32]. HierchVid is an LSTM-based future pose predictor while HistryRep uses an attention-based model. At test time, we use the first half of the videos as input and compare the future poses generated with the second half as ground-truth. We also use first half as input to generate a motion program with for-loop and unroll it indefinitely to generate future poses. We then synthesize future frames from poses for both the methods using the Everybody Dance Now [5] GAN and compare it with the ground-truth frames. + +Metrics. Similar to video interpolation, we use the PSNR, SSIM and LPIPS image metrics when ground truth frames are available. We also compute the keypoint difference (KD) with the ground-truth poses. We average our results over 10 runs. Since predicting future frames is a stochastic task + +![](images/a2acef0fcfaffd8cacf51ac8075c5de75cfa99804f45462521771cf5f7ff533a.jpg) +Figure 8. Human evaluation of video prediction across different future frame slices on two datasets. We observe that extrapolating via motion programs leads to more consistent future prediction of repetitive segments + +![](images/82e155885af1ec3204019241528feee2056176688d050d1adb6be5de0c785077.jpg) + +and direct comparison to ground-truth might be an incomplete analysis, we also perform human preference studies on AMT. We randomly showed videos synthesized from both the methods and ask humans 'Which video looks more similar to the ground-truth?' For each dataset, 10 subjects were each asked to vote for all the videos from the test set. To have a granular understanding, we did three studies, comparing the first 900 frames in sets of 300 frames. + +Results. We present quantitative results in Figure 7 where we plot the average KD and LPIPS metrics on the two datasets against the number of future frames predicted. We observe that as the number of future frames increases, the gap between the baselines and our model increases. This is due to the fact that both HierchVid and HistryRep perform sequence modelling and do not have higher level knowledge of repetitions. After the first few frames, the error compounds and the model diverges to performing a different action. This fact is reinforced by the human evaluation study, results of which are in Figure 8. On the cardio00 dataset, HierchVid does well on the first few frames, though in the later frames our model is more consistent with the ground-truth. We present additional results on more metrics on our webpage. + +# 5. Discussion + +We have presented a hierarchical motion understanding framework based on motion programs. From the input video, we can automatically build primitive-level understanding while also capturing higher-level repetitive structures. Experiments show that these programs can capture a wide range of semantically meaningful actions, enhance human motion understanding, and enable applications such as video synthesis for computer animation. Like all other visual content generation methods, we urge users of our models to be aware of potential ethical and societal concerns and to apply them with good intent. + +Acknowledgements. This work is in part supported by Magic Grant from the Brown Institute for Media Innovation, the Samsung Global Research Outreach (GRO) Program, Autodesk, Amazon Web Services, and Stanford HAI for AWS Cloud Credits. + +# References + +[1] Andreas Aristidou, Daniel Cohen-Or, Jessica K Hodgins, Yiorgos Chrysanthou, and Ariel Shamir. Deep motifs and motion signatures. ACM TOG, 2018. 2 +[2] Guha Balakrishnan, Amy Zhao, Adrian V Dalca, Fredo Durand, and John Guttag. Synthesizing images of humans in unseen poses. In CVPR, 2018. 6 +[3] Randy Bullock. Least-squares circle fit. Developmental Testbed Center, 2006. 3 +[4] Zhe Cao, Gines Hidalgo, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Openpose: Realtime multi-person 2d pose estimation using part affinity fields. IEEE TPAMI, 2019. 3 +[5] Caroline Chan, Shiry Ginosar, Tinghui Zhou, and Alexei A Efros. Everybody dance now. In ICCV, 2019. 8 +[6] Abe Davis and Maneesh Agrawala. Visual rhythm and beat. ACM TOG, 2018. 2 +[7] Emily Denton and Rob Fergus. Stochastic Video Generation with a Learned Prior. In ICML, 2018. 2 +[8] Kevin Ellis, Daniel Ritchie, Armando Solar-Lezama, and Josh Tenenbaum. Learning to Infer Graphics Programs from Hand-Drawn Images. In NeurIPS, 2018. 2 +[9] Hao-Shu Fang, Shuqin Xie, Yu-Wing Tai, and Cewu Lu. RMPE: Regional multi-person pose estimation. In ICCV, 2017. 3 +[10] Michael Gleicher. Motion editing with spacetime constraints. In I3D, 1997. 2 +[11] Michael Gleicher and Peter Litwinowicz. Constraint-based motion adaptation. The journal of visualization and computer animation, 1998. 2 +[12] Huaizu Jiang, Deqing Sun, Varun Jampani, Ming-Hsuan Yang, Erik Learned-Miller, and Jan Kautz. Super slomo: High quality estimation of multiple intermediate frames for video interpolation. In CVPR, 2018. 2 +[13] Lucas Kovar, Michael Gleicher, and Frédéric Pighin. Motion graphs. In SIGGRAPH, 2008. 2 +[14] Jun Li, Kai Xu, Siddhartha Chaudhuri, Ersin Yumer, Hao Zhang, and Leonidas Guibas. GRASS: Generative Recursive Autoencoders for Shape Structures. ACM TOG, 2017. 2 +[15] Manyi Li, Akshay Gadi Patil, Kai Xu, Siddhartha Chaudhuri, Owais Khan, Ariel Shamir, Changhe Tu, Baoquan Chen, Daniel Cohen-Or, and Hao Zhang. GRAINS: Generative Recursive Autoencoders for INdoor Scenes. ACM TOG, 2019. 2 +[16] Ruilong Li, Shan Yang, David A. Ross, and Angjoo Kanazawa. Learn to dance with aist++: Music conditioned 3d dance generation, 2021. 7 +[17] Aristid Lindenmayer. Mathematical models for cellular interactions in development ii. simple and branching filaments with two-sided inputs. Journal of theoretical biology, 1968. 2 +[18] Yu-Lun Liu, Yi-Tung Liao, Yen-Yu Lin, and Yung-Yu Chuang. Deep video frame interpolation using cyclic frame generation. In AAAI, volume 33, 2019. 2 +[19] Ziwei Liu, Raymond Yeh, Xiaou Tang, Yiming Liu, and Aseem Agarwala. Video Frame Synthesis Using Deep Voxel Flow. In ICCV, 2017. 2 + +[20] Erika Lu, Forrester Cole, Tali Dekel, Weidi Xie, Andrew Zisserman, David Salesin, William T Freeman, and Michael Rubinstein. Layered neural rendering for retiming people in video. SIGGRAPH Asia, 2020. 2 +[21] Jiayuan Mao, Xiuming Zhang, Yikai Li, William T. Freeman, Joshua B. Tenenbaum, and Jiajun Wu. Program-Guided Image Manipulators. In ICCV, 2019. 2 +[22] William McNally, Kanav Vats, Tyler Pinto, Chris Dulhanty, John McPhee, and Alexander Wong. Golfdb: A video database for golf swing sequencing. In CVPR Workshop, June 2019. 5 +[23] Simon Niklaus, Long Mai, and Feng Liu. Video frame interpolation via adaptive separable convolution. In CVPR, 2017. 1, 2, 6, 7 +[24] Chengjie Niu, Jun Li, and Kai Xu. Im2Struct: Recovering 3d Shape Structure from a Single RGB Image. In CVPR, 2018. 2 +[25] Charles F Rose, Bobby Bodenheimer, and Michael F Cohen. Verbs and adverbs: Multidimensional motion interpolation using radial basis functions. CiteSeer, 1999. 2 +[26] Gopal Sharma, Rishabh Goyal, Difan Liu, Evangelos Kalogerakis, and Subhransu Maji. CSGNet: Neural Shape Parser for Constructive Solid Geometry. In CVPR, 2018. 2 +[27] Yonglong Tian, Andrew Luo, Xingyuan Sun, Kevin Ellis, William T. Freeman, Joshua B. Tenenbaum, and Jiajun Wu. Learning to Infer and Execute 3D Shape Programs. In ICLR, 2019. 2 +[28] Shuhei Tsuchida, Satoru Fukayama, Masahiro Hamasaki, and Masataka Goto. Aist dance video database: Multi-genre, multi-dancer, and multi-camera database for dance information processing. In ISMIR, pages 501-510, Delft, Netherlands, Nov. 2019. 7 +[29] Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to Generate Long-term Future via Hierarchical Prediction. In ICML, 2017. 1, 2, 8 +[30] Yanzhen Wang, Kai Xu, Jun Li, Hao Zhang, Ariel Shamir, Ligang Liu, Zhiquan Cheng, and Yueshan Xiong. Symmetry Hierarchy of Man-Made Objects. CGF, 2011. 2 +[31] Zhou Wang, Alan C. Bovik, Hamid R. Sheikh, and Eero P. Simoncelli. Image Quality Assessment: From Error Visibility to Structural Similarity. IEEE TIP, 2004. 6 +[32] Mao Wei, Liu Miaomiao, and Salzemann Mathieu. History repeats itself: Human motion prediction via motion attention. In ECCV, 2020. 1, 8 +[33] Halley Young, Osbert Bastani, and Mayur Naik. Learning Neurosymbolic Generative Models via Program Synthesis. In ICML, 2019. 2 +[34] Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, and Oliver Wang. The Unreasonable Effectiveness of Deep Networks As a Perceptual Metric. In CVPR, 2018. 6 \ No newline at end of file diff --git a/hierarchicalmotionunderstandingviamotionprograms/images.zip b/hierarchicalmotionunderstandingviamotionprograms/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bfa12298fbd9b30ad97d317981f56936b7c86759 --- /dev/null +++ b/hierarchicalmotionunderstandingviamotionprograms/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce0a9f0924c827d1aebc5bbc7f983d7c8769233d109a588fede9e1b3ba483022 +size 878439 diff --git a/hierarchicalmotionunderstandingviamotionprograms/layout.json b/hierarchicalmotionunderstandingviamotionprograms/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d6054464d7acf0f56b4de7a5cf8e18551bd38dc1 --- /dev/null +++ b/hierarchicalmotionunderstandingviamotionprograms/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:600c6250935f1ea973d12f329f1439ee24a771030cdc494ce74152e999557320 +size 374409 diff --git a/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_content_list.json b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b87f685a55898f4deab193d0df73184adbe09574 --- /dev/null +++ b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a4bdd5a4dd529a16faab8b15d7472b4d8d52715ba15b0f55c88fbd8c7096bd4 +size 72441 diff --git a/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_model.json b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9fb460f8f7e4a319d5477dc47304abf24815748d --- /dev/null +++ b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8f6c0431802740d5680de3193c50052282e1ed843791d1f36c334a7ce708c05 +size 89601 diff --git a/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_origin.pdf b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ac242ce3c4b4142cb2dda5815abc158ac6ab32d7 --- /dev/null +++ b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/17c6f366-e072-41d5-a071-0c05d0af84af_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74cda8a6a40ff682ba390055a4005759dc140a5f2474d501436aaf5c1060729d +size 9747296 diff --git a/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/full.md b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..75c708f320c6465f7665492c73b724bb5e1b7ae5 --- /dev/null +++ b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/full.md @@ -0,0 +1,304 @@ +# Hierarchical Video Prediction using Relational Layouts for Human-Object Interactions + +Navaneeth Bodla1 + +Gaurav Shrivastava1 + +1University of Maryland, College Park + +Rama Chellappa2 + +Abhinav Shrivastava + +2Johns Hopkins University + +# Abstract + +Learning to model and predict how humans interact with objects while performing an action is challenging, and most of the existing video prediction models are ineffective in modeling complicated human-object interactions. Our work builds on hierarchical video prediction models, which disentangle the video generation process into two stages: predicting a high-level representation, such as pose sequence, and then learning a pose-to-pixels translation model for pixel generation. An action sequence for a human-object interaction task is typically very complicated, involving the evolution of pose, person's appearance, object locations, and object appearances over time. To this end, we propose a Hierarchical Video Prediction model using Relational Layouts. In the first stage, we learn to predict a sequence of layouts. A layout is a high-level representation of the video containing both pose and objects' information for every frame. The layout sequence is learned by modeling the relationships between the pose and objects using relational reasoning and recurrent neural networks. The layout sequence acts as a strong structure prior to the second stage that learns to map the layouts into pixel space. Experimental evaluation of our method on two datasets, UMD-HOI and Bimanual, shows significant improvements in standard video evaluation metrics such as LPIPS, PSNR, and SSIM. We also perform a detailed qualitative analysis of our model to demonstrate various generalizations. + +# 1. Introduction + +Video prediction is a challenging task of predicting future frames conditioned on one or more past frames. Videos in the real world are extremely complex. An everyday action, such as drinking a coffee, results from complicated interactions among various objects. For example, first, the person might reach the coffee pot and pour coffee into their cup. Next, they might start drinking from the cup while browsing their cell phone. Observe that this particular action involves interactions among various objects such as a + +coffee pot, cup, and cell phone. Each of the objects has its relative motion with respect to other objects and the person performing the action. While it is effortless for human beings to imagine such events, existing computer vision models often fail at these tasks. + +Existing video prediction methods broadly fall into two categories: 1) models that directly predict the video in the pixel space, and 2) models that use hierarchical prediction. Hierarchical prediction methods are a preferred over directly predicting the video in pixel space as they learn a good intermediate representation which is then mapped to pixel space. Disentangling the prediction into simpler steps helps the models focus on smaller tasks and, hence, learn an improved frame prediction model. A natural choice of intermediate representation for videos is optical flow [1]. Similarly, for videos involving human actions, human-pose is typically used as an intermediate representation. Villegas et al. [2] and Walker et al. [3] have disentangled the video prediction by first predicting the pose sequence and then mapping the pose sequence to pixel space. + +While pose is a great choice for videos involving human actions, pose alone is not sufficient to capture various dynamics in a Human-Object interaction sequence. For complex actions, such as human-object interactions where multiple objects evolve over time, pose alone does not fully capture the complex scene dynamics. Since the pose does not contain any information about the objects, the models fail to capture the object's motion and appearance faithfully. To mitigate this issue, we propose to learn a layout sequence as an intermediate representation. A layout sequence is a combination of pose and object sequences that not only captures the person's pose while performing an action, but also explicitly learns the locations of various objects at different times while the action is being performed. The naive way of learning these pose and object sequences independently is also not sufficient since the spatio-temporal evolution of an object is dependent on how the pose is evolving and vice versa. Hence, we propose a Human-Object Relational Network (HORN) to model these complex interactions among objects and poses. + +Our key contributions for video prediction for human + +object interactions are: 1) we model the full-body motion for humans, 2) our intermediate representation captures both pose and object locations, and thus learns a better structure prior for the frame prediction stage. 3) our model can generate videos for novel interactions, e.g., it can generalize well to new people performing actions that were not part of the training set. + +# 2. Related Work + +Our work is closely related to video prediction, human-object interaction, and relational reasoning. We briefly review some related research in these areas. + +Video Prediction. Early works in video prediction have focused on directly predicting the sequence of frames in pixel space [4-11]. Our work is different from these since we do not predict the frames in the pixel space directly. Instead, we use a hierarchical model that first generates a structure that acts as a prior to the next stage of generating pixels. Two-stage methods have been proposed to improve the video prediction models [2, 3, 12-16]. HVP [2] learns to predict a sequence of poses in the first stage and maps it to pixel space using a visual analogy in the second stage. For complicated videos such as human-object interaction, there is more than one object, and the person's pose evolving over time. Therefore, pose alone is not sufficient to capture good structure prior. We propose to learn a layout sequence, which is a combination of both pose and object sequences. + +Human-Object Interaction. Modeling human-object interactions in images has been an active research topic in computer vision [17-22]. HoI-GAN [23] proposed a generative model using 3D convolutions for synthesizing human interactions with objects in videos. Similar to this, our work also aims to synthesize human-object interaction videos. However, it is different in the following aspects 1) we propose a two-stage method instead of synthesizing images directly in the pixel space. 2) We model interactions with more than one object, whereas HoI-GAN assumes interactions with only one object. 3) While HoI-GAN models egocentric videos predominantly involving hand motions, we model humans' full-body motion. + +Relational Reasoning. Relational reasoning has been widely used to model the interactions among various entities for visual understanding tasks such as: object interactions in videos [24], object relationships in images [25], action prediction [26, 27], human-object interactions [28-30] human trajectory prediction [31], physical dynamics of object [32, 33] etc. To the best of our knowledge, this work is the first to use relational reasoning in the context of video prediction for real-world videos. Since our task involves modeling human-object interactions, which in-turn involves reasoning across entities such as humans and objects and + +objects and objects, relational reasoning is a natural choice for our first stage of layout generation. + +# 3. Human-Object Interactions using Relational Layouts + +Let $x_0$ be the first frame of a video sequence of a person performing an action $a$ . Let $b_0 = \{b_0^0, b_0^1, \ldots, b_0^n\}$ be the set of objects in the first frame of the video. Our task is to predict how a person would perform action $a$ by interacting with objects $b_0$ . Formally, we would like to learn a mapping function $X_{1:T} = G(x_0, a, b_0)$ that takes the first frame, also called as guidance frame, $x_0$ , action $a$ and a set of objects $b_0$ in the guidance frame as inputs and learns to predict the subsequent frames $X_{1:T} = [x_1, x_2, \ldots, x_T]$ . + +We disentangle this process of generating the video $X_{1:T}$ conditioned on the guidance frame $x_0$ into two subtasks. In the first stage, we learn a coarser representation of the video, which is a sequence of layouts $L_{1:T}$ . The layout sequence is a sequence of object locations and keypoints of the person performing the target action. In the second stage, we learn a video generator that takes the sequence of layouts and the guidance frame as inputs and predicts the video in the pixel space. + +# 3.1. Stage 1: Relational Layout generation + +A layout sequence $L_{0:T}$ is a combination of pose and object sequences. Formally, let $P_{0:T} = [p_0, p_1, \ldots, p_T]$ be the sequence of poses, let $B_{0:T}^k = [b_0^k, b_1^k, \ldots, b_T^k]$ where $k = 1, 2, \ldots, n$ be the sequence of $k$ -th object. We assume that the number of objects, $n$ remains constant through out the sequence. $L_{0:T} = [l_0, l_1, \ldots, l_T]$ is a sequence of layouts where $l_t = (p_t, b_t^1, b_t^2, \ldots, b_t^n)$ . At each time step $t$ layout $l_t$ is a tuple of pose and objects. + +Our Relational Layout Generator consists of three main building blocks: 1) a Human-Object sequence prediction model that learns to predict the sequence of poses and sequence of objects corresponding to the target action, 2) a Human-Object relational model that learns to reason about relations among various objects and poses and 3) the pose and object decoders that generate the final sequence of layouts. + +Human-object sequence prediction. The pose and object features for every time step are learned recursively using recurrent networks. More than one object evolves over time in an action, and hence we model each object's sequence separately using an RNN. Since all the object sequences differ only in terms of the object category, we share the recurrent network parameters for all the object sequences. The pose and object features for the time step $t + 1$ are obtained by learning pose and object recurrent networks $\mathrm{RNN}_{\theta_p}$ and + +![](images/e6ec077aca47565935c4a5f68d6bda4ae78313a626a11ce3ae78e89f10c8e5a2.jpg) +(a) Context Encoder + +![](images/76a17d83def250b8df90b77c02b18c243380504a86207a2033cec8f11d1b983b.jpg) + +![](images/1c2832a31eefb4f5f91ba1073e4a98d75fd807ea4ca3c1e014c39485f92b5a7a.jpg) +(b) Layout Generator $(\mathrm{G_L})$ + +![](images/2f513b3cd90c3659a91dcc8cd8be4a097b85c38707a85246a5844830dab44fd0.jpg) +(c) Layout sequence to video generator +Figure 1: An overview of our approach. (a) Context encoder for encoding the first frame, action, and object information. (b) Layout generator for predicting the layout sequence using pose and object RNNs and relational network. (c) Video generator for mapping layouts to pixels. + +$\mathrm{RNN}_{\theta_o}$ as follows: + +$$ +v _ {p} = \operatorname {R N N} _ {\theta_ {p}} \left(c _ {p}, p _ {t}\right), \quad v _ {o} ^ {k} = \operatorname {R N N} _ {\theta_ {o}} \left(c _ {o}, b _ {t} ^ {k}\right) \tag {1} +$$ + +where $p_t$ is the pose and $b_t^k$ is the location of the $k$ -th object at time step $t$ and $\theta_p$ , $\theta_o$ are the parameters of the RNNs for pose and object respectively. $c_p$ and $c_o^k$ are context features for pose and object RNNs that remain constant throughout the sequence prediction for every step. $c_p$ and $c_o^k$ are computed by learning the context mapping functions $c_p = f_{\theta_p}(x_0, a)$ and $c_o^k = f_{\theta_o}(x_0, a, y^k)$ where $y^k$ is the object class for the $k$ -th object. + +Human-object relational reasoning. In a typical Human-Object interaction sequence, the pose and object sequences are highly correlated. Since the sequence prediction step learns a sequence of pose and object features independently, it cannot reason about the relations among them. Therefore to incorporate relational reasoning among various objects and human pose, we propose a Human-Object Relational Network (HORN). HORN takes the pose and object features from the sequence prediction step and enhances them by learning the complicated Human-Object relationships. HORN learns two kinds of Human-Object relations: 1) Object-Object and 2) Human-Object. + +Given a set of object features $\mathcal{O} = \{v_o^1,v_o^2,\dots ,v_o^n\}$ we define pairwise relations between the object feautres as $g_{\theta}(v_o^i,v_o^j)$ where $g_{\theta}(:,.)$ is a feature extraction function pa + +rameterized by $\theta$ and $v_{o}^{i}, v_{o}^{j}$ are the object features, which are the outputs of the sequence prediction step. The pairwise relational features are further aggregated to obtain object relational features (ORF) for every object as: + +$$ +\operatorname {O R F} \left(v _ {o} ^ {i}\right) = g _ {\phi} \left(g _ {\theta} \left(v _ {o} ^ {i}, v _ {o} ^ {j}\right): v _ {o} ^ {j} \in \mathcal {O}\right) \tag {2} +$$ + +$g_{\phi}$ is the aggregation function parameterized by $\phi$ that learns to aggregate all pairs for object features. + +Object relational features are further encouraged to learn Human-Object Relational Features (HORF) by learning their relationships with pose features. To do this, we learn $h_{\theta}(v_p,\mathrm{ORF}(v_o^i))$ where $h_{\theta}(v_p,.)$ is a feature extraction function parameterized by $\theta$ , $v_{p}$ is the pose feature and $\mathrm{ORF}(v_o^i)$ is the object relational feature of the $i$ -th object. Similarly, the pose feature $v_{p}$ is encouraged to learn the relationships with the objects. This is done by learning a function $h_{\phi}(v_p,\mathrm{ORF}(v_o^i))$ where $h_{\phi}(v_p,.)$ is a feature extraction function parameterized by $\phi$ . Therefore, + +$$ +\operatorname {H O R F} \left(v _ {o} ^ {i}\right) = h _ {\theta} \left(v _ {p}, \operatorname {O R F} \left(v _ {o} ^ {i}\right)\right), \tag {3} +$$ + +$$ +\mathrm {H O R F} (v _ {p}) = h _ {\phi} (v _ {p}, \mathrm {O R F} (v _ {o} ^ {i}))). +$$ + +where $v_{o}^{i}\in \mathcal{O}$ + +Pose and object decoders. The HORN outputs are enhanced pose and object feature vectors obtained by learning the relationships among them. These enhanced pose + +and object feature vectors are passed through their respective pose and object decoders $D_{p}$ and $D_{o}$ to predict the pose $\widehat{p}_{t + 1}$ and objects $\widehat{b}_{t + 1}^{k}$ for the next step. This process is recursively continued to generate the layout sequence $\widehat{L}_{1:N}$ . The overall layout generator $(G_{L})$ is learned by minimizing the layout loss $\mathcal{L}_{\mathrm{Layout}} = \mathcal{L}_{\mathrm{pose}} + \mathcal{L}_{\mathrm{object}}$ as: + +$$ +\mathcal {L} _ {\text {p o s e}} = \mathrm {B C E} \left(p _ {1: T}, \widehat {p} _ {1: T}\right), \mathcal {L} _ {\text {o b j e c t}} = \sum_ {k = 1,.., n} \mathrm {M S E} \left(b _ {1: T} ^ {k}, \widehat {b} _ {1: T} ^ {k}\right) \tag {4} +$$ + +# 3.2. Stage 2: Layout sequence to video generation + +Once the layout sequence is predicted, the next step is to learn to map them to video. The layout sequence acts as a structure prior that helps the generator to synthesize temporally coherent videos with high fidelity. The video generator needs to learn to generate frames with the same context as the guidance frame while respecting the input layout. While the guidance frame provides contextual information such as background, the appearance of the objects in place, and the person's appearance performing the action, the layout offers information about the pose and location of objects. The video generator learns to extract this contextual information from the guidance frame, propagates it throughout the video, and maintains the pose and object locations. + +The video generator model $(G_v)$ is an encoder-decoder style convolutional neural network that takes a layout as input and generates a frame. To maintain temporal consistency across the predicted frames, along with the current layout, $G_v$ takes the previous layout and the guidance frame as inputs to generate the current frame. To generate the frame at time step $t$ , $G_v$ takes $l_t$ , $l_{t-1}$ and $x_0$ as inputs. The video generator is learned by minimizing the $\mathcal{L}_1$ loss between the generated and ground truth video as follows: + +$$ +\widehat {x} _ {t} = G _ {v} \left(l _ {t}, l _ {t - 1}, x _ {0}\right), \quad \mathcal {L} _ {\mathrm {p i x}} = \sum_ {t = 1, \dots , T} | \widehat {x} _ {t} - x _ {t} | \tag {5} +$$ + +Since the input to the video generator is just the first frame, $\mathcal{L}_1$ loss alone is not sufficient to generate high fidelity videos. With $\mathcal{L}_1$ loss alone, the videos tend to be blurry and not guaranteed to synthesize objects faithfully. This problem gets aggravated when the objects are too small with significant motion in very few frames. Hence, to further improve the generated videos' visual quality, we learn the video generator by training it with feature loss and discriminator loss functions. We use the same feature loss $(\mathcal{L}_{\mathrm{feat}})$ as proposed in HVP [2]. For improving the realism of the generated videos, we propose three discriminators that operate at various granularity levels: 1) an object discriminator to enhance objects' appearance, 2) a frame discriminator to make frames look more realistic, and 3) a video discriminator to improve the spatio-temporal quality of the generated video in pixel space. + +Conditional Object Discriminator. To obtain a perceptually good appearance for the objects, we train $G_{v}$ against an object discriminator. The generated video frames must have the following two properties: 1) the objects' appearance in every frame needs to match with that of the guidance frame, and 2) the objects must belong to the same class as the guidance frame. Hence the conditional object discriminator $D_{\mathrm{obj}}$ takes cropped objects from guidance frame, cropped objects from generated (and real) frames, and the corresponding object classes as inputs. $D_{\mathrm{obj}}$ is trained to distinguish a fake triplet from a real triplet, and the generator $G_{v}$ is encouraged to synthesize the objects that can fool the discriminator. $G_{v}$ and $D_{\mathrm{obj}}$ are trained by minimizing the loss function: + +$$ +\mathcal {L} _ {\mathrm {o b j}} = \left[ \log D _ {\mathrm {o b j}} \left(x _ {t} ^ {c}; y, x _ {0} ^ {c}\right) \right] + \left[ \log \left(1 - D _ {\mathrm {o b j}} \left(\widehat {x} _ {t} ^ {c}; y, x _ {0} ^ {c}\right)\right) \right]. \tag {6} +$$ + +where $x_{t}^{c}$ is the cropped object from real video and $\widehat{x}_{t}^{c}$ is the cropped object from the predicted video at time $t$ . + +Conditional Frame Discriminator. To ensure that the video generator accurately learns the person's appearance, we train it against a frame discriminator $D_{f}$ . $D_{f}$ takes the guidance frame and each of the subsequent frames as inputs and learns to distinguish it from a fake pair. The generator is trained to synthesize frames that fool the discriminator and hence learns to transfer the person's appearance from the guidance frame to the entire video. $G_{v}$ and $D_{f}$ are trained by minimizing the loss function: + +$$ +\mathcal {L} _ {\text {f r a m e}} = \left[ \log D _ {f} \left(x _ {t}; x _ {0}\right) \right] + \left[ \log \left(1 - D _ {f} \left(\widehat {x} _ {t}; x _ {0}\right)\right) \right]. \tag {7} +$$ + +Conditional Video Discriminator. To obtain temporally coherent predicted videos, we train the video generator $G_{v}$ against a video discriminator $D_{v}$ . $D_{v}$ is also designed to ensure that the generated frames are coherent with the input layout. To do so, $D_{v}$ takes the layout sequence and real video as inputs and learns to distinguish with the fake pair. $G_{v}$ and $D_{v}$ are trained by minimizing the loss function: + +$$ +\mathcal {L} _ {\mathrm {v i d e o}} = \left[ \log D _ {v} \left(X _ {1: T}, L _ {1: T}\right) \right] + \left[ \log \left(1 - D _ {v} \left(\widehat {X} _ {1: T}, L _ {1: T}\right)\right) \right]. \tag {8} +$$ + +# 3.3. Architecture and training details + +Inputs. In our model, the guidance frame is a tensor of size $128 \times 128 \times 3$ . The action vector is a one-hot embedding of size $1 \times d_{a}$ and the object vectors are one-hot embeddings of size $1 \times d_{o}$ where $d_{a}$ and $d_{o}$ are number of action classes and object classes respectively. For the pose sequence, pose at every time step is represented as a 2D map of $N_{kp}$ keypoints. That is, $p_{t}$ is a tensor of size $128 \times 128 \times N_{kp}$ . For the object sequence of every object, $b_{t}^{k}$ is represented using object class and bounding box information. $b_{t}^{k}$ is a tensor of size $1 \times (d_{o} + 4)$ which is obtained + +Table 1: Quantitative comparison of our method with baselines on Bimanual dataset. FID and I-DTW scores are lower the better and mAP is higher the better. + +
MetricFID(↓)I-DTW(↓)mAP(↑)
MoCoGAN181.6514.977.83
HoI-GAN214.6713.298.77
HVP69.9211.3257.52
HORN (ours)35.8210.5259.04
+ +by concatenating one-hot vector of the object class and the bounding box, $x,y,dx,dy$ + +Layout generator. We use convolutional encoders to encode frames and poses in the layout generator. The guidance frame encoder $E_{g}$ , the pose encoder $E_{p}$ and the pose decoder $D_{p}$ are convolutional networks with $4 \times 4$ convolutions and stride 2. All convolutional layers are followed by batch normalization and ReLU. For pose and object sequences, we use two layer LSTMs with hidden size of 128. Note that all the object sequences share the same LSTM. The HORN is implemented using a 2 layer MLP as mentioned in Palm et al. [34] + +Video generator and discriminators. Video generator is a Pix2PixHD [35] architecture with 2 local enhancers and 2 global blocks. The input to the generator is a tensor of size $128 \times 128 \times 3 + 2 * (N_{kp} + d_o)$ . This is obtained by concatenating the guidance frame, pose maps, and object maps of the current and previous frames. + +The frame discriminator and object discriminators are 2D convolutional networks, and the video discriminator is a 3D convolutional network with spectral normalization. For the object discriminator, the objects are cropped and resized to a fixed size of $32 \times 32$ . We train the Model using Adam optimizer with a learning rate of 0.0002 and batch size 24. The layout generation and pixel generation stages are trained independently. Additional training details, such as data augmentation and preprocessing, are provided in the supplementary material. In all our experiments, the videos are of length 17 such that given the first frame, the next 16 frames are predicted by the model. + +# 4. Experiments + +We present the qualitative and quantitative evaluation of our approach on two datasets: 1) UMD-HOI [36] and 2) Bimanual [37]. Both these datasets contain the videos where a performer approaches a set of objects and performs a task such as drinking, speaking on a telephone, cooking with bowls, etc. The main advantages of these datasets are: 1) the performer is fully visible in the video, 2) the actions performed are complex enough to involve full-body motion, and 3) An action may contain interaction with multiple objects. The UMD-HOI dataset has videos with sin- + +gle object interactions mainly done with either right or left hand. The Bimanual dataset has videos with more complicated interactions with multiple objects involving both hands. Therefore, these datasets are better suited to evaluate various components in our method, such as the effectiveness of pose sequences, object sequences, and their interactions. + +UMD-HOI dataset. UMD-HOI dataset has a total of 64 videos with actions performed by ten subjects performing six interactions with four objects. The dataset is divided into train and test splits. The train split contains 50 videos, and the test split contains 14 videos. To evaluate generalization to new subjects, a random subject is held out of training. The training and test videos are chosen randomly. + +Bimanual dataset. The Bimanual dataset contains 540 videos with actions performed by six subjects. It has an overall twelve objects and nine tasks. The tasks in this dataset involve interactions with multiple objects over time. For example, "cooking with bowls" action involves picking up a whisk, mixing in the bowl, poring from another bowl, etc. We selected 6 tasks and computed the tracklets for each object in the video using two heuristics: 1) IoU and 2) similarity score based on the color histogram. The dataset is divided into training and testing splits. The training has 300 videos, and testing has 120. The data is split so that two random actions performed by every subject are held out from training and are included in the test set. + +We compare our method with the following baselines : + +- im2vid MoCoGAN [38]: MoCoGAN is a widely used video prediction model that synthesizes videos from random noise. We use an image to video prediction version of the MoCoGAN as mentioned in [38] (section 4.3) to compare our method. It is a stronger baseline and closer to our approach. We modify it to take the first frame and action as inputs to predict the video. +- im2vid HOI-GAN [23]: Like MoCoGAN, we modify HOI-GAN to image to the video prediction model. For that, we make two modifications to the original model: 1) We remove noise as the input, and 2) the generator is trained with an additional $L_{1}$ loss function. + +# 4.1. Quantitave Analysis + +Perceptual similarity measures. To quantitatively evaluate the effectiveness of our approach, we compare our method with the baselines using the following standard video evaluation metrics: 1) LPIPS [39], 2) SSIM [40] and 3) PSNR. The results are shown in Figure 2. + +Our method significantly outperforms the baselines on LPIPS and SSIM metrics for both the UMD-HoI and bi-manual datasets. On the PSNR metric, our approach has a similar performance as that of HoI-GAN. SSIM, PSNR, and LPIPS metrics are limited in accurately measuring the + +![](images/e3ed7c8f0f1c236f458b18a38b97747189a562e38deb6fbb472158fe6374c1a8.jpg) +(a) LPIPS + +![](images/916c032917afb0d35390fa0d50ba74cf4b071cb5f77c33b880b4e19ace8c4be1.jpg) +(b) SSIM + +![](images/0d80834f9735e79416ea2ea09663f2faeecaef6ae91fd18cbaab9f277df7072f.jpg) +(c) PSNR + +![](images/f8f8f1aa223404a4d6e5548819b92003b2c1dd8f4c001258382e49c9e1c2a514.jpg) +(d) LPIPS + +![](images/ffa48bc07ea5ea03274b26ff0b861e559cd0f932100f7f03edb306eebfea14d2.jpg) +(e) SSIM + +![](images/003978baaa1e6b5de99ff3c6977daf406628733b5cca972a01e2df896ab0d09d.jpg) +(f) PSNR + +![](images/9471a93b34ea5bc2f0553d76f6ac58ad430954c2b148c7fb8133308944de723a.jpg) +Figure 2: Comparison of our method with baselines on UMD-HOI (a-c) and Bimanual (d-f) datasets +Figure 3: Limitations of pose only intermediate representation as compared to our layout representation. + +performance of video prediction methods. These are frame-based metrics that assume that the predicted video is aligned temporally with the ground truth video, which is not valid. For example, an actor could be performing an action slowly in the predicted videos compared to the ground truth, which leads to phase shift. Standard video evaluation metrics fail to capture these properties. Therefore we further evaluate our model on the bimanual dataset using three additional metrics: 1) FID score [41], 2) Inception-DTW score, and 3) mAP of the objects detected by a FasterRCNN based detector in the generated frames. FID score is more widely accepted and a standard metric for quantitatively evaluating an image generation model's effectiveness. We use this metric to assess the quality of the generated frames. While the FID score measures the overall frame quality, it doesn't consider the generated videos' temporal quality. For estimating this, we propose a pre-trained Inception network-based Dynamic Time Warping metric (I-DTW). Like FID and Inception scores [42], I-DTW relies on features from a pre-trained inception network to measure the temporal video quality. Since inception based metrics have been used widely for evaluating the image generation models, we extend it to evaluate video generation models. To compute the I-DTW score, we extract the normalized Inception features + +for the generated video sequence and the ground truth sequence and calculate the DTW distance between these two sequences in the feature space. Lower the I-DTW score, better the generated video since it is closer to the ground truth in the feature space learned by the inception network. Our method significantly outperforms the baselines on these metrics, as shown in Table 1. + +# 4.2. Ablations + +We perform a detailed ablation analysis to measure the usefulness of various components of our model. + +Importance of layout generation. The layout generation step is essential to our model for generating a good video, and we argue that pose alone is not sufficient. Figure 3 shows the importance of object locations and poses in predicting a video. For this experiment, we use our layout generator's output to train a pose only to frame mapping, as described in HVP [2]. We compare this visually against our model's output. Note that for the pose only model, while the posture changes, the objects more or less remain in the same position as the guidance frame. In Figure 3, a red bowl is an object of interaction that changes its location over time. However, in the pose only model, the red bowl doesn't move at all. + +Table 2: Quantitative evaluation of the importance of various modules in our model. Each row is a model trained with different loss functions indicated in the columns. + +
LpixLfeatFrameGANObjectGANVideoGANFID(↓)I-DTW(↓)mAP(↑)
HORN✓✓---49.0512.9353.54
✓✓✓--40.4410.7557.21
Models(ours)✓✓✓✓-38.3010.6458.67
✓✓✓✓✓35.8310.5259.04
+ +Table 3: Results on Bimanual dataset. ++ implies improved baselines for HoI-GAN and MoCoGAN respectively. Ab1, Ab2 and Ab3 are architecture ablations of our model without relational reasoning, without prior layouts and conditioning on previous generated frame instead of the first frame respectively. SSIM, PSNR and LPIPs are average values. + +
FIDmAPI-DTWSSIMPSNRLPIPS
HoI-GAN++210.427.2813.250.7418.470.78
MoCoGAN++181.297.6914.920.6716.810.73
Ab165.7355.4611.380.8017.990.83
Ab242.9758.2810.190.8118.600.86
Ab3140.8034.4714.690.6715.750.69
Ours35.8259.0410.520.8118.610.86
+ +Similarly, for the second example of "screwing a hard-drive", the objects are not predicted by the pose only model. In contrast, our model can capture both pose and objects evolution over time. To quantitatively evaluate the layout generation step, we compare our method with HVP by computing the FID, I-DTW, and mAP metrics, as shown in Table 1. Our method outperforms HVP on all the three metrics that confirm that pose alone is not sufficient to generate high-quality videos. The proposed way of predicting the entire layout sequence is vital for generating high-quality videos. + +Importance of various loss functions. The success of our layout-to-frame generation step is due to the proposed discriminator losses such as Frame-GAN, Object-GAN, and Video-GAN. We evaluate each of these loss functions' usefulness and contribution in Table 2 by training the models in different configurations. First, we train the model without any discriminator losses (no GAN). For the next two models, we train one with Frame-GAN and the other with Frame and Object GANs. Finally, we train a model with all the loss functions. We observe from Table 2 that Frame GAN significantly improves the frames' visual quality, which helps synthesize better objects (we can see that mAP increases by $4\%$ with the introduction of frame GAN). Object and Video GANs have moderate contributions where Object GAN improves the mAP by $1.5\%$ , and video gan improves it by $0.4\%$ . + +Architecture ablation analysis. We evaluate the effectiveness of the proposed architecture by training models in different configurations such as without relational reasoning (Ab1), without prior layout for video generation (Ab2) and conditioning the layout generator on previous generated frame instead of the first frame (Ab3). We also compare these models with improved baselines where they are trained by augmenting the input with corresponding pose and object information in the channel dimension. The results of these experiments are shown in Table 3. We do not observe any significant improvements in the baselines and our proposed method still outperforms these. Our method shows improvements in FID and mAP without degradation in other metrics compared to not using prior layouts. + +# 4.3. Qualitative Analysis + +This section presents a detailed qualitative analysis of our model and its generalizations. + +We visualize the layout sequence and the corresponding video predicted by our model in Figure 4. Figure 4(a) shows a few examples of generated object sequences. Observe that our model learns to predict the sequences with a slight phase shift with respect to the ground truth. Therefore, our model is not merely trying to mimic the ground truths but is learning to generate new sequences. + +Figure 4(b) is an example of "cooking" that is performed by interacting with a bowl and a whisk. The first two rows correspond to the ground truth sequence, and the next two rows correspond to sequences predicted by our model. Observe that in the predicted layout sequence, as the bowl moves up (red box), the pose of the person changes such that the wrist gets very close to the bowl, and simultaneously in the pixel space, the bowl starts to move up. This shows that our model predicts the correct layout sequence, which is aligned temporally with the generated video. + +In this experiment, the performer's test set actions have no overlap with the same performer's training set actions. Therefore, in the testing phase, the performer's target action is a novel action for this performer as it was not part of the training set. Our qualitative results show that the model can successfully generate the video by learning to transfer the action to the test set performer. This validates that our model can generalize well to new performers. + +# 4.4. Visualization on UMD-HOI Dataset + +Figure 5, shows a few examples of the generated videos using the UMD-HoI dataset. Figure 5(a) is an example of a "speaking in a telephone action" performed by an out of sample performer. The model has never seen this performer during training. We observe that our model is able to generalize well to new people while faithfully generating the target video. Figure 5(b, c) shows examples of generated videos by changing an object's target action. In these ex + +![](images/4da2af54c2487a1079805fbec7c96a58d31bc53198f96d4ac3e638ec5e21e1c0.jpg) +Figure 4: Qualitative results on Bimanual dataset. + +![](images/9f50aa01663ef6ddbc1d1c182bf2cf7f0458fb566c0da87bfea7f8c0614374b0.jpg) +Figure 5: Qualitative results and generalization study on UMD-HOI dataset + +amples we ask the model to perform: 1) pouring from a cup and 2) speaking with a cup actions. We observe that the model is able to reasonably generate the videos of new target actions with the objects. + +# 5. Conclusion + +We presented a novel hierarchical video prediction model for human-object interactions by disentangling the video prediction into two stages. The first stage involves predicting a layout sequence, which is a combination of pose and object sequences. Since the spatio-temporal motion of poses and objects is highly correlated, a relational reasoning module is learned to model their interactions. Fi + +nally, in the second stage, a layout sequence to video mapping is learned to generate high-fidelity videos. We presented an extensive evaluation of our method to show that the model can learn novel interactions with objects. + +Acknowledgements. This work was supported by the DARPA SAIL-ON program via ARO contract no. W911NF2020009 and IARPA via contract no. D17PC00345. The views and conclusions are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation. + +# References + +[1] Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang. Flow-grounded spatial-temporal video prediction from still images. In Proceedings of the European Conference on Computer Vision (ECCV), pages 600-615, 2018. 1 +[2] Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 3560-3569. JMLR.org, 2017. 1, 2, 4, 6 +[3] Jacob Walker, Kenneth Marino, Abhinav Gupta, and Martial Hebert. The pose knows: Video forecasting by generating pose futures. In Proceedings of the IEEE international conference on computer vision, pages 3332-3341, 2017. 1, 2 +[4] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In International conference on machine learning, pages 843-852, 2015. 2 +[5] Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pages 2863–2871, 2015. +[6] Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv preprint arXiv:1511.05440, 2015. +[7] Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1771-1779. JMLR.org, 2017. +[8] T Xue, J Wu, K Bouman, and B Freeman. Probabilistic modeling of future frames from a single image. Advances in Neural Information Processing Systems (NIPS), 2, 2016. +[9] Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. arXiv preprint arXiv:1706.08033, 2017. +[10] Emily L Denton et al. Unsupervised learning of disentangled representations from video. In Advances in neural information processing systems, pages 4414-4423, 2017. +[11] Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, pages 64-72, 2016. 2 +[12] Nevan Wichers, Ruben Villegas, Dumitru Erhan, and Honglak Lee. Hierarchical long-term video prediction without supervision. arXiv preprint arXiv:1806.04768, 2018. 2 +[13] Long Zhao, Xi Peng, Yu Tian, Mubbasir Kapadia, and Dimitris Metaxas. Learning to forecast and refine residual motion for image-to-video generation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 387-403, 2018. +[14] Haoye Cai, Chunyan Bai, Yu-Wing Tai, and Chi-Keung Tang. Deep video generation, prediction and completion of human action sequences. In Proceedings of the European Conference on Computer Vision (ECCV), pages 366–382, 2018. +[15] Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li F Fei-Fei, + +and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In Advances in Neural Information Processing Systems, pages 517-526, 2018. +[16] Ceyuan Yang, Zhe Wang, Xinge Zhu, Chen Huang, Jianping Shi, and Dahua Lin. Pose guided human video generation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 201-216, 2018. 2 +[17] Bangpeng Yao, Xiaoye Jiang, Aditya Khosla, Andy Lai Lin, Leonidas Guibas, and Li Fei-Fei. Human action recognition by learning bases of action attributes and parts. In 2011 International Conference on Computer Vision, pages 1331–1338. IEEE, 2011. 2 +[18] Vincent Delaître, Josef Sivic, and Ivan Laptev. Learning person-object interactions for action recognition in still images. In Advances in neural information processing systems, pages 1503-1511, 2011. +[19] Abhinav Gupta and Larry S Davis. Objects in action: An approach for combining action understanding and object perception. In 2007 IEEE Conference on Computer Vision and Pattern Recognition, pages 1-8. IEEE, 2007. +[20] Abhinav Gupta, Aniruddha Kembhavi, and Larry S Davis. Observing human-object interactions: Using spatial and functional compatibility for recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(10):1775-1789, 2009. +[21] He Wang, Soren Pirk, Ersin Yumer, Vladimir G Kim, Ozan Sener, Srinath Sridhar, and Leonidas J Guibas. Learning a generative model for multi-step human-object interactions from videos. In Computer Graphics Forum, volume 38, pages 367-378. Wiley Online Library, 2019. +[22] Weidong Yin, Ziwei Liu, and Leonid Sigal. Person-in-context synthesis with compositional structural space. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2827-2836, 2021. 2 +[23] Megha Nawhal, Mengyao Zhai, Andreas Lehrmann, and Leonid Sigal. Zero-shot generation of human-object interaction videos. arXiv preprint arXiv:1912.02401, 2019. 2, 5 +[24] Fabien Baradel, Natalia Neverova, Christian Wolf, Julien Mille, and Greg Mori. Object level visual reasoning in videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 105-121, 2018. 2 +[25] 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, pages 3076-3086, 2017. 2 +[26] Chen Sun, Abhinav Shrivastava, Carl Vondrick, Kevin Murphy, Rahul Sukthankar, and Cordelia Schmid. Actor-centric relation network. In Proceedings of the European Conference on Computer Vision (ECCV), pages 318-334, 2018. 2 +[27] Chen Sun, Abhinav Shrivastava, Carl Vondrick, Rahul Sukthankar, Kevin Murphy, and Cordelia Schmid. Relational action forecasting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 273-283, 2019. 2 +[28] Yu-Wei Chao, Yunfan Liu, Xieyang Liu, Huayi Zeng, and Jia Deng. Learning to detect human-object interactions. In 2018 IEEE winter conference on applications of computer vision + +(wacy), pages 381-389. IEEE, 2018. 2 +[29] Georgia Gkioxari, Ross Girshick, Piotr Dólar, and Kaiming He. Detecting and recognizing human-object interactions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8359-8367, 2018. +[30] 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, pages 17-24. IEEE, 2010. 2 +[31] Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social lstm: Human trajectory prediction in crowded spaces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 961–971, 2016. 2 +[32] Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. arXiv preprint arXiv:1612.00341, 2016. 2 +[33] Sjoerd Van Steenkiste, Michael Chang, Klaus Greff, and Jürgen Schmidhuber. Relational neural expectation maximization: Unsupervised discovery of objects and their interactions. arXiv preprint arXiv:1802.10353, 2018. 2 +[34] Rasmus Palm, Ulrich Paquet, and Ole Winther. Recurrent relational networks. In Advances in Neural Information Processing Systems, pages 3368-3378, 2018. 5 +[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, 2018. 5 +[36] Abhinav Gupta, Aniruddha Kembhavi, and Larry S Davis. Observing human-object interactions: Using spatial and functional compatibility for recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(10):1775-1789, 2009. 5 +[37] Christian R. G. Dreher, Mirko Wächter, and Tamim As-four. Learning object-action relations from bimanual human demonstration using graph networks. IEEE Robotics and Automation Letters (RA-L), 5(1):187-194, 2020. 5 +[38] Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. Mocogan: Decomposing motion and content for video generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1526-1535, 2018. 5 +[39] 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. 5 +[40] 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. 5 +[41] 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. 6 + +[42] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in neural information processing systems, pages 2234-2242, 2016. 6 \ No newline at end of file diff --git a/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/images.zip b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0cb870bfcbc24286fa85684a26c94f9db914b10f --- /dev/null +++ b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cf59d167afd7bee73b99650a3fd6e616b4d9adb895de6190ae38d19b4a22dd8 +size 732537 diff --git a/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/layout.json b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8046c3dcc511ccc31e38dc683580073448c4e8fe --- /dev/null +++ b/hierarchicalvideopredictionusingrelationallayoutsforhumanobjectinteractions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c95f80262d0dc813d247c87296a6caf381f93102201fcb6e69fbe0f7b2634ad9 +size 386828 diff --git a/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_content_list.json b/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..57facbed2292e63b157af77e89abaf805a56423a --- /dev/null +++ b/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b6c28ffbfaf15bf3465ecd26300b07f76fe76c9f511376e3b8e98abac4cbcdc +size 76607 diff --git a/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_model.json b/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c6d0759459ccb3f408d8a10cd7db8d22b825cb0f --- /dev/null +++ b/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f297f3ae78a4686166236d920e3893a5cf51642cf27b8d93abefbeacdc799bd5 +size 94928 diff --git a/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_origin.pdf b/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7e23739d6eb0e671b10bd4ce0c0c215ea64c71b3 --- /dev/null +++ b/highfidelityandarbitraryfaceediting/1eea15cf-bedd-477b-8472-c80efe184577_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:541e1d799ee9c1f74856dda2694dc006556f5d8dddb3e2cc37fb29a01f538796 +size 6759326 diff --git a/highfidelityandarbitraryfaceediting/full.md b/highfidelityandarbitraryfaceediting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0494d7b3a3915a1b5c20a7f28ee539d633cf9f96 --- /dev/null +++ b/highfidelityandarbitraryfaceediting/full.md @@ -0,0 +1,331 @@ +# High-Fidelity and Arbitrary Face Editing + +Yue Gao $^{1}$ , Fangyun Wei $^{2}$ , Jianmin Bao $^{2}$ , Shuyang Gu $^{3}$ , Dong Chen $^{2}$ , Fang Wen $^{2}$ , Zhouhui Lian $^{1*}$ + +$^{1}$ Wangxuan Institute of Computer Technology, Peking University, China $^{2}$ Microsoft Research Asia + +3University of Science and Technology of China + +# Abstract + +Cycle consistency is widely used for face editing. However, we observe that the generator tends to find a tricky way to hide information from the original image to satisfy the constraint of cycle consistency, making it impossible to maintain the rich details (e.g., wrinkles and moles) of non-editing areas. In this work, we propose a simple yet effective method named HifaFace to address the above-mentioned problem from two perspectives. First, we relieve the pressure of the generator to synthesize rich details by directly feeding the high-frequency information of the input image into the end of the generator. Second, we adopt an additional discriminator to encourage the generator to synthesize rich details. Specifically, we apply wavelet transformation to transform the image into multi-frequency domains, among which the high-frequency parts can be used to recover the rich details. We also notice that a fine-grained and wider-range control for the attribute is of great importance for face editing. To achieve this goal, we propose a novel attribute regression loss. Powered by the proposed framework, we achieve high-fidelity and arbitrary face editing, outperforming other state-of-the-art approaches. + +# 1. Introduction + +Face editing is a process of editing the specific attributes or regions of an input facial image while keeping the non-editing attributes/areas unchanged. With the rapid development of Generative Adversarial Networks (GANs) [11], many recent works on face editing [19, 6, 15, 24, 33, 8] leverage the advanced conditional GANs and achieve remarkable progress. Due to the lack of paired images during training, they typically use cycle consistency to keep the non-editing attributes/areas unchanged. Namely, given an image $\mathbf{x}$ , it requires $\mathbf{x} = G(\mathbf{G}(\mathbf{x},\Delta), - \Delta)$ , where $G$ + +![](images/3c42f3ac3ff1817ee591955c7a961326f50540db2826d7ec6a4e121d5294804e.jpg) +(a) Input $\pmb{x}$ +Figure 1: The results of a representative face editing method StarGAN [6]: (a) the input image; (b) the output image synthesized by editing (a) with the attribute eyeglasses (EG); (c) the reconstructed image with (b) as input. We observe that the rich details are all missing in $\hat{\pmb{y}}$ , but are almost restored in $\hat{\pmb{x}}$ . (d) The high-fidelity face image synthesized by our HifaFace. + +![](images/64cef3cfa97de847ecc3c625394931326f9e511a3b7f952f63270fe53c54245f.jpg) +(b) $\hat{\pmb{y}} = \pmb{x} + \mathrm{EG}$ + +![](images/e80a40bcd91b092d19f49fb6adf8eb3e73deced93cfb37183825793551c01c3f.jpg) +(c) $\hat{\pmb{x}} = \hat{\pmb{y}}$ -EG + +![](images/776a09bece7fbcc58c7345176b940c4d67bfcf0befa4f59c286ac40125cd52d4.jpg) +(d) HifaFace + +represents the generator and $\Delta$ indicates the attribute that needs to be changed. However, we find that even if the cycle consistency is satisfied, images generated by $G$ may still be blurry and lose rich details from input images. + +To demonstrate the above-mentioned problem, we take StarGAN [6] as an example. As shown in Figure 1, we feed an input face image $\pmb{x}$ to StarGAN and expect it to add eyeglasses on the face. Although the output $\hat{\pmb{y}}$ does wear eyeglasses, the details (e.g., wrinkles and moles) are all missing. However, we observe an intriguing phenomenon as follows. When we feed $\hat{\pmb{y}}$ into the StarGAN model and expect removing eyeglasses on the face, the reconstruction result $\hat{\pmb{x}}$ surprisingly recovers almost all rich details, which satisfies the purpose of setting cycle consistency. This observation indicates that the generator encodes the rich details of the input image into the output image in the form of "hidden" signals, and then decodes the feature with these "hidden" signals to achieve reconstruction. The above-mentioned phenomenon is called steganography [7] and is undesirable for face editing [29]. + +To prevent the generator from taking this trick route to satisfy cycle consistency, we propose a simple yet effective face editing method called HifaFace. We tackle this problem from two perspectives. First, we directly feed the high-frequency information of the input image to the end of the + +generator to alleviate the generator's struggles for synthesizing rich details so that it gives up encoding the hidden signals. Second, we adopt an additional discriminator to constrain the generator to synthesize rich details, thus further preventing the generator from finding a trivial solution for cycle consistency. + +Specifically, we adopt wavelet transformation to transform an image into multiple frequency domains. We find that almost all rich details lie in the high-frequency domains. In order to feed the high-frequency information to the generator, we adopt an encoder-decoder-like structure and design a novel module named Wavelet-based Skip-Connection to replace the original Skip-Connection. + +To achieve the goal of providing a fine-grained and wider-range control for each facial attribute, we also propose a novel loss, called the attribute regression loss, which requires the generated image to explicitly describe the change on selected attributes and thus enables wider-range and controllable face editing. Furthermore, our method is able to effectively exploit large amounts of unlabeled face images for training, which can further improve the fidelity of synthesized faces in the wild. Powered by the proposed framework, we obtain high-fidelity and arbitrarily controllable face editing results. + +In summary, our major contributions are threefold: + +- We propose a novel wavelet-based face editing method, called HifaFace, for high-fidelity and arbitrary face editing. +- We revisit cycle consistency in face editing and observe that the generator learns to apply a tricky way to satisfy the constraint of cycle consistency by hiding signals in the output image. We thoroughly analyze this phenomenon and provide an effective solution to handle the problem. +- Both qualitative and quantitative results demonstrate the effectiveness of the proposed framework for improving the quality of edited face images. + +# 2. Related Work + +Generative Adversarial Networks. Generative Adversarial Networks (GANs) [11] have been widely used in the literature. A typical GAN-based model adopts a generator and a discriminator to implement adversarial training during the learning process. The capability of GANs enables a wide range of computer vision applications such as image generation [20, 21], font generation [9, 32], low-level vision [23, 34], complex distribution modeling [4, 26, 36], and so on. + +Cycle Consistency. Assessing the matches between two or more samples with cycle consistency is a commonly used technique in computer vision. It has been applied to + +many popular vision tasks such as image alignment [39, 40], depth estimation [37, 35], correspondence learning [38, 31] and etc. How to exploit the cyclic relation to learn the bidirectional transformation functions between different domains attracts intensive attention in recent years, since it can be used in domain adaption [17] and unpaired imaged-to-image translation [41, 6]. Also, some previous works [7, 27, 29] notice the problem of cycle consistency in CycleGANs [41] that the cycle consistency tends to do steganography [7] during the training process. In this paper, we concentrate on the process of steganography in the face editing framework and demonstrate its harmfulness for face editing results. Then, we propose a simple yet effective method to solve the problem of cycle consistency in the task of face editing. + +Face Generation and Editing. The face is of great interest in computer vision and computer graphics circles. Thanks to the recent development of GANs, a number of methods have reported achieving the high-quality generation of face images [3, 20, 21] and the flexible manipulation of facial attributes for a given face [6, 33, 24]. Generally speaking, these methods can be classified into two groups. The first group of methods [30, 1, 2] leverages pre-trained GANs to achieve the manipulation of faces. They first extract the latent code for a given face, then manipulate it to obtain the edited results. One major drawback of those methods is that they are not able to get the perfect latent code for a given image, resulting in the edited image that loses the rich details of the original face. The second group of methods [13, 6, 33, 24, 8] utilizes image-to-image translation techniques for face editing, where the original face image is also fed to the network. However, synthesis results of these methods are far from satisfactory and their qualities are lower compared to the first type of approaches. One possible reason is the existence of the above-mentioned problem of "cycle consistency". In this paper, we explicitly investigate the reasons why image-to-image translation methods cannot obtain satisfactory results for the face editing task and propose an effective framework to solve this problem. + +# 3. Method Description + +# 3.1. Revisiting Cycle Consistency in Face Editing + +Suppose $G$ is a face editing model (e.g., StarGAN [6] or RelGAN [33]), which typically requires two inputs: a source face image and the difference between target attributes and source attributes (StarGAN directly uses the target attributes). Given an image $\pmb{x}$ with the attributes $\pmb{a}_x$ , we aim to change its attributes to $\pmb{a}_y$ . Namely, the generator $G$ can take $\pmb{x}$ and $\pmb{\Delta} = \pmb{a}_y - \pmb{a}_x$ as input and generate the synthesis result $\hat{\pmb{y}} = G(\pmb{x}, \pmb{\Delta})$ . To guarantee that only the regions related to attribute changes in $\hat{\pmb{y}}$ are different against + +![](images/379290966e04b57f66b9d66bedcb4f3686e58deb832db3934dcc01490cafee70.jpg) + +![](images/0124d60069c03e2b359113eba2d71d051b87a5deba8b7ff35ad5d313b84b0398.jpg) +a) Input $\pmb{x}$ + +![](images/4852ff2eb1ca48f9805677ce06c462bd404a1bfb6f01da2bbfc151c57ec32e21.jpg) + +![](images/942b3a38b64184374ed4847239575280bf35cd9d0387519f6320790d9e691b4f.jpg) +b) $\hat{\pmb{y}} = G(\pmb {x},\pmb {\Delta})$ + +![](images/3cc627ce5b62185df2c5af348ee6c21d9e6ab8635358cb7a883517503603601a.jpg) + +![](images/52760ab581bf474e861fd56231e7d76f3b3ff475d9072b5a43b7e7fb1d3e7e5a.jpg) +c) $\pmb{y}^{\prime} = G(\hat{\pmb{y}},\Delta^{\prime})$ +Figure 2: Previous methods (e.g., StarGAN [6]) using cycle consistency tend to hide information in the output images. + +![](images/7e5c669a6c9b0de1cf9b2156876415bbc3a67ffc412ed84ae0922b739df8850c.jpg) + +![](images/faf3f4792c57e1abdd6ee89d9ab9c0c376a36fd6d759ea803d4b727a5c0daa20.jpg) +d) $\hat{\pmb{x}} = G(\hat{\pmb{y}}, - \pmb {\Delta})$ + +![](images/425f99cd84c607178ec5266e811f22a8f02125b4a46c966780be0ccfbfdc640e.jpg) + +![](images/1a79e439516e1b77a75c7ae0d61eb86f1d838a6c290c7e8f50fa384b853a7a73.jpg) +e) $\overline{y} = G(\pmb {x},\mathbf{0})$ + +![](images/b17a2e02d3b82949e98d32248fff1a247aa55863d4be8ecc305f8a74995232b8.jpg) + +![](images/9ec748f40b591b720bcd4d6fc73b0de229baade8e1d417efd7d5281bb97fe6c2.jpg) +f) $\overline{x} = G(\overline{y},\mathbf{0})$ + +![](images/1a26e017e329ab7ed917130cd1fe767d199d52927c32a38c53cdeb16214e5cb3.jpg) + +![](images/66d12a363964c585a57cf13b3cef59db277e70790ebead6bd566093fd7dc7acf.jpg) +g) $h = \overline{y} -\overline{x}$ + +$\pmb{x}$ , cycle consistency is usually applied between $G(\hat{\pmb{y}}, - \Delta)$ and $\pmb{x}$ . However, we observe an intriguing phenomenon, that is, if we further input $\hat{\pmb{y}}$ to the generator with any other attribute difference $\Delta^{\prime}(\Delta^{\prime}\neq -\Delta)$ to get $\pmb{y}^{\prime} = G(\hat{\pmb{y}},\Delta^{\prime})$ , the generated result $\pmb{y}^{\prime}$ will tend to be the same as input. This phenomenon is demonstrated in Figure 2(a,b,c), indicating that the generator learns to apply a tricky way to achieve the cycle consistency by "hiding" information in the output image. If we feed an image with hidden information to the generator, it tends to ignore the input attributes and only leverage the hidden information to reconstruct the original image. + +Thereby, it is crucial to figure out this hidden information. One possible way is to calculate the difference between the edited image and its ground truth [7]. But, unfortunately, it is usually impossible to obtain the ground truth. To address this problem, we let the target attributes be identical to the original attributes by feeding the input image and $\Delta = 0$ to the generator. Then we can get the synthesis result $\overline{y} = G(x,0)$ , whose corresponding ground truth is the original input image. We further feed $\overline{y}$ with $\Delta = 0$ back to the generator to get the result $\overline{x} = G(\overline{y},0)$ . Examples of $\overline{y}$ and its reconstructed image $\overline{x}$ are shown in Figure 2(e, f). We find that there exist significant differences between $\overline{y}$ and $x$ , especially the hair and wrinkles. However, the reconstructed image $\overline{x}$ is almost perfect, which verifies the existence of hidden information in $\overline{y}$ . In this manner, we can get the hidden information $h = \overline{y} - \overline{x}$ (see Figure 2(g)). + +Motivated by the analysis mentioned above, we can prevent the generator from hiding information by simply restricting the hidden information $\pmb{h}$ to be $\mathbf{0}$ , which is equivalent to restrict $G(\pmb{x},\mathbf{0})$ to be equal to $\pmb{x}$ . We notice that the above strategy has been adopted by several existing methods [24, 8]. But this restriction is harmful to the face editing model and makes the edited results remain unchanged during the editing process. Another possible way to prevent the generator from hiding information is to corrupt the hidden information during training. We have tried to add image transformations such as Gaussian blur, flip and rotation on + +the synthesis results to encourage the generator to give up hiding information. However, we find that the generator still struggles to synthesize rich details and learns to satisfy cycle consistency via a trivial solution. + +This paper proposes addressing this problem with a novel framework. The key idea is to prevent the generator from encoding hidden information and encourage it to synthesize perceptible information. By inspecting the hidden information, we find that it is highly related to the high-frequency signals of the input image. Therefore, we choose to utilize the widely used wavelet transformation to decompose the image into domains with different frequencies and take the high-frequency parts to represent rich details. + +More specifically, we propose solving the problem of cycle consistency from two perspectives. On the one hand, we directly feed the high-frequency signals to the end of the generator to mitigate the generator's struggles for synthesizing rich details so that it gives up to encode the hidden signals. On the other hand, we also employ an additional discriminator to encourage the generator to generate rich details, thus further preventing the generator from finding a trivial solution for cycle consistency. + +# 3.2. Wavelet Transformation + +Wavelet transformation has achieved remarkable success in applications that require decomposing images into domains with different frequencies. Following this idea, we adopt a classic wavelet transformation method, the Haar wavelet, which consists of two operations: wavelet pooling and unpooling. Wavelet pooling contains four kernels, $\{LL^{\top}, LH^{\top}, HL^{\top}, HH^{\top}\}$ , where the low (L) and high (H) pass filters are $L^{\top} = \frac{1}{\sqrt{2}} [1, 1]$ and $H^{\top} = \frac{1}{\sqrt{2}} [-1, 1]$ , respectively. The low-pass filter concentrates on the smooth surface which is mostly related to low-frequency signals while the high-pass filter captures most high-frequency signals like vertical, horizontal and diagonal edges. Figure 4 shows the information of four frequency domains (i.e., LL, LH, HL and HH) decomposed from two images by implementing the Haar wavelet transformation. LL mainly con + +![](images/c9b6ea1b1d04e5749d04e04f14b525440a38f3652444ee311549aa0e508b165c.jpg) +(a) Wavelet-Based Generator $G$ + +![](images/e83660e227610bbd966bd4de04c6556f841513664b1f03a15d4d187b05ca1194.jpg) +(b) High-Frequency Discriminator $D_H$ + +![](images/2ebba65195d8ab7a7e9f7336aa17440d20b6482f9c02ae439e714ef6add99bd2.jpg) +(c) Image-Level Discriminator $D_{I}$ + +![](images/f9bb5d99fa0981006725df364df7843d79b17bbe6323c1083e2f79ba1e8f600d.jpg) +(d) Attribute Classifier $C$ + +sists of information in the low-frequency domain, depicting the overall appearance of an image, while LH, HL and HH contain information representing rich details. We find that the combination of LH, HL and HH can be considered a good approximation of the hidden information $h$ (see Figure 2(g)). Besides, wavelet unpooling is employed to exactly reconstruct the original image from the signal components decomposed via wavelet pooling as follows. We first apply a component-wise transposed-convolution on the signal of each component and then sum all resulted features up to precisely reconstruct the image. + +Wavelet transformation is usually applied at the image level, but here we implement it at the feature level. Specifically, we first adopt the above-mentioned wavelet pooling to extract features in the domains of different frequencies from different layers of the encoder (see Figure 3). Then we ignore the information of LL, and apply wavelet un-pooling to LH, HL and HH to reconstruct the information for high-frequency components of the original feature. + +# 3.3. HifaFace + +In this section, we introduce our proposed method called HifaFace. It requires two inputs: the input image $\mathbf{x}$ and the difference of attributes $\Delta$ , and outputs the result $\hat{\mathbf{y}}$ with the target attributes. Figure 3 gives an overview of our method which mainly contains the following four parts: 1) the Wavelet-based Generator, 2) the High-frequency Discriminator, 3) the Image-level Discriminator and 4) an attribute Classifier. + +Wavelet-Based Generator. Our generator $G$ mainly follows the "encoder-decoder" structure, which contains the encoding part, bottleneck part and decoding part. The input image $x$ is directly fed to the front of the network. We adopt the widely used AdaIN [18] module in the bottleneck + +![](images/45293fbbbd2e544a6091b65eb3b24a6eb42d850e7550bcdffef52760cedbe6bc.jpg) +Figure 3: An overview of our proposed method, which contains four parts: a) the Wavelet-Based Generator $G$ ; b) the High-Frequency Discriminator $D_H$ ; c) the Image-Level Discriminator $D_I$ and; d) the Attribute Classifier $C$ . $\bigoplus$ denotes element-wise plus and $\otimes$ denotes channel-wise concatenation. +Figure 4: An illustration of wavelet transformation. + +part to input the vector of condition attributes $\pmb{\Delta}$ . To alleviate the generator's pressure of synthesizing rich details, we propose to use a wavelet-based skip-connection to feed the high-frequency information directly to the decoding part of the generator. Specifically, for the $i$ -th layer in the encoding part, we adopt wavelet pooling to extract frequency features $E_{LL}^{i}, E_{LH}^{i}, E_{HL}^{i}$ and $E_{HH}^{i}$ . Then we ignore the low-frequency feature $E_{LL}^{i}$ , and feed the remaining three high-frequency feature maps to the wavelet unpooling module which transforms them to the different frequency domains of the original feature. Finally, we use a skip-connection to feed them to the $(n - i)$ -th layer in the decoding part, where $n$ is the number of all layers. This branch aims to maintain the high-frequency details of the input image. + +High-Frequency Discriminator. To ensure that synthesis results with rich details can be obtained by the generator, we also adopt a high-frequency discriminator $D_H$ . For both real images and generated images, we first use wavelet pooling to extract their high-frequency features $\pmb{E_{LH}}$ , $\pmb{E_{HL}}$ and $\pmb{E_{HH}}$ . Then we feed them into the high-frequency discriminator, thus encouraging the generator to synthesize images with high-frequency information. + +Image-Level Discriminator. To encourage the generated image to be realistic, we adopt an image-level discriminator $D_{I}$ to distinguish between real images and generated images. + +Attribute Classifier. To guarantee the consistency between synthesis results and their corresponding target attributes, we design an auxiliary attribute classifier $C$ . Specifically, it consists of $K$ binary classifiers on top of the feature extractor, where $K$ denotes the number of attributes. To achieve a faster training procedure, we first train the classifier only on the labeled dataset. Then when training the whole HifafaFace model, we apply the learned classifier to ensure that the generated image possesses the target attributes. + +# 3.4. Objective Function + +We train our model using the following losses. + +Image-Level Adversarial Loss. We adopt the adversarial loss to encourage the generated image to be realistic. Let $\mathbf{y}$ denote the sampled real images, the image-level adversarial loss is defined as: + +$$ +\mathcal {L} _ {G A N} ^ {I} = \mathbb {E} \left[ \log D _ {I} (\boldsymbol {y}) + \log \left(1 - D _ {I} \left(G (\boldsymbol {x}, \boldsymbol {\Delta})\right)\right) \right]. \tag {1} +$$ + +High-Frequency Domain Adversarial Loss. To encourage the generator to maintain rich details, we apply the adversarial loss in the high-frequency domain. Here, we choose the combination of three domains (i.e., LH, HL and HH) as the high-frequency domain, and define the high-frequency domain adversarial loss as: + +$$ +\mathcal {L} _ {G A N} ^ {H} = \mathbb {E} \left[ \log D _ {H} (\boldsymbol {x}) + \log \left(1 - D _ {H} \left(G (\boldsymbol {x}, \boldsymbol {\Delta})\right)\right) \right]. \tag {2} +$$ + +Cycle Reconstruction Loss. In order to guarantee the generated image properly preserving the characteristics of the input image $\pmb{x}$ that are invariant to the target attributes, we employ the cycle reconstruction loss which is defined as: + +$$ +\mathcal {L} _ {c y c} = \mathbb {E} [ \| \boldsymbol {x} - G (G (\boldsymbol {x}, \boldsymbol {\Delta}), - \boldsymbol {\Delta}) \| _ {1} ]. \tag {3} +$$ + +Attribute Classification Loss. To ensure that the synthesis result $\hat{y}$ possesses the desired attributes $a_{y}$ , where $a_{y}^{k}$ is the $k$ -th element of $a_{y}$ , we introduce the attribute classification loss to constrain the generator $G$ . The attribute classification loss is only applied on the attributes that are changed. Specifically, we use $\Delta^k$ to determine whether the $k$ -th attribute has been changed (i.e., $|\Delta^k| = 1$ ). Suppose $p^k$ is the probability value of the $k$ -th attribute estimated by the classifier $C$ , we have the attribute classification loss as: + +$$ +\mathcal {L} _ {a c} = - \mathbb {E} [ \sum_ {k = 1} ^ {K} \mathbb {1} _ {\left\{\left| \Delta^ {k} \right| = 1 \right\}} \left(a _ {y} ^ {k} \log p ^ {k} + \left(1 - a _ {y} ^ {k}\right) \log \left(1 - p ^ {k}\right)\right) ], \tag {4} +$$ + +where $\mathbb{1}$ denotes the indicator function, which is equal to 1 when the condition is satisfied. The attribute classification loss restricts the generator to synthesize high-quality images with the corresponding target attributes. + +Attribute Regression Loss. Most existing works only consider discrete editing operations [6, 24, 8] or support a limited range of continuous editing [33], making them less + +practical in real-world scenarios. We expect to precisely control the attributes with a scale factor $\alpha$ , requiring that the generator is capable of synthesizing face images with different levels of attribute editing. Thus the output image can be denoted as $\pmb{y}_{\alpha} = G(\pmb{x}, \alpha \cdot \pmb{\Delta})$ , in which $\alpha \in [0,2]$ . For example, we may want the people in an image to smile. If $\alpha = 0.5$ , we expect a smile, if $\alpha = 2$ , what we expect is laughing. We calculate the attribute regression loss by: + +$$ +\mathcal {L} _ {a r} = \mathbb {E} \left[ \left(d \left(\boldsymbol {f} _ {0}, \boldsymbol {f} _ {\alpha}\right) - d \left(\boldsymbol {f} _ {1}, \boldsymbol {f} _ {0}\right)\right) - (\alpha - 1) \right], \tag {5} +$$ + +where $\pmb{f}_{\alpha}$ means the $\ell_2$ normalized feature vector extracted by the attribute classifier $C$ : $\pmb{f}_{\alpha} = C(G(\pmb{x}, \alpha \cdot \pmb{\Delta}))$ , in which $d(.,.)$ denotes the $\ell_2$ distance of two feature vectors. + +Objective Function. The overall loss function of our model is: + +$$ +\mathcal {L} = \lambda_ {a r} \mathcal {L} _ {a r} + \lambda_ {a c} \mathcal {L} _ {a c} + \lambda_ {G A N} ^ {I} \mathcal {L} _ {G A N} ^ {I} + \lambda_ {G A N} ^ {H} \mathcal {L} _ {G A N} ^ {H} + \lambda_ {c y c} \mathcal {L} _ {c y c}, \tag {6} +$$ + +where $\lambda_{ar},\lambda_{ac},\lambda_{GAN}^{I},\lambda_{GAN}^{H}$ and $\lambda_{cyc}$ denote the weights of corresponding loss terms, respectively. + +# 3.5. Semi-Supervised Learning + +Another important challenge for attribute editing is the limited size of the training dataset. Existing supervised learning based models [6, 24, 33, 8] are typically incapable of handling faces in the wild, especially for those with rich details, pose variance or complex background. However, manually annotating the attributes for a large number of face images is time-consuming, so we adopt a semi-supervised learning strategy to exploit large amounts of unlabeled data. We use our attribute classifier $C$ to predict attributes for all images in the unlabeled dataset $\mathcal{D}_u$ , and assign each image with the corresponding prediction result as the pseudo label. Then, both the labeled dataset $\mathcal{D}_l$ and the pseudo-labeled dataset $\mathcal{D}_u$ are employed for training. + +# 4. Experiments + +Datasets. We evaluate our model on the CelebA-HQ [20] and FFHQ [21] datasets. The classification model trained on CelebA-HQ is applied to get the pseudo labels for all images in FFHQ. The image resolution is chosen as $256 \times 256$ in our experiments. + +Implementation Details. In the generator $G$ , the wavelet-based skip-connection is employed between all the three encoding and decoding blocks. We apply the Spectral Normalization (SN) [25] for both $D_H$ and $D_I$ . For the attribute classifier $C$ , we use the pre-trained ResNet-18 [14] as the feature extractor, and two non-linear classification layers are followed for each attribute. The classifier is fine-tuned on CelebA-HQ [20] with $92.8\%$ accuracy on the test set. We use the Adam optimizer [22] with TTUR [16] for training. + +Baselines. We compare our approach with two typical types of face editing models: 1) Latent space manipulation + +![](images/ebf6bfde4f243414fb9749b5e657e2c03283786915c8c3e9b9cb316df090c52b.jpg) +Figure 5: Comparison of attribute-based face editing results obtained by the proposed method and other state-of-the-art approaches. All test images are wild images used in [2]. + +based models with pre-trained GANs: InterFaceGAN [30] and StyleFlow [2]; 2) Image-to-image translation-based methods: GANimation [28], STGAN [24], RelGAN [33], CAFE-GAN [10], CooGAN [5] and SSCGAN [8]. + +Evaluation Metrics. We apply several quantitative metrics to evaluate the performance of different face editing methods: 1) Frechet inception distance (FID) [16]; 2) Quality Score (QS) [12], which evaluates the quality of each sample; 3) Acc., which measures the classification accuracy of attributes for synthesized face images; 4) In addition to these commonly used metrics, we utilize the Self-Reconstruction Error (SRE) to quantify the models' capability of synthesizing rich details. Specifically, we compute the $\ell_1$ distance between the original image and its projection for the latent space based methods. For the image-to-image translation-based methods, we calculate the $\ell_1$ distance between the input image's self-reconstruction image $\overline{\mathbf{y}}$ and the reconstructed image $\overline{\mathbf{x}}$ of the self-reconstruction result. + +# 4.1. Comparison with State of the Art Methods + +In this section, we compare our face editing method with other existing approaches from two perspectives: attribute- + +
MethodsFID ↓Acc. ↑QS ↑SRE ↓
GANimation15.7264.70.7100.145
STGAN14.7883.20.5430.041
RelGAN10.1383.60.7290.024
CAFE-GAN-81.9--
CooGAN-83.8--
SSCGAN4.6994.2--
InterFaceGAN---0.163
HifaFace4.0497.50.8030.021
+ +Table 1: Quantitative results of different methods. + +based face editing and arbitrary face editing. + +Attribute-Based Face Editing We compare our method with some recent works: GANimation [28] STGAN [24], RelGAN [33], InterFaceGAN [30] and StyleFlow [2], and show the qualitative results in Figure 5. GANimation utilizes a masking mechanism to force the generator to edit the regions that need to be edited. Unsatisfactory results indicate that the attention mask mechanism does not work well for the face editing task. STGAN is a typical method that adopts the reconstruction loss between the input image and its self-reconstruction instead of cycle consistency. + +![](images/5d99d661f4fdf88e747a9fd963ab68bd7c5362f7b6d7d0eb2ab32a4db86f3b60.jpg) +(a) Input (b) Interpolation of the "eyeglasses" attribute, in range of [0.4, 2.0] with an interval of 0.2. +Figure 6: Interpolation results obtained by RelGAN [33], InterFaceGAN (IFGAN) [30] and our HifaFace. + +
MethodsArched EyebrowsBlack HairBlond HairBrown HairEye-glassesGray HairHeavy MakeupMaleMouth OpenMustacheNo BeardSmilingYoungAverage
GANimation69.274.052.854.187.277.175.965.957.254.844.667.757.564.7
STGAN80.276.378.982.986.184.387.386.588.475.790.384.680.383.2
RelGAN85.474.884.791.493.991.479.573.791.680.591.669.978.383.6
CAFE-GAN--88.1----95.297.240.1--88.681.9
CooGAN89.180.184.264.199.8--85.094.959.496.3-85.283.8
SSCGAN96.599.3--99.9--99.199.965.7--99.094.2
HifaFace98.494.998.492.798.998.396.098.999.098.297.798.397.597.5
+ +Table 2: The attribute editing accuracy of our method and other image-to-image translation-based face editing approaches. + +
MethodsFID ↓Acc. ↑QS ↑SRE ↓
w/ VS in G5.5094.80.7690.068
w/o WS in G5.2296.20.7900.049
w/o DH5.3496.40.7620.057
HifaFace4.0497.50.8030.021
+ +Table 3: Quantitative results for ablation studies. + +We observe that their results keep the rich details but don't have the desired attributes. On the contrary, RelGAN is designed based on cycle consistency. We observe that their results lose rich details and have a lot of artifacts. Meanwhile, for the latent space based methods InterFaceGAN [30] and StyleFlow [2], they lose too many details of the original input image. Compared to those existing approaches, our method obtains impressive results with higher quality, which not only preserve the rich details of the input face but also perfectly satisfy the desired attributes. Table 1 compares the quantitative results of different methods, from which we can see that our method clearly outperforms others considering the values of FID and QS, and generates face images containing more rich details as well as low self-reconstruction errors. Furthermore, the high Acc. value indicates that our method has better capability of editing facial attributes. In Table 2, we evaluate the attribute editing accuracy for each attribute. We can see that our method obtains the best results for most attributes. + +Arbitrary Face Editing. In real-world scenarios, a fine-grained and wider-range control for each attribute is very useful. Previous works such as RelGAN [33] and InterFaceGAN [30] also provide continuous control for facial + +attribute editing. We perform attribute interpolation in the range of $\lambda \in [0.4, 2.0]$ with an interval of 0.2, where $\lambda = 0$ and $\lambda = 1$ denote that the desired attributes are equal to the source and target attributes, respectively. We show the visualization results in Figure 6, which shows that our model generates smoother and higher-quality interpolation results compared to InterFaceGAN [30]. When $\lambda$ is larger than 1, interpolation results of RelGAN remain almost unchanged, while our method tends to strengthen the attribute of wearing eyeglasses. When $\lambda$ is set to 2, the eyeglasses in the outputted face image of our method will be replaced by a pair of sunglasses. Both qualitative and quantitative results demonstrate that our method has a significantly stronger capability of implementing arbitrary face editing. + +# 4.2. Ablation Studies + +In this section, we conduct experiments to validate the effectiveness of each component of the proposed HifaFace. We mainly study the following three important issues: 1) the wavelet generator and discriminator; 2) the attribute regression loss; 3) the semi-supervised learning strategy. + +Wavelet-Based Generator and Discriminator To verify the effectiveness of our proposed wavelet-based generator and discriminator, we evaluate the performance of several variants of our method. Specifically, we consider the following four variants: 1) our full model; 2) the proposed model without the wavelet-based skip-connection in the Generator (w/o WS in $G$ ); 3) the proposed model without the high-frequency Discriminator (w/o $D_H$ ); 4) the proposed model with the vanilla skip-connection (w/ VS in + +![](images/2e7b13b4aa21cbe77444254c43cbfe90e15ca56043742570a8dc5bd2e8a42efa.jpg) +(a) Input + +![](images/a70a2a16aad7968c647385edae6400d3a390252645644b6655ff195df9a5b30f.jpg) +(b) Interpolation of the "old" attribute, in range of [0.4, 2.0] with an interval of 0.2. + +![](images/d4d1de328fe2562b25a9c32fa7282274353a5ec8a42bd5040b4031d3c036df51.jpg) +Figure 7: Comparison of interpolation results obtained using our models without and with the attribute regression loss. +Input Eyeglasses Gray hair Smile +Eyeglasses Hidden + +![](images/10f4a1786e5ba313e00af66a0a7fc9843af1159c4e127f48747f3915ee558b01.jpg) +Figure 8: Ablation studies of our proposed model. +Figure 9: Comparison of synthesis results obtained by our models without and with semi-supervised learning. + +G). Qualitative and quantitative results of these methods are shown in Figure 8 and Table 3, respectively, from which we can draw two conclusions as follows. 1) The wavelet-based generator and discriminator are extremely important for the overall framework, since it is impossible to obtain satisfactory face editing results without them. 2) Our generator does not encode hidden information in its output image. This is intuitively demonstrated in Figure 8, where we expect to add eyeglasses on the synthesized smile face images (the fifth column). We can see that only our full model is able to satisfactorily achieve this goal. The hidden information of each model is shown in the rightmost column of Figure 8. + +Attribute Regression Loss. The attribute regression loss is introduced to achieve arbitrary face editing, which aims to obtain both high-quality interpolated results and extrapolated results, as shown in Figure 7. With our proposed at- + +![](images/43c98908dc7f30e547475fab0b82b63514cb516c952b7b4f9690a7579d1eb3bc.jpg) +Figure 10: Examples of face editing results for wild images obtained by our HifaFace. + +tribute regression loss, we can get a smooth and wider-range control for each attribute. + +Semi-Supervised Learning. To validate the effectiveness of our semi-supervised learning strategy, we conduct an ablation study and show the results in Figure 9. It can be observed that benefiting from the utilization of large amounts of data, the quality of synthesis results obtained by the method with semi-supervised learning is significantly better, especially for some attributes such as "eyeglasses" and "old", where very few labeled data are available. + +# 4.3. Editing Wild Faces + +Finally, we demonstrate the strong capability of HifaFace by editing wild face images downloaded from the Internet. As shown in Figure 10, our method works well for face images under various poses and expressions. + +# 5. Conclusion + +In this paper, we first revisit cycle consistency in current face editing frameworks and observed an interesting phenomenon called steganography. We then propose a novel model named HifaFace to address this problem. The key idea of our method is to adopt a wavelet-based generator and a high-frequency discriminator. Moreover, we also designed a novel attribute regression loss to achieve arbitrary face editing on a single attribute. Extensive experiments demonstrate the superiority of our framework for high-fidelity and arbitrary face editing. Hopefully, this paper will be able to inspire researchers for solving the similar problems of cycle consistency in many other tasks. + +# References + +[1] Rameen Abdul, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? In Proceedings of the IEEE international conference on computer vision, pages 4432-4441, 2019. 2 +[2] Rameen Abdal, Peihao Zhu, Niloy Mitra, and Peter Wonka. Styleflow: Attribute-conditioned exploration of stylegan-generated images using conditional continuous normalizing flows. ArXiv, abs/2008.02401, 2020. 2, 6, 7 +[3] Jianmin Bao, Dong Chen, Fang Wen, Houqiang Li, and Gang Hua. Towards open-set identity preserving face synthesis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6713-6722, 2018. 2 +[4] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018. 2 +[5] Xuanhong Chen, B. Ni, Naiyuan Liu, Ziang Liu, Yiliu Jiang, Loc Truong, and Q. Tian. Coogan: A memory-efficient framework for high-resolution facial attribute editing. ArXiv, abs/2011.01563, 2020. 6 +[6] Yunjey Choi, Min-Je Choi, Munyoung Kim, Jung-Woo Ha, S. Kim, and J. Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8789-8797, 2018. 1, 2, 3, 5 +[7] Casey Chu, A. Zhmoginov, and Mark Sandler. Cyclegan, a master of steganography. ArXiv, abs/1712.02950, 2017. 1, 2, 3 +[8] Wenqing Chu, Ying Tai, Chengjie Wang, Jilin Li, Feiyue Huang, and Rongrong Ji. Sscgan: Facial attribute editing via style skip connections. ECCV, 2020. 1, 2, 3, 5, 6 +[9] Yue Gao, Yuan Guo, Zhouhui Lian, Yingmin Tang, and Jianguo Xiao. Artistic glyph image synthesis via one-stage few-shot learning. ACM Transactions on Graphics (TOG), 38(6):1-12, 2019. 2 +[10] Jeong gi Kwak, David K Han, and Hanseok Ko. Cafe-gan: Arbitrary face attribute editing with complementary attention feature. ECCV, 2020. 6 +[11] Ian J. Goodfellow, Jean Pouget-Abadie, M. Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. 1, 2 +[12] Shuyang Gu, Jianmin Bao, D. Chen, and Fang Wen. Giqa: Generated image quality assessment. ArXiv, abs/2003.08932, 2020. 6 +[13] Shuyang Gu, Jianmin Bao, Hao Yang, D. Chen, Fang Wen, and L. Yuan. Mask-guided portrait editing with conditional gans. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3431-3440, 2019. 2 +[14] Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. 5 +[15] Zhenliang He, W. Zuo, M. Kan, S. Shan, and X. Chen. Attgan: Facial attribute editing by only changing what you want. IEEE Transactions on Image Processing, 28:5464-5478, 2019. 1 + +[16] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and S. Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In NIPS, 2017. 5, 6 +[17] 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 International conference on machine learning, pages 1989-1998. PMLR, 2018. 2 +[18] X. Huang and Serge J. Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. 2017 IEEE International Conference on Computer Vision (ICCV), pages 1510-1519, 2017. 4 +[19] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-image translation with conditional adversarial networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5967-5976, 2017. 1 +[20] Tero Karras, Timo Aila, S. Laine, and J. Lehtinen. Progressive growing of gans for improved quality, stability, and variation. ArXiv, abs/1710.10196, 2018. 2, 5 +[21] Tero Karras, S. Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4396-4405, 2019. 2, 5 +[22] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015. 5 +[23] 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 Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4681-4690, 2017. 2 +[24] Ming Liu, Yukang Ding, Min Xia, Xiao Liu, E. Ding, W. Zuo, and Shilei Wen. Stgan: A unified selective transfer network for arbitrary image attribute editing. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3668-3677, 2019. 1, 2, 3, 5, 6 +[25] Takeru Miyato, T. Kataoka, Masanori Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. ArXiv, abs/1802.05957, 2018. 5 +[26] Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. fgan: Training generative neural samplers using variational divergence minimization. In Advances in neural information processing systems, pages 271-279, 2016. 2 +[27] Horia Porav, Valentina Musat, and Paul Newman. Reducing steganography in cycle-consistency gans. In CVPR Workshops, pages 78-82, 2019. 2 +[28] Albert Pumarola, Antonio Agudo, Aleix M Martinez, Alberto Sanfeliu, and Francesc Moreno-Noguer. Ganimation: Anatomically-aware facial animation from a single image. In Proceedings of the ECCV, 2018. 6 +[29] E. Sánchez and M. Valstar. A recurrent cycle consistency loss for progressive face-to-face synthesis. 2020 15th IEEE International Conference on Automatic Face and Gesture Recognition (FG 2020), pages 53-60, 2020. 1, 2 +[30] Yujun Shen, Ceyuan Yang, X. Tang, and B. Zhou. Interfacegan: Interpreting the disentangled face representation + +learned by gans. IEEE transactions on pattern analysis and machine intelligence, PP, 2020. 2, 6, 7 +[31] Xiaolong Wang, Allan Jabri, and Alexei A Efros. Learning correspondence from the cycle-consistency of time. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2566-2576, 2019. 2 +[32] Yizhi Wang, Yue Gao, and Zhouhui Lian. Attribute2font: creating fonts you want from attributes. ACM Transactions on Graphics (TOG), 39(4):69-1, 2020. 2 +[33] P. Wu, Yu-Jing Lin, Che-Han Chang, E. Chang, and S. Liao. Relgan: Multi-domain image-to-image translation via relative attributes. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 5913-5921, 2019. 1, 2, 5, 6, 7 +[34] 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. 2 +[35] Zhichao Yin and Jianping Shi. Geonet: Unsupervised learning of dense depth, optical flow and camera pose. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1983-1992, 2018. 2 +[36] 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. 2 +[37] Tinghui Zhou, Matthew Brown, Noah Snavely, and David G Lowe. Unsupervised learning of depth and ego-motion from video. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1851-1858, 2017. 2 +[38] Tinghui Zhou, Yong Jae Lee, Stella X Yu, and Alyosha A Efros. Flowweb: Joint image set alignment by weaving consistent, pixel-wise correspondences. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1191-1200, 2015. 2 +[39] Tinghui Zhou, Philipp Krahenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A Efros. Learning dense correspondence via 3d-guided cycle consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 117-126, 2016. 2 +[40] Xiaowei Zhou, Menglong Zhu, and Kostas Daniilidis. Multi-image matching via fast alternating minimization. In Proceedings of the IEEE International Conference on Computer Vision, pages 4032-4040, 2015. 2 +[41] Jun-Yan Zhu, T. Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. 2017 IEEE International Conference on Computer Vision (ICCV), pages 2242-2251, 2017. 2 \ No newline at end of file diff --git a/highfidelityandarbitraryfaceediting/images.zip b/highfidelityandarbitraryfaceediting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ba80c6131a37288b735bea28844d3fad2db0faa3 --- /dev/null +++ b/highfidelityandarbitraryfaceediting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02d32f3ae449c71baa834ad7665bb6f22e1850a229a170d52e50e7095cbc96dc +size 897568 diff --git a/highfidelityandarbitraryfaceediting/layout.json b/highfidelityandarbitraryfaceediting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..07d496b0e5c83c92c24a514aa3dc3835259ff17a --- /dev/null +++ b/highfidelityandarbitraryfaceediting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c4251caf4b981bfcb11b3d0bd996d28d02da924cef32f0cde79eadb82dd3ee4 +size 449737 diff --git a/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_content_list.json b/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f4558406df002cbeea0e6e75011f179478a1d97c --- /dev/null +++ b/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8897b4d93f7b252b88739cad984f498236a3f3194f6b004084afe8267eddc203 +size 73861 diff --git a/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_model.json b/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b75e3b74b0f85fe5b86b72b3d0f966cd2c92c39f --- /dev/null +++ b/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0adb5a7a897bc875af94da00cc77ecd1bb0da0ca1abe414b2b285b28da100e8 +size 95740 diff --git a/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_origin.pdf b/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fc4cf2070069e3f508a6ad774a6650f3f91b80b3 --- /dev/null +++ b/highfidelityfacetrackingforarvrviadeeplightingadaptation/0b4e94e5-5ea3-46ee-a8a2-65dcda0eecf8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:214d9e833f2626490ea968aa6db1a042075c21064a29a3717985194c79f15914 +size 9932844 diff --git a/highfidelityfacetrackingforarvrviadeeplightingadaptation/full.md b/highfidelityfacetrackingforarvrviadeeplightingadaptation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c3145907ac5a406ff7d36b127d56629bc848a235 --- /dev/null +++ b/highfidelityfacetrackingforarvrviadeeplightingadaptation/full.md @@ -0,0 +1,318 @@ +# High-fidelity Face Tracking for AR/VR via Deep Lighting Adaptation + +Lele Chen $^{1,2}$ + +Chen Cao + +Fernando De la Torre1 + +Jason Saragih1 + +Chenliang $\mathbf{X}\mathbf{u}^2$ + +Yaser Sheikh + +$^{1}$ Facebook Reality Labs + +2 University of Rochester + +![](images/32e0903eb2cda81f6741292753575623e6e1b269e426910a512bf0a2d1b43d16.jpg) +Captured image + +![](images/a90ef03a7a7ced1a27282eee1721ee6536f56e37f1ac91f37519a10d3e9cf998.jpg) +Normal map + +![](images/a7a0b6cdce8ba7b4dbc44a8a5a2ef221afac4e8ae1d05d0ac27a733bb6ebe239.jpg) +Fully-lit avatar + +![](images/59163dc08cf8117617b44cc27fb7d315425f82772d4a40672767db12309bddaf.jpg) +Relit avatar +Figure 1. High-fidelity face tracking results using our method. From left to right: Input image captured by an iPhone, normal map, fully-lit avatar (avatar before relighting), relit avatar (avatar after relighting), and relit avatar under different viewpoints. Please notice the specular highlight changes on the avatars under different viewpoints. + +![](images/77aaff6d8c31382b21d8d77825b2614cceb215d6daf5ff47895da86a0292de96.jpg) +Relit avatar under different viewpoints + +# Abstract + +3D video avatars can empower virtual communications by providing compression, privacy, entertainment, and a sense of presence in AR/VR. Best 3D photo-realistic AR/VR avatars driven by video, that can minimize uncanny effects, rely on person-specific models. However, existing person-specific photo-realistic 3D models are not robust to lighting, hence their results typically miss subtle facial behaviors and cause artifacts in the avatar. This is a major drawback for the scalability of these models in communication systems (e.g., Messenger, Skype, FaceTime) and AR/VR. This paper addresses previous limitations by learning a deep learning lighting model, that in combination with a high-quality 3D face tracking algorithm, provides a method for subtle and robust facial motion transfer from a regular video to a 3D photo-realistic avatar. Extensive experimental validation and comparisons to other state-of-the-art methods demonstrate the effectiveness of the proposed framework in real-world scenarios with variability in pose, expression, and illumination. Our project page can be found at this website. + +# 1. Introduction + +Currently, video conferencing (e.g., Zoom, Skype, Messenger) is the best 2D available technology for internet communication. To allow for more advance levels of communication and sense of presence, Augmented Reality (AR) and Virtual Reality (VR) technologies aim to build 3D personalized avatars, and superimpose virtual objects in the real space. If successful, this new form of face-to-face interaction will allow extended remote work experiences that can improve productivity, reducing cost and stress of commuting, have a huge impact on the environment, and overall improving the work/life balance. + +Today most real-time systems for avatars in AR are cartoon-like (e.g., Apple Animoji, Tiktok FaceAnimation, Hyprsense, Loom AI); on the other hand, digital creators in movies have developed uncanny digital humans using advanced computer graphics technology and person-specific (PS) models (e.g., Siren). While some of these avatars can be driven in real-time from egocentric cameras (e.g., Doug character made by digital domain), building the PS model is an extremely time-consuming and hand-tuned process that + +prevents democratizing this technology. This paper contributes toward this direction, and it proposes new algorithms to robustly and accurately drive 3D video-realistic avatars from monocular cameras to be consumed by AR/VR displays (see Fig. 1). + +Model-based photo-realistic 3D face reconstruction/animation from a video has been a core area of research in computer vision and graphics in the last thirty years [3, 4, 6, 8, 14, 16, 23, 28, 33, 49, 44, 59, 2]. While different versions of morphable models or active appearance models have provided good facial animation results, the existing 3D models do not provide the quality that is needed it for a good immersive viewing experience in AR/VR. In particular, the complex lighting, motion, and other in-the-wild conditions do result in artifacts in the avatar due to poor decouple of rigid and non-rigid motion, as well as, no accurate texture reconstruction. To tackle this problem, we build on recent work on Deep Appearance Model (DAM) [27] that learns a person-specific model from a multi-view capture setup. [27] can render photo-realistic avatars in a VR headset by inferring 3D geometry and view-dependent texture from egocentric cameras. + +This paper extends DAM [27] with a new deep lighting adaptation method to recover subtle facial expressions from monocular videos in-the-wild and transfer them to a 3D video-realistic avatar. The method is able to decouple rigid and non-rigid facial motions, as well as, shape, appearance and lighting from videos in-the-wild. Our method combines a prior lighting model learned in a lab-controlled scenario and adapts it to the in-the-wild video, recovering accurate texture and geometric details in the avatar from images with complex illuminations and challenging poses (e.g. profile). There are two main contributions of our work. First, we provide a framework for fitting a non-linear appearance model (based on a variational auto-encoder) to in-the-wild videos. Second, we propose a new lighting transfer module to learn a global illumination model. Experimental validation shows that our proposed algorithm with deep lighting adaptation outperforms state-of-the-art methods and provides robust solutions in realistic scenarios. + +# 2. Related Work + +3D Face Tracking. 3D morphable face models (3DMM) [3, 4, 6, 14, 16, 23, 33] and Active Appearance Models (AAMs) [8, 28, 49] have been extensively utilized for learning facial animations from 3D scans and face tracking. These methods produce texture and geometry through the idea of analysis-by-synthesis, where a parametric face model is iteratively adapted until the synthesized face matches the target image. For example, by leveraging the photometric error in both shape and texture, AAMs [8] have shown strong efficiency and expressibility to register faces in images. More recently, + +Deep Appearance Model (DAM) [27] extends the AAMs with deep neural networks in-place of linear generative functions. DAM learns the latent presentation of geometry and texture using a conditional variational autoencoder [19] and is able to reconstruct a high-fidelity view-dependent avatar with the aid of the multi-view camera system. + +In-the-Wild Face Reconstruction. Face reconstruction under an in-the-wild scenario is known as a challenging problem since the rigid, lighting, and expression are unknown. For example, the surface information presented by a single image [15, 24, 34, 38, 42, 43, 57, 48, 54, 58, 56, 45, 17, 12] or even an image collection [35, 36, 25, 37, 50, 41, 46] is limited. Thus, achieving high-fidelity face reconstruction from in-the-wild imagery usually relies on prior knowledge like 3DMMs [3], FLAME [23], or DAM [27]. For example, instead of directly regressing the geometry, MoFA [43] uses a CNN-based image encoder to extract the semantically meaningful parameters (e.g., facial expression, shape, and skin reflectance) from a single 2D image and then uses the parametric model-based decoder to render the output image. Tran et al. [48] propose a weakly supervised model that jointly learns a nonlinear 3DMM and its fitting algorithm from 2D in-the-wild image collection. Gecer et al. [13] train a facial texture generator in the UV space with self-supervision as their statistical parametric representation of the facial texture. Lin et al. [24] propose a GCN-based network to refine the texture generated by a 3DMM-based method with facial details from the input image. Yoon et al. [54] propose a network (I2ZNet) to learn a latent vector $z$ and head pose for DAM from a single image to reconstruct the texture and geometry. + +Lighting Estimation for In-the-Wild Imagery. Most existing face reconstruction works [24, 26, 39, 42, 43, 47, 48, 29] estimate the illumination using spherical harmonics (SH) basis function. For instance, Tewari et al. [42] regress the illumination parameters from the input image, and the rendering loss is computed after combining the estimated illumination and skin reflectance in a self-supervised fashion. In this way, it is hard to analyze the quality of the estimated illumination and skin albedo. Moreover, low-order spherical harmonics cannot produce hard shadows cast from point light sources, which will decrease the face reconstruction quality in many real-world scenarios. I2ZNet [54] proposes a MOTC module to convert the color of the predicted texture to the in-the-wild texture of the input image. The MOTC can be viewed as a color correction matrix that corrects the white-balance between the two textures. However, the MOTC can only model the low-frequent lighting information, which will decrease the face registration performance if the lighting environment is complicated. Meanwhile, the surface information presented by a single image is limited, which leads to some artifacts such as oversmoothing and incorrect expression. To explicitly model the + +lighting, we propose a physics-based lighting model to learn the high-frequent lighting pattern (e.g., shading, and brightness) from data captured in a lab-controlled environment. Besides, a domain adaptation schema is proposed to bridge the domain mismatch between lab and wild environments. + +# 3. Adaptive Lighting Model + +This section describes existing work on DAMs [27] (Sec. 3.1), construction of the lighting model with light-stage data (Sec. 3.2), and the adaptation of the model for in-the-wild settings in Sec. 3.3. + +# 3.1. Deep Appearance Models + +Our work is based on the face representation described in DAM [27]. It uses a variational auto-encoder (VAE) [20] to jointly represent the 3D facial geometry and appearance that are captured from a multi-view capture light-stage. The decoder, $D$ , can generate instances of a person's face by taking, as input, a latent code $\mathbf{z}$ , which encodes the expression, and a vector $\mathbf{v}^v$ that represents viewing direction as a normalized vector pointing from the center of the head to the camera $v$ : + +$$ +\hat {\mathbf {M}}, \hat {\mathbf {T}} ^ {v} \leftarrow D (\mathbf {z}, \mathbf {v} ^ {v}). \tag {1} +$$ + +Here, $\hat{\mathbf{M}}$ denotes the 3D face mesh (geometry) and $\hat{\mathbf{T}}^v$ , the view-dependent texture. + +In this work, we assume the availability of a pre-trained DAM decoder of a subject, and propose a system to fit the model to images by estimating the rigid and non-rigid motion (i.e., facial expression). A major challenge in implementing such a system is how to account for illumination differences between the high controlled studio lighting system where the avatar was captured, and the in-the-wild captures where the avatar is deployed. In the following, we will describe an adaptive lighting model that extends the original DAM formulation to enable high precision tracking in uncontrolled and complex environments. + +# 3.2. Lighting Model + +In order to incorporate a generative model of lighting into the DAM formulation, we extend the capture system in [27] to include 460 controllable lights that are synchronized with the multi-view camera system. The captured sequence was extended to include a portion where non-overlapping groups of approximately 10 lights were turned on, interleaved with fully lit frames that were used for tracking. This data was used to build a relightable face model using the scheme illustrated in Figure 2. + +Our formulation is inspired by the light-varying residual proposed by Nestmeyer et al. [31], where illumination variations are represented using gain and bias maps, $\mathbf{g}$ and $\mathbf{b}$ , each matching DAM's texture dimensions $(H\times W\times 3)$ : + +$$ +\mathbf {T} ^ {v} = \hat {\mathbf {T}} ^ {v} \odot \mathbf {g} ^ {v} + \mathbf {b} ^ {v}, \tag {2} +$$ + +![](images/a59814d71b741313de3af2b32a12b63aca1b466c585ec87f380111ab17fdec3b.jpg) +Figure 2. Training the lighting model on the light-stage data. We update the lighting model $G$ and per-frame expression code $\mathbf{z}$ while fixing the other parameters. + +where $\odot$ denotes the element-wise product, $\mathbf{T}^v$ is the relit texture, and $\hat{\mathbf{T}}^v$ is the DAM avatar's original texture (fully-lit). The gain and bias maps depend on the lighting, head pose1, viewpoint, and expression. These inputs, represented by $\mathbf{l}$ , $\mathbf{h}^v$ , and $\hat{\mathbf{T}}^v$ , are processed by MLPs and are spatially repeated for concatenation with the DAM's texture followed by additional convolution operations to produce the final relit texture. This lighting model is, thus, defined as follows: + +$$ +\mathbf {g} ^ {v}, \mathbf {b} ^ {v} \leftarrow G (\mathbf {l}, \mathbf {h} ^ {v}, \hat {\mathbf {T}} ^ {v}; \phi) , \tag {3} +$$ + +where $\phi$ denotes the weights of the network. Further details about $G$ are in Sec. 4.1 and in the supplementary material. + +Since the goal of our lighting model is to enable accurate registration in uncontrolled scenarios, we do not require a lighting representation that is geometrically interpretable, only one that can span the space of facial illuminations. As such, we represent lighting conditions using a one vector that specifies which of the lights, in each color channel, are active for a given training frame. We use a binary vector of 150 dimensions, which comprises the 50 lighting groups with three color channels each. The fully-lit frames are encoded as the all-one vector. In combination with the continuously parameterized head pose, this representation allows for continuous and smoothly varying illumination synthesis on the face that can model complex effects such as how shadows move as the subject's head rotates in the scene. + +To train $G$ , we take a pre-trained DAM decoder and fix its weights while minimizing the reconstruction error over all camera views in the subject's sequence, that is: + +$$ +\mathcal {L} _ {\text {r e n d e r}} (\phi , \mathbf {Z}) = \sum_ {t, v} \left\| \left(I _ {t} ^ {v} - \mathcal {R} \left(\mathbf {T} _ {t} ^ {v}, \hat {\mathbf {M}} _ {t}\right)\right) \odot m ^ {v} \right\| _ {1}, \tag {4} +$$ + +Algorithm 1 Lighting Model Adaptation +Input: lighting model $G$ with weights $\phi$ , $K$ key frames with initial face parameters $\{(I, \tilde{\mathbf{p}})_k\}$ , camera viewpoint vector $\mathbf{v}^v$ +Output: adapted lighting model $G$ and lighting code 1 +Initialization: set 1 to zeros, $\phi$ to pre-trained weights by Sec. 3.2, face parameters $\{\mathbf{p}_k\}$ to $\{\tilde{\mathbf{p}}_k\}$ +for number of iterations do + # Fitting 1 + for number of iterations do + Unfreeze 1, freeze $\phi$ and $\{\mathbf{p}_k\}$ + Calculate $\mathcal{L}_{pix}$ using Eq. 7 + $1 \gets Adam\{\mathcal{L}_{pix}\}$ + # Fitting $\phi$ and $\{\mathbf{p}_k\}$ + for number of iterations do + Freeze 1, unfreeze $\phi$ and $\{\mathbf{p}_k\}$ + Calculate $\mathcal{L}_{pix}$ using Eq. 7 + $\phi, \{\mathbf{p}_k\} \gets Adam\{\mathcal{L}_{pix}\}$ + +where the minimization is performed over the lighting model's weights, $\phi$ , as well as the expression codes for each frame $\mathbf{Z} = \{\mathbf{z}_t\}$ . In Equation 4, $m^v$ is a foreground mask from view $v$ and $\mathcal{R}$ is a differentiable rasterization function [32]. To ensure stable convergence, we employ $L_{2}$ -shrinkage on the expression codes, $\mathbf{Z}$ , and use the technique in [52] to obtain a tracked mesh, $\mathbf{M}_t$ , from the fully-lit frames, that are used to geometrically constrain the optimization, resulting in the following total objective: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {r e n d e r}} + \lambda_ {\text {g e o}} \sum_ {t} \| \mathbf {M} _ {t} - \hat {\mathbf {M}} _ {t} \| ^ {2} + \lambda_ {\text {r e g}} \| \mathbf {Z} \| ^ {2}. \tag {5} +$$ + +Regularization weights of $\lambda_{\mathrm{geo}} = 1.0$ and $\lambda_{\mathrm{reg}} = 0.1$ were chosen for all experiments in Sec. 4 by cross validation. + +# 3.3. Registration In-the-Wild + +With the lighting model described in Sec. 3.2, we have a personalized face model that can synthesize realistic variations in expression as well as lighting suitable for an analysis-by-synthesis approach to register the model to inthe-wild video with uncontrolled illumination. However, to achieve robust and precise results, special care needs to be applied in how registration is performed. Our algorithm comprises three steps (Fig. 3) outlined below, each designed to address initialization, accuracy, and computational efficiency, respectively. + +Step 1: Initialization. To avoid registration terminating in poor local minima, we initialize the pose and expression parameters by matching against facial keypoints in the image found via an off-the-shelf detector (e.g.,[22]). Specifically, face landmarks, $\{L_i\}$ , describing facial features such as eye corners, lip contours, and the face silhouette correspond to fixed vertices in the face model's geometry, $\{\ell_i\}$ . + +The initial face parameters, $\tilde{\mathbf{p}} = [\tilde{\mathbf{r}},\tilde{\mathbf{t}},\tilde{\mathbf{z}}]$ , are then found by minimizing the reprojection error over these landmark points in all camera views, $v$ , for every frame: + +$$ +\mathcal {L} _ {\text {l a n d}} (\tilde {\mathbf {p}}) = \sum_ {v, i} \left\| \Pi_ {v} \left(\tilde {\mathbf {r}} \tilde {\mathbf {M}} ^ {(\ell_ {i})} + \tilde {\mathbf {t}}\right) - L _ {i} ^ {v} \right\| ^ {2}, \tag {6} +$$ + +where $\Pi_v$ is the projection operator based on camera parameters that are assumed to be available. The face mesh, $\tilde{\mathbf{M}}$ , is calculated using Eq. 1 with the expression code $\tilde{\mathbf{z}}$ . Due to the landmarks' sparsity and detection noise, minimizing $\mathcal{L}_{\mathrm{land}}$ results in only a rough alignment of the face in each frame (e.g., Fig. 4 (b)). Nonetheless, it places the model within the vicinity of the solution, allowing the more elaborated optimization procedure described next to converge. + +Step 2: Lighting Model Adaptation. Although the lighting model described in Sec. 3.2 equips us with the ability to synthesize variations in facial illumination, using the light-stage to simulate the total span of lighting variations encounter in the wild remains challenging. Effects such as nearfield lighting, cast shadows, and reflections from nearby objects are commonly observed in uncontrolled settings. To account for variations not spanned by our lighting model, $G$ , in addition to solving for the lighting parameters, $l$ , we simultaneously fine-tune the model's weights, $\phi$ , to obtain a better fit to in-the-wild images. Specifically, we minimize the following loss over a collection of $K$ frames from the target environment: + +$$ +\mathcal {L} _ {\mathrm {p i x}} (\mathbf {l}, \phi , \left\{\mathbf {p} _ {k} \right\}) = \sum_ {k} \| r _ {k} \odot w _ {k} \| _ {1} + \lambda_ {\triangle} \| \bigtriangleup r _ {k} \odot w _ {k} \| _ {1}, \tag {7} +$$ + +where $r_k = I_k - \hat{I}(\mathbf{p}_k)$ is the reconstruction residual, $w_k$ is the foreground mask, and $\mathbf{p}_k = [\mathbf{r}_k, \mathbf{t}_k, \mathbf{z}_k]$ . Here, $\Delta$ denotes the image Laplacian operator that makes the loss more robust to residual differences due to illumination and generally improves results. + +Step 3: Face Tracking. The procedure described previously can generate accurate estimates of facial expression, but requires batch processing to adapt the lighting model simultaneously over several frames. However, once the lighting model has been adapted, the parameters $\mathbf{p} = [\mathbf{r},\mathbf{t},\mathbf{z}]$ for any new frames can be estimated independently of the lighting model $G$ . Thus, in practice, we adapt the lighting model using only a small subset of $K$ frames and estimate $\mathbf{p}$ with the updated model $G$ . To further improve accuracy, in addition to the optimizing the loss in Eq. 7, similarly to [5], we use dense optical flow [21] between the rendered model and the image to further constrain the optimization. It is computed over all projected mesh vertices in all camera + +![](images/e93482c5e2689a2e9bf0ffa354447880ae57ca0f7646f8eb401a0bf738cfa2a5.jpg) +Figure 3. The pipeline of in-the-wild registration. We estimate the initial tracking parameters in step 1, adapt the lighting model and tracking parameters $\mathbf{1}, \phi, \{\mathbf{p}_k\}$ with $K$ reference frames in Step 2, and further optimize the tracking parameters in step 3. + +![](images/4a3e69c61284e42f2b2ae720177f64229857e2b576555a77911c5a8e42e38ade.jpg) +Figure 4. Result of each step in Sec. 3.3. From left to right: (a) captured image, (b) avatar output by step 1, (c) relit avatar after step 2, (d) fully-lit avatar after step 3, and (e) relit avatar after step 3. The last column shows the zoom-in of corresponding color rectangle, please notice the lip shapes and gaze directions. + +views as follows: + +$$ +\mathcal {L} _ {\text {f l o w}} (\mathbf {p}) = \sum_ {v, i} \left\| \left(\mathbf {r} \mathbf {M} ^ {(i)} + \mathbf {t}\right) - \Pi_ {v} \left(\tilde {\mathbf {r}} \tilde {\mathbf {M}} ^ {(i)} + \tilde {\mathbf {t}}\right) - \mathbf {d} _ {i} ^ {v} \right\| ^ {2}, \tag {8} +$$ + +where mesh $\mathbf{M}$ and $\tilde{\mathbf{M}}$ are calculated using Eq. 1 with the latent face code $\mathbf{z}$ and $\tilde{\mathbf{z}}$ respectively, and $(\tilde{\mathbf{r}},\tilde{\mathbf{t}},\tilde{\mathbf{z}})$ are initial parameters from Step 1. We optimize the per-frame face parameters $\mathbf{p} = \{\mathbf{r},\mathbf{t},\mathbf{z}\}$ by minimizing the total loss $\mathcal{L} = \mathcal{L}_{\mathrm{pix}} + \lambda_{\mathrm{flow}}\mathcal{L}_{\mathrm{flow}}$ , where $\lambda_{\mathrm{flow}} = 3.0$ was chosen via cross validation. Fig. 4 (d-e) shows some examples of results obtained through this process, demonstrating accurate alignment and reconstruction of lip shape and gaze direction that were absent in Step 1. + +# 4. Experiments + +In this section, we conduct quantitative and qualitative experiments to show the performance of the proposed face tracking framework on in-the-wild videos. Sec. 4.1 explains dataset and implementation details. Sec. 4.2 compares our method to state-of-the-art methods, and Sec. 4.3 describes the ablation studies. + +# 4.1. Experimental Settings + +Dataset Collection. We recorded our light-stage data in a calibrated multi-view light-stage consisting of 40 machine vision cameras capable of synchronously capturing HDR images at $1334 \times 2048 / 90$ fps and a total of 460 white LED lights. We flash a group of LEDs (at most 10) per frame and instruct our subjects to make diverse expressions with + +head movements. There are 50 different lighting patterns and one fully-lit pattern. We record a total of 13 minutes video sequence of one subject (see supplementary videos). + +The in-the-wild video test were gathered using the frontal camera of an iPhone. We captured videos for 10 subjects. We collected around 5 video clips for each subject, performing different facial expressions and head movements, under various lighting conditions and environments. + +Implementation Details. The light-stage training step (Sec. 3.2) and the lighting adaptation step cost 36 hours and 4mins, respectively, on an NVIDIA DGX machine. In all our experiments, we used the Adam optimizer [18] to optimize the losses. In order to cover more lighting space during the training of the lighting transfer module, we augmented the RGB channels of the light-stage lighting color with randomly selected scales, which are also used to scale the lighting code 1 in the training data. The architecture of our lighting decoder $G$ is as follows: we first encode the input head pose $\mathbf{h}^v$ and 1 with two MLPs to 256 dimensions. After concatenating the two latent features, we pass it to a fully-connected layer and a convolution layer followed by four transposed convolutions with each layer. The fully-lit texture $\hat{\mathbf{T}}^v$ is encoded by four convolution layers with each layer followed by a down-sampling layer to texture feature. Then we concatenate the texture feature and lighting feature and pass it to two separate branches consists of two transpose convolution. The two branches output gain map $\mathbf{g}_t^v$ and bias map $\mathbf{b}_t^v$ with the resolution of $256 \times 256$ , and we up-sample them 4 times using bilinear interpolation to the same resolution as texture $\hat{\mathbf{T}}^v$ . Please refer to supplementary materials for details. While training the lighting model on the light-stage data in Sec. 3.2, the rendering loss is optimized with an initial learning rate of $1e^{-3}$ , which is decreased by a quarter after every 10 epochs. + +During the registration of the in-the-wild videos in Sec. 3.3, we fit the DAM code $\mathbf{z}_k$ in step 1 with 1000 iterations. The initial learning rate is 0.1, and we decrease it by half after every 500 iterations. In step 2, the $K$ frames are uniformly sampled according to the value of $\tilde{\mathbf{r}}$ to cover diverse head movements. We fit the lighting code 1 with 250 iterations with a learning rate of $1e^{-2}$ , then update $G$ 's network parameter $\phi$ and face parameters $\{\mathbf{p}_k\}$ with 500 iterations with a learning rate of $1e^{-3}$ . We alternatively update 1, $\phi$ , and $\{\mathbf{p}_k\}$ for 4 times. In step 3, we update the face + +![](images/cc48657058db741a1517a530ba4bfe2379ef167ed07603e85b414f3c3f971b1d.jpg) +Figure 5. Qualitative comparison. We suggest to view it using a monitor for better visual quality. We selected 8 subjects from the test set with different lighting conditions, facial expression, and head motion. From left to right: (a) Captured image, (b) Abrevaya et al. [1], (c) 3DDFAv2 [15], (d) PRNet [11], (e) RingNet [37], (f) FaceScape [53], (g) Deng et al. [10], (h) MGCNet [40], and (i) our method. + +![](images/38e5b9274641dda6252fac9d5d5d8a34cdbceca6bd8617ecba80ba41083b00e3.jpg) +Figure 6. Visual comparison between our method and I2ZNet [54] on testing video frames. From top to bottom: captured image, I2ZNet [54], and our method. + +parameters $\{\mathbf{p}_k\}$ with the same hyper-parameters as step 1. Evaluation Metrics. We used a variety of perceptual measures to quantitatively compare the registered image against the ground-truth in-the-wild image. Besides the pixel-level $L_{2}$ distance, we adopted PSNR and structural similarity (SSIM) [51] for human perceptual response. To + +evaluate the realism of the output avatar, we computed the cosine similarity (CSIM) between embedding vectors of the state-of-the-art face recognition network [9] suggested by [55, 7] for measuring identity mismatch between the input image and reconstructed avatar. + +# 4.2. Comparison with state-of-the-art methods + +To demonstrate the effectiveness of our lighting model and the face tracking quality, we compared our algorithm against the following set of related methods using the pretrained models provided by the authors: Abrevaya et al. [1], 3DDFAv2 [15], PRNet [11], RingNet [37], FaceScape [53], Deng et al. [10], MGCNet [40], and I2ZNet [54]. As the baseline method, we used the same face registration method proposed in Sec. 3, but use the standard spherical harmonics (SH) [30] illumination model, which is denoted as ours-SH. We adopt the same parameter setting as [43] for SH, and train a regression network to regress the input images to the 27 dimensional SH parameters. + +Qualitative Evaluation. Fig. 5 shows the tracked geom + +![](images/22801f3168ae2027198e602edd114936ba6f22c58190e505c9057731074d3b9e.jpg) +(a) Captured image +(b) Fully-lit texture (c) Fully-lit avatar +(d) Gain map +(e) Bias map +(f) Relit texture +(g) Relit avatar +(h) Relit avatar-SH +Figure 7. Visual results under different lighting conditions. Besides our final relit avatar (g), we also show the tracked avatar (h) using spherical harmonics (SH) as illumination model. Our method can handle different lighting conditions well. + +etry results for different methods $^{3}$ . We can observe that our proposed method is robust to diverse facial expressions, poses, and lighting conditions. For example, in the $3^{rd}$ and $4^{th}$ row, all other methods failed to describe the expression (e.g., lips) except our method and Abrevaya et al. [1]. In the $7^{th}$ row, all other methods can not output the correct head pose, while our method can still reconstruct high-quality geometry and texture under dark lighting conditions. We also show the reconstructed avatars by (g) [10], (h) [40], and (i) our method (fully-lit and relit avatar). Comparing with other methods, our method not only generates a more realistic avatar, but also considers the lighting details (e.g., shadows and specular highlights, see the relit avatar in $1^{th}$ , $3^{rd}$ , and $6^{th}$ row). Furthermore, we compare our relit avatar with I2ZNet [54] in Fig. 6. Although I2ZNet is a person-specific model, our method produces better visual results. + +Fig. 7 shows the visual results under different real-world lighting environments. The proposed method is robust to different unseen lighting conditions, and our face tracking system can output a high-quality avatar with the aid of our lighting model. Fig. 7(h) shows the tracking results using + +the SH illumination model. The reconstruction error between the captured frame and the avatar relit by SH model is large, and it decreases the face tracking performance. + +We also show our avatar rendered from different viewpoints in Fig. 1 and Fig. 8. We can find that our method can output the high-fidelity avatar from any viewpoint. Our lighting model is conditioned on the camera viewpoints, so the gain map and bias map will be adjusted to match the lighting in the specific view. Please refer to the supplementary video for more visual results. + +Quantitative Evaluation. Tab. 1 shows the quantitative results of MGCNet [40], Deng et al. [10], I2ZNet [54], and our method. Our method outperforms other methods not only at the human perception level, but also at the identity preserving ability (CSIM score). The high CSIM score indicates that our reconstructed avatar produces high identity similarity. We can see that the $L_{2}$ and other perceptual scores of the avatar optimized with the SH illumination model result in higher error, although it preserves the identity information (CSIM). + +![](images/23024e04b7fd14f3fdc0e35d8bd4f03273e0f8b842a3000b545deeb260fd16ed.jpg) +Figure 8. The visual results for different viewpoints. From left to right: captured image, normal map, fully-lit texture, fully-lit avatar, gain map, relit texture, and relit avatar. From top to bottom: different viewpoints. Please notice the changes of the gain map due to different viewpoints. + +
MethodsMetrics
L2↓SSIM↑PSNR↑CSIM↑
MGCNet [40]24.560.8634.470.305
Deng et al. [10]27.330.8633.810.434
I2ZNet [54]20.490.92735.030.592
Ours-SH41.010.7932.000.693
Ours12.590.9337.930.871
+ +# 4.3. Ablation Study + +We have already shown the superiority of our face tracking algorithm along with the lighting model over other methods. To further demonstrate the effectiveness of different steps in Sec. 3, we make a comprehensive ablation study on a subset of the testing videos. + +The lighting model. To evaluate the role of our lighting model, we test our face tracking system with the lighting model under two different settings: without pre-training on light-stage data (w/o Pre-train.) and without lighting adaptation on wild video frames (w/o Adapt.). We set $K = 48$ in the without pre-training experiment. Tab. 2 shows the quantitative evaluation results, and we can see that all the scores are improved with light-stage pre-training $(1^{st}$ and $5^{th}$ row). Although without adaptation $(2^{nd}$ row) performs slightly better than $K = 1$ , with more reference frames for adaptation, the adapted lighting model performs much better than without adaptation. Fig. 9 shows the visual comparison. We can see that the pre-training on light-stage data and lighting adaptation both contribute to the final tracking results, where the pre-training on light-stage data enables the + +Table 1. The quantitative evaluation on the test set. $\downarrow / \uparrow$ denote the lower/higher, the better. The top-1 scores are highlighted. + +
MethodsMetrics
L2↓SSIM↑PSNR↑CSIM↑
w/o Pre-train.14.880.94137.080.783
w/o Adapt.18.030.93835.590.593
K=118.580.90035.480.550
K=1212.300.95037.320.842
K=4811.350.95037.660.809
K=All11.330.95237.780.863
+ +Table 2. Quantitative results of the ablation study. + +![](images/21d637d1cc78a31f8c5d311f3717cdfa552c2359603401e703d355d8c1f3b13c.jpg) +Figure 9. Visual comparison of the ablation study. + +lighting interpretation ability, and the adaptation step enables the lighting model to generate accurate gain and bias map for target video frames. + +Influence of the value of $K$ . To evaluate the effect on the number of reference frames used in the lighting model adaptation step, we sample reference frames with different $K$ and keep other settings the same, and show the results in Tab. 2 and Fig. 9. We can find that with only 48 reference frames, the lighting model can be perfectly adapted to the target video and achieve comparable results in visual metrics ( $L_{2}$ , SSIM, and PSNR). If the amount of the selected reference frames is too small (e.g., $K = 1$ ), the lighting model will be over-fitted to the selected frames and loss the lighting interpolation ability. + +# 5. Conclusion + +We present a new in-the-wild face tracking algorithm with an adaptive lighting model that can infer a high-fidelity 3D avatar. The proposed lighting model inherits the prior knowledge from the light-stage data, and it adapts to in-the-wild samples to produce high-quality re-lighting results for our face tracking. Results confirm that relatively few adaptation samples (48) are enough to produce hyper-realistic results in the avatar. While the proposed method can generate photo-realistic avatars from videos in the wild, our lighting model assumes that the lighting source in the testing video is fixed, and it uses one single lighting code to represent the lighting in the whole video sequence. This is a limitation of the current model, and the model can produce undesirable results if the lighting is changing in the video. In the future, we will explore on-line adaptation methods to address this limitation of the current work. + +Acknowledgements. This work was done when Lele Chen was an intern at Facebook Reality Labs. + +# References + +[1] V. F. Abrevaya, A. Boukhayma, P. H. Torr, and E. Boyer. Cross-modal deep face normals with deactivable skip connections. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4979-4989, 2020. 6, 7 +[2] T. Beeler, F. Hahn, D. Bradley, B. Bickel, P. Beardsley, C. Gotsman, R. W. Sumner, and M. Gross. High-quality passive facial performance capture using anchor frames. ACM Trans. Graph., 30:75:1-75:10, August 2011. 2 +[3] V. Blanz and T. Vetter. A morphable model for the synthesis of 3d faces. In Proceedings of the 26th annual conference on Computer graphics and interactive techniques, pages 187-194, 1999. 2 +[4] J. Booth, A. Roussos, A. Ponniah, D. Dunaway, and S. Zafeiriou. Large scale 3d morphable models. International Journal of Computer Vision, 126(2-4):233-254, 2018. 2 +[5] C. Cao, M. Chai, O. Woodford, and L. Luo. Stabilized real-time face tracking via a learned dynamic rigidity prior. ACM Transactions on Graphics (TOG), 37(6):1-11, 2018. 4 +[6] C. Cao, Y. Weng, S. Zhou, Y. Tong, and K. Zhou. Facewarehouse: A 3d facial expression database for visual computing. IEEE Transactions on Visualization and Computer Graphics, 20(3):413-425, 2013. 2 +[7] L. Chen, G. Cui, C. Liu, Z. Li, Z. Kou, Y. Xu, and C. Xu. Talking-head generation with rhythmic head motion. In European Conference on Computer Vision, pages 35-51. Springer, 2020. 6 +[8] T. F. Cootes, G. J. Edwards, and C. J. Taylor. Active appearance models. IEEE Transactions on pattern analysis and machine intelligence, 23(6):681-685, 2001. 2 +[9] J. Deng, J. Guo, N. Xue, and S. 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. 6 +[10] Y. Deng, J. Yang, S. Xu, D. Chen, Y. Jia, and X. Tong. Accurate 3d face reconstruction with weakly-supervised learning: From single image to image set. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 0–0, 2019. 6, 7, 8 +[11] Y. Feng, F. Wu, X. Shao, Y. Wang, and X. Zhou. Joint 3d face reconstruction and dense alignment with position map regression network. In Proceedings of the European Conference on Computer Vision (ECCV), pages 534-551, 2018. 6 +[12] P. Garrido, M. Zollhöfer, D. Casas, L. Valgaerts, K. Varanasi, P. Pérez, and C. Theobalt. Reconstruction of personalized 3d face rigs from monocular video. ACM Transactions on Graphics (TOG), 35(3):1-15, 2016. 2 +[13] B. Gecer, S. Ploumpis, I. Kotsia, and S. Zafeiriou. Ganfit: Generative adversarial network fitting for high fidelity 3d face reconstruction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1155–1164, 2019. 2 +[14] T. Gerig, A. Morel-Forster, C. Blumer, B. Egger, M. Luthi, S. Schonborn, and T. Vetter. Morphable face models—an open + +framework. In 2018 13th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2018), pages 75-82. IEEE, 2018. 2 +[15] J. Guo, X. Zhu, Y. Yang, F. Yang, Z. Lei, and S. Z. Li. Towards fast, accurate and stable 3d dense face alignment. arXiv preprint arXiv:2009.09960, 2020. 2, 6 +[16] P. Huber, G. Hu, R. Tena, P. Mortazavian, P. Koppen, W. J. Christmas, M. Ratsch, and J. Kittler. A multiresolution 3d morphable face model and fitting framework. In Proceedings of the 11th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications, 2016. 2 +[17] H. Kim, M. Zolloffer, A. Tewari, J. Thies, C. Richardt, and T. Christian. InverseFaceNet: Deep Single-Shot Inverse Face Rendering From A Single Image. In Proceedings of Computer Vision and Pattern Recognition (CVPR 2018), 2018. +[18] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 5 +[19] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 2 +[20] D. P. Kingma and M. Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, 2014. 3 +[21] T. Kroeger, R. Timofte, D. Dai, and L. Van Gool. Fast optical flow using dense inverse search. In B. Leibe, J. Matas, N. Sebe, and M. Welling, editors, Computer Vision – ECCV 2016, pages 471–488, Cham, 2016. Springer International Publishing. 4 +[22] D. Lee, H. Park, and C. D. Yoo. Face alignment using cascade gaussian process regression trees. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4204-4212, 2015. 4 +[23] T. Li, T. Bolkart, M. J. Black, H. Li, and J. Romero. Learning a model of facial shape and expression from 4d scans. ACM Trans. Graph., 36(6):194-1, 2017. 2 +[24] J. Lin, Y. Yuan, T. Shao, and K. Zhou. Towards high-fidelity 3d face reconstruction from in-the-wild images using graph convolutional networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5891-5900, 2020. 2 +[25] C. Liu and X. Li. Superimposition-guided facial reconstruction from skull. Arxiv, arXiv:1810.00107, 2018. 2 +[26] C. Liu, Z. Li, S. Quan, and Y. Xu. Lighting estimation via differentiable screen-space rendering. In 2020 IEEE Conference on Virtual Reality and 3D User Interfaces Abstracts and Workshops (VRW), pages 575-576, 2020. 2 +[27] S. Lombardi, J. Saragih, T. Simon, and Y. Sheikh. Deep appearance models for face rendering. ACM Transactions on Graphics (TOG), 37(4):1-13, 2018. 2, 3 +[28] I. Matthews and S. Baker. Active appearance models revisited. International journal of computer vision, 60(2):135-164, 2004. 2 +[29] A. Meka, R. Pandey, C. Hane, S. Orts-Escalano, P. Barnum, P. David-Son, D. Erickson, Y. Zhang, J. Taylor, S. Bouaziz, et al. Deep reightable textures: volumetric performance capture with neural rendering. ACM Transactions on Graphics (TOG), 39(6):1-21, 2020. 2 + +[30] C. Müller. Spherical harmonics, volume 17. Springer, 2006. 6 +[31] T. Nestmeyer, J.-F. Lalongne, I. Matthews, and A. Lehrmann. Learning physics-guided face relighting under directional light. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5124-5133, 2020. 3 +[32] S. G. Parker, J. Bigler, A. Dietrich, H. Friedrich, J. Hoberock, D. Luebke, D. McAllister, M. McGuire, K. Morley, A. Robison, et al. Optix: a general purpose ray tracing engine. Acm transactions on graphics (tog), 29(4):1-13, 2010. 4 +[33] P. Paysan, R. Knothe, B. Amberg, S. Romdhani, and T. Vetter. A 3d face model for pose and illumination invariant face recognition. In 2009 Sixth IEEE International Conference on Advanced Video and Signal Based Surveillance, pages 296-301. IEEE, 2009. 2 +[34] E. Richardson, M. Sela, and R. Kimmel. 3d face reconstruction by learning from synthetic data. In 2016 fourth international conference on 3D vision (3DV), pages 460-469. IEEE, 2016. 2 +[35] J. Roth, Y. Tong, and X. Liu. Unconstrained 3d face reconstruction. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2606-2615, 2015. 2 +[36] J. Roth, Y. Tong, and X. Liu. Adaptive 3d face reconstruction from unconstrained photo collections. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(11):2127-2141, December 2016. 2 +[37] S. Sanyal, T. Bolkart, H. Feng, and M. J. Black. Learning to regress 3d face shape and expression from an image without 3d supervision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7763-7772, 2019. 2, 6 +[38] M. Sela, E. Richardson, and R. Kimmel. Unrestricted facial geometry reconstruction using image-to-image translation. In Proceedings of the IEEE International Conference on Computer Vision, pages 1576-1585, 2017. 2 +[39] S. Sengupta, A. Kanazawa, C. D. Castillo, and D. W. Jacobs. Sfsnet: Learning shape, reflectance and illuminance of facesin the wild'. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6296- 6305, 2018. 2 +[40] J. Shang, T. Shen, S. Li, L. Zhou, M. Zhen, T. Fang, and L. Quan. Self-supervised monocular 3d face reconstruction by occlusion-aware multi-view geometry consistency. arXiv preprint arXiv:2007.12494, 2020. 6, 7, 8 +[41] A. Tewari, F. Bernard, P. Garrido, G. Bharaj, M. Elgharib, H.-P. Seidel, P. Pérez, M. Zollhöfer, and C. Theobalt. FML: Face Model Learning from Videos. In Proceedings of Computer Vision and Pattern Recognition (CVPR 2019), 2019. +[42] A. Tewari, M. Zollhöfer, P. Garrido, F. Bernard, H. Kim, P. Pérez, and C. Theobalt. Self-supervised multi-level face model learning for monocular reconstruction at over 250 hz. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2549-2559, 2018. 2 + +[43] A. Tewari, M. Zollhofer, H. Kim, P. Garrido, F. Bernard, P. Perez, and C. Theobalt. Mofa: Model-based deep convolutional face autoencoder for unsupervised monocular reconstruction. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 1274-1283, 2017. 2, 6 +[44] J. Thies, M. Zollhöfer, M. Nießner, L. Valgaerts, M. Stamminger, and C. Theobalt. Real-time expression transfer for facial reenactment. ACM Transactions on Graphics (TOG), 34(6), 2015. 2 +[45] J. Thies, M. Zollhöfer, M. Stamminger, C. Theobalt, and M. Niessner. Face2face: Real-time face capture and reenactment of rgb videos. Commun. ACM, 62(1):96-104, Dec. 2018. 2 +[46] L. Thies, M. Zollhoefer, C. Richardt, C. Theobalt, and G. Greiner. Real-time halfway domain reconstruction of motion and geometry. In Proceedings of the International Conference on 3D Vision (3DV), 2016. 2 +[47] L. Tran, F. Liu, and X. Liu. Towards high-fidelity nonlinear 3d face morphable model. In In Proceeding of IEEE Computer Vision and Pattern Recognition, Long Beach, CA, June 2019. 2 +[48] L. Tran and X. Liu. On learning 3d face morphable model from in-the-wild images. IEEE transactions on pattern analysis and machine intelligence, 2019. 2 +[49] G. Tzimiropoulos, J. Alaborti Medina, S. Zafeiriou, and M. Pantic. Generic active appearance models revisited. In Asian Conference on Computer Vision, pages 650-663. Springer, 2012. 2 +[50] X. Wang, Y. Guo, B. Deng, and J. Zhang. Lightweight photometric stereo for facial details recovery. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 740-749, 2020. 2 +[51] Z. 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, 2004. 6 +[52] C. Wu, T. Shiratori, and Y. Sheikh. Deep incremental learning for efficient high-fidelity face tracking. ACM Trans. Graph., 37(6), Dec. 2018. 4 +[53] H. Yang, H. Zhu, Y. Wang, M. Huang, Q. Shen, R. Yang, and X. Cao. Facescape: A large-scale high quality 3d face dataset and detailed riggable 3d face prediction. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 6 +[54] J. S. Yoon, T. Shiratori, S.-I. Yu, and H. S. Park. Self-supervised adaptation of high-fidelity face models for monocular performance tracking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4601-4609, 2019. 2, 6, 7, 8 +[55] E. Zakharov, A. Shysheya, E. Burkov, and V. Lempitsky. Few-shot adversarial learning of realistic neural talking head models. In Proceedings of the IEEE International Conference on Computer Vision, pages 9459-9468, 2019. 6 +[56] H. Zhou, J. Liu, Z. Liu, Y. Liu, and X. Wang. Rotate-and-render: Unsupervised photorealistic face rotation from single-view images. In Proceedings of the IEEE/CVF + +Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 2 +[57] H. Zhou, Y. Sun, W. Wu, C. C. Loy, X. Wang, and Z. Liu. Pose-controllable talking face generation by implicitly modularized audio-visual representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 2 +[58] X. Zhu, X. Liu, Z. Lei, and S. Z. Li. Face alignment in full pose range: A 3d total solution. IEEE transactions on pattern analysis and machine intelligence, 41(1):78-92, 2017. 2 +[59] M. Zollhöfer. Real-Time Reconstruction of Static and Dynamic Scenes. PhD thesis, University of Erlangen-Nuremberg, 2015. 2 \ No newline at end of file diff --git a/highfidelityfacetrackingforarvrviadeeplightingadaptation/images.zip b/highfidelityfacetrackingforarvrviadeeplightingadaptation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b0726159608bc3019ea439ee440308091e744265 --- /dev/null +++ b/highfidelityfacetrackingforarvrviadeeplightingadaptation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cb0601bbb1e18b613cff2c47c172598d57990e4eb1f1b2ec3ad52e8af0475ed +size 754109 diff --git a/highfidelityfacetrackingforarvrviadeeplightingadaptation/layout.json b/highfidelityfacetrackingforarvrviadeeplightingadaptation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..64df24f2cb9d33d5503a2f721061d77a8791f218 --- /dev/null +++ b/highfidelityfacetrackingforarvrviadeeplightingadaptation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ac1d962ddc85b23dca0e65ea3fe8155d8ab5fb89a58b87c5ab95f4d144ed191 +size 426122 diff --git a/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_content_list.json b/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4304d72f0a6f99e5e256468bd251a70a0b654b8c --- /dev/null +++ b/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98e577085481239db1b55960164c6700c08bafb9bb1ae9d58a24ddc315db4604 +size 77598 diff --git a/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_model.json b/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_model.json new file mode 100644 index 0000000000000000000000000000000000000000..676430a5dbe7725e3d07b3c1dc49c6283db0df32 --- /dev/null +++ b/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dcf65585bdfbc1996ae3538aba25055bda07964ac1c8db494b177c2c218315d +size 91121 diff --git a/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_origin.pdf b/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e0d53ecf7dcfd6f5e93edf319a60119a9db7fcf7 --- /dev/null +++ b/highfidelityneuralhumanmotiontransferfrommonocularvideo/0efa778a-10e5-4fb4-a5d1-15ae9acd5481_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78bf7f08aa2c3cb5461fb67926522afa3f12ed5bbada123266f429bd8eebc064 +size 2412111 diff --git a/highfidelityneuralhumanmotiontransferfrommonocularvideo/full.md b/highfidelityneuralhumanmotiontransferfrommonocularvideo/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f0de87850f08ec5483ce744d419e8a70326284a3 --- /dev/null +++ b/highfidelityneuralhumanmotiontransferfrommonocularvideo/full.md @@ -0,0 +1,335 @@ +# High-Fidelity Neural Human Motion Transfer from Monocular Video + +Moritz Kappel + +Hans-Peter Seidel + +Vladislav Golyanik + +Susana Castillo + +Mohamed Elgharib + +Christian Theobalt2 + +Jann-Ole Henningsson1 + +Marcus Magnor1 + +1 Computer Graphics Lab, TU Braunschweig, Germany {lastname}@graphics.tu-bs.de + +2 Max Planck Institute for Informatics, Saarland Informatics Campus, Germany {lastname}@mpi-inf.mpg.de + +![](images/60ebbd3d664ce4ab37bf4e2f3839be68134e2193539e1aeca2943c3de974b630.jpg) +Input skeleton (A) + +![](images/2681b525ed05c218678295ae7c03e9023c8b1050345371df86ffae1f172253a5.jpg) +Estimated shape (B) +Figure 1. Our human motion transfer framework translates 2D pose skeletons (A) to photorealistic images (D) by explicitly estimating the actor's 2D shape (B) and internal structure of clothing (C), enabling direct deformation handling and support of high-frequency details such as wrinkles and shadows. + +![](images/b7fedf7e8fea18f94383c9e3b61851bb47e65f18330423a1e37293a5a0f6aadd.jpg) +Estimated clothing structure (C) + +![](images/cee97b77738083ce1522793f6eb3c4bbe12eacc9a3a2712386d3fc322627fdd9.jpg) + +![](images/78a593d3e5565c96c8e574f976dabc6a1fd8c151ff7fb444888612baaed8a0c6.jpg) + +![](images/bf6e345da61ea98d89505dd028e8c133d5887ef21594b77c3b2ceaf1c2d6d338.jpg) +Final rendering (D) + +![](images/4db255ec674519023df48a03db1226218e1eb614611dce2b3370feb95f71d579.jpg) + +# Abstract + +Video-based human motion transfer creates video animations of humans following a source motion. Current methods show remarkable results for tightly-clad subjects. However, the lack of temporally consistent handling of plausible clothing dynamics, including fine and high-frequency details, significantly limits the attainable visual quality. We address these limitations for the first time in the literature and present a new framework which performs high-fidelity and temporally-consistent human motion transfer with natural pose-dependent non-rigid deformations, for several types of loose garments. In contrast to the previous techniques, we perform image generation in three subsequent stages: synthesizing human shape, structure, and appearance. Given a monocular RGB video of an actor, we train a stack of recurrent deep neural networks that generate these intermediate representations from 2D poses and their temporal derivatives. Splitting the difficult motion transfer problem into subtasks that are aware of the temporal motion context helps us to synthesize results with plausible dynamics and pose-dependent detail. It also allows artistic control of results by manipulation of individual framework stages. In the experimental results, we significantly outperform the state-of-the-art in terms of video realism. The source code is available at https://graphics.tu-bs.de/publications/kappel2020high-fidelity. + +# 1. Introduction + +Human motion transfer methods, also known as performance cloning or reenactment methods, can generate real- + +istic video animations of an actor following a target motion specified by a user. This has several applications in AR/VR and video editing. Building upon new advances in machine learning, current motion transfer methods tackle this challenging problem by learning a direct mapping between an actor-independent motion space and the resulting target actor's appearance space. These methods often require a training video of an actor performing a rich set of motions [2, 5, 17, 19, 27, 33]. + +Some recent motion transfer approaches parameterize motion as skeletal pose sequences that can be computed from videos with off-the-shelf pose detectors [5, 27]. Others use pre-captured template meshes or parameterized body models to provide additional guidance to the synthesis step [17, 19]. Acquisition of such templates [17], however, requires an extensive structure-from-motion reconstruction of the static target actor under constant lighting. Furthermore, existing human motion transfer approaches are likely to produce notable temporal and spatial artifacts when actors wear loose clothing, such as dresses, skirts and hoodies [2, 5, 19, 33]. On such garments, they struggle to realistically reproduce the appearance of fine-scale details like folds and wrinkles, as well as plausible dynamics. + +In this paper, we present a new human motion transfer framework that generates visually plausible video animations of humans that are spatially and temporally coherent, and show natural dynamics, even for actors wearing loose garments (see Fig. 1). Given a single monocular video of an actor performing a rich set of motions, we train a stack of deep generative networks to learn a mapping from 2D pose to a silhouette with semantic part labels, and per-pixel + +appearance of the actor. We model the person's shape as a dense foreground silhouette mask with per-pixel labels encoding assignment to limbs and garments. We further encode the structure of wrinkles and texture patterns of garments as the orientation and strength of local image gradients. We extract this structure from images using a bank of oriented filter kernels [23, 31]. Encoding the actor's appearance with these explicitly decoupled intermediate representations of silhouette and structure is key to enhance the temporal and spatial quality of synthesized videos comprising human actors in loose clothing. + +Our method improves over current motion transfer approaches in terms of visual fidelity using a single RGB camera. Furthermore, our representation provides an additional level of control over the final image generation. For example, for the same overall dynamic geometric outline (i.e., the same garment geometry), color and appearance, including fold and wrinkle style, can be manipulated in a purely image-based way. Overall, our contributions can be summarized as follows: (1) A new motion transfer framework with an emphasis on visually-plausible fine-scale deformations and dynamics in the actor's clothing. (2) For this, we propose to decompose the pose-to-image translation task into better conditioned cascaded processes, where the final appearance is conditioned on the predicted shape outline and internal structure of the clothing. (3) We show that our intermediate representations do not only help to provide more temporally coherent conditioning resulting in more appealing image synthesis, but also allow controlling individual aspects of the final rendering (e.g., enhance wrinkles and transfer the clothing style). + +# 2. Related Work + +Apart from general-purpose image-translation techniques which can be used for novel human view synthesis [2, 12, 32, 33, 37], most specialized techniques can be classified into still image-based [8, 21, 22, 25, 28] or video-based [1, 5, 7, 9, 17, 18, 19]. Pix2pix [12] is one of the most recognized general-purpose image translation techniques in the literature. Other image-to-image translation variants include pix2pixHD [33] for processing high-resolution images, Zhu et al. [37] for learning from unpaired data, and Wang et al. [32] for video processing. The work of Bansal et al. [2] learns a mapping from unpaired video data with a focus on processing temporal information. While general-purpose image-to-image translation techniques [2, 12, 32, 33, 37] can in principle be applied in our scenario, their visual accuracy usually suffers from multiple types of artifacts such as spurious details (e.g., jittering texture details), unnatural deformations, and temporal inconsistency, among others. + +Neural human motion transfer methods are specifically designed to generate novel views of a person observed in a + +single RGB image. Still-image-based approaches [7, 8, 21, 22, 25, 28] focus is different from the problem we solve. Their focus is on re-targeting a person in just a still image and do not produce temporally consistent and visually pleasing video results. Video-based human motion transfer techniques [1, 5, 9, 17, 18, 19], however, focus on producing video results by handling temporal information. Aberman et al. [1] combine a skeleton representation with an image-translation network for human performance cloning. Additionally, they introduce an actor-independent training branch for unpaired data to enlarge the set of representable poses. Recently, Chan et al. [5] introduced a translation method for human bodies using an intermediate, subject independent pose representation. Inspired by pix2pix [12], they learn a pose-to-appearance mapping from video clips of target identities for human performance transfer. To improve temporal consistency and overall image quality, they include a temporal discriminator and dedicated face prediction network. While their method produces visually appealing results, it frequently generates unnatural and inconsistent deformations and texture details for loose clothing, as it is underconstrained from 2D pose keypoints. + +Some video-based techniques aim to improve temporal and spatial fidelity by incorporating 3D information through human body meshes [9, 17, 18, 19]. L. Liu et al. [17, 18] presented high-quality human reenactments. As a proxy, they use an explicitly rigged, textured and skinned 3D model of the target actor. The underlying deformation model, however, does not allow to capture small wrinkles and local deformations. W. Liu et al. [19] use a human mesh recovery technique to disentangle poses from shapes as well as a correspondence map for human appearance transfer and novel view synthesis. They propagate input information both in the image and feature space and advocate a warping-based module for the enhanced preservation of the source information. Along the same lines is the work of Guan et al. [9] for human action transfer. It shows generalization to different target persons without retraining, thanks to a texture extraction method and a parametric human body model. However, the resolution of the supported renderings does not capture fine details and wrinkles. Textured Neural Avatars [27] can be trained for rendering a target actor in tight clothes in arbitrary body and camera poses. Proceeding from monocular videos with extracted 3D poses and regions of interest (human bodies), they train a convolutional neural network to predict a dense UV-map under a given target pose. Explicit decoupling of the geometry and texture results in higher visual quality and temporal consistency; yet, the overall representation is still comparably coarse and lacks fine details as well as local pose-dependent deformations and shading. Thus, no body renderings with loose clothes are demonstrated. While mesh-based techniques impose stronger human shape priors for higher qual + +![](images/10b14e8b9f51a5c1c00a26a3853102d306ada6ddc7d8d3e21ff31e8ea028f06b.jpg) +Figure 2. Framework Overview: Our framework synthesizes new output views of humans from a static background image and a pose input sequence extracted from the target (training) or source (testing) image sequence. Therefore, we apply two consecutive networks to explicitly pre-estimate human body parsing (yellow) and the internal gradient structure of clothing (green). The resulting outputs are used to condition final image generation, which is separated into the foreground (blue) and global (red) components to handle loose clothing in a temporally coherent way. Dashed lines indicate recurrent networks that feedback the last output to generate the next prediction. + +ity results, they often assume water-tight clothing and a pre-captured template of the examined subject [9, 17, 18, 27]. This can lead to difficulties in capturing loosely-swinging garments or fine pose-dependent deformations. Furthermore, getting access to pre-captured templates can lead to additional assumptions about the scene (e.g., that the target actor has to stay still for rigid structure-from-motion and brightness consistency for feature point matching) [17, 18]. + +# 3. Method + +Our framework $G_{\theta}$ generates photorealistic videos of a target actor mimicking the motion of another source identity. Given only a single monocular RGB image sequence $I = (i_n)_{n=1}^N \in \mathbb{R}^{N \times 3 \times h \times w}$ containing $N$ frames of width $w$ and height $h$ showing a target actor performing a rich set of motions, we extract an identity-independent 2D skeletal pose $P(i_n)$ for each frame and fit the network parameters $\theta$ to approximate the inverse mapping $P^{-1}$ back to the original frames. Instead of performing the translation task within a single network, our framework can be thought of as a function composition of four generative neural networks $(G_{ref}, G_{app}, G_{str}, G_{shp})$ executed in a cascade fashion to progressively generate higher-level representations, as illustrated in Fig. 2. Next, we describe all individual framework components (Secs. 3.1-3.3), before providing details on the network architectures and implementation (Sec. 3.4). + +# 3.1. Inputs + +As inputs, our method takes the target image sequence $I$ and a static image of the scene background $b \in \mathbb{R}^{3 \times h \times w}$ + +that is fused with the synthesized actor later on. From the given image sequence, we extract actor-independent pose representations $P: \mathbb{R}^{3 \times h \times w} \to H \times D$ , where $H = \{0,1\}^{C_1 \times h \times w}$ symbolizes the set of rasterized binary pose skeletons with $C_1$ input channels, and $D = \mathbb{R}^{C_2 \times h \times w}$ is the set of temporal derivatives for a single pose consisting of $C_2$ channels. Similar to recent performance cloning methods [5, 27], we apply an off-the-shelf pose estimator [3, 29, 35] that predicts 2D keypoints $k_n \in \mathbb{R}^{127 \times 2}$ for the body (including hands and face), to generate the skeleton $h_n \in H$ by connecting adjacent keypoints via binary lines. We further distribute $C_1 = 9$ limbs (face, head, torso, arms, legs, hands) over multiple channels, which helps the networks to distinguish between overlapping or symmetrical body parts. + +However, estimating soft body deformations from a single pose remains highly ambiguous as the states depend on the temporal order of poses. Thus, we calculate a temporal pose context $d_{n} \in D$ as the first and second temporal derivatives of $k_{n}$ with respect to the image index $n$ in $x$ and $y$ direction, respectively $(C_2 = 2\cdot 2\cdot 9)$ , similar to velocities and accelerations in classical dynamics simulation: + +$$ +k _ {n} ^ {\prime} = \left(\frac {\partial k _ {n}}{\partial n}, \frac {\partial^ {2} k _ {n}}{\partial n ^ {2}}\right). \tag {1} +$$ + +We create rasterizations $d_{n}$ from $k_{n}^{\prime}$ in the same way as for the pose skeletons, and linearly interpolate their values along the bones, similar to the depth representation of Shysheya et al. [27]. During the reenactment, we apply the same procedure to the source image sequence, but additionally perform pose normalization as described by Chan et + +al. [5] for inter-target appearance transfer before drawing the skeletons. Finally, our pose conditioning $P(i_{n}) = (h_{n},d_{n})$ is provided to our framework as the concatenation of the frame-wise pose skeleton and temporal context. We find that the described procedure results in a compact, yet expressive pose representation, while slightly outperforming a simple sliding window approach in our experiments. + +# 3.2. Garment Conditioning + +In our framework, we use two dedicated networks that pre-estimate the actor's shape and the internal gradient structure of clothing in 2D space to improve the consistent modeling of deforming garments and the fall of the folds. + +# 3.2.1 Shape Estimator + +As a first step, our shape estimator $G_{shp}$ transforms the provided pose representations $P$ into the actor's current silhouette + +$$ +\tilde {s} _ {n} ^ {*} = \boldsymbol {G} _ {\boldsymbol {s h p}} (\boldsymbol {P} (i _ {n}), \tilde {s} _ {n - 1} ^ {*}), \tag {2} +$$ + +where $\tilde{s}_i^* \in \mathbb{R}^{j \times h \times w}$ is represented as semantic body-part segmentation with $j$ labels. We extract a final segmentation mask $\tilde{s}_n \in ([\mathbb{N}]_1^j)^{h \times w}$ from our network by extracting the indices of maximum elements per pixel over the channel dimension. + +As knowledge about the preceding shape is necessary to achieve temporal coherence of deforming garments, we design our networks in a recurrent fashion where each execution is conditioned on the previous output. Thus, $G_{shp}$ is tasked to estimate a delta in the observed shape based on the current pose and the contextual temporal derivatives. The resulting segmentation mask is a significant prior for the final appearance network to produce visually-plausible renderings, and it is further used to segment the actor and parts of their clothing in later stages. For training, we use the human parsing method of Li et al. [15] trained on the ATR dataset [16] to extract pseudo-ground-truth segmentation maps $S = (s_n)_{n=1}^n$ from $I$ . This dataset provides $j = 18$ labels for all body limbs and common clothing, enabling our method to handle various clothing styles including shirts, pants, skirts, dresses and scarfs. We formulate our shape training loss $L_{shp}$ as the cross-entropy between the network prediction and the training label: + +$$ +\boldsymbol {L} _ {\boldsymbol {s h p}} = \mathbb {E} _ {n \sim N} \log \left(\sum_ {j} \exp \left(\tilde {s} _ {n} ^ {*} (j)\right)\right) - \tilde {s} _ {n} ^ {*} (s), \tag {3} +$$ + +where $\tilde{s}_n^* (j)$ is the output channel for a given label $j$ + +# 3.2.2 Structure Estimator + +While our shape representation is sufficient prior to infer the appearance of solid body parts like arms and faces, it does + +not provide information about wrinkles and folds within the clothing, that are needed to generate temporally consistent shading and texture patterns. Thus, we apply a second recurrent network $G_{str}$ that estimates the internal gradient structure $\tilde{w}_n \in \mathbb{R}^{2 \times h \times w}$ for clothing regions as indicated by the segmentation map $\tilde{s}_n$ : + +$$ +\tilde {w} _ {n} = \boldsymbol {G} _ {\boldsymbol {s t r}} (\boldsymbol {P} (i _ {n}), \tilde {s} _ {n}, \tilde {w} _ {n - 1}). \tag {4} +$$ + +We model the clothing structure as the pixelwise gradient direction and strength extracted from the responses of 32 oriented Gabor filters, similar to recent work on neural hair synthesis [31]. However, as a floating garment comprises sparser gradients than human hair, we do not only use the maximum filter responses to smooth the angle field, but append a normalized version to the smoothed gradient directions to model the probability of a wrinkle or texture change at a specific location, as visualized in Fig. 1 (color and saturation encode the gradient direction and the strength, respectively). We train the structure estimator using the $L_{1}$ distance between estimated $\tilde{w}_{n}$ and ground-truth $w_{n}$ structure using a mask for garment labels extracted from $\tilde{s}_n$ : + +$$ +\boldsymbol {L} _ {\boldsymbol {s t r}} = \mathbb {E} _ {n \sim N} \chi_ {C} (\tilde {s} _ {n}) | \tilde {w} _ {n} - w _ {n} |, \tag {5} +$$ + +where $C$ denotes the set of segmentation labels corresponding to the actor's clothing, and $\chi_C$ is the indicator function: + +$$ +\chi_ {C} (x) = \left\{ \begin{array}{l l} 1, & \text {i f} x \in C, \\ 0, & \text {e l s e .} \end{array} \right. \tag {6} +$$ + +# 3.3. Image Synthesis + +The second stage of our framework synthesizes the final output image based on the provided pose and garment conditionings. Again, we use two dedicated networks to independently generate the actor in the foreground and fuse it with the provided background image. + +# 3.3.1 Appearance Network + +Our first rendering network $G_{app}$ takes provided pose as well as the pre-estimated shape $\tilde{s}$ and internal clothing structure $\tilde{W}$ to synthesize the actor's appearance $\tilde{f}_n \in \mathbb{R}^{3 \times h \times w}$ : + +$$ +\tilde {f} _ {n} = \boldsymbol {G} _ {\boldsymbol {a p p}} (\boldsymbol {P} (i _ {n}), \tilde {s} _ {n}, \tilde {w} _ {n}). \tag {7} +$$ + +We train the appearance module using a combination of $L_{1}$ distance and perceptual reconstruction loss [13]. Again, an indicator function $\chi_{B}$ is used to mask the foreground pixels that are not assigned to the background label $\beta$ : + +$$ +\chi_ {B} (x) = \left\{ \begin{array}{l l} 0, & \text {i f} x = \beta , \\ 1, & \text {e l s e .} \end{array} \right. \tag {8} +$$ + +Thus, our appearance loss $L_{app}$ reads + +$$ +\boldsymbol {L} _ {\boldsymbol {a p p}} = \mathbb {E} _ {n \sim N} \chi_ {B} (\tilde {s} _ {n}) \left(\lambda_ {r} | \tilde {f} _ {n} - i _ {n} | + \lambda_ {p} | \phi (\tilde {f} _ {n}) - \phi (i _ {n}) |\right) \tag {9} +$$ + +where $\phi (\cdot)$ denotes feature maps extracted from different layers of a pre-trained VGG19 network [30], and $\lambda_r,\lambda_p$ are free hyperparameters for weighting. + +# 3.3.2 Refinement Network + +Finally, we apply a shallow refinement network to fuse the foreground prediction with the provided scene background. For this, we first paste the generated foreground $\tilde{f}_n$ onto the static background image $b$ using the masking function (8): + +$$ +\tilde {i} _ {n} ^ {*} = \left(\chi_ {B} (\tilde {s} _ {n}) \cdot \tilde {f} _ {n}\right) + \left((1 - \chi_ {B} (\tilde {s} _ {n})) \cdot b\right). \qquad (1 0) +$$ + +Then, given foreground-background composition $\tilde{i}_n^*$ and actor segmentation $\tilde{s}_n$ , our refinement network $G_{ref}$ performs simple transition smoothing and shadow generation to produce the final output image $\tilde{i}_n$ : + +$$ +\tilde {i} _ {n} = \boldsymbol {G} _ {\boldsymbol {r e f}} \left(\tilde {i} _ {n} ^ {*}, \tilde {s} _ {n}\right). \tag {11} +$$ + +We use a combination of structural and perceptual losses similar to our $L_{app}$ (9), but over the entire image plane: + +$$ +\boldsymbol {L} _ {\text {r e f}} = \mathbb {E} _ {n \sim N} \lambda_ {r} | \tilde {i} _ {n} - i _ {n} | + \lambda_ {p} | \phi (\tilde {i} _ {n}) - \phi (i _ {n}) |. \tag {12} +$$ + +In contrast to recent pose-to-video translation methods [1, 5], we do not apply an adversarial loss for our generator network as we do not want to hallucinate high frequency details in the clothing based on statistics from the data sequence $I$ , but rather encourage the network to stick to the predicted structure layout. + +# 3.4. Implementation Details + +We implement our framework in Python using PyTorch 1.5 [24]. Our four translation networks employ the local Pix2PixHD [33] generator architecture; we halve the number of residual blocks in our refinement network $G_{ref}$ due to the similarity of the domains. We optimize our final loss + +$$ +\boldsymbol {L} _ {\text {t o t a l}} = \lambda_ {1} \boldsymbol {L} _ {\text {s e g}} + \lambda_ {2} \boldsymbol {L} _ {\text {s t r}} + \lambda_ {3} \boldsymbol {L} _ {\text {a p p}} + \lambda_ {4} \boldsymbol {L} _ {\text {r e f}} \tag {13} +$$ + +with hyperparameters $(\lambda_{1} = 0.5, \lambda_{2,3,4} = 1.0, \lambda_{r} = 0.1, \lambda_{p} = 0.9)$ in a sequential way for 30 epochs using Adam optimization [14] (momentum $\beta_{1} = 0.999$ and $\beta_{2} = 0.5$ ). On a single Quadro RTX 8000 GPU, training converges after approximately four days for $N \approx 23K$ frames, while processing a single testing-frame takes $\sim 280$ milliseconds at a resolution of $512 \times 512$ pixels. For more details, please refer to our official implementation and supplementary material. + +# 4. Experiments + +We compare our framework to several state-of-the-art approaches with subjects wearing different types of loose clothing with rich wrinkling and textures (Sec. 4.2), conduct a user study (Sec. 4.3) and perform an ablation study for individual framework stages (Sec. 4.4). Since our results improve upon the temporal consistency and fine texture details, they are best viewed in our supplementary video. + +# 4.1. Datasets, Methods and Metrics + +Existing datasets for the evaluation of recent appearance transfer methods usually comprise actors in monochromatic body-tight clothing, as loose garments are a frequent cause of visual artifacts and temporal irregularities. For our experiments, we capture new sequences of three subjects, each in up to three clothing styles with a length of seven to ten minutes at a resolution of $512 \times 512$ pixels, and select the last $5\%$ of the frames for testing. Our dataset features various clothing styles including jeans, loose t-shirts, hoodies, and two dresses with rich wrinkle and texture patterns. + +We compare our framework to current video-based appearance transfer approaches, i.e., a general-purpose pix2pixHD network [33] that synthesizes an image from a rendering of the extracted pose, the Everybody-Dance-Now (EDN) method by Chan et al. [5], which adds a temporal discriminator and specialized face GAN, and RecycleGAN [2] that performs direct unsupervised retargeting between two videos. Additionally, we test our approach on the dataset of Liu et al. [17] comprising various actors in tight clothes. All results were generated using either the official implementations or data directly provided by the authors. Moreover, we have explored pose editing using NHRR [25] and Liquid Warping GAN [19] but the results showed poor visual quality on our sequences. Kindly note that these methods predict pixel correspondences to the SMPL mesh [20] using DensePose [10], and hence struggle with handling loose clothes. We provide exemplary results showing limitations of mesh-based approaches in our supplementary material. Furthermore, the code of Textured Neural Avatars [27] is, unfortunately, not publicly available, and we were not able to obtain results on our sequences directly from the authors. For quantitative analysis, we utilize the widely-used SSIM [34], LPIPS [36] and FID [11] metrics that assess the pixel-space structural similarity, perceptual distance based on neural network features, and the Fréchet distance between two data collections, respectively. + +# 4.2. Results and Comparisons + +We show exemplary results of every network component in Fig. 3. As can be seen, our framework is capable of estimating pronounced body part segmentations, the corresponding wrinkle patterns and resulting target actor appear + +![](images/e78ba5cc913d0d71c396a8049e657369c35a0ec88ea944f55ec5b5ea16b35794.jpg) +Figure 3. Exemplary results of our motion transfer framework. The first column of each block illustrates the driving sequence, while the last one shows the final result. They anchor the outputs for the different intermediate networks (shape, structure, and appearance). For clothing gradient structure, we encode the direction and confidence as color and saturation, respectively, similar to optical flow visualization. + +![](images/f8ee2a2d36e385d3f06368285b05ba275fa5ba9afe03a1dc5ec08a856a6b1736.jpg) + +![](images/142e3e40152505979a424d0441c8f148f7fdb243253e955acdbc173c909a4589.jpg) + +![](images/6a204f4e5351b7768da5d66bb9dd040f492bc4af1907f049c3bbbc469eb2e466.jpg) + +![](images/72e72aff7069058a82140c9a052080f379f9dec92a5463567e1e4ead1541494a.jpg) + +![](images/968dc1c9a425112c25396870c2095fb1330b956fec54e8cf851b59a858e99b34.jpg) + +![](images/93a13a55a2d4f1bf495d5e2fffd854d3851861fe17570d6ecd32f5a015bb89de.jpg) + +![](images/38f940d2574f9a7dbe96fe4c98bff039dd30107c70bfe1a63e3337ceb9d534e7.jpg) + +![](images/895ba88848f8c434ab221901d1f9f2728ba150e42fe175120c83eb600ecc0937.jpg) + +![](images/71ca20ba13146d24d0128ad03e1c6171c88a2f2874a182c469642d6b5f92c817.jpg) + +ance for all types of complex clothing in our dataset, independent of the source actor's posture or appearance. We further compare our method to recent state-of-the-art approaches in Fig. 4. Therefore, we use a bidirectional reenactment scenario with two different types of clothing, i.e., a loose monochromatic t-shirt with jeans, and a dress featuring a delicate arrangement of folds. While all of the tested methods are able to produce strong wrinkle patterns, our framework manages to achieve the most plausible temporal and spatial results due to the explicit handling of deforming garments. Please note that the temporal consistency can only be evaluated by watching our supplemental video. Also, we provide results and comparisons on the video sequences of Liu et al. [17] in our supplemental material. + +We further assess the visual quality by numerically comparing our method to related pose-to-video translation approaches in Table 1. To calculate the metrics, we employ the target actor sequences shown in the first column of Fig. 4 using the corresponding self-reenactment scenarios, where ground-truth images are available from the testing sets. Recycle-GAN [2] focuses on learning from unpaired data and is upper-bounded by paired translation techniques + +
Metricpix2pixHD [33]EdN [5]ours
SSIM [34]↑0.92880.90430.9358
LPIPS [36]↓0.04010.03030.0289
FID [11]↓21.772413.542117.9573
+ +Table 1. Quantitative comparison to related methods. We assess the quantitative quality according to SSIM, LPIPS and FID metrics in a self-reenactment scenario. + +when trained on paired data. Hence, we exclude it from our quantitative analysis. Our method outperforms the current state of the art according to the SSIM and LPIPS metrics, which perform a direct structural and perceptual comparison on a per-frame basis, indicating that the physical behaviour of clothing synthesized by our method better reflects ground truth. On the other hand, FID states that the pixel distribution generated by EDN is closer to the training set, presumably due to strong adversarial losses. + +# 4.3. Perceptual Experiment + +We find that quantitative metrics do not reveal all aspects of the visual video quality, and complement our evaluation by two user studies in which videos are graded according to human perception. We compare our method against recent image-based techniques using the video sequences shown in Fig. 4, including wide clothes with significant deformations. We also conduct an additional experiment on the dataset of Liu et al. [17] to evaluate on videos of actors in tight clothes. In both studies, we show the participants video reenactments of $\sim 20$ seconds in length with results of two methods at a time and ask them which video looks the most realistic. To measure both the performance of each method and the agreement between participants, we follow the linked-paired comparison design [6]. We rank each method according to the number of times they are preferred over the rest and perform a significance test of the votes differences [4, 26]. The total number of votes a method received in each experiment is displayed in Table 2. As can be seen, our method significantly outperforms recent image-based pose-to-video-translation methods in terms of video + +![](images/f995cfe4ae883f052b9eef014208933150ad9dfd451b83d271c751df595e631b.jpg) +Figure 4. Comparison to state-of-the-art motion transfer methods. We compare our method against pix2pixHD [33], EDN [5] and Recycle-GAN [2] on two sequences of an actress in a loose t-shirt and a dress. Please note that results of Recycle-GAN are only available at half of the original resolution, as training on full resolution produced highly implausible results. + +realism for the clothing and is even preferred over RecycleGAN, which uses a richer input domain for motion transfer. Our second experiment on the dataset of Liu et al. [17] further confirms that our monocular video-based approach also achieves considerably more realistic results than the related EDN method when exchanging motion between actors in tight clothing. However, in that scenario, image-based approaches cannot quite reach the quality of priors provided by expensively recorded template meshes, which excel for tight and static shapes (Liu et al. [17]). We provide more details on the experimental setup and evaluation in our supplementary material. + +# 4.4. Ablation Study + +We next conduct an ablation study to assess the influence of different framework components. Therefore, we retrain our method on one of our most challenging sequences featuring a swinging dress with complicated texture patterns, while incrementally dropping the garment conditioning net + +
Exp.MethodInput#VotesRanking
1OursVideo (Pose)2571
Recycle-GAN [2]Video (RGB)1942
EDN [5]Video (Pose)1433
pix2pixHD [33]Video (Pose)544
2Liu [17]Textured mesh + Video (Pose)1031
OursVideo (Pose)762
EDN [5]Video (Pose)133
+ +![](images/6b2af534412d18487cca3893f5a1c4e74341f02886cfbef945f0657e53cb82fc.jpg) +Figure 5. Ablation study evaluating the influence of our framework stages in a self-reenactment scenario. For an exemplary ground-truth frame, we show a plain appearance network conditioned on pose only (P), pose and shape (PS), and our full framework without (PSS-R) and with (PSS/ours) temporal recurrence. + +works. In our study, we consider four framework variations, i.e., the plain appearance network without additional inputs (P), the appearance conditioned on our shape estimates (PS) and our full framework including the internal structure (PSS/ours); additionally, we examine the effect of removing the recurrent back-feeding from all network modules (PSS-R). As shown in Fig. 5, we find that every component contributes to improving the final image quality. + +While our plain pix2pix generator fails to produce sharp outlines of body parts and garments (P), providing a pre-estimated shape mask results in distinct transitions and more realistically-floating garments (PS). Adding information about the internal structure of the clothing further enhances the generation of high-frequency details within the given shape (PSS). This effect is also observable in quantitative evaluation using structural and perceptive metrics, as shown in Table 3. Furthermore, we observe that dropping the temporal back-feeding of previous network outputs (PSS-R)—while achieving similar quality on a per-frame basis—significantly decreases temporal consistency, as can be seen in our supplemental video. + +Table 2. Perceptual ranking of the compared methods for our user studies. Experiment 1 was conducted online with 54 participants with various backgrounds, while experiment 2 was in-situ with 16 CG/CV experts. The rankings are statistically significant. + +
MetricPPSPSS-RPSS (ours)
SSIM [34]↑0.89590.90450.90450.9046
LPIPS [36]↓0.0440.0360.0360.035
FID [11]↓15.04612.28212.92512.176
+ +Table 3. Quantitative ablation analysis according to SSIM, LPIPS and FID metrics. We compare different versions of our framework in a self-reenactment scenario. The numbers indicate that every component contributes a structural and perceptual improvement to the synthesized output. + +![](images/d8fda1e957f5f70f9a83cba64ec82e27fac222eb73c2864a75fbdb8bf13ef76f.jpg) +Figure 6. Applications: Our approach allows novel video editing through style transfer and wrinkle intensity manipulation. For style transfer, we use the source shape and/or structure while keeping the target appearance. + +![](images/61dd76b8b5f3ae58e219aa7ebd8cbab2a67f06f77be3717367d8dd5bf17f6394.jpg) + +![](images/a879852b5c63e4f96dc381a0df3e27f6f477c83c30efe6f2fc5f3b4a24a7f607.jpg) + +# 5. Application: Material Editing + +On top of high-fidelity motion transfer, our framework offers an additional level of control over the image generation, as it incorporates explicit specifications of the actor's shape and garment structure. This enables editing and manipulating the generated videos. For actors wearing similar clothing, pseudo-ground-truth segmentation or structure maps extracted from the source sequence can significantly improve the final image quality and temporal consistency. Alternatively, after training multiple subjects wearing clothing of the similar type, garment conditioning networks can be interchanged to generate clothing with new combinations of shape, structure and appearance. Furthermore, manually-edited or completely handcrafted shape and structure patterns can be used to influence the physical behavior of clothing. Fig. 6 shows two examples of automatic and manual material and appearance editing. We change the style of the actress's dress and the actor's top while keeping the original appearance by applying the shape (left), or both shape and structure, from the source sequence and feed it to the appearance network (middle). Also, magnifying the second channel of structure estimate (gradient confidence map) can be used to magnify or minify the fall of the folds during reenactment (right). While material property exchange is still currently limited to garments of comparable type or texture, the proposed approach is the first neural motion transfer method enabling controllable clothing composition for videos, which can pave the way for many applications in future (such as virtual try-on). + +# 6. Discussion and Limitations + +We have demonstrated high-fidelity results for multiple challenging human appearances with various deformation patterns of garments, and were able to manipulate several properties of the clothing during the reenactment. The ablative study has shown that all stages of our framework are justified and contribute to the final result. Although our + +method is a step forward in the neural rendering of humans, it has limitations and can provoke further research. First, the space of depictable poses is currently determined by the composition and length of the training sequences. Next, inaccuracies and missing 3D information from the pose keypoint estimator can result in incorrect occlusion maps and temporal behavior of garments. At the same time, the propagation of errors in the estimated human body parsing can lead to missing or disconnected body parts and unnatural transitions between the frames. These aspects can be improved in future by incorporating stronger constraints on the shape and body structure and enlarging the pose space by training on unpaired data. + +# 7. Conclusion + +We introduce a novel multi-stage framework for high-fidelity human motion transfer from monocular video. The tests show that our method performs qualitatively appealing motion transfer for different clothes, visually improving over previous image-based techniques. The performance is also confirmed by a comprehensive perceptual study, indicating superior temporal and visual quality compared to current image-based state-of-the-art motion transfer approaches. All in all, we conclude that explicitly handling deformations of clothing in a temporally-coherent way is crucial for high-fidelity neural human motion transfer. + +Our supplementary material contains additional details on training, our garment conditioning representation/visualization, and experiments, as well as further comparison with other techniques. The full implementation is available at our project page https://graphics.tubes.de/publications/kappel2020high-fidelity. + +Acknowledgements: This work was partially funded by the DFG (MA2555/15-1 "Immersive Digital Reality") and the ERC Consolidator Grant 4DRepLy (770784). We thank Jalees Nehvi and Navami Kairanda for helping with comparisons. + +# References + +[1] Kfir Aberman, Mingyi Shi, Jing Liao, Dani Lischinski, Baoquan Chen, and Daniel Cohen-Or. Deep video-based performance cloning. Comput. Graph. Forum, 38:219-233, 2018. +[2] Aayush Bansal, Shugao Ma, Deva Ramanan, and Yaser Sheikh. Recycle-gan: Unsupervised video retargeting. In European Conference on Computer Vision (ECCV), pages 119-135, 2018. +[3] 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 (TPAMI), 43(1):172-186, 2021. +[4] Susana Castillo, Tilke Judd, and Diego Gutierrez. Using eyetracking to assess different image retargeting methods. In Symposium on Applied Perception in Graphics and Visualization (APGV), page 7-14, 2011. +[5] Caroline Chan, Shiry Ginosar, Tinghui Zhou, and Alexei A Efros. Everybody dance now. In International Conference on Computer Vision (ICCV), 2019. +[6] Herbert Aron David. The method of paired comparisons, volume 12 of Griffin's statistical monographs & courses. Charles Griffin, London, 1 1963. +[7] Patrick Esser, Ekaterina Sutter, and Björn Ommer. A variational u-net for conditional appearance and shape generation. In Computer Vision and Pattern Recognition (CVPR), 2018. +[8] Artur Grigorev, Artem Sevastopolsky, Alexander Vakhitov, and Victor Lempitsky. Coordinate-based texture inpainting for pose-guided human image generation. In Computer Vision and Pattern Recognition (CVPR), pages 12127-12136, 2019. +[9] Shanyan Guan, Shuo Wen, Dexin Yang, Bingbing Ni, Wendong Zhang, Jun Tang, and Xiaokang Yang. Human action transfer based on 3D model reconstruction. In AAAI Conference on Artificial Intelligence, pages 8352-8359, 2019. +[10] Riza Alp Güler, Natalia Neverova, and Iasonas Kokkinos. Densepose: Dense human pose estimation in the wild. In Computer Vision and Pattern Recognition (CVPR), pages 7297-7306, 2018. +[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 Neural Information Processing Systems (NIPS), pages 6626-6637, 2017. +[12] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Computer Vision and Pattern Recognition (CVPR), pages 1125-1134, 2017. +[13] 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, 2016. +[14] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. + +[15] Peike Li, Yunqiu Xu, Yunchao Wei, and Yi Yang. Self-correction for human parsing. arXiv preprint arXiv:1910.09777, 2019. +[16] Xiaodan Liang, Si Liu, Xiaohui Shen, Jianchao Yang, Luoqi Liu, Jian Dong, Liang Lin, and Shuicheng Yan. Deep human parsing with active template regression. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(12):2402-2414, 2015. +[17] Lingjie Liu, Weipeng Xu, Marc Habermann, Michael Zollhöfer, Florian Bernard, Hyeongwoo Kim, Wenping Wang, and Christian Theobalt. Neural human video rendering by learning dynamic textures and rendering-to-video translation. IEEE Transactions on Visualization and Computer Graphics (TVCG), 2020. +[18] Lingjie Liu, Weipeng Xu, Michael Zollhoefer, Hyeongwoo Kim, Florian Bernard, Marc Habermann, Wenping Wang, and Christian Theobalt. Neural rendering and reenactment of human actor videos. ACM Transactions on Graphics (TOG), 2019. +[19] Wen Liu, Zhixin Piao, Min Jie, Wenhan Luo, Lin Ma, and Shenghua Gao. Liquid warping gan: A unified framework for human motion imitation, appearance transfer and novel view synthesis. In International Conference on Computer Vision (ICCV), 2019. +[20] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black. SMPL: A skinned multi-person linear model. ACM Trans. Graphics (Proc. SIGGRAPH Asia), 34(6):248:1-248:16, 2015. +[21] Liqian Ma, Xu Jia, Qianru Sun, Bernt Schiele, Tinne Tuytelaars, and Luc Van Gool. Pose guided person image generation. In Neural Information Processing Systems (NIPS), 2017. +[22] Liqian Ma, Qianru Sun, Stamatios Georgoulis, Luc van Gool, Bernt Schiele, and Mario Fritz. Disentangled person image generation. Computer Vision and Pattern Recognition (CVPR), 2018. +[23] Sylvain Paris, Will Chang, Oleg I. Kozhushnyan, Wojciech Jarosz, Wojciech Matusik, Matthias Zwicker, and Frédo Durand. Hair photobooth: Geometric and photometric acquisition of real hairstyles. ACM Trans. Graph., 27(3), 2008. +[24] 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 Neural Information Processing Systems (NIPS), pages 8024-8035, 2019. +[25] Kripasindhu Sarkar, Dushyant Mehta, Weipeng Xu, Vladislav Golyanik, and Christian Theobalt. Neural re- rendering of humans from a single image. In European Conference on Computer Vision (ECCV), 2020. +[26] Iwan Setyawan and Reginald L. Lagendijk. Human perception of geometric distortions in images. In Security, Steganography, and Watermarking of Multimedia Contents VI, volume 5306, pages 256 - 267, 2004. + +[27] Aliaksandra Shysheya, Egor Zakharov, Kara-Ali Aliev, Renat Bashirov, Egor Burkov, Karim Iskakov, Aleksei Ivakhnenko, Yury Malkov, Igor Pasechnik, Dmitry Ulyanov, Alexander Vakhitov, and Victor Lempitsky. Textured neural avatars. In Computer Vision and Pattern Recognition (CVPR), 2019. +[28] Aliaksandr Siarohin, Enver Sangineto, Stephane Lathuiliere, and Nicu Sebe. Deformable GANs for pose-based human image generation. In Computer Vision and Pattern Recognition (CVPR), 2018. +[29] Tomas Simon, Hanbyul Joo, Iain Matthews, and Yaser Sheikh. Hand keypoint detection in single images using multiview bootstrapping. In Computer Vision and Pattern Recognition (CVPR), 2017. +[30] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +[31] Zhentao Tan, Mengelei Chai, Dongdong Chen, Jing Liao, Qi Chu, Lu Yuan, Sergey Tulyakov, and Nenghai Yu. Michigan: multi-input-conditioned hair image generation for portrait editing. ACM Transactions on Graphics (TOG), 39(4):95-1, 2020. +[32] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. In Neural Information Processing Systems (NIPS), pages 1152-1164, 2018. +[33] 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 Computer Vision and Pattern Recognition (CVPR), 2018. +[34] 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. +[35] Shih-En Wei, Varun Ramakrishna, Takeo Kanade, and Yaser Sheikh. Convolutional pose machines. In Computer Vision and Pattern Recognition (CVPR), 2016. +[36] Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Computer Vision and Pattern Recognition (CVPR), 2018. +[37] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In International Conference on Computer Vision (ICCV), 2017. \ No newline at end of file diff --git a/highfidelityneuralhumanmotiontransferfrommonocularvideo/images.zip b/highfidelityneuralhumanmotiontransferfrommonocularvideo/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc70daf7f0b6f57841d7c3e3d2af776dddbaca26 --- /dev/null +++ b/highfidelityneuralhumanmotiontransferfrommonocularvideo/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aff3fc9c929d78d3ddeb3343ee32883d038035c3c45b284e6b5bc354c50159da +size 499643 diff --git a/highfidelityneuralhumanmotiontransferfrommonocularvideo/layout.json b/highfidelityneuralhumanmotiontransferfrommonocularvideo/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4d2a5a64ffb7a93d0f8c5b1db42dac524ff546bc --- /dev/null +++ b/highfidelityneuralhumanmotiontransferfrommonocularvideo/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16014b48cab5d16f875e6ec653c514dd33d2ec5d023ae4c7e6ece89429ef78ef +size 364110 diff --git a/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_content_list.json b/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8ab8504d00ff3cf01fc79af4dccc8effa7c3e164 --- /dev/null +++ b/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3df8097916367cdd176245e60333fa0fdbe49705d9f5b2e286a401e73f400ca7 +size 76059 diff --git a/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_model.json b/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a0147d96ce1f62bd950c93d64acac6f8f2d9e173 --- /dev/null +++ b/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:515c00d4fbc3920da5e2c22b11a51ee8bb9efd1dcb8938c96229f03792d01c20 +size 90760 diff --git a/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_origin.pdf b/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f6b07e1c0a2f647410b5759e025677120eb6aa9b --- /dev/null +++ b/highqualitystereoimagerestorationfromdoublerefraction/c8b24fe7-9dd0-4e5e-97c5-801eb2efc526_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac26e4070c3b745f61b245bb6060be77dd198b7125aad25b3aaa82ca72d3726d +size 3299006 diff --git a/highqualitystereoimagerestorationfromdoublerefraction/full.md b/highqualitystereoimagerestorationfromdoublerefraction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..07f248c28ebbcc61286869e7d6f48913f134fc42 --- /dev/null +++ b/highqualitystereoimagerestorationfromdoublerefraction/full.md @@ -0,0 +1,347 @@ +# High-Quality Stereo Image Restoration from Double Refraction + +Hakyeong Kim + +Andreas Meuleman + +Daniel S. Jeon + +Min H. Kim + +KAIST + +# Abstract + +Single-shot monocular birefractive stereo methods have been used for estimating sparse depth from double refraction over edges. They also obtain an ordinary-ray (o-ray) image concurrently or subsequently through additional post-processing of depth densification and deconvolution. However, when an extraordinary-ray (e-ray) image is restored to acquire stereo images, the existing methods suffer from very severe restoration artifacts due to a low signal-to-noise ratio of input e-ray image or depth/deconvolution errors. In this work, we present a novel stereo image restoration network that can restore stereo images directly from a double-refraction image. First, we built a physically faithful birefractive stereo imaging dataset by simulating the double refraction phenomenon with existing RGB-D datasets. Second, we formulated a joint stereo restoration problem that accounts for not only geometric relation between o/e-ray images but also joint optimization of restoring both stereo images. We trained our model with our birefractive image dataset in an end-to-end manner. Our model restores high-quality stereo images directly from double refraction in real-time, enabling high-quality stereo video using a monocular camera. Our method also allows us to estimate dense depth maps from stereo images using a conventional stereo method. We evaluate the performance of our method experimentally and synthetically with the ground truth. Results validate that our stereo image restoration network outperforms the existing methods with high accuracy. We demonstrate several image-editing applications using our high-quality stereo images and dense depth maps. + +# 1. Introduction + +Double refraction occurs by birefringence, an optical property of anisotropic, transmissive materials, where an incident ray is split into two rays: ordinary ray (o-ray) and extraordinary ray (e-ray). A double-refraction image is a superimposed image caused by the refracted o-ray and e-ray placed on the same image with displacement (see Figure 1 + +![](images/7facc26038f596d33fd7ca3e1bbcf174e0436f84e748538bc6319f4475e61b48.jpg) + +![](images/a674c4a887b0df1041d02225208d37a2dcb3779c538659829cc5e4df793a4377.jpg) +b) O-ray image closeup (PSNR: 40.80 dB, SSIM: 0.99) + +![](images/6e8077247b2c0d9a9807809a06d1f89b51a5fb6cd93668e46ea8b9f7693feff1.jpg) +c) E-ray image closeup (PSNR: 36.90 dB, SSIM: 0.98) + +![](images/bf72aa6e836bff24f5926ad16f31b3cf5bcb696d98281f3d0a0251480c7d296a.jpg) +(a) Double-refraction input image +(d) Dense depth result + +![](images/f6d11701258e2135b1908d953ecea67e57fd67082457d945c6339cf6f8a04815.jpg) +O-ray image result +Figure 1: (a) an input double-refraction image, (b) an o-ray image result, (c) an e-ray result, (d) a dense disparity map estimated from our stereo images. Compared to ground truth, PSNRs and SSIMs of the entire o-/e-ray images are $40.80 / 36.90\mathrm{dB}$ , SSIM: $0.9854 / 0.9799$ , respectively. + +![](images/7af4ef61209a13763b05d63fe29a884c9052e80e6f887baf19049dd655f975cc.jpg) +E-ray image result + +for an example). Displacement in a double-refraction image contains additional information related to depth, similar to a disparity in traditional stereo, i.e., it is inversely proportional to depth. Based on this phenomenon, single-shot monocular birefractive stereo methods [1, 12] have been developed to estimate sparse depth from double refraction over edges, achieving passive monocular 3D imaging with a small form factor. + +To obtain two stereo images from double refraction, there are two different ways in the existing methods. One way is to densify the sparse depth map with a diffusion method [10] and then deconvolve the input double-refraction image with different point spread functions (PSFs) for each depth [1]. The resulting quality depends on the accuracy of per-pixel depth. Ringing artifacts of deconvolution often occur, degrading the image quality of the restored images. Another way is to subtract the restored o-ray image from the input double-refraction image and then recover its scale [12]. This approach restores an e-ray image from uneven double refraction. Still, the signal-to-noise ratio (SNR) of the input e-ray image is inherently low in an uneven double refraction image [12]. Even though the restored o-ray image is sharp, the e-ray image suffers from + +severe noise, and also some restoration errors in the o-ray image are inherited from the e-ray image. Earlier birefractive imaging solutions mainly focus on acquiring the depth information and the ordinary-ray image only. None of the existing works can restore stereo images from a double-refraction image with high quality yet. + +Different from the existing works, we focus on stereo image restoration directly from double refraction without relying on depth information. Since double refraction and displacement are geometrically related, our objective is challenging. Therefore, to mitigate the ill-posedness of our problem, we first generate a physically faithful birefractive stereo dataset from existing RGB-D datasets [14, 17] by simulating the double refraction phenomenon. Second, we formulate a joint stereo restoration problem that accounts for the geometric relation of o-ray and e-ray images to jointly infers both stereo images from double refraction with high accuracy. We train our model with our birefractive image dataset with supervised signals in an end-to-end manner. Our model can restore high-quality stereo images directly from double refraction (Figure 1a) without knowing depth information (Figures 1b and 1c). These stereo images also agree with epipolar geometry with high accuracy, allowing us to estimate dense depth with high accuracy from the restored stereo images using a conventional stereo method [3] (Figure 1d). + +Our model is computationally efficient. It takes just $\sim 227$ ms to restore two stereo images of three megapixels from input on a conventional desktop computer with a GPU. Using our network, a high-quality stereo video can be obtained directly from a double-refraction video in real-time, enabling high-quality anaglyph of 3D stereo vision using a single monocular camera. + +We evaluate the performance of our method experimentally and synthetically with the ground truth. Results validate that our stereo image restoration network outperforms the existing methods with high accuracy. We demonstrate several image-editing applications using high-quality stereo images and dense depth maps. All codes and models are published to ensure reproducibility. + +# 2. Related Work + +Birefractive Stereo. Baek et al. [1] proposed a birefractive depth acquisition method that consists of a conventional camera and a calcite crystal attached in front of the camera lens. Double refraction by the birefringent material splits the ray into two rays: o-ray and e-ray. Therefore, the birefractive stereo system's captured image is a double-layered image of the identical scene but shifted by the spatially variant disparity, which is inversely proportional to the scene depth. Baek et al. [1] proposed an image formation model of birefractive stereo and analytically computed the dispar + +ity between o-ray and e-ray to depth. Meuleman et al. [12] introduced real-time birefractive stereo imaging by attaching a linear polarizer in front of the crystal to weaken one of the polarized rays intentionally. Uneven double refraction is beneficial to relax the ambiguity of correspondence search. This work restores o-ray images with improved image quality. Based on the analysis of the relation between the attenuation coefficients of double-refraction images and the restoration quality, we also decided to use uneven double refraction as an input of our stereo restoration network. + +Image Restoration from Double Refraction. In the previous birefractive stereo methods, Baek et al. [1] recovered a clean o-ray image from a double-refraction image by formulating the problem into non-blind deconvolution. The pre-calibrated deconvolution kernel is voted using the estimated depth values. Oppositely, Meuleman et al. [12] restore the image in precedence to select the most probable disparity. In this work, we separate an overlapped two rays image into two stereo images of o-ray and e-ray without having depth information using a neural network. + +Learning-based Image Restoration. In recent years, many single image non-uniform blind deblurring algorithms have been developed by employing deep learning methodologies. Instead of estimating blur kernels per image regions and combining with non-blind deconvolution, these studies have used a convolutional neural network (CNN) to directly reconstruct sharp latent images from blurry input images with high accuracy. Network architectures used for these methods include multi-scale CNN [13], formatted residual network [5], and recurrent network [18]. While letting CNN as an end-to-end pipeline that generates latent images, studies have diversified by adopting adversarial learning [8] and supplementing a deconvolutional module that consists of recurrent neural network (RNN) [21] or deformable convolution modules [20]. However, existing works seek only a single latent image and discard residuals caused by blur. + +Some recent studies related to superimposed image separation restore two latent images from mixed images, but their input data are grounded to the reflection of background scene on a transmitted foreground scene on glass [6, 22] or mixed input of completely different scenes [4, 24]. These recent works assume that the restoration target images must have distinctive differences in image statistics. However, for double refraction images, o-ray and e-ray images are very similar to each other with subtle displacement. Due to the statistical ambiguity in the superimposed double-refraction, images of o-/e-ray cannot be restored clearly using state-of-the-art restoration networks. Instead, our method leverages the resemblance with consideration of their geometric relation of o-/e-ray. + +To the best of our knowledge, there is no network architecture that separates and restores both the latent image and + +the derivative (or by-product) from the degradation of the equivalent scene in practical applications. Therefore, we propose a novel network architecture that differs from conventional image restoration networks to restore two stereo images of o-ray and e-ray efficiently. + +# 3. Stereo Restoration from Double Refraction + +# 3.1. Double Refraction + +Image Formation Model. Birefringent material has an anisotropic optical property determined by its optical axis; it splits the light propagating directions into two by polarization. If an incoming ray has perpendicular polarization with the optical axis, the ray follows Snell's law and travels along the plane of incidence. This ray is called an ordinary ray (o-ray). Extraordinary ray (e-ray), the other ray among split rays, has parallel polarization with the optical axis. It propagates in the direction that walks off the plane of incidence, as illustrated in Figure 2(a). Therefore, each image generated by an o-ray and e-ray is the shifted image of the equivalent latent scene. Accordingly, the resulting double refraction image is in the form of overlapped underlying scenes as shown in Figure 2(b). + +The early-stage depth acquisition method from double refraction [1] employs even double refraction images. However, finding correspondence points in even double refraction has to resolve ambiguity between o-ray and e-ray, doubling the computational costs. The subsequent study [12] resolves this issue by attaching the linear polarizer in front of the birefringent material. Since o-ray and e-ray are perpendicular in polarization direction, tuning the polarity of incoming light can adjust the intensity ratio of o-ray and e-ray. When e-ray is attenuated by the attenuation ratio of $\tau$ with respect to direct ray, uneven double refraction image $\mathbf{I}_b$ is formulated as following equation: + +$$ +\mathbf {I} _ {b} = \frac {\tau}{1 + \tau} \mathbf {I} _ {e} + \frac {1}{1 + \tau} \mathbf {I} _ {o} + \mu , \tag {1} +$$ + +where $\mathbf{I}_e, \mathbf{I}_o$ and $\mu$ refers to e-ray, o-ray images and noise. + +This work adopts this uneven double refraction model for stereo image acquisition under consideration of computational cost and stability of image restoration. The former reason coincides with the objective of the previous work [12] and the latter reason comes from the problem interpretation in the aspect of image deconvolution. Double refraction image can be modeled with image convolution with spatially varying kernel $k$ , which is dependent on disparity between o-ray and e-ray $d_{oe}$ with the following equation: $\mathbf{I}_b = k(d_{oe})*\mathbf{I}_o + \mu$ . The image formulation kernel assuming the rectification is depicted in Figure 2(c). + +Since e-ray can be obtained from a spatially varying shift transformation of the o-ray image, the convolution kernel that simulates double refraction consists of two Dirac delta + +![](images/7e88fd0b5ae0e3583c95b66b10c4b654879cf165a3856b8535144496f992ff1c.jpg) +(b) Synthesized image + +![](images/083dff3c20d8b4c74d6d1a8b834b0daaa197a7b961e71d832f9fe9f87a3d9d37.jpg) +I +Figure 2: (a) Image formation by double refraction. (b) Uneven double refraction images; (left) rendered image with an attenuation ratio $\tau = 0.3$ , (right) real double-refraction image captured with a birefractive stereo camera. (c) Interpretation of double-refraction image formation as convolution. + +![](images/736759dfefc1bc1e4a59786690126e664b491ac0d4beed4254618927f15c111c.jpg) +$\mathbf{I}_o\otimes k_{d_{ox}(x_i,y_i)} = \mathbf{I}_b$ + +![](images/19ac73ab04ed99de1f4d58fbd283c7045a54baebfba13499d4e81c167ef24e41.jpg) + +![](images/ac460c51e0e8e948ef378f362f0829666ea40a848dca752b5827becac982a02d.jpg) +Real image + +![](images/0abe4aafd836280ef466451a2ef4fe3bf48042e21fd34ed3ce9cec07f0515b45.jpg) +$k_{d_{oe}(x_1,y_1)}$ + +![](images/caf53b6f08ee10f2b26bb42ea158c2f21ee2dbdba343a418015919b18b938af4.jpg) +$k_{d_{oe}(x_2,y_2)}$ + +functions that each sample the latent signals with displacement. The intensity of kernel weights is determined by the attenuation ratio $\tau$ . + +A previous study on image restoration from reflected images [19] provides an analysis of the stability of the deconvolution filter for two-layered images, whose generation kernel appears similar to the kernel of Figure 2(c). They examined the stability of their method on the varying intensity of a layered image and found that image restoration is stable when one of the layered image intensity is weakened. As such, we consider uneven double refraction is suitable for stable estimation of stereo images from uneven double refraction images. + +Depth from Birefractive Disparity. The disparity $d_{oe}$ between o-ray and e-ray is related to depth. While Baek et al. [1] maps disparity to depth $z$ with the intermediate of a hypothetical direct ray – a ray corresponding to an absence of birefractive medium -, Meuleman et al. [12] have demonstrated that a mapping from disparity to depth can be achieved solely using disparity without significant approximation. In addition, they propose a rectification that reduces the disparity-to-depth conversion to: $z = \frac{c}{d_{oe}}$ , where $c$ is a baseline constant, similarly to conventional binocular stereo. + +# 3.2. Stereo Restoration Network + +Despite the adversity on restoring attenuated rays from a super-imposed image, a recent study on visually imbalanced stereo matching [11] addresses the importance of consistent and good visual quality of a stereo image pair for ideal depth estimation. Meuleman et al. [12] report a lower value of an attenuation ratio enhances image restoration quality when restoring a strong latent signal. Alternatively, we can induce that restoring the attenuated ray is analytically difficult. + +![](images/3fc34371c13c4362a95c76e1e5424e4e7ce9180f2d038fb8219f6fac320c9202.jpg) +Figure 3: Architecture of our stereo restoration network. Refer to Section 3.2 for description of the network architecture. + +![](images/a98ebe3a9f03406c3693224c355c7ec5e7ca679e1b420393256f425d966412b6.jpg) + +To efficiently restore both o-ray and e-ray in competitive quality, we analyzed the residuals between the individual ray and double refraction signal. Derived from Equation (1), Equation (2) shows that subtraction of each ray signal from double refraction signal is proportional to the term $\mathbf{I_o} - \mathbf{I_e}$ when noise term is ignored as follows: + +$$ +\mathbf {I} _ {b} - \mathbf {I} _ {o} = \frac {\tau}{1 + \tau} \left(\mathbf {I} _ {e} - \mathbf {I} _ {o}\right), \quad \mathbf {I} _ {b} - \mathbf {I} _ {e} = \frac {1}{1 + \tau} \left(\mathbf {I} _ {o} - \mathbf {I} _ {e}\right). \tag {2} +$$ + +We design a novel stereo restoration network from the idea that successful feature extraction of the common term in Equation (2) with the supervision of strong latent signals would also aid the estimation of attenuated signals. + +Network Architecture. Based on the motivation, we designed a stereo restoration network to have one backbone network, two head networks, and two global skip connections, as shown in Figure 3. + +To train network layers to learn residuals between individual rays and double refraction, we adopt global skip connections for both head networks. Several studies have utilized global skip connections for performance enhancement in image deblurring, and restoration [20, 8]. We take advantage of global skip connection to effectively utilize our insight that the residual between o-ray and birefractive image is negatively proportional to the residual between e-ray and birefractive image. We design two types of global skip connections: one that element-wisely subtracts layer output from the input image, and the other that element-wisely adds layer output to the input image. These operations are summarized as: + +$$ +\mathbf {I} _ {b} - g \left(\mathbf {I} _ {b}\right) = \mathbf {I} _ {e}, \tag {3} +$$ + +$$ +\mathbf {I} _ {b} + \tilde {g} \left(\mathbf {I} _ {b}\right) = \mathbf {I} _ {o}, +$$ + +where $g$ and $\tilde{g}$ denotes the forward operation of the backbone network and each head networks. Since layers that estimate residual of o-ray and layers that estimate residual of e-ray shares majority of parameters by using common backbone network, both rays are jointly estimated, and negative proportionality of two CNN outputs are induced by two different types of global skip connections. + +Figure 3 illustrates the details of the network architecture. All convolutional layers in the network have a kernel size three and parametric ReLU layers for activation. The + +backbone network consists of a sequence of residual blocks. This architecture is inspired by the feature extractor of Yuan et al. [20], which uses stride convolution for downsampling instead of pooling layers. However, we do not use dilation to densely participate in neighboring pixels in feature computation while stacking more residual blocks to retain the size of receptive fields. + +The head networks upsample image resolution with transposed convolution. As $g$ and $\tilde{g}$ learn following quantities, + +$$ +\begin{array}{l} g \left(\mathbf {I} _ {b}\right) = \frac {1}{1 + \tau} \left(\mathbf {I} _ {o} - \mathbf {I} _ {e}\right) + \mu , \tag {4} \\ \tilde {g} \left(\mathbf {I} _ {b}\right) = - \frac {\tau}{1 + \tau} \left(\mathbf {I} _ {o} - \mathbf {I} _ {e}\right) - \mu , \\ \end{array} +$$ + +we allow bias in the transposed convolution layer and add a $1 \times 1$ convolution layer as the final layer. + +Loss. For prevalent usage of $l_{2}$ loss in image restoration and regression as loss metric, we adopt $l_{2}$ loss defined as $\mathcal{L}_r(\mathbf{I},\hat{\mathbf{I}}) = \| \mathbf{I} - \hat{\mathbf{I}} \|_2^2$ , where $\mathbf{I}$ and $\hat{\mathbf{I}}$ are input and restored images. However, due to the limit of $l_{2}$ loss in reconstructing images' structural details, we fine-tune the network through further training with different loss metrics after training with $l_{2}$ loss. As addressed in [23], we use mixture of $l_{1}$ loss and MS-SSIM (multi-scale structural similarity) loss $\mathcal{L}_{f}$ for better restoration quality. The loss metric is defined as: + +$$ +\mathcal {L} _ {r} (\mathbf {I}, \hat {\mathbf {I}}) = (1 - \alpha) \left\| \mathbf {I} - \hat {\mathbf {I}} \right\| _ {1} + \alpha \cdot \mathcal {L} _ {f} (\mathbf {I}, \hat {\mathbf {I}}), \tag {5} +$$ + +where the ratio is set as $\alpha = 0.84$ . We compute restoration loss between the restored ray and ground truth for both o-ray and e-ray. The total loss is the sum of restoration loss for each ray, formulated as: $\mathcal{L}_{total} = \lambda_o\mathcal{L}_r(\mathbf{I}_o,\hat{\mathbf{I}}_o) + \lambda_e\mathcal{L}_r(\mathbf{I}_e,\hat{\mathbf{I}}_e)$ , where default ratios of $\lambda_{o},\lambda_{e}$ are set as 0.5. + +Training/Test Datasets. Dataset to train and test our stereo restoration network should contain compilation of double refraction image $\mathbf{I}_b$ , e-ray $\mathbf{I}_e$ , o-ray $\mathbf{I}_o$ and disparity $d_{oe}$ between o-ray and e-ray: $D = \{\mathbf{I}_b, \mathbf{I}_o, \mathbf{I}_e, d_{oe}\}$ . Since any training dataset for birefractive stereo imaging does not exist, we synthesized a dataset with publicly available RGB-D datasets. Refer to Section 1 in the supplemental document for the technical details on how to simulate the training image dataset. + +We set the attenuation ratio $\tau$ to 0.3 on the basis of analysis on polarizer orientation by [12]. Lastly, we added gaus + +![](images/f263f92c1d71392f8d3ea87d0eaba1263548c1715eefd0d8b6bcf1ebc6540517.jpg) +Figure 4: Comparison of our image restoration results on real double refraction images captured by our birefractive stereo camera with a birefractive stereo method [12], which used the same input of uneven double refraction. Our method can provide clearer restoration results than the existing method without suffering from ringing artifacts. Inset (top right) Our real-system prototype of birefractive stereo imaging. + +sian noise with a standard deviation of 0.0005 on the synthesized double refraction images. + +We adopted the labeled NYU-Depth v2 dataset [14] for generating train samples since it provides 1449 scenes with a dense depth map. We converted given depth in meters into disparity ranging between 0 to 32. Each $640 \times 480$ size images were sliced into $256 \times 256$ size patches for training. + +We generate a test dataset with the Middlebury dataset 2014 [17]. It provides 23 high-resolution stereo image pairs of indoor scenes with ground truth disparity. We downsample images into size $2048 \times 1500$ , and warped depth from stereo disparity to disparity between o-ray and e-ray. The warped disparity ranges from 5 to 20. + +Implementation Details. Our stereo restoration network was implemented with Pytorch. We trained the network using a synthetic train dataset and Adam optimizer [7] on an NVIDIA Titan RTX GPU. We went through three phases of training to get the final model. To start, we set optimizer parameter as $\beta_{1} = 0.9$ and $\beta_{2} = 0.9$ and trained network with $l_{2}$ loss for first 100 epochs. The learning rate and batch size were set as $10^{-3}$ and 32. Then, we changed Adam parameters into $(\beta_{1} = 0.9, \beta_{2} = 0.999)$ and used AMSGrad [15] gradient direction. Network was trained further for 16 epochs with mixture of $l_{1}$ and MS-SSIM defined in Equation (5). Initial learning rate was $10^{-4}$ and it was halved for every 5 epochs. For the last phase, we changed the weight on e-ray restoration loss and o-ray restoration loss to $\lambda_{e} = 0.75$ and $\lambda_{o} = 0.25$ for further enhancement on e-ray restoration. We let Adam optimizer have default parameter settings with a learning rate of $10^{-4}$ . We applied the weight decaying parameter as $10^{-5}$ in this phase. + +# 4. Results + +Hardware Prototype. We built a prototype of birefractive stereo imaging with uneven double refraction and calibrated it as proposed by Meuleman et al. [12] (Figure 4 inset). We employed a machine-vision camera (GS3-U3-123S6C-C) with a $35\mathrm{mm}$ lens, a glass-type linear polarizer from Edmund Optics, and a $15\mathrm{mm}$ thick calcite crystal from Newlight Photonics. The refractive indices of the crystal are 1:65 and 1:48 for o-ray and e-ray, respectively. To obtain deep depth-of-field, the aperture was set to $f / 22$ . + +Figure 4 presents stereo restoration results from double-refraction images captured by our real prototype. We compare our results with restored o-/e-ray images by Meuleman et al. [12]. This figure shows that our method restores stereo images in clear shape and retains the displacement between o-ray and e-ray simultaneously. On the other hand, we can observe that artifacts in the o-ray restoration of the other method [12] have a direct influence on the failure of e-ray image restoration. + +Quantitative Evaluation. We compare the accuracy of our stereo image restoration method with two birefractive stereo methods [1, 12] on unseen synthetic double refraction scenes generated from a Middlebury RGB-D dataset [17]. Note that per-pixel ground truths for both o-ray and e-ray are available only in this synthesized dataset. Since earlier studies do not produce e-ray images, we compute e-ray signals by subtracting the restored o-ray signals from the superimposed double refraction image and rescaling it (Equation (1)) as: $\mathbf{I}_e = \frac{1}{\tau} ((1 + \tau)\mathbf{I}_b - \mathbf{I}_o)$ . + +Table 1 summarizes the average peak signal-to-noise ratio (PSNR) and structural similarity index measure (SSIM) values of the restored o-ray and e-ray of each method. The results show that our method has significantly improved the + +![](images/6b1b9197cd0692d4c8ded4eda1ad3ab5b96171984be48f0b673af39391527256.jpg) +Figure 5: Comparison of our image restoration results with two birefractive stereo methods [1, 12] on synthetic double refraction images with the ground truth. Our method outperforms these two current methods. + +
PSNR (dB)SSIM
O-rayE-rayO-rayE-ray
Baek et al. [1]28.2715.990.80620.1237
Meuleman et al. [12]34.1920.100.91580.2072
Our method39.8034.510.96310.9379
+ +Table 1: Quantitative comparison of stereo image restoration quality with the synthetic test dataset. Bold texts mean the best accuracy. + +restoration quality of o-ray and e-ray images. Furthermore, even our e-ray restoration results show a higher PSNR and SSIM values than the o-ray restoration results by the previous methods. Restored images are also visualized in Figure 5. It confirms that our method restores images with clearer edges and textures and removed noise effectively. In particular, our method obtains e-ray images without a typical deconvolution artifact of rings prevalent in the e-ray results restored by the previous methods. + +Robustness. We evaluate the robustness of our network by running the restoration with image distortion by noise. We added Gaussian noise with different standard deviations on the images captured by our birefractive stereo camera and checked whether the stereo image is restored despite of the image degradation. The stereo restoration results of degraded input double refraction images for each noise level are shown in Figure 6. The highlighted image crops present that extracted rays from our network still preserves faithful geometrical displacements. This observation validates our methods' stability in stereo restoration to noise. + +Also, we validate the robustness of our network trained with an attenuation ratio $(\tau = 0.3)$ by evaluating reconstruc + +![](images/35620ff5b162253142a7c8678fc5afd51062ca4778faf78650081a2f023fc956.jpg) +Figure 6: Robustness of stereo image restoration on additive Gaussian noise. Gaussian noise with variance of $\sigma^2 = 0.05$ , 0.005, 0.0005 was added on the real scene. + +tion errors with image datasets simulated with different attenuation ratios $\tau \in \{0.15, 0.3, 0.45\}$ . The average PSNR values of o-ray reconstruction results span in 36.02, 39.80, and $35.94\mathrm{dB}$ , respectively. The performance of our method is still higher than the previous works [1, 12] (Table 1). + +# 4.1. Ablation Study + +Two-Head vs. One-Head Network. Our two-headed network architecture was compared with one-headed architecture to emphasize the importance of o- and e-ray joint estimation for stereo restoration with a balanced quality and appropriateness of the two-headed architecture of our stereo restoration network on the former purpose. We build a one-headed network that consists of one backbone network, one-headed network, and skip connection. The architecture of each component is equivalent to those of a two-headed network. One-headed network and two-headed network were trained in the same settings, equivalent to the first phase of + +![](images/597d8e74b975e649206422ae311ae34613584517a70258e9b77a72a6e00c02e5.jpg) + +![](images/11daedf293faccf73748c911ace2797566b22ba83f5c6604df6e5f9d7d655535.jpg) + +![](images/a3bb3d17d7d825da3ebf662faaa3b5fe933e1c738fc186bf86ec07ea745ea099.jpg) + +![](images/e954b6cb0f0ca251feceb4620746b1e2457cab8b974cfe5cca2259ba474cad76.jpg) + +![](images/c906cd962fa49e07dc2aaa40e82ad577cdbf422718bae398df031a0228bf1de8.jpg) + +![](images/7f7c58e7334518bed948cf31f39a1df37e7af9b7fd04c1831ddb55ae8dc12d97.jpg) +Figure 7: Depth estimation results on synthetic double refraction image generated from the Middlebury test dataset. + +![](images/c88f0b85d2c44e63157f163081f099594d92dcd8d19568971b753405f88def7e.jpg) +Figure 8: (a) Comparison on restoration performance of o-/e-ray between one-headed and two-headed networks. (b) Impact of the attenuation ratio on network training. + +![](images/4ebbd2f9d961089e4fb171c9de55d9cb22f6bcbb844bb3202308c98fb01fe836.jpg) + +training described in implementation details (Section 3.2). + +The difference is that the one-headed network was trained with o-ray supervision only, and an e-ray from the one-headed network was obtained by subtracting the output from a double-refraction image and rescaling it. + +The performance of each network architecture for each epoch is illustrated in Figure 8(a). This plot shows that despite the stand-alone one-headed network restores o-ray in slightly better quality, simple subtraction of the restored o-ray from superimposed double refraction signals cannot restore the residual signals as compatible quality regardless of the o-ray restoration quality. Therefore, this experiment verifies that our network architecture design and training strategy of cooperatively restoring a pair of rays has successfully restored stereo images from double refraction. + +Attenuation Ratio. We chose the attenuation ratio $\tau$ of our image formation model (refer to Equation (1)) upon the analysis of the former study [12] on the appropriate attenuation ratio for restoring both latent image and correct disparity at the same time. Yet, we further investigate the impact of the attenuation ratio on our network performance. We additionally synthesized double refraction data with different attenuation ratio $(\tau = 0.15, 0.45)$ . Supplemented ratios are consistent with the values investigated by Meuleman et al. [12]. + +We started from the pre-trained model obtained from the first phase of training and proceeded with the second phase of training with equal settings but with a newly generated dataset. Figure 8(b) portrays the PSNR of restored stereo images for each training stage of the corresponding attenuation ratios. The plot shows that the highest restoration + +quality of o-ray is obtained when $\tau = 0.3$ among examined values, which is consistent with the previous observation [12]. Still, it is notable that we obtained comparable o-ray restoration with a slighter gap of restoration quality between o-ray and e-ray when the attenuation ratio is 0.15. + +# 5. Applications + +Dense RGB-D Imaging. We show that our stereo images restored from double refraction can be directly applied for dense depth map acquisition using existing stereo matching methods. We attached a PSM-Net [3] (pyramid stereo matching network) subsequent to our stereo restoration network as a depth acquisition module to estimate disparity between o-ray and e-ray. A double refraction image is fed into our stereo restoration network and then separated into o-ray and e-ray images. These outputs are fed into the PSM-Net after rectification. The mapping function for rectification was obtained by the previous calibration method [12]. + +We newly train the PSM-Net by feeding the o-ray and e-ray images acquired from the trained stereo restoration network and our synthesized double refraction dataset. The forward operation of the whole network pipeline ran while the parameters of our stereo restoration network were fixed. For the training phase, we used the $l_{1}$ smooth loss, which is consistent with the loss metric used for disparity regression by [3]. It is defined as: + +$$ +\mathcal {L} _ {d} = \left\{ \begin{array}{l l} 0. 5 \left(d _ {g t} - \hat {d}\right) ^ {2}, & \text {i f} \left| d _ {g t} - \hat {d} \right| < 1 \\ \left| d _ {g t} - \hat {d} \right| - 0. 5, & \text {o t h e r w i s e} \end{array} \right.. \tag {6} +$$ + +We used the Adam optimizer with parameters $(\beta_{1} = 0.9, \beta_{2} = 0.999)$ , and the initial learning rate is set to $10^{-3}$ for 8 epochs with the batch size of 32. + +We validate the significance of disparity estimation with our restored stereo images by comparing disparity estimation by existing depth from double refraction methods [1, 12] on the synthetic test dataset. Since both methods produce a sparse depth map, we compared the disparity estimation error on the region that is valid in the previous methods and compared the estimation of dense maps by densifying the sparse depth map of [1, 12] with a popular diffusion algorithm [9]. + +![](images/770fe2d8d9c0dfd94e9b558f3cd0d7d05324378c94ad3fa443560bbe56d72cba.jpg) +(a) Depth map + +![](images/ac866cab088fb826e3ac0639bd8bbe9f7a31aa261f27f0164398f316b0dd5540.jpg) +[m] (b) O-ray image + +![](images/dc9597bb0d967458d057892f80d67211d71e423ce5a6f8f94a4f0be2193d0724.jpg) +(c) Focus in back + +![](images/fbf18dc929ffc7e1b7ea8dbf0c4bc99d7d0a72a4ddfc676b4aab3aacde04d43f.jpg) +(d) Focus in front + +![](images/33eeead3d368d56d2a68f8f0fdfcc731eac673697dda4ecc5e92373cce7408ec.jpg) +Figure 9: Synthetic defocus. From the estimated depth map (a) and the reconstructed o-ray image (b), we render a defocused image, focusing on the background (c) and on the front object (d). +(a) Depth map +Figure 10: 3D Anaglyph. From the depth map (a) and the o-ray image (b), we generate an anaglyph image (c) with a baseline. + +![](images/f01ef2bbc455c4448b260ee5d7e960c4faaf396492487897b650514cc0e005a5.jpg) +n] +(b) O-ray image + +![](images/642ddce4be4c2d9dd3a9b88a2a4738e9b6c304043b92e68959b9527b4f1ecbd2.jpg) +(c) Anaglyph 3D photo + +
Disparity RMSE (px.)Bad pixel ratio (%)Sparsity (%)
SparseDense
Baek et al. [1]2.752.9658.7789.48
Meuleman et al. [12]1.902.0738.9790.55
Our method1.441.7119.790
+ +Table 2: Quantitative comparison of our dense depth estimation with other densified depth maps captured by other birefractive stereo methods. Bold texts mean the best value. + +As shown in Figure 7, our method restores dense disparity map in great details. Moreover, disparity estimation errors and sparsity of depth estimations in Table 2 quantitatively verifies that disparity estimation with our restored stereo images gives more accurate results in sparse points and disparity map with better accuracy than densified disparity map from sparse values. + +We also demonstrate qualitative depth estimation results of real scenes in Figures 9, 10 and 11. The actual depth values are computed using the disparity-to-depth converting equation: $d_{oe} = \frac{c}{z}$ . The value of calibrated baseline using our prototype camera is $c = 6.756 \, \mathrm{px} \cdot \mathrm{m}$ . Refer to Section 2 in the supplemental document for the depth range. + +Synthetic Defocus. Figure 9 shows a defocus application using our RGB-D results. From the dense depth map from the network and the RGB image of the o-ray, we synthesize a defocused image using the rendering technique proposed by Barron et al. [2]. As we already extracted a clean o-ray image and a depth map from a double refraction image, synthesizing a defocused image is straightforward. + +Anaglyph Visualization. We generate anaglyph stereo images of red and blue filters in a target baseline using clean o-/e-ray images and a depth map, as shown in Figure 10. + +Depth-based Object Segmentation. Our method enables + +![](images/1baede7bac52a33d1413ce5528748e24fc15387166cc4c677fc029aaf2fc861d.jpg) + +![](images/b1f328d66c6c067a756895188e7b51c0d121e3826b84416e7fe703c646566c40.jpg) +(a) Depth map +Figure 11: Depth-aware object segmentation. From the depth maps (a) and the o-ray images (b), we extract an object from the scene to render a decolorized image (c) and an occlusion-aware image composition (d). + +![](images/c16d83cfadd72b74d16d1ccd5651cf7d7c2677b43380fbd9ceb99ecc95ee03a3.jpg) +[m] + +![](images/902a89e76d08cff52a4f267b19950727b6031bdcd11f365f049017f0c313db1f.jpg) +(c) Decolorization + +![](images/23d60a1f086d84584ba139ddd2d09f9d11ab1c6df0561f848aa7bba09103821d.jpg) +(b) O-ray image. + +![](images/a8d35d75b1d70935092db4ec8508fda099b092b7edff30bd90286b07b5abba04.jpg) +(d) Image compositing + +depth-based object segmentation from a double-refraction image. Using a classical object segmentation algorithm, such as grab-cut [16], we extract objects from the captured scene. Figure 11 shows an example of segmentation used for background decolorization and depth-aware image composition. The occlusion regions are computed from the estimated depth without manual intervention. + +# 6. Conclusion + +We have proposed a stereo restoration network with a two-headed architecture and two different types of skip connections to effectively restore stereo images from double refraction using the geometrical relationship between two latent images overlapped in the double refraction image. Unlike previous image restoration and birefractive stereo studies, we restored both e- and o-ray, preserving the spatially variant displacements without relying on depth. Our results validate that our method restores both e- and o-ray with better quality in the PSNR metric. We further investigate the performance of our network on captured real scenes with a birefractive stereo camera and confirms that our network successfully generates stereo images from a monocular camera. Also, the robustness experiment with noise verifies the stability of our restoration method. Demonstrated applications, including dense RGB-D imaging, supports the practicality of our monocular stereo image restoration. + +# Acknowledgments + +Min H. Kim acknowledges Samsung Research Funding Center of Samsung Electronics (SRFC-IT2001-04) for developing partial 3D imaging algorithms, in addition to a partial support of Korea NRF grants (2019R1A2C3007229), MSIT/IITP of Korea (2017-0-00072), and MSRA. + +# References + +[1] Seung-Hwan Baek, Diego Gutierrez, and Min H Kim. Birefractive stereo imaging for single-shot depth acquisition. ACM Transactions on Graphics (TOG), 35(6):1-11, 2016. +[2] Jonathan T Barron, Andrew Adams, YiChang Shih, and Carlos Hernandez. Fast bilateral-space stereo for synthetic defocus. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4466-4474, 2015. +[3] Jia-Ren Chang and Yong-Sheng Chen. Pyramid stereo matching network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5410-5418, 2018. +[4] Yosef Gandelsman, Assaf Shocher, and Michal Irani. "double-dip": Unsupervised image decomposition via coupled deep-image-priors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +[5] Jianbo Jiao, Wei-Chih Tu, Shengfeng He, and Rynson WH Lau. Formresnet: Formatted residual learning for image restoration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 38-46, 2017. +[6] Soomin Kim, Yuchi Huo, and Sung-Eui Yoon. Single image reflection removal with physically-based training images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5164-5173, 2020. +[7] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[8] Orest Kupyn, Volodymyr Budzan, Mykola Mykhailych, Dmytro Mishkin, and Ji√ri Matas. Deblurgan: Blind motion deblurring using conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8183-8192, 2018. +[9] Anat Levin, Rob Fergus, Frédo Durand, and William T Freeman. Image and depth from a conventional camera with a coded aperture. In ACM Transactions on Graphics (TOG), volume 26, page 70. ACM, 2007. +[10] Anat Levin, Dani Lischinski, and Yair Weiss. Colorization using optimization. In ACM SIGGRAPH 2004 Papers, pages 689-694. 2004. +[11] Yicun Liu, Jimmy Ren, Jiawei Zhang, Jianbo Liu, and Mude Lin. Visually imbalanced stereo matching. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +[12] Andreas Meuleman, Seung-Hwan Baek, Felix Heide, and Min H Kim. Single-shot monocular rgb-d imaging using uneven double refraction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2465-2474, 2020. +[13] Seungjun Nah, Tae Hyun Kim, and Kyoung Mu Lee. Deep multi-scale convolutional neural network for dynamic scene deblurring. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3883-3891, 2017. + +[14] Pushmeet Kohli Nathan Silberman, Derek Hoiem and Rob Fergus. Indoor segmentation and support inference from rgbd images. In ECCV, 2012. +[15] Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. arXiv preprint arXiv:1904.09237, 2019. +[16] Carsten Rother, Vladimir Kolmogorov, and Andrew Blake. "grabcut" interactive foreground extraction using iterated graph cuts. ACM transactions on graphics (TOG), 23(3):309-314, 2004. +[17] Daniel Scharstein, Heiko Hirschmüller, York Kitajima, Greg Krathwohl, Nera Ne√sic, Xi Wang, and Porter Westling. High-resolution stereo datasets with subpixel-accurate ground truth. In German conference on pattern recognition, pages 31–42. Springer, 2014. +[18] Xin Tao, Hongyun Gao, Xiaoyong Shen, Jue Wang, and Jiaya Jia. Scale-recurrent network for deep image deblurring. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. +[19] Takahiro Yano, Masao Shimizu, and Masatoshi Okutomi. Image restoration and disparity estimation from an uncalibrated multi-layered image. In 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pages 247-254. IEEE, 2010. +[20] Yuan Yuan, Wei Su, and Dandan Ma. Efficient dynamic scene deblurring using spatially variant deconvolution network with optical flow guided training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3555-3564, 2020. +[21] Jiawei Zhang, Jinshan Pan, Jimmy Ren, Yibing Song, Linchao Bao, Rynson WH Lau, and Ming-Hsuan Yang. Dynamic scene deblurring using spatially variant recurrent neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2521-2529, 2018. +[22] Xuaner Zhang, Ren Ng, and Qifeng Chen. Single image reflection separation with perceptual losses. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4786-4794, 2018. +[23] Hang Zhao, Orazio Gallo, Iuri Frosio, and Jan Kautz. Loss functions for image restoration with neural networks. IEEE Transactions on computational imaging, 3(1):47-57, 2016. +[24] Zhengxia Zou, Sen Lei, Tianyang Shi, Zhenwei Shi, and Jieping Ye. Deep adversarial decomposition: A unified framework for separating superimposed images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. \ No newline at end of file diff --git a/highqualitystereoimagerestorationfromdoublerefraction/images.zip b/highqualitystereoimagerestorationfromdoublerefraction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cbf0245d0971f3031b5624830dfa6802ffb35ca4 --- /dev/null +++ b/highqualitystereoimagerestorationfromdoublerefraction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16655b31b2258567dc2ca45a2570fcf47d21cd5ab2592d31457860e50a293c93 +size 784135 diff --git a/highqualitystereoimagerestorationfromdoublerefraction/layout.json b/highqualitystereoimagerestorationfromdoublerefraction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2931e8c18be9e5a92d764bd5c394b93de7286ec4 --- /dev/null +++ b/highqualitystereoimagerestorationfromdoublerefraction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9596c9b8614079e22245f05a0d5e58e700f66a66447744c3997de0c3823cf7b1 +size 387622 diff --git a/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_content_list.json b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4226687f72f33f417349d1b70115304b63bd7aa8 --- /dev/null +++ b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10ce5ab7061e7ae21cbea2f17a8e4e3816296870ab53b05fc73cba5cb1b4ddbe +size 81316 diff --git a/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_model.json b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3a8399c321a6456b823dcbe5bbc8f70d17af46a4 --- /dev/null +++ b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a058168629f24d38c71b80af54031312db01aa46c1cd1cc729d9c24304f9159 +size 93120 diff --git a/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_origin.pdf b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..09136312e43b8a22afc79f64018df3dd43151c46 --- /dev/null +++ b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/d476da8c-1c44-4a19-a959-65c063a357e3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ff3fa76df6099330b46e224a21bd61d8df24dce8b00bcdd09ebccdc0ba9fac2 +size 2534771 diff --git a/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/full.md b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8e15725cdb4666aaba541b8729b0f11628ab684e --- /dev/null +++ b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/full.md @@ -0,0 +1,335 @@ +# High-Resolution Photorealistic Image Translation in Real-Time: A Laplacian Pyramid Translation Network + +Jie Liang $^{1,2*}$ , Hui Zeng $^{1,2*}$ and Lei Zhang $^{1,2\dagger}$ + +1The HongKong Polytechnic University, 2DAMO Academy, Alibaba Group {csjliang, cshzeng, cslzhang}@comp.polyu.edu.hk + +# Abstract + +Existing image-to-image translation (I2IT) methods are either constrained to low-resolution images or long inference time due to their heavy computational burden on the convolution of high-resolution feature maps. In this paper, we focus on speeding-up the high-resolution photorealistic I2IT tasks based on closed-form Laplacian pyramid decomposition and reconstruction. Specifically, we reveal that the attribute transformations, such as illumination and color manipulation, relate more to the low-frequency component, while the content details can be adaptively refined on high-frequency components. We consequently propose a Laplacian Pyramid Translation Network (LPTN) to simultaneously perform these two tasks, where we design a lightweight network for translating the low-frequency component with reduced resolution and a progressive masking strategy to efficiently refine the high-frequency ones. Our model avoids most of the heavy computation consumed by processing high-resolution feature maps and faithfully preserves the image details. Extensive experimental results on various tasks demonstrate that the proposed method can translate 4K images in real-time using one normal GPU while achieving comparable transformation performance against existing methods. Datasets and codes are available: https://github.com/csjliang/LPTN. + +# 1. Introduction + +Image-to-image translation (I2IT, [11, 26, 31]), which aims to translate images from a source domain to a target one, has gained significant attention. Recently, photorealistic I2IT has been attracting increasing interest in various practical tasks, e.g., transferring images among different daytimes or seasons [11] or retouching the illumination and color of images to improve their aesthetic quality [4]. + +![](images/590e0aea6e60e887e2afe9838329f4463d512736eb3a0c24d89d4b7439f514be.jpg) + +![](images/c08ad74bf553983937530ef00413623c3cb5018cd0597ea0131b68b4b0ab1a9a.jpg) + +![](images/a46dd59e4f1684cb49f7c2a7ed11fad3fd07d3e60a3b1bc615a2a766d7d88848.jpg) + +![](images/0924c0c4a8d8dd66ea784068182dcd6667b11aaf61f8ab11693bb2d041b87eaa.jpg) +(a) Original Images, MSE=7853.9 + +![](images/a046bfbb6c74b619940dc4b41b64a89bd334a7e4372683e2eddc086c45109630.jpg) +(b) High Frequencies, Level=1, MSE=97.5 + +![](images/f72c1463fbff9c772da136678fbaf478809a1134ea21984fbadbafef8ddad46c.jpg) + +![](images/e8f81f90452397aa53f5ea3f3659ede1f11b74fc7311a109ec17c82a7cccbb7a.jpg) +(c) High Frequencies, Level=2, MSE=107.7 + +![](images/7fa4ee29104fa9a95fa85bb6da2c099436d781980991b3f14de8cf5bb328d488.jpg) + +![](images/449663b252ee2efdff0e1924f45f38a9110198da71c16d31d7a4cfa77d16b0f9.jpg) + +![](images/3fb7b6ee327af0eb48c54a21767e2b6f5dde1aa993eb9227c4539c104c1334ee.jpg) +(d) Low Frequencies, Level=3, MSE=6969.4 + +![](images/d7b8a714c0266f2dd968c89d431a7da8f67988dfedfc7aa6a1e3a269ba735c63.jpg) +Figure 1. (a) Images of a scene captured at different daytimes and $(\mathrm{b}\sim \mathrm{d})$ the Laplacian pyramids (figures in $(\mathbf{c}\sim \mathbf{d})$ are resized for better visualization). As shown by the MSE and the Histograms, the differences between the day and night images are dominated in the low-frequency components (d). + +![](images/250f28ba0a28018c5db8f46b3a88845ee1ca6ed0519fcd46d7c12dee5697e065.jpg) + +Different from the general I2IT problem, the key challenge of the practical photorealistic I2IT task is to keep efficiency and avoid content distortions when handling high-resolution images. + +To achieve faithful translations, most traditional methods [16, 29, 33] employ an encoding-decoding paradigm which maps the input image into a low-dimensional latent space, followed by reconstructing the output from a translated latent code. However, these methods are naturally lim + +ited to low-resolution applications or time-consuming inference models [16, 19, 21, 25, 29, 33], which is far from practical. The main reason is that the model needs to manipulate the image globally using deep networks, yet directly convolving a high-resolution image with sufficient channels and large kernels demands heavy computational cost. There are some developments in pruning and boosting the inference models [13, 17, 20], yet a shallow network can hardly fulfill the requirements of reconstructing complex content details from a low-dimensional latent space to a high-resolution image. To generate a photorealistic translation, recent researches [10, 14, 15] have also been focusing on disentangling the contents and attributes of both domains in a data-driven manner. Nevertheless, the irreversible down- and up-sampling operations in these models still involves heavy convolutions on high-resolution feature maps, sacrificing the efficiency of the inference model. + +Inspired by the reversible and closed-form frequency-band decomposition framework of a Laplacian pyramid (LP, [1]), we reveal that the domain-specific attributes, e.g., illuminations or colors, of a photorealistic I2IT task are mainly exhibited on the low-frequency component. In contrast, the content details relate more to higher-frequency components, which can be adaptively refined according to the transformation of the visual attributes. As shown in Figure 1, for a pair of images with the same scene yet captured at different daytimes, the mean squared errors (MSE) between the high-frequency components (b-c) of the two domains are much smaller (about $1/71$ and $1/65$ ) than that between the low-frequency components (d). Similar findings can be observed from the histograms and visual appearance. Figure 1 (b-c) also demonstrate that the higher-frequency subimages are with tapering resolutions, while different levels show pixel-wise correlations and exhibit similar textures. Such properties allow an efficient masking strategy for adjusting the content details accordingly. + +Based on the above observations, in this paper, we propose a fast yet effective method termed the Laplacian Pyramid Translation Network (LPTN) to improve efficiency while keeping the transformation performance for photorealistic I2IT tasks. In specific, we build a lightweight network with cascaded residual blocks on top of the low-frequency component to translate the domain-specific attributes. To fit the manipulation of the low-frequency component and reconstruct the image from an LP faithfully, we refine the high-frequency components adaptively yet avoid heavy convolutions on high-resolution feature maps to improve the efficiency. Therefore, we build another tiny network to calculate a mask on the smallest high-frequency component of the LP and then progressively upsample it to fit the others. The framework is trained end-to-end in an unsupervised manner via adversarial training strategy. + +The proposed method offers multiple advantages. + +Firstly, we are the first to enable photorealistic I2IT on 4K resolution images in real-time. Secondly, given the lightweight and fast inference model, we still achieve comparable or superior performance on photorealistic I2IT applications in terms of transformation capacity and photorealism. Both qualitative and quantitative results demonstrate that the proposed method performs favorably against state-of-the-art methods. + +# 2. Related Work + +# 2.1. Photorealistic Image Translation + +Most existing I2IT methods [10,16,19,23,33,34] include three main steps as follows: 1) encoding the image into a low-dimensional latent space; 2) translating the domain-specific attributes in the latent space and 3) reconstructing the image via a deep decoder. Recent researchers attempt to alleviate the space burden and improve the time efficiency of the I2IT models [3,8,13,17,20,29,32]. For example, to allow translation on high-resolution images, Wang et al. [29] proposed a coarse-to-fine generation pipeline where a low-resolution translation is learned first and then expanded progressively to higher-resolution. However, it is computationally expensive due to the direct optimization of high-resolution images. There are also some speeding-up frameworks in the photorealistic style transfer community. Specifically, instead of conducting iterative forward and backward processes [7], researchers proposed to learn a feed-forward network to approximate the optimization process [3, 13, 17]. Nevertheless, the encoding and decoding steps may introduce structural distortions due to the tradeoff between efficiency and effectiveness. + +To enhance the faithfulness of a fast stylization, Li et al. [20] took advantage of the spatial propagation network [24], which however can hardly be extended to high-resolution applications. Recent developments [6, 10, 15, 19, 22, 28, 30] also focus on disentangling the factors of data variations based on second-order statistics. For example, Huang et al. [14] proposed an adaptive instance normalization which normalizes the content latent code using the mean and standard deviation of the style. To allow a photorealistic translation according to a given reference, Luan et al. [25] designed a novel loss on preserving the local structure of the given content image. In addition, Li et al. [21] proposed a smoothing process based on per-pixel affinities on top of the original transformation stage. Furthermore, Yoo et al. [30] introduced a wavelet pooling strategy to approximate the average pooling yet with a mirroring unpooling operation. Nevertheless, these methods are computationally expensive on high-resolution tasks, e.g., costing a few seconds on an HD image. In addition, they need a reference image to manipulate the style of each input. In contrast, the I2IT methods including the proposed LPTN mod + +![](images/f7bcd4bab0fc7d53b472b1fb15b142b52210db0eb5f3b28f5ddb09998a157bc2.jpg) +Figure 2. Pipeline of the proposed LPTN algorithm. Given a high-resolution image $I_0 \in \mathbb{R}^{h \times w \times 3}$ , we first decompose it into a Laplacian pyramid (e.g., $L = 3$ ). Red arrows: For the low-frequency component $I_L \in \mathbb{R}^{\frac{h}{2L} \times \frac{w}{2L} \times c}$ , we translate it into $\hat{I}_L \in \mathbb{R}^{\frac{h}{2L} \times \frac{w}{2L} \times c}$ using a lightweight network. Brown arrows: To adaptively refine the high-frequency component $h_{L-1} \in \mathbb{R}^{\frac{h}{2L-1} \times \frac{w}{2L-1} \times c}$ , we learn a mask $M_{L-1} \in \mathbb{R}^{\frac{h}{2L-1} \times \frac{w}{2L-1} \times 1}$ based on both high- and low-frequency components. Purple arrows: For the other components with higher resolutions, we progressively upsample the learned mask and finetune it with lightweight convolution blocks to maintain the capacity of a photorealistic reconstruction. + +els the visual attributes based on the overall distribution of the training data, which thus need only the input image in the testing stage. + +# 2.2. Laplacian Pyramid + +Laplacian pyramid (LP) [1] is a long-standing technique on image processing. The main idea of the LP method [1] is to linearly decompose an image into a set of high- and low-frequency bands, from which the original image can be exactly reconstructed. In specific, given an arbitrary image $I_0$ of $h \times w$ pixels, it firstly calculates a low-pass prediction $I_1 \in \mathbb{R}^{\frac{h}{2} \times \frac{w}{2}}$ where each pixel is a weighted average of the neighboring pixels based on a fixed kernel. To allow a reversible reconstruction, the LP records the high-frequency residual $h_0$ as $h_0 = I_0 - \hat{I}_0$ , where $\hat{I}_0$ denotes the upsampled image from $I_1$ . To further reduce the sample rate and image resolution, LP iteratively conducts the above operations on $I_1$ to get a sequence of low- and high-frequency components. + +The hierarchical structure of the LP paradigm inspires several recent CNN-based image processing works such as image generation [5], super-resolution [18] and semantic segmentation [9]. For example, in order to generate high-quality images, Denton et al. [5] trained multiple generators on the components of an LP. In addition, Lai et al. [18] follows the Laplacian pyramid reconstruction process to progressively reconstruct the high-frequency (also high-resolution) components for image super-resolution. Its + +computation and memory cost grows dramatically with the increase of resolution due to the intensive convolutions on high-resolution components. In contrast, we tackle the photorealistic I2IT problem and reveal that the task can be done by simultaneously translating the illuminations and colors at low-freq and refining slightly the details at high-freq to avoid computationally intensive convolutions. Accordingly, an efficient refining module on high-freq components is designed, allowing a real-time implementation on 4K images. + +# 3. Laplacian Pyramid Translation Network + +# 3.1. Framework Overview + +We propose an end-to-end framework, namely the Laplacian Pyramid Translation Network (LPTN), to reduce the computational burden and simultaneously keep the transformation performance for photorealistic I2IT tasks. The pipeline of the proposed LPTN is shown in Figure 2. + +As shown in the figure, given an image $I_0 \in \mathbb{R}^{h \times w \times 3}$ , we first decompose it into an Laplacian pyramid, obtaining a set of band-pass components denoted by $H = [h_0, h_1, \dots, h_{L-1}]$ and a low-frequency residual image $I_L$ where $L$ is the number of decomposed levels of the LP. The components of $H$ have tapering resolutions from $h \times w$ to $\frac{h}{2^{L-1}} \times \frac{w}{2^{L-1}}$ , while $I_L$ has $\frac{h}{2^L} \times \frac{w}{2^L}$ pixels. Such a decomposition is invertible where the original image can be reconstructed by a sequence of mirror operations. According to Burt and Adelson [1], $H$ is highly decorrelated where + +the light intensity of most pixels is close to 0 except for the detailed textures of the image. At the same time, the low-pass filtered $I_{L}$ is blurred where each pixel is averaged by the neighboring pixels via an octave Gaussian filter. As a result, $I_{L}$ reflects the global attributes of an image in a content-independent manner. + +Inspired by the above properties of LP, we propose to translate mainly on $I_{L}$ to manipulate the illuminations or colors, while refining $H$ adaptively to avoid artifacts in reconstruction. In addition, we progressively refine the higher-resolution component conditioned on the lower-resolution one. The LPTN framework is therefore composed of three parts. First, we translate the low-resolution $I_{L}$ into $\hat{I}_{L}$ using deep convolutions. Second, we learn a mask on top of the concatenation of $[h_{L - 1},up(I_L),up(\hat{I}_L)]$ , where $up(\cdot)$ denotes a bilinear upsampling operation. The mask is then multiplied to $h_{L - 1}$ to refine the high-frequency component of level $L - 1$ . Third, to further refine the other components with higher resolutions, we propose an efficient and progressive upsampling strategy. At each level from $l = L - 2$ to $l = 0$ , we first upsample the mask of the last level and then learn a lightweight convolution to slightly finetune the mask. We introduce these modules in detail in the following sections. + +# 3.2. Translation on Low-Frequency Component + +The inherent properties of LP, including the separation of textures and visual attributes, and the capability of a reversible reconstruction, can benefit the photorealistic I2IT task. For general I2IT tasks with texture manipulations, the domain-specific attributes are represented in the latent space powered by a deep encoding-decoding network. In contrast, for the task of photorealistic I2IT, we observe that the domain-specific attributes are mainly about illuminations or colors, which can be extracted using fixed kernels in an efficient way. As shown in Figure 1, for example, the domain-specific visual attributes of the day-to-night translation task are mainly exhibited in the low-frequency component, while the high-frequency ones relate more to the textures. Consequently, we can translate the domain-specific attributes on the low-frequency component with a down-scaled resolution, reducing largely the computational complexity against the general I2I methods. + +As shown in Figure 2, given $I_{L}$ with a reduced resolution, we first extend the feature map channel-wisely using a $1 \times 1$ convolution. Then, we stack 5 residual blocks on top of the extended feature map. For each residual block, two convolutions with kernel size being 3 and stride being 1 are conducted, each is followed by a leaky ReLU. After that, we reduce the channels of the feature maps back to $c$ to get the translated results $\hat{I}_{L}$ , where $c$ denotes the number of channels of the given image. The output is finally added to the original inputs followed by a Tanh activation layer. + +Traditional I2IT algorithms also conduct transformation at a low-dimensional space via a cascade of residual blocks. However, the proposed model shows advantages against these methods in the following ways. 1) On time and space efficiency: The decomposition of high- and low-frequency components in an LP is based on a fixed kernel and a simple convolution operation, it is therefore efficient and free of learning from images. Such a strategy is based on a prior knowledge that the photorealistic I2IT task requires to manipulate illuminations and colors while slightly refining the textures accordingly. In contrast, traditional methods access to the low-dimensional latent space via auto-encoders with heavy convolutions on the whole image, which limits their applications to high-resolution tasks. 2) On the disentanglement and reconstruction effectiveness: The separation of different frequency bands in an LP is simple and effective for disentangling and reconstructing an image, as shown in Figure 1. In contrast, a learning-based auto-encoder in general methods may suffer from a trade-off between the model size and disentanglement/reconstruction effectiveness. + +# 3.3. Refinement of High-Frequency Components + +To allow a faithful reconstruction when manipulating domain-specific attributes, the high-frequency components $H = [h_0,h_1,\dots ,h_{L - 1}]$ should also be refined according to the transformation from $I_{L}$ to $\hat{I}_L$ . In this section, we propose to learn a mask for $h_{L - 1}$ and progressively expand the mask to refine the rest of high-frequency components according to the intrinsic characteristic of LP. + +According to the analysis in Section 3.1, we have $h_{L - 1} \in \mathbb{R}^{\frac{h}{2L - 1} \times \frac{w}{2L - 1} \times c}$ and $I_L, \hat{I}_L \in \mathbb{R}^{\frac{h}{2L} \times \frac{w}{2L} \times c}$ . We first upsample $I_L$ and $\hat{I}_L$ with bilinear operations to match the resolution of $h_{L - 1}$ . Then, we concatenate $[I_L, \hat{I}_L, h_{L - 1}]$ and feed it into a tiny network with the same architecture as shown in Figure 2. The output channel of the last convolution layers is set to 1 in this network. + +The output of the network $M_{L-1} \in \mathbb{R}^{\frac{h}{2^{L-1}} \times \frac{w}{2^{L-1}} \times 1}$ is considered as a per-pixel mask of the $h_{L-1}$ . As shown in Figure 1, for image pairs in two domains, the high-frequency components on the same level only differ slightly in terms of the global brightness. Therefore, the masks can be interpreted as a global adjustment which is relatively easier to be optimized than the mixed-frequency images. Consequently, we refine the $h_{L-1}$ by: + +$$ +\hat {h} _ {L - 1} = h _ {L - 1} \otimes M _ {L - 1}, \tag {1} +$$ + +where $\otimes$ denotes the pixel-wise multiplication. + +We then progressively upsample the per-pixel mask $M_{L-1}$ to a set of masks $[M_{L-2},\dots,M_1,M_0]$ with resolutions from $\frac{h}{2^{L-2}}\times\frac{w}{2^{L-2}}\times 1$ to $h\times w\times 1$ to match the rest high-frequency components. As shown in Figure 2, $M_{L-1}$ is expanded with a scale factor of 2 using bilinear interpolation, followed by an optional lightweight convolution + +block for fine-tuning. The result of this stage, i.e., $M_{L - 2}$ , is then progressively upsampled until $M_0$ is generated. Consequently, we can refine all the high-frequency components of the LP using the same operations as in Eq. (1) and get the result set $[\hat{h}_0,\hat{h}_1,\dots ,\hat{h}_{L - 1}]$ . The result image $\hat{I}_0$ is then reconstructed using the translated $\hat{I}_L$ and the refined $[\hat{h}_0,\hat{h}_1,\dots ,\hat{h}_{L - 1}]$ . + +To demonstrate the effectiveness of the bilinear interpolation on upsampling the masks, let's recap the construction of an LP. As mentioned in Section 2.2, given the low-frequency image of the $l$ -th level, i.e., $I_{l}$ , we have $h_{l} = I_{l} - T(C(I_{l}))$ where $C$ and $T$ denote convolution and transpose convolution with the same low-pass kernel. On the next level, we have $h_{l + 1} = I_{l + 1} - T(C(I_{l + 1})) = C(I_{l}) - T(C(C(I_{0})))$ since $I_{l + 1} = C(I_{l})$ . The closed-form convolution operation $C$ with the 2D low-pass kernel derived from $[1,4,6,4,1]$ approximates the average pooling with a receptive field of 5. Figure 1 demonstrates that the difference between the high-frequency components of the two images is small and only the global tone has a big difference. As a result, a bilinear upsampling and a lightweight convolution are capable to simultaneously reverse the down-sampling process and manipulate the global intensity of the mask. Compared with those directly convolute the large-scale high-frequency components, the above mentioned progressive masking strategy can save computational resources to a large extent. + +# 3.4. Learning criteria + +The proposed LPTN is trained in an unsupervised scenario by optimizing a reconstruction loss $\mathcal{L}_{recons}$ as well as an adversarial loss $\mathcal{L}_{adv}$ on the image space. To encourage a faithful translation and refinement, we let $\mathcal{L}_{recons} = \| I_0 - \hat{I}_0\| _2^2$ given the input image $I_{0}$ and the translated result $\hat{I}_0$ . Besides, the $\mathcal{L}_{adv}$ is computed based on the LSGAN objective [27] and a multi-scale discriminator [29] to match the target distribution. Specifically, we train the generator $G$ (including both low- and high- frequency modules) to minimize $E_{I_0\sim p_{data}(I_0)}[D(G(I_0) - 1)^2]$ , and train a discriminator $D$ to minimize $E_{\tilde{I}_0\sim p_{data}(\tilde{I}_0)}[(D(\tilde{I}_0) - 1)^2] + E_{I_0\sim p_{data}(I_0)}[D(G(I_0))^2]$ . Like [27], the $D$ has 3 components with identical network structure on 3 image scales. The total loss is calculated as follows: $\mathcal{L} = \mathcal{L}_{recons} + \lambda \mathcal{L}_{adv}$ , where $\lambda$ balances the two losses. + +# 4. Experiment + +# 4.1. Setup + +Datasets: To extend the I2IT task to a high-resolution scenario, we collect two unpaired datasets from Flickr\* with random resolutions from $1080\mathrm{p}$ $(1920\times 1080)$ to 4K + +$(3840 \times 2160)$ . One of them is regarding the day→night translation task (with 1035 day photos and 862 night photos) while the other is about the summer→winter translation task (with 1173 summer photos and 1020 winter photos). Examples of the training images are shown in the supplementary material. + +In addition, to quantitatively evaluate the proposed method, we conduct experiments on the MIT-Adobe fiveK dataset [2] which contains 5,000 untouched images and the corresponding manually-retouched targets given by photographic experts. We use the targets given by expert C following the existing works [4], while we employ 4,500 images for training and the rest 500 pairs for evaluation. Note we only use the paired samples to calculate the quantitative metrics in the testing stage. + +Hyper-Parameters: We use an Adam optimizer with the learning rate being $1e^{-4}$ . The weight of the losses is set to be $\mathcal{L}_{recons} : \mathcal{L}_{adv} = 10 : 1$ . + +Compared Methods: We compare our method with both unpaired I2IT methods, i.e., CycleGAN [33], UNIT [23] and MUNIT [15] and unpaired photo retouching methods, i.e., the White-box [12] and DPE [4]. Qualitative and quantitative comparisons are reported in Section 4.3 and Section 4.4, respectively. + +# 4.2. Ablation Study + +Effectiveness of Specific Modules: We visualize the effectiveness of different modules (the refinement of high-frequency components and the instance normalization when translating the low-frequency component) in Figure 3. On one hand, as shown in the third column of the figure, the progressive refinement of the high-frequency components is effective in preserving the texture details. When we remove these refinement modules, although the visual attributes (in this task, illuminations and colors, etc.) are successfully translated, many regions suffer from blurring effects and the PSNR is thus reduced to 20.87. This is mainly caused by the dis-match between the translated low-frequency component and the nearly unchanged high-frequency ones. On the other hand, as shown in the fourth column of the figure, the instance norm is required when translating the low-frequency component. If we manipulate the attributes with no normalization process, the translation will be excessive and lead to over-sharpened results. As shown in the top row, many undesired details on the face are produced. In contrast, LPTN achieves a natural and photorealistic translation, which results in a comparable PSNR with the state-of-the-art unpaired photo retouching methods. + +Selection of the Number of Levels: We validate the influence of the number of levels $L$ on the photo retouching task. As shown in the last three rows of Table 1, the model achieves the best performance on all tested resolutions when $L = 3$ . At the same time, as shown in the Ta + +![](images/7b0764ad14f3d068ae85f637b223eef9d91afa4500a73baf6553efcea2b1baa0.jpg) + +![](images/0f6afb74a5ffc982402d983ecbc1a4fc3363fb40f78922d51b555db450f34c3c.jpg) +Input + +![](images/813f4359a0799bb476ad0e9a27cb3b7cefb4db16ccbedbb487e8d8ad15c5b965.jpg) + +![](images/fedce889cb2612722c58860ca4fc1ccba55156b451437cf61ffc851cf6c17fb3.jpg) +Target + +![](images/6821cdc13aa9e9e125be6e2d96714ab440fabbf707304fa9517ed5e9065e81c2.jpg) + +![](images/7e1dd451892e196fdcc7c0f3b1e6f1e669e5250ec9def5cea99b1312a33139c8.jpg) +w/o high-frequency PSNR: 20.87 +Figure 3. Ablation study toward the model structures on the photo retouching task. The images in the third column are generated without the refinement modules of the high-frequency components, while the images in the fourth column are generated by removing the instance norm layer when translating the low-frequency component. The PSNRs are the average of 500 test images under the specific setting. + +![](images/0252fd28d37a793728106a31b3db36b1d0cb1c5b05d1a71995082272bb99ebec.jpg) + +![](images/1be765c1d10aff22e3b81d75743802b7ceb730021d5960afd9112ca216a07a76.jpg) +w/o instance norm PSNR: 21.65 + +![](images/5bb31a14d914e8542ea73ce0d2919f8203aceae6e229bf7a83e74e78bbde469a.jpg) + +![](images/51756b381cd80132a424d2dbb1ed305e8c536c3f30d5b6c89755215f047c81ef.jpg) +Final PSNR: 22.03 + +ble 2, the LPTN consumes more time with $L = 3$ than that with $L = 4$ or $L = 5$ . Actually, there is a trade-off between the time consumption and the performance, which is determined by the number of levels of the LP. However, the proposed LPTN is robust when increasing the parameter $L$ to reduce the computational burden. Take the task on 1080p images as an example, the PSNR of the LPTN is just reduced from 22.09 to 21.95 when the $L$ is increased from 3 to 5, yet the model achieves a speed-up of more than $\times 2$ and takes about $1/16$ of memory usage. This result validates that domain-specific attributes are presented in a relatively low-dimensional space. + +# 4.3. Visual Comparisons + +Photorealistic I2IT: We compare the visual performance on various photorealistic I2IT tasks, i.e., (a) day→night, (b) summer→winter and (c) photo retouching, in Figure 4. This experiment is conducted on 1080p resolution considering the memory limitation of the CycleGAN, UNIT, and MU-NIT. As shown in the figure, the proposed LPTN performs favorably against these three methods on both the photorealism and translation performance, while the LPTN is the only one that can be extended to higher resolution tasks (e.g., 4K). + +In specific, for the day $\rightarrow$ night task as shown in Figure 4 (a), the LPTN translates the inputted day image into a dark night and shows little texture distortion. The geometric structure of the zoomed-in regions, i.e., a part of clouds and building, is well preserved in the translated results. Meanwhile, the global tone of the image is modified into a dark night style. The CycleGAN, which also achieves a dark tone, shows the second-best performance among these methods. However, it introduces many visible distortions, e.g., the cloud in the red box is transformed into many light spots while the ambient sky is in pure black. There are also some artifacts on top of the building as shown + +in the yellow box. The structural distortions and artifacts in the results of CycleGAN may be caused by the insufficient reconstruction capability of the decoder given a relatively high-resolution application. In contrast, LPTN achieves the encoding-decoding process via a closed-form filtering, which can be extended to higher resolutions, e.g., 4K, with negligible performance reduction. Similar conclusions can be made on the (b) summer→winter and the (c) photo retouching tasks. + +We compare the proposed LPTN with traditional I2IT methods, i.e., CycleGAN, UNIT, and MUNIT, to demonstrate the advantages of our method. Generally, traditional ones are based on auto-encoder frameworks with mainly three steps: 1) disentangling the contents and attributes on a low-dimensional latent space via an encoding process; 2) translating the latent attribute code via residual blocks; 3) reconstructing the image from the translated attribute code via a decoder mirroring the encoding process. Actually, the ability to reconstruct contents is modeled by the network parameters of the auto-encoder. As a result, these methods can hardly be extended to high-resolution tasks or be applied to photorealistic scenarios due to the expensive computational cost. + +Instead of a parameterized encoding and decoding framework, the proposed LPTN decomposes the image into different frequency bands with tapering resolutions via a closed-form operation. The decomposed components are validated to be effective to represent the domain-specific attributes and content textures (as shown in Figure 1). Consequently, the image can be easily reconstructed in a closed-form (note that the decomposition and reconstruction cost less than $2ms$ for a 4K image with $L = 4$ ). As shown in Figure 2, most computation resources are allocated to translate the low-frequency component at the smallest resolution and to calculate the adaptive mask at the second-smallest resolution. Therefore, the proposed LPTN can be easily ex + +![](images/afe451c986bf9e61e0d60dac4af006b408754e446f53dd3f07853c163d76821c.jpg) +Input + +![](images/a50607d35584b43866391328d55aebb334a6fb15ce91846c539455a6d92e5f2b.jpg) + +![](images/e10d5303bfdda51f90c6805708b77be401f7d95e268f8eac3cb90591affb72bf.jpg) + +![](images/43e1cacccde907bfc4eba5cd869e42a0a600b6c097d238785b285fb9f4c950b9.jpg) +CycleGAN + +![](images/cb9013ee9eb71370b6e2626267b6634b220cadc36ab8be918cc12344cac24d01.jpg) + +![](images/9d9122d9ec27ff43d7c6b70c0fa3654dd1f30413638c095c606a1d1d902d01e4.jpg) + +![](images/2d51d0a82263e5a6c9eaa2a95a974513e79a1922e95f05e4b6f9256a7d117630.jpg) +UNIT + +![](images/4b48f74b7a30ea58d44a2310277488ce8fe15797388ac8c5c2c30432256f7472.jpg) +(a) Day to Night + +![](images/c95f36a9976abca34e4868e93be504b59f1f6676cd5538388900068aee5b0d16.jpg) + +![](images/3bb07e6ee1309c0351ad0fcc71c0e2446f004ce30c517500d8ef39f7c6f4612a.jpg) +MUNIT + +![](images/db5637c90512fbd3a3c2eb135eca254d658fd87c8507dbb5f93869e1727f1ac9.jpg) + +![](images/63a6ed6be7b1e4ce5e0f1fc353fac10df5b8f1b6312091b461e5a5ed7c1c0427.jpg) + +![](images/7bd1892ace71b44de4dd6cb6b9ea4d914e108323e45f94bd46ed36dcb5c8b16f.jpg) +LPTN + +![](images/be39de21206fe445e7ff9ddd9029ccd01e47039ff776788fb3ccd572c9668e00.jpg) + +![](images/a44e5f56d2baa270d6e67ee1c717153a8a54c02211774249d0aedba4b33bed40.jpg) + +![](images/da18554d9478579e90f7ce4e43dffb6601225743d14a7282cc6d282e43ba9397.jpg) + +![](images/e9f0d0596de54df3b7c8ec1d9a9257d3c731e9974a5bb0f083ecd982df86eb43.jpg) + +![](images/770a2326494bfe39b96b7f327a976d053e2b725f625f64f52eae710398409f9d.jpg) + +![](images/fef40f20778e3b1db94daaff6a0d698d2db2b361efabd6f3f892863ce7feaaae.jpg) + +![](images/171c7ce7fdc35d6d22675f1e6ea4cb04e40c4a227b61ae1549f193996932b12a.jpg) + +![](images/15042c742c3ce7d4addee150f4c101d70de15a98bfa5f5397bb42fa9a5d6563d.jpg) + +![](images/fd731497d821189ea61953bef6d3d9dbec55e130146f767f36bfc16dce9387ca.jpg) + +![](images/999ba39ccc34dea897ef8098f018c49600885309cb6949202f5a1894bcc776c6.jpg) + +![](images/09fa8368016cee719ca59bee7c5a1fe416f81b9185e3af6795cd962049086a7d.jpg) + +![](images/557886adda0c329a44c2361ae4ab608c0a69a26f0dc316b46f45edd214a5cc5c.jpg) + +![](images/ec372fba7fb8ed20a7aac0e8d54be7f14fb1e23d7dbebdfefcb0d373f029a533.jpg) + +![](images/6349f2630f3e96de141fcdfb8615f87cedd952c183554102e48e4004441b1777.jpg) + +![](images/b974beb9569518f91090bf080faaa84a1b08a07230a7fcb99b0259131260099f.jpg) + +![](images/dd45ab716bc791c52f7879db4131b3983d092ad6c4e51f9a58aeeb34bbb5fe0f.jpg) + +![](images/7756ef9d594e106372e12242708ce76fc94fd825cb0220092e64b869da9e8072.jpg) + +![](images/f90a1d71217b6b225fabeefc3c18734d0a2f1e82098c82e61b64b5be06fa219e.jpg) +Figure 4. Visual comparisons among different I2IT methods, i.e., CycleGAN, UNIT, MUNIT and the proposed LPTN, on three different I2I tasks. The red and yellow boxes in (a) and (b) zoom in the particular regions for a better observation. + +![](images/fb899b004ba7f7d60f4404b86488a989bee44b872b149c1c861bc2425ad2a23e.jpg) + +![](images/431ffcaf944a6daaa0fe4721dfdfd2e208f785beb6c619341c33ccaa511afce2.jpg) +(c) Photo Retouching + +![](images/c888596bd3991dd1002a5c8873c2f0b64ca70f1c314e9b29e09ab06a6a5437bc.jpg) + +![](images/2265cd0f9d407b76d0bf185eb859b2a626c1ec7a9de9895b5317d025e8ef0e39.jpg) + +tended to higher resolution applications with linear growth of time consumption. + +Considering the inherent property of the Laplacian pyramid, the proposed LPTN cannot handle the problem generating novel content details, e.g., synthesizing Cityscapes images from its semantic segmentation labels. Actually, existing methods such as pix2pix perform well on this task by modeling the visual contents in a deep network, which depends on pixel-wise supervision and have a drastic demand for computational resources. A major limitation of our method is about the processing of high frequency (HF) components. Our progressive masking strategy saves much computation but may introduce halo artifacts in the day to night task. A feasible solution is to leverage the sparsity property of HF components, and employ sparse convolution on HF components to achieve more flexible translation while maintaining high efficiency. + +# 4.4.Quantitative Examinations + +In this section, we quantitatively compare the LPTN to the state-of-the-art methods on photo retouching regarding the PSNR/SSIM and time consumption. + +Performance: To test the performance on matching the manually retouched targets, we conduct three groups of experiments with the resolution being 480p, 1080p and origi + +Table 1. Quantitative comparison on the MIT Adobe FiveK dataset (the photo retouching task). The N.A. denotes that the result is not applicable due to the limitation of computational resources. + +
Methods480p1080poriginal
PSNRSSIMPSNRSSIMPSNRSSIM
CycleGAN [33]20.980.83120.860.846N.A.N.A.
UNIT [23]19.630.81119.320.802N.A.N.A.
MUNIT [15]20.320.82920.280.815N.A.N.A.
White-Box [12]21.320.86421.260.87221.170.875
DPE [4]21.990.87521.940.885N.A.N.A.
LPTN, L = 322.120.87822.090.88322.020.879
LPTN, L = 422.100.87222.030.87021.980.862
LPTN, L = 521.940.86621.950.85821.890.862
+ +nal size (ranging from $3000 \times 2000$ to $6000 \times 4000$ ), respectively. As shown in Table 1, the proposed LPTN performs favorably against both the general I2IT and the photo retouching methods. For the photo retouching task defined in the fiveK dataset, the main difference between the inputs and targets lies in the global tone (regarding colors or illuminations, etc.) of the image. The general I2IT methods translate the global tone satisfactorily yet perform badly on + +Table 2. Comparison about the time consumption (in seconds) of different inference models. Each result is an average of 50 tests, where the N.A. denotes that the method cannot handle the image of specific resolution on a GPU with 11G RAM. + +
Methods480p1080p2K4K
CycleGAN [33]0.3250.562N.A.N.A.
UNIT [23]0.2940.483N.A.N.A.
MUNIT [15]0.3360.675N.A.N.A.
White-Box [12]2.8465.1236.5429.785
DPE [4]0.0320.091N.A.N.A.
LPTN, L = 30.0030.0120.0430.082
LPTN, L = 40.0020.0070.0150.033
LPTN, L = 50.00080.0050.0110.016
+ +reconstructing the details as shown in Figure 4 (c). The main reason is that the fiveK dataset is relatively small but contains various scenes in the testing set so that the decoder can hardly learn a reverse mapping against the encoder on all visual scenes. For the photo retouching methods such as DPE [4], in contrast, a skip connection between the input and output is added to improve the reconstruction performance. However, the connection may also bring the unaesthetic visual attributes of the input images to the outputs caused by an unsatisfactory disentanglement of domain-invariant contents and domain-specific attributes. Thanks to the full decomposition and the preservation of reconstruction capacity by adaptively refining the high-frequency components, the proposed LPTN performs well on the photo retouching task. + +Running Time: As shown in Table 2, the proposed LPTN outperforms other methods regarding the time consumption performance by a large gap, e.g., achieves about $\times 80$ speed-up against the CycleGAN on 1080p images when $L = 4$ , and runs on 4K images in real-time when $L = 5$ . According to Figure 2, the main optimization-based computations of the proposed method are concentrated on translating the low-frequency component $I_{L}$ and learning the mask for the last high-frequency component $h_{L-1}$ , where both $I_{L}$ and $h_{L-1}$ are of low-resolution. For example, to translate an 1080p image ( $I_{0} \in \mathbb{R}^{1920 \times 1080 \times 3}$ ) with $L = 4$ , we have $I_{L} \in \mathbb{R}^{120 \times 67 \times 3}$ and $h_{L-1} \in \mathbb{R}^{240 \times 135 \times 3}$ . Besides, thanks to the spatial correlations among the high-frequency components, the generation of higher-resolution masks is efficient since they only include a bilinear interpolation operation and two convolutional layers. + +# 4.5. User Study + +To evaluate the overall performance of the translation regarding both the photorealism and transformation effects, we perform a user study based on human perception. In specific, we randomly select 20 samples for the photore + +Table 3. User preference toward photorealistic day→night translation task. Participants are required to select out the most realistic and aesthetically pleasing result among the four methods. The images are shown in random order in each test. + +
Visual MetricsCycleGANUNITMUNITLPTN
Photorealism16.4%2.3%3.0%78.3%
Aesthetic21.3%12.7%8.5%57.5%
+ +alistic day $\rightarrow$ night and summer $\rightarrow$ winter translation tasks, respectively, and collect the translated results of the compared methods. A group of 20 participants are required to answer the following two questions after seeing the inputted images and all the compared results: 1) Photorealism: given the input image, which result is the most realistic one? 2) Transformation effectiveness: given the input image, which result is translated to the target style mostly? The results are summarized in Table 3. For example, the proposed LPTN achieves a score of $78.3\%$ and $50.2\%$ for the visual performance of photorealism and transformation effect on the day $\rightarrow$ night translation task, respectively. The results demonstrate that the proposed method performs better in preserving the content details and translating the images into target styles. The other three methods do not perform well on this subjective task since there are visible structural distortions and artifacts of their results. Some participants $(22.5\%)$ prefer the output of CycleGAN regarding the transformation effect. Such preference mainly happens in those scenes that do not contain abundant detail textures, e.g., scenes consisting of a large area of sky or sea. Similar performance can be found in the summer $\rightarrow$ winter translation task. + +# 5. Conclusion + +We proposed an highly-efficient framework for the photorealistic I2IT problem, which significantly reduces the computational burden when handling high-resolution images while simultaneously keeping the transformation performance. By using the Laplacian pyramid to decompose the input image, we disentangled the domain-specific visual attributes and the textures with tapering resolutions in an invertible manner and learned the translation and refinement networks on low-resolution components. A progressive masking strategy was then developed to adaptively refine the high-frequency components in order to generate a photorealistic result. The so-called Laplacian pyramid translation network (LPTN) was applied to a set of photorealistic I2IT tasks, exhibiting not only a much faster running speed but also comparable or superior translation performance. In particular, LPTN can run at real-time on 4K resolution images by using a desktop GPU. + +# References + +[1] Peter Burt and Edward Adelson. The laplacian pyramid as a compact image code. IEEE Transactions on communications, 31(4):532-540, 1983. 2, 3 +[2] Vladimir Bychkovsky, Sylvain Paris, Eric Chan, and Frédo Durand. Learning photographic global tonal adjustment with a database of input/output image pairs. In CVPR, 2011. 5 +[3] Dongdong Chen, Jing Liao, Lu Yuan, Nenghai Yu, and Gang Hua. Coherent online video style transfer. In ICCV, 2017. 2 +[4] Yu-Sheng Chen, Yu-Ching Wang, Man-Hsin Kao, and Yung-Yu Chuang. Deep photo enhancer: Unpaired learning for image enhancement from photographs with GANs. In CVPR, 2018. 1, 5, 7, 8 +[5] Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In NeurIPS, 2015. 3 +[6] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, 2015. 2 +[7] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. 2 +[8] Michael Gharbi, Jiawen Chen, Jonathan T Barron, Samuel W Hasinoff, and Frédo Durand. Deep bilateral learning for real-time image enhancement. ACM Transactions on Graphics, 36(4):118, 2017. 2 +[9] Golnaz Ghiasi and Charless C Fowlkes. Laplacian pyramid reconstruction and refinement for semantic segmentation. In ECCV, 2016. 3 +[10] Abel Gonzalez-Garcia, Joost van de Weijer, and Yoshua Bengio. Image-to-image translation for cross-domain disentanglement. In NeurIPS, 2018. 2 +[11] 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 +[12] Yuanming Hu, Hao He, Chenxi Xu, Baoyuan Wang, and Stephen Lin. Exposure: A white-box photo post-processing framework. ACM Transactions on Graphics, 37(2):26, 2018. 5, 7, 8 +[13] 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. 2 +[14] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017. 2 +[15] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In ECCV, 2018. 2, 5, 7, 8 +[16] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. 1, 2 +[17] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016. 2 +[18] Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In CVPR, 2017. 3 + +[19] Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In ECCV, 2018. 2 +[20] Xueting Li, Sifei Liu, Jan Kautz, and Ming-Hsuan Yang. Learning linear transformations for fast image and video style transfer. In CVPR, 2019. 2 +[21] Yijun Li, Ming-Yu Liu, Xueting Li, Ming-Hsuan Yang, and Jan Kautz. A closed-form solution to photorealistic image stylization. In ECCV, 2018. 2 +[22] Alexander H. Liu, Yen-Cheng Liu, Yu-Ying Yeh, and Yu-Chiang Frank Wang. A unified feature disentangler for multidomain image translation and manipulation. In NeurIPS, 2018. 2 +[23] Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In NIPS, 2017. 2, 5, 7, 8 +[24] Sifei Liu, Shalini De Mello, Jinwei Gu, Guangyu Zhong, Ming-Hsuan Yang, and Jan Kautz. Learning affinity via spatial propagation networks. In NeurIPS, 2017. 2 +[25] Fujun Luan, Sylvain Paris, Eli Shechtman, and Kavita Bala. Deep photo style transfer. In CVPR, 2017. 2 +[26] Liqian Ma, Xu Jia, Stamatios Georgoulis, Tinne Tuytelaars, and Luc Van Gool. Exemplar guided unsupervised image-to-image translation with semantic consistency. In ICLR, 2019. 1 +[27] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In ICCV, 2017. 5 +[28] Gilles Puy and Patrick Perez. A flexible convolutional solver for fast style transfers. In CVPR, 2019. 2 +[29] 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 CVPR, 2018. 1, 2, 5 +[30] Jaejun Yoo, Youngjung Uh, Sanghyuk Chun, Byeongkyu Kang, and Jung-Woo Ha. Photorealistic style transfer via wavelet transforms. In ICCV, 2019. 2 +[31] Rui Zhang, Tomas Pfister, and Jia Li. Harmonic unpaired image-to-image translation. In ICLR, 2019. 1 +[32] 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. In SIGGRAPH, 2017. 2 +[33] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 1, 2, 5, 7, 8 +[34] Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A Efros, Oliver Wang, and Eli Shechtman. Toward multimodal image-to-image translation. In NeurIPS, 2017. 2 \ No newline at end of file diff --git a/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/images.zip b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1c65b1cb737a5ca15a4c39d6190460fa36401f47 --- /dev/null +++ b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d2d5f42e86c93552fd257c645fb72a61989dadab6119af6b4f9749293b27bb3 +size 536558 diff --git a/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/layout.json b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..269b418b5fc6f971236a4e63af15f4c938c20d5b --- /dev/null +++ b/highresolutionphotorealisticimagetranslationinrealtimealaplacianpyramidtranslationnetwork/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88857060d86084f461a9d12dc46a609be4a8727f5efb3c17862cee0b94caa718 +size 452997 diff --git a/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_content_list.json b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..760248943916516e86adf0d275fd27f8fa4984b8 --- /dev/null +++ b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d12c960ff89b53446243f6fec1bed43ee7ea8cb1edeb80c82a96253ec236d457 +size 70949 diff --git a/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_model.json b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a8ba44561544f0840d0a0f1a4bdb447ad4ed0352 --- /dev/null +++ b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:384865f1b0cc3c6294c76c9480fc4a77ae79a6731867eea8da4b6572b171b8ac +size 88398 diff --git a/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_origin.pdf b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3e13bcae3719854d14ae4974225b770e8b78cc4d --- /dev/null +++ b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/27b59abb-3835-4fa4-86a3-9d63a54dffe5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35772fbd3d9604a73434e2d04205380727c40c2b57bad311534e00f694c8849f +size 5726386 diff --git a/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/full.md b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9fe691635d961a7b809fc9606fa3797f00c7dfff --- /dev/null +++ b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/full.md @@ -0,0 +1,320 @@ +# High-speed Image Reconstruction through Short-term Plasticity for Spiking Cameras + +Yajing Zheng $^{1\dagger}$ , Lingxiao Zheng $^{1\dagger}$ , Zhaofei Yu $^{1,2*}$ , Boxin Shi $^{1,2}$ , Yonghong Tian $^{1}$ , Tiejun Huang $^{1,2}$ + +$^{1}$ Department of Computer Science and Technology, Peking University + +$^{2}$ Institute for Artificial Intelligence, Peking University + +# Abstract + +Fovea, located in the centre of the retina, is specialized for high-acuity vision. Mimicking the sampling mechanism of the fovea, a retina-inspired camera, named spiking camera, is developed to record the external information with a sampling rate of $40,000\mathrm{Hz}$ , and outputs asynchronous binary spike streams. Although the temporal resolution of visual information is improved, how to reconstruct the scenes is still a challenging problem. In this paper, we present a novel high-speed image reconstruction model through the short-term plasticity (STP) mechanism of the brain. We derive the relationship between postsynaptic potential regulated by STP and the firing frequency of each pixel. By setting up the STP model at each pixel of the spiking camera, we can infer the scene radiance with the temporal regularity of the spike stream. Moreover, we show that STP can be used to distinguish the static and motion areas and further enhance the reconstruction results. The experimental results show that our methods achieve state-of-the-art performance in both image quality and computing time. + +# 1. Introduction + +High-speed imaging is desired in scientific imaging and professional photography for clearly recording fast-changing processes in physics experiments, rapidly moving particles in chemical reactions, fleeting moment in competitive sports and so on. The traditional digital camera records scenes with a constant shutter speed (e.g., 30 fps), which loses much visual information and suffers motion blur. High-speed cameras can output images with a relatively high time sampling frequency of millions Hz or even hundreds of millions Hz [1, 13]. However, enormous memory demands are needed to record these images. Moreover, high-speed cameras require specialized sensors that + +![](images/658a27a89dac486e749d73f42d877f6eb10f4767b2d40f6c93ccfb1475f32267.jpg) +Figure 1. Illustration of working mechanism for traditional cameras, event cameras, and spiking cameras. Traditional cameras acquire images according to the constant frame rate, event cameras generate asynchronous events for all pixels when brightness changes exceed a certain threshold, and spiking cameras continuously capture photons and generate asynchronous spike for all pixels when the accumulated intensity reaches a predefined threshold. + +are highly expensive, which cannot be widely used. + +Over the past decades, neuromorphic vision sensors [12] have attracted extensive attention with its bio-inspired visual recording mechanism. Unlike conventional cameras, which sample external light with the same exposure time for all pixels, the neuromorphic vision sensors mimic the retina's sampling process and generate asynchronously binary outputs for all pixels based on the scene radiance change. A commonly used neuromorphic vision sensors are dynamic vision sensors (DVS) (also called event cameras), in which events are generated only when the brightness change exceeds a certain threshold [22, 5, 9]. Event cameras have distinctive advantages over traditional frame cameras such as low-latency, sparse output, low power consumption, and high dynamic range. Despite this, it is difficult for an event camera to reconstruct textures in scenes as visual in + +formation of the static scenes is lost. Inspired by the sampling mechanism of primate fovea located in the retina center [34, 18], another retina-inspired camera named spiking camera has been developed in recent years [6, 7]. Each pixel of the spiking camera continuously captures photons and generates a spike when the accumulated intensity reaches a predefined threshold. An intuitive illustration for traditional cameras, event cameras, and spiking cameras is shown in Fig. 1. In spiking cameras, the pixels sensed different scene radiance will fire spikes with varying frequencies — the stronger the radiance is, the faster the spikes fire. Compared with event cameras, the spiking camera retains high-speed spatio-temporal information for both moving and static objects, which is ready-to-use for scene reconstruction. + +Recently, some scene reconstruction methods have been proposed by estimating the firing frequency of each pixel, as the photosensitive units receive different scene radiance will trigger spikes with different frequencies [38, 39, 36]. However, these methods require a predefined length of the time window, which often suffer the problems of motion blur and low image contrast if the window length is inappropriate. Besides, complex optimization algorithms are utilized to separate the motion and static areas as to make it impossible to reconstruct images in real-time. Therefore, how to estimate each pixel's firing frequency without a predefined time window and reconstruct the texture with high image quality and low latency is still unclear. + +In this paper, we develop a new high-speed image reconstruction approach through the short-term plasticity (STP) mechanism of the brain [31, 30]. By employing the output spiking streams as the input of spiking neural networks with STP [17], we derive the relationship between the time-varying firing frequency of each pixel and the dynamics of the postsynaptic neuron, and further infer the scene radiance and the pixel value of the reconstructed images. Moreover, as the dynamics of STP model will fluctuate around a stable value if the spike frequency changes, we introduce a motion extraction method with STP to enhance the reconstruction results. The experimental results show that the proposed methods are capable to reconstruct high-speed motion scenes with high quality in real-time, the performance of which outperform state-of-the-art approaches. + +# Contributions: + +- We propose bio-inspired image reconstruction methods by implicitly estimating each pixel's firing frequency rather than utilizing time windows. +- We propose a novel motion extraction method based on the STP dynamics intuitively, without using much extra computation while rebuilding scenes. +- The proposed methods outperform previous works in both image quality and computing time, which leverage spiking cameras' low latency to realize high-speed image reconstruction. + +# 2. Related Works + +Event-based Imaging. It is different for event cameras to reconstruct textures in scenes as visual information of the static scenes is lost. Some hybrid sensors combining event cameras and conventional digital cameras, such as ATIS [24], DAVIS [2], RGB-DAVIS imaging system [33, 11] and Celex [10], were developed in recent years. Based on these sensors, the scene could be reconstructed with high frame rate by combining events and frames directly [3, 21, 20, 28, 10] or warping the events to images [15, 29]. However, the difficulty in achieving reliable temporal synchronization between events and low-rate frames from traditional sensors makes them inapplicable in capturing the high-speed scene. + +In recent years, generating high-speed and high dynamic range videos with event cameras based on deep neural networks (DNNs) has become a mainstream trend. Inspired by [37, 27], Rebecq et al. [25, 26] trained a recurrent UNet architecture (E2VID) end-to-end with simulated data. These works are later improved by introducing a temporal consistency loss based on [14] and achieve the state of the art. Scheerlinck et al. [28] proposed a FireNet reducing the E2VID model complexity by $99\%$ with minor trade-offs in reconstruction quality. Except for using the recurrent architecture, generative adversarial networks (GANs) were used in [23, 32] to generate frames from events. Nevertheless, the computational cost of DNNs is high and does not leverage the low-power and the low-latency of event cameras. + +High-speed Imaging based on Spiking Cameras. Based on the temporal characteristic of spike streams generated by spiking cameras, some reconstruction methods have been proposed [38, 39, 36]. Zhu et al. [38] presented "texture from inter-spike-intervals (TFI)" and "texture from playback (TFP)" to rebuild the scenes according to the firing interval and firing rate, respectively. As there is a tradeoff between removing the motion blur and improving the image contrast, the length of the window needs to be carefully defined, which will significantly influence the results. To solve this problem, Zhu et al. [39] proposed to extract the motion area and reconstruct the static and motion area with different methods. Nevertheless, the motion extraction based on the graph cut needs to optimize the motion mask iteratively. Such an energy-based optimized way is time-consuming that diminishes the advantage of the low latency of spiking cameras. Zhao et al. [36] improved the signal to noise ratio by utilizing temporal correlations of signals, but it only applied to the scenes with linear motion. + +# 3. Preliminaries + +# 3.1. Short-term Plasticity + +Short-term plasticity refers to the short-term change of synaptic strength, which is usually between tens to thou + +![](images/96ae242a5a5cddf0db0648ce0a36be94dd4cce44fc4bdbe8f0e75ac85b3f7dbf.jpg) +Figure 2. The postsynaptic potential and current generated by STP with received spike streams from a presynaptic neuron. Left: The short-term depression dominated model, the parameters are $\tau_{D} = 750$ ms, $\tau_{F} = 50$ ms, $U = 0.45$ , $C = 0.3$ . Right: The short-term facilitation dominate model, the parameters are $\tau_{D} = 50$ ms, $\tau_{F} = 750$ ms, $U = 0.15$ , $C = 0.15$ . + +sands of milliseconds. STP is sensitive to presynaptic spikes' temporal-distribution regularity and can transiently change postsynaptic potential (PSP) amplitude accordingly. When a postsynaptic neuron receives a sequence of action potentials (spikes) from a presynaptic neuron, the PSP changes according to: + +$$ +\operatorname {P S P} (t) = A \cdot R (t) \cdot u (t), \tag {1} +$$ + +where $A$ denotes the maximum voltage value that an action potential can trigger on a postsynaptic neuron, $R(t)$ denotes the remaining number of available neurotransmitters in the axon at time $t$ , and $u(t)$ denotes the release probability of neurotransmitter in the axon at time $t$ . The following ordinary differential equations define the dynamics of $R(t)$ and $u(t)$ : + +$$ +\frac {d R (t)}{d t} = \frac {1 - R (t)}{\tau_ {D}} - u \left(t ^ {-}\right) R \left(t ^ {-}\right) \delta \left(t - t _ {s p}\right), \tag {2} +$$ + +$$ +\frac {d u (t)}{d t} = \frac {U - u (t)}{\tau_ {F}} + C [ 1 - u \left(t ^ {-}\right) ] \delta \left(t - t _ {s p}\right). \tag {3} +$$ + +Here $\delta(t)$ represents Dirac delta function, $C$ is a constant parameter that influences the change of $u(t)$ . Eq. 2 illustrates that the amount of neurotransmitters $R(t)$ decreases by $u(t^{-})R(t^{-})$ when a presynaptic spike releases at time $t_{sp}$ , and recovers to 1 with a depression time constant $\tau_{D}$ . Note, the notation $t^{-}$ denotes that these functions should be computed in the limit approaching the spike release time from below. Eq. 3 indicates that the release probability $u(t)$ increases by $C[1 - u(t^{-})]$ once a presynaptic spike fires, and decays back to baseline release probability $U$ with facilitation time constant $\tau_{F}$ . Similar to PSP, the postsynaptic current is formulated by: + +$$ +\frac {d \operatorname {P S C} (t)}{d t} = - \frac {\operatorname {P S C} (t)}{\tau_ {s}} + A \cdot R \left(t ^ {-}\right) \cdot u (t) \cdot \delta \left(t - t _ {s p}\right). \tag {4} +$$ + +![](images/acceeb5ceacb3461155328a180c40a88cc45ebc021cb36dec7b6054cc0f8b4b0.jpg) + +![](images/3734450b460491c3dc452b75e6b4b55423917b23fe5b096effb9a2b8e9f73514.jpg) + +![](images/43b0edfa87356cac97259dfca1e10459c4027744954fee19c1e6730e0a3e55ac.jpg) + +![](images/6445862415125072480225c9e9f627df0a3681004b15544c4a5fcc10b096610d.jpg) +Figure 3. Reconstruction results of TFP with different length of time window. Images in the blue dotted box are recovered with $w = 8$ , and images in the red dotted are recovered with $w = 32$ . + +![](images/27784d4043177f7865be738fd56307875bb82110715b3cca4607fecf1b302880.jpg) + +![](images/ced172d21c4ae5e12504ddc04a7486a9e242ecd56d2e951c3452474ba3da8ce9.jpg) + +![](images/27d2178e45eaf246e1f073798fc5fd6cb319b53941d659869d38cb9e47ca4134.jpg) + +![](images/1555466e0e039be4638cf54f1995e195559606857350760f44ec2f13dd53af29.jpg) + +Intuitively, the dynamics of $R(t)$ and $u(t)$ (Eq. 2 and Eq. 3) can be seen as two low-pass filters of the input spikes, and their cutoff frequencies are inversely proportional to time constants $\tau_{D}$ and $\tau_{F}$ . There are two types of STP named short-term depression and short-term facilitation, respectively. Short-term depression and short-term facilitation have opposite effects on synaptic efficacy, which can be seen in the middle and bottom of Fig. 2. Through adjusting the four parameters $\mathrm{STP}^{\theta} = \{\tau_{D},\tau_{F},U,C\}$ , STP can have forms being either short-term depression dominated or short-term facilitation dominated. + +# 4. Methods + +# 4.1. Overview of the method + +The previous works to reconstruct the scene can be summarized as estimating the firing frequency of each pixel [36, 38, 39]. Fig. 3 illustrates the reconstruction results of TFP [38] with different time windows. One can find that a short time window leads to lower contrast and less motion blur, while the long one has higher contrast and more motion blur. Thus, it requires an appropriate predefined length of the time window to estimate the firing frequency accurately, so as to make the texture relatively high contrast and avoid the motion blur. + +To mitigate the weakness of the setting of the time window, we set up the STP model at each pixel of the spiking cameras to record the temporal regularity of spikes implicitly. The dynamics of PSP regulated by STP is shown in Fig. 4a. We can find that PSP will converge to a steady value if the firing frequency of the input spike streams is fixed, no matter what type of STP is used. + +Moreover, the steady value of PSP, the number of vesicles $R$ , and the release probability $u$ are all monotone increasing functions of firing frequency (shown in Fig. 4b). As mentioned above, the firing frequency of the spike + +![](images/12918b00dfe03b95c443ddc45676e67ca4c8af8b03981f30462ccbdd7f871233.jpg) +Figure 4. (a): The dynamic of PSP regulated by STP. The dotted lines with different colors refer to spike trains with different frequencies, from $5\mathrm{Hz}$ to $30\mathrm{Hz}$ . The short-term facilitation and depression model has a mixture of properties of both short-term depression and short-term facilitation. (b): the steady value of PSP, the number of neurotransmitters $R$ , and the release probability $u$ with respect to different input frequencies. The results are obtained with a short-term facilitation and depression model. + +streams triggered by each photosensitive unit is proportional to the received scene radiance. Intuitively, we can estimate the scene radiance and the pixel value of the reconstructed images, as well as detect the motion area based on PSP. The details of our approach are presented in the following sections. + +# 4.2. Texture Reconstruction through STP + +By setting up the STP model at each pixel of the spiking cameras to record the output spike stream, we derive the equation between the time-varying firing frequency of each pixel and the dynamics of postsynaptic neuron. For the sake of derivation, and numerical implementation with simplicity and efficiency, the dynamics of $R(t)$ and $u(t)$ (Eq. 2 and Eq. 3) can be rewritten as the following difference equations by integrating between spikes $n$ and $n + 1$ : + +$$ +R _ {n + 1} = 1 - \left[ 1 - R _ {n} \left(1 - u _ {n}\right) \right] \exp \left(- \frac {\Delta t _ {n}}{\tau_ {D}}\right), \tag {5} +$$ + +$$ +u _ {n + 1} = U + \left[ u _ {n} + C (1 - u _ {n}) - U \right] \exp \left(- \frac {\Delta t _ {n}}{\tau_ {F}}\right), (6) +$$ + +where $R_{n}$ and $u_{n}$ denote the value of $R$ and $u$ between spikes $n$ and $n + 1$ , $\Delta t_{n}$ denotes the interval between spikes $n$ and $n + 1$ . Similar to [4], we set $C = U$ . If the spike rate $\rho$ keeps constant, $R$ and $u$ will converge to their steady-state values $R_{\infty}(\rho)$ and $u_{\infty}(\rho)$ : + +$$ +R _ {\infty} (\rho) = \frac {1 - \exp \left(- \frac {1}{\rho \tau_ {D}}\right)}{1 - \left[ 1 - u _ {\infty} (\rho) \right] \exp \left(- \frac {1}{\rho \tau_ {D}}\right)}, \tag {7} +$$ + +$$ +u _ {\infty} (\rho) = \frac {U + (C - U) \exp \left(- \frac {1}{\rho \tau_ {F}}\right)}{1 - (1 - C) \exp \left(- \frac {1}{\rho \tau_ {F}}\right)}. \tag {8} +$$ + +Conversely, assuming that the spike rate $\rho$ keeps constant and $R$ and $u$ have already converged to their steady-state values, we can estimate $\rho$ from $R$ and $u$ separately through Eq. (7) and Eq. (8): + +$$ +\rho_ {R} = - \frac {1}{\tau_ {D} \ln \left(\frac {1 - R}{1 - R (1 - u)}\right)}, \tag {9} +$$ + +$$ +\rho_ {u} = - \frac {1}{\tau_ {F} \ln \left(\frac {u - U}{C - U + u (1 - C)}\right)}. \tag {10} +$$ + +As the firing frequency of each pixel is proportional to the scene radiance, the estimated pixel value is a weighted average of $\rho_{R}$ and $\rho_{u}$ : + +$$ +\hat {P} _ {s t p} \propto w _ {1} \cdot \rho_ {R} + w _ {2} \cdot \rho_ {u}. \tag {11} +$$ + +By varying the weighted parameter $\boldsymbol{w} = \{w_{1}, w_{2}\}$ , we can control the contribution of $\rho_{R}$ and $\rho_{u}$ to the constructed image. Here the parameters are set as $\mathrm{STP}^{\theta 1} : \{\tau_{D} = 0.025 \, ms, \tau_{F} = 0.25 \, ms, C = U = 0.15\}$ . The steps of this methods (texture from short-term plasticity, TFSTP) are summarized in Algorithm 1. + +# Algorithm 1 Texture from STP (TFSTP) + +Input: Spike streams $S_{ij}$ + +Output: Estimated pixel value $\hat{P}_{ij}$ + +1: Initialize the parameters of STP, $\{\tau_D,\tau_F,U,C\}$ $R$ and $u$ , and the weight parameter $w$ +2: Compute $\Delta t_{n}$ using the spike data. +3: Update $R_{n+1}$ and $u_{n+1}$ using Eq. 5 and Eq. 6. +4: Estimated the firing frequency $\rho_{R}$ and $\rho_{u}$ using Eq. 9 and Eq. 10. +5: Estimate the pixel value using Eq. 11. + +Fig. 5 compares the STP dynamics $\{\rho_{R},\rho_{u},R,u\}$ for dark and bright area with different scene radiance. In the dark area without moving objects (green circle in Fig. 5b), the spikes generated by a spiking camera have a nearly constant frequency. Hence the corresponding STP dynamics will converge to the steady value rapidly. When the car in the scenes moves across the bright areas (red circle in Fig. 5b) between $0 - 3.5~ms$ there are some small-range fluctuations of the STP dynamics, but the overall trend is still converging towards the corresponding state of the bright place. + +# 4.3. Brightness Change Detection + +For most scenes, the TFSTP method proposed in Section 4.2 works pretty well. Nevertheless, for high-speed scenes with limited illumination, it may suffer from motion blur caused by rare spikes in the dark area, and the STP status is not updated in time. To solve this problem, we proposed another texture reconstruction method (texture from motion-based short-term plasticity, TFMSTP) based on detecting + +![](images/a518b68bf7cd704fde2c06af775a15c9ba792ee3916fa7c5a0ebb44133fa03f3.jpg) +Figure 5. Difference between STP dynamics of dark and bright area. (a): Spike raster and the corresponding STP dynamics of dark area (green circle in (b)). (b): Scenes reconstruction via Algorithm 1. (c): Spike raster and STP dynamics of bright area (red circle in (b)). + +![](images/a525484b41c4a90f0ac31dd861dbc51056379ae72b5e9a81cb37e223199b1bcd.jpg) +Figure 6. Illustration of the reconstruction process based on distinguishing the motion and static pixel through STP. + +the motion area with STP. Specifically, we first detect the brightness change to extract the motion area and then reconstruct the motion and static areas via TFP and STP, separately. + +Motion Determination. When there exists motion in the area, the STP value will vary around the steady value corresponding to the scene radiance (Fig. 5). Thus, we are able to detect the motion area by evaluating the STP dynamics, e.g. $R$ , and $u$ , which updates according to Eq. (5) and Eq. (6). The reconstruction process of TFMSTP is shown in Fig. 6, it begins with motion determination via STP. Since the number of vesicles $R$ fluctuates with a larger range than the lease probability $u$ in the short-term facilitation dominated model (shown in Fig. 2b), we detect pixels belonging to the motion + +area or not by using the difference between $R_{n}$ and $R_{n - 1}$ : + +$$ +\mathcal {M} _ {i, j} = \left\{ \begin{array}{l} 1, | R _ {n} (i, j) - R _ {n - 1} (i, j) | \geq \theta \\ 0, | R _ {n} (i, j) - R _ {n - 1} (i, j) | < \theta \end{array} , \right. \tag {12} +$$ + +where $\mathcal{M}_{i,j}$ denotes whether $\mathrm{pixel}(i,j)$ belongs to the motion area, and $\theta$ is a predefined global constant. + +Area Refinement. Except for finding the motion pixels, places along the moving trajectory of objects are also regarded as motion areas in our methods, which is achieved by feeding the $\mathcal{M}_{i,j}$ as the input voltage to a locally connected network consisted of leaky integrate-and-fire (LIF) neurons. The membrane potential $v(t)$ of LIF neuron + +![](images/becad2b51d5a61aa40a880cd25f3d0f3af5aaf6e86833db3182f5179a4eeed1a.jpg) +Figure 7. Example results of the Algorithm 2. (a): Motion mask $\mathcal{M}$ mentioned in Eq. 12. (b): The refined motion area $\chi$ obtained by Eq. 14. Yellow dots refer to states equal to 1, e.g. $\chi_{i,j} = 1$ or $\mathcal{M}_{i,j} = 1$ , while the black ones refer to zero. (c): The voltage $v$ of LIF neurons corresponding to the state of (b) (Eq. 13). (d): The estimated pixel value $\hat{P}'$ . + +changes according to: + +$$ +\tau_ {m} \frac {d v (t)}{d t} = - [ v (t) - v _ {\text {r e s t}} ] + I _ {i, j} (t), \tag {13} +$$ + +where $\tau_{m}$ is the membrane time constant, and $v_{rest}$ is the resting potential. The current $I_{i,j}$ of the neuron is the integrated result of neurons that locally connect to it, which is calculated as $I_{i,j} = \sum_{\boldsymbol{x}}\mathcal{M}_{\boldsymbol{x}}$ ( $\boldsymbol{x}$ is the location of neurons connected to the LIF neuron at $(i,j)$ ). In our cases, $\tau_{m}$ equals the sampling frequency $(25\mu s)$ of the spiking cameras. The LIF neuron will release spikes when the membrane potential exceeds a certain threshold $\vartheta$ , and the membrane potential is reset to the resting potential. The state of the LIF neuron is changed as: + +$$ +\chi_ {i, j} = \left\{ \begin{array}{l} 1, v \geq \vartheta \\ 0, v < \vartheta \end{array} \right. \tag {14} +$$ + +After that, areas with $\chi = 0$ are regarded as static pixels while the ones with $\chi = 1$ refer to motion pixels. For static pixels, we estimate the pixel value using Eq. 11 derived by STP, and for motion pixels (i.e. $\chi_{i,j} = 1$ ), intensity of pixels are obtained by TFP with a small moving window $w = 8$ . Therefore, we can achieve more texture details, high dynamic range, and low noise for the static area as well as low motion blur for the motion area. The proposed TFM-STP approach is summarized in Algorithm 2. In Fig. 7, we show some example results obtained when detecting the brightness change with our proposed method. With continuous input of spike streams, the STP dynamic of each pixel gradually converges to a steady state, and only the motion area has state change (i.e. $\mathcal{M}_{i,j} = 1$ in Fig. 7a). To detect the motion area in time, the STP parameters, in this case, are set as $\mathrm{STP}^{\theta 2}:\{\tau_D = \tau_F = 10ms,C = U = 0.15\}$ . The segmented motion region have a clearer and smoother contour after area refinement. (Fig. 7b and Fig. 7c). + +# Algorithm 2 TFMSTP + +Input: Spike streams $S_{i,j}$ + +Output: pixel value $\hat{P}_{i,j}^{\prime}$ , motion state $\chi_{i,j}$ . + +1: Initialize the parameters of STP, $\{\tau_{D},\tau_{F},U,C\}$ $R$ and $u$ , and the weighted parameter $w$ +2: Compute $\Delta t_{n}$ using the spike data. +3: Update $R(t)$ and $u(t)$ using Eq. 5 and Eq. 6. +4: Obtain $\mathcal{M}_{i,j}$ using Eq. 12. +5: Refine the area and get $\chi_{i,j}$ with Eq. 13 and Eq. 14. +6: Estimate pixel value $\hat{P}_{\chi = 1}^{\prime}$ with Algorithm 1. +7: Compute $\hat{P}_{\chi = 0}^{\prime}$ with TFP. + +# 5. Evaluation + +# 5.1. Datasets + +To test the proposed image reconstruction algorithms, we use a publicly available dataset, including spike sequences captured by the spike camera with a sampling rate of 40,000 Hz, which is also used in [39]. This dataset contains eight sequences, which can be divided into two categories: high-speed scenes with the object's motion (Class A) and high-speed scenes with camera's ego-motion (Class B). Class A includes "Balloon", "Car", "Rotation1" and "Rotation2". Among them, "Balloon" records a balloon filled with water being punctured by a needle, "Car" describes a car traveling at a speed of $100\mathrm{km/h}$ , "Rotation1" describes a disk with 2000 rpm (revolutions per minute), and "Rotation2" depicts a rotating fan with 2600 rpm. Class B includes "Forest", "Railway", "Train" and "Viaduct-bridge"(V-b). These four sequences are recorded by a spiking camera in a high railway with a speed of $350\mathrm{km/h}$ . + +# 5.2. Qualitative Measurement + +As shown in Fig. 8, our method is less noisy than other methods, while maintaining low motion blur. For the scenes of high-speed rotation characters without enough scene radiance, there still exists motion blur on the edges of rotating characters (Fig. 9) with TFI, Graph-based method [39], OF-based [36] and the proposed method TFsTP. For TFMSTP method, the motion blur can be effectively eliminated through reconstruct the static and motion pixels separately. Moreover, except the TFMSTP, all the other recovered results on the back of a monitor are suffer from the low contrast, which is shown in the first row of Fig. 9. As the parameters $(\mathcal{ST}\mathcal{P}^{\theta}:\{\tau_{D},\tau_{F},U,C\})$ setting are different in TFsTP and TFMSTP, the corresponding STP dynamics converged with different speed. When using the parameters $\mathrm{STP}^{\theta 2}$ (Section. 4.3), the STP dynamics of each pixel converges to a steady state quickly, bringing about reconstructed results on the static region with higher contrast (Fig. 10) using a few timestamp. The reconstructed videos + +![](images/a9ab642077137b6c7764fcb5b9401fe6c4867d9c33b72db000dfa7e3b693acee.jpg) +Figure 8. Reconstruction results of TFP $(w = 8)$ , TFI, GraphCut-based [39], OF-based [36], TFSTP (Ours). + +![](images/32998c3af130bdb80c17bca9d4c66a70a464dcb47b1e79d2a986bb74dd1935c8.jpg) + +![](images/687b24795df92728033961ae3ab71631d50b5cd612d44bf52743b9e4c3ef49a8.jpg) +Figure 9. Comparison among different reconstruction methods on the scenes of "rotation2". (b): Closeups of the reconstructed results on character "B", "A" and "E" at different moment (1 ms, 4.5 ms, 11 ms), respectively. + +![](images/854fc1932a0a08ad9c065af1871692612bf75de9243480ecb96d4bda96758fab.jpg) +Figure 10. Comparison between reconstruction results through TFSTP with different parameters setting. The left image is reconstructed with the first set of STP parameters $\mathrm{STP}^{\theta 1}$ , and the right one with $\mathrm{STP}^{\theta 2}$ . + +of all methods can be found in supplementary material. + +# 5.3.Quantitative Evaluation + +For quantitative evaluation, we first apply the reconstruction methods on a simulated dataset (supplementary material), and compare the TFP, TFI, GraphCut-based, OF-based, and TFSTP methods against the ground truth. As the synthesized dataset is generated only with the camera's ego + +
MetricTFP(w=8)TFIGraphCut-basedOF-basedTFSTP
PSNR19.9616.9219.0316.4623.15
SSIM0.37760.61250.74450.70760.7300
+ +Table 1. Referenced quantitative evaluation using simulated data + +motion, it is unnecessary to distinguish the static and motion areas. Thus the TFMSTP method is not compared here. The results are reported in Tab. 1. The proposed TFMSP method achieves the best results in PSNR, and gets comparable results as GraphCut-based method in SSIM. The reconstruction results of our method are less noisy than GraphCut-based method (supplementary material). + +Furthermore, to verify the effectiveness of the proposed methods on real-world data, we employ three no-reference image quality assessment metrics, namely two-dimensional (2-D) entropy [35], standard deviation and BIQI [19]. 2-D entropy uses both the gray value of a pixel and its local average gray value to evaluate the amount of information + +
MetricMethodClass A (Object motion)Class B (Camera's ego motion)Average
BalloonCarRotation1Rotation2ForestRailwayTrainV-b
2-D entropy ↑TFP [38]3.885.534.004.805.305.336.036.015.11
TFI [38]12.057.5011.3810.218.489.028.247.499.30
GraphCut-based [39]9.759.5811.1011.0511.3511.2910.6010.4610.65
OF-based [36]7.119.647.338.439.9610.439.7910.539.15
TFSTP (ours)13.4513.4513.8212.9113.4413.7112.8613.6413.41
TFMSTP (ours)13.0112.0113.1212.4812.6212.8611.2812.8912.53
standard deviation ↑TFP [38]46.4146.09127.4587.3951.7768.4559.8256.9968.04
TFI [38]72.9168.9971.0369.3168.4466.0566.3863.7268.35
GraphCut-based [39]31.8358.3427.0437.7446.9437.8266.4936.3142.81
OF-based [36]17.9447.017.0520.3623.0424.4846.4427.7026.75
TFSTP (ours)73.9474.1872.9173.1573.6973.4473.6073.5273.55
TFMSTP (ours)74.3974.8474.2977.2373.3174.5677.1674.0174.97
BIQI ↓(the lower, the better)TFP [38]61.6153.7675.9385.6162.1966.1758.2355.1164.83
TFI [38]71.3361.2781.6439.3383.9778.8564.4866.1368.38
GraphCut-based [39]37.2628.4052.4023.8945.5136.6234.3029.4635.98
OF-based [36]38.1432.9569.0636.2952.1351.0838.4931.5443.71
TFSTP (ours)53.0141.3054.8017.6828.2828.7526.5239.9736.29
TFMSTP (ours)45.0725.8246.7117.8332.8122.3024.7329.7030.62
+ +Table 2. Comparison among different reconstruction methods. + +carried by the image, larger 2-D entropy means more information. Standard deviation evaluates the contrast of the image, and larger standard deviation means higher contrast. BIQI considers JPEG quality, JP2K quality, noise, motion blur and fast fading of the image. Different from the former two metrics, a lower BIQI score indicates higher image quality. + +As shown in Tab. 2, our methods achieve better results than other methods in almost all three metrics, which is consistent with subjective observation in Fig. 8 and Fig. 9. Note that TFP shows abnormally high standard deviation on dataset "Rotation1" and "Rotation2", which is caused by the high noise in the reconstruction image (see the first row of Fig. 8). By comparing our two methods, we find that TFSTP performs slightly better in 2-D entropy while TFMSTP is slightly better in standard deviation and BIQI. + +# 5.4. Computational Complexity + +Here we evaluate the computational complexity of our methods. For comparison, we consider the problem of reconstructing a $K$ -frame video with a size $H \times W$ . For each pixel, the TFSTP method only needs to update $R$ , $u$ , $\rho_{R}$ , $\rho_{u}$ when a spike generates at that pixel. Therefore, it needs at most $K$ updates for each pixel. The time complexity of the TFSTP method is $O(HWK)$ . Note that writing a $H \times W \times K$ video into the memory also takes $O(HWK)$ time, so our reconstruction method has reached the minimum asymptotic time complexity in theory. + +Different to TFSTP, the TFMSTP method needs extra steps to determine whether a pixel belongs to the motion area or not with Eq. 12. However, this only takes constant time for each pixel. It does not affect the asymptotic time complexity. + +In comparison, the GraphCut-based method in [39] takes at least $O(H^{3}W^{3})$ time to implement graph cut for each frame, thus it takes at least $O(H^{3}W^{3}K)$ time to reconstruct a $K$ -frame video. The OF-based method in [36] takes $O(H \cdot W \cdot K \cdot T \cdot iter)$ time to reconstruct a $K$ -frame video. Therefore, our methods achieve a significantly lower time complexity than other methods. + +# 6. Conclusions + +In this paper, we propose a novel bio-inspired image reconstruction method for spiking cameras. Distinct from previous works, the spatiotemporal statics of spike streams is recorded implicitly by the short-term plasticity. By analyzing the dynamic characteristic of STP, we are able to infer the scene radiance and the pixel value of the reconstructed images. Besides, we show that STP can also be used to exact motion area to enhance reconstruction results. The theoretical analysis and experimental results show that our methods can reconstruct high-quality images with low computational complexity. Moreover, as the spiking cameras are one of the time-to-saturate cameras [8], our reconstruction methods can also be applied to other cameras developed based on similar principles (e.g. SPAD [16]). + +# 7. Acknowledgement + +This work is supported by National Natural Science Foundation of China (62027804, 62088102, 61825101, 61961130392), and Beijing Academy of Artificial Intelligence (BAAI). We thank Lin Zhu and Jing Zhao for providing the code and data. + +# References + +[1] DK Bradley, PM Bell, OL Landen, JD Kilkenny, and J Oertel. Development and characterization of a pair of 30-40 ps x-ray framing cameras. Review of Scientific Instruments, 66(1):716-718, 1995. 1 +[2] Christian Brandli, Raphael Berner, Minhao Yang, Shih-Chii Liu, and Tobi Delbruck. A $240 \times 180$ 130 db $3\mu s$ latency global shutter spatiotemporal vision sensor. IEEE Journal of Solid-State Circuits, 49(10):2333-2341, 2014. 2 +[3] Christian Brandli, Lorenz Muller, and Tobi Delbruck. Realtime, high-speed video decompression using a frame-and event-based davis sensor. In 2014 IEEE International Symposium on Circuits and Systems, 2014. 2 +[4] Rui P Costa, P Jesper Sjostrom, and Mark CW Van Rossum. Probabilistic inference of short-term synaptic plasticity in neocortical microcircuits. Frontiers in Computational Neuroscience, 7:75, 2013. 4 +[5] Tobi Delbrück, Bernabe Linares-Barranco, Eugenio Culurciello, and Christoph Posch. Activity-driven, event-based vision sensors. In Proceedings of 2010 IEEE International Symposium on Circuits and Systems, 2010. 1 +[6] Siwei Dong, Tiejun Huang, and Yonghong Tian. Spike camera and its coding methods. In Data Compression Conference, 2017. 2 +[7] Siwei Dong, Lin Zhu, Daoyuan Xu, Yonghong Tian, and Tiejun Huang. An efficient coding method for spike camera using inter-spike intervals. In Data Compression Conference, 2019. 2 +[8] Abbas El Gamal. High dynamic range image sensors. In Tutorial at International Solid-State Circuits Conference, volume 290, 2002. 8 +[9] Guillermo Gallego, Tobi Delbruck, Garrick Orchard, Chiara Bartolozzi, Brian Taba, Andrea Censi, Stefan Leutenegger, Andrew Davison, Jorg Conradt, Kostas Daniilidis, et al. Event-based vision: A survey. arXiv preprint arXiv:1904.08405, 2019. 1 +[10] Menghan Guo, Jing Huang, and Shoushun Chen. Live demonstration: A $768 \times 640$ pixels 200meps dynamic vision sensor. In IEEE International Symposium on Circuits and Systems, 2017. 2 +[11] Jin Han, Chu Zhou, Peiqi Duan, Yehui Tang, Chang Xu, Chao Xu, Tiejun Huang, and Boxin Shi. Neuromorphic camera guided high dynamic range imaging. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. 2 +[12] Giacomo Indiveri and Rodney Douglas. Neuromorphic vision sensors. Science, 288(5469):1189-1190, 2000. 1 +[13] J Itatani, F Quéré, Gennady L Yudin, M Yu Ivanov, Ferenc Krausz, and Paul B Corkum. Attosecond streak camera. Physical Review Letters, 88(17):173903, 2002. 1 +[14] Wei-Sheng Lai, Jia-Bin Huang, Oliver Wang, Eli Shechtman, Ersin Yumer, and Ming-Hsuan Yang. Learning blind video temporal consistency. In Proceedings of the European Conference on Computer Vision, 2018. 2 +[15] Han-Chao Liu, Fang-Lue Zhang, David Marshall, Luping Shi, and Shi-Min Hu. High-speed video generation with an + +event camera. The Visual Computer, 33(6-8):749-759, 2017. 2 +[16] Sizhuo Ma, Shantanu Gupta, Arin C Ulku, Claudio Bruschini, Edoardo Charbon, and Mohit Gupta. Quanta burst photography. ACM Transactions on Graphics (TOG), 39(4):79-1, 2020. 8 +[17] Wolfgang Maass. Networks of spiking neurons: The third generation of neural network models. Neural Networks, 10(9):1659-1671, 1997. 2 +[18] Richard H Masland. The neuronal organization of the retina. Neuron, 76(2):266-280, 2012. 2 +[19] AK Moorthy and AC Bovik. A modular framework for constructing blind universal quality indices. IEEE Signal Processing Letters, 17, 2009. 7 +[20] Liyuan Pan, Richard Hartley, Cedric Scheerlinck, Miaomiao Liu, Xin Yu, and Yuchao Dai. High frame rate video reconstruction based on an event camera. arXiv preprint arXiv:1903.06531, 2019. 2 +[21] Liyuan Pan, Cedric Scheerlinck, Xin Yu, Richard Hartley, Miaomiao Liu, and Yuchao Dai. Bringing a blurry frame alive at high frame-rate with an event camera. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. 2 +[22] Lichtsteiner Patrick, Christoph Posch, and Tobi Delbruck. A 128x 128 120 db $15\mu$ s latency asynchronous temporal contrast vision sensor. IEEE Journal of Solid-state Circuits, 43:566-576, 2008. 1 +[23] Stefano Pini, Guido Borghi, and Roberto Vezzani. Learn to see by events: Color frame synthesis from event and rgb cameras. In International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications, 2020. 2 +[24] Christoph Posch, Daniel Matolin, and Rainer Wohlgenannt. An asynchronous time-based image sensor. In 2008 IEEE International Symposium on Circuits and Systems, 2008. 2 +[25] Henri Rebecq, René Ranftl, Vladlen Koltun, and Davide Scaramuzza. Events-to-video: Bringing modern computer vision to event cameras. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. 2 +[26] Henri Rebecq, René Ranftl, Vladlen Koltun, and Davide Scaramuzza. High speed and high dynamic range video with an event camera. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 2 +[27] 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, 2015. 2 +[28] Cedric Scheerlinck, Nick Barnes, and Robert Mahony. Continuous-time intensity estimation using event cameras. In Asian Conference on Computer Vision, 2018. 2 +[29] Prasan Shedligeri and Kaushik Mitra. Photorealistic image reconstruction from hybrid intensity and event-based sensor. Journal of Electronic Imaging, 28(6):063012, 2019. 2 +[30] Misha Tsodyks, Klaus Pawelzik, and Henry Markram. Neural networks with dynamic synapses. *Neural Computation*, 10(4):821-835, 1998. 2 + +[31] Misha V Tsodyks and Henry Markram. The neural code between neocortical pyramidal neurons depends on neurotransmitter release probability. Proceedings of the National Academy of Sciences, 94(2):719-723, 1997. 2 +[32] Lin Wang, Yo-Sung Ho, Kuk-Jin Yoon, et al. Event-based high dynamic range image and very high frame rate video generation using conditional generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. 2 +[33] Zihao W Wang, Peiqi Duan, Oliver Cossairt, Aggelos Katsaggelos, Tiejun Huang, and Boxin Shi. Joint filtering of intensity images and neuromorphic events for high-resolution noise-robust imaging. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. 2 +[34] Heinz Wässle. Parallel processing in the mammalian retina. Nature Reviews Neuroscience, 5(10):747-757, 2004. 2 +[35] Li Xi, Liu Guosui, and Jinlin Ni. Autofocusing of isar images based on entropy minimization. IEEE Transactions on Aerospace and Electronic Systems, 35(4):1240-1252, 1999. 7 +[36] Jing Zhao, Ruiqin Xiong, and Tiejun Huang. High-speed motion scene reconstruction for spike camera via motion aligned filtering. In 2020 IEEE International Symposium on Circuits and Systems, 2020. 2, 3, 6, 7, 8 +[37] Alex Zihao Zhu, Liangzhe Yuan, Kenneth Chaney, and Kostas Daniilidis. Ev-flownet: Self-supervised optical flow estimation for event-based cameras. arXiv preprint arXiv:1802.06898, 2018. 2 +[38] Lin Zhu, Siwei Dong, Tiejun Huang, and Yonghong Tian. A retina-inspired sampling method for visual texture reconstruction. In IEEE International Conference on Multimedia and Expo, 2019. 2, 3, 8 +[39] Lin Zhu, Siwei Dong, Jianing Li, Tiejun Huang, and Yonghong Tian. Retina-like visual image reconstruction via spiking neural model. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. 2, 3, 6, 7, 8 \ No newline at end of file diff --git a/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/images.zip b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b95f0ad85471ccde27f65dfb740562773bbbf5dc --- /dev/null +++ b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a763f4f7d16204637d485458319133270b754cf9913af8db81803514396c4cd +size 849139 diff --git a/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/layout.json b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0337a14052f1d8221f05885822f734c98d5f6e37 --- /dev/null +++ b/highspeedimagereconstructionthroughshorttermplasticityforspikingcameras/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47d31639a941de11bd5d51612d15e1ed5765ac9a10268358a6c34bddaca00e6a +size 444270 diff --git a/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_content_list.json b/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..dea009e4581de92b1e0251958018668bc3ed6643 --- /dev/null +++ b/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:924798a99308f365e9d3ba5ddb29c68bf54b69f4976f54c6880cfe76e28b9a60 +size 73606 diff --git a/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_model.json b/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_model.json new file mode 100644 index 0000000000000000000000000000000000000000..618694f4306d9c495d2c3415b808fd0f0b9cab6b --- /dev/null +++ b/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77496d338c57219409ab32ee7e83fc6b77c53d5a7f9da49957f54a64ab0a353a +size 86067 diff --git a/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_origin.pdf b/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..393c73470a090b969c47d78d112b90ccf6c6a91e --- /dev/null +++ b/hijackganunintendeduseofpretrainedblackboxgans/83b8d549-cf60-4e62-a03f-e4e53bee2d29_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:330f0c5db60078a9c33b09554578ad17f90f1d20d9e12a997d901b25594f3355 +size 3195513 diff --git a/hijackganunintendeduseofpretrainedblackboxgans/full.md b/hijackganunintendeduseofpretrainedblackboxgans/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0b00e8fe822a8fdd901d57412052d2fc9789c3d2 --- /dev/null +++ b/hijackganunintendeduseofpretrainedblackboxgans/full.md @@ -0,0 +1,345 @@ +# Hijack-GAN: Unintended-Use of Pretrained, Black-Box GANs + +Hui-Po Wang $^{1}$ Ning Yu $^{2,3}$ Mario Fritz $^{1}$ + +$^{1}$ CISPA Helmholtz Center for Information Security, Germany + +$^{2}$ Max Planck Institute for Informatics, Saarland Informatics Campus, Germany + +3University of Maryland, College Park + +# Abstract + +While Generative Adversarial Networks (GANs) show increasing performance and the level of realism is becoming indistinguishable from natural images, this also comes with high demands on data and computation. We show that state-of-the-art GAN models – such as they are being publicly released by researchers and industry – can be used for a range of applications beyond unconditional image generation. We achieve this by an iterative scheme that also allows gaining control over the image generation process despite the highly non-linear latent spaces of the latest GAN models. We demonstrate that this opens up the possibility to re-use state-of-the-art, difficult to train, pre-trained GANs with a high level of control even if only black-box access is granted. Our work also raises concerns and awareness that the use cases of a published GAN model may well reach beyond the creators' intention, which needs to be taken into account before a full public release. Code is available at https://github.com/a514514772/hijackgan. + +# 1. Introduction + +Generative Adversarial Nets (GANs) [14] have achieved remarkable success in many applications, such as image synthesis [20, 19, 21] and image translation [8, 10, 9, 33]. By learning a mapping between noise and images, the models are skilled to produce photo-realistic images from random noise. However, as the architectures become sophisticated [20, 19, 7], training modern GANs often requires massive data and computation resources. For example, it takes one high-quality face dataset, 8 V100 GPUs, and one week to train a single StyleGAN [1] model. In light of this trend, it is crucial to reuse existing pre-trained GANs, such as those being released by researchers or industry, for building green AI systems, in which the critical factor is to achieve other tasks beyond the original intention of GANs. + +To reuse GANs for other tasks, prior works have shown that semantic manipulation can be realized by vector arith- + +metic [23] or moving along constant attribute vectors [13, 28, 25, 12] in latent spaces. For instance, InterfaceGAN [25] demonstrates that facial attribute manipulation can be achieved by moving noise close to or away from the linear decision boundary of the desired attribute. Although these methods reveal the potential that pre-trained GANs could go beyond unconditional generation, they highly rely on the assumption of linear manifolds, thereby ignoring the nature of highly non-linear latent spaces (e.g., $\mathcal{Z}$ -space of StyleGAN [25, 34]). This strong assumption could be harmful, especially for rare attributes, and lead to ineffective manipulation. + +Inspired by this observation, we propose a novel framework, which gains high-level control over unconditional image generation by iteratively traversing the non-linear latent spaces. Specifically, we first train a proxy model that bypasses the gradients from one pretrained GAN and other fixed task models, and then dynamically decides the moving direction in each step, thus producing smoother and more effective attribute transition. Next, we propose an orthogonal constraint to solely edit the attribute of interest while retaining others in images. Despite only black-box access, we show that our method can achieve various unintended tasks, including manipulation over facial attributes, head poses, and landmarks. + +As a result of our experiments, we find that our framework with pre-trained GANs not only facilitates other vision tasks but raises concerns regarding further usage. Even without access to model parameters, the models can still be applied to unintended tasks potentially for malicious purposes. The owners of GANs should be aware and cautious about the potential risks before releasing their models. Overall, our contributions are summarized below. + +- We propose a framework which leverages off-the-shelf GANs to approach unintended vision tasks in a black-box setting. +- We propose a constraint that helps our framework solely edit the attribute of interest while retaining others in images. + +- Extensive results show that our method can produce smoother and more effective manipulation while preserving non-target attributes better, as compared to prior work. We also shed light on the potential risks of unintended usage by gaining control over facial attributes, head poses, and landmarks. + +# 2. Related Work + +Generative Adversarial Nets (GANs). Since GAN [14] was proposed, it has advanced many applications such as image synthesis [1, 19, 21] and image translation [8, 10, 9, 33]. The rationale behind it is to map noise drawn from a simple distribution (e.g., Gaussian) to a real data distribution (e.g., images) by non-linear networks. Many works [20, 7, 19, 21, 30, 4] have been proposed to improve image quality while the demands on resources also significantly increase. In this work, we consider two state-of-the-art GANs, PGGAN [19] and StyleGAN [20], as our generator backbones. The former one takes a vector of noise as input and progressively upsamples features to generate images. The later one adopts a similar strategy but first embed the noise vector by neural networks and treat them as style representations. As observed by Shen et al. [25], the $z$ -space of StyleGAN is expected to be more entangled than PGGAN. In general, GAN models for new tasks are often trained from scratch, making them inefficient and difficult to scale up. With our framework, we show that pre-trained GANs can well approach a range of applications beyond their original purposes. + +Study on Latent Spaces of GANs. A considerable amount of works has attempted to understand the latent space of GANs. In particular, [23, 28] show that semantic manipulation is achievable by vector arithmetic on latent code; [20] show that style transfer can be achieved by mixing two latent represents. Some studies have attempted to identify semantically meaningful directions by self-supervised learning [29] or PCA on latent spaces [15]. They are able to perform transformations by moving noise toward the direction. However, since they approach it in an unsupervised fashion, they may be limited to generalize to new tasks beyond simple transformations. + +Recent works further indicate that various semantic meanings may be implicitly encoded in the latent space of pre-trained GANs even though the concepts are not specified in the training set, ranging from memorability [13], transformation [18], to facial attributes [25, 12, 27]. For instance, InterfaceGAN [25] uses the normal vector of the SVM decision boundary to edit facial attributes by moving noise along the vector. Notably, most of the works mentioned above assume that the manifolds expand linearly in the latent space, ignoring that the underlying manifold could be extremely non-linear. In contrast to the prior + +works, we propose a general framework that can be applied to various vision applications by traversing the non-linear manifolds in an iterative scheme. + +Study on Leveraging Pre-trained GANs. Recently, several studies have investigated how to leverage existing GANs to achieve new tasks. One way is to treat pretrained GANs as strong image priors, which can be achieved by either exploiting GANs as a component of their networks [22, 5, 6, 17, 3] or directly editing the latent code to find feasible solutions [1, 2, 11]. These methods often require access to model parameters or additional training data. In contrast, this work aims to study the potential usage of black-box pretrained GANs, advising the owners to be careful about the risk before releasing models. + +# 3. Hijack-GAN + +In this section, we first formalize the problem and then describe how to reuse models by our framework, followed by a proposed orthogonal constraint to improve disentanglement ability. Lastly, we discuss the practical considerations. The overall architecture is shown in Figure 1. + +# 3.1. Problem Statement + +We aim to study the possibility that pre-trained GANs can be used for unintended applications beyond unconditional generation. Specifically, we consider a victim generator $G: z \to I$ that maps noise $z \sim p(z)$ to realistic images $I$ , and one or multiple victim task models $\mathcal{M}: I \to A$ that map images $I$ to the attributes space $A$ . We aim to find a trajectory $\mathcal{T}$ in the latent space $p(z)$ such that, as traversing along the path, the desired task can be gradually achieved, which can be further expressed as follows: + +$$ +\mathcal {L} \circ \mathcal {M} \circ G (z ^ {(i + 1)}) \leq \mathcal {L} \circ \mathcal {M} \circ G (z ^ {(i)}), \forall z ^ {(i)} \in \mathcal {T}, \tag {1} +$$ + +where $\mathcal{L}$ is the loss function of unintended tasks. Note that the parameters and training data for the task are inaccessible, making it impossible to be directly solved by optimization methods since they require the gradients from the models. + +# 3.2. Non-linear Traversal + +To identify a meaningful trajectory in the black-box setting, we have to address the following two issues: (1) the gradients from the GAN and the task models are impassable. (2) we need to identify a trajectory that precisely describes the highly non-linear manifolds. + +Since the gradients are impassable, we first train a proxy model $\mathcal{P}$ to distill the information from the models. We assume that only $z$ -space is available and synthesize data pairs $(z,\mathcal{M}\circ G(z))$ to train the proxy model such that it can map input noise to the attribute space; therefore, we + +![](images/32362ee6390608dacd06b1b21b696f51042438e58230ed5cbaa3bd647009e5b8.jpg) +Figure 1. An overview of the proposed framework. The framework takes two steps to reuse GANs: (a) train a proxy model to distill information from pre-trained models, circumventing accessing the gradients of pre-trained models; (b) identify and iteratively traverse a non-linear trajectory under the guidance of gradients. + +![](images/f1b6ea59c4c20c810fa7ed2555655b66a83f65ed719d476d1c0bf950bc52985d.jpg) + +circumvent directly accessing the gradients while remaining informed about the relation between attributes and noise. Next, we compute the Jacobian matrix of the proxy model $\mathcal{P}$ with respect to the input noise $z\in \mathbb{R}^n$ + +$$ +\mathbf {J} = \left[ \begin{array}{c c c} \frac {\partial \mathcal {P} _ {1}}{\partial z _ {1}} & \dots & \frac {\partial \mathcal {P} _ {1}}{\partial z _ {n}} \\ \vdots & \ddots & \vdots \\ \frac {\partial \mathcal {P} _ {m}}{\partial z _ {1}} & \dots & \frac {\partial \mathcal {P} _ {m}}{\partial z _ {n}} \end{array} \right], \tag {2} +$$ + +where $\mathcal{P}_j$ denotes j-th attributes predicted by the proxy. Each row vector of the matrix $\mathbf{J}$ , termed $\mathbf{J}_j$ for simplicity, can be interpreted as the direction in which the corresponding attribute changes most quickly; meanwhile, this vector also gives us a hint to identify a meaningful non-linear trajectory. + +In light of this, we design an algorithm that iteratively updates the position of noise under the guidance of the vector $\mathbf{J}_j$ : + +$$ +z ^ {(i + 1)} = z ^ {(i)} - \lambda \mathbf {J} _ {j} ^ {(i)}, \tag {3} +$$ + +where $\lambda$ is a hyper-parameter deciding moving speed and $\mathbf{J}_j^{(i)}$ is associated with the attribute of interest at step i. Note that we normalize the $\mathbf{J}_j^{(i)}$ to better control the level of changes. By repeatedly computing Eq. 3 in each step, the target attribute in the generated image $G(z)$ would be gradually modified, granting us high-level control over image generation despite the black-box access. + +# 3.3. Constraint for Disentanglement + +In many cases, attributes may be entangled with each other, meaning that other non-target attributes would be changed if we solely follow the steepest direction in Eq. 3. To alleviate the problem, we additionally propose a constraint to encourage disentanglement. Since each row vector $\mathbf{J}_j$ in Eq. 2 represents one direction that affects certain attributes most, we aim to find a vector which have the maximum inner product with the target direction $\mathbf{J}_j$ while being + +orthogonal to other non-target directions $\mathbf{J}_{k\neq j}$ . We formulate the constraint as a linear program as follows. + +$$ +\underset {n} {\text {m a x i m i z e}} \quad \mathbf {J} _ {j} ^ {T} n \tag {4} +$$ + +$$ +\text {s u b j e c t} A n = 0, +$$ + +where $n$ is the direction vector of interest, and each row of $A$ consists of the attribute vector $\mathbf{J}_{k \neq j}$ on which we want to condition. By substituting $n$ for $\mathbf{J}_j^{(i)}$ in Eq. 3, we can solely edit the attribute of interest while retaining other non-target attributes in the image. Note that since Eq. 4 is evaluated at each iteration, we are still capable of capturing the nonlinear manifolds. + +# 3.4. Implementation + +We consider two state-of-the-art GANs, PGGAN [19] and StyleGAN [20], as the victim generators. The input of both models is 512-D noise drawn from a standard normal distribution. Following Shen et al. [25], we do not normalize the input noise for both models. The proxy models are implemented by a stack of fully-connected layers. Except for the last layer, each layer is followed by a ReLU activation function and a Dropout [26] layer with a rate of 0.2. We empirically find that a proxy model with 3 layers works sufficiently well for PGGAN, while it takes 8 layers to work on StyleGAN. It is also observed that the Dropout function plays a critical role to prevent over-fitting on StyleGAN. These observations imply that the $z$ -space of StyleGAN may be highly entangled and non-linear. + +For attribute manipulation, we find it important to train the proxy models with balanced datasets. We synthesize datasets for every attribute, each of which involves 100k positive and 100k negative samples. Since the annotations are unavailable, we adopt a ResNet-50 [16] classifier pretrained on CelebAHQ [19] to annotate the generated images. We discard data with confidence lower than 0.9 to reduce the ambiguity. For other regression tasks, we generate random samples over the latent space and discard those with lower confidence. It is also observed that the proxy model + +on StyleGAN benefits from more training data, while the effect is marginal on PGGAN. + +# 4. Experiments + +In this section, we provide analysis of our non-linear iterative scheme by applying it to attribute manipulation, head pose manipulation, and landmark editing, showing that our method benefits from the non-linearity and demonstrates the possibility of unintended usage. + +# 4.1. Experiment Setup + +Settings. We take two state-of-the-art GANs, StyleGAN [20] and PGGAN [19], as our backbone generators. Both models are pre-trained on CelebAHQ [19]. We adopt different task models according to the applications. We use ResNet-50 [16] pre-trained on CelebAHQ for attribute manipulation, HopeNet [24] pre-trained on 300W-LP [35] for head pose manipulation, and MTCNN [31] to crop faces and detect landmarks for landmark editing. Note that in all experiments, the model parameters and additional training data are unavailable. + +Baselines. We consider two baselines here. First, following Denton et al. [12], we employ the same classifier as our framework to compute the gradient with respect to the initial point and take it as a constant attribute vector $v$ . The attribute manipulation is realized as below, + +$$ +z ^ {(i + 1)} = z ^ {(i)} + \lambda v. \tag {5} +$$ + +We refer to this baseline as Linear. The key difference is that the proposed framework recomputes gradients in every step. Similarly, the second baseline, InterfaceGAN [25], adopts the same linear strategy but derive the vector $v$ from the normal vector of the decision boundary of a linear SVM, which can be viewed as a common direction that changes the attribute most. InterfaceGAN achieves conditional manipulation by pairwise computing an orthogonal vector for the normal vectors. Note that, instead of using a common direction for all data, we derive moving directions for specific input. + +# 4.2. Attribute Manipulation + +We show that our framework can be applied to attribute manipulation. We consider unconditional and conditional settings, respectively. The former one is achieved by solely applying Eq. 3; The latter one adopts Eq. 4 to ensure the preservation of non-target attributes. + +Unconditional Manipulation. In the unconditional setting, we expect to see an effective transition as compared to the baselines since our method dynamically decides the moving direction in each step and follows the steepest direction. Note that although the main objective here is to change the target attribute, other attributes might change arbitrarily. + +Figure 2 compares our method to two baselines, Linear and InterfaceGAN, on 4 attributes. On PGGAN, all three methods successfully edit the attributes, while our method produces transition with much less distortion, e.g., smile and age. Also, we observe that our method and InterfaceGAN perform similarly on eyeglasses and gender. It may imply that for some attributes, the underlying manifold expands linearly as is derived by InterfaceGAN. + +On the other hand, our method behaves clearly differently from the two linear baselines on StyleGAN, showing that the manifold may be highly non-linear. We verify the benefit of the iterative scheme by comparing our method to the baselines. First, Linear appears to fail to edit smiling even if it uses the same classifier as our framework. When comparing to InterfaceGAN, our method preserves more non-target contents than InterfaceGAN although the goal is not to preserve attributes. For example, age changes when editing eyeglasses, and hair color changes when editing smiles. + +Effectiveness. To further verify the effectiveness of the proposed method, we compare our method to InterfaceGAN on logit changes over steps. We experiment on StyleGAN since it tends to be more non-linear as observed in Figure 2. Specifically, we choose 7 attributes and sample 2500 trajectories for each attribute, each of which consists of 40 steps with the step size equal to 0.2. Next, we compute the mean values over trajectories and report the target and non-target logit changes, respectively. + +Figure 3 shows that our method can rapidly change the target attribute on most attributes, especially on rare attributes such as blond hair, pale skin, and narrow eyes. The result aligns with our hypothesis that not all attributes in the latent space distribute linearly; thus, our framework can benefit from the non-linearity. We additionally visualize the manipulation over the rare attributes in Figure 4, confirming the effectiveness of our method. In addition to effective manipulation, it is also seen that the non-target attributes of all methods are changed during the manipulation. It is thus crucial to limit such an undesired effect. + +Conditional Manipulation. We present that our framework along with the proposed constraint in Eq. 4 can preserve the non-target attributes better. In this experiment, we consider 1 of 4 attributes to edit while conditioned on the other three. Figure 5 presents the results on PGGAN and StyleGAN, respectively. On PGGAN, our method strongly preserves the non-target attributes and effectively modify the target attribute. InterfaceGAN appears to be ineffective when it has to maintain non-target attributes. For example, the smiling is changed when editing eyeglasses. On StyleGAN, both methods succeed to edit the attributes while our method looks closer to the input. These results suggest that our method with the constraint can effectively edit the target attribute while retaining others. + +![](images/796637d3de7a34fa8b7e2c724113288532cff8d7f3631363e82a6d0ecd89bd8a.jpg) +Figure 2. Unconditional attribute manipulation on PGGAN (left) and StyleGAN (right) with respect to Eyeglasses, Gender, Smile, and Age. We compare our method to Linear and InterfaceGAN. + +![](images/c09ee505e2111ae9ac8f0b9c065c0a8e63d6c328d8ea3d7515a26973648bb918.jpg) +Figure 3. Logit changes over steps on StyleGAN. From left to right: Eyeglasses, Gender, Smile, Age, Narrow Eyes, Blond Hair, and Pale Skin. The solid lines represent the predictions of the target attributes while the dot lines represent the mean values over all the other non-target attribute predictions. Zoom in for better visualization. + +Attribute Preservation. To inspect how well our method can preserve the non-target attributes, we follow the same sampling strategy as in Figure 3 and measure the ratio of target prediction changes to non-target prediction changes on StyleGAN. Higher values indicate that the subject can more effectively edit target attributes with lower perturbation to non-target attributes. We consider 7 attributes to edit. The former four attributes are conditioned on each other except themselves, and the latter three attributes are conditioned on all the former four. This design makes the latter three more challenging since they have to edit rare attributes while maintaining 4 attributes simultaneously. + +Figure 6 compares our method to InterfaceGAN in both conditional (Eq. 4) and unconditional (Eq. 3) settings. It is immediately observed that our method with the proposed constraint achieves the highest ratio on almost all attributes, validating that the non-linear iterative scheme not only advances the attribute manipulation but also help the attribute + +preservation. Interestingly, the ratio of our unconditional method on the last three attributes are higher than InterfaceGAN in the conditional setting. It could be attributed to inefficiency of linear methods. As observed in Figure 3, linear methods are less active on rare attributes. Moreover, it uses the same direction for every step, which may be sub-optimal for the points far away from the initial point. Both two reasons together lead to the phenomenon. + +# 4.3. Analysis + +We conduct two analysis to provide more insights from the perspective of smoothness and function approximation. + +Smoothness. We compare the trajectories generated by our method to those by linear methods such as InterfaceGAN in terms of smoothness. Previously, Karras et al. [20] propose a metric, Perceptual Path Length (PPL), to measure smoothness over the whole latent space. However, we only focus on smoothness of trajectories; thus we propose to use modi + +![](images/afb3dbebe3ceca2a57170861c9e2244ac25a80142132cbe3b1390eaf5b357366.jpg) + +![](images/64b8416c440dcda88074ef25443456ac479204785bb1f30a77db891105e4d130.jpg) + +![](images/0369228d7c6257e49c22909e0ad48b3b02879e679876e5a64bee357667f33410.jpg) + +![](images/3d279f18849d96accfdbfae671938272fda84c09cc6d27b7399ac53fb88b4417.jpg) + +![](images/7286d50e1c08cc4c9326edf4a7b0b78edf79b71673b5b4ded389094d9a6305ab.jpg) + +![](images/c162bbefb6337549d481b7d62589d4f35ce5251fe582a95ba4dce0e35921eca6.jpg) + +![](images/fff9958a4eb447a180b339f72a0f4c8d8700ad07c4c64f51ce2c24780ef73c09.jpg) +Figure 4. Unconditional rare attribute manipulation on StyleGAN with respect to Bald, Narrow Eyes, Pale Skin, and Blond Hair. Each set consists of input (left), our method (middle), and InterfaceGAN (right). + +![](images/e3c5075b147c727bb7336bbe2ea1c158f18f236f8aeaf889419d805f36929429.jpg) +Bald +Pale Skin + +![](images/877e323248c1e288ae9036d0a8696638f60ad99d34bf22cdedb8073e36d0f20a.jpg) + +![](images/180dc6fd9480920da5dfcaa07969832bb721b1c09be68d1bd15a9830d80fccd7.jpg) + +![](images/ef8af23e22fe367ddd6c8f4bf8eb6989509ac43bdf70bd86edb253f1291fff4f.jpg) +Blond Hair + +![](images/143b998c5546c76b64b8c9424ffda5d87c5f52234202eab17b5f343f8ef1cf0a.jpg) + +![](images/7ad57bde589b1affb9d048a241e2083fd3eeec67ceadf2eb51a37884ebd841b4.jpg) +Figure 5. Conditional attribute manipulation on PGGAN (left) and StyleGAN (right) with respect to Eyeglasses, Gender, Smile, and Age. We compare our method to InterfaceGAN. + +fied PPL (mPPL) that only consider noise sampled from the generated trajectories. Formally, we have + +$$ +l _ {z} = \mathbb {E} _ {z ^ {(i)} \sim \mathcal {T}, \mathcal {T} \sim p (\mathcal {T})} [ \frac {1}{\epsilon^ {2}} d (G (\operatorname {l e r p} (z ^ {(i)}, z ^ {(i + 1)}, t)), +$$ + +$$ +G (\operatorname {l e r p} (z ^ {(i)}, z ^ {(i + 1)}, t + \epsilon))) ], +$$ + +(6) + +where $\mathcal{T}$ is a generated trajectory, $z^{(i)}$ is the noise of i-th step in the trajectory, $G$ is the generator, lerp is linear interpolation function with factor $t$ drawn from uniform distribution, $\epsilon$ is a small displacement, and $d(\cdot)$ is LPIPS metric [32]. For each attribute, we sample 1000 trajectories and each consists of 600 steps with step size 0.01, leading to 600k images in total. Following Karras et al. [20], we set $\epsilon$ to 1e-4 and report the mean value over all samples. Lower + +values mean smoother trajectories. + +Table 1 presents the evaluation results on both PGGAN and StyleGAN. In the unconditional setting, both methods produce comparably smooth trajectories. It also happens in the condition setting on PGGAN. It could be attributed to the relatively linear manifolds. Note that smoothness does not mean the effectiveness. One could generate images with no change to gain smoother transition. Lastly, our method surpasses the baseline on StyleGAN in the conditional setting by a large margin since it can strongly retain the nontarget attributes, leading to smoother transition. + +Function Approximation. We show that our iterative scheme can better traverse the highly non-linear latent space from the perspective of function approximation. We first re + +![](images/1ef72a313c043f8c3e586ee9bb38bae4d8468d3227ce66469fe22a700e3fc579.jpg) +Figure 6. Attribute preservation ratio. We compare our method (orange) to InterfaceGAN (mist blue) in unconditional (non-stripe) and conditional (stripe) settings. The higher values, the better attributes are preserved during attribute manipulation. + +
Cond.EyeglassGenderSmileAge
PGGAN
InterfaceGAN OursN60.6965.0054.4961.16
64.1062.5056.5560.28
InterfacGAN OursY54.5155.6555.0756.59
57.4059.7955.0055.30
StyleGAN
InterfaceGAN OursN99.15101.6596.9096.62
103.0897.9397.9391.86
InterfacGAN OursY80.4681.5292.7583.51
57.2371.6778.1855.41
+ +Table 1. Modified Perceptual Path Length measured on PGGAN and StyleGAN. Lower is better. + +
< 1< 2< 3>= 3Avg.
Eyeglasses
InterfaceGAN1.7602.7793.6441.4812.416
Ours1.6752.4012.4691.5572.026
Gender
InterfaceGAN5.7024.0451.7980.8913.109
Ours4.4693.6941.7900.8122.692
Smile
InterfaceGAN1.7641.7831.6930.9611.550
Ours3.1912.3911.6110.9212.028
Age
InterfaceGAN2.3502.4342.3121.3542.113
Ours0.9691.1091.8931.2851.314
+ +Table 2. Errors of first order Taylor approximation. Errors are reported according to the L2-norm between the initial point and the estimated points. $f$ consists of the generator and the task model. + +call the first order Taylor approximation, + +$$ +f (x) = f (a) + f ^ {\prime} (a) (x - a). \tag {7} +$$ + +If a method models the underlying manifold better, it is expected to have lower error between the real logit $f(z^{(i + 1)})$ and the estimated logit $f(z^{(i)}) + f'(z^{(i)})(z^{(i + 1)} - z^{(i)})$ . Note that the real gradient $f'$ in Eq. 7 is unavailable for all baselines and our model. Instead, all methods use estimated gradients, namely $\mathbf{J}_j$ (Eq. 3) for our method and $v$ (see Section 4.1) for InterfaceGAN. + +Since InterfaceGAN uses normal vectors of SVM decision boundaries as guiding signals, we expect it to work well in a local region while becoming less accurate in the farther distance. To verify this assumption, we measure the errors and categorize them according to the L2 distance between the estimated and initial points. Table 2 compares our method to InterfaceGAN. It shows that our method approximates the underlying function more accurately on average. As for the smiling, since we discard the data with lower confidence (see Section 3.4), it may make the proxy model less robust at the region where many ambiguous samples happen. Lastly, due to the iterative scheme, our method achieves lower errors even when the estimated points move far away from the initial points. + +# 4.4. Head Pose Manipulation + +To further study the possibility of unintended usage of pretrained GANs, we employ our framework to achieve head pose manipulation by leveraging pre-trained HopeNet [24] as the task model. In particular, we attempt to gain control over the yaw and pitch axes since the training dataset of the pre-trained GANs, CelebAHQ, is well-aligned by eyes; thus it is almost impossible to control the roll axis. It also suggests that the framework could be still limited by the training dataset of pretrained GANs even though we are capable of gaining control over the generation process. To generate fine-grained transition, we choose small step size 0.01 and produces 1000 steps in total. + +Due to the proposed constraint in Eq. 4, our framework can solely edit one axis by conditioning on four attributes and the other axis. As shown in Figure 7, we smoothly interpolate the images for yaw and pitch axes. We also note that some artifacts or undesired changes happen when forcing the pose to go beyond certain degrees. With our framework, we can generate faces with arbitrary poses if they remain feasible in the training data of pre-trained GANs. + +# 4.5. Landmark Editing + +By utilizing pre-trained MTCNN [31], we take one step further to consider landmark editing, which is a relatively challenging application. The reasons are three-fold. First, a landmark is two coordinates, which are extremely local attributes as compared to, e.g., age or gender. Second, since + +![](images/ceef86242e06a500e3e10d5adffad5ad847e1c945367db41f5005e2a7179e7a2.jpg) + +![](images/9573ef04bdbb89b6e031be82f144e131803358156cdff641e710397312893193.jpg) + +![](images/f2e5ff0260e1eca61ca3eac4cde9b5092ed9d864864b5e040f480eb9d56a1adb.jpg) + +![](images/8834b6871c3da5eae9a94aca6af885d93ef2b58028c0a8c23781e55d0968e1d7.jpg) + +![](images/3d4e36863e7168009f5c09ecba52e2db96fadf8bca1aea39de3d1b56cb96796f.jpg) + +![](images/a4100baf87b93a32f12faedd98be1a26be0a0e77ac3ffae4db79f07ab3c7205b.jpg) + +![](images/7d8fe1b37b8f8b262886c38d5ae084bf3f10612980039160949222e4094f13f0.jpg) +Figure 7. Pose manipulation on StyleGAN with respect to yaw (top) and pitch (bottom). + +![](images/7c77aabeb0f843487d069ac18ff586f035a4d1072252d1c9b66771b2345cac18.jpg) + +![](images/ab5d91198f737f9c345abc71319b072912f220e320beb74a26563e350e670a29.jpg) + +![](images/6f51c7f83306780cdbd2e538ceb28fbbdf6cd8631f23e70036b1a4100d51138a.jpg) + +![](images/4a5d940ba189dcced849b0b1e630469c795100706c360c4810d98fb63664647c.jpg) + +![](images/4feb2f03ba3cd53d3b071884af10b35606a0973aadd6b093efc573421f7362ce.jpg) + +![](images/c2d07d82a89a8e3469f7a50769c695598302a62d48a3a6f714779d59cf82eabf.jpg) + +![](images/a3d1267a83da3c6c0ab956976b02cf7ee11a6fecb7b8dcb08b5081e96dbb4c24.jpg) + +![](images/8b38d662d5662027e4b9a578aee279933ede43d3e30f991fa829362ca018f27f.jpg) + +![](images/f211854771603fc932ae44cf645d7457b8e6295dcd0e6862b73faebe629da4cd.jpg) + +![](images/6a8e3761b7b9eeded6204c369f984fa66bd4b4ad921d31c780bfb73c366bc8b8.jpg) + +![](images/2f9dacad8951326bf7f321d308aef80baa86a5afe73bd19c04d024703be7a89d.jpg) + +![](images/e7b8caa9f26cdd50b6721af407b826d5f64900a770295f661df6773238914c66.jpg) +Left corner of mouth + +![](images/1f9035629fae98ce7c8df3035e95243581c7dc7382b1155cc6dbd42fee14a36b.jpg) +Nose up/down + +![](images/a1bb2f3b5ca251a10fc7af764f06ea84b82d3818490ad42e362c8fa16820a0b4.jpg) +Figure 8. Landmark editing on StyleGAN with respect to Nose up/down, Nose left/right, Left corner of mouth, Right corner of mouth. + +![](images/03d1e845fc132069e21cf1c6a47bfc0adbc07b73923b3e1a55276586f9fe56f6.jpg) +Right conner of mouth + +![](images/02959af4d59ef7edd814e5d187963af92fa77a6cf16ed8eeffc09390084857f0.jpg) + +![](images/6c7b2100ddf7cf47fa90d566ff42efb0227a4827d31bf8e1edb5d1a644f8791f.jpg) + +landmarks are coordinates, it becomes very sensitive for annotation. The performance may be degraded if the accuracy of task models are not satisfactory. Lastly, landmarks are often correlated with other features. Based on the results of previous experiments, we edit landmarks while conditioning on 4 attributes, poses, and a subset of landmarks. Note that since the training dataset is well aligned, the landmark of eyes are not editable. + +Figure 8 demonstrates the results when editing the coordinates of noses and mouths. Surprisingly, we find some attributes are highly entangled. For instance, mouth landmarks is highly correlated with smile. To measure the correlation, we additionally compute the cosine similarity between direction vectors (Eq. 3). Higher similarity indicates higher entanglement. We analyze the correlation of mouth landmarks vs. smile (0.296) and mouth landmarks vs. gender (0.035). The former one is around 8.5 times larger than the latter. Additionally, nose landmarks vs. yaw are highly correlated by 0.5014. In this analysis, we do find measurable entanglement. + +# 5. Conclusion + +In this paper, we demonstrate that publicly released state-of-the-art GANs can be applied for a wide range of applications beyond the creators' intention. To achieve this, we propose a framework to gain high-level control over unconditional image generation. Extensive results show that the framework is advantageous over non-iterative linear baselines in many aspects and can be readily applied to various unintended tasks. While this allows to re-use high quality GANs that are becoming increasingly costly to train for new applications, we hope that this work also raises awareness regarding potential unintended usage, urging the creators and owners to be cautious about the possible risks of their models before a full release. + +# Acknowledgment + +This work is partially funded by the Helmholtz Association within the project "Protecting Genetic Data with Synthetic Cohorts from Deep Generative Models (PRO-GENGEN)" (ZT-I-PF-5-23). + +# References + +[1] Rameen Abdul, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? In Int. Conf. Comput. Vis., pages 4432-4441, 2019. +[2] Rameen Abdul, Yipeng Qin, and Peter Wonka. Image2stylegan++: How to edit the embedded images? In IEEE Conf. Comput. Vis. Pattern Recog., pages 8296-8305, 2020. +[3] Rameen Abdal, Peihao Zhu, Niloy Mitra, and Peter Wonka. Styleflow: Attribute-conditioned exploration of stylegan-generated images using conditional continuous normalizing flows. arXiv e-prints, pages arXiv-2008, 2020. +[4] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning, pages 214-223, 2017. +[5] David Bau, Steven Liu, Tongzhou Wang, Jun-Yan Zhu, and Antonio Torralba. Rewriting a deep generative model. In Eur. Conf. Comput. Vis., 2020. +[6] David Bau, Hendrik Strobelt, William Peebles, Jonas Wulff, Bolei Zhou, Jun-Yan Zhu, and Antonio Torralba. Semantic photo manipulation with a generative image prior. ACM Trans. Graph., 38(4):1-11, 2019. +[7] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. In Int. Conf. Learn. Represent., 2018. +[8] Wei-Lun Chang, Hui-Po Wang, Wen-Hsiao Peng, and Wei-Chen Chiu. All about structure: Adapting structural information across domains for boosting semantic segmentation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 1900-1909, 2019. +[9] Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 8789-8797, 2018. +[10] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In IEEE Conf. Comput. Vis. Pattern Recog., pages 8188-8197, 2020. +[11] Edo Collins, Raja Bala, Bob Price, and Sabine Susstrunk. Editing in style: Uncovering the local semantics of gans. In IEEE Conf. Comput. Vis. Pattern Recog., pages 5771-5780, 2020. +[12] Emily Denton, Ben Hutchinson, Margaret Mitchell, and Timnit Gebru. Detecting bias with generative counterfactual face attribute augmentation. arXiv preprint arXiv:1906.06439, 2019. +[13] Lore Goetschalckx, Alex Andonian, Aude Oliva, and Phillip Isola. Ganalyze: Toward visual definitions of cognitive image properties. In Int. Conf. Comput. Vis., pages 5744-5753, 2019. +[14] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Adv. Neural Inform. Process. Syst., pages 2672–2680, 2014. + +[15] Erik Härkönen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering interpretable gan controls. arXiv preprint arXiv:2004.02546, 2020. +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conf. Comput. Vis. Pattern Recog., pages 770-778, 2016. +[17] Shady Abu Hussein, Tom Tirer, and Raja Giryes. Image-adaptive gan based reconstruction. In AAAI, volume 34, pages 3121-3129, 2020. +[18] Ali Jahanian, Lucy Chai, and Phillip Isola. On the"steerability" of generative adversarial networks. In Int. Conf. Learn. Represent., 2019. +[19] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In Int. Conf. Learn. Represent., 2018. +[20] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In IEEE Conf. Comput. Vis. Pattern Recog., pages 4401-4410, 2019. +[21] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In IEEE Conf. Comput. Vis. Pattern Recog., pages 8110-8119, 2020. +[22] 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 Eur. Conf. Comput. Vis., 2020. +[23] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. +[24] Nataniel Ruiz, Eunji Chong, and James M Rehg. Fine-grained head pose estimation without keypoints. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 2074-2083, 2018. +[25] Yujun Shen, Jinjin Gu, Xiaou Tang, and Bolei Zhou. Interpreting the latent space of gans for semantic face editing. In IEEE Conf. Comput. Vis. Pattern Recog., pages 9243-9252, 2020. +[26] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958, 2014. +[27] Ayush Tewari, Mohamed Elgharib, Gaurav Bharaj, Florian Bernard, Hans-Peter Seidel, Patrick Pérez, Michael Zollhofer, and Christian Theobalt. Stylerig: Rigging stylegan for 3d control over portrait images. In IEEE Conf. Comput. Vis. Pattern Recog., pages 6142-6151, 2020. +[28] Paul Upchurch, Jacob Gardner, Geoff Pleiss, Robert Pless, Noah Snavely, Kavita Bala, and Kilian Weinberger. Deep feature interpolation for image content changes. In IEEE Conf. Comput. Vis. Pattern Recog., pages 7064-7073, 2017. +[29] Andrey Voynov and Artem Babenko. Unsupervised discovery of interpretable directions in the gan latent space. In International Conference on Machine Learning, 2020. +[30] 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. +[31] Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499-1503, 2016. +[32] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In IEEE Conf. Comput. Vis. Pattern Recog., pages 586-595, 2018. +[33] Peng Zhou, Bor-Chun Chen, Xintong Han, Mahyar Najibi, Abhinav Shrivastava, Ser-Nam Lim, and Larry Davis. Generate, segment, and refine: Towards generic manipulation segmentation. In AAAI, pages 13058-13065, 2020. +[34] Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. Indomain gan inversion for real image editing. In Eur. Conf. Comput. Vis., 2020. +[35] Xiangyu Zhu, Zhen Lei, Xiaoming Liu, Hailin Shi, and Stan Z Li. Face alignment across large poses: A 3d solution. In IEEE Conf. Comput. Vis. Pattern Recog., pages 146-155, 2016. \ No newline at end of file diff --git a/hijackganunintendeduseofpretrainedblackboxgans/images.zip b/hijackganunintendeduseofpretrainedblackboxgans/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f20519d541e5a2869eb9a7f6cb4b62056eeb6ef3 --- /dev/null +++ b/hijackganunintendeduseofpretrainedblackboxgans/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bbea438b8679f9ff1d6619101d02ca92db02bf56fa815bb57886140dee8521c +size 815462 diff --git a/hijackganunintendeduseofpretrainedblackboxgans/layout.json b/hijackganunintendeduseofpretrainedblackboxgans/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..15c69e94b742ba126e4ba2a9cddda2d669d72e09 --- /dev/null +++ b/hijackganunintendeduseofpretrainedblackboxgans/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b0f532f5645076ced33d244d664b712f20aa878c7c575d42c4a0052eb77249e +size 358398 diff --git a/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_content_list.json b/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ce0ea9f10d395effaf8f85bb7ea032813613bd9a --- /dev/null +++ b/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcb5cc5736816e67f2c1c55f8199237d9d89fc87eb2e8fdb2d6ddbbba816c9e5 +size 90840 diff --git a/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_model.json b/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_model.json new file mode 100644 index 0000000000000000000000000000000000000000..525abd7b68615f19d2ee403a35c8210905243b90 --- /dev/null +++ b/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60ca584ee4f2f648230c3d497cb69ba0ef2339c9d73db77bead175cde2021319 +size 113495 diff --git a/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_origin.pdf b/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f1733792cf99a8bb3e317ab65bf7e02538246311 --- /dev/null +++ b/hilbertsinkhorndivergenceforoptimaltransport/ecbdae8a-4a13-49d1-bae1-90096d5f1370_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac69290bf60318cad44acfee6796e97ecd686d611419258c281805823aea430f +size 1365291 diff --git a/hilbertsinkhorndivergenceforoptimaltransport/full.md b/hilbertsinkhorndivergenceforoptimaltransport/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c00266a2a6b6457a8e227ccce0084bffda96580d --- /dev/null +++ b/hilbertsinkhorndivergenceforoptimaltransport/full.md @@ -0,0 +1,470 @@ +# Hilbert Sinkhorn Divergence for Optimal Transport + +Qian Li $^{1*}$ + +Zhichao Wang $^{2*}$ + +Gang Li3 + +Jun Pang4 + +Guandong $\mathbf{X}\mathbf{u}^{1}$ + +$^{1}$ Faculty of Engineering and Information Technology, University of Technology Sydney, Australia +$^{2}$ School of Electrical Engineering and Telecommunications, University of New South Wales, Australia +3 Centre for Cyber Security Research and Innovation, Deakin University, Geelong, VIC 3216, Australia +4 Faculty of Science, Technology and Medicine, University of Luxembourg + +{qian.li, guandong.xu}@uts.edu.au, zchaoking@gmail.com, gang.li@deakin.edu.au, jun.pang@uni.lu + +# Abstract + +The Sinkhorn divergence has become a very popular metric to compare probability distributions in optimal transport. However, most works resort to the Sinkhorn divergence in Euclidean space, which greatly blocks their applications in complex data with nonlinear structure. It is therefore of theoretical demand to empower the Sinkhorn divergence with the capability of capturing nonlinear structures. We propose a theoretical and computational framework to bridge this gap. In this paper, we extend the Sinkhorn divergence in Euclidean space to the reproducing kernel Hilbert space, which we term "Hilbert Sinkhorn divergence" (HSD). In particular, we can use kernel matrices to derive a closed form expression of the HSD that is proved to be a tractable convex optimization problem. We also prove several attractive statistical properties of the proposed HSD, i.e., strong consistency, asymptotic behavior and sample complexity. Empirically, our method yields state-of-the-art performances on image classification and topological data analysis. + +# 1. Introduction + +As an important tool to compare probability distributions, optimal transport theory [52] has found many successful applications in machine learning. Examples include generative modeling [56, 19], domain adaptation [17], dictionary learning [42], text mining [29], sampling [54, 55] and single-cell genomics [41]. Optimal transport aims at minimizing the cost of moving a source distribution to a target distribution. The minimal transportation cost defines a divergence between the two distributions, which is called the Wasserstein or Earth-Mover distance [51, 40]. Roughly speaking, the Wasserstein distance measures the + +minimal cost required to deform a distribution to another distribution. Different from other divergence, such as Kullback-Leibler divergence and the $L_{2}$ distance, the Wasserstein distance could compare probability distributions in a geometrically faithful manner. This entails a rich geometric structure on the space of probability distributions. + +Related work. Existing optimal transport schemes can be mainly categorized into three classes. Methods in the first class are the regularization-based Wasserstein distance. Such numerical schemes add a regularization penalty to the original optimal transport problem. For instance, the Sinkhorn divergence [12, 13] provides a fast approximation to the Wasserstein distance by regularizing the original optimal transport with an entropy term. Greedy [2], Nystrom [1] and stochastic [18] versions of Sinkhorn algorithm with better empirical performance have also been explored. Other representative contributions towards regularization-based optimal transport include quantum regularization [35], sparse regularization [7] and Boltzmann-Shannon entropy [16]. + +An alternative principle for approximating the Wasserstein distance comes from Radon transform: to project high-dimensional distribution to one-dimensional distributions. One representative example is the sliced Wasserstein distance [8, 23, 14, 24], which is defined as the average Wasserstein distance obtained between random one-dimensional projections. In other words, the sliced Wasserstein distance is calculated via linear slicing of the probability distribution. Its important extensions, such as [34, 31], are proposed recently to search for the $k$ -dimensional subspace that would maximize the Wasserstein distance between two measures after projection. The sample complexity of such estimators is investigated [15, 14] between two measures and their empirical counterparts. + +Methods in the third class include the Gromov-Wasserstein distance, it extends optimal transport to scenario where heterogeneous distributions are involved, i.e., + +distributions defined on different metric spaces. Such an approach was successfully applied for tasks where source and target samples do not lie in the same Euclidean space, e.g., for heterogeneous domain adaptation [57], shapes [46], word embedding [3] and generative modeling [9]. From the computational perspective, the Gromov-Wasserstein distance involves a non-convex quadratic problem, and it is hard to lift it to large scale settings [36]. Such a heavy computation burden could be remedied by the Sinkhorn divergence [37] or the sliced technique [50]. + +Motivations. All these works consider the optimal transport in original sample space (usually Euclidean space $\mathbb{R}^n$ ). However, various machine learning tasks are kernel dependent, such as computerized tomography [32], topological data analysis [25], geometric domain [45], kernel mean embedding [30] and adaptive Monte Carlo [43]. There is no straightforward way to formulate the optimal transport problem for such tasks. The performance of these tasks highly depends on comparing the distributions in reproducing kernel Hilbert spaces (RKHS) [48]. Thus defining the optimal transport in the original sample space may lead to sub-optimum performance for the above applications. + +In fact, RKHS provides a platform for optimal transport in functional spaces to be applied in real-world problems. Recent relevant works can be found in [32, 58], where efforts have been devoted to the intersection of RKHS and optimal transport. But they involve a linear program so that evaluating the Wasserstein distance in RHKS is a computational bottleneck in general, and they did not deliver the convergence result such as asymptotic behavior or sample complexity. Although various techniques mentioned previously have been extensively considered Sinhorn divergence to accelerate the computation of Wasserstein distance, it is still non-trivial to extend the analysis for RKHS cases. This is mainly due to the fact that the convex relaxation of the Sinkhorn divergence is formulated through an implicit nonlinear map in infinite dimension, making it a challenge to optimize. Another important reason is that the theoretical convergence of optimal transport in RKHS has not been well studied. There are practical and theoretical demands to develop a general framework to analyze the theory between optimal transport and RKHS, which will favor various kernel-dependent tasks in machine learning. + +Contributions. This paper makes two valuable contributions, including both practical formulations and theoretical convergence. + +- We prove that the Sinkhorn divergence has a special structure in RKHS, which allows us to propose an equivalent and computable "Hilbert Sinkhorn divergence" (HSD) that could be fully determined by the kernel function (Thm. 1) and then could be computed via solving a convex optimization problem. Thm. 1 + +shows that the proposed HSD could be solved in an efficient manner using Sinkhorn iterations. + +- We analyze the strong consistency and sample complexity of the proposed HSD. We give the error bound and prove the strong consistency when approximating original Wasserstein distances with our HSD (Thm. 3). We also focus on how the asymptotic behavior (Prop. 3) and sample complexity (Thm. 4) affect the convergence of the proposed HSD. + +# 2. Preliminary + +We begin with the background of optimal transportation. Let $c: \mathcal{X} \times \mathcal{X} \to \mathbb{R}$ denote the cost function where $\mathcal{X} \in \mathbb{R}^n$ is the sample space. We define $\Pi(\mu, \nu)$ as the set of all probabilistic couplings $\pi$ with marginals $\mu$ and $\nu$ . Formally, the Wasserstein distance is thus defined as + +$$ +\mathcal {W} (\mu , \nu) = \inf _ {\pi \in \Pi (\mu , \nu)} \int_ {\mathcal {X} \times \mathcal {X}} c (x, y) d \pi (x, y) \tag {1} +$$ + +Thus the Wasserstein distance aims to find a couplings $\pi$ so as to minimize the cost function of moving a probability mass from $\mu$ to $\nu$ . The Wasserstein distance (1) is numerically intractable in general due to its high computational complexity. Consequently, the Sinkhorn divergence [12] is proposed to approximate (1) by regularizing the original problem with an entropy term. + +Definition 1 (Sinkhorn divergence) The Sinkhorn divergence is formally defined as: + +$$ +\mathcal {W} _ {\epsilon} (\mu , \nu) = \inf _ {\pi \in \Pi (\mu , \nu)} \left[ \int_ {\mathcal {X} \times \mathcal {X}} c (x, y) d \pi (x, y) + \epsilon H (\pi) \right] \tag {2} +$$ + +where $\epsilon > 0$ is a coefficient and the entropic regularization $H(\pi)$ is given below + +$$ +H (\pi) = \log \left(\frac {d \pi}{d \mu d \nu} (x, y)\right) \tag {3} +$$ + +The entropic regularization makes the Sinkhorn divergence (2) strictly convex to guarantee the unique minimizer. The Sinkhorn divergence allows an extremely simple iterative algorithm [12], which can be implemented using only matrix-vector products and converges quickly to a solution of (1). Note that the Sinkhorn divergence (2) is defined in the sample space. To further reformulate the Sinkhorn divergence in RKHS, we need Hilbert embedding to transform the probability measures from the sample space to RKHS. + +Definition 2 (Hilbert embedding) Let $\mathbb{P}(\mathcal{X})$ be the set of probability measures on sample set $\mathcal{X}$ and $\mathbb{P}(\mathcal{H})$ be the set of probability measures on reproducing kernel Hilbert + +space $\mathcal{H}$ . Given a probability measure $\mu \in \mathbb{P}(\mathcal{X})$ , the implicit feature map $\phi : \mathcal{X} \to \mathcal{H}$ will induce the Hilbert embedding of $\mu$ : + +$$ +\phi_ {*}: \mathbb {P} (\mathcal {X}) \rightarrow \mathbb {P} (\mathcal {H}), \mu \mapsto \phi_ {*} \mu = \int_ {\mathcal {X}} \phi (x) d \mu (x) \tag {4} +$$ + +For the map $(\phi ,\phi):\mathcal{X}\times \mathcal{X}\to \mathcal{H}\times \mathcal{H},$ we similarly have + +$$ +\left(\phi , \phi\right) _ {*}: (\mu , \nu) \mapsto \left(\phi_ {*} \mu , \phi_ {*} \nu\right) \tag {5} +$$ + +# 3. Hilbert Sinkhorn divergence + +In this section, we introduce the nonlinear version of the Sinkhorn divergence in RKHS, which we term "Hilbert Sinkhorn divergence" (HSD). Section 3.1 provides an equivalent and computable formulation of HSD. In Section 3.2, we further discuss how HSD could be used to compare empirical probability measures. + +# 3.1. Formulation + +Let $\mathcal{X}$ be a sample space. A function $k:\mathcal{X}\times \mathcal{X}$ is called a kernel function of reproducing kernel Hilbert space $\mathcal{H}$ , i.e., $\forall x\in \mathcal{X},k(\cdot ,x)\in \mathcal{H}$ . The kernel function $k$ satisfies the reproducing property + +$$ +f \in \mathcal {H}, \langle f, k (\cdot , x) \rangle_ {\mathcal {H}} = f (x) \tag {6} +$$ + +Define the implicit feature map $\phi : \mathcal{X} \to \mathcal{H}$ as $x \mapsto \phi(x) = k(\cdot, x)$ . Then we have kernel trick such that $\langle \phi(x), \phi(y) \rangle_{\mathcal{H}} = k(x, y)$ . + +In order to capture the nonlinearity of optimal transport, we employ a compact representation that not only preserves statistical properties of arbitrary distributions, but also permits efficient computation. That is, we adopt the Hilbert embedding [6, 44, 48] to represent the probability measure as a mean function in the RKHS. + +Definition 3 (Hilbert Sinkhorn divergence, HSD) Given measures $\mu, \nu \in \mathbb{P}(\mathcal{X})$ and elements $u, v \in \mathcal{H}$ , the Hilbert Sinkhorn divergence between embedding $\phi_*\mu$ and $\phi_*\nu$ is written as + +$$ +\mathcal {S} _ {\epsilon} \left(\phi_ {*} \mu , \phi_ {*} \nu\right) = \inf _ {\pi_ {\phi}} \int_ {\mathcal {H} \times \mathcal {H}} c _ {\phi} (u, v) d \pi_ {\phi} (u, v) + \epsilon \Phi (\pi_ {\phi}) \tag {7} +$$ + +where $\pi_{\phi} \in \Pi(\phi_{*}\mu, \phi_{*}\nu)$ is a joint probability measure with two marginals $\phi_{*}\mu$ and $\phi_{*}\nu$ , and + +$$ +c _ {\phi} (u, v) = \| u - v \| _ {\mathcal {H}} ^ {2} +$$ + +$$ +\Phi (\pi_ {\phi}) = \log \left(\frac {d \pi_ {\phi}}{d (\phi_ {*} \mu) d (\phi_ {*} \nu)} (u, v)\right) +$$ + +HSD is a natural nonlinear version of the Sinkhorn divergence (2) that is extended to RKHS. Therefore, HSD can be solved by finding an optimal joint probability measure in $\mathcal{P}(\mathcal{H}\times \mathcal{H})$ . However, as HSD in (7) is expressed by an + +unknown implicit nonlinear map $\phi$ , making it difficult to solve. Thus, we provide an equivalent and solvable formulation of (7), which is completely determined by the kernel function. + +Theorem 1 Given two measures $\mu, \nu \in \mathbb{P}(\mathcal{X})$ , we write + +$$ +\mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) = \inf _ {\pi} \int_ {\mathcal {X} \times \mathcal {X}} c _ {\mathcal {H}} (x, y) d \pi (x, y) + \epsilon H (\pi) \tag {8} +$$ + +where $\pi \in \Pi (\mu ,\nu)$ is the joint probability measures on $\mathcal{X}\times$ $\mathcal{X}$ with marginals $\mu$ and $\nu$ ,and + +$$ +\begin{array}{l} c _ {\mathcal {H}} (x, y) = \| \phi (x) - \phi (y) \| _ {\mathcal {H}} ^ {2} = k (x, x) + k (y, y) - 2 k (x, y) \\ H (\pi) = \log \left(\frac {d \pi}{d \mu d \nu} (x, y)\right) \\ \end{array} +$$ + +Then we have the following conclusions: + +$$ +\bullet \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) = \mathcal {S} _ {\epsilon} \left(\phi_ {*} \mu , \phi_ {*} \nu\right) +$$ + +- If $\pi^{*}$ is a minimizer of (8), its Hilbert embedding $(\phi, \phi)_{*}\pi^{*}$ is a minimizer of (7). + +Proof See proof in the supplement. + +The reformulation (8) can be viewed as the Sinkhorn divergence in sample domain $\mathcal{X} \times \mathcal{X}$ with cost function $c_{\mathcal{H}}$ induced by the nonlinear kernel $k(\cdot, \cdot)$ , e.g., RBF kernel. + +The reformulation (8) improves (7) in two promising aspects: First, the integral domain in formulation (8) is transformed into a more tractable and computable sample domain $\mathcal{X} \times \mathcal{X}$ rather than the Hilbert domain $\mathcal{H} \times \mathcal{H}$ . This is a practically useful transformation as it effectively simplifies the problem from an infinite dimensional space to a finite dimensional space. Second, this reformulation is beneficial for establishing the strong consistency and sample complexity via leveraging standard tools from RKHS theory, as shown in Section 4. + +Remark. We have a special case for Eq. (8) that enables a connection between HSD and the Wasserstein distance. That is, if $\epsilon = 0$ , then $S_{\mathcal{H},\epsilon}$ degenerates to the Wasserstein distance in RKHS. + +$$ +\mathcal {W} _ {\mathcal {H}} (\mu , \nu) = \inf _ {\pi \in \Pi (\mu , \nu)} \int_ {\mathcal {X} \times \mathcal {X}} c _ {\mathcal {H}} (x, y) d \pi (x, y) \tag {9} +$$ + +# 3.2. Discrete Hilbert Sinkhorn divergence + +In most applications, probability measures $\mu$ and $\nu$ are only discrete, i.e., empirical measures. Accordingly, we define a discrete case of our HSD for empirical measures + +$$ +\mu_ {n} = \sum_ {i = 1} ^ {n} \hat {\mu} _ {i} \delta_ {x _ {i}}, \quad \nu_ {n} = \sum_ {j = 1} ^ {n} \hat {v} _ {j} \delta_ {y _ {j}} \tag {10} +$$ + +where $\delta_{x_i}$ is the Dirac measure, and $\hat{\mu}_i$ is the probability of mass associated to $x_i$ . Similarly, $\delta_{y_i}$ and $\hat{v}_j$ are defined for + +$y_{j}$ . Let $\mathcal{B}$ denote a set of probabilistic couplings between the two empirical measures: + +$$ +\mathcal {B} = \left\{\pi \in \left(\mathbb {R} ^ {+}\right) ^ {n \times n} \mid \pi \mathbf {1} _ {n} = \mu , \pi^ {\top} \mathbf {1} _ {n} = \nu \right\} \tag {11} +$$ + +where $\mathbf{1}_n$ is a $n$ -dimensional vector of ones. Then the discrete version for HSD in (8) is + +$$ +\pi^ {*} = \underset {\pi \in \mathcal {B}} {\operatorname {a r g m i n}} \left\langle \pi , K \right\rangle_ {F} + \epsilon H (\pi) \tag {12} +$$ + +where $\langle \cdot, \cdot \rangle_F$ is the Frobenius dot product, and $K$ is the kernel matrix with entries defined on a kernel function $k$ + +$$ +K _ {i, j} = k \left(x _ {i}, x _ {i}\right) + k \left(y _ {j}, y _ {j}\right) - 2 k \left(x _ {i}, y _ {j}\right) \tag {13} +$$ + +Apparently, the discrete HSD in (12) is a strict convex problem. The Sinkhorn algorithm [12, 36] enables this problem with a unique solution $\pi^{*}$ , which is a very simple iterative algorithm involving only matrix-vector products. + +# 4. Theoretical properties + +In this section, we present several theoretical properties of HSD $S_{\mathcal{H},\epsilon}$ : consistency, asymptotic behavior and sample complexity. All the proofs are provided in the supplement. + +# 4.1. Strong consistency + +Proving the consistency of our HSD can be decomposed into two problems: variational representation and approximation. The first one leads to two propositions. Prop. 1 states that HSD admits the variational representation, which results in the lower bound in Prop. 2. We use Corollary 1 to prove the second problem in Thm. 2, which states the almost sure convergence of $S_{\mathcal{H}, \epsilon}(\mu_n, \nu_n)$ to $S_{\mathcal{H}, \epsilon}(\mu, \nu)$ . + +Proposition 1 (Variational representation) The Hilbert Sinkhorn divergence (7) admits the following variational representation in the reproducing kernel Hilbert space: + +$$ +\mathcal {S} _ {\epsilon} \left(\phi_ {*} \mu , \phi_ {*} \nu\right) = \epsilon \left(1 + \min _ {\pi_ {\phi}} \mathbb {E} _ {\pi_ {\phi}} [ T ] - \log \left(\mathbb {E} _ {\xi_ {\phi}} \left[ e ^ {T} \right]\right)\right) +$$ + +where coefficient $\epsilon > 0$ , $\pi_{\phi} \in \Pi(\phi_{*}\mu, \phi_{*}\nu)$ , $\xi_{\phi}(x,y) = e^{-\|u-v\|_{\mathcal{H}}^{2}/\epsilon}$ , and $T = \log \frac{d\pi_{\phi}}{d\xi_{\phi}} + C$ for $C \in \mathbb{R}$ . + +The variational representation relies on $T$ that is a mapping from product Hilbert space $\mathcal{H} \times \mathcal{H}$ to $\mathbb{R}$ . Alternatively, we hope to restrict the result of Prop. 1 on a more solvable space $\mathcal{X} \times \mathcal{X}$ . Prop. 2 will give a lower bound for our HSD between arbitrary measures in RKHS. + +Proposition 2 (Lower bound) The Hilbert Sinkhorn distance has the following lower bound: + +$$ +\mathcal {S} _ {\epsilon} \left(\phi_ {*} \mu , \phi_ {*} \nu\right) \geq \epsilon \left(1 + \min _ {\pi \in \Pi (\mu , \nu)} \mathbb {E} _ {\pi} [ k ] - \log \left(\mathbb {E} _ {\xi} \left[ e ^ {k} \right]\right)\right) +$$ + +where $\epsilon > 0$ , $\phi_*\mu$ and $\phi_*\nu$ are Hilbert embedding in Eq. (4), and $k$ is a kernel function. + +More interestingly, Thm. 1 ensures that Prop. 1 and Prop. 2 are also valid for our HSD between two measures $\mu$ and $\nu$ , as summarized in the following corollary. + +Corollary 1 Given notations in Prop 1 and 2, the reformulation (8) admits the following variational representation and lower bound: + +$$ +\begin{array}{l} \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) = \epsilon \left(1 + \min _ {\pi_ {\phi}} \mathbb {E} _ {\pi_ {\phi}} [ T ] - \log \left(\mathbb {E} _ {\xi_ {\phi}} \left[ e ^ {T} \right]\right)\right) \\ \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) \geq \epsilon \left(1 + \min _ {\pi \in \Pi (\mu , \nu)} \mathbb {E} _ {\pi} [ k ] - \log \left(\mathbb {E} _ {\xi} \left[ e ^ {k} \right]\right)\right) \\ \end{array} +$$ + +Results in Corollary 1 are the necessary conditions to prove that empirical Hilbert Sinkhorn divergence closes to its exact version in probability, i.e., $S_{\mathcal{H},\epsilon}(\mu_n,\nu_n)$ is the strongly consistent estimator of $S_{\mathcal{H},\epsilon}(\mu ,\nu)$ as follows. + +Theorem 2 (Strong consistency) Given $\mu_n, \nu_n$ defined in Eq. (10) and $\epsilon, \eta > 0$ , there exists $N > 0$ such that + +$$ +\forall n \geq N, \mathbb {P} \left(\left| \mathcal {S} _ {\mathcal {H}, \epsilon} \left(\mu_ {n}, \nu_ {n}\right) - \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) \right| \leq \epsilon \eta\right) = 1 +$$ + +The strong consistency theorem states the almost sure convergence of empirical estimator $S_{\mathcal{H},\epsilon}(\mu_n,\nu_n)$ , but it relies on the sample number $n \geq N$ . We will analyze the upper bound of sample number in Subsection 4.3. + +# 4.2. Asymptotic behavior + +In this section, we investigate the asymptotic properties of the proposed HSD (8) with respect to the Wasserstein distance (1). The following proposition states that $S_{\mathcal{H},\epsilon}(\mu ,\nu)$ can approximate the Wasserstein distance with the bound determined by the diameter and dimension of sample space. + +Proposition 3 (Approximation error) Define the sample space $\mathcal{X}$ as a subset of $\mathbb{R}^d$ and its diameter $|\mathcal{X}| = \sup \{\| x - y\| \mid x,y\in \mathcal{X}\}$ , we have + +$$ +\begin{array}{l} \left| \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) - \mathcal {W} _ {\epsilon} (\mu , \nu) \right| \leq \epsilon \eta \\ \left| \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) - \mathcal {W} (\mu , \nu) \right| \leq \epsilon \left(\eta + 2 d \log \frac {e ^ {2} L D}{\sqrt {d} \epsilon}\right) \tag {14} \\ \end{array} +$$ + +where $\epsilon > 0$ , $D \geq |\mathcal{X}|$ and $L$ is a Lipschitz constant. + +We are also interested in the asymptotic bound when approximating the Wasserstein distance $\mathcal{W}(\mu, \nu)$ with the discrete HSD. Combining Prop. 3 and Thm. 2 with the triangular inequality, we can have the following bound. + +Theorem 3 (Asymptotic bound) With the notations in Prop. 3, the discrete Hilbert Sinkhorn divergence $\mathcal{S}_{\mathcal{H},\epsilon}(\mu_n,\nu_n)$ approximates the Wasserstein distance $\mathcal{W}(\mu ,\nu)$ with the following bound + +$$ +\forall n \geq N, \mathbb {P} \left(\left| \mathcal {S} _ {\mathcal {H}, \epsilon} \left(\mu_ {n}, \nu_ {n}\right) - \mathcal {W} (\mu , \nu) \right| \leq \zeta\right) = 1 \tag {15} +$$ + +where $\zeta = 2\epsilon \left(\eta + d\log \frac{e^2LD}{\sqrt{d}\epsilon}\right)$ . + +![](images/ae2ebdcafd23b0e9900674b913747284b0632138441366270974e9e8aff11af3.jpg) +Figure 1. We map the vector $v$ to an empirical measure $\alpha$ as in (18), and then use Hilbert embedding $\phi_*$ to transform $\alpha$ in reproducing kernel Hilbert space. By comparing the embedded measures $\phi_*(\alpha)$ in pairwise, we obtain a new kernel upon Hilbert Sinkhorn divergence $S_{\mathcal{H},e}$ , which can be used in any kernel-based learning machine, such as SVM. + +# 4.3. Sample complexity + +We will discuss the sample complexity of our HSD, i.e., how many samples we need for the discrete HSD at a desired accuracy of a high confidence. To answer this question, we rely on the well-known covering number for RKHS and attained the refinement Thm. 2 of Thm. 4. The lemma below shows there exists finite disks such that covering $\mathcal{H}$ , and it will be useful to prove sample complexity in Thm. 4. + +Lemma 1 [59] We assume that arbitrary function $f \in \mathcal{H}$ is bounded (i.e., $\| f\|_{\mathcal{H}} \leq M$ ). Given the covering disk $B_{\eta} = \{f \in \mathcal{H} : \| f\|_{\mathcal{H}} \leq \eta \}$ , the covering number of $\mathcal{H}$ is $\mathcal{N}(\mathcal{H},\eta) \leq \left(\frac{3M}{\eta}\right)^m$ where $m$ is the number of basis that span the function $f$ . + +The covering number measures the size of reproducing kernel Hilbert space with respect to the norm $\| \cdot \|_{\mathcal{H}}$ . We will show how this quantity affects the sample complexity of the Hilbert Sinkhorn divergence $S_{\mathcal{H},\epsilon}$ . + +Theorem 4 Given the desired accuracy parameters $\eta, \epsilon > 0$ and the confidence parameter $\eta$ , we have, + +$$ +\mathbb {P} \left(\left| \mathcal {S} _ {\mathcal {H}, \epsilon} (\mu , \nu) - \mathcal {S} _ {\mathcal {H}, \epsilon} \left(\mu_ {n}, \nu_ {n}\right) \right| \leq \epsilon \eta\right) \geq 1 - \delta , \tag {16} +$$ + +whenever the number $n$ of samples satisfies + +$$ +n \geq \frac {2 M ^ {2} (\log (2 / \delta) + m \log (2 4 M / \eta))}{\eta^ {2}} \tag {17} +$$ + +where $m$ and $M$ are given in Lem. 1. + +# 5. Applications + +In this section, we apply our HSD on real-world tasks: image classification and topological data analysis. + +# 5.1. Image classification + +The whole process is depicted in Fig. 1. Each image is unfolded as a vector $v = (u_{1},\dots ,u_{n})\in \mathbb{R}^{n}$ that is further mapped to a empirical measure + +$$ +\alpha = \sum_ {i = 1} ^ {n} a _ {i} \delta_ {i} \quad \text {w i t h} \quad a _ {i} = u _ {i} / \| v \| \tag {18} +$$ + +where $\delta_{i}$ is the Dirac measure at position $i$ such that the probability mass of $\alpha_{i}$ is 1. Once the probability distributions $\alpha$ are embedded as $\phi_{*}\alpha$ in RKHS, we then apply the HSD reformulation (8) to construct + +$$ +\begin{array}{l} \mathbf {S} _ {\mathcal {H}, \epsilon^ {-}} \text {k e r n e l :} k _ {\mathcal {S}} \left(I _ {1}, I _ {2}\right) = k \left(\phi_ {*} \alpha_ {1}, \phi_ {*} \alpha_ {2}\right) \\ \stackrel {\text {d e f}} {=} \exp \left(- \frac {\mathcal {S} _ {\mathcal {H} , \epsilon} ^ {2} \left(\alpha_ {1} , \alpha_ {2}\right)}{\sigma^ {2}}\right) \tag {19} \\ \end{array} +$$ + +for two images $I_{1}$ and $I_{2}$ on the RKHS. We are able to apply $S_{\mathcal{H},\epsilon}$ -kernel in a straightforward fashion for SVM. This actually generalizes the usual kernel SVM such as RBF-SVM to $S_{\mathcal{H},\epsilon}$ -SVM that could deal with probability distributions in RKHS. Namely, this amounts to solving a SVM problem with $S_{\mathcal{H},\epsilon}$ -kernel. + +For comparison, we also apply the traditional Sinkhorn divergence (2) to define $\mathcal{W}_{\epsilon}$ kernel + +$$ +\begin{array}{l} k _ {\mathcal {W}} \left(I _ {1}, I _ {2}\right) = k \left(\alpha_ {1}, \alpha_ {2}\right) \\ \stackrel {\text {d e f}} {=} \exp \left(- \frac {\mathcal {W} _ {\epsilon} ^ {2} \left(\alpha_ {1} , \alpha_ {2}\right)}{\sigma^ {2}}\right) \tag {20} \\ \end{array} +$$ + +# 5.2. Topological data analysis (TDA) + +Topological data analysis extracts the topological features that are complementary to statistical quantities, which has found many applications in computer vision [4, 39, 25, 10, 26, 53, 47]. In TDA, persistence diagram (PD) is a favoured tool for describing topological feature, such as shape or graph. The space of PDs is a metric space with the $p$ -Wasserstein distance, which is neither an Euclidean space nor a Hilbert space. Therefore, PDs cannot be directly used as inputs for a variety of machine learning methods, such as SVM. To analyze topological features encoded in PDs, recent efforts have been devoted to vectorizing PDs in the Hilbert space [4, 25, 39]. + +Motivated by these considerations, we propose a novel intuitive kernel for TDA based on our Hilbert Sinkhorn divergence $S_{\mathcal{H},\epsilon}$ . The whole process is depicted in Fig. 2. For + +![](images/a9d17e2c57695161e471fdf2ef0b7abf87f81e8ce61afcdd2226b9ac5b3d775d.jpg) +Figure 2. We represent the topological properties of visual data using the persistence diagram $D_{i}$ . Next, the Hilbert embedding (22) maps persistence diagram $D_{i}$ to $\phi_{*}\alpha_{i}$ in reproducing kernel Hilbert space. Finally, we define $S_{\mathcal{H},\epsilon}$ -kernel (23) for persistence diagrams to enable the downstream machine learning tasks. + +the persistence diagram $D$ , we introduce the measure + +$$ +\alpha (D) := \sum_ {x \in D} w (x) \delta_ {x} \tag {21} +$$ + +with a weight $w(x) > 0$ for each generator $x = (b, d) \in D$ , where $\delta_x$ is the Dirac delta measure at $x$ . We follow [25] to define a weight function $w(x) = \arctan(C \cdot (b - d)^p)$ with $C$ and $p > 0$ . As in Def. 2, the measure $\alpha(D)$ can be embedded in RKHS via + +$$ +\alpha (D) \mapsto \phi_ {*} \alpha (D) := \sum_ {x \in D} w (x) k (\cdot , x) \tag {22} +$$ + +Since $\phi_{*}\alpha(D)$ serves as a vector representation of the persistence diagram, we can apply $S_{\mathcal{H},\epsilon}$ divergence to define a kernel over the vector representation. Similar to (19) for image classification, we consider the kernel + +$$ +\begin{array}{l} \mathbf {S} _ {\mathcal {H}, \epsilon^ {-}} \text {k e r n e l :} k _ {\mathcal {S}} \left(D _ {1}, D _ {2}\right) = k \left(\phi_ {*} \alpha_ {1}, \phi_ {*} \alpha_ {2}\right) \\ \stackrel {\text {d e f}} {=} \exp \left(- \frac {\mathcal {S} _ {\mathcal {H} , \epsilon} ^ {2} \left(\alpha_ {1} , \alpha_ {2}\right)}{\sigma^ {2}}\right) \tag {23} \\ \end{array} +$$ + +for two persistence diagrams $D_{1}$ and $D_{2}$ on the RKHS. + +# 6. Experiments + +# 6.1. Synthetic data + +We study the behavior of the proposed HSD converging to the Wasserstein distance (1). Due to the approximation (14), we could have $S_{\mathcal{H},\epsilon}(\mu ,\nu)\to \mathcal{W}_{\epsilon}(\mu ,\nu)$ if $\epsilon \rightarrow 0$ According to Def. (2), we also have $\mathcal{W}_{\epsilon}(\mu ,\nu)$ converges to the Wasserstein distance, i.e., $\mathcal{W}_{\epsilon}(\mu ,\nu)\to \mathcal{W}(\mu ,\nu)$ if regularization $\epsilon \rightarrow 0$ . So by the triangle inequality, the gap $|S_{\mathcal{H},\epsilon} - \mathcal{W}|$ is expected to decrease as the parameter $\epsilon$ decreases. We use the universal kernel $k(x,y) =$ $\exp \left(-\frac{\|x - y\|_2^2}{\sigma^2}\right)$ with $\sigma = 0.1$ to construct the matrix $K$ + +defined in (13). Fig. 4 plots $|S_{\mathcal{H},\epsilon} - \mathcal{W}| / S_{\mathcal{H},\epsilon}$ over 100 random pairs $(x,y)$ , where $x$ and $y$ are sampled from the uniform distribution $U(0,1)$ . This simulation reveals that the Hilbert Sinkhorn divergence $S_{\mathcal{H},\epsilon}$ typically approximates the Wasserstein distance with a high accuracy when $\epsilon$ is less than 0.01. + +![](images/dfb5669a19c0c1c89952c418a15303712d4b615659af98d88082273f61c4a0af.jpg) +Figure 3. The gap between the HSD and the Wasserstein distance is a function of $\epsilon$ . + +# 6.2. Image classification + +We use the handwritten dataset USPS [21], which consists of 10 classes (i.e., from digital 0 to 9). The training and datasets are sampled uniformly at random. We fix the testing size as 1000 and vary the training size accordingly. Because identifying the handwritten digit is a multi-class classification problem, we use one-versus-one encoding. + +Note that these two kernels (19) and (20) involve regularization parameter $\epsilon$ and width $\sigma$ , we choose a small subset in the training dataset to tune $\epsilon$ in $\{10^{-2}, 0.1, 1, 10, 10^2\}$ and $\sigma$ in $\{10^{-2}, 0.1, 0.2, 1, 5, 10\} \times M$ , where $M$ is the median of all the squared $S_{\mathcal{H},\epsilon}$ divergence or $\mathcal{W}_{\epsilon}$ divergence. After computing two kernels (19) and (20) between any pair of images, we employ SVMs as the classifier for the image + +classification. In our experiments, we compare three kernel methods based on RBF, Hilbert Sinkhorn divergence $S_{\mathcal{H},\epsilon}$ and traditional Sinkhorn divergence $\mathcal{W}_{\epsilon}$ . We use the universal kernel $k(x,y) = \exp \left(-\frac{\|x - y\|_2^2}{\tau^2}\right)$ to construct the cost function $c_{\mathcal{H}}$ in (8), where $\tau$ is the median of squared Euclidean distances among all samples. + +![](images/9fae64961053a4c3cfa7cf541e11cd3ae2d873953ea5e04b723921cb5f434e7b.jpg) +Figure 4. Average accuracy of SVM on USPS by using RBF, $\mathcal{W}_{\epsilon}$ -kernel and $S_{\mathcal{H},\epsilon}$ -kernel. + +Figure 4 reports the mean together with standard deviation of the classification error for all the compared methods. It is observed that $\mathcal{W}_{\epsilon}$ and $S_{\mathcal{H},\epsilon}$ kernels outperform the RBF. In particular, $S_{\mathcal{H},\epsilon}$ kernel yields the best performance when training size is varied. The out-performance attained by our method can be explained as follows. As indicated in Figure 1, our method can embed the image in sample space through $v \to \alpha \to \phi_*\alpha$ into the RKHS. Namely, rather than training on vectorial training examples, $S_{\mathcal{H},\epsilon}$ kernel learns by using a collection of embedded probability distributions $\phi_*\alpha$ . This can potentially incorporate higher-level statistical information that represents the discriminative features of images. Thus, $S_{\mathcal{H},\epsilon}$ kernel should intuitively enhance the classification power. + +# 6.3. Topological data analysis + +We compare our $\mathbf{S}_{\mathcal{H},\epsilon}$ -kernel (23) with several popular TDA methods on classical tasks: 3D shape analysis and texture recognition. Because the construction of persistence diagram (PD) is required for TDA methods, we construct their PDs of input data using the software DIPH A [5]. Parameter setting of all comparison methods will be first described. + +PSS. Persistence scale space kernel [39] utilizes the multi-scale kernel function to map PD into Hilbert space. The kernel function is defined by the solutions of heat diffusion equation and has the expression: $k(D_1, D_2) = \frac{1}{8\pi t} \sum_{p \in D_1} \sum_{q \in D_2} \exp \left( -\frac{\|p - q\|^2}{8t} \right) - \exp \left( -\frac{\|p - \bar{q}\|^2}{8t} \right)$ , where $\bar{q} = (d, b)$ is the symmetric of $q = (b, d)$ along the diagonal. Since there is no clear heuristic on how to tune $t$ , we choose the kernel scale parameter $t$ from $\{10^{-3}, 10^{-2}, 0.2, 1, 50, 10^2, 10^3\}$ . + +PSR. Persistence square-root representation [4] models a PD as a probability density function on the Hilbert Sphere. Then it discretizes the density function into a $K \times K$ grid. A smaller $K$ reduces the accuracy, and a larger $K$ improves the accuracy as well as the computational cost. Parameter $K$ is chosen from the set $\{10, 15, 30, 50, 80\}$ . + +PWG. Then the persistence weighted Gaussian kernel [25] is defined as $k(D_1, D_2) = \exp \left(-\frac{\|\alpha_1 - \alpha_2\|_{\mathcal{H}_{\tau}}}{\sigma^2}\right)$ , where $\alpha$ is the embedding measure of PD defined by (22). We use cross-validation to chose $\tau$ and $\sigma$ , each of which is taken values in 5 factors: $10^{-2}$ , 0.2, 1, 5 and 100. This leads to $5^2 = 25$ different possible grid values. + +PWK. Persistence Wasserstein kernel uses $\mathcal{W}_{\epsilon}$ kernel (20) to classify the persist diagram. Measure $\alpha$ is defined as (21) with same parameters $C$ and $p$ as PWG. We choose cross-validation to tune $\epsilon$ in $\{10^{-2}, 0.1, 1, 10\}$ and $\sigma$ in $\{10^{-2}, 0.1, 0.2, 1, 5, 10, 100\} \times M$ where $M$ is the median of all the squared $\mathcal{W}_{\epsilon}$ distances. + +PSK. Persistence Hilbert Sinkhorn kernel refers to the proposed $S_{\mathcal{H},\epsilon}$ -kernel in Eq. (23). We use universal kernel $k(x,y) = \exp \left(-\frac{\|x - y\|_2^2}{\tau^2}\right)$ to construct symmetric matrix $K$ in (13). Parameter $\tau$ is set to be the median of squared Euclidean distances among samples. Meanwhile, parameters $\epsilon, C, p$ and $\sigma$ are set as same as PWK. + +PHK. Persistence Hilbert Wasserstein kernel applies (9) to classify the persist diagram. As discussed in (9), PHK is just the special case of PSK under setting $\epsilon = 0$ while keeping other parameters invariant. + +# 6.3.1 3D shape analysis + +3D shape analysis uses sketch as input to retrieve 3D objects models, which mainly involves shape segmentation and shape classification. + +Shape segmentation aims to design a classifier that assigns the class labels to different locations in a mesh shape. We use seven datasets of SHREC2010 [22] for both training and testing in shape segmentations, containing ANT, FISH, BIRD, HUMAN, OCTOPUS, LIMB, BEAR. Motivated by [11], we use the geodesic balls to construct 1-dimensional PD that characterizes the specific bumps in the shape. In particular, we construct the PD using the geodesic distance function on the shape. + +Shape classification is performed on the 3D mesh benchmark dataset SHREC2014 [38] which consists of both synthetic (SYN) and real shapes (REAL). SYN contains 300 meshes from 15 classes of humans and REAL contains 400 meshes from 40 classes of humans. Shape classification aims to distinguish humans of different classes within SYN or REAL dataset. We use the popular heat kernel signature (HKS) [49] as the feature function for constructing 1-dimensional PDs [39, 26]. The time parameter $t$ for HKS + +Table 1. Classification performance (%) with different kernels for shape analysis. + +
DATAPSSPSRPWGPWKPHKPSK
ANT85.3 ± 1.289.1 ± 0.588.2 ± 0.490.6 ± 0.391.3 ± 0.592.7 ± 0.3
FISH74.2 ± 1.575.7 ± 0.879.3 ± 0.677.2 ± 0.775.6 ± 0.478.8 ± 0.6
BIRD65.5 ± 2.067.2 ± 1.372.2 ± 1.471.8 ± 0.472.1 ± 0.273.2 ± 0.4
HUMAN69.8 ± 1.768.8 ± 0.769.5 ± 1.172.3 ± 0.673.2 ± 0.474.3 ± 0.5
OCTOPUS78.2 ± 1.577.1 ± 0.780.2 ± 0.684.4 ± 0.583.9 ± 0.585.9 ± 0.2
LIMB68.1 ± 1.966.0 ± 1.370.8 ± 0.572.8 ± 0.871.7 ± 0.674.2 ± 0.6
BEAR67.5 ± 1.367.6 ± 0.269.3 ± 0.773.9 ± 0.472.8 ± 0.373.4 ± 0.6
SYN97.3 ± 2.896.2 ± 2.297.2 ± 1.397.4 ± 1.997.2 ± 1.598.1 ± 0.7
REAL63.1 ± 1.760.1 ± 1.765.8 ± 1.766.3 ± 2.065.2 ± 1.968.9 ± 0.5
+ +function is set as a fixed value in [0.005, 10], which controls the smoothness of the input data. + +Results. We summarize the 3D shape analysis results in Tab. 1. The difference between the performance on SHREC2010 and SHREC2014 is consistent across all methods. Shape analysis on BIRD and LIMB is "hard", because there are many small prominent bumps in these shapes. Small prominent bumps having short persistences in PD may be mistaken for topological noise, which thus fools the training process resulting classification accuracy below $75\%$ for all methods. Our persistence Hilbert Sinkhorn kernel PSK achieves the best accuracy in most cases, followed by PWG and PWK. The best shape segmentation accuracy of PSK is $92.7 \pm 0.3$ on ANT and the best shape classification result of PSK is $98.1 \pm 0.7$ on SYN. The variance of PSK is less than that of compared methods. Shape analysis results verify that $S_{\mathcal{H}_{\epsilon}}$ metric extracts more preferable nonlinear and meaningful features from probability measures in RKHS when compared with other methods. Although PWG can preserve these features, it may lose some important statistical information when matching distributions by using the metric $\| \mu_1 - \mu_2 \|_{\mathcal{H}}$ in RKHS. + +# 6.3.2 Texture recognition + +We use dataset OUTEX00000 [33] for texture recognition, including 480 texture images with 24 classes and 100 predefined training/testing splits. Following [39], texture images are downsampled to $32 \times 32$ images. We apply CLBP descriptors [20] to obtain the local region of an texture image, named as Sign (CLBP-S) and Magnitude (CLBP-M). Then we construct PDs for the component CLBP-S or CLBP-M. + +Texture recognition results are reported in Tab. 2. Our kernel (PSK) outperforms all comparison methods. Although CLBP is sensitive to noise [20] and thus results in the perturbations in PDs, our PSK can remedy such perturbations via the higher-level statistical information encoded in RKHS probability measures $\phi_{*}\alpha$ . However, the + +Table 2. Texture recognition (%) with different kernels. + +
METHODSCLBP-SCLBP-M
PSS70.5 ± 2.956.2 ± 2.3
PSR68.4 ± 1.654.3 ± 0.9
PWG73.1 ± 1.359.6 ± 1.8
PWK72.2 ± 1.257.3 ± 1.2
PHK73.8 ± 1.060.3 ± 1.4
PSK75.3 ± 1.062.3 ± 1.4
+ +worst performance of PSR confirms that the Hilbert sphere manifold is not robust to such perturbations. Notice that $\mathcal{W}_{\mathcal{H}}$ -kernel PHK achieves higher recognition rates than $\mathcal{W}_{\epsilon}$ -kernel PWK and weighted Gaussian kernel PWG but less than $\mathcal{S}_{\mathcal{H}_{\epsilon}}$ kernel PSK. This verifies that $\mathcal{S}_{\mathcal{H}_{\epsilon}}$ metric is more favorable to extract the discriminative non-linear feature representation, which can obviously improve the classification performance. + +# 7. Conclusion + +In this paper, we present a novel computational framework, i.e., Hilbert Sinkhorn divergence (HSD), to compare distributions in RKHS. We proved that it is theoretically robust due to strong consistency, asymptotic behavior and sample complexity. Our approach can be naturally extended to other kernel dependent machine learning tasks such as metric learning, domain adaptation and manifold learning. Moreover, it has great potential to succeed in non-vectorial data (e.g., graph or diagram) by a valid $S_{\mathcal{H},\epsilon}$ -kernel. While HSD can increase the accuracy of classification tasks, it is noted that the training also requires extra time. Our future work will consider the scalable Sinkhorn [1] via the Nystrom method to accelerate the computation, and investigate optimal transport in other non-Euclidean space, such as the low rank manifold [28] and Grassmannian manifold [27]. + +Acknowledgment: This work was supported by the Australian Research Council under Grant DP200101374 and Grant LP170100891. + +# References + +[1] J. Altschuler, F. Bach, A. Rudi, and J. Niles-Weed. Massively scalable sinkhorn distances via the nyström method. In Advances in Neural Information Processing Systems, pages 4427–4437, 2019. 1, 8 +[2] J. Altschuler, J. Niles-Weed, and P. Rigollet. Near-linear time approximation algorithms for optimal transport via sinkhorn iteration. In Advances in neural information processing systems, pages 1964-1974, 2017. 1 +[3] D. Alvarez-Melis and T. Jaakkola. Gromov-wasserstein alignment of word embedding spaces. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1881-1890, 2018. 2 +[4] R. Anirudh, V. Venkataraman, K. Natesan Ramamurthy, and P. Turaga. A riemannian framework for statistical analysis of topological persistence diagrams. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 68-76, 2016. 5, 7 +[5] U. Bauer, M. Kerber, and J. Reininghaus. Distributed computation of persistent homology. In 2014 Proceedings of the Sixteenth Workshop on Algorithm Engineering and Experiments (ALENEX), pages 31-38. SIAM, 2014. 7 +[6] A. Berlinet and C. Thomas-Agnan. Reproducing kernel Hilbert spaces in probability and statistics. Springer Science & Business Media, 2011. 3 +[7] M. Blondel, V. Seguy, and A. Rolet. Smooth and sparse optimal transport. In International Conference on Artificial Intelligence and Statistics, pages 880-889, 2018. 1 +[8] N. Bonneel, J. Rabin, G. Peyre, and H. Pfister. Sliced and radon wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision, 51(1):22-45, 2015. 1 +[9] C. Bunne, D. Alvarez-Melis, A. Krause, and S. Jegelka. Learning generative models across incomparable spaces. arXiv preprint arXiv:1905.05461, 2019. 2 +[10] M. Carriere, M. Cuturi, and S. Oudot. Sliced wasserstein kernel for persistence diagrams. In International Conference on Machine Learning, pages 664-673. PMLR, 2017. 5 +[11] M. Carrière, S. Y. Oudot, and M. Ovsjanikov. Stable topological signatures for points on 3d shapes. In Computer Graphics Forum, volume 34, pages 1-12. Wiley Online Library, 2015. 7 +[12] M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pages 2292-2300, 2013. 1, 2, 4 +[13] M. Cuturi and G. Peyre. A smoothed dual approach for variational Wasserstein problems. SIAM Journal on Imaging Sciences, 9(1):320-343, 2016. 1 +[14] I. Deshpande, Y.-T. Hu, R. Sun, A. Pyrros, N. Siddiqui, S. Koyejo, Z. Zhao, D. Forsyth, and A. G. Schwing. Max-sliced Wasserstein distance and its use for gans. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 10648-10656, 2019. 1 +[15] I. Deshpande, Z. Zhang, and A. G. Schwing. Generative modeling using the sliced Wasserstein distance. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3483-3491, 2018. 1 + +[16] A. Dessein, N. Papadakis, and J.-L. Rouas. Regularized optimal transport and the rot mover's distance. The Journal of Machine Learning Research, 19(1):590-642, 2018. 1 +[17] R. Flamary, N. Courty, D. Tuia, and A. Rakotomamonjy. Optimal transport for domain adaptation. IEEE Trans. Pattern Anal. Mach. Intell, 2016. 1 +[18] A. Genevay, M. Cuturi, G. Peyré, and F. Bach. Stochastic optimization for large-scale optimal transport. In Advances in neural information processing systems, pages 3440-3448, 2016. 1 +[19] A. Genevay, G. Peyré, and M. Cuturi. Learning generative models with sinkhorn divergences. In International Conference on Artificial Intelligence and Statistics, pages 1608-1617, 2018. 1 +[20] Z. Guo, L. Zhang, and D. Zhang. A completed modeling of local binary pattern operator for texture classification. IEEE Transactions on Image Processing, 19(6):1657-1663, 2010. 8 +[21] J. J. Hull. A database for handwritten text recognition research. IEEE Transactions on pattern analysis and machine intelligence, 16(5):550-554, 1994. 6 +[22] E. Kalogerakis, A. Hertzmann, and K. Singh. Learning 3d mesh segmentation and labeling. Acm Transactions on Graphics, 29(4):1-12, 2010. 7 +[23] S. Kolouri, K. Nadjahi, U. Simsekli, R. Badeau, and G. Rohde. Generalized sliced wasserstein distances. In Advances in Neural Information Processing Systems, pages 261-272, 2019. 1 +[24] S. Kolouri, Y. Zou, and G. K. Rohde. Sliced wasserstein kernels for probability distributions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5258-5267, 2016. 1 +[25] G. Kusano, Y. Hiraoka, and K. Fukumizu. Persistence weighted gaussian kernel for topological data analysis. In International Conference on Machine Learning, pages 2004–2013, 2016. 2, 5, 6, 7 +[26] C. Li, M. Ovsjanikov, and F. Chazal. Persistence-based structural recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1995-2002, 2014. 5, 7 +[27] Q. Li, W. Niu, G. Li, Y. Cao, J. Tan, and L. Guo. Lingo: linearized grassmannian optimization for nuclear norm minimization. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pages 801-809, 2015. 8 +[28] Q. Li and Z. Wang. Riemannian submanifold tracking on low-rank algebraic variety. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. 8 +[29] T. Lin, Z. Hu, and X. Guo. Sparsemax and relaxed Wasserstein for topic sparsity. In Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, pages 141-149, 2019. 1 +[30] K. Muandet, K. Fukumizu, B. Sriperumbudur, and B. Scholkopf. Kernel mean embedding of distributions: A review and beyond. arXiv preprint arXiv:1605.09522, 2016. 2 + +[31] J. Niles-Weed and P. Rigollet. Estimation of wasserstein distances in the spiked transport model. arXiv preprint arXiv:1909.07513, 2019. 1 +[32] J. H. Oh, M. Pouryahya, A. Iyer, A. P. Apte, J. O. Deasy, and A. Tannenbaum. A novel kernel Wasserstein distance on gaussian measures: An application of identifying dental artifacts in head and neck computed tomography. Computers in Biology and Medicine, page 103731, 2020. 2 +[33] T. Ojala, T. Maenpää, M. Pietikainen, J. Viertola, J. Kyllönen, and S. Huovinen. Outex - new framework for empirical evaluation of texture analysis algorithms. In International Conference on Pattern Recognition, 2002. Proceedings, pages 701-706 vol.1, 2002. 8 +[34] F.-P. Paty and M. Cuturi. Subspace robust wasserstein distances. arXiv preprint arXiv:1901.08949, 2019. 1 +[35] G. Peyré, L. Chizat, F.-X. Vialard, and J. Solomon. Quantum entropic regularization of matrix-valued optimal transport. European Journal of Applied Mathematics, 30(6):1079-1102, 2019. 1 +[36] G. Peyré, M. Cuturi, et al. Computational optimal transport: With applications to data science. Foundations and Trends® in Machine Learning, 11(5-6):355-607, 2019. 2, 4 +[37] G. Peyré, M. Cuturi, and J. Solomon. Gromov-wasserstein averaging of kernel and distance matrices. In International Conference on Machine Learning, pages 2664-2672, 2016. 2 +[38] D. Pickup, X. Sun, P. L. Rosin, R. R. Martin, Z. Cheng, Z. Lian, M. Aono, A. B. Hamza, A. Bronstein, and M. Bronstein. Shape retrieval of non-rigid 3d human models. In Eurographics Workshop on 3d Object Retrieval, pages 101-110, 2014. 7 +[39] J. Reininghaus, S. Huber, U. Bauer, and R. Kwitt. A stable multi-scale kernel for topological machine learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4741-4748, 2015. 5, 7, 8 +[40] F. Santambrogio. Optimal transport for applied mathematicians. Birkhäuser, NY, 55(58-63):94, 2015. 1 +[41] G. Schiebinger, J. Shu, M. Tabaka, B. Cleary, V. Subramanian, A. Solomon, J. Gould, S. Liu, S. Lin, P. Berube, et al. Optimal-transport analysis of single-cell gene expression identifies developmental trajectories in reprogramming. Cell, 176(4):928–943, 2019. 1 +[42] M. A. Schmitz, M. Heitz, N. Bonneel, F. Ngole, D. Coeurjolly, M. Cuturi, G. Peyre, and J.-L. Starck. Wasserstein dictionary learning: Optimal transport-based unsupervised nonlinear dictionary learning. SIAM Journal on Imaging Sciences, 11(1):643-678, 2018. 1 +[43] D. Sejdinovic, H. Strathmann, M. L. Garcia, C. Andrieu, and A. Gretton. Kernel adaptive metropolis-hastings. In International conference on machine learning, pages 1665–1673, 2014. 2 +[44] A. Smola, A. Gretton, L. Song, and B. Schölkopf. A hilbert space embedding for distributions. In International Conference on Algorithmic Learning Theory, pages 13-31. Springer, 2007. 3 +[45] J. Solomon, F. De Goes, G. Peyre, M. Cuturi, A. Butscher, A. Nguyen, T. Du, and L. Guibas. Convolutional Wasserstein + +distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics (TOG), 34(4):1-11, 2015. 2 +[46] J. Solomon, G. Peyre, V. G. Kim, and S. Sra. Entropic metric alignment for correspondence problems. ACM Transactions on Graphics (TOG), 35(4):1-13, 2016. 2 +[47] A. Som, K. Thopalli, K. N. Ramamurthy, V. Venkataraman, A. Shukla, and P. Turaga. Perturbation robust representations of topological persistence diagrams. In Proceedings of the European Conference on Computer Vision (ECCV), pages 617-635, 2018. 5 +[48] B. K. Sriperumbudur, A. Gretton, K. Fukumizu, B. Scholkopf, and G. R. Lanckriet. Hilbert space embeddings and metrics on probability measures. The Journal of Machine Learning Research, 11:1517-1561, 2010. 2, 3 +[49] J. Sun, M. Ovsjanikov, and L. Guibas. A concise and provably informative multi-scale signature based on heat diffusion. In Computer graphics forum, volume 28, pages 1383-1392. Wiley Online Library, 2009. 7 +[50] V. Titouan, R. Flamary, N. Courty, R. Tavenard, and L. Chapel. Sliced gromov-wasserstein. In Advances in Neural Information Processing Systems, pages 14753-14763, 2019. 2 +[51] C. Villani. Topics in optimal transportation. Number 58. American Mathematical Soc., 2003. 1 +[52] C. Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008. 1 +[53] Z. Wang, Q. Li, G. Li, and G. Xu. Polynomial representation for persistence diagram. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6123-6132, 2019. 5 +[54] Z. Wang and V. Solo. Lie group state estimation via optimal transport. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5625-5629. IEEE, 2020. 1 +[55] Z. Wang and V. Solo. Particle filtering on the stiefel manifold with optimal transport. In 2020 59th IEEE Conference on Decision and Control (CDC), pages 4111-4116. IEEE, 2020. 1 +[56] J. Wu, Z. Huang, D. Acharya, W. Li, J. Thoma, D. P. Paudel, and L. V. Gool. Sliced wasserstein generative models. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3713-3722, 2019. 1 +[57] Y. Yan, W. Li, H. Wu, H. Min, M. Tan, and Q. Wu. Semi-supervised optimal transport for heterogeneous domain adaptation. In *IJCAI*, pages 2969-2975, 2018. 2 +[58] Z. Zhang, M. Wang, and A. Nehorai. Optimal transport in reproducing kernel hilbert spaces: Theory and applications. IEEE transactions on pattern analysis and machine intelligence, 2019. 2 +[59] D.-X. Zhou. Capacity of reproducing kernel spaces in learning theory. IEEE Transactions on Information Theory, 49(7):1743-1752, 2003. 5 \ No newline at end of file diff --git a/hilbertsinkhorndivergenceforoptimaltransport/images.zip b/hilbertsinkhorndivergenceforoptimaltransport/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..358a6e60693a11a7882e69a04994488b561f42c2 --- /dev/null +++ b/hilbertsinkhorndivergenceforoptimaltransport/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a501bbd2869af0afaf8d97c8697dff944a6b50206012af70fd3dc848dffcad91 +size 439394 diff --git a/hilbertsinkhorndivergenceforoptimaltransport/layout.json b/hilbertsinkhorndivergenceforoptimaltransport/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7f0c97cc52f6d62fb3156c827cceb390c467c38e --- /dev/null +++ b/hilbertsinkhorndivergenceforoptimaltransport/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f1cd0206a361af92032238b28a8f8ab060dcfc29dc28c9447bf90cac9964c70 +size 585301 diff --git a/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_content_list.json b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e198ab86651d204c526ad7811dd80f244e4e0533 --- /dev/null +++ b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed8532ed5281cec70a29766c78637289439b1f942f824596d042a75fd16afd4e +size 102220 diff --git a/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_model.json b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3f6f3cca67c3b2dcc0e3340c46d8dc53d67f87ff --- /dev/null +++ b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a21ecef47505ee3883aa2c04b69426435ccb6ae810959bc7652069c9fe9f960 +size 120827 diff --git a/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_origin.pdf b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2a0e6d9c89d71e265a4710155682afe027ff6fc0 --- /dev/null +++ b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/6afc3dab-540e-47b1-8e63-1b8336388139_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ef595fb40f5711705291b256594cfd69b8d9cc2bfa836e1908cb2c97ea55271 +size 7850729 diff --git a/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/full.md b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a72a38496c3b236999146ba80d36db78438df02a --- /dev/null +++ b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/full.md @@ -0,0 +1,543 @@ +# HistoGAN: + +# Controlling Colors of GAN-Generated and Real Images via Color Histograms + +Mahmoud Afifi + +Marcus A. Brubaker + +Michael S. Brown + +York University + +{mafifi,mab,mbrown}@eecs.yorku.ca + +![](images/fc0033fb8479736bbda28ebae0a4cd755a3a6eeb86e6f71539c704eae10c064f.jpg) +Target colors + +![](images/491639cd868535dff155e6f1541ff08d003f86c1cc407a45d10f5ae37e7547c7.jpg) +Histograms + +![](images/2efc483062b0f8a017bdc1f8224159414b8916dc2c8d333a61ffd3b32bb2e7f5.jpg) + +![](images/5a26143257e74408926607adcb908fbb79d2812881a5345c30faaee9a363ff45.jpg) + +Auto-recolored +Auto-recolored input image without the need to manually specify target histogram + +![](images/cc9ae04e3cdd984eb016816c4e42ea6aa58e8b004cee58f3988eaf8583bc9fb2.jpg) + +![](images/ebc7cf40239731cf28a8d8031b5f3212a61c634ed9aeb8829766cfc9dc4e0232.jpg) + +![](images/72cce0cdfa8bcd99f76f427889a8c3642dcfebfc2f1061fb6d6e5c13cd2edfa4.jpg) + +![](images/80b467622b4b36d215cc5029bc62ab53201c8741d9919b5d69f628ffd9f7cd64.jpg) + +![](images/edf8d8de33ceb15d4092ca20fb4ac65cde1d662806202775055507bccfdff80b.jpg) + +![](images/ec0a77435b943bd5ef2b677e6fe5a9f39879777240fdc76c44cdc9e6140901bd.jpg) + +![](images/a9d7b539137814cc59204d35970ee6474b19916185b15827a4ff80914a0dc807.jpg) +Input image +Figure 1: HistoGAN is a generative adversarial network (GAN) that learns to manipulate image colors based on histogram features. Top: GAN-generated images with color distributions controlled via target histogram features (left column). Bottom: Results of ReHistoGAN, an extension of HistoGAN to recolor real images, using sampled target histograms. + +![](images/eb43346192e2d444f170408a172b8a89007588cfeaf30854a8576aa9975124bf.jpg) + +![](images/7e749b6404704196714f5291354df2f6de915124f658b67a343e0818b1eaf86f.jpg) +GAN-generated images based on specified histogram feature + +![](images/17bab02e144d513753136e9ef4035ce8576b3c3acef5e5642e5a35c281f7cc6d.jpg) + +![](images/a6e666065e4787d10a4431c99241ba71c5729bd43d908172f23cc5a52f49319e.jpg) + +![](images/420ad4d3f2b75c8e2abda844965e1d6ae5e7060c7260bf6137235a27378fd3ba.jpg) + +![](images/a61c8228374e2a9c35b037d06000bc0184a5590a1b0dbbf54c08b675edefccd3.jpg) + +![](images/3807ace442b931f705f8b6e696da3f20cf948e5cf874e55f29b515eab8911b14.jpg) + +# Abstract + +While generative adversarial networks (GANs) can successfully produce high-quality images, they can be challenging to control. Simplifying GAN-based image generation is critical for their adoption in graphic design and artistic work. This goal has led to significant interest in methods that can intuitively control the appearance of images generated by GANs. In this paper, we present HistoGAN, a color histogram-based method for controlling GAN-generated images' colors. We focus on color histograms as they provide an intuitive way to describe image color while remaining decoupled from domain-specific semantics. Specifically, we introduce an effective modification of the recent StyleGAN architecture [31] to control the colors of GAN-generated images specified by a target color histogram feature. We then describe how to expand HistoGAN to recolor real images. For image recoloring, we jointly train an encoder network along with HistoGAN. The recoloring model, ReHistoGAN, is an unsupervised ap + +proach trained to encourage the network to keep the original image's content while changing the colors based on the given target histogram. We show that this histogram-based approach offers a better way to control GAN-generated and real images' colors while producing more compelling results compared to existing alternative strategies. + +# 1. Motivation and Related Work + +Color histograms are an expressive and convenient representation of an image's color content. Color histograms are routinely used by conventional color transfer methods (e.g., [18, 40, 46, 56]). These color transfer methods aim to manipulate the colors in an input image to match those of a target image, such that the images share a similar "look and feel". In the color transfer literature, there are various forms of color histograms used to represent the color distribution of an image, such as a direct 3D histogram [18, 46, 56], 2D histogram [4, 6, 10, 11], color palette [7, 12, 58] or color + +triad [52]. Despite the effectiveness of color histograms for color transfer, recent deep learning methods almost exclusively rely on image-based examples to control colors. While image exemplars impact the final colors of generative adversarial network (GAN)-generated images and deep recolored images, these methods – that mostly target image style transfer – also affect other style attributes, such as texture information and tonal values [20, 21, 27, 28, 37, 50, 54]. Consequently, the quality of the results produced by these methods often depends on the semantic similarity between the input and target images, or between a target image and a particular domain [25, 50]. + +In this paper, our attention is focused explicitly on controlling only the color attributes of images—this can be considered a sub-category of image style transfer. Specifically, our method does not require shared semantic content between the input/GAN-generated images and a target image or guide image. Instead, our method aims to assist the deep network through color histogram information only1. With this motivation, we first explore using color histograms to control the colors of images generated by GANs. + +Controlling Color in GAN-Generated Images GANs are often used as "black boxes" that can transform samples from a simple distribution to a meaningful domain distribution without an explicit ability to control the details/style of the generated images [9, 22, 29, 36, 45]. Recently, methods have been proposed to control the style of the GAN-generated images. For example, StyleGAN [30, 31] proposed the idea of "style mixing", where different latent style vectors are progressively fed to the GAN to control the style and appearance of the output image. To transfer a specific style in a target image to GAN-generated images, an optimization process can be used to project the target image to the generator network's latent space to generate images that share some properties with the target image [1, 31]. However, this process requires expensive computations to find the latent code of the target image. Another direction is to jointly train an encoder-generator network to learn this projection [13, 35, 43]. More recently, methods have advocated different approaches to control the output of GANs, such as using the normalization flow [2], latent-to-domain-specific mapping [13], deep classification features [51], few-shot image-to-image translation [48], and a single-image training strategy [49]. Despite the performance improvements, most of these methods are limited to work with a single domain of both target and GAN-generated images [35, 43]. + +We seek to control GAN-generated images using color histograms as our specified representation of image style. Color histograms enable our method to accept target images taken from any arbitrary domain. Figure 1-top shows GAN-generated examples using our method. As shown in Fig. 1, + +our generated images share the same color distribution as the target images without being restricted to, or influenced by, the semantic content of the target images. + +Recoloring Real Images In addition to controlling the GAN-generated images, we seek to extend our approach to perform image recoloring within the GAN framework. In this context, our method accepts a real input image and a target histogram to produce an output image with the fine details of the input image but with the same color distribution given in the target histogram. Our method is trained in a fully unsupervised fashion, where no ground-truth recolored image is required. Instead, we propose a novel adversarial-based loss function to train our network to extract and consider the color information in the given target histogram while producing realistic recolored images. One of the key advantages of using the color histogram representation as our target colors can be shown in Fig. 1-bottom, where we can automatically recolor an image without directly having to specify a target color histogram. Auto-image recoloring is a less explored research area with only a few attempts in the literature (e.g., [7, 8, 16, 34, 59]). + +# 2. HistoGAN + +We begin by describing the histogram feature used by our method (Sec. 2.1). Afterwards, we discuss the proposed modification to the second version of StyleGAN [31] to incorporate our histogram feature into the generator network (Sec. 2.2). Lastly, we explain how this method can be expanded to control colors of real input images to perform image recoloring (Sec. 2.3). + +# 2.1. Histogram feature + +The histogram feature used by HistoGAN is borrowed from the color constancy literature [4-6, 11] and is constructed to be a differentiable histogram of colors in the log-chroma space due to better invariance to illumination changes [17, 19]. The feature is a 2D histogram of an image's colors projected into a log-chroma space. This 2D histogram is parameterized by $uv$ and conveys an image's color information while being more compact than a typical 3D histogram defined in RGB space. A log-chroma space is defined by the intensity of one channel, normalized by the other two, giving three possible options of how it is defined. Instead of selecting only one such space, all three options can be used to construct three different histograms which are combined together into a histogram feature, $\mathbf{H}$ , as an $h \times h \times 3$ tensor [6]. + +The histogram is computed from a given input image, I, by first converting it into the log-chroma space. For instance, selecting the R color channel as primary and normalizing by G and B gives: + +$$ +\mathbf {I} _ {u R} (\mathbf {x}) = \log \left( \begin{array}{c} \mathbf {I} _ {\mathrm {R}} (\mathbf {x}) + \epsilon \\ \overline {{\mathbf {I}}} _ {\mathrm {G}} (\mathbf {x}) + \epsilon \end{array} \right), \mathbf {I} _ {v R} (\mathbf {x}) = \log \left( \begin{array}{c} \mathbf {I} _ {\mathrm {R}} (\mathbf {x}) + \epsilon \\ \overline {{\mathbf {I}}} _ {\mathrm {B}} (\mathbf {x}) + \epsilon \end{array} \right), (1) +$$ + +![](images/e685b8db64fcdede00b7f123746793899c843bfdfeb015351a32e7eb84314592.jpg) +(A) Simplified version of StyleGAN's first block + +![](images/6fd6d4372da6f90b6736aa7415e5cbd1dac787e82f9128c31dbe31ad1baa6f3f.jpg) +(B) Simplified version of StyleGAN's last block + +![](images/81a32366d6cff5844674d2b2c004122da2d6acfda367dca190d2c0321dfead05.jpg) +(C) HistoGAN block + +where the R, G, B subscripts refer to the color channels of the image I, $\epsilon$ is a small constant added for numerical stability, $\mathbf{x}$ is the pixel index, and $(uR, vR)$ are the $uv$ coordinates based on using R as the primary channel. The other components $\mathbf{I}_{uG}, \mathbf{I}_{vG}, \mathbf{I}_{uB}, \mathbf{I}_{vB}$ are computed similarly by projecting the G and B color channels to the log-chroma space. In [6], the RGB- $uv$ histogram is computed by thresholding colors to a bin and computing the contribution of each pixel based on the intensity $\mathbf{I}_y(\mathbf{x}) = \sqrt{\mathbf{I}_\mathrm{R}^2(\mathbf{x}) + \mathbf{I}_\mathrm{G}^2(\mathbf{x}) + \mathbf{I}_\mathrm{B}^2(\mathbf{x})}$ . In order to make the representation differentiable, [4] replaced the thresholding operator with a kernel weighted contribution to each bin. The final unnormalized histogram is computed as: + +$$ +\mathbf {H} (u, v, c) \propto \sum_ {\mathbf {x}} k (\mathbf {I} _ {u c} (\mathbf {x}), \mathbf {I} _ {v c} (\mathbf {x}), u, v) \mathbf {I} _ {y} (\mathbf {x}), \quad (2) +$$ + +where $c \in \{\mathrm{R}, \mathrm{G}, \mathrm{B}\}$ and $k(\cdot)$ is a pre-defined kernel. While a Gaussian kernel was originally used in [4], we found that the inverse-quadratic kernel significantly improved training stability. The inverse-quadratic kernel is defined as: + +$$ +\begin{array}{l} k \left(\mathbf {I} _ {u c}, \mathbf {I} _ {v c}, u, v\right) = \left(1 + \left(\left| \mathbf {I} _ {u c} - u \right| / \tau\right) ^ {2}\right) ^ {- 1} \\ \times \left(1 + \left(\left| \mathbf {I} _ {v c} - v \right| / \tau\right) ^ {2}\right) ^ {- 1}, \tag {3} \\ \end{array} +$$ + +where $\tau$ is a fall-off parameter to control the smoothness of the histogram's bins. Finally, the histogram feature is normalized to sum to one, i.e., $\sum_{u,v,c}\mathbf{H}(u,v,c) = 1$ . + +# 2.2. Color-controlled Image Generation + +Our histogram feature is incorporated into an architecture based on StyleGAN [31]. Specifically, we modified the original design of StyleGAN (Fig. 2-[A] and [B]) such that we can "inject" the histogram feature into the progressive construction of the output image. The last two blocks of the StyleGAN (Fig. 2-[B]) are modified by replacing the fine-style vector with the color histogram feature. The histogram feature is then projected into a lower-dimensional + +![](images/70ee7ab512fd79f19c462f3bc25974b1d4aa95af47e7c50a5bf51d7321202009.jpg) +Figure 2: We inject our histogram into StyleGAN [31] to control the generated image colors. (A) and (B) are simplified versions of the StyleGAN's first and last blocks. We modified the last two blocks of the StyleGAN by projecting our histogram feature into each block's latent space, as shown in (C). The parameter $m$ controls the capacity of the model. +Figure 3: Progressively generated images using the HistogramGAN modifications. + +representation by a "histogram projection" network (Fig. 2[C]). This network consists of eight fully connected layers with a leaky ReLU (LReLU) activation function [38]. The first layer has 1,024 units, while each of the remaining seven layers has 512. The "to-latent" block, shown in orange in Fig. 2, maps the projected histogram to the latent space of each block. This "to-latent" block consists of a single fc layer with $2^{n}m$ output neurons, where $n$ is the block number, and $m$ is a parameter used to control the entire capacity of the network. + +To encourage generated images to match the target color histogram, a color matching loss is introduced to train the generator. Because of the differentiability of our histogram representation, the loss function, $C(\mathbf{H}_g,\mathbf{H}_t)$ , can be any differentiable metric of similarity between the generated and target histograms $\mathbf{H}_g$ and $\mathbf{H}_t$ , respectively. For simplicity, we use the Hellinger distance defined as: + +$$ +C \left(\mathbf {H} _ {g}, \mathbf {H} _ {t}\right) = \frac {1}{\sqrt {2}} \left\| \mathbf {H} _ {g} ^ {1 / 2} - \mathbf {H} _ {t} ^ {1 / 2} \right\| _ {2}, \tag {4} +$$ + +where $\| \cdot \| _2$ is the standard Euclidean norm and $\mathbf{H}^{1 / 2}$ is an element-wise square root. Note that the Hellinger distance is closely related to the Bhattacharyya coefficient, $B(\cdot)$ , where $C\left(\mathbf{H}_g,\mathbf{H}_t\right) = (1 - B\left(\mathbf{H}_g,\mathbf{H}_t\right))^{1 / 2}$ . + +![](images/ccf168cb3d81538d9ee8d3c90fb1c325a7442e9f40516710909c14008575532c.jpg) +Figure 4: Our Recoloring-HistoGAN (ReHistoGAN) network. We map the input image into the HistoGAN's latent space using an encoder-decoder network with skip connections between each encoder and decoder blocks. Additionally, we pass the latent feature of the first two encoder blocks to our GAN's head after processing it with the histogram's latent feature. + +This color-matching histogram loss function is combined with the discriminator to give the generator network loss: + +$$ +\mathcal {L} _ {g} = D \left(\mathbf {I} _ {g}\right) + \alpha C \left(\mathbf {H} _ {g}, \mathbf {H} _ {t}\right), \tag {5} +$$ + +where $\mathbf{I}_g$ is the GAN-generated image, $D(\cdot)$ is our discriminator network that produces a scalar feature given an image (see supp. materials for more details), $\mathbf{H}_t$ is the target histogram feature (injected into the generator network), $\mathbf{H}_g$ is the histogram feature of $\mathbf{I}_g$ , $C(\cdot)$ is our histogram loss function, and $\alpha$ is a scale factor to control the strength of the histogram loss term. + +As our histogram feature is computed by a set of differentiable operations, our loss function (Eqs. 4 and 5) can be optimized using SGD. During training, different target histograms $\mathbf{H}_t$ are required. To generate these for each generated image, we randomly select two images from the training set, compute their histograms $\mathbf{H}_1$ and $\mathbf{H}_2$ , and then randomly interpolate between them. Specifically, for each generated image during training, we generate a random target histogram as follows: + +$$ +\mathbf {H} _ {t} = \delta \mathbf {H} _ {1} + (1 - \delta) \mathbf {H} _ {2}, \tag {6} +$$ + +where $\delta \sim U(0,1)$ is sampled uniformly. The motivation behind this interpolation process is to expand the variety of histograms during training. This is a form of data augmentation for the histograms with the implicit assumption of the convexity of the histogram distribution in the target domain (e.g., face images). We found this augmentation helped reduce overfitting to the histograms of the training images and ensured robustness at test time. We note that this assumption does not hold true for target domains with high diversity where the target histograms span a broad range in the log-chroma space and can be multimodal (e.g., landscape images). Nonetheless, we found that even in those cases the augmentation was still beneficial to the training. + +With this modification to the original StyleGAN architecture, our method can control the colors of generated im + +![](images/67aa8c2d5269ed5f9e0ed910be5e99e39b9b5701cb20dbfe0a52b93058cd783d.jpg) + +![](images/6fc0968c366c271f11f8e97c86b94fe92de6c92d207167453becf1d681186ed6.jpg) +Input image + +![](images/5193eff840bf7091c12a0488c7989c913f4e0aff9ea7d99b3a93ab2e1faaa735.jpg) + +![](images/92c4f7151829c146cabe37bcbdcc472e77b605b7dfab671aa1154f4549425d1f.jpg) +Target colors + +![](images/9b1b85a18e7b422b3e6664255a8f0b07af3756b4f2288cd376879640200ac714.jpg) + +![](images/550b3c40eca5f46fa7075c451e8cd24cc26f64155f486ccf74f68ec562243f7a.jpg) +Figure 5: Results of training ReHistoGAN with and without the variance loss term described in Eq. 9. + +![](images/c951f4ce730493d1ea6b53077724daab59acbd98fff261be2ba21d82e51ae405.jpg) + +![](images/ce18d8e2a16f57705b34352a5cbd304f67899bd53fff93c32db8f7ce566770d0.jpg) +w/o variance loss +w/ variance loss + +ages using our color histogram features. Figure 3 shows the progressive construction of the generated image by HistogramAN. As can be seen, the outputs of the last two blocks are adjusted to consider the information conveyed by the target histogram to produce output images with the same color distribution represented in the target histogram. + +# 2.3. Image Recoloring + +We can also extend HistoGAN to recolor an input image, as shown in Fig. 1-bottom. Recoloring an existing input image, $\mathbf{I}_i$ , is not straightforward because the randomly sampled noise and style vectors are not available as they are in a GAN-generated scenario. As shown in Fig. 3, the head of HistoGAN (i.e., the last two blocks) are responsible for controlling the colors of the output image. Instead of optimizing for noise and style vectors that could be used to generate a given image $\mathbf{I}_i$ , we propose to train an encoding network that maps the input image into the necessary inputs of the head of HistoGAN. With this approach, the head block can be given different histogram inputs to produce a wide variety of recolored versions of the input image. We dub this extension the "Recoloring-HistoGAN" or ReHistoGAN for short. The architecture of ReHistoGAN is shown in Fig. 4. The "encoder" has a U-Net-like structure [47] with skip connections. To ensure that fine details are preserved in the recolored image, $\mathbf{I}_r$ , the early latent feature produced by the first two U-Net blocks are further provided as input into the HistoGAN's head through skip connections. The target color information is passed to the HistoGAN head blocks + +![](images/b331c2e543ede9b61679ddabde3a5b9062ffc9a14199a882af85626dbfaf0564.jpg) +Input image +Figure 6: Results of image recoloring using the encoderGAN reconstruction without skip connections and our ReHistoGAN using our proposed loss function. + +![](images/639342bccb1a1e2019be02ab7d7a7d017775f89e88c4864e04cd9bd6d5f57ded.jpg) +Target colors + +![](images/8b83942d193c4bb8ba0b6971fcf4bc881f8a2fcf035c8a7f376e0453578c09f7.jpg) +w/o skip connection + +![](images/99c148ae330acf0e87d0955c39eee7a6369579fd015538ba6c5ebbdeaf1b7b78.jpg) +ReHistoGAN + +![](images/3909baeb287a41841bea05e46f805c08b9ebebdc42ff1679b73f838770799fec.jpg) + +![](images/607113c8dc2b30cfa45f2876ab7949b98f7d1be75f3d4a60387e3f66383efbc0.jpg) + +![](images/bb9c34948ccc1506368dcdb6c2b39ec458ddec7a98e632abb01728bc7f1aa142.jpg) + +![](images/8dc23c282dc1fae5ee2c4cc7bea8622bf6516237bb0146374212ddbc615cbe89.jpg) + +![](images/10c5fe086a58f99367532832bdd952c093d12cd80babbcfb17df91674c9ac6cd.jpg) + +![](images/809912f3ae9974454cf5a072e42e899a6e0a71e2d8ab1676576dcdcbdbcce924.jpg) +Target colors + +![](images/36244e280ec0f4d6fac669b3fcbfe61710a3d87f8064e1c9a6142a3e869f77ec.jpg) + +![](images/8b832d7f6f4532b376e1822a0151250b943b1b5d822584accf95ad05e6326392.jpg) + +![](images/2eb05ebc03bb419574c16ee301aa5ad79edc10dd361f0488bb3d2562dc2782cb.jpg) + +![](images/2732ca448e1a274d09066aacd16c518fd72dac5962ad609dd22af5dd86caf6e9.jpg) + +![](images/b00800d19bcd10d6f6ab48ed9569a896838404b1c92ad1ae48fbdd8e6c56bfd2.jpg) + +![](images/d5746266aedbb28f4d8930310768fc39e07f2f0d567c36eebfcc70225e39f5f9.jpg) +Our generated images + +![](images/227b29a19e4f89a4a85da1025520d2527fcce8be1f4ab893dd0304d1d404a619.jpg) + +![](images/18b1ba85419e37a2989c5b1d19586662fbf65b24804a8fad61b80f0140af72ca.jpg) + +![](images/2425af2976c1fa6b3641459c5e0fcaf17a7552e31739a560bf094413499ec12e.jpg) + +![](images/dbd341deee9685d4a4054a7123da92d226fd830915290b9fa538c9d425927603.jpg) + +![](images/92f52af4f7319e8eb5ae504d600ebba3bdde4855cc311cd4aefcfe5086d09aa1.jpg) + +![](images/1702f33c2680defa632af206cabe69e12f4d1272e0c61c4f70803bc13a84d2f5.jpg) +Figure 7: Images generated by HistoGAN. For each input image (the left column), we computed the corresponding target histogram (the upper left corner of the left column) and used it to control colors of the generated images in each row. + +as described in Sec. 2.2. Additionally, we allow the target color information to influence through the skip connections to go from the first two U-Net-encoder blocks to the HistoGAN's head. We add an additional histogram projection network, along with a "to-latent" block, to project our target histogram to a latent representation. This latent code of the histogram is processed by weight modulation-demodulation operations [31] and is then convolved over the skipped latent of the U-Net-encoder's first two blocks. + +We modified the HistoGAN block, described in Fig. 2, to accept this passed information (see supp. materials for more information). The leakage of the target color information helps ReHistoGAN to consider information from both + +the input image content and the target histogram in the recoloring process. + +We initialize our encoder-decoder network using He's initialization [23], while the weights of the HistoGAN head are initialized based on a previously trained HistoGAN model (trained in Sec. 2.2). The entire ReHistoGAN is then jointly trained to minimize the following loss function: + +$$ +\mathcal {L} _ {r} = \beta R \left(\mathbf {I} _ {i}, \mathbf {I} _ {r}\right) + \gamma D \left(\mathbf {I} _ {r}\right) + \alpha C \left(\mathbf {H} _ {r}, \mathbf {H} _ {t}\right) \tag {7} +$$ + +where $R(\cdot)$ is a reconstruction term, which encourages the preservation of image structure and $\alpha, \beta,$ and $\gamma$ are hyperparameters used to control the strength of each loss term (see supp. materials for associated ablation study). The recon + +struction loss term, $R(\cdot)$ , computes the L1 norm between the second order derivative of our input and recolored images as: + +$$ +R \left(\mathbf {I} _ {i}, \mathbf {I} _ {r}\right) = \left\| \mathbf {I} _ {i} * \mathbf {L} - \mathbf {I} _ {r} * \mathbf {L} \right\| _ {1} \tag {8} +$$ + +where $*\mathbf{L}$ denotes the application of the Laplacian operator. The idea of employing the image derivative was used initially to achieve image seamless cloning [42], where this Laplacian operator suppressed image color information while keeping the most significant perceptual details. Intuitively, ReHistoGAN is trained to consider the following aspects in the output image: (i) having a similar color distribution to the one represented in the target histogram, this is considered by $C(\cdot)$ , (ii) being realistic, which is the goal of $D(\cdot)$ , and (iii) having the same content of the input image, which is the goal of $R(\cdot)$ . + +Our model trained using the loss function described in Eq. 7 produces reasonable recoloring results. However, we noticed that, in some cases, our model tends to only apply a global color cast (i.e., shifting the recolored image's histogram) to minimize $C(\cdot)$ . To mitigate this behavior, we added variance loss term to Eq. 7. The variance loss can be described as: + +$$ +V \left(\mathbf {I} _ {i}, \mathbf {I} _ {r}\right) = - w \sum_ {c \in \{R, G, B \}} | \sigma \left(\mathbf {I} _ {i c} * \mathbf {G}\right) - \sigma \left(\mathbf {I} _ {r c} * \mathbf {G}\right) |, \tag {9} +$$ + +where $\sigma (\cdot)$ computes the standard deviation of its input (in this case the blurred versions of $\mathbf{I}_i$ and $\mathbf{I}_r$ using a Gaussian blur kernel, $\mathbf{G}$ , with a scale parameter of 15), and $w = \| \mathbf{H}_t - \mathbf{H}_i\| _1$ is a weighting factor that increases as the target histogram and the input image's histogram, $\mathbf{H}_t$ and $\mathbf{H}_i$ , become dissimilar and the global shift solution becomes more problematic. The variance loss encourages the network to avoid the global shifting solution by increasing the differences between the color variance in the input and recolored images. The reason behind using a blurred version of each image is to avoid having a contradiction between the variance loss and the reconstruction loss—the former aims to increase the differences between the variance of the smoothed colors in each image, while the latter aims to retain the similarity between the fine details of the input and recolored images. Figure 5 shows recoloring results of our trained models with and without the variance loss term. + +We train ReHistoGAN with target histograms sampled from the target domain dataset, as described earlier in Sec. 2.2 (Eq. 6). A simpler architecture was experimented initially, which did not make use of the skip connections and the end-to-end fine tuning (i.e., the weights of the HistoGAN head were fixed). However, this approach gave unsatisfactory result, and generally failed to retain fine details of the input image. A comparison between this approach and the above ReHistoGAN architecture can be seen in Fig. 6. + +![](images/002ad1863511c56b96d0ed2a08526aa6cbae3fc0fa862196898569d774561f8d.jpg) + +![](images/69f2eb90fa3becd300f57d18849c55b1faed7a7e44cbd3ccc744c532b16d4517.jpg) + +![](images/59b410d34bf9451adc1eff57cb4f5dd7f3416462e0e4c76ccb57fe7047f07dd2.jpg) + +![](images/731074cb18cf9a5754deb7b8c5b563c1f2ddff72cae7920ffd8a8bf671f539ff.jpg) +Target colors (Input shape & background for MixNMatch) + +![](images/c7d6d709d572ef26dd5bd8b7494b2caf20e299437a894688691b2782879151c7.jpg) +MixNMatch + +![](images/1d8b02e6fa37abf0ead1b45723e8ff22266e011366d07893bea071b25ed050f1.jpg) +Ours +Figure 8: Comparison with the MixNMatch method [35]. In the shown results, the target images are used as input shape and background images for the MixNMatch method [35]. + +# 3. Results and Discussion + +This section discusses our results and comparisons with alternative methods proposed in the literature for controlling color. Due to hardware limitations, we used a lightweight version of the original StyleGAN [31] by setting $m$ to 16, shown in Fig. 2. We begin by presenting our image generation results, followed by our results on image recoloring. Additional results, comparisons, and discussion are also available in the supp. materials. + +Image Generation Figure 7 shows examples of our HistoGAN-generated images. Each row shows samples generated from different domains using the corresponding input target colors. For each domain, we fixed the style vectors responsible for the coarse and middle styles to show our HistoGAN's response to changes in the target histograms. Qualitative comparisons with the recent MixN-Match method [35] are provided in Fig. 8. + +To evaluate the potential improvement/degradation of the generated-image diversity and quality caused by our modification to StyleGAN, we trained StyleGAN [31] with $m = 16$ (i.e., the same as our model capacity) without our histogram modification. We evaluated both models on different datasets, including our collected set of landscape images. For each dataset, we generated $10,000 \times 256 \times 256$ images using the StyleGAN and our HistoGAN. We evaluated the generated-image quality and diversity using the Frechet inception distance (FID) metric [26] using the second max-pooling features of the Inception model [53]. + +We further evaluated the ability of StyleGAN to control colors of GAN-generated images by training a regression deep neural network (ResNet [24]) to transform generated + +![](images/2f63ffab7827d7723e24aad995e239dc476ea26eb0c5b3df406984b4b101e322.jpg) +Target colors + +![](images/f460872d18147c2be2f2991be26c1edd2fb38d00b025f10586a8b6249d875d60.jpg) + +![](images/18e3fc2d65a51314e886341bdc9ae0de6d09cd962295a5b7bf2374b1ab6f51e3.jpg) + +![](images/27d104a417afebccb944936ec69aa2e1f8e0345428e747ac1180d5fdfd2a68b6.jpg) + +![](images/129ae248401bdf6ede4986cf2fd828b6cab610e19cc0d33a53d5b54788a4105a.jpg) + +![](images/fa2176ef2a8b956606a1a52508f7ce680a942cfacce6c64ca3435cb639d666af.jpg) + +![](images/9c304b51aff3fa52eda0c6ce0a50c3cff2fd97396dea123a47b81812ca816ce8.jpg) + +![](images/407ceed89b1ce9ee0ab5b90e4c7db111680248627aa655d843b1d8241dd5b896.jpg) + +![](images/f72179a6397d9f3bda233dfe4d08ad3fd6df0d5c8ad810a8aa8f919e44808863.jpg) + +![](images/be733d240599524ccbb0429c2614171a530f4351f44a2ffed3c986ea2315fc2a.jpg) + +![](images/b0a945bdd0f746d29d5ef6a1a0a56880318e99f62e571dac29d15dfe44485d1f.jpg) + +![](images/4be03466211aa9c9435aa201e1ff44f912dba63e9cef6522720e2afdd23f5d91.jpg) + +![](images/6108124c227cdaa2e8a799dd2d0351f2ea6b7793c7b29731932b0529be9ba422.jpg) + +![](images/91986eb7ce33a47dde5526cd0ceb1a7b337823c88643a5139fda2038d0cb936e.jpg) + +![](images/eaad72171a0a5b68f046c0f87507342112aca1eba3fd919e6d1cb9fd4e58310c.jpg) + +![](images/c241d8fa051a64a8e434c978b749b38fd9982be29eb8ae71cf8c4d9e75e5132b.jpg) + +![](images/2010f99722de8c6c7ab9685f3df85fdebe77c0f9f6994ce43cabe3889c2b4399.jpg) + +![](images/b3028019b9d5dd8519928a7809bb54661a92500a2519bc1d96bbfef476186d4b.jpg) + +![](images/7c85cc3210298c3c4ae1b9fe7b513b0fad08156c3ef6b41d07e085745bd076cb.jpg) + +![](images/6d59b75ebed6d436e1bf3fed560f872e7802396d4cb229be2f055d6e774c46a5.jpg) + +![](images/e6cd47f6b34cf1c8978a13a65a1d81c25b64f0a77b98d95e3eb632ed92e72a9b.jpg) + +![](images/eb27c18a44a33ebdf3d0b198ea8b441d94624fa45135102cf130fb21167b3af8.jpg) + +![](images/a5ad98e58929dd21baf1dc9acf648b7bb9112ce9ebe91b948b3c0626f0de0916.jpg) + +![](images/b1f3b6901b8323138482aa273310aea1ae6649957109db513573d9c39bb3a2e0.jpg) +Input image +Figure 9: Results of our ReHistoGAN. The shown results are after recoloring input images (shown in the left column) using the target colors (shown in the top row). + +![](images/dbff09824e0c925ee333f1e967fa1d4ecf50f8ae6f9702522177359d70ea711a.jpg) + +![](images/f3722390e6a747dfdd49a020a22427f6829ad143425e21772b591c3f51e79d6c.jpg) + +![](images/3794b2aa498016c075ac5e04329298849c3d4bc900fde25f7a2165e86dc7a938.jpg) + +![](images/48d503f0c60ed530beb268261ae8ec99deaee8e12f0bc2ded4a4985c6ae80784.jpg) +Recolored images + +![](images/5b83cc1fd39e58f9f979ee7b31db1f8dbde5650abc5b64d48921ede103cf5e76.jpg) + +![](images/44a4ec44ca575d28287928a16511a10099255df653c365c35a3439c6aa7314d6.jpg) + +![](images/554d89109cff581385ed7e5e52b35184b23c87ecf070d922a63739861357d661.jpg) + +Table 1: Comparison with StyleGAN [31]. The term 'w/ proj.' refers to projecting the target image colors into the latent space of StyleGAN. We computed the similarity between the target and generated histograms in RGB and projected RGB-uv color spaces. For each dataset, we report the number of training images. Note that StyleGAN results shown here do not represent the actual output of [31], as the used model here has less capacity ( $m = 16$ ). + +
DatasetStyleGAN [31]HistoGAN (ours)
FIDRGB hist. (w/ proj.)RGB-uv hist. (w/ proj.)FIDRGB hist. (w/ proj.)RGB-uv hist. (w/ proj.)
w/o proj.w/ proj.KL Div.H dis.KL Div.H dis.KL Div.H dis.KL Div.H dis.
Faces (69,822) [30]9.501814.1941.31240.97101.21250.67248.93870.98100.74870.44700.3088
Flowers (8,189) [41]10.87615.5021.03040.96142.71100.70384.95720.89860.73530.38370.2957
Cats (9,992) [15]14.36621.8261.66590.97401.40510.530317.0681.00540.72780.34610.2639
Dogs (20,579) [32]16.70630.4031.90420.97031.48560.565820.3361.35650.74050.43210.3058
Birds (9,053) [55]3.553912.5641.90350.97061.91340.60913.22511.49760.78190.42610.3064
Anime (63,565) [14]2.50029.88900.97470.98691.43230.59295.37570.85470.62110.13520.1798
Hands (11,076) [3]2.68532.78260.93870.99420.36540.37092.24380.33170.36550.05330.1085
Landscape (4,316)24.21629.2480.88110.97411.94920.626523.5490.83150.81690.54450.3346
Bedrooms (303,116) [57]10.59914.6731.57090.97031.26900.53634.53201.37740.72780.25470.2464
Cars (16,185) [33]21.48525.4961.68710.97490.73640.423114.4081.07430.70280.29230.2431
Aerial Scenes (36,000) [39]11.41314.4982.11420.97981.14620.515812.6020.98890.58870.17570.1890
+ +images back to the corresponding fine-style vectors. These fine-style vectors are used by the last two blocks of StyleGAN and are responsible for controlling delicate styles, such as colors and lights [30, 31]. + +The training was performed for each domain separately using 100,000 training StyleGAN-generated images and their corresponding "ground-truth" fine-style vectors. In the testing phase, we used the trained ResNet to predict the corresponding fine-style vectors of the target image—these target images were used to generate the target color histograms for HistoGAN's experiments. We then generated output images based on the predicted fine-style vectors of each target image. In the evaluation of StyleGAN and HistoGAN, we used randomly selected target images from the same domain. + +![](images/6f822edb253ba4ef676ee91a4ed186a633b9ff203f6b2aa3a3e7fe25d7f92001.jpg) +Input image +Figure 10: Comparison with the high-resolution daytime translation (HiDT) method [8]. + +![](images/b02533e985681754d80ec7dde85569a7972c9c3ec088fa36b7e1aad1c048431e.jpg) +Target colors/style + +![](images/ea86a7d6017463aeb078f75652714c267dcbaf1cc705f0766071482bb24d4939.jpg) +HiDT + +![](images/4ffb8de800a3e19cfc3539311dc947dd18d7bcc910c06831d6c39d4e903c527b.jpg) +Ours + +The Hellinger distance and KL divergence were used to measure the color errors between the histograms of the generated images and the target histogram; see Table 1. + +Image Recoloring Figure 9 shows examples of image recoloring using our ReHistoGAN. A comparison with the re + +![](images/eb4f55cebf3c2d135be063c5d9c14fe3fea4aa4ea93fc8fe17e328c97ed09bfb.jpg) + +![](images/985284225f6bef9aeeedb3fb7d9da61f3e2a48ae47849d3894a4ea71c78a32c9.jpg) + +![](images/fff5833711860d53ee8ecda2958ffecfdc20199808387c2ebadd430b6b709147.jpg) + +![](images/f11cb37b581a87628b069a113b14dd40e2d7f1407990d89303648f4c4b783935.jpg) + +![](images/34e2012e07d3da11e4e95ad2e3cae5864b32fbb5b1c6cf6c51989aecd590f3f4.jpg) + +![](images/c356faca60cdedc1dfd03e9e3107e8263ebbd64738955857ec7c941a31b4987a.jpg) + +![](images/baa9023a66083cf457ea285f4f25385798c9031e2c088040100f9149b5468da8.jpg) + +![](images/74529d840436736538e55acd142385d2e5e9b112e54562f84c668303ab552382.jpg) + +![](images/9da8709d47e3b3f9980c31fb4d29caf38e27f0acc87dd83cb22d9148255de72a.jpg) + +![](images/0bd7b742d94c8110463d8abd146ed7bb2386dfa3ca3bac045c0f52b293d25073.jpg) + +![](images/6c1b5d59628dc40790a6a73cbd4686320f3c857dcf7a72f599227e69cf6f8d0b.jpg) + +![](images/d86233336a18457e4f4110f6344d68546ffe9f69161cbd9d8d96983311f7d2d0.jpg) + +![](images/b00f8827ff107b6b4a4809f4603de8820776ebc8c4e655ab389777234471d61b.jpg) + +![](images/e5f9b7555a52a25031c77da7a9fabb3b6c2b47314e61e67d8aabcc7a6e96e602.jpg) + +![](images/98545c0459cba51d6aca05a99d77e51b46fff52f8bd39a4fa473bec65ee42769.jpg) + +![](images/de730a67a05f580ebf2f8c82a7c5cc4d1f715e4218b92fade3382cd7ddbb71a1.jpg) + +![](images/dc1c93266797f22383c257840112b764eea0e04a1d4e02cbc235e36dc0459908.jpg) + +![](images/0851f31a24ffa6175d78f766e95200f9291228cce6d415e334082ea1ed6784a2.jpg) + +![](images/4b3d8b53bc9c9dd245ad6a63575afb5431ba173abe466c3c7ade5b7d8ffbfc26.jpg) +Input image + +![](images/23fd4bad1e445f14331ed36334c390f1763cc624bc5367cca93394311ebc0e6b.jpg) +Target colors + +![](images/e6adb65647f606a15793f3576091721914473d5cb68418f8bb0191621d9a37c3.jpg) +Reinhard et al. + +![](images/a09178a31a5e55ca833b2bde3dac5e9c65561bd1774fb519da2f3df39ce3f2dc.jpg) +Xiao et al. + +![](images/c09783529ec66f132769759ec30a22fd527c6142d807fa3ea4465467c4e4233e.jpg) +Pitié and Kokaram + +![](images/b4754e1ccc7e3be96bd7e248e79559a8a379eedb5ee5b5be3eaf2a3939e8cb68.jpg) +Nguyen et al. + +![](images/5e2be1b4c24c90dd4e786c83e17f5c631313cbf2f4000a0591008ad63cbd560b.jpg) +Gatys et al. + +![](images/1c027f36cd9b222c207f95e711dbf09ca32e90354e01b9d8153f80f37790c11b.jpg) +Sheng et al. + +![](images/c59e126ec5288543465bed74ed7372e1b7a6d8c4737ff4978411b4abd38b633b.jpg) +Ours + +![](images/59252ff82c05bbec152ce8ea8e38170c4849b22781c10afc67aee313394fa4f7.jpg) +Figure 11: Comparisons between our ReHistoGAN and other image color/style transfer methods, which are: Reinhard et al., [46], Xiao et al., [56], Pitie and Kokaram [44], Nguyen et al., [40], Gatys et al., [21], and Sheng et al., [50]. +Input image + +![](images/4291df4b10c2a7cfc894f439e581441fbe9d632e289a90e55d7ee2b3f0b4c41b.jpg) +Afifi et al. + +![](images/84181eb397954ac5b627afcb4a7bca8030b3e34c14a1ee22634fcbd6115243a1.jpg) +Ours + +![](images/26c88ae2d96312a0ad2b5b6b659bb7583f0ab14cb73d9665bfc066ccfe46c44c.jpg) +Figure 12: Automatic recoloring comparison with the recent method by Afifi et al., [7]. +Input image +Figure 13: Results of using our ReHistoGAN for a diverse image colorization. + +![](images/487cbf97523317bc5ad61bf2f148a48dfbf01b5dfa693f607902e56515587807.jpg) + +![](images/370edabc67d4b37bf433af065b96c09e85faaf352789c486a30b0a2a3caea009.jpg) +Colorized images + +![](images/dedab8c5309c07d3c5f6bc599f4e1c56e5bfe9fb217ef0a33a6cbbed30e4a342.jpg) + +cent high-resolution daytime translation (HiDT) method [8] is shown in Fig. 10. Additional comparisons with image recoloring and style transfer methods are shown in Fig. 11. Arguably, our ReHistoGAN produces image recoloring results that are visually more compelling than the results of other methods for image color/style transfer. As shown in Fig. 11, our ReHistoGAN produces realistic recoloring even when the target image is from a different domain than the input image, compared to other image style transfer methods (e.g., [21, 50]). + +Lastly, we provide a qualitative comparison with the recent auto-recoloring method proposed by Afifi et al., [7] in Fig. 12. In the shown example, our target histograms were dynamically generated by sampling from a pre-defined set of histograms and applying a linear interpolation between the sampled histograms (see Eq. 6). + +What is Learned? Our method learns to map color information, represented by the target color histogram, to an output image's colors with a realism consideration in the recolored image. Maintaining realistic results is achieved by learning proper matching between the target colors and the input image's semantic objects (e.g., grass can be green, but not blue). To demonstrate this, we examine a trained ReHistoGAN model for an image colorization task, where the input image is grayscale. The input of a grayscale image means that our ReHistoGAN model has no information regarding objects' colors in the input image. Figure 13 shows outputs where the input has been "colorized". As can be seen, the output images have been colorized with good semantic-color matching based on the image's content. + +# 4. Conclusion + +We have presented HistoGAN, a simple, yet effective, method for controlling colors of GAN-generated images. Our HistoGAN framework learns how to transfer the color information encapsulated in a target histogram feature to the colors of a generated output image. To the best of our knowledge, this is the first work to control the color of GAN-generated images directly from color histograms. Color histograms provide an abstract representation of image color that is decoupled from spatial information. This allows the histogram representation to be less restrictive and suitable for GAN-generation across arbitrary domains. We have shown that HistoGAN can be extended to control colors of real images in the form of the ReHistoGAN model. Our recoloring results are visually more compelling than currently available solutions for image recoloring. Our image recoloring also enables "auto-recoloring" by sampling from a pre-defined set of histograms. This allows an image to be recolored to a wide range of visually plausible variations. HistoGAN can serve as a step towards intuitive color control for GAN-based graphic design and artistic endeavors. + +# References + +[1] Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2StyleGAN: How to embed images into the stylegan latent space? In ICCV, 2019. 2 +[2] Rameen Abdal, Peihao Zhu, Niloy Mitra, and Peter Wonka. StyleFlow: Attribute-conditioned exploration of StyleGAN-generated images using conditional continuous normalizing flows. arXiv preprint arXiv:2008.02401, 2020. 2 +[3] Mahmoud Affifi. 11K hands: Gender recognition and biometric identification using a large dataset of hand images. Multimedia Tools and Applications, 78(15):20835-20854, 2019. 7 +[4] Mahmoud Afifi and Michael S Brown. Sensor-independent illumination estimation for dnn models. In BMVC, 2019. 1, 2, 3 +[5] Mahmoud Affi and Michael S Brown. What else can fool deep learning? addressing color constancy errors on deep neural network performance. In ICCV, 2019. 2 +[6] Mahmoud Afifi, Brian Price, Scott Cohen, and Michael S Brown. When color constancy goes wrong: Correcting improperly white-balanced images. In CVPR, 2019. 1, 2, 3 +[7] Mahmoud Affifi, Brian L Price, Scott Cohen, and Michael S Brown. Image recoloring based on object color distributions. In Eurographics 2019 (short papers), 2019. 1, 2, 8 +[8] Ivan Anokhin, Pavel Solovev, Denis Korzhenkov, Alexey Kharlamov, Taras Khakhulin, Aleksei Silvestrov, Sergey Nikolenko, Victor Lempitsky, and Gleb Sterkin. High-resolution daytime translation without domain labels. In CVPR, 2020. 2, 7, 8 +[9] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. arXiv preprint arXiv:1701.07875, 2017. 2 +[10] Mor Avi-Aharon, Assaf Arbelle, and Tammy Riklin Raviv. Deephist: Differentiable joint and color histogram layers for image-to-image translation. arXiv preprint arXiv:2005.03995, 2020. 1 +[11] Jonathan T Barron. Convolutional color constancy. In ICCV, 2015. 1, 2 +[12] Huiwen Chang, Ohad Fried, Yiming Liu, Stephen DiVerdi, and Adam Finkelstein. Palette-based photo recoloring. ACM Transactions on Graphics (TOG), 34(4):139-1, 2015. 1 +[13] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. StarGAN V2: Diverse image synthesis for multiple domains. In CVPR, 2020. 2 +[14] Spencer Churchill. Anime face dataset. https://www.kaggle.com/splcher/animefacedataset. [Online; accessed October 27, 2020]. 7 +[15] Chris Crawford and NAIN. Cat dataset. https://www.kaggle.com/crawford/cat-dataset. [Online; accessed October 27, 2020]. 7 +[16] Aditya Deshpande, Jiajun Lu, Mao-Chuang Yeh, Min Jin Chong, and David Forsyth. Learning diverse image colorization. In CVPR, 2017. 2 +[17] Eva Eibenberger and Eli Angelopoulou. The importance of the normalizing channel in log-chromaticity space. In CIP, 2012. 2 + +[18] H Sheikh Faridul, Tania Pouli, Christel Chamaret, Jürgen Stauder, Erik Reinhard, Dmitry Kuzovkin, and Alain Trémeau. Colour mapping: A review of recent methods, extensions and applications. In Computer Graphics Forum, 2016. 1 +[19] Graham D Finlayson and Steven D Hordley. Color constancy at a pixel. JOSA A, 2001. 2 +[20] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. A neural algorithm of artistic style. arXiv preprint arXiv:1508.06576, 2015. 2 +[21] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. 2, 8 +[22] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014. 2 +[23] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification. In ICCV, 2015. 5 +[24] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 6 +[25] Mingming He, Jing Liao, Dongdong Chen, Lu Yuan, and Pedro V Sander. Progressive color transfer with dense semantic correspondences. ACM Transactions on Graphics (TOG), 38(2):1-18, 2019. 2 +[26] 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 NeurIPS, 2017. 6 +[27] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. 2 +[28] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016. 2 +[29] 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. 2 +[30] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. 2, 7 +[31] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In CVPR, 2020. 1, 2, 3, 5, 6, 7 +[32] Aditya Khosla, Nityananda Jayadevaprakash, Bangpeng Yao, and Fei-Fei Li. Novel dataset for fine-grained image categorization: Stanford dogs. In CVPR Workshops, 2011. 7 +[33] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3D object representations for fine-grained categorization. In ICCV Workshops, 2013. 7 +[34] Pierre-Yves Laffont, Zhile Ren, Xiaofeng Tao, Chao Qian, and James Hays. Transient attributes for high-level understanding and editing of outdoor scenes. ACM Transactions on graphics (TOG), 33(4):1-11, 2014. 2 + +[35] Yuheng Li, Krishna Kumar Singh, Utkarsh Ojha, and Yong Jae Lee. MixNMatch: Multifactor disentanglement and encoding for conditional image generation. In CVPR, 2020. 2, 6 +[36] Huidong Liu, Xianfeng Gu, and Dimitris Samaras. Wasserstein GAN with quadratic transport cost. In ICCV, 2019. 2 +[37] Fujun Luan, Sylvain Paris, Eli Shechtman, and Kavita Bala. Deep photo style transfer. In CVPR, 2017. 2 +[38] Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In ICML, 2013. 3 +[39] Emmanuel Maggiori, Yuliya Tarabalka, Guillaume Charpiat, and Pierre Alliez. Can semantic labeling methods generalize to any city? The inria aerial image labeling benchmark. In International Geoscience and Remote Sensing Symposium (IGARSS), 2017. 7 +[40] Rang MH Nguyen, Seon Joo Kim, and Michael S Brown. Illuminant aware gamut-based color transfer. In Computer Graphics Forum, 2014. 1, 8 +[41] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics & Image Processing, 2008. 7 +[42] Patrick Pérez, Michel Gangnet, and Andrew Blake. Poisson image editing. In SIGGRAPH. 2003. 6 +[43] Stanislav Pidhorskyi, Donald A Adjeroh, and Gianfranco Doretto. Adversarial latent autoencoders. In CVPR, 2020. 2 +[44] F. Pitie and A. Kokaram. The linear Monge-Kantorovitch linear colour mapping for example-based colour transfer. In European Conference on Visual Media Production, 2007. 8 +[45] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. 2 +[46] Erik Reinhard, Michael Adhikhmin, Bruce Gooch, and Peter Shirley. Color transfer between images. IEEE Computer graphics and applications, 21(5):34-41, 2001. 1, 8 +[47] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. 4 +[48] Kuniaki Saito, Kate Saenko, and Ming-Yu Liu. COCO-FUNIT: Few-shot unsupervised image translation with a content conditioned style encoder. In ECCV, 2020. 2 +[49] Tamar Rott Shaham, Tali Dekel, and Tomer Michaeli. SinGAN: Learning a generative model from a single natural image. In ICCV, 2019. 2 +[50] Lu Sheng, Ziyi Lin, Jing Shao, and Xiaogang Wang. AvatarNet: Multi-scale zero-shot style transfer by feature decoration. In CVPR, 2018. 2, 8 +[51] Assaf Shocher, Yossi Gandelsman, Inbar Mosseri, Michal Yarom, Michal Irani, William T Freeman, and Tali Dekel. Semantic pyramid for image generation. In CVPR, 2020. 2 +[52] Maria Shugrina, Amlan Kar, Sanja Fidler, and Karan Singh. Nonlinear color triads for approximation, learning and direct manipulation of color distributions. ACM Transactions on Graphics (TOG), 39(4):97-1, 2020. 2 + +[53] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015. 6 +[54] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016. 2 +[55] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The Caltech-UCSD birds-200-2011 dataset. 2011. 7 +[56] Xuezhong Xiao and Lizhuang Ma. Color transfer in correlated color space. In International conference on Virtual reality continuum and its applications, 2006. 1, 8 +[57] Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. LSUN: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 7 +[58] Qing Zhang, Chunxia Xiao, Hanqiu Sun, and Feng Tang. Palette-based image recoloring using color decomposition optimization. IEEE Transactions on Image Processing, 26(4):1952-1964, 2017. 1 +[59] 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), 36(4):1-11, 2017. 2 \ No newline at end of file diff --git a/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/images.zip b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4581867d9e9d83f1309848e79d4949254d986713 --- /dev/null +++ b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcb2b5aa07a1ddfb7fd9a863728ddd6c2b5ec79af354464c5a473d654047aee7 +size 1391785 diff --git a/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/layout.json b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a1f59321059219de8e88fc4a0f597b9c32bfba99 --- /dev/null +++ b/histogancontrollingcolorsofgangeneratedandrealimagesviacolorhistograms/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d9a8aa93abcee80972dea9cc35a5b856e18f1b65baf4f502232f1e373bf5563 +size 595182 diff --git a/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_content_list.json b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c8c37ee34963551024e1fbc591982a071ca45d2e --- /dev/null +++ b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21e74f14a33db17b14649d9a83c698ec53d316c9810015d68cfa820ed5ea735e +size 83343 diff --git a/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_model.json b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6c63dd468ed1540248b4b235062dcce341ebc311 --- /dev/null +++ b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34dadc5aba3b7b96c9d756e9a9efc3ae2d8ff60fbd14ec7dd2f25eb71b5ec303 +size 102402 diff --git a/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_origin.pdf b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b09973898a97bac33e6edc0cd442f62867b32ad8 --- /dev/null +++ b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/6b9442f8-cb69-4b29-8d13-f84536821cc2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4d26695e5717e451b835ca3e828269f790c32d8e6dbb35bea7ac0848ae33b91 +size 2852407 diff --git a/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/full.md b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d2eaad7303e3e3b1b2bdc4d18c1db7f6a689bbee --- /dev/null +++ b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/full.md @@ -0,0 +1,347 @@ +# HITNet: Hierarchical Iterative Tile Refinement Network for Real-time Stereo Matching + +Vladimir Tankovich + +Christian Hane + +Yinda Zhang + +Adarsh Kowdle + +Sean Fanello + +Sofien Bouaziz + +Google + +{vtankovich, chaene, yindaz, adarshkowdle, seanfa, sofien}@google.com + +![](images/535bce7978b4e75335cdcb1bb9242de69df245c4619927df66642f77915811f6.jpg) +Left image + +![](images/da4a83dc78ff2a934e8fb6fae3fc40ebf2870eac099cd9842b9812677b8c8c5a.jpg) +Right image + +![](images/12f22ed4ac0ff40946aa78cd96759f7cc4b80aca3602f337671ea23a82dedbd8.jpg) +Predicted disparity + +![](images/909c72eaf1aa0e0740748d66e73c245243cb49d954e7a99e6efdcf561e91c0cb.jpg) +Predicted slant + +![](images/9c3eb7d9ca376b105113e84fc9f1cd6ec8a916104fb1cb9d4c59bc0ce8e1835b.jpg) + +![](images/2c067dbc41f821bd04c4aa26dd7aaeb4f6511dca9137ac236cad1c4d200b4d7c.jpg) + +![](images/aabe9da2f144c1fe4287cec29d096686981dea4afb435f5b7f37922384f6e4e2.jpg) + +![](images/570424578415df138fef5c8a1cd9e4bdf38ab86fe2a4b9e8a4778a73b50175d8.jpg) + +![](images/10d7a0fa36a7e2add00e0a1c4829132020409c3b01cf25b3a04741b98e5762d8.jpg) + +![](images/89eece7047d6a48e499bbff229c5a3b08f8e464c4bcc4841eb70bd6af0f3b6ed.jpg) + +![](images/f0125cea763f9344a461e76122a0d5244474245105637980a6811a55fac7bac3.jpg) + +![](images/8e1a360bc62bc106c371400d6a507c629627d18aa69abdfde91d3cde3b232aba.jpg) + +![](images/b1934e13b2ece6e89a84ee87a907c2bfad09bcad8120abb2e58cd6f7d0ba9765.jpg) +Figure 1: Example result of HITNet on the SceneFlow, KITTI, ETH3D and Middlebury datasets. Our approach predicts accurate depth with crisp edges. HITNet obtains state-of-art results on KITTI, ETH3D and Middlebury-v3 benchmarks. + +![](images/5ba794965253c48be1db2e1cb5fd9ccafc8fa3b2bb12886e265c1aec28e195c0.jpg) + +![](images/f667e5f3951b32bbbfdcbb8fe937cace3dd6274ad773a25cab271384e35e68cb.jpg) + +![](images/a25f73e9260bfc7e36b757d25cdb0046211fd4634ccf90d027d2181887d99a2b.jpg) + +# Abstract + +This paper presents HITNet, a novel neural network architecture for real-time stereo matching. Contrary to many recent neural network approaches that operate on a full cost volume and rely on 3D convolutions, our approach does not explicitly build a volume and instead relies on a fast multi-resolution initialization step, differentiable 2D geometric propagation and warping mechanisms to infer disparity hypotheses. To achieve a high level of accuracy, our network not only geometrically reasons about disparities but also infers slanted plane hypotheses allowing to more accu + +rately perform geometric warping and upsampling operations. Our architecture is inherently multi-resolution allowing the propagation of information across different levels. Multiple experiments prove the effectiveness of the proposed approach at a fraction of the computation required by state-of-the-art methods. At the time of writing, HITNet ranks $1^{st}-3^{rd}$ on all the metrics published on the ETH3D website for two view stereo, ranks $1^{st}$ on most of the metrics amongst all the end-to-end learning approaches on Middlebury-v3, ranks $1^{st}$ on the popular KITTI 2012 and 2015 benchmarks among the published methods faster than 100ms. + +# 1. Introduction + +Recent research on depth from stereo matching has largely focused on developing accurate but computationally expensive deep learning approaches. Large convolutional neural networks (CNNs) can often use up to a second or even more to process an image pair and infer a disparity map. For active agents such as mobile robots or self driving cars such a high latency is undesirable and methods which are able to process an image pair in a matter of milliseconds are required instead. Despite this, only 4 out of the top 100 methods on the KITTI 2012 leaderboard are published approaches that take less than $100\mathrm{ms}^1$ . + +A common pattern in end-to-end learning based approaches to computational stereo is utilizing a CNN which is largely unaware of the geometric properties of the stereo matching problem. In fact, initial end-to-end networks were based on a generic U-Net architecture [37]. Subsequent works have pointed out that incorporating explicit matching cost volumes encoding the cost of assigning a disparity to a pixel, in conjunction with 3D convolutions provides a notable improvement in terms of accuracy but at the cost of significantly increasing the amount of computation [24]. Follow up work [25] showed that a downsampled cost volume could provide a reasonable trade-off between speed and accuracy. However, the downsampling of the cost volume comes at the price of sacrificing accuracy. + +Multiple recent stereo matching methods [51, 12, 28] have increased the efficiency of disparity estimation for active stereo while maintaining a high level of accuracy. These methods are mainly built on three intuitions: Firstly, the use of compact/sparse features for fast high resolution matching cost computation; Secondly, very efficient disparity optimization schemes that do not rely on the full cost volume; Thirdly, iterative image warps using slanted planes to achieve high accuracy by minimizing image dissimilarity. All these design choices are used without explicitly operating on a full 3D cost volume. By doing so these approaches achieve very fast and accurate results for active stereo but they do not directly generalize to passive stereo due to the lack of using a powerful machine learning system. This therefore raises the question if such mechanisms can be integrated into neural network based stereo-matching systems to achieve efficient and accurate results opening up the possibility of using passive stereo based depth sensing in latency critical applications. + +We propose HITNet, a framework for neural network based depth estimation which overcomes the computational disadvantages of operating on a 3D volume by integrating image warping, spatial propagation and a fast high resolution initialization step into the network architecture, while + +keeping the flexibility of a learned representation by allowing features to flow through the network. The main idea of our approach is to represent image tiles as planar patches which have a learned compact feature descriptor attached to them. The basic principle of our approach is to fuse information from the high resolution initialization and the current hypotheses using spatial propagation. The propagation is implemented via a convolutional neural network module that updates the estimate of the planar patches and their attached features. In order for the network to iteratively increase the accuracy of the disparity predictions, we provide the network a local cost volume in a narrow band ( $\pm 1$ disparity) around the planar patch using in-network image warping allowing the network to minimize image dissimilarity. To reconstruct fine details while also capturing large texture-less areas we start at low resolution and hierarchically upsample predictions to higher resolution. A critical feature of our architecture is that at each resolution, matches from the initialization module are provided to facilitate recovery of thin structures that cannot be represented at low resolution. An example output of our method shows how our network recovers very accurate boundaries, fine detail and thin structures in Fig. 1. + +To summarize, our main contributions are: + +- A fast multi-resolution initialization step that computes high resolution matches using learned features. +- An efficient 2D disparity propagation that makes use of slanted support windows with learned descriptors. +- State-of-art results in popular benchmarks using a fraction of the computation compared to other methods. + +# 2. Related Work + +Stereo matching has been an active field of research for decades [36, 43, 19]. Traditional methods utilize handcrafted schemes to find local correspondences [55, 22, 4, 21] and global optimization to exploit spatial context [14, 26, 27]. The run-time efficiency of most of these approaches are correlated with the size of the disparity space, which prevents real-time applications. Efficient algorithms [31, 34, 5, 3] avoid searching the full disparity space by using patchmatch [1] and super-pixel [31] techniques. A family of machine learning based approaches, using random forest and decision trees, are able to establish correspondences quickly [10, 11, 12, 13]. However, these methods require either camera specific learning or post processing. Recently, deep learning brought big improvements to stereo matching. Early works trained siamese networks to extract patch-wise features or predict matching costs [35, 58, 56, 57]. End-to-end networks have been proposed to learn all steps jointly, yielding more accurate results [46, 37, 40, 47]. + +A key component in modern architectures is a cost volume layer [24] (or correlation layer [23]), allowing the network to run per-pixel feature matching. To speed up computation, cascaded models [39, 7, 32, 16, 53, 59] have been proposed to search in disparity space in a coarse-to-fine fashion. In particular, [39] uses multiple residual blocks to improve the current disparity estimate. The recent work [53] relies on a hierarchical cost volume, allowing the method to be trained on high resolution images and generate different resolutions on demand. All these methods rely on expensive cost-volume filtering operations using 3D convolutions [53] or multiple refinement layers [39], preventing real-time performance. Fast approaches [25, 60] down-sample the cost volume in spatial and disparity space and attempt to recover fine details by edge-aware upsampling layers. These methods show real-time performance but sacrifice accuracy especially for thin structures and edges since they are missing in the low-res initialization. + +Our method is inspired by classical stereo matching methods, which aim at propagating good sparse matches [12, 13, 51]. In particular, Tankovich et al. [51] proposed a hierarchical algorithm that makes use of slanted support windows to amortize the matching cost computation in tiles. Inspired by this work, we propose an end-to-end learning approach that overcomes the issues of hand-crafted algorithms, while maintaining computational efficiency. + +PWC-Net [49], although designed for optical flow estimation, is related to our approach. The method uses a low resolution cost volume with multiple refinement stages via image warps and local matching cost computations. Thereby following the classical pyramidal matching approach where a low resolution result gets hierarchically upsampled and refined by initializing the current level with the previous level's solution. In contrast we propose a fast, multi-scale, high resolution initialization which is able to recover fine details that cannot be represented at low resolution. Finally, our refinement steps produce local slanted plane approximations, which are used to predict the final disparities, as opposed to standard bilinear warping and interpolation employed in [49]. + +# 3. Method + +The design of HITNet, follows the principles of traditional stereo matching methods [43]. In particular, we observe that recent efficient methods rely on the three following steps: ① compact feature representations are extracted [12, 13]; ② a high resolution disparity initialization step utilizes these features to retrieve feasible hypotheses; ③ an efficient propagation step refines the estimates using slanted support windows [51]. Motivated by these observations, we represent the disparity map as planar tiles at various resolutions and attach a learnable feature vector to each tile hypothesis (Sec. 3.1). This allows our network to learn which + +information about a small part of the disparity map is relevant to further improving the result. This can be interpreted as an efficient and sparse version of the learnable 3D cost volumes that have shown to be beneficial [24]. + +The overall method is depicted in Fig. 2. Our feature extraction module relies on a very small U-Net [41], where the multi-resolution features of the decoder are used by the rest of the pipelines. These features encode multi-scale details of the image, similar to [7] (Sec. 3.2). Once the features are extracted, we initialize disparity maps as fronto parallel tiles at multiple resolutions. To do so, a matcher evaluates multiple hypotheses and selects the one with the lowest $\ell_1$ distance between left and right view feature. Additionally, a compact per-tile descriptor is computed using a small network (Sec. 3.3). The output of the initialization is then passed to a propagation stage, which acts similarly to the approximated Conditional Random Field solution used in [12, 51]. This stage hierarchically refines the tile hypotheses in an iterative fashion (Sec. 3.4). + +# 3.1. Tile Hypothesis + +We define a tile hypothesis as a planar patch with a learnable feature attached to it. Concretely, it consists of a geometric part describing a slanted plane with the disparity $d$ and the gradient of disparity in $x$ and $y$ directions $(d_x, d_y)$ , and a learnable part $\mathbf{p}$ which we call tile feature descriptor. The hypothesis is therefore described as a vector which encodes a slanted 3D plane, + +$$ +\mathbf {h} = \underbrace {\left[ d , d _ {x} , d _ {y} \right.} _ {\text {p l a n e}}, \underbrace {\mathbf {p}} _ {\text {d e s c r i p t o r}} ] \tag {1} +$$ + +The tile feature descriptor is a learned representation of the tile which allows the network to attach additional information to the tile. This could for example be matching quality or local surface properties such as how planar the geometry actually is. We do not constrain this information and learned it end-to-end from the data instead. + +# 3.2. Feature Extractor + +The feature extractor provides a set of multi-scale feature maps $\mathcal{E} = \{\mathbf{e}_0, \dots, \mathbf{e}_M\}$ that are used for initial matching and for warping in the propagation stage. We denote a feature map as $\mathbf{e}_l$ and an embedding vector $\mathbf{e}_{l,x,y}$ for locations $x,y$ at resolution $l \in 0, \dots, M$ , 0 being the original image resolution and $M$ denoting a $2^M \times 2^M$ downsampled resolution. A single embedding vector $\mathbf{e}_{l,x,y}$ is composed of multiple feature channels. We implement the feature extractor $\mathcal{E} = \mathcal{F}(\mathbf{I}; \boldsymbol{\theta}_{\mathcal{F}})$ as a U-Net like architecture [41, 33], i.e. an encoder-decoder with skip connections, with learnable parameters $\boldsymbol{\theta}_{\mathcal{F}}$ . The network is composed of strided convolutions and transposed convolutions with leaky RLUs as non-linearities. The set of feature maps $\mathcal{E}$ that we use in + +![](images/63e6303ea6641acd0f508fb33e1cd111b77c43fb14bb1024d0bf9c9e060cd413.jpg) + +![](images/375300cbcaba08e6cd7a7d37e40e5c7630596c175e446478102a1b5fd01128de.jpg) +Figure 2: Overview of the proposed framework. (Top) A U-Net is used to extract features at multiple scales from left and right images. The initialization step is run on each scale of the extracted features. This step operates on tiles of $4 \times 4$ feature regions and evaluates multiple disparity hypotheses. The disparity with the minimum cost is selected. (Bottom) The output of the initialization is then used at propagation stage to refine the predicted disparity hypotheses using slanted support windows. + +the remainder of the network are the outputs of the upsampling part of the U-Net at all resolutions. This means that even the high resolution features do contain some amount of spatial context. In more details, one down-sampling block of the U-Net has a single $3 \times 3$ convolution followed by a $2 \times 2$ convolution with stride 2. One up-sampling block applies $2 \times 2$ stride 2 transpose convolutions to up-sample results of coarser U-Net resolution. Features are concatenated with skip-connection, and a $1 \times 1$ convolution followed by a $3 \times 3$ convolution are applied to merge the skipped and upsampled feature for the current resolution. Each upsampling block generates a feature map $\mathbf{e}_l$ , which is then used for downstream tasks and also further upsampled in the U-Net to generate a higher resolution feature map. We run the feature extractor on the left and the right image and obtain two multi-scale representations $\mathcal{E}^L$ and $\mathcal{E}^R$ . + +# 3.3. Initialization + +The goal of the initialization is to extract an initial disparity $d^{\mathrm{init}}$ and a feature vector $\mathbf{p}^{\mathrm{init}}$ for each tile at various resolutions. The output of the initialization is fronto-parallel tile hypotheses of the form $\mathbf{h}^{\mathrm{init}} = [d^{\mathrm{init}}, 0, 0, \mathbf{p}^{\mathrm{init}}]$ . + +Tile Disparity. In order to keep the initial disparity resolution high we use overlapping tiles along the $x$ direction, + +i.e. the width, in the right (secondary) image but we still use non-overlapping tiles in the left (reference) image for efficient matching. To extract the tile features we run a $4 \times 4$ convolution on each extracted feature map $\mathbf{e}_l$ . The strides for the left (reference) image and the right (secondary) image are different to facilitate the aforementioned overlapping tiles. For the left image we use strides of $4 \times 4$ and for the right image we use strides of $4 \times 1$ , which is crucial to maintain the full disparity resolution to maximize accuracy. This convolution is followed by a leaky ReLU and an MLP. + +The output of this step will be a new set of feature maps $\tilde{\mathcal{E}} = \{\tilde{\mathbf{e}}_0,\dots ,\tilde{\mathbf{e}}_M\}$ with per tile features $\tilde{\mathbf{e}}_{l,x,y}$ . Note that the width of the feature maps in $\tilde{\mathcal{E}}^L$ and $\tilde{\mathcal{E}}^R$ are now different. The per-tile features are explicitly matched along the scan lines. We define the matching cost $\varrho$ at location $(x,y)$ and resolution $l$ with disparity $d$ as: + +$$ +\varrho (l, x, y, d) = \left\| \tilde {\mathbf {e}} _ {l, x, y} ^ {L} - \tilde {\mathbf {e}} _ {l, 4 x - d, y} ^ {R} \right\| _ {1} \tag {2} +$$ + +The initial disparities are then computed as: + +$$ +d _ {l, x, y} ^ {\text {i n i t}} = \operatorname * {a r g m i n} _ {d \in [ 0, D ]} \varrho (l, x, y, d) \tag {3} +$$ + +for each $(x,y)$ location and resolution $l$ , where $D$ is the maximal disparity that is considered. Note that despite the fact that the initialization stage exhaustively computes + +matches for all disparities there is no need to ever store the whole cost volume. At test time only the location of the best match needs to be extracted, which can be done very efficiently utilizing fast memory, e.g. shared memory on GPUs and a fused implementation in a single Op. Hence, there is no need to store and process a 3D cost volume. + +Tile Feature Descriptor. The initialization stage also predicts a feature description $\mathbf{p}_{l,x,y}^{\mathrm{init}}$ for each $(x,y)$ location and resolution $l$ : + +$$ +\mathbf {p} _ {l, x, y} ^ {\text {i n i t}} = \mathcal {D} \left(\varrho \left(d _ {l, x, y} ^ {\text {i n i t}}\right), \tilde {\mathbf {e}} _ {l, x, y} ^ {L}; \boldsymbol {\theta} _ {\mathcal {D} _ {l}}\right). \tag {4} +$$ + +The features are based on the embedding vector of the reference image $\tilde{\mathbf{e}}_{l,x,y}^{L}$ and the costs $\varrho$ of the best matching disparity $d_{\mathrm{init}}$ . We utilize a perceptron $\mathcal{D}$ , with learnable weights $\theta_{\mathcal{D}}$ , which is implemented with a $1\times 1$ convolution followed by a leaky ReLU. The input to the tile feature descriptor includes the matching costs $\varrho(\cdot)$ , which allows the network to get a sense of the confidence of the match. + +# 3.4. Propagation + +The propagation step takes tile hypotheses as input and outputs refined tile hypotheses based on spatial propagation of information and fusion of information. It internally warps the features from the feature extraction stage from the right image (secondary) to the left image (reference) in order to predict highly accurate offsets to the input tiles. An additional confidence is predicted which allows for effective fusion between hypotheses coming from earlier propagation layers and from the initialization stage. + +Warping. The warping step computes the matching costs between the feature maps $\mathbf{e}_l^L$ and $\mathbf{e}_l^R$ at the feature resolution $l$ associated to the tiles. This step is used to build a local cost volume around the current hypothesis. Each tile hypothesis is converted into a planar patch of size $4 \times 4$ that it originally covered in the feature map. We denote the corresponding $4 \times 4$ local disparity map as $\mathbf{d}'$ with + +$$ +\mathbf {d} _ {i, j} ^ {\prime} = d + (i - 1. 5) d _ {x} + (j - 1. 5) d _ {y}, \tag {5} +$$ + +for patch coordinates $i,j\in \{0,\dots ,3\}$ . The local disparities are then used to warp the features $\mathbf{e}_l^R$ from the right (secondary) image to the left (reference) image using linear interpolation along the scan lines. This results in a warped feature representation $\mathbf{e}_l^{R'}$ which should be very similar to the corresponding features of the left (reference) image $\mathbf{e}^L$ if the local disparity maps $\mathbf{d}'$ are accurate. Comparing the features of the reference $(x,y)$ tile with the warped secondary tile we define the cost vector $\phi (\mathbf{e},\mathbf{d}^{\prime})\in \mathbb{R}^{16}$ as: + +$$ +\boldsymbol {\phi} \left(\mathbf {e} _ {l}, \mathbf {d} ^ {\prime}\right) = \left[ c _ {0, 0}, c _ {0, 1}, \dots , c _ {0, 3}, c _ {1, 0} \dots c _ {3, 3} \right], \tag {6} +$$ + +where $c_{i,j} = \|\mathbf{e}_{l,4x + i,4y + j}^{L} - \mathbf{e}_{l,4x + i - \mathbf{d}_{i,j},4y + j}^{R}\|_{1}$ . + +Tile Update Prediction. This step takes $n$ tile hypotheses as input and predicts deltas for the tile hypotheses plus a scalar value $w$ for each tile indicating how likely this tile is to be correct, i.e. a confidence measure. This mechanism is implemented as a CNN module $\mathcal{U}$ , the convolutional architecture allows the network to see the tile hypotheses in a spatial neighborhood and hence is able to spatially propagate information. A key part of this step is that we augment the tile hypothesis with the matching costs $\phi$ from the warping step. By doing this for a small neighborhood in disparity space we build up a local cost volume which allows the network to refine the tile hypotheses effectively. Concretely, we displace all the disparities in a tile by a constant offset of one disparity 1 in the positive and negative directions and compute the cost three times. Using this let $\mathbf{a}$ be the augmented tile hypothesis map for input tile map $\mathbf{h}$ : + +$$ +\mathbf {a} _ {l, x, y} = \left[ \mathbf {h} _ {l, x, y}, \underbrace {\phi \left(\mathbf {e} _ {l} , \mathbf {d} ^ {\prime} - \mathbf {1}\right) , \phi \left(\mathbf {e} _ {l} , \mathbf {d} ^ {\prime}\right) , \phi \left(\mathbf {e} _ {l} , \mathbf {d} ^ {\prime} + \mathbf {1}\right)} _ {\text {l o c a l c o s t v o l u m e}} \right], \tag {7} +$$ + +for a location $(x,y)$ and resolution $l$ , The CNN module $\mathcal{U}_l$ then predicts updates for each of the $n$ tile hypothesis maps and additionally $w^i \in \mathbb{R}$ which represent the confidence of the tile hypotheses: + +$$ +\underbrace {(\Delta \mathbf {h} _ {l} ^ {1} , w ^ {1} , \dots , \Delta \mathbf {h} _ {l} ^ {n} , w ^ {n})} _ {\text {h y p o t h e s e s u p d a t e s}} = \mathcal {U} _ {l} \left(\mathbf {a} _ {l} ^ {1}, \dots , \mathbf {a} _ {l} ^ {n}; \boldsymbol {\theta} _ {\mathcal {U} _ {l}}\right). \tag {8} +$$ + +The architecture of $\mathcal{U}$ is implemented with residual blocks [20] but without batch normalization. Following [25] we use dilated convolutions to increase the receptive field. Before running a sequence of residual blocks with varying dilation factors we run a $1\times 1$ convolution followed by a leaky ReLU to decrease the number of feature channels. The update module is applied in a hierarchical iterative fashion (see Fig. 2). At the lowest resolution $l = M$ we only have 1 tile hypothesis per location from the initialization stage, hence $n = 1$ . We apply the tile updates by summing the input tile hypotheses and the deltas and upsample the tiles by a factor of 2 in each direction. Thereby, the disparity $d$ is upsampled using the plane equation of the tile and the remaining parts of the tile hypothesis $d_x$ , $d_y$ and $\mathbf{p}$ are upsampled using nearest neighbor sampling. At the next resolution $M - 1$ we now have two hypotheses: the one from the initialization stage and the upsampled hypotheses from the lower resolution, hence $n = 2$ . We utilize the $w^i$ to select the updated tile hypothesis with highest confidence for each location. We iterate this procedure until we reach the resolution 0, which corresponds to tile size $4\times 4$ and full disparity resolution in all our experiments. To further refine the disparity map we use the winning hypothesis for the $4\times 4$ tiles and apply propagation module 3 times: for $4\times 4$ , $2\times 2$ , $1\times 1$ resolutions, using $n = 1$ . The output at tile size $1\times 1$ is our final prediction. More details about the network architecture are provided in the supplementary material. + +# 4. Loss Functions + +Our network is trained end-to-end with ground truth disparities $d^{\mathrm{gt}}$ utilizing the losses described in the remainder of this section. The final loss is a sum of the losses over all the scales and pixels: $\sum_{l,x,y} L_l^{\mathrm{init}} + L_l^{\mathrm{prop}} + L_l^{\mathrm{slant}} + L_l^{\mathrm{w}}$ . + +# 4.1. Initialization Loss + +Ground truth disparities are given with subpixel precision, however matching in initialization happens with integer disparities. Therefore we compute the matching cost for subpixel disparities using linear interpolation. The cost for subpixel disparities is then given as + +$$ +\psi (d) = (d - \lfloor d \rfloor) \varrho (\lfloor d \rfloor + 1) + (\lfloor d \rfloor + 1 - d) \varrho (\lfloor d \rfloor), \tag {9} +$$ + +where we dropped the $l, x, y$ subscripts for clarity. To compute them at multiple resolutions we maxpool the ground truth disparity maps to downsample them to the required resolution. We aim at training the features $\mathcal{E}$ to be such that the matching cost $\psi$ is smallest at the ground truth disparity and larger everywhere else. To achieve this, we impose an $\ell_1$ contrastive loss [18] + +$$ +L ^ {\text {i n i t}} \left(d ^ {\mathrm {g t}}, d ^ {\mathrm {n m}}\right) = \psi \left(d ^ {\mathrm {g t}}\right) + \max (\beta - \psi \left(d ^ {\mathrm {n m}}\right), 0), \tag {10} +$$ + +where $\beta > 0$ is a margin, $d^{\mathrm{gt}}$ the ground truth disparity for a specific location and + +$$ +d ^ {\mathrm {n m}} = \operatorname {a r g m i n} _ {d \in [ 0, D ] / \{d: d \in [ d ^ {\mathrm {g t}} - 1. 5, d ^ {\mathrm {g t}} + 1. 5 ] \}} \varrho (d) \tag {11} +$$ + +the disparity of the lowest cost non match for the same location. This cost pushes the ground truth cost toward 0 as well as the lowest cost non match toward a certain margin. In all our experiments we set the margin to $\beta = 1$ . Similar contrastive losses have been used to learn the matching score in earlier deep learning based approaches to stereo matching [58, 35]. However, they either used a random non-matching location as negative sample or used all the non matching locations as negative samples, respectively. + +# 4.2. Propagation Loss + +During propagation we impose a loss on the tile geometry $d$ , $d_x$ , $d_y$ and the tile confidence $w$ . We use the ground truth disparity $d^{\mathrm{gt}}$ and ground truth disparity gradients $d_x^{\mathrm{gt}}$ and $d_y^{\mathrm{gt}}$ , which we compute by robustly fitting a plane to $d^{\mathrm{gt}}$ in a $9 \times 9$ window centered at the pixel. In order to apply the loss on the tile geometry we first expand the tiles to a full resolution disparities $\hat{d}$ using the plane equation $(d,d_x,d_y)$ analogously to Eq. 5. The slant portion is also up-sampled to full resolution using nearest neighbor approach before slant loss is applied. We use the general robust loss function $\rho(\cdot)$ from [2] which resembles a smooth $\ell_1$ loss, i.e., Huber loss. Additionally, we apply a truncation to the loss with threshold $A$ + +$$ +L ^ {\text {p r o p}} (d, d x, d y) = \rho \left(\min \left(| d ^ {\text {d i f f}} |, A\right), \alpha , c\right), \tag {12} +$$ + +where $d^{\mathrm{diff}} = d^{\mathrm{gt}} - \hat{d}$ . Further we impose a loss on the surface slant, as + +$$ +L ^ {\text {s l a n t}} \left(d _ {x}, d _ {y}\right) = \left\| \begin{array}{l} d _ {x} ^ {\mathrm {g t}} - d _ {x} \\ d _ {y} ^ {\mathrm {g t}} - d _ {y} \end{array} \right\| _ {1} \chi_ {| d ^ {\text {d i f f}} | < B}, \tag {13} +$$ + +where $\chi$ is an indicator function which evaluates to 1 when the condition is satisfied and 0 otherwise. To supervise the confidence $w$ we impose a loss which increases the confidence if the predicted hypothesis is closer than a threshold $C_1$ from the ground truth and decreases the confidence if the predicted hypothesis is further than a threshold $C_2$ away from the ground truth. + +$$ +L ^ {\mathrm {w}} (w) = \max (1 - w, 0) \chi_ {| d ^ {\text {d i f f}} | < C _ {1}} + \max (w, 0) \chi_ {| d ^ {\text {d i f f}} | > C _ {2}} \tag {14} +$$ + +For all our experiments $A = B = C_1 = 1$ ; $C_2 = 1.5$ . For the last several levels, when only a single hypotheses is available, loss is applied to all pixels ( $A = \infty$ ). + +# 5. Experiments + +We evaluate the proposed approach on popular benchmarks showing competitive results at a fraction of the computational time compared to other methods. We consider the following datasets: SceneFlow [37], KITTI 2012 [15], KITTI 2015 [38], ETH3D [44], Middlebury dataset V3 [42]. Following the standard evaluation settings we consider the two popular metrics: the End-Point-Error (EPE), which is the absolute distance in disparity space between the predicted output and the groundtruth; the $x$ -pixels error, which is the percentage of pixels with disparity error greater than $x$ . For the EPE computation on SceneFlow we adopt the same methodology of PSMNet [7], which excludes all the pixel with ground truth disparity bigger than 192 from the evaluation. Unless stated otherwise we use a HITNet with 5 levels, i.e. $M = 4$ . + +In this section we focus on comparisons with state-of-art on popular benchmarks, detailed ablation studies, run-time breakdown, cross-domain generalization and additional evaluations, are provided in the supplementary material. The trained models used for submission to benchmarks and evaluation scripts can be found at https://github.com/google-research/googleresearch/tree/master/hitnet + +# 5.1. Comparisons with State-of-the-art + +SceneFlow. On the synthetic dataset SceneFlow "final-pass" we achieve the remarkable End-Point-Error (EPE) of 0.36, which is 2X better than state-of-art at time of writing (see supplementary materials for details of L and XL versions). Representative competitors are reported in Tab. 1. The PSMNet algorithm [7] performs multi-scale feature extraction similarly to our method, but in contrast they use a more sophisticated pooling layer. Here we show that + +![](images/77d3b8bec87e6f63c487dc09f13a1efca77bf563cd07b8ebb902983656f5ec8a.jpg) +Figure 3: Qualitative results on SceneFlow and KITTI 2012. Note how the model is able to recover fine details, textureless regions and crisp edges. + +
MethodEPE pxRuntime s
HITNet XL0.360.114
HITNet L0.430.054
EdgeStereo [48]0.740.32
LEAStereo [8]0.780.3
GA-Net [59]0.841.6
PSMNet [7]1.090.41
StereosNet [25]1.10.015
+ +Table 1: Comparisons with state-of-the-art methods on Scene Flow "finalpass" dataset, lower is better. + +
MethodEPE pxBad 1Bad 2Runtime
HITNet (ours)0.202.790.800.02 s
R-Stereo0.182.440.440.81 s
DN-CSS0.222.690.770.31 s
AdaStereo [47]0.263.410.740.40 s
Deep-Pruner [9]0.263.520.860.16 s
iResNet [32]0.243.681.000.20 s
Stereo-DRNet [6]0.274.460.830.33 s
PSMNet [7]0.335.021.090.54 s
+ +Table 2: Comparisons with state-of-the-art methods on ETH3D stereo dataset. For all metrics lower is better. + +our architecture is more effective. Compared to GA-Net [59], we do not need complex message passing steps such as SGM. The results we obtain show that our strategy is also achieving a very similar inference. Finally, a representative fast method, StereoNet [25] is considered, which we consistently outperform. As result our method achieves the lowest EPE while still maintaining real-time performance. See Figure 3 for qualitative results. + +Middlebury Stereo Dataset v3. We evaluated our method with multiple state-of-art approaches on the Middlebury stereo dataset v3, see Table 4 and the official benchmark website. As we can observe we outperform all the other end-to-end learning based approaches on most of the metrics, we rank among the top 10 when considering also hand-crafted approaches and in particular we rank first for bad 0.5 and A50, second for bad 1 and avgerr. In addition, we note that our average error is impacted by specifically one image, DjembL, which is due to the fact that we do not explicitly handle harsh lighting variations between input pairs. For visual results on the Middlebury datasets and details regarding the training procedure we refer the reader to the supplementary material. + +ETH3D two view stereo. We evaluated our method with multiple state-of-art approaches on the ETH3D dataset, see Tab. 2. At time of submission to benchmark, HITNet ranks $1^{\text{st}} - 4^{\text{rd}}$ on all the metrics published on the website. In particular, our method ranks $1^{\text{nd}}$ on the following metrics: bad 0.5, bad 4, average error, rms error, $50\%$ quantile, $90\%$ quantile: this shows that HITNet is resilient to the particular measurement chosen, whereas competitive approaches exhibits substantial differences when different metrics are selected. See the submission website for details. $^3$ . + +KITTI 2012 and 2015. At time of writing, among the published methods faster than 100ms, HITNet ranks #1 on KITTI 2012 and 2015 benchmarks. Compared to other state-of-the-art stereo matchers (see Tab. 3), our approach + +2See "HITNet" entry on the official dataset website. +3See the ETH3D Website at https://www.eth3d.net/low_res_two_view for the complete metrics. + +
KITTI 2012 [15]KITTI 2015 [38]
Method2-noc2-all3-noc3-allEPE nocEPE allD1-bgD1-fgD1-allRun-time
HITNet (ours)2.002.651.411.890.40.51.743.201.980.02s
LEAStereo [8]1.902.391.131.450.40.51.402.911.650.3s
GANet-deep [59]1.892.501.191.60.40.51.483.461.811.8s
EdgeStereo-V2 [48]2.322.881.461.830.40.51.843.302.080.32s
GC-Net [24]2.713.461.772.300.60.72.216.162.870.9s
SGM-Net [45]3.605.152.293.500.70.92.668.643.6667s
ESMNet [17]3.654.302.082.530.60.72.574.862.950.06s
MC-CNN-acrt [58]3.905.452.093.220.60.72.898.883.8967s
RTSNet [29]3.984.612.432.900.70.72.866.193.410.02s
Fast DS-CS [54]4.545.342.613.200.70.82.834.313.080.02s
StereoNet [25]4.916.02--0.80.94.307.454.830.015s
+ +Table 3: Quantitative evaluation on KITTI 2012 and KITTI 2015. For KITTI 2012 we report the percentage of pixels with error bigger than $x$ disparities in both non-occluded (x-noc) and all regions (x-all), as well as the overall EPE in both non occluded (EPE-noc) and all the pixels (EPE-all). For KITTI 2015 We report the percentage of pixels with error bigger than 1 disparity in background regions (bg), foreground areas (fg), and all. + +
MethodRMSAvgErrBad 0.5Bad 1.0Bad 2.0Bad 4.0A50Run-time
HITNet (ours)9.971.7134.213.36.463.810.400.14 s
LEAStereo [8]8.111.4349.520.87.152.750.532.9 s
NOSS-ROB [30]12.22.0838.213.25.013.460.42662s (CPU)
LocalExp [50]13.42.2438.713.95.433.690.43881s (CPU)
CRLE [52]13.62.2538.113.45.753.900.421589s (CPU)
HSM [53]10.32.0750.724.610.24.830.560.51 s
MC-CNN [58]21.33.8240.717.18.084.910.45150 s
EdgeStereo [48]9.842.6755.632.418.710.80.720.35 s
+ +Table 4: Comparisons with state-of-the-art methods on Middlebury V3 dataset. For all metrics lower is better. + +compares favorably to GC-Net [24], [39] and many others. Recent methods such as GA-Net [59] and HSM [53] are obtaining slightly better metrics, although they require 1.8 and 0.15 seconds respectively. Note also that HSM [53] has been trained with additional external high resolution data. Similarly, GA-Net [59] is pre-trained on SceneFlow and fine-tuned on KITTI benchmarks, whereas our approach is fully trained on the small data available on KITTI. Compared to fast methods such as StereoNet [25] and RTSNet [29], our method consistently outperforms them by a considerable margin, showing that it can be employed in latency critical scenarios without sacrificing accuracy. $^{4}$ . + +# 6. Conclusion + +We presented HITNet, a real-time end-to-end architecture for accurate stereo matching. We presented a fast initialization step that is able to compute high resolution matches using learned features very efficiently. These tile initializations are then fused using propagation and fusion steps. The use of slanted support windows with learned + +descriptors provides additional accuracy. We presented state-of-the-art accuracy on multiple commonly used benchmarks. A limitation of our algorithm is that it needs to be trained on a dataset with ground truth depth. To address this in the future we are planning to investigate self-supervised methods and self-distillation methods to further increase the accuracy and decrease the amount of training data that is required. A limitation of our experiments is that different datasets are trained on separately and use slightly different model architectures. To address this in the future, a single experiment is required that aligns with Robust Vision Challenge requirements. + +Acknowledgements. We would like to thank Shahram Izadi for support and enabling of this project. + +# 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 (ToG), 2009. 2 + +[2] Jonathan T Barron. A general and adaptive robust loss function. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 6 +[3] Frederic Besse, Carsten Rother, Andrew Fitzgibbon, and Jan Kautz. Pmbp: Patchmatch belief propagation for correspondence field estimation. International Journal of Computer Vision (IJCV), 2014. 2 +[4] Michael Bleyer and Margrit Gelautz. Simple but effective tree structures for dynamic programming-based stereo matching. In International Conference on Computer Vision Theory and Applications (VISAPP), 2008. 2 +[5] Michael Bleyer, Christoph Rhemann, and Carsten Rother. Patchmatch stereo-stereo matching with slanted support windows. In British Machine Vision Conference (BMVC), 2011. 2 +[6] Rohan Chabra, Julian Straub, Christopher Sweeney, Richard Newcombe, and Henry Fuchs. StereoDRNet: Dilated residual stereonet. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 7 +[7] Jia-Ren Chang and Yong-Sheng Chen. Pyramid stereo matching network. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. 3, 6, 7 +[8] Xuelian Cheng, Yiran Zhong, Mehrtash Harandi, Yuchao Dai, Xiaojun Chang, Tom Drummond, Hongdong Li, and Zongyuan Ge. Hierarchical neural architecture search for deep stereo matching. In NIPS, 2020. 7, 8 +[9] Shivam Duggal, Shenlong Wang, Wei-Chiu Ma, Rui Hu, and Raquel Urtasun. Deepruner: Learning efficient stereo matching via differentiable patchmatch. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 4383-4392, 2019. 7 +[10] S. R. Fanello, C. Keskin, S. Izadi, P. Kohli, D. Kim, D. Sweeney, A. Criminisi, J. Shotton, S.B. Kang, and T. Paek. Learning to be a depth camera for close-range human capture and interaction. Transaction On Graphics (TOG), 2014. 2 +[11] S. R. Fanello, C. Rhemann, V. Tankovich, A. Kowdle, S. Orts Escolano, D. Kim, and S. Izadi. Hyperdepth: Learning depth from structured light without matching. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 2 +[12] Sean Ryan Fanello, Julien Valentin, Adarsh Kowdle, Christoph Rhemann, Vladimir Tankovich, Carlo Ciliberto, Philip Davidson, and Shahram Izadi. Low compute and fully parallel computer vision with hashmatch. In international Conference on Computer Vision (ICCV), 2017. 2, 3 +[13] Sean Ryan Fanello, Julien Valentin, Christoph Rhemann, Adarsh Kowdle, Vladimir Tankovich, Philip Davidson, and Shahram Izadi. Ultrastereo: Efficient learning-based matching for active stereo systems. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 2, 3 +[14] Pedro F Felzenszwalb and Daniel P Huttenlocher. Efficient belief propagation for early vision. International journal of computer vision (IJCV), 2006. 2 +[15] 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. 6, 8 + +[16] Spyros Gidaris and Nikos Komodakis. Detect, replace, refine: Deep structured prediction for pixel wise labeling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 3 +[17] Chenggang Guo, Dongyi Chen, and Zhiqi Huang. Learning efficient stereo matching network with depth discontinuity aware super-resolution. IEEE Access, 2019. 8 +[18] Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2006. 6 +[19] Rostam Affendi Hamzah and Haidi Ibrahim. Literature survey on stereo vision disparity map algorithms. Journal of Sensors, 2016. 2 +[20] 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), 2016. 5 +[21] Heiko Hirschmuller. Stereo processing by semiglobal matching and mutual information. IEEE Transactions on pattern analysis and machine intelligence (TPAMI), 2008. 2 +[22] Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2013. 2 +[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), 2017. 3 +[24] Alex Kendall, Hayk Martirosyan, Saumitro Dasgupta, Peter Henry, Ryan Kennedy, Abraham Bachrach, and Adam Bry. End-to-end learning of geometry and context for deep stereo regression. In IEEE International Conference on Computer Vision (ICCV), 2017. 2, 3, 8 +[25] Sameh Khamis, Sean Fanello, Christoph Rhemann, Adarsh Kowdle, Julien Valentin, and Shahram Izadi. StereoNet: Guided hierarchical refinement for edge-aware depth prediction. In European Conference on Computer Vision (ECCV), 2018. 2, 3, 5, 7, 8 +[26] Andreas Klaus, Mario Sormann, and Konrad Karner. Segment-based stereo matching using belief propagation and a self-adapting dissimilarity measure. In International Conference on Pattern Recognition (ICPR), 2006. 2 +[27] Vladimir Kolmogorov and Ramin Zabih. Computing visual correspondence with occlusions using graph cuts. In International Conference on Computer Vision (ICCV), 2001. 2 +[28] Adarsh Kowdle, Christoph Rhemann, Sean Fanello, Andrea Tagliasacchi, Jon Taylor, Philip Davidson, Mingsong Dou, Kaiwen Guo, Cem Keskin, Sameh Khamis, David Kim, Danhang Tang, Vladimir Tankovich, Julien Valentin, and Shahram Izadi. The need 4 speed in real-time dense visual tracking. Transaction On Graphics (TOG), 2018. 2 +[29] H. Lee and Y. Shin. Real-time stereo matching network with high accuracy. In IEEE International Conference on Image Processing (ICIP), 2019. 8 + +[30] Jie Li, Penglei Ji, and Xinguo Liu. Superpixel alpha-expansion and normal adjustment for stereo matching. In CAD/Graphics 2019, 2019. 8 +[31] Yu Li, Dongbo Min, Michael S Brown, Minh N Do, and Jiangbo Lu. SPM-BP: Sped-up patchmatch belief propagation for continuous mrfs. In IEEE International Conference on Computer Vision (ICCV), 2015. 2 +[32] Zhengfa Liang, Yiliu Feng, Yulan Guo, Hengzhu Liu, Linbo Qiao, Wei Chen, Li Zhou, and Jianfeng Zhang. Learning for disparity estimation through feature constancy. 2017. 3, 7 +[33] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In IEEE conference on computer vision and pattern recognition (CVPR), 2015. 3 +[34] Jiangbo Lu, Hongsheng Yang, Dongbo Min, and Minh N Do. Patch match filter: Efficient edge-aware filtering meets randomized search for fast correspondence field estimation. In IEEE conference on computer vision and pattern recognition (CVPR), 2013. 2 +[35] Wenjie Luo, Alexander G Schwing, and Raquel Urtasun. Efficient deep learning for stereo matching. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 2, 6 +[36] David Marr and Tomaso Poggio. Cooperative computation of stereo disparity. Science, 1976. 2 +[37] Nikolaus Mayer, Eddy Ig, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 2, 6 +[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. 6, 8 +[39] Jiahao Pang, Wenxiu Sun, JS Ren, Chengxi Yang, and Qiong Yan. Cascade residual learning: A two-stage convolutional neural network for stereo matching. In International Conference on Computer Vision-Workshop on Geometry Meets Deep Learning (ICCVW 2017), 2017. 3, 8 +[40] Anurag Ranjan and Michael J Black. Optical flow estimation using a spatial pyramid network. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 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 (MICCAI), 2015. 3 +[42] Daniel Scharstein, Heiko Hirschmuller, York Kitajima, Greg Krathwohl, Nera Nesic, Xi Wang, and Porter Westling. High-resolution stereo datasets with subpixel-accurate ground truth. In German Conference on Pattern Recognition (GCR), 2014. 6 +[43] Daniel Scharstein and Richard Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International journal of computer vision, 2002. 2, 3 + +[44] Thomas Schöps, Johannes L. Schonberger, Silvano Galliani, Torsten Sattler, Konrad Schindler, Marc Pollefeys, and Andreas Geiger. A multi-view stereo benchmark with high-resolution images and multi-camera videos. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 6 +[45] A. Seki and M. Pollefeys. SGM-Nets: Semi-global matching with neural networks. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 8 +[46] Amit Shaked and Lior Wolf. Improved stereo matching with constant highway networks and reflective confidence learning. In IEEE conference on computer vision and pattern recognition (CVPR), 2017. 2 +[47] Xiao Song, Guorun Yang, Xinge Zhu, Hui Zhou, Zhe Wang, and Jianping Shi. Adastereo: A simple and efficient approach for adaptive stereo matching. Technical report, arXiv preprint arXiv:2004.04627, 2020. 2, 7 +[48] Xiao Song, Xu Zhao, Liangji Fang, Hanwen Hu, and Yizhou Yu. Edgestereo: An effective multi-task learning network for stereo matching and edge detection. International Journal of Computer Vision (IJCV), 2020. 7, 8 +[49] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. PWC-Net: Cnns for optical flow using pyramid, warping, and cost volume. IEEE Conference on Computer Vision and Pattern Recognition, 2018. 3 +[50] Tatsunori Taniai, Yasuyuki Matsushita, Yoichi Sato, and Takeshi Naemura. Continuous 3D Label Stereo Matching using Local Expansion Moves. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 40(11):2725-2739, 2018. 8 +[51] Vladimir Tankovich, Michael Schoenberg, Sean Ryan Fanello, Adarsh Kowdle, Christoph Rhemann, Max Dzitsiuk, Mirko Schmidt, Julien Valentin, and Shahram Izadi. Sos: Stereo matching in o(1) with slanted support windows. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2018. 2, 3 +[52] H. Xu, X. Chen, H. Liang, S. Ren, Y. Wang, and H. Cai. Crosspatch-based rolling label expansion for dense stereo matching. IEEE Access, 8:63470-63481, 2020. 8 +[53] Gengshan Yang, Joshua Manela, Michael Happold, and Deva Ramanan. Hierarchical deep stereo matching on high-resolution images. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3, 8 +[54] Kyle Yee and Ayan Chakrabarti. Fast deep stereo with 2d convolutional processing of cost signatures. In Winter Conference on Applications of Computer Vision (WACV), 2020. 8 +[55] Kuk-Jin Yoon and In-So Kweon. Locally adaptive support-weight approach for visual correspondence search. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2005. 2 +[56] Sergey Zagoruyko and Nikos Komodakis. Learning to compare image patches via convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 2 + +[57] Jure Zbontar and Yann LeCun. Computing the stereo matching cost with a convolutional neural network. In IEEE conference on computer vision and pattern recognition (CVPR), 2015. 2 +[58] Jure Zbontar and Yann LeCun. Stereo matching by training a convolutional neural network to compare image patches. Journal of Machine Learning Research (JMLR), 2016. 2, 6, 8 +[59] Feihu Zhang, Victor Prisacariu, Ruigang Yang, and Philip HS Torr. Ga-net: Guided aggregation net for end-to-end stereo matching. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3, 7, 8 +[60] Yinda Zhang, Sameh Khamis, Christoph Rhemann, Julien Valentin, Adarsh Kowdle, Vladimir Tankovich, Michael Schoenberg, Shahram Izadi, Thomas Funkhouser, and Sean Fanello. ActiveStereoNet: End-to-end self-supervised learning for active stereo systems. European Conference on Computer Vision (ECCV), 2018. 3 \ No newline at end of file diff --git a/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/images.zip b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1dab262bffc28aba52dbb8822eb32b10db81f4f2 --- /dev/null +++ b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:291cb08548a7c77481a451e940945a953b9e37405a6adb66eca2d947377909db +size 680103 diff --git a/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/layout.json b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c5c677d0bcb2531f81dcb4f2f78fc08c036487d0 --- /dev/null +++ b/hitnethierarchicaliterativetilerefinementnetworkforrealtimestereomatching/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd35f1399102bfd06ced411f0d060864c5fb413993e0a9a233aaa6ae6f04e2cd +size 455848 diff --git a/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_content_list.json b/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ab5def331cecfcee3902efec3bdea7df6b970731 --- /dev/null +++ b/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd7e5c8c11b283bce58ad916ff6a88e3c318e123807affe871c8fa12de2e69be +size 86491 diff --git a/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_model.json b/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..920bcdf13821694893ffec7595248858ad1babfc --- /dev/null +++ b/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acf26ec21f30c3ce57f4415b68cb2600cb0205e195c9c496a7e5d35ac7f316a2 +size 112163 diff --git a/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_origin.pdf b/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..922b349fad5c196623da9129dbaaedc5ba9655e1 --- /dev/null +++ b/hlafacejointhighlowadaptationforlowlightfacedetection/9bd8dc90-670d-48a8-aa14-f2ba5eb4c2f6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d920b4ef00b3f52a038d14fa3f1c28b70934f9a12bdace470c4484af5c86d98a +size 8980383 diff --git a/hlafacejointhighlowadaptationforlowlightfacedetection/full.md b/hlafacejointhighlowadaptationforlowlightfacedetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..343214f8d7e9ac1dd6035fd88883da11f87dcbc6 --- /dev/null +++ b/hlafacejointhighlowadaptationforlowlightfacedetection/full.md @@ -0,0 +1,415 @@ +# HLA-Face: Joint High-Low Adaptation for Low Light Face Detection + +Wenjing Wang, Wenhan Yang, Jiaying Liu* + +Wangxuan Institute of Computer Technology, Peking University, Beijing, China + +# Abstract + +Face detection in low light scenarios is challenging but vital to many practical applications, e.g., surveillance video, autonomous driving at night. Most existing face detectors heavily rely on extensive annotations, while collecting data is time-consuming and laborious. To reduce the burden of building new datasets for low light conditions, we make full use of existing normal light data and explore how to adapt face detectors from normal light to low light. The challenge of this task is that the gap between normal and low light is too huge and complex for both pixel-level and object-level. Therefore, most existing low-light enhancement and adaptation methods do not achieve desirable performance. To address the issue, we propose a joint High-Low Adaptation (HLA) framework. Through a bidirectional low-level adaptation and multi-task high-level adaptation scheme, our HLA-Face outperforms state-of-the-art methods even without using dark face labels for training. Our project is publicly available at: https://daooshee.github.io/HLA-Face-Website/. + +# 1. Introduction + +Face detection is fundamental for many vision tasks, and has been widely used in a variety of practical applications, such as intelligent surveillance for smart city, face unlock, and beauty filters in mobile phones. Over the past decades, extensive researches have made great progress in face detection. However, face detection under adverse illumination conditions is still challenging. Images captured without insufficient illumination suffer from a series of degradations, e.g., low visibility, intensive noise, and color cast. These degradations can not only affect the human visual quality, but also worsen the performance of machine vision tasks, which may cause potential risks in surveillance video analysis and nighttime autonomous driving. In Fig. 1 (a), the + +![](images/8e955b17dbd4ff64c5286bd5f20c76e744585cdff603f39c4f43d4bcb565d9c9.jpg) + +![](images/d32574d3a79f62f137e4f2d901b58a6486b529b5cac3c7bdad8cb6bf743b216b.jpg) +(a) DSFD + +![](images/f531c4e4bfb440d0af10021da383834df79db6c0f25e68bc8550e6785a12d50a.jpg) + +![](images/2b27d6720dd5641f1f8ebb28f3270418f39d332ee6d409cbc1aab6071cadf3e9.jpg) +(b) LIME + DSFD + +![](images/33031711d060d5666c7323e435ef88a114f9c054502006ae4e59e860577ead47.jpg) + +![](images/0e7d047aa01aa66c5f70e09cfd8c23a97add05e71fb0ca75c39e77049ee19faa.jpg) + +![](images/8cc247c44cb694fc53a70a63ffc98a82714e0744a7f2b6f421f9c8c68b91a72a.jpg) +(c) Ours +(d) Our learning paradigm for dark face detection +Figure 1. Dark face detection visual results and our learning paradigm. Compared with the result of DSFD [26] on original low light images and the enhanced version by LIME [16], our method can better recognize the faces in dark scenarios. + +state-of-the-art face detector DSFD [26] can hardly detect faces under insufficient illumination, in direct contrast to its over $90\%$ precision on WIDER FACE [49]. + +To promote the research of low light face detection, a large scale benchmark DARK FACE [50] is constructed. The emergence of dark face data gives birth to a number of dark face detection researches [27]. However, existing methods are dependent on extensive annotations, therefore have poor robustness and scalability. + +In this paper, based on the benchmarking platform provided by DARK FACE, we explore how to adapt normal light face detection models to low light scenarios without the requirement of dark face annotations. We find that there are two levels of gaps between normal light and low light. One is the gap in pixel-level appearance, such as the insufficient illumination, camera noise, and color bias. The other is the object-level semantic differences between normal and low light scenes, including but not limited to the existence of street lights, vehicle headlights, and advertisement boards. Traditional low light enhancement methods [16, 52] are designed for improving visual quality, therefore cannot fill the semantic gap, as shown in Fig. 1 (b). Typical adapta + +tion methods [24, 41] are mainly designed for the scenario where the two domains share the same scene, such as adapting from Cityscapes [8] to Foggy Cityscapes [42]. But for our task, the domain gap is more huge, raising a more difficult challenge for adaptation. + +To adapt from normal light to low light, we propose a High-Low Adaptation Face detection framework (HLA-Face). We consider joint low-level and high-level adaptation. Specifically, for low-level adaptation, typical methods either brighten the dark image or darken the bright image. However, due to the huge domain gap, they do not achieve desirable performance. Instead of unidirectional low-to-normal or normal-to-low translation, we bidirectionally make two domains each take a step towards each other. By brightening the low light images and distorting the normal light images, we build intermediate states that lie between the normal and low light. For high-level adaptation, we use multi-task self-supervised learning to close the feature distance between the intermediate states built by low-level adaptation. By combining low-level and high-level adaptation, we outperform state-of-the-art face detection methods even though we do not use the labels of dark faces. Our contributions are summarized as follows: + +- We propose a framework for dark face detection without annotated dark data. Through a joint low-level and high-level adaptation, our model achieves superior performance compared with state-of-the-art face detection and adaptation methods. +- For low-level adaptation, we design a bidirectional scheme. Through brightening low light data and distorting normal light data with noise and color bias, we set up intermediate states and make two domains each take a step towards each other. +- For high-level adaptation, we introduce cross-domain self-supervised learning for feature adaptation. With context-based and contrastive learning, we comprehensively close the feature distance among multiple domains and further strengthen the representation. + +# 2. Related Works + +Low Light Enhancement. Low illumination is a common kind of visual distortion, which might be caused by undesirable shooting conditions, wrong camera operations, and equipment malfunctions, etc. There have been many literatures for low light enhancement. Histogram equalization and its variants [37] stretch the dynamic range of the images. Dehazing-based methods [11] regard dark images as inverted hazy images. Retinex theory assumes that images can be decomposed into illumination and reflectance. Based on the Retinex theory, a large portion of works [12, 16] estimate illumination and reflectance, then process each component separately or simultaneously. Recent methods are + +mainly based on deep learning. Some design end-to-end processing models [15], while some inject traditional ideas such as the Retinex theory [2, 48, 52]. Besides processing 8-bit RGB images, there are also models for RAW images [4]. + +The problem is that these methods are mainly designed for human vision rather than machine vision. How pixel-level adjustment can benefit and guide high-level tasks has not been well explored. In this paper, we provide corresponding solutions for dark face detection. + +Face Detection. Early face detectors rely on hand-crafted features [47], which are now replaced by deep features learned from data-driven convolutional neural networks. Inherit from generic object detection, typical face detectors can be classified into two categories: two-stage and one-stage. Two-stage models [38, 40] first generate region proposals, then refine them for the final detection. One-stage models [29] instead directly predict the bounding boxes and confidence. The difference between generic object and face detection is that, in face detection, the scale variation is often much larger. Existing methods solve this problem by multi-scale image and feature pyramids [19, 28], or various anchor sampling and matching strategies [33, 51, 54]. + +Despite the prosperity of face detection researches, existing models seldom consider the scenario of insufficient illumination. In this paper, we propose a dark face detector that outperforms state-of-the-art methods even without using dark annotations. + +Dark Object Detection. With the rapid development of deep learning, object detection has attracted more and more attention. However, few efforts have been made for dark objects. For RAW images, YOLO-in-the-Dark [44] merges models pre-trained in different domains using glue layers and a generative model. For RGB images, Loh et al. build the ExDark [31] dataset and analyze the low light images using both hand-crafted and learned features. DARK FACE [50] is a large-scale low light face dataset, giving birth to a series of dark face detectors in the $\mathrm{UG}^2$ Prize Challenge1. However, most of these models highly rely on annotations, thus are of limited flexibility and robustness. + +To get rid of the dependency on labels, Unsupervised Domain Adaptation (UDA) may be a plain solution [21, 24]. Although UDA has been demonstrated to be effective in many applications, due to the huge gap between normal and low light, these methods have limited performance in dark face detection. In this paper, we propose a superior method by combining low- and high-level adaptation. + +# 3. Joint Adaptation for Dark Face Detection + +In this section, we firstly introduce the motivation of our learning paradigm, then describe the detailed designs. + +![](images/01820bcb4d9ac41fa52eced172fdc21df45e702a9022c153d6ef69c3e7dd9b3c.jpg) +(a) Problem description +(b) Enhancement +(c) Darkening + +![](images/70d2522a925e345cd231b9c0a87a4cd114ab56cb95f68d4d524ed1a3bc1fe383.jpg) +(d) Feature adaptation +(e) The proposed method + +![](images/bab58e1781711e41b231fa6d4c92a255339f92360aa75e139999d4dd1c85c558.jpg) +Figure 2. Comparison of different adaptive low light detection techniques. $L$ : low light data. $H$ : normal light data. Existing enhancement-based, darkening-based, and feature adaptation methods either ignore the high-level gap, or have limited effects due to the huge and complex gap between $L$ and $H$ . Our method instead considers both low-level and high-level adaptation, therefore achieves better performance. +(a) WIDER FACE +Figure 3. Comparison of WIDER FACE and DARK FACE. On the right, DARK FACE is enhanced for better visibility. + +![](images/fe8d57fa0a1f3f5b39b4d1449618414bed1433726f99edf7d24fa36f6f86ce36.jpg) +(b) DARK FACE + +![](images/208161a4ae604f46454527c25d10acd1d283cbead039ec8c31e6cf763dbeadb8.jpg) + +![](images/db0e4ca1a22bd057108251e2d3a4cb7aae8e3af189916e7e1a4cb73edc161c2e.jpg) + +# 3.1. Motivation + +The task is to adapt face detectors trained on normal light data $H$ to unlabeled low light data $L$ . As shown in Fig. 2, existing methods can be roughly divided into three categories: enhancement, darkening, and feature adaptation. Enhancement-based methods [7] brighten the low light images and directly test on them. They usually require no model fine-tuning, therefore are highly flexible. Darkening-based methods [1, 25, 43] first darken the normal light data into a dark version, then re-train the model on the transferred annotated data. Enhancement and darkening are all pixel-level. For feature adaptation, typical methods use alignment [45], adversarial learning [13], or pseudo labeling [21] to directly adapt the features of the model. + +The problem for dark face detection is that the gap between $H$ and $L$ is too huge and complex for existing methods to handle. As shown in Fig. 3, the images in WIDER FACE [49] and DARK FACE [50] not only have different pixel-level appearance (bright v.s. dark, clean v.s. noisy), but also contain different objects and scenes (photos, paintings v.s. street views). However, enhancement-and darkening-based methods only consider the pixel-level gap. Feature adaptation methods try to fill the whole gap in one step. But as shown Sec. 4.2, the effect is limited. + +To jointly fill both pixel-level and feature-level gaps for dark face detection, we propose a High-Low Adaptation (HLA) scheme. As shown in Fig. 2 (e), we set low-level intermediate states between $L$ and $H$ , and based on these states adapt the corresponding high-level representations. + +Specifically, the low-level distance is reduced by both enhancing and darkening. Compared with $L$ -to- $H$ or $H$ -to- $L$ unidirectional translation, our bidirectional translation: $L$ -to- $E(L)$ and $H$ -to- $D(H)$ , can not only ease the difficulty of adaptation, but also provide more tools for feature-level adaptation. The high-level distance is reduced by pushing the feature spaces of multiple states towards each other. Moreover, the feature representation is further enhanced by contrastive learning. While testing, we first process the image by $E(\cdot)$ , then apply the adapted face detector. + +The framework detail is shown in Fig. 4. In the following, we will respectively introduce the proposed low-level and high-level adaptation schemes. + +# 3.2. Bidirectional Low-Level Adaptation + +The challenge of low-level adaptation lies in two aspects. One is the co-existence of the high-level gap, which can confuse pixel-level transfer models. For example, we show the effect of some methods for transferring $H$ to $L$ in Fig. 5. Different from WIDER FACE, DARK FACE contains many street lights, vehicle highlights, and signboards. Accordingly, CUT [36] generates weird lights on human bodies, and CycleGAN [55] generates street lights on faces. MUNIT [20] can distinguish content and style, therefore has no street light artifact. However, MUNIT cannot completely darken the image, and the result is visually far from $L$ . + +The other challenge is the difficulty of low light enhancement itself. Existing low light enhancement methods are mainly designed for human vision rather than machine vision. Some methods draw black edges, keep noisy parts dark, or enhance the contrast to improve the comprehensive visual quality, which can damage the high-level detection performance. Moreover, images in DARK FACE suffer from intensive noise and color bias. However, existing denoising and color reconstruction methods are not robust enough to handle this extreme case. + +To solve the above challenges, we propose the bidirectional low-level adaptation scheme. Low light degradation is a complex process. We roughly decompose the related factors into three aspects: illumination, noise, and color + +![](images/b6cd66f5c405c2f212b45d033fef76384b13ee8533c5bc1383f5c5b05a51a433.jpg) +Joint High-Low Adaptation for Dark Face Detection + +![](images/134add06e5d751772e8996c7a02a0a8f325f45c3c16aa0469164318a536abc2c.jpg) +Bidirectional Low-Level Adaptation + +![](images/b1c531e09da2ee3fd09fb1e9c0bbc8ae1224775ca2f9e5d3cda2cac77d1230af.jpg) +Multi-Task High-Level Adaptation +Figure 4. The overview of our joint High-Low Adaptation (HLA) framework for dark face detection. Low-level adaptation fills the gap by creating intermediate states. We bidirectionally brighten the low light data as well as distort the normal light data with noise and color bias. Based on the built intermediate states, we use multi-task cross-domain self-supervised learning to fill the high-level gap. + +![](images/03446b859f83b6c0a82080d676cc5bbd421440d67144c8d9dd3898715a18ce63.jpg) +(a) WIDER FACE + +![](images/0600e1ad6c9cd515724b5d4699ede5bbeecfbf492744260f4a2d087b3d8a798e.jpg) +(b) DARK FACE + +![](images/3cfb4470f5ba80200202f5ace7d8a5433ba21c6b45c6b360d7946e55031ab898.jpg) +(c) Enhanced (b) + +![](images/39f2c1d16182664e1dee1ebf8c1ad26381db157b383e362fbdfcb1bf7d988b0d.jpg) +(d) CycleGAN + +![](images/9cb9307306581fae8895f646892f17fa3d4517254953eceefc4518e198b4f7b0.jpg) +(e) Enhanced (d) + +![](images/7ccc7507d33fee8e87d3780559d3dd9f51f3eea59d7406714cfe574e88b83679.jpg) +(f) MUNIT + +![](images/460813e187b04b750104abb28516de5097456baf37affe3982059eb0a84cd610.jpg) +(g) CUT +Figure 5. Results of transferring between WIDER FACE and DARK FACE. (b) and (d) are enhanced for better visualization. + +![](images/094c045dd31ead1e5cf5e15c25b0ba63d93e1661b01d709cbb0f5bf8c8d21a4d.jpg) +(h) Our $H_{\mathrm{noise}}$ + +![](images/b7194ed7e4a1ff2f1aa05d878e36c60ca9fc02c0b52b1ec9caeb84356652e03e.jpg) +(i) Our $E(L)$ + +bias. Although denoising and color correction is difficult, adding noise and applying color bias inversely is relatively easy. On this basis, we bright $L$ into $E(L)$ , and distort $H$ with noises and color bias to form $D(H)$ . Compared with $L$ and $H$ , $E(L)$ and $D(H)$ are more similar. In this way, we ease the difficulty of adaptation by making $L$ and $H$ take a step towards each other. Also, by formulating the specific components of low light degradation, the transfer model will not be disturbed by the semantic gap between the domains. In the following, we will introduce the detailed designs of each procedure. + +Brightening. Different from common low light enhancement tasks, here we want to adjust the illumination without denoising or color reconstruction. Moreover, low light images suffer from nonuniform illumination. Some faces may + +be brightened by street lights, while some may be covered in severe darkness. Therefore, we also need to prevent overexposure as well as under-exposure. + +Our module is based on nonlinear curve mapping [15], which is made up of iterative quadratic curves $LE(\cdot)$ : + +$$ +L E (x, A) = x + A x (1 - x), \tag {1} +$$ + +$$ +L E _ {n} = L E \left(L E _ {n - 1}; A _ {n}\right), \tag {2} +$$ + +where $LE_0$ is the input image, $LE_n$ is the result at iteration $n$ , and $A_n$ is a pixel-wise three-channel adjustment map estimated by neural networks. Compared with common end-to-end or Retinex-based deep enhancement methods, curve mapping does not introduce extra noise or artifacts. We follow [15] to use a 7-layer CNN with symmetrical skip-connections and the corresponding training objectives. + +The issue of [15] is that, the enhancement is conservative (Weak). As shown in Fig. 6 (b), many faces are still covered in darkness. This is because further enhancing the image can bring more noise, and [15] choose to hide these noises in darkness, so that the visual quality of the whole image is better. We instead propose strong illumination enhancement (Strong). By doubling the iteration number in Eq. (1) and widening the curve estimation network, the model can enhance the image with higher brightness. The drawback may be that noise and color bias come along, but we can leave it to the following $H \rightarrow D(H)$ process. This is also the difference between our enhancement module and common low light enhancement methods. + +Noise Synthesis. Although the pixel-level distance can be reduced by brightening, the gap between $E(L)$ and $H$ is still challenging. Therefore, we further decompose the gap remained into color and noise. Also, by separating out the color, we can use color to guide the noise synthesis process. + +As shown in Fig. 4, we first blur $E(L)$ by a strong Bilateral filter of $d = 25$ and $\sigma = 75$ . The blurring result $E(L)_{\text{blur}}$ works as the color guidance. Then, a Pix2Pix [22] + +![](images/ecd044ca01ee5fa6580d3a1df8703eb8f1a08c679b22e00db36e9d6ffc902a31.jpg) +(a) Input + +![](images/2616f8ddc4d193c35ac491463f2591b1b47554a523ef40920756863c93de4c29.jpg) +(b) Weak + +![](images/0ceb8084ef3049f5a573155add95e381af85ba2d98e9ba393f624c5186e7c324.jpg) +(c) Strong +Figure 6. Effects of weak and strong brightening. Compared with (c), many faces are still covered in darkness in (b). + +is trained for transferring from $E(L)_{\text{blur}}$ to $E(L)$ . Finally, we blur $H$ in the same way and use the trained Pix2Pix to add noise. As shown in Fig. 5, $H_{\text{noise}}$ successfully imitates the noise pattern of $E(L)$ . Their difference in color distribution will be handled in the next step. + +Color Jittering. We want the color distribution of $D(H)$ to match that of $E(L)$ . Based on statistical analysis, we set the jittering range to brightness: (0.4, 1.2), contrast: (0.6, 1.4), saturation: (0.6, 1.4) and hue: (0.8, 1.2). + +# 3.3. Multi-Task High-Level Adaptation + +Most feature adaptation methods are based on alignment, pseudo labeling, and adversarial learning. However, alignment and pseudo labeling cannot well handle the huge gaps, while adversarial learning is not stable. We instead fully use the natural information of the images themselves, i.e., self-supervised learning. By forcing the self-supervised learning classifiers to be shared across domains, the features are forced to be mapped into the same high dimensional subspace, therefore closing the high-level gap. + +To push $E(L)$ , $H$ and $D(H)$ towards each other, we first close $E(L) - H$ by cross-domain context-based self-supervised learning, then close $H - D(H)$ by cross-domain contrastive learning. We further enhance the representation of $E(L)$ by single-domain contrastive learning. The whole adaptation works in a multi-task way. In the following, we will introduce the details of each learning scheme. + +Closing E(L) and H. Context-based self-supervised learning designs pretext tasks, through which the model can learn to understand the spatial context of objects. Here, we use the jigsaw puzzling game [35]. We have also tried rotation [14] and combining jigsaw with rotation, but find that using jigsaw alone works the best. One possible explanation for this may be that many images in WIDER FACE are paintings or advertisements, where the faces may have strange angles. Therefore, the rotation prediction pretext task can be ambiguous. + +Similar to [3], we assemble $3 \times 3$ patches into a whole image and set the patch permutation number to 30, i.e., 30 classification problem. Denote $p_{jig}$ as the permutation label, and $\mathcal{L}_c$ as the cross-entropy loss, we have: + +$$ +\mathcal {L} _ {j i g} ^ {E (L)} = \mathcal {L} _ {c} \left(F _ {j i g} ^ {E (L)}, p _ {j i g} ^ {E (L)}\right), \tag {3} +$$ + +$$ +\mathcal {L} _ {j i g} ^ {H} = \mathcal {L} _ {c} \left(F _ {j i g} ^ {H}, p _ {j i g} ^ {H}\right), \tag {4} +$$ + +where $F_{jig}$ stands for the feature extracted from the corresponding domain. $E(L)$ and $H$ share classification heads, which can force the semantic features to be mapped into the same space, therefore closing high-level gaps. The final loss for closing $E(L)$ and $H$ is: + +$$ +\mathcal {L} _ {E (L) \leftrightarrow H} = \mathcal {L} _ {j i g} ^ {E (L)} + \mathcal {L} _ {j i g} ^ {H}. \tag {5} +$$ + +Closing H and D(H). The idea of contrastive learning is that, given a query $v$ , identifying its "positive" pair $v^{+}$ and "negatives" pairs $v^{-} = \{v_{1}^{-}, v_{2}^{-}, \dots, v_{N}^{-}\}$ . With similarity measured by dot product, the objective $\mathcal{L}_q(v, v^+, v^-)$ is: + +$$ +\mathcal {L} _ {q} = - \log \left[ \frac {\sigma (v , v ^ {+})}{\sigma (v , v ^ {+}) + \sum_ {n = 1} ^ {N} \sigma (v , v _ {n} ^ {-})} \right], \tag {6} +$$ + +$$ +\sigma (x, y) = \exp (x \cdot y / \tau), \tag {7} +$$ + +where $\tau$ is a temperature hyper-parameter. Intuitively, this is an $(N + 1)$ classification problem. + +To reduce the distance between $H$ and $D(H)$ , we take advantage of the behavior that contrastive learning brings positive samples closer. In specific, we make the positive pair of $H$ to be the patch from $D(H)$ , and vice versa: + +$$ +\begin{array}{l} \tilde {\mathcal {L}} _ {H \leftrightarrow D (H)} = \mathcal {L} _ {q} (H, D (H) ^ {+}, H ^ {-}) \\ + \mathcal {L} _ {q} (D (H), H ^ {+}, D (H) ^ {-}). \tag {8} \\ \end{array} +$$ + +In this way, the feature similarity between $H$ and $D(H)$ can be improved, and the high-level gap can be closed. + +We also introduce single-domain contrastive learning on $H$ and $D(H)$ themselves to make the features better. In the implementation, the above four losses are simplified by regarding $D(\cdot)$ as a part of the augmentation: + +$$ +\mathcal {L} _ {H \leftrightarrow D (H)} = \mathcal {L} _ {q} \left(D _ {i} ^ {*} (H), D _ {j} ^ {*} (H) ^ {+}, D _ {k} ^ {*} (H) ^ {-}\right), \tag {9} +$$ + +where $D^{*}(H)$ has a $50\%$ probability of being $H$ , and $50\%$ of being $D(H)$ . While training, we use the Momentum Contrast (MoCo) [17] and follow [5] for other settings. + +Enhancing $\mathbf{E}(\mathbf{L})$ . We also find that it is beneficial to enhance the feature on $E(L)$ by contrastive learning: + +$$ +\mathcal {L} _ {E (L) \uparrow} = \mathcal {L} _ {q} (E (L), E (L) ^ {+}, E (L) ^ {-}). \tag {10} +$$ + +Final objective. Our model learns in a multi-task way. Denote $\mathcal{L}_{det}$ as the detection loss, the final objective is: + +$$ +\begin{array}{l} \mathcal {L} = \lambda_ {d e t} \mathcal {L} _ {d e t} + \lambda_ {E (L) \leftrightarrow H} \mathcal {L} _ {E (L) \leftrightarrow H} \\ + \lambda_ {H \leftrightarrow D (H)} \mathcal {L} _ {H \leftrightarrow D (H)} + \lambda_ {E (L) \uparrow} \mathcal {L} _ {E (L) \uparrow}, \tag {11} \\ \end{array} +$$ + +where $\lambda$ s are hyper-parameters to balance different losses. + +# 4. Experimental Results + +# 4.1. Implementation Details + +Network Architecture. DSFD [26] is used as the face detection baseline. Our headers for self-supervised learning are added on the conv3_3, conv4_3, conv5_3, conv_fc7, conv6_2, and conv7_2 layers of the backbone. For more details, please refer to the supplementary material. + +Training and Evaluation Settings. All experiments are based on WIDER FACE [49] and DARK FACE [50]. Our model is allowed to use the labels of WIDER FACE, but not allowed to use the labels of DARK FACE. The framework is first pre-trained on WIDER FACE, then fine-tuned with both WIDER FACE and the images of DARK FACE. Pretraining follows the same process of [26]. For fine-tuning, the batch size is set to 8. We use SGD with 0.9 momentum and 5e-4 weight decay. The learning rate is set to 1e-4 for the first 20k iterations, and 1e-5 for another 40k iterations. Fine-tuning takes about 15 hours with two GeForce RTX 2080Ti. The testing process is the same as the original DSFD implementation. + +For DARK FACE, we use the official train/test setting, and further split 500 images from the training set for validation. Finally, there are 5500 images for training, 500 images for validation, and 4000 images for testing. Performance is measured by mean Average Precision (mAP), and evaluated with the official tool $^2$ of DARK FACE. + +# 4.2. Comparisons with State-of-the-Art Methods + +The proposed model is compared with 22 state-of-the-art methods, covering the categories of face detection, low light enhancement, image-to-image translation, and unsupervised domain adaptation. The benchmarking results are shown in Table 1 and Fig. 8. + +Face Detection. Our model is compared with seven face detectors and one generic object detector. Due to the poor visibility caused by low light conditions, existing detectors all achieve undesirable performance. As shown in Table 1, Faster-RCNN $^3$ [39] (re-trained on WIDER FACE) performs worse than detection models designed especially for faces. State-of-the-art face detection methods, SSH [34], RetinaFace [9], SRN [6], SFA [32], and PyramidBox [46] all have mAP scores less than $15\%$ , showing that insufficient illumination can greatly hurt the performance of high-level tasks. The best results here are achieved by DSFD [26] and Small Hard Faces [53], but their mAP scores are still unsatisfactory. By adapting to the dark environment, our model outperforms these detectors by a significant margin. + +Table 1. Comparison results on DARK FACE. + +
CategoryMethodmAP (%)
Face DetectionFaster-RCNN [39]1.7
SSH [34]6.9
RetinaFace [9]8.6
SRN [6]9.0
SFA [32]9.3
PyramidBox [46]12.5
Small Hard Face [53]16.1
DSFD [26]16.1
Enhancement (with Small Hard Face)Zero-DCE [15]37.7
MF [12]38.3
Enhancement (with DSFD)SICE [2]4.7
RetinexNet [48]12.0
KinD [52]15.8
EnlightenGAN † [23]20.8
EnlightenGAN [23]31.3
Zero-DCE † [15]37.3
LIME [16]40.7
Zero-DCE [15]41.3
MF [12]41.4
Darkening (with DSFD)MUNIT [20]29.7
CycleGAN [55]31.9
CUT [36]32.7
Unsupervised DA (with DSFD)OSHOT [10]25.4
Progressive DA [18]28.5
Pseudo Labeling [21]35.1
Fully SupervisedFine-tuned DSFD [26]46.0
Ours44.4
+ +$\dagger$ denotes retrained with DARKFACE. + +Enhancement. We also explore the effect of illumination adjustment, i.e., the scheme in Fig. 2 (b). We first use low light enhancement methods to enhance the DARK FACE images, then apply the face detectors. Although DSFD and Small Hard Face are comparable on original dark images, when the images are brightened, DSFD outperforms Small Hard Face by $3.35\%$ in mAP on average. This indicates that DSFD is of better robustness and generalization. Therefore, in the rest of the experiments, we use DSFD as the baseline. + +Although some low light enhancement methods can improve the performance to a large extent, some may even damage the detection performance. This is because these methods introduce more artifacts to the images. As shown in Fig. 7, SICE [2] distorts the details. KinD [52] overdenoises the images, leading to blurry edges and dull color. RetinexNet [16] instead generates weird green colors on dark regions. These three methods widen the gap between the testing images and the daytime natural photographs, therefore hurt the performance of the face detector. MF [12] and Zero-DCE [15], LIME [16] can help DSFD better recognize faces. The visual quality of their subjective results + +![](images/fcc510cbdc27c2c056bbf7aed1f45215c0171c41e2238b69b762b226cbcdddbb.jpg) +(a) Ground truth + +![](images/0e39012e377a59b3610eaead786c581ccdfc0a707e1a0e7a15e080092c3794cc.jpg) +(b) SICE + +![](images/e7bfca5ff69d25cb2c6c652dccd9d54afe7a63b32cc3b7b85e36147e8eadc05e.jpg) +(c) RetinexNet +Figure 7. Qualitative comparison of different enhancement-based methods. (a) Input low light image and the ground truth boxes. (b)-(g) Results of low-light enhancement methods with DSFD. (h) Our result. + +![](images/20ece84bfcb45c9956a7b5e2caed6cecfd780b759ca59ae2aaafe50bb156b608.jpg) +(d) KinD + +![](images/9dfeff02a5a6b8b4a6754166358331fbeb5244644107681e7582f365bd7d9643.jpg) +(e) LIME + +![](images/4bc9e60ad900a231263d80be970fb2704a86a9a5457c8c1512a98d2b02fc587b.jpg) +(f) Zero-DCE + +![](images/e266e2dcef05bf2d551d30568e4c8b87739dd187252b926c956b34a74fc77cda.jpg) +(g) MF + +![](images/6b0e9fd4fc315339c6a42156b0e28b9ac3190fa8f9dc008ba2d854f6ac285098.jpg) +(h) Ours + +![](images/f82e7af6c4a6c0ad4b6fdb6d1b32394f91359d7cb2937944628f12dc0b77db1e.jpg) +Figure 8. Precision-Recall (PR) curves on DARK FACE. + +is also better. However, compared with our model, their performance is still relatively poor. This is because when simply combining low light enhancement and face detection, the semantic gap between WIDER FACE and DARK FACE still remains. + +Darkening. Darkening-based adaptation, i.e., the scheme in Fig. 2 (c), proposes to re-train models on synthetic dark data. Specifically, we first transfer WIDER FACE to DARK FACE, then use the transferred WIDER FACE to re-train DSFD. Most darkening-based methods [30, 43] are based on the classic unsupervised image-to-image translation model CycleGAN [55]. We also test more powerful MUNIT [20], and the newest CUT [36]. + +Quantitative and qualitative results can be found in Fig. 5 and Table 1, respectively. Although MUNIT is more powerful than CycleGAN, the effect of benefitting dark face detection is worse. This is because MUNIT cannot fully darken the image as shown in Fig. 5 (f). In Fig. 5 (d) and (e), although the result of CycleGAN looks like night street views at the first glance, after enhancing the image, we can see that CycleGAN actually distorts the details and puts street light on faces. CUT generates less artifact than CycleGAN, therefore the mAP score is higher. However, compared with our model, the performances of darkening-based methods are all unsatisfactory. This demonstrates our + +Table 2. Comparison with Top 10 teams (with labels) in the $\mathrm{{UG}}{}^{2}$ Prize Challenge. Scores are copied from the official website. + +
RankTeam NamemAP (%)
1CAS-Newcastle-TUM62.45
2CAS-NEU61.84
-Ours44.44
3MSFace42.71
4iie40.49
5NTU-MiRA37.50
6DUTMedia35.65
7SCUT-CVC35.18
8IIAI VOS34.73
9USTC-NELSLIP32.81
10PHI-AI29.95
+ +assumption that the gap between normal and low light is too huge and complex for pixel-level transfer models to handle. + +Unsupervised Domain Adaptation. Most UDA methods are based on Faster-RCNN, which performs too poor on face detection as shown in Table 1. For a fair comparison, we re-implement all compared UDA methods with DSFD. + +OSHOT [10] directly closes the gap by self-supervised learning of rotation angle prediction. It is originally designed for one-shot adaptation. We change it into fine-tuning on the whole DARK FACE. The performance of OS-HOT is poor. This is because the gap between normal light and low light faces is too huge to be handled by feature adaptation. Pseudo Labeling [21] is a two-step progressive UDA method. It first uses CycleGAN to artificially generate training data, then uses pseudo labels to fine-tune the detector. Compared with directly training on images synthesized by CycleGAN, the performance improves from $31.9\%$ to $35.1\%$ in mAP, demonstrating the effectiveness of pseudo labels. However, the mAP is still less than $40\%$ . Progressive DA [18] combines pixel-level transferring and feature-level adversarial learning. But adversarial learning still cannot close the huge gap between normal and low light domains. + +With Dark Annotations. Our model is also compared with face detection methods that have access to the labels of DARK FACE. The result of fine-tuning DSFD with labels is shown in Table 1. We can see that our model is + +Table 3. Ablation study results on DARK FACE. † denotes using the pyramid multi-scale testing scheme in DSFD. + +
E(·)E(L) ↔ HH ↔ D(H)E(L) ↑mAP (%)
----15.3
Weak---38.3
Strong---39.1
-Rotation--22.7
-Jigsaw--26.9
-Rot + Jig--25.3
Strong-Pseudo labels-40.2
Strong-H only-38.2
Strong-Cross-domain-40.9
StrongJigsaw--40.2
Strong-Cross-domain✓41.1
StrongJigsawCross-domain✓41.4
StrongJigsawCross-domain✓44.4 †
+ +much closer to the supervised learning upper bound $46.0\%$ in mAP, demonstrating the effectiveness of our adaptation framework. We also show the leader board of the $\mathrm{UG^2}$ Prize Challenge4 in Table 2, where our model outperforms most of the teams. Notice that the teams in $\mathrm{UG^2}$ are allowed to use labels for training, while our model uses no DARK FACE annotations. + +# 4.3. Ablation Studies + +To support our motivation and the joint high-low adaptation framework, in this section, we analyze the effect of each technical design. The results are shown in Table 3. + +Effectiveness of $\mathbf{E}(\mathbf{L})$ . Enhancing the testing images can improve the performance from $15.3\%$ to $39.1\%$ in mAP. Compared with the baseline (Weak), the performance of our $E(L)$ is higher by $0.8\%$ , supporting our proposed strong enhancement. + +Effectiveness of $\mathbf{E}(\mathbf{L})\leftrightarrow \mathbf{H}$ . We show the effect of different choices of context-based self-supervised learning for closing $E(L)$ and $H$ . Using jigsaw alone works the best. Adding rotation can damage the performance. As we mentioned in Sec. 3.3, since many images in WIDER FACE are paintings or advertisements, the rotation angle prediction pretext task can be ambiguous. As shown in Table 4, the rotation top-1 classification accuracy on WIDER FACE is only slightly over random guess. In comparison, although the jigsaw pretext task is a 30-class problem, the top-1 accuracies are higher than $85\%$ . We also notice that for both jigsaw and rotation, the performance on DARK FACE is higher than that on WIDER FACE. This is because the images in WIDER FACE are more diverse. + +Table 4. Top-1 classification accuracy of jigsaw and rotation self-supervised learning pretext tasks in different domains. + +
LayerJig, E(L)Jig, HRot, E(L)Rot, H
conv3_397.5%80.6%19.2%15.4%
conv4_398.9%87.8%33.6%26.2%
conv5_399.0%89.6%51.2%36.7%
conv_fc799.3%89.7%54.9%33.5%
conv6_299.3%89.7%51.2%28.3%
conv7_299.3%90.0%41.8%19.3%
average98.9%87.9%42.0%26.6%
+ +Effectiveness of $\mathbf{H} \leftrightarrow \mathbf{D}(\mathbf{H})$ . We further explore the strategy for closing $H$ and $D(H)$ . The proposed cross-domain contrastive learning scheme $\mathcal{L}_{H \leftrightarrow D(H)}$ can improve the mAP score by $1.8\%$ . If we only use contrastive learning on $H$ , the performance even drops from $39.1\%$ to $38.2\%$ . This is because if we enhance features only in $H$ , the detection model will concentrate more on $H$ , therefore increasing the distance between $H$ and $E(L)$ . The result also supports our design of cross-domain contrastive learning and the necessity of setting the intermediate domain $D(H)$ . + +Contrastive learning can be regarded as a kind of "soft" label. Naturally, we wonder about the effect of "hard" label. We test the result of directly training with transferred labels on $D(H)$ , i.e., pseudo labeling. The mAP can be improved from $39.1\%$ to $40.2\%$ , but the improvement is smaller than using our contrastive learning. This is because representation learning based on "soft" labels can avoid the inaccuracy of manual annotations and better refine the features. + +Combination Effect. Finally, we demonstrate the combination effect of our design. Enhancing the feature on $E(L)$ ( $\mathcal{L}_{E(L)\uparrow}$ ) can further improve the mAP score. The full version of our model achieves the best performance, demonstrating the effectiveness of our joint high-level and low-level adaptation framework. + +DSFD uses a pyramid multi-scale testing scheme. Although it can improve the performance, the running time increases from 1.25 hours to 10 hours. Even without this multi-scale scheme, i.e., using a more weak face detection baseline, the performance of our model (41.4% in mAP) can still outperform most of the state-to-the-arts in Table 1. + +# 5. Conclusion + +We design a joint high-level and low-level adaptation framework for dark face detection. We propose a bidirectional pixel translation pipeline for the low level, and a multi-task adaptation strategy based on self-supervised learning for the high level. Our framework demonstrates the potential of joint high-low adaptation and can inspire other related low light high-level vision tasks. + +# References + +[1] Vinicius F. Arruda, Thiago M. Paixão, Rodrigo Ferreira Berriel, Alberto F. De Souza, Claudine Badue, Nicu Sebe, and Thiago Oliveira-Santos. Cross-domain car detection using unsupervised image-to-image translation: From day to night. In IJCNN, 2019. 3 +[2] Jianrui Cai, Shuhang Gu, and Lei Zhang. Learning a deep single image contrast enhancer from multi-exposure images. IEEE TIP, 27(4):2049-2062, 2018. 2, 6 +[3] Fabio Maria Carlucci, Antonio D'Innocente, Silvia Bucci, Barbara Caputo, and Tatiana Tommasi. Domain generalization by solving jigsaw puzzles. In CVPR, 2019. 5 +[4] Chen Chen, Qifeng Chen, Jia Xu, and Vladlen Koltun. Learning to see in the dark. In CVPR, 2018. 2 +[5] Xinlei Chen, Haoqi Fan, Ross B. Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. CoRR, abs/2003.04297, 2020. 5 +[6] Cheng Chi, Shifeng Zhang, Junliang Xing, Zhen Lei, Stan Z. Li, and Xudong Zou. Selective refinement network for high performance face detection. In AAAI, 2019. 6 +[7] Se Woon Cho, Na Rae Baek, Ja Hyung Koo, Muhammad Arsalan, and Kang Ryoung Park. Semantic segmentation with low light images by modified cyclegan-based image enhancement. IEEE Access, 8:93561-93585, 2020. 3 +[8] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, 2016. 2 +[9] Jiankang Deng, Jia Guo, Yuxiang Zhou, Jinke Yu, Irene Kotsia, and Stefanos Zafeiriou. Retinaface: Single-stage dense face localisation in the wild. CoRR, abs/1905.00641, 2019. 6 +[10] Antonio D'Innocente, Francesco Cappio Borlino, Silvia Bucci, Barbara Caputo, and Tatiana Tommasi. One-shot unsupervised cross-domain detection. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, ECCV, 2020. 6, 7 +[11] Xuan Dong, Guan Wang, Yi Pang, Weixin Li, Jiangtao Wen, Wei Meng, and Yao Lu. Fast efficient algorithm for enhancement of low lighting video. In ICME, 2011. 2 +[12] Xueyang Fu, Delu Zeng, Yue Huang, Yinghao Liao, Xing-hao Ding, and John W. Paisley. A fusion-based enhancing method for weakly illuminated images. Signal Process., 129:82-96, 2016. 2, 6 +[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., 17:59:1-59:35, 2016. 3 +[14] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In ICLR, 2018. 5 +[15] Chunle Guo, Chongyi Li, Jichang Guo, Chen Change Loy, Junhui Hou, Sam Kwong, and Runmin Cong. Zero-reference deep curve estimation for low-light image enhancement. In CVPR, 2020. 2, 4, 6 +[16] Xiaojie Guo, Yu Li, and Haibin Ling. LIME: low-light image enhancement via illumination map estimation. IEEE TIP, + +26(2):982-993, 2017. 1, 2, 6 +[17] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 5 +[18] Han-Kai Hsu, Chun-Han Yao, Yi-Hsuan Tsai, Wei-Chih Hung, Hung-Yu Tseng, Maneesh Kumar Singh, and Ming-Hsuan Yang. Progressive domain adaptation for object detection. In WACV, 2020. 6, 7 +[19] Peiyun Hu and Deva Ramanan. Finding tiny faces. In CVPR, 2017. 2 +[20] Xun Huang, Ming-Yu Liu, Serge J. Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, ECCV, 2018. 3, 6, 7 +[21] Naoto Inoue, Ryosuke Furuta, Toshihiko Yamasaki, and Kiyoharu Aizawa. Cross-domain weakly-supervised object detection through progressive domain adaptation. In CVPR, 2018. 2, 3, 6, 7 +[22] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. 4 +[23] Yifan Jiang, Xinyu Gong, Ding Liu, Yu Cheng, Chen Fang, Xiaohui Shen, Jianchao Yang, Pan Zhou, and Zhangyang Wang. Enlightengan: Deep light enhancement without paired supervision. IEEE TIP, 30:2340-2349, 2021. 6 +[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. 2 +[25] Hongjun Lee, Moonsoo Ra, and Whoi-Yul Kim. Nighttime data augmentation using GAN for improving blind-spot detection. IEEE Access, 8:48049-48059, 2020. 3 +[26] Jian Li, Yabiao Wang, Changan Wang, Ying Tai, Jianjun Qian, Jian Yang, Chengjie Wang, Jilin Li, and Feiyue Huang. DSFD: dual shot face detector. In CVPR, 2019. 1, 6 +[27] Jinxiu Liang, Jingwen Wang, Yuhui Quan, Tianyi Chen, Jiaying Liu, Haibin Ling, and Yong Xu. Recurrent exposure generation for low-light face detection. CoRR, abs/2007.10963, 2020. 1 +[28] Tsung-Yi Lin, Piotr Dólar, Ross B. Girshick, Kaiming He, Bharath Hariharan, and Serge J. Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 2 +[29] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. In ICCV, 2017. 2 +[30] Tong Liu, Zhaowei Chen, Yi Yang, Zehao Wu, and Haowei Li. Lane detection in low-light conditions using an efficient data enhancement: Light conditions style transfer. CoRR, abs/2002.01177, 2020. 7 +[31] Yuen Peng Loh and Chee Seng Chan. Getting to know low-light images with the exclusively dark dataset. Comput. Vis. Image Underst., 178:30-42, 2019. 2 +[32] Shi Luo, Xiongfei Li, Rui Zhu, and Xiaoli Zhang. SFA: small faces attention face detector. IEEE Access, 7:171609-171620, 2019. 6 +[33] Xiang Ming, Fangyun Wei, Ting Zhang, Dong Chen, and Fang Wen. Group sampling for scale invariant face detection. In CVPR, 2019. 2 +[34] Mahyar Najibi, Pouya Samangouei, Rama Chellappa, and Larry S. Davis. SSH: single stage headless face detector. In + +ICCV, 2017. 6 +[35] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, ECCV, 2016. 5 +[36] Taesung Park, Alexei A. Efros, Richard Zhang, and JunYan Zhu. Contrastive learning for unpaired image-to-image translation. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, ECCV, 2020. 3, 6, 7 +[37] S. M. Pizer, R. E. Johnston, J. P. Ericksen, B. C. Yankaskas, and K. E. Muller. Contrast-limited adaptive histogram equalization: speed and effectiveness. In Conference on Visualization in Biomedical Computing, pages 337-345, 1990. 2 +[38] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett, editors, NeurIPS, 2015. 2 +[39] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett, editors, NeurIPS, pages 91-99, 2015. 6 +[40] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. IEEE TPAMI, 39(6):1137-1149, 2017. 2 +[41] Kuniaki Saito, Yoshitaka Ushiku, Tatsuya Harada, and Kate Saenko. Strong-weak distribution alignment for adaptive object detection. In CVPR, 2019. 2 +[42] Christos Sakaridis, Dengxin Dai, and Luc Van Gool. Semantic foggy scene understanding with synthetic data. IJCV, 126(9):973-992, 2018. 2 +[43] Christos Sakaridis, Dengxin Dai, and Luc Van Gool. Guided curriculum model adaptation and uncertainty-aware evaluation for semantic nighttime image segmentation. In ICCV, pages 7373-7382. IEEE, 2019. 3, 7 +[44] Yukihiro Sasagawa and Hajime Nagahara. Yolo in the dark - domain adaptation method for merging multiple models -. ECCV, 2020. 2 +[45] Baochen Sun and Kate Saenko. Deep CORAL: correlation alignment for deep domain adaptation. In Gang Hua and Hervé Jégou, editors, ECCV, 2016. 3 +[46] Xu Tang, Daniel K. Du, Zeqiang He, and Jingtuo Liu. Pyramidbox: A context-assisted single shot face detector. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, ECCV, 2018. 6 +[47] Paul A. Viola and Michael J. Jones. Robust real-time face detection. IJCV, 57(2):137-154, 2004. 2 +[48] Chen Wei, Wenjing Wang, Wenhan Yang, and Jiaying Liu. Deep retina decomposition for low-light enhancement. In BMVC, 2018. 2, 6 +[49] Shuo Yang, Ping Luo, Chen Change Loy, and Xiaou Tang. WIDER FACE: A face detection benchmark. In CVPR, 2016. 1, 3, 6 +[50] Wenhan Yang, Ye Yuan, Wenqi Ren, Jiaying Liu, Walter J. Scheirer, Zhangyang Wang, Taiheng Zhang, Qiaoyong Zhong, Di Xie, Shiliang Pu, Yuqiang Zheng, Yanyun Qu, Yuhong Xie, Liang Chen, Zhonghao Li, Chen Hong, + +Hao Jiang, Siyuan Yang, Yan Liu, Xiaochao Qu, Pengfei Wan, Shuai Zheng, Minhui Zhong, Taiyi Su, Lingzhi He, Yandong Guo, Yao Zhao, Zhenfeng Zhu, Jinxiu Liang, Jingwen Wang, Tianyi Chen, Yuhui Quan, Yong Xu, Bo Liu, Xin Liu, Qi Sun, Tingyu Lin, Xiaochuan Li, Feng Lu, Lin Gu, Shengdi Zhou, Cong Cao, Shifeng Zhang, Cheng Chi, Chubin Zhuang, Zhen Lei, Stan Z. Li, Shizheng Wang, Ruizhe Liu, Dong Yi, Zheming Zuo, Jianning Chi, Huan Wang, Kai Wang, Yixiu Liu, Xingyu Gao, Zhenyu Chen, Chang Guo, Yongzhou Li, Huicai Zhong, Jing Huang, Heng Guo, Jianfei Yang, Wenjuan Liao, Jiangang Yang, Liguo Zhou, Mingyue Feng, and Likun Qin. Advancing image understanding in poor visibility environments: A collective benchmark study. IEEE TIP, 29:5737-5752, 2020. 1, 2, 3, 6 +[51] Shifeng Zhang, Xiangyu Zhu, Zhen Lei, Hailin Shi, Xiaobo Wang, and Stan Z. Li. S~3fd: Single shot scale-invariant face detector. In ICCV, 2017. 2 +[52] Yonghua Zhang, Jiawan Zhang, and Xiaojie Guo. Kindling the darkness: A practical low-light image enhancer. In ACM MM, 2019. 1, 2, 6 +[53] Zhishuai Zhang, Wei Shen, Siyuan Qiao, Yan Wang, Bo Wang, and Alan L. Yuille. Robust face detection via learning small faces on hard images. In WACV, 2020. 6 +[54] Chenchen Zhu, Ran Tao, Khoa Luu, and Marios Savvides. Seeing small faces from robust anchor's perspective. In CVPR, 2018. 2 +[55] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 3, 6, 7 \ No newline at end of file diff --git a/hlafacejointhighlowadaptationforlowlightfacedetection/images.zip b/hlafacejointhighlowadaptationforlowlightfacedetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6c3ddaa7b477666f0aea49b4028794067921fa01 --- /dev/null +++ b/hlafacejointhighlowadaptationforlowlightfacedetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee286852c7f8445f6a413db87530c4bc5f265a19b5b2c1d98154fb6b81a786e5 +size 607061 diff --git a/hlafacejointhighlowadaptationforlowlightfacedetection/layout.json b/hlafacejointhighlowadaptationforlowlightfacedetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..581480114e77bae295b3a6071b14e57a905d7d6a --- /dev/null +++ b/hlafacejointhighlowadaptationforlowlightfacedetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d23f7af67d60870b0a28a1f13a91d0eec70f8f35541156d5e319d449c37ad747 +size 526787 diff --git a/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_content_list.json b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..25a46102b04bbc25a6a3ab9d8d47d38e3b76fe73 --- /dev/null +++ b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43bff2b23513670ed2c2fef5dd7222e4bc603328e5fb8919abb0cd657a30282b +size 78063 diff --git a/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_model.json b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e49ef81d478865b25d22b50cc240f67f394fae05 --- /dev/null +++ b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f8d4e71be8d7e5a0873f70972b0eb9c37310237b02db5c08575edb0d684dd7 +size 95298 diff --git a/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_origin.pdf b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d92d8be58d754838d0263ab9cf58c98c5210727a --- /dev/null +++ b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/95e85f56-611d-4765-9970-efad86b02c9b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:073f29ff26d228a069ae4e419964b9f40b76ba34f5be9429a95efe270d7fd786 +size 1922678 diff --git a/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/full.md b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fd8374196ecdb14c04ffd52e9f1eb09783cc2f1a --- /dev/null +++ b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/full.md @@ -0,0 +1,284 @@ +# HoHoNet: 360 Indoor Holistic Understanding with Latent Horizontal Features + +Cheng Sun $^{1,2}$ + +chengsun@gapp.nthu.edu.tw + +Min Sun1,3 + +sunmin@ee.nthu.edu.tw + +Hwann-Tzong Chen $^{1,4}$ + +htchen@cs.nthu.edu.tw + +# Abstract + +We present HoHoNet, a versatile and efficient framework for holistic understanding of an indoor 360-degree panorama using a Latent Horizontal Feature (LHFeat). The compact LHFeat flattens the features along the vertical direction and has shown success in modeling per-column modality for room layout reconstruction. HoHoNet advances in two important aspects. First, the deep architecture is redesigned to run faster with improved accuracy. Second, we propose a novel horizon-to-dense module, which relaxes the per-column output shape constraint, allowing per-pixel dense prediction from LHFeat. HoHoNet is fast: It runs at 52 FPS and 110 FPS with ResNet-50 and ResNet-34 backbones respectively, for modeling dense modalities from a high-resolution $512 \times 1024$ panorama. HoHoNet is also accurate. On the tasks of layout estimation and semantic segmentation, HoHoNet achieves results on par with current state-of-the-art. On dense depth estimation, HoHoNet outperforms all the prior arts by a large margin. Code is available at https://github.com/sunset1995/HoHoNet. + +# 1. Introduction + +Panoramic images can capture the complete $360^{\circ}$ FOVs in one shot to provide a wide range of context that facilitates scene understanding [29]. As omnidirectional cameras become more easily accessible and several large-scale panorama datasets have been released, a growing number of techniques are developed for tasks of panoramic scene modeling such as semantic segmentation [9, 16, 28], depth estimation [13, 24, 27], layout reconstruction [21, 26, 33], and indoor real-time navigation [3]. + +This paper aims to address the problem of holistic scene modeling from a single high-resolution equirectangular projection (ERP) image that captures the $360^{\circ}$ panorama. We present HoHoNet as an efficient, effective, and versatile framework to achieve this goal (Fig. 1). The input ERP + +![](images/e00ad5f6d0b2e4ee4046c9b810045be73a325148de4cdb673cf727687b0d9208.jpg) +Figure 1: One framework for all: HoHoNet is a novel deep learning framework for modeling layout structure, dense depth, and semantic segmentation through a Latent Horizontal Feature representation (LHFeat) whose height dimension is flattened. The proposed horizon-to-dense (h2d) module can produce dense predictions from the compact LHFeat. + +image is first passed through a CNN backbone for feature pyramid extraction, and then a proposed efficient height compression module encodes the feature pyramid into a Latent Horizontal Feature representation (LHFeat) whose height dimension is flattened. Finally, from LHFeat, the HoHoNet framework can yield both per-column and per-pixel modalities with state-of-the-art quality. + +Our way of encoding ERP images into LHFeat is inspired by Sun et al. [21]. However, their model is only applicable to tasks of predicting per-column modalities (e.g., corners or boundaries of layout), which constrains its feasibility in other scenarios requiring per-pixel predictions. We show that LHFeat can flexibly encode latent features for recovering the target 2D per-pixel modalities, based on our observation of the strong regularity between human-made structures and gravity aligned $y$ -axis of ERP images (Fig. 2). + +In HoHoNet we introduce a new horizon-to-dense (h2d) module for recovering 2D per-pixel modalities while maintaining the efficiency of overall framework (Fig. 1). A naive method is to treat the channel dimension of horizontal prediction as height and apply a linear interpolation if + +required. However, this requires the shallow Conv1D layers to disentangle the row-dependent information from the row-independent LHFeat. The spatial (the row) blended essence of LHFeat motivates us to model dense information in the frequency domain, and we resort to the discrete cosine transform (DCT) for its long-standing applications in data compression. By replacing linear interpolation with IDCT, we are able to improve the dense prediction results. With our horizon-to-dense module, the efficiently encoded LHFeat can now model dense modalities. + +We summarize the key merits and contributions of HoHoNet for holistic scene modeling from a $360^{\circ}$ image. + +- Fast. HoHoNet can yield dense modalities for a high-resolution $512 \times 1024$ panorama at 52 FPS and 110 FPS with ResNet-50 and ResNet-34 respectively. +- Versatile. Our method relaxes the final prediction space upon the compact LHFeat from $\mathcal{O}(W)$ to the most common $\mathcal{O}(HW)$ , capable of modeling layout, dense depth, and semantic segmentation. +- Accurate. The performances of HoHoNet on semantic segmentation and layout reconstruction are on par with the recent state-of-the-art. On dense depth estimation, HoHoNet outperforms prior arts by a margin. + +# 2. Related work + +Indoor 360 datasets. Scene modeling on $360^{\circ}$ images is a topic with a growing number of researches recently. Several 360 datasets are released to facilitate the learning-based methods. Stanford2D3D [1] and Matterport3D [2] datasets are currently the two largest real-world indoor 360 datasets with various modalities being provided. To model the higher level indoor structure, human-annotated layout datasets [25, 26, 29, 32, 33] are constructed with more data and topology. Structured3D [30] is a recently published photorealistic 360 dataset with abundant data and structure annotations from virtual environments. In this work, we focus on real-world datasets to model depth, semantic, and layout modalities. + +Input 360 format. Three standard 360 input formats are commonly used in the literature—i) equirectangular projection (ERP), ii) multiple perspective projections, and iii) icosahedron mesh. ERP preserves all captured information in one image, but it also introduces distortion that might degrade the performance of the conventional convolution layer designed for perspective imagery. A number of variants of convolution layers [6, 7, 19, 20, 22] have been proposed to address the issue of ERP distortion. Projecting the $360^{\circ}$ signal to multiple planar images makes it applicable to use classical CNNs with plenty of pre-trained models available, but the FOV of each view is limited. Several padding [4, 24] and view sampling [9] strategies are proposed to deliver context information between views. Recently, a few approaches + +![](images/42f5ed9d66bbdbfa25bdbdb2880f18d2020fcecba836cce35907d73cd544f0bd.jpg) +(a) Aligned 360. + +![](images/a55fd2016c98182af2fee2b2a500e35bc54563c2a55a25e05832bc35ca3d1b0d.jpg) +(b) Roll rotation. + +![](images/a3c9205e8f97bcd652069d193df63dc625d1f6ca34997abbb33102ee836da1cc.jpg) +(c) Pitch rotation. + +![](images/b86b8011d8fce54e62eb22640769be58d30de0ddad3737c73d572a7b6e1c1126.jpg) +(d) Gravity-aligned 360 image columns are easier to compress. +Figure 2: We show that the structure information of an image column can be better kept in compression when the $y$ -axis of the image is gravity aligned. We sample 1000 depth maps from Structured3D [30] dataset for the statistic. A $512 \times 1024$ depth map is compressed to $16 \times 1024$ via discrete cosine transform with high frequency truncated, which is applied to each column separately. We measure the absolute error between the original depth and the inverse transformed one. + +propose to represent the omnidirectional input via icosahedron mesh for scene modeling [16, 28]. In this work, our model takes ERP as the $360^{\circ}$ input format and apply classical convolution layers directly. Although we speculate that incorporating distortion-aware techniques into our model with extra computational overheads could potentially improve performance, for the sake of simplicity and efficiency, we do not digress to pursue in that direction as the proposed method already achieves state-of-the-art performance. + +Depth estimation on 360 imagery. To model depth on omnidirectional imagery, OmniDepth [31] designs encoder-decoder architectures considering the ERP distortion. PanoPopups [8] shows that learning 360 depth with plane-aware loss is beneficial in the synthetic environment. Recent works on panorama dense depth estimation propose to jointly learn from different projections [24] or different modalities [13, 27]. In contrast to most recent methods [13, 24, 27] that employ multiple backbones with cascaded training stages, HoHoNet consists of only one backbone and is trained in only one stage. Besides, HoHoNet models dense depth through the compact LHFeat while the prior arts estimate depth from conventional dense features. + +Semantic segmentation on 360 imagery. Semantic segmentation is a fundamental task for scene modeling. DistConv [22] proposes a distortion-aware deformable convolu + +![](images/67abfd1291c8296843062b19d91cbbc9e35ac6d077db49ac2bcd06acd5cc7b25.jpg) +Figure 3: An overview of the HoHoNet framework for dense depth estimation. (a) A high-resolution panorama is first processed by the backbone (e.g., ResNet). (b) The feature pyramid is then squeezed and fused by the proposed Efficient Height Compression (EHC) module, with a Multi-Head Self-Attention (MHSA) for refinement (detailed in Sec. 3.2). Note that the resulting LHFeat is compact (e.g., it is $\mathbb{R}^{256\times 1024}$ if the input image is $\mathbb{R}^{3\times 512\times 1024}$ ), enabling the overall network to run much faster than conventional encoder-decoder networks for dense features. (c) Finally, 1D convolution layers are employed to yield the final prediction. We find that predicting in DCT frequency domain brings about superior results, so we apply IDCT to the prediction of each column (detailed in Sec. 3.4). Sec. 3 and supplementary material contain more architectural details. + +tion layer for dense depth and semantic prediction on ERP images. Most of the recent methods for 360 semantic segmentation design a trainable layer operating on representation related to icosahedral mesh [5, 12, 16, 28]. However, all methods above run on a relatively low resolution for the panoramic signal. Tangent images [9] project omnidirectional signals to multiple planar images tangent to a subdivided icosahedron, which allows to process high-resolution panoramas and to deploy the pre-trained weights on perspective images. Similar to [9], HoHoNet can also operate on a high-resolution image, which is shown to be an essential factor in achieving better semantic segmentation accuracy. In contrast to the recent methods, HoHoNet runs on ERP images directly, and the highly optimized deep-learning library can easily implement all our operations. + +Latent horizontal features (LHFeat). HoHoNet is closely related to HorizonNet [21] on the motivation of using 1D features. However, HorizonNet only tackles a specific layout reconstruction task and can only predict horizontal modalities. We design a new architecture for encoding the LHFeat with much better speed and accuracy, and, importantly, we relax the constraint on output space via the proposed horizon-to-dense module, which enables dense-modality holistic scene modeling. We show that the compact LHFeat can be effectively applied to more tasks including dense depth estimation and semantic segmentation. + +# 3. Approach + +# 3.1. Framework overview + +An overview of the proposed framework is depicted in Fig. 3. We describe the details below. + +Input 360 image. We use the standard equirectangular projection (ERP) for $360^{\circ}$ images. The resolution of input ERP images, $H_{\mathrm{inp.}} \times W_{\mathrm{inp.}}$ , is a hyperparameter, and we set it according to the standard practice of each benchmark. We show in Fig. 2 that the structure signals of an image + +column are preserved better after compression if the gravity direction is aligned with the image's $y$ -axis, which is also a desirable property for our framework to encode a column into a latent vector. In this work, the 360 data provided by the benchmarks are mostly well-aligned, so we do not apply any pre-processing. Future applications could consider using the IMU sensor or 360 VP detection algorithm [29, 32] to pre-process and align the input for better robustness. + +Backbone. We adopt ResNet [10], and the intermediate features from the four ResNet stages form the feature pyramid— $\{\mathbb{R}^{C_{\ell}\times H_{\ell}\times W_{\ell}}\}_{\ell = 1,2,3,4}$ where $H_{\ell} = \frac{H_{\mathrm{inp}}}{2^{\ell + 1}}$ , $W_{\ell} = \frac{W_{\mathrm{inp}}}{2^{\ell + 1}}$ and $C_\ell$ is the latent dimension of ResNet. + +Extracting latent horizontal features (LHFeat). We propose an efficient height compression (EHC) module to extract the LHFeat $\mathbb{R}^{D\times W_1}$ from the backbone's feature pyramid. We detail the EHC module in Sec. 3.2. + +Predicting modalities. We use $N$ in this work to denote the number of target channels for a task (e.g., $N$ is set to 1 for depth estimation and is set to the number of classes for semantic segmentation). Given the LHFeat $\mathbb{R}^{D\times W_1}$ , we show how HoHoNet predicts 1D output $\mathbb{R}^{N\times W_{\mathrm{inp}}}$ in Sec. 3.3. In Sec. 3.4, we propose the first method to yield 2D dense prediction $\mathbb{R}^{N\times H_{\mathrm{inp}}\times W_{\mathrm{inp}}}$ from the compact LHFeat, which widely extends the potential applications of the proposed efficient framework. + +# 3.2. EHC module for LHFeat + +The proposed efficient height compression (EHC) module is illustrated in Fig. 4. We first employ EHC blocks to squeeze the height of each 2D feature from the backbone's pyramid. The resulting 1D features are then simply fused by summation. Within the EHC block, the input 2D features are first processed by a Conv2D block for channel reduction, and then the spatial width is upsampled to $W_{1}$ if needed, and finally, another Conv2D block refines the upsampled features. To efficiently reduce the feature height to 1, we + +![](images/3af359c9c8fa961491d63604edf6ee1949a6a434ab3b6593ad3815748588c628.jpg) +Figure 4: The proposed efficient height compression (EHC) module. The sizes of 2D and 1D features are denoted as $[C, H, W]$ and $[C, W]$ respectively. The ConvSqueezeH layer is a depthwise convolution layer with kernel size set to the prior known input feature height without padding, which produces output feature height 1. See Sec. 3.2 for details. + +design the ConvSqueezeH layer, a depthwise convolution layer with kernel size set to $(h,1)$ to cover full feature height without padding. Note that the parameter $h$ of each EHC block is automatically pre-computed given $H_{\mathrm{inp}}$ . Finally, a Conv2D layer converts the number of channels to LHFeat's latent size $D$ , and the height dimension is simply discarded as it is already reduced to 1 by the ConvSqueezeH layer. + +To further refine the initial LHFeat, the similar prior work [21] adopts bidirectional LSTM [11] for horizontal prediction. We find the recurrent layer accounts for $22\%$ of our deep net processing time, so we employ multi-head self-attention [23] (MHSA) instead. Our results show that MHSA runs faster and improves accuracy more. + +# 3.3. Predicting 1D per-column modalities + +The target modality of some applications can be formulated into per-column prediction instead of the conventional per-pixel format. An example in this regard has been shown by Sun et al. [21] for layout estimation. To predict the 1D modalities, we first upsample the horizontal features from $\mathbb{R}^{D\times W_1}$ to $\mathbb{R}^{D\times W_{\mathrm{inp}}}$ . and apply three Conv1D layers of kernel size 3, 3, and 1 respectively with BN, ReLU in between. The last layer yields the final prediction in $\mathbb{R}^{N\times W_{\mathrm{inp}}}$ . + +# 3.4. Predicting 2D per-pixel modalities + +The strategy of shaping output space into per-column format does not apply to tasks that involve per-pixel modalities. Here we present the horizon-to-dense module of HoHoNet to derive dense prediction $\mathbb{R}^{N\times H_{\mathrm{inp.}}\times W_{\mathrm{inp.}}}$ from the compact LHFeat $\mathbb{R}^{D\times W_1}$ . This functionality opens the door to a more common scenario for various applications. + +The trainable layers for 2D modality prediction are almost the same as the layers for 1D prediction introduced in Sec. 3.3 except that the number of channels in the output + +![](images/044074f13e7b28e9d9fce7262df99cfb2d2bcaf484d0a6e565e442c82f29fc57.jpg) +Figure 5: The predictions at each column act as the weights for the linear combination of components in basis $M$ . HoHoNet learns to predict in the spatial domain if $M$ implements linear interpolation, and learns in the frequency domain if $M$ implements IDCT. See Sec. 3.4 for details. + +layer is augmented to $E = N \cdot r$ where $N$ is the number of target channels for a task and $r$ is the number of components shared by a image column. The produced prediction is then reshaped from $\mathbb{R}^{E \times W_{\mathrm{inp}}}$ to $\mathbb{R}^{N \times r \times W_{\mathrm{inp}}}$ . We present two different operations to recover $\mathbb{R}^r$ back to $\mathbb{R}^{H_{\mathrm{inp}}}$ for each column depending on the physical meaning we assign to the $r$ predicted values. + +Interpolation. The simplest way is to view the latent dimension $r$ as the output height and apply linear interpolation to resize $r$ to $H_{\mathrm{inp}}$ . If $r < H_{\mathrm{inp}}$ + +Inverse discrete cosine transform (IDCT). Inspired by the application of the DCT in image compression for its energy compaction property, we view the $r$ predicted values as if they are in the DCT frequency domain with higher frequencies being truncated. In this case, we can apply IDCT to recover the low-pass signal back to the original signal. Let $x = [x_{n}]_{n = 0}^{r - 1}\in \mathbb{R}^{r}$ be the prediction; the final output $X = [X_{m}]_{m = 0}^{H - 1}\in \mathbb{R}^{H}$ can be recovered by + +$$ +X _ {m} = \frac {x _ {0}}{2} + \sum_ {n = 1} ^ {r - 1} x _ {n} \cos \left[ \frac {\pi}{H} n \left(m + \frac {1}{2}\right) \right]. \tag {1} +$$ + +A unified view. We can put the two aforementioned operations into a unified view of matrix multiplication as $X = Mx$ where $x \in \mathbb{R}^r$ , $X \in \mathbb{R}^H$ , and $M \in \mathbb{R}^{H \times r}$ consisting of $r$ orthogonal column vectors. Depending on the choice of basis, this unified view can implement linear interpolation or IDCT, as shown in Fig. 5. + +We find that IDCT constantly outperforms linear interpolation. We elaborate the intuition as follows. The LHFeat blends the spatial-row information (as described in Sec. 3.2), so training the last layers to disentangle the row-dependent dense modality from the flattened row-less LHFeat would pose a challenge. Conversely, learning to predict in the frequency domain can benefit from the well defined basis functions with meaningful spatial frequencies that characterize each column's original row information as a whole, and therefore may alleviate the row-dependency problem. + +# 4. Experiments + +In Sec. 4.1, we first conduct ablation studies for the proposed components in HoHoNet. We then compare the performance of HoHoNet with state-of-the-art methods on dense depth estimation (Sec. 4.2), semantic segmentation (Sec. 4.3), and layout estimation (Sec. 4.4). Note that we train HoHoNet for each task separately and focus on showcasing the effectiveness of HoHoNet in learning a modality. In Sec. 4.5, we analyze the effect of non-gravity-aligned view. More quantitative and qualitative results are included in the supplementary material. + +# 4.1. Ablation study + +Table 1 summarizes the results of ablation experiments, where we compare different settings of HoHoNet for dense depth estimation. Detailed descriptions are as follows. + +Ablation split for Matterport3D [2]. Matterport3D is a large-scale real-world dataset of indoor panoramas. We prepare the ablation split by splitting the official 61 training houses into 41 and 20 houses (containing 4,921 and 2,908 panoramas) for training and validation during ablation study. We do not use the official validation split for ablation study as it will be used for state-of-the-art comparison later. The input ERPs are resized to $512 \times 1024$ . + +Training and evaluation. We use Adam [14] to optimize the L1 loss for 40 epochs with batch-size of 4. The learning rate is set to 1e-4, and we apply polynomial learning rate decay with factor 0.9. Standard depth evaluation metric—MAE, RMSE, and $\delta^1$ —are used. We measure the average frame per second (FPS) for processing 50 individual $512 \times 1024$ panoramas on a GeForce RTX 2080 Ti. + +Architecture of LHFeat extraction. Table 1a compares the proposed efficient height compression (EHC) module with the architecture used in the related work [21]. In [21], a sequence of convolution layers gradually reduces the feature heights to form the initial LHFeat, which is then followed by a bidirectional LSTM (Bi-LSTM) for feature refinement. (Detailed architectures are in the supplementary material.) Table 1a shows that employing the proposed EHC module for initial LHFeat extraction achieves better speed and accuracy under different refinement configurations. We also find that using multi-head self-attention for feature refinement provides a better speed-accuracy tradeoff. Finally, our overall architecture for extracting the LHFeat is considerably better than [21]'s—the depth MAE is improved from 0.3002 to 0.2835 with FPS from 38 to 52. All experiments in Table 1a deploy ResNet-50 as backbone and use the IDCT with $r = 64$ for dense prediction. + +Hyperparameters of horizon-to-dense. We compare the two operations—linear interpolation (spatial domain) and IDCT (frequency domain)—applied to dense prediction un- + +
HCRefineMAE↓RMSE↓δ1↑FPS↑
[21]-0.30900.52380.815849
EHC0.30220.51020.820454
[21]Bi-LSTM0.30020.51470.825438
EHC0.29280.50360.829441
[21]MHSA0.29150.50350.833147
EHC0.28350.49160.838952
+ +(a) Comparison of the components for LHFeat extraction. The 'HC' column indicates the height compression block, which produces the initial LHFeat from the backbone features. We compare the results of 'no feature refinement', 'refined by bidirectional LSTM' [11] (BiLSTM), and 'refined by multi-head self-attention' [23] (MHSA). Refinement with MHSA achieves the most favorable results. + +
rBasisMAE↓RMSE↓δ1↑FPS↑
32Interp.0.28860.50130.835652
IDCT0.28470.49350.836952
64Interp.0.28800.49960.835152
IDCT0.28350.49160.838952
128Interp.0.29260.50430.830852
IDCT0.28500.49550.840552
256Interp.0.29370.50590.826052
IDCT0.29030.50280.833452
512Interp.0.30450.51890.822752
IDCT0.29130.50400.834152
+ +(b) Comparison on the different settings of the proposed horizon-to-dense module. The parameter $r$ denotes the number of components in a basis. We compare the two bases that implement the linear interpolation (Interp.) and the inverse discrete cosine transform (IDCT). + +
BackboneMAE↓RMSE↓δ1↑FPS↑
ResNet340.28540.49760.8397110
ResNet500.28350.49160.838952
+ +(c) Comparison of the results with different backbones. +Table 1: Ablation study on depth modality using the ablation split of Matterport3D [2]. More details are in Sec. 4.1. + +der different basis setups. As shown in Table 1b, learning to predict in frequency domain (with IDCT) is consistently better than predicting in spatial domain (with linear interpolation) for dense depth estimation upon the compact LHFeat. Interestingly, the number of components $r$ is not monotonic to the resulting accuracy, and we find $r = 64$ is the best setting for our model. As the compared operations introduce negligible computational cost, the FPSs are almost identical even if we increase $r$ . All experiments in Table 1b share the same deep net setting that consists of ResNet-50, the proposed EHC, and the MHSA. + +Comparison of the backbones. We compare the results of different backbones in Table 1c, where we find that employing ResNet-34 can almost double the FPS with only a little drop in accuracy comparing to ResNet-50. + +
DatasetMethodMREMAERMSERMSE (log)δ1δ2δ3
Matterport3DFCRN [15]0.24090.40080.67040.12440.77030.91740.9617
OmniDepth (bn) [31]0.29010.48380.76430.14500.68300.87940.9429
Equi [24]0.20740.37010.65360.11760.83020.92450.9577
Cube [24]0.25050.39290.66280.12810.75560.91350.9612
BiFuse [24]0.20480.34700.62590.11340.84520.93190.9632
Ours0.14880.28620.51380.08710.87860.95190.9771
Stanford2D3DFCRN [15]0.18370.34280.57740.11000.72300.92070.9731
OmniDepth (bn) [31]0.19960.37430.61520.12120.68770.88910.9578
Equi [24]0.14280.27110.46370.09110.82610.94580.9800
Cube [24]0.13320.25880.44070.08440.83470.95230.9838
BiFuse [24]0.12090.23430.41420.07870.86600.95800.9860
Ours0.10140.20270.38340.06680.90540.96930.9886
+ +Table 2: State-of-the-art comparison for depth estimation on real-world indoor 360 datasets—Matterport3D [2] and Stanford2D3D [1]. The evaluation protocol follows [24], where the depth is clipped to 10 meter without depth median alignment. + +# 4.2. Depth estimation + +# 4.2.1 State-of-the-art comparison using the protocol of Wang et al. [24] + +Datasets and evaluation protocol. We compare HoHoNet with state-of-the-art 360 depth estimation methods on real-world datasets following the testing protocol of [24]. Matterport3D [2] has 10,800 panoramas, and its training split contains 61 houses, and the testing results are reported on the merged official validation and test split. Stanford2D3D [1] contains 1,413 panoramas, and the fold-1 is used where the fifth area is for testing, and the other areas are for training. All the ERP images and depth maps are resized to $512 \times 1024$ . Standard depth estimation evaluation metrics—MRE, MAE, RMSE, RMSE ( $\log$ ), and $\delta$ —are used. Depths are clipped to 10 meters without median alignment. + +Implementation details. We employ ResNet-50 as the backbone with the proposed EHC module for LHFeat extraction; the latent size $D$ of LHFeat is set to 256; IDCT with $r = 64$ components is applied to the model predictions. We use Adam [14] to optimize the L1 loss for 60 epochs with a batch-size of 4. The learning rate is set to 1e-4, and we apply the polynomial learning rate decay with factor 0.9. + +Results. Table 2 shows the comparisons with prior arts. We demonstrate that the proposed HoHoNet outperforms the previous state-of-the-art, BiFuse [24], by a large margin. Note also that BiFuse takes both ERP and cubemap as their model inputs and thus requires two backbone networks. HoHoNet has only one backbone and the compact LHFeat can achieve superior results, which shows the effectiveness of the proposed framework. + +A qualitative comparison with BiFuse [24] is provided in Fig. 6, where we download their code1 and the pre-trained + +weights for the comparison. We find that HoHoNet is good at capturing the overall structure of the scene. However, some drawbacks of HoHoNet are also observable through the visualization in Fig. 6. + +# 4.2.2 State-of-the-art comparison using the protocol of Jin et al. [13] + +Dataset and evaluation protocol. We also compare HoHoNet with another set of methods following the testing protocol of [13]. A subset of the real-world Stanford2D3D [1] dataset with extra layout annotation is used, where there are only 404 and 113 pancreas for training and testing. All the ERP images and depth maps are resized to $256 \times 512$ . Standard evaluation metrics—RMSE, MRE, log10, and $\delta^1$ —for depth estimation are used. Neither depth clipping nor median alignment is applied during evaluation. + +Implementation details. The network and the training details are the same as in Sec. 4.2.1. However, we find the training strategy of [13] is very different from ours. For a fair comparison, we also report the results of training HoHoNet with the training protocol of [13]—SGD optimizer with a batch-size of 8, learning rate of 0.01, and weight decay set to 5e-4. + +Results. The comparison on the Stanford2D3D subset is shown in Table 3a. HoHoNet achieves the best accuracy under the same training protocol, and using Adam optimizer with our training setting can further improve the results. Note that GeoReg360 [13] employs a ResNet-50 and a ResNet-34, and the network is jointly trained with the additional layout and semantic annotation. Conversely, HoHoNet employs a single ResNet-50 and is only trained with depth modality, but still shows superior results, which further demonstrates the effectiveness of the proposed framework. + +
MethodRMSEMRElog10δ1
FCRN [15]0.5340.1640.0730.749
UResNet [31]0.5900.1870.0840.711
RectNet [31]0.5770.1810.0810.717
Sph. FCRN [22]0.5230.1450.0670.783
U-Net [18]0.4720.1400.0620.803
GeoReg360 [13]†0.4210.1180.0530.851
Ours*0.4080.1110.0500.867
Ours0.3940.1040.0480.896
+ +*Using [13] training protocol for a fair comparison. +$\dagger$ Using layout and semantic annotation. +(a) Quantitative comparison for dense depth on Stanford2D3D [1] layout-available subset [32]. We strictly follow [13] evaluation protocol. See detail in Sec. 4.2.2. + +
H × WInputMethodmIoUmAcc
Simple backbone w/ low-resolution 360°
64 × 128RGB-DGauge Net [5]39.455.9
RGB-DUGSCNN [12]38.354.7
RGB-DHexRUNet [28]43.358.6
RGB-DTangentImg [9]37.550.2
RGB-DOurs40.852.1
256 × 512RGB-DTangentImg [9]41.854.9
RGB-DOurs43.353.9
ResNet backbone w/ high-resolution 360°
2048 × 4096RGBTangentImg [9]45.665.2
1024 × 2048RGBOurs52.065.0
2048 × 4096RGB-DTangentImg [9]51.969.1
1024 × 2048RGB-DOurs56.368.9
+ +(b) Quantitative comparison for semantic segmentation on Stanford2D3D [1]. Results are averaged over the official 3 folds. + +
MethodBackboneIoUFPS
3D2D
LayoutNet v2 [33]ResNet-3475.8278.7346
DuLa-Net v2 [26]ResNet-5075.0578.8234
HorizonNet [21]ResNet-5079.1181.7131
AtlantaNet [17]ResNet-5080.0282.095
OursResNet-3479.8882.32110
+ +(c) Quantitative comparison for room layout estimation on Matter-portLayout [33]. +Table 3: State-of-the-art comparison on various datasets and different modalities. + +# 4.3. Semantic segmentation + +Dataset and evaluation protocol. We evaluate HoHoNet's semantic segmentation performance on Stanford2D3D [1] dataset. As previous work, we report the averaged results from the official 3-fold cross-validation splits, using standard semantic segmentation evaluation metrics—class-wise mIoU and class-wise mAcc. + +Implementation detail. The architecture setting of HoHoNet for semantic segmentation is almost the same as for depth estimation in Sec. 4.2.1 except the last layer has $E = Nr = 13 \cdot 64 = 832$ channels. To compare with methods using a simple backbone under low resolution, we follow [9, 12, 28] to construct a shallow U-Net but purely with planar CNN. For results on high resolution, we use ResNet-101 as backbone. We use Adam [14] to optimize the cross-entropy loss for 60 epochs with a batch-size of 4. The learning rate is 1e-4 with polynomial decay of factor 0.9. + +Results. Table 3b shows the comparison with previous methods. On the lowest resolution, HexRUNet [28], with a specially designed kernel on icosahedron representation, achieves the best result. Ours with purely planar CNNs and compact LHFeat is still competitive with the distortion mitigated methods under the low-resolution settings. When scaling to a high resolution, we achieve similar mACC with the recent state-of-the-art [9], while our mIoU is significantly better. Note that the results of [9] are obtained from a stronger FCN-ResNet101 backbone and a higher input resolution. Limited by our device and ERP projection, we can only train on a lower $1024 \times 2048$ resolution but still obtain competitive performance with the current state-of-the-art on $360^{\circ}$ semantic segmentation. + +# 4.4. Room layout estimation + +Dataset and evaluation protocol. We use MatterportLayout [33, 25] dataset, which is a real-world 360 Manhattan layout dataset. The official evaluation function for 2D IoU and 3D IoU is used directly, where the 2D IoU is measured by projecting floor corners to an aligned floor, while 3D IoU is for pop-up view considering both floor and ceiling corners. + +Implementation details. HoHoNet is compatible with the 1D layout representation proposed by HorizonNet [21]. Since our main focus is not to design a new method for layout reconstruction, we use [21]'s loss, training protocol, and post-processing algorithm directly. We find HoHoNet with ResNet-34 shows slightly better accuracy than ResNet-50 in validation, so we use the simpler ResNet-34 as backbone. + +Results. The comparison with previous methods on MatterLayout is shown in Table 3c. The FPSs are obtained using the official codes $^{2345}$ and measured by the averaged feed-forward times of the models on a GeForce RTX 2080 Ti. The result of AtlantaNet [17] is obtained from their official new pre-trained weights $^{5}$ with aligned data split and re-evaluated by the official evaluation function $^{2}$ . Our result is on par with the state-of-the-art AtlantaNet but $22 \times$ faster. HoHoNet also outperforms HorizonNet [21] by $+0.77$ 3D + +$^{2}$ https://github.com/zouchuhang%/LayoutNetv2 +3https://github.com/SunDaDenny/DuLa-Net +$^{4}$ https://github.com/sunset1995/HorizonNet +5https://github.com/crs4/AtlantaNet + +![](images/a550109ef0bcd5cf8e2d2b96a9a3c52397c280f33f5f1c2cf52e629172e4dc97.jpg) +Figure 6: Qualitative comparison of the estimated dense depth with the prior art—BiFuse [24]. The ‘Advantage’ column shows the MAE difference between ours and BiFuse’s where the blue color indicates ours is better and the red color for vice versa. We find HoHoNet achieves good results in capturing the overall structure, but we also find some drawback in the visualization. First, HoHoNet’s depth boundary is blurrier comparing to those of BiFuse. Second, some high-frequency signal in a column is discarded by HoHoNet. See the last row for an example. We find that $i)$ the boundary of the chairs in the left of the image is blurrier, and $ii)$ the lamp at the middle of the image is poorly reconstructed by HoHoNet while it seems to be easier to reconstruct from the conventional dense features. The intuitive reason for the qualitatively identified drawback is that the LHFeat focuses on learning the most prominent signals of a column, which makes it easier to optimize the training criterion. + +IoU and $+0.61$ 2D IoU, and is $3.5 \times$ faster, which shows the effectiveness of the designed architecture. + +# 4.5. Results on non-gravity-aligned views + +In Fig. 2, we show that the structure signals of an image column suffer more losses in compression if the image's $y$ -axis is not aligned with the gravity. Though the 360 data in all benchmarks we use are mostly well-aligned with gravity, the captured $360^{\circ}$ views could be non-gravity-aligned in practice. In Table 4, we show the vulnerability of our model to heavy pitch or roll rotation (see Fig. 2c and Fig. 2b for visualization). The pre-trained model in our ablation study takes the rotated images directly as input, and the output depth maps are rotated back to the original view for a fair comparison. As expected, the pre-trained model performs poorly when input $360^{\circ}$ views are not gravity-aligned. Introducing $10^{\circ}$ of pitch or roll rotation increases MAE from $28.45\mathrm{cm}$ to more than $44\mathrm{cm}$ . A simple solution is to use the IMU sensor or 360 vanishing point detection algorithm [29, 32] to ensure gravity alignment (the VP alignment is also a standard step in 360 layout benchmark [25, 32, 33]). + +We also show the results by training with $\mathcal{U}(-30^{\circ}, 30^{\circ})$ pitch/roll rotation as data augmentation, which makes the model much more robust against the non-canonical view but sacrifices the test-time performance when input $360^{\circ}$ view + +
Training Rot. Aug.Testing Cam. Rot.MAE (cm)
0°10°20°30°
✓Pitch28.3544.8862.7775.79
30.9231.3031.8032.97
✓Roll28.3544.3261.9075.11
30.9231.3231.8032.90
+ +Table 4: Vulnerability to non-gravity-aligned views. + +are gravity-aligned (MAE $\uparrow$ from $28.35\mathrm{cm}$ to $30.92\mathrm{cm}$ ). + +# 5. Conclusion + +This work presents a novel framework, HoHoNet, which is the first step to learning compact latent horizontal features for dense modalities modeling of omnidirectional images. HoHoNet is fast, versatile, and accurate for solving layout reconstruction, depth estimation, and semantic segmentation with accuracy on par with or better than the state-of-the-art. + +Acknowledgements: This work was supported in part by the MOST, Taiwan under Grants 110-2634-F-001-009 and 110-2634-F-007-016, MOST Joint Research Center for AI Technology and All Vista Healthcare. We thank National Center for High-performance Computing (NCHC) for providing computational and storage resources. + +# References + +[1] Iro Armeni, Sasha Sax, Amir Roshan Zamir, and Silvio Savarese. Joint 2d-3d-semantic data for indoor scene understanding. CoRR, abs/1702.01105, 2017. +[2] Angel X. Chang, Angela Dai, Thomas A. Funkhouser, Maciej Halber, Matthias Nießner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from RGB-D data in indoor environments. In 2017 International Conference on 3D Vision, 3DV 2017, Qingdao, China, October 10-12, 2017, pages 667-676. IEEE Computer Society, 2017. +[3] Devendra Singh Chaplot, Ruslan Salakhutdinov, Abhinav Gupta, and Saurabh Gupta. Neural topological SLAM for visual navigation. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 12872-12881. IEEE, 2020. +[4] Hsien-Tzu Cheng, Chun-Hung Chao, Jin-Dong Dong, Hao-Kai Wen, Tyng-Luh Liu, and Min Sun. Cube padding for weakly-supervised saliency prediction in $360^{\circ}$ videos. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pages 1420-1429. IEEE Computer Society, 2018. +[5] Taco Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge equivariant convolutional networks and the icosahedral CNN. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 1321-1330. PMLR, 2019. +[6] Taco S. Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical cnns. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. +[7] Benjamin Coors, Alexandru Paul Condurache, and Andreas Geiger. Spherenet: Learning spherical representations for detection and classification in omnidirectional images. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part IX, volume 11213 of Lecture Notes in Computer Science, pages 525-541. Springer, 2018. +[8] Marc Eder, Pierre Moulon, and Li Guan. Pano pickups: Indoor 3d reconstruction with a plane-aware network. In 2019 International Conference on 3D Vision, 3DV 2019, Quebec City, QC, Canada, September 16-19, 2019, pages 76-84. IEEE, 2019. +[9] Marc Eder, Mykhailo Shvets, John Lim, and Jan-Michael Frahm. Tangent images for mitigating spherical distortion. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 12423-12431. IEEE, 2020. +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, + +CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770-778. IEEE Computer Society, 2016. +[11] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735-1780, 1997. +[12] Chiyu Max Jiang, Jingwei Huang, Karthik Kashinath, Prabhat, Philip Marcus, and Matthias Nießner. Spherical cnns on unstructured grids. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. +[13] Lei Jin, Yanyu Xu, Jia Zheng, Junfei Zhang, Rui Tang, Shugong Xu, Jingyi Yu, and Shenghua Gao. Geometric structure based and regularized depth estimation from 360 indoor imagery. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 886-895. IEEE, 2020. +[14] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. +[15] Iro Laina, Christian Rupprecht, Vasileios Belagiannis, Federico Tombari, and Nassir Navab. Deeper depth prediction with fully convolutional residual networks. In Fourth International Conference on 3D Vision, 3DV 2016, Stanford, CA, USA, October 25-28, 2016, pages 239-248. IEEE Computer Society, 2016. +[16] Yeon Kun Lee, Jaeseok Jeong, Jong Seob Yun, Wonjune Cho, and Kuk-Jin Yoon. Spherephd: Applying cnns on a spherical polyhedron representation of 360deg images. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 9181-9189. Computer Vision Foundation / IEEE, 2019. +[17] Giovanni Pintore, Marco Agus, and Enrico Gobbetti. Atlantanet: Inferring the 3D indoor layout from a single 360 image beyond the Manhattan world assumption. In Proceedings of The European Conference on Computer Vision (ECCV), 2020. +[18] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Nassir Navab, Joachim Hornegger, William M. Wells III, and Alejandro F. Frangi, editors, Medical Image Computing and Computer-Assisted Intervention - MICCAI 2015 - 18th International Conference Munich, Germany, October 5 - 9, 2015, Proceedings, Part III, volume 9351 of Lecture Notes in Computer Science, pages 234-241. Springer, 2015. +[19] Yu-Chuan Su and Kristen Grauman. Learning spherical convolution for fast features from $360^{\circ}$ imagery. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 529-539, 2017. +[20] Yu-Chuan Su and Kristen Grauman. Kernel transformer networks for compact spherical convolution. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 9442-9451. Computer Vision Foundation / IEEE, 2019. + +[21] Cheng Sun, Chi-Wei Hsiao, Min Sun, and Hwann-Tzong Chen. HorizonNet: learning room layout with 1d representation and pano stretch data augmentation. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 1047-1056, 2019. +[22] Keisuke Tateno, Nassir Navab, and Federico Tombari. Distortion-aware convolutional filters for dense prediction in panoramic images. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part XVI, volume 11220 of Lecture Notes in Computer Science, pages 732-750. Springer, 2018. +[23] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 5998-6008, 2017. +[24] Fu-En Wang, Yu-Hsuan Yeh, Min Sun, Wei-Chen Chiu, and Yi-Hsuan Tsai. Bifuse: Monocular 360 depth estimation via bi-projection fusion. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 459-468. IEEE, 2020. +[25] Fu-En Wang, Yu-Hsuan Yeh, Min Sun, Wei-Chen Chiu, and Yi-Hsuan Tsai. Layout: Layout annotation of matter-port3d. CoRR, abs/2003.13516, 2020. +[26] Shang-Ta Yang, Fu-En Wang, Chi-Han Peng, Peter Wonka, Min Sun, and Hung-Kuo Chu. Dula-net: A dual-projection network for estimating room layouts from a single RGB panorama. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 3363-3372. Computer Vision Foundation / IEEE, 2019. +[27] Wei Zeng, Sezer Karaoglu, and Theo Gevers. Joint 3d layout and depth prediction from a single indoor panorama image. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XVI, volume 12361 of Lecture Notes in Computer Science, pages 666-682. Springer, 2020. +[28] Chao Zhang, Stephan Liwicki, William Smith, and Roberto Cipolla. Orientation-aware semantic segmentation on icosahedron spheres. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 3532-3540. IEEE, 2019. +[29] Yinda Zhang, Shuran Song, Ping Tan, and Jianxiong Xiao. Panocontext: A whole-room 3d context model for panoramic scene understanding. In David J. Fleet, Tomás Pajdla, Bernt Schiele, and Tinne Tuytelaars, editors, Computer Vision - ECCV 2014 - 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part VI, volume 8694 of Lecture Notes in Computer Science, pages 668-686. Springer, 2014. + +[30] Jia Zheng, Junfei Zhang, Jing Li, Rui Tang, Shenghua Gao, and Zihan Zhou. Structured3d: A large photo-realistic dataset for structured 3d modeling. In Proceedings of The European Conference on Computer Vision (ECCV), 2020. +[31] Nikolaos Zioulis, Antonis Karakottas, Dimitrios Zarpalas, and Petros Daras. Omnidepth: Dense depth estimation for indoors spherical panoramas. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part VI, volume 11210 of Lecture Notes in Computer Science, pages 453-471. Springer, 2018. +[32] Chuhang Zou, Alex Colburn, Qi Shan, and Derek Hoiem. Layoutnet: Reconstructing the 3d room layout from a single RGB image. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pages 2051-2059. IEEE Computer Society, 2018. +[33] Chuhang Zou, Jheng-Wei Su, Chi-Han Peng, Alex Colburn, Qi Shan, Peter Wonka, Hung-Kuo Chu, and Derek Hoiem. 3d Manhattan room layout reconstruction from a single 360 image. CoRR, abs/1910.04099, 2019. \ No newline at end of file diff --git a/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/images.zip b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ca2e4dde5892fc5d1430cea8464058dc0d6c2f0b --- /dev/null +++ b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17bee83aa5fbb0535f730d554b94ddf99f73eedbbc5c33338c285779788976fd +size 645488 diff --git a/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/layout.json b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ec92c8262307ad8a596e90a805bdbda1fdb0fc68 --- /dev/null +++ b/hohonet360indoorholisticunderstandingwithlatenthorizontalfeatures/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04e54c0d29504d568ad3fff566293ec56f73f8f0486799d54960a19d49d881f5 +size 389373 diff --git a/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_content_list.json b/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..432b2d5c5c53e02b6e4a084063b284bf26f1fbf9 --- /dev/null +++ b/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3515ae3534051d10568cac299f843fa03bdd66a75c70fb4b74210f722d73aa37 +size 77421 diff --git a/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_model.json b/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fdac023df1c2def9d1a021a83b5657de75cdd3ba --- /dev/null +++ b/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e625aed1838b925d44ab43ba67fc21a60229addf08a70ee16d37365b07228c5 +size 93663 diff --git a/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_origin.pdf b/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7dfb96ef505ad2dda4c1180499ac740c57920f52 --- /dev/null +++ b/holistic3dhumanandscenemeshestimationfromsingleviewimages/a529bd30-4804-48b3-8985-0cad48d6789e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f6d876df7a902e9ecfbd7a20c9ea029ae73215d230a3b29cbecbba085942a0f +size 2492332 diff --git a/holistic3dhumanandscenemeshestimationfromsingleviewimages/full.md b/holistic3dhumanandscenemeshestimationfromsingleviewimages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0e325cfa9522ec7700410ab36aa5c68b09cf7394 --- /dev/null +++ b/holistic3dhumanandscenemeshestimationfromsingleviewimages/full.md @@ -0,0 +1,281 @@ +# Holistic 3D Human and Scene Mesh Estimation from Single View Images + +Zhenzhen Weng, Serena Yeung +Stanford University +{zzweng, syyeung}@stanford.edu + +# Abstract + +The 3D world limits the human body pose and the human body pose conveys information about the surrounding objects. Indeed, from a single image of a person placed in an indoor scene, we as humans are adept at resolving ambiguities of the human pose and room layout through our knowledge of the physical laws and prior perception of the plausible object and human poses. However, few computer vision models fully leverage this fact. In this work, we propose a holistically trainable model that perceives the 3D scene from a single RGB image, estimates the camera pose and the room layout, and reconstructs both human body and object meshes. By imposing a set of comprehensive and sophisticated losses on all aspects of the estimations, we show that our model outperforms existing human body mesh methods and indoor scene reconstruction methods. To the best of our knowledge, this is the first model that outputs both object and human predictions at the mesh level, and performs joint optimization on the scene and human poses. + +# 1. Introduction + +Holistic scene perception is key to our human ability to accurately interpret and interact with the 3D world. The human visual system naturally integrates context from actors, objects, and scene layout to infer realistic, robust estimations of the world. Suppose a human is partially included in an image because they are positioned behind a desk. We can still effortlessly extract rich information from the static scene to resolve ambiguities due to the occlusion. Likewise, the appearance of humans also provides useful information about scenes, such as the ground plane and depth of surrounding objects. Humans and objects in scenes jointly manifest spatial occupancies that constrain their relative positions. For computer vision systems to achieve high accuracy in recognizing and interpreting complex scenes, it is therefore important to develop approaches for holistic scene perception and reasoning. + +In recent years, holistic scene understanding from single view images has gained increasing interest from com + +![](images/3a13860e1da9805c859cf27af414f2597411862e826e6a8da3a7782444f1f10d.jpg) +Figure 1. Given a single view RGB image of an indoor scene, our model is able to (i) predict all aspects of the scene (3D object bounding boxes, object and human meshes, 3D room layout, camera pose), and (ii) jointly optimize over a comprehensive set of global consistency losses. The final result is more physically plausible and accurate. + +puter vision researchers. [34] [14] proposed methods for joint reasoning over inanimate scenes, and recovered room layout and 3D object bounding boxes using consistency losses such as a constraint for objects to be enclosed within the room bounding box. [4] additionally discouraged intersection between object bounding box estimations, and was the first model to bring 3D human pose estimation into the holistic scene understanding problem. It incorporated human-object interaction priors to reason about approximate relations between humans and objects. However all of these works still operate at the relatively coarser level of bounding boxes and joint key points, and are therefore limited in their ability to use precise shapes, surfaces, and physical occupancies to design holistic scene constraints and improve estimation accuracy. + +In this work we propose the first single-view, holistic scene understanding method that jointly optimizes over all aspects of 3D human pose, objects, and room layout at the mesh level, to produce state-of-the-art mesh estimations of the scene. Our approach builds on recent advances in mesh prediction. [5] [7] [29] proposed methods for reconstructing the individual object meshes with varying topological + +structures. [27] builds on [29] and proposed the first holistic 3D scene understanding method with mesh reconstruction at the instance level, however they did not consider humans. Recently, [11] introduced a method for 3D mesh-based human pose estimation, that utilizes physical occupancy information of the static scene to discourage body penetration into the scene. However, [11] requires the ground truth 3D scans of the scene, and does not perform joint human and scene estimation. + +Given a single RGB image, our method simultaneously reconstructs the human body mesh and multiple aspects of the scene - 3D object meshes and bounding boxes, room layout, and camera pose - all in 3D (Figure 1). Our approach outputs the SMPL-X (SMPL eXpressive) [30] human mesh model, which fully parameterizes the 3D surface of the human body. It also leverages a variant of the Topology Modification Network (TMN) [5], proposed in [27], as the base model for static object mesh and scene reconstruction. Importantly, we introduce a joint optimization process that incorporates a comprehensive set of physical constraints and priors including 2D/3D reprojection constraints, object-object mesh constraints, object-human mesh constraints, and object/human - room layout constraints, to obtain robust, physically plausible predictions. We perform experimental evaluation on the PiGraphs [33] and PROX [11] datasets and demonstrate that our model outperforms state-of-the-art methods on either 3D scene understanding or 3D human pose estimation. + +In summary, our contributions are the following: + +- We propose a holistic trainable model for jointly reconstructing 3D human body meshes and static scene elements (3D object meshes and bounding boxes, room layout, and camera pose) from monocular RGB images. To the best of our knowledge, we are the first to jointly estimate this rich scene understanding at the mesh level. +- Our model does not require any ground truth annotations of the 3D scene or the human poses, and can be directly used on any indoor dataset to produce high quality mesh reconstructions. +- Through our joint optimization process that incorporates a comprehensive set of physical constraints and priors, we show that our model outperforms prior state-of-the-art methods on either 3D scene understanding or 3D human pose estimation, on the PiGraphs and PROX Quantitative datasets. + +# 2. Related Work + +Single View 3D Human Pose Estimation. Previous 3D pose estimation methods from single view RGB images can be divided into two types: (i) directly learning 3D human keypoints from 2D image features [38], and (ii) 2D pose estimation with subsequent separate lifting of the 2D coor + +dinates to 3D via deep neural networks [31] [24]. Although these works have showed impressive results on in-the-wild images with relatively clean backgrounds, estimating 3D poses with cluttered background and partial occlusions is still very challenging. Recent works in human body models [22] [30] and single view body mesh reconstruction methods [2] [19] have pushed the richness of body details available for reasoning, and provide opportunities for bringing novel constraints to the training stage. Recently, [11] proposed the first 3D human body mesh reconstruction method that takes the static scene into consideration; however they rely on ground truth 3-D scene scans. Our work builds on these directions and is the first to leverage mesh representations of both human and scene in performing holistic estimation of 3D human body and scene meshes jointly. + +Holistic Scene Understanding. The 3D holistic scene understanding problem, in particular 3D scene reconstruction from single view images, has received increasing attention over the past few years. While most of these works have focused on coarser bounding boxes and keypoints as opposed to meshes, methods have differed in model outputs and constraint formulations [14][27][4]. Works such as [14] have focused on the static scene; [14] proposed an end-to-end model that learns the 3D room layout, camera pose and 3D object bounding boxes. Drawing insight from the camera projection process and and physical commonsense, [14] encourages projected 3D bounding boxes to be close to their 2D locations on the image plane, and forces object bounding boxes to be within the room layout bounding box. + +Some works have attempted to incorporate scene/object information in human pose estimation [42] [11] [26] [43] and/or vice-versa [8]. [43] relies on mesh exemplars with annotated contact points, and does not perform full layout/scene reconstruction. [26] uses a database of "scenelets" and works with human skeletons. [11] utilizes ground truth scene scans. In contrast to these, we consider the more challenging setting of directly estimating scene and human meshes (in general indoor settings), whereas joint mesh estimation is beyond the scope of these works. [4] jointly tackles two tasks from a single-view image: (i) 3D estimations of object bounding boxes, camera pose, and room layout; and (ii) 3D human keypoints estimation. They used an energy-based inference optimization process that refines direct 3D outputs by jointly reasoning across aspects of the objects and human keypoints. However, their constraint formulations based on 3D bounding boxes and human keypoints are still lacking in precision. Additionally, energy-based models have the disadvantage of an expensive inference step compared to feed-forward models, and [4]'s MAP estimation method searches over a discrete set of object locations which may give sub-optimal results. In contrast, we impose precise physical constraints at the mesh level in our joint optimization procedure and directly back + +propagate the underlying neural networks. + +Holistic Scene Mesh Reconstruction. An emerging line of work attempts to reconstruct richer information about objects in scenes such as depth [35], voxel [21] [39], or mesh representations [7] [27]. Meshes contain much richer 3D shape information about the objects, but are generally harder to reconstruct due to the diverse topology of the shapes. Mesh-retrieval methods [16] [15] [17] retrieve 3D models from a large 3D model repository, however the size of these repositories remain a bottleneck. Object-wise mesh reconstruction methods [5] [41] [7] [29] take a different approach using end-to-end prediction and refinement of the target mesh of individual objects. Recently, [27] incorporated an object-wise mesh reconstruction module in their holistic 3D understanding model for static scenes. However, they did not take advantage of the rich information about object shapes that comes with the meshes, and their reconstructed scene meshes are often physically implausible. Although a recent 3D human mesh estimation method [11] takes advantage of precise object shapes in their constraint formulation, they use ground truth 3D scene scans. In contrast, we estimate both humans and the static scene jointly from single view images. + +# 3. Model + +We introduce a two-stage approach for joint 3D human and scene mesh estimation. In Stage I, we separately parse and reconstruct the human meshes and the 3D scene - 3D object bounding boxes and meshes, camera pose, and 3D room layout - to obtain initial estimates. In this stage, holistic reasoning is limited to encouraging physical plausibility within the human only and within the static scene only. Then in Stage II, we jointly minimize global consistency losses across humans and the static scene together, which extends the holistic reasoning to simultaneously improve performance of all sub-tasks. + +An overview of our method is illustrated in Figure 2. In Section 3.1, we first define our notation and representation of the 3D scene and our human body mesh model. In Section 3.2, we describe the model architectures we use for producing each part of the body and scene estimations. Based on these, in Section 3.3, we present our joint optimization process that incorporates a comprehensive set of physical rules and priors – including reprojection constraints, object-object mesh constraints, object-human mesh constraints, and object/human - room layout constraints – to perform holistic estimation of both human and scene meshes. + +# 3.1. Representation + +3D Scene. The input to our model is a 2D image $I \in \mathbb{R}^{(\mathrm{h},\mathrm{w},3)}$ . We use a pre-trained Faster R-CNN [32] to obtain initial 2D bounding box estimates $b \in \mathbb{R}^{(4,2)}$ for each of the $n_{obj}$ objects in the scene. The 2D bounding box centers + +are represented as $c \in \mathbb{R}^2$ . Our representation for the camera pose, room layout, and 3D object bounding boxes and meshes in a scene follows the notation used in [14][27]. The camera pose is a $3 \times 3$ rotation matrix defined by the pitch and roll angles of the camera system relative to the world system. In the world system, an object bounding box is represented by a 3D bounding box $X \in \mathbb{R}^{(8,3)}$ , which can be determined from its 3D center $C \in \mathbb{R}^3$ , spatial size $s \in \mathbb{R}^3$ , and orientation angle $\theta \in [-\pi, \pi)$ . The cuboid room layout is also represented by a 3D box $X^L \in \mathbb{R}^{(8,3)}$ , and is parameterized in the same manner as an object bounding box. The triangular mesh for object $i$ in the image is represented by its vertices and faces $M_i = (V_i, F_i)$ , where $V_i \in \mathbb{R}^{(N_i,3)}$ . $N_i$ is the number of vertices and $F_i$ defines the triangular faces of the mesh. $M_i$ is normalized to fit in a unit cube, and the vertices of the mesh can be converted to the 3D camera coordinate system by translation and rotation as specified by the 3D bounding box parameters. + +Human Body Model. We represent the human body using SMPL-X (SMPL eXpressive) [30], a generative model that captures how the human body shape varies across a human population, learned from a corpus of registered 3D body, face and hand scans of people of different sizes, genders and nationalities in various poses. SMPL-X extends the SMPL model [22] with fully articulated hands and an expressive face. It is essentially a differentiable function parameterized by shape $\beta_{b}$ , pose $\theta_{b}$ , facial expressions $\psi$ and translation $\gamma$ of the body. The output of SMPL-X is a 3D triangular mesh $M_{b} = (V_{b},F_{b})$ that contains $N_{b} = 10475$ vertices $V_{b}\in \mathbb{R}^{(N_{b},3)}$ and triangular faces $F_{b}$ . + +# 3.2. Model Architecture + +Body Model. Since the SMPL-X [30] body model is a fully differentiable function, we simply compute the body loss terms (Section 3.3) that are formulated in terms of the vertices and faces of the output human body mesh, and back-propagate the SMPL-X model to find the optimal set of parameters such as the shape and pose of the human body. As in [30], the parameters of the SMPL-X model are regularized with a set of body priors including a VAE-based body pose prior, and $L_{2}$ priors on hand pose, facial pose, body shape and facial expressions, penalizing deviation from the neutral state. + +Scene Models. We use three sub-modules to predict 3D object boxes, camera pose and 3D room layout, and 3D object meshes in the scene, respectively. Specifically, we adopt the Object Detection Network (ODN), Layout Estimation Network (LEN), and Mesh Generation Network (MGN) from [27]. For 3D object box prediction, the ODN first takes 2D detections of a Faster R-CNN model trained on LVIS [10], extracts appearance features in an object-wise fashion using ResNet-34 [12], and encodes the relative position and size between 2D object boxes into geometry fea + +![](images/2e17d1b57ada8b495e8d5050fbf1474168a332eab4ae3504d273ebec5f04e332.jpg) +Figure 2. Overview of our model. Given a single RGB image, we first use off-the-shelf 2D detectors to predict the 2D human keypoints and 2D bounding boxes of the objects in the scene. Then, the body mesh network reconstructs a SMPL-X body mesh model through the human keypoints re-projection loss and the human body prior losses. The Mesh Generation Network (MGN) reconstructs the object-wise meshes. 3D Object Detection Network (ODN) predicts the 3D bounding boxes of the objects. Layout Estimation Network (LEN) predicts the camera pose and the 3D room bounding box. In Stage I, the individual modules are optimized with within-body and within-scene losses. In Stage II, the modules fine-tune with the additional human-scene joint losses to achieve consistency and physical plausibility across all aspects of the output. + +tures using the method in [13]. For each target object, an "attention sum" is then computed using relational features to other objects [13]. Finally, each set of box parameters is regressed using a two-layer MLP. The LEN consists of a ResNet-34 feature extractor and two separate branches with fully-connected layers, one for predicting the camera pose and the other for predicting the 3D room bounding box attributes. Finally, for 3D object mesh prediction, the MGN takes a 2D detection of an object as input and uses ResNet-18 to extract 2D appearance features. Then, the image features concatenated with the one-hot LVIS [10] object category encoding are fed into the decoder of AtlasNet [9], which performs mesh deformation from a template sphere mesh. An edge classifier is trained to remove redundant edges from the deformed mesh and a boundary refinement module [29] is used to refine the smoothness of boundary edges and output the final mesh. We pre-trained on SUN RGB-D [36] to initialize the scene models. However, no ground truth annotations are required when training our model on a new dataset. + +# 3.3. Loss Functions and Optimization + +We optimize a comprehensive set of losses based on physically plausible constraints and priors, across two stages of training, to perform holistic estimation of 3D human and scene meshes. These losses can be organized as within-body losses (Stage I), within-scene losses (Stage I), and global human-scene losses (Stage II). + +Within-body losses As part of Stage I of our approach, we first utilize within-body constraints to generate an initial human mesh estimation. Following [11] [2] [30], we formulate fitting SMPL-X to monocular images as an optimization problem, and seek to minimize the loss function + +$$ +\begin{array}{l} \mathcal {L} _ {\text {b o d y}} = E (\beta , \theta , \psi , \gamma) \\ = E _ {J} + \lambda_ {\theta_ {b}} E _ {\theta_ {b}} + \lambda_ {\theta_ {f}} E _ {\theta_ {f}} + \lambda_ {\theta_ {h}} E _ {\theta_ {h}} + \\ \lambda_ {\varepsilon} E _ {\varepsilon} + \lambda_ {\beta} E _ {\beta} + \lambda_ {\alpha} E _ {\alpha} + \lambda_ {\mathcal {P} _ {s e l f}} E _ {\mathcal {P} _ {s e l f}} \tag {1} \\ \end{array} +$$ + +Here $E_{J}$ is the re-projection loss that we use to minimize the weighted robust distance between 2D joints estimated from the RGB image $I$ and the 2D projection of the corresponding 3D joints of SMPL-X. $\theta_{b},\theta_{f},\theta_{h}$ are the pose vectors for the body, face (neck, jaw) and the two hands respectively. The terms $E_{\theta_f},E_{\theta_h},E_{\mathcal{E}}$ and $E_{\beta}$ are $L_{2}$ priors for the hand pose, facial pose, facial expressions and body shape, penalizing deviations from the neutral state. $E_{\beta}$ is a VAE-based body pose prior called VPoser introduced in [30]. $E_{\alpha}$ is a prior penalizing extreme bending only for elbows and knees. The terms $E_{J},E_{\theta_{b}},E_{\theta_{h}},E_{\alpha},E_{\beta}$ are as described in [30]. $E_{\mathcal{P}_{self}}$ is a penetration penalty for selfpenetrations (e.g. hand intersecting knee). The $\lambda$ 's are the weights for the terms. + +Our formulation is closest to that in [11], which performs human mesh estimation and was built upon [30] with the addition of scene contact $(E_{\mathcal{C}})$ and penetration $(E_{\mathcal{P}})$ terms by assuming access to ground truth scene scans. There are several differences between their full loss function and our + +formulation in Eq. 1. First, we do not include any depth related terms, because we wish to perform estimation using solely RGB images whereas [11] propose model variants leveraging RGB-D information. Second, since we are performing joint estimation of the 3D scene from a monocular RGB image, we are not yet able to reason on scene contact or penetration after only human mesh estimation. So we include only a body self-penetration term in Eq. 1, which is computed following the approach in [1] [30][40], and will consider human-scene constraints instead during our global optimization stage. + +Within-scene losses In Stage I of our approach, we also utilize within-scene constraints to generate an initial static scene estimation. Specifically, we design two within-scene constraints, one for encouraging 2D/3D consistency of the predicted object bounding boxes and the other one for penalizing the collision between the object meshes. + +For the first constraint, we utilize the fact that based on the camera projection model, if we project predicted 3D bounding boxes onto the 2D image plane, the projected corners should be close to the 2D bounding box corners. This constraint therefore optimizes both camera pose and 3D bounding boxes. [27] imposes a similar loss where they penalize the deviation of the 2D projections of predicted 3D bounding box corners from ground truth 3D bounding box corners for both object bounding boxes and the room bounding box. However, since our model does not rely on any ground truth annotations in our described optimization process, we propose to use our detected 2D bounding boxes as a pseudo ground truth. We show the effectiveness of this loss term in Section 4. The formal definition of this term can be written as + +$$ +\mathcal {L} _ {\text {s c e n e}} ^ {J} = \frac {1}{n _ {o b j}} \sum_ {i = 1} ^ {n _ {o b j}} \operatorname {S m o o t h L} _ {1} \left(f \left(X _ {i} \left(s _ {i}, C _ {i}, \theta_ {i}\right)\right), b _ {i}\right) \tag {2} +$$ + +where $s_i$ , $C_i \theta_i$ are the size, centroid and orientation of the object $i$ . $b_i$ is the 2D bounding box estimate for object $i$ , and $f$ is a differentiable projection function that projects the corners of a 3D bounding box to a 2D image plane. Like [27], we use a smooth $L_1$ loss function comprised of a squared term if the absolute element-wise error falls below a threshold and an $L_1$ term otherwise. + +Our second constraint is a loss term that penalize the collision between reconstructed object meshes. Although some pose estimation works [11] [18] have incorporated body collision losses, prior works in scene understanding have not explored this loss, because they either did not have the object shape information necessary to calculate the precise collision [14] [4], or did not take advantage of the object shape information that comes with the meshes [27]. We notice that inter-object collision is common in the output of these works. We detect collision using the signed distance field (SDF) of each object. For each object mesh, we voxelize its 3D bounding box into a grid, where for each grid cell center, we calculate its signed distance to the nearest + +point in the rest of the object meshes in the scene. A negative distance means that this cell center is inside the nearest scene object and denotes penetration. We use a squared sum term of the signed distances of each penetrating grid cell. Formally, + +$$ +\mathcal {L} _ {\text {s c e n e}} ^ {\mathcal {P}} = \frac {1}{n _ {o b j}} \sum_ {i = 1} ^ {n _ {o b j}} \sum_ {c _ {j} \in V _ {i}} | | d (c _ {j}, M _ {- i}) \mathbb {1} (d (c _ {j}, M _ {- i}) < 0) | | _ {2} ^ {2} \tag {3} +$$ + +where $c_{j}$ is the center of the $j_{th}$ cell in the voxel grid $V_{i}$ for object $i$ . $d(c_{j}, M_{-i})$ is the signed distance between the cell center $c_{i}$ and the scene mesh composed of all object meshes except for object $i$ . $\mathbb{1}$ is an indicator function. + +Global human-scene losses In Stage II of our approach, we jointly fine-tune the human and scene estimation components by imposing additional human-scene losses across the reconstructed human mesh and scene mesh. We consider four types of human-scene losses here. + +First, observing that indoor furniture are very likely to be on the floor, we penalize the absolute distance between the object bounding boxes and the ground plane as estimated by the Layout Estimation Network. In the camera coordinate system that we use, $+y$ axis is perpendicular to the ground plane and pointing upward. Hence, we can write this term formally as + +$$ +\mathcal {L} _ {\text {j o i n t}} ^ {\mathrm {o b j - g r o u n d}} = \frac {1}{n _ {o b j}} \sum_ {i = 1} ^ {n _ {\mathrm {o b j}}} d \left(y _ {\min } \left(X ^ {L}\right), y _ {\min } \left(X _ {i}\right)\right) \tag {4} +$$ + +where $y_{\mathrm{min}}(X)$ returns the minimum $y$ coordinate values of the 3D bounding box $X \in \mathbb{R}^{(8,3)}$ . + +Second, like objects in the room, humans need a supporting plane to counteract the gravity. Therefore, we penalize the distance between the lowest point in the human body mesh and the room ground plane. We denote this term as $\mathcal{L}_{\mathrm{joint}}^{\mathrm{body - ground}}$ + +Third, we include the contact term $E_{\mathcal{C}}$ from [11], although[11] utilized ground truth scene scans. The intuition is that when humans interact with the scene, they come in contact with it. Thus, [11] annotates a set of candidate contact vertices $V_{\mathcal{C}} \subset V_{b}$ across the whole body that come frequently in contact with the world, focusing on the actions of sitting and touching with hands. Formally, + +$$ +\mathcal {L} _ {\text {j o i n t}} ^ {\mathcal {C}} = \sum_ {v _ {\mathcal {C}} \in V _ {\mathcal {C}}} \rho_ {\mathcal {C}} \left(\min _ {v _ {s} \in V _ {s}} \| v _ {\mathcal {C}} - v _ {s} \|\right) \tag {5} +$$ + +where $\rho_{\mathcal{C}}$ denotes a robust Geman-McClure error function [6] for down-weighting vertices in $V_{\mathcal{C}}$ that are far from the nearest vertices the 3D scene mesh $M_{s}$ which consists of all the meshes in the scene. Note that since we do not have access to (or reconstruct) a floor mesh as in [11], we leave out [11]'s body-floor contact terms; instead, our loss term + +$\mathcal{L}_{\mathrm{joint}}^{\mathrm{body - ground}}$ encourages contact between the feet and the floor. + +Finally, we penalize any collisions between the body mesh and object meshes in the scene. The formulation is similar to Eq. 3. We call this term $\mathcal{L}_{joint}^{\mathcal{P}}$ . + +To summarize, our model's total loss is + +$$ +\mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {\text {b o d y}} + \mathcal {L} _ {\text {s c e n e}} + \mathcal {L} _ {\text {j o i n t}} \tag {6} +$$ + +where + +$$ +\mathcal {L} _ {\text {s c e n e}} = \lambda_ {1} \mathcal {L} _ {\text {s c e n e}} ^ {J} + \lambda_ {2} \mathcal {L} _ {\text {s c e n e}} ^ {\mathcal {P}} \tag {7} +$$ + +$$ +\begin{array}{l} \mathcal {L} _ {\text {j o i n t}} = \lambda_ {3} \mathcal {L} _ {\text {j o i n t}} ^ {\text {o b j - g r o u n d}} + \lambda_ {4} \mathcal {L} _ {\text {j o i n t}} ^ {\text {b o d y - g r o u n d}} \\ + \lambda_ {5} \mathcal {L} _ {\text {j o i n t}} ^ {\mathcal {C}} + \lambda_ {6} \mathcal {L} _ {\text {j o i n t}} ^ {\mathcal {P}} \tag {8} \\ \end{array} +$$ + +In Stage I, only within-body $(\mathcal{L}_{\mathrm{body}})$ and within-scene $(\mathcal{L}_{\mathrm{scene}})$ constraints are used. In Stage II, we add global consistency losses $(\mathcal{L}_{\mathrm{joint}})$ across humans and the static scene together, and continuously fine-tune the modules to simultaneously improve performance of all sub-tasks. + +# 4. Experiments + +In this section, we evaluate the performance of our method. Since we are the first to jointly predict and reconstruct both 3D human poses and objects at the mesh level, we compare our model with the state-of-the-art methods for each task. Specifically, we compare with [11] on human body mesh prediction, [25][4] for 3D human keypoints estimation, and [14][4] for 3D bounding box estimation. + +# 4.1. Datasets + +Pigraphs [33]. PiGraphs contains 30 3D scene scans and 63 video recordings of five human subjects with skeletal tracking provided by Kinect v2 devices. The dataset contains annotations for 3D human keypoints and 3D object bounding boxes in the scenes. We will perform quantitative evaluation on both of these prediction tasks. + +PROX Quantitative and Qualitative [11]. PROX Quantitative has 180 static RGB-D frames and was captured using Vicon and MoSH markers. [11] placed everyday furniture and objects into the scene to mimic a living room, and performed 3D reconstruction of the scene. The ground truth human body mesh annotations were obtained by placing markers on the body and the fingers, and then using MoSh++ [23] to convert MoCap data into realistic 3D human meshes represented by a rigged body model. To the best of our knowledge, this is the only available dataset that has both real furniture in a cuboid room as well as a human subject actively interacting with the scene, which makes it ideal for our task. Since PROX Quantitative does not provide ground truth object-level meshes and therefore does not support scene estimation task, we will quantitatively evaluate our model only on the human mesh estimation task. PROX Qualitative [11] provides 100K synchronized and spatially calibrated RGB-D recordings of humans in 12 + +
Object DetectionPose Estimation
Methods2D IoU3D IoUMethods2D (pix)3D (m)
[14]68.621.4[25]63.90.732
[4]75.124.9[4]15.90.472
w/o joint74.225.2w/o joint15.90.469
Ours75.626.3Ours15.80.460
+ +Table 1. Left: Quantitative results for 3D scene reconstruction on Pigraphs. Higher IoU values indicate better performance. Right: Quantitative results for human keypoints estimation on Pigraphs. For both 2D (pix) and 3D (m) metrics, lower values are better. "w/o joint" is the performance of our model without joint optimization. + +indoor scenes. While it was released together with PROX Quantitative, it does not have ground truth human mesh annotations. We perform additional qualitative evaluation on this dataset. + +# 4.2. Implementation Details + +Given an RGB image of an indoor scene as the input to the model, we first use off-the-shelf 2D detectors to estimate 2D object bounding boxes and 2D human keypoints. For 2D object detections, we use Faster R-CNN [32] trained on the LVIS [30] dataset; for 2D keypoint detections we use OpenPose [3]. ODN, LEN, and MGN are pretrained on the SUN RGB-D dataset [36] and Pix3D [37], following prior work for our task. + +In Stage I, we optimize the SMPL-X body model using only the within-body $(\mathcal{L}_{\mathrm{body}})$ losses. We use L-BFGS optimizer [28] with learning rate $1\mathrm{e} - 3$ . For the scene model, we freeze the MGN and the feature extractors components of ODN and LEN, and use Adam [20] optimizer with learning rate $1\mathrm{e} - 4$ to back-propagate the linear layers for predicting object bounding box attributes (eg. centroid, orientation), camera pose and 3D room layout. For this part, only the within-scene $(\mathcal{L}_{\mathrm{scene}})$ losses are used. + +In Stage II, we add the global consistency losses $(\mathcal{L}_{\mathrm{joint}})$ , and continue fine-tuning of all modules. In this stage, we additionally fix the orientation of the 3D object and room bounding boxes and the camera pose. We train the linear layers for predicting the centroid and the size of the object and room boxes to further refine the 3D location of the objects and the ground plane of the scene. We use the same optimizers as Stage I but with reduced learning rates (1e-4 for L-BFGS [28] and 5e-5 for Adam). + +# 4.3.Quantitative Results + +3D Object and Human Pose Estimation. To show the efficacy of our method in holistic scene understanding, we quantitatively evaluate 3D object detection and 3D human pose estimation on PiGraphs. No prior works for holistic scene understanding have attempted mesh level reconstruction of the scene and human body; both [14] and [4] outputs 3D bounding boxes of objects, and [4] additionally outputs 3D human keypoints. Thus, we evaluate on the same tasks as these baselines. Since our approach is fully based on + +physical constraints from externally available mesh models, we do not use any of the 3D annotations in PiGraphs for training, as [14] does. However, we are still able to outperform both (Table 1), showing the power of leveraging the rich shape information available through meshes. + +Following [14], for object detection evaluation, we report mean 3D bounding box IoU, as well as 2D IoU between the 2D projections of the 3D object bounding boxes and the ground-truth 2D boxes. For 3D human keypoints evaluation, we extract the 144 body joints from the fitted SMPL-X model and only keep the ones used in [25] [4], which is a subset of the SMPL-X joints. As in [4], we compute the Euclidean distance between the estimated 3D joints and the ground-truth, and average over all joints. For 2D evaluation, we project the estimated 3D keypoints back to the 2D image plane and compute pixel distance to ground truth. + +The quantitative results for both tasks in Table 1 show that our model outperforms both [14] and [4] on the 3D object detection task, and [25] [4] on the 3D pose estimation task, which illustrates the effectiveness of our method. The boost in 3D performance is significant, because a large source of error of the baseline models come from inaccurate depth estimation of the objects or the humans. Depth estimation from single view images is generally a difficult problem because 2D visual features are limited in suggesting the depth information. We show that the constraints in our joint optimization help to disambiguate the depth information. The improvement on the object bounding box IoUs suggests that applying fine-grained constraints at the mesh level helps with refining coarser details of the objects. + +Human Mesh Estimation We quantitatively evaluate our human body mesh estimation results on PROX Quantitative [11] (Table 2). We follow the evaluation of [11], and report the mean per-joint error without/with procrustes alignment (noted as “PJE” / “p.PJE”), and the mean vertex-to-vertex error (noted as “V2V” / “p.V2V”). Procrustes alignment is a common trick to adjust the predicted 3D vertices for errors in translation, rotation, and scaling. We include the procrustes aligned numbers for completion, but note that since our method optimizes all aspects of the human body including translation, rotation and scaling, V2V and PJE are more meaningful quantitative metrics in evaluating the overall quality of the predicted 3D vertices of the mesh. + +We compare our body mesh reconstruction method with [11], the state-of-the-art human body mesh reconstruction method on PROX Quantitative. [11] shares the same body loss $(\mathcal{L}_{\mathrm{body}})$ as us; however it imposes contact $(E_{\mathcal{C}})$ and collision $(E_{\mathcal{P}})$ constraints between the human mesh and the ground truth 3D scene scans. In our method, we consider an estimated scene mesh in formulating our losses instead. Therefore, in Table 2, we include quantitative performance of [11]'s models using ground truth 3D scene scans for reference, and additionally including the following three base + +
with ground truth 3D scene scans
V2VPJEp.V2Vp.PJE
[11] (including EC)208.03208.5772.7660.95
[11] (including EP)190.07190.3873.7362.38
Full [11] (EC + EP)167.08166.5171.9761.14
without ground truth 3D scene scans
[11] (body terms only)220.27218.0673.2460.80
[11] + estimated scene224.53220.4773.4961.32
[11] + w/in-scene losses212.48209.6773.1362.06
Ours192.21190.7872.7261.01
+ +Table 2. Quantitative results for human mesh estimation on PROX Quantitative. Top half of the table contains the performance of [11]'s models that use ground truth 3D scene scans in optimizing the human body model. Bottom half of the table contains the baseline models that are most comparable to ours, because no ground truth 3D scene scans are used during training. We highlight the best numbers among the models that do not require ground truth scene scans. + +lines models for a fair comparison with our model: + +[11] (body terms only): [11], without using scene terms (since these utilize a ground truth scene). +- [11] + estimated scene: [11] with their contact $(E_{\mathcal{C}})$ and collision $(E_{\mathcal{P}})$ terms calculated using the 3D scene mesh predicted by [27] (our base scene model). +- $[11] + \mathrm{w/in}$ -scene losses: [11] with their contact $(E_{\mathcal{C}})$ and collision $(E_{\mathcal{P}})$ terms calculated using an optimized scene mesh (the base scene model [27], plus our within-scene losses $\mathcal{L}_{\mathrm{scene}}$ ). + +Our model outperforms all three baselines that do not use ground truth scene scans (bottom half of Table 2), and is competitive to [11]'s models using ground truth scene scans (top half). This shows the effectiveness of our scene mesh estimation in refining the human meshes, and that simply adding estimated scenes to [11] is not sufficient. The gap between $[11] + \mathrm{w / in}$ -scene losses and Ours highlights the utility of our joint optimization process. + +# 4.4. Ablation Analysis + +To analyze the contributions of different losses, we compare variants of our proposed full model. In Tables 3 and 4, we compare quantitative results on the human body mesh prediction and 3D object detection tasks as we take out each one of the losses in Eqs. 7 and 8, except for the essential body loss $(\mathcal{L}_{\mathrm{body}})$ and box re-projection loss $(\mathcal{L}_{\mathrm{scene}}^{J})$ . We observe that all of the losses are essential in improving both the scene estimation and body estimation tasks. The joint losses $\mathcal{L}_{\mathrm{joint}}^{\mathrm{object - ground}}$ , $\mathcal{L}_{\mathrm{joint}}^{\mathcal{C}}$ , and $\mathcal{L}_{\mathrm{joint}}^{\mathcal{P}}$ play an essential role in jointly improving the global consistency, which boosts the performance of human body mesh reconstruction task. In particular, $\mathcal{L}_{\mathrm{joint}}^{\mathcal{P}}$ seems to be the most important term in refining the body meshes. The $\mathcal{L}_{\mathrm{joint}}^{\mathrm{object - ground}}$ and $\mathcal{L}_{\mathrm{joint}}^{\mathrm{body - ground}}$ terms improves the ground plane estimation, + +![](images/2b21aae0db54e715d3035f5eb5d1b86ca67f8d1849d975dc447e0a219f1b63f8.jpg) +Figure 3. Left half: Qualitative results on PROX Quantitative and Qualitative datasets. The left frames is from PROX Quantitative. The right frame is from PROX Qualitative. Right half: Qualitative results on Pigraphs dataset. From top to bottom are the RGB input, the direct output from the scene and body mesh without any optimization, and the final mesh with the joint optimization. + +![](images/da349397cd21d8f04a2503477b8a2cf8d31ce9f0155f7a456f65a68699f1390b.jpg) + +which helps the 3D object detection task significantly. + +# 4.5. Qualitative Results + +Figure 3 shows qualitative results of our models on the PROX Quantitative and Qualitative, and PiGraphs datasets. We observe that the direct output of the scene model (pre-trained on SUN-RGBD and Pix3D) without our holistic optimization contains inaccurate object attributes. Our proposed joint optimization method improves the overall accuracy of the predictions by constraining the orientations, positions and the sizes of the objects to be realistic with respect to each other. Also, human pose estimation task helps the optimization of the scene - the chair that the human sits on tend to have more accurate orientations than the other two chairs (column 2). Besides, the initially estimated ground plane could be very inaccurate (column 3), and our joint optimization process helps adjust the ground plane and improve the location of all objects at the same time. Although not obvious from the qualitative results in Figure 3, the estimated scene mesh helps refining the 3D locations of the human body mesh vertices through the joint losses, which is supported by our quantitative results in Tables 2 and 3. Finally, we show additional qualitative results in Section 2 of the Supplementary, and we discuss limitations and failure cases in Section 3 of the Supplementary. + +# 5. Conclusion + +In this work, we focus on the challenging problem of single view holistic reconstruction and joint optimization of human pose together with static scene. We propose the first holistically trainable model for reconstructing and jointly estimating both 3D human pose and 3D scene at the mesh + +
MetricsV2VPJEp. V2Vp. PJE
w/o Lscene200.43194.2773.2062.76
w/o body-ground joint192.18190.8472.2162.39
w/o object-ground joint196.32193.4372.4762.00
w/o Ljoint196.48194.3273.2462.96
w/o Ljoint212.24213.2673.6462.90
Full model192.21190.7872.7261.01
+ +Table 3. Ablations for human mesh estimation on PROX Quant. + +
TasksObject DetectionPose Estimation
MetricsIoU2DIoU3D2D (pix)3D (m)
w/o LsceneP58.119.116.50.472
w/o Lbody-grnd52.610.316.30.463
w/o Lobj-grnd49.311.217.90.523
w/o Ljoint74.626.418.40.493
w/o LjointP73.224.721.60.540
Full model75.626.315.80.460
+ +Table 4. Ablation results on PiGraphs. For the IoU metrics, higher values indicate better performance. For the pose estimation metrics (2D (pix) and 3D (m)), lower values are better. + +level. Through a joint optimization process that incorporates a comprehensive set of physical plausibility and priors, we show that our model outperforms state-of-the-art methods on either 3D scene understanding or 3D human pose estimation, on the PiGraphs and PROX Quantitative datasets. + +Acknowledgements This material is based upon work supported by the National Science Foundation under Grant No. 2026498, as well as a seed grant from the Institute for Human-Centered Artificial Intelligence (HAI) at Stanford University. + +# References + +[1] Luca Ballan, Aparna Taneja, Jürgen Gall, Luc Van Gool, and Marc Pollefeys. Motion capture of hands in action using discriminative salient points. In European Conference on Computer Vision, pages 640-653. Springer, 2012. 5 +[2] 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, pages 561-578. Springer, 2016. 2, 4 +[3] Zhe Cao, Gines Hidalgo, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Openpose: realtime multi-person 2d pose estimation using part affinity fields. arXiv preprint arXiv:1812.08008, 2018. 6 +[4] Yixin Chen, Siyuan Huang, Tao Yuan, Siyuan Qi, Yixin Zhu, and Song-Chun Zhu. Holistic++ scene understanding: Single-view 3d holistic scene parsing and human pose estimation with human-object interaction and physical commonsense. In Proceedings of the IEEE International Conference on Computer Vision, pages 8648-8657, 2019. 1, 2, 5, 6, 7 +[5] Lin Gao, Tong Wu, Yu-Jie Yuan, Ming-Xian Lin, Yu-Kun Lai, and Hao Zhang. Tm-net: Deep generative networks for textured meshes. arXiv preprint arXiv:2010.06217, 2020.1, 2,3 +[6] Stuart Geman. Statistical methods for tomographic image reconstruction. Bull. Int. Stat. Inst, 4:5-21, 1987. 5 +[7] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 9785-9795, 2019. 1, 3 +[8] Helmut Grabner, Juergen Gall, and Luc Van Gool. What makes a chair a chair? In CVPR 2011, pages 1529-1536. IEEE, 2011. 2 +[9] Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A papier-mâché approach to learning 3d surface generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 216-224, 2018. 4 +[10] Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5356-5364, 2019. 3, 4 +[11] 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. 2, 3, 4, 5, 6, 7 +[12] 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. 3 +[13] 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. 4 +[14] Siyuan Huang, Siyuan Qi, Yinxue Xiao, Yixin Zhu, Ying Nian Wu, and Song-Chun Zhu. Cooperative holistic + +scene understanding: Unifying 3d object, layout, and camera pose estimation. In Advances in Neural Information Processing Systems, pages 207-218, 2018. 1, 2, 3, 5, 6, 7 +[15] Siyuan Huang, Siyuan Qi, Yixin Zhu, Yinxue Xiao, Yuanlu Xu, and Song-Chun Zhu. Holistic 3d scene parsing and reconstruction from a single rgb image. In Proceedings of the European Conference on Computer Vision (ECCV), pages 187-203, 2018. 3 +[16] Moos Hueting, Pradyumna Reddy, Vladimir Kim, Ersin Yumer, Nathan Carr, and Niloy Mitra. Seethrough: finding chairs in heavily occluded indoor scene images. arXiv preprint arXiv:1710.10473, 2017. 3 +[17] Hamid Izadinia, Qi Shan, and Steven M Seitz. Im2cad. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5134-5143, 2017. 3 +[18] Wen Jiang, Nikos Kolotouros, Georgios Pavlakos, Xiaowei Zhou, and Kostas Daniilidis. Coherent reconstruction of multiple humans from a single image. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5579-5588, 2020. 5 +[19] 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 +[20] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 +[21] Lin Li, Salman Khan, and Nick Barnes. Silhouette-assisted 3d object instance reconstruction from a cluttered scene. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 0–0, 2019. 3 +[22] 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, 3 +[23] 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. 6 +[24] 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. 2 +[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. 6, 7 +[26] Aron Monszpart, Paul Guerrero, Duygu Ceylan, Ersin Yumer, and Niloy J Mitra. imapper: interaction-guided scene mapping from monocular videos. ACM Transactions on Graphics (TOG), 38(4):1-15, 2019. 2 +[27] Yinyu Nie, Xiaoguang Han, Shihui Guo, Yujuan Zheng, Jian Chang, and Jian Jun Zhang. Total3dunderstanding: Joint layout, object pose and mesh reconstruction for indoor scenes + +from a single image. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 55-64, 2020. 2, 3, 5, 7 +[28] Jorge Nocedal and Stephen J Wright. Nonlinear equations. Numerical Optimization, pages 270-302, 2006. 6 +[29] Junyi Pan, Xiaoguang Han, Weikai Chen, Jiapeng Tang, and Kui Jia. Deep mesh reconstruction from single rgb images via topology modification networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 9964-9973, 2019. 1, 2, 3, 4 +[30] 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, 4, 5, 6 +[31] 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 +[32] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE transactions on pattern analysis and machine intelligence, 39(6):1137-1149, 2016. 3, 6 +[33] 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. 2, 6 +[34] Alexander G Schwing, Sanja Fidler, Marc Pollefeys, and Raquel Urtasun. Box in the box: Joint 3d layout and object reasoning from single images. In Proceedings of the IEEE International Conference on Computer Vision, pages 353-360, 2013. 1 +[35] Daeyun Shin, Zhile Ren, Erik B Sudderth, and Charless C Fowlkes. 3d scene reconstruction with multi-layer depth and epipolar transformers. In Proceedings of the IEEE International Conference on Computer Vision, pages 2172-2182, 2019. 3 +[36] Shuran Song, Samuel P Lichtenberg, and Jianxiong Xiao. Sun rgb-d: A rgb-d scene understanding benchmark suite. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 567-576, 2015. 4, 6 +[37] Xingyuan Sun, Jiajun Wu, Xiuming Zhang, Zhoutong Zhang, Chengkai Zhang, Tianfan Xue, Joshua B Tenenbaum, and William T Freeman. Pix3d: Dataset and methods for single-image 3d shape modeling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2974-2983, 2018. 6 +[38] Xiao Sun, Bin Xiao, Fangyin Wei, Shuang Liang, and Yichen Wei. Integral human pose regression. In Proceedings of the European Conference on Computer Vision (ECCV), pages 529-545, 2018. 2 +[39] Shubham Tulsiani, Saurabh Gupta, David F Fouhey, Alexei A Efros, and Jitendra Malik. Factoring shape, pose, and layout from the 2d image of a 3d scene. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 302-310, 2018. 3 + +[40] Dimitrios Tzionas, Luca Ballan, Abhilash Srikantha, Pablo Aponte, Marc Pollefeys, and Juergen Gall. Capturing hands in action using discriminative salient points and physics simulation. International Journal of Computer Vision, 118(2):172-193, 2016. 5 +[41] Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In Proceedings of the European Conference on Computer Vision (ECCV), pages 52-67, 2018. 3 +[42] Andrei Zanfir, Elisabeta 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. 2 +[43] Jason Y Zhang, Sam Pepose, Hanbyul Joo, Deva Ramanan, Jitendra Malik, and Angjoo Kanazawa. Perceiving 3d human-object spatial arrangements from a single image in the wild. In European Conference on Computer Vision, pages 34-51. Springer, 2020. 2 \ No newline at end of file diff --git a/holistic3dhumanandscenemeshestimationfromsingleviewimages/images.zip b/holistic3dhumanandscenemeshestimationfromsingleviewimages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9a64d4daa8477ab334f047e5fcae1a1b20a5a804 --- /dev/null +++ b/holistic3dhumanandscenemeshestimationfromsingleviewimages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd0d9f3deb88c79ae92f2aca036002faf8d1e485a63922c90f89e17593e4c57d +size 424834 diff --git a/holistic3dhumanandscenemeshestimationfromsingleviewimages/layout.json b/holistic3dhumanandscenemeshestimationfromsingleviewimages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..90d48651fdadb1176c4b5019c7169880a14da90d --- /dev/null +++ b/holistic3dhumanandscenemeshestimationfromsingleviewimages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf04f0e15f4adbbfd99bd917d7bf484dbab3149fe822b5b0b241ce214f36e67d +size 349804 diff --git a/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_content_list.json b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6fd6283377ca084abac6d1d27e4c293df2231205 --- /dev/null +++ b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:673aaf0aecaa3d126d333ad3d4ae10a225c00871aba8733ce6bb175a46c4f64e +size 72779 diff --git a/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_model.json b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7dd42902fe0dc4317a43fe92c9eb0211dcb52909 --- /dev/null +++ b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c99a95077630e85cde8e9e372425ae422a46f842a6287f1e95e09110fc452c7 +size 92101 diff --git a/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_origin.pdf b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7afc6dd6c32c1966410520c08140126acaaeaf0f --- /dev/null +++ b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/73dcb792-99b2-40af-895f-fe4a707cd490_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:004421f257cd4887a19663ecdcd58900c6386b46a87f8a4b1de4e7501c455e49 +size 9266517 diff --git a/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/full.md b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5e5ae313add17cce5ddf0facffd3ec3f33df8ba3 --- /dev/null +++ b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/full.md @@ -0,0 +1,285 @@ +# Holistic 3D Scene Understanding from a Single Image with Implicit Representation + +Cheng Zhang $^{2*}$ Zhaopeng Cui $^{1*}$ Yinda Zhang $^{3*}$ Bing Zeng $^{2}$ Marc Pollefeys $^{4}$ Shuaicheng Liu $^{2\dagger}$ + +1 State Key Lab of CAD & CG, Zhejiang University + +$^{2}$ University of Electronic Science and Technology of China $^{3}$ Google $^{4}$ ETH Zürich + +# Abstract + +We present a new pipeline for holistic 3D scene understanding from a single image, which could predict object shapes, object poses, and scene layout. As it is a highly ill-posed problem, existing methods usually suffer from inaccurate estimation of both shapes and layout especially for the cluttered scene due to the heavy occlusion between objects. We propose to utilize the latest deep implicit representation to solve this challenge. We not only propose an image-based local structured implicit network to improve the object shape estimation, but also refine the 3D object pose and scene layout via a novel implicit scene graph neural network that exploits the implicit local object features. A novel physical violation loss is also proposed to avoid incorrect context between objects. Extensive experiments demonstrate that our method outperforms the state-of-the-art methods in terms of object shape, scene layout estimation, and 3D object detection. + +# 1. Introduction + +3D indoor scene understanding is a long-lasting computer vision problem and has tremendous impact on several applications, e.g., robotics, virtual reality. Given a single color image, the goal is to reconstruct the room layout as well as each individual object and estimate its semantic type in the 3D space. Over decades, there are plenty of works consistently improving the performance of such a task over two focal points of the competition. One is the 3D shape representation preserving fine-grained geometry details, evolving from the 3D bounding box, 3D volume, point cloud, to the recent triangulation mesh. The other is the joint inference of multiple objects and layout in the scene leveraging contextual information, such as co-occurring or relative locations among objects of multiple + +![](images/b79929f1d3f60d0182ead81293ac6f9e5462a476e25665c7660f25f990b8bb12.jpg) +Figure 1: Our proposed pipeline takes a single image as input, estimates layout and object poses, then reconstructs the scene with Signed Distance Function (SDF) representation. + +![](images/b73c248a658aa0b785c7fcf37a78fd286711e5dde29947f55d967027047b8242.jpg) + +categories. However, the cluttered scene is a double-blade sword, which unfortunately increases the complexity of 3D scene understanding by introducing large variations in object poses and scales, and heavy occlusion. Therefore, the overall performance is still far from satisfactory. + +In this work, we propose a deep learning system for holistic 3D scene understanding, which predicts and refines object shapes, object poses, and scene layout jointly with deep implicit representation. At first, similar to previous methods, we exploit standard Convolutional Neural Networks (CNN) to learn an initial estimation of 3D object poses, scene layout as well as 3D shapes. Different from previous methods using explicit 3D representation like volume or mesh, we utilize the local structured implicit representation of shapes motivated by [12]. Instead of taking depth images as input like [12], we design a new local implicit shape embedding network to learn the latent shape code directly from images, which can be further decoded to generate the implicit function for 3D shapes. Due to the power of implicit representation, the 3D shape of each object can be reconstructed with higher accuracy and finer surface details compared to other representations. + +Then, we propose a novel graph-based scene context network to gather information from local objects, i.e., bottom-up features extracted from the initial predictions, and learn to refine the initial 3D pose and scene layout via scene context information with the implicit representation. Being one of the core topics studied in scene understanding, the context has been achieved in the era of deep learning mainly + +from two aspects - the model architecture and the loss function. From the perspective of model design, we exploit the graph-based convolutional neural network (GCN) to learn context since it has shown competitive performance to learn context [58]. With the deep implicit representation, the learned local shape latent vectors are naturally a compact and informative feature measuring of the object geometries, which results in more effective context models compared to features extracted from other representations such as mesh. + +Not only the architecture, but the deep implicit representation also benefits the context learning on the loss function. One of the most basic contextual information yet still missing in many previous works - objects should not intersect with each other, could be easily applied as supervision by penalizing the existence of 3D locations with negative predicted SDF in more than one objects1. We define this constraint as a novel physical violation loss and find it particularly helpful in preventing intersecting objects and producing reasonable object layouts. + +Overall, our contributions are mainly in four aspects. First, we design a two-stage single image-based holistic 3D scene understanding system that could predict object shapes, object poses, and scene layout with deep implicit representation, then optimize the later two. Second, a new image-based local implicit shape embedding network is proposed to extract latent shape information which leads to superior geometry accuracy. Third, we propose a novel GCN-based scene context network to refine the object arrangement which well exploits the latent and implicit features from the initial estimation. Last but not least, we design a physical violation loss, thanks to the implicit representation, to effectively prevent the object intersection. Extensive experiments show that our model achieves the state-of-the-art performance on the standard benchmark. + +# 2. Related works + +Single Image Scene Reconstruction. As a highly ill-posed problem, single image scene reconstruction sets a high bar for learning-based algorithms, especially in a cluttered scene with heavy occlusion. The problem can be divided into layout estimation, object detection and pose estimation, and 3D object reconstruction. A simple version of the first problem is to simplify the room layout as a bounding box [19, 27, 30, 8, 38]. To detect objects and estimate poses in 3D space, Recent works [10, 21, 5] try to infer 3D bounding boxes from 2D detection by exploiting relationships among objects with a graph or physical simulation. At the same time, other works [24, 23, 22] further extend the idea to align a CAD model with similar style to each detected object. Still, the results are limited by the size of + +the CAD model database which results in an inaccurate representation of the scene. To tackle the above limitations of previous works, Total3D [33] is proposed as an end-to-end solution to jointly estimate the layout box and object poses while reconstructing each object from the detection and utilizing the reconstruction to supervise the pose estimation learning. However, they only exploit relationships among objects with features based on appearance and 2D geometry. + +Shape Representation. In the field of computer graphics, traditional shape representation methods include mesh, voxel, and point cloud. Some of the learning-based works try to encode the shape prior into a feature vector but stick to the traditional representations by decoding the vector into mesh [17, 50, 34, 42, 14], voxel [54, 7, 3, 52, 44] or point cloud [29, 1, 57]. Others try to learn structured representations which decompose the shape into simple shapes [28, 11, 36]. Recently, implicit surface function [31, 35, 56, 39, 37, 40] has been widely used as a new representation method to overcome the disadvantages of traditional methods (i.e. unfriendly data structure to neural network of mesh and point cloud, low resolution and large memory consumption of voxel). Most recent works [13, 12, 53] try to combine the structured and implicit representation which provides a physically meaningful feature vector while introducing significant improvement on the details of the decoded shape. + +Graph Convolutional Networks. Proposed by [15], graph neural networks or GCNs have been widely used to learn from graph-structured data. Inspired by convolutional neural networks, convolutional operation has been introduced to graph either on spectral domain [4, 9, 25] or non-spectral domain [18] which performs convolution with a message passing neural network to gather information from the neighboring nodes. Attention mechanism has also been introduced to GCN and has been proved to be efficient on tasks like node classification [48], scene graph generation [58] and feature matching [41]. Recently, GCN has been even used on super-resolution [59] which is usually the territory of CNN. In the 3D world which interests us most, GCN has been used on classification [51] and segmentation [46, 49, 51] on point cloud, which is usually an enemy representation to traditional neural networks. The most related application scenario of GCN with us is 3D object detection on points cloud. Recent work shows the ability of GCN to predict relationship [2] or 3D object detections [32] from point cloud data. + +# 3. Our method + +As shown in Fig. 2, the proposed system consists of two stages, i.e., the initial estimation stage, and the refinement stage. In the initial estimation stage, similar to [21, 33], a 2D detector is first adopted to extract the 2D bounding + +![](images/acdc1cce5ed2a692bfd15819d7b0ddc1dac928e1028c717192e207c8bab1b6d8.jpg) +Figure 2: Our proposed pipeline. We initialize the layout estimation and 3D object poses with LEN and ODN from prior work [33], then refine them with Scene Graph Convolutional Network (SGCN). We utilize a Local Implicit Embedding Network (LIEN) to encode latent code for LDIF decoder [12] and to extract implicit features for SGCN. With the help of LDIF and marching cube algorithm, object meshes are extracted then rotated, scaled, and put into places to construct the scene. + +box from the input image, followed by an Object Detection Network (ODN) to recover the object poses as 3D bounding boxes and a new Local Implicit Embedding Network (LIEN) to extract the implicit local shape information from the image directly, which can further be decoded to infer 3D geometry. The input image is also fed into a Layout Estimation Network (LEN) to produce a 3D layout bounding box and relative camera pose. In the refinement stage, a novel Scene Graph Convolutional Network (SGCN) is designed to refine the initial predictions via the scene context information. As 2D detector, LEN, ODN has the standard architecture similar to prior works [21, 33], in this section, we will describe the details of the novel SGCN and LIEN in detail. Please refer to our supplementary materials for the details of our 2D detector, LEN, ODN. + +# 3.1. Scene Graph Convolutional Network + +As shown in Fig. 2, motivated by Graph R-CNN [58], we model the whole 3D scene as a graph $G$ , in which the nodes represent the objects, the scene layout, and their relationships. The graph is constructed starting from a complete graph with undirected edges between all objects and layout nodes, which allows information to flow among objects and the scene layout. Then, we add relation nodes to each pair of neighboring object/layout nodes. Considering the nature of directional relation [26], we add two relation nodes between each pair of neighbors in different directions. + +It is well known that the input features are the key to an effective GCN [50]. For different types of nodes, we design features carefully from different sources as follows. For each node, features from different sources are flattened and concatenated into a vector, then embedded into a node representation vector with the same length using MLP. + +Layout Node. We use the feature from the image encoder of LEN, which encodes the appearance of layout, and the parameterized output of layout bounding box and camera pose from LEN, as layout node features. We also concatenate the camera intrinsic parameters normalized by the image height into the feature to add camera priors. + +Object Node. We collect the appearance-relationship feature [33] from ODN, and the parameterized output of object bounding box from ODN, along with the element centers in the world coordinate and analytic code from LIEN (which we will further describe in the next section). We also use the one-hot category label from the 2D detector to introduce semantic information to SGCN. + +Relationship Node. For nodes connecting two different objects, the geometry feature [20, 47] of 2D object bounding boxes and the box corner coordinates of both connected objects normalized by the image height and width are used as features. The coordinates are flattened and concatenated in the order of source-destination, which differentiate the relationships of different directions. For nodes connecting objects and layouts, since the relationship is presumably different from object-object relationship, we initialize the representations with constant values, leaving the job of inferring reasonable relationship representation to SGCN. + +For a graph with $N$ objects and 1 layout, object-Layout nodes and relationship nodes can then be put into two matrixes $Z^{o} \in \mathbb{R}^{d \times (N + 1)}$ and $Z^{r} \in \mathbb{R}^{d \times (N + 1)^{2}}$ . + +Since the graph is modeled with different types of nodes, which makes a difference in the information needed from different sources to destinations, we define independent message passing weights for each of the source-destination types. We denote the linear transformation from source node to destination node with type $a$ and $b$ as $W^{ab}$ , in which + +node types can be source object (or layout) $s$ , destination object (or layout) $d$ , and relationships $r$ . With adjacent matrix $\alpha^{sr} = \alpha^{dr} = 1 - I_{N + 1}$ , the representation of object and layout nodes can be updated as + +$$ +z _ {i} ^ {o} = \sigma \left(z _ {i - 1} ^ {o} + \overbrace {W ^ {\text {s d}} Z ^ {o}} ^ {\text {M e s s a g e f r o m L a y o u t o R e c o n s t}} + \overbrace {W ^ {s r} Z ^ {r} \alpha^ {s r} + W ^ {d r} Z ^ {r} \alpha^ {d r}} ^ {\text {M e s s a g e f r o m N e i g h b o r i n g R e l a t i o n s h i p s}}\right), \tag {1} +$$ + +and the relationship node representations can be updated as + +$$ +z _ {i} ^ {r} = \sigma \left(z _ {i - 1} ^ {r} + \underbrace {W ^ {r s} Z ^ {o} \alpha^ {r s} + W ^ {r d} Z ^ {o} \alpha^ {r d}} _ {\text {M e s s a g e s f r o m L a y o u t o r N e i g h b o r i n g O b j e c t s}}\right), \tag {2} +$$ + +After four steps of message passing, independent MLPs are used to decode object node representations into residuals for corresponding object bounding box parameters $(\delta, d, s, \theta)$ , and layout node representation into residuals for initial layout box $\left(C, s^l, \theta^l\right)$ and camera pose $\mathbf{R}(\beta, \gamma)$ . Please refer to our supplementary or [33] for the details of the definition. The shape codes can be also refined in the scene graph, while we find that it doesn't improve empirically as much as for the layout and object poses in our pipeline because our local implicit embedding network, which will be introduced in the following, is powerful enough to learn accurate shapes. + +# 3.2. Local Implicit Embedding Network + +With a graph constructed for each scene, we naturally ask what features help SGCN effectively capture contextual information among objects. Intuitively, we expect features that well describe 3D object geometry and their relationship in 3D space. Motivated by Genova et al. [12], we propose to utilize the local deep implicit representation as the features embedding object shapes due to its superior performance for single object reconstruction. In their model, the function is a combination of 32 3D elements (16 with symmetry constraints), with each element described with 10 Gaussian function parameters analytic code and 32-dim latent variables (latent code). The Gaussian parameters describe the scale constant, center point, radii, and Euler angle of every Gaussian function, which contains structured information of the 3D geometry. We use analytic code as a feature for object nodes in SGCN, which should provide information on the local object structure. Furthermore, since the centers of the Gaussian functions presumably correspond to centers of different parts of an object, we also transform them from the object coordinate system to the world coordinate system as a feature for every object node in SGCN. The transformation provides global information about the scene, which makes SGCN easier to infer relationships between objects. The above two features make up the implicit features of LIEN. + +As LDIF [12] is designed for 3D object reconstruction from one or multiple depth images, we design a new image + +based Local Implicit Embedding Network (LIEN) to learn the 3D latent shape representation from the image which is obviously a more challenging problem. Our LIEN consists of a Resnet-18 as image encoder, along with a three-layer MLP to get the analytic and latent code. Additionally, in order to learn the latent features effectively, we concatenate the category code with the image feature from the encoder to introduce shape priors to the LIEN, which improves the performance greatly. Please refer to our supplementary material for the detailed architecture of the proposed LIEN. + +# 3.3. Loss Function + +Losses for Initialization Modules. When training LIEN along with LDIF decoder individually, we follow [12] to use the shape element center loss $\mathcal{L}_c$ with weight $\lambda_{c}$ and point sample loss, + +$$ +\mathcal {L} _ {p} = \lambda_ {n s} \mathcal {L} _ {n s} + \lambda_ {u s} \mathcal {L} _ {u s}, \tag {3} +$$ + +where $\mathcal{L}_{ns}$ and $\mathcal{L}_{us}$ evaluates $L_{2}$ losses for near-surface samples and uniformly sampled points. When training LEN and ODN, we follow [21, 33] to use classification and regression loss for every output parameter of LEN and ODN, + +$$ +\mathcal {L} _ {L E N} = \sum_ {y \in \left\{\beta , \gamma , C, s ^ {l}, \theta^ {l} \right\}} \lambda_ {y} \mathcal {L} _ {y}, \tag {4} +$$ + +$$ +\mathcal {L} _ {O D N} = \sum_ {x \in \{\delta , d, s, \theta \}} \lambda_ {x} \mathcal {L} _ {x}. \tag {5} +$$ + +Joint Refinement with Object Physical Violation Loss. For the refinement stage, we aim to optimize the scene layout and object poses using the scene context information by minimizing the following loss function, + +$$ +\mathcal {L} _ {j} = \mathcal {L} _ {L E N} + \mathcal {L} _ {O D N} + \lambda_ {c o} \mathcal {L} _ {c o} + \lambda_ {p h y} \mathcal {L} _ {p h y}. \tag {6} +$$ + +Besides $\mathcal{L}_{LEN}$ , $\mathcal{L}_{ODN}$ and cooperative loss $\mathcal{L}_{co}$ [33], we propose a novel physical violation loss as a part of joint loss for the scene graph convolutional network to make sure that objects will not intersect with each other. The neural SDF representation used by local implicit representation gives us a convenient way to propagate gradient from undesired geometry intersection back to the object pose estimation. To achieve this, we first sample points inside objects. For each object $i$ , we randomly sample points inside the bounding box of each object, along with the center points of Gaussian elements as point candidates. We then queue these candidates into LDIF decoder of the object and filter out points outside object surfaces to get inside point samples $\mathbb{S}_i$ . Finally, we queue $\mathbb{S}_i$ into the LDIF decoder of the k-nearest objects $\mathbb{N}_i$ to verify if they have intersection with other objects (if the predicted label is "inside"). We follow [12] to compute a $L_2$ loss between the predicted labels of intersected points with the ground truth surface label (where we + +![](images/f6b14119c97f6efbcce01fd179814421844c7619ba88d98608b927fe7e624057.jpg) +Figure 3: Object physical violation loss. Based on the insight that objects should not intersect, we punish points inside neighboring objects (demonstrated as $p$ , which has negative LDIF values in both object A and object B). With error back-propagated through the LDIF decoder, intersected objects should be pushed back from each other, reducing intersection resulting from bad object pose estimation. + +use 1, 0, 0.5 for "outside", "inside", "surface" labels). The object physical violation loss can be defined as: + +$$ +\mathcal {L} _ {p h y} = \frac {1}{N} \sum_ {i = 1} ^ {N} \frac {1}{| \mathbb {S} _ {i} |} \sum_ {\mathbf {x} \in \mathbb {S} _ {i}} \| \operatorname {r e l u} (0. 5 - \operatorname {s i g} (\alpha \mathrm {L D I F} _ {i} (\mathbf {x}))) \|, \tag {7} +$$ + +where $\mathrm{LDIF}_i(\mathbf{x})$ is the LDIF for object $i$ to decode a world coordinate point $\mathbf{x}$ into LDIF value. A sigmoid is applied on the LDIF value (scaled by $\alpha$ ) to get the predicted labels, and a ReLU is applied to consider only the intersected points. As shown in Fig. 3, the loss punishes intersected sample points thus push both objects away from each other to prevent intersections. + +# 4. Experiments + +In this section, we compare our method with state-of-the-art 3D scene understanding methods in various aspects and provide an ablation study to highlight the effectiveness of major components. + +# 4.1. Experiment Setup + +Datasets. We follow [33] to use two datasets to train each module individually and jointly. We use two datasets for training and evaluation. 1) Pix3D dataset [45] is presented as a benchmark for shape-related tasks including reconstruction, providing 9 categories of 395 furniture models and 10,069 images with precise alignment. We use the mesh fusion pipeline from Occupancy Network [31] to get watertight meshes for LIEN training and evaluate LIEN on original meshes. 2) SUN RGB-D dataset [43] contains 10K RGB-D indoor images captured by four different sensors and is densely annotated with 2D segmentation, semantic labels, 3D room layout, and 3D bounding boxes with object orientations. Follow Total3D [33], we use the train/test split from [14] on the Pix3D dataset and the official train/test split on the SUN RGB-D dataset. The object labels are mapped from NYU-37 to Pix3D as presented by [33]. + +Metrics. We adopt the same evaluation metrics with [21, 33], including average 3D Intersection over Union + +![](images/dcc45a14a81f522d4bb0d8a8d35eac82ff1e3dbc443e84a3dd4d6326a022acfd.jpg) +Figure 4: Object reconstruction qualitative comparison. We use the implementation from [33] for AtlasNet [16]. Our results contain finer details and have more smooth surfaces. + +(IoU) for layout estimation; mean absolute error for camera pose; average precision (AP) for object detection; and chamfer distance for single-object mesh generation from single image. + +Implementation. We use the outputs of the 2D detector from Total3D as the input of our model. We also adopted the same structure of ODN and LEN from Total3D. LIEN is trained with LDIF decoder on Pix3D with watertight mesh, using Adam optimizer with a batch size of 24 and learning rate decaying from 2e-4 (scaled by 0.5 if the test loss stops decreasing for 50 epochs, 400 epochs in total) and evaluated on the original non-watertight mesh. SGCN is trained on SUN RGB-D, using Adam optimizer with a batch size of 2 and learning rate decaying from 1e-4 (scaled by 0.5 every 5 epochs after epoch 18, 30 epochs in total). We follow [33] to train each module individually then jointly. When training SGCN individually, we use $\mathcal{L}_j$ without $\mathcal{L}_{phy}$ , and put it into the full model with pre-trained weights of other modules. In joint training, we adopt the observation from + +
Categorybedbookcasechairdesksofatabletoolwardrobemiscmean
AtlasNet [16]9.036.918.378.596.2419.466.954.7840.0512.26
TMN [34]7.785.936.867.084.2517.424.134.0923.689.03
MGN [33]5.996.565.325.933.3614.193.123.8326.938.36
Ours4.113.965.457.855.6111.732.394.3124.656.72
+ +Table 1: Object reconstruction comparison. We report the Chamfer distance scaled with the factor of $10^{3}$ . We follow [33] to align the reconstructed mesh to ground-truth with ICP then sample 10K points from the output and the ground-truth meshes. Although trained on watertight meshes with more noise, our results still show better results. + +
MethodbedchairsofatabledeskdressernightstandsinkcabinetlampmAP
3DGP [6]5.622.313.241.23-------
HoPR [22]58.2913.5628.3712.124.7913.718.802.180.482.4114.47
CooP [21]57.7115.2136.6731.1619.9015.9811.3615.9510.473.2821.77
Total3D [33]60.6517.5544.9036.4827.9321.1917.0118.5014.515.0426.38
Ours89.3235.1469.1057.3749.0329.2741.3433.8133.9311.9045.21
+ +[33] that object reconstruction depends on clean mesh for supervision, to fix the weights of LIEN and LDIF decoder. + +# 4.2. Comparison to State-of-the-art + +In this section, we compare to the state-of-the-art methods for holistic scene understand from aspects including object reconstruction, 3D object detection, layout estimation, camera pose prediction, and scene mesh reconstruction. + +3D Object Reconstruction. We first compare the performance of LIEN with previous methods, including AtlasNet [16], TMN [34], and Total3D [33], for the accuracy of the predicted geometry on Pix3D dataset. All the methods take as input a crop of image of the object and produce 3D geometry. To make a fair comparison, the one-hot object category code is also concatenated with the appearance feature for AtlasNet [16] and TMN [34]. For our method, we run a marching cube algorithm on 256 resolution to reconstruct the mesh. The quantitative comparison is shown in Table 1. Our method produces the most accurate 3D shape compared to other methods, yielding the lowest mean Chamfer Distance across all categories. Qualitative results are shown in Fig. 4. AtlasNet produces results in limited topology and thus generates many undesired surfaces. MGN mitigates the issue with the capability of topology modification, which improves the results but still leaves obvious artifacts and unsmooth surface due to the limited representation capacity of the triangular mesh. In contrast, our method produces 3D shape with correct topology, smooth surface, and fine-grained details, which clearly shows the advantage of the deep implicit representation. + +3D Object Detection. We then evaluate the 3D object detection performance of our model. Follow [33, 21], we use mean average precision (mAP) with the threshold of 3D bounding box IoU set at 0.15 as the evaluation metric. The quantitative comparison to state-of-the-art methods [6, 22, 21, 33] is shown in Table 2. Our method performs + +Table 2: 3D object detection comparison. For CooP, we report the better results from [33] trained on NYU-37 object labels. Our method outperforms SOTA, benefiting from a better understanding of the object relationships and the scene context. + +
MethodLayout IoUCam pitchCam roll
3DGP [6]19.2--
Hedau [19]-33.853.45
HoPR [22]54.97.603.12
CooP [21]56.93.282.19
Total3D [33]59.23.152.09
Ours64.42.982.11
+ +Table 3: 3D layout and camera pose estimation comparison. Our method outperforms SOTA by $5.2\%$ in layout estimation while on par with SOTA on camera pose estimation. + +consistently the best over all semantic categories and significantly outperforms the state-of-the-art (i.e. improving AP by $18.83\%$ ). Figure 5 shows some qualitative comparison. Note how our method produces object layout not only more accurate but also in reasonable context compared to Total3D, e.g. objects are parallel to wall direction. + +Layout Estimation. We also compare the 3D room layout estimation with Total3D [33] and other state-of-the-arts [6, 22, 21]. The quantitative evaluation is shown in Table 3 (Layout IoU). Overall, our method outperforms all the baseline methods. This indicates that the GCN is effective in measuring the relation between layout and objects and thus benefits the layout prediction. + +Camera Pose Estimation. Table 3 also shows the comparison over camera pose prediction, following the evaluation protocol of Total3D. Our method achieves $5\%$ better camera pitch and slightly worse camera roll. + +Holistic Scene Reconstruction. To our best knowledge, Total3D [33] is the only work achieving holistic scene reconstruction from a single RGB, and thus we compare to it. Since no ground truth is presented in SUN RGB-D dataset, we mainly show qualitative comparison in Fig. 5. Compared to Total3D, our model has less intersection and estimates more reasonable object layout and direction. We consider this as a benefit from a better understanding of scene context by GCN. Our proposed physical violation loss $\mathcal{L}_{phy}$ also contributes to less intersection. + +![](images/bae410d1014104d348fbfa0e1511537b505510739d36f910ac21350c78ac1d00.jpg) +Figure 5: Qualitative comparison on object detection and scene reconstruction. We compare object detection results with Total3D [33] and ground truth in both oblique view and camera view. The results show that our method gives more accurate bounding box estimation and with less intersection. We compare scene reconstruction results with Total3D in camera view and observe more reasonable object poses. + +# 4.3. Ablation Study + +In this section, we verify the effectiveness of the proposed components for holistic scene understanding. As shown in Table 4, we disable certain components and evaluate the model for 3D layout estimation and 3D object detection. We do not evaluate the 3D object reconstruction since it is highly related to the usage of deep implicit representation, which has been already evaluated in Section 4.2. + +Does GCN Matter? To show the effectiveness of GCN, we first attach the GCN to the original Total3D to improve the object and scene layout (Table 4, Total3D+GCN). For the difference between MGN of Total3D and LIEN of ours, we replace deep implicit features with the feature from image encoder of MGN and use their proposed partial Chamfer loss $\mathcal{L}_g$ instead of $\mathcal{L}_{phy}$ . Both object bounding box and scene layout are improved. We also train a version of our model without the GCN (Ours-GCN), and the performance drops significantly. Both experiments show that GCN is effective in capturing scene context. + +Does Deep Implicit Feature Matter? As introduced in Section 3.2, the LDIF representation provides informative node features for the GCN. Here we demonstrate the contribution from each component of the latent representation. Particularly, we remove either element centers or analytic code from the GCN node feature (Ours-element, Ours-analytic), and find both hurts the performance. This indicates that the complete latent representation is helpful in pursuing better scene understanding performance. + +Does Physical Violation Loss Matter? Additionally, we evaluate the effectiveness of the physical violation loss. We train our model without it (Ours- $\mathcal{L}_{phy}$ ), and also observe performance drop for both scene layout and object 3D bounding box in Table 4. We refer to supplementary material for qualitative comparison. + +Evaluating on Other Metrics. We also test our method in other aspects including supporting relation, geometry accuracy, and room layout as shown in Table 5. 1) We calculate the mean distance between the predicted bottom of on-floor objects and the ground truth floor to measure the supporting relationship. As ground truth, an object is considered to be on-floor if its bottom surface is within $15\mathrm{cm}$ to the floor. While GCN significantly improves the metric, $\mathcal{L}_{phy}$ slightly hurts possibly because it tends to push objects away. Further qualitative results are shown in the supplementary material. Besides, we also measure the average volume of the collision per scene between objects (Coll Vol), and our full model effectively prevent collision. 2) We follow Total3D [33] to evaluate the alignment between scene reconstruction and ground truth depth map with global loss $\mathcal{L}_g$ , and our full model performs the best. 3) We also project the predicted layout onto the image and evaluate with image based metrics [8, 38]. Our full model achieves the best on both corner and pixel errors. Overall, the GCN and $\mathcal{L}_{phy}$ benefit on all + +
SettingLayout IoU (↑)Detection mAP (↑)
Total3D59.2526.38
Total3D+GCN62.4937.04
Ours-GCN60.0427.47
Ours-element64.2242.05
Ours-analytic63.7643.10
Ours-Phy63.5243.33
Full64.4145.21
+ +Table 4: Ablation study. We evaluate layout estimation with layout IoU and 3D object detection with mAP. + +
SettingSup Err (cm)\( {\mathcal{L}}_{g} \)Coll Vol (dm3/scene)Corner Err (%)Pixel Err (%)
Total3D26.721.43-13.2920.51
Ours-GCN24.181.4116.6413.1720.05
Ours-\( {\mathcal{L}}_{phy} \)13.351.1413.6511.6017.91
Full14.711.1113.5511.4517.60
+ +Table 5: Ablation study on other metrics. We compare on supporting error, $\mathcal{L}_g$ (in units of $10^{-2}$ ), average collision volume, corner error, and pixel error. + +![](images/5ef3e3fd5dda5bad25224e223286e875f9a4434cbd2220624f0b557ccf445dda.jpg) +(a) Input +Figure 6: Qualitative results on ObjectNet3D dataset [55] (row 1) and the layout estimation dataset in [19] (row 2). + +![](images/943ce25cdfb652a03a772767a0d3e2bb9fa937760c717c371de6452c3c3e7a28.jpg) +(b) 3D Detection + +![](images/13a561517d3756d44873683806255c9b05e4ee93f185351e55ccc40ca20cbb7e.jpg) +(c) Reconstruction + +these aspects. + +# 4.4. Generalization to other datasets + +We also show qualitative results of our method tested on the 3D detection dataset ObjectNet3D [55] and the layout estimation dataset in [19] without fine-tuning in Fig. 6. Our method shows good generalization capability and performs reasonably well on these unseen datasets. + +# 5. Conclusion + +We have presented a deep learning model for holistic scene understanding by leveraging deep implicit representation. Our model not only reconstructs accurate 3D object geometry, but also learns better scene context using GCN and a novel physical violation loss, which can deliver accurate scene and object layout. Extensive experiments show that our model improves various tasks in holistic scene understanding over existing methods. A promising future direction could be exploiting object functionalities for better 3D scene understanding. + +Acknowledgement: This research was supported by National Natural Science Foundation of China (NSFC) under grants No.61872067 and No.61720106004. + +# 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. PMLR, 2018. +[2] Armen Avetisyan, Tatiana Khanova, Christopher Choy, Denver Dash, Angela Dai, and Matthias Nießner. Scenecad: Predicting object alignments and layouts in rgb-d scans. arXiv preprint arXiv:2003.12622, 2020. +[3] Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Generative and discriminative voxel modeling with convolutional neural networks. arXiv preprint arXiv:1608.04236, 2016. +[4] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann Le-Cun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. +[5] Yixin Chen, Siyuan Huang, Tao Yuan, Siyuan Qi, Yixin Zhu, and Song-Chun Zhu. Holistic++ scene understanding: Single-view 3d holistic scene parsing and human pose estimation with human-object interaction and physical commonsense. arXiv preprint arXiv:1909.01507, 2019. +[6] Wongun Choi, Yu-Wei Chao, Caroline Pantofaru, and Silvio Savarese. Understanding indoor scenes using 3d geometric phrases. In IEEE Conf. Comput. Vis. Pattern Recog., 2013. +[7] 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 Eur. Conf. Comput. Vis., pages 628-644. Springer, 2016. +[8] Saumitro Dasgupta, Kuan Fang, Kevin Chen, and Silvio Savarese. Delay: Robust spatial layout estimation for cluttered indoor scenes. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. +[9] Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Adv. Neural Inform. Process. Syst., pages 3844-3852, 2016. +[10] Yilun Du, Zhijian Liu, Hector Basevi, Ales Leonardis, Bill Freeman, Josh Tenenbaum, and Jiajun Wu. Learning to exploit stability for 3d scene parsing. In Adv. Neural Inform. Process. Syst., 2018. +[11] Lin Gao, Jie Yang, Tong Wu, Yu-Jie Yuan, Hongbo Fu, Yu-Kun Lai, and Hao Zhang. Sdm-net: Deep generative network for structured deformable mesh. ACM Trans. Graph., 38(6):1-15, 2019. +[12] Kyle Genova, Forrester Cole, Avneesh Sud, Aaron Sarna, and Thomas Funkhouser. Local deep implicit functions for 3d shape. In IEEE Conf. Comput. Vis. Pattern Recog., pages 4857-4866, 2020. +[13] Kyle Genova, Forrester Cole, Daniel Vlasic, Aaron Sarna, William T Freeman, and Thomas Funkhouser. Learning shape templates with structured implicit functions. In Int. Conf. Comput. Vis., pages 7154-7164, 2019. +[14] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Int. Conf. Comput. Vis., pages 9785-9795, 2019. +[15] Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Proceedings. + +2005 IEEE International Joint Conference on Neural Networks, 2005., volume 2, pages 729-734. IEEE, 2005. +[16] Thibault Groueix, Matthew Fisher, Vladimir G. Kim, Bryan Russell, and Mathieu Aubry. AtlasNet: A Papier-Mâché Approach to Learning 3D Surface Generation. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. +[17] Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A papier-mâché approach to learning 3d surface generation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 216-224, 2018. +[18] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Adv. Neural Inform. Process. Syst., pages 1024-1034, 2017. +[19] Varsha Hedau, Derek Hoiem, and David Forsyth. Recovering the spatial layout of cluttered rooms. In Int. Conf. Comput. Vis., 2009. +[20] Han Hu, Jiayuan Gu, Zheng Zhang, Jifeng Dai, and Yichen Wei. Relation networks for object detection. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. +[21] Siyuan Huang, Siyuan Qi, Yinxue Xiao, Yixin Zhu, Ying Nian Wu, and Song-Chun Zhu. Cooperative holistic scene understanding: Unifying 3d object, layout, and camera pose estimation. In Adv. Neural Inform. Process. Syst., 2018. +[22] Siyuan Huang, Siyuan Qi, Yixin Zhu, Yinxue Xiao, Yuanlu Xu, and Song-Chun Zhu. Holistic 3d scene parsing and reconstruction from a single rgb image. In Eur. Conf. Comput. Vis., 2018. +[23] Moos Hueting, Pradyumna Reddy, Vladimir Kim, Ersin Yumer, Nathan Carr, and Niloy Mitra. Seethrough: finding chairs in heavily occluded indoor scene images. arXiv preprint arXiv:1710.10473, 2017. +[24] Hamid Izadinia, Qi Shan, and Steven M Seitz. Im2cad. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. +[25] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. +[26] 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. Int. J. Comput. Vis., 123(1):32-73, 2017. +[27] David C Lee, Martial Hebert, and Takeo Kanade. Geometric reasoning for single image structure recovery. In IEEE Conf. Comput. Vis. Pattern Recog., 2009. +[28] Jun Li, Kai Xu, Siddhartha Chaudhuri, Ersin Yumer, Hao Zhang, and Leonidas Guibas. Grass: Generative recursive autoencoders for shape structures. ACM Trans. Graph., 36(4):1-14, 2017. +[29] Chen-Hsuan Lin, Chen Kong, and Simon Lucey. Learning efficient point cloud generation for dense 3d object reconstruction. arXiv preprint arXiv:1706.07036, 2017. +[30] Arun Mallya and Svetlana Lazebnik. Learning informative edge maps for indoor scene layout prediction. In Int. Conf. Comput. Vis., 2015. +[31] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: + +Learning 3d reconstruction in function space. In IEEE Conf. Comput. Vis. Pattern Recog., pages 4460-4470, 2019. +[32] Mahyar Najibi, Guangda Lai, Abhijit Kundu, Zhichao Lu, Vivek Rathod, Thomas Funkhouser, Caroline Pantofaru, David Ross, Larry S Davis, and Alireza Fathi. Dops: Learning to detect 3d objects and predict their 3d shapes. In IEEE Conf. Comput. Vis. Pattern Recog., pages 11913-11922, 2020. +[33] Yinyu Nie, Xiaoguang Han, Shihui Guo, Yujuan Zheng, Jian Chang, and Jian Jun Zhang. Total3dunderstanding: Joint layout, object pose and mesh reconstruction for indoor scenes from a single image. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. +[34] Junyi Pan, Xiaoguang Han, Weikai Chen, Jiapeng Tang, and Kui Jia. Deep mesh reconstruction from single rgb images via topology modification networks. In Int. Conf. Comput. Vis., pages 9964-9973, 2019. +[35] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. arXiv preprint arXiv:1901.05103, 2019. +[36] Despoina Paschalidou, Ali Osman Ulusoy, and Andreas Geiger. Superquadrics revisited: Learning 3d shape parsing beyond cuboids. In IEEE Conf. Comput. Vis. Pattern Recog., pages 10344-10353, 2019. +[37] Songyou Peng, Michael Niemeyer, Lars Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy networks. arXiv preprint arXiv:2003.04618, 2020. +[38] Yuzhuo Ren, Shangwen Li, Chen Chen, and C-C Jay Kuo. A coarse-to-fine indoor layout estimation (cfile) method. In ACCV, 2016. +[39] 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 Int. Conf. Comput. Vis., pages 2304-2314, 2019. +[40] Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. Pifuhd: Multi-level pixel-aligned implicit function for high-resolution 3d human digitization. In IEEE Conf. Comput. Vis. Pattern Recog., pages 84-93, 2020. +[41] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In IEEE Conf. Comput. Vis. Pattern Recog., pages 4938-4947, 2020. +[42] Edward J Smith, Scott Fujimoto, Adriana Romero, and David Meger. Geometrics: Exploiting geometric structure for graph-encoded objects. arXiv preprint arXiv:1901.11461, 2019. +[43] Shuran Song, Samuel P Lichtenberg, and Jianxiong Xiao. Sun rgb-d: A rgb-d scene understanding benchmark suite. In IEEE Conf. Comput. Vis. Pattern Recog., 2015. +[44] David Stutz and Andreas Geiger. Learning 3d shape completion from laser scan data with weak supervision. In IEEE Conf. Comput. Vis. Pattern Recog., pages 1955-1964, 2018. +[45] Xingyuan Sun, Jiajun Wu, Xiuming Zhang, Zhoutong Zhang, Chengkai Zhang, Tianfan Xue, Joshua B Tenenbaum, and William T Freeman. Pix3d: Dataset and methods for single-image 3d shape modeling. In IEEE Conf. Comput. Vis. Pattern Recog., pages 2974-2983, 2018. + +[46] Gusi Te, Wei Hu, Amin Zheng, and Zongming Guo. Rgcnn: Regularized graph cnn for point cloud segmentation. In ACM Int. Conf. Multimedia, pages 746-754, 2018. +[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 Adv. Neural Inform. Process. Syst., 2017. +[48] Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. +[49] Lei Wang, Yuchun Huang, Yaolin Hou, Shenman Zhang, and Jie Shan. Graph attention convolution for point cloud semantic segmentation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 10296-10305, 2019. +[50] Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In *Eur. Conf. Comput. Vis.*, 2018. +[51] 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 Trans. Graph., 38(5):1-12, 2019. +[52] 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 Adv. Neural Inform. Process. Syst., pages 82-90, 2016. +[53] Rundi Wu, Yixin Zhuang, Kai Xu, Hao Zhang, and Baoquan Chen. Pq-net: A generative part seq2seq network for 3d shapes. In IEEE Conf. Comput. Vis. Pattern Recog., pages 829-838, 2020. +[54] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In IEEE Conf. Comput. Vis. Pattern Recog., pages 1912-1920, 2015. +[55] Yu Xiang, Wonhui Kim, Wei Chen, Jingwei Ji, Christopher Choy, Hao Su, Roozbeh Mottaghi, Leonidas Guibas, and Silvio Savarese. Objectnet3d: A large scale database for 3d object recognition. In Eur. Conf. Comput. Vis., pages 160-176. Springer, 2016. +[56] Qiangeng Xu, Weiyue Wang, Duygu Ceylan, Radomir Mech, and Ulrich Neumann. Disn: Deep implicit surface network for high-quality single-view 3d reconstruction. arXiv preprint arXiv:1905.10711, 2019. +[57] Guandao Yang, Xun Huang, Zekun Hao, Ming-Yu Liu, Serge Belongie, and Bharath Hariharan. Pointflow: 3d point cloud generation with continuous normalizing flows. In Int. Conf. Comput. Vis., pages 4541-4550, 2019. +[58] Jianwei Yang, Jiasen Lu, Stefan Lee, Dhruv Batra, and Devi Parikh. Graph r-cnn for scene graph generation. In Eur. Conf. Comput. Vis., pages 670-685, 2018. +[59] Shangchen Zhou, Jiawei Zhang, Wangmeng Zuo, and Chen Change Loy. Cross-scale internal graph neural network for image super-resolution. Adv. Neural Inform. Process. Syst., 33, 2020. \ No newline at end of file diff --git a/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/images.zip b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..46b039f503d1df7e648a18f5515e36f5b30254ba --- /dev/null +++ b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db3bb5d459c299e8c0ebb19c788f66924ed3f556c298c008c3b0b7bb684bea77 +size 847865 diff --git a/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/layout.json b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..88234a98aa833f826393d3e66f28a6ea618a614b --- /dev/null +++ b/holistic3dsceneunderstandingfromasingleimagewithimplicitrepresentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f93d29de72b3b8973fd41cffe3b2f2b4035252a717458f68dbb1c614fab26ee4 +size 340529 diff --git a/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_content_list.json b/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3013a71c6bdbca93cceb60aad67e500fd0222683 --- /dev/null +++ b/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8534bbcfdcbd1bf8e212a6386939fd3f944fde43ee56e3eaccc0241dc4003790 +size 80987 diff --git a/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_model.json b/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b8319617c8252dbd10ec722dadb3d1b7a4d02dfa --- /dev/null +++ b/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7fa6e9ca5c1033b553d1864a77bbee01b592904de137d235f6ee7f7d625945c +size 99161 diff --git a/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_origin.pdf b/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f7d2859818c6dffe101bfa59c881ffca07c59bc3 --- /dev/null +++ b/homeactiongenomecooperativecompositionalactionunderstanding/0dc14a22-56a1-430a-933a-268a56c386a1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:794fc570af301330aab0445b7ad927063b6f801ab6cb9ffb2b03f80c411051e6 +size 1595458 diff --git a/homeactiongenomecooperativecompositionalactionunderstanding/full.md b/homeactiongenomecooperativecompositionalactionunderstanding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6e33ab7f9c476ef9c380b02f850fc22c0d4e116a --- /dev/null +++ b/homeactiongenomecooperativecompositionalactionunderstanding/full.md @@ -0,0 +1,297 @@ +# Home Action Genome: Cooperative Compositional Action Understanding + +Nishant Rai $^{1}$ , Haofeng Chen $^{1}$ , Jingwei Ji $^{1}$ , Rishi Desai $^{1}$ , Kazuki Kozuka $^{2}$ , Shun Ishizaka $^{2}$ , Ehsan Adeli $^{1}$ , Juan Carlos Niebles $^{1}$ + +$^{1}$ Stanford University $^{2}$ Panasonic Corporation + +http://www.homeactiongenome.org + +# Abstract + +Existing research on action recognition treats activities as monolithic events occurring in videos. Recently, the benefits of formulating actions as a combination of atomic actions have shown promise in improving action understanding with the emergence of datasets containing such annotations, allowing us to learn representations capturing this information. However, there remains a lack of studies that extend action composition and leverage multiple viewpoints and multiple modalities of data for representation learning. To promote research in this direction, we introduce Home Action Genome (HOMAGE): a multi-view action dataset with multiple modalities and view-points supplemented with hierarchical activity and atomic action labels together with dense scene composition labels. Leveraging rich multi-modal and multi-view settings, we propose Cooperative Compositional Action Understanding (CCAU), a cooperative learning framework for hierarchical action recognition that is aware of compositional action elements. CCAU shows consistent performance improvements across all modalities. Furthermore, we demonstrate the utility of co-learning compositions in few-shot action recognition by achieving $28.6\%$ mAP with just a single sample. + +# 1. Introduction + +Action understanding in videos is a critical task with various use-cases and real-world applications, from robotics [1, 2] and human-computer interaction [3] to healthcare [4, 5] and elderly behavior monitoring [6, 7]. Despite the recent success of deep learning methods for image classification, complex and holistic action or event understanding remains an elusive task. + +There are several challenges associated with the task of action understanding. The inherent variability in executing complex activities poses one of the most critical difficulties in building action understating models. To understand these challenges, it is essential to understand what actions are composed of. As opposed to bounding boxes in the object detection task, actions are composed of various parts + +![](images/1599670638c72c8a10421ee1aae1aeb2631d5d8a565bd785b3ad36474344c277.jpg) +Figure 1: Given an activity instance (e.g., 'do laundry') and corresponding multiple views, we compute features using modality-specific deep encoders ( $f$ modules). Different modalities may capture different semantic information regarding the action. Cooperatively training all modalities together allows us to see improved performance. We utilize training using both video-level and atomic action labels to allow both the videos and atomic actions to benefit from the compositional interactions between the two. As discussed in the results, we see significantly improved performance when using the above components together. + +spanned in space and time. For instance, the action of "laundry" involves multiple entities, e.g., humans, objects, and their relationships, and is composed of a number of atomic actions. Such partonomy of actions [8, 9, 10] both in space and time defines a hierarchical structure. Furthermore, to capture the variability in executing complex activities, understanding each part (e.g., body limbs, objects, or atomic actions) becomes crucial. Since actions happen in the 3D world, a holistic understanding of the world requires capturing the subtle movements or parts using multiple modalities (e.g., RGB and audio) and from multiple viewpoints. + +Each of these challenges has previously been separately investigated using different datasets and advanced methods. For instance, numerous datasets were put together for generic action recognition and spatio-temporal localization in YouTube or broadcasting third-person videos, such as Kinetics [11], Charades [12], ActivityNet [13], UCF101 [14]. Other datasets such as EPIC Kitchens [15] were used for ego-centric action recognition. Action Genome [10] focused on using scene information in action recognition, + +while others [16] focused on hierarchical action modeling from events to low-level atomic actions. Several studies target learning from long instructional videos and release datasets [17, 18, 19, 20] for the same, exploring the partonomy of actions in long sequences. Others also focused on observing and recognizing actions from multiple views, such as LEMMA [21] and HumanEva [22]. In parallel, there have been numerous recent advances in contrastive and cooperative learning [23, 24] applied to multi-modal and multi-view datasets as a self-supervised pre-training strategy to improve downstream recognition results. Despite all these advances, action understanding and generalizability of such models remains a challenging problem due to complexities brought by their complicated nature and numerous object interactions. Multi-modal approaches [25, 26, 27] have shown superior performance in tackling such issues. However, there is still a need for a benchmark that unifies all these challenges and tasks. In this paper, we release a dataset along with a novel method for hierarchical action recognition to tackle these problems. + +We introduce a new benchmark for action recognition, Home Action Genome (HOMAGE), that includes multimodal synchronized videos from multiple viewpoints along with hierarchical action and atomic-action labels. Actions in homes are challenging as we deal with long-term actions, interactions with objects, and frequent occlusions. Having multiple views and sensors to handle occlusions and scene graph information to capture object interaction allows us to tackle these complexities. In addition, synchronous videos provide implicit alignment that facilitates multi-modal training. Additionally, access to sensor information enables future research in privacy-aware recognition where we avoid audio-visual modalities. HOMAGE also provides temporal annotations of high-level activity and low-level atomic action supplemented with spatio-temporal scene-graphs. Annotations regarding interaction of objects within actions and atomic actions within high-level actions enable research in explainable video understanding, early action prediction, and long-range action recognition. + +For this new benchmark, we introduce a novel method to perform simultaneous co-training with multiple modalities (RGB, audio, and annotations of scene composition) and viewpoints that enable the learning of rich video representations. Training involves a co-training strategy that leverages information from all views and modalities to build the representation space. During inference, we set up different experiments and observe improved action recognition performance even when only a single modality is used, which suggests training on HOMAGE improves performance with no need for other modalities during inference. In this paper, we explore audio-visual data (of interest to the vision community). Future sensor-fusion work can further exploit other modalities we release (e.g., for privacy-preserving studies). + +HOMAGE aims to unify various aspects and challenges of action recognition, specifically targeting multi-modal and compositional perception for home actions. Moreover, the presence of a large number of modalities in our dataset encourages research in areas such as privacy-aware recognition and sensor-fusion. To summarize, our contributions are as follows: + +(1) We introduce a new dataset, Home Action Genome (HOMAGE) with multiple views and modalities densely annotated with scene graphs and hierarchical activity labels (overall activity and atomic actions). +(2) We propose a novel learning framework (CCAU) that leverages multiple modalities and hierarchical action labels and improves the performance of the baselines trained on each individual modality. We demonstrate the benefits of our approach with an improvement of $+6.4\%$ using only ego-view during inference. + +# 2. Related Work + +Action Recognition in Videos. Action recognition has continuously been an important direction for the computer vision research community. The success of 2D convolutions in image classification allowed frame-level action recognition to become a viable approach. Subsequently, two-stream networks for action recognition [25] have led to many competitive approaches, which demonstrates using multiple modalities such as optical flow helps improve performance considerably. Their work motivated other approaches that model temporal motion features together with spatial image features from videos. [28, 29] demonstrated that replacing 2D convolutions with 3D convolutions leads to further performance improvements. Recent approaches such as I3D [30] inflate a 2D convolutional network into 3D to benefit from the use of pre-trained models. 3D-ResNet [31] adds residual connections building a very deep 3D network leading to improved performance. + +Related Datasets. MSR-Action3D [32] provides depth map sequences containing 20 actions of interactions with game consoles. [33, 34, 35, 36] use the Microsoft Kinect sensor to collect multi-modal action data with RGB and depth map sequences. NTU RGB+D [35] consists of RGB, depth map, infrared frames with 3D human joints annotations with 40 human subjects, and 80 distinct camera viewpoints. However, for action labels, each video in these datasets has a single video-level label and thus tough to use for action localization applications. + +Other datasets [13, 33, 37, 21, 10] provide annotations for temporally localized actions. MMAcT [37] is a largescale action recognition benchmark multimodal data including RGB videos, keypoints, acceleration, gyroscope, and orientation. It provides an ego-view and 4 third-person views and temporally localized actions. However, MMAcT does not provide bounding box annotations for spatial local + +ization and relationships between objects. LEMMA [21] is a recent multi-view and multi-agent human activity recognition dataset, providing bounding box annotations on third-person views and compositional action labels annotated with predefined action templates and verbs/nouns. However, they do not provide bounding boxes of objects the subjects (human) interact with. Action Genome [10] is built upon the videos from Charades [38], with the additional annotation of spatio-temporal scene graph labels. However, it only provides videos from a single camera view. HOMAGE aims to provide 1) multiple modalities to promote multimodal video representation learning, 2) high-level activity labels and temporally localized atomic action labels, and 3) scene graphs that provide spatial localization cues for both the subject and the object and their relationship. + +Multi-Modal Learning. Multiple modalities of videos are rich sources of information for both supervised [25] and self-supervised learning [26, 27, 39]. [40, 27] introduce a contrastive learning framework to maximize the mutual information between modalities in a self-supervised manner. The method achieves state-of-the-art results on unsupervised learning benchmarks while being modality-agnostic and scalable to any number of modalities. Two stream networks for action recognition [25] have led to many competitive approaches, which demonstrate using even derivable modalities such as optical flow helps improve performance considerably. There have been approaches [41, 39, 27, 26] utilizing diverse modalities, sometimes derivable from one other, to learn better representations. + +# 3. Home Action Genome (HOMAGE) + +Home Action Genome (HOMAGE) is a new benchmark for action recognition that includes multi-modal synchronized video data from multiple viewpoints (ego-view, third-person) with both high-level activity and low-level action definitions. HOMAGE focuses on actions in residential settings due to the challenges involved i.e. complexity and long duration of actions, object interactions, and frequent occlusions. HOMAGE provides multiple views and sensors to tackle these challenges. We describe the design, data collection, and data annotation process of the HOMAGE dataset in this section. + +Activities and Scenarios. Our goal is to build an activity recognition dataset that depicts behaviors observed in living spaces. To cover daily activities, we employed the activity taxonomy in the American Time Use Survey (ATUS) [44]. The ATUS taxonomy organizes activities according to two key dimensions: 1) social interactions and 2) the locations of the activities. The ATUS coding lexicon contains a large variety of daily human activities organized under 18 top-level categories such as Personal Care, Work-Related, Education, and Household activities. + +Each participant was asked to perform tasks according to + +![](images/c41a76b593e00a8e55e5d6e7c1c65ed471016a0663bbdc0c3cd8d04be3136efd.jpg) +Figure 2: Multiple Views of Home Action Genome (HOMAGE) Dataset. Each sequence has one ego-view video as well as at least one or more synchronized third person views. + +the instructions assigned. To make sure the behaviors are as natural as possible, we did not specify detailed procedures and time limits within the activities, and let the individual participants perform the activity freely. + +Data Collection. We recorded 27 participants in kitchens, bathrooms, bedrooms, living rooms, and laundry rooms in two different houses. We used 12 sensor types: cameras (RGB), infrared (IR), microphone, RGB light, light, acceleration, gyro, human presence, magnet, air pressure, humidity, temperature. We refer to the set of data collected from a given activity with different modalities as one synchronized action sequence. Sensors were attached to several locations in the room for third-person views and to the participants' heads for ego-view. On average, there are more than 3 views per action sequence. We synchronized the sensor recordings of all views giving us synced videos which allowed for ease of use without requiring any additional post-processing. + +Ground-truth Annotation. Home Action Genome is a dataset with (1) video-level activity labels, (2) temporally localized atomic activity labels, and (3) spatio-temporal scene-graph labels. Figure 3 visualizes our annotation pipeline. For the atomic actions, we annotated all atomic actions performed during the activities. Note that while each video can only have a single activity label, a given frame can be assigned with multiple atomic action labels when atomic actions overlap with each other. For the action graph, we annotated the person performing the action and the objects they interact with on videos from third-person views. We uniformly sampled 3 or 5 to annotate scene graphs across the range of each atomic action interval (3 for intervals less than 3 seconds and 5 otherwise). This action-oriented dynamic sampling provides more labels where more actions occur which is very valuable for describing complex primitive actions. [45] also shows this sampling scheme performs remarkably well. + +Dataset Statistics. We annotated 75 activities and 453 atomic actions in 1,752 synchronized sequences and 5,700 videos in total. We split the dataset into 1,388 train sequences and two test splits containing 198 and 166 se + +
DatasetSeqhrsModalitiesViewsHLHL ClassesTLTL ClassesTL InsSG
RGBD-HuDaAct [34]1.19K4621✓12----
UCF101 [14]13K2711✓101----
ActivityNet [13]28K64811✓200----
Kinetics-700 [11]650K1.79K11✓700----
AVA [42]43010811--✓801.58M-
PKU-MMD [33]1.08K5033--✓5120K-
EPIC-Kitchens [15]-5511--✓12539.6K-
MMAct [37]36K-65--✓3736.8K-
Action Genome [10]10K8211--✓15766.5K✓
Breakfast [43]-7711✓10✓48--
LEMMA [21]32410.124✓\( 15^1 \)✓86311.8K-
Ours1.75K25.4122~5✓75✓45324.6K✓
+ +Table 1: Comparison between related datasets and HOMAGE. (Seq: number of synchronized sequences, Modalities: sensor modalities not including annotation data or derived data like optical flow, Views: number of synchronized viewpoints for a given sample, HL: high-level activity label (often assigned one per video), TL: temporally localized atomic action label, SG: scene graph). HOMAGE provides rich multi-modal action data, including dense annotations such as scene graphs, along with hierarchical action labels. + +![](images/fec51e597ee23f566bcafd628fdc85281bd591d2f3d88f2a74e7bdc434c2d16b.jpg) +Figure 3: HOMAGE annotation pipeline: For every action, we uniformly sample 3 or 5 frames across the action and annotate the bounding boxes of the person performing the action along with the objects they interact with. We also annotate the pairwise relationships between the subject and the objects. + +quences each. Each sequence has a high-level activity category. We annotated atomic actions in each of these videos by providing the start and end frames and the category of the atomic action. There are 20,039 training, 2,062, and 2,468 atomic action sequences in the three splits mentioned above respectively. For scene graphs, we annotate one third-person view video in each synchronized sequence by providing bounding boxes of the subject and the object along with the relationship between them. There are 86 object classes (excluding "person"), and 29 relationship classes in the dataset. Overall, there are annotations of 497,534 + +bounding boxes and 583,481 relationships. + +The duration of atomic actions in HOMAGE is often short in time: there are about $60\%$ of the atomic actions under 2 seconds and $80\%$ under 5 seconds. For scene graphs, some of the most common objects are "countertop," "clothes," and "table"; and the most common relationships include "in front of," "looking at," and "holding." More details on the statistics are available in the supplement. + +Relevance of Modalities. In this paper, we only study the effect of modalities of interest to the vision community; however, HOMAGE provides rich sensor information which could be useful for privacy-aware recognition. Modalities such as angular velocity, acceleration, and geomagnetic sensors can be used to extract motion information in ego-view, and environmental sensors, e.g., temperature and humidity can capture changes in the scene before and after an activity. Thermal sensors can extract people or heat sources (e.g., extracting heat sources can be useful for recognition in places such as kitchens), and human presence and light sensors can determine the presence of people without using visual cues. Although not explored in detail in this paper, future sensor-fusion work can exploit these other modalities as well. + +# 4. Cooperative Compositional Action Understanding (CCAU) + +We discuss the benefits of HOMAGE and propose our approach Cooperative Compositional Action Understanding (CCAU) allowing us to exploit the rich annotations present in the dataset for improved action understanding. We discuss how CCAU employs simultaneous cooperative training with multiple modalities to improve the model's understanding of actions and the associated atomic-actions. We start by discussing a few preliminaries and proceed + +to discuss different components of our model. Note that "modalities" refer to both different camera views, as well as, modes such as images, audio, and scene graphs. + +# 4.1. Preliminaries + +A video $V$ is a sequence of $T$ frames with resolution $H\times W$ and $C$ channels, $\{\mathbf{i}_1,\mathbf{i}_2,\dots ,\mathbf{i}_T\}$ , where $\mathbf{i}_t\in \mathbb{R}^{H\times W\times C}$ . Assume $T = N*K$ , where $N$ is the number of blocks and $K$ denotes the number of frames per block. We partition a video clip $V$ into $N$ disjoint blocks $V = \{\mathbf{x}_1,\mathbf{x}_2,\ldots ,\mathbf{x}_N\}$ where $\mathbf{x}_j\in \mathbb{R}^{K\times H\times W\times C}$ and a deep encoder $f(\cdot)$ transforms each input block $x_{j}$ into its latent representation $z_{j} = f(x_{j})$ . An aggregation function, $g(\cdot)$ takes a sequence $\{z_1,z_2,\dots ,z_j\}$ as input and generates a context representation $c_{j} = g(z_{1},z_{2},\dots ,z_{j})$ . In our setup, $z_{j}\in \mathbb{R}^{H^{\prime}\times W^{\prime}\times D}$ and $c_{j}\in \mathbb{R}^{D}$ . $D$ represents the embedding size and $H^{\prime}$ , $W^{\prime}$ represent down-sampled resolutions as different regions in $z_{j}$ represent features for different spatial locations. We define $c = F(V)$ , where $F(\cdot) = g(f(\cdot))$ . In our experiments, $H^{\prime} = 4$ , $W^{\prime} = 4$ , $D = 256$ . The computed representations are then utilized in order to perform per-block classification to generate the necessary predictions, e.g., activity label or atomic-action label. For multiple modalities, we define $c_{m} = F_{m}(V_{m})$ , where $V_{m}$ , $c_{m}$ and $F_{m}$ represent the video input, context feature and composite encoder for modality $m$ , respectively. + +RGB Videos with Multiple Viewpoints. An interesting aspect of HOMAGE is the presence of multiple viewpoints, specifically, a single ego-centric viewpoint and numerous third-person views. For simplicity, we treat these multiple viewpoints as two separate modalities, i.e., ego-view and third-person view. Each of these modalities has a dedicated encoder to generate clip-level features. + +Audio. Along with having multiple camera viewpoints, we also have associated audio clips for each viewpoint. For simplicity, we only use the audio associated with the egocentric view. For each audio clip, we generate the associated log-mel spectrogram [46] and treat it as an image input. Following numerous other works [47, 40], we utilize a VGG19 backbone to generate a representation for the passed-in spectrogram. + +Scene Graph. A scene graph in a given frame $G$ contains a set of objects $O = \{o_1, o_2, \ldots\}$ and a set of relationships $R = \{r_1, r_2, \ldots\}$ . Each object $o_j$ contains an object ID, bounding box coordinates of the object, and object category. Each relationship $r_j$ contains the object IDs for both the subject and the object of the relationship, as well as the category of the relationship. + +# 4.2. Multi-Modal Cooperative Learning + +As discussed earlier, we define $c_{m} = F_{m}(V_{m})$ , where $V_{m}$ , $c_{m}$ and $F_{m}$ represent the input, context feature, and composite encoder for modality $m$ , respectively. We simul + +taneously train encoders for each modality while ensuring that the views improve with cooperation. Such a training regime allows us to observe improved performance during inference even when using a single modality. + +Intuitively, we expect different modalities to impart complementary information to other modalities during training. This can be similar to existing approaches such as student-teacher frameworks or knowledge distillation [48, 37]. However, as we demonstrate in the experiments section, CCAU manages to learn better representations. We argue this is because the unidirectional formulation of student/teacher does not suit such setups as different modalities serve as a collective cohort of students as opposed to one of them being significantly dominant compared to others. CCAU utilizes contrastive multi-modal losses to promote cooperation between the learners. + +Noise Contrastive Estimation (NCE) [49, 50, 51] constructs a binary classification task where a classifier is fed with real and noisy samples with the training objective to distinguish them. We utilize a simple task of performing alignment between different modes $m, m'$ . The task becomes choosing the correct in-sync instance amongst multiple noisy instances. Similar to [27], we use an NCE loss over our feature embeddings $c$ described in Eq. (1). $c_i^m$ represents the feature embedding for the $m^{th}$ modality's $i^{th}$ temporal block. This effectively becomes a cross-entropy loss distinguishing one positive pair from all the negative pairs present in a video. In a batch setting with multiple video clips, it is possible to have more inter-clip negative pairs. The objective function for a single pair of modalities will hence be: + +$$ +\mathcal {L} _ {\text {a l i g n}} ^ {m, m ^ {\prime}} = - \sum_ {i} \left(\log \frac {\exp \left(c _ {i} ^ {m} \cdot c _ {i} ^ {m ^ {\prime}}\right)}{\sum_ {j} \exp \left(c _ {i} ^ {m} \cdot c _ {j} ^ {m ^ {\prime}}\right)}\right). \tag {1} +$$ + +To extend this to multiple views, we utilize the same objective for all pairs and simultaneously optimize: + +$$ +\mathcal {L} _ {a l i g n} = \sum_ {m, m ^ {\prime}} \mathcal {L} _ {a l i g n} ^ {m, m ^ {\prime}}. +$$ + +Self-supervised attention [52] has been shown to be useful to auto-learn associations between different modalities. We model attention by predicting importance weights over the grid. We predict $H' \times W'$ values $\alpha_{i,j}$ representing weights of each feature corresponding to spatial location $(i,j)$ . Given feature $c$ of shape $D \times H' \times W'$ , we extract $c_{agg}$ from it as given in Eq. (2). Where $\tau$ refers to the temperature. Further details are provided in the appendix. + +$$ +c _ {a g g} = \sum_ {i, j} p _ {i, j} \cdot c _ {i, j}, p _ {i, j} = \frac {\exp \left(\alpha_ {i , j} / \tau\right)}{\sum_ {a , b} \exp \left(\alpha_ {a , b} / \tau\right)} \tag {2} +$$ + +# 4.3. Compositional Action Recognition + +In addition to the multi-modal nature of HOMAGE, another one of its differentiating factors is having fine-grained + +atomic-action labels along with video-level action labels. The compositional nature of atomic-actions is useful in determining both the overall activity as well as learning relationships between atomic-actions and high-level actions. + +We leverage the compositionality of atomic-actions and activities in CCAU by simultaneously utilizing both activity and atomic action level labels in our learning task. The intuition being our model will be able to learn the composition and relationships between atomic-actions and activities improving its understanding. We utilize the contextual features $c$ in order to predict class labels for both video and atomic-action classes. The video action prediction task is a standard one-hot classification task, while we formulate the atomic-action prediction task as multi-target classification. We represent their corresponding losses as $\mathcal{L}_{video} = \mathcal{L}_v$ and $\mathcal{L}_{atomic} = \mathcal{L}_a$ . The overall compositional loss is represented by $\mathcal{L}_{composition} = \mathcal{L}_c$ . + +We explore two variants to define $\mathcal{L}_c$ . The first involves manually chosen hyper-parameters modulating each component, i.e., $\mathcal{L}_c = \mathcal{L}_v + \lambda \mathcal{L}_a$ . The second automatically learns the appropriate multi-task weights [53]. The numbers reported in the paper represent use the first approach with $\lambda = 10$ . For details refer to the appendix. + +# 5. Experiments + +We discussed the rich annotations in Home Action Genome (HOMAGE) that allows us to explore multiple aspects previously not possible due to the lack of such datasets. CCAU utilizes cooperative and compositional learning to learn improved representations for action understanding. Co-training with other modalities such as audio imparts additional structure and knowledge to individual modalities, also leading to improved single-view performance. We design and discuss multiple quantitative experiments to verify the validity of our claims. We also conduct qualitative experiments to gain deeper insights into our approach. In this section, we briefly go over our experiment framework. Additional details are provided in the appendix. + +# 5.1. Implementation Details + +Following our design discussed earlier to allow inference using individual modalities, we use separate encoders for each. We use different designs as mentioned in Section 4.1. Images. In all of our experiments, we treat ego-view as one modality and all third-person view videos as another. We resize each input frame to the size of $128 \times 128$ . We employ a 3D-ResNet similar to [31] as the encoder $f(\cdot)$ . Following [54], we only expand the convolutional kernels present in the last two residual blocks to be 3D ones and use 3D-ResNet18 for our experiments, denoted as ResNet18. A weak aggregation function $g(\cdot)$ is used to learn a strong encoder $f(\cdot)$ . Specifically, we use a one-layer Convolutional Gated Recurrent Unit (ConvGRU) with kernel size $(1,1)$ as + +
MethodAudioEgo3rd Person
Single Modality28.531.321.8
Cooperative Ours33.337.724.7
Static KD28.532.321.8
Cooperative KD32.132.123.5
+ +Table 2: Video classification accuracy. Cooperative Ours outperforms the baselines. Cooperative KD performs better than its counterparts, further validating benefits of cooperative learning. + +$g(\cdot)$ . The weights are shared amongst all spatial positions in the feature map. This design allows the aggregation function to propagate features in the temporal axis. + +We use a dropout [55] with $p = 0.1$ to compute the hidden state at each time step. A shallow two-layer perceptron is used as the predictive function $\phi(\cdot)$ . Recall $z_{j}^{\prime} = Pool(z_{j})$ where $z_{j}^{\prime} \in R_{D}$ . We utilize stacked max pool layers as $Pool(\cdot)$ . To construct blocks to pass to the network, we uniformly choose one out of every 3 frames. Then, they are grouped into 8 blocks containing 5 frames each. Since the videos are usually 30fps, each block roughly covers 0.5 seconds and 8 blocks sums to about 4 seconds worth of action. Given the 256D final representations, we pass this through fully connected layers to compute the final classification where we use a dropout of $p = 0.5$ . + +Audio. To process audio clips, we convert audio to MP3 format, compute log-mel spectrograms [46], and pass it through a VGG19-like convolutional architecture. We sample fixed intervals of the spectrogram image to represent the action clip. Similar to the image encoder, we have fully connected layers to perform classification. + +# 5.2. Quantitative Results + +In this section, we analyze various aspects of our proposed model. To objectively evaluate model performance, classification accuracy is utilized as a proxy for learned representation quality. Evaluation is performed on two different splits of HOMAGE. Although models have access to other modalities during training, this is not the case during inference. Therefore, evaluation only involves inference using individual modalities. However, we see an improvement despite this constraint due to co-training. We also study the improvement imparted through compositional learning with both high-level action and atomic-action labels. + +# 5.2.1 Comparisons with Baselines + +In this section, we investigate the effectiveness of cooperative multi-modal learning for action understanding. We study the impact of cooperative learning and compare the performance to knowledge distillation approaches. + +Impact of Cooperation. Our co-operative training approach hinges on the assumption that multi-modal information helps in improving overall representation quality. To + +verify our hypothesis, we study the performance of CCAU compared along with a few other comparable approaches. (1) Single Modality Training (SM) - Training of modalities independently (2) Cooperative Ours Training (CT) - Co-Training of all modalities and individual inference. Table 2 summarizes our results demonstrating a consistent improvement in performance across modalities. + +Comparison with Knowledge Distillation. Given the potential applicability of student-teacher approaches in this setting, we also study their performance compared to our approach. We study two variants. (1) Static Knowledge Distillation (SKD) - We transfer knowledge from other trained modalities into the ego-view encoder. (2) Cooperative Knowledge Distillation (CKD) - To isolate the effect of cooperation leading to improved performance, we also propose a cooperative version of knowledge distillation that allows all modalities to simultaneously improve (details in the appendix). Table 2 summarizes our results demonstrating the performance difference between these approaches. We notice a performance improvement when utilizing cooperative KD compared to the static variant. CT outperforms CKD even though both allow cooperation, due to the incorrect student-teacher hierarchy even with a symmetric knowledge distillation setup. CT allows cooperation in a softer manner without an implicit assumption of hierarchy. + +# 5.2.2 Impact of Additional Modalities + +We saw the benefits of Cooperative Training in the previous section and established the performance improvements accompanying training with multiple modalities. In this section, we look at the implications modalities have on performance by studying the impact of training with multiple modalities. We consider 1) Training each modality separately; 2) Joint training of multi-camera views, i.e., Ego and $3rd$ Person RGB video clips, and 3) Joint training of multi-camera views with ego-centric audio clips. + +Activity Classification. Table 3 summarizes the results of our approach trained with different modalities. Compared with training with single views individually, co-training with the two video views and video + audio consistently improves the performance together with more modalities. + +Atomic Action Classification. We also investigate the impact of cooperative training on multi-target classification for atomic actions. Table 4 summarizes our results. The Mean Average Precision scores for each modality are reported. + +# 5.2.3 Cooperative Compositional Learning + +We analyze the role of both our proposed soft attention module and CCAU's compositional learning framework. + +Impact of Co-training with Attention. Table 5 summarizes the results of the cross-modality co-training experiment with and without attention module. With attention, the + +
MethodAudioEgo3rd
Single Modality28.531.321.8
Coop - Ego + 3rd-35.123.5
Coop - Ego + 3rd + Aud33.337.724.7
+ +Table 3: Co-training encoders with different modalities on activity classification. We see a distinct performance improvement across modalities as we co-train with increasing number of modes, possibly due to the presence of rich complementary information. + +
MethodAudioEgo3rd Person
Single Modality7.020.511.7
Cooperative13.228.515.3
+ +Table 4: Effect of co-training encoders with different modalities on atomic action classification. The numbers reported are support weighted mAP scores. + +
MethodEgo3rd Person
Cooperative32.519.1
Cooperative with Attention34.820.8
+ +Table 5: Effect of co-training encoders using the proposed attention module. We see a consistent performance improvement across both modalities. The $3rd$ person mode benefits as attention allows potential localization of the region of interest - despite the lack of dense associations between the ego and $3rd$ person view. + +model yields better accuracy on the video modalities compared with its counterpart. The model can implicitly learn localization and correspondence between views to form representations with view-invariant information. + +Impact of Compositional Learning. Our compositional learning framework hinges on the assumption that simultaneously learning both activity labels and atomic action labels leads to improved performance. To verify this hypothesis, we compare different variants such as (1) train with activity labels, (2) train with atomic-action labels, (3) train with both activity and atomic actions without cooperation and (4) CCAU - cooperatively train with both video and atomic actions. In Table 6, we see a consistent improvement across both activity and atomic-action performance. + +# 5.2.4 Few-Shot Compositional Action Learning + +We have discussed the benefits of our cooperative and compositional approach. Intuitively, predicting activities should be easier if we have an idea of the atomic-actions composing the higher-order action. We now showcase the ability and potential of CCAU to generalize to rare actions. + +Setup. In our few-shot action recognition experiments, we split the 75 action classes into a base set of 60 classes and a novel set of 15 classes. We use CCAU as our feature extractor. Note that we do not finetune the backbone. Next, we train each model with only k examples from each novel class, where $\mathrm{k} = 1, 5, 10, 20$ . Finally, we evaluate the trained + +
MethodAccmAP
AudioEgo3rd PersonAudioEgo3rd Person
Cooperative - Activity28.331.117.0---
Cooperative - Atomic Actions---5.918.59.5
Compositional23.532.116.216.426.312.2
Cooperative Compositional29.334.919.221.729.313.8
+ +Table 6: Effect of co-training encoders with images and audio on activity classification. We see a distinct performance improvement compared to the Ego, $3rd$ Person Co-Training case; due to the rich complementary information present in audio encoders. Missing numbers denote the model was not trained for the associated subtask. Results are averaged over the two test splits. + +
Method - EgoAtomic Action - mAP
1 shot5 shot10 shot20 shot
Single Modality22.435.338.640.6
CCAU28.636.939.449.4
+ +Table 7: Compositional learning with few shot learning. With compositional action understanding, CCAU demonstrates much better generalizability than other baseline, showing the potential of co-learning with compositional labels in improving action understanding. Results are averaged over the two testing splits. + +models on all examples of novel classes in the validation set. Results. We report few-shot experiment performance in Table 7. CCAU improves the single modality baseline on all 1, 5, 10, 20-shot experiments. Furthermore, CCAU shows a $+6.2\%$ 1-shot and $+8.8\%$ 20-shot mAP improvement. + +# 5.3. Qualitative Results + +One of the motivating factors behind CCAU was the benefits of co-training different encoders together to gain higher-order perspectives provided through different modalities. We observe the learned structure across modalities results in the emergence of higher-order semantics without additional supervision, e.g., sensible class relationships and good feature representations. Jointly training with modalities gives rise to better representations and byproducts such as localization of visual regions of interest. + +t-SNE Visualization. We explore t-SNE visualizations of our learned representations. For clarity, only a few action classes are displayed. We loosely order the action classes according to their relationships; classes having similar colors are semantically similar. Fig. 4 summarizes our results. + +Multi-Modal Localization. A by-product of learning attention using contrastive losses is the ability to localize potential points of interest in images (details in the appendix). + +# 6. Conclusion + +We introduced Home Action Genome (HOMAGE), a human action recognition benchmark with multiple modalities and viewpoints with hierarchical activity and atomic action labels. We also proposed CCAU, a cooperative and compositional learning method to leverage information across multiple modalities along with action compositions + +![](images/54296f2c20c06c023844474957851c41ac83e6f012d17ee16b8432bab62c9a1e.jpg) +Figure 4: t-SNE visualization of Ego-View features from CCAU trained with ego, $3rd$ and audio modalities. The color mapping represents the relationships between the action classes, e.g., Red: Clothes; Green: Grooming; Blue: Kitchen. CCAU is able to learn meaningful clusters by utilizing compositional information. + +![](images/13d0cf7a82361d717c8016bb91f12cda49bb811b1af72bef0a0c2f1034e36f91.jpg) + +in HOMAGE for better representation learning. Due to the nature of cooperative learning, CCAU allows inference on individual modalities where no privileged information and other modalities are available. We demonstrated the benefits of learning atomic-actions compositions leading to significantly improved results in a few-shot learning setting. + +With rich multi-modal data and compositional annotations, HOMAGE facilitates research in subfields such as multi-modal action recognition and localization, explainable action understanding, and reasoning with spatiotemporal scene graphs. We hope HOMAGE promotes research in multi-modal cooperative learning and action understanding using compositions for richer feature representations in human action recognition as well as raises interest in generalizable video understanding. + +Acknowledgement. This work has been supported by Panasonic. This article solely reflects the opinions and conclusions of its authors and not Panasonic or any entity associated with Panasonic. + +# References + +[1] F. Rezazadegan, S. Shirazi, B. Upcroft, and M. Milford, "Action recognition: From static datasets to moving robots," + +in 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 3185-3191, IEEE, 2017. +[2] B. Liu, E. Adeli, Z. Cao, K.-H. Lee, A. Shenoi, A. Gaidon, and J. C. Niebles, "Spatiotemporal relationship reasoning for pedestrian intent prediction," IEEE Robotics and Automation Letters, vol. 5, no. 2, pp. 3485-3492, 2020. +[3] T. Santini, W. Fuhl, and E. Kasneci, "Calibme: Fast and unsupervised eye tracker calibration for gaze-based pervasive human-computer interaction," in Proceedings of the 2017 chi conference on human factors in computing systems, pp. 2594-2605, 2017. +[4] A. Haque, A. Milstein, and L. Fei-Fei, "Illuminating the dark spaces of healthcare with ambient intelligence," Nature, vol. 585, no. 7824, pp. 193–202, 2020. +[5] M. Lu, K. Poston, A. Pfefferbaum, E. V. Sullivan, L. Fei-Fei, K. M. Pohl, J. C. Niebles, and E. Adeli, “Vision-based estimation of mds-updrs gait scores for assessing parkinson's disease motor severity,” in International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 637–647, Springer, 2020. +[6] A. Jalal, S. Kamal, and D. Kim, "A depth video-based human detection and activity recognition using multi-features and embedded hidden markov models for health care monitoring systems," International Journal of Interactive Multimedia & Artificial Intelligence, vol. 4, no. 4, 2017. +[7] Z. Luo, J.-T. Hsieh, N. Balachandar, S. Yeung, G. Pusiol, J. Luxenberg, G. Li, L.-J. Li, N. L. Downing, A. Milstein, et al., "Computer vision-based descriptive analytics of seniors' daily activities for long-term health monitoring," Machine Learning for Healthcare (MLHC), vol. 2, 2018. +[8] U. Blanke and B. Schiele, “Remember and transfer what you have learned-recognizing composite activities based on activity spotting,” in International Symposium on Wearable Computers (ISWC) 2010, pp. 1–8, IEEE, 2010. +[9] J. M. Zacks and B. Tversky, “Event structure in perception and conception,” Psychological bulletin, vol. 127, no. 1, p. 3, 2001. +[10] J. Ji, R. Krishna, L. Fei-Fei, and J. C. Niebles, “Action genome: Actions as compositions of spatio-temporal scene graphs,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10236–10247, 2020. +[11] J. Carreira, E. Noland, C. Hillier, and A. Zisserman, “A short note on the kinetics-700 human action dataset,” arXiv preprint arXiv:1907.06987, 2019. +[12] G. A. Sigurdsson, G. Varol, X. Wang, A. Farhadi, I. Laptev, and A. Gupta, "Hollywood in homes: Crowdsourcing data collection for activity understanding," in Proceedings of the European Conference on Computer Vision (ECCV), pp. 510-526, Springer, 2016. +[13] B. G. Fabian Caba Heilbron, Victor Escorcia and J. C. Niebles, "Activitynet: A large-scale video benchmark for human activity understanding," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 961-970, 2015. + +[14] K. Soomro, A. R. Zamir, and M. Shah, "Ucf101: A dataset of 101 human actions classes from videos in the wild," arXiv preprint arXiv:1212.0402, 2012. +[15] D. Damen, H. Doughty, G. Maria Farinella, S. Fidler, A. Furnari, E. Kazakos, D. Moltisanti, J. Munro, T. Perrett, W. Price, et al., "Scaling egocentric vision: The epic-kitchens dataset," in Proceedings of the European Conference on Computer Vision (ECCV), pp. 720-736, 2018. +[16] S. Malla, B. Dariush, and C. Choi, “Titan: Future forecast using action priors,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11186–11196, 2020. +[17] C.-Y. Chang, D.-A. Huang, D. Xu, E. Adeli, L. Fei-Fei, and J. C. Niebles, “Procedure planning in instructional videos,” in European Conference on Computer Vision, pp. 334–350, Springer, 2020. +[18] A. Miech, D. Zhukov, J.-B. Alayrac, M. Tapaswi, I. Laptev, and J. Sivic, "Howto100m: Learning a text-video embedding by watching hundred million narrated video clips," in Proceedings of the IEEE international conference on computer vision, pp. 2630-2640, 2019. +[19] Y. Tang, D. Ding, Y. Rao, Y. Zheng, D. Zhang, L. Zhao, J. Lu, and J. Zhou, "Coin: A large-scale dataset for comprehensive instructional video analysis," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1207-1216, 2019. +[20] L. Zhou, C. Xu, and J. J. Corso, “Towards automatic learning of procedures from web instructional videos,” in AAAI Conference on Artificial Intelligence, pp. 7590–7598, 2018. +[21] B. Jia, Y. Chen, S. Huang, Y. Zhu, and S.-C. Zhu, “Lemma: A multi-view dataset for learning multi-agent multi-task activities,” in Proceedings of the European Conference on Computer Vision (ECCV), pp. 767–786, 2020. +[22] L. Sigal, A. O. Balan, and M. J. Black, "Humaneva: Synchronized video and motion capture dataset and baseline algorithm for evaluation of articulated human motion," International Journal of Computer Vision, vol. 87, no. 1-2, pp. 4-27, 2010. +[23] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in International conference on machine learning, pp. 1597–1607, PMLR, 2020. +[24] T. Han, W. Xie, and A. Zisserman, "Self-supervised constraining for video representation learning," Advances in Neural Information Processing Systems, vol. 33, 2020. +[25] K. Simonyan and A. Zisserman, “Two-stream convolutional networks for action recognition in videos,” in Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 1, NIPS'14, (Cambridge, MA, USA), p. 568-576, MIT Press, 2014. +[26] N. Sayed, B. Brattoli, and B. Ommer, “Cross and learn: Cross-modal self-supervision,” CoRR, vol. abs/1811.03879, 2018. + +[27] Y. Tian, D. Krishnan, and P. Isola, “Contrastive multiview coding,” CoRR, vol. abs/1906.05849, 2019. +[28] D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri, "Learning spatiotemporal features with 3d convolutional networks," in Proceedings of the IEEE international conference on computer vision, pp. 4489-4497, 2015. +[29] G. Varol, I. Laptev, and C. Schmid, “Long-term temporal convolutions for action recognition,” IEEE transactions on pattern analysis and machine intelligence, vol. 40, no. 6, pp. 1510–1517, 2017. +[30] J. Carreira, A. Zisserman, and Q. Vadis, “Action recognition? a new model and the kinetics dataset,” in IEEE Conference on Computer Vision and Pattern Recognition, pp. 4724–4733, 2018. +[31] K. Hara, H. Kataoka, and Y. Satoh, “Can spatiotemporal 3d cnns retrace the history of 2d cnns and imagenet?,” in Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 6546–6555, 2018. +[32] W. Li, Z. Zhang, and Z. Liu, "Action recognition based on a bag of 3d points," in 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition-Workshops, pp. 9-14, IEEE, 2010. +[33] C. Liu, Y. Hu, Y. Li, S. Song, and J. Liu, "Pku-mmd: A large scale benchmark for continuous multi-modal human action understanding," arXiv preprint arXiv:1703.07475, 2017. +[34] B. Ni, G. Wang, and P. Moulin, "Rgbd-hudaact: A color-depth video database for human daily activity recognition," in 2011 IEEE International Conference on Computer Vision Workshops (ICCV Workshops), pp. 1147-1153, IEEE, 2011. +[35] A. Shahroudy, J. Liu, T.-T. Ng, and G. Wang, "Ntu $\mathrm{rgb + }$ d: A large scale dataset for 3d human activity analysis," in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1010-1019, 2016. +[36] J. Sung, C. Ponce, B. Selman, and A. Saxena, “Human activity detection from rgbd images,” plan, activity, and intent recognition, vol. 64, 2011. +[37] Q. Kong, Z. Wu, Z. Deng, M. Klinkigt, B. Tong, and T. Murakami, "Mact: A large-scale dataset for cross modal human action understanding," in Proceedings of the IEEE International Conference on Computer Vision, pp. 8658-8667, 2019. +[38] G. A. Sigurdsson, G. Varol, X. Wang, A. Farhadi, I. Laptev, and A. Gupta, "Hollywood in homes: Crowdsourcing data collection for activity understanding," in European Conference on Computer Vision, pp. 510-526, Springer, 2016. +[39] C. Vondrick, H. Pirsiavash, and A. Torralba, "Generating videos with scene dynamics," CoRR, vol. abs/1609.02612, 2016. +[40] B. Korbar, D. Tran, and L. Torresani, "Cooperative learning of audio and video models from self-supervised synchronization," arXiv preprint arXiv:1807.00230, 2018. +[41] Z. Luo, B. Peng, D. Huang, A. Alahi, and L. Fei-Fei, "Unsupervised learning of long-term motion dynamics for videos," CoRR, vol. abs/1701.01821, 2017. + +[42] C. Gu, C. Sun, D. A. Ross, C. Vondrick, C. Pantofaru, Y. Li, S. Vijayanarasimhan, G. Toderici, S. Ricco, R. 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, pp. 6047-6056, 2018. +[43] H. Kuehne, A. Arslan, and T. Serre, "The language of actions: Recovering the syntax and semantics of goal-directed human activities," in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 780-787, 2014. +[44] D. S. Hamermesh, H. Frazis, and J. Stewart, “Data watch: The american time use survey,” Journal of Economic Perspectives, vol. 19, no. 1, pp. 221–232, 2005. +[45] J. Ji, R. Krishna, L. Fei-Fei, and J. C. Niebles, “Action genome: Actions as compositions of spatio-temporal scene graphs,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10236–10247, 2020. +[46] "Librosa mel spectrogram." https://librosa.org/doc/main/generated/librosa.feature.melspectrogram.html. +[47] T. Afouras, A. Owens, J. S. Chung, and A. Zisserman, "Self-supervised learning of audio-visual objects from video," arXiv preprint arXiv:2008.04237, 2020. +[48] G. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” arXiv preprint arXiv:1503.02531, 2015. +[49] M. Gutmann and A. Hyvarinen, "Noise-contrastive estimation: A new estimation principle for unnormalized statistical models," in Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 297-304, 2010. +[50] A. Mnih and K. Kavukcuoglu, “Learning word embeddings efficiently with noise-contrastive estimation,” in Advances in neural information processing systems, pp. 2265–2273, 2013. +[51] A. v. d. Oord, Y. Li, and O. Vinyals, “Representation learning with contrastive predictive coding,” arXiv preprint arXiv:1807.03748, 2018. +[52] A. Owens and A. A. Efros, "Audio-visual scene analysis with self-supervised multisensory features," in Proceedings of the European Conference on Computer Vision (ECCV), pp. 631-648, 2018. +[53] A. Kendall, Y. Gal, and R. Cipolla, “Multi-task learning using uncertainty to weigh losses for scene geometry and semantics,” in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7482–7491, 2018. +[54] T. Han, W. Xie, and A. Zisserman, "Video representation learning by dense predictive coding," in Workshop on Large Scale Holistic Video Understanding, ICCV, 2019. +[55] G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R. R. Salakhutdinov, "Improving neural networks by preventing co-adaptation of feature detectors (2012)," arXiv preprint arXiv:1207.0580, 2012. \ No newline at end of file diff --git a/homeactiongenomecooperativecompositionalactionunderstanding/images.zip b/homeactiongenomecooperativecompositionalactionunderstanding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d750cae6ecf02c734307aeba4143b881cf86db8d --- /dev/null +++ b/homeactiongenomecooperativecompositionalactionunderstanding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:359cb4f31637c7d08b0693dc1f0232567e028f7d63ed1760a3a29ae0ddc6f5ac +size 378278 diff --git a/homeactiongenomecooperativecompositionalactionunderstanding/layout.json b/homeactiongenomecooperativecompositionalactionunderstanding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e94b0a68713c6c19427f5860323222c719810b52 --- /dev/null +++ b/homeactiongenomecooperativecompositionalactionunderstanding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ce14f0034c7533d52817cf1cea56b543ff1d63436587ea5cc6d9be09c34535f +size 383182 diff --git a/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_content_list.json b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..70befab13489a6984b5ae2cf6773a4c3dba17612 --- /dev/null +++ b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9cab0b1c5e76fd6b8bc0f6c3332ea20783aa2493745fd60d0f0337bb70f2e6a +size 70957 diff --git a/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_model.json b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cde63c072221b724459989442a15bc0efc5b1ad4 --- /dev/null +++ b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ffb2a2a7a8417d7b449549471f66a2ee448eb9d34ce578362c40dab60158223 +size 84376 diff --git a/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_origin.pdf b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6b7d934d9f158bd812070e27b6bdf7d47a29b23e --- /dev/null +++ b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/6a0b5ef7-2413-4052-be3e-d2f0e8892cd4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9301c6470020acb9abd34ab3af853f73e49891b6cb759a4ad3c80679dc6c5bed +size 812713 diff --git a/hotrendtoendhumanobjectinteractiondetectionwithtransformers/full.md b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..97c403164d706fea7e62e05c929712779855a2fd --- /dev/null +++ b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/full.md @@ -0,0 +1,259 @@ +# HOTR: End-to-End Human-Object Interaction Detection with Transformers + +Bumsoo $\mathrm{Kim}^{1,2}$ Junhyun Lee $^{2}$ Jaewoo Kang $^{2}$ Eun-Sol Kim $^{1,\dagger}$ Hyunwoo J. Kim $^{2,\dagger}$ + +$^{1}$ Kakao Brain $^{2}$ Korea University + +{bumsoo.brain, eunsol.kim}@kakaobrain.com + +{meliketoy,ljhyun33,kangj,hyunwoojkim}@korea.ac.kr + +# Abstract + +Human-Object Interaction (HOI) detection is a task of identifying "a set of interactions" in an image, which involves the i) localization of the subject (i.e., humans) and target (i.e., objects) of interaction, and ii) the classification of the interaction labels. Most existing methods have indirectly addressed this task by detecting human and object instances and individually inferring every pair of the detected instances. In this paper, we present a novel framework, referred by HOTR, which directly predicts a set of $\langle$ human, object, interaction $\rangle$ triplets from an image based on a transformer encoder-decoder architecture. Through the set prediction, our method effectively exploits the inherent semantic relationships in an image and does not require time-consuming post-processing which is the main bottleneck of existing methods. Our proposed algorithm achieves the state-of-the-art performance in two HOI detection benchmarks with an inference time under 1 ms after object detection. + +# 1. Introduction + +Human-Object Interaction (HOI) detection has been formally defined in [8] as the task to predict a set of $\langle$ human, object, interaction $\rangle$ triplets within an image. Previous methods have addressed this task in an indirect manner by performing object detection first and associating $\langle$ human, object $\rangle$ pairs afterward with separate post-processing steps. Especially, early attempts (i.e., sequential HOI detectors [5, 18, 17, 26]) have performed this association with a subsequent neural network, thus being time-consuming and computationally expensive. + +To overcome the redundant inference structure of sequential HOI detectors, recent researches [30, 19, 12] proposed parallel HOI detectors. These works explicitly localize interactions with either interaction boxes (i.e., the tightest box that covers both the center point of an object + +![](images/cadfc2260a915284074dfad77240b9eb15be542e6fee2c924b974ccdefc5aa87.jpg) +Figure 1. Time vs. Performance analysis for HOI detectors on V-COCO dataset. HOI recognition inference time is measured by subtracting the object detection time from the end-to-end inference time. Blue circle represents sequential HOI detectors, orange circle represents parallel HOI detectors and red star represents ours. Our method achieves an HOI recognition inference time of $0.9\mathrm{ms}$ , being significantly faster than the parallel HOI detectors such as IPNet [30] or UnionDet [12] (the comparison between parallel HOI detectors is highlighted in blue). + +pair) [30, 19] or union boxes (i.e., the tightest box that covers both the box regions of an object pair) [12]. The localized interactions are associated with object detection results to complete the $\langle$ human, object, interaction $\rangle$ triplet. The time-consuming neural network inference is replaced with a simple matching based on heuristics such as distance [30, 19] or IoU [12]. + +However, previous works in HOI detection are still limited in two aspects; i) They require additional post-processing steps like suppressing near-duplicate predictions and heuristic thresholding. ii) Although it has been shown that modeling relations between objects helps object detection [11, 2], the effectiveness of considering high-level dependency for interactions in HOI detection has not yet been fully explored. + +In this paper, we propose a fast and accurate HOI algorithm named HOTR (Human-Object interaction TRans + +former) that predicts a set of human-object interactions in a scene at once with a direct set prediction approach. We design an encoder-decoder architecture based on transformers to predict a set of HOI triplets, which enables the model to overcome both limitations of previous works. First, direct set-level prediction enables us to eliminate hand-crafted post-processing stage. Our model is trained in an end-to-end fashion with a set loss function that matches the predicted interactions with ground-truth (human, object, interaction) triplets. Second, the self-attention mechanisms of transformers make the model exploit the contextual relationships between human and object and their interactions, encouraging our set-level prediction framework more suitable for high-level scene understanding. + +We evaluate our model in two HOI detection benchmarks: V-COCO and HICO-DET datasets. Our proposed architecture achieves state-of-the-art performance on two datasets compared to both sequential and parallel HOI detectors. Also, note that our method is much faster than other algorithms as illustrated in Figure 1, by eliminating time-consuming post-processing through the direct set-level prediction. The contribution of this work can be summarized as the following: + +- We propose HOTR, the first transformer-based set prediction approach in HOI detection. HOTR eliminates the hand-crafted post-processing stage of previous HOI detectors while being able to model the correlations between interactions. +- We propose various training and inference techniques for HOTR: HO Pointers to associate the outputs of two parallel decoders, a decomposition step to predict a set of final HOI triplets, and a new loss function to enable end-to-end training. +- HOTR achieves state-of-the-art performance on both benchmark datasets in HOI detection with an inference time under $1\mathrm{ms}$ , being significantly faster than previous parallel HOI detectors $(5\sim 9\mathrm{ms})$ + +# 2. Related Work + +# 2.1. Human-Object Interaction Detection + +Human-Object Interaction detection has been initially proposed in [8], and has been developed in two main streams: sequential methods and parallel methods. In sequential methods, object detection is performed first and every pair of the detected object is inferred with a separate neural network to predict interactions. Parallel HOI detectors perform object detection and interaction prediction in parallel and associates them with simple heuristics such as distance or IoU. + +Sequential HOI Detectors: InteractNet [6] extended an existing object detector by introducing an action-specific density map to localize target objects based on the human-centric appearance, and combined features from individual boxes to predict the interaction. Note that interaction detection based on visual cues from individual boxes often suffers from the lack of contextual information. + +To this end, iCAN [5] proposed an instance-centric attention module that extracts contextual features complementary to the features from the localized objects/humans. No-Frills HOI detection [9] propose a training and inference HOI detection pipeline only using simple multi-layer perceptron. Graph-based approaches have proposed frameworks that can explicitly represent HOI structures with graphs [24, 26, 4, 28, 21]. Deep Contextual Attention [29] leverages contextual information by a contextual attention framework in HOI. [28] proposes a heterogeneous graph network that models humans and objects as different kinds of nodes. Various external sources such as linguistic priors [23, 31, 17, 4, 1, 32, 20] or human pose information [15, 33, 18, 9, 27, 33] have also been leveraged for further improve performance. Although sequential HOI detectors feature a fairly intuitive pipeline and solid performance, they are time-consuming and computationally expensive because of the additional neural network inference after the object detection phase. + +Parallel HOI Detectors: Attempts for faster HOI detection has been also introduced in recent works as parallel HOI detectors. These works have directly localized interactions with interaction points [30, 19] or union boxes [12], replacing the separate neural network for interaction prediction with a simple heuristic based matching with distance or IoUs. Since they can be parallelized with existing object detectors, they feature fast inference time. However, these works are limited in that they require a hand-crafted postprocessing stage to associate the localized interactions with object detection results. This post-processing step i) requires manual search for the threshold, and ii) generates extra time complexity for matching each object pairs with the localized interactions $(5\sim 9\mathrm{ms})$ + +# 2.2. Object Detection with Transformers + +DETR [2] has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance. DETR infers a fixed-size set of $N$ predictions, in a single pass through the decoder, where $N$ is set to be significantly larger than the typical number of objects in an image. The main loss for DETR produces an optimal bipartite matching between predicted and ground-truth objects. Afterward, the object-specific losses (for class and bounding box) are optimized. + +![](images/c5b45667bfc5716c0d5af830bd3898009d94a355fb0fe1ef6d2e4131e76d420b.jpg) +Figure 2. Overall pipeline of our proposed model. The Instance Decoder and Interaction Decoder run in parallel, and share the Encoder. In our decomposition, the interaction representations predicted by the Interaction Decoder are associated with the instance representations to predict a fixed set of HOI triplets (see Fig.3). The positional encoding is identical to [2]. + +# 3. Method + +The goal of this paper is to predict a set of $\langle$ human, object, interaction $\rangle$ triplets while considering the inherent semantic relationships between the triplets in an end-to-end manner. To achieve this goal, we formulate HOI detection as set prediction. In this section, we first discuss the problems of directly extending the set prediction architecture for object detection [2] to HOI detection. Then, we propose our architecture HOTR that parallelly predicts a set of object detection and associates the human and object of the interaction, while the self-attention in transformers models the relationships between the interactions. Finally, we present the details of training for our model including Hungarian Matching for HOI detection and our loss function. + +# 3.1. Detection as Set Prediction + +We first start from object detection as set prediction with transformers, then show how we extend this architecture to capture HOI detection with transformers. + +Object Detection as Set Prediction. Object Detection has been explored as a set prediction problem by DETR [2]. Since object detection includes a single classification and a single localization for each object, the transformer encoder-decoder structure in DETR transforms $N$ positional embeddings to a set of $N$ predictions for the object class and bounding box. + +HOI Detection as Set Prediction. Similar to object detection, HOI detection can be defined as a set prediction problem where each prediction includes the localization of a human region (i.e., subject of the interaction), an + +object region (i.e., target of the interaction) and multi-label classification of the interaction types. One straightforward extension is to modify the MLP heads of DETR to transform each positional embedding to predict a human box, object box, and action classification. However, this architecture poses a problem where the localization for the same object needs to be redundantly predicted with multiple positional embeddings (e.g., if the same person works on a computer while sitting on a chair, two different queries have to infer redundant regression for the same human). + +# 3.2. HOTR architecture + +The overall pipeline of HOTR is illustrated in Figure 2. Our architecture features a transformer encoder-decoder structure with a shared encoder and two parallel decoders (i.e., instance decoder and interaction decoder). The results of the two decoders are associated with using our proposed HO Pointers to generate final HOI triplets. We will introduce HO Pointers shortly after discussing the architecture of HOTR. + +Transformer Encoder-Decoder architecture. Similar to DETR [2], the global context is extracted from the input image by the backbone CNN and a shared encoder. Afterward, two sets of positional embeddings (i.e., the instance queries and the interaction queries) are fed into the two parallel decoders (i.e., the instance decoder and interaction decoder in Fig. 2). The instance decoder transforms the instance queries to instance representations for object detection while the interaction decoder transforms the interaction queries to interaction representations for + +![](images/68234fc0ab1a8ac379894c0a6fe2132c07177ef289d6dbcf8e6dbc9e34eba1ad.jpg) +Figure 3. Conceptual illustration of how HO Pointers associates the interaction representations with instance representations. As instance representations are pre-trained to perform standard object detection, the interaction representation learns localization by predicting the pointer to the index of the instance representations for each human and object boxes. Note that the index pointer prediction is obtained in parallel with instance representations. + +interaction detection. We apply feed-forward networks (FFNs) to the interaction representation and obtain a Human Pointer, an Object Pointer, and interaction type, see Fig. 3. In other words, the interaction representation localizes human and object regions by pointing the relevant instance representations using the Human Pointer and Object Pointer (HO Pointers), instead of directly regressing the bounding box. Our architecture has several advantages compared to the direct regression approach. We found that directly regressing the bounding box has a problem when an object participates in multiple interactions. In the direct regression approach, the localization of the identical object differs across interactions. Our architecture addresses this issue by having separate instance and interaction representations and associating them using HO Pointers. Also, our architecture allows learning the localization more efficiently without the need of learning the localization redundantly for every interaction. Note that our experiments show that our shared encoder is more effective to learn HO Pointers than two separate encoders. + +HO Pointers. A conceptual overview of how HO Pointers associate the parallel predictions from the instance decoder and the interaction decoder is illustrated in Figure 3. HO Pointers (i.e., Human Pointer and Object Pointer) contain the indices of the corresponding instance representations of the human and the object in the interaction. After the in- + +teraction decoder transforms $K$ interaction queries to $K$ interaction representations, an interaction representation $z_{i}$ is fed into two feed-forward networks $\mathrm{FFN}_h:\mathbb{R}^d\to \mathbb{R}^d$ $\mathrm{FFN}_o:\mathbb{R}^d\to \mathbb{R}^d$ to obtain vectors $v_{i}^{h}$ and $v_{i}^{o}$ , i.e., $v_{i}^{h} = \mathrm{FFN}_{h}(z_{i})$ and $v_{i}^{o} = \mathrm{FFN}_{o}(z_{i})$ . Then finally the Human/Object Pointers $\hat{c}_i^h$ and $\hat{c}_i^o$ , which are the indices of the instance representations with the highest similarity scores, are obtained by + +$$ +\begin{array}{l} \hat{c}_{i}^{h} = \operatorname *{argmax}_{j}\bigl(\operatorname {sim}(v_{i}^{h},\mu_{j})\bigr), \\ \hat {c} _ {i} ^ {o} = \underset {j} {\operatorname {a r g m a x}} \left(\operatorname {s i m} \left(v _ {i} ^ {o}, \mu_ {j}\right)\right), \tag {1} \\ \end{array} +$$ + +where $\mu_{j}$ is the $j$ -th instance representation and $\operatorname{sim}(u,v) = u^{\top}v / \|u\| \|v\|$ . + +Recomposition for HOI Set Prediction. From the previous steps, we now have the following: i) $N$ instance representations $\mu$ , and ii) $K$ interaction representations $z$ and their HO Pointers $\hat{c}^h$ and $\hat{c}^o$ . Given $\gamma$ interaction classes, our decomposition is to apply the feed-forward networks for bounding box regression and action classification as $\mathrm{FFN}_{\mathrm{box}}: \mathbb{R}^d \to \mathbb{R}^4$ , and $\mathrm{FFN}_{\mathrm{act}}: \mathbb{R}^d \to \mathbb{R}^\gamma$ , respectively. Then, the final HOI prediction for the $i$ -th interaction representation $z_i$ is obtained by, + +$$ +\hat {b} _ {i} ^ {h} = \mathrm {F F N} _ {\mathbf {b o x}} \left(\mu_ {\hat {c} _ {i} ^ {h}}\right) \in \mathbb {R} ^ {4}, +$$ + +$$ +\hat {b} _ {i} ^ {o} = \operatorname {F F N} _ {\mathbf {b o x}} \left(\mu_ {\hat {c} _ {i} ^ {o}}\right) \in \mathbb {R} ^ {4}, \tag {2} +$$ + +$$ +\hat {a} _ {i} = \mathrm {F F N} _ {\mathbf {a c t}} (z _ {i}) \in \mathbb {R} ^ {\gamma}. +$$ + +The final HOI prediction by our HOTR is the set of $K$ triplets, $\{\langle \hat{b}_i^h,\hat{b}_i^o,\hat{a}_i\rangle \}_{i = 1}^K$ . + +Complexity & Inference time. Previous parallel methods have substituted the costly pair-wise neural network inference with a fast matching of triplets (associating interaction regions with corresponding human regions and object regions based on distance [30] or IoU [12]). HOTR further reduces the inference time after object detection by associating $K$ interactions with $N$ instances, resulting in a smaller time complexity $\mathcal{O}(KN)$ . By eliminating the post-processing stages in the previous one-stage HOI detectors including NMS for the interaction region and triplet matching, HOTR diminishes the inference time by $4 \sim 8\mathrm{ms}$ while showing improvement in performance. + +# 3.3. Training HOTR + +In this section, we explain the details of HOTR training. We first introduce the cost matrix of Hungarian Matching for unique matching between the ground-truth HOI triplets and HOI set predictions obtained by decomposition. Then, using the matching result, we define the loss for HO + +Pointers and the final training loss. + +Hungarian Matching for HOI Detection. HOTR predicts $K$ HOI triplets that consist of human box, object box and binary classification for the $a$ types of actions. Each prediction captures a unique $\langle \text{human}, \text{object} \rangle$ pair with one or more interactions. $K$ is set to be larger than the typical number of interacting pairs in an image. We start with the basic cost function that defines an optimal bipartite matching between predicted and ground truth HOI triplets, and then show how we modify this matching cost for our interaction representations. + +Let $\mathcal{V}$ denote the set of ground truth HOI triplets and $\hat{\mathcal{Y}} = \{\hat{y}_i\}_{i=1}^K$ as the set of $K$ predictions. As $K$ is larger than the number of unique interacting pairs in the image, we consider $\mathcal{V}$ also as a set of size $K$ padded with $\varnothing$ (no interaction). To find a bipartite matching between these two sets we search for a permutation of $K$ elements $\sigma \in \mathfrak{S}_K$ with the lowest cost: + +$$ +\hat {\sigma} = \underset {\sigma \in \mathfrak {S} _ {K}} {\operatorname {a r g m i n}} \sum_ {i} ^ {K} \mathcal {C} _ {\text {m a t c h}} \left(y _ {i}, \hat {y} _ {\sigma (i)}\right), \tag {3} +$$ + +where $\mathcal{C}_{\mathrm{match}}$ is a pair-wise matching cost between ground truth $y_{i}$ and a prediction with index $\sigma (i)$ . However, since $y_{i}$ is in the form of $\langle \mathrm{hbox},\mathrm{obox},\mathrm{action}\rangle$ and $\hat{y}_{\sigma (i)}$ is in the form of $\langle \mathrm{hidx},\mathrm{oidx},\mathrm{action}\rangle$ , we need to modify the cost function to compute the matching cost. + +Let $\Phi : \mathrm{idx} \to \mathrm{box}$ be a mapping function from ground-truth $\langle \mathrm{hidx}, \mathrm{oidx} \rangle$ to ground-truth $\langle \mathrm{hbox}, \mathrm{obox} \rangle$ by optimal assignment for object detection. Using the inverse mapping $\Phi^{-1} : \mathrm{box} \to \mathrm{idx}$ , we get the ground-truth $idx$ from the ground-truth box. + +Let $M \in \mathbb{R}^{d \times N}$ be a set of normalized instance representations $\mu' = \mu / \| \mu\| \in \mathbb{R}^d$ , i.e., $M = [\mu_1', \dots, \mu_N']$ . We compute $\hat{P}^h \in \mathbb{R}^{K \times N}$ that is the set of softmax predictions for the H Pointer in (1) given as + +$$ +\hat {P} ^ {h} = \left\| _ {i = 1} ^ {K} \operatorname {s o f t m a x} \left(\left(\bar {v} _ {i} ^ {h}\right) ^ {T} M\right), \right. \tag {4} +$$ + +where $\|_{i = 1}^{K}$ denotes the vertical stack of row vectors and $\bar{v}_i^h = v_i^h /||v_i^h ||$ . $\hat{P}^o$ is analogously defined. + +Given the ground-truth $y_{i} = (b_{i}^{h}, b_{i}^{o}, a_{i}), \hat{P}^{h}$ , and $\hat{P}^{o}$ , we convert the ground-truth box to indices by $c_{i}^{h} = \Phi^{-1}(b_{i}^{h})$ and $c_{i}^{o} = \Phi^{-1}(b_{i}^{o})$ and compute our matching cost function written as + +$$ +\begin{array}{l} \mathcal {C} _ {\text {m a t c h}} \left(y _ {i}, \hat {y} _ {\sigma (i)}\right) = - \alpha \cdot \mathbb {1} _ {\{a _ {i} \neq \emptyset \}} \hat {P} ^ {h} [ \sigma (i), c _ {i} ^ {h} ] \\ - \beta \cdot \mathbb {1} _ {\{a _ {i} \neq \emptyset \}} \hat {P} ^ {o} [ \sigma (i), c _ {i} ^ {o} ] \tag {5} \\ + \mathbb {1} _ {\{a _ {i} \neq \emptyset \}} \mathcal {L} _ {\mathrm {a c t}} (a _ {i}, \hat {a} _ {\sigma (i)}), \\ \end{array} +$$ + +where $\hat{P}[i,j]$ denotes the element at i-th row and j-th column, and $\hat{a}_{\sigma(i)}$ is the predicted action. The action matching + +cost is calculated as $\mathcal{L}_{\mathrm{act}}(a_i,\hat{a}_{\sigma (i)}) = \mathrm{BCELoss}(a_i,\hat{a}_{\sigma (i)})$ $\alpha$ and $\beta$ is set as a fixed number to balance the different scales of the cost function for index prediction and action classification. + +Final Set Prediction Loss for HOTR. We then compute the Hungarian loss for all pairs matched above, where the loss for the HOI triplets has the localization loss and the action classification loss as + +$$ +\mathcal {L} _ {\mathrm {H}} = \sum_ {i = 1} ^ {K} \left[ \mathcal {L} _ {\text {l o c}} \left(\mathrm {c} _ {i} ^ {h}, \mathrm {c} _ {i} ^ {o}, z _ {\sigma (i)}\right) + \mathcal {L} _ {\text {a c t}} \left(a _ {i}, \hat {a} _ {\sigma (i)}\right) \right]. \tag {6} +$$ + +The localization loss $\mathcal{L}_{\mathrm{loc}}(c_i^h, c_i^o, z_{\sigma(i)})$ is denoted as + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {l o c}} = - \log \frac {\exp \left(\operatorname {s i m} \left(\mathrm {F F N} _ {h} \left(z _ {\sigma (i)}\right) , \mu_ {c _ {i} ^ {h}}\right) / \tau\right)}{\sum_ {k = 1} ^ {N} \exp \left(\operatorname {s i m} \left(\mathrm {F F N} _ {h} \left(z _ {\sigma (i)}\right) , \mu_ {k}\right) / \tau\right)} \tag {7} \\ - \log \frac {\exp (\mathrm {s i m} (\mathrm {F F N} _ {o} (z _ {\sigma (i)}) , \mu_ {c _ {i} ^ {o}} / \tau)}{\sum_ {k = 1} ^ {N} \exp (\mathrm {s i m} (\mathrm {F F N} _ {o} (z _ {\sigma (i)}) , \mu_ {k}) / \tau)}, \\ \end{array} +$$ + +where $\tau$ is the temperature that controls the smoothness of the loss function. We empirically found that $\tau = 0.1$ is the best value for our experiments. + +Defining No-Interaction with HOTR. In DETR [2], maximizing the probability of the no-object class for the softmax output naturally suppresses the probability of other classes. However, in HOI detection the action classification is a multi-label classification where each action is treated as an individual binary classification. Due to the absence of an explicit class that can suppress the redundant predictions, HOTR ends up with multiple predictions for the same $\langle$ human, object $\rangle$ pair. Therefore, HOTR sets an explicit class that learns the interactiveness (1 if there is any interaction between the pair, 0 otherwise), and suppresses the predictions for redundant pairs that have a low interactiveness score (defined as No-Interaction class). In our experiment in Table. 3, we show that setting an explicit class for interactiveness contributes to the final performance. + +Implementation Details. We train HOTR with AdamW [22]. We set the transformer's initial learning rate to $10^{-4}$ and weight decay to $10^{-4}$ . All transformer weights are initialized with Xavier init [7]. For a fair evaluation with baselines, the Backbone, Encoder, and Instance Decoder are pre-trained in MS-COCO and frozen during training. We use the scale augmentation as in DETR [2], resizing the input images such that the shortest side is at least 480 and at most 800 pixels while the longest side at most is 1333. + +# 4. Experiments + +In this section, we demonstrate the effectiveness of our model in HOI detection. We first describe the two public datasets that we use as our benchmark: V-COCO and HICO-DET. Next, we show that HOTR successfully captures HOI triplets, by achieving state-of-the-art performance in both mAP and inference time. Then, we provide a detailed ablation study of the HOTR architecture. + +# 4.1. Datasets + +To validate the performance of our model, we evaluate our model on two public benchmark datasets: the V-COCO (Verbs in COCO) dataset and HICO-DET dataset. V-COCO is a subset of COCO and has 5,400 trainval images and 4,946 test images. For V-COCO dataset, we report the $\mathrm{AP}_{\mathrm{role}}$ over 25 interactions in two scenarios $\mathrm{AP}_{\mathrm{role}}^{\#1}$ and $\mathrm{AP}_{\mathrm{role}}^{\#2}$ . The two scenarios represent the different scoring ways for object occlusion cases. In Scenario1, the model should correctly predict the bounding box of the occluded object as [0,0,0,0] while predicting human bounding box and actions correctly. In Scenario2, the model does not need to predict about the occluded object. HICO-DET [3] is a subset of HICO dataset and has more than 150K annotated instances of human-object pairs in 47,051 images (37,536 training and 9,515 testing) and is annotated with 600 interaction types. For HICO-DET, we report our performance in the Default setting where we evaluate the detection on the full test set. We follow the previous settings and report the mAP over three different category sets: (1) all 600 HOI categories in HICO (Full), (2) 138 HOI categories with less than 10 training instances (Rare), and (3) 462 HOI categories with 10 or more training instances (Non-Rare). + +# 4.2. Quantitative Analysis + +For quantitative analysis, we use the official evaluation code for computing the performance of both V-COCO and HICO-DET. Table 1 and Table 2 show the comparison of HOTR with the latest HOI detectors including both sequential and parallel methods. For fair comparison, the instance detectors are fixed by the parameters pre-trained in MS-COCO. All results in V-COCO dataset are evaluated with the fixed detector. For the HICO-DET dataset, we provide both results using the fixed detector and the fine-tuned detector following the common evaluation protocol [1, 18, 10, 21, 4, 16, 12, 19]. + +Our HOTR achieves a new state-of-the-art performance on both V-COCO and HICO-DET datasets, while being the fastest parallel detector. Table 1 shows our result in the V-COCO dataset with both Scenario1 and Scenario2. HOTR outperforms the state-of-the-art parallel HOI detector [30] in Scenario1 with a margin of $4.2\mathrm{mAP}$ . + +
MethodBackboneAP#1roleAP#2role
Models with external features
TIN (RPDCD) [18]R5047.8
Verb Embedding [31]R5045.9
RPNN [33]R50-47.5
PMFNet [27]R50-FPN52.0
PastaNet [17]R50-FPN51.057.5
PD-Net [32]R5052.0-
ACP [13]R15253.0
FCMNet [20]R5053.1-
ConsNet [21]R50-FPN53.2-
Sequential HOI Detectors
VSRL [8]R50-FPN31.8-
InteractNet [6]R50-FPN40.048.0
BAR-CNN [14]R50-FPN43.6-
GPNN [24]R15244.0-
iCAN [5]R5045.352.4
TIN (RCD) [18]R5043.2-
DCA [29]R5047.3-
VSGNet [26]R15251.857.0
VCL [10]R50-FPN48.3
DRG [4]R50-FPN51.0
IDN [16]R5053.360.3
Parallel HOI Detectors
IPNet [30]HG10451.0-
UnionDet [12]R50-FPN47.556.2
OursR5055.264.4
+ +Table 1. Comparison of performance on V-COCO test set. $AP_{\text{role}}^{\#1}$ , $AP_{\text{role}}^{\#2}$ denotes the performance under Scenario1 and Scenario2 in V-COCO, respectively. + +Table 2 shows the result in HICO-DET in the Default setting for each Full/Rare/Non-Rare class. Due to the noisy labeling for objects in the HICO-DET dataset, fine-tuning the pre-trained object detector on the HICO-DET train set provides a prior that benefits the overall performance [1]. Therefore, we evaluate our performance in HICO-DET dataset under two conditions: i) using pre-trained weights from MS-COCO which are frozen during training (denoted as COCO in the Detector column) and ii) performance after fine-tuning the pre-trained detector on the HICO-DET train set (denoted as HICO-DET in the Detector column). Our model outperforms the state-of-the-art parallel HOI detector under both conditions by a margin of $4.1\mathrm{mAP}$ and $4\mathrm{mAP}$ , respectively. Below, we provide a more detailed analysis of our performance. + +HOTR vs Sequential Prediction. In comparative analysis with various HOI methods summarized in Table 1 and 2, we also compare the experimental results of HOTR with sequential prediction methods. Even though the sequential + +
MethodDetectorBackboneFeatureDefault
FullRareNon Rare
Sequential HOI Detectors
InteractNet [6]COCOR50-FPNA9.947.1610.77
GPNN [24]COCOR101A13.119.4114.23
iCAN [5]COCOR50A+S14.8410.4516.15
DCA [29]COCOR50A+S16.2411.1617.75
TIN [18]COCOR50A+S+P17.0313.4218.11
RPNN [33]COCOR50A+P17.3512.7818.71
PMFNet [27]COCOR50-FPNA+S+P17.4615.6518.00
No-Frills HOI [9]COCOR152A+S+P17.1812.1718.68
DRG [4]COCOR50-FPNA+S+L19.2617.7419.71
VCL [10]COCOR50A+S19.4316.5520.29
VSGNet [26]COCOR152A+S19.8016.0520.91
FCMNet [20]COCOR50A+S+P20.4117.3421.56
ACP [13]COCOR152A+S+P20.5915.9221.98
PD-Net [32]COCOR50A+S+P+L20.8115.9022.28
DJ-RN [15]COCOR50A+S+V21.3418.5322.18
ConsNet [21]COCOR50-FPNA+S+L22.1517.1223.65
PastaNet [17]COCOR50A+S+P+L22.6521.1723.09
IDN [16]COCOR50A+S23.3622.4723.63
Functional Gen. [1]HICO-DETR101A+S+L21.9616.4323.62
TIN [18]HICO-DETR50A+S+P22.9014.9725.26
VCL [10]HICO-DETR50A+S23.6317.2125.55
ConsNet [21]HICO-DETR50-FPNA+S+L24.3917.1026.56
DRG [4]HICO-DETR50-FPNA+S24.5319.4726.04
IDN [16]HICO-DETR50A+S24.5820.3325.86
Parallel HOI Detectors
UnionDet [12]COCOR50-FPNA14.2510.2315.46
IPNet [30]COCOR50-FPNA19.5612.7921.58
OursCOCOR50A23.4616.2125.62
UnionDet [12]HICO-DETR50-FPNA17.5811.7219.33
PPDM [19]HICO-DETHG104A21.1014.4623.09
OursHICO-DETR50A25.1017.3427.42
+ +Table 2. Performance comparison in HICO-DET. The Detector column is denoted as 'COCO' for the models that freeze the object detectors with the weights pre-trained in MS-COCO and 'HICO-DET' if the object detector is fine-tuned with the HICO-DET train set. The each letter in Feature column stands for A: Appearance (Visual features), S: Interaction Patterns (Spatial Correlations [5]), P: Pose Estimation, L: Linguistic Priors, V: Volume [15]. + +methods take advantages from additional information while HOTR only utilize visual information, HOTR outperforms the state-of-the-art sequential HOI detector [16] in both Scenario1 and Scenario2 by $1.9\mathrm{mAP}$ and $4.1\mathrm{mAP}$ in V-COCO while showing comparable performance (with a margin of $0.1\sim 0.52\mathrm{mAP}$ ) in the Default(Full) evaluation of HICO-DET. + +Performance on HICO-DET Rare Categories. HOTR shows state-of-the-art performance across both sequential and parallel HOI detectors in the Full evaluation for HICO-DET dataset (see Table. 2). However, HOTR underperforms than baseline methods [16] in the Rare setting. Since this setting deals with the action categories that has less than 10 training instances, it is difficult to achieve accuracy on + +this setting without the help of external features. Therefore, most of the studies that have shown high performance in Rare settings make use of additional information, such as spatial layouts [5], pose information [18], linguistic priors [17], and coherence patterns between the humans and objects [16]. In this work, our method is a completely vision-based pipeline but if we include the prior knowledge, we expect further improvement in the Rare setting. + +Time analysis. Since the inference time of the object detector network (e.g., Faster-RCNN [25]) can vary depending on benchmark settings (e.g., the library, CUDA, CUDAN version or hyperparameters), the time analysis is based on the pure inference time of the HOI interaction prediction model excluding the time of the object detection phase for fair comparison with our model. For detailed analysis, + +HOTR takes an average of $36.3\mathrm{ms}$ for the backbone and encoder, $23.8\mathrm{ms}$ for the instance decoder and interaction decoder (note that the two decoders run in parallel), and $0.9\mathrm{ms}$ for the recomposition and final HOI triplet inference. We excluded the i/o times in all models including the time of previous models loading the RoI align features of Faster-RCNN (see Figure.1 for a speed vs time comparison). Note that our HOTR runs $\times 5 \sim \times 9$ faster compared to the state-of-the-art parallel HOI detectors, since an explicit post-processing stage to assemble the detected objects and interaction regions is replaced with a simple $O(KN)$ search to infer the HO Pointers. + +# 4.3. Ablation Study + +
MethodAP#1roleDefault(Full)
HOTR55.223.5
w/o HO Pointers39.317.2
w/o Shared Encoders33.914.5
w/o Interactiveness Suppression52.222.0
+ +Table 3. Ablation Study on both V-COCO test set (scenario 1, $AP_{\mathrm{role}}^{\# 1}$ ) and HICO-DET test set (Default, Full setting without fine-tuning the object detector) + +In this section, we explore how each of the components of HOTR contributes to the final performance. Table 3 shows the final performance in the V-COCO test set after excluding each components of HOTR. We perform all experiments with the most basic R50-C4 backbone, and fix the transformer layers to 6 and attention heads 8 and the feed-forward network dimension to $d = 1024$ unless otherwise mentioned. + +With vs Without HO Pointers. In HOTR, the interaction representation localizes human and object region by pointing the relevant instance representations using the Human Pointer and Object Pointer (HO Pointers), instead of directly regressing the bounding box. We pose that our architecture has advantages compared to the direct regression approach, since directly regressing the bounding box for every interaction prediction requires redundant bounding box regression for the same object when an object participates in multiple interactions. Based on the performance gap $(55.2\rightarrow 39.3$ in V-COCO and $23.5\rightarrow 17.2$ in HICO-DET), it can be concluded that using HO Pointers alleviates the issue of direct regression approach. + +Shared Encoder vs Separate Encoders. From the Fig. 2, the architecture having separate encoders for each Instance and Interaction Decoder can be considered. In this ablation, we verify the role of the shared encoder of the HOTR. In + +Table 3, it is shown that sharing the encoder outperforms the model with separate encoders by a margin of $21.3\mathrm{mAP}$ and $9.0\mathrm{mAP}$ in V-COCO and HICO-DET, respectively. We suppose the reason is that the shared encoder helps the decoders learn common visual patterns, thus the HO Pointers can share the overall context. + +With vs Without Interactiveness Suppression. Unlike softmax based classification where maximizing the probability for the no-object class can explicitly diminish the probability of other classes, action classification is a multi-label binary classification that treats each class independently. So HOTR sets an explicit class that learns the interactivity, and suppresses the predictions for redundant pairs that have low probability. Table 3 shows that setting an explicit class for interactivity contributes 3mAP to the final performance. + +# 5. Conclusion + +In this paper, we present HOTR, the first transformer-based set prediction approach in human-object interaction problem. The set prediction approach of HOTR eliminates the hand-crafted post-processing steps of previous HOI detectors while being able to model the correlations between interactions. We propose various training and inference techniques for HOTR: HOI decomposition with parallel decoders for training, recomposition layer based on similarity for inference, and interactiveness suppression. We develop a novel set-based matching for HOI detection that associates the interaction representations to point at instance representations. Our model achieves state-of-the-art performance in two benchmark datasets in HOI detection: V-COCO and HICO-DET, with a significant margin to previous parallel HOI detectors. HOTR achieves state-of-the-art performance on both benchmark datasets in HOI detection with an inference time under $1\mathrm{ms}$ , being significantly faster than previous parallel HOI detectors $(5\sim 9\mathrm{ms})$ + +Acknowledgments. This research was partly supported by the Institute of Information & communications Technology Planning & Evaluation (IITP) grants funded by the Korea government (MSIT) (No.2021-0-00025, Development of Integrated Cognitive Drone AI for Disaster/Emergency Situations), (IITP-2021-0-01819, the ICT Creative Consilience program), and National Research Foundation of Korea (NRF2020R1A2C3010638, NRF2016M3A9A7916996). + +# References + +[1] Ankan Bansal, Sai Saketh Rambhatla, Abhinav Shrivastava, and Rama Chellappa. Detecting human-object interactions via functional generalization. In AAAI, pages 10460-10469, 2020. +[2] 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] Yu-Wei Chao, Yunfan Liu, Xieyang Liu, Huayi Zeng, and Jia Deng. Learning to detect human-object interactions. In 2018, the winter conference on applications of computer vision (wacv), pages 381-389. IEEE, 2018. +[4] Chen Gao, Jiarui Xu, Yuliang Zou, and Jia-Bin Huang. Drg: Dual relation graph for human-object interaction detection. In European Conference on Computer Vision, pages 696-712. Springer, 2020. +[5] Chen Gao, Yuliang Zou, and Jia-Bin Huang. ican: Instancecentric attention network for human-object interaction detection. arXiv preprint arXiv:1808.10437, 2018. +[6] Georgia Gkioxari, Ross Girshick, Piotr Dólár, and Kaiming He. Detecting and recognizing human-object interactions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8359-8367, 2018. +[7] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249-256, 2010. +[8] Jitendra Gupta, Saurabh Malik. Visual semantic role labeling. arXiv preprint arXiv:1505.04474, 2015. +[9] Tanmay Gupta, Alexander Schwing, and Derek Hoiem. No-frills human-object interaction detection: Factorization, layout encodings, and training techniques. In Proceedings of the IEEE International Conference on Computer Vision, pages 9677-9685, 2019. +[10] Zhi Hou, Xiaojiang Peng, Yu Qiao, and Dacheng Tao. Visual compositional learning for human-object interaction detection. arXiv preprint arXiv:2007.12407, 2020. +[11] 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. +[12] Bumsoo Kim, Taeho Choi, Jaewoo Kang, and Hyunwoo Kim. Unionet: Union-level detection towards real-time human-object interaction detection. In Proceedings of the European conference on computer vision (ECCV), 2020. +[13] Dong-Jin Kim, Xiao Sun, Jinsoo Choi, Stephen Lin, and In So Kweon. Detecting human-object interactions with action co-occurrence priors. arXiv preprint arXiv:2007.08728, 2020. +[14] Alexander Kolesnikov, Alina Kuznetsova, Christoph Lampert, and Vittorio Ferrari. Detecting visual relationships using box attention. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 0-0, 2019. +[15] Yong-Lu Li, Xinpeng Liu, Han Lu, Shiyi Wang, Junqi Liu, Jiefeng Li, and Cewu Lu. Detailed 2d-3d joint repre + +sensation for human-object interaction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10166-10175, 2020. +[16] Yong-Lu Li, Xinpeng Liu, Xiaogian Wu, Yizhuo Li, and Cewu Lu. Hoi analysis: Integrating and decomposing human-object interaction. Advances in Neural Information Processing Systems, 33, 2020. +[17] Yong-Lu Li, Liang Xu, Xinpeng Liu, Xijie Huang, Yue Xu, Shiyi Wang, Hao-Shu Fang, Ze Ma, Mingyang Chen, and Cewu Lu. Pastanet: Toward human activity knowledge engine. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 382-391, 2020. +[18] Yong-Lu Li, Siyuan Zhou, Xijie Huang, Liang Xu, Ze Ma, Hao-Shu Fang, Yanfeng Wang, and Cewu Lu. Transferable interactiveness knowledge for human-object interaction detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3585-3594, 2019. +[19] Yue Liao, Si Liu, Fei Wang, Yanjie Chen, Chen Qian, and Ji-ashi Feng. Ppdm: Parallel point detection and matching for real-time human-object interaction detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 482–490, 2020. +[20] Y Liu, Q Chen, and A Zisserman. Amplifying key cues for human-object-interaction detection. Lecture Notes in Computer Science, 2020. +[21] Ye Liu, Junsong Yuan, and Chang Wen Chen. Consnet: Learning consistency graph for zero-shot human-object interaction detection. In Proceedings of the 28th ACM International Conference on Multimedia, pages 4235-4243, 2020. +[22] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. +[23] Julia Peyre, Ivan Laptev, Cordelia Schmid, and Josef Sivic. Detecting unseen visual relations using analogies. In Proceedings of the IEEE International Conference on Computer Vision, pages 1981-1990, 2019. +[24] Siyuan Qi, Wenguan Wang, Baoxiong Jia, Jianbing Shen, and Song-Chun Zhu. Learning human-object interactions by graph parsing neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 401-417, 2018. +[25] 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. +[26] Oytun Ulutan, ASM Iftekhar, and Bangalore S Manjunath. Vsgnet: Spatial attention network for detecting human object interactions using graph convolutions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13617-13626, 2020. +[27] Bo Wan, Desen Zhou, Yongfei Liu, Rongjie Li, and Xuming He. Pose-aware multi-level feature network for human object interaction detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 9469-9478, 2019. +[28] Hai Wang, Wei-shi Zheng, and Ling Yingbiao. Contextual heterogeneous graph network for human-object interaction detection. arXiv preprint arXiv:2010.10001, 2020. + +[29] Tiancai Wang, Rao Muhammad Anwer, Muhammad Haris Khan, Fahad Shahbaz Khan, Yanwei Pang, Ling Shao, and Jorma Laaksonen. Deep contextual attention for human-object interaction detection. arXiv preprint arXiv:1910.07721, 2019. +[30] Tiancai Wang, Tong Yang, Martin Danelljan, Fahad Shahbaz Khan, Xiangyu Zhang, and Jian Sun. Learning human-object interaction detection using interaction points. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4116-4125, 2020. +[31] Bingjie Xu, Yongkang Wong, Junnan Li, Qi Zhao, and Mohan S Kankanhalli. Learning to detect human-object interactions with knowledge. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. +[32] Xubin Zhong, Changxing Ding, Xian Qu, and Dacheng Tao. Polysemy deciphering network for human-object interaction detection. In Proc. Eur. Conf. Comput. Vis, 2020. +[33] Penghao Zhou and Mingmin Chi. Relation parsing neural network for human-object interaction detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 843-851, 2019. \ No newline at end of file diff --git a/hotrendtoendhumanobjectinteractiondetectionwithtransformers/images.zip b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b54c2fb729bc44c7056020a6ac36d68fea91b55c --- /dev/null +++ b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:491362b34f8c6bc5c8e7493f39eab9ab11f59f0339f253a0f41629bc76ad2e15 +size 539436 diff --git a/hotrendtoendhumanobjectinteractiondetectionwithtransformers/layout.json b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..499905d58fac562e8899674cb7ddf001e7a37727 --- /dev/null +++ b/hotrendtoendhumanobjectinteractiondetectionwithtransformers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81c69391f64b88d7cd66dbab5c38253f4528259f00e632d1fde94bcc1942fcf5 +size 349820 diff --git a/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_content_list.json b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a84400d9659052735cfb9da26ec786b5638f1476 --- /dev/null +++ b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07ad5a6d931eb95a5aa1e8f7b3eb82248f383d1a6d0fbb3d80a06acc8909ad6a +size 85000 diff --git a/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_model.json b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b4420595c6bcd968701c65779365ec9b0d2c9d07 --- /dev/null +++ b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f1b4bbc4687690ecb715611eeddfa368c2d13a6643197783e4f76dd83c67c09 +size 110318 diff --git a/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_origin.pdf b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3a12f248a78992757eaa104ee18242fad31c5b47 --- /dev/null +++ b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/fa8677af-cd7a-44a9-9c4b-4ea7d53e93df_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7fc4b1cc6bb421ed4562f7b6708484d54887c7bb4ab85fce7a1988b76baa227 +size 529172 diff --git a/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/full.md b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3e47f8e8f3a03bc2abb8a24e303683c4ea7f7825 --- /dev/null +++ b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/full.md @@ -0,0 +1,369 @@ +# HourNAS: Extremely Fast Neural Architecture Search Through an Hourglass Lens + +Zhaohui Yang $^{1,2}$ , Yunhe Wang $^{2*}$ , Xinghao Chen $^{2}$ , Jianyuan Guo $^{2}$ , Wei Zhang $^{2}$ , Chao Xu $^{1}$ , Chunjing Xu $^{2}$ , Dacheng Tao $^{3}$ , Chang Xu $^{3}$ + +1 Key Lab of Machine Perception (MOE), Dept. of Machine Intelligence, Peking University. + +$^{2}$ Noah's Ark Lab, Huawei Technologies. $^{3}$ School of Computer Science, Faculty of Engineering, University of Sydney. + +zhaohuiyang@pku.edu.cn; yunhe.wang@huawei.com; c.xu@sydney.edu.au + +# Abstract + +Neural Architecture Search (NAS) aims to automatically discover optimal architectures. In this paper, we propose an hourglass-inspired approach (HourNAS) for extremely fast NAS. It is motivated by the fact that the effects of the architecture often proceed from the vital few blocks. Acting like the narrow neck of an hourglass, vital blocks in the guaranteed path from the input to the output of a deep neural network restrict the information flow and influence the network accuracy. The other blocks occupy the major volume of the network and determine the overall network complexity, corresponding to the bulbs of an hourglass. To achieve an extremely fast NAS while preserving the high accuracy, we propose to identify the vital blocks and make them the priority in the architecture search. The search space of those non-vital blocks is further shrunk to only cover the candidates that are affordable under the computational resource constraints. Experimental results on ImageNet show that only using 3 hours (0.1 days) with one GPU, our HourNAS can search an architecture that achieves a $77.0\%$ Top-1 accuracy, which outperforms the state-of-the-art methods. + +# 1. Introduction + +In the past decade, progress in deep neural networks has resulted in the advancements in various computer vision tasks, such as image classification [6, 67, 7, 52], object detection [20, 41], and segmentation [25]. The big success of deep neural networks is mainly contributed to the well-designed cells and sophisticated architectures. For example, VGGNet [51] suggested the use of smaller convolutional filters and stacked a series of convolution layers for achieving higher performance, ResNet [26] introduced the residual blocks to benefit the training of deeper neural networks, and DenseNet [29] designed the densely con + +nected blocks to stack features from different depths. Besides the efforts on the initial architecture design, extensive experiments [59, 24, 10] are often required to determine the weights and hyperparameters of the lightweight deep neural network [2, 11, 69, 35, 36, 37]. + +To automatically and efficiently search for neural networks of desirable properties (e.g., model size and FLOPs) from a predefined search space, a number of Neural Architecture Search (NAS) algorithms [40, 65, 33, 70, 68, 18, 58, 61] have been recently proposed. Wherein, Evolutionary Algorithm (EA) based methods [48] maintain a set of architectures and generate new architectures using genetic operations like mutation and crossover. Reinforcement Learning (RL) based methods [75, 76] sample architectures from the search space and train the controllers accordingly. The differentiable based methods [40, 62, 63, 50] optimize the shared weights and architecture parameters, which significantly reduces the demand for computation resources and makes the search process efficient. + +These methods have made tremendous efforts to greatly accelerate the search process of NAS. Nevertheless, given the huge computation cost on the large-scale dataset [62, 23, 64, 27, 3], e.g., 9 GPU days for NAS on the ImageNet benchmark, most methods execute NAS in a compromised way. The architecture is first searched on a smaller dataset (e.g., CIFAR-10 [32]), and then the network weight of the derived architecture is trained on the large dataset. An obvious disadvantage of this concession is that the performance of the selected architecture on the CIFAR-10 may not be well extended to the ImageNet benchmark [71]. We tend to use the minimal number of parameters without discrimination to construct an architecture that would achieve the maximal accuracy. But just as the popular 80-20 rule1 goes, only a few parts could be critical to the architecture's success, and + +![](images/b36997dd18f57982d0cf5460cde89d8c868070f92f148688da655bd6bce8d43b.jpg) +Figure 1. Blocks in the residual network are either "vital" or "non-vital", and they form the neck or bulb parts in the hourglass network. Two-stage search scheme speed up architecture search by $9 \times$ and the resource constrained search further accelerates architecture search by $72 \times$ . + +we need to give them the most focus while balancing the parameter volume for other parts. + +In this paper, we propose HourNAS for an accurate and efficient architecture search on the large-scale ImageNet dataset. Blocks in an architecture are not created equally. Given all the possible paths for the information flow from the input to the output of the network, blocks shared by these paths are vital, just as the neck of an hourglass to regulate the flow. We identify these vital blocks and make them the priority in the architecture search. The other non-vital blocks may not be critical to the accuracy of the architecture, but they often occupy the major volume of the architecture (like the bulb of an hourglass) and will carve up the resource budget left by the vital blocks. Instead of directly working in a large search space flooding with architectures that obviously do not comply with the constraints during deployment, we develop a space proposal method to screen out and optimize the most promising architecture candidates under the constraints. By treating the architecture search through an hourglass lens, the limited computation resource can be well allocated across vital and non-vital blocks. We design toy experiments on residual networks to illustrate the varied influence of vital and non-vital blocks on the network accuracy. The resulting HourNAS costs only about 3 hours (0.1 GPU days) on the entire ImageNet dataset to achieve a $77.0\%$ Top-1 accuracy, which outperforms the state-of-the-art methods. + +# 2. Related Works + +This section reviews the methods for neural architecture search algorithms. Then, we discuss layer equality, i.e., the importance of different blocks in deep neural networks. + +Neural Architecture Search. To automate the design of neural models, neural architecture search (NAS) was introduced to discover efficient architectures with competitive performance. Reinforcement learning (RL) and evolution algo + +rithm (EA) were widely adopted in NAS [76, 75, 42, 48, 55, 23, 21]. However, these methods were highly computationally demanding. Many works have been devoted to improving the efficiency of NAS from different perspectives, e.g., by adopting the strategy of weight sharing [45] or progressive search [39]. Differentiable based NAS attracted great interest as it drastically reduces the searching cost to several days or even hours [62, 40, 16, 63, 46, 38, 22, 8, 34, 74]. For example, DARTS [40] adopted the continuous architecture representation to allow efficient architecture search via gradient descent. Meanwhile, as discusses in TuNAS [1], gradient-based NAS methods consistently performed better than random search, showing the power of searching for excellent architectures. However, the most efficient gradient-based NAS methods still took dozens of days for directly searching on target large-scale dataset (e.g., ImageNet). Thus, an efficient method for directly searching deep neural architectures on large-scale datasets and search spaces is urgently required. + +Layer Equality. Most of existing NAS methods treated all layers with the same importance during the search. However, convolution neural networks are always over-parameterized and the impact on the final accuracy of each layer is totally different. Zhang et al. [72] re-initialized and re-randomized the pre-trained networks, and found that some layers are robust to the disturbance. For some intermediate layers, the re-initialization and re-randomization steps did not have negative consequences on the accuracy. Veit et al. [60] decomposed residual networks and found that skipping some layers does not decrease the accuracy significantly. Ding et al. [15] pruned different layers separately and found some layers are more important to the final accuracy. It is obvious that the layers are not created equal, and some layers are more important than others. + +In this paper, we analyze the causes of the inequality + +phenomenon in the residual network and exploit this property in neural architecture search to improve its efficiency. + +# 3. Hourglass Neural Architecture Search + +In this section, we revisit the neural architecture search from an hourglass way. The vital few blocks should be searched with a higher priority to guarantee the potential accuracy of the architecture. The non-vital blocks that occupy the major volume are then searched in an extremely fast way by focusing on the discovered space proposals. + +# 3.1. Vital Blocks: the Neck of Hourglass + +In this paper, we focus on the serial-structure NAS SuperNet [55, 56, 62, 4, 54, 53], as it is hardware-friendly and capable of achieving superior performance. Before we illustrate vital blocks in a general NAS, we first take ResNet [26] as an example for the analysis. ResNet is one of the most popular manually designed architectures. It is established by stacking a series of residual blocks, and the residual block is defined as, + +$$ +\mathbf {y} = \mathcal {F} (\mathbf {x}, \mathbf {w}) + \mathbf {x}, \tag {1} +$$ + +where $\mathbf{x}$ is the input feature map, $\mathcal{F}$ denotes the transformation (e.g., convolution and batch normalization for vision tasks) and $\mathbf{w}$ stands for the trainable parameters. From the information flow perspective, there are two paths to transmit the information from the node $\mathbf{x}$ to the node $\mathbf{y}$ , i.e., the shortcut connection and the transformation $\mathcal{F}$ . If there are $m$ residual blocks in a network, there will be $2^m$ different paths for the information propagation in total. A general neural network $\mathcal{N}$ based on the residual blocks [26, 55, 62] can therefore be approximated as the ensemble of a number of paths [60] $\{\mathcal{P}_1,\dots ,\mathcal{P}_n\}$ , i.e., $\mathcal{N}(X)\approx \sum_{i = 1}^{n}\mathcal{P}_{i}(X)$ , where each path $\mathcal{P}_i$ is set up by a series of blocks, $X$ is the input data, and $n$ is the number of all the paths. + +It is worth noticing that there are a few blocks existing in all the possible paths, e.g., the gray blocks in Fig. 1. These self-contained blocks do not participate in forming any residual blocks, but they are vital, because of their appearance in every path from the input to the output of the network. On the other hand, the green and blue blocks in Fig. 1 are a part of the residual blocks $\mathbf{y} = \mathcal{F}(\mathbf{x},\mathbf{w}) + \mathbf{x}$ , where the information can be transmitted through the plain transformation $\mathcal{F}(\mathbf{x},\mathbf{w})$ or the shortcut connection $\mathbf{x}$ to the next block, so they are not that vital. + +Identify and Examine Vital Blocks. Given the paths $\{\mathcal{P}_1,\dots ,\mathcal{P}_n\}$ in a general residual network $\mathcal{N}$ , the vital blocks shared by all the paths can be identified through $\hat{\mathcal{P}} = \mathcal{P}_1\cap \dots \cap \mathcal{P}_n$ , where $\mathcal{P}_i\cap \mathcal{P}_j$ denotes the intersection set of those blocks in paths $\mathcal{P}_i$ and $\mathcal{P}_j$ . In the popular + +![](images/03e3d7339e40b89c34583eb5190fcb4064bef6df8c1b24852ae542b22b4f7048.jpg) +(a) MnasNet + +![](images/2541851f2d4199a2e6cfe521e92e536366ff403a3d26150289722528553fd813.jpg) +(b) MobileNetV2 +Figure 2. The diagram of block importance by using the MnasNet and MobileNetV2 pretrained models. + +residual networks, such as ResNet [26] and FBNet [62], the vital blocks are exactly the first convolution layer, the last fully connected layer, the downsampling blocks, and the channel expansion blocks. These vital blocks are critical to the accuracy of the whole architecture, as they exist in all paths and act as the neck of the hourglass to control the information flow. In contrast, the other blocks would always find substitutes for themselves to keep the information flow, and they thus play a secondary role in the whole architecture. + +We further take mobile architectures as an example to illustrate the different influence of vital and non-vital blocks on the network accuracy. A random mask function $\mathcal{M}(\mathbf{y},p)$ is introduced to destroy the output of blocks in the pretrained MnasNet [55] and MobileNetV2 [49], where $\mathbf{y}$ is the output feature map, and $0\leq p\leq 1$ is the probability. In particular, every channel is reset to 0 with a probability $p$ . Fig. 2 shows the accuracy change of MnasNet [55] and MobileNetV2 [49] resulting from the feature distortion on different blocks. The blocki\_j denotes the $j$ -th block in the $i$ -th stage. As discussed above, the first block in every stage is the vital block. We set $p = \{0.3,0.6,1.0\}$ to gradually increase the degree of feature distortion. Each time we only manipulate one block while keeping others unchanged in the network. For the non-vital blocks (e.g., block3_2 and block3_3 in both MnasNet and MobileNetV2), even if all the channels are reset to zero (i.e., $p = 1.0$ ), the network does not undergo a significant accuracy degradation. However, a small portion ( $p = 0.3$ ) of channels that are masked out for those vital blocks (e.g., block1_1 and block2_1) will lead to an obvious accuracy drop. + +Revisit Neural Architecture Search. The goal of NAS is to search for the architecture of a higher accuracy under the constraints of available computational resources. In other words, NAS can be regarded as a problem of resource allocation. Vital blocks are potentially the most important and need to be put as the priority. As a result, more resources are better to be first allocated to the vital blocks, and the remaining resources are used for the non-vital blocks design. This therefore naturally motivates us to develop a two-stage search algorithm. During the first stage, we construct the minimal SuperNet $S_{\text{vital}}$ by stacking all the vital layers and search the vital blocks. The weights and architecture param + +eters are optimized alternatively in a differentiable way [62]. In the second stage, we fix the derived architecture of those vital blocks, and allocate the computational resources to search for the non-vital blocks. + +# 3.2. Non-Vital Blocks: the Bulb of Hourglass + +Non-vital blocks are often composed of a large number of parameters. They look like the bulb of the hourglass to determine the whole volume size. If the computational resources are unlimited to deploy the neural network, then we can make the network wider and deeper for achieving a higher performance [26, 56]. However, the searched architectures are to be deployed on mobile devices which have demanding constraints of the resources, e.g., model size, and FLOPs. Without investigating these constraints, it would be ineffective to directly sample the architecture from a large search space. For example, if the sampled architectures cannot fully use the available computation resource, the resulting models might perform poorer than expected, which has been analyzed by a number of multi-objective NAS works [42, 66, 19, 55] (the Pareto front). Otherwise, if the sampled architectures overwhelm the use of computation resources, they would be difficult to be deployed. To tackle the dilemma, we introduce an efficient sampling operation to avoid wasting too much time on search unimportant operations, and a space proposal strategy to put more attention on architectures that meet the target computational resources. + +# 3.3. Space Proposal for Efficient Resource Constrained Search + +A general differentiable neural architecture search algorithm can be formulated as a bilevel optimization problem [40]: + +$$ +\theta^ {*} = \underset {\theta} {\arg \min } \mathcal {H} _ {v a l} (w ^ {*} (\theta), \theta), \tag {2} +$$ + +$$ +\text {s . t .} w ^ {*} (\theta) = \underset {w} {\arg \min } \mathcal {H} _ {t r a i n} (w, \theta), +$$ + +where $\mathcal{H}$ is the cross-entropy loss function, and $\theta$ denotes the architecture parameters. If the accuracy is the only objective to be considered for searching, a complex architecture would be preferred for achieving a highest accuracy (see Sec. 4.3). However, if the obtained architectures are to be deployed on mobile devices, we may always have the computational resource constraints from the environment. Thus, neural architecture search that considers the multiple objectives can be formulated as, + +$$ +\theta^ {*} = \underset {\theta} {\arg \min } \mathcal {H} _ {v a l} (w ^ {*} (\theta), \theta) + \alpha \times \mathcal {T} (\theta), \tag {3} +$$ + +$$ +\mathrm {s . t .} w ^ {*} (\theta) = \underset {w} {\arg \min} \mathcal {H} _ {t r a i n} (w, \theta), +$$ + +where $\mathcal{T}(\theta)$ is the regularization term that encourages the produced architecture to satisfy the target computational + +resource constraints. Assuming the constraints (targets) on computational resources (e.g., model size, FLOPs) are $T_{i \in \{1, \dots, n\}}$ , where $n$ is the number of objectives, an efficient and controllable way is to initialize architectures that satisfy $T$ . Thus, we introduce the concept of space proposal. The space proposal is a subspace of the large search space, and all the sampled architectures from the space proposal satisfy the target resources. As a result, the search phase would not waste resources on optimizing useless architectures. In addition, the space proposal ensures "what you set is what you get". Similar to gradient-based NAS, the space proposal is represented by the architecture parameters. + +We take the FLOPs as an example to describe how to optimize a space proposal. Suppose $\theta$ represents the trainable architecture parameters of the NAS SuperNet and the size is $L \times O$ , where $L$ is the maximum depth and $O$ is the number of candidate operations in each layer. A number of methods $\mathcal{G}$ are capable of sampling architectures $A_{\theta}$ from architecture parameters $\theta$ , + +$$ +A _ {\theta} = \mathcal {G} (\theta), \quad \sum_ {o} A _ {l, o} = 1, \tag {4} +$$ + +where $\mathcal{G}$ is usually specified as softmax [40], Gumbel-softmax [62], Gumbel-Max [17, 5], etc. The $A_{l,o}$ is the $o$ -th operation in the $l$ -th layer. + +The FLOPs table $F$ of the SuperNet $\mathcal{S}$ is of size $L\times O$ , where $F_{l,o}$ denotes the FLOPs of the $o$ -th operation in the $l$ -th SuperBlock. The FLOPs for sampled architecture $A_{\theta}$ is calculated as $\mathcal{R}_F(A_\theta) = \mathrm{sum}(A_\theta \odot F)$ , where $\odot$ is the element-wise product. Assuming the target FLOPs is $T_F$ , the optimization is formulated as, + +$$ +\theta^ {F} = \underset {\theta} {\arg \min } \left| \mathcal {R} _ {F} (\mathcal {G} (\theta)) - T _ {F} \right| / M _ {F}, \tag {5} +$$ + +where $M_F$ is a constant scalar denotes the maximum FLOPs of the sampled architectures, and this term is used for normalizing the objective to $[0,1]$ . We extend Eqn 5 to $n$ different objectives. The targets for $n$ objectives are $T_{i\in \{1,\dots,n\}}$ , and the optimization is defined as, + +$$ +\theta^ {T} = \arg \min _ {\theta} \frac {1}{n} \sum_ {i = 1} ^ {n} \left| \mathcal {R} _ {i} (\mathcal {G} (\theta)) - T _ {i} \right| / M _ {i}, \tag {6} +$$ + +which $\mathcal{R}_i(\mathcal{G}(\theta))$ is the resource demand of the architecture sampled by $\mathcal{G}(\theta)$ on the $i$ -th objective. + +This optimization problem is easily to be solved in a few seconds. The solution $\theta^T$ can be regarded as a space proposal under the constraints $T$ , and the structure $A_{\theta^T}$ sampled from $\theta^T$ by Eqn 4 would be more easily to satisfy target resources $T$ . Instead of relying on a single optimal solution $\theta^T$ , we turn to an ensemble way to start from different random initializations and derive a series of space proposals $\Theta^T = \{\theta_1^T, \dots, \theta_m^T\}$ , where $m$ is the number of space + +proposals. The orthogonal constraint is also introduced to further increase the diversity of different space proposals, which is formulated as, + +$$ +\begin{array}{l} \theta_ {1}, \dots , \theta_ {m} = \underset {\theta_ {1}, \dots , \theta_ {m}} {\arg \min } \left(\frac {1}{n m} \sum_ {j = 1} ^ {m} \sum_ {i = 1} ^ {n} \left| \mathcal {R} _ {i} (\mathcal {G} (\theta_ {j})) - T _ {i} \right| / M _ {i} + \right. \\ \beta \times \sum (| O - I |)), \tag {7} \\ \end{array} +$$ + +where $O = \Theta \Theta^T$ is an $m \times m$ matrix and element $O_{i,j}$ denotes the inner product of $\theta_i$ and $\theta_j$ . The term $\sum (|O - I|)$ regularizes $m$ space proposals to be orthogonal, which indicates that the architectures sampled from different space proposals are different. A uniformly initialized auxiliary parameter $\Pi$ of size $m$ is then introduced to sample space proposals, + +$$ +\pi = \mathcal {P} (\Pi), \quad \sum_ {i} \pi_ {i} = 1, \tag {8} +$$ + +where $\mathcal{P}$ could be softmax, Gumbel-softmax or Gumbel-Max, $\pi$ is the sampled vector from $\Pi$ that used for combine the architectures sampled from $m$ space proposals, and the ensembled architecture $A_{\Theta}$ that used for updating the SuperNet is defined as, + +$$ +A _ {\Theta} = \sum_ {i} \pi_ {i} \cdot A _ {\theta_ {i}} = \sum_ {i} \pi_ {i} \cdot \mathcal {G} (\theta_ {i}), \tag {9} +$$ + +where $A_{\Theta}$ is utilized for updating network parameter $w$ on train set $\mathcal{D}_{train}$ and architecture parameter $\Pi$ , $\Theta$ on validation set $\mathcal{D}_{val}$ , respectively. Every space proposal $\theta_{i}$ optimizes towards the good architectures in the space proposal and $\Pi$ optimizes towards better proposals. The NAS framework by using the space proposal strategy is summarized as, + +$$ +\begin{array}{l} \Pi^{*},\Theta^{*} = \operatorname *{arg min}_{\Pi ,\Theta}\mathcal{H}_{val}(w^{*}(\Pi ,\Theta),\Pi ,\Theta) + \alpha \times \mathcal{T}(\Pi ,\Theta), \\ \text {s . t .} w ^ {*} (\Pi , \Theta) = \underset {w} {\arg \min } \mathcal {H} _ {\text {t r a i n}} (w, \Pi , \Theta), \tag {10} \\ \end{array} +$$ + +where $\mathcal{T}$ (Eqn 6) is the regularization on space proposal parameters (Eqn 7), and $\alpha$ is the slope of the multi-objective loss term. + +# 3.4. Overall Search Algorithm + +Based on the proposed method, we summarize the overall search algorithm in Alg. 1. + +# 4. Experiments + +In this section, we first describe the experimental settings and then extensively evaluate the proposed HourNAS on several popular NAS search spaces [62, 55, 56] on ImageNet. The models trained on CIFAR-10 dataset by using MindSpore toolkit are available at https://gitee.com/mindspore/mindspore/tree/master/model_zoo/research/cv/HourNAS + +# Algorithm 1 The searching algorithm of HourNAS. + +Input: The NAS supernet $S$ , the computational targets $T_{i\in \{1,\dots,n\}}$ , the train set $D_{train}$ and validation set $D_{val}$ , the searching epochs for vital blocks $E_{vital}$ and non-vital blocks $E_{n-vital}$ , the number of space proposals $m$ , iterations $I_{sp}$ for training space proposals. + +# 1: // Search Vital Blocks + +2: Constructing the minimal SuperNet $S_{vital}$ by stacking all the vital layers and the architecture parameter $\theta_{vital}$ . + +# 3: for e = 1 to $E_{\text{vital}}$ do + +4: for data and target pair $(X_{tr},Y_{tr})$ in $D_{train}$ do + +5: Sample network $A$ from $\theta_{\text{vital}}$ , calculate loss and update network parameters. + +# 6: end for + +7: for data and target pair $(X_{val}, Y_{val})$ in $D_{val}$ do + +8: Sample network $A$ from $\theta_{vital}$ , calculate loss and update $\theta_{vital}$ . + +# 9: end for + +# 10: end for + +11: The operations with the highest importance are selected to form the vital layers. + +# 12: // Optimize $m$ space proposals + +13: According to the computational targets $T$ , HourNAS optimizes $m$ proposals $\Theta^T = \{\theta_1^T, \dots, \theta_m^T\}$ for $I_{sp}$ iterations (Eqn 7), and construct the proposal sampler $\pi$ (Eqn 8). + +# 14: // Search Non-Vital Blocks + +# 15: for e = 1 to $E_{n-vital}$ do + +# 18: end for + +# 21: end for + +# 22: end for + +16: for data and target pair $(X_{tr},Y_{tr})$ in $D_{train}$ do +17: Sample network $A$ from $\pi$ and $\Theta$ , calculate loss and update network parameters. +19: for data and target pair $(X_{val},Y_{val})$ in $D_{val}$ do +20: Sample network $A$ from $\pi$ and $\Theta$ , calculate loss and update $\pi$ and $\Theta$ . +23: Fix operations by selecting the space proposal and operations with the highest probability. +Output: The architecture $A$ which satisfies the computational targets $T_{i\in \{1,\dots,n\}}$ . + +# 4.1. Experimental Settings + +We use the HourNAS to search on the complete ImageNet train set. The subset $\mathcal{D}_{tr}$ takes $80\%$ of the train set to train network parameters and the rest $\mathcal{D}_{val}$ is used to update architecture parameters. We search on three popular search spaces, i.e., FBNet [62], MnasNet [55], and EfficientNet [56]. For any of our searched architecture, the training strategy is the same as the corresponding baseline. We use the NVIDIA V100 GPU to measure the search time + +and compare with previous works fairly. The V100 GPU is also adopted by a number of literatures, for example, PDARTS [9], FBNet [62]. + +The HourNAS first searches the vital blocks for one epoch (about 1 hour). Then, HourNAS optimizes multiple space proposals according to the computational targets and searches the non-vital blocks for one epoch (about 2 hours). The whole searching process requires only one V100 GPU within 3 hours. Extending the search time will not further improve the accuracy, because the distribution of architecture parameters is stable. For competing methods like MnasNet [55], 3 GPU hours could only train one sampled architecture and the RL controller has no difference with random search. We utilize the Gumbel-Max [44, 5, 17] to sample operations according to the learned importance, which avoids wasting searching time on undesired operations. Gumbel-Max samples an operation according to the learned probability distribution (i.e., importance). The sampling frequencies of those poor operations tend to be relatively low, so that we can effectively reduce the time spent on them. The Gumbel-Max sampling accelerates every iteration by around $O$ times, where $O$ is the number of candidate operations in every layer. During searching, we follow FBNet [62] and add the temperature $\tau$ (Eqn 4) for sharpening the distribution progressively. The temperature $\tau$ starts from 5.0 and multiply 0.9999 at every iteration. Slope parameter $\alpha$ , $\beta$ are empirically set to 5.0 and 1e-2, respectively. Learning rates for optimizing weights and architecture parameters are 0.1 and 0.01, respectively. Adam [31] optimizer is used to update architecture parameters. + +# 4.2. Comparison with State-of-the-arts + +FBNet Search Space (FBNetSS). We first evaluate our HourNAS on the popular FBNet search space (FBNetSS), which contains $9^{22} \approx 1 \times 10^{21}$ architectures. HourNAS first searches the vital blocks and the results show that operations with the expansion ratio of six have significantly higher probabilities than other operations. We choose the operations with the highest probabilities to form the vital blocks. This result is in line with our intuition that the complex operations have the greatest feature extraction ability on the large dataset, i.e., ImageNet. + +After fixing the operations of the vital blocks, we are interested in finding the appropriate proposal number $m$ . We set the computational resources the same as FBNet-B and search architectures using $m$ different space proposals. We first visualize the distribution of sampled architectures from the space proposal by gradually decreasing the temperature $\tau$ . Each space proposal is optimized for 1000 iterations in total (Eqn 6). The computational targets are set to 4.8M parameters (x-axis) and 300M FLOPs (y-axis), which are consistent with FBNet-B [62]. As shown in Fig. 3, with the decrease of temperature of $\tau$ , the sampled architectures + +![](images/cf54a3e327ce9c536b088c8ae46c17ef68d8078328fe53335ddd05ad628c5f25.jpg) +Figure 3. The distribution of 10,000 architectures sampled from optimized space proposal under different temperatures $\tau$ . + +satisfy the computational targets more precisely. + +The optimization step for constructing several space proposals takes only a few seconds, which is an efficient solution for controllable multi-objective neural architecture search. We enumerate $m = \{1,2,4,8,16\}$ and the operations with the highest probability according to $\Pi$ and $\Theta$ are selected after searching. The architectures are evaluated on the CIFAR-10 dataset to determine the appropriate space proposal number $m$ for finding superior architectures. In retraining, we integrate CutOut [14] to make networks generalize better. The stochastic depth [30] is not used. As shown in Tab. 2, $m = 8$ could result in a well-performed architecture and we use $m = 8$ in the following experiments to achieve a better trade-off between searching costs and performance. + +Table 2. Comparison of image classifiers on CIFAR-10 dataset. + +
ModelTest Error (%)Params (M)Search Cost (GPU days)
HourNAS (m=1)3.862.80.1
HourNAS (m=2)3.542.80.1
HourNAS (m=4)3.412.70.1
HourNAS (m=8)3.392.80.1
HourNAS (m=16)3.372.80.1
+ +We search for models on the ImageNet dataset, i.e., HourNAS-FBNetSS-A and HourNAS-FBNetSS-B. To fairly compare with FBNet, HourNAS-FBNetSS-A has the same model size and FLOPs as FBNet-B, and HourNAS-FBNetSS-B has the same computational requirements as FBNet-C. We train the networks for 350 epochs in total with a batch size of 512. Learning rate starts from 0.25 and the weight decay is 1e-5. Label smoothing and learning rate warmup strategies are also used. The activation after convolution is the ReLU function. The training strategy is the same as FBNet [62] without using bells and whistles. As shown in Tab. 1, the HourNAS-FBNetSS-A and HourNAS-FBNetSS-B achieve competitive accuracies with FBNet-B and FBNet-C, and the search time is drastically reduced by two orders of magnitude. We search HourNAS-FBNetSS-A for three times using different random seeds, and the standard deviation of Top-1 accuracy is $0.1\%$ . + +Enlarged FBNet Search Space (EFBNetSS). Mix-Conv [57] indicates that a larger kernel size leads to better performance. To understand the impact of search space and to further verify the effectiveness of HourNAS, we + +Table 1. Overall comparison on the ILSVRC2012 dataset. + +
ModelTypeSearch DatasetSearch Cost (GPU days)Params (M)FLOPS (M)Top-1 (%)Top-5 (%)
ResNet50 [26]manual--25.6410075.392.2
MobileNetV1 [28]manual--4.257570.689.5
MobileNetV2 [49]manual--3.430072.091.0
MobileNetV2 (1.4×)manual--6.958574.792.5
ShuffleNetV2 [43]manual---29972.6-
ShuffleNetV2 (1.5×)manual--3.529972.6-
FPNASNet [13]autoCIFAR-100.83.430073.3-
SNAS (mild) [63]autoCIFAR-101.54.352272.790.8
AmoebaNet-A [48]autoCIFAR-1031505.155574.592.0
PDARTS [9]autoCIFAR-100.34.955775.692.6
NASNet-A [76]autoCIFAR-1018005.356474.091.3
GDAS [17]autoCIFAR-100.25.358174.091.5
PNAS [39]autoCIFAR-102255.158874.291.9
CARS-I [66]autoCIFAR-100.45.159175.292.5
DARTS [40]autoCIFAR-1044.959573.191.0
MdeNAS [73]autoCIFAR-100.26.1-74.592.1
RCNet [64]autoImageNet83.429472.291.0
SPOSNAS [23]autoImageNet135.346574.8-
ProxylessNAS [4]autoImageNet8.37.146575.192.5
FBNet-B [62]autoImageNet94.829574.1-
FBNet-C [62]autoImageNet95.537574.9-
HourNAS-FBNetSS-AautoImageNet0.14.829874.191.8
HourNAS-FBNetSS-BautoImageNet0.15.540675.092.2
HourNAS-EFBNetSS-CautoImageNet0.14.829674.191.6
HourNAS-EFBNetSS-DautoImageNet0.15.539475.392.3
MnasNet-A1 [55]autoImageNet38003.931275.292.5
HourNAS-MnasNetSS-EautoImageNet0.13.831375.792.8
EfficientNet-B0 [56]autoImageNet-5.339076.8-
HourNAS-EfficientNetSS-FautoImageNet0.15.338377.093.5
+ +slightly enlarge the search space of FBNet. We add the blocks with kernel size $k = 7$ and remove the blocks with group $g = 2$ . This modification results in a search space containing $1 \times 10^{22}$ architectures, which is 10 times larger than the original one. The multi-objectives are the same as HourNAS-FBNetSS-A and HourNAS-FBNetSS-B. We list the searched architectures in Tab. 1. The HourNAS-EFBNetSS-C achieves the same Top-1 accuracy with HourNAS-FBNetSS-A and HourNAS-EFBNetSS-D surpasses HourNAS-FBNetSS-B by $0.3\%$ Top-1 accuracy. The larger kernel size $k = 7$ ensures that the architectures are capable of perceiving the characteristics of a larger area. + +MnasNet Search Space (MnasNetSS). We further apply our proposed HourNAS to the search space of MnasNet [55]. The search space contains $2.5 \times 10^{23}$ architectures in total and is larger than FBNet search space. We select MnasNet-A1 as the baseline and use its number of the parameters and FLOPs as two objectives to optimize 8 space proposals. The discovered HourNAS-MnasNetSS-E achieves a Top-1 accuracy of $75.7\%$ on the ILSVRC2012 dataset, which surpasses MnasNet-A1 by $0.5\%$ . + +EfficientNet Search Space (EfficientNetSS). To compare with the state-of-the-art architecture EfficientNet- + +B0 [56], we also use HourNAS to search on the same search space as EfficientNet, which contains $4 \times 10^{18}$ architectures. Targeting at EfficientNet-B0, we use its model size and FLOPs as two objectives to regularize space proposals and name the searched architecture as HourNAS-EfficientNetSS-F. Same as EfficientNet $^3$ , we use the Swish [47] activation and Exponential Moving Average (EMA) in fully training. Note that the AutoAugment [12] is not used. The result in Tab. 1 shows HourNAS-EfficientNetSS-F surpasses EfficientNet-B0 by $0.2\%$ Top-1 accuracy with similar number of parameters and FLOPs. + +# 4.3. Ablation Study + +If we do not restrict the computational resources of the sampled architectures in searching, the most complex block achieves the highest probability after searching for enough time. As shown in Tab. 3, we train the most complex architectures in both FBNet and EfficientNet search spaces, namely FBNet-Max and EfficientNet-Max. These two models obtain $75.7\%$ , and $78.3\%$ Top-1 accuracies, respectively. However, the computational resource requirements of these structures are relatively high. Therefore, the neural archi + +Table 3. The results of FBNet-Max and EfficientNet-Max on ILSVRC2012 dataset. + +
ModelParams (M)FLOPS (M)Top-1 (%)Top-5 (%)
FBNet-Max5.758375.792.8
EfficientNet-Max5.873878.394.0
+ +Table 4. Comparisons of searching with and without vital block priori on ILSVRC2012 dataset. The search spaces are original (upper) and enlarged (lower) FBNet search space, respectively. + +
ModelTypeSearch DatasetSearch Cost (GPU days)Params (M)FLOPS (M)Top-1 (%)Top-5 (%)
HourNAS-FBNetSS-AautoImageNet0.14.829874.191.8
HourNAS-FBNetSS-G (w/o vital block priori)autoImageNet0.24.729773.291.4
HourNAS-EFBNetSS-CautoImageNet0.14.829674.191.6
HourNAS-EFBNetSS-H (w/o vital block priori)autoImageNet0.24.829973.591.3
+ +Table 5. The results comparison on ILSVRC2012 dataset. + +
ModelTypeSearch DatasetSearch Cost (GPU days)Params (M)FLOPS (M)Top-1 (%)Top-5 (%)
HourNAS-FBNetSS-AautoImageNet0.14.829874.191.8
HourNAS-FBNetSS-IautoImageNet1.04.831874.291.8
+ +tecture search (NAS) could be regarded as the problem of computational resource allocation given the resource constraints. + +The Impact of Vital Block Priori. In order to investigate the impact of the vital block priori, we directly search architectures without using the vital block information. All the blocks in the SuperNet $S$ are treated equally in searching. We use the Gumbel-Max sampling and space proposal strategy to search architectures under the same predefined computational resources. + +We use the previously described original and enlarged FBNet search spaces. We optimize 8 space proposals and it takes 6 hours for searching, which is twice of the counterpart that utilize the vital block priori. As shown in Tab. 4, the Top-1 accuracies of the discovered models (HourNAS-FBNetSS-G, HourNAS-EFBNetSS-H) drop by $0.9\%$ and $0.6\%$ on the ImageNet validation set, respectively. The searched vital blocks of HourNAS-FBNetSS-A uses $0.9\mathrm{M}$ parameters and 130M FLOPs, and the HourNAS-FBNetSS-G uses $0.5\mathrm{M}$ parameters and 55M FLOPs. The vital blocks in HourNAS-FBNetSS-G are not as expressive as HourNAS-FBNetSS-A, which results in worse performance. The results show the necessity of the vital block priori. Searching the vital blocks with higher priority is helpful in finding high-quality architectures. Therefore, we use a two-stage search method to allocate resources to vital blocks first, which can allocate resources more effectively, so as to complete the architecture search in a short time. The architectures are provided in the supplementary file, under same computational resources constraints, inclining more resources on the vital blocks gains more performance profit. + +The Impact of Gumbel-Max Sampling. As discussed in Sec. 3.3, there are several design choices for the sampling methods. To find out the impact of the Gumbel-Max sam + +pling method, here we instead use the Gumbel softmax [62] to optimize architecture parameters and network parameters. The search space and target resource constraints are the same as HourNAS-FBNetSS-A. The search process takes around 1 GPU day and the finalized architecture is denoted as HourNAS-FBNetSS-I. As shown in Tab. 5, HourNAS-FBNetSS-I outperforms HourNAS-FBNetSS-A by $0.1\%$ Top-1 accuracy with much less searching cost, which demonstrate that Gumbel-Max is an efficient strategy for optimizing the SuperNet with almost no less of accuracy. + +# 5. Conclusions + +This paper investigates an efficient algorithm to search deep neural architectures on the large-scale dataset (i.e., ImageNet) directly. To reduce the complexity of the huge search space, we present an Hourglass-based search framework, namely HourNAS. The entire search space is divided into "vital" and "non-vital" parts accordingly. By gradually search the components in each part, the search cost can be reduced significantly. Since the "vital" parts are more important for the performance of the obtained neural network, the optimization on this part can ensure accuracy. By exploiting the proposed approach, we can directly search architectures on the ImageNet dataset that achieves a $77.0\%$ Top-1 accuracy using only 3 hours (i.e., about 0.1 GPU days), which outperforms the state-of-the-art methods in both terms of search speed and accuracy. + +Acknowledgement This work is supported by National Natural Science Foundation of China under Grant No. 61876007, and Australian Research Council under Project DE180101438 and DP210101859. + +# References + +[1] Gabriel Bender, Hanxiao Liu, Bo Chen, Grace Chu, Shuyang Cheng, Pieter-Jan Kindermans, and Quoc V Le. Can weight sharing outperform random architecture search? an investigation with tunas. CVPR. 2 +[2] Ermao Cai, Da-Cheng Juan, Dimitrios Stamoulis, and Diana Marculescu. Neuralpower: Predict and deploy energy-efficient convolutional neural networks. ACML, 2017. 1 +[3] Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, and Song Han. Once for all: Train one network and specialize it for efficient deployment. *ICLR*, 2020. 1 +[4] Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. *ICLR*, 2019. 3, 7 +[5] Jianlong Chang, xinbang zhang, Yiwen Guo, Gaofeng Meng, Shiming Xiang, and Chunhong Pan. Data: Differentiable architecture approximation. NeurIPS, 2019. 4, 6 +[6] Hanting Chen, Yunhe Wang, Chunjing Xu, Boxin Shi, Chao Xu, Qi Tian, and Chang Xu. Addernet: Do we really need multiplications in deep learning? CVPR, 2020. 1 +[7] Hanting Chen, Yunhe Wang, Chang Xu, Zhaohui Yang, Chuanjian Liu, Boxin Shi, Chunjing Xu, Chao Xu, and Qi Tian. Data-free learning of student networks. ICCV, 2019. 1 +[8] Hanlin Chen, Li'an Zhuo, Baochang Zhang, Xiawu Zheng, Jianzhuang Liu, David S. Doermann, and Rongrong Ji. Binarized neural architecture search. AAAI, 2020. 2 +[9] Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. ICCV, 2019. 6, 7 +[10] Zhuo Chen, Jiyuan Zhang, Ruizhou Ding, and Diana Marculescu. Vip: Virtual pooling for accelerating cnn-based image classification and object detection. WACV, 2020. 1 +[11] Ting-Wu Chin, Ruizhou Ding, Cha Zhang, and Diana Marculescu. Towards efficient model compression via learned global ranking. CVPR, 2020. 1 +[12] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. CVPR, 2019. 7 +[13] Jiequan Cui, Pengguang Chen, Ruiyu Li, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Fast and practical neural architecture search. ICCV, 2019. 7 +[14] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv, 2017. 6 +[15] Xiaohan Ding, guiguang ding, Xiangxin Zhou, Yuchen Guo, Jungong Han, and Ji Liu. Global sparse momentum sgd for pruning very deep neural networks. NeurIPS, 2019. 2 +[16] Xuanyi Dong and Yi Yang. One-shot neural architecture search via self-evaluated template network. ICCV, 2019. 2 +[17] Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in fourgpu hours. CVPR, 2019. 4, 6, 7 +[18] Xuanyi Dong and Yi Yang. Nas-bench-102: Extending the scope of reproducible neural architecture search. *ICLR*, 2020. 1 +[19] Thomas Elsken, Jan Metzen, and Frank Hutter. Efficient multi-objective neural architecture search via lamarckian evolution. *ICLR*, 2019. 4 + +[20] Ross Girshick. Fast r-cnn. ICCV, 2015. 1 +[21] Xinyu Gong, Shiyu Chang, Yifan Jiang, and Zhangyang Wang. Autogan: Neural architecture search for generative adversarial networks. ICCV, 2019. 2 +[22] 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. CVPR, 2020. 2 +[23] Zichao Guo, Xiangyu Zhang, Haoyuan Mu, Wen Heng, Zechun Liu, Yichen Wei, and Jian Sun. Single path oneshot neural architecture search with uniform sampling. arXiv, 2019. 1, 2, 7 +[24] Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, and Chang Xu. Ghostnet: More features from cheap operations. CVPR, 2020. 1 +[25] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. ICCV, 2017. 1 +[26] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016. 1, 3, 4, 7 +[27] Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. ECCV, 2018. 1 +[28] Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andretto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv, 2017. 7 +[29] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. CVPR, 2017. 1 +[30] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. ECCV. 6 +[31] Diederik P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. *ICLR*, 2015. 6 +[32] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, 2009. 1 +[33] Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. UAI. 1 +[34] Mingbao Lin, Rongrong Ji, Yuxin Zhang, Baochang Zhang, Yongjian Wu, and Yonghong Tian. Channel pruning via automatic structure search. *IJCAI*, 2020. 2 +[35] Shaohui Lin, Rongrong Ji, Chao Chen, Dacheng Tao, and Jiebo Luo. Holistic cnn compression via low-rank decomposition with knowledge transfer. TPAMI, 2019. 1 +[36] Shaohui Lin, Rongrong Ji, Yuchao Li, Yongjian Wu, Feiyue Huang, and Baochang Zhang. Accelerating convolutional networks via global & dynamic filter pruning. *IJCAI*, 2018. 1 +[37] Benlin Liu, Yongming Rao, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Metadistiller: Network self-boosting via meta-learned top-down distillation. ECCV, 2020. 1 +[38] Chenxi Liu, Liang-Chieh Chen, Florian Schroff, Hartwig Adam, Wei Hua, Alan L Yuille, and Li Fei-Fei. Auto-deeplab: Hierarchical neural architecture search for semantic image segmentation. CVPR, 2019. 2 +[39] Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, + +and Kevin Murphy. Progressive neural architecture search. ECCV, 2018. 2, 7 +[40] Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. *ICLR*, 2019. 1, 2, 4, 7 +[41] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. ECCV, 2016. 1 +[42] Zhichao Lu, Ian Whalen, Vishnu Boddeti, Yashesh D. Dhebar, Kalyanmoy Deb, Erik D. Goodman, and Wolfgang Banzhaf. Nsga-net: A multi-objective genetic algorithm for neural architecture search. GECC, 2018. 2, 4 +[43] Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. ECCV, 2018. 7 +[44] Chris J Maddison, Daniel Tarlow, and Tom Minka. A* sampling. NeurIPS, 2014. 6 +[45] Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. ICML, 2018. 2 +[46] Ruijie Quan, Xuanyi Dong, Yu Wu, Linchao Zhu, and Yi Yang. Auto-reid: Searching for a part-aware convnet for person re-identification. ICCV, 2019. 2 +[47] Prajit Ramachandran, Barret Zoph, and Quoc V Le. Searching for activation functions. arXiv, 2017. 7 +[48] Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. AAAI, 2019. 1, 2, 7 +[49] Mark B. Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. *CVPR*, 2018. 3, 7 +[50] Albert Shaw, Wei Wei, Weiyang Liu, Le Song, and Bo Dai. Meta architecture search. NeurIPS, 2019. 1 +[51] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. *ICLR*, 2015. 1 +[52] Dimitrios Stamoulis, Ting-Wu Rudy Chin, Anand Krishnan Prakash, Haocheng Fang, Sribhuvan Sajja, Mitchell Bognar, and Diana Marculescu. Designing adaptive neural networks for energy-constrained image classification. ICCAD, 2018. 1 +[53] Dimitrios Stamoulis, Ruizhou Ding, Di Wang, Dimitrios Lymberopoulos, Bodhi Priyantha, Jie Liu, and Diana Marculescu. Single-path nas: Designing hardware-efficient convnets in less than 4 hours. Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2019. 3 +[54] Dimitrios Stamoulis, Ruizhou Ding, Di Wang, Dimitrios Lymberopoulos, Bodhi Priyantha, Jie Liu, and Diana Marculescu. Single-path mobile automl: Efficient convnet design and nas hyperparameter optimization. IEEE Journal of Selected Topics in Signal Processing, 2020. 3 +[55] Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V. Le. Mnasnet: Platform-aware neural architecture search for mobile. CVPR, 2018. 2, 3, 4, 5, 6, 7 +[56] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. ICML, 2019. 3, 4, 5, 7 + +[57] Mingxing Tan and Quoc V. Le. Mixconv: Mixed depthwise convolutional kernels. BMVC, 2019. 6 +[58] Yehui Tang, Yunhe Wang, Yixing Xu, Hanting Chen, Boxin Shi, Chao Xu, Chunjing Xu, Qi Tian, and Chang Xu. A semi-supervised assessor of neural architectures. CVPR, 2020. 1 +[59] Yehui Tang, Yunhe Wang, Yixing Xu, Dacheng Tao, Chunjing Xu, Chao Xu, and Chang Xu. Scop: Scientific control for reliable neural network pruning. arXiv, 2020. 1 +[60] Andreas Veit, Michael Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. NeurIPS, 2016. 2, 3 +[61] Yunhe Wang, Yixing Xu, and Dacheng Tao. Dc-nas: Divide-and-conquer neural architecture search. arXiv preprint arXiv:2005.14456, 2020. 1 +[62] 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. CVPR, 2019. 1, 2, 3, 4, 5, 6, 7, 8 +[63] Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. Snas: stochastic neural architecture search. *ICLR*, 2019. 1, 2, 7 +[64] Yunyang Xiong, Ronak Mehta, and Vikas Singh. Resource constrained neural network architecture search. ICCV, 2019. 1, 7 +[65] Antoine Yang, Pedro M Esperança, and Fabio M Carlucci. Nas evaluation is frustratingly hard. *ICLR*, 2020. 1 +[66] 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. CVPR, 2020. 4, 7 +[67] Zhaohui Yang, Yunhe Wang, Chang Xu, Peng Du, Chao Xu, Chunjing Xu, and Qi Tian. Discernible image compression. ACMM, 2020. 1 +[68] Chris Ying, Aaron Klein, Eric Christiansen, Esteban Real, Kevin Murphy, and Frank Hutter. Nas-bench-101: Towards reproducible neural architecture search. ICML. 1 +[69] Fuxun Yu, Zhuwei Qin, Di Wang, Ping Xu, Chenchen Liu, Zhi Tian, and Xiang Chen. Dc-cnn: computational flow redefinition for efficient cnn through structural decoupling. Proceedings of the 23rd Conference on Design, Automation and Test in Europe, 2020. 1 +[70] Kaicheng Yu, Christian Sciuto, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. *ICLR*, 2019. 1 +[71] Arber Zela, Thomas Elsken, Tonmoy Saikia, Yassine Marrakchi, Thomas Brox, and Frank Hutter. Understanding and robustifying differentiable architecture search. *ICLR*, 2020. 1 +[72] Chiyuan Zhang, Samy Bengio, and Yoram Singer. Are all layers created equal. ICMLW, 2019. 2 +[73] Xiawu Zheng, Rongrong Ji, Lang Tang, Baochang Zhang, Jianzhuang Liu, and Qi Tian. Multinomial distribution learning for effective neural architecture search. ICCV, 2019. 7 +[74] Li'an Zhuo, Baochang Zhang, Hanlin Chen, Linlin Yang, Chen Chen, Yanjun Zhu, and David S. Doermann. Cp-nas: Child-parent neural architecture search for 1-bit cnns. *IJCAI*, 2020. 2 + +[75] Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. *ICLR*, 2017. 1, 2 +[76] Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. CVPR, 2018. 1, 2, 7 \ No newline at end of file diff --git a/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/images.zip b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..29d06084f39287743d668727f8ad670a05bb756c --- /dev/null +++ b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5d6fe6771308753f905853ad3aed1bcce11758ea67c47fe2fcdcfe44670dfe8 +size 443697 diff --git a/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/layout.json b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f8c9b08b63bcfe3e6bed2c659fd880d01c4027ad --- /dev/null +++ b/hournasextremelyfastneuralarchitecturesearchthroughanhourglasslens/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cb404a43e6b4cf9a1359f09fdba897fac63c74264981bb42ea784e6b492be3b +size 531874 diff --git a/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_content_list.json b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..868c33975f9235cbb8a114cbd0e5d4f56cc9cabe --- /dev/null +++ b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98d87efc4795ad0c42145013973b4cdc71aef888c496dffa75dd2429ab82e37f +size 69911 diff --git a/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_model.json b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..68c124f8a4329068f9a969465cc180dd5a9cd710 --- /dev/null +++ b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fb7d44b50468dbb8dc67ddc9f213057da13771908b5592e63b81000dce02a88 +size 83939 diff --git a/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_origin.pdf b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cd696cda54d82c2d3d9257dbf54eea4c3001ddb5 --- /dev/null +++ b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/f8d042cd-50db-4555-8e9d-86f6e13683c6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bab72dbbbb61fc004feb6466bb7aa82f9ee1cb094ea59a71b93102d553782597 +size 1815724 diff --git a/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/full.md b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e78a674c7ea2a83b562077d2cf81224aed05df85 --- /dev/null +++ b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/full.md @@ -0,0 +1,324 @@ +# House-GAN++: Generative Adversarial Layout Refinement Network towards Intelligent Computational Agent for Professional Architects + +Nelson Nauata Simon Fraser University nnauata@sfu.ca + +Hang Chu +Autodesk Research + +hang.chu@autodesk.com + +Sepidehsadat Hosseini Simon Fraser University sepidh@sfu.ca + +Chin-Yi Cheng +Autodesk Research +-yi.cheng@autodesk + +Kai-Hung Chang +Autodesk Research +kai-hung.chang@autodesk.com + +Yasutaka Furukawa Simon Fraser University furukawa@sfu.ca + +![](images/9514fc4189daea946941ad8da8db432a2ec759b069a1cca92510149bed3540c3.jpg) +Figure 1. The paper makes a breakthrough in automated house layout generation. The right is the mix of a ground-truth design by an architect and our generated samples, based on the input bubble-diagram. (The second from the right is the ground-truth.) A novel generative adversarial layout refinement network is trained to repeatedly apply and refine the design towards perfection. + +![](images/dea0d720120de158f2ef1de3773056ecac76700acc3fef4ba2a35cf29f8724d0.jpg) + +Mix of a ground-truth and generated house layouts + +![](images/c27c35359922df55edec7e4751e8a05bc8bd93227525ba543b567a56426e7086.jpg) + +![](images/6d8eea39dadc1ae45e39bc437af1db02cefdbd5c9ebdab72f871b62efb7d7983.jpg) + +# Abstract + +This paper proposes a generative adversarial layout refinement network for automated floorplan generation. Our architecture is an integration of a graph-constrained relational GAN and a conditional GAN, where a previously generated layout becomes the next input constraint, enabling iterative refinement. A surprising discovery of our research is that a simple non-iterative training process, dubbed component-wise GT-conditioning, is effective in learning such a generator. The iterative generator further allows us to improve a metric of choice via meta-optimization techniques by controlling when to pass which input constraints during iterative refinement. Our qualitative and quantitative evaluation based on the three standard metrics demonstrate that the proposed system makes significant improvements over the current state-of-the-art, even competitive against the ground-truth floorplans, designed by professional architects. Code, model, and data are available at https://ennauata.github.io/houseganpp/page.html. + +# 1. Introduction + +House design is a time-consuming iterative process, requiring multiple rounds of refinements. An architect + +sketches out a design, evaluates, adjusts, and repeats the cycles until being satisfied with a design within a given time budget. Unfortunately, designing an effective floorplan is possible only by professional architects, where a small fraction of buildings (less than $10\%$ in North America) employ a design professional for custom design due to the cost. Automatic floorplan generation will have tremendous impacts on the trillion-dollar real-estate/construction industries. + +Floorplan generation has been an active area of research. Early methods formulated it as iterative optimization [22, 21]. The surge of deep neural networks has made a breakthrough, where state-of-the-art algorithms [24, 7] utilize Generative Adversarial Networks (GANs) [10]. GAN is a one-shot generation process, converting a noise vector into a sample. A conditional GAN could take a design in progress and produce a refined version iteratively [25]. However, there does not exist a database of incomplete floorplans during design iterations, making such a training infeasible. + +This paper proposes a novel generative adversarial layout refinement network, where the generator is trained to generate a floorplan as a graph of segmentation masks by iteratively refining its design (See Fig. 1). We borrow the problem setup from the state-of-the-art system House-GAN [24], while making a few extensions towards a + +![](images/597569151805029a2dd68a6a74c216ecd8015bab03b798138b2145204c72a9b6.jpg) +Kitchen +Living room +Bedroom +Dining room +Bathroom +Study room +Balcony + +![](images/4c39db3722aece5c93d448e8ce1537a64bda652268e8195c44c776c1d2fe83bd.jpg) + +![](images/3a5586ad80ac5c36c083189ecae4c1b5f14adc17ea8660e481308050e3db1125.jpg) + +![](images/a26ab021a598dd6fa9e9778bae6c9204c5f06bbf0a97afdd6132103115a36a21.jpg) + +![](images/ab2f8169421864d9524ce29825cd4017be38e86386e079f32a59494c6eb1bec6.jpg) + +![](images/de130984d48494584c53d2d95147bc05112d70e0c1c9bfb67ba3aeb31ca2071f.jpg) + +Figure 2. We have parsed the RPLAN dataset [30] to prepare 60k house layouts with the corresponding bubble-diagrams. Our task is to generate a realistic and diverse set of floorplans that are compatible with the input bubble-diagram. +![](images/3c110df56df0d6e705699602ff7f0a6d5909e9996012613167ef70ec35c71fed.jpg) +$\odot$ Entrance +Storage +Unknown +Outside +Front door +Interior door + +![](images/b632cd0c275f63708eab63d2e7461870ffd8bba1cde3f4ffe1daaf4cced6aef8.jpg) + +![](images/aa8e6d01f2b89444dd56549a23330dc2e87ec47cfc5226105fcc7b430a9cf079.jpg) + +![](images/3fd6d8d55157c79d681f9032fa38042d43a55b18ec29053574a086873429adf4.jpg) + +![](images/f4944bc33adaf0b21b999420061a2ad733cebf871ba1c5d9932b4407cdc167bd.jpg) + +![](images/ca55bb12be632f463a28bcb1f4ac15bd2bf56cd0560875869fa722f7b67a5783.jpg) + +more challenging production-level task (i.e., handling nonrectangular room shapes, generating doors/entrances, and using a functional graph instead of an adjacency graph). + +The technical contribution of this paper is three-fold: an architecture, a training algorithm, and a test-time meta-optimization algorithm. First, the architecture is an integration of a graph-constrained relational GAN (i.e., based on the current state-of-the-art [24]) and a conditional GAN [25], where a previously generated model becomes the next input constraint, enabling iterative layout refinement. Second, a surprising discovery of our research is that a computationally affordable non-iterative training process, dubbed component-wise GT-conditioning, is effective in learning an iterative generator, where a ground-truth segmentation is passed to each component as a condition at a random probability. Third, our framework creates a new opportunity in further optimizing a metric of choice via meta-optimization, such as Bayesian optimization by controlling when to pass which constraints. + +We have used the RPLAN dataset [30], which offers 60k vector-graphics floorplans designed by professional architects. Qualitative and quantitative evaluations based on the three standard metrics (i.e., realism, diversity, and compatibility) in the literature demonstrate that the proposed system outperforms the current-state-of-the-art by a large margin. The system is even competitive against the groundtruth floorplans, based on user studies judged by professional architects. Code, model, and data are available at https://ennauata.github.io/houseganpp/page.html. + +# 2. Related Work + +This section reviews generative models for structured data such as objects, 3D buildings, or floorplans. + +Traditional methods: Classical algorithms formulate optimization or design hand-crafted rules for structured data generation. Procedural modeling is an early successful ap + +proach for 3D building models, where shape-grammars define iterative generation processes [23, 3]. Integer programming is formulated to generate an arrangement of tiles [26]. Optimization has also proven effective for game-level design [20, 12]. For floorplans specifically, Bayesian network is trained to learn distributions of architectural components for stochastic sample generation [22]. + +Neural approach (one-step generation): With the surge of deep learning, researchers started to train deep neural networks (DNNs) to learn a single-step model generation. Convolutional neural networks are trained to add objects into a room one by one for indoor scene generation [29, 27]. A scene graph generation in addition to the object placement are learned step by step via DNNs [28]. Neural turtle graphics learns RNNs to encode incoming paths and generate outgoing edges at one node [8]. An iterative algorithm uses the RNN modules repeatedly to generate road layouts. While being a reconstruction task as opposed to a generative one, RoadTracer learns a CNN that takes the current partial network then decides on a next action for reconstructing a road network from a satellite image [4]. + +Neural approach (joint generation): Joint generation of multiple components in an entire structured model is more challenging. Room boundaries as a raster image is estimated from a house foot-print by a CNN, followed by a series of heuristics to generate a vectorized floorplan [30]. Image generation has been an active area of research, where realistic object arrangements are learned via variational auto encoder [15], a differentiable renderer [16], or graph convolutional networks [14, 2]. Graph generation is modeled as a sequence of graph editing operations, whose entire process is learned by recurrent neural networks [31] or graph recurrent attention networks [17]. Natural language generation is another related area of research, where an auto-regressive model is trained by masking words from ground-truth sentences in the input [18]. The adversarial training is also + +![](images/f7afd912dc1e73c839d5b4079ba22f585c4f8b2243fd1c059e9f3bbd371a0a7e.jpg) +Figure 3. Our architecture is built on top of a relational GAN from the state-of-the-art system [24]. An additional 2D segmentation mask for each room/door can be specified as an input condition, enabling iterative design refinement. + +employed for the same language task [9] in a seq2seq architecture. This paper takes the idea of masking and adversarial training to the task of 2D layout generation, where our architecture jointly estimates segmentation masks for all architectural components (as opposed to a recurrent formulation) and is capable of iteratively refining a design. + +Neural approach (joint refinement generation): GAN-Hopper [19] is the closest to ours in the spirit of iterative refinement. The key differences are that our system produces a structured model (as opposed to a raster image), employs non-sequential training process, and is a generative model from a noise vector (as opposed to an image-to-image translation model between two domains). + +# 3. Problem Formulation + +In a standard design process, architects incorporate constraints from clients into a sketch called a bubble-diagram, then convert it into a floorplan through design explorations and iterations. We borrow the problem setup from the state-of-the-art system House-GAN [24], while adding a few extensions towards the production-level task. + +Input: The input to the system is a bubble-diagram, which is represented as a graph where a node encodes a room with its room type (See Fig. 2)1. In the original problem, an edge encoded spatial adjacency of two rooms. In this work, an edge encodes a functional connection ("interior door" or "front door") as in real architect's sketches. An "interior door" is a connection between two rooms, and a "front door" is a connection between a room and the outside area. + +Output: The output of the system is a segmentation mask for each room and door. We also utilize an off-the-shelf floorplan vectorization algorithm [6] to convert the layout into a vector floorplan image, where a room is represented by an axis-aligned closed-polygon, adjacent rooms share + +the walls with the common line segments, and a door is represented as a line-segment on a wall. + +Metrics: Realism, diversity, and compatibility are the three metrics, evaluating the performance as in the prior work [24]. Roughly speaking, realism is an average user rating, diversity is the Fréchet Inception Distance (FID) [13], and the compatibility is the graph edit distance (GED) [1] between the input bubble-diagram and the one constructed from the output layout. To account for the addition of doors, we adjusted the metric definitions slightly, whose details are referred to the supplementary document. We describe the details of the user study in Sect. 5. + +# 4. Technical Innovations + +Learning an iterative refinement process is non-trivial due to the lack of databases containing step-by-step design iterations. Our architecture is a straightforward integration of a relational GAN [24] and a conditional GAN [25]. A surprising discovery of our research is that a simple non-iterative training procedure is effective in training such an iterative generator. The iterative refinement capability opens up a new opportunity in further improving the metric of choice by meta-optimizing the refinement scheme at test-time. The section explains the architecture, the training algorithm, and the meta-optimization algorithm. + +# 4.1. Architecture + +Following House-GAN [24], our network backbone is a convolutional message passing network (Conv-MPN [32]), whose relational graph structure is defined by the bubble-diagram (See Fig. 3). There are three key differences in our architecture: 1) Edges in addition to nodes carry features for the generation of doors; 2) Each node/edge takes a 2D segmentation mask as an additional input constraint with an associated new loss; and 3) Conv-MPN feature pooling [32] is reformulated to allow feature-exchange between nodes and edges. We now explain the three differences in detail. + +Edge features: House-GAN has a 10-d one-hot vector, + +![](images/de6bd64bb9aaed1ac5d21325c5109b19001c1a7711ec850951f3e1d3c9dac272.jpg) +Figure 4. During training, we specify a GT segmentation mask for each room/door with a $50\%$ chance. The generator learns the task of inpainting missing components when many GT masks are given, or the task of generating a complete design when few masks are given. During testing, previously generated layouts are passed to the generator as potential input constraints, enabling iterative design refinement. + +![](images/0b93869cbd4eb72f7209d6bfe98fae2d7580af7428c2119649b7ef8083ee4997.jpg) + +which encodes a room type and initializes a node feature vector. In our work, doors have two types, and we extend the one-hot vector to 12-d over the mix of 10 room types and 2 door types. With the common type vector, door generation from an edge becomes the same as room generation from a node, except the pooling mechanism in the convolutional message passing as detailed in the following paragraph. + +Mask condition: HouseGAN initializes each node with a noise vector and a room-type, which is transformed into a $8 \times 8 \times 16$ feature volume. Our relational generator takes in an additional $64 \times 64 \times 2$ condition image for each node/edge. The first channel provides the segmentation mask, which we expect the generator to learn to keep unchanged. The second channel becomes 1 for every pixel when the segmentation mask is specified, otherwise 0. We use a 3-layer CNN to convert the condition image to $8 \times 8 \times 16$ , which is concatenated to the original feature. When the segmentation mask is specified, we enforce an L1-loss between the condition image $\hat{\mathbf{m}}_i$ and the generated mask $\mathbf{m}_i$ . $i$ is the index of a node or an edge. Precisely, let $\mathcal{I}$ denote the set of node/edge indices where the condition masks are specified. The loss function is defined as follows, where $L_{org}$ is the original generator adversarial loss [11] in HouseGAN and $\lambda$ is 1000: + +$$ +L = L _ {o r g} + \lambda \frac {1}{| \mathcal {I} |} \sum_ {i \in \mathcal {I}} | \mathbf {m} _ {i} - \hat {\mathbf {m}} _ {i} |. \tag {1} +$$ + +Conv-MPN pooling: Conv-MPN message passing is defined based on the connectivity of the relational graph [32]: + +$$ +\mathbf {g} _ {r} \leftarrow \operatorname {C N N} \left[ \mathbf {g} _ {r} \quad ; \quad \underset {s \in \mathcal {N} (r)} {\operatorname {P o o l}} \mathbf {g} _ {s} \quad ; \quad \underset {s \in \mathcal {N} (r)} {\operatorname {P o o l}} \mathbf {g} _ {s} \right]. \tag {2} +$$ + +$[\cdot ,\cdot ;]$ indicates concatenation, $\mathbf{g}_r$ feature volumes for a component $r$ (i.e. either a room or a door) and Pool $\mathbf{g}_s$ sumpooling over feature volumes $\mathbf{g}_s$ . $\mathcal{N}(r)$ and $\overline{\mathcal{N}}(r)$ denote + +the neighbors of $r$ and its complement. We redefine $\mathcal{N}(r)$ to allow feature exchange between rooms and doors. First, a room is a neighbor of its connected rooms and the doors in-between. Second, a door is a neighbor of its incidental two rooms. The rest of the architecture is the same as House-GAN, except that we upsample the feature volume three times instead of twice, where the final segmentation mask is produced in the resolution of $64 \times 64$ . + +# 4.2. Component-wise GT-conditional training + +Our training strategy is similar in spirit to "masking" in NLP [9] (See Fig. 4). In each training step, we pick a ground-truth layout at random, initialize a relational graph with its bubble-diagram, then specify a ground-truth segmentation mask as the input condition for each room/door with a $50\%$ chance. This strategy forces the generator to either create a whole layout when few GT conditions are specified, or simply inpaint the missing components when many GT conditions are given. Surprisingly, this simple training process allows the generator to iteratively improve a design by passing the previously generated layout as the input condition. + +# 4.3. Meta-optimizing iterative refinement scheme + +Iterative layout refinement starts by running a generator without input constraints. From the second iteration, we have an option of specifying the previously generated room/edge masks. What is the best strategy? Is it the best to always pass all the constraints? We propose three strategies that control when to pass which constraints based on: 1) fixed heuristics; 2) static node/edge properties; or 3) dynamic layout information. In the latter two cases, we parameterize the space of strategies and employ a meta-optimization algorithm to seek for good solutions subject to either our diversity or compatibility metrics. In all strategies, we run the generator 10 times to refine a layout. + +Fixed heuristics: The first heuristic is to pass the segmentation mask for each room/door at a $50\%$ chance at every iteration $(\text{Ours}_{\text{heur}}^{50\%})$ . The second heuristic is to always specify all the conditions $(\text{Ours}_{\text{heur}}^{100\%})$ . + +Static scheme (Oursstatic): Our static scheme is based on the observation that architects start by designing certain spaces first (e.g., a living room). We parameterize the scheme by a 12-d vector $\{V_i\}$ , where $i$ is an index over 10 room types and 2 door types. Each element takes a value in the range [1, 10]. Suppose $V_3$ is 4. In this scheme, the previous mask is specified as the input condition for the $3_{rd}$ room (or door) type after the $4_{th}$ iteration. FID (i.e., diversity) score is the target metric for the optimization. + +Dynamic scheme (Oursdyna): Another intuitive strategy is to control the conditioning based on the compatibility of the current model with the input bubble-diagram. We parameterize the scheme by two 12-d vectors $\{T_i\}$ and $\{U_i\}$ , where $i$ is again the index over the room/door type. Suppose $T_3$ is 4, and $U_3$ is 7. In this scheme, the previously generated mask is specified after the $4_{th}$ (resp. $7_{th}$ ) iteration if the current room (door) is compatible (resp. incompatible) for the $3_{rd}$ room type. FID (i.e., diversity) or a graph edit distance (i.e., compatibility) is the target metric. + +# 5. Implementation Details + +We use PyTorch for implementation and a workstation with dual Xeon CPUs and dual NVIDIA Titan RTX GPUs. We adopt the same training configuration as in House-GAN except for the batch size (1 instead of 32) and the number of iterations (500k instead of 300k). For the meta scheme optimization, we use the Python library Hyperopt [5] with Tree-structured Parzen Estimators. In each round, we compute the target metric on 1,000 bubble-diagrams from the training set, and pick the best scheme after 500 rounds. + +Testing framework: To avoid a network from simply copying and pasting layouts, we use the k-fold cross validation from House-GAN [24], while dividing the samples into four groups based on the number of rooms: (5, 6, 7, 8): When generating layouts with 8 rooms, we use samples from the other three groups for training. At test time, we randomly pick a GT layout from the test set, use its bubble-diagram to initialize a relational graph. The process repeats 1,000 times to generate 1,000 samples for the evaluation. For the diversity and compatibility evaluations, we compute the mean and the standard deviation of the metrics over five rounds. + +Realism user study: We have carried out the user study with 10 amateurs (i.e. engineers and graduate students) and 10 professional architects on two layout representa + +tions. The first is the raw output of the systems as pixelwise segmentation masks. The second is a vector-floorplan representation where we have used an off-the-shelf floorplan vectorization system (Floor-SP [6]) for the conversion of the samples except for the ground-truth. Each room/door is assigned a unique color based on its type as in Fig. 2. A subject is presented a pair of layouts as in Fig. 5, and asked which one is more realistic or a tie. A method scores $(+1)$ for a win, $(-1)$ for a loss, and $(0)$ for a tie. For each pair of methods, we generate 100 pairs to be presented to 10 amateurs and 10 professional architects, where the average score becomes the realism metric. Please see the supplementary document for the full details of the user study. + +Competing methods: We compare against the three competing methods with their official implementations: HouseGAN [24], Ashual et al. [2], and Johnson et al. [14]. For House-GAN [24], the room shapes were simplified to rectangles via pre-processing in their work. In our experiments, non-rectangular room shapes are used for fair comparison. For Ashual et al. [2] and Johnson et al. [14], we convert our bubble-diagram and floorplan data into their scene-graph representations, while limiting to three connection types ("room-room", "room-door", or "none"). + +# 6. Experimental Results + +Table 1 provides the main results, where we use the proposed approach with a baseline refinement scheme $(\text{Ours}_{\text{heur}}^{50\%})$ . The table shows that our system outperforms all the other methods in all the metrics with clear margins, which are the greatest for the most challenging task (i.e., column "8", generating layouts of 8 rooms, where layouts of 5, 6, or 7 rooms are used for training). Note that a realism metric is first computed for pairs of methods as described above, then their average is reported for each method. + +Qualitative evaluations on realism, diversity, and compatibility are in Figs. 5, 6, and 7, respectively. The figures show that our layouts are more realistic with better room arrangements and shapes. House-GAN does a reasonable job especially in the diversity evaluation, but doors are often missing and room boundaries have noticeable artifacts. Compatibility is more challenging in our problem, where the functional connectivity is given in the bubble diagram and small doors need to be placed precisely at the room boundaries. Fig. 8 shows how the iterative refinement improves the design quality over time with our method Oursstatic. Both the room spatial arrangement and their shapes make significant improvements over the iterations. + +The complete pairwise realism scores are provided in Fig. 10. The left is the results with raw segmentation visualization, where two of our methods (Ours $_{heur}$ and Ours $_{static}$ ) are compared against the three competing methods and the ground-truth. Our scheme-optimized system + +Table 1. The main quantitative evaluations. Realism is measured by a user study with amateurs and professional architects. Diversity is measured by the FID scores. Compatibility is measured by the graph edit distance. (↑) and (↓) indicate the higher-the-better and the lower-the-better metrics, respectively. The cyan, orange, and magenta colors indicate the first, the second, and third best results, respectively. + +
ModelRealism (↑)Diversity (↓)Compatibility (↓)
856785678
Ashual et al. [2]-0.7120.6±0.5172.5±0.2162.1±0.4183.0±0.47.5±0.09.2±0.010.0±0.011.8±0.0
Johnson et al. [14]-0.7167.2±0.3168.4±0.4186.0±0.4186.0±0.47.7±0.06.5±0.010.2±0.011.3±0.1
House-GAN [24]0.037.5±1.141.0±0.632.9±1.266.4±1.72.5±0.12.4±0.13.2±0.05.3±0.0
Ours50%heur0.230.4±4.437.6±3.027.3±4.932.9±4.91.9±0.32.2±0.32.4±0.33.9±0.5
+ +![](images/a4646bc06afcdc08f942222143b9a5bb3a85b15cab7e0a9f18cb2e727e532836.jpg) +Input graph + +![](images/405a7c8a87a626a18e2dbaa72c0ceff44e682b2ac0c887ad8b0472eac753d652.jpg) + +![](images/d6ad082b1545c9cdbe401483af5397101970baf4020f899df8fe356666db8b73.jpg) + +![](images/e2e8f4126d96c724eec426bf26fceebda74209bcc54595862795af65bc0791bf.jpg) +Figure 5. Realism evaluation. One generated layout is shown for each input bubble diagram. + +![](images/2fc01603b835c725885df28fb3fb3b443ff369b6145ab84cdd8193f6fa987982.jpg) +Ashual et al. + +![](images/ee428a11ce9622afc7173c427b0bba546a2b2ca4d018c3e9a9452db14853291a.jpg) + +![](images/eb991381ef0cef98e41916734f13b197327f1e6d29db9fdc16b898b44e86fc56.jpg) + +![](images/2814ab70b4b4ed60691eb8c7ecd3580ce688a45469043663e39e753ff34ce3e4.jpg) + +![](images/b9962f624382d0eb0e271c8d3e6b64784171ec11199f4e2a25add767ee6ed179.jpg) +Johnson et al. + +![](images/dbf342bc78f3b93a6d756819f8afbfa53f64ea1e5527b3a831f13b065d579e21.jpg) + +![](images/e612f8b58c2e3298c738692918242f486c849433afb8e91ed4b90b6e0c01d461.jpg) + +![](images/c75802327df6b6017023bc4dcbd4a764046fbe405e7d213f011b8ca4f9d1fee5.jpg) + +![](images/9fad982ba63efa9fbeb35c6469bd0d225a866ca9538431c2a272f8b32503cd9e.jpg) +House-GAN + +![](images/3254d8435ba28ac14ee4525f5e6a019e96b010476d79669081d9328693dcde07.jpg) + +![](images/fdd4f602c2e69bae4a949ea76950d2c73c51a34cad1ff011772d96deb2e7bc0e.jpg) + +![](images/ddec7234565530df5b631044793ddea6cdd4473b50b5fed9b02ccd850dfc3fd0.jpg) + +![](images/6bfdbae0a6980306b5f2e7fd1467bc4bba27ec9b602eb7256f5f6daf72e1778f.jpg) +Ours static + +![](images/09274fc8f346767eba2b4213a6ea4a4f2e50b54ea3e16284823b4756d12bfc0c.jpg) + +![](images/f6fcc42318d2598876f705c9c3dac768cdbca008d504650e3f5fcda4d7cdf57f.jpg) + +![](images/3494d9df79fd3ff49eef9a5eed44e17a3786122a84b03c98e11309935e5b7c0b.jpg) + +![](images/557d270965cb7fa663f92a75e057b1b816157e25cf364d33213c953204202db2.jpg) +Ground-truth + +![](images/5625c76053a32768f4604ab1de70a265041cc66eac2f285e44e5509e1d8abf58.jpg) + +![](images/21a54f63fcf8fc20751a36417b58dcbcf37b299ad786c584dfaff99eeb2ffafa.jpg) + +![](images/787368a2931657267e724f3b36da81de68e76a6d02608108dfd81cd4573de1e8.jpg) + +(Oursstatic) is the best among the competing methods but is still behind GT with a big margin. In direct comparisons between Oursstatic and GT, subjects choose "Ours is better" only $6\%$ of the time ("tie" is $20\%$ ). The right is the results with the vector-floorplan visualization, comparing against the best competing method House-GAN and the groundtruth. For this evaluation, in addition to Oursstatic, we have prepared another variant Oursstatic* where only fully compatible samples (roughly $10\%$ in our generations) are used in the evaluation. While GT is still the winner, Oursstatic* scores -0.18 against GT, where 0.0 is the ultimate score when our results become indistinguishable from GT. Subjects chose "Ours is better", "tie", and "GT is better" at $25\%$ , $32\%$ , and $43\%$ of the time, respectively, indicating that even professional architects struggle to distinguish our + +results from GT (See Figs. 9 and 10). + +Lastly, Table 2 demonstrates the effectiveness of the scheme optimization, where the diversity or the compatibility is the target metric. The compatibility optimization requires the information of the current design (i.e., dynamic information) and cannot be optimized with Oursstatic. Overall, optimized refinement schemes outperform heuristic schemes consistently. The best compatibility measure is achieved when the compatibility metric is the target. Looking at the scheme parameters, we found that in 9 out of 12 node/edge types, the scheme passes the mask-conditions at earlier iterations when being compatible, which agrees with our intuition. The best diversity measure is achieved when the diversity is the metric. Looking at the parameters of Oursstatic, we found that the scheme passes the mask + +![](images/647ccb76827e5c1a2373d207b72dc55a2b19dd80735bd44b1ff9aca2fa3567bf.jpg) + +![](images/055bdf995360dcd3faae5b062c08b1766e78a80ba03fd39aecdad1092137223f.jpg) +Figure 6. Diversity evaluation. Given an input bubble-diagram, we show six samples generated by each method. + +![](images/34406a1fc650537d8e2012f810d596925d3fa1aa099396c7b6b4cfc90da69f9a.jpg) + +![](images/44e79f37098d9ced331ca1a8d0278c0d1c55c33d8a5516ddd479612f1cbafc6c.jpg) +Figure 7. Compatibility evaluation. The figure shows the inconsistency between the input bubble diagram and the ones constructed by the output layouts. The orange, red and green colors indicate if an edge is missing, wrongly predicted, or correctly predicted. + +conditions in the order of doors, living room, kitchen, bedroom, and bathroom. This was counter-intuitive at first, because one designs doors last. This is due to the fact that doors are small and the effects of the L1-loss are minimal. We found that the doors often move when the input conditions are specified. The rest of the room order makes sense, as it is easy to start with rooms at the core (i.e., living room). + +# 7. Conclusion + +This paper makes a breakthrough in the task of automated house layout generation via a novel generative adversarial refinement network, generating vector floorplans often indistinguishable from ground-truth. While we have evaluated the offline layout generation task, the capability + +![](images/15109566a5f1a6a6aa643993d9e23b14920fc310f864a5bfe151877ade3fd75e.jpg) +Figure 8. Iterative layout refinement. Each row shows the input bubble-diagram and the iterative refinement process over the 10 iterations. + +![](images/486fbe81cfd59cbc22055159d0fcbcc8f872fd22170d3040de324fef2384d755.jpg) +Figure 9. Representative user study results. The left is the raw segmentation visualization and the right is the vector-floorplan visualization. Each column is a pair presented to the subjects. A green mark denotes the preferred design. Two green marks denote a tie. + +Table 2. Refinement scheme optimization. The diversity and the compatibility metrics are shown for House-GAN and five variants of our method. Meta optimization is used to optimize the refinement scheme in the last three rows. "Target" column indicates the target metric of the scheme-optimization, where "Divers." and "Compat." indicate FID and the graph edit distance metrics. + +
ModelTargetDivers. (↓)Compat. (↓)
House-GANN/A66.4±1.75.3±0.0
Ours50%heurN/A32.9±4.93.9±0.5
Ours100%heurN/A31.2±0.63.7±0.1
OursstaticDivers.27.3±1.13.2±0.1
OursdynaDivers.24.7±0.83.7±0.0
OursdynaCompat.35.7±1.32.6±0.0
+ +of refining an incomplete design has huge potentials for incorporating user inputs: Architects can take a design, makes adjustments, and pass back to the system for refinement. + +![](images/a2672f5f15084ad4ef9081c8969f49e789ee8dad51aa1a0a85d19d1062165ed9.jpg) +Figure 10. Realism scores based on the user study for each pair of methods (or GT). The tables are to be read row-by-row: The bottom row shows that the GT receives positive scores against all the other methods. The left is the evaluation with raw segmentation masks, and the right is with the vector-floprplan images. + +Acknowledgement: The research is supported by NSERC Discovery Grants, NSERC Discovery Grants Accelerator Supplements, and DND/NSERC Discovery Grant Supplement. We thank architects and students for the user study. + +# References + +[1] Zeina Abu-Aisheh, Romain Raveaux, Jean-Yves Ramel, and Patrick Martineau. An exact graph edit distance algorithm for solving pattern recognition problems. 2015. 3 +[2] Oron Ashual and Lior Wolf. Specifying object attributes and relations in interactive scene generation. In Proceedings of the IEEE International Conference on Computer Vision, pages 4561-4569, 2019. 2, 5, 6 +[3] Fan Bao, Dong-Ming Yan, Niloy J Mitra, and Peter Wonka. Generating and exploring good building layouts. ACM Transactions on Graphics (TOG), 32(4):1-10, 2013. 2 +[4] Favyen Bastani, Songtao He, Sofiane Abbar, Mohammad Al-izadeh, Hari Balakrishnan, Sanjay Chawla, Sam Madden, and David DeWitt. Roadtracer: Automatic extraction of road networks from aerial images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4720–4728, 2018. 2 +[5] James Bergstra, Daniel Yamins, and David Cox. Making a science of model search: Hyperparameter optimization in hundreds of dimensions for vision architectures. In International conference on machine learning, pages 115-123, 2013. 5 +[6] Jiacheng Chen, Chen Liu, Jiaye Wu, and Yasutaka Furukawa. Floor-sp: Inverse cad for floorplans by sequential room-wise shortest path. In Proceedings of the IEEE International Conference on Computer Vision, pages 2661-2670, 2019. 3, 5 +[7] Qi Chen, Qi Wu, Rui Tang, Yuhan Wang, Shuai Wang, and Mingkui Tan. Intelligent home 3d: Automatic 3d-house design from linguistic descriptions only. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12625-12634, 2020. 1 +[8] Hang Chu, Daiqing Li, David Acuna, Amlan Kar, Maria Shugrina, Xinkai Wei, Ming-Yu Liu, Antonio Torralba, and Sanja Fidler. Neural turtle graphics for modeling city road layouts. In Proceedings of the IEEE International Conference on Computer Vision, pages 4522-4530, 2019. 2 +[9] William Fedus, Ian Goodfellow, and Andrew M Dai. Maskgan: Better text generation via filling in the... arXiv preprint arXiv:1801.07736, 2018. 3, 4 +[10] 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, pages 2672–2680, 2014. 1 +[11] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, pages 5767-5777, 2017. 4, 5 +[12] Mark Hendrikx, Sebastiaan Meijer, Joeri Van Der Velden, and Alexandru Iosup. Procedural content generation for games: A survey. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 9(1):1-22, 2013. 2 +[13] 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. 3 +[14] 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, pages 1219–1228, 2018. 2, 5, 6 +[15] Akash Abdu Jyothi, Thibaut Durand, Jiawei He, Leonid Sigal, and Greg Mori. Layoutvae: Stochastic scene layout generation from a label set. In Proceedings of the IEEE International Conference on Computer Vision, pages 9895-9904, 2019. 2 +[16] Jianan Li, Jimei Yang, Aaron Hertzmann, Jianming Zhang, and Tingfa Xu. Layoutgan: Generating graphic layouts with wireframe discriminators. arXiv preprint arXiv:1901.06767, 2019.2 +[17] Renjie Liao, Yujia Li, Yang Song, Shenlong Wang, Will Hamilton, David K Duvenaud, Raquel Urtasun, and Richard Zemel. Efficient graph generation with graph recurrent attention networks. In Advances in Neural Information Processing Systems, pages 4255-4265, 2019. 2 +[18] Yi Liao, Xin Jiang, and Qun Liu. Probabilistically masked language model capable of autoregressive generation in arbitrary word order. In Annual Meeting of the Association for Computational Linguistics, 2020. 2 +[19] Wallace Lira, Johannes Merz, Daniel Ritchie, Daniel Cohen-Or, and Hao Zhang. Ganhopper: Multi-hop gan for unsupervised image-to-image translation. In ECCV, 2020. 3 +[20] Chongyang Ma, Nicholas Vining, Sylvain Lefebvre, and Alla Sheffer. Game level layout from design specification. In Computer Graphics Forum, volume 33, pages 95-104. Wiley Online Library, 2014. 2 +[21] Jess Martin. Procedural house generation: A method for dynamically generating floor plans. In Proceedings of the Symposium on Interactive 3D Graphics and Games, pages 1-2, 2006. 1 +[22] Paul Merrell, Eric Schkufza, and Vladlen Koltun. Computer-generated residential building layouts. In ACM Transactions on Graphics (TOG), volume 29, page 181. ACM, 2010. 1, 2 +[23] Pascal Müller, Peter Wonka, Simon Haegler, Andreas Ulmer, and Luc Van Gool. Procedural modeling of buildings. In ACM SIGGRAPH 2006 Papers, pages 614-623. 2006. 2 +[24] Nelson Nauata, Kai-Hung Chang, Chin-Yi Cheng, Greg Mori, and Yasutaka Furukawa. House-gan: Relational generative adversarial networks for graph-constrained house layout generation. In ECCV, 2020. 1, 2, 3, 5, 6 +[25] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2536-2544, 2016. 1, 2, 3 +[26] Chi-Han Peng, Yong-Liang Yang, and Peter Wonka. Computing layouts with deformable templates. ACM Transactions on Graphics (TOG), 33(4):1-11, 2014. 2 +[27] Daniel Ritchie, Kai Wang, and Yu-an Lin. Fast and flexible indoor scene synthesis via deep convolutional generative + +models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6182-6190, 2019. 2 +[28] Kai Wang, Yu-An Lin, Ben Weissmann, Manolis Savva, Angel X Chang, and Daniel Ritchie. Planit: Planning and instantiating indoor scenes with relation graph and spatial prior networks. ACM Transactions on Graphics (TOG), 38(4):132, 2019. 2 +[29] Kai Wang, Manolis Savva, Angel X Chang, and Daniel Ritchie. Deep convolutional priors for indoor scene synthesis. ACM Transactions on Graphics (TOG), 37(4):1-14, 2018. 2 +[30] Wenming Wu, Xiao-Ming Fu, Rui Tang, Yuhan Wang, YuHao Qi, and Ligang Liu. Data-driven interior plan generation for residential buildings. ACM Transactions on Graphics (TOG), 38(6):1-12, 2019. 2 +[31] Jiaxuan You, Rex Ying, Xiang Ren, William L Hamilton, and Jure Leskovec. Graphrn: Generating realistic graphs with deep auto-regressive models. In ICML, 2018. 2 +[32] Fuyang Zhang, Nelson Nauata, and Yasutaka Furukawa. Conv-mpn: Convolutional message passing neural network for structured outdoor architecture reconstruction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2798-2807, 2020. 3, 4 \ No newline at end of file diff --git a/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/images.zip b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7a6f0649aca9c33fd1b56e284683f6b89e34d191 --- /dev/null +++ b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd66b4492fe87968c7d1583d27cad7293d6d5a4bd57c817d48b94bcd4a28cf21 +size 639182 diff --git a/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/layout.json b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..99db144c6eea96cb12f31d34bad57da3f4c81b65 --- /dev/null +++ b/housegangenerativeadversariallayoutrefinementnetworktowardsintelligentcomputationalagentforprofessionalarchitects/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40a835de873b9c0b7eb5a62c3fd619cf72485ecff45207037e51dfc0aa7f9c15 +size 367544 diff --git a/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_content_list.json b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7ff6a4f92b7784e15dea9343b16bda09f78b07ad --- /dev/null +++ b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bd85f4718f13af93de8c627cc896b21310d5575a57b9fe11ab78e81a89cb41e +size 92006 diff --git a/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_model.json b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7768112aa33998e0b6a96f9ad1b3fcd6fb73fa1c --- /dev/null +++ b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78c8e35972f08cc49d93d10b620a761ee954ca6b8d8e7d073b6f948f66009f84 +size 119365 diff --git a/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_origin.pdf b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..61d0b1ddc4b7a7edab2779680bedbba1a8a55696 --- /dev/null +++ b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/1566b85f-1f56-4d86-aec7-214d0a6781d2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a63efc55de324bb913d448a80ef685421bdad21b3fe1cbd2ba4574d424b999e6 +size 536768 diff --git a/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/full.md b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0ef29ac95d9fe6bd79da6828fc8def0a88a8347e --- /dev/null +++ b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/full.md @@ -0,0 +1,345 @@ +# HR-NAS: Searching Efficient High-Resolution Neural Architectures with Lightweight Transformers + +Mingyu Ding $^{1*}$ Xiaochen Lian $^{2}$ Linjie Yang $^{2}$ Peng Wang $^{2}$ Xiaojie Jin $^{2}$ Zhiwu Lu $^{3}$ Ping Luo $^{1}$ $^{1}$ The University of Hong Kong + $^{2}$ Bytedance Inc. + +$^{3}$ Gaoling School of Artificial Intelligence, Renmin University of China + +{myding, pluo}@cs.hku.hk + +luzhiwu@ruc.edu.cn + +{xiaochen.lian, linjie.yang, peng.wang, jinxiaojie}@bytedance.com + +# Abstract + +High-resolution representations (HR) are essential for dense prediction tasks such as segmentation, detection, and pose estimation. Learning HR representations is typically ignored in previous Neural Architecture Search (NAS) methods that focus on image classification. This work proposes a novel NAS method, called HR-NAS, which is able to find efficient and accurate networks for different tasks, by effectively encoding multiscale contextual information while maintaining high-resolution representations. In HR-NAS, we renovate the NAS search space as well as its searching strategy. To better encode multiscale image contexts in the search space of HR-NAS, we first carefully design a lightweight transformer, whose computational complexity can be dynamically changed with respect to different objective functions and computation budgets. To maintain high-resolution representations of the learned networks, HR-NAS adopts a multi-branch architecture that provides convolutional encoding of multiple feature resolutions, inspired by HRNet [73]. Last, we proposed an efficient fine-grained search strategy to train HR-NAS, which effectively explores the search space, and finds optimal architectures given various tasks and computation resources. As shown in Fig.1 (a), HR-NAS is capable of achieving state-of-the-art trade-offs between performance and FLOPs for three dense prediction tasks and an image classification task, given only small computational budgets. For example, HR-NAS surpasses SqueezeNAS [63] that is specially designed for semantic segmentation while improving efficiency by $45.9\%$ . Code is available at https://github.com/dingmyu/HR-NAS. + +# 1. Introduction + +Neural architecture search (NAS) has achieved remarkable success in automatically designing efficient models for image classification [76, 43, 47, 53, 6, 79, 5, 64, 92, 26]. + +![](images/39ef0f384766bc6c96d41fcf2c0de7e3ec764e7c1c7aff7c7492012d8a2edf87.jpg) + +![](images/4245d841d56d61db5dac15f83525a4c5a7368dfafc22dfde405e75068825224b.jpg) + +![](images/8a3ec15cb3497e568e53194d7fce6bdf55981d2625df044dab6cd39b5e6e7141.jpg) +Figure 1. Comparisons of the efficiency (i.e., FLOPs) and the performance (e.g., Acc, mIoU, AP) on 4 computer vision tasks, i.e., classification (ImageNet), segmentation (CityScapes), pose estimation (COCO), and 3D detection (KITTI), between the proposed approach and existing SoTA methods. Each method is represented by a circle, whose size represents the number of parameters. $\star$ represents the optimal model with both high performance and low FLOPs. Our approach achieves superior performance under similar FLOPs compared to its counterparts on all four benchmarks. + +![](images/d5c94ceba7e5344d413853a7e067111b659c16c65502f6f4286f60414d255e29.jpg) + +NAS has also been applied to improve the efficiency of models for dense prediction tasks such as semantic segmentation [63, 8] and pose estimation [19]. However, existing NAS methods for dense prediction either directly extend the search space designed for image classification [19, 44], only search for a feature aggregation head [54, 8], organizing network cells in a chain-like single-branch manner [46, 63]. This lack of consideration to the specificity of dense prediction hinders the performance advancement of NAS methods compared to the best hand-crafted models [73, 23]. + +In principle, dense prediction tasks require the integrity of the global context and the high-resolution (HR) representation; the former is critical to clarify ambiguous local features [87] at each pixel, and the latter is useful for the accu + +rate prediction of fine details [39], such as semantic boundaries and keypoint locations. However, these two aspects, especially the HR representations, have not got enough attention in existing NAS algorithms for classification. The straightforward strategy to implement the principle is manually combining multi-scale features at the end of the network [46, 9, 41], while recent approaches [23, 73, 88] show the performance can be enhanced by putting multi-scale feature processing within the network backbone. Another observation from recent research is that multi-scale convolutional representations can not guarantee a global outlook of the image since dense prediction tasks often come with high input resolution but a network often only covers a fixed receptive field. Therefore, global attention strategies such as SENet [34] and non-local network [75] have been proposed to enrich image convolutional features. Most recently, inspired by its success in natural language processing, Transformer architectures [72, 66], which contain global attention with spatial encoding, have also shown superior results when combined with convolutional neural network for image classification [24] and object detection [7]. + +Motivated by the above observations, in this work, we propose a NAS algorithm, which incorporates these strategies, i.e. in-network multi-scale features and transformers, and enables their adaptive changing with respect to task objectives and resource constraints. In practice, it is nontrivial to put them together. Firstly, Transformer has a high computational cost that is quadratic w.r.t. image pixels and hence unfriendly to the NAS search space of efficient architectures. We solve this through a dynamic down projection strategy, yielding a lightweight and plug-and-play transformer architecture that can be combined with other convolutional neural architectures. In addition, searching a fused space of multi-scale convolution and transformers needs proper feature normalization, selection of fusion strategies and balancing. We did extensive studies to calibrate various model choices that generalize to multiple tasks. + +In summary, HR-NAS works as follows. We first setup a super network, where each layer contains a multi-branch parallel module followed by a fusion module. The parallel module contains searching blocks with multiple resolutions, and the fusion module contains searching blocks of feature fusion determining how feature from different resolutions fuses. Then, based on the computational budget and the task objective, a fine-grained progressive shrinking search strategy is introduced to prune redundant channels in convolutions and queries in transformers, resulting in an efficient model that provides the best trade-off between performance and computational costs. With extensive experiments, HR-NAS achieves state-of-the-art on multiple dense prediction tasks and competitive results on image classification under highly efficient settings with a single search. Fig. 1 shows a comprehensive comparison of our proposed approach with + +previous NAS approaches as well as manually designed networks on four different tasks. + +Our main contributions are three-fold. (1) We introduce a novel lightweight and plug-and-play transformer, which is highly efficient and can be easily combined with convolutional networks for computer vision tasks. (2) We propose a well-designed multi-resolution search space containing both convolutions and transformers to model in-network multi-scale information and global contexts for dense prediction tasks. To our best knowledge, we are the first to integrate transformers in a resource-constrained NAS search space for computer vision. (3) A resource-aware search strategy allows us to customize efficient architectures for different tasks. Extensive experiments show models produced by our NAS algorithm achieve state-of-the-art on three dense prediction tasks and four widely used benchmarks with lower computational costs. + +# 2. Related Work + +Transformers. Transformer [72, 66], a model architecture relying on a self-attention mechanism to learn dependencies between input and target, is used primarily in natural language processing. Generative Pre-trained Transformer (GPT) uses language modeling as a pre-training task [58, 4]. BERT [21] improves Transformer with a masked language model and a learned positional embedding to replace the sinusoidal positional encoding [72]. + +Since Transformer is suitable for capturing global information and pairwise interactions, some attempts [75, 7, 24, 77] have been made to adapt it to computer vision. Nonlocal networks [75] proposed a self-attention architecture to capture long-range interactions which can be viewed as a simplified version of Transformer. DETR [7] formulates object detection as a set prediction problem, which is naturally modeled as a sequence prediction task by the Transformer. Visual Transformers [77] represent images as a set of visual tokens and apply a Transformer-based structure to detect relationships between visual semantic concepts for semantic segmentation. iGPT [10] uses a standard Transformer to unsupervisedly learn generative relationships of image pixels. However, since its computational complexity grows quadratically with the number of pixels, such applications of Transformers in computer vision are computationally expensive. Some approaches [61, 48, 37, 74, 13] leverage network compression techniques, such as dynamic routing and knowledge distillation, to improve the efficiency of Transformers in NLP. However, efficient Transformers are seldom explored in computer vision. In light of this, we formulate Transformer into an efficient and plug-and-play module that is seamlessly integrated into a well-designed NAS search space. + +Neural Architecture Search for Efficient models. Early approaches utilize reinforcement learning [93] and evo + +lution algorithms [60, 51] to find efficient and powerful network structures. However, these methods are usually computationally expensive. To improve the efficiency of the search process, differentiable search methods such as Darts [47, 38, 80] and ProxylessNAS [6] formulate the search space as a super-graph where the probability to adopt an operator is represented by a continuous importance weight, allowing an efficient search of the architecture using gradient descent. Other approaches [3, 67, 31] utilize a random sampling approach when training the super-net and search for the best model candidate after the network converges. Inspired by the manually designed structures, [68, 33] use a search space based on MobileNetV2 [62] to search for efficient structures. Mixed convolution [70, 53] is also adopted in NAS search spaces due to its multi-scale feature modeling capability. Recently, model scaling techniques are used to expand the search space from operators to other hyper-parameters such as input resolutions, channel numbers, and layer numbers [5, 84]. In order to search for efficient models, the existing methods usually borrow efficient operators from manually designed networks, such as depthwise convolution and Inverted Residual Block [62]. To construct the search space with more powerful operators, we design a new efficient Transformer structure that can be directly inserted into existing NAS search spaces. + +Neural Architecture Search for Dense Prediction. The current NAS algorithms either reuse search spaces for image classification or only search for a feature aggregation head for dense prediction tasks. A single branch supernet structure is usually utilized for dense prediction tasks such as semantic segmentation [63, 46, 44], object detection [25, 12, 28], and human pose estimation [19]. Structures of feature aggregation head are also discovered using NAS algorithms for semantic segmentation [8, 54]. Recent explorations [29, 88] aim to find an optimal network layout in a hierarchical multi-scale search space. However, their search spaces use fixed width of layers which result in computationally heavy models. In contrast, we propose a multi-branch search space where each branch specializes for a typical feature resolution. The same search space can be directly used for various dense prediction tasks that have different preferences on the granularity of features, in which the computation budget is allocated for different resolutions through an end-to-end optimization. + +# 3. Methodology + +Our method aims to search for network structures within a multi-branch search space containing both Convolutions and Transformers with a resource-aware search strategy. In this section, we first introduce our lightweight Transformers. We then detail our multi-branch search space and how to integrate our Transformers into it. Finally, we describe the resource-aware fine-grained search strategy. + +![](images/f2512b172b3e73a7009b6dc1ece715faef339bec0fcde59fa017ee80d5c06dee.jpg) +Figure 2. The architecture of our lightweight Transformer, which contains a projector, an encoder, and a decoder. It can be used plug-and-play to enhance the global context of image features. + +# 3.1. Lightweight Transformers + +The standard Transformer [72, 7] cannot be directly applied to high-resolution images and mobile scenarios, as its computational cost grows quadratically to the number of pixels. Our lightweight Transformer shown in Fig. 2, which consists of a projector, an encoder, and a decoder, is proposed to solve this issue (see Fig. 2). + +**Projection.** To reduce the computational costs, we project the input feature $X \in \mathbb{R}^{c \times h \times w}$ , together with the positional encoding, into a reduced size of $n \times s \times s$ by a projection function $\mathcal{P}(\cdot)$ , where $n$ denotes the number of queries and $s \times s$ is the reduced spatial size. Formally, the projection process can be represented by: + +$$ +X ^ {\prime} = \mathcal {P} (\operatorname {C o n c a t} (X, P)), \tag {1} +$$ + +where Concat denotes the concatenation operator, $P \in \mathbb{R}^{d_p \times h \times w}$ is a positional encoding which compensates for the loss of spatial information during the self-attention process, and $X' \in \mathbb{R}^{n \times s^2}$ is the projected and flattened embedding. The projector $\mathcal{P}$ first uses a point-wise convolution (with a Batch Normalization layer) to reduce the channel dimension of the feature map from $c + d_p$ to a smaller dimension $n$ and then uses a bilinear interpolation operation to resize the spatial dimension of the feature map to $s \times s$ . The positional encoding $P$ in Eq. 1, is simply a normalized 2D positional map: + +$$ +\begin{array}{l} P [ 0, i, j ] = i / h, \quad i \in [ 0, h - 1 ] \\ P [ 1, i, j ] = j / w, \quad j \in [ 0, w - 1 ] \tag {2} \\ \end{array} +$$ + +The 2D positional map $P$ is very efficient as it contains only 2 channels (i.e., $d_p = 2$ ). Later in the experiments, we show that this simple encoding outperforms the sinusoidal positional encoding [72] and the learned embedding [7]. + +Encoder. After the projection, the original feature $X$ is transformed into a set of $n$ tokens $X'$ ; each token is an $s^2$ -dimensional semantic embedding with positional information. $X'$ , is then fed into our encoder as queries, keys, and + +![](images/6867755922f36625cae1eafff06c5269b9ef16cc0647538e2f0220211a0a945b.jpg) +(a) + +![](images/ac6bd39d5de4d19c8814bc591705273863ae2e3332a4e51a40e9f126d3559ed8.jpg) +(b) + +![](images/8b74b26c71645f9abd6e1914345c624c9fb17d3bea8a5a9c60f0a0caf6df35f2.jpg) +(c) +Figure 3. (a) Our multi-branch search space, which is composed of parallel modules and fusion modules alternately. “ $1/4, 1/8, \ldots$ ” denote the down-sampling ratios. (b) Illustration of parallel modules and fusion modules. The red, black, and blue arrows represent the reduction searching blocks, normal searching blocks, and normal searching blocks with upsampling, respectively. The cubes represent feature maps. In this example, the fusion module generates an extra branch from the previous lowest-resolution branch by a reduction searching block. (c) The proposed searching block that contains both convolutions with different kernel sizes $C_1, C_2, C_3$ and a lightweight Transformer $\mathcal{T}$ . + +values $Q, K, V \in \mathbb{R}^{n \times s^2}$ . Following the standard Transformer [72], our lightweight Transformer is built upon the Multi-Head Self-Attention $\mathcal{A}(\cdot)$ , which allows the model to jointly attend to information at different positions. It is defined as: + +$$ +\begin{array}{l} \mathcal {A} _ {e n c} (Q, K, V) = \operatorname {C o n c a t} \left(\operatorname {h e a d} _ {1}, \dots , \operatorname {h e a d} _ {h}\right) W ^ {O} \\ \text {w h e r e} \quad \text {h e a d} _ {i} = \text {A t t e n t i o n} \left(Q W _ {i} ^ {Q}, K W _ {i} ^ {K}, V W _ {i} ^ {V}\right) \\ = \operatorname {s o f t m a x} \left[ \frac {Q W _ {i} ^ {Q} \left(K W _ {i} ^ {K}\right) ^ {T}}{\sqrt {d}} \right] V W _ {i} ^ {V} \tag {3} \\ \end{array} +$$ + +where $h$ is the number of heads, $d$ is the hidden dimensions of the attended subspaces, and $W_{i}^{Q}, W_{i}^{K}, W_{i}^{V} \in \mathbb{R}^{s^2 \times d}, W^{O} \in \mathbb{R}^{hd \times s^2}$ are learned embeddings (weights). A position-wise Feed-Forward Network (FFN) $\mathcal{F}_{enc}(\cdot)$ , which consists of two linear transformations with a ReLU activation in between, is then applied to the attended features: + +$$ +\mathcal {F} _ {e n c} (x) = \max \left(0, x W _ {1} + b _ {1}\right) W _ {2} + b _ {2} \tag {4} +$$ + +where $W_{1} \in \mathbb{R}^{s^{2} \times 4s^{2}}$ , $W_{2} \in \mathbb{R}^{4s^{2} \times s^{2}}$ , $b_{1}$ and $b_{2}$ are the weights and biases of the linear layers respectively. We employ residual connections [32] around both the Multi-Head Self-Attention layer and the Feed-Forward Network, which are followed by layer normalization [1] as in [72]. + +Decoder. Our decoder follows the same paradigm of the encoder: Multi-Head Self-Attention layer and Feed-Forward Networks. It uses the output of the encoder $F$ as keys and values and a set of n learnable $s^2$ -dimensional semantic embeddings $S \in \mathbb{R}^{n \times s^2}$ as queries. The decoder can be formalized as $\mathcal{F}_{dec}(\mathcal{A}_{dec}(S, F, F))$ . Finally, the output of the decoder is transformed back to the proper shape by an inverse projection function $\widehat{\mathcal{P}}(\cdot)$ . Like the projector $P$ , the inverse projector $\widehat{\mathcal{P}}(\cdot)$ consists of a point-wise convolution (with a Batch Normalization layer) and a bilinear interpolation layer. + +tion operation. Note that since image modeling is not a sequence prediction task, and there is no temporal relationship between the semantic tokens, we remove the first Multi-Head Attention in the standard Transformer decoder [72]. + +Time Complexity. The time complexities of our Multi-Head Self-Attention and our FFN are $O(4nds^2 + 2n^2 d)$ and $O(8ns^4)$ , respectively, where $s^2$ , $d$ and $n$ are in the projected low-dimensional space. Since $s^2$ is a projected small spatial size, the overall time complexity (FLOPs) $O_{\mathcal{T}}(n)$ of our Transformer is approximately linear with $n^2 d$ . In the following part, we will further introduce a fine-grained search strategy to reduce the number of tokens $n$ in order to make the lightweight Transformer more efficient. + +In summary, the main difference between our lightweight Transformer and the standard Transformer [72, 7] lies in: (1) A projection function $\mathcal{P}(\cdot)$ is used to learn self-attention in a low-dimensional space. (2) A simpler yet effective 2D positional map $P$ is used for positional encoding. (3) The first Multi-Head Attention and the spatial encoding in the standard Transformer decoder are removed. + +# 3.2. Multi-branch Search Space + +Inspired by HRNet [73], we design a multi-branch search space for dense predictions that contains both multiscale features and global contexts while maintaining high-resolution representations throughout the network. + +Overview. The network consists of two modules: the parallel module and the fusion module. Both of the two modules are constructed with our searching blocks. As shown in Fig. 3 (a), after two convolutions which decrease the feature resolution to $1/4$ of the input image size, we start with this high-resolution branch and gradually add high-to-low resolution branches through fusion modules, and con + +nect the multi-resolution branches in parallel through parallel modules. Finally, multi-branch features are resized and concatenated together, and connected to the final classification/regression layer without any additional heads. + +The parallel module obtains larger receptive fields and multi-scale features by stacking searching blocks in each branch. It has $m \in [1, 4]$ branches containing $nc_{1}, \ldots, nc_{m}$ convolutions with $nw_{1}, \ldots, nw_{m}$ channels in each branch. A fusion module is used after a parallel module to exchange information across multiple branches. An extra lower-resolution branch is also generated from the previously lowest-resolution branch until it reaches 1/32 down-sampling ratios. A fusion module takes $min$ branches from the previous parallel module as input and outputs $m_{out}$ branches. For each output branch, all its neighboring input branches are fused by using the searching block to unify their feature map sizes. For example, a 1/8 output branch integrates information of 1/4, 1/8, and 1/16 input branches. In our fusion module, the high-to-low resolution feature transformation is realized by the reduction searching block, while the low-to-high resolution feature transformation is implemented with the normal searching block and upsampling. + +Searching block. As shown in Fig. 3 (c), our searching block contains two paths: one path is a MixConv [70], the other path is a lightweight Transformer which aims to provide more global contexts. The number of convolutional channels and the number of tokens in the Transformer are searchable parameters. + +Formally, let $X$ be the input of $c$ feature channels (the spatial dimension is omitted for simplicity). In the Mix-Conv path, the first layer is a point-wise convolution $\mathcal{C}_0$ which expands $X$ to a $3r \times c$ dimension (i.e., the expansion ratio is $3r$ ); the output is split into three parts with an equal number of channels (i.e., each with $r \times c$ channels), which are then fed into three depth-wise convolutions $\mathcal{C}_1, \mathcal{C}_2, \mathcal{C}_3$ with kernel sizes of $3 \times 3, 5 \times 5$ , and $7 \times 7$ , respectively. The outputs of these three layers are concatenated, followed by another point-wise convolution $\mathcal{C}_4$ that produces the feature map with the desired number of channels $c'$ . In the Transformer path, a lightweight Transformer $\mathcal{T}$ with $n$ tokens is applied to the input feature $X$ to obtain the global self-attention. The outputs of two branches are added as the final output of the searching block. Intuitively, the Transformer path can be regarded as a residual path for enhancing the global context within the searching block. The information flow in a searching block can be written as: + +$$ +X ^ {\prime} = \mathcal {C} _ {4} (\operatorname {C o n c a t} \left(\mathcal {C} _ {1} \left(\mathcal {C} _ {0} (X) _ {1}\right), \mathcal {C} _ {2} \left(\mathcal {C} _ {0} (X) _ {2}\right), \mathcal {C} _ {3} \left(\mathcal {C} _ {0} (X) _ {3}\right)\right)) + \mathcal {T} (X) \tag {5} +$$ + +where $\mathcal{C}_0(X)_i$ represents the $i$ -th part of the output of $\mathcal{C}_0(X)$ , as shown in Fig. 3 (c). Note that when the strides of the convolutions $\mathcal{C}_1, \mathcal{C}_2, \mathcal{C}_3$ are equal to 2, as in the reduction searching block, the inverse projection $\widehat{\mathcal{P}}(\cdot)$ in Transformer + +resizes its input into half size of the original spatial dimension in order to match the output shape of $\mathcal{C}_4$ . + +# 3.3. Resource-aware Fine-grained Search + +Our supernet is a multi-branch network where each branch is a chain of searching blocks operating at different resolutions; each searching block combines a MixConv and a Transformer. Unlike previous searching methods that are designed for specific tasks, we aim to customize the network for various tasks. Specifically, we propose a resource-aware channel/query-wise fine-grained search strategy to explore the optimal feature combination for different tasks. + +We adopt a progressive shrinking NAS paradigm which generates lightweight models by discarding some of the convolutional channels and Transformer queries during training. As described in [53], as channels in depth-wise convolutions are independent in our searching block, any channels from these convolutions can be easily removed without affecting the other searching blocks; we only need to remove the corresponding weights from the convolutions. Similarly, if a token of the Transformer is discarded, we just remove the corresponding weights from the $1 \times 1$ convolutions of the projections $\mathcal{P}(\cdot)$ and $\widehat{\mathcal{P}}(\cdot)$ , and the corresponding embedding from queries $S$ . + +In the rest of this paper, we call a channel of the depthwise convolutions or a token in Transformers a search unit. A searching block with $c$ input channels, the expansion ratio of $3r$ , and $n$ tokens has $3rc + n$ search units in total. + +Following Darts [47], we introduce an importance factor $\alpha > 0$ that can be learned jointly with the network weights for each search unit of the searching block. We then progressively discard those with low importance while maintaining overall performance. Inspired by works on channel pruning [85, 49, 53], we add a resource-aware L1 penalty on $\alpha$ , which effectively pushes importance factors of high computational costs to zero. Specifically, the L1 penalty of a search unit is weighted by the amount of the reduction in computational cost $\Delta > 0$ (i.e. FLOPs in this case): + +$$ +\Delta_ {i} = \left\{ \begin{array}{l l} 3 \times 3 \times h \times w, & i \in [ 0, r c) \\ 5 \times 5 \times h \times w, & i \in [ r c, 2 r c) \\ 7 \times 7 \times h \times w, & i \in [ 2 r c, 3 r c) \\ O _ {\mathcal {T}} \left(n ^ {\prime}\right) - O _ {\mathcal {T}} \left(n ^ {\prime} - 1\right), & i \in [ 3 r c, 3 r c + n) \end{array} \right. \tag {6} +$$ + +where $O_{\mathcal{T}}$ is the FLOPs of the Transformer defined in Sec. 3.1, $i$ is the index of the search unit, $n'$ is the number of remaining tokens. Note that $\Delta$ 's for search units of convolutions are fixed, while in the Transformer, $\Delta$ 's is a function of the number of remaining tokens. It is worth mentioning that, although FLOPs is not always a good measure of latency, we use it anyway as it is the most widely and easily used metric. The Eq. 7 can be easily adapted to use other metrics, e.g., latency and energy cost. + +With the added resource-aware penalty term, the overall training loss is: + +$$ +L = L _ {\text {t a s k}} + \lambda \sum_ {i \in [ 0, r c + n)} \Delta_ {i} | \alpha_ {i} | \tag {7} +$$ + +where $L_{\mathrm{task}}$ denotes the standard classification/regression loss, and $\lambda$ denotes the coefficient of the L1 penalty term. + +During training, after every few epochs, we progressively remove the search units whose importance factors are below a predefined threshold $\epsilon$ and re-calibrate the running statistics of Batch Normalization (BN) layers. Note that if all tokens of a Transformer are removed, the Transformer will degenerate into a residual path, as shown in Fig. 2. + +When the search ends, the remaining structure not only represents the best accuracy-efficiency trade-offs, but also has the optimal low-level/high-level and local/global feature combination for a specific task. In addition, since the network training and architecture search are conducted in a unified end-to-end manner, the resulting network can be used directly without fine-tuning. + +# 4. Experiments + +# 4.1. Implementation Details + +To validate the generalizability of our method, we select five benchmark datasets on four representative tasks for performance evaluation: image classification on ImageNet [20], human pose estimation on COCO keypoint [45], semantic segmentation on Cityscapes [16] and ADE20K [91], and 3D object detection on KITTI [27]. These benchmarks are carefully selected as they require different receptive fields, global/local contexts, and 2D/3D perceptions. In this work, the same supernet is used for all five benchmarks; It begins with two $3 \times 3$ convolutions with stride 2, which is followed by five parallel modules (respectively with 1, 2, 3, 4, 4 branches); a fusion module is inserted between every two adjacent parallel modules, to obtain multi-scale features. For Transformers, we set $s = 8$ , $d = s^2 = 64$ , and $h = 1$ . In some evaluation experiments without search, we fix $d = 8$ . The expansion ratio $r$ of the searching block is set to be 4. For the MixConv, we use the scales from the batch normalization layers after the depth-wise convolutions as the importance factors; for the Transformer, we use the scales from the batch normalization layer in the projector $\mathcal{P}$ as the importance factors. On each benchmark, we obtain HR-NAS-A and HR-NAS-B using different $\lambda$ values. Search units with $\alpha < 0.001$ are deemed unimportant and removed every five epochs. Unless specified, all experiments in this paper use standard training protocols, e.g., we don't apply techniques like AutoAug [17], Mixup [86], and Cutout [22]. All our models are trained from scratch without pretraining on the ImageNet dataset, and are evaluated with single-scale input and without multicrop. Details of the datasets and the training settings for each task can be found in Supplemental Materials. + +Table 1. Comparison with state-of-the-arts on ImageNet under the mobile setting. † denotes methods using Swish activation [59], ‡ denotes methods trained on AutoAugment [17] or RandAugment [18]. FLOPs is measured using an input size of $224 \times 224$ . + +
ModelParamsFLOPsTop-1(%)
CondenseNet [36]2.9M274M71.0
ShuffleNetV1 [89]3.4M292M71.5
ShuffleNetV2 [52]3.5M299M72.6
MobileNetV2 [62]3.4M300M72.0
MobileNetV3 [33]†5.4M219M75.2
EfficientNet-B0 [69]†‡5.3M390M77.3
FBNet-B [76]4.5M295M74.1
AutoSlim-MobileNetV2 [83]5.7M305M74.2
Proxyless [6]4.1M320M74.6
DA-NAS [19]-323M74.3
AtomNAS-A [53]3.9M258M74.6
SinglePathOneShot [31]3.4M328M74.7
FairNAS-C [15]4.4M321M74.7
MnasNet-A1 [68]3.9M312M75.2
TF-NAS-C [35]-284M75.2
SCARLET-B [14]6.5M329M76.3
ST-NAS-A [30]5.2M326M76.4
HR-NAS-A5.5M267M75.7
HR-NAS-B6.4M325M76.5
MixNet-S [70]†4.1M256M75.8
AtomNAS-A+ [53]†4.7M260M76.3
Once-for-all [5]†4.4M230M76.0
Once-for-all (finetuned) [5]†4.4M230M76.9
BigNAS [84]†‡4.5M242M76.5
FairNAS-C+ [15]†5.6M325M76.7
HR-NAS-A †‡5.5M267M76.6
HR-NAS-B †‡6.4M325M77.3
+ +# 4.2. Comparative Results + +We conduct experiments against the state-of-the-art methods on five benchmarks: image classification on ImageNet (Tab. 1), semantic segmentation on Cityscapes (Tab. 2), semantic segmentation on ADE20K (Tab. 3), human pose estimation on COCO keypoint (Tab. 4), and 3d object detection on KITTI (Tab. 5). From these tables we can see that: (1) Our method achieves state-of-the-art performance on all three dense prediction tasks and competitive results on the classification task. Compared with other tasks, classification usually benefits less from multi-scale and global contexts because it aggregates position-invariant features through global pooling. (2) Many existing methods, such as [84, 44, 41] utilize additional modules or pretraining on the ImageNet dataset to get better performance for a specific task. In contrast, our method is able to show superior results across multiple challenging datasets without any bells and whistles. (3) We evaluate the mean and standard deviation of 5 runs on Cityscapes [16] with Random Search [42] as a baseline. It shows that our method yields stable results with a standard deviation of about only 0.3. (4) For NAS methods toward high segmentation accuracy [46, 25] rather than accuracy-efficiency trade-offs, + +Table 2. Comparative results on the CityScapes validation set (mIoU, $\%$ ). * indicates the model is pre-trained on the ImageNet dataset. FLOPs is measured using an input size of $512\times 1024$ . † denotes the model is reduced by us for acc-efficiency trade-offs. + +
ModelParamsFLOPsmIoU(%)
SegNet [2]29.47M649G57.00
Enet [57]0.37M8.69G58.30
BiSeNet [82]5.8M6.58G69.00
MobileNetV2 [62]2.11M5.33G70.71
MobileNetV3-Large [33]1.51M2.48G72.36
HRNet-W18-Small [73]3.94M19.30G75.44
C3 [56]0.20M6.45G61.96
SkipNet-MobileNet [65]*-13.80G62.40
EDANet [50]0.68M7.98G65.11
SwiftNet [55]11.80M26G70.20
DFANet [41]*7.8M1.7G70.30
ShuffleNetV2+DPC [71]3.00M6.92G71.30
Auto-DeepLab [46]-Tiny†3.16M27.29G71.21
GAS [44]*1.50M-71.80
SqueezeNAS-Large [63]0.73M8.35G72.40
SpineNet-49 [25]-Tiny†5.49M37.99G74.18
Random Search [42]6.11±2.25M7.09±1.88G70.20±3.01
HR-NAS-A2.20±0.14M1.91±0.11G74.26±0.37
HR-NAS-B3.85±0.19M4.66±0.17G75.90±0.30
+ +Table 3. Comparative results on the ADE20K validation set (mIoU,%). FLOPs is measured using an input size of $512 \times 512$ . + +
ModelParamsFLOPsmIoU(%)
MobileNetV2[62]2.20M2.76G32.04
MobileNetV3-Large[33]1.60M1.32G32.31
HRNet-W18-Small [73]3.97M10.23G33.41
HR-NAS-A2.49M1.42G33.22
HR-NAS-B3.86M2.19G34.92
+ +we reduce their network width to 1/2 (and depth to 1/2 for [46]), thus obtain the tiny variants. Our method outperforms the second-best competitor by a large margin on Cityscapes (74.18 vs. 76.01), ADE20K (33.41 vs. 34.92), and COCO keypoint (74.9 vs. 75.5) using a much lighter model, showing its superiority and accuracy-efficiency balance ability on dense prediction tasks. + +# 4.3. Ablation Study + +Search Space. In this part, we study the design components of our search space. In Tab. 6 we show how the introduction of different components affects the performance and FLOPs, using the Cityscapes segmentation benchmark as an example. The baseline search space, "Single-branch" in Tab. 6, is a single-branch network with only $3 \times 3$ convolutions, where the up-sampling operations are applied at the end for dense prediction tasks. Adding the multi-branch architecture increases the mIoU from $66.23\%$ to $68.65\%$ with fewer parameters and FLOPs, showing the effectiveness of our multi-branch design. The MixConv with a mix of $3 \times 3, 5 \times 5, 7 \times 7$ convolutions in the searching block further improves the mIoU by $3.34\%$ . Finally, the lightweight Transformer provides another gain of $2.56\%$ (71.99% v.s. $74.55\%$ ) with only extra 70M FLOPs. + +Table 4. Comparisons on COCO keypoint validation set. * indicates the model is pre-trained on the ImageNet dataset. Params and FLOPs are calculated for the pose estimation network, and those for human detection and keypoint grouping are not included. + +
MethodInput sizeParamsFLOPsAPAP^MAP^LAR
ShuffleNetV1 [89]*256 × 1921.0M0.16G58.555.264.665.1
ShuffleNetV2 [52]*256 × 1921.3M0.17G59.856.566.266.4
MobileNetV2 [62]*256 × 1922.3M0.33G64.661.071.170.7
NAS-CSS [54]256 × 1922.9M1.48G65.963.170.069.3
DA-NAS [19]256 × 19210.9M2.18G68.465.574.475.7
CPN [11]256 × 19227.0M6.20G69.4---
SimpleBaseline-50 [78]*256 × 19234.0M8.90G70.467.177.276.3
HRNet-W32 [73]256 × 19228.5M7.10G73.470.280.178.9
AutoPose [29]256 × 192-10.65G73.669.879.778.1
HR-NAS-A256 × 1921.7M0.25G67.765.471.170.8
HR-NAS-B256 × 1926.1M1.35G73.770.280.679.3
ShuffleNetV1 [89]*384 × 2881.0M0.35G62.257.869.568.4
ShuffleNetV2 [52]*384 × 2881.3M0.37G63.659.570.769.7
MobileNetV2 [62]*384 × 2882.3M0.74G67.362.874.772.8
SimpleBaseline-50 [78]*384 × 28834.0M20.02G72.268.179.777.6
PoseNFS-3 [81]384 × 28815.8M14.8G73.0---
HRNet-W32 [73]384 × 28828.5M16.0G74.971.580.879.3
HR-NAS-A384 × 2881.1M0.35G65.762.572.171.4
HR-NAS-B384 × 2886.6M3.72G75.572.681.779.4
+ +Table 5. Vehicle 3D detection results $(\mathrm{AP},\%)$ on the KITTI split1 validation set. All methods are implemented based on the Point-pillar [40] framework. FLOPs is calculated for 2D RPN network using an input size of $496\times 432$ + +
MethodParamsFLOPsModerateEasyHard
ShuffleNetV2 [52]1.69M2.26G66.7380.7461.84
MobileNetV2 [62]2.49M6.47G67.6582.5264.22
Pointpillar [40]4.80M61.75G77.1286.6172.71
HR-NAS-A2.13M3.22G69.7483.0964.89
HR-NAS-B4.74M15.65G78.4987.6275.53
+ +Table 6. Ablation study of our search space on the CityScapes semantic segmentation validation set. + +
MethodParamsFLOPsmIoU(%)mACC(%)aACC(%)
Single-branch1.59M1.81G66.2375.5794.43
Multi-branch0.82M1.64G68.6578.2694.80
+MixConv1.12M1.86G71.9980.3395.40
+Transformer2.23M1.93G74.5582.9895.54
+ +Lightweight Transformer. In Tab. 7, we study the choice of positional embeddings. It can be seen that using the proposed 2D positional map in the encoder of the Transformer achieves better performance than using the sinusoidal position encoding [72] and the learned position embedding [21]. This may be because our lightweight Transformer has fewer queries and smaller token dimensions than the other two, and therefore it is unnecessary to use high dimension representation for position information. We also evaluate the alternative which uses the 2D positional map at both the encoder and the decoder; the performance is slightly worse than the encoder-only option. + +The proposed Transformer can be used as a plug-and-play component. To show this, we add our Transformer to the Inverted Residual Blocks of two efficient models ShuffleNetV2 [52] and MobileNetV2 [62], and evalu + +![](images/70bd1b83a6beb6339bb012da037684462cb570c59a51c532f290642cb338ee50.jpg) + +![](images/2f0463e4ec50db1361e23f3fecce1d9526aa0e086072a91a62988d653eb255a9.jpg) +(a) Image classification on ImageNet +(c) Human pose estimation on COCO keypoint +Figure 4. Visualization of the searched smaller architectures (i.e. HR-NAS-A) on four different tasks. The area of cyan, red, yellow, green, and gray sectors indicate the number of $3 \times 3$ , $5 \times 5$ , $7 \times 7$ convolutional channels, the number of transformer queries, and the number of removed channels/queries, respectively. Note that if all queries and convolutional channels of a searching block are removed, the searching block will degenerate into a residual path. For simplicity, we only visualize searching blocks in the parallel module. We can see that our method is able to find different architectures for different tasks, showing that it can automatically adapt to various tasks. + +![](images/45e479367e7e983eadacda79a604b4d4ed017fa2ecd3207702dd3618b21635f2.jpg) + +![](images/753ac008391591d4256ece6a29dcd2539726913eaa75c53a32ebf5fc50865c0f.jpg) +(b) Semantic segmentation on Cityscapes +(d) 3D object detection on KITTI + +Table 7. Comparisons $(\%)$ of different positional embedding of Transformer with $n = 8$ and $s = 8$ on Cityscapes validation set. 'Enc' and 'Dec' denote the positional embedding are employed in the encoder and decoder of the Transformer, respectively. FLOPs is measured using an input size of $512\times 1024$ . + +
Input sizeParamsFLOPsmIoUmACCaACC
Baseline1.120M1.863G71.9980.3395.40
Sinusoidal position encoding2.346M2.131G71.9180.3895.08
Learned position embedding2.930M2.236G72.7180.8895.33
2D positional map (Enc only)2.273M1.872G74.2282.3695.52
2D positional map (Enc + Dec)2.278M1.873G73.7081.8995.47
+ +ate their performance on both ImageNet classification and Cityscapes segmentation tasks. PSP module [90] is added as segmentation head to all models. As shown in Tab. 8, our Transformer improves the two baseline models on both classification and segmentation tasks. + +# 4.4. Visualization of Searched Networks + +We visualized the four smaller models we found on each of the four benchmarks (i.e. HR-NAS-A) in Fig. 4. We can observe that our method can find different architectures for different tasks, showing that it can automatically adapt to various tasks: (1) In the image classification task and the 3D detection task, at the high-resolution branches (i.e. first and second branches), the models we found remove most of the search units; some searching blocks are even completely removed, as indicated by circles with complete gray in Fig. 4). The reason is that in these two tasks, global semantic information is more important than local information. (2) The model for the segmentation task still retains computation from the first two branches, as it is important to keep high resolution imagery for semantic segmentation tasks. (3) The human pose estimation model mainly utilizes the second and the third branches, which means it may + +Table 8. Single-crop top-1 error rates $(\%)$ on the ImageNet, and the mIoU $(\%)$ on the cityscapes dataset. All models are trained from scratch. FLOPs is measured using classification models. + +
MethodParamsFLOPstop-1mIoU
ShuffleNetV2 [52]2.279M0.150G69.566.02
ShuffleNetV2 [52] + transformer2.758M0.157G70.167.31
MobileNetV2 [62]3.505M0.319G72.068.98
MobileNetV2 [62] + transformer3.770M0.321G72.870.17
+ +rely more on middle-resolution semantics instead of high-resolution semantics. (4) Transformers are more used in the segmentation and the human keypoint estimation tasks, indicating these dense prediction tasks benefit more from global contexts. + +# 5. Conclusion + +In this paper, we introduce a lightweight and plug-and-play Transformer that can be easily combined with convolutional networks to enrich global contexts for dense image prediction tasks. We then effectively encode both the proposed Transformers and convolutions into a well-designed high-resolution search space to model both global and multiscale contextual information. A channel/query-level fine-grained progressive shrinking strategy is applied to the search space for searching and customizing efficient models for various tasks. Our searched models achieve state-of-the-art trade-offs between performance and FLOPs for three dense prediction tasks and an image classification task, given only small computational budgets. + +Acknowledgements Ping Luo was supported by the General Research Fund of HK No.27208720. Zhiwu Lu was supported by National Natural Science Foundation of China (61976220 and 61832017), and Beijing Outstanding Young Scientist Program (BJJWZYJH012019100020098). + +# References + +[1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 4 +[2] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE TPAMI, 39(12):2481-2495, 2017. 7 +[3] Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In ICML, pages 550-559, 2018. 3 +[4] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. 2 +[5] Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, and Song Han. Once-for-all: Train one network and specialize it for efficient deployment. In ICLR, 2020. 1, 3, 6 +[6] Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. In ICLR, 2019. 1, 3, 6 +[7] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 2, 3, 4 +[8] Liang-Chieh Chen, Maxwell Collins, Yukun Zhu, George Papandreou, Barret Zoph, Florian Schroff, Hartwig Adam, and Jon Shlens. Searching for efficient multi-scale architectures for dense image prediction. In NeurIPS, pages 8699-8710, 2018. 1, 3 +[9] 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 TPAMI, 40(4):834-848, 2017. 2 +[10] Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In ICML, 2020. 2 +[11] Yilun Chen, Zhicheng Wang, Yuxiang Peng, Zhiqiang Zhang, Gang Yu, and Jian Sun. Cascaded pyramid network for multi-person pose estimation. In CVPR, pages 7103-7112, 2018. 7 +[12] Yukang Chen, Tong Yang, Xiangyu Zhang, Gaofeng Meng, Chunhong Pan, and Jian Sun. Detnas: Neural architecture search on object detection. arXiv preprint arXiv:1903.10979, 1(2):4-1, 2019. 3 +[13] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. 2 +[14] Xiangxiang Chu, Bo Zhang, Jixiang Li, Qingyuan Li, and Ruijun Xu. Scarletnas: Bridging the gap between scalability and fairness in neural architecture search. arXiv preprint arXiv:1908.06022, 2019. 6 +[15] Xiangxiang Chu, Bo Zhang, Ruijun Xu, and Jixiang Li. Fairnas: Rethinking evaluation fairness of weight sharing neural + +architecture search. arXiv preprint arXiv:1907.01845, 2019. 6 +[16] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, pages 3213-3223, 2016. 6 +[17] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018. 6 +[18] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In CVPRW, pages 702-703, 2020. 6 +[19] Xiyang Dai, Dongdong Chen, Mengchen Liu, Yinpeng Chen, and Lu Yuan. Da-nas: Data adapted pruning for efficient neural architecture search. arXiv preprint arXiv:2003.12563, 2020. 1, 3, 6, 7 +[20] 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. IEEE, 2009. 6 +[21] 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. 2, 7 +[22] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 6 +[23] Mingyu Ding, Yuqi Huo, Haoyu Lu, Linjie Yang, Zhe Wang, Zhiwu Lu, Jingdong Wang, and Ping Luo. Learning versatile neural architectures by propagating network codes. arXiv preprint arXiv:2103.13253, 2021. 1, 2 +[24] 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. 2 +[25] Xianzhi Du, Tsung-Yi Lin, Pengchong Jin, Golnaz Ghiasi, Mingxing Tan, Yin Cui, Quoc V Le, and Xiaodan Song. Spinenet: Learning scale-permuted backbone for recognition and localization. In CVPR, pages 11592-11601, 2020. 3, 6, 7 +[26] Jiemin Fang, Yuzhu Sun, Qian Zhang, Yuan Li, Wenyu Liu, and Xinggang Wang. Densely connected search space for more flexible neural architecture search. In CVPR, pages 10628-10637, 2020. 1 +[27] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In CVPR, pages 3354-3361, 2012. 6 +[28] Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Nas-fpn: Learning scalable feature pyramid architecture for object detection. In CVPR, pages 7036-7045, 2019. 3 +[29] Xinyu Gong, Wuyang Chen, Yifan Jiang, Ye Yuan, Xianming Liu, Qian Zhang, Yuan Li, and Zhangyang Wang. Autopose: Searching multi-scale branch aggregation for pose estimation. arXiv preprint arXiv:2008.07018, 2020. 3, 7 + +[30] Ronghao Guo, Chen Lin, Chuming Li, Keyu Tian, Ming Sun, Lu Sheng, and Junjie Yan. Powering one-shot topological nas with stabilized share-parameter proxy. In ECCV, 2020. 6 +[31] Zichao Guo, Xiangyu Zhang, Haoyuan Mu, Wen Heng, Zechun Liu, Yichen Wei, and Jian Sun. Single path one-shot neural architecture search with uniform sampling. In ECCV, 2020. 3, 6 +[32] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 4 +[33] 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 ICCV, pages 1314-1324, 2019. 3, 6, 7 +[34] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, pages 7132-7141, 2018. 2 +[35] Yibo Hu, Xiang Wu, and Ran He. Tf-nas: Rethinking three search freedoms of latency-constrained differentiable neural architecture search. In ECCV, 2020. 6 +[36] Gao Huang, Shichen Liu, Laurens Van der Maaten, and Kilian Q Weinberger. Condensenet: An efficient densenet using learned group convolutions. In CVPR, pages 2752-2761, 2018. 6 +[37] Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351, 2019. 2 +[38] Xiaojie Jin, Jiang Wang, Joshua Slocum, Ming-Hsuan Yang, Shengyang Dai, Shuicheng Yan, and Jiashi Feng. Rc-darts: Resource constrained differentiable architecture search. arXiv preprint arXiv:1912.12814, 2019. 3 +[39] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In CVPR, pages 9799-9808, 2020. 2 +[40] Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. In CVPR, pages 12697-12705, 2019. 7 +[41] Hanchao Li, Pengfei Xiong, Haoqiang Fan, and Jian Sun. Dfanet: Deep feature aggregation for real-time semantic segmentation. In CVPR, pages 9522-9531, 2019. 2, 6, 7 +[42] Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In Uncertainty in Artificial Intelligence, pages 367-377. PMLR, 2020. 6, 7 +[43] 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. 1 +[44] Peiwen Lin, Peng Sun, Guangliang Cheng, Sirui Xie, Xi Li, and Jianping Shi. Graph-guided architecture search for real-time semantic segmentation. In CVPR, pages 4203-4212, 2020. 1, 3, 6, 7 +[45] 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. Springer, 2014. 6 + +[46] Chenxi Liu, Liang-Chieh Chen, Florian Schroff, Hartwig Adam, Wei Hua, Alan L Yuille, and Li Fei-Fei. Autodeplab: Hierarchical neural architecture search for semantic image segmentation. In CVPR, pages 82–92, 2019. 1, 2, 3, 6, 7 +[47] Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: differentiable architecture search. In ICLR, 2019. 1, 3, 5 +[48] Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Haotang Deng, and Qi Ju. Fastbert: a self-distilling bert with adaptive inference time. arXiv preprint arXiv:2004.02178, 2020. 2 +[49] Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In ICCV, pages 2736-2744, 2017. 5 +[50] Shao-Yuan Lo, Hsueh-Ming Hang, Sheng-Wei Chan, and Jing-Jhih Lin. Efficient dense modules of asymmetric convolution for real-time semantic segmentation. In Proceedings of the ACM Multimedia Asia, pages 1–6, 2019. 7 +[51] Zhichao Lu, Ian Whalen, Vishnu Boddeti, Yashesh Dhebar, Kalyanmoy Deb, Erik Goodman, and Wolfgang Banzhaf. Nsga-net: A multi-objective genetic algorithm for neural architecture search. arXiv preprint arXiv:1810.03522, 2018. 3 +[52] Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In ECCV, pages 116-131, 2018. 6, 7, 8 +[53] Jieru Mei, Yingwei Li, Xiaochen Lian, Xiaojie Jin, Linjie Yang, Alan Yuille, and Jianchao Yang. Atomnas: Fine-grained end-to-end neural architecture search. In ICLR, 2020. 1, 3, 5, 6 +[54] Vladimir Nekrasov, Hao Chen, Chunhua Shen, and Ian Reid. Fast neural architecture search of compact semantic segmentation models via auxiliary cells. In CVPR, pages 9126-9135, 2019. 1, 3, 7 +[55] Marin Orsic, Ivan Kreso, Petra Bevandic, and Sinisa Segvic. In defense of pre-trained imagenet architectures for real-time semantic segmentation of road-driving images. In CVPR, pages 12607-12616, 2019. 7 +[56] Hyojin Park, Youngjoon Yoo, Geonseok Seo, Dongyoon Han, Sangdoo Yun, and Nojun Kwak. C3: Concentrated-comprehensive convolution and its application to semantic segmentation. arXiv preprint arXiv:1812.04920, 2018. 7 +[57] Adam Paszke, Abhishek Chaurasia, Sanggil Kim, and Eugenio Culurciello. Enet: A deep neural network architecture for real-time semantic segmentation. arXiv preprint arXiv:1606.02147, 2016. 7 +[58] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training, 2018. 2 +[59] Prajit Ramachandran, Barret Zoph, and Quoc V Le. Searching for activation functions. arXiv preprint arXiv:1710.05941, 2017. 6 +[60] Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc Le, and Alex Kurakin. Large-scale evolution of image classifiers. arXiv preprint arXiv:1703.01041, 2017. 3 + +[61] Xingkai Ren, Ronghua Shi, and Fangfang Li. Distill bert to traditional models in chinese machine reading comprehension. In AAAI, pages 13901-13902, 2020. 2 +[62] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *CVPR*, pages 4510–4520, 2018. 3, 6, 7, 8 +[63] Albert Shaw, Daniel Hunter, Forrest Landola, and Sammy Sidhu. Squeezenas: Fast neural architecture search for faster semantic segmentation. In ICCVW, 2019. 1, 3, 7 +[64] Albert Shaw, Wei Wei, Weiyang Liu, Le Song, and Bo Dai. Meta architecture search. In NeurIPS, pages 11227-11237, 2019. 1 +[65] Mennatullah Siam, Mostafa Gamal, Moemen Abdel-Razek, Senthil Yogamani, and Martin Jagersand. Rtseg: Real-time semantic segmentation comparative study. In ICIP, pages 1603-1607. IEEE, 2018. 7 +[66] David R So, Chen Liang, and Quoc V Le. The evolved transformer. arXiv preprint arXiv:1901.11117, 2019. 2 +[67] Dimitrios Stamoulis, Ruizhou Ding, Di Wang, Dimitrios Lymberopoulos, Bodhi Priyantha, Jie Liu, and Diana Marculescu. Single-path nas: Designing hardware-efficient convnets in less than 4 hours. In ECML-PKDD, pages 481-497. Springer, 2019. 3 +[68] Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V Le. Mnasnet: Platform-aware neural architecture search for mobile. In CVPR, pages 2820-2828, 2019. 3, 6 +[69] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In ICML, pages 6105-6114, 2019. 6 +[70] Mingxing Tan and Quoc V Le. Mixconv: Mixed depthwise convolutional kernels. arXiv preprint arXiv:1907.09595, 2019. 3, 5, 6 +[71] Sercan Türkmen and Janne Heikkilä. An efficient solution for semantic segmentation: Shufflenet v2 with atrous separable convolutions. In Scandinavian Conference on Image Analysis, pages 41-53. Springer, 2019. 7 +[72] 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, pages 5998-6008, 2017. 2, 3, 4, 7 +[73] 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 TPAMI, 2020. 1, 2, 4, 7 +[74] Sinong Wang, Belinda Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020. 2 +[75] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, pages 7794-7803, 2018. 2 +[76] 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 CVPR, pages 10734-10742, 2019. 1, 6 + +[77] Bichen Wu, Chenfeng Xu, Xiaoliang Dai, Alvin Wan, Peizhao Zhang, Masayoshi Tomizuka, Kurt Keutzer, and Peter Vajda. Visual transformers: Token-based image representation and processing for computer vision. arXiv preprint arXiv:2006.03677, 2020. 2 +[78] Bin Xiao, Haiping Wu, and Yichen Wei. Simple baselines for human pose estimation and tracking. In ECCV, pages 466-481, 2018. 7 +[79] Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. Snas: stochastic neural architecture search. arXiv preprint arXiv:1812.09926, 2018. 1 +[80] Yuhui Xu, Lingxi Xie, Xiaopeng Zhang, Xin Chen, Guo-Jun Qi, Qi Tian, and Hongkai Xiong. Pc-darts: Partial channel connections for memory-efficient differentiable architecture search. arXiv preprint arXiv:1907.05737, 2019. 3 +[81] Sen Yang, Wankou Yang, and Zhen Cui. Pose neural fabrics search. arXiv preprint arXiv:1909.07068, 2019. 7 +[82] Changqian Yu, Jingbo Wang, Chao Peng, Changxin Gao, Gang Yu, and Nong Sang. Bisenet: Bilateral segmentation network for real-time semantic segmentation. In ECCV, pages 325-341, 2018. 7 +[83] Jiahui Yu and Thomas Huang. Autoslim: Towards one-shot architecture search for channel numbers. arXiv preprint arXiv:1903.11728, 2019. 6 +[84] 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 ECCV, 2020. 3, 6 +[85] Jiahui Yu, Linjie Yang, Ning Xu, Jianchao Yang, and Thomas Huang. Slimmable neural networks. arXiv preprint arXiv:1812.08928, 2018. 5 +[86] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 6 +[87] Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, and Amit Agrawal. Context encoding for semantic segmentation. In CVPR, pages 7151-7160, 2018. 1 +[88] Xiong Zhang, Hongmin Xu, Hong Mo, Jianchao Tan, Cheng Yang, and Wenqi Ren. Dcnas: Densely connected neural architecture search for semantic image segmentation. arXiv preprint arXiv:2003.11883, 2020. 2, 3 +[89] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR, pages 6848-6856, 2018. 6, 7 +[90] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, pages 2881-2890, 2017. 8 +[91] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In CVPR, pages 633-641, 2017. 6 +[92] Yanqi Zhou, Peng Wang, Sercan Arik, Haonan Yu, Syed Zawad, Feng Yan, and Greg Diamos. Epnas: Efficient progressive neural architecture search. BMVC, 2019. 1 +[93] Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In ICLR, 2017. 2 \ No newline at end of file diff --git a/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/images.zip b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a6925039d64bc541c40bc92bc73eb68b0edc0c85 --- /dev/null +++ b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:423f5fd88ac8f8b9426132169aa98e0a0dcb17d1d2d0a72dbd4312af18aec3ef +size 644811 diff --git a/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/layout.json b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c5d27fe9d465477dce601cfabe5e395002fec5bb --- /dev/null +++ b/hrnassearchingefficienthighresolutionneuralarchitectureswithlightweighttransformers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84abc6c5f64275fc8a3f7264b38693666e160e65e02935541f914dd15a0e891e +size 498546 diff --git a/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_content_list.json b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a1f48e60d20381ce01a08ea75a9f7574f163e1dc --- /dev/null +++ b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d95519bb5bd85e3dd8216f7cfba30904e1efd93cf94174072118a6ee2c96c67c +size 75964 diff --git a/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_model.json b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_model.json new file mode 100644 index 0000000000000000000000000000000000000000..25905a0688a9a0671000125c638d77c2d030030f --- /dev/null +++ b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:959887e2736e7dbddaf790c5657c668165def9c7771ac0551b92956d125f2283 +size 91759 diff --git a/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_origin.pdf b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1dd82b5d6f9f13c67ce397c9ff9b7c7044164137 --- /dev/null +++ b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/8a2d62fb-2ffc-4ba5-94c3-d9c0f21ec100_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:266134653f740daa4548d62b5b2b31f95555d328dcc2fda9bdb78de90ac68bb8 +size 3563484 diff --git a/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/full.md b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..caa83cc319930e44f1a3475affcb574d6da161e4 --- /dev/null +++ b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/full.md @@ -0,0 +1,273 @@ +# HVPR: Hybrid Voxel-Point Representation for Single-stage 3D Object Detection + +Jongyoun Noh + +Sanghoon Lee + +Bumsub Ham* + +School of Electrical and Electronic Engineering, Yonsei University + +# Abstract + +We address the problem of 3D object detection, that is, estimating 3D object bounding boxes from point clouds. 3D object detection methods exploit either voxel-based or point-based features to represent 3D objects in a scene. Voxel-based features are efficient to extract, while they fail to preserve fine-grained 3D structures of objects. Point-based features, on the other hand, represent the 3D structures more accurately, but extracting these features is computationally expensive. We introduce in this paper a novel single-stage 3D detection method having the merit of both voxel-based and point-based features. To this end, we propose a new convolutional neural network (CNN) architecture, dubbed HVPR, that integrates both features into a single 3D representation effectively and efficiently. Specifically, we augment the point-based features with a memory module to reduce the computational cost. We then aggregate the features in the memory, semantically similar to each voxel-based one, to obtain a hybrid 3D representation in a form of a pseudo image, allowing to localize 3D objects in a single stage efficiently. We also propose an Attentive Multi-scale Feature Module (AMFM) that extracts scale-aware features considering the sparse and irregular patterns of point clouds. Experimental results on the KITTI dataset demonstrate the effectiveness and efficiency of our approach, achieving a better compromise in terms of speed and accuracy. + +# 1. Introduction + +3D object detection is an essential technique for scene understanding, which aims at predicting 3D bounding boxes of objects in a scene. It can also be exploited as a basic building block for many applications, including autonomous driving and robotics. Recent approaches to 3D object detection focus on learning discriminative 3D representations using point clouds acquired from a LiDAR sensor. Point clouds provide accurate depth information of objects, but they are sparse with the densities largely varying + +![](images/e34d47efba39b312a19086589b3c22f3df91d6eb4864ce81a629054fa919f5a6.jpg) +Figure 1: Runtime and accuracy comparison of detection results on the KITTI [10] test set. We compare our model with voxel-based methods on the car class for three difficulty levels. Voxel-based methods using pseudo image representations (Voxel-PI) are shown as circles, and 3D voxel-based methods (Voxel-3D) are plotted as triangles. Our method gives a better compromise in terms of accuracy and runtime for all cases. SE: SECOND [42]; PP: PointPillars [18]; TA: TANet [23]; AS: Associate-3D [7]; 3D: 3D IoULoss [49]; SA: SA-SSD [12]; HS: HotSpotNet [3]. Best viewed in color. + +# w.r.t distances from the sensor. + +There are many attempts to learn 3D feature representations using point clouds with deep neural networks, which can be categorized into two groups: Voxel-based and point-based methods. The first approaches [7, 12, 18, 35, 43, 46] transform raw point clouds to structured grid representations, e.g., birds-eye-view (BEV) [35, 43] or voxels [12, 18, 33, 46, 50], to extract 3D representations using convolutional neural networks (CNNs). The voxelization and downsampling operations in these methods allow to extract compact 3D features efficiently, but they fail to preserve fine-grained 3D structures of objects. The second approaches [29, 34, 38, 44, 45], on the other hand, exploit raw point clouds directly to extract point-wise features using e.g., PointNet++ [30, 31]. They provide more discrimin + +inative 3D representations than the voxel-based one, and thus give better detection results. Processing a large-scale point cloud data, however, needs lots of computational cost. + +We present in this paper a novel single-stage 3D object detection framework that integrates voxel-based and point-based features effectively and efficiently to obtain discriminative 3D representations. To this end, we introduce a new CNN architecture, dubbed HVPR, that consists of a two-stream encoder for voxel-based and point-based features and a memory module. It augments the encoder for point-based features with the memory module to reduce the computational cost. Namely, we update and store point-based features from the encoder to memory items during training, and do not use the encoder at test time, avoiding heavy computation. Specifically, we aggregate the point-wise features in memory items, semantically similar to each voxel-based one, to obtain a pseudo image representation, enabling exploiting hybrid 3D representations efficiently for localizing objects in a single stage. This also encourages voxel-based features to incorporate fine-grained representations of point-based features, which are particularly effective for localizing small or largely occluded objects acquired from sparse point clouds. We also introduce a detection network with an Attentive Multi-scale Feature Module (AMFM). Given the hybrid pseudo image, it extracts multi-scale features, and AMFM refines them using 3D scale representations to obtain scale-aware features, which are crucial especially for 3D object detection, due to the sparse and irregular patterns of point clouds. Extensive experimental results on standard benchmarks demonstrate the effectiveness and efficiency of our approach to exploiting hybrid feature representations. The main contributions of this paper can be summarized as follows: + +- We introduce a novel single-stage framework for 3D object detection using hybrid 3D representations. We propose to use a memory module to augment point-based features, maintaining the efficiency of a single-stage method. +- We introduce AMFM that provides scale-aware features considering the sparse and irregular patterns of point clouds explicitly, allowing to consider complex scale variations across objects for 3D object detection. +- We demonstrate that our approach gives a better compromise in terms of speed and accuracy, compared to the state of the art. Our model runs at 36.1fps, while achieving competitive performance on the KITTI dataset [10]. + +Our code and models are available online: https:// cvlab.yonsei.ac.kr/projects/HVPR. + +# 2. Related work + +Multi-sensor based 3D detection. Multi-sensory data, obtained from e.g., RGB and depth sensors, provides complementary information for 3D object detection. For ex + +ample, RGB and depth images give semantic and structural information of objects, respectively. Many approaches attempt to leverage features from RGB images and point clouds jointly for 3D object detection. MV3D [5] generates object proposals from BEV representations, and refines them using features from point clouds and RGB images. AVOD [16] instead incorporates these features to extract object proposals, which provides better detection results. To further enhance 3D representations, proxy tasks are also exploited [20], such as a ground estimation with point clouds and a depth completion with RGB images. Recent methods [13, 47] also handle the case when multi-sensory data is not registered. They leverage correspondences between features from point clouds and RGB images to better exploit the complementary information. + +LiDAR based 3D detection. Recent approaches to 3D object detection use point clouds alone from a LiDAR sensor. They can be divided into two categories, voxel-based and point-based methods, depending on how to transform point clouds to 3D representations for localizing objects. First, voxel-based approaches convert irregular point clouds into ordered grid representations. Early works [35, 43] exploit a BEV image, obtained by projecting raw point clouds, which provides a compact 3D representation and preserves the scales of objects. Hand-crafted BEV representations are, however, limited to obtain accurate 3D features for object localization. Recent methods represent point clouds in a form of 3D voxels [7, 12, 18, 46, 50]. They often use 3D convolutions to extract features from the voxel representation, which is computationally inefficient. To alleviate this problem, PointPillars [18] propose to use a pseudo-image. Representing 3D voxels in a form of an image allows to exploit 2D convolutions, resulting in more efficient 3D object detection, compared to using 3D voxels directly. The voxel-based approaches mainly have two limitations: (1) Fine-grained 3D structures are lost during voxelization; (2) The localization performance largely depends on the size of voxel grids. As the grid size becomes smaller, fine-grained 3D representations can be obtained but at the cost of more runtime. Second, point-based approaches leverage raw point clouds directly. They extract point-based features, typically using PointNet++ [30, 31], that provide more accurate spatial representations than 3D voxels. These approaches thus perform better than the voxel-based one in terms of detection accuracy. It is, however, computationally demanding to extract point-based features directly from a large amount of point clouds for e.g., outdoor sceneries. To circumvent this issue, point-based approaches adopt a two-stage pipeline. Specifically, they estimate 3D object proposals either using point-based features [34, 45] or off-the-shelf 2D object detectors [29, 38] in the first stage. The object proposals are then refined with the point-based features inside the proposals for final predictions in the second stage. + +![](images/9c30df39e31ca890c8ca3e333ffa7b4f6279e107f9a50c6874ea617374411060.jpg) +Figure 2: An overview of our framework. The HVPR network inputs point clouds and generates two types of hybrid 3D features via a two-stream encoder: Voxel-point and voxel-memory representations. The former representations are obtained by aggregating point-based features for individual voxel-based ones. For the later ones, we also perform the aggregation but with memory items, instead of using point-based features. That is, we augment the point-based features using a memory module, and exploit voxel-memory representations, i.e., hybrid 3D features, at test time for fast inference. The backbone network with AMFM inputs the voxel-memory representations to extract multiple scale-aware features, and the detection head predicts 3D bounding boxes and object classes. See text for details. + +![](images/bd22b3bea0d733a1d57b5e035b9cf8b158a8766a53bbd5d80d1e745ce1b13847.jpg) + +Recently, PV-RCNN [33] and Fast Point R-CNN [6] further reduce the computational cost of point-based approaches. They propose to exploit voxel-based features to generate 3D object proposals in the first stage, while refining them to estimate final 3D bounding boxes with point-based features in the second stage. Since these methods exploit 3D voxels and raw point clouds separately in different stages, they do not fully leverage the complementary information of the two representations. Moreover, the point-based approaches are still slower than voxel-based methods, even leveraging a single-stage framework [38, 44]. + +Our approach belongs to the voxel-based method in the sense that it uses a pseudo image representation of point clouds, similar to PointPillars [18]. In contrast to previous voxel-based methods, we also exploit point-based features for the pseudo image representation in an efficient way, which boosts the detection performance significantly, while retaining fast runtime. Our approach is similar to recent point-based methods [6, 33, 44] in that it exploits both voxel-based and point-based features [6, 33]. On the contrary, we leverage both voxel-based and point-based representations jointly within a single-stage framework. We weave both representations in a form of a pseudo image, allowing to exploit 2D convolutions for efficient 3D object detection. Moreover, we further reduce the computational cost for extracting point-based features via augmenting a feature encoder with a memory module. + +Memory networks. Memory networks [39] have been introduced to capture long-term dependencies in sequential data by augmenting a neural network with an external memory module that can be read and written to. Based on this idea, recent works develop more advanced architectures using continuous memory representations [36] or a key-value memory [26]. A number of approaches have adopted the memory-augmented networks to solve various computer vi + +sion tasks including visual question answering [9, 17, 25], one-shot learning [2, 14, 32], anomaly detection [11, 27], and person recognition [41, 48]. + +# 3. Approach + +Our model mainly consists of three components (Fig. 2): a HVPR network (Sec. 3.1), a backbone network with AMFM (Sec. 3.2), and a detection head (Sec. 3.3). Given point clouds, the HVPR network outputs hybrid voxel-point representations in a form of pseudo-images. To this end, we exploit a two-stream encoder to extract voxel-based and point-based features. For each voxel-based feature, we aggregate point-based ones, based on their similarities, and obtain hybrid voxel-point representations. Extracting point-based features is, however, computationally demanding. To overcome this, we augment point-based features using a memory module. Specifically, we store various prototypes of point-based features in memory items, and aggregate the prototypical features in the memory to obtain voxel-memory representations. The memory items are updated by encouraging the aggregated prototypical and point-based features to be similar. Note that we exploit the voxel-memory representations only at test time, instead of using point-based ones directly, enabling a fast object detection. The backbone network inputs the voxel-memory representations in a form of a pseudo image, and extracts multi-scale feature maps. The AMFM refines the feature maps using 3D scale representations, and provides scale-aware features. The detection head predicts 3D object bounding boxes and object classes using the scale-aware features. In the following, we describe our single-stage detection framework in detail. + +# 3.1. HVPR Network + +Voxel-based feature. We assume that the physical dimension of a 3D scene that point clouds lie on is within the range + +of $W\times H\times L$ , where $W$ , $H$ , and $L$ are width, height, and length, respectively, in three-dimensions. Supposing that the size of each voxel is $v_{W}\times v_{H}\times v_{L}$ , we define voxel grids of size $W^{\prime}\times H^{\prime}\times L^{\prime}$ , where $W^{\prime} = W / v_{W}$ , $H^{\prime} = H / v_{H}$ , $L^{\prime} = L / v_{L}$ . Following [18], we voxelize point clouds in a x-y plane only, i.e., by setting the value of $v_{L}$ to be the same as $L$ . We represent a voxel as a tensor of size $N_{\mathrm{vox}}\times D$ , where $N_{\mathrm{vox}}$ and $D$ are the number of point clouds within each voxel and the size of augmented point clouds1, respectively. We exploit a tiny PointNet [30] as an encoder for voxel-based features. The encoder takes a set of voxels and extracts features of all point clouds in each voxel, providing an output of size $C\times N\times N_{\mathrm{vox}}$ , where $N$ is a total number of voxels. It then applies a max pooling operator over the point clouds in each voxel to obtain a voxel-based feature map of size $C\times N$ , where we denote by $\mathbf{f}_{\mathrm{vox}}(n)$ each voxel-based feature of size $C\times 1$ , where $n = 1,\dots ,N$ . + +Point-based feature. As a point stream, we adopt a Point-Net++ [31], widely used to other 3D applications, such as 3D semantic segmentation [1, 37] and 3D object detection [29, 34, 38, 44, 45], that extracts point-based features from raw point clouds directly. To this end, PointNet++ uses set abstraction (SA) and feature propagation (FP) layers. It first downsamples a set of points gradually, with a number of SA layers, to produce novel features with fewer points. The FP layers then propagate sub-sampled features to recover the initial points entirely. We follow these procedures to obtain a point-based feature for each point cloud. We denote by $\mathbf{f}_{\mathrm{pts}}(m)$ each point-based feature of size $C\times 1$ , where $m = 1,\dots ,M$ and $M$ is a total number of point clouds. + +# 3.1.1 Voxel-point representation + +We integrate voxel-based and point-based features, $\mathbf{f}_{\mathrm{vox}}$ and $\mathbf{f}_{\mathrm{pts}}$ , to obtain a hybrid voxel-point representation. To this end, we compute the dot product between all pairs of voxel-based and point-based features, resulting in a 2-dimensional correlation map of size $N\times M$ as follows: + +$$ +C (n, m) = \mathbf {f} _ {\mathrm {v o x}} (n) ^ {\top} \mathbf {f} _ {\mathrm {p t s}} (m). \tag {1} +$$ + +For each voxel-based feature, we select the nearest $K$ point-based features, according to the correlation scores. We denote by $\hat{\mathbf{f}}_{\mathrm{pts}}(n,k)$ the $k$ -th similar point-wise feature w.r.t the $n$ -th voxel-based one, where $k = 1,\dots ,K$ . We then compute the matching probabilities between these voxel-based and point-based features as follows: + +$$ +P (n, k) = \frac {\exp (\mathbf {f} _ {\mathrm {v o x}} (n) ^ {\top} \hat {\mathbf {f}} _ {\mathrm {p t s}} (n , k))}{\sum_ {k ^ {\prime}} \exp (\mathbf {f} _ {\mathrm {v o x}} (n) ^ {\top} \hat {\mathbf {f}} _ {\mathrm {p t s}} (n , k ^ {\prime}))}. \qquad (2) +$$ + +Finally, we aggregate the nearest $K$ point-based features with corresponding matching probabilities as follows: + +$$ +\mathbf {g} _ {\mathrm {p t s}} (n) = \sum_ {k} P (n, k) \hat {\mathbf {f}} _ {\mathrm {p t s}} (n, k), \tag {3} +$$ + +where $\mathbf{g}_{\mathrm{pts}}(n)$ is an aggregated point-based feature of size $C\times 1$ . It is semantically similar to the corresponding voxel-based one, but contains more accurate 3D structural information for objects. This enables imposing the fine-grained 3D representation to the voxel-based feature that loses the structure during voxelization. Specifically, we concatenate voxel-based and aggregated point-based features, and obtain a voxel-point pseudo image of size $H\times W\times 2C$ by scattering the concatenated features back to the corresponding voxel locations, similar to PointPillars [18]. In this context, the aggregated feature also has an effect of feature augmentation, providing more discriminative 3D representations, especially for the voxels obtained from sparse point clouds. + +# 3.1.2 Voxel-memory representation + +Point-wise features obtained by PointNet++ [31] contain fine-grained 3D representations, but this requires lots of computational cost. PointRCNN [34], for instance, composed of 4 pairs of SA and FP layers, requires 54ms with a Titan V GPU to obtain point-based features [44], which already exceeds the overall runtime of most voxel-based 3D detection methods [12, 18, 46]. To address this problem, we augment point-based features using a memory module, where each memory item stores various prototypes of the features, to obtain voxel-memory representations. + +Concretely, we denote by $\mathbf{f}_{\mathrm{mem}}(t)$ each item in the memory, the size of which is $C\times 1$ where $t = 1,\dots ,T$ and $T$ is a total number of memory items. We integrate the voxel-based features $\mathbf{f}_{\mathrm{vox}}$ and the memory items $\mathbf{f}_{\mathrm{mem}}$ to obtain a voxel-memory pseudo image in a similar way to the voxelpoint one in Sec. 3.1.1. Specifically, we consider the memory as a set of prototypes for point-based features. To read memory items, we use voxel-based features as queries. We then compute matching probabilities between voxel-based features and memory items, and aggregate the top $K$ items with corresponding probabilities for each voxel-based feature, which is analogous to the aggregated point-based feature in (3). We concatenate the voxel-based features with the aggregated items, and scatter the concatenated features back to the original voxel locations to form a voxel-memory pseudo image. To update memory items, we encourage the aggregated point-based features and memory items to be similar as follows: + +$$ +\mathcal {L} _ {\mathrm {m e m}} = \sum_ {n} \| \mathbf {g} _ {\mathrm {p t s}} (n) - \mathbf {g} _ {\mathrm {m e m}} (n) \| _ {2}, \tag {4} +$$ + +where we denote by $\mathbf{g}_{\mathrm{mem}}(n)$ an aggregated memory item, and $\| \cdot \| _2$ computes the L2 norm of a vector. Note that we + +do not use the voxel-point pseudo image at test time. We instead use the voxel-memory pseudo image only, avoiding extracting point-based features at test time. As will be shown in our experiments, obtaining hybrid 3D representations using a memory is much more cheaper than exploiting point-based features directly, while retaining the same level of quality. + +# 3.2. Backbone Network with AMFM + +Our backbone network consists of a series of 2D convolutional layers and AMFM (Fig. 2). It inputs our hybrid 3D representations, i.e., the voxel-memory pseudo image, and gives multi-scale feature maps. The AMFM then refines them using spatial attention maps, and provides scale-aware features. We obtain final feature representations for predicting 3D object bounding boxes by concatenating the scale-aware feature maps along the channel dimension. + +AMFM. There are large scale variations across 3D object instances in a scene. Multi-scale features help to consider the scale variations for 3D object detection, but they are not scale-aware, even when obtained from a feature pyramid [19]. To address this problem, we introduce AMFM that provides scale-aware features using 3D scale information explicitly. The basic idea of AMFM is to exploit spatial attention maps [40], while leveraging 3D scale features explicitly, for suppressing scale-confused features. Specifically, AMFM refines a multi-scale feature by element-wise multiplication with the attention map. It then combines the initial and refined multi-scale features via a skip connection. We illustrate in Fig. 3 how AMFM works in the backbone network in detail. In the following, we describe how to extract 3D scale features, and then present how to obtain a spatial attention map using 3D scale features in detail. + +We observe that 3D point clouds are sparse with the densities largely varying w.r.t distances from a LiDAR sensor. Namely, the sparse and irregular patterns of point clouds and their distances from a sensor reflect scale information of 3D objects. Based on this idea, we represent each voxel with the number of point clouds within a voxel, and an absolute position of point clouds averaged on each voxel and its distance from a sensor. We input a set of voxel representations to a network, and obtain voxel-wise features. To be specific, we exploit a tiny PointNet [30] similar to the encoder for voxel-based features. We then scatter the voxel-wise features back to the original locations to obtain a 3D scale feature map of the same size as the voxel-memory pseudo image. We downsample the 3D scale feature with a strided convolution, before feeding it to AMFM, such that it has the same spatial resolution as a corresponding multiscale feature map. To obtain a spatial attention map, we apply max pooling and average pooling layers to the 3D scale feature along the channel dimension, highlighting informative regions in the feature map [15]. We concatenate the pooled features, and feed the concatenated one to a con + +![](images/9cde7c33693a031d684b8cd9487541d471b9a1aaf4c561d746ca09e4b09c3f5d.jpg) +Figure 3: Illustration of AMFM. AMFM refines multi-scale features with a spatial attention map. It then combines the initial and refined features via a skip connection to obtain scale-aware representations. To compute the attention map, we leverage 3D scale features considering scale variations of objects in a 3D scene. See text for details. + +volitional layer, followed by applying a sigmoid function, to produce the attention map. + +# 3.3. Detection Head and Loss + +Following [18], we adopt the detection head of SSD [22] to localize 3D objects. It consists of two fully-connected layers for regressing 3D object bounding boxes and classifying object classes inside the boxes. We parameterize a 3D object bounding box as $(x, y, z, w, l, h, \theta)$ , where $(x, y, z)$ , $(w, l, h)$ and $\theta$ are the center coordinate, the size, the heading angle of the box, respectively. We compute 2D intersection over union (IoU) scores [8] between anchor boxes and the ground truth, and pick the anchors with the IoU scores being larger than a predefined threshold. Our detection head regresses residuals between the anchor boxes and the ground truth directly, defined as follows: + +$$ +\begin{array}{l} \Delta x = \frac {x ^ {\mathrm {g t}} - x ^ {\mathrm {a}}}{d}, \Delta y = \frac {y ^ {\mathrm {g t}} - y ^ {\mathrm {a}}}{d}, \Delta z = \frac {z ^ {\mathrm {g t}} - z ^ {\mathrm {a}}}{h ^ {\mathrm {a}}} \\ \Delta w = \log \frac {w ^ {\mathrm {g t}}}{w ^ {\mathrm {a}}}, \Delta l = \log \frac {l ^ {\mathrm {g t}}}{l ^ {\mathrm {a}}}, \Delta h = \log \frac {h ^ {\mathrm {g t}}}{h ^ {\mathrm {a}}} \tag {5} \\ \Delta \theta = \sin \left(\theta^ {\mathrm {g t}} - \theta^ {\mathrm {a}}\right), \\ \end{array} +$$ + +where $d = \sqrt{\left(w^{\mathrm{a}}\right)^2 + \left(l^{\mathrm{a}}\right)^2}$ , and we use the superscripts, gt and a, to indicate parameters for ground-truth and anchor boxes, respectively. + +To train our model, we use four terms for regression $(\mathcal{L}_{\mathrm{reg}}$ and $\mathcal{L}_{\mathrm{dir}})$ , classification $(\mathcal{L}_{\mathrm{cls}})$ , and memory update $(\mathcal{L}_{\mathrm{mem}}$ in (4)), as follows: + +$$ +\mathcal {L} = \frac {1}{N _ {\text {p o s}}} \left(\lambda_ {\text {r e g}} \mathcal {L} _ {\text {r e g}} + \lambda_ {\text {d i r}} \mathcal {L} _ {\text {d i r}} + \lambda_ {\text {c l s}} \mathcal {L} _ {\text {c l s}} + \lambda_ {\text {m e m}} \mathcal {L} _ {\text {m e m}}\right), \tag {6} +$$ + +where $N_{\mathrm{pos}}$ is the number of positive anchors, and $\lambda$ is a balancing parameter for the corresponding loss. We define the regression term with the residual between anchor and ground-truth boxes as follows: + +$$ +\mathcal {L} _ {\text {r e g}} = \sum_ {r \in (x, y, z, w, l, h, \theta)} \operatorname {S m o o t h L 1} (\Delta r). \tag {7} +$$ + +Note that $\Delta \theta$ is defined with a sine function in (5), penalizing the same 3D bounding boxes but with opposite directions differently. To prevent this, we also exploit the angle classification term $(\mathcal{L}_{\mathrm{dir}})$ [42]. As a classification term $(\mathcal{L}_{\mathrm{cls}})$ , we use the focal loss [21], which has shown the effectiveness to handle a class imbalance between positive and negative samples, with the default parameters in [21]. + +# 4. Experiments + +# 4.1. Implementation details + +Dataset and evaluation protocol. We evaluate our model on the KITTI 3D object detection benchmark [10]. The KITTI dataset provides 7,481 training and 7,518 test samples for object classes of cars, pedestrians and cyclists. Object instances across different classes are further classified into easy, moderate and hard splits, depending on the object size, the degree of occlusion and the maximum truncation level. We evaluate our model on the car and the pedestrian classes, most commonly used object class and the hardest one for 3D object detection, respectively. Following [23], we split the training set into two splits with the ratio of around 5:1 to train our model for testing via an official evaluation server. For other experiments including an ablation study, we follow the experimental protocol in [4, 8], and split the original training set of 7,481 samples into 3,712 and 3,769 ones for training and validation, respectively. We report the mean average precision (mAP) on both validation and test splits with 40 recall positions on a PR curve [10]. At test time, we apply non maximum suppression (NMS) with a threshold of 0.1 to eliminate multiple overlapping bounding boxes. + +Training. Following the previous works [18, 23, 42, 50], we train separate networks for the car and the pedestrian classes. We describe hereafter the training setting for the car class, and the one for the pedestrian is included in the supplementary material. We train our network for 100 epochs, with a learning rate of 3e-3 and a weight decay of 1e-2. We use a cosine annealing technique [24] as a learning rate scheduler. Batch size is set to 8 for the network. All models are trained end-to-end using PyTorch [28]. We use data augmentation techniques during training. Specifically, we apply random flipping along the $x$ -axis, global scaling, where a scaling factor is randomly chosen within a range of [0.95, 1.05], and global rotation along the $z$ -axis, where a rotation angle is sampled randomly from a range of $[-\frac{\pi}{4}, \frac{\pi}{4}]$ . We also use a ground-truth augmentation technique [42] that randomly selects ground-truth bounding boxes within the entire training dataset and associates them for each 3D scene. + +Parameter setting. We set the parameters for our model by a grid search in terms of mAP on the validation split: $K = 20$ , $C = 64$ , $T = 2,000$ , $\lambda_{\mathrm{reg}} = 2.0$ , $\lambda_{\mathrm{dir}} = 0.2$ , $\lambda_{\mathrm{cls}} = 1.0$ and $\lambda_{\mathrm{mem}} = 1.0$ . For other parameters, we + +use the same setting as in [18] as follows: We assume that the dimension of a 3D scene $(W, H, L)$ is within a range of $[(0, 70.4), (-40, 40), (-3, 1)]$ meters. We set the size of anchors as $1.6 \times 3.9 \times 1.5$ . To define positive and negative pairs, we compute IoU scores between the anchors and the ground truth. We choose the anchors with the IoU scores being larger than 0.6, as positive boxes, while those lower than 0.45 are used as negative ones. We use (0.16, 0.16, 4) as the size of a voxel, $v_{W} \times v_{H} \times v_{L}$ . The number of point clouds within each voxel $N_{\mathrm{vox}}$ and the size of augmented point clouds $D$ are set to 32 and 9, respectively. Please refer to the supplementary material for more implementation details including our network architecture. + +# 4.2. Results + +We compare in Table 1 our model with the state of the art for LiDAR based 3D detection. We report mAP scores of car and pedestrian classes on the KITTI test dataset [10]. All numbers including ours are obtained from an official evaluation server, except for [42, 50], which are taken from [3]. We classify 3D object detection methods into point-based and voxel-based approaches, according to features used to represent 3D objects. The voxel-based approaches are further categorized into two groups based on whether they exploit 3D voxels explicitly or implicitly in a form of a pseudo image, where our model belongs to the latter one. We mainly compare our model with voxel-based methods, especially with the ones exploiting pseudo image representations. For comparison, we also report results of point-based and other voxel-based approaches. From this table, we observe four things: (1) Our model for the car class gives the best results among voxel-based methods using pseudo images. This demonstrates the effectiveness of our approach to exploiting a hybrid 3D representation and scale-aware features for 3D object detection. (2) Our method is fastest among voxel-based approaches, except PointPillars [18], while providing competitive results. Although PointPillars is faster than ours (42.4Hz vs. 36.1Hz), it is outperformed by our model by a significant margin in terms of mAP for all difficulty levels. This suggests that our model offers a good compromise in terms of speed and accuracy. (3) The performance improvements over other voxel-based methods using pseudo images are particularly significant in a hard split, where 3D objects are typically small in size and largely occluded. For example, the mAP gain of our model w.r.t the second best method [7] (73.04 vs. 70.53) is much larger than those for easy and moderate splits of the car class. Also, our model gives the best result among other voxel-based methods using pseudo images on the hard split of the pedestrian class. This confirms that augmenting point-based features provides more discriminative 3D representations, especially for objects taken from sparse point clouds. (4) Our model for the pedestrian class outperforms PointPillars [18] significantly, while providing + +Table 1: Quantitative comparison with the state of the art in terms of mAP(%) and runtime on the KITTI test set [10]. We mainly compare our model with voxel-based methods using pseudo image representations (Voxel-PI). For comparison, we also report results for point-based and (Point) other voxel-based methods using 3D voxel representations (Voxel-3D), although they typically provide better results, but at the cost of much slower runtime, than exploiting pseudo image representations. Numbers in bold for Voxel-PI indicate the best performance and underscored ones are the second best. + +
TypeStageMethodsReferenceRuntime (Hz)GPUEasyCar Mod.HardPedestrian
EasyMod.Hard
PointTwoPointRCNN [34]CVPR 201910TITAN XP86.9675.6470.7047.9839.3736.01
TwoFastPointRCNN [6]ICCV 201916.7Tesla P4085.2977.4070.24---
OneF-ConvNet [38]IROS 20192.1GTX 108087.3676.3966.6952.1643.3838.80
TwoSTD [45]ICCV 201912.5TITAN V87.9579.7175.0953.2942.4738.35
One3DSSD [44]CVPR 202025TITAN V88.3679.5774.5554.6444.2740.23
TwoPV-RCNN [33]CVPR202012.5GTX 1080Ti90.2581.4376.8252.1743.2940.29
Voxel-3DOneVoxelNet [50]CVPR 20184.5TITAN X77.4765.1157.7339.4833.6931.51
One3DIoULoss [49]3DV 201912.5-86.1676.5071.39---
OneSA-SSD [12]CVPR 202025GTX 2080Ti88.7579.7974.16---
OneHotSpotNet [3]ECCV 202025-87.6078.3173.3453.1045.3741.47
Voxel-PIOneSECOND [42]Sensors 201820GTX 1080Ti84.7875.3268.7045.3135.5233.14
OnePointPillars [18]CVPR 201942.4GTX 1080Ti82.5874.3168.9951.4541.9238.89
OneTANet [23]AAAI 202028.5TITAN V84.3975.9468.8253.7244.3440.49
OneAssociate-3D [7]CVPR 202020GTX 1080Ti85.9977.4070.53---
OneOurs36.1GTX 2080Ti86.3877.9273.0453.4743.9640.64
+ +Table 2: Quantitative comparison for variants of our model. We compute mAP (\%) and measure runtime (Hz) on the KITTI validation set [10]. VoxF: Voxel-based feature; PtsF: Point-based feature; MEM: Memory module; 3DSF: 3D scale feature. + +
VoxFPtsFMemAMFM3DSFEasyMod.HardTime
✓87.6678.8275.3239.5
✓✓88.9780.3577.286.8
✓✓✓87.9680.4477.9237.9
✓✓✓✓89.5180.8678.2231.3
✓✓✓✓✓91.1482.0579.4936.1
+ +a competitive result with the best voxel-based method using pseudo images [23]. This shows that our model can generalize to other object classes. Note that our 3D representations from the HVPR network can be easily incorporated into other voxel-based methods [12, 49, 50], which may boost the mAP performance. + +# 4.3. Discussion + +In this section, we show more experimental results to analyze individual components of our model in detail. Following previous works [44, 45, 50], we report quantitative results of the car class in terms of mAP on the validation split of KITTI [10]. We measure the mAP performance with 40 recall positions. + +Ablation study. We show an ablation analysis on different components of our model in Table 2. As our baseline in the first row, we use PointPillars [18], reproduced by ourselves, for ablation studies. Similar to ours, PointPillars leverage a pseudo image to represent a 3D scene, but it exploits voxel-based features alone. We can see from + +the first and second rows that a hybrid representation using additional point-based features boosts the detection performance remarkably, which provides mAP gains of 1.31, 1.53 and 1.94 for easy, moderate and hard splits, respectively. The improvements for the moderate and hard splits are more significant than the easy one. This suggests that 1) the aggregated point-based features allow to obtain more discriminative 3D representations, especially for small or occluded objects with sparse points, and 2) voxel-based and point-based features are complementary to each other. Extracting point-based features, however, is computationally expensive, which degrades runtime performance from $39.5\mathrm{Hz}$ to $6.8\mathrm{Hz}$ . The third row demonstrates that our memory module boosts the runtime performance significantly, while retaining the same level of quality. The average runtime is almost the same as the baseline (39.5Hz vs. 37.9Hz). This shows the effectiveness and efficiency of a memory module to augment point-based features. Our model in the fourth row exploits AMFM but without using 3D scale features. That is, it computes an attention map directly using multi-scale features. From the third and fourth rows, we can see that refining multi-scale features with a spatial attention map gives better results. The last two rows show that 3D scale features further boosts the detection performance drastically for all cases. The mAP gains for each split are 1.63, 1.19 and 1.27, respectively. The reason is that the features allow to leverage 3D scale information explicitly, which is particularly important to consider complex scale variations of objects in a scene for 3D object detection. + +Memory items. We show in Table 3 quantitative results for different combinations of a total number of memory + +![](images/9c2d6dc81915c41e5cff54622d8cee53f67a80cb1ab3c3c198cc0900474a8bf1.jpg) + +![](images/3360e1ff0cafa748de170af80bef96a95cd3f14e678da6192806ef95631363f0.jpg) + +![](images/e45a8ab455ec1f9450c2e3631c83e307169c5a5cfecf99f1310571aa5d6840a3.jpg) + +![](images/aa91400665ff8ef52a4f3c5e262a1a1a7eae8e2d3b6726d02be2f6d0d7d0f832.jpg) + +![](images/f59b6196ebb628651b3f7be85922cd174b89c55fb7dbfb6b26f10f61236aa621.jpg) + +![](images/52ac19f26333b11428094d1d44889689548cb4e8377fd8c5707c1489f2990453.jpg) + +![](images/66625e36131610f2d863d3e92631a8f09915164f34622b9a7e21dffb0b54bcba.jpg) + +![](images/b84ff1f738e7867c44116f4480ffe5b4796fb114c3478fb8ffcbd1c87299006e.jpg) + +![](images/53c523bd389b2112a644287a06ee259a916b439e1a913b421024ceb9bc04c718.jpg) + +![](images/ef3ffbd30ee370c33307d1661c648f57af3efa7ae9b65a13ed17a112d849c89e.jpg) +Figure 4: Qualitative results on the validation split of KITTI [10]. Our predictions and ground-truth bounding boxes are shown in green and red, respectively. Our method localizes small and/or occluded objects well, except the heavily occluded ones, e.g., in the left-bottom of the top-middle image. We also show 2D bounding boxes projected from 3D detection results. Best viewed in color. + +![](images/71881a253676cac1de378a671e874f8c261996db9fce5f86d6e61108b50d6487.jpg) + +![](images/117069abab4b42808a7f1261c264c2a3656ef74099159315b719ad691dee36be.jpg) + +Table 3: Quantitative comparison for different combinations of a total numbers of memory items $(T)$ and the number of nearest items retrieved $(K)$ . We report mAP $(\%)$ for the car class on the validation split of KITTI [10]. + +
K=5K=10K=20K=30
T=100080.2280.7481.3280.82
T=200080.6880.9182.0581.18
T=300080.6880.8281.5681.45
+ +items $T$ and the number of nearest items retrieved $K$ . We compare the performance of our final model, with a memory module and AMFM, in terms of mAP, and report results of the car class on the moderate split. We can clearly see that the mAP performance is robust over the total number of memory items. We can also observe that aggregating more items for hybrid 3D representations provides better results, but using less similar items are not helpful. For example, mAP scores increase, until we reach the number of nearest items $K$ to the value of 20. After that, using more items rather lowers the scores. + +Qualitative results. We visualize in Fig. 4 detection results on the validation split of KITTI [10]. We can see that our model is robust to complex scale variations. That is, it localizes 3D objects well, including small ones captured with sparse point clouds. This confirms the effectiveness + +of our hybrid 3D representations and scale-aware features once again. More qualitative results are available in the supplementary material. + +# 5. Conclusion + +We have introduced a novel single-stage 3D detection method using hybrid 3D representations. We have integrated voxel-based and point-based features effectively to obtain 3D representations of a scene in a form of a pseudo image. For efficient object detection, we have proposed to use a memory module to augment point-based features. We have also presented AMFM that provides scale-aware representations using 3D scale features, which boosts the performance of 3D object detection significantly. An extensive experimental analysis on KITTI demonstrates that our model achieves the best results among voxel-based methods using pseudo images, and it provides a better compromise in terms of accuracy and speed than other 3D detection approaches. + +Acknowledgments. 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 (NRF-2018M3E3A1057289), and Institute for Information and Communications Technology Promotion (IITP) funded by the Korean Government (MSIP) under Grant 2016-0-00197. + +# References + +[1] Jens Behley, Martin Garbade, Andres Milioto, Jan Quenzel, Sven Behnke, Cyril Stachniss, and Jurgen Gall. SemanticKITTI: A dataset for semantic scene understanding of lidar sequences. In ICCV, 2019. 4 +[2] Qi Cai, Yingwei Pan, Ting Yao, Chenggang Yan, and Tao Mei. Memory matching networks for one-shot image recognition. In CVPR, 2018. 3 +[3] Qi Chen, Lin Sun, Zhixin Wang, Kui Jia, and Alan Yuille. Object as hotspots: An anchor-free 3D object detection approach via firing of hotspots. In ECCV, 2020. 1, 6, 7 +[4] Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Andrew G Berneshawi, Huimin Ma, Sanja Fidler, and Raquel Urtasun. 3D object proposals for accurate object class detection. In NeurIPS, 2015. 6 +[5] Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia. Multi-view 3D object detection network for autonomous driving. In CVPR, 2017. 2 +[6] Yilun Chen, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Fast point r-cnn. In ICCV, 2019. 3, 7 +[7] Liang Du, Xiaoqing Ye, Xiao Tan, Jianfeng Feng, Zhenbo Xu, Errui Ding, and Shilei Wen. Associate-3Ddet: Perceptual-to-conceptual association for 3D point cloud object detection. In CVPR, 2020. 1, 2, 6, 7 +[8] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (VOC) challenge. *IJCV*, 88, 2010. 5, 6 +[9] Chenyou Fan, Xiaofan Zhang, Shu Zhang, Wensheng Wang, Chi Zhang, and Heng Huang. Heterogeneous memory enhanced multimodal attention model for video question answering. In CVPR, 2019. 3 +[10] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the KITTI vision benchmark suite. In CVPR, 2012. 1, 2, 6, 7, 8 +[11] 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, 2019. 3 +[12] Chenhang He, Hui Zeng, Jianqiang Huang, Xian-Sheng Hua, and Lei Zhang. Structure aware single-stage 3D object detection from point cloud. In CVPR, 2020. 1, 2, 4, 7 +[13] Tengteng Huang, Zhe Liu, Xiwu Chen, and Xiang Bai. EP-Net: Enhancing point features with image semantics for 3D object detection. In ECCV, 2020. 2 +[14] Lukasz Kaiser, Ofir Nachum, Aurko Roy, and Samy Bengio. Learning to remember rare events. In ICLR, 2017. 3 +[15] Nikos Komodakis and Sergey Zagoruyko. Paying more attention to attention: improving the performance of convolutional neural networks via attention transfer. In ICLR, 2017. 5 +[16] Jason Ku, Melissa Mozifian, Jungwook Lee, Ali Harakeh, and Steven L Waslander. Joint 3D proposal generation and object detection from view aggregation. In IROS, 2018. 2 +[17] Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016. 3 + +[18] Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. In CVPR, 2019. 1, 2, 3, 4, 5, 6, 7 +[19] Yazhao Li, Yanwei Pang, Jianbing Shen, Jiale Cao, and Ling Shao. NETNet: Neighbor erasing and transferring network for better single shot object detection. In CVPR, 2020. 5 +[20] Ming Liang, Bin Yang, Yun Chen, Rui Hu, and Raquel Urtasun. Multi-task multi-sensor fusion for 3D object detection. In CVPR, 2019. 2 +[21] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In ICCV, 2017. 6 +[22] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. SSD: Single shot multibox detector. In ECCV. Springer, 2016. 5 +[23] Zhe Liu, Xin Zhao, Tengteng Huang, Ruolan Hu, Yu Zhou, and Xiang Bai. TANet: Robust 3D object detection from point clouds with triple attention. In AAAI, 2020. 1, 6, 7 +[24] Ilya Loshchilov and Frank Hutter. SGDR: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. 6 +[25] Chao Ma, Chunhua Shen, Anthony Dick, Qi Wu, Peng Wang, Anton van den Hengel, and Ian Reid. Visual question answering with memory-augmented networks. In CVPR, 2018. 3 +[26] Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. In EMNLP, 2016. 3 +[27] Hyunjong Park, Jongyoun Noh, and Bumsub Ham. Learning memory-guided normality for anomaly detection. In CVPR, 2020. 3 +[28] 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 +[29] Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3D object detection from rgb-d data. In CVPR, 2018. 1, 2, 4 +[30] 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, 2, 4, 5 +[31] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NeurIPS, 2017. 1, 2, 4 +[32] Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-learning with memory-augmented neural networks. In ICML, 2016. 3 +[33] Shaoshuai Shi, Chaoxu Guo, Li Jiang, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. PV-RCNN: Point-voxel feature set abstraction for 3D object detection. In CVPR, 2020. 1, 3, 7 +[34] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. PointR-CNN: 3D object proposal generation and detection from point cloud. In CVPR, 2019. 1, 2, 4, 7 +[35] Martin Simon, Stefan Milzy, Karl Amendey, and Horst-Michael Gross. Complex-YOLO: An euler-region-proposal + +for real-time 3d object detection on point clouds. In ECCVW, 2018.1,2 +[36] Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In NeurIPS, 2015. 3 +[37] Xinlong Wang, Shu Liu, Xiaoyong Shen, Chunhua Shen, and Jiaya Jia. Associatively segmenting instances and semantics in point clouds. In CVPR, 2019. 4 +[38] Zhixin Wang and Kui Jia. Frustum convnet: Sliding frustums to aggregate local point-wise features for amodal 3D object detection. In IROS, 2019. 1, 2, 3, 4, 7 +[39] Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In ICLR, 2015. 3 +[40] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. CBAM: Convolutional block attention module. In ECCV, 2018. 5 +[41] Jiangyue Xia, Anyi Rao, Qingqiu Huang, Linning Xu, Jiangtao Wen, and Dahua Lin. Online multi-modal person search in videos. In ECCV, 2020. 3 +[42] Yan Yan, Yuxing Mao, and Bo Li. SECOND: Spherically embedded convolutional detection. Sensors, 18(10), 2018. 1, 6, 7 +[43] Bin Yang, Wenjie Luo, and Raquel Urtasun. **PIXOR: Real-time 3D object detection from point clouds. In CVPR, 2018.** 1, 2 +[44] Zetong Yang, Yanan Sun, Shu Liu, and Jiaya Jia. 3DSSD: Point-based 3D single stage object detector. In CVPR, 2020. 1, 3, 4, 7 +[45] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia. STD: Sparse-to-dense 3D object detector for point cloud. In ICCV, 2019. 1, 2, 4, 7 +[46] Maosheng Ye, Shuangjie Xu, and Tongyi Cao. HVNet: Hybrid voxel network for lidar based 3D object detection. In CVPR, 2020. 1, 2, 4 +[47] Jin Hyeok Yoo, Yeocheol Kim, Ji Song Kim, and Jun Won Choi. 3D-CVF: Generating joint camera and lidar features using cross-view spatial feature fusion for 3D object detection. In ECCV, 2020. 2 +[48] Zhun Zhong, Liang Zheng, Zhiming Luo, Shaozi Li, and Yi Yang. Invariance matters: Exemplar memory for domain adaptive person re-identification. In CVPR, 2019. 3 +[49] Dingfu Zhou, Jin Fang, Xibin Song, Chenye Guan, Junbo Yin, Yuchao Dai, and Ruigang Yang. Iou loss for 2D/3D object detection. In 3DV, 2019. 1, 7 +[50] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3D object detection. In CVPR, 2018. 1, 2, 6, 7 \ No newline at end of file diff --git a/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/images.zip b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..213ed12c0502cd1e8cac6b1dde8fe945ec753b3e --- /dev/null +++ b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e109b7a892f89c110e639e8d1d5a78a48b8b20593b8826b4dccec96522cfe8be +size 489753 diff --git a/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/layout.json b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8d088aa9c7dfc67190d33557a4606b59245b5c8b --- /dev/null +++ b/hvprhybridvoxelpointrepresentationforsinglestage3dobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14bd6981bcc43bea612ad67f70d731a4ecca22a27ebb71ff37f24339872ef2d7 +size 352352