diff --git a/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_content_list.json b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5dbeb5ca842c12fe420130422f84d04f71b94e9c --- /dev/null +++ b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26a30abb2c5a4637bc67f5474c39cd0076dea6b15cc1feddb645ac54d164572f +size 90672 diff --git a/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_model.json b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4a43f7f754b47dd01ec06b2f88311fdd9111e6a0 --- /dev/null +++ b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d62915e24570d5b41f184cb01744ce90ddafedc7506ee9a7e7329a6db9f2409e +size 114367 diff --git a/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_origin.pdf b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..705bc471fa6b88e0fe80e339ce350e83643ab4eb --- /dev/null +++ b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/a3a7c8f1-73ec-4e4f-847b-4e90fdc9c177_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e3bfe6b59a034a7cd58b2d865bf218164b6371b60adc192f6d1579bdcbbcdd7 +size 1147408 diff --git a/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/full.md b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3ebdcd79bea06dcec826590ce268bc9a768c3892 --- /dev/null +++ b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/full.md @@ -0,0 +1,465 @@ +# Rethinking Data Augmentation for Image Super-resolution: A Comprehensive Analysis and a New Strategy + +Jaejun Yoo* EPFL. + +jaejun.yoo88@gmail.com + +Namhyuk Ahn* +Ajou University + +aa0cfg@ajou.ac.kr + +Kyung-Ah Sohn† + +Ajou University + +kasohn@ajou.ac.kr + +# Abstract + +Data augmentation is an effective way to improve the performance of deep networks. Unfortunately, current methods are mostly developed for high-level vision tasks (e.g., classification) and few are studied for low-level vision tasks (e.g., image restoration). In this paper, we provide a comprehensive analysis of the existing augmentation methods applied to the super-resolution task. We find that the methods discarding or manipulating the pixels or features too much hamper the image restoration, where the spatial relationship is very important. Based on our analyses, we propose CutBlur that cuts a low-resolution patch and pastes it to the corresponding high-resolution image region and vice versa. The key intuition of CutBlur is to enable a model to learn not only "how" but also "where" to superresolve an image. By doing so, the model can understand "how much", instead of blindly learning to apply super-resolution to every given pixel. Our method consistently and significantly improves the performance across various scenarios, especially when the model size is big and the data is collected under real-world environments. We also show that our method improves other low-level vision tasks, such as denoising and compression artifact removal. + +# 1. Introduction + +Data augmentation (DA) is one of the most practical ways to enhance model performance without additional computation cost in the test phase. While various DA methods [7, 29, 30, 13] have been proposed in several high-level vision tasks, DA in low-level vision has been scarcely investigated. Instead, many image restoration studies, such as super-resolution (SR), have relied on the synthetic datasets [22], which we can easily increase the number of training samples by simulating the system degradation functions (e.g., using the bicubic kernel for SR). + +Because of the gap between a simulated and a real data + +distribution, however, models that are trained on simulated datasets do not exhibit optimal performance in the real environments [4]. Several recent studies have proposed to mitigate the problem by collecting real-world datasets [1, 4, 32]. However, in many cases, it is often very time-consuming and expensive to obtain a large number of such data. Although this is where DA can play an important role, only a handful of studies have been performed [9, 24]. + +Radu et al. [24] was the first to study various techniques to improve the performance of example-based single-image super-resolution (SISR), one of which was data augmentation. Using rotation and flipping, they reported consistent improvements across models and datasets. Still, they only studied simple geometric manipulations with traditional SR models [12, 23] and a very shallow learning-based model, SRCNN [8]. To the best of our knowledge, Feng et al. [9] is the only work that analyzed a recent DA method (Mixup [30]) in the example-based SISR problem. However, the authors provided only a limited observation using a single U-Net-like architecture and tested the method with a single dataset (RealSR [4]). + +To better understand DA methods in low-level vision, we provide a comprehensive analysis on the effect of various DA methods that are originally developed for high-level vision tasks (Section 2). We first categorize the existing augmentation techniques into two groups depending on where the method is applied; pixel-domain [7, 29, 30] and feature-domain [11, 10, 26, 27]. When directly applied to SISR, we find that some methods harm the image restoration results and even hampers the training, especially when a method largely induces the loss or confusion of spatial information between nearby pixels (e.g., Cutout [7] and feature-domain methods). Interestingly, basic manipulations like RGB permutation that do not cause a severe spatial distortion provide better improvements than the ones which induce unrealistic patterns or a sharp transition of the structure (e.g., Mixup [30] and CutMix [29]). + +Based on our analyses, we propose CutBlur, a new augmentation method that is specifically designed for the low-level vision tasks. CutBlur cut and paste a low resolution + +![](images/e1a25811ca6553e240aa10309271a43958ef65e1bf70d441dea6c8f7c43b9fdf.jpg) +(a) High resolution + +![](images/cabe1401224085aeb46e7ca4f5a2f0d0d23bd9bc0e39606e6a315405a3f96041.jpg) +(b) Low resolution + +![](images/50288ee48b3eb9f3ab02bafdcfac54f5e7a56d3d7e09a039de3464c96db97122.jpg) +(c) CutBlur + +![](images/2764bf0cda3b325f61306df7df7a7f97555cb13bf4fbb313595d1146e12f401c.jpg) +(d) Schematic illustration of CutBlur operation + +![](images/9de8381bdfb9bd54281351ca2924f80ec47bb2acea027322d138da89ee109e93.jpg) + +![](images/5203550ead2c4e1a8e5a7aa077c99c1b74edf6f9ba6f08abd90583981c738889.jpg) +(e) Blend + +![](images/1fe2da7921c90a7753823ce994d749333e15310043da4dd63c686f68497e160d.jpg) +(f) RGB permute + +![](images/07c09bcea10801d0169bbd7e9da83b6f4f6297eba99ab02e794906d2914b0fac.jpg) +(g) Cutout $(25\%)$ [7] +Figure 1. Data augmentation methods. (Top) An illustrative example of our proposed method, CutBlur. CutBlur generates an augmented image by cut-and-pasting the low resolution (LR) input image onto the ground-truth high resolution (HR) image region and vice versa (Section 3). (Bottom) Illustrative examples of the existing augmentation techniques and a new variation of CutMix and Mixup, CutMixup. + +![](images/855f5a884cb212e9e6e8b650457264fd62be314ed32e2f21077358a5ebae7614.jpg) +(h) Mixup [30] + +![](images/bb0ac83c81827d4abac1cb5318efe78de294909813ba9371d76e9465b75ce006.jpg) +(i) CutMix [29] + +![](images/f3321d786873d1f432f063de2daf7a7bc42137bcb338b99825c2e944bb5f9f43.jpg) +(j) CutMixup + +(LR) image patch into its corresponding ground-truth high resolution (HR) image patch (Figure 1). By having partially LR and partially HR pixel distributions with a random ratio in a single image, CutBlur enjoys the regularization effect by encouraging a model to learn both "how" and "where" to super-resolve the image. One nice side effect of this is that the model also learns "how much" it should apply super-resolution on every local part of a given image. While trying to find a mapping that can simultaneously maintain the input HR region and super-resolve the other LR region, the model adaptively learns to super-resolve an image. + +Thanks to this unique property, CutBlur prevents oversharpening of SR models, which can be commonly found in real-world applications (Section 4.3). In addition, we show that the performance can be further boosted by applying several curated DA methods together during the training phase, which we call mixture of augmentations (MoA) (Section 3). Our experiments demonstrate that the proposed strategy significantly and consistently improves the model performance over various models and datasets. Our contributions are summarized as follows: + +1. To the best of our knowledge, we are the first to provide comprehensive analysis of recent data augmentation methods when directly applied to the SISR task. +2. We propose a new DA method, CutBlur, which can reduce unrealistic distortions by regularizing a model to learn not only "how" but also "where" to apply the super-resolution to a given image. +3. Our mixed strategy shows consistent and significant improvements in the SR task, achieving state-of-the-art (SOTA) performance in RealSR [4]. + +# 2. Data augmentation analysis + +In this section, we analyze existing augmentation methods and compare their performances when applied to EDSR [15], which is our baseline super-resolution model. We train EDSR from scratch with DIV2K [2] dataset or RealSR [4] dataset. We used the authors' official code. + +# 2.1. Prior arts + +DA in pixel space. There have been many studies to augment images in high-level vision tasks [7, 29, 30] (Figure 1). Mixup [30] blends two images to generate an unseen training sample. Cutout and its variants [7, 34] drop a randomly selected region of an image. Addressing that Cutout cannot fully exploit the training data, CutMix [29] replaces the random region with another image. Recently, AutoAugment and its variant [6, 16] have been proposed to learn the best augmentation policy for a given task and dataset. + +DA in feature space. DA methods manipulating CNN features have been proposed [5, 10, 11, 19, 26, 27] and can be categorized into three groups: 1) feature mixing, 2) shaking, and 3) dropping. Like Mixup, Manifold Mixup [26] mixes both input image and the latent features. Shake-shake [10] and ShakeDrop [27] perform a stochastic affine transformation to the features. Finally, following the spirit of Dropout [19], a lot of feature dropping strategies [5, 11, 25] have been proposed to boost the generalization of a model. + +DA in super-resolution. A simple geometric manipulation, such as rotation and flipping, has been widely used in SR models [24]. Recently, Feng et al. [9] showed that Mixup can alleviate the overfitting problem of SR models [4]. + +# 2.2. Analysis of existing DA methods + +The core idea of many augmentation methods is to partially block or confuse the training signal so that the model acquires more generalization power. However, unlike the high-level tasks, such as classification, where a model should learn to abstract an image, the local and global relationships among pixels are especially more important in the low-level vision tasks, such as denoising and superresolution. Considering this characteristic, it is unsurprising that DA methods, which lose the spatial information, limit the model's ability to restore an image. Indeed, we observe that the methods dropping the information [5, 11, 25] are detrimental to the SR performance and especially harmful in the feature space, which has larger receptive fields. Every feature augmentation method significantly drops the performance. Here, we put off the results of every DA method that degrades the performance in the supplementary material. + +On the other hand, DA methods in pixel space bring some improvements when applied carefully (Table 1). For example, Cutout [7] with default setting (dropping $25\%$ of pixels in a rectangular shape) significantly degrades the original performance by $0.1 \mathrm{~dB}$ . However, we find that Cutout gives a positive effect (DIV2K: $+0.01 \mathrm{~dB}$ and RealSR: $+0.06 \mathrm{~dB}$ ) when applied with $0.1\%$ ratio and erasing random pixels instead of a rectangular region. Note that this drops only $2 \sim 3$ pixels when using a $48 \times 48$ input patch. + +CutMix [29] shows a marginal improvement (Table 1), and we hypothesize that this happens because CutMix generates a drastically sharp transition of image context making boundaries. Mixup improves the performance but it minngles the context of two different images, which can confuse the model. To alleviate these issues, we create a variation of CutMix and Mixup, which we call CutMixup (below the dashed line, Figure 1). Interestingly, it gives a better improvement on our baseline. By getting the best of both methods, CutMixUp benefits from minimizing the boundary effect as well as the ratio of the mixed contexts. + +Based on these observations, we further test a set of basic operations such as RGB permutation and Blend (adding a constant value) that do not incur any structural change in an image. (For more details, please see our supplementary material.) These simple methods show promising results in the synthetic DIV2K dataset and a big improvement in the RealSR dataset, which is more difficult. These results empirically prove our hypothesis, which naturally leads us to a new augmentation method, CutBlur. When applied, CutBlur not only improves the performance (Table 1) but provides some good properties and synergy (Section 3.2), which cannot be obtained by the other DA methods. + +Table 1. PSNR (dB) comparison of different data augmentation methods in super-resolution. We report the baseline model (EDSR [15]) performance that is trained on DIV2K $(\times 4)$ [2] and RealSR $(\times 4)$ [4]. The models are trained from scratch. $\delta$ denotes the performance gap between with and without augmentation. + +
MethodDIV2K (δ)RealSR (δ)
EDSR29.21 (+0.00)28.89 (+0.00)
Cutout [7] (0.1%)29.22 (+0.01)28.95 (+0.06)
CutMix [29]29.22 (+0.01)28.89 (+0.00)
Mixup [30]29.26 (+0.05)28.98 (+0.09)
CutMixup29.27 (+0.06)29.03 (+0.14)
RGB perm.29.30 (+0.09)29.02 (+0.13)
Blend29.23 (+0.02)29.03 (+0.14)
CutBlur29.26 (+0.05)29.12 (+0.23)
All DA's (random)29.30 (+0.09)29.16 (+0.27)
+ +# 3. CutBlur + +In this section, we describe the CutBlur, a new augmentation method that is designed for the super-resolution task. + +# 3.1. Algorithm + +Let $x_{LR} \in \mathbb{R}^{W \times H \times C}$ and $x_{HR} \in \mathbb{R}^{sW \times sH \times C}$ are LR and HR image patches and $s$ denotes a scale factor in the SR. As illustrated in Figure 1, because CutBlur requires to match the resolution of $x_{LR}$ and $x_{HR}$ , we first upsample $x_{LR}$ by $s$ times using a bicubic kernel, $x_{LR}^s$ . The goal of CutBlur is to generate a pair of new training samples $(\hat{x}_{HR \to LR}, \hat{x}_{LR \to HR})$ by cut-and-pasting the random region of $x_{HR}$ into the corresponding $x_{LR}^s$ and vice versa: + +$$ +\begin{array}{l}\hat {x} _ {H R \rightarrow L R} = \mathbf {M} \odot x _ {H R} + (\mathbf {1} - \mathbf {M}) \odot x _ {L R} ^ {s}\\\hat {x} _ {L R \rightarrow H R} = \mathbf {M} \odot x _ {L R} ^ {s} + (\mathbf {1} - \mathbf {M}) \odot x _ {H R}\end{array}\tag {1} +$$ + +where $\mathbf{M} \in \{0,1\}^{sW \times sH}$ denotes a binary mask indicating where to replace, $\mathbf{1}$ is a binary mask filled with ones, and $\odot$ is element-wise multiplication. For sampling the mask and its coordinates, we follow the original CutMix [29]. + +# 3.2. Discussion + +Why CutBlur works for SR? In the previous analysis (Section 2.2), we found that sharp transitions or mixed image contents within an image patch, or losing the relationships of pixels can degrade SR performance. Therefore, a good DA method for SR should not make unrealistic patterns or information loss while it has to serve as a good regularizer to SR models. + +CutBlur satisfies these conditions because it performs cut-and-paste between the LR and HR image patches of the same content. By putting the LR (resp. HR) image region onto the corresponding HR (resp. LR) image region, it can minimize the boundary effect, which majorly comes from + +![](images/987f228c93f2050563899c56460ca52f3460f553cc3de9cd0f546a32e451bad3.jpg) +HR (input) + +![](images/a30afa7d5a60e19d42e7b149f1d2429549c27b252b2e28b36e35de9235c1da0c.jpg) +EDSR w/o CutBlur $(\Delta)$ + +![](images/15ccd33be0b94935e7b09719a8004b9ef2fa38797433682ea51e24acedcab3db.jpg) + +![](images/17b8742890063267d7af27a7ee55194c49249a61ed0ff5d727fbd1427d422cc3.jpg) + +![](images/f8f3008cd64decd0d7d9f47aec7550cdaa3eba40748f21155e7d68f734c645fc.jpg) + +![](images/c3805a1c2e57d08c14bb24f413e3f5791e724da7a89cb462c949187ea50a2e7e.jpg) + +![](images/7d6a74f49c6fbe9749a78c28e764fb7b188bc0fe6a7dc0d589ccd0577827ab2e.jpg) +EDSR w/ CutBlur $(\Delta)$ + +![](images/43e9e8ecbe88d07a21822e1084486f1d99ee1da7e61dd84b948cf41c01bcf97b.jpg) + +![](images/0853411d16d6ecaf2a19e7c8f838a59096cb5e2092f5e5d1b8b11c36d7fbbdd7.jpg) +HR (input) + +![](images/fbe9cb09e159744bc9e0c2465acc744a75c7e36526bf0872b7abc684c593b848.jpg) + +![](images/0580e0fe1406b279ebd274b97a910aa396fffd7f981a5db4b090f5d095595e1c.jpg) + +![](images/8b88d352ae1157aabf8ba72391c4975ec9d0cea274d88b3a7b970c1471c014e7.jpg) +EDSR w/o CutBlur $(\Delta)$ + +![](images/7c41c10b3d3dab9e9822b15171de5bc1663bc24c9f8c0bcdff7e6c90a68f3614.jpg) +EDSR w/ CutBlur $(\Delta)$ + +![](images/ab72409a42e92b3894f4f8e98084df9174c9b1951322f5c576e87ef09e6aee47.jpg) + +![](images/ddcdfe9671210a153a78cd8fcf7ccdef3d3de8bc7706593f9950760e70c95878.jpg) + +a mismatch between the image contents (e.g., Cutout and CutMix). Unlike Cutout, CutBlur can utilize the entire image information while it enjoys the regularization effect due to the varied samples of random HR ratios and locations. + +What does the model learn with CutBlur? Similar to the other DA methods that prevent classification models from over-confidently making a decision (e.g., label smoothing [21]), CutBlur prevents the SR model from oversharpening an image and helps it to super-resolve only the necessary region. This can be demonstrated by performing the experiments with some artificial setups, where we provide the CutBlur-trained SR model with an HR image (Figure 2) or CutBlurred LR image (Figure 3) as input. + +When the SR model takes HR images at the test phase, it commonly outputs over-sharpened predictions, especially where the edges are (Figure 2). CutBlur can resolve this issue by directly providing such examples to the model during the training phase. Not only does CutBlur mitigate the oversharpening problem, but it enhances the SR performance on the other LR regions, thanks to the regularization effect (Figure 3). Note that the residual intensity has significantly decreased in the CutBlur model. We hypothesize that this enhancement comes from constraining the SR model to discriminatively apply super-resolution to the image. Now the model has to simultaneously learn both "how" and "where" to super-resolve an image, and this leads the model to learn "how much" it should apply super-resolution, which provides a beneficial regularization effect to the training. + +Of course it is unfair to compare the models that have been trained with and without such images. However, we argue that these scenarios are not just the artificial experimental setups but indeed exist in the real-world (e.g., out-of-focus images). We will discuss this more in detail with several real examples in Section 4.3. + +CutBlur vs. Giving HR inputs during training. To make a model learn an identity mapping, instead of using CutBlur, one can easily think of providing HR images as an input of the network during the training phase. With the EDSR model, CutBlur trained model (29.04 dB) showed better + +![](images/9811d53c88f72008dc636e2a433c008a320cf3d84accaf2385cc3a7c3e145f36.jpg) +Figure 2. Qualitative comparison of the baseline with and without CutBlur when the network takes the HR image as an input during the inference time. $\Delta$ is the absolute residual intensity map between the network output and the ground-truth HR image. CutBlur successfully preserves the entire structure while the baseline generates unrealistic artifacts (left) or incorrect outputs (right). +HR + +![](images/a446949f6839bc3062cc608506e6141fdbde844ef25043a25704270fde5b321f.jpg) +EDSR w/o CutBlur (Δ) + +![](images/5231f1585f67d1a91384c579dd78952ae1461a16deeb3e0d1c7fb8ae5257ff41.jpg) + +w/o CutBlur $(\Delta)$ + +![](images/a451c28f68d064ca9725ee7637454bab932c7df5c4cc4517faee4c4cc122e22d.jpg) +LR (CutBlurred) +Figure 3. Qualitative comparison of the baseline and Cut-Blur model outputs when the input is augmented by CutBlur. $\Delta$ is the absolute residual intensity map between the network output and the ground-truth HR image. Unlike the baseline (top right), CutBlur model not only resolves the HR region but reduces $\Delta$ of the other LR input area as well (bottom right). + +![](images/8b4abb71466b9d3af7febef28171d2d1b19b22449590c4d574aa74ed638594dc.jpg) +EDSR w/CutBlur (Δ) + +![](images/6735115a92d16343f27b3493eef6a8e223378de0fcfb3de69447eb956903f2f8.jpg) + +performance in PSNR than naively providing the HR images (28.87 dB) to the network. (The detailed setups can be found in the supplementary material.) This is because Cut-Blur is more general in that HR inputs are its special case ( $\mathbf{M} = \mathbf{0}$ or $\mathbf{1}$ ). On the other hand, giving HR inputs can never simulate the mixed distribution of LR and HR pixels so that the network can only learn "how", not "where" to super-resolve an image. + +Mixture of augmentation (MoA). To push the limits of performance gains, we integrate various DA methods into a single framework. For each training iteration, the model first decides with probability $p$ whether to apply DA on inputs or not. If yes, it randomly selects a method among the DA pool. Based on our analysis, we use all the pixel-domain DA methods discussed in Table 1 while excluding all feature-domain DA methods. Here, we set $p = 1.0$ as a default. From now on, unless it is specified, we report all the experimental results using this MoA strategy. + +![](images/744b755ad1182169acc85209d36b897f29d9488064ea97e280734597f36da44f.jpg) + +![](images/c6cef3f9065024dc6f8c458c7b6fd13042405908111ff7b17b40c10c4d1a9968.jpg) + +![](images/7dc4acd766a057d8bb8821fe950f1b1e9d1ee5edd4d467f20e0fc1852da06c54.jpg) +(a) SRCNN (0.07M) +(c) RCAN (15.6M) +Figure 4. PSNR (dB) comparison on ten DIV2K $(\times 4)$ validation images during training for different data size $(\%)$ . Ours are shown by triangular markers. Zoomed curves are displayed (inlets). + +![](images/1f80e1c9f5b95959d3ef4ac0120b5d9a8df1d70b5204afdbef4678223fd42fba.jpg) +(b) CARN (1.14M) +(d) EDSR (43.2M) + +# 4. Experiments + +In this section, we describe our experimental setups and compare the model performance with and without applying our method. We compare the super-resolution (SR) performance under various model sizes, dataset sizes (Section 4.1), and benchmark datasets (Section 4.2). Finally, we apply our method to the other low-level vision tasks, such as Gaussian denoising and JPEG artifact removal, to show the potential extensibility of our method (Section 4.4).[23] + +Baselines. We use four SR models: SRCNN [8], CARN [3], RCAN [33], and EDSR [15]. These models have different numbers of parameters from 0.07M to 43.2M (million). For fair comparisons, every model is trained from scratch using the authors' official code unless mentioned otherwise. + +Dataset and evaluation. We use the DIV2K [2] dataset or a recently proposed real-world SR dataset, RealSR [4] for training. For evaluation, we use Set14 [28], Urban100 [14], Manga109 [17], and test images of the RealSR dataset. Here, PSNR and SSIM are calculated on the Y channel only except the color image denoising task. + +# 4.1. Study on different models and datasets + +Various model sizes. It is generally known that a large model benefits more from augmentation than a small model does. To see whether this is true in SR, we investigate how the model size affects the maximum performance gain using our strategy. Here, we set the probability of applying augmentations differently depending on the model size, $p = 0.2$ for the small models (SRCNN and CARN) and + +Table 2. PSNR (dB) comparison on DIV2K $(\times 4)$ validation set by varying the model and the size of dataset for training. Note that the number of RealSR dataset, which is more difficult to collect, is around $15\%$ of DIV2K dataset. + +
ModelParams.Training Data Size
100%50%25%15%10%
SRCNN + proposed0.07M27.9527.9527.9527.9327.91
-0.02-0.01-0.02-0.02-0.01
CARN + proposed1.14M28.8028.7728.7228.6728.60
+0.00+0.01+0.02+0.03+0.04
RCAN + proposed15.6M29.2229.0629.0128.9028.82
+0.08+0.16+0.11+0.13+0.14
EDSR + proposed43.2M29.2129.1028.9728.8728.77
+0.08+0.08+0.10+0.10+0.11
+ +$p = 1.0$ for the large models (RCAN and EDSR). With the small models, our proposed method provides no benefit or marginally increases the performance (Table 2). This demonstrates the severe underfitting of the small models, where the effect of DA is minimal due to the lacking capacity. On the other hand, it consistently improves the performance of RCAN and EDSR, which have enough capacity to exploit the augmented information. + +Various dataset sizes. We further investigate the model performance while decreasing the data size for training (Table 2). Here, we use $100\%$ , $50\%$ , $25\%$ , $15\%$ and $10\%$ of the DIV2K dataset. SRCNN and CARN show none or marginal improvements with our method. This can be also seen by the validation curves while training (Figure 4a and 4b). On the other hand, our method brings a huge benefit to the RCAN and EDSR in all the settings. The performance gap between the baseline and our method becomes profound as the dataset size diminishes. RCAN trained on half of the dataset shows the same performance as the $100\%$ baseline when applied with our method $(29.06 + 0.16 = 29.22\mathrm{dB})$ . Our method gives an improvement of up to $0.16\mathrm{dB}$ when the dataset size is less than $50\%$ . This tendency is observed in EDSR as well. This is important because $15\%$ of the DIV2K dataset is similar to the size of the RealSR dataset, which is more expensive taken under real environments. + +Our method also significantly improves the overfitting problem (Figure 4c and 4d). For example, if we use $25\%$ of the training data, the large models easily overfit and this can be dramatically reduced by using our method (denoted by curves with the triangular marker of the same color). + +# 4.2. Comparison on diverse benchmark dataset + +We test our method on various benchmark datasets. For the synthetic dataset, we train the models using the DIV2K dataset and test them on Set14, Urban100, and Manga109. Here, we first pre-train the network with $\times 2$ scale dataset, then fine-tune on $\times 4$ scale images. For the realistic case, we train the models using the training set of the RealSR dataset + +![](images/9e010a344ca20eca274cca14e4c53ffc9f2f3196c2474da216ce6c51d042bd1f.jpg) +Urban100: 004 + +![](images/d3e45f0e55416bd1507b66ddb5c7a1767bb227f6f025245f3d0de23d16666e34.jpg) +HR (PSNR/SSIM) + +![](images/d18b87b2fbbc0a51da1816dc80c46a40039e5f09d5040eb23583fb48d2400888.jpg) +CARN (Δ) (21.97/0.8127) + +![](images/2dd17f5473058ab7c84b16994cb18a61bf1389f1c848901b42e40297df1b4ae6.jpg) +EDSR $(\Delta)$ (23.04/0.8492) + +![](images/46b1a1c1c38d50b5fa440b7ac2121a9f5ce74bf6c9aa04606484f8e1a26c60d7.jpg) +RCAN $(\Delta)$ (23.64/0.8658) + +![](images/df1fd33855aeacd8b4c110ee804f5bb1932612b60b76944c7dc44d9f6c7a7af1.jpg) +Urban100: 073 + +![](images/2436dd3027ba84cbc74e8141bb86de3f48b6044c7ff1348d68d6f8a4760d4d71.jpg) +LR (19.81/0.6517) + +![](images/56960b21012c2ec37b5e7c78453bdd59a1a80c2c4b16087fc4d31250ea057a1d.jpg) +CARN + proposed (Δ) (22.04/0.8148) + +![](images/5f14d3bc62d6a5988ac2a91423f22b80a640df7b195ddc2be63dfeb3ea45b5e8.jpg) +EDSR + proposed (Δ) (24.13/0.8687) + +![](images/bd9cef269e8cb4b872ae182d1a50d5b713a9cf17f0da158049d4d16cf78c1322.jpg) +RCAN + proposed (Δ) (24.07/0.8704) + +![](images/8ddeac7089f054b6114432bb155b53a980f6e693cb4618ddd9347f0787204b35.jpg) + +![](images/d78841fd0d09ab4906a6c0d4f613b072a5c06c7caee7e584fef30a77e69df04c.jpg) +manga109: RisingGirl + +![](images/dd3b5876180f727e0dce79a2adcdd3e48359e0c34bc37b34743e56b12252502b.jpg) + +![](images/21e52095b95c4904739d2129e143542bb2a02ed147341b7b4b87a971d7848e87.jpg) +HR (PSNR/SSIM) +LR (18.20/0.4204) + +![](images/0164c70745e8fd1b62375e397c46130780ed54af1529b448f528d174a4665691.jpg) + +![](images/8f4ac64eae3872bfbb00f43dd229830f09db6ba321e894fd31006395614c1b48.jpg) +CARN (Δ) (18.71/0.5343) +CARN + proposed (Δ) (18.83/0.5347) + +![](images/6f331a0c130b54e345a0e68044e9eef0cef7083b9b298f4ab261a128683eabbc.jpg) + +![](images/3e9c288e8da35060103ee5da33feb497e0bb3dc6686985f1b97369126077ceb3.jpg) +EDSR $(\Delta)$ (19.08/0.5869) +EDSR + proposed (Δ) (19.86/0.6074) + +![](images/12983634a876f22d7da43f649fe0ccf8cb4a29d872a4e6107319793a2b4c144b.jpg) + +![](images/4cd4f72a9d54f038c822447bc1490d5aea9971d9d0e8f1cbe49f0b2dd36fdebf.jpg) +RCAN (Δ) (19.40/0.5843) +RCAN $^+$ proposed $(\Delta)$ (20.02/0.6085) + +![](images/656c69107d9fcb7808a63bab0f11045adef6175748205c588eb1d2b405aaee35.jpg) + +![](images/856ab597c812e56060192699b117cb0f6dad5f408a5085175bde2ca2a6fa7539.jpg) +RealSR: Canon010 + +![](images/9615f95d7b149d4d180a239bf91bd65011e3f67a23a8464b1973d7d9401ba2ad.jpg) + +![](images/7607998894942202f42f8a91bb21fdc6043fc98c6e132183facd4262cc21f438.jpg) +HR (PSNR/SSIM) +LR (22.99/0.7440) + +![](images/9576634adcd7cfdb049f130891bc0e9465db95ecaaa26ab1b7e961c2a94e933d.jpg) + +![](images/86142af8dc077b5598de7ce73a53077669a0023923b05046b7a8a471e0fa802d.jpg) +CARN (Δ) (27.29/0.8404) +CARN + proposed (Δ) (27.29/0.8402) + +![](images/fd9fbbdee571ace40be002ce2cb91cc2b43e79cd1bae4233211eaa9760070ee5.jpg) + +![](images/0eb2d7a92f4a962ad2923e62df8c7da6c47936729ea29f9318333de465d04297.jpg) +EDSR $(\Delta)$ (27.98/0.8546) +EDSR + proposed (Δ) (28.12/0.8579) + +![](images/f70aed311c46489b7be95f215a46eb923b089c215dbcdbadeba323289d8e542b.jpg) + +![](images/04911f2aa31ea996cb39f55619d83c03c22239d3610df21b99273e7f55f54f27.jpg) +RCAN $(\Delta)$ (27.77/0.8533) +RCAN + proposed (Δ) (28.10/0.8572) + +![](images/748361a7e8b3fed5135c1bbc5d895ddb28baf98b83caee80d015005563e6908c.jpg) + +![](images/621c880256da00adc343c828c24d0e8046c2f256ec30feef240ab061dca49049.jpg) +RealSR: Nikon011 +Figure 5. Qualitative comparison of using our proposed method on different datasets and tasks. $\Delta$ is the absolute residual intensity map between the network output and the ground-truth HR image. + +![](images/ab3d21bf7987404237b62c695ef6c99d441263367f1e3e45a7dcb0d8929dd449.jpg) +HR (PSNR/SSIM) + +![](images/b6c8f96bcca56fbcb520a6d70d8d9c1d35e702407005ac519b06c5e8c25de17b.jpg) +LR (23.21/0.7865) + +![](images/e58fcf70f4ba5e7dafa5f3eda4c6d2aa8c9034301d90fac921adbea102d38d12.jpg) +CARN (Δ) (24.69/0.8486) + +![](images/a88ff2462753ee0315085b915de76fb97ade0cc912fe1ccd1c37e04db1b1c664.jpg) +CARN + proposed (Δ) (25.13/0.8578) + +![](images/2dac1639f18b98cf6571e32c40a23556bb37cb8c003f37392bcc158ced70512f.jpg) +EDSR $(\Delta)$ (25.19/0.8575) + +![](images/cca8783cc2010ecaf50ac346cfb589eb222caf09a763488503018e6156f0880e.jpg) +EDSR + proposed (Δ) (25.54/0.8673) + +![](images/29f84e962198ca6c95e4e656c1644af6dc9fde4223eed4919929a58285771b56.jpg) +RCAN (Δ) (25.53/0.8669) + +![](images/0b3d93361046ce9528ec8ea959c7b41ad18259dc577e0521ba02de6afdb24e4c.jpg) +RCAN $^+$ proposed $(\Delta)$ (25.78/0.8693) + +![](images/d65f01e03555493e993af41d3a54db43fa5172950b82b5c34ff9cfe835933899.jpg) + +Table 3. Quantitative comparison (PSNR / SSIM) on SR (scale $\times 4$ ) task in both synthetic and realistic settings. $\delta$ denotes the performance gap between with and without augmentation. For synthetic case, we perform the $\times 2$ scale pre-training. + +
Model# Params.Synthetic (DIV2K dataset)Realistic (RealSR dataset)
Set14 (δ)Urban100 (δ)Manga109 (δ)RealSR (δ)
CARN + proposed1.14M28.48 (+0.00) / 0.778725.85 (+0.00) / 0.777930.17 (+0.00) / 0.903428.78 (+0.00) / 0.8134
28.48 (+0.00) / 0.778825.85 (+0.00) / 0.778030.16 (-0.01) / 0.903229.00 (+0.22) / 0.8204
RCAN + proposed15.6M28.86 (+0.00) / 0.787926.76 (+0.00) / 0.806231.24 (+0.00) / 0.916929.22 (+0.00) / 0.8254
28.92 (+0.06) / 0.789526.93 (+0.17) / 0.810631.46 (+0.22) / 0.919029.49 (+0.27) / 0.8307
EDSR + proposed43.2M28.81 (+0.00) / 0.787126.66 (+0.00) / 0.803831.06 (+0.00) / 0.915128.89 (+0.00) / 0.8204
28.88 (+0.07) / 0.788626.80 (+0.14) / 0.807231.25 (+0.19) / 0.916329.16 (+0.27) / 0.8258
+ +![](images/489a363a97f984fe73b41a925e69406bdc1c8b6aacdbdfa05864041fd6b16e01.jpg) +HR LR (input) + +![](images/5ea4affb089dcc5d7ca25221e5ebe7b55e13f79ba7aa76016ab6d93484f5e528.jpg) +HR +LR (input) + +![](images/b2d03f4f845c2d17632e862212c8c77ca82748d4d79eccab7e9003be8e408e49.jpg) +EDSR w/o CutBlur (Δ) + +![](images/a9ffca6af4defd9d20a8c01ac700503994ef41e78fdd9b89c91940754fa8a579.jpg) +EDSR w/o CutBlur (Δ) + +![](images/5194039190fa5c43c6dc0a8fdba642e05872b1afdba5d3db66769e493df5ce64.jpg) +EDSR w/CutBlur $(\Delta)$ +Figure 6. Qualitative comparison of the baseline and CutBlur model outputs. The inputs are the real-world out-of-focus photography ( $\times 2$ bicubic downsampled), which are taken from a web (left) and captured by iPhone 11 Pro (right). $\Delta$ is the absolute residual intensity map between the network output and the ground-truth HR image. The baseline model over-sharpens the focused region resulting in unpleasant distortions while the CutBlur model effectively super-resolves the image without such a problem. + +![](images/c916091283b08d07fd0bbc457db91f314ac56d9af5a4c89e507501b3b3b8ccf0.jpg) +EDSR w/CutBlur (Δ) + +$(\times 4$ scale) and test them on its unseen test images. + +Our proposed method consistently gives a huge performance gain, especially when the models have large capacities (Table 3). In the RealSR dataset, which is a more realistic case, the performance gain of our method becomes larger, increasing at least $0.22\mathrm{dB}$ for all models in PSNR. We achieve the SOTA performance (RCAN [33]) compared to the previous SOTA model (LP-KPN [4]: 28.92 dB / 0.8340). Note that our model increases the PSNR by 0.57 dB with a comparable SSIM score. Surprisingly, the lightest model (CARN [3]: 1.14M) can already beat the LP-KPN (5.13M) in PSNR with only $22\%$ of the parameters. + +Figure 5 shows the qualitative comparison between the models with and without applying our DA method. In the Urban100 examples (1st and 2nd rows in Figure 5), RCAN and EDSR benefit from the increased performance and successfully resolve the aliasing patterns. This can be seen more clearly in the residual between the model-prediction and the ground-truth HR image. Such a tendency is con + +sistently observed across different benchmark images. In RealSR dataset images, even the performance of the small model is boosted, especially when there are fine structures (4th row in Figure 5). + +# 4.3. CutBlur in the wild + +With the recent developments of devices like iPhone 11 Pro, they offer a variety of features, such as portrait images. Due to the different resolutions of the focused foreground and the out-focused background of the image, the baseline SR model shows degraded performance, while the CutBlur model does not (Figure 6). These are the very real-world examples, which are simulated by CutBlur. The baseline model adds unrealistic textures in the grass (left, Figure 6) and generates ghost artifacts around the characters and coin patterns (right, Figure 6). In contrast, the CutBlur model does not add any unrealistic distortion while it adequately super-resolves the foreground and background of the image. + +Table 4. Performance comparison on the color Gaussian denoising task evaluated on the Kodak24 dataset. We train the model with both mild $(\sigma = 30)$ and severe noises $(\sigma = 70)$ and test on the mild setting. LPIPS [31] (lower is better) indicates the perceptual distance between the network output and the ground-truth. + +
ModelTrain σTest (σ = 30)
PSNR ↑SSIM ↑LPIPS ↓
EDSR + proposed3031.920.87160.136
+0.02+0.0006-0.004
EDSR + proposed7027.380.72950.375
-2.51+0.0696-0.193
+ +Table 5. Performance comparison on the color JPEG artifact removal task evaluated on the LIVE1 [18] dataset. We train the model with both mild $(q = 30)$ and severe compression $(q = 10)$ and test on the mild setting. + +
ModelTrain qTest (q = 30)
PSNR ↑SSIM ↑LPIPS ↓
EDSR + proposed3033.950.92270.118
-0.01-0.0002+0.001
EDSR + proposed1032.450.89920.154
+0.97+0.0187-0.023
+ +# 4.4. Other low-level vision tasks + +Interestingly, we find that our method also gives similar benefits when applied to the other low-level vision tasks. We demonstrate the potential advantages of our method by applying it to the Gaussian denoising and JPEG artifact removal tasks. For each task, we use EDSR as our baseline and trained the model from scratch with the synthetic DIV2K dataset with the corresponding degradation functions. We evaluate the model performance on the Kodak24 and LIVE1 [18] datasets using PSNR (dB), SSIM, and LPIPS [31]. Please see the appendix for more details. + +Gaussian denoising (color). We generate a synthetic dataset using Gaussian noise of different signal-to-noise ratios (SNR); $\sigma = 30$ and 70 (higher $\sigma$ means stronger noise). Similar to the over-sharpening issue in SR, we simulate the over-smoothing problem (bottom row, Table 4). The proposed model has lower PSNR (dB) than the baseline but it shows higher SSIM and lower LPIPS [31], which is known to measure the perceptual distance between two images (lower LPIPS means smaller perceptual difference). + +In fact, the higher PSNR of the baseline model is due to the over-smoothing (Figure 7). Because the baseline model has learned to remove the stronger noise, it provides the over-smoothed output losing the fine details of the image. Due to this over-smoothing, its SSIM score is significantly lower and LPIPS is significantly higher. In contrast, the proposed model trained with our strategy successfully denoises the image while preserving the fine structures, which demonstrates the good regularization effect of our method. + +![](images/9369765826cf776750c78c9153c9306d5dacbae2024774841a305c668d3fcd54.jpg) +High quality (PSNR/SSIM/LPIIPS) + +![](images/938b393b0f96ec650032e41392192a2f3b32743e6b96362fa09f802df624ede3.jpg) +Low quality $(\sigma = 30)$ (18.88, 0.4716 / 0.446) + +![](images/7991aafe58ba5dd29aa9f2587a6fb9fbcb3150974977ba47054558f7280d6769.jpg) +Baseline +(23.38 / 0.5375 / 0.598) +Figure 7. Comparison of the generalization ability in the denoising task. Both the baseline and the proposed method are trained using $\sigma = 70$ (severe) and tested with $\sigma = 30$ (mild). Our proposed method effectively recovers the details while the baseline oversmooths the input resulting in a blurry image. + +![](images/ba596e7b6b21213f487ef5230f7a5db986bfd44bb4ad3a133695eb313501f3a8.jpg) +Proposed +(23.14/0.7630/0.191) + +JPEG artifact removal (color). We generate a synthetic dataset using different compression qualities, $q = 10$ and 30 (lower $q$ means stronger artifact) on the color image. Similar to the denoising task, we simulate the over-removal issue. Compared to the baseline model, our proposed method shows significantly better performance in all metrics we used (bottom row, Table 5). The model generalizes better and gives 0.97 dB performance gain in PSNR. + +# 5. Conclusion + +We have introduced CutBlur and Mixture of Augmentations (MoA), a new DA method and a strategy for training a stronger SR model. By learning how and where to super-resolve an image, CutBlur encourages the model to understand how much it should apply the super-resolution to an image area. We have also analyzed which DA methods hurt SR performance and how to modify those to prevent such degradation. We showed that our proposed MoA strategy consistently and significantly improves the performance across various scenarios, especially when the model size is big and the dataset is collected from real-world environments. Last but not least, our method showed promising results in denoising and JPEG artifact removals, implying its potential extensibility to other low-level vision tasks. + +Acknowledgement. We would like to thank Clova AI Research team, especially Yunjay Choi, Seong Joon Oh, Youngjung Uh, Sangwoo Yun, Dongyoon Han, Youngjoon Yoo, and Jung-Woo Ha for their valuable comments and feedback. This work was supported by Naver Corp and also by the National Research Foundation of Korea grant funded by the Korea government (MSIT) (no.NRF2019R1A2C1006608) + +# References + +[1] Abdelrahman Abdelhamed, Stephen Lin, and Michael S Brown. A high-quality denoising dataset for smartphone cameras. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1692-1700, 2018. 1 +[2] Eirikur Agustsson and Radu Timofte. Ntire 2017 challenge on single image super-resolution: Dataset and study. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, July 2017. 2, 3, 5 +[3] Namhyuk Ahn, Byungkon Kang, and Kyung-Ah Sohn. Fast, accurate, and lightweight super-resolution with cascading residual network. In Proceedings of the European Conference on Computer Vision (ECCV), pages 252-268, 2018. 5, 7 +[4] Jianrui Cai, Hui Zeng, Hongwei Yong, Zisheng Cao, and Lei Zhang. Toward real-world single image super-resolution: A new benchmark and a new model. arXiv preprint arXiv:1904.00523, 2019. 1, 2, 3, 5, 7 +[5] Junsuk Choe and Hyunjung Shim. Attention-based dropout layer for weakly supervised object localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2219-2228, 2019. 2, 3 +[6] 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. 2 +[7] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 1, 2, 3 +[8] Chao Dong, Chen Change Loy, Kaiming He, and Xiaou Tang. Image super-resolution using deep convolutional networks. IEEE transactions on pattern analysis and machine intelligence, 38(2):295-307, 2015. 1, 5 +[9] Ruicheng Feng, Jinjin Gu, Yu Qiao, and Chao Dong. Suppressing model overfitting for image super-resolution networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 0-0, 2019. 1, 2 +[10] Xavier Gastaldi. Shake-shake regularization. arXiv preprint arXiv:1705.07485, 2017. 1, 2 +[11] Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A regularization method for convolutional networks. In Advances in Neural Information Processing Systems, pages 10727-10737, 2018. 1, 2, 3 +[12] Shuhang Gu, Wangmeng Zuo, Qi Xie, Deyu Meng, Xi-angchu Feng, and Lei Zhang. Convolutional sparse coding for image super-resolution. In Proceedings of the IEEE International Conference on Computer Vision, pages 1823–1831, 2015. 1 +[13] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019. 1 +[14] Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5197-5206, 2015. 5 + +[15] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Young Mu Lee. Enhanced deep residual networks for single image super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 136-144, 2017. 2, 3, 5 +[16] Sungbin Lim, Ildoo Kim, Taesup Kim, Chiheon Kim, and Sungwoong Kim. Fast autoaugment. arXiv preprint arXiv:1905.00397, 2019. 2 +[17] Yusuke Matsui, Kota Ito, Yuji Aramaki, Azuma Fujimoto, Toru Ogawa, Toshihiko Yamasaki, and Kiyoharu Aizawa. Sketch-based manga retrieval using manga109 dataset. Multimedia Tools and Applications, 76(20):21811-21838, 2017. 5 +[18] HR Sheikh. Live image quality assessment database release 2. http://live.ece.utexas.edu/research/quality, 2005. 8 +[19] 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. 2 +[20] Nako Sung, Minkyu Kim, Hyunwoo Jo, Youngil Yang, Jingwoong Kim, Leonard Lausen, Youngkwan Kim, Gayoung Lee, Donghyun Kwak, Jung-Woo Ha, et al. Nsml: A machine learning platform that enables you to focus on your models. arXiv preprint arXiv:1712.05902, 2017. 5 +[21] 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. 4 +[22] Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, and Lei Zhang. Ntire 2017 challenge on single image super-resolution: Methods and results. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 114-125, 2017. 1 +[23] Radu Timofte, Vincent De Smet, and Luc Van Gool. A+: Adjusted anchored neighborhood regression for fast superresolution. In Asian conference on computer vision, pages 111-126. Springer, 2014. 1 +[24] Radu Timofte, Rasmus Rothe, and Luc Van Gool. Seven ways to improve example-based single image super resolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1865-1873, 2016. 1, 2 +[25] Jonathan Tompson, Ross Goroshin, Arjun Jain, Yann LeCun, and Christoph Bregler. Efficient object localization using convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 648-656, 2015. 2, 3 +[26] Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitlagkas, Aaron Courville, David Lopez-Paz, and Yoshua Bengio. *Manifold mixup: Better representations by interpolating hidden states.* arXiv preprint arXiv:1806.05236, 2018. 1, 2 +[27] Yoshihiro Yamada, Masakazu Iwamura, Takuya Akiba, and Koichi Kise. Shakedrop regularization for deep residual learning. arXiv preprint arXiv:1802.02375, 2018. 1, 2 +[28] Jianchao Yang, John Wright, Thomas S Huang, and Yi Ma. Image super-resolution via sparse representation. IEEE + +transactions on image processing, 19(11):2861-2873, 2010. 5 +[29] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. arXiv preprint arXiv:1905.04899, 2019. 1, 2, 3 +[30] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 1, 2, 3 +[31] 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. 8 +[32] 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. 1 +[33] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 286-301, 2018. 5, 7 +[34] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. arXiv preprint arXiv:1708.04896, 2017. 2 \ No newline at end of file diff --git a/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/images.zip b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b3e3dfb404652bf988fc68bf4069d47e8a47759e --- /dev/null +++ b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:159c2d517763cd7a9ed4ea80bfc59664e39b1e80fe52d80e2493a6eebf8922b4 +size 1037610 diff --git a/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/layout.json b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d5135901540be2787395b5eeca601861f53ca86e --- /dev/null +++ b/rethinkingdataaugmentationforimagesuperresolutionacomprehensiveanalysisandanewstrategy/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6269ff15a8a1607ce67136f9b5e406946079c4f95689693b7cc87d47f263c0e +size 566865 diff --git a/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_content_list.json b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..998a928eb268b65c0765c40b26e78b0bd021cec5 --- /dev/null +++ b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d5db640d53b7778bab74a3fb441f4720fd3bed7f95ee229ff8b6e5e655723f2 +size 78897 diff --git a/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_model.json b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ab7502070204afc090762b83002adf354d7adb5e --- /dev/null +++ b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b42c4405a687c25907f1efd27561cebd54ab072d42526a98eb7a147544e7ad6a +size 96071 diff --git a/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_origin.pdf b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c3c13fb9be4a3b1a41979bec2271707ffa6fd257 --- /dev/null +++ b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/b7544196-a325-427c-aa3d-82cc4a50b918_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b094449cd8af56ca7087fa22363fa3f483d835dc5bc6adfbf08a44af98df9d1a +size 612427 diff --git a/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/full.md b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..56d16d65909c3c01d3d8eea83015d4733ee803a8 --- /dev/null +++ b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/full.md @@ -0,0 +1,344 @@ +# Rethinking Depthwise Separable Convolutions: How Intra-Kernel Correlations Lead to Improved MobileNets + +Daniel Haase* + +ZEISS Microscopy + +daniel.haase@zeiss.com + +Manuel Amthor* + +ZEISS Microscopy + +manuel.amthor@zeiss.com + +# Abstract + +We introduce blueprint separable convolutions (BSConv) as highly efficient building blocks for CNNs. They are motivated by quantitative analyses of kernel properties from trained models, which show the dominance of correlations along the depth axis. Based on our findings, we formulate a theoretical foundation from which we derive efficient implementations using only standard layers. Moreover, our approach provides a thorough theoretical derivation, interpretation, and justification for the application of depthwise separable convolutions (DSCs) in general, which have become the basis of many modern network architectures. Ultimately, we reveal that DSC-based architectures such as MobileNets implicitly rely on cross-kernel correlations, while our BSConv formulation is based on intrakernel correlations and thus allows for a more efficient separation of regular convolutions. Extensive experiments on large-scale and fine-grained classification datasets show that BSCnvs clearly and consistently improve MobileNets and other DSC-based architectures without introducing any further complexity. For fine-grained datasets, we achieve an improvement of up to 13.7 percentage points. In addition, if used as drop-in replacement for standard architectures such as ResNets, BSCnv variants also outperform their vanilla counterparts by up to 9.5 percentage points on ImageNet. + +# 1. Introduction + +Convolutional neural networks (CNNs) [27, 26] have become the basis of practically all state-of-the-art approaches for image classification, object detection [5], semantic segmentation [30], and many other applications. In the past, improvements of CNNs were mainly driven by increasing the model capacity, while at the same time ensuring a proper training behavior [20, 13, 14]. Recently, this has led to the development of models with half a billion parameters [18]. In practical applications, however, the computational ca + +![](images/b32a273ebe0bce41d67f74eaa7be42d309d689347f44d5e7eae0dca66717043c.jpg) +Figure 1. We introduce blueprint separable convolutions (BSConv) as highly efficient building block for CNNs. BSCnv exploits correlations of CNN kernels along their depth axis. In consequence, BSCnv represents each filter kernel using one 2d blueprint kernel which is distributed along the depth axis using a weight vector. + +pacity is often limited, especially in mobile and automotive contexts. This fact has led to another important research direction which focuses on improving model efficiency. The most prominent approaches are based on depthwise separable convolutions (DSCs) [37, 16]—building blocks which are motivated by exploiting redundancies of filter weights. + +Based on quantitative and qualitative analyses of trained CNNs, in Section 3 we propose blueprint separable convolutions (BSConv), which follow this path of research. The main idea of BSConv is to exploit that kernels of CNNs usually show high redundancies along their depth axis (i.e., intra-kernel correlations). Thus, BSConv represents each filter kernel using one 2d blueprint which is distributed along the depth axis using a weight vector (see Figure 1). + +Although DSCs are also motivated by intra-kernel correlations [37], in Section 4 we show that their derived order of operations contradicts this assumption and is reversed compared to our BSConv solution. In fact, the DSC result is equivalent to assuming redundancies between kernels (i.e., cross-kernel correlations, see Figure 5), which was shown + +![](images/6d4861eefe24e546317534a614efe4e695b8472af5d079463e47f8b9999efb59.jpg) +Figure 2. Exemplary filter weights of a vanilla VGG-19, Inception v2, and ResNet-50 CNN trained on ImageNet. For each of the three CNN architectures, one filter kernel of size $M \times K \times K = 128 \times 3 \times 3$ is visualized, split into 128 images. The weights of each filter kernel are highly correlated along the depth axis. Concretely, most slices show the same filter-specific $3 \times 3$ 'blueprint', only scaled by different factors (including negative factors which cause 'inverted' versions of the blueprint). While only three slices are highlighted for each kernel, the correlation is visible for far more slices (52/128 for the ResNet-50 example). This observation is the motivation for our proposal of blueprint separable convolutions (BSConv), which inherently represent a filter kernel of size $M \times K \times K$ using one blueprint kernel of size $K \times K$ and a set of $M$ multiplicative factors used to distribute the blueprint across the depth axis. + +![](images/f900700cb77bdbdae3d87d4293b2f2022aed834cdebc69fbcee9d2b862d8861c.jpg) + +![](images/9979ca4fab49362dbbf7c628b40a72e0e2656570dd780a482fc2d363733712f4.jpg) + +to be less effective when separating convolutions [7]. In addition, a natural extension of BSConv leads to an interpretation and justification for DSCs with linear bottlenecks [35], which are extensively used in many recent models [15, 40, 41]. Our solution, however, directly implies the use of an additional regularization loss to improve the subspace transform implicitly performed by these bottlenecks. + +In Section 5, we thoroughly demonstrate that BSCov consistently outperforms DSC-based architectures such as MobileNets on a wide variety of large-scale and fine-grained datasets at the same parameter and time complexity. Furthermore, BSCov can be used as drop-in replacement for standard convolution layers and can be applied to other architectures as well, leading to performance gains while drastically increasing model efficiency. + +# 2. Related Work + +Numerous approaches exist to improve the efficiency of CNNs. One example is model pruning, where filters and/or connections are removed from CNNs during or after model training [10, 28, 11, 29]. Closely related and often combined are quantization [33, 47, 19] and compression techniques [6, 9, 8] to accelerate model inference. + +Another relevant research area is efficiency-driven CNN architecture search. It can be performed manually [12] or automatically, e.g. via genetic algorithms [43] or via reinforcement learning in the form of neural architecture search [48, 1]. The latter is the basis for the most recent advances in building efficient models such as MnasNet [40], MobileNetV3 [15], and EfficientNet [41]. + +Building blocks typically consist of activation, normalization, and convolution operations, where the latter bear the greatest potential for efficiency optimizations. Redundancies in convolution weights of trained CNNs are ana- + +lyzed in [3, 37, 36, 7]. Approaches to reduce these redundancies are for instance low-rank approximations of the filter kernels [4, 21, 22] and the usage of grouped convolutions [46, 31, 44]. In [37], DSCs are introduced, which form the basis for practically all recent efficient network architectures. Their direct application can for instance be found in MobileNetV1 [16], factorized CNNs [42], and Xception [2]. An extension of DSCs are inverted residual bottlenecks which are introduced in MobileNetV2 [35]. They are used in state-of-the-art efficient architectures, including MnasNet [40], MobileNetV3 [15], and EfficientNet [41]. + +# 3. Blueprint Separable Convolutions (BSConv) + +In standard CNNs, each convolution layer transforms an input tensor $U$ of size $M \times Y \times X$ into an output tensor $V$ of size $N \times Y \times X$ by applying convolution kernels $F^{(1)}, \ldots, F^{(N)}$ , each of size $M \times K \times K$ such that + +$$ +V _ {n,:,:} = U * F ^ {(n)} \tag {1} +$$ + +with $n \in \{1, \dots, N\}$ (see Figure 1, top row). The entries (or 'weights') of these $N$ kernels are optimized during the training stage of CNNs via backpropagation and may take arbitrary values. However, in the following we show that in practice these weights often converge towards a state in which they show a substantial amount of correlation. We analyze these correlations qualitatively and quantitatively, and then derive a new, parameter- and time-efficient version of convolution layers for CNNs based on our findings. + +# 3.1. Intra-Kernel Correlations in Standard CNNs + +In this paper we focus on intra-kernel correlations and their potential for the design of parameter- and time-efficient CNNs. We start with a qualitative analysis of intra-kernel correlations by visualizing filters of trained CNNs. + +![](images/47d339eec19debab2544379d0b2bcb516c7fa06b038ebd91b072ba7a0a83c0f4.jpg) +Figure 3. Histogram of the variance along the depth axis of filter kernels which can be explained using only one principal component per filter. The filters are grouped by convolution stages (stage 1: blue, stage 2: orange, stage 3: green, stage 4: red). These quantitative results show that a large portion of CNN filters can potentially be represented using our BSConv formulation. This figure is best viewed in color. + +![](images/06b21332cdbbc004ce1266dbc73f8f340ebc65ff463e2914ff55e79b38ca846f.jpg) + +![](images/567593c7b2f1b99756a0ed4358905bb9da4bce13445f06b823da9df6e6b2d801.jpg) + +Figure 2 shows exemplary filter kernels for three established CNN architectures trained on the ImageNet dataset—namely VGG-19 [38], Inception v2 [20], and ResNet-50 [13, 14]. From these visualizations, it can be seen that intrakernel correlations exist along the depth axis. Concretely, it often seems that for a filter $F^{(n)}$ , its slices $F_{1,:,:}^{(n)}, \ldots, F_{M,:,:}^{(n)}$ show the same filter-specific $K \times K$ 'blueprint', only scaled by different factors (including negative factors which cause 'inverted' versions of the blueprint). + +While Figure 2 shows only a small subset of filter kernels, the described property of filter slices being based on a 'blueprint' are by no means an exception. According to our observations, it occurs consistently across different CNN architectures, training settings, and datasets. To systematically quantify to which extent filter kernels show this behavior, we analyze several trained CNNs in the following way: For each individual filter of the CNN, we (i) split the $M \times K \times K$ kernel into $M$ samples of size $K \times K$ , (ii) perform principal component analysis (PCA) on the set of $M$ samples, and (iii) determine the variance of the filter kernel which is explained by the first principal component (PC1). Using this approach, we can quantify how well each filter is representable by a $K \times K$ filter-specific blueprint (which in this case corresponds to PC1) and $M$ factors (which in this case are the 'scores' obtained via PCA). We aggregate these individual values into histograms, which are shown in Figure 3 for the same vanilla CNNs used in Figure 2. It can be seen that on average, about $50\%$ of each filter kernel's variance can be explained using this simple model, suggesting a large potential for efficiency improvements. + +# 3.2. From Correlations to BSConv + +The analysis in Section 3.1 suggests that for trained vanilla CNNs, each $M \times K \times K$ filter can be approximated using a $K \times K$ blueprint and $M$ factors which 'distribute' the blueprint along the depth dimension. Even though it is by no means enforced during training, this approximation explains a large portion of the observed variance. This + +finding is the motivation for the introduction of blueprint separable convolutions (BSConv). They are defined in such a way that above approximation turns into an integral property of the filters of CNNs. Concretely, we define each filter kernel $F^{(n)}$ to be represented using a blueprint $B^{(n)}$ and the weights $w_{n,1},\ldots ,w_{n,M}\in \mathbb{R}$ via + +$$ +F _ {m,:,:} ^ {(n)} = w _ {n, m} \cdot B ^ {(n)}, \tag {2} +$$ + +with $m \in \{1, \dots, M\}$ and $n \in \{1, \dots, N\}$ (see Figure 1, bottom row). While this definition poses a hard constraint on the filter kernels, in Section 5 we experimentally show that CNNs trained with BSConv can reach the same or even better quality in comparison to their vanilla counterparts. However, in contrast to standard convolution layers which have $M \cdot N \cdot K^2$ free parameters (see Figure 1), the BSConv variant only has $N \cdot K^2$ parameters for the blueprints, and $M \cdot N$ parameters for the weights. As is discussed below, the latter can be reduced even further. + +# 3.3. Variants and Implementations + +A BSCnv module consists of $N$ filters, each having one blueprint and $M$ weights. All $M \cdot N$ weights can be combined into the matrix $W = (w_{n,m})$ . Depending on how $W$ is learned in the training step, different BSCnv variants can be derived. In the following, two variants are described. + +# 3.3.1 Unconstrained BSConv (BSConv-U) + +In the most general case, the weights $W$ can vary without any constraints and are learned directly via backpropagation, just like the entries of the blueprint filter kernels. + +As shown in Figure 1, a naive implementation can be achieved by constructing a full kernel from each blueprint and performing a regular convolution afterwards. However, to derive a much more efficient implementation for CNNs, we rewrite Equation (1) in the following way: Firstly, because the input data tensor $U$ and the filter kernels $F^{(1)},\ldots ,F^{(N)}$ have the same size $M$ along their depth dimension, we can split each 3d convolution into a sum of $M$ + +![](images/f1317893a69c2257ca83f71d1698d983ad756ac1fe3b4f875687a14064383373.jpg) +Figure 4. Computational graphs for the efficient implementation of the different BSConv variants (see Sections 3.3.1 and 3.3.2). + +2d convolutions, yielding + +$$ +V _ {n,:,:} = U * F ^ {(n)} = \sum_ {m = 1} ^ {M} \left(U _ {m,:,: *} * F _ {m,:,:} ^ {(n)}\right). \tag {3} +$$ + +Secondly, we can replace each filter with its BSConv representation as given in Equation (2), and obtain + +$$ +V _ {n, \therefore :} = \sum_ {m = 1} ^ {M} \left(U _ {m, \therefore :} * \left(w _ {n, m} \cdot B ^ {(n)}\right)\right). \tag {4} +$$ + +Because (i) each filter blueprint $B^{(n)}$ is independent of the input channel $m$ , and (ii) $w_{n,m}$ is a scalar, we can rearrange above equation into + +$$ +V _ {n,:,:} = \underbrace {\left(\sum_ {m = 1} ^ {M} U _ {m , : , :} \cdot w _ {n , m}\right)} _ {V _ {n,:,:} ^ {\prime}} * B ^ {(n)}. \tag {5} +$$ + +If we further rearrange $w_{n,1}, \ldots, w_{n,M}$ into a $M \times 1 \times 1$ array $\tilde{w}_n$ , the sum can be replaced by a convolution, giving + +$$ +V _ {n,:,:} ^ {\prime} = U * \tilde {w} _ {n} \tag {6} +$$ + +$$ +V _ {n, \vdots ; \vdots} = V _ {n, \vdots ; \vdots} ^ {\prime} * B ^ {(n)}. \tag {7} +$$ + +For a concrete implementation, these Equations (6) and (7) can directly be translated into two tensor operations: (i) a $1 \times 1$ pointwise convolution with the kernels $\tilde{w}_1, \ldots, \tilde{w}_N$ , which is performed on the input data tensor $U$ , and (ii) a $K \times K$ depthwise convolution [16, 20] with kernels $B^{(1)}, \ldots, B^{(N)}$ , which is applied to the result of the first step. A flowchart visualization of these steps is given in Figure 4. + +# 3.3.2 Subspace BSConv (BSConv-S) + +For CNNs trained with BSConv-U convolution layers, the free parameters to be estimated are the $N$ blueprint ker + +nel matrices and the weight matrix $W = (w_{n,m})$ of size $N \times M$ . When analyzing the structure of the weight matrices $W$ of such CNNs, we observe that the rows of $W$ are often highly correlated. This fact indicates the potential for a further regularization and parameter reduction. + +Concretely, we perform a low-rank approximation of $W$ by factorizing it into the $N \times M'$ matrix $W^{A} = (w_{n,m'}^{A})$ and the $M' \times M$ matrix $W^{B} = (w_{m',m}^{B})$ as + +$$ +W = W ^ {A} \cdot W ^ {B}, \tag {8} +$$ + +with $M' = \lceil p \cdot M \rceil$ , while $p \in (0.0, 1.0)$ specifies the size of the subspace $M'$ in relation to the size $M$ of the original space. The matrix $W^B$ can be thought of as a set of $M'$ basis vectors, while $W^A$ is the subspace version of $W$ . Instead of $N \cdot M$ weights as for the case of BSCov-U, this method reduces the parameter count to $N \cdot M' + M' \cdot M$ , as only $W^A$ and $W^B$ have to be learned via backpropagation. + +To minimize redundancies in the low-rank subspace, we want the basis defined by $W^{B}$ to be orthonormal. This can be achieved via the regularization loss + +$$ +L _ {\text {o r t h o}} = \left\| W ^ {B} W ^ {B ^ {\mathrm {T}}} - I \right\| _ {\mathrm {F}}, \tag {9} +$$ + +where $I$ is the identity matrix and $\| \cdot \|_{\mathrm{F}}$ the Frobenius norm of a matrix. The regularization loss is added to the classification loss $L_{\mathrm{class}}$ with the weighting factor $\alpha$ , resulting in the joint loss $L = L_{\mathrm{class}} + \alpha L_{\mathrm{ortho}}$ . + +To derive an efficient implementation of BSCov-S, we can substitute $w_{n,m} = \sum_{m' = 1}^{M'}w_{n,m'}^A\cdot w_{m',m}^B$ in Equation (5), yielding + +$$ +V _ {n, \therefore :} = \left(\sum_ {m = 1} ^ {M} U _ {m, \therefore :} \cdot \left(\sum_ {m ^ {\prime} = 1} ^ {M ^ {\prime}} w _ {n, m ^ {\prime}} ^ {A} \cdot w _ {m ^ {\prime}, m} ^ {B}\right)\right) * B ^ {(n)}. \tag {10} +$$ + +Using the same arguments as in Section 3.3.1, we can rearrange this equation into + +$$ +V _ {n, \vdots ,:} = \overbrace {\left(\sum_ {m ^ {\prime} = 1} ^ {M ^ {\prime}} \underbrace {\left(\sum_ {m = 1} ^ {M} U _ {m , \vdots , :} \cdot w _ {m ^ {\prime} , m} ^ {B}\right)} _ {U _ {m ^ {\prime}, \vdots ,}:} \cdot w _ {n , m ^ {\prime}} ^ {A}\right)} ^ {V _ {n, \vdots ,:} ^ {\prime}} * B ^ {(n)}. \tag {11} +$$ + +By rearranging the weights $w_{m',1}^{B}, \ldots, w_{m',M}^{B}$ into the $M \times 1 \times 1$ array $\tilde{w}_{m'}^{B}$ and the weights $w_{n,1}^{A}, \ldots, w_{n,M'}^{A}$ into the $M' \times 1 \times 1$ array $\tilde{w}_{n}^{A}$ , the sums can be replaced by convolutions in the same way as in Section 3.3.1, and we obtain + +$$ +U _ {m ^ {\prime}, \therefore ;} ^ {\prime} = U * \tilde {w} _ {m ^ {\prime}} ^ {B} \tag {12} +$$ + +$$ +V _ {n, \therefore , \therefore} ^ {\prime} = U ^ {\prime} * \tilde {w} _ {n} ^ {A} \tag {13} +$$ + +$$ +V _ {n, \therefore ;} = V _ {n, \therefore} ^ {\prime} * B ^ {(n)}. \tag {14} +$$ + +Again, Equations (12) to (14) directly translate into tensor operations, thus a concrete implementation of BSConv-S is + +a three-step process: (i) the input tensor is projected into a $M^{\prime}$ -dimensional subspace via a $1\times 1$ pointwise convolution with kernels $\tilde{w}_1^B,\ldots ,\tilde{w}_{M'}^B$ , (ii) another $1\times 1$ pointwise convolution with kernels $\tilde{w}_1^A,\ldots ,\tilde{w}_N^A$ is applied to the result of the first step, and (iii) a $K\times K$ depthwise convolution with kernels $B^{(1)},\ldots ,B^{(N)}$ is applied to the result of step two (see Figure 4 for a visualization). + +# 4. Rethinking Depthwise Separable Convolutions + +In the following, we show how the derived variants of BSCnv are related to both most important building blocks for mobile models, i.e. depthwise separable convolutions and linear inverted residual bottlenecks. Moreover, we demonstrate how current model architectures can easily be equipped with our improved building blocks. As we will see in our experiments in Section 5, BSCnv variants substantially outperform their vanilla counterparts. + +# 4.1. BSCnv-U is a Reversed Depthwise Separable Convolution + +Although the derivation of DSCs in [37] is based on the same observation of kernel correlations along the depth axis, they obtain a reversed order of depthwise and pointwise convolution layers compared to BSConv (see Figure 4). This is because DSC in fact enforces cross-kernel correlations instead of intra-kernel correlations. Using our formulation in Section 3.3, this can be verified by setting Equation (2) to $F_{m,::}^{(n)} = w_{n,m} \cdot B_{m,::}^{\prime}$ . This case corresponds to having a single 3d $M \times K \times K$ blueprint kernel $B^{\prime}$ , which is replicated along the width axis, i.e. across kernels (see Figure 5). While both cross-kernel and intrakernel correlations are valid assumptions, in [7] it is shown that the latter dominate and thus have a larger potential for an efficient separation. This becomes even more obvious given that natural images are inherently correlated along the depth axis, which propagates through all layers. + +The MobileNetV1 architecture can be translated to a BSConv-U model by simply substituting all DSCs by BSConv-U building blocks, which effectively means switching the order depthwise and pointwise convolutions. However, the inversion of the layer order should have no substantial effect on the middle flow of the network, since we already have alternating point- and depthwise convolutions. The main difference comes from the entry flow: with our approach, feature maps from the first regular convolution can be fully utilized by the depthwise convolution via the preceding pointwise distribution. In contrast, each kernel of the first depthwise convolution of the original MobileNetV1 model can only benefit from a single feature map, leading to limited expressiveness. Following our derivation, for the BSConv-U version of MobileNetV1, no + +![](images/616d08d856a03633befe36ac4be81cf76a859b3df5894691a8429fb81271b67b.jpg) +Figure 5. Interpretations for DSC and BSConv. DSCs implicitly assume one 3d blueprint which is used for all kernels, while BSConv relies on individual 2d blueprints for each kernel. + +activation nor normalization is applied after the pointwise convolutions, since it is essential to allow the weights $w_{n,m}$ to be negative. + +# 4.2. BSCnv-S is a Shifted Linear Bottleneck with Orthonormal Regularization + +Linear bottlenecks with inverted residual skips were first introduced in [35] as a highly efficient building block providing impressive expressiveness at a minimum amount of required operations. It follows the idea of regularizing bottlenecks in very large ResNets and became the de facto standard in most of the current state-of-the-art mobile architectures such as MobileNetV2 and MobileNetV3. A single block consists of a cascade of a pointwise, a depthwise, and a pointwise convolution where the bottleneck is placed between blocks. Considering BSConv-S, we can see the close relationship when shifting our cascade of two pointwise and one depthwise convolution within a block to obtain a pointwise, a depthwise, and a pointwise convolution. Thus, MobileNetV2 and V3 can be reinterpreted as a BSConv model with subspace transforms. As found by [35], the shift of residual skips into the bottleneck provides superior model performance and we keep that idea also for our implementation of MobileNets equipped with BSConv-S. Following our derivation in Section 3.3.2, the linear bottleneck, i.e. without the use of an activation function, comes quite natural since negative components are equally essential as positive ones for the subspace transform. Note that this implies that the first bottleneck block does not apply a subspace transform while the last feature map before the final classification layer is in fact compressed. Most importantly, BSConv-S models greatly benefit from our theoretical findings concerning the application of the orthonormal regularization during training. Note that the conversion to a BSConv-S model as described above is also suited for other architectures which use linear bottleneck blocks, such as EfficientNet [41] and MnasNet [40]. + +# 5. Experiments + +We evaluate our approach of blueprint separable convolutions based on a variety of commonly used benchmark datasets. We provide a comprehensive analysis of the MobileNet family and their modified counterparts according to our findings in Section 4. Furthermore, we demonstrate how our approach can be used as a drop-in substitution for regular convolution layers in standard models like ResNets to drastically reduce the number of model parameters and operations, while keeping or even gaining accuracy. + +To allow for a fair comparison, we train all models—including the baseline networks—with exactly the same training procedure. + +# 5.1. CIFAR10 and CIFAR100 + +The CIFAR10/100 datasets [25] consist of 50k training and 10k test images of size $32\mathrm{px} \times 32\mathrm{px}$ and comprise 10 and 100 classes, respectively. As suggested in [13, 45], we train for 200 epochs for both datasets. We use SGD with momentum set to 0.9 and a weight decay of $10^{-4}$ . The initial learning rate is set to 0.1 and decayed by a factor of 0.1 at epochs 100, 150, and 180. Images are augmented by random horizontal flips and random shifts by up to 4 px to prevent models from overfitting [13, 45]. + +MobileNets. As first experiment, we evaluate our improvements of MobileNetV1-V3 [16, 35, 15] as derived in Section 4. To make MobileNets applicable to CIFAR, we removed the first and second pooling operation to obtain a final feature map of size $4 \times 4$ . With this modification, we achieve state-of-the-art performance for the baseline models (see Table 1). + +As described in Section 4, we use BSConv-U for MobileNetV1 and BSConv-S for MobileNetV2/V3. For the BSConv-S models, we use a subspace compression ratio of $p = \frac{1}{6}$ to have exactly the same parameter count as the vanilla model. The weighting coefficient $\alpha$ for the orthonormal regularization loss was set to 0.01. + +The results are shown in Table 1. We can state that all BSConv variants outperform their corresponding MobileNet baselines. For MobileNetV1, this can be explained by (i) the inversion of point- and depthwise convolutions and (ii) the absence of ReLU activations for the pointwise convolutions (see discussion in Section 4.1). For MobileNetsV2 and V3, the fact that BSConv-S always outperforms the baseline models clearly confirms the advantage of our proposed orthonormal regularization loss. + +ResNets and WideResNets. In addition to the improvements with respect to MobileNets, we can use our BSCov approach as drop-in substitution for regular convolution layers in standard networks. In the following, we consider ResNets [13] and WideResNets [45] as two state-of-the-art models for the CIFAR datasets. In both cases, we use the + +BSConv-U variant. We increase the depth and width factor of each BSConv model such that its parameter count matches the parameter count of the corresponding baseline model. We apply the same training protocol and augmentation techniques as described above. + +In Table 2 we compare the original networks with their modified BSConv versions. For ResNets, we can improve accuracy by up to 3.1 percentage points for CIFAR100, while having slightly fewer parameters and computational costs. For WideResNets, we can gain accuracy of up to 2.1 percentage points for CIFAR100, while having fewer parameters and computational costs. This clearly shows the effectiveness of our approach as an drop-in substitution of regular convolution layers. + +# 5.2. ImageNet + +To assess the performance of BSConv models in large-scale classification scenarios, we conduct experiments on the ImageNet dataset (ILSVRC2012, [34]). It contains about 1.3M images for training and 50k images for testing which are drawn from 1000 object categories. + +We employ a common training protocol and train for 100 epochs with an initial learning rate of 0.1 which is decayed by a factor of 0.1 at epochs 30, 60, and 90. We use SGD with momentum 0.9 and a weight decay of $10^{-4}$ . To allow for a fair comparison and to investigate the effect of our approach, we train own baseline models with exactly the same training setup as used for BSConv models. The images are resized such that their short side has a length of $256\mathrm{px}$ . We use the well-established Inception-like scale augmentation [39], horizontal flips, and color jitter [26]. + +MobileNets. As for the CIFAR experiments, we compare MobileNets to their corresponding BSConv variants. Again, BSConv-U is used for MobileNetV1, and BSConv-S is used for MobileNetV2/V3. The subspace compression ratio for BSConv-S is $p = \frac{1}{6}$ just like for the CIFAR experiments. The weighting coefficient $\alpha$ for the orthonormal regularization loss was set to 0.1. + +The results are presented in Table 3. Again, it can be seen that the BSCov variants of MobileNets outperform their corresponding baseline models. However, the relative improvements are no longer as large as for the CIFAR experiments. This effect can be explained by the regularization impact of the dataset itself. Considering the MobileNetV3-large results, we note that even if the orthonormal regularization loss seems to be no longer effective, it has no negative influence on the training. + +ResNets. As noted before, it is possible to directly substitute regular convolution layers in standard networks by BSConv variants. To this end, we analyze the effectiveness of our approach when applied to ResNets on large-scale image databases. For the baseline models, we use ResNet-10, ResNet-18, and ResNet-26. The BSConv vari + +
NetworkCIFAR10CIFAR100Stanford DogsStanford CarsOxford Flowers
origoursorigoursorigoursorigoursorigours
MobileNetV1 (x0.25)90.491.667.569.842.849.164.674.059.268.0
MobileNetV1 (x0.5)91.893.370.873.549.355.270.678.863.171.5
MobileNetV1 (x0.75)92.794.372.274.551.457.972.980.063.170.8
MobileNetV1 (x1.0)93.494.373.475.751.659.174.479.960.267.3
MobileNetV2 (x0.25)89.690.165.668.942.046.865.269.944.951.9
MobileNetV2 (x0.5)92.093.272.573.250.854.870.478.057.660.6
MobileNetV2 (x0.75)93.193.973.275.053.559.073.482.055.771.5
MobileNetV2 (x1.0)93.694.274.975.856.060.176.783.861.367.0
MobileNetV3-small (x0.35)90.390.666.567.242.844.263.470.456.966.5
MobileNetV3-small (x0.5)91.591.769.469.645.347.468.174.464.071.7
MobileNetV3-small (x0.75)92.092.570.472.046.749.572.177.266.374.3
MobileNetV3-small (x1.0)92.292.772.273.749.452.172.577.068.475.6
MobileNetV3-large (x0.35)92.893.071.573.748.556.069.577.555.769.4
MobileNetV3-large (x0.5)93.093.972.975.351.257.973.680.465.766.8
MobileNetV3-large (x0.75)93.794.473.977.051.860.074.980.963.175.1
MobileNetV3-large (x1.0)93.794.675.277.754.960.075.782.364.473.8
+ +Table 1. MobileNet results for various datasets. The columns 'orig' refer to the baseline MobileNet models. The columns 'ours' refer to BSConv-U for MobileNetV1 and BSConv-S for MobileNetV2/V3. + +
NetworkCIFAR10CIFAR100
ParametersFLOPsAccuracyParametersFLOPsAccuracy
ResNet-20 [13]272.5K41.3M92.2278.3K41.3M67.7
ResNet-110 (BSConv-U)239.0K41.1M92.9244.8K41.1M70.8
WideResNet-40-3 [45]5.0M735.0M94.95.0M735.0M75.5
WideResNet-40-8 (BSConv-U)4.2M671.6M95.24.3M671.6M77.6
+ +Table 2. ResNets and WideResNets on CIFAR10 and CIFAR100. We increase the depth and width factor of each BSCov model such that its parameter count matches the parameter count of the corresponding baseline model. + +
NetworkOriginalBSConv (ours)
MobileNetV1 (x0.25)51.853.2
MobileNetV1 (x0.5)63.564.6
MobileNetV1 (x0.75)68.269.2
MobileNetV1 (x1.0)70.871.5
MobileNetV2 (x1.0)69.769.8
MobileNetV3-small (x1.0)64.464.8
MobileNetV3-large (x1.0)71.571.5
+ +Table 3. MobileNets on ImageNet. BSConv-U is used for MobileNetV1, and BSConv-S is used for MobileNetV2/V3. Note that BSConv does not introduce additional parameters. + +ants are ResNet-10, ResNet-18, ResNet-34, ResNet-68, and ResNet-102. Again, we use the same training protocol and augmentation techniques as described above. + +The results are shown in Figure 6, split by parameter count and computational complexity. It can be seen that the BSConv-U variants of ResNets significantly outperform the baseline models. ResNet-10 and ResNet-68+BSConv-U, for instance, have similar parameter counts, while us + +ing BSCnv leads to an accuracy gain of 9.5 percentage points. Another interesting example is ResNet-18 vs. ResNet-34+BSConv-U: both have a comparable accuracy, while the BSCnv model has only about one fifth of the baseline model parameter count. + +# 5.3. Fine-grained Recognition + +Apart from large-scale object recognition, we are interested in the task of fine-grained classification, as those datasets usually have no inherent regularization. The following experiments are conducted on three well-established benchmark datasets for fine-grained recognition, namely Stanford Dogs [23], Stanford Cars [24], and Oxford 102 Flowers [32]. We train all models from scratch, since parts of these datasets are a subset of ImageNet. In contrast to the ImageNet training protocol, we do not use aggressive data augmentation, since we observed that it severely affects model performance. We only augment data via random crops, horizontal flips, and random gamma transform. + +We use the same training protocol for all three datasets. In particular, we use SGD with momentum set to 0.9 and a + +![](images/9df588553bf988281c4de991b743ab981a866e28165bc09481a603c5323e1763.jpg) +Figure 6. ResNets on ImageNet. For the baseline models, we use ResNet-10/18/26. The BSCnv variants are ResNet-10/18/34/68/102. + +![](images/fa9aab8f96700d9df6de22a242b2102d538a426201e6713f2a741a122c2a160d.jpg) + +weight decay of $10^{-4}$ . The initial learning rate is set to 0.1 and linearly decayed at every epoch such that it approaches zero after a total of 100 epochs. + +MobileNets. We use the same model setup as for the CIFAR and ImageNet experiments discussed above. The results are shown in Table 1. Again, all BSConv models substantially outperform their baseline counterparts. In contrast to the CIFAR results, the margin is even larger. Therefore, the interpretation of the CIFAR results applies here as well. + +Other Architectures. We further evaluate the effect of our approach for a variety of state-of-the-art models. We replace regular convolution layers in standard networks such as VGG [38] and DenseNet [17]. + +In Table 4 we can see that all models greatly benefit from the application of BSConv. Accuracy for BSConv-U can be improved by at least 2 percentage points, while having up to $8.5 \times$ less parameters and a substantial reduction of computational complexity. Most of the recently proposed model architectures utilize residual linear bottlenecks [35], which can also be easily equipped with our BSConv-S approach in the same way as for MobileNetV2/V3 (see Section 4.2). As can be seen in Table 4, our subspace model clearly outperforms the original EfficientNet-B0 [41] by 6.5 percentage points and MnasNet [40] by 5 percentage points with the same number of parameters and computational complexity. This shows the effectiveness of our proposed orthonormal regularization of the BSConv-S subspace transform. + +Influence of the Orthonormal Regularization. To evaluate the influence of the proposed orthonormal regularization loss for BSCov-S models, we conduct an ablation study using MobileNetV3-large. In particular, several identical models are trained on the Stanford Dogs dataset using weighting coefficients $\alpha$ in the range of $10^{-5},\ldots ,10^{0}$ + +As can be seen in Figure 7, by regularizing the subspace components to be orthonormal, model performance can be substantially improved by over 5 percentage points. An optimum is reached for a weighting coefficient of $\alpha = 0.1$ . For smaller values, the influence of the regularization decreases, until it is no longer effective and converges towards the baseline performance. Larger values, however, decrease model performance since the optimization is mainly driven by rapidly reaching a solution with an orthonormal basis independently of creating a beneficial joint representation. + +
NetworkAccuracy
VGG-16 (BN) [38]60.5
VGG-16 (BN) (BSConv-U)62.4
DenseNet-121 [17]56.9
DenseNet-121 (BSConv-U)59.4
Xception* [2]59.6
Xception (BSConv-U)64.3
EfficientNet-B0 [41]54.7
EfficientNet-B0 (BSConv-S)61.2
MnasNet [40]54.8
MnasNet (BSConv-S)59.8
+ +Table 4. Results of various architectures and their BSConv counterparts for the Stanford Dogs dataset. BSConv-U CNNs have fewer parameters and a smaller computational complexity compared to their baseline models. BSConv-S CNNs have the same parameter count and computational complexity as their counterparts. * Commonly used implementation based on DSCs. + +![](images/da62f9ff8c8c1a5ed9c68f4718ee271242568cd12e89f837a7a8335f85a42cd5.jpg) +Figure 7. Influence of the orthonormal regularization loss on the accuracy for the BSConv-S variant of MobileNetV3-large (red solid line) on Stanford Dogs. The baseline MobileNetV3-large model without BSConv-S is indicated by the black dashed line. + +# 6. Conclusions + +We introduced blueprint separable convolutions (BSConv) as highly efficient building blocks for CNNs. Our formulation provided an interpretation and justification for depthwise separable convolutions. By using BSConv, we clearly and consistently improved established models such as MobileNets, MnasNets, EfficientNets, and ResNets. Code and trained models are available under https://github.com/zeiss-microscopy/BSCnv. + +# References + +[1] Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. arXiv preprint arXiv:1812.00332, 2018. 2 +[2] François Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1251-1258, 2017. 2, 8 +[3] Misha Denil, Babak Shakibi, Laurent Dinh, Marc'Aurelio Ranzato, and Nando De Freitas. Predicting parameters in deep learning. In Advances in neural information processing systems, pages 2148-2156, 2013. 2 +[4] Emily L Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Advances in neural information processing systems, pages 1269-1277, 2014. 2 +[5] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 580-587, 2014. 1 +[6] Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014. 2 +[7] Jianbo Guo, Yuxi Li, Weiyao Lin, Yurong Chen, and Jianguo Li. Network decoupling: From regular to depthwise separable convolutions. arXiv preprint arXiv:1808.05517, 2018. 2, 5 +[8] Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A Horowitz, and William J Dally. Eie: efficient inference engine on compressed deep neural network. In 2016 ACM/IEEE 43rd Annual International Symposium on Computer Architecture (ISCA), pages 243-254. IEEE, 2016. 2 +[9] Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015. 2 +[10] Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pages 1135-1143, 2015. 2 +[11] Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in neural information processing systems, pages 164-171, 1993. 2 +[12] Kaiming He and Jian Sun. Convolutional neural networks at constrained time cost. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5353-5360, 2015. 2 +[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 1, 3, 6, 7 +[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European + +conference on computer vision, pages 630-645. Springer, 2016. 1, 3 +[15] 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. arXiv preprint arXiv:1905.02244, 2019. 2, 6 +[16] 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 preprint arXiv:1704.04861, 2017. 1, 2, 4, 6 +[17] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700-4708, 2017. 8 +[18] 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. arXiv preprint arXiv:1811.06965, 2018. 1 +[19] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. The Journal of Machine Learning Research, 18(1):6869-6898, 2017. 2 +[20] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. 1, 3, 4 +[21] Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014. 2 +[22] Jonghoon Jin, Aysegul Dundar, and Eugenio Culurciello. Flattened convolutional neural networks for feedforward acceleration. arXiv preprint arXiv:1412.5474, 2014. 2 +[23] Aditya Khosla, Nityananda Jayadevaprakash, Bangpeng Yao, and Li Fei-Fei. Novel dataset for fine-grained image categorization. In First Workshop on Fine-Grained Visual Categorization, IEEE Conference on Computer Vision and Pattern Recognition, Colorado Springs, CO, June 2011. 7 +[24] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013. 7 +[25] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Cite-seer, 2009. 6 +[26] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097-1105, 2012. 1, 6 +[27] Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541-551, 1989. 1 + +[28] Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016. 2 +[29] Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. arXiv preprint arXiv:1810.05270, 2018. 2 +[30] 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. 1 +[31] Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), pages 116-131, 2018. 2 +[32] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pages 722-729. IEEE, 2008. 7 +[33] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pages 525-542. Springer, 2016. 2 +[34] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. 6 +[35] 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. 2, 5, 6, 8 +[36] Wenling Shang, Kihyuk Sohn, Diogo Almeida, and Honglak Lee. Understanding and improving convolutional neural networks via concatenated rectified linear units. In international conference on machine learning, pages 2217-2225, 2016. 2 +[37] L Sifre and S Mallat. Rigid-motion scattering for image classification, 2014. PhD thesis, Ph.D. thesis, 2014. 1, 2, 5 +[38] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 3, 8 +[39] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1-9, 2015. 6 +[40] 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 Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2820-2828, 2019. 2, 5, 8 +[41] Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019. 2, 5, 8 +[42] Min Wang, Baoyuan Liu, and Hassan Foroosh. Factorized convolutional neural networks. In Proceedings of the IEEE + +International Conference on Computer Vision, pages 545-553, 2017. 2 +[43] Lingxi Xie and Alan Yuille. Genetic cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 1379-1388, 2017. 2 +[44] Saining Xie, Ross Girshick, Piotr Dólár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492-1500, 2017. 2 +[45] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. 6, 7 +[46] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6848-6856, 2018. 2 +[47] Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017. 2 +[48] Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.2 \ No newline at end of file diff --git a/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/images.zip b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..250d019977f7c030f881a4f08ac7951fd340787b --- /dev/null +++ b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86dbcd7bcdd2a8c07a5cafd52deb59d5ecf6a8ac47d074dd13f45450226b0fbc +size 622398 diff --git a/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/layout.json b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1801a074a5dd73323b7fdfdc5e467e3bf1084c57 --- /dev/null +++ b/rethinkingdepthwiseseparableconvolutionshowintrakernelcorrelationsleadtoimprovedmobilenets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a27133d4fb514af305e214bfe7addd34808982282ef6ed678eb731910a11276 +size 405985 diff --git a/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_content_list.json b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5b1336cf1cf08fb876751ca1192d1a5217ea88f1 --- /dev/null +++ b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:481c52db094d6012093dc8d908b9d92a7464919ae81908da2baf64095f3db26c +size 78658 diff --git a/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_model.json b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cbf802282f63b7821111798b4aa77cd9c029ce2f --- /dev/null +++ b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:060d71201d12a8b2e2732401f4bc1540ff8b4b9656128ebbc87207eb532e5536 +size 93865 diff --git a/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_origin.pdf b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2bfd210c7f6139b3422ee43816a4ae226a5ba2da --- /dev/null +++ b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/152a81a5-de52-4478-89d2-495f940592c1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38cf129a8d6b53c5066f3c5787fb164625c2047dc53ba9a2d2bd658396046f09 +size 287977 diff --git a/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/full.md b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..86711eb7e4cd0123eacf7f0f12dd5c1f8ee7888f --- /dev/null +++ b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/full.md @@ -0,0 +1,385 @@ +# Rethinking Differentiable Search for Mixed-Precision Neural Networks + +Zhaowei Cai +UC San Diego + +zwcai@ucsd.edu + +Nuno Vasconcelos +UC San Diego + +nuno@ucsd.edu + +# Abstract + +Low-precision networks, with weights and activations quantized to low bit-width, are widely used to accelerate inference on edge devices. However, current solutions are uniform, using identical bit-width for all filters. This fails to account for the different sensitivities of different filters and is suboptimal. Mixed-precision networks address this problem, by tuning the bit-width to individual filter requirements. In this work, the problem of optimal mixed-precision network search (MPS) is considered. To circumvent its difficulties of discrete search space and combinatorial optimization, a new differentiable search architecture is proposed, with several novel contributions to advance the efficiency by leveraging the unique properties of the MPS problem. The resulting Efficient differentiable MFixed-Precision network Search (EdMIPS) method is effective at finding the optimal bit allocation for multiple popular networks, and can search a large model, e.g. Inception-V3, directly on ImageNet without proxy task in a reasonable amount of time. The learned mixed-precision networks significantly outperform their uniform counterparts. + +# 1. Introduction + +Deep neural networks have state-of-the-art performance on computer vision tasks such as visual recognition [16, 26, 29, 30, 12], object detection [24, 19, 5], segmentation [11, 6], etc. However, their large computation and memory costs make them difficult to deploy on devices such as mobile phones, drones, autonomous robots, etc. Low-precision networks, which severely reduce computation and storage by quantizing network weights and activations to low-bit representations, promise a solution to this problem. + +In the low-precision literature, all network weights and activations are usually quantized to the same bit-width [14, 23, 35, 4, 37, 34]. The resulting uniform low-precision networks have been preferred mostly because they are well supported by existing hardware, e.g. CPUs, FPGAs, etc. However, uniform bit allocation does not account for the individual properties of different filters, e.g. their location + +![](images/eec0db3389ea54f0cfb45ef9f2c7dd96bf1d913dceea3cd3ea1b2aff02cf4a63.jpg) +Figure 1. Differentiable architecture of the proposed mixed-precision network search module. + +on the network, structure, parameter cardinality, etc. In result, it can lead to suboptimal performance for a given network size and complexity. Mixed-precision networks [1, 18, 17, 33, 32, 31, 9] address this limitation, enabling the optimization of bit-widths at the filter level. They are also becoming practically relevant, with the introduction of hardware that supports mixed-precision representations. For example, the NVIDIA $\mathrm{AMP}^1$ can choose between different floating point representations during training. + +Nevertheless, the problem of optimizing bit allocation for a mixed-precision network is very challenging. Since a network of $L$ layers and $N$ candidate bit-widths can have $N^L$ different configurations, it is usually impossible to manually craft the optimal solution, and automatic bit allocation techniques are required. While this is well aligned with recent progresses in automatic neural architecture search (NAS) [38, 39, 3, 2, 20], there are several important differences between generic NAS and mixed-precision network search (MPS). First, NAS relies extensively on a proxy task to overcome the extremely high computational demands of searching for the optimal network architecture on a large dataset, such as ImageNet. It is common to search for a module block on a small dataset (such as CIFAR-10) and stack copies of this module as the final architecture. How + +ever, this type of proxy task is very ineffective for MPS, due to 1) the layer importance difference, e.g. layers closer to input and output typically require higher bit-width; and 2) the (likely large) difference between optimal bit allocations for CIFAR-10 and ImageNet. Second, higher bit-widths usually lead (up to overfitting) to mixed-precision networks of higher accuracy. Hence, the sole minimization of classification loss usually has a trivial solution: to always select the candidate of highest bit-width. Third, while general NAS requires candidate operators that are heterogeneous in structure, e.g. convolution, skip connection, pooling, etc., MPS only involves homogeneous operators and very similar representations, e.g. convolutions of different bit-widths. These unique properties of MPS suggest the need for search techniques different than those of standard NAS. + +In this work, we leverage the above properties to propose an efficient MPS framework based on several contributions. First, to enable search without proxies, the proposed framework is based on the differentiable search architecture of Figure 1, motivated by the popular DARTS [20] approach to generic NAS. Second, to avoid the trivial selection of the highest bit-width, learning is constrained by a complexity budget. The constrained optimization is reformulated as a Lagrangian, which is optimized to achieve the optimal trade-off between accuracy and complexity. Third, to circumvent the expensive second-order bi-level optimization of DARTS, a much simpler and effective optimization is proposed, where both architecture and network parameters are updated in a single forward-backward pass. Fourth, by exploiting the linearity of the convolution operator, the expensive parallel convolutions of Figure 1 are replaced by an efficient composite convolution, parameterized by the weighted sum of parallel weight tensors. This ensures the training complexity remains constant, independently of the size of search space, enabling the training of large networks. + +Together, these contributions enable an efficient MPS procedure with no need for proxy tasks. This is denoted as Efficient differentiable MFixed-Precision network Search (EdMIPS) and can, for example, search the optimal mixed-precision Inception-V3 [30] of 93 filters, on ImageNet, in 8 GPU days. Extensive evaluations of EdMIPS on multiple popular networks of various sizes, accuracies, properties, etc., including AlexNet, ResNet, GoogLeNet and Inception-V3, show that it outperforms uniform low-precision solutions by a large margin. Beyond demonstrating the effectiveness of EdMIPS, this vast set of results also establishes solid baselines for the growing area of mixed-precision networks. To facilitate future research, all code is released at https://github.com/zhaoweicai/EdMIPS. + +# 2. Related Work + +Uniform low-precision: Low-precision networks have recently become popular to speed-up and reduce model size + +of deep networks [14, 23, 35, 4, 37, 34, 36]. [14, 23] pioneered the joint binarization of network weights and activations, using a continuous approximation to overcome the non-differentiability of quantization. This, however, entailed a significant accuracy loss. [35, 4] later achieved accuracies much closer to those of full-precision networks. The HWGQ-Net [4] approximated the ReLU by a half-wave Gaussian quantizer, and proposed a clipped ReLU function to avoid the gradient mismatch. LQ-Net [34] and PACT [7] tried to learn the optimal step size and clipping function online, respectively, achieving better performance. However, these are all uniform low-precision networks. + +Bit allocation: Optimal bit allocation has a long history in neural networks [15, 1, 18]. [15, 1] proposed the exhaustive checking of filter sensitivities on a per layer basis, following simulation-based word-length optimization methods from signal processing [28]. [18] proposed an analytical solution to fixed-point quantization that seeks the optimal bit-width allocations across network layers by optimizing signal-to-quantization-noise-ratio (SQNR). [17] frames precision allocation as the sequential allocation of bits of precision to the weights of one layer, until a bit budget is exhausted. These techniques precede NAS [38] and are less powerful, less applicable to practical network design, or both. + +Neural architecture search: NAS is a popular approach to automated search of neural network architectures [38, 39, 3, 2, 20]. However, the large and discrete nature of the search space make NAS very expensive. [38] proposed a reinforcement learning (RL) technique that requires 1,000 GPU days to search for an architecture on CIFAR-10. Subsequent works have tried to reduce these extraordinary levels of computation. [3, 2, 10] start by learning a subnet, containing all possible module choices, and find the best subnet within this subnet. Differentiable architecture search (DARTS) [20] relaxes the discrete search space into a continuous one, enabling the optimization by gradient descent. + +Mixed Precision: Recently, [33, 32, 31] formulated MPS as an instance of NAS. Some of these techniques [33, 31] are based on RL and thus not very efficient. [32] relies on DARTS but requires a proxy task, due to the linear memory/computation on the cardinality of candidate pool, and samples dozens of architectures during search. Compared to these approaches, EdMIPS is simpler, more efficient, effective, and applicable to a much broader set of networks. + +# 3. Low-Precision Neural Network + +In this section, we briefly review some preliminary concepts on low-precision neural network. + +# 3.1. Deep Neural Network + +Deep networks implement many filtering operators, + +$$ +y = f (a (x)) = \mathbf {W} * a (x), \tag {1} +$$ + +![](images/f6855fc93958b4ae740f659aa660fd321884b263ab7bec18a36891403a7b019e.jpg) +Figure 2. The Inception module in GoogLeNet. + +where filter $f$ is parameterized by weight tensor $\mathbf{W}$ (which can be expressed in full or low-precision), $x$ is the filter input, $a$ a non-linear activation function (e.g. ReLU in full-or HWGQ [4] in low-precision networks), $y$ the filter output and $*$ the convolution or matrix-vector multiplication operator. The $L$ network filters $F = \{f_{1}, f_{2}, \dots, f_{L}\}$ are learned by minimizing the classification risk $\mathcal{R}_E[F]$ defined by the cross-entropy loss function on a training set. The overall complexity of a neural network is mostly dictated by the complexity of (1). By quantizing both weights and activations to low bit-width, the expensive float-point operations of (1) can be replaced by efficient bit operations (e.g. XNOR and bit-count), substantially reducing model size and computation [23, 4]. + +# 3.2.HWGQ Network + +A mixed-precision network can have arbitrary weight and activation bit-widths. Many quantization techniques have been proposed [14, 23, 35, 4, 37, 34]. In this work, we start from the HWGQ-Net [4], one of the state-of-the-art low-precision networks in the literature. Although the HWGQ-Net only uses binary weights, its activation quantization technique can be used to produce weights of higher precision. This starts by pre-computing the optimal quantizer + +$$ +Q (x) = q _ {i}, \quad i f \quad x \in \left(t _ {i}, t _ {i + 1} \right] \tag {2} +$$ + +for a Gaussian distribution of zero mean and unit variance, using Lloyd's algorithm [21, 22]. Since the network weight distributions are always close to zero-mean Gaussians of different variance $\sigma^2$ , the optimal quantization parameters can then be easily obtained by rescaling the pre-computed quantization parameters [27], i.e. using the quantizer + +$$ +Q (x) = \sigma q _ {i}, \quad i f \quad x \in \left(\sigma t _ {i}, \sigma t _ {i + 1} \right]. \tag {3} +$$ + +To be hardware-friendly, all quantizers are uniform. + +# 3.3. Filter Sensitivity + +The allocation of the same bit-width to all network layers, known as uniform bit allocation, can be very suboptimal, since different filters have different bit-width sensitivities. Figure 3 illustrates this point for the popular Inception + +![](images/fd8d04a6dd17fca3659022681e96b06ec8da2c953d495388eac372fe62e93b32.jpg) +Figure 3. The filter sensitivity in the Inception module. + +module of GoogLeNet [29] whose architecture is shown in Figure 2. This has four parallel branches and six learnable filters in total. To check their sensitivities, we started by training a uniform 2-bit GoogLeNet baseline on ImageNet. We then trained another model, changing a single filter of the Inception module to 4-bit, throughout the network. This experiment was repeated for all six filters. The changes in accuracy and computation of the whole network, with respect to the baseline, reflect the differences in bit-width sensitivity of the six filters. Figure 3 shows that "ch1x1" is the most sensitive filter, as the bit-width increase improves network accuracy by more than $2\%$ with only a $25\%$ computation increase. "ch3x3red" and "ch5x5" have computation similar to "ch1x1" but are less sensitive, especially "ch5x5". On the other hand, the computation of "ch3x3" skyrockets to $125\%$ for a much smaller gain of $1.3\%$ in accuracy, which is close to that of the inexpensive "ch3x3red" and "poolProj". Finally, "ch5x5red" has minor changes in accuracy and computation. These observations suggest that mixed-precision networks could substantially outperform uniform networks. + +# 4. Mixed-Precision Network + +In a mixed-precision network, bit-width varies filter by filter. The problem is to search a candidate pool $\mathcal{B}$ of bit-widths for the optimal bit-width for each filter in the network. This can be implemented by reformulating (1) as + +$$ +y = \sum_ {i = 1} ^ {n _ {f}} o _ {i} ^ {\alpha} f _ {i} \left(\sum_ {j = 1} ^ {n _ {a}} o _ {j} ^ {\beta} a _ {j} (x)\right), \tag {4} +$$ + +$$ +\begin{array}{l} \text {s . t .} \sum o _ {i} ^ {\alpha} = 1, \sum o _ {j} ^ {\beta} = 1, o ^ {\alpha}, o ^ {\beta} \in \{0, 1 \}, \end{array} +$$ + +where $n_f$ and $n_a$ are the cardinalities of bit-width pool $\mathcal{B}^{\alpha}$ for weights and $\mathcal{B}^{\beta}$ for activations. The goal is to find the optimal bit-width configuration $\{o_{\alpha}^{*}, o_{\beta}^{*}\}$ for the whole network. Since the search space is discrete and large, it is usually infeasible to hand-craft the optimal solution. + +# 4.1. Complexity-Aware Learning + +In general, networks of higher bit-width have higher accuracy. Hence, the simple minimization of classification loss has the trivial solution of always selecting the highest possible bit-width. To avoid this, we resort to complexity-aware learning, seeking the best trade-off between classification accuracy and complexity. This is a constrained optimization problem, where classification risk $\mathcal{R}_E[F]$ is minimized under a bound on complexity risk $R_C[F]$ , + +$$ +F ^ {*} = \arg \min _ {F} R _ {E} [ F ] \quad \text {s . t .} \quad R _ {C} [ F ] < \gamma , \tag {5} +$$ + +which can be solved by minimizing the Lagrangian + +$$ +\mathcal {L} [ F ] = \mathcal {R} _ {E} [ F ] + \eta \mathcal {R} _ {C} [ F ], \tag {6} +$$ + +where $\eta$ is a Lagrange multiplier that only depends on $\gamma$ . Under this constrained formulation, the optimal bit allocation is no longer trivial. The complexity is user-defined, and could address computation, memory, model size, energy, running speed, or other aspects. It has the form + +$$ +\mathcal {R} _ {C} [ F ] = \sum_ {f \in F} c (f). \tag {7} +$$ + +where $c(f)$ is the cost of filter $f$ . + +# 4.2. Model Complexity + +A popular practice is to characterize complexity by the number of floating-point operations (FLOPs) of filter $f$ , + +$$ +c (f) = | f | w _ {x} h _ {x} / s ^ {2}, \tag {8} +$$ + +where $|\cdot|$ denotes cardinality, $w_{x}$ and $h_x$ are the spatial width and height of the filter input $x$ , and $s$ the filter stride. In low-precision networks, where filter $f$ and activation function $a$ have low bit-width, this cost can be expressed in bit operations (BitOps), + +$$ +c (f) = b _ {f} b _ {a} | f | w _ {x} h _ {x} / s ^ {2}, \tag {9} +$$ + +where $b_{f}$ and $b_{a}$ are the bit-widths of weights and activations, respectively. Since only relative complexities matter for the search, the overall network complexity is normalized by the value of (8) for the first layer to search. + +# 4.3. Relaxed Mixed-Precision Network + +The binary nature of the search space of $\{o_{\alpha}, o_{\beta}\}$ makes the minimization of (6) a complex combinatorial problem. As suggested by [20], a much simpler optimization is possible by relaxing the binary search space into a continuous one, through the reformulation of (4) as + +$$ +y = \sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} f _ {i} \left(\sum_ {j = 1} ^ {n _ {a}} \pi_ {j} ^ {\beta} a _ {j} (x)\right), \tag {10} +$$ + +$$ +\mathrm {s . t .} \sum \pi_ {i} ^ {\alpha} = 1, \sum \pi_ {j} ^ {\beta} = 1, \pi^ {\alpha}, \pi^ {\beta} \in [ 0, 1 ]. +$$ + +The constraints $\pi^{\alpha},\pi^{\beta}\in [0,1]$ can then be eliminated by introducing a set of real configuration parameters $\{\alpha ,\beta \}$ and defining + +$$ +\pi_ {i} ^ {\alpha} = \frac {\exp (\alpha_ {i})}{\sum_ {k} \exp (\alpha_ {k})}, \quad \pi_ {j} ^ {\beta} = \frac {\exp (\beta_ {j})}{\sum_ {k} \exp (\beta_ {k})}. \tag {11} +$$ + +This leads to the architecture of Figure 1. The complexity measure of (9) is finally defined as + +$$ +c (f) = E \left[ b _ {f} \right] E \left[ b _ {a} \right] | f | w _ {x} h _ {x} / s ^ {2}, \tag {12} +$$ + +where + +$$ +E \left[ b _ {f} \right] = \sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} b _ {f _ {i}}, \quad E \left[ b _ {a} \right] = \sum_ {j = 1} ^ {n _ {a}} \pi_ {j} ^ {\beta} b _ {a _ {j}} \tag {13} +$$ + +are the bit-width expectations for weights and activations, respectively. This relaxation enables learning by gradient descent in the space of continuous parameters $\{\alpha ,\beta \}$ which is much less expensive than combinatorial search over the configurations of $\{o_{\alpha},o_{\beta}\}$ + +# 4.4. Efficient Composite Convolution + +While efficient, differentiable architecture search is not without limitations. A common difficulty for general NAS is the linear increase in computation and memory with the search space dimension [20, 2]. If there are ten candidate operators for a layer, they all need to be applied to the same input, in parallel. This makes the search impossible for large networks, e.g. the ResNet-50, Inception-V3, etc., and is usually addressed by resorting to a proxy task. + +Unlike general NAS, where the candidate operators are heterogeneous [38, 20, 2], e.g. convolution, skip connection, pooling, etc., the candidate operators of MPS are homogeneous, namely replicas of the same filter with different bit-widths. This property can be exploited to avoid the expensive parallel operations. The weighted sum of parallel convolutions, as shown in Figure 1, given the weighted activation sum $\bar{a}(x) = \sum_{j=1}^{n_a} \pi_j^\beta a_j(x)$ , can be rewritten as + +$$ +\begin{array}{l} y = \sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} f _ {i} (\bar {a} (x)) = \sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} \left(Q _ {i} \left(\mathbf {W} _ {i}\right) * \bar {a} (x)\right) \\ = \left(\sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} Q _ {i} (\mathbf {W} _ {i})\right) * \bar {a} (x) = \bar {f} (\bar {a} (x)) \tag {14} \\ \end{array} +$$ + +where $\bar{f}$ is the composite filter parameterized by weight tensor + +$$ +\overline {{\mathbf {W}}} = \sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} Q _ {i} \left(\mathbf {W} _ {i}\right). \tag {15} +$$ + +Hence, rather than $n_f$ convolutions between the different $Q_{i}(\mathbf{W}_{i})$ and the common activation $\bar{a}(x)$ , the architecture + +of Figure 1 only requires one convolution with the composite filter of (15). This enables constant training time, independently of the number of bit-widths considered per filter, and the training of large networks become feasible. + +In (15), each candidate operator has its own weight tensor $\mathbf{W}_i$ . During training, the gradients arriving at a layer are distributed to the different branches. In result, filters of low probability $\pi_i^\alpha$ receive few gradient updates and could be under-trained. For example, a branch of $\pi^{\alpha} = 0.1$ will only receive $10\%$ of the overall gradients. A more robust solution is to share weights across all filters by making $\mathbf{W}_i = \mathbf{W}$ and redefining the composite filter of (15) as + +$$ +\overline {{\mathbf {W}}} = \sum_ {i = 1} ^ {n _ {f}} \pi_ {i} ^ {\alpha} Q _ {i} (\mathbf {W}). \tag {16} +$$ + +In this case, while the gradients are still distributed to each branch, they are all accumulated to update the universal weight tensor $\mathbf{W}$ . This eliminates the potential for underfitting, and the size of search model can also remain constant independent of the search space. Note that this weight sharing requires a universal $\mathbf{W}$ representative enough for multiple quantizers of different bit-widths. While this has not been shown in the low-precision network literature [35, 4, 37, 34], it is less of a problem for MPS since 1) the parallel branches learn similar and potentially redundant representations at different bit-widths; 2) what matters for MPS is to optimize the bit allocation, not the weight tensor. + +# 4.5. Search Space + +The design of the search space is critical for NAS. Unlike NAS, which has an open-set search space, the search space of MPS is well-defined and limited to a relatively small number of possibilities per filter and activation, e.g. bit-widths in $\{1,\ldots ,32\}$ . Previous works [32, 10] have coupled weight and activation bit-widths, e.g. defining pairs (1,4), (2,4), etc. This results in $|\mathcal{B}^{\alpha}| \times |\mathcal{B}^{\beta}|$ parallel branches per filter. To reduce complexity, [32, 10] manually pruned $|\mathcal{B}^{\alpha}| \times |\mathcal{B}^{\beta}|$ to a small subset, e.g. six pairs, which is suboptimal. Instead, we decouple weight and activation bit-widths, using $|\mathcal{B}^{\alpha}|$ and $|\mathcal{B}^{\beta}|$ parallel branches for weight and activations, respectively, as shown in Figure 1. This decoupling maintains the search space at full size $|\mathcal{B}^{\alpha}| \times |\mathcal{B}^{\beta}|$ , but significantly reduces computation and memory. Since 1) many works [34, 7] have shown that a bit-width of 4 suffices for very good performance; 2) very low-precision networks, e.g. using 2 bits, are the most challenging to develop; and 3) 1-bit activations are usually insufficient for good performance [14, 23, 35, 4], we use a search space with + +$$ +\mathcal {B} ^ {\alpha} = \{1, 2, 3, 4 \}, \quad \mathcal {B} ^ {\beta} = \{2, 3, 4 \}. \tag {17} +$$ + +# 4.6. Learning + +This leads to the learning procedure for MPS. EdMIPS optimizes the Lagrangian of (6) with respect to the architecture parameters $\{\alpha, \beta\}$ of (11) and the weight tensors $\mathbf{W}$ of (16) over the search space of (17). Both $\mathbf{W}$ and $\{\alpha, \beta\}$ are learned by gradient descent. This is modeled as a bilevel optimization problem [8] in [20]. However, this is too complex, even impractical, for searching large models (e.g. ResNet and Inception-V3) on large datasets (e.g. ImageNet) without a proxy task. To avoid this, we consider two more efficient optimization approaches. The first, which is used by default, is vanilla end-to-end backpropagation. It treats the architecture $\{\alpha, \beta\}$ and filter $\mathbf{W}$ parameters equally, updating both in a single forward-backward pass. The second is an alternating optimization of two steps: 1) fix $\{\alpha, \beta\}$ and update $\mathbf{W}$ ; 2) fix $\mathbf{W}$ and update $\{\alpha, \beta\}$ . It has twice the complexity of vanilla backpropagation. Our experiments show that these strategies are efficient and effective for MPS. + +# 4.7. Architecture Discretization + +Given the optimal architecture parameters $\{\alpha^{*},\beta^{*}\}$ , the mixed-precision network must be derived by discretizing the soft selector variables $\pi$ of (11) into the binary selectors $o$ required by (4). Two strategies are explored. + +The first is a "winner-take-all" approach, used by default, in which only the branch with the highest $\pi$ is selected and the others removed, by defining + +$$ +o _ {i} ^ {*} = \left\{ \begin{array}{l l} 1, & \text {i f} i = \arg \max _ {j} \pi_ {j}, \\ 0, & \text {o t h e r w i s e .} \end{array} \right. \tag {18} +$$ + +This results in a deterministic architecture, which is not affected by the details of the distribution of $\pi$ , only the relative ranking of its values. + +The second is a sampling strategy. Since each $\pi$ is a categorical distribution, hard selectors $o_i$ can be sampled from a multinomial distribution + +$$ +O \sim \text {M u l t i n o m i a l} (n, \pi). \tag {19} +$$ + +with one trial $n = 1$ . This defines a random architecture with expected BitOps as defined in (13). The user can then sample multiple architectures and choose the one with the best trade-off between accuracy and complexity, as in [32]. However, in our experience, the variance of this random architecture is very large, making it very inefficient to find the best network configuration. Alternatively, it is possible to sample from (19) with multiple trials, e.g. $n = 50$ , and choose the architecture with the highest counts. This produces architectures closer to that discovered by "winnertake-all", converging to the latter when $n \to \infty$ . + +# 5. Experiments + +EdMIPS was evaluated with ImageNet [25], top-1 and top-5 classification accuracy. Previous MPS works [32, 31] + +![](images/19e13a048ce3dc1f0139ce7a147293326c929b6d40023d4bcee62f4632da8d32.jpg) +Figure 4. Architecture evolution of ResNet-18 during search. The curves shown per layer index represent the probabilities of the two bit-widths. Layers indexes are as in PyTorch, where 7/12/17 are residual connections. Left: $\eta = 0.001$ in (6). Right: $\eta = 0.002$ . + +![](images/d5ee28ed0bef044cd494c0579704e6bcfb46e5d388541f0204ef0069014e21ac.jpg) + +![](images/bd7a8a8c942c70478d40af97a7c7a151c2a716da081de85876e27aad9b04cc48.jpg) + +![](images/a3f948c902f53e717315a95c6017d79c3636ff3bf352313837f461936f717f18.jpg) + +used ResNet-18 or MobileNet [13]. However, these are relatively simple networks, that stack replicas of a single module block, and for which heuristics can be used to hand-craft nearly optimal bit allocation. For example, the depth-wise layers of MobileNet should receive more bits than the pointwise ones. On the other end of the spectrum, GoogLeNet [29] and Inception-V3 [30] are complex combinations of different modules and too complicated to optimize by hand. Since this is the case where MPS is more useful, beyond the small and simple AlexNet and ResNet-18, we have also tested EdMIPS on larger and more complicated ResNet-50, GoogLeNet and Inception-V3. These experiments establish broad baselines for future studies in MPS. + +# 5.1. Implementation Details + +All experiments, followed standard ImageNet training on PyTorch $^2$ , with the following exceptions. For simplicity, all auxiliary losses were removed from the GoogLeNet and Inception-V3. EdMIPS used a learning rate of 0.1 for network parameters $\mathbf{W}$ , and 0.01 for architecture parameters $\{\alpha, \beta\}$ . All network parameters were initialized as usual, and all architecture parameters were set to 0.01, treating all candidates equally. The search model was trained for 25 epochs, with learning rates decayed by 10 time at every 10 epochs. After training the search model, the classification model was derived by the "winner-take-all" strategy of Section 4.7. Next, the classification models were trained for 50 (95) epochs, with learning rate decayed by 10 times at every 15 (30) epochs, to allow exploration (the final comparison with the state-of-the-art). All models were trained from scratch. For network quantization, we followed [4] but enabled scaling in all BatchNorm layers. + +# 5.2. Architecture Evolution + +Sometimes, it is mysterious why and how an architecture is found by NAS. Due to the differentiability of Ed + +MIPS, the soft architecture evolves gradually during search, as shown in Figure 4. For clarity, we only show the evolution of a ResNet-18 with search space of $\{2,4\}$ bit. Some interesting observations follow from the left part of Figure 4. First, the use of (6) with complexity penalty $\eta = 0.001$ is shown to avoid the trivial solution (highest bit-width always selected). Candidates of lower bit-width are selected for many layers. Second, nearly all layers choose 2 bits in the early epochs, where the network parameters are not yet trained and the complexity penalty dominates. As network parameters become stronger, the error penalty is more likely to overcome the complexity penalty, and 4-bit candidates start to be selected. Third, weights and activations can have different optimal bit allocations. For example, 4-bits are selected for the weights of layers $5/6/8$ , whose activations are assigned 2-bits. Fourth, since the complexity penalty of residual connections (layers $7/12/17$ ) is much smaller than $3 \times 3$ convolutions, they are allocated 4-bits early on. Finally, both candidates are equally strong for some layers, e.g. $9/13$ for weights and 1 for activations. In these cases, the model is not confident on which candidate to choose. + +# 5.3. Effect of Complexity Constraint + +When a stronger complexity constraint is enforced, lower bit-widths are more likely to be chosen. This can be observed by comparing the left $(\eta = 0.001)$ and right $(\eta = 0.002)$ of Figure 4. For layers preferring lower bit-width, this preference is reinforced by stronger $\eta$ . For example, in layers 1-4 for weights and 2-6 for activations, EdMIPS converges to lower bit-widths much faster. For layers preferring lower bit-width at the start but switching to more bits at the end, e.g. 5/10/15 for weights and 10/15/16 for activations, more epochs are required to reach the crossing point. The stronger complexity constraint can also change the final decisions. For example, for weights at layers 6/8/11 and activations at layers 18-19, the decisions switch from 4- to 2-bit. These results show that the optimal architecture depends on the complexity constraint. + +![](images/715e9d4da47bda7a2b4b3fe34f0d06a2d6a25071da7de6f5e253dc6f8a71b484.jpg) +Figure 5. Comparison of the uniform HWGQ-Net and the EdMIPS network. The x-axis, indicating BitOps, is normalized to the scale of bit-width, which is actually in log-scale. + +![](images/83b96a0402be42bedb182bc58fce52dc8f950235a24547efec163eb4be33bec7.jpg) + +![](images/774a3c125955bfbcfefae6c5844f41be7f99c67d1dd7493828d032702f1e5252.jpg) + +![](images/b1b488ca10065102dc20b0e01a0bf0ced94a7daf5ce3b517a5631e01e6eaf234.jpg) + +![](images/3fecbb2f9ee77f36fe4c9fc028ab12bc800aef30ac8b5b425120093540eaeac9.jpg) + +![](images/11b8807bd99ca1c423c26d608661fd8d21412c32c5587f77c9c88ae3ace2aa19.jpg) + +![](images/86d53949a5f8520118a19f01dd4b6e14bd7251874189188dba5a61427afb8b90.jpg) +Figure 6. EdMIPS bit allocation for AlexNet, ResNet-18 and GoogLeNet. + +![](images/698a988fae8d21d61c1b64e5042fbdb38f58eb27883794eeb83fdbf04560d67f.jpg) + +# 5.4. Comparison to Uniform Bit Allocation + +Figure 5 shows that EdMIPS networks substantially outperform the uniform HWGQ-Net versions of AlexNet, ResNet-18/50, GoogLeNet, and Inception-V3. Note that the HWGQ-Net has fairly high baselines. Since the learned model is bounded by the weakest (W1A2) and strongest (W4A4) models in the search space, the improvements are small on both ends, but substantial in between. For example, the EdMIPS models improve the uniform 2-bit HWGQ-Net by about 0.9 point for AlexNet, 0.8 point for ResNet-18, 2.8 points for GoogLeNet, 1.5 points for ResNet-50 and 1.7 points for Inception-V3. This is strong evidence for the effectiveness of EdMIPS. + +# 5.5. Learned Optimal Bit Allocation + +To understand what EdMIPS learns, we visualize the optimal bit allocation of each layer in Figure 6, for AlexNet, ResNet-18 and GoogLeNet, with roughly the same BitOps as the uniform 2-bit models. On AlexNet, whose FC layers are lighter and closer to the output, they receive higher bitwidth. The layers closer to the input, e.g. 1st for weights and 2nd for activations, also receive relatively higher bitwidth. On ResNet-18, the cheap residual connections usually receive the largest bit-width. The first block of layers in each stage, e.g. 5-6th, 10-11th, and 15-16th, also has relatively higher bit-width. GoogLeNet is a more complicated network, and so is its bit allocation. The most expensive "ch3x3" layers frequently receive the lowest bit-width, but not always. Higher bit-widths are allocated to "ch3x3" layers closer to the output. On the other hand, "ch5x5red" is very cheap, and usually receives the highest bit-width. Although "ch1x1" is the second most expensive filter, it is frequently allocated higher bit-width. This reflects its highest sensitivity, shown in Figure 3. Finally, "ch3x3red" and + +"ch5x5" have similar computation, but the former is much more sensitive. Hence, it receives higher bit-width allocations. Note the difficulty of hand-crafting the optimal bit allocation for this complex network. + +# 5.6. Ablation Studies + +ResNet-18 is used for ablation experiments. The default EdMIPS model is denoted as "mixed" in Figure 7 (a). + +Relaxation: Figure 7 (a) shows that the relaxed models of (10) (trained for 50 epochs), only have slightly higher accuracy than their discretized counterparts, i.e. architecture discretization has little performance cost. + +Filter Sharing vs. Non-Sharing: In the default model, all parallel candidates share the weight tensor of (16). Figure 7 (a) shows that this is as effective as learning the individual weight tensors of (15). This is also confirmed by the comparison of their relaxed counterparts, indicating that the unshared parallel branches are somewhat redundant. + +Sampling: Four architectures were sampled from the architecture distribution of the model close to 2-bit of Figure 5, using both the categorical and multinomial sampling discussed in Section 4.7, with close BitOps to the uniform 2-bit model. Figure 7 (a) shows that categorical sampling architectures have large accuracy variance, sometimes even underperforming the uniform baseline. Better performance and lower variance are obtained with multinomial sampling. + +Learning Strategy: Figure 7 (a) shows that there is little difference in accuracy between the default model, which uses single pass optimization, and a model trained with the alternating optimization of Section 4.6. Since the latter has twice the learning complexity, single pass optimization is used by default on EdMIPS. + +Convergence Speed: Figure 7 (b) summarizes the evolu + +![](images/df624c99e8995745610906b2bf073204ff219846518e4e446e3560c067c65d6d.jpg) +(a) + +![](images/5a657a465141cc3881971703c754c7367a35aa1af257687f70ef4b57ac76c4da.jpg) +(b) +Figure 7. (a) ablation experiments on ResNet-18; (b) complexity evolution on ResNet-18 (dashed lines are expected complexities of (13)); (c) savings by efficient composite convolution of Section 4.4. + +![](images/86ec93636c9cef62356ebed7f195529f5990c938539037f7d619cde80a3d281a.jpg) +(c) + +tion of network complexity as a function of $\eta$ , for the five ResNet-18 models of Figure 5. The search usually converges quickly, with minor changes in architecture complexity after the 15th epoch. The accuracy of the corresponding classification models ("models at 15th epoch") is shown in Figure 7 (a). They are comparable to those found after 25 search epochs. + +Search Space: Figure 7 (a) shows that no gain occurs over the uniform model when a coarser search space ( $\{1,4\}$ bit for weight and $\{2,4\}$ bit for activation) is used. + +Efficient Composite Convolution: Figure 7 (c) summarizes the practical savings achieved with the efficient composite convolution of Section 4.4, with respect to the vanilla parallel convolutions, in terms of computation, memory and model size, for the search space of (17). The weight sharing of (16) reduces model size by a factor of almost four. Replacing the parallel convolutions results in $30 - 50\%$ savings in computation and $20 - 40\%$ in memory. These savings make MPS much more practical. For example, the time needed to search for the ResNet-18 on 2 GPUs decreased from 35 to 18 hours, and the search for the Inception-V3 can be performed with 8 GPUs and 12GB of memory. In result, the complete search (e.g. 25 epochs) only increases by $\sim 45\%$ the training complexity of a uniform low-precision ResNet-18 network. It should be mentioned that these practical savings are nevertheless smaller than theoretically predicted by (14), due to other practical cost bottlenecks, e.g. weight/activation quantization, parallelization efficiency in GPUs, network architecture, etc. Better implementations of EdMIPS could enable further savings. + +# 5.7. Comparison to state-of-the-art + +Table 1 compares EdMIPS models to state-of-the-art uniform low-precision networks, including HWGQ-Net [4] and LQ-Net [34]. EdMIPS models, with similar BitOps to the 2-bit uniform models, achieve top performance for all base networks. Compared to the uniform HWGQ-Net, the gains are particularly large (3 points) for the complicated + +Table 1. Comparison to the state-of-the-art. + +
Model +bit-widthRef +32Full +32HWGQ +2LQ [34] +2EdMIPS +~2
AlexNetTop-157.159.258.657.459.1
Top-580.281.780.980.181.0
ResNet-18Top-169.670.265.164.965.9
Top-589.289.586.285.986.5
GoogLeNetTop-173.372.764.8-67.8
Top-591.391.086.3-88.0
ResNet-50Top-176.076.270.671.572.1
Top-593.093.089.890.390.6
Inception-V3Top-177.577.371.0-72.4
Top-593.693.689.9-90.7
+ +GoogLeNet, a compact model very averse to quantization. On the other hand, for the simplest model (AlexNet), the 2-bit EdMIPS model is already equivalent to the full precision network. These results show that EdMIPS is an effective MPS solution. Since 1) [31] only experiments on MobileNet and uses latency as complexity indicator; 2) [32] mainly focuses on ResNet-18/34 of higher bit-widths, e.g. 4-bit; 3) neither of these works have released the code needed to reproduce their results, we are unable to compare to them. We believe that the release of EdMIPS code and the solid baselines now established by Table 1 will enable more extensive comparisons to future work in MPS. + +# 6. Conclusion + +We have proposed EdMIPS, an efficient framework for MPS based on a differentiable architecture. EdMIPS has multiple novel contributions to the MPS problem. It can search large models, e.g. ResNet-50 and Inception-V3, directly on ImageNet, at affordable costs. The learned mixed-precision models of multiple popular networks substantially outperform their uniform low-precision counterparts and establish a solid set of baselines for future MPS research. + +Acknowledgment This work was partially funded by NSF awards IIS-1637941, IIS-1924937, and NVIDIA GPU donations. + +# References + +[1] Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Fixed point optimization of deep convolutional neural networks for object recognition. In ICASSP, pages 1131-1135, 2015. 1, 2 +[2] Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc V. Le. Understanding and simplifying one-shot architecture search. In ICML, pages 549-558, 2018. 1, 2, 4 +[3] Andrew Brock, Theodore Lim, James M. Ritchie, and Nick Weston. SMASH: one-shot model architecture search through hypernetworks. In ICLR, 2018. 1, 2 +[4] Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. In CVPR, pages 5406-5414, 2017. 1, 2, 3, 5, 6, 8 +[5] Zhaowei Cai and Nuno Vasconcelos. Cascade R-CNN: delving into high quality object detection. In CVPR, pages 6154-6162, 2018. 1 +[6] 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 Trans. Pattern Anal. Mach. Intell., 40(4):834-848, 2018. 1 +[7] Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Pact: Parameterized clipping activation for quantized neural networks. arXiv preprint arXiv:1805.06085, 2018. 2, 5 +[8] Benoit Colson, Patrice Marcotte, and Gilles Savard. An overview of bilevel optimization. Annals OR, 153(1):235-256, 2007. 5 +[9] Zhen Dong, Zhewei Yao, Amir Gholami, Michael W. Mahoney, and Kurt Keutzer. HAWQ: hessian aware quantization of neural networks with mixed-precision. In ICCV, pages 293–302. IEEE, 2019. 1 +[10] 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 preprint arXiv:1904.00420, 2019. 2, 5 +[11] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross B. Girshick. Mask R-CNN. In ICCV, pages 2980-2988, 2017. 1 +[12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 1 +[13] 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. CoRR, abs/1704.04861, 2017. 6 +[14] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran ElYaniv, and Yoshua Bengio. Binarized neural networks. In NIPS, pages 4107-4115, 2016. 1, 2, 3, 5 +[15] Kyuyeon Hwang and Wonyong Sung. Fixed-point feedforward deep neural network design using weights $+1$ , 0, and -1. In IEEE Workshop on Signal Processing Systems, pages 174-179, 2014. 2 + +[16] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1106-1114, 2012. 1 +[17] Griffin Lacey, Graham W. Taylor, and Shawki Areibi. Stochastic layer-wise precision in deep neural networks. In UAI, pages 663-672, 2018. 1, 2 +[18] Darryl Dexu Lin, Sachin S. Talathi, and V. Sreekanth Annapureddy. Fixed point quantization of deep convolutional networks. In ICML, pages 2849-2858, 2016. 1, 2 +[19] 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, pages 936-944, 2017. 1 +[20] Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018. 1, 2, 4, 5 +[21] Stuart P. Lloyd. Least squares quantization in PCM. IEEE Trans. Information Theory, 28(2):129-136, 1982. 3 +[22] Joel Max. Quantizing for minimum distortion. IRE Trans. Information Theory, 6(1):7-12, 1960. 3 +[23] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In ECCV, pages 525-542, 2016. 1, 2, 3, 5 +[24] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In NIPS, pages 91-99, 2015. 1 +[25] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Fei-Fei Li. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. 5 +[26] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. 1 +[27] Huifang Sun and Yun Q Shi. Image and video compression for multimedia engineering: Fundamentals, algorithms, and standards. CRC press, 2008. 3 +[28] Wonyong Sung and Ki-II Kum. Simulation-based word-length optimization method for fixed-point digital signal processing systems. IEEE Trans. Signal Processing, 43(12):3087-3090, 1995. 2 +[29] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, pages 1-9, 2015. 1, 3, 6 +[30] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, pages 2818-2826, 2016. 1, 2, 6 +[31] Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization with mixed precision. In CVPR, pages 8612-8620, 2019. 1, 2, 5, 8 +[32] Bichen Wu, Yanghan Wang, Peizhao Zhang, Yuandong Tian, Peter Vajda, and Kurt Keutzer. Mixed precision quantization of convnets via differentiable neural architecture search. arXiv preprint arXiv:1812.00090, 2018. 1, 2, 5, 8 + +[33] Amir Yazdanbakhsh, Ahmed T Elthakeb, Prannoy Pilligundla, FatemehSadat Mireshghallah, and Hadi Esmaeilzadeh. Releq: An automatic reinforcement learning approach for deep quantization of neural networks. arXiv preprint arXiv:1811.01704, 2018. 1, 2 +[34] Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In ECCV, pages 373-390, 2018. 1, 2, 3, 5, 8 +[35] Shuchang Zhou, Zekun Ni, Xinyu Zhou, He Wen, Yuxin Wu, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. CoRR, abs/1606.06160, 2016. 1, 2, 3, 5 +[36] Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Structured binary neural networks for image recognition. arXiv preprint arXiv:1909.09934, 2019. 2 +[37] Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian D. Reid. Towards effective low-bitwidth convolutional neural networks. In CVPR, pages 7920-7928, 2018. 1, 2, 3, 5 +[38] Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. CoRR, abs/1611.01578, 2016. 1, 2, 4 +[39] Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. In CVPR, pages 8697-8710, 2018. 1, 2 \ No newline at end of file diff --git a/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/images.zip b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d5ad89c50101e939872129dfe8259d464a338331 --- /dev/null +++ b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9b0b194090be47d18486421127c21eb5bdeae186343970550df448d8ecebf9e +size 533019 diff --git a/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/layout.json b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..88d8fbbea440bd752e32917f2a4f6579d94b4aa0 --- /dev/null +++ b/rethinkingdifferentiablesearchformixedprecisionneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e26f3075cd4dd63a6a2fb23c1d7a58bd690a0830afd32a2b3e1bd9ad1efca495 +size 401373 diff --git a/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_content_list.json b/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d0314c5d328fef151db4cbc50488ab641a49942d --- /dev/null +++ b/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1eb04698fc620471d1706f06a0948d31701c578b9e1216913cab876665e0e48b +size 77514 diff --git a/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_model.json b/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a7c136818aca93f2bbdfe83e8c4f67ad927d0a00 --- /dev/null +++ b/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cbdb79d2c492d3481d6c2766c59f64f42dbb8e60a820194c88c0d88c752ae6f +size 94566 diff --git a/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_origin.pdf b/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..69d864f5e559483e05213545c06dd4e879bf7dcb --- /dev/null +++ b/rethinkingperformanceestimationinneuralarchitecturesearch/c50097d4-2297-470a-aeeb-504fc5f7d37a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fb9170cd1bef587c847e6eb5fe73b76cf34526788e91cee3b415e601c27fac0 +size 457665 diff --git a/rethinkingperformanceestimationinneuralarchitecturesearch/full.md b/rethinkingperformanceestimationinneuralarchitecturesearch/full.md new file mode 100644 index 0000000000000000000000000000000000000000..734248c1d08f070ee76cde3ce04fdae3076ca6b6 --- /dev/null +++ b/rethinkingperformanceestimationinneuralarchitecturesearch/full.md @@ -0,0 +1,335 @@ +# Rethinking Performance Estimation in Neural Architecture Search + +Xiawu Zheng $^{1,2,3}$ , Rongrong Ji $^{1,2,3*}$ , Qiang Wang $^{1,3}$ , Qixiang Ye $^{3,4}$ , Zhenguo Li $^{5}$ Yonghong Tian $^{3,6}$ , Qi Tian $^{5}$ $^{1}$ Media Analytics and Computing Lab, Department of Artificial Intelligence, School of Informatics, Xiamen University, 361005, China + +$^{2}$ National Institute for Data Science in Health and Medicine, Xiamen University. $^{3}$ Peng Cheng Laboratory, Shenzhen, China. $^{4}$ University of Chinese Academy of Sciences, China. + +$^{5}$ Noah's Ark Lab, Huawei Technologies $^{6}$ Peking University. + +{zhengxiawu,Wangqiang}@stu.xmu.edu.cn, rrji@xmu.edu.cn qxye@ucas.ac.cn, li.zhenguo@huawei.com,yhtian@pku.edu.cn,tian.qil@huawei.com + +# Abstract + +Neural architecture search (NAS) remains a challenging problem, which is attributed to the indispensable and time-consuming component of performance estimation (PE). In this paper, we provide a novel yet systematic rethinking of PE in a resource constrained regime, termed budgeted PE (BPE), which precisely and effectively estimates the performance of an architecture sampled from an architecture space. Since searching an optimal BPE is extremely time-consuming as it requires to train a large number of networks for evaluation, we propose a Minimum Importance Pruning (MIP) approach. Given a dataset and a BPE search space, MIP estimates the importance of hyper-parameters using random forest and subsequently prunes the minimum one from the next iteration. In this way, MIP effectively prunes less important hyper-parameters to allocate more computational resource on more important ones, thus achieving an effective exploration. By combining BPE with various search algorithms including reinforcement learning, evolution algorithm, random search, and differentiable architecture search, we achieve $1,000 \times$ of NAS speed up with a negligible performance drop comparing to the SOTA. + +# 1. Introduction + +Deep learning have made significant success in classification [15, 12], retrieval [48, 47] and detection [42, 46, 20]. To this end, neural architecture search (NAS) aims to automatically discover a suitable neural network architecture by exploring over a tremendous architecture search space, which + +![](images/600dd2a222c8290e3a602e3dd1e7697391665a0ecc90d0c659ef0de663bd0c92.jpg) +Figure 1. Time cost with/without budgeted performance estimation (BPE-1). (a) Previous methods did not optimize the huge computation cost in PE. (b) By incorporating the BPE, we can largely accelerate NAS methods including reinforcement learning (RL) [52], evolution algorithm (EA) [34], random search (RS) and DARTS [28] (One-shot) with a negligible performance drop. + +![](images/43d80bd98ffbdc39ac2e6eaff34f28875c8f9d936fed77d5bc4195336056c014.jpg) + +has shown remarkable performance over manual designs in various computer vision tasks [9, 51, 28, 52, 10, 26]. + +Despite the extensive success, previous methods are still defective in intensive computation resources, which severely restricts its application prospect and flexibility. For instance, reinforcement learning (RL) based methods [52, 51] search a suitable architecture on CIFAR10 by training and evaluating more than 20,000 architectures by using 500 GPUs over 4 days. For another instance, the evolutionary algorithm (EA) based method in [34] needs 3,150 GPU days to find an optimal architecture on CIFAR10. + +A NAS method generally consists of three components, i.e., search space, search strategy and performance estimation. As established by [51], cell based search space is now well adopted [49, 44, 11, 31, 34, 33, 51, 52], which is predefined and fixed during the architecture search to ensure a fair comparison among different NAS methods. On the other hand, as illustrated in Fig. 1, different search strategies (RL or EA) have similar run-time (after subtracting the + +![](images/75a0953a5d8dd0144d254855e69c1451ccfe1837544cbf651cd55c4b028bd58c.jpg) +Figure 2. The overall framework of the proposed Minimum Importance Pruning for finding an optimal Budgeted Performance Estimation. The search space of BPE is built from the training hyper-parameters including training epoch, batch size, learning rate, layer number, float point, channels, cutout and image size. We first sample the example with the lowest time cost. Then the sampled example is used to train the random forest, which is used to evaluate the importance of the corresponding hyper-parameters. The hyper-parameter with the lowest importance is pruned by assigning the value with a minimum time cost. + +performance estimation cost), which can also be well accelerated with GPU packages. Therefore the major computational consumption of NAS lies in the performance estimation (PE) step, as validated in Fig. 1. However, few works have been devoted to the efficiency issue of PE, which is crucial to cope with the explosive growth of dataset size and model complexity. Moreover, it is highly desirable to conduct fast architecture search under different datasets for deployment in emerging applications like self-driving cars [5]. + +In this paper, we propose a novel and efficient performance estimation under the resource-constrained regime, termed budgeted performance estimation (BPE), which is the first of its kind in the NAS community. The BPE essentially controls the hyper-parameters of training, network designing and dataset processing, such as number of channels, number of layers, learning rate and image size. Rather than pursuing model precision for a specific dataset, BPE aims to learn the most achievable relative precision order of different neural architectures in a specific architecture space. In other words, a good network structure still has a relatively high ranking on an accurate BPE. We argue that the missing of accurate and efficient BPE remains as the main barrier for the wide usage of NAS research. However, finding an accurate and effective BPE is extremely challenging compared to other black-box optimization problems. First, BPE needs to carefully deal with the discrete (like layers or channels) and continuous (like learning rate) hyper-parameters. Second, evaluating a specific BPE needs to train a large number of neural networks e.g., $2 \times 8^{14}$ networks in the cell-based architecture search space [28]. + +As implicitly employed in previous NAS [52, 22, 33, 28, + +7, 31] methods, most BPE methods only leverage intuitive tricks including early stopping [52], dataset sampling [22] and lower resolution dataset, or using a proxy search network with fewer filters per layer and fewer cells [52, 28]. While such methods can reduce the computational cost to a certain extent (which is still time consuming [52, 34]), noise is also introduced into PE to underestimate its corresponding performance. Little work investigates the relative performance rank between approximated evaluations and full evaluations, which is traditionally considered as a merited trick [28, 52, 34]. However, as subsequently validated in Sec. 5, such a relative rank can change dramatically under a tiny difference in the training condition. + +In this paper, we present a unified, fast and effective framework, termed Minimum Importance Pruning (MIP), to find an optimal BPE on a specific architecture search space such as cell-based search space [49, 44, 11, 31, 34, 33, 51, 52], as illustrated in Fig. 2. In particular, for a given large-scale hyper-parameter search space, we first sample examples with the lowest time consumption. The sampled examples are then used to estimate the hyper-parameter importance using random forest [6, 16]. The hyper-parameter of the lowest importance is set to the value with the minimum time cost. The algorithm stops when every hyperparameter is set. The contributions of this paper include: + +- It is the first work to systematically investigate the performance estimation in NAS under the resource-constrained regime. We seek an optimal budgeted PE (BPE) by designing a spearman correlation loss function on a group of key hyper-parameters. +- A novel hyper-parameter optimization method, termed + +Minimum Importance Pruning (MIP), is proposed, which is effective for black-box optimization with extremely time consuming on the evaluation step. + +- The proposed MIP-BPE generalizes well to various architecture search methods, including Reinforcement Learning (RL), Evolutionary Algorithms (EA), Random Search (RS) and DARTS. MIP-BPE achieves remarkable performance on both CIFAR-10 and ImageNet, while accelerating the search process by $1,000 \times$ . + +# 2. Related Work + +# 2.1. Performance Estimation in NAS + +Performance estimation refers to estimating the performance of a specific architecture in the architecture search space. A conventional option is to perform a standard training and validation process of this architecture on the dataset, which is computationally expensive and limits the number of architectures that can be explored. To accelerate performance estimation, most NAS methods only provide simple intuitive cues such as early stopping [52], dataset sampling [22] and lower resolution dataset, or using a proxy search network with fewer filters and fewer cells [52, 28]. + +Another possibility of estimating the architecture performance is one-shot based methods [50, 28, 1], which consider each individual in the search space as a sub-graph sampled from a super-graph. In this way, they accelerate the search process by parameter sharing [31]. Chen et al. [11] proposed to progressively grow the depth of searched architectures during the training procedure. Xu et al. [44] presented a partially connected method by sampling a small part of the super-net to reduce the redundancy in the network space, which thereby performs a more efficient search without comprising the performance. However, these methods do not deeply investigate the influence of different hyper-parameters, which has introduced large noise as validated in Sec. 5. + +# 2.2. Hyper-parameter Optimization + +Hyper-parameter optimization [41] aims to automatically optimize the hyper-parameters during the learning process [4, 19, 39, 45]. To this end, gird search and random search [4] are the two simplest and most straightforward approaches. Note that these methods do not consider to use the experience (sampled examples in the search process). Subsequently, sequential model-based optimization (SMBO) [19] is proposed to learn a proxy function from the experience and estimate the performance for unknown hyper-parameters. As one of the most popular methods, Bayesian optimization [39] learns a Gaussian process with the sampled examples, and then decides the best hyper + +parameter for the next trial by maximizing the corresponding improvement function. + +However, all these methods mostly deal with hyperparameters for particular machine learning models, which cannot handle the optimization of BPE with such an expensive evaluation step. Different from the previous methods, we evaluate and estimate the importance of the hyperparameters by sampling examples with the minimum time consumption, where hyper-parameters of minimum importances are then pruned in the next iteration, which is extremely effective and efficient to find the optimal BPE. + +# 3. Preliminaries + +# 3.1. NAS Pipeline + +Given a training set, conventional NAS algorithms [52, 49, 25] first sample an architecture in the pre-defined search space by a certain search strategy like Reinforcement Learning (RL) or Evolution Algorithm (EA). Then the sampled neural architecture is passed to the performance estimation (PE), which returns the performance of the architecture to the search algorithm. + +In most NAS methods [49, 28, 44], PE is accelerated by using a group of lower-cost hyper-parameters (like smaller image size, less channel and shallower network) in the search space $\Omega = \Theta_{1} \times \Theta_{2} \times \ldots \times \Theta_{n}$ , termed budgeted PE (BPE), which contains $n$ sorts of training hyper-parameters including the number of training epochs, batch size, learning rate, the number of layers, float point precision, channels, cutout [13] and image size. For instance, Liu et al. [28] proposed to estimate the performance of an architecture on a small network of 8 layers trained for 50 epochs, with batch size 64 and initial number of channels 16. After the search process, the optimal neural architecture is then evaluated by a fully and time-consuming training hyperparameter set $f$ . In the existing works [49, 28, 44], $f$ controls the final evaluation hyper-parameters of the optimal architecture, i.e., a large network of 20 layers is trained for 600 epochs with a batch size of 96 and an additional regularization such as cutout [13]. + +However, in this pipeline, the BPE and the final evaluation phase are decoupled. There is no guarantee that the BPE is correlated to the final evaluation step, i.e., the same architectures may have large ranking distances under different training conditions. Most NAS methods [28, 52] intuitively change BPE with fewer channels or layers. Nevertheless, extensive experiments in Sec. 5 show that the effectiveness of BPE is very sensitive, which means that it needs to carefully select and analyze the corresponding hyper-parameters in NAS. Indeed, we believe, and validated in Sec. 5, that BPE is a crucial component, while unfortunately there are no corresponding works devoted to this area. + +# 3.2. Cell based Architecture Search Space + +As mentioned in Sec. 1, BPE aims to find optimal training hyper-parameters on a specific architecture search space. In this paper, we follow the widely-used cell-based architecture search space in [49, 44, 11, 31, 34, 33, 51, 52, 50]: A network consists of a pre-defined number of cells [51], which can be either norm cells or reduction cells. Each cell takes the outputs of the two previous cells as input. A cell is a fully-connected directed acyclic graph (DAG) of $M$ nodes, i.e., $\{B_1, B_2, \dots, B_M\}$ . Each node $B_i$ takes the dependent nodes as input, and generates an output through a sum operation $B_j = \sum_{i < j} o^{(i,j)}(B_i)$ . Here each node is a specific tensor (e.g., a feature map in convolutional neural networks) and each directed edge $(i,j)$ between $B_i$ and $B_j$ denotes an operation $o^{(i,j)}(.)$ , which is sampled from the corresponding operation search space $\mathcal{O}^{(i,j)}$ . Note that the constraint $i < j$ ensures no cycles in a cell. Each cell takes the outputs of two dependent cells as input, and the two input nodes are set as $B_{-1}$ and $B_0$ for simplicity. Following [28], the operation search space $\mathcal{O}^{(i,j)}$ consists of $K = 8$ operations: $3 \times 3$ dilated convolution with rate 2, $5 \times 5$ dilated convolution with rate 2, $3 \times 3$ depth-wise separable convolution, $5 \times 5$ depth-wise separable convolution, $3 \times 3$ max pooling, $3 \times 3$ average pooling, no connection (zero), and a skip connection (identity). Therefore, the size of the whole search space $\mathcal{O}$ is $2 \times K^{|\mathcal{E}_{\mathcal{M}}|}$ , where $\mathcal{E}_{\mathcal{M}}$ is the set of possible edges with $M$ intermediate nodes in the fully-connected DAG. In our case with $M = 4$ the total number of cell structures in the search space is $2 \times 8^{2 + 3 + 4 + 5} = 2 \times 8^{14}$ , which is an extremely large space to search. + +# 4. The Proposed Method + +In this section, we first describe the formal setting of BPE in Sec. 4.1. We then present the proposed minimum importance pruning (MIP) to find the optimal BPE. + +# 4.1. Budgeted Performance Estimation + +The performance estimation is a training algorithm $A$ with $n$ hyper-parameters in a domain $\Omega$ . Given an architecture set $\mathcal{G}$ sampled from $\mathcal{O}$ , we address the following optimization problem: + +$$ +\max _ {b \in \Omega} r _ {s} \left(R _ {f}, R _ {b}\right) + \lambda \overline {{T \left(\mathcal {G} _ {b}\right)}}, \tag {1} +$$ + +where $0 < \lambda < 1$ , $r_s$ calculates the Spearman Rank Correlation between $R_f$ and $R_b$ . $R_f$ and $R_b$ are the performance on validation set of every architecture in $\mathcal{G}$ with full training hyper-parameter $f$ and BPE parameter $b$ , respectively. We aim to find the optimal $b$ with less average training consumption $\overline{T(\mathcal{G}_b)}$ on $\mathcal{G}$ . + +Optimizing Eq. 1 is extremely challenging, as we need to train over $|\mathcal{G}|$ architectures to validate one example in $\Omega$ . + +This large set of models to be trained and evaluated prevent most NAS methods to be widely deployed. Fortunately, Radosavovic et al. [32] observed that sampling about 100 models form a given architecture search space is sufficient to perform robust estimation, which is also validated in our work. Specifically, we randomly sample 100 neural architectures in the cell-based search architecture space to construct the architecture set $\mathcal{G}$ . Then $R_{f}$ and $R_{b}$ are obtained by training and validate every architecture in $\mathcal{G}$ with the hyper-parameters $f$ and $b$ , respectively. + +# 4.2. Minimum Importance Pruning + +Although the time consumption of the validation step has been drastically reduced, it is still very difficult to optimize Eq. 1, i.e., in our evaluation, the average training time of an architecture from $\mathcal{G}$ for different hyper-parameters is 10 hours on CIFAR10 benchmark. In this case, each example needs to train 100 networks, and the time consumption for one BPE example $b$ is $\sim 10^{3}$ hours. Such a time consumption is still difficult for finding an optimal BPE efficiently. + +To handle this issue we propose a minimum importance pruning (MIP) as illustrated in Fig. 2. We first sample the hyper-parameter examples around the lowest time cost. Then the sampled examples are trained to estimate the hyper-parameter importance by using random forest [16, 6]. After that, the hyper-parameter with the lowest importance is pruned by setting the value with the minimum time cost. The pruning step is ceased when there is only one hyperparameter in the search space, and the optimal BPE is the example with the maximum $r_s$ . + +Lowest time cost sampling. For each element in $\Theta_{i}$ , we introduce a category distribution related to the computational cost: + +$$ +p \left(\eta_ {i, j}\right) = \frac {\exp \left\{- F L O P s \left(\Theta_ {i , j}\right) \right\}}{\sum_ {j} \exp \left\{- F L O P s \left(\Theta_ {i , j}\right) \right\}}, \tag {2} +$$ + +where $\Theta_{i,j}$ denotes the $j$ th element of the $i$ th hyperparameter $\Theta_{i}$ . The function $FLOPs(\Theta_{i,j})$ is the number of floating point operations. We set $\Theta_{i}$ with the $j$ th element and fix other hyper-parameters in $\Omega$ by the value with the minimum time cost. An example $b$ is generated by sampling the joint probability in Eq. 2, e.g., $p(\eta) = \prod_{i=1}^{n} p(\eta_i)$ . Then, we obtain $R_b$ by training every architecture in $\mathcal{G}$ using the sampled $b$ , and the objective $r_s$ is calculated with $R_f$ by using Eq. 1. + +Random forest training. After repeating previous steps over $K = 10$ times, we get a set $\mathcal{D} = \{(b_1, r_{s,1}), (b_2, r_{s,2}), \ldots, (b_K, r_{s,K})\}$ with different BPEs and corresponding objective values, which is used as a training set for the random forest. In random forest, each tree is built from a set $\mathcal{D}_s$ drawn with a replacement sampling from $\mathcal{D}$ . Training random forest is to train multiple regression trees. Given a training set $\mathcal{D}_s$ with $b_i \in \mathbb{R}^n$ , $i =$ + +Algorithm 1: Minimum Importance Pruning +Input: Architecture search space $\mathcal{O}$ ; hyper-parameter space $\Omega$ sampling time $K = 10$ Output: Optimal BPE hyper-parameter $b$ +1 $n\gets$ The number of parameter in $\Omega$ . +2 $R\gets$ {Sample 100 network architectures in $\mathcal{O}\} .$ +3 Train $R$ with fully training condition $f$ . +4 $R_{f}\gets \{R$ 's performance on validation set}; +5 $\mathcal{D}\gets \emptyset$ . +6 while $(n > 0)$ do +7 $B = \{\mathrm{Randomly~sample~}T\mathrm{~ex~amples~in~}\Omega \mathrm{~by~}$ distribution in Eq. 2}; +8 for $b$ in $B$ do +9 Train $R$ with BPE $b$ .. +10 $R_{b}\gets \{R$ 's performance on validation set}; +11 $r_s\gets$ Spearman Rank Correlation between $R_{b}$ and $R_{f}$ .. +12 $\mathcal{D}\gets \mathcal{D}\cup \{b,r_s\}$ +13 end +14 Train random forest $\mathcal{T}$ by using Eq. 5 and Eq. 6 on $\mathcal{D}$ . +15 Calculate the importance by Eq. 8; +16 Pruning space $\Omega$ by Eq. 9; +17 $n = n - 1$ . +18 end + +$1, \dots, l$ and the corresponding spearman rank correlation vector $[r_{s,1}, r_{s,2}, \dots, r_{s,l}]$ sampled from $\mathcal{D}$ , a regression tree in the random forest recursively partitions the space such that the examples in $\mathcal{D}_s$ with similar values are grouped together. When training the regression tree, we need to consider how to measure and choose the partition feature (hyper-parameter in our case). Specifically, let the data at node $m$ be represented by $Q$ . For each candidate partition $\xi = (i, t_m)$ consisting of hyper-parameter $i$ and threshold $t_m$ , we partition the data into $Q_{left}(\xi)$ and $Q_{right}(\xi)$ subsets as follows: + +$$ +\begin{array}{l} Q _ {\text {l e f t}} (\xi) = (x, r _ {s}) \left| x _ {i} \leq t _ {m} \right. \\ Q _ {\text {r e s}} (\xi) = (x, r _ {s}) \end{array} \tag {3} +$$ + +$$ +Q _ {r i g h t} (\xi) = (x, r _ {s}) \left| x _ {i} > t _ {m}. \right. +$$ + +We further define the impurity function $H(\cdot)$ for a given split set $Q$ as + +$$ +H (Q) = \frac {1}{| Q |} \sum_ {r _ {s, i} \in Q} \left(r _ {s, i} - \overline {{r _ {s , Q}}}\right) ^ {2}, \tag {4} +$$ + +where $\overline{r_{s,Q}} = \frac{1}{|Q|}\sum_{r_{s,i}\in Q}r_{s,i}, |Q|$ denotes the number of examples in set $Q$ . And the impurity for a specific partition is the weighted sum of the impurity function: + +$$ +G (Q, \xi) = \frac {\left| Q _ {l e f t} \right| H \left(Q _ {l e f t}\right) + \left| Q _ {r i g h t} \right| H \left(Q _ {r i g h t}\right)}{\left| Q _ {l e f t} \right| + \left| Q _ {r i g h t} \right|}. \tag {5} +$$ + +We adopt the exhaustion method to find the optimal partition, that is, iterate through all possible partitions and select + +
Hyper-parameterBPE-1BPE-2DARTS[28]
Epoch103050
Batch size12812864
Learning rate0.030.030.025
N_Layers6168
Channels81616
Image Size161632
Correlation rs0.500.630.57
Training Time0.080.551.38
+ +Table 1. Detailed hyper-parameters of the best settings discovered On CIFAR10 by using MIP. The found BPE-1 and BPE-2 show a better correlation $r_s$ with less average training time (GPU Hours). + +the partition with the minimum impurity: + +$$ +\xi^ {*} = \underset {\xi} {\arg \min } G (Q, \xi). \tag {6} +$$ + +Hyper-parameter importance. For every node $m$ in the regression tree, we calculate the parameter importance as the decrease in node impurity, which is weighted by the number of samples that reach the node. The parameter importance for node $m$ is defined as: + +$$ +\begin{array}{l} I _ {m} = \left| Q _ {m} \right| H \left(Q _ {m}\right) - \left| Q _ {\{l e f t, m \}} \right| H \left(Q _ {\{l e f t, m \}}\right) \tag {7} \\ - \left| Q _ {\{r i g h t, m \}} \right| H \left(Q _ {\{r i g h t, m \}}\right). \\ \end{array} +$$ + +The importance for each $\Theta_{i}$ is the summation of the importance through the node in the random forest, which uses $\Theta_{i}$ as the partition parameter: + +$$ +I _ {\Theta_ {i}} = \frac {\sum_ {\xi_ {m} (0) = \Theta_ {i}} I _ {m}}{\sum I _ {m}}. \tag {8} +$$ + +Parameter pruning. After the importance estimation process in Eq. 8, the hyper-parameter with the lowest probability is pruned by setting + +$$ +\Theta_ {i} = \beta_ {i}, \Theta_ {i} = \arg \min I _ {\Theta}. \tag {9} +$$ + +$\beta_{i}$ is the value of the lowest FLOPs in hyper-parameter $\Theta_{i}$ when $I_{\Theta_i} < 0.1$ . Otherwise, $\beta_{i}$ is the corresponding parameter value with the maximum $r_s$ in $\mathcal{D}$ . The pruning step significantly improves the search efficiency. By setting the less important hyper-parameter to a value with less resource consumption, we can allocate more computational resource on important parameters. Our minimum importance pruning algorithm is presented in Alg. 1. + +# 5. Experiment + +As we mentioned before, the average time consumption for evaluating BPE examples is $\sim 10^{3}$ GPU hours, which means that with similar sample magnitude ( $\sim 70$ ), methods such as bayesian optimization or random search need about $7 \times 10^{4}$ GPU hours (almost infeasible). In contrast, our + +
ArchitectureTest Error (%)Params (M)Search Cost (GPU days)Search Method
ResNet-18 [15]3.5311.1-Manual
DenseNet [18]4.771.0-Manual
SENet [17]4.0511.2-Manual
NASNet-A [52]2.653.31800RL
ENAS [31]2.894.60.5RL
Path-level NAS [8]3.643.28.3RL
RL+BPE-1 (Ours)2.66 ± 0.052.70.33RL
RL+BPE-2 (Ours)2.65 ± 0.122.92RL
AmoebaNet-B [34]2.552.83150Evolution
EA+BPE-1 (Ours)2.68 ± 0.092.460.33Evolution
EA+BPE-2 (Ours)2.66 ± 0.072.872Evolution
DARTS [28]2.7 ± 0.013.11.5Gradient-based
GDAS [14]2.93 ± 0.073.40.8Gradient-based
P-DARTS [11]2.75 ± 0.063.40.3Gradient-based
SNAS [43]2.85 ± 0.022.81.5Gradient-based
DARTS + BPE-1 (Ours)2.89 ± 0.03.90.05Gradient-based
DARTS + BPE-2 (Ours)2.72 ± 0.04.040.33Gradient-based
Random Sample 1002.552.9108Random Search
Random Sample 100 + BPE-1 (Ours)2.68 ± 0.092.70.33(337×)Random Search
Random Sample 100 + BPE-2 (Ours)2.68 ± 0.051.92 (54×)Random Search
+ +Table 2. Comparing of test error rates for our discovered architecture, human-designed networks and other NAS architectures on CIFAR-10. For a fair comparison, we select the architectures and results with similar parameters (< 5M) and the same training condition (all the networks are trained with Cutout [13]). Values are $\mu \pm \sigma$ across 4 runs. + +method needs only $5.2 \times 10^{3}$ GPU hours. Therefore, we do not compare these methods in our paper. + +We first combine BPE with different search strategies including Reinforcement Learning (RL) [21], Evolutionary Algorithm (EA) [2], Random Search (RS) [4] and Different Architecture Search (DARTS) [28]. As shown in Sec. 5.1, we compare with state-of-the-art methods in terms of both effectiveness and efficiency using CIFAR10 [24] and ImageNet [35]. In Sec. 5.2, we investigate the effect of each hyper-parameter in BPE, as well as the efficiency of using Spearman Rank Correlation as the objective function. Although many works [38, 25] pointed out that the one-shot based method [37, 31, 28, 3, 50] could not effectively estimate the performance throughout the entire search space, in Sec. 5.3 we have found that these methods are indeed effective in the local search space, which reasonably explains the reproducibility and effectiveness, i.e., the corresponding algorithms are actually able to find good architectures, and the optimal architectures are quite different in different runs due to the local information. + +# 5.1. Comparing with State-of-the-arts + +We first search neural architectures by using the found BPE-1 and BPE-2 in Tab. 1, and then evaluate the best architecture with a stacked deeper network. To ensure the stability of the proposed method, we run each experiment 4 times and find that the resulting architectures only show a + +slight variance in performance. + +# 5.1.1 Experimental Settings + +We use the same datasets and evaluation metrics for existing NAS methods [28, 8, 52, 27]. First, most experiments are conducted on CIFAR-10 [23], which has $50\mathrm{K}$ training images and $10\mathrm{K}$ testing images from 10 classes with a resolution $32 \times 32$ . During the architecture search, we randomly select $5\mathrm{K}$ images from the training set as a validation set. To further evaluate the generalization capability, we stack the optimal cell discovered on CIFAR-10 into a deeper network, and then evaluate the classification accuracy on ILSVRC 2012 [35], which consists of 1,000 classes with 1.28M training images and $50\mathrm{K}$ validation images. Here, we consider the mobile setting, where the input image size is $224 \times 224$ and the FLOPs is less than 600M. + +In the search process, we directly use the found BPE-1 and BPE-2 in Tab. 1 as the performance estimation with other search algorithms. After finding the optimal architecture in the search space, we validate the final accuracy on a large network of 20 cells is trained for 600 epochs with a batch size of 96 and additional regularization such as cutout [13], which are similar to [28, 52, 31]. When stacking cells to evaluate on ImageNet, we use two initial convolutional layers of stride 2 before stacking 14 cells with the scale reduction at the 1st, 2nd, 6th and 10th cells. The total number + +
ModelTop-1Params (M)Search time (GPU days)
MobileNetV2 [36]72.03.4-
ShuffleNetV2 2x (V2) [29]73.7~5-
NASNet-A [52]74.05.31800
AmoebaNet-A [34]74.55.13150
MnasNet-92 [40]74.84.4-
SNAS [43]72.74.3522
DARTS [28]73.14.94
RL + BPE-1 (Ours)74.185.50.33
EA + BPE-1 (Ours)74.565.00.33
RS + BPE-1 (Ours)74.25.50.33
DARTS [28] + BPE-1 (Ours)74.05.90.05
+ +Table 3. Comparison with the state-of-the-art image classification methods on ImageNet. All the NAS networks in this table are searched on CIFAR10, and are then directly transferred to ImageNet. + +of FLOPs is determined by the initial number of channels. The network is trained for 250 epochs with a batch size of 512, a weight decay of $3 \times 10^{-5}$ , and an initial SGD learning rate of 0.1. All the experiments and models are implemented in PyTorch [30]. + +# 5.1.2 Result on CIFAR10 + +We compare our method with both manually designed networks and NAS networks. The manually designed networks include ResNet [15], DenseNet [18] and SENet [17]. We evaluate on four categories of NAS methods, i.e., RL methods (NASNet [52], ENAS [31] and Path-level NAS [8]), evolutionary algorithms (AmoebaNet [34]), gradient-based methods (DARTS [28]) and Random Search. + +The results for convolutional architectures on CIFAR-10 are presented in Tab. 2. It is worth noting that the found BPE combining with various search algorithms outperform various state-of-the-art search algorithms [52, 28, 33] in accuracy, with much lower computational consumption (only 0.05 GPU days $\ll 3150$ in [34]). We attribute our superior results to the found BPE. Another notable observation from Tab. 2 is that, even with random search in the search space, the test error rate is only $2.44\%$ , which outperforms previous methods in the same search space. Conclusively, with the found BPE, search algorithms can quickly explore the architecture search space and generate a better architecture. We also report the results of hand-crafted networks in Tab. 2. Clearly, our method shows a notable enhancement. + +# 5.1.3 Results on ImageNet + +We further compare our method under the mobile settings on ImageNet to demonstrate the generalizability. The best architecture on CIFAR-10 is transferred to ImageNet, which + +![](images/d523c0b6f216b05c0db793e9175ecbf1837d4ffd000ac05cbcb5b30c729a9ac0.jpg) +Figure 3. The relationship between $r_s$ and performance with random sampled BPEs in $\mathcal{D}$ . The x-axis measures the Spearman Rank Correlation $r_s$ by Eq. 1, and the y-axis measures the real architecture performance found by DARTS+BPE on CIFAR10. The correlation between $r_s$ and performance is 0.65. + +follows the same experimental settings in [52, 31, 8]. Results in Tab. 3 show that the best cell architecture on CIFAR10 is transferable to ImageNet. The proposed method achieves comparable accuracy to the state-of-the-art methods [52, 34, 27, 34, 27, 31, 28, 8] while using far less computational resources, e.g., 9, 545 times faster comparing to EA, and 5, 400 times faster comparing to RL. + +# 5.2. Deep Analysis in Performance Estimation + +We further study the efficiency of using Spearman Rank Correlation $r_s$ as the objective function in Fig. 3. In Fig. 4, we also provide a deep analysis about the importance of every hyper-parameter. One can make full use of this analysis to transfer the found BPEs to other datasets and tasks. + +We randomly select 15 hyper-parameter settings in $\Omega$ and apply them on the DARTS [28] search algorithm to find optimal architectures. Fig. 3 illustrates the relationship between $r_s$ and the accuracy of the optimal architecture found by the corresponding setting. The performance is highly correlated to $r_s$ (with a 0.65 correlation), which denotes the efficiency of the proposed objective function in Eq. 1. + +After exploring the BPE space by the proposed method, we get a dataset $\mathcal{D}$ w.r.t. each $\Theta_{i}$ and $r_s$ , which is used as the training set to train a random forest regression predictor [16] for each $\Theta_{i}$ . We then report the $r_s$ estimated by the predictor and importance for each hyper-parameter in Fig. 4. As illustrated in Fig. 4, the steepness and importance are highly correlated, i.e., the more important the parameter is, the steeper of the corresponding curve is, vice versa. At the same time, for the two most important parameters (epoch and layer), we get a high $r_s$ with a small range. This means that we only need to carefully finetune these two parameters + +![](images/3ed6296a7fedc16e7cda5fa5860d328b1833713077be83aef95a0e624fb9f492.jpg) + +![](images/b6cf39949dc0e26c447beb61139d2b20c25feef96c9462afc5969980f70262bd.jpg) + +![](images/6169497583a0dc3aab77e5f77934c0fa00f04b76d15a2b970319d3aa14deb0b1.jpg) + +![](images/bcad2345738d9509f4f81882171f25fd476255e2592af71faf1c4054b050e03d.jpg) + +![](images/fc4ffe0a85091d04ce8f3c85097f91850ae08f8f5c67739198cc0dbd7940214b.jpg) +Figure 4. The importance (within brackets) and regression predict curves with mean and variance learned by the random forest for each hyper-parameter. Importance is highly correlated to the curve steepnes. For the two most important parameters (epoch and layer), we can get a high $r_s$ within a small range. + +![](images/0493d19e6aaa2bd96b7950857a5c16a273b3afab77eba52d9454d7b14ad9c5ee.jpg) + +![](images/cb18f90a6a313fbfd6c638754c5058c28e525a783f9f0acf6e0d53d66224a94b.jpg) + +![](images/1aac9b5aa506814990fab73a92a05034566f29ae13eafeedb6211d828abce4f2.jpg) + +
Epoch
50200400600
FairGlobal rs0.10-0.060.13-0.03
Local rs0.130.500.310.31
RandomGlobal rs0.10-0.05-0.30-0.19
Local rs-0.14-0.520.61-0.01
Random_10Global rs0.00.00.02-0.08
Local rs0.260.110.570.58
+ +Table 4. Comparison of the Global $r_s$ and Local $r_s$ under different training conditions. "Fair" denotes each operation in an edge is trained with exactly the same epoch. "Random" denotes each operation in an edge is trained randomly with different random level. Global $r_s$ and local $r_s$ denote we use the trained model to evaluate the performance estimation globally and locally, respectively. + +in a small range when transferring to other datasets. + +# 5.3. Understanding One-shot based Methods + +Previous works [25, 38] have reported that one-shot based methods such as DARTS do not work well (in some cases even no better than random search). There are two main questions which are not been explained yet: (1) One-shot based methods can not make a good estimate of performance, but they can search for good neural architectures. (2) The instability of one-shot based methods, that is, the found networks are different with different random seeds. With the found BPE, we can effectively investigate every search phase in these methods. + +To understand and explain such questions, we first train the same hypergraph with different settings: (1) Fair training, each operation in an edge is trained with exactly the same epoch; (2) Random training, each operation in an edge is trained randomly at different random levels. In Tab. 4, we report the global and local $r_s$ in the case of fair training and random training. The global $r_s$ denotes that we use our + +trained hypergraph to get the validation performance for the networks in $\mathcal{G}$ , and then calculate the $r_s$ with $X_f$ . The local $r_s$ is obtained by the following steps: When training the hypergraph, we save the sampled network architectures $\mathcal{G}_t$ and the corresponding validation performance $X_{\mathcal{G}_t}$ at epoch $t$ . The local $r_s$ is then obtained by using the found BPE-2 and Eq. 1 i.e., $r_s(X_{\mathcal{G}_t}, \mathrm{BPE}-2(\mathcal{G}_t))$ . As illustrated in Tab. 4, one-shot based methods have a poor performance estimation in global $r_s$ , which is consistent with previous works [25, 38]. However, these methods have a high local $r_s$ , which means that these methods are essentially using the local information. That is to say, each epoch in the search phase can only perceive and optimize by using local information, which reasonably explains the instability of DARTS. + +# 6. Conclusion + +In this paper, we present the first systematic analysis of the budgeted performance estimation (BPE) in NAS, and propose a minimum importance pruning (MIP) towards optimal PE. The proposed MIP gradually reduces the number of BPE hyper-parameters, which allocates more computation resources on more important hyper-parameters. The found MIP-BPE is generalized to various search algorithms, including reinforcement learning, random search, evolution algorithm and gradient-based methods. Combining the found BPE with various NAS algorithms, we have reached the state-of-the-art test error $2.66\%$ on CIFAR10 with much fewer search time, which also helps us to better understand the widely-used one-shot based methods. + +Acknowledgements. This work is supported by the Nature Science Foundation of China (No.U1705262, No.61772443, No.61572410, No.61802324 and No.61702136), National Key R&D Program (No.2017YFC0113000, and No.2016YFB1001503), and Nature Science Foundation of Fujian Province, China (No. 2017J01125 and No. 2018J01106). + +# References + +[1] Youhei Akimoto, Shinichi Shirakawa, Nozomu Yoshinari, Kento Uchida, Shota Saito, and Kouhei Nishida. Adaptive stochastic natural gradient method for one-shot neural architecture search. In ICML, 2019. 3 +[2] Thomas Back. Evolutionary algorithms in theory and practice: evolution strategies, evolutionary programming, genetic algorithms. Oxford university press, 1996. 6 +[3] Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In ICML, 2018. 6 +[4] James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. JMLR, 2012. 3, 6 +[5] Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, et al. End to end learning for self-driving cars. arXiv, 2016. 2 +[6] Leo Breiman. Random forests. Machine learning, 2001. 2, 4 +[7] Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In AAAI, 2018. 2 +[8] Han Cai, Jiacheng Yang, Weinan Zhang, Song Han, and Yong Yu. Path-level network transformation for efficient architecture search. arXiv, 2018. 6, 7 +[9] Hanlin Chen, Li'an Zhuo, Baochang Zhang, Xiawu Zheng, Jianzhuang Liu, David Doermann, and Rongrong Ji. Binarized neural architecture search. arXiv preprint arXiv:1911.10862, 2019. 1 +[10] 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, 2018. 1 +[11] Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. ICCV, 2019. 1, 2, 3, 4, 6 +[12] Hao Cheng, Dongze Lian, Bowen Deng, Shenghua Gao, Tao Tan, and Yanlin Geng. Local to global learning: Gradually adding classes for training deep neural networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 1 +[13] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv, 2017. 3, 6 +[14] Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in fourgpu hours. In CVPR, 2019. 6 +[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 1, 6, 7 +[16] Holger Hoos and Kevin Leyton-Brown. An efficient approach for assessing hyperparameter importance. In ICML, pages 754-762, 2014. 2, 4, 7 +[17] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, 2018. 6, 7 +[18] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017. 6, 7 + +[19] Frank Hutter, Holger H Hoos, and Kevin Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In LION, 2011. 3 +[20] Rongrong Ji, Ke Li, Yan Wang, Xiaoshuai Sun, Feng Guo, Xiaowei Guo, Yongjian Wu, Feiyue Huang, and Jiebo Luo. Semi-supervised adversarial monocular depth estimation. IEEE transactions on pattern analysis and machine intelligence, 2019. 1 +[21] Leslie Pack Kaelbling, Michael L Littman, and Andrew W Moore. Reinforcement learning: A survey. JAIR, 1996. 6 +[22] Aaron Klein, Stefan Falkner, Simon Bartels, Philipp Hennig, and Frank Hutter. Fast bayesian optimization of machine learning hyperparameters on large datasets. arXiv, 2016. 2, 3 +[23] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, 2009. 6 +[24] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, 2009. 6 +[25] Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. arXiv, 2019. 3, 6, 8 +[26] Chenxi Liu, Liang-Chieh Chen, Florian Schroff, Hartwig Adam, Wei Hua, Alan Yuille, and Li Fei-Fei. Auto-deeplab: Hierarchical neural architecture search for semantic image segmentation. CVPR, 2019. 1 +[27] 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. In ECCV, 2018. 6, 7 +[28] Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. *ICLR*, 2019. 1, 2, 3, 4, 5, 6, 7 +[29] Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In ECCV, 2018. 7 +[30] 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. 7 +[31] Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. ICML, 2018. 1, 2, 3, 4, 6, 7 +[32] Ilija Radosavovic, Justin Johnson, Saining Xie, Wan-Yen Lo, and Piotr Dólar. On network design spaces for visual recognition. arXiv, 2019. 4 +[33] E Real, A Aggarwal, Y Huang, and QV Le. Aging evolution for image classifier architecture search. In AAAI, 2019. 1, 2, 4, 7 +[34] Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. AAAI, 2019. 1, 2, 4, 6, 7 +[35] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 2015. 6 + +[36] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *CVPR*, 2018. 7 +[37] Shreyas Saxena and Jakob Verbeek. Convolutional neural fabrics. In NeurlPS, 2016. 6 +[38] Christian Scioso, Kaicheng Yu, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. arXiv, 2019. 6, 8 +[39] Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. In NeurIPS, pages 2951-2959, 2012. 3 +[40] 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, 2019. 7 +[41] Chris Thornton, Frank Hutter, Holger H Hoos, and Kevin Leyton-Brown. Auto-weka: Combined selection and hyperparameter optimization of classification algorithms. In SIGKDD, 2013. 3 +[42] Fang Wan, Chang Liu, Wei Ke, Xiangyang Ji, Jianbin Jiao, and Qixiang Ye. C-mil: Continuation multiple instance learning for weakly supervised object detection. In IEEE CVPR, pages 2199-2208, 2019. 1 +[43] Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: stochastic neural architecture search. In ICLR, 2019. 6, 7 +[44] 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, 2019. 1, 2, 3, 4 +[45] Arber Zela, Aaron Klein, Stefan Falkner, and Frank Hutter. Towards automated deep learning: Efficient joint neural architecture and hyperparameter search. ICML Workshop, 2018. 3 +[46] Xiaosong Zhang, Fang Wan, Chang Liu, Rongrong Ji, and Qixiang Ye. Freeanchor: Learning to match anchors for visual object detection. In NeurIPS, pages 147-155, 2019. 1 +[47] Xiawu Zheng, Rongrong Ji, Xiaoshuai Sun, Yongjian Wu, Feiyue Huang, and Yanhua Yang. Centralized ranking loss with weakly supervised localization for fine-grained object retrieval. In IJCAI, pages 1226-1233, 2018. 1 +[48] Xiawu Zheng, Rongrong Ji, Xiaoshuai Sun, Baochang Zhang, Yongjian Wu, and Feiyue Huang. Towards optimal fine grained retrieval via decorrelated centralized loss with normalize-scale layer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 9291-9298, 2019. 1 +[49] Xiawu Zheng, Rongrong Ji, Lang Tang, Yan Wan, Baochang Zhang, Yongjian Wu, Yunsheng Wu, and Ling Shao. Dynamic distribution pruning for efficient network architecture search. arXiv, 2019. 1, 2, 3, 4 +[50] Xiawu Zheng, Rongrong Ji, Lang Tang, Baochang Zhang, Jianzhuang Liu, and Qi Tian. Multinomial distribution learning for effective neural architecture search. In ICCV, 2019. 3, 4, 6 +[51] Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv, 2016. 1, 2, 4 + +[52] Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In CVPR, 2018. 1, 2, 3, 4, 6, 7 \ No newline at end of file diff --git a/rethinkingperformanceestimationinneuralarchitecturesearch/images.zip b/rethinkingperformanceestimationinneuralarchitecturesearch/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cfd60c1672949602b85fb7622ce97d9e7f65e1d5 --- /dev/null +++ b/rethinkingperformanceestimationinneuralarchitecturesearch/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5c13cc3d0cf6f5013872c5b70aff927a2b6ea07d2bf39d78d14be94f6557450 +size 452563 diff --git a/rethinkingperformanceestimationinneuralarchitecturesearch/layout.json b/rethinkingperformanceestimationinneuralarchitecturesearch/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c4c2b4b4046503d164ed5fa2275162a87de1a4e7 --- /dev/null +++ b/rethinkingperformanceestimationinneuralarchitecturesearch/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3060c5e259bcbacd35ef5ca0f8c2e24192a8176b9149c52834c365b113745cf1 +size 473709 diff --git a/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_content_list.json b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c5c68aa9bf6ca0edbac167e937dc4f6d91111792 --- /dev/null +++ b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d4d23f6e7d92389f7ac101741559642f139540f58ff13b3e80fdaa6a0df2f8f +size 74936 diff --git a/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_model.json b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b76cb4932194b0acf2b23af5be6af8f7f9274849 --- /dev/null +++ b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b186007704c0fc7c13bdca932f68e0749e5235f62389dbd26ecc8f33bde8d589 +size 90364 diff --git a/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_origin.pdf b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..253b3810b0a3db9f98e78233dd5a4272629d9909 --- /dev/null +++ b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/87179fc2-4049-406a-a9d7-005bda956120_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0027d385a6bbeb6d406574ecc4d9b3c84a0b0743d7151e68affa442fe558e7e3 +size 988212 diff --git a/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/full.md b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..568ab4aad6ee32ca0048a0a8add792b63d22af2c --- /dev/null +++ b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/full.md @@ -0,0 +1,302 @@ +# Rethinking the Route Towards Weakly Supervised Object Localization + +Chen-Lin Zhang Yun-Hao Cao Jianxin Wu\* + +National Key Laboratory for Novel Software Technology Nanjing University, Nanjing, China + +{zhangcl,caoyh}@lamda.nju.edu.cn,wuqx2001@nju.edu.cn + +# Abstract + +Weakly supervised object localization (WSOL) aims to localize objects with only image-level labels. Previous methods often try to utilize feature maps and classification weights to localize objects using image level annotations indirectly. In this paper, we demonstrate that weakly supervised object localization should be divided into two parts: the class-agnostic object localization and the object classification. For class-agnostic object localization, we should use class-agnostic methods to generate noisy pseudo annotations and then perform bounding box regression on them without class labels. We propose the pseudo supervised object localization (PSOL) method as a new way to solve WSOL. Our PSOL models have good transferability across different datasets without fine-tuning. With the generated pseudo bounding boxes, we achieve $58.00\%$ localization accuracy on ImageNet and $74.97\%$ localization accuracy on CUB-200, which have a large edge over previous models. + +# 1. Introduction + +Deep convolutional neural networks have achieved enormous success in various computer vision tasks, such as classification, localization and detection. However, current deep learning models need a large number of accurate annotations, including image-level labels, location-level labels (bounding boxes and key points) and pixel-level labels (per pixel class labels for semantic segmentation). Many large-scale datasets are proposed to solve this problem [15, 10, 3]. However, models pre-trained on these large-scale datasets cannot be directly applied to a different task due to the differences between source and target domains. + +To relax these restrictions, weakly supervised methods are proposed. Weakly supervised methods try to perform detection, localization and segmentation tasks with only image-level labels, which are relatively easy and cheap to + +obtain. Among these tasks, weakly supervised object localization (WSOL) is the most practical task since it only needs to locate the object with a given class label. Most of these WSOL methods try to enhance the localization ability of classification models to conduct WSOL tasks [19, 28, 29, 2, 27] using the class activation map (CAM) [30]. + +However, in this paper, through ablation studies and experiments, we demonstrate that the localization part of WSOL should be class-agnostic, which is not related to classification labels. Based on these observations, we advocate a paradigm shift which divides WSOL into two independent sub-tasks: the class-agnostic object localization and the object classification. The overall pipeline of our method is in Fig. 1. We name this novel pipeline as Pseudo Supervised Object Localization (PSOL). We first generate pseudo groundtruth bounding boxes based on the class-agnostic method deep descriptor transformation (DDT) [26]. By performing bounding box regression on these generated bounding boxes, our method removes restrictions on most WSOL models, including the restrictions of allowing only one fully connected layer as classification weights [30] and the dilemma between classification and localization [19, 2]. + +We achieve state-of-the-art performances on ImageNet-1k [15] and CUB-200 [25] combining the results of these two independent sub-tasks, obtaining a large edge over previous WSOL models (especially on CUB-200). With classification results of the recent EfficientNet [22] model, we achieve $58.00\%$ Top-1 localization accuracy on ImageNet-1k, which significantly outperforms previous methods. + +We summarize our contributions as follows. + +- We show that weakly supervised object localization should be divided into two independent sub-tasks: the class-agnostic object localization and the object classification. We propose PSOL to solve the drawbacks and problems in previous WSOL methods. +- Though generated bounding boxes are noisy, we argue that we should directly optimize on them without using class labels. With the proposed PSOL, we achieve + +![](images/4c3178195e91617fb9541cc152dcc01e1ee8a8b79c2d01ea68bbd0cd7947c960.jpg) +Figure 1: Overall pipeline of previous WSOL methods (top) and our proposed PSOL (bottom). Previous WSOL methods need the final feature map to generate bounding boxes implicitly. However, PSOL first generates inaccurate bounding boxes using class-agnostic methods, then perform bounding box regression to predict the bounding box explicitly. + +58.00% Top-1 localization accuracy on ImageNet-1k and 74.97% Top-1 localization accuracy on CUB-200, which is far beyond previous state-of-the-art. + +- Our PSOL method has good localization transferability across different datasets without any fine-tuning, which is significantly better than previous WSOL models. + +# 2. Related Works + +Convolutional neural networks (CNN), since the success of AlexNet [8], have been widely applied in many areas of computer vision, including object localization and object detection tasks. We will briefly review detection and localization with full supervision and weak supervision in this section. + +# 2.1. Fully Supervised Methods + +After the success of AlexNet [8], researchers tried to adopt CNN to conduct object localization and detection. The pioneering work OverFeat [17] tried to use sliding window and multi-scale techniques to conduct classification, localization and detection within a single network. VGG-Net [18] adds a per-class regression and model ensemble to enhance the prediction result of localization. + +Object detection is another task that can generate bounding boxes and labels simultaneously. R-CNN [5] and FastRCNN [4] use the selective search [24] to generate candidate regions and then use CNN to classify them. FasterRCNN [14] proposes a two-stage network: the region + +proposal network (RPN) for generating regions of interest (ROI), then the R-CNN module to classify them and localize the object in the region. These popular two-stage detectors are widely used in detection tasks. YOLO [13] and SSD [11] are one stage detectors with carefully designed network structures and anchors. Recently, some anchor-free detectors are proposed to mitigate the anchor problem in common detectors like CornerNet [9] and CenterNet [31]. + +However, all these methods need massive, detailed and accurate annotations. Annotations in real-world tasks are expensive and sometimes even hard to get. So we need some other methods to perform object localization tasks without requiring many exact labels. + +# 2.2. Weakly Supervised Methods + +Weakly supervised object localization (WSOL) learns to localize the object with only image-level labels. It is more attractive since image-level labels are much easier and cheaper to obtain than object level labels. Weakly supervised detection (WSOD) tries to give the object location and category simultaneously when training images only have image-level labels. + +WSOL has the assumption that there is only one object of the specific category in the whole image. Based on this assumption, many methods are proposed to push the limit of WSOL. [30] first generates class activation maps with the global average pooling layer and the final fully connected layer (weights of the classifier). Grad-CAM [16] uses gradients rather than output features to generate more accurate class response maps. Besides these methods which focus + +on improving class response maps, some other methods try to make the classification model more suitable for localization tasks. HaS [19] tries to randomly erase some regions in the input image to force the network to be meticulous for WSOL. ACoL [28] uses two parallel classifiers with dynamic erasing and adversarial learning to discover complementary object regions more effectively. SPG [29] generates Self-Produced Guidance masks to localize the whole object. ADL [2] proposes the importance map and the drop mask, with a random selection mechanism to achieve a balance between classification and localization. + +WSOD does not have the one object in one class restriction. However, WSOD often needs methods to generate region proposals like selective search [24] and edge boxes [32], which will cost much computation resources and time. Furthermore, current WSOD detectors use high resolution inputs to output the bounding boxes, leading to heavy computational burdens. Thus, most WSOD methods are difficult to be applied to large-scale datasets. + +# 3. Methodology + +In this section, we will mainly discuss the drawbacks of the current WSOL pipeline and propose our pseudo supervised object localization (PSOL). + +# 3.1. A paradigm shift from WSOL to PSOL + +Current WSOL methods can generate the bounding box with a given class label. However, the community have identified serious drawbacks of this pipeline. + +- The learning objective is indirect, which will hurt the model's performance on localization tasks. HaS [19] and ADL [2] show that localization is not compatible with classification when only having a single CNN model. Localization tries to localize the whole object while classification tries to classify the object. The classification model often tries to localize only the most discriminative part of the object in an image. +- Offline CAM [30] has the thresholding parameter and needs to store the three-dimensional feature map for further computation. The thresholding value is tricky and hard to determine. + +Those drawbacks make WSOL hard to apply to real-world applications. + +Encouraged by the class-agnostic process that generates regions of interest (ROI) in selective search [24] and Faster-RCNN [14], we divide WSOL into two sub-tasks: the class-agnostic object localization and the object classification. Based on these two sub-tasks, we propose our PSOL method. PSOL directly optimizes the localization model on explicitly generated pseudo ground-truth bounding boxes. Hence, it removes the restrictions and drawbacks illustrated + +# Algorithm 1 Pseudo Supervised Object Localization + +Input: Training images $I_{tr}$ with class label $L_{tr}$ + +Output: Predicted bounding boxes $b_{te}$ and class labels $L_{te}$ on testing images $I_{te}$ + +1: Generate pseudo bounding boxes $\tilde{b}_{tr}$ on $I_{tr}$ +2: Train a localization CNN $F_{loc}$ on $I_{tr}$ with $\dot{b}_{tr}$ +3: Train a classification CNN $F_{cls}$ on $I_{tr}$ with $L_{tr}$ +4: Use $F_{loc}$ to predict $b_{te}$ on $I_{te}$ +5: Use $F_{cls}$ to predict $L_{te}$ on $I_{te}$ +6: Return: $b_{te}$ , $L_{te}$ + +in previous WSOL methods, and it is a paradigm shift for WSOL. + +# 3.2. The PSOL Method + +The general framework of our PSOL is in Algorithm 1. We will introduce our PSOL step by step. We will discuss the details of generating pseudo groundtruth bounding boxes in Sec 3.2.1, then the localization method used in our model in Sec 3.2.2. For the classification method, we use pre-trained models in the computer vision community directly. + +# 3.2.1 Bounding Box Generation + +The critical difference between WSOL and our PSOL is the generation of pseudo bounding boxes for training images. Detection is a natural choice for this task since detection models can provide bounding boxes and classes directly. However, the largest dataset in detection only has 80 classes [10], and it cannot provide a general object localizer for datasets with many classes such as ImageNet-1k. Furthermore, current detectors like Faster-RCNN [14] need substantial computation resources and large input image sizes (like shorter side=600 when testing). These issues prevent detection models from being applied to generate bounding boxes on large-scale datasets. + +Without detection models, we can try some localization methods to output bounding boxes for training images directly. Some weakly and co-supervised methods can generate noisy bounding boxes, and we will give a brief introduction to them. + +WSOL methods. Existing WSOL methods often follow this pipeline to generate the bounding box for an image. First the image $I$ is feed into the network $F$ , then the final feature map (often the output of the last convolutional layer) $G$ is generated: $G \in \mathbb{R}^{h \times w \times d} = F(I)$ , where $h, w, d$ are the height, width and depth of the final feature map. Then, after global average pooling and the final fully connected layer, the label $L_{pred}$ is produced. According to the predicted label $L_{pred}$ or the ground truth label $L_{gt}$ , we can get the class specific weights in the final fully connected layer + +$W \in \mathbb{R}^d$ . Then each spatial location of $G$ is channel-wise weighed and summed to get the final heat map $H$ for the specific class: $H_{i,j} = \sum_{k=1}^{d} G_{i,j,k} W_k$ . Finally, $H$ is upsampled to the original input size, and thresholding is applied to generate the final bounding box. + +DDT recap. Some co-supervised methods can also have good performances on localization tasks. DDT has good performance and little computational resource requirement among these co-supervised methods. So we use DDT [26] as an example. Here is a brief recap of DDT. Given a set of images $S$ with $n$ images, where each image $I \in S$ has the same label, or contains the same object in the image. With a pre-trained model $F$ , the final feature map is also generated: $G \in \mathbb{R}^{h \times w \times d} = \mathbb{R}^{hw \times d} = F(I)$ . Then these feature maps are gathered together into a large feature set: $G_{all} \in \mathbb{R}^{n \times hw \times d} = \mathbb{R}^{nhw \times d}$ . Principal component analysis (PCA) [12] is applied along the depth dimension. After the PCA process, we can get the eigenvector $P$ with the largest eigenvalue. Then, each spatial location of $G$ is channel-wise weighed and summed to get the final heat map $H: H_{i,j} = \sum_{k=1}^{d} G_{i,j,k} P_k$ . Then $H$ is upsampled to the original input size. Zero thresholding and max connected component analysis is applied to generate the final bounding box. + +We will generate pseudo bounding boxes using both WSOL methods and the DDT method, and evaluate their suitability. + +# 3.2.2 Localization Methods + +After generating bounding boxes, we have (pseudo) bounding box annotations for each training image. Then it is natural to perform object localization with these generate boxes. As shown before, detection models are too heavy to handle this task. Thus, it is natural to perform bounding box regression. Previous fully supervised works [18, 17] suggest two methods of bounding box regression: single-class regression (SCR) and per-class regression (PCR). PCR is strongly related to the class label. Since we advocate that localization is a class-agnostic rather than a class-aware task, we choose SCR for all our experiments. + +We follow previous work to perform bounding box regression [18]. Suppose the bounding box is in the $x, y, w, h$ format, where $x, y$ are the top-left coordinates of the bounding box and $w, h$ are the width and height of the bounding box, respectively. We first transfer $x, y, w, h$ into $x^{*}, y^{*}, w^{*}, h^{*}$ where $x^{*} = \frac{x}{w_{i}}, y^{*} = \frac{y}{h_{i}}, w^{*} = \frac{w}{w_{i}}, h^{*} = \frac{h}{h_{i}}$ , and $w_{i}$ and $h_{i}$ are the width and height of the input image, respectively. We use a sub-network with two fully connected layers and corresponding ReLU layers for regression. Finally, the outputs are sigmoid activated. We use the mean squared error loss ( $\ell_{2}$ loss) for the regression task. + +Step 2 and step 3 in Algorithm 1 may be combined, i.e., + +$F_{cls}$ and $F_{loc}$ can be integrated into a single model, which is jointly trained with classification labels and generated bounding boxes. However, we will show empirically that localization and classification models should be separated. + +# 4. Experiments + +# 4.1. Experimental Setups + +Datasets. We evaluate our proposed method on two common WSOL datasets: ImageNet-1k [15] and CUB200 [25]. The ImageNet-1k dataset is a large dataset with 1000 classes, containing 1,281,197 training images and 50,000 validation images. For training images, bounding box annotations are incomplete, and bounding box labels are complete for validation images. In this paper, we do not use any accurate training bounding box annotations. In our experiments, we generate pseudo bounding boxes on training images by previous methods. The detailed ablation studies will be in Sec 5.1. We train all models on the generated bounding box annotations and classification labels and test them on the validation dataset. + +For the CUB-200 dataset, it contains 200 categories of birds with 5,994 training images and 5,794 testing images. Each image in the dataset has an accurate bounding box annotation. We follow the strategies on ImageNet-1k to train and test models. + +Metrics. We use three metrics for evaluating our models: Top-1/Top-5 localization accuracy (Top-1/Top-5 Loc) and localization accuracy with known ground truth class (GT-Known Loc). They are following previous state-of-the-art methods [30, 2]: GT-Known Loc is correct when given the ground truth class to the model, the intersection over union (IoU) between the ground truth bounding box and the predicted box is $50\%$ or more. Top-1 Loc is correct when the Top-1 classification result and GT-Known Loc are both correct. Top-5 Loc is correct when given the Top-5 predictions of groundtruth labels and bounding boxes, there is one prediction which the classification result and localization result are both correct. + +Base Models. We prepare several baseline models for evaluating our method on localization tasks: VGG16 [18], InceptionV3 [21], ResNet50 [6] and DenseNet161 [7]. Previous methods try to enlarge the spatial resolution of the feature map [28, 29, 2], we do not use this technology in our PSOL models. Previous WSOL methods need the classification weights to turn a 3D feature map into a 2D spatial heat map. However, in PSOL, we do not need the feature map for localization, our model will directly output the bounding box for object localization. For a fair comparison, we modified VGG16 into two versions: VGG-GAP and VGG16. VGG-GAP replaces all fully connected layers in VGG16 with GAP and a single fully connected layer, and VGG16 keeps the original structures in VGG16. For + +other models, we keep the original structure of each model. For regression, we use a two-layer fully connected network with corresponding ReLU layers to replace the last layer in original networks, as illustrated in Sec 3.2.2. + +Joint and Separate Optimization In the previous section, we discussed the problem of joint optimization of classification and localization tasks. For ablating this issue, we prepare several models for each base model. For joint optimization models, we add a new bounding box regression branch to the model (-Joint models), and then train this model with both generated bounding boxes and class labels simultaneously. For separate optimization models, we replace the classification part with the regression part (-Sep models), then train these two models separately, i.e., localization models are trained with only generated bounding boxes while classification models are trained with only class labels. The hyperparameters are kept same for all models. + +# 4.2. Implementation Details + +We use the PyTorch framework with TitanX Pascal GPUs support. For all models, we use pre-trained classification weights on ImageNet-1k and fine-tune on target localization and classification tasks. + +For experiments on ImageNet-1k, the hyperparameters are set the same for all models: batch size 256, 0.0005 weight decay and 0.9 momentum. We will fine-tune all models with a start learning rate of 0.001. Added components (like the regression sub-network) will have a larger learning rates due to the random initialization. We train 6 epochs on ImageNet and 30 epochs on CUB-200. For localization only tasks, we keep the learning rate fixed among all epochs. The reason is that DDT generated bounding boxes are noisy, which contain many inaccurate or even totally wrong bounding boxes. The conclusion in [23] shows that for noisy data, we should retain large learning rates. For classification related tasks (including single classification and joint classification and localization tasks), we divide the learning rate by 10 every 2/10 epochs on ImageNet/CUB-200. + +For testing models, we use ten crop augmentations on ImageNet to output results of the final classification following [28] and [29] on ImageNet and single crop classification results on CUB200, and use single image inputs for all our localization results. We use the center crop techniques to get the image input, e.g., resize to $256 \times 256$ then center crop to $224 \times 224$ for most models except InceptionV3 (resize to $320 \times 320$ then center crop to $299 \times 299$ ), following the setup in [2, 27]. For state-of-the-art classification models, we also follow the input size in their paper, e.g., 600 for EfficientNet-B7. + +Previous WSOL methods can provide multiple boxes for a single image with different labels. However, our SCR model can only provide one bounding box output for + +Table 1: The GT-Known Loc accuracy on the ImageNet-1k validation dataset of various weakly and co-supervised localization (DDT) methods. + +
ModelImageNet-1kCUB-200
VGG16-CAM [30]59.0057.96
VGG16-ACoL [28]62.9659.30
SPG [29]64.6960.50
DDT-ResNet50 [26]59.9272.39
DDT-VGG16 [26]61.4184.55
DDT-InceptionV3 [26]51.8751.80
DDT-DenseNet161 [26]61.9278.09
+ +each image. Thus, we combine the output bounding box with Top-1/Top-5 classification outputs of baseline models $(-Sep$ models) or with outputs of the classification branch $(-Joint$ models) to get the final output to evaluate on test images. + +For experiments on CUB-200, we change the batch size from 256 to 64, and keep other hyperparameters the same as ImageNet-1k. + +# 5. Results and Analyses + +In this section, we will provide empirical results, and perform detailed analyses on them. + +# 5.1. Ablation Studies on How to Generate Pseudo Bounding Boxes + +Previous WSOL methods can generate bounding boxes with given ground truth labels. Some co-localization methods can also provide bounding boxes with a given class label. Since some annotations are missing in ImageNet-1k training images, we test these methods on the validation/test set of ImageNet-1k and CUB-200 to choose a better method to generate pseudo bounding boxes for PSOL. For the DDT method, we first resize the training images to the resolution size of $448 \times 448$ , then perform DDT on training images. According to the statistics collected on training images, we generate bounding boxes on test images with the correct class label. For other WSOL methods, we follow original instructions in their papers and use pre-trained models to generate bounding boxes on validation/test images with the correct class label. + +We list the GT-Known Loc of DDT and weakly supervised localization methods in Table 1. As shown in Table 1, DDT achieves comparable results with WSOL methods on ImageNet-1k, but achieves better performance than all WSOL methods on CUB-200. DDT results on CUB-200 indicate that object localization should not be related to classification labels. Furthermore, these WSOL methods need large computational resources, e.g., storing the feature map of each image, then perform off-line CAM operation to + +Table 2: Empirical localization accuracy results on CUB-200 and ImageNet-1k. The first column of the paper shows the model name, and the second column shows the backbone network for each model. Parameter number and FLOPs are shown in the third and fourth column. Then Top-1/Top-5 Loc accuracy of CUB-200 and ImageNet-1k are shown in the next four columns. The last column illustrates the GT-Known Loc accuracy on ImageNet-1k. For separate models like DDT and our -Sep models, we combine their localization results with classification results of baseline models. For FLOPs calculation, we only calculate convolutional operations as FLOPs and using networks on ImageNet as counting examples. Results with bold are best among the same backbone networks. + +
ModelBackboneParametersFLOPsCUB-200ImageNet-1k
Top-1 LocTop-5 LocTop-1 LocTop-5 LocGT-Known Loc
VGG16-CAM [30]VGG-GAP14.82M15.35G36.13-42.8054.8659.00
VGG16-ACoL [28]VGG-GAP45.08M43.32G45.9256.5145.8359.4362.96
ADL [2]VGG-GAP14.82M15.35G52.36-44.92--
VGG16-Grad-CAM [16]VGG16138.36M15.42G--43.4953.59-
CutMix [27]VGG-GAP138.36M15.35G52.53-43.45--
DDT-VGG16 [26]VGG16138.36M15.42G62.3078.1547.3158.2361.41
PSOL-VGG16-SepVGG16274.72M30.83G66.3084.0550.8960.9064.03
PSOL-VGG16-JointVGG16140.46M15.42G60.0775.3548.8359.0062.1
PSOL-VGG-GAP-SepVGG-GAP29.64M30.70G59.2974.8848.3658.7563.72
PSOL-VGG-GAP-JointVGG-GAP15.08M15.35G58.3972.6447.3758.4162.25
SPG [29]InceptionV338.45M66.59G46.6457.7248.6060.0064.69
ADL [2]InceptionV338.45M66.59G53.04-48.71--
PSOL-InceptionV3-SepInceptionV353.32M11.42G65.5183.4454.8263.2565.21
PSOL-InceptionV3-JointInceptionV329.21M5.71G60.3278.9852.7661.1062.83
ResNet50-CAM [30]ResNet5025.56M4.10G29.5837.2538.9949.4751.86
ADL [2]ResNet50-SE28.09M6.10G62.29-48.53--
CutMix [27]ResNet5026.61M4.10G54.81-47.25--
PSOL-ResNet50-SepResNet5050.12M8.18G70.6886.6453.9863.0865.44
PSOL-ResNet50-JointResNet5026.61M4.10G68.1783.6952.8262.0064.30
DenseNet161-CAMDenseNet16129.81M7.80G29.8139.8539.6150.4052.54
PSOL-DenseNet161-SepDenseNet16156.29M15.46G74.9789.1255.3164.1866.28
PSOL-DenseNet161-JointDenseNet16129.81M7.80G74.2487.0354.4863.4165.39
+ +get the final bounding boxes. Compared to these methods, DDT has little computation requirements and achieves comparable results. For the base model choice of DDT, though DDT-DenseNet161 has higher accuracy than DDT-VGG16 on ImageNet-1k, it runs much slower due to the dense connections and has lower accuracy than DDT-VGG16 on CUB-200. Based on these observations, we choose DDT with VGG16 to generate our bounding boxes on training images in PSOL. + +# 5.2. Comparison with State-of-the-art Methods + +In this section, we will compare our PSOL models with state-of-the-art WSOL methods: CAM [30], HaS [19], ACoL [28], SPG [29] and ADL [2] on CUB-200 and ImageNet-1k. + +We list experimental results in Table 2. Furthermore, we visualize bounding boxes generated by CAM [30], DDT [26] and our methods in Fig. 2. According to these results, we have the following findings. + +- Without any training, DDT already performs well on both CUB-200 and ImageNet. DDT-VGG16 achieves $47.31\%$ Top-1 Loc accuracy, which has a $2\sim 3\%$ edge over WSOL models based on VGG16. Since DDT is a class-agnostic method, it suggests that WSOL should be divided into two independent sub-tasks: class-agnostic object localization and object classification. +- All PSOL models with separate training perform better than PSOL models with joint training. In all five baseline models, -Sep models consistently perform better than -Joint models by large margins. These results indicate that learning with joint classification and localization is not suitable. +- All our PSOL models enjoy a large edge (mostly $>5\%$ ) on CUB-200 compared with state-of-the-art WSOL methods, including the DDT-VGG16 method. CUB-200 is a fine-grained dataset which contains many categories of birds. The within-class varia + +![](images/a2041cfbad0180d15fb8b06a76639875b63b53e3f4bf0208e39dec5394cc6c99.jpg) +CANN + +![](images/0e56c300d3eb63d54323c8ee0929e0e4959d981b10d47cb28a1c606e73e090d0.jpg) + +![](images/00da1295f089e41e69801c0c982c68e514111c128ea84e608eb79ada8121eb3c.jpg) + +![](images/42712c5437c441e003f2f711f99a9d353d9f9c9451a614a29c69fd069b9308e4.jpg) + +![](images/ff48a3a5b467632366abdf58a55b1376c420405433f318a037cc317a0bfbf12e.jpg) +(a) CUB-200-2011 + +![](images/2622a6bd7e1b06c6db6e0f59f7668e220462328a38853c6d717a15cb639f8dec.jpg) +Figure 2: Comparison of our methods with CAM and DDT. Please note that in CAM figures, yellow boxes are CAM predicted boxes and red boxes are groundtruth boxes. In figures of our methods, blue boxes are DDT generated boxes, green boxes are predicted boxes by our regression model and red boxes are groundtruth boxes. We use the DenseNet161-Sep model to output DDT and predict boxes. This figure is best viewed in color and zoomed in. + +![](images/798a8620602b55378a8a9998eb5cdc9522eb6a6ec63204312f36e4eddf6a6c0a.jpg) + +![](images/b2a5e66815838d32c2fa54f9aae16caec57d1651401ae062ab1bef7a65414834.jpg) + +![](images/a6af73908ad3fd756db3ef7d537c016b093544b5d491d3113a18ae44ac28181f.jpg) + +![](images/72f3a1a98f2fba6a8d063892bccae27d65ab7605e29653162b420d21b4dd1ecf.jpg) + +![](images/84e53901920ac1dcca1c91b576263e6dd232f8d178a6c94f722bb6ce99f46130.jpg) + +![](images/a7f0bfe227e183882a77b8a7d6412ca39086a716dd91f3be256cd321abbcfa82.jpg) + +![](images/bcb3d8cf56759f493821a99b33e7312def8aaff92d33571077e1fe2c1bf14c6b.jpg) + +![](images/c5e69aef5a523fdc6402177330026d989bd8a3a01cbb1bfb321418791827b24a.jpg) +(b) ImageNet-1k + +![](images/3cb7c54dc075f5d0eecb11d97b99bd84adca3f23419a105d46b4491d711ea723.jpg) + +![](images/45a81688a53cc52d9db65848448938d2a7896900ec4fa6eae6a4b07549306324.jpg) + +tion is much larger than the between-class variation in most fine-grained datasets [25]. The exact label may not help the process of localization. Hence, the colocalization method DDT will perform better than previous WSOL methods. + +- CNN has the ability to tolerate some incorrect annotations, and retain high accuracy on validation sets. For all separate localization models, the GT-Known Loc is higher than DDT-VGG16. This phenomenon indicates that CNN can tolerate some annotation errors and learn robust patterns from noisy data. +- Some restrictions and rules-of-thumb in WSOL do not carry over to PSOL. In previous WSOL papers, only one final fully connected layer is allowed, and large spatial size of the output feature map is recommended. Many methods try to remove the stride of the last downsample convolution layer, which will result in large FLOPs (such as SPG and VGG16-ACoL). Besides this, three fully connected layers in VGG16 are all removed, which will directly affect the accuracy. However, in our experiments, VGG-Full performs significantly better than VGG-GAP. Since CAM requires GAP and only one FC layer, when this restriction is removed, VGG16 can get better performance. Another restriction is the inference path of the network. WSOL needs the output of the last convolutional layer in the model, and often uses simple forward networks (VGG16, GoogLeNet, and InceptionV3). Complex network structures like DenseNet are not recommended and do not perform well in the WSOL problem [30]. As we show in Table 2, CAM achieves poor performance with DenseNet161. DenseNet will use features of every block, not just the last feature to conduct classification. Thus, the semantic meaning of the last feature may not as clear as the last feature of + +sequential networks like ResNet and VGG. However, PSOL-DenseNet models are directly trained on noisy bounding boxes, which can avoid this problem. Moreover, DenseNet161 achieves the best performance. + +# 5.3. Transfer Ability on Localization + +In this section, we will discuss the transferability of different localization models. + +Previous weakly supervised localization models need the exact label to generate bounding boxes, regardless of the correctness of the label. However, our proposed method does not need the label and directly generate the bounding box. So we are interested in that: Is single object localization task transferable? Does the model trained directly on object localization tasks like trained on image recognition tasks, have good generalization ability? + +We perform the following experiment. We take object localization models trained on ImageNet-1k, then predict on CUB-200 test images directly, i.e., without any training or fine-tuning process. We add previous WSOL methods for a fair comparison. Since they need exact labels, we fine-tune all these models. For all models marked with *, they are only fine-tuned with classification parts (the last fully connected layer), i.e., features learned on ImageNet-1k are directly transferred to CUB-200. For models marked without *, they are fine-tuned on CUB-200 with all layers. We take our VGG-GAP-Sep model for fair comparison and DenseNet161-Sep model for better results. Results are in Table 3. + +It is surprising that without any supervision, PSOL object localization models can transfer well from ImageNet-1k to CUB-200, which performs significantly better than previous WSOL methods, including models which only fine-tune the classification weight (models marked with $*$ ), and models which fine-tune the whole weights. It further indicates that objection localization is not dependent on classifica + +Table 3: Transfer results of our models on CUB-200 and ImageNet-1k. For a fair comparison, we add VGG-GAP with CAM, VGG16-ACoL [28] and SPG [29] for transfer experiments. VGG-GAP is fine-tuned with all layers while VGG-GAP* only fine-tunes the final fully connected layer. Please note that PSOL models trained on ImageNet-1k do not have any training or fine-tuning process on CUB-200. + +
ModelTrainedTargetGT-Known Loc
VGG-GAP + CAMCUB-200CUB-20057.96
VGG-GAP* + CAMImageNetCUB-20057.53
VGG16-ACoL + CAMCUB-200CUB-20059.30
VGG16-ACoL* + CAMImageNetCUB-20058.70
SPG + CAMCUB-200CUB-20060.50
SPG* + CAMImageNetCUB-20059.70
PSOL-VGG-GAP-SepCUB-200CUB-20080.45
PSOL-VGG-GAP-SepImageNetCUB-20089.11
PSOL-DenseNet161-SepCUB-200CUB-20092.54
PSOL-DenseNet161-SepImageNetCUB-20092.07
+ +Table 4: Top-1 and Top-5 Loc results by combining localization of our models with more state-of-the-art classification models on ImageNet-1k. + +
ModelTop-1Top-5
VGG16-ACoL+DPN13153.9461.15
VGG16-ACoL+DPN-ensemble54.8661.45
SPG + DPN13155.1962.76
SPG + DPN-ensemble56.1763.22
PSOL-InceptionV3-Sep + DPN13155.7263.64
PSOL-DenseNet161-Sep + DPN13156.5964.63
PSOL-InceptionV3-Sep + EfficientNet-B757.2564.04
PSOL-DenseNet161-Sep + EfficientNet-B758.0065.02
+ +tion, and it is inessential to perform object localization with the class label. Furthermore, it proves the advantage of our PSOL method. + +# 5.4. Combining with State-of-the-art Classification + +Previous methods try to combine localization outputs with state-of-the-art classification outputs to achieve better localization results. SPG [29] and ACoL [28] combine with DPN networks including DPN-98, DPN-131 and DPN-ensemble [1]. For a fair comparison, we also combine other models' (InceptionV3 and DenseNet161) results with DPN-131. Moreover, EfficientNet [22] achieves better results on ImageNet-1k recently. We combine our localization outputs with EfficientNet-B7's classification outputs. Results are in Table 4. + +From the table we can see that our model achieves better localization accuracy on ImageNet-1k compared with SPG [29] and ACoL [28] when combining the same classification results from DPN131 [1]. Furthermore, when combining with EfficientNet-B7 [22], we can achieve $58.00\%$ + +Table 5: Compare our method with state-of-the-art fully supervised methods on ImageNet-1k validation datasets. + +
ModelsupervisionTop-5 Loc
GoogLeNet-GAP [30]weak57.1
GoogLeNet-GAP (heuristics) [30]weak62.9
VGG16-Sepweak60.9
DenseNet161-Sepweak64.2
GoogLeNet [20]full73.3
OverFeat [17]full70.1
AlexNet [8]full65.8
VGG16 [18]full70.5
VGGNet-ensemble [18]full73.1
ResNet + Faster-RCNN-ensemble [14]full90.0
+ +Top-1 localization accuracy. + +# 5.5. Comparison with fully supervised methods + +We also compare our PSOL with fully supervised localization methods on ImageNet-1k. Fully supervised methods use training images with accurate bounding box annotations in ImageNet-1k to train their models. Results are in Table 5. + +With the bounding box regression sub-network, our DenseNet161-Sep model can roughly match fully supervised AlexNet with Top-5 Loc accuracy. However, our performances are still worse than fully supervised OverFeat, GoogLeNet and VGGNet. It is noticeable that ResNet + Faster-RCNN-ensemble [14] achieves the best Top-5 Loc accuracy. They transfer region proposal networks trained on ILSVRC detection track, which has 200 classes of fully labeled images, to the 1000-class localization tasks directly. The region proposal network shows good generalization ability among different classes without fine-tuning, which indicates that localization is separated with classification. + +# 6. Discussions and Conclusions + +In this paper, we proposed the pseudo supervised object localization (PSOL) to solve the drawbacks in previous weakly supervised object localization methods. Various experiments show that our methods obtain a significant edge over previous methods. Furthermore, our PSOL methods have good transfer ability across different datasets without any training or fine-tuning. + +For future works, we will try to dive deep into the joint classification and localization problem: We will try to integrate both tasks into a single CNN model with less localization accuracy drop. Another direction is trying to improve the quality of generating bounding boxes with class-agnostic methods. Finally, novel network structures or algorithms on localization problems should be found, which should prevent the high input resolution and computational resources in the current detection framework to apply to large-scale datasets. + +# References + +[1] Yunpeng Chen, Jianan Li, Huaxin Xiao, Xiaojie Jin, Shuicheng Yan, and Jiashi Feng. Dual path networks. In NIPS, pages 4467-4475, 2017. 8 +[2] Junsuk Choe and Hyunjung Shim. Attention-based dropout layer for weakly supervised object localization. In CVPR, pages 2219-2228, 2019. 1, 3, 4, 5, 6 +[3] 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. 1 +[4] Ross Girshick. Fast R-CNN. In ICCV, pages 1440-1448, 2015. 2 +[5] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, pages 580-587, 2014. 2 +[6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 4 +[7] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, pages 4700-4708, 2017. 4 +[8] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, pages 1097-1105, 2012. 2, 8 +[9] Hei Law and Jia Deng. CornerNet: Detecting objects as paired keypoints. In ECCV, volume 11218 of LNCS, pages 734-750, 2018. 2 +[10] 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, volume 8693 of LNCS, pages 740-755, 2014. 1, 3 +[11] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. SSD: Single shot multibox detector. In ECCV, volume 9905 of LNCS, pages 21-37, 2016. 2 +[12] Karl Pearson. On lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559-572, 1901. 4 +[13] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, pages 779-788, 2016. 2 +[14] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NIPS, pages 91-99, 2015. 2, 3, 8 +[15] 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, 4 +[16] 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 ICCV, pages 618-626, 2017. 2, 6 +[17] Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, and Yann LeCun. OverFeat: Integrated recognition, localization and detection using convolutional networks. In ICLR, pages 1-15, 2014. 2, 4, 8 +[18] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, pages 1-14, 2015. 2, 4, 8 +[19] Krishna Kumar Singh and Yong Jae Lee. Hide-and-seek: Forcing a network to be meticulous for weakly-supervised object and action localization. In ICCV, pages 3544-3553, 2017. 1, 3, 6 +[20] 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, pages 1-9, 2015. 8 +[21] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the Inception architecture for computer vision. In CVPR, pages 2818-2826, 2016. 4 +[22] Mingxing Tan and Quoc Le. EfficientNet: Rethinking model scaling for convolutional neural networks. In ICML, pages 6105-6114, 2019. 1, 8 +[23] Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In CVPR, pages 5552-5560, 2018. 5 +[24] Jasper RR Uijlings, Koen EA Van De Sande, Theo Gevers, and Arnold WM Smeulders. Selective search for object recognition. IJCV, 104(2):154-171, 2013. 2, 3 +[25] C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD birds-200-2011 dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. 1, 4, 7 +[26] Xiu-Shen Wei, Chen-Lin Zhang, Jianxin Wu, Chunhua Shen, and Zhi-Hua Zhou. Unsupervised object discovery and co-localization by deep descriptor transformation. Pattern Recognition, 88:113-126, 2019. 1, 4, 5, 6 +[27] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. CutMix: Regularization strategy to train strong classifiers with localizable features. In ICCV, page in press, 2019. 1, 5, 6 +[28] Xiaolin Zhang, Yunchao Wei, Jiashi Feng, Yi Yang, and Thomas S Huang. Adversarial complementary learning for weakly supervised object localization. In CVPR, pages 1325-1334, 2018. 1, 3, 4, 5, 6, 8 +[29] Xiaolin Zhang, Yunchao Wei, Guoliang Kang, Yi Yang, and Thomas Huang. Self-produced guidance for weakly-supervised object localization. In ECCV, volume 11216 of LNCS, pages 610-625, 2018. 1, 3, 4, 5, 6, 8 +[30] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, pages 2921-2929, 2016. 1, 2, 3, 4, 5, 6, 7, 8 +[31] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. arXiv preprint arXiv:1904.07850, 2019. 2 + +[32] C Lawrence Zitnick and Piotr Dólar. Edge boxes: Locating object proposals from edges. In ECCV, volume 8693 of LNCS, pages 391-405, 2014. 3 \ No newline at end of file diff --git a/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/images.zip b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6e6a5be3eb56ac76098c56836d48e0b9412361ea --- /dev/null +++ b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8868000de04bd04cab4383044c7e31d9562430714b7fa0cd5439b2ba7f2214e7 +size 575436 diff --git a/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/layout.json b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a3857ded8cfd262bafad92c1e7c231a0a5cb5925 --- /dev/null +++ b/rethinkingtheroutetowardsweaklysupervisedobjectlocalization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fede1265902256c53f4a11699ec39a9737e50cbe063877b79670c817d241f326 +size 351773 diff --git a/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_content_list.json b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b38c4c26cab66e00a108061e40a3f6fc01c84922 --- /dev/null +++ b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1324c5ffd3f5211020c89113d3832d847f7312b12fdfe58f8776fa7a705d8e81 +size 80171 diff --git a/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_model.json b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..35020ca7c2e2b51589adc3cafeb84deee10f1782 --- /dev/null +++ b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a35577749fff34726b1ee18ebda58e91066ae6c047ab42e9421bc8e4bebe01c +size 103107 diff --git a/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_origin.pdf b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..37bdfe738cd417af14aab16eb15c05e31a5f4c78 --- /dev/null +++ b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/3aee7e3b-fcbe-42a5-8f3f-f20164799dd7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e027038d3e9395336999e6a282b681c3b022925c20a055a363d5085c15c70caa +size 896264 diff --git a/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/full.md b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/full.md new file mode 100644 index 0000000000000000000000000000000000000000..903f595feeac69fb5e1365640055a564ae291c51 --- /dev/null +++ b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/full.md @@ -0,0 +1,360 @@ +# Rethinking Zero-shot Video Classification: End-to-end Training for Realistic Applications + +Biagio Brattoli* +Heidelberg University + +biagio.brattoli@iwr.uni-heidelberg.de + +Pietro Perona Amazon + +perona@caltech.edu + +Joseph Tighe Amazon + +tighe@amazon.com + +Fedor Zhdanov +Amazon + +fedor@amazon.com + +Krzysztof Chalupka +Amazon + +chalupkk@amazon.com + +# Abstract + +Trained on large datasets, deep learning (DL) can accurately classify videos into hundreds of diverse classes. However, video data is expensive to annotate. Zero-shot learning (ZSL) proposes one solution to this problem. ZSL trains a model once, and generalizes to new tasks whose classes are not present in the training dataset. We propose the first end-to-end algorithm for ZSL in video classification. Our training procedure builds on insights from recent video classification literature and uses a trainable 3D CNN to learn the visual features. This is in contrast to previous video ZSL methods, which use pretrained feature extractors. We also extend the current benchmarking paradigm: Previous techniques aim to make the test task unknown at training time but fall short of this goal. We encourage domain shift across training and test data and disallow tailoring a ZSL model to a specific test dataset. We outperform the state-of-the-art by a wide margin. Our code, evaluation procedure and model weights are available at github.com/bbrattoli/ZeroShotVideoClassification. + +# 1. Introduction + +Training image and video classification algorithms requires large training datasets [21, 27, 51, 52, 53]. With no task-specific training data available one may still attempt to train a model using related information and transfer the learned knowledge to classify previously unseen categories. This approach is called zero-shot learning (ZSL) [29, 34] and it is quite successful in the image domain [41, 42, 44, 45, 47, 56]. + +We focus on ZSL for video action recognition, where data sourcing and annotation is particularly expensive. + +![](images/f5f29b33bec8c87c7bc329df992e8ed7642bf709acd242b03e5bff195eb4e1fe.jpg) +Figure 1: (Top) Our model is state-of-the-art (error computed on the UCF test dataset.) (Bottom) Our e2e model is simple but powerful. URL [64], Action2Vec [18] and TARN [4] are state-of-the-art approaches. Gray blocks represent modules fixed during training. Colors (blue, red, orange, yellow) indicate modules trained in separate stages. + +Since the set of possible human actions is huge, action recognition is a great ZSL testbed. Trained on large-scale academic datasets [11, 17, 24, 25, 28, 50], supervised 3D convolutional neural networks (CNNs) proved successful in this domain [12, 51, 52]. How well modern deep networks can recognize human actions in the ZSL setting is, however, an open question. + +To our knowledge, all current ZSL methods for video + +recognition use pretrained visual embeddings [1, 4, 18, 33, 35, 54, 55, 58, 59, 60, 61, 64]. This provides a good tradeoff between training efficiency and using prior knowledge. Shallow trainable models then convert the pretrained representations to ZSL embeddings, as shown in Fig. 1 (Bottom). Low training space complexity of shallow models allows them to benefit from long video sequences [51] and large feature extractors [21]. + +In contrast, state-of-the-art algorithms in the fundamental CV domains of image classification [21], object detection [36, 38, 49] and segmentation [8, 20, 63] all rely on end-to-end (e2e) training. Representation learning is at the core of deep networks' success across machine learning domains [3], and deeper models can better utilize information available in large datasets [2, 21]. This poses a question: How can an e2e ZSL compete with current methods? + +Our contributions involve multiple aspects of ZSL video classification: + +Novel Modeling: We propose the first e2e-trained model for zero-shot action recognition. The training procedure is inspired by modern supervised video classification practices. Fig. 1 shows that our method is simple, yet outperforms previous work. Moreover, we devise a novel easy pretraining technique that targets the ZSL scenario for video recognition. + +Evaluation Protocol: We propose a novel ZSL training and evaluation protocol that enforces a realistic ZSL setting. Extending the work of Roitberg et al. [40], we test a single trained model on multiple test datasets, where sets of training and test classes are disjoint. In addition, we argue that training and test domains should not be identical. + +In-depth Analysis: We perform an in-depth analysis of the e2e model and a pretrained baseline. In a series of guided experiments we explore the characteristics of good ZSL datasets. + +Our model, training and evaluation code, are available at github.com/bbrattoli/ZeroShotVideoClassification. + +# 2. Related work + +We focus on inductive ZSL in which test data is fully unknown at training time. There exists a body of literature on transductive ZSL [1, 33, 54, 55, 59, 58, 60], where test images or videos are available during training but test labels are not. We do not discuss the transductive approach in this work. + +Video classification: Modern, DL-based video classification methods fall largely into two categories: 2D networks [48, 53] that operate on 1-5 frame snippets and 3D networks [5, 6, 7, 12, 19, 31, 46, 51, 52] that operate on 16-128 frames. One of the earliest works of this type, Simonyan and Zisserman [48], trained with only 1-5 frames sampled randomly from the video. At inference many more + +![](images/f87a7cf05c772a726a4ada94b77cb1231a95ae5062d9daff6ca5013a671b9027.jpg) +Figure 2: Training and test classes, t-SNE [30] visualization of Word2Vec embeddings. Red dots represent training classes we used, and gray dots training classes we removed in order to separate training and test data. Crosses represent test classes. Pictures are actual dataset videoframes. + +frames were sampled and the classifier outputs were averaged across all samples taken for a video clip. This implied that looking at a large chunk of the video was important during inference but wasn't strictly required during training. Wang et al. [53] showed that sampling multiple frames throughout the video during training could improve performance, opening the question whether training also requires a large temporal context. However, a body of later work based on more powerful 3D networks [7, 12, 51] showed that for most datasets sampling 16 frames during training is sufficient. Increasing training frame count from 16 to 128 improved performance only marginally. + +In this work, we adapt the training-time sampling philosophy of state-of-the-art video classification to the ZSL setup. This allows us to train the visual embedding e2e. As a consequence, the overall architecture and inference procedure are very simple compared to previous work, and the results are state-of-the-art - as shown in Fig. 1. + +Zero shot video classification: The common practice in zero-shot video classification is to first extract visual features from video frames using a pretrained network such as C3D [51] or ResNet [21], then trains a temporal model that maps the visual embedding to a semantic embedding space [4, 13, 14, 15, 16, 18, 35, 61, 64]. Good generalization on semantic embeddings of class names means that the model can be applied to new videos where the possible + +![](images/70f884bf8cfcc2de7101561fbfad6172e36bd5a8d50d0a4ed7896a949da28380.jpg) +Figure 3: Removing overlapping training and test classes. The y-axis shows Kinetics classes closest to the test sets UCF and HMDB. x-axis shows the distance (see Eq. 4) of the corresponding closest test class. In our experiments, we removed training classes closer than $\tau = 0.05$ to the test set - to the left of the red line in the figure. + +output classes are not present in training data. Inference reduces to finding the test class whose embedding is the nearest-neighbor of the model's output. Word2Vec [32] is commonly used to produce the ground-truth word embeddings. An alternative approach is to use manually crafted class attributes [23]. We decided not to pursue the manual approach as it harder to apply in general scenarios. + +Two effective recent methods, Hahn et al. [18] and Bishay et al. [4], extract C3D features from 52 clips of 16 frames from each video. They then learn a recurrent neural network [10, 22] to encode the result as a single vector. Finally, a fully connected layer maps the encoded video into Word2Vec embedding. Fig. 1 illustrates this approach. Both [18] and [4] use the same dataset for training and testing, after splitting the available dataset classes into two sets. Using a pretrained deep network is convenient because preextracted visual features easily fit in GPU memory, even for a large number of video frames. Alternative approaches use generative models to compensate for the gap between semantic and visual distributions [33, 62]. Unfortunately, performance is limited by the inability to fine-tune the visual embedding. We show fine-tuning is crucial to generalize + +across datasets. + +Our work is similar to Zhu et al. [64] in that both methods learn a universal action representation that generalizes across datasets. However, their proposed model does not leverage the potential of 3D CNNs. Instead, they utilize the very deep ResNet200 [21], pretrained on ImageNet [9, 43], which cannot utilize temporal information. + +As pointed out by Roitberg et al. [40], previous works train their models on actions overlapping with those of the target dataset, violating ZSL assumptions. For example, Zhu et al. [64] train on the full ActivityNet [11] dataset. This makes their results difficult to fairly compare with ours. Under our definition of ZSL (Sec. 3.3), Zhu et al. have 23 classes in their training datasets that overlap with the test dataset. The situation is similar for all other methods to varying degrees. + +# 3. Zero-shot action classification + +We first carefully define ZSL in the context of video classification. This will allow us to propose not only a new ZSL algorithm, but also a clear evaluation protocol that we hope will direct future research towards practical ZSL solutions. We stay within the inductive setting, as described in Sec. 2. + +# 3.1. Problem setting + +A video classification task is defined by a training set (source) $D_{s} = \{(x_{1},c_{1}),\dots ,(x_{N_{s}},c_{N_{s}})\}$ consisting of pairs of videos $x$ and their class labels $c$ , and a video-label test set $D_{t}$ . In addition, previous work often uses pretraining datasets $D_{p}$ as explained in Sec. 2. + +Intuitively, ZSL is any procedure for training a classification model on $D_{s}$ (and possibly $D_{p}$ ) and then testing on $D_{t}$ where $D_{t}$ does not overlap with $D_{s} \cup D_{p}$ . How this overlap is defined varies. Sec. 3.3 proposes a definition that is more restrictive than those used by previous work, and forces the algorithms into a more realistic ZSL setting. + +ZSL classifiers need to generalize to unseen test classes. One way to achieve this is using nearest-neighbor search in a semantic class embedding space. + +Formally, given a video $x$ , we infer the corresponding semantic embedding $z = g(x)$ and classify $x$ as the nearest-neighbor of $z$ in the set of embeddings of the test classes. Then, a trained classification model $M(\cdot)$ outputs + +$$ +M (x) = \underset {c \in D _ {t}} {\operatorname {a r g m i n}} \cos (g (x), \mathrm {W} 2 \mathrm {V} (c)). \tag {1} +$$ + +where $\cos$ is the cosine distance and the semantic embedding is computed using the Word2Vec function [32] W2V: $\mathcal{C}\to \mathbb{R}^{300}$ + +The function $g = f_s \circ f_v$ is a composition of a visual encoder $f_v \colon x \mapsto y$ and a semantic encoder $f_s \colon y \mapsto z \in \mathbb{R}^{300}$ . + +# 3.2. End-to-end training + +In previous work, the visual embedding function $f_{v}$ is either hand-crafted [60, 64] or computed by a pretrained deep network [4, 18, 55, 64]. It is fixed during optimization, forcing model development to focus on improving $f_{s}$ . Resulting models need to learn to transform fixed visual embeddings into meaningful semantic features and can be very complex, as shown in Fig. 1 (Bottom). + +Instead, we propose to optimize both $f_{v}$ and $f_{s}$ at the same time. Such e2e training offers multiple advantages: + +1. Since $f_{v}$ provides a complex computation engine, $f_{s}$ can be a simple linear layer (see Fig. 1). +2. We can implement the full model using standard 3D CNNs. +3. Pretraining the visual embedding on a classification task is not necessary. + +End-to-end optimization using the full video is unfeasible due to GPU memory limitations. Our implementation is based on standard video classification methods which are effective even when only a small snippet is used during training, as discussed in detail in Sec 2. Formally, given a training video/class pair $(x,c)\in D_s$ we extract a snippet $x^t$ of 16 frames at a random time $t\leq (\mathrm{len}(x) - 16)$ . The network is optimized by minimizing the loss + +$$ +L = \sum_ {(x, c) \in D _ {s}} \| \mathrm {W} 2 V (c) - \left(f _ {s} \circ f _ {v}\right) \left(x ^ {t}\right) \| ^ {2}. \tag {2} +$$ + +Inference procedure is similar but pools information from multiple snippets following Wang et al. [53]. Sec. 4.4 details both our training and inference procedures. + +To better understand our method's performance under various experimental conditions, we implemented a baseline model that uses identical $f_{s}$ , $f_{v}$ and training data, but fixes $f_{v}$ 's weights to values pretrained on the classification task (available out-of-the-box in the most recent PyTorch implementation, see Sec. 4.4). This was necessary since we were not able to access implementations of any of the state-of-the-art methods ([4, 18, 64]). Unfortunately, our own re-implementations achieved results far below numbers reported by their authors, even with their assistance. + +# 3.3. Towards realistic ZSL + +To ensure that our ZSL setting is realistic, we extend the methods of [40] that carefully separates training and test data. This is cumbersome to achieve in practice, and has not been attempted by most previous work. We hope that our clear formulation of the training and evaluation protocols will make it easy for future researchers to understand the performance of their models in true ZSL scenarios. + +Non-overlapping training and test classes: Our first goal is to make sure that $D_{s} \cup D_{p}$ and $D_{t}$ have "non-overlapping classes". The simple solution - to remove + +source class names from target classes or vice-versa - does not work, because two classes with slightly different names can easily refer to the same concept, as shown in Fig. 3. A distance between class names is needed. Equipped with such a metric, we can make sure training and test classes are not too similar. Formally, let $d \colon \mathcal{C} \to \mathcal{C}$ denote a distance metric on the space of all possible class names $\mathcal{C}$ , and let $\tau \in \mathbb{R}$ denote a similarity threshold. A video classification task fully respects the zero-shot constraint if + +$$ +\forall c _ {s} \in D _ {s} \cup D _ {p}, \min _ {c _ {t} \in D _ {t}} d \left(c _ {s}, c _ {t}\right) > \tau . \tag {3} +$$ + +A straightforward way to define $d$ is using semantic embeddings of class names. We define the distance between two classes to be simply + +$$ +d \left(c _ {1}, c _ {2}\right) = \cos \left(\mathrm {W} 2 \mathrm {V} \left(c _ {1}\right), \mathrm {W} 2 \mathrm {V} \left(c _ {2}\right)\right) \tag {4} +$$ + +where $\cos$ indicates cosine distance. This is consistent with the use of the cosine distance in the ZSL setting as we do in Eq. 1. Fig. 2 shows an embedding of training and test classes after we removed from Kinetics classes overlapping with test data using the procedure outlined above. Fig. 3 shows the distribution of distances between training and test classes in our datasets. There is a cliff between distances very close to 0 and larger than 0.1. In our experiments we use $\tau = 0.05$ as a natural, unbiased threshold. + +Different training and test video domains: We argue that video domains of $D_{s} \cup D_{p}$ and $D_{t}$ should differ. In previous work, the standard evaluation protocol is to use one dataset for training and testing, using 10 random splits. This does not account for domain shifts that happen in real world scenarios due to data compression, camera artefacts, and so on. For this reason ZSL training and test datasets should ideally have disjoint video sources. + +Multiple test datasets: A single ZSL model should perform well on multiple test datasets. As outlined above, previous works train and test anew for each available dataset (typically UCF and HMDB). In our experiments, training happens only once on the Kinetics dataset [25], and testing on all of UCF [50], HMDB [28] and ActivityNet [11]. + +# 3.4. Easy pretraining for video ZSL + +In a real-world scenario a model is trained once and then deployed on diverse unseen test datasets. A large and diverse training dataset is crucial to achieve good performance. Ideally, the training dataset would be tailored to the general domain of inference – for example, a strong ZSL surveillance model to be deployed at multiple unknown locations would require a large surveillance and action recognition dataset. + +Sourcing and labeling domain-specific video datasets is, however, very expensive. On the other hand, annotating images is considerably faster. Therefore, we designed a simple + +
DatasetVisualFeatUCFHMDBActivity
URL [64]ResNet20042.551.8-
DataAug [60]-18.319.7-
InfDem [39]I3D17.821.3-
Bidirectional [55]IDT21.418.9-
FairZSL [40]--23.1-
TARN [4]C3D1919.5-
Action2Vec [18]C3D22.123.5-
Ours(605classes)C3D41.525.024.8
Ours(664classes)C3D43.824.7-
Ours(605classes)R(2+1)D_1844.129.826.6
Ours(664classes)R(2+1)D_184832.7-
+ +Table 1: Comparison with the state-of-the-art on standard benchmarks. We evaluate on half test classes following Evaluation Protocol 1 (Sec. 4.3). Ours(605classes) indicates we removed all training classes that overlap with UCF, HMDB, or ActivityNet. Ours(664classes) indicates we removed only training classes overlapping with UCF and HMDB. We outperform previous work in both scenarios. Sec. 2 argues that URL's results are not compatible with other works as their training and test sets overlap and their VisualFeat is an order of magnitude deeper. + +dataset augmentation scheme which creates synthetic training videos from still images. Sec. 5 shows that pretraining our model using this dataset boosts performance, especially if available training data is small. + +We convert images to videos using the Ken Burns effect: a sequence of crops moving around the image simulates video-like motion. Sec. 4.1 provides more details. + +Our experiments focus on the action recognition domain. In action recognition (as well as in many other classification tasks), location and scenery of the video is strongly predictive of action category. Because of this we choose SUN [57], a standard scene recognition dataset. Fig. 2 shows the complete class embedding of our the scene dataset's class names. + +# 4. Experimental setup + +To facilitate reproducibility, we describe our training and evaluation protocols in detail. The protocols propose one way of training and evaluating ZSL models that is consistent with our definitions in Sec. 3.3. + +# 4.1. Datasets + +UCF101 [50] has 101 action classes primarily focused around sports, with 13320 videos sourced from YouTube. HMDB51 [28] is divided into 51 human actions focused around sports and daily activities and contains 6767 videos + +
MethodUCFHMDBActivity
Top-1Top-5Top-1Top-5Top-1Top-5
URL [64]34.2-----
664classes37.662.526.949.8--
605classes35.360.624.844.020.042.7
+ +Table 2: Evaluation on all test classes. In contrast to Table 1, here we report results of our method applied to all three test datasets using Evaluation Protocol 2 (Sec. 4.3). We applied a single model trained on classes dissimilar from all of UCF, HMDB and ActivityNet. Nevertheless, we outperform URL [64] on UCF101. URL authors do not report results on full HMDB51. Remaining previous work do not report results on neither full UCF101 nor full HMDB51. + +sourced from commercial videos and YouTube. ActivityNet [11] contains 27,801 untrimmed videos divided in 200 classes focusing on daily activities with videos sourced using web search. We extracted only the labeled frames from each video. Kinetics [25] is the largest currently available action recognition dataset, covering a wide range of human activity. The first version of the dataset contains over 200K videos divided in 400 categories. The newest version has 700 classes for a total of 541624 videos sourced from YouTube. SUN397 [57] (see Sec. 3.4) is a scene understanding image dataset. It contains 397 scene categories for a total of over 100K high-resolution images. We converted it to a simulated video dataset using the Ken Burns effect: To create a 16-frame video from an image, we randomly choose "start" and "end" crop locations (and crop sizes) in the image, and linearly interpolate to obtain 16 crops. Each of them are then resized to $112 \times 112$ . + +# 4.2. Training protocol + +Our experiments in Sec. 5 use two training methods: + +Training Protocol 1: Remove from Kinetics 700 all the classes whose distance to any class in UCF $\cup$ HMDB is smaller than $\tau$ (see Eq. 4). This results in a subset of Kinetics with 664 classes, which we call Kinetics 664. As explained in Sec. 3.3, this setting is already more restrictive than that of the previous methods, which train new models for each test dataset. + +Training Protocol 2: Remove from Kinetics 700 all the classes whose distance to any class in UCF $\cup$ HMDB $\cup$ ActivityNet is smaller than $\tau$ (see Eq. 4). This results in a subset of Kinetics with 605 classes which we call Kinetics 605. This setting is even more restrictive, but is closer to true ZSL. Our goal is to show that it is possible to train a single ZSL model that applies to multiple diverse test datasets. + +Figure 2 shows a t-SNE projection of the semantic embeddings of all Kinetics 700 classes, as well as the 101 UCF + +classes and the classes we removed to obtain Kinetics 664. + +# 4.3. Evaluation protocol + +We tested our model using two protocols: the first follows Sec. 3.3 to emulate a true ZSL setting, the second is compatible with previous work. Both Evaluation Protocols apply the same model to multiple test datasets. + +Evaluation Protocol 1: In order to make our results comparable with previous work, we use the following procedure: Randomly choose half of the test dataset's classes, 50 for UCF and 25 for HMDB. Evaluate the classifier on that test set. Repeat ten times and average the results for each test dataset. + +Evaluation Protocol 2: Previous work uses random training/test splits of UCF [50] and HMDB [28] to evaluate their algorithms. However, we train on a separate dataset Kinetics 664 / 605 and can test on full UCF and HMDB. This allows us to return more realistic accuracy scores. The evaluation protocol is simple: evaluate the classifier on all 101 UCF classes and all 51 HMDB classes. + +# 4.4. Implementation details + +In our experiments, $f_{v}$ (see Sec. 3.1) is the PyTorch implementation of R(2+1)D_18 [52] or C3D[51]. In the pretrained setting, we use the out-of-the-box R(2+1)D_18 pretrained on Kinetics 400[25], while C3D is pretrained on Sports-1M[24]. In the e2e setting, we initialize the model with the pretrained=True argument. The visual embedding $f_{v}(x)$ is BxTx512 where B is the batch size and T is the number of clips per video. We use $T = 1$ for training, and $T = 25$ for evaluation in Tables 1 and 2. The clips are 16 frames long and we choose them following standard protocols established by Wang et al. [53]. We average $f_{v}(x)$ across time (video snippets) similarly to previous approaches [51, 64]. $f_{s}$ is a linear classifier with 512x300 weights. The output of $f_{s} \circ f_{v}$ is of shape Bx300. + +We follow standard protocol in computing semantic embeddings of class names [4, 58, 64]. Word2Vec [32] - in particular, the gesim [37] Python implementation - encodes each word. We average multi-word class names. In rare cases of words not available in the pretrained W2V model (for example, 'rubiks' or 'photobombing') we manually change the words (see the code for more details). Formally, for a class name consisting of N words $c = [c^1,\dots ,c^N ]$ we embed it as $\mathrm{W}2V(c) = \sum_{i = 1}^{N}\mathrm{W}2V(c^i)\in \mathbb{R}^{300}$ . We set $\tau$ to 0.05 following the analysis in Sec. 3.3 based on Fig. 3. + +To minimize the loss of Eq. 2 we use the Adam optimizer [26], starting with a learning rate of $1e - 3$ . Batch size is 22 snippets, with 16 frames each. The model trained for 150 epochs, with a tenfold learning rate decrease at epochs 60 and 120. All experiments are performed on the Nvidia Tesla V100 GPU. + +Following [51], we reshaped each frame's shortest side + +![](images/1188c883c6bf1d6dadeb1fc6e09a22895ccfdf05d9bde7155e91d51f740d80fa.jpg) +Figure 4: Number of training classes matters in ZSL. Orange curves show performance on subsets of Kinetics 664, as we keep all the training classes and increase the subset size. The blue curves, whose markers become progressively brighter, indicate a separate experiment where we increased the number of training classes starting from 2, all the way up to 664 (Sec. 5.2). For any given training dataset size, performance on test data is much better with more training classes. In addition, when few training classes are available the e2e model is not able to outperform the baseline. + +to 128 pixels, and cropped a random $112 \times 112$ patch on training and the center patch on inference. + +# 5. Results + +Our experiments have two goals: compare our method to previous work and investigate our method's performance vs the baseline (see Sec. 3.2.) The first is necessary to validate that e2e ZSL on videos can outperform more complex approaches that use pretrained features. The latter will allow us to understand under what conditions e2e training can be particularly beneficial. + +# 5.1. Comparison to the state of the art + +Table 1 compares our method to existing approaches. We followed our Training and Evaluation Protocol 1, as described in Sections 4.2 and 4.3. Our protocols are more restrictive than that of previous methods: we removed training classes that overlap with test classes, introduced domain shift, and applied one model to multiple test datasets. Despite this, we outperform previous video-based methods by a large margin. Furthermore, when testing on UCF we outperform URL [64] which uses a network an order of mag- + +![](images/857a78e62bdb06d1a517fd74fde795b68ae46f9ce85720942e0f6e700883b3ae.jpg) +1 cluster. Error 0.84 + +![](images/710fd98fb66feefa0b7fd016a697525e48e37a54b23cf5fedeb29faeb38316ea.jpg) +3 clusters. Error 0.89 +Figure 5: Diverse training classes are good for ZSL. Here we trained our algorithm on subsets of 50 Kinetics 664 classes. (Top left) Training classes picked uniformly at random. (Top right) We clustered Word2Vec embeddings of classes into two clusters, then trained and evaluated separately using each cluster, and averaged the results. (Bottom) Here we averaged the results of training using three and six clusters. The figure shows that the more clusters, the less diverse the training classes were semantically. At the same time, less diversity caused higher errors. + +![](images/4c8523e00f6eafb0ceedbf2e56af95b723ad95cc869fb092631f14250154385c.jpg) +2 clusters. Error 0.87 + +![](images/7b007502f9f216567dba77868b92b6955e7b3001264012f502804c8e5355af66.jpg) +6 clusters. Error 0.91 + +nitude deeper than ours - 18 vs 200 layers - and 23 classes overlap between training and testing (see Sec. 2). + +# 5.2. Comparison to a baseline method + +Our baseline method described in Sec. 3.2 uses a fixed, pretrained visual feature extractor but is otherwise identical to our e2e method. This allows us to study the benefits of e2e training under Evaluation Protocol 2, (see Sections 4.2 and 4.3). Using all test classes provides a more direct evaluation of the method. + +Training dataset size: To investigate the effect of training set size on performance we subsampled Kinetics 664 uniformly at random, then re-trained and re-evaluated the model. Fig. 4 shows that the e2e algorithm consistently outperforms the baseline on both datasets. Both algorithms' performance is worse with smaller training data. However, the baseline flattens out at about 100K training datapoints, whereas our method's error keeps decreasing. This is expected, as the e2e model has more capacity. + +Number of training classes: In many video domains diverse data is difficult to obtain. Small datasets might not + +![](images/7328ff119db2f4a74c4c3085172115e26153c1526afed421f15101677bc6047e.jpg) +Figure 6: Augmented pretraining with videos-from-images. We trained our algorithm on progressively smaller subsets of Kinetics 664 classes (Sec. 5.2). We compared the results to training on the same dataset, after pretraining the model on our synthetic SUN video dataset (Sec. 5.3). The pretraining procedure boosts performance up to $10\%$ points. + +only have few datapoints, but also contain only a few training classes. We show that the number of training classes can impact ZSL results as much as training dataset size. + +To obtain Fig. 4 we subsampled Kinetics 664 class-wise. We first picked 2 Kinetics 664 classes at random, and trained the algorithm on those classes only. We repeated the procedure using 4, 10, 25, 50, 100, 200, 400 and all 664 classes. Naturally, the fewer classes the fewer datapoints the training set contained. This results are compared in Fig. 4 with the procedure described above, where we removed Kinetics datapoints at random - independent of their classes. + +The figure shows that it is better to have few training samples from a large number of classes rather than many from a very small number of classes. This effect is more pronounced for the e2e model rather than the baseline. + +Training dataset class diversity: We showed that ZSL works better with more training classes. If we have a limited budget for collecting classes and datapoints, how should we choose them? We investigated whether the set of training classes should emphasize fine differences (e.g. "shooting basketball" vs "passing basketball" vs "shooting soccerball" and so on) or diversity. + +In Fig. 5 we selected 50 training classes in four ways: (Top Left) We randomly choose 50 classes from the whole Kinetics 664 dataset, trained the algorithm on these classes, and ran inference on the test set. We repeated this process ten times and averaged inference error. (Top Right) We clustered the 664 classes into 2 clusters in the Word2Vec embedding space, and chose 50 classes at random within one of the clusters, trained and ran inference. We then repeated the procedure ten times and averaged the result. + +![](images/06909f9ac9e7359a7abc5876934173cb928cf9b622a00e825357466d8e0f9efb.jpg) +Figure 7: Error as test classes move away from training. For each UCF101 test class, we computed its distance to 10 nearest neighbors in the training dataset. We arranged all such distance thresholds on the x-axis. For each threshold, we computed the accuracy of the algorithms on test classes whose distance from training data is larger than the threshold. In other words, as x-axis moves to the right, the model is evaluated on cumulatively smaller, but harder test sets. + +(Bottom) Here we chose 50 classes in one of 3 clusters (Left) and one of 6 clusters (Right), trained, and averaged inference results of 10 runs. The figure shows that test error for our method increases as class diversity decreases. This result is not obvious, since the task becomes harder with increasing class diversity. + +# 5.3. Easy pretraining with images + +Previous section showed that class count and diversity are important drivers of ZSL performance. This inspired us to develop the pretraining method described in Sec. 3.4: we pretrain our model on a synthetic video dataset created from still images from the SUN dataset. Fig. 6 shows that this simple procedure consistently decreases test errors by up to $10\%$ . In addition, Fig. 7 shows that this initialization scheme makes the model more robust to large domain shift between train and test classes. The following section describes the latter finding in more detail. + +# 5.4. Generalization and domain shift + +A good ZSL model generalizes well to classes that differ significantly from training classes. To investigate the performance of our models under heavy domain shift, we computed the accuracy on subsets of test data with a growing distance from the training dataset. We first trained our model on Kinetics 664. Then, for a given distance threshold $\tau$ (see Sec. 3.3), we computed accuracy on the set of UCF classes whose mean distance from the closest 10 Kinetics 664 classes is larger than $\tau$ . Fig. 7 shows that the baseline model's (not trained e2e) performance drops to zero at around $\tau \sim 0.57$ . Our method performs much better, never dropping to zero accuracy for high thresholds. Finally, using the SUN pretraining further increases performance. + +
UCF101 accuracy50 classes101 classes
e2eAugmentMultiTop-1Top-5Top-1Top-5
26.855.519.840.5
✓43.068.235.156.4
✓✓45.673.136.861.7
✓✓48.074.237.662.5
✓✓✓49.277.039.865.6
+ +Table 3: Ablation study. Numbers represent classification accuracy. "50 classes" uses Evaluation Protocol 1 (Sec. 4.3.) "101 classes" uses Evaluation Protocol 2. e2e: training the visual embedding as opposed to fixed, pretrained baseline (Sec. 3.2). Augment: pretrain using the SUN augmentation scheme (Sec. 5.3). Multi: At test time, extract multiple snippets from each video and average the visual embeddings (Sec. 4.4). + +# 5.5. Ablation study + +Table 3 studies contributions of different elements of our model to its performance. The performance is low when the visual embedding is fixed. The e2e approach improves the performance by a large margin. Our class augmentation method further boosts performance. Finally it helps to extract linearly spaced snippets from a video on testing, and average their visual embeddings. Using 25 snippets improves considerably the performances without influencing the training time of the model. + +# 6. Conclusion + +We followed practices from recent video classification literature to train the first e2e system for video recognition ZSL. Our evaluation protocol is stricter than that of existing work, and measures more realistic zero-shot classification accuracy. Even under this stricter protocol, our method outperforms previous works whose performance was measured with training and test sets overlapping and sharing domains. Through a series of directed experiments, we showed that a good ZSL dataset should have many diverse classes. Guided by this insight, we formulated a simple pretraining technique that boosts ZSL performance. + +Our model is easy to understand and extend. Our training and evaluation protocols are easy to use with alternative approaches. We made our code available at github.com/bbrattoli/ZeroShotVideoClassification to encourage the community to build on our insights and create a strong foundation for future video ZSL research. + +Acknowledgement. We thank Amazon for generously supporting the project, and Alina Roitberg for a productive discussion on the evaluation protocol. + +# References + +[1] Ioannis Alexiou, Tao Xiang, and Shaogang Gong. Exploring synonyms as context in zero-shot action recognition. In 2016 IEEE International Conference on Image Processing (ICIP), pages 4190-4194. IEEE, 2016. +[2] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In The European Conference on Computer Vision (ECCV), September 2018. +[3] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798-1828, 2013. +[4] Mina Bishay, Georgios Zoumpourlis, and Ioannis Pa-tras. Tarn: Temporal attentive relation network for few-shot and zero-shot action recognition. arXiv preprint arXiv:1907.09021, 2019. +[5] Biagio Brattoli, Uta Buchler, Anna-Sophia Wahl, Martin E. Schwab, and Björn Ommer. Lstm self-supervision for detailed behavior analysis. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. +[6] Uta Buchler, Biaggio Brattoli, and Björn Ommer. Improving spatiotemporal self-supervisionby deep reinforcement learning. In IEEE Conference on European Conference on Computer Vision (ECCV), 2018. +[7] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299-6308, 2017. +[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. +[9] 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. +[10] Rahul Dey and Fathi M Salemt. Gate-variants of gated recurrent unit (gru) neural networks. In 2017 IEEE 60th international midwest symposium on circuits and systems (MWS-CAS), pages 1597–1600. IEEE, 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] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. arXiv preprint arXiv:1812.03982, 2018. +[13] Chuang Gan, Ming Lin, Yi Yang, Gerard De Melo, and Alexander G Hauptmann. Concepts not alone: Exploring pairwise relationships for zero-shot video activity recognition. In Thirtieth AAAI Conference on Artificial Intelligence, 2016. +[14] Chuang Gan, Ming Lin, Y. Yang, Y. Zhuang, and Alexander Hauptmann. Exploring semantic inter-class relationships (sir) for zero-shot action recognition. Proceedings of + +the Twenty-Ninth AAAI Conference on Artificial Intelligence, pages 3769-3775, 01 2015. +[15] Chuang Gan, Tianbao Yang, and Boqing Gong. Learning attributes equals multi-source domain generalization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 87-97, 2016. +[16] Chuang Gan, Yi Yang, Linchao Zhu, Deli Zhao, and Yueting Zhuang. Recognizing an action using its name: A knowledge-based approach. International Journal of Computer Vision, 120, 03 2016. +[17] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The” something something” video database for learning and evaluating visual common sense. In ICCV, volume 1, page 3, 2017. +[18] Meera Hahn, Andrew Silva, and James M Rehg. Action2vec: A crossmodal embedding approach to action learning. arXiv preprint arXiv:1901.00484, 2019. +[19] Kensho Hara, Hirokatsu Kataoka, and Yutaka 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, pages 6546-6555, 2018. +[20] 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. +[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] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. +[23] 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, 155:1-23, 2017. +[24] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In CVPR, 2014. +[25] 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. +[26] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[27] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097-1105, 2012. +[28] Hildegard Kuehne, Hueihan Jhuang, Estfbaliz Garrote, Tomaso Poggio, and Thomas Serre. Hmdb: a large video database for human motion recognition. In 2011 International Conference on Computer Vision, pages 2556-2563. IEEE, 2011. + +[29] Hugo Larochelle, Dumitru Erhan, and Yoshua Bengio. Zero-data learning of new tasks. In AAAI, volume 1, page 3, 2008. +[30] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579-2605, 2008. +[31] Brais Martinez, Davide Modolo, Yuanjun Xiong, and Joseph Tighe. Action recognition with spatial-temporal discriminative filter banks. In The IEEE International Conference on Computer Vision (ICCV), October 2019. +[32] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. +[33] Ashish Mishra, Vinay Kumar Verma, M Shiva Krishna Reddy, S Arulkumar, Piyush Rai, and Anurag Mittal. A generative approach to zero-shot and few-shot action recognition. In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 372-380. IEEE, 2018. +[34] Mark Palatucci, Dean Pomerleau, Geoffrey E Hinton, and Tom M Mitchell. Zero-shot learning with semantic output codes. In Advances in neural information processing systems, pages 1410-1418, 2009. +[35] AJ Piergiovanni and Michael S Ryoo. Learning shared multimodal embeddings with unpaired data. CoRR, 2018. +[36] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 779-788, 2016. +[37] Radim ōhůrek and Petr Sojka. Software Framework for Topic Modelling with Large Corpora. In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks, pages 45-50, Valletta, Malta, May 2010. ELRA. http://is.muni.cz/publication/884893/en. +[38] 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. +[39] Alina Roitberg, Ziad Al-Halah, and Rainer Stiefelhagen. Informed democracy: voting-based novelty detection for action recognition. arXiv preprint arXiv:1810.12819, 2018. +[40] Alina Roitberg, Manuel Martinez, Monica Haurilet, and Rainer Stiefelhagen. Towards a fair evaluation of zero-shot action recognition using external data. In Proceedings of the European Conference on Computer Vision (ECCV), pages 0-0, 2018. +[41] Karsten Roth, Biagio Brattoli, and Bjorn Ommer. Mic: Mining interclass characteristics for improved metric learning. In Proceedings of the IEEE International Conference on Computer Vision, pages 8000-8009, 2019. +[42] Karsten Roth, Timo Milbich, Samarth Sinha, Prateek Gupta, Bjoern Ommer, and Joseph Paul Cohen. Revisiting training strategies and generalization performance in deep metric learning. arXiv preprint arXiv:2002.08473, 2020. +[43] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. + +[44] Artsiom Sanakoyeu, Vasil Khalidov, Maureen S. McCarthy, Andrea Vedaldi, and Natalia Neverova. Transferring dense pose to proximal animal classes. In CVPR, 2020. +[45] Artsiom Sanakoyeu, Vadim Tschernezki, Uta Buchler, and Björn Ommer. Divide and conquer the embedding space for metric learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. +[46] Nawid Sayed, Biagio Brattoli, and Björn Ommer. Cross and learn: Cross-modal self-supervision. In German Conference on Pattern Recognition (GCR), 2018. +[47] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 815-823, 2015. +[48] Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. In Advances in neural information processing systems, pages 568-576, 2014. +[49] Bharat Singh, Mahyar Najibi, and Larry S Davis. Sniper: Efficient multi-scale training. In Advances in Neural Information Processing Systems, pages 9310-9320, 2018. +[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] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489-4497, 2015. +[52] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 6450-6459, 2018. +[53] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In European conference on computer vision, pages 20-36. Springer, 2016. +[54] Qian Wang and Ke Chen. Alternative semantic representations for zero-shot human action recognition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 87-102. Springer, 2017. +[55] Qian Wang and Ke Chen. Zero-shot visual recognition via bidirectional latent embedding. International Journal of Computer Vision, 124(3):356-383, 2017. +[56] Yongqin Xian, Bernt Schiele, and Zeynep Akata. Zero-shot learning-the good, the bad and the ugly. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4582-4591, 2017. +[57] Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pages 3485-3492. IEEE, 2010. +[58] Xun Xu, Timothy Hospedales, and Shaogang Gong. Semantic embedding space for zero-shot action recognition. In + +2015 IEEE International Conference on Image Processing (ICIP), pages 63-67. IEEE, 2015. +[59] Xun Xu, Timothy Hospedales, and Shaogang Gong. Transductive zero-shot action recognition by word-vector embedding. International Journal of Computer Vision, 123(3):309-333, 2017. +[60] Xun Xu, Timothy M Hospedales, and Shaogang Gong. Multi-task zero-shot action recognition with prioritised data augmentation. In European Conference on Computer Vision, pages 343-359. Springer, 2016. +[61] Bowen Zhang, Hexiang Hu, and Fei Sha. Cross-modal and hierarchical modeling of video and text. In Proceedings of the European Conference on Computer Vision (ECCV), pages 374-390, 2018. +[62] Chenrui Zhang and Yuxin Peng. Visual data synthesis via gan for zero-shot video classification. arXiv preprint arXiv:1804.10073, 2018. +[63] 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. +[64] Yi Zhu, Yang Long, Yu Guan, Shawn Newsam, and Ling Shao. Towards universal representation for unseen action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9436-9445, 2018. \ No newline at end of file diff --git a/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/images.zip b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..307dfeb3628be88ba692ed95517de74d4a4e266d --- /dev/null +++ b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a521b53f00c89d9388a9c9bf6913392a1fc20590033441c5ad484c78463b82f0 +size 449664 diff --git a/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/layout.json b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a495b88e0e04b4d9d1aec41d20d46577c09bb112 --- /dev/null +++ b/rethinkingzeroshotvideoclassificationendtoendtrainingforrealisticapplications/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28a2ea7484b666ba464e5cb84966e2e3887d7987cf3ecf90620afef01ae68613 +size 398955 diff --git a/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_content_list.json b/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..823340be2b28b8bf18b178467ed74fac1d7576dd --- /dev/null +++ b/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af1c2e54c37be6e7696a168a9a24d59bc66627aefef0ac50cf6106f976e7bdb1 +size 81675 diff --git a/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_model.json b/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..24fb58b0b6970e0a33e6206d6c48324dac2eee90 --- /dev/null +++ b/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c118b1278caee71c0b83db7abc167beb96dfc7a50c032747de855154138d1adf +size 105118 diff --git a/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_origin.pdf b/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5f8403ba6a4bce96b9c78ca75437573ef3fe110d --- /dev/null +++ b/retinafacesingleshotmultilevelfacelocalisationinthewild/4f7b959c-5667-4c2c-bccb-c5f3615567cf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35f5ab3667f14c3c6fec2b4b30b8a74f08884ff33622cdc7db99492f1a19d0f5 +size 8617450 diff --git a/retinafacesingleshotmultilevelfacelocalisationinthewild/full.md b/retinafacesingleshotmultilevelfacelocalisationinthewild/full.md new file mode 100644 index 0000000000000000000000000000000000000000..27adab64c45ce659b10d5b58aff60de15e0f25dd --- /dev/null +++ b/retinafacesingleshotmultilevelfacelocalisationinthewild/full.md @@ -0,0 +1,350 @@ +# RetinaFace: Single-shot Multi-level Face Localisation in the Wild + +Jiankang Deng * 1,2,3 Jia Guo * 2 Evangelos Ververas1,3 + +Irene Kotsia $^{4}$ Stefanos Zafeiriou $^{1,3}$ + +$^{1}$ Imperial College $^{2}$ InsightFace $^{3}$ FaceSoft $^{4}$ Middlesex University London + +{j.deng16, e.ervereras16, s.zafeiriou}@imperial.ac.uk + +guojia@gmail.com, i.kotsia@mdx.ac.uk + +# Abstract + +Though tremendous strides have been made in uncontrolled face detection, accurate and efficient 2D face alignment and 3D face reconstruction in-the-wild remain an open challenge. In this paper, we present a novel single-shot, multi-level face localisation method, named RetinaFace, which unifies face box prediction, 2D facial landmark localisation and 3D vertices regression under one common target: point regression on the image plane. To fill the data gap, we manually annotated five facial landmarks on the WIDER FACE dataset and employed a semiautomatic annotation pipeline to generate 3D vertices for face images from the WIDER FACE, AFLW and FDB datasets. Based on extra annotations, we propose a mutually beneficial regression target for 3D face reconstruction, that is predicting 3D vertices projected on the image plane constrained by a common 3D topology. The proposed 3D face reconstruction branch can be easily incorporated, without any optimisation difficulty, in parallel with the existing box and 2D landmark regression branches during joint training. Extensive experimental results show that RetinaFace can simultaneously achieve stable face detection, accurate 2D face alignment and robust 3D face reconstruction while being efficient through single-shot inference. + +# 1. Introduction + +Automatic face localisation is a prerequisite for facial image analysis in many applications such as facial attribute analysis(e.g. expression [64] and age [41, 39]) and facial identity recognition [18, 12, 56]. A narrow definition of face localisation may refer to traditional face detection [54, 62], which aims at estimating the face bounding boxes without possessing any scale and position prior. Nevertheless, in this paper we refer to a broader definition of face locali + +![](images/23e4590be22e6abd879d8c9a60c69f12747b3f4ea160a47e9d8a367512c304e1.jpg) + +![](images/8433bd391f126605099d618ec3097ea2899c1a3fb72e30a0cadebaf033ba5b12.jpg) + +![](images/0a5f1976c6458b99d6a428e2845811aa8475721b59247c8c6b8fa145f88f22a6.jpg) + +![](images/46b8b392c41a0abe65e5150ecc024eb4b83d01b91051c35de34c386f9ea5deac.jpg) + +![](images/1d7baff3fbc3ba584ca20316602b42abcdcb106ffd1b3b756f44d7826e0e9dc1.jpg) +68 Landmarks: 136 scalars + +![](images/5304eb3c83fd548647a0e12740282ea7cfd673a213cb6d8717f6b79d5755b1a7.jpg) +Mask: H x W matrix + +![](images/e1858df57c73a70f371613a759fcb6051fbb47812d83c22add590e76ce3ca8ec.jpg) +3D mesh(Ours) $3 \times 1k$ vertices + +![](images/7c677eac5504141ce336a1142014d03cf7602348f3e268ef04750d69512212dd.jpg) + +![](images/91fb2a9f7f63da1518b6d779aa0f3f83e50db715f5b179098f1eaa7fd6e10f00.jpg) +Figure 1. Face localisation tasks from coarse to fine. Face detection only predicts one center point and scales. Face pose estimation calculates the scale, 3D rotation and translation parameters. Sparse face alignment localises more semantic points. Face segmentation computes pixel-wise label maps for different semantic components (e.g. mouth, eyes). 3D face reconstruction can establish dense 3D correspondence for every pixel of a face, which is the most informative and demanding face localisation technique. + +# More Informative + +sation which includes face detection [43], face pose estimation [48, 60, 31, 5], face alignment [14, 57, 17, 16, 15, 58, 23], face segmentation [50, 34] and 3D face reconstruction [72, 1, 19, 70]. In Fig. 1, we show face localisation tasks with multiple levels of detail, from coarse to fine. + +Typically, face pose estimation, face alignment, face segmentation and 3D face reconstruction are steps subsequent to face detection. These fine-grind face localisation tasks are performed on individual face crops and the computational complexity increases linearly with the number of faces in the input image. Since all face localisation tasks from face detection to 3D face reconstruction aim at establishing the semantic correspondence between different face images, with their main difference being only in the information level, the question that arises is if can we combine them into a united framework by jointly training and make + +different tasks benefit from each other. + +The training process for face detection usually contains classification and box regression losses [21]. Chen et al. [8] proposed to combine face detection and alignment in a joint cascade framework based on the observation that aligned face shapes can provide better features for face classification. Inspired by [8], MTCNN [66] and STN [7] simultaneously detected faces and five facial landmarks. Due to training data limitation, JDA [8], MTCNN [66] and STN [7] have not verified whether detection of tiny faces can benefit from the extra supervision of five facial landmarks. + +In Mask R-CNN [25], the detection performance is significantly improved by adding a branch for predicting an object mask in parallel with the existing branch for bounding box classification and regression. This confirms that dense pixel-wise annotations are also beneficial for improving detection. In FAN [55], an anchor-level attention map is proposed to improve the occluded face detection. Nevertheless, the proposed attention map is quite coarse and does not contain semantic information. In MFN [6], a single end-to-end network is presented to jointly predict the bounding box locations and 3DMM parameters for multiple faces. This contributes to more precise face detection in the-wild by leveraging both 2D information from bounding boxes and 3D information from 3DMM parameters. However, 3DMM parameter prediction constitutes an indirect regression target when compared to semantic point prediction (e.g. box center) on the image plane. In this paper, we explore joint learning for different face localisation tasks (face detection, 2D face alignment and 3D face reconstruction) based on the single-shot [40, 69, 51] framework. To overcome the limitation of training data [6], we have manually annotated five facial landmarks for $84.6k$ faces from the WIDER FACE training dataset [59]. In addition, we set up a semi-automatic annotation pipeline to generate 1k 3D vertices for $22k$ faces from the WIDER FACE dataset [59], $27.1k$ faces from the AFLW dataset [30], and $39.3k$ faces from the FDDB full image set [28]. Based on these training data, we propose an innovative, straightforward and effective 3D mesh regression method. More specifically, we directly regress $x$ , $y$ and $z$ coordinates in the image space and add a regularization term to control the edge distance of triangles in the mesh for more accurate prediction of $z$ coordinates. + +Joint learning of face bounding box locations, five facial landmarks and 1k 3D vertices forces the network to learn exclusive facial features that characterize face pose, shape, and expression, in addition to differentiating face regions from the background. As five facial landmarks localisation and 3D vertices regression both target on predicting semantic points on the image plane, face box prediction benefits from joint learning and becomes more accurate and stable, producing less false positives. Also, as the anno + +tated but challenging face detection data [59] are employed in the joint training of face detection and the rest fine-grind face localisation tasks (for which usually less challenging datasets are employed, e.g. [30]), they directly contribute to robust 3D mesh regression. + +To summarise, our key contributions are: + +- We integrate face bounding box prediction, 2D facial landmark localisation and 3D vertices regression under a unified multi-level face localisation task with a common goal: point regression on the image plane. +- Based on a single-shot inference, we propose a mutually beneficial learning strategy to train a unified multilevel face localisation method that simultaneously predicts face bounding boxes, five 2D facial landmarks, and 1k 3D vertices. +- Our method achieves state-of-the-art performance in face detection and 2D face alignment, as well as robust 3D face reconstruction with single-shot inference. + +# 2. Related Work + +Face Detection. Inspired by generic object detection methods [21, 46, 38, 44, 45, 35, 36], face detection has recently achieved remarkable progress [27, 40, 69, 10, 51]. Different from generic object detection, face detection features smaller ratio variations (from 1:1 to 1:1.5) but much larger scale variations (from several pixels to thousands of pixels). The most recent state-of-the-art methods [40, 69, 51] focus on single-shot design [38, 36] which densely samples face locations and scales on feature pyramids [35], demonstrating promising performance and yielding faster inference compared to two-stage methods [46, 63, 10]. Following this route, we improve the performance of single-shot face detection by exploiting extra-supervisions from multi-level face localisation tasks. + +3D Face Reconstruction. Building dense pixel-to-pixel correspondence is one of the most fundamental problems in 3D face reconstruction from 2D images. Recently, a lot of works follow the approach of regressing 3DMM parameters from 2D images using CNNs [29, 72, 53, 47, 24, 52]. Jourabloo et al. [29] employs a cascade of CNNs to alternately regress the shape and pose parameters. 3DDFA [72] utilizes cascade iterations on a single CNN to jointly regress the shape and pose parameters. However, as pose and 3DMM parameters are indirect information for a 2D face image, the variations from network prediction can exert huge visual error. Most recently, model parameter regression methods have changed into dense correspondence regression approaches [1, 19]. By using the intermediate UV representation, DenseReg [1] predicts the UV coordinates and PRN [19] forecasts 3D coordinates rearranged in the UV space. However, UV transformation is still an indirect representation for a 2D image. In this paper, we resort the most straightforward 3D representation: 3D vertices pro + +jected on the image plane. This representation is consistent with the regression targets of face detection and 2D facial landmark localisation, and easy to optimise in a single-shot, multi-level face localisation framework. Due to the parallel training with face detection and 2D face alignment, our 3D face reconstruction branch is very robust under in-the-wild scenarios. + +# 3. Proposed Approach + +# 3.1. 3D Face Reconstruction + +In Fig. 3, we show a fixed number of $N$ vertices $(\mathbf{V} = [x_{1},y_{1},z_{1};x_{2},y_{2},z_{2};\dots ;x_{N},y_{N},z_{N}])$ on a predefined topological triangle context. These corresponding vertices share the same semantic meaning across different faces. With the fixed triangle topology, every pixel on the face can be indexed by the barycentric coordinates and the triangle index, thus there exists a pixel-wise correspondence with the 3D face. Comparing Mesh68 and Mesh1k in Fig. 3, it becomes obvious that more vertices make the mesh more informative and smooth. As the parameters of the last layer increase linearly with the size of the regression output, we choose to regress $1\mathrm{k} + 68$ vertices, which is a subset of 53, 215 vertices [42], carefully sampled to sufficiently retain the 3D faces structure. + +In this paper, we directly regress 3D vertices on the 2D image plane. As each densely aligned 3D face is represented by concatenating its $N$ vertex coordinates, we employ the following vertex loss to constrain the location of vertices: + +$$ +\mathcal {L} _ {v e r t} = \frac {1}{N} \sum_ {i = 1} ^ {N} | | \mathbf {V} _ {i} (x, y, z) - \mathbf {V} _ {i} ^ {*} (x, y, z) | | _ {1}, \tag {1} +$$ + +where $N = 1103$ is the number of vertices, $\mathbf{V}$ is the prediction of our model and $\mathbf{V}^*$ is the ground-truth. + +The $x$ and $y$ coordinates of visible vertices in the image space can be directly learned from input face images. However, predicting the $z$ coordinates and the $x$ and $y$ coordinates of invisible vertices is challenging due to the information loss occurring when projecting a face from 3D to 2D. By taking advantage of the 3D triangulation topology, we consider the edge length loss [37]: + +$$ +\mathcal {L} _ {\text {e d g e}} = \frac {1}{3 M} \sum_ {i = 1} ^ {M} | | \mathbf {E} _ {i} - \mathbf {E} _ {i} ^ {*} | | _ {1}, \tag {2} +$$ + +where $M = 2110$ is the number of triangles, $\mathbf{E}$ is the edge length calculated from the prediction and $\mathbf{E}^*$ is the edge length calculated from the ground truth. The edge graph is a fixed topology as shown in Fig. 3. + +By combining the vertex loss and the edge loss, we define the mesh regression loss as: $\mathcal{L}_{mesh} = \mathcal{L}_{vert} + \lambda_0\mathcal{L}_{edge}$ where $\lambda_0$ is set to 1 according to our experimental experience. + +# 3.2. Multi-level Face Localisation + +For any training anchor $i$ , we minimise the following multi-task loss: + +$$ +\begin{array}{l} \mathcal {L} = \mathcal {L} _ {c l s} \left(p _ {i}, p _ {i} ^ {*}\right) + \lambda_ {1} p _ {i} ^ {*} \mathcal {L} _ {b o x} \left(t _ {i}, t _ {i} ^ {*}\right) \\ + \lambda_ {2} p _ {i} ^ {*} \mathcal {L} _ {\text {p t s}} \left(l _ {i}, l _ {i} ^ {*}\right) + \lambda_ {3} p _ {i} ^ {*} \mathcal {L} _ {\text {m e s h}} \left(v _ {i}, v _ {i} ^ {*}\right). \tag {3} \\ \end{array} +$$ + +where $t_i, l_i, v_i$ are box, five landmarks and 1k vertices predictions, $t_i^*, l_i^*, v_i^*$ is the corresponding ground-truth, $p_i$ is the predicted probability of anchor $i$ being a face, and $p_i^*$ is 1 for the positive anchor and 0 for the negative anchor. The classification loss $\mathcal{L}_{cls}$ is the softmax loss for binary classes (face/not face). + +For a positive anchor with center coordinates $x_{center}^{a}, y_{center}^{a}$ and scale $s^a$ , we have the box size regression targets: $\log (w^{*} / s^{a})$ and $\log (h^{*} / s^{a})$ [21], where $w^{*}$ and $h^{*}$ are the width and height of the ground-truth face box. In addition, we have the following unified point regression targets for multi-level face localisation tasks: + +$$ +\begin{array}{l} \left(x _ {j} ^ {*} - x _ {\text {c e n t e r}} ^ {a}\right) / s ^ {a}, \\ (y _ {j} ^ {*} - y _ {\text {c e n t e r}} ^ {a}) / s ^ {a}, \\ \left(z _ {j} ^ {*} - z _ {\text {n o s e - t i p}} ^ {*}\right) / s ^ {a}, \tag {4} \\ \end{array} +$$ + +where $x_{j}^{*}$ and $y_{j}^{*}$ are the ground-truth coordinates of the two box corners, five facial landmarks and 1k 3D vertices in the image space, and $z_{j}^{*}$ is the ground-truth $z$ coordinates of the 1k 3D vertices. As we use orthographic projection to generate the ground-truth 3D meshes, we translate all vertices so that the $z$ coordinate of the nose tip is 0. Afterwards, we normalise the $z$ coordinates by the anchor scale. We follow [21] and use the smooth- $\mathrm{L}_1$ loss for all the above regression targets. As these three localisation tasks are homogeneous, the loss-balancing parameters $\lambda_{1} - \lambda_{3}$ are all set to 1. + +As illustrated in Fig. 4, face detection, five 2D facial landmark localisation and 3D face reconstruction are three face localisation tasks aiming at different levels of localisation detail which however, share the same target: accurate point regression on the image plane. Integrating direct regression of 3D vertices in the single-shot face detection design, induces no optimisation difficulty as it is compatible with box center regression and five facial landmark regression. Each task can benefit from other tasks such that: (1) localisation of more semantic points contributes to more accurate box prediction, and (2) more challenging training scenarios in the face detection dataset result in more robust point prediction. + +# 3.3. Single-shot Multi-level Face Localisation + +In Fig. 2, we present the framework of the proposed single-shot, multi-level face localisation approach. As can be seen, our model consists of three main components: the + +![](images/9200bd0a102cf43ce47437cf9cb37f5af300a39d1658799e4bad6a8f2643083a.jpg) +(a) Network Structure +(b) Multi-task Loss + +![](images/dd369aeb6f40ef11425905a3f77a901570a271e29976fa8d774a09eae1f7660c.jpg) +Figure 2. (a) An overview of the proposed single-shot multi-level face localisation approach. (b) Detailed illustration of our loss design. RetinaFace is designed based on the feature pyramids with five scales. For each scale of the feature maps, there is a deformable context module. Following the context modules, we calculate a joint loss (face classification, face box regression, five facial landmarks regression and 1k 3D vertices regression) for each positive anchor. To minimise the residual of localisation, we employ cascade regression. +Figure 3. A mesh consists of vertices plus triangles. Mesh68 is a coarse version used for quantitative evaluation and Mesh1k is a more elaborate version which includes facial details. In this paper, we regress Mesh68 and Mesh1k simultaneously. + +![](images/b5bab83d86942c0c6b14e39fd9ffeabda3c2e51864530b2c1a20ab229b80eaed.jpg) +Figure 4. Three face localisation tasks have different levels of detail but share the same target: accurate point prediction on the image plane. Each task can benefit from other tasks. + +feature pyramid network, the context head module and the cascade multi-task loss. First, the feature pyramid network gets the input face images and outputs five feature maps of different scale. Then, the context head module gets a feature map of a particular scale and calculates the multi-task loss (Eq. 3). In more detail, the first context head module predicts the bounding box from the regular anchor, while subsequently, the second context head module predicts a more accurate bounding box using the regressed anchor, which is generated by the first context head module. The proposed RetinaFace employs fully convolutional neural net + +works, thus it can be easily trained in an end-to-end way. + +Feature Pyramid RetinaFace employs feature pyramid levels from $P_{2}$ to $P_{6}$ , where $P_{2}$ to $P_{5}$ are computed from the output of the corresponding ResNet residual stage ( $C_{2}$ through $C_{5}$ ) using top-down and lateral connections as in [35, 36]. $P_{6}$ is calculated through a $3 \times 3$ convolution with stride=2 on $C_{5}$ . $C_{1}$ to $C_{5}$ is a pre-trained classification network on the ImageNet-11k dataset while $P_{6}$ are randomly initialised using the "Xavier" method [22]. + +Context Module Inspired by SSH [40] and Pyramid-Box [51], we also apply independent context modules on five feature pyramid levels to increase the receptive field and enhance the rigid context modelling power. We replace all $3 \times 3$ convolution layers within the lateral connections and context modules with the deformable convolution network (DCN) [11, 71], which further strengthens the non-rigid context modelling capacity. + +Cascade Multi-task Loss To further improve the performance of face localisation, we employ cascade regression [4, 65] with multi-task loss (Sec. 3.2). The loss head is a $1 \times 1$ convolution across different feature maps of dimension $H_{n} \times W_{n} \times 256$ , $n \in \{2, \ldots, 6\}$ . The first context head module predicts the bounding box from the regular anchor. Subsequently, the second context head module predicts a more accurate bounding box from the regressed anchor. + +Anchor Settings and Matching Strategy We employ scale-specific anchors on the feature pyramid levels from $P_{2}$ to $P_{6}$ similarly to [55]. Here, $P_{2}$ is designed to capture tiny faces by tiling small anchors at the cost of more computational time and with risk of more false positives. We set the scale step at $2^{1/3}$ and the aspect ratio at 1:1. With the input image size at $640 \times 640$ , the anchors can cover scales from $16 \times 16$ to $406 \times 406$ across the feature pyramid levels. In total, there are 102,300 anchors, and $75\%$ of these anchors are from $P_{2}$ . For the first head module, anchors are matched to a ground-truth box when Intersection over Union (IoU) is larger than 0.7, and to the background when IoU is less than 0.3. For the second head module, anchors are matched + +![](images/6c6ca9de4ad9898f64f7092ed5a0886e6e727942d12170b0f78c570d2ec85f1d.jpg) +(a) Five Landmarks Annotation + +![](images/cc8ea87b21e04311eafa5d526806322fb36dec589e0fd9d014a3375f95817058.jpg) +(b) 1k 3D Vertices Annotation +Figure 5. We annotate (a) five facial landmarks and (b) 1k 3D vertices on faces that can be annotated from the WIDER FACE dataset. + +to a ground-truth box when IoU is larger than 0.5, and to the background when IoU is less than 0.4. Unmatched anchors are ignored during training. We employ OHEM [49, 69] to balance the positive and negative training examples. + +# 4. Experiments + +# 4.1. Dataset + +The WIDER FACE dataset [59] consists of 32,203 images and 393,703 face bounding boxes with a high degree of variability in scale, pose, expression, occlusion and illumination. As illustrated in Fig. 5, we define five levels of face image quality [13] according to how difficult it is to annotate landmarks on the face. We have manually annotated five facial landmarks (i.e. eye centres, nose tip and mouth corners) for $84.6k$ faces on the training set and $18.5k$ faces on the validation set. To obtain accurate ground-truth 3D vertices from 2D faces, we employ a semi-automatic annotation pipeline. That is, for each face we automatically recover 68 3D landmarks [15] and employ them to drive a 3DMM fitting algorithm [3] in order to reconstruct a dense 3D face with 53K vertices, projected on the image plane. To ensure high quality in the 3DMM fitting results, we recover UV texture maps from the fitted faces and ask annotators to inspect them for artifacts. If the fitting is not accurate, the annotator manually updates the 68 landmarks and gets another automatic 3DMM fitting. If the fitting is still not accurate, the face is discarded. Finally, we get $22k$ accurate 3D face annotations from the training set. + +Following [6], we also completed $27.1k$ and $39.3k$ 3D face annotations from the AFLW dataset [30] and the full FDDB image set [28] using our semi-automatic annotation method. For the face detection task, only the training data of the WIDER FACE dataset were used. For the rest of the tasks, face annotations from both the AFLW and FDDB datasets were employed, except for the subset of faces that overlaps with faces of the AFLW2000-3D dataset [72]. + +
MethodEasyMediumHardaverage AP
Baseline95.83295.24389.87552.65
+DCN96.14995.56890.28653.36
+Cascade96.23395.67990.64254.20
Lpts96.57095.91391.16154.73
Lvert96.51295.80590.98354.55
Lmesh96.52895.82990.99154.62
L5pts+mesh96.71396.08291.44755.02
+ +Table 1. Ablation experiments of RetinaFace (ResNet-50) on the WIDER FACE validation subset and the Hard test subset. + +# 4.2. Implementation Details + +Data Augmentation As there are around $20\%$ tiny faces in the WIDER FACE training set, we follow [69, 51] to randomly crop square patches from the original images and resize them to $640 \times 640$ resolution during training. Besides random crops, we also augment the training dataset by applying random horizontal flip and photo-metric colour distortion [69]. + +Training and testing Details We train our method using a SGD optimizer (momentum at 0.9, weight decay at 0.0005, and batch size of $8 \times 4$ ) on four NVIDIA Tesla P40 (24GB) GPUs. The learning rate starts from $10^{-3}$ , rising to $10^{-2}$ after 5 epochs, then divided by 10 at 55 and 68 epochs. The training process is terminated at 80 epochs. Our implementation is on MXNet [9]. For the evaluation on WIDER FACE, we follow the standard practices of [40, 69] and employ flipping as well as multi-scale (the shorter image size at [500, 800, 1100, 1400, 1700]) strategies. Box voting [20] is applied on the union set of predicted facial boxes using an IoU threshold of 0.4. For the evaluation of other tasks, RetinaFace employs single-scale inference using the ResNet-50 backbone (model size: 155MB, speed: 22.3ms on the P40 GPU). + +# 4.3. Face Detection + +Besides the standard evaluation metric of Average Precision (AP), we also employ a more strict evaluation metric of average AP for IoU=0.5: 0.05: 0.95, rewarding more accurate face detectors. As illustrated in Tab. 1, we evaluate the performance of several different settings on the WIDER FACE validation set and report the average AP on the Hard test subset. Here, we use Resnet-50 [26] as the backbone and focus on the metric of average AP. By applying the Deformable Context Module (DCM) and cascade regression, we improve the average AP of the baseline to $54.20\%$ . + +Five facial landmarks regression $(\mathcal{L}_{pts})$ and 1k 3D vertices regression $(\mathcal{L}_{vert})$ improve the average AP by $0.53\%$ and $0.35\%$ , respectively. The difference in improvement percentage is due to the annotation of five facial landmarks being much easier than annotating 3D vertices, and thus more training data with 5 facial points annotations can be + +![](images/485e94d9e9f21c74b5bff379d99a8053f8541cb6cd5868f6de99b1e629d7ea8b.jpg) +(a) False Positive Suppression + +![](images/1445031b5bac72343e3b8ab7de1ba6d7ab9e7867993fd4af89439cca9fa75847.jpg) + +![](images/1effe6305516070d9d73d0b744b0713963818c50270b489790b4a84185db644b.jpg) + +![](images/6cf24baaf429bce974ded53b1dbaf39b8ae9129ba45bee46a6610dc84ae1a3ea.jpg) +(b) False Positive Examples + +![](images/c923e7558b84d8059fef1ca21b2593e8ffe5eda0524f704126c18c724ad5f52c.jpg) + +![](images/e4aff745debbe5e31bda67c2ef719ec0d3460a17611efe14adf6822687d3998c.jpg) +Figure 6. Joint five facial landmarks regression and 1k 3D vertices regression can (a) significantly decrease the scores of false positives, and (b) effectively suppress high-score false positives. + +![](images/aee951037ce55593a493dea88c35259d411a942eae52081d202239dd153806d7.jpg) + +![](images/a217a7cee503e8afa9a1b25e3f5b232b17f86a4850e77d7d07d9d171967bf804.jpg) + +![](images/2c0b53b62fd1d01db3dd1da0d4abf9ee1111772f2fc45eb090997194ca485d92.jpg) + +![](images/08a4bf5491a10350f587c24ba740af7c386f0a66e323265c38e9d870f0f9ba78.jpg) + +included, aiding to achieve a higher performance. Adding topology constraints into 1k 3D vertices regression only slightly improves face detection. However, they are beneficial for predicting $z$ coordinates and pose (Sec. 4.5). We therefore employ the mesh loss $(\mathcal{L}_{mesh})$ . Combining five facial landmark regression and mesh regression significantly improves the performance by $0.82\%$ . + +Besides improving the accuracy of facial boxes, joint five facial landmark regression and 1k 3D vertices regression can effectively suppress the scores of false positives as illustrated in Fig. 6(a). In Fig. 6(b), we show some high-score false positives $(>0.9)$ produced from the baseline. RetinaFace assigns much lower scores $(<0.3)$ to these crops. Moreover, for the baseline the class information for a face is only a binary label and no information exists about the image quality. In contrast, we annotate 1k 3D vertices for easy-to-medium level faces, and five facial landmarks for faces that can be annotated. These annotations implicitly indicate the information level of faces, which can be learned by our model. Therefore, RetinaFace only gives high confidence scores for very informative faces and low scores for less informative faces. + +To obtain the evaluation results from the WIDER FACE leader-board, we submitted the detection results of RetinaFace (ResNet-152) to the organisers. As shown in Fig. 7, we compared RetinaFace with other 29 state-of-the-art face detection algorithms (e.g. SSH [40], SFD [69], PyramidBox [51], DSFD [33], SFDet [68], RefineFace [67] etc.). Our approach sets up a new impressive record in terms of AP $(91.7\%)$ and outperforms these state-of-the-art methods on the Hard subset which contains a large number of tiny faces. + +# 4.4. Five Facial Landmark Localisation + +Face detection datasets are more challenging [59] than the face alignment datasets, which are usually collected by a pre-trained face detector with a high threshold. In the following experiments, we explore the benefits of training for point regression and face detection simultaneously. + +To evaluate the accuracy of five facial landmark localisation, we compare RetinaFace with MTCNN [66] and + +![](images/b0de0fb4a655c9f6e7858e65fd03ff43036293e367c5383520aa2fdf46f430bc.jpg) +Figure 7. Precision-recall curves of RetinaFace (ResNet-152) on the WIDER FACE test Hard subsets. + +
MethodAUC (%)Failure Rate (%)
MTCNN [66]36.6326.31
STN [7]42.6324.23
RetinaFace-MobileNet0.547.1219.72
RetinaFace-R5058.549.82
RetinaFace(w/o 3D)-R5055.6610.25
AFLW-R50-gtbox44.9125.40
Wider-R50-gtbox61.558.78
+ +Table 2. Summary of five facial landmark localisation results on the WIDER FACE dataset. Accuracy is reported as the Area Under The Curve (AUC) and the Failure Rate (threshold at $10\%$ ). “-gtbox” refers to crop-based face alignment based on ground-truth facial boxes. + +STN [7] on the WIDER FACE validation set (18.5k faces). Here, we employ the face box size $(\sqrt{W\times H})$ as the normalisation distance. In Fig. 8(a), we show the Cumulative Error Distribution (CED) curves on the WIDER FACE validation set. As shown in Tab. 2, RetinaFace-MobileNet0.5 outperforms the baselines and decrease the failure rate to $19.72\%$ . By employing a deeper backbone (ResNet-50), RetinaFace-R50 further reduces the failure rate to $9.82\%$ . After removing the 3D mesh regression branch from RetinaFace, the AUC obviously decreases from $58.54\%$ to $55.66\%$ . This is because 3D mesh regression is pose-invariant and a joint training framework can improve the accuracy of 2D five facial landmarks. In Fig. 8(b), we test RetinaFace on the AFLW2000-3D profile subset (232 faces) [72], and we confirm that 3D mesh regression can significantly improve five facial landmark localisation under the large-pose scenario. + +We further train two crop-based five facial landmark regression networks (ResNet-50) on the AFLW dataset (24,386 faces) [30] and the WIDER FACE dataset, separately. Even with the ground-truth facial boxes, the model trained on AFLW still has a high failure rate $(25.40\%)$ , which indicates the difference in the difficulty level between the face alignment dataset (AFLW) and the face detection dataset (WIDER FACE). Even though the model trained on WIDER FACE achieves the highest performance, the computational complexity increases linearly with the number of faces in the input image. However, RetinaFace achieves + +![](images/f9820d2617a69c689c90ba3189e52d48d1991f88ae12f3896c638705f41696da.jpg) +(a) CED on WIDER FACE + +![](images/f77ba81bacaf9deb7becace5196babbcabf52cf3b5e88fa0f4d1ccfa53078609.jpg) +(b) NME on AFLW Profile +Figure 8. Qualitative comparison between baselines and RetinaFace on five facial landmark localisation. (a) CED on the WIDER FACE validation set (18k faces) (b) NME on the AFLW2000-3D profile subset [72]. + +
Method[0°,30°][30°,60°][60°,90°]Mean
SDM [72]3.674.949.676.12
3DDFA [72]3.434.247.174.94
Yu et al. [61]3.626.069.566.41
3DSTN [2]3.154.335.984.49
PRN [19]2.753.514.613.62
FAME [5]3.113.846.604.52
SS-SFN [6]3.094.275.594.31
MS-SFN [6]2.913.834.943.89
Lvert2.773.704.953.81
Lmesh2.723.654.813.72
L5pts+mesh2.573.324.563.48
+ +only slightly lower performance while its computational complexity remains fixed independently of the number of faces in each image. + +# 4.5.3D Vertex Regression + +Following [19], we evaluate the accuracy of 3D vertex regression on the AFLW2000-3D dataset [72] considering 68 points with the 2D projected coordinates. The mean error is normalised by the bounding box size [72]. In addition, our 3D vertex prediction can be used for (1) pose-invariant facial component segmentation [1], and (2) 3D pose estimation by utilizing a least squares solution [19] instead of solving a PnP problem. + +In Tab. 3, we compare the proposed RetinaFace (ResNet-50) with other state-of-the-art dense regression algorithms (e.g. PRN [19] and MS-SFN [6] etc.) for 68 landmark localisation under yaw angle variations. The proposed direct 3D vertex regression is more than able to handle 68 facial landmark localisation under pose-variations, achieving an impressive NME of $3.81\%$ . 3D topology constraints help to slightly decrease the NME to $3.72\%$ . After training the 2D landmark regression and 3D mesh regression jointly with the face detector, we achieve better performance than state-of-the-art methods. PRN [19] employs UV position map regression and MS-SFN [6] uses 3DMM parameter regression, both of which are indirect regression methods. In contrast, our method directly regresses the projected 3D ver + +Table 3. Comparison of NME(%) for 68 points on the AFLW2000-3D dataset. + +
MethodEyebrowEyeNoseLip
DenseReg [1]47.6274.2987.7172.35
\( \mathcal{L}_{5pts+vert} \)71.376.8590.9075.43
\( \mathcal{L}_{5pts+mesh} \)72.2378.5192.2177.55
+ +Table 4. Semantic segmentation accuracy on the Helen test set [32] measured using IoU ratio. + +
Method[0°,30°][30°,60°][60°,90°]
DenseReg [1]4.14 ± 3.935.96 ± 4.746.38 ± 4.90
PRN [19]3.96 ± 3.435.75 ± 4.426.08 ± 4.41
L5pts+vert3.79 ± 3.085.28 ± 3.835.60 ± 3.81
L5pts+mesh3.69 ± 2.995.11 ± 3.735.41 ± 3.57
+ +Table 5. Yaw angle estimation on the AFLW2000-3D dataset. + +tices on the image plane, which can benefit from challenging training scenarios of face detection and large-scale five facial landmark annotations. + +Besides the evaluation on facial landmark localisation, we can also transfer our 3D vertex predictions into pixelwised segmentation maps for different semantic components [1]. After an additional linear regression from 1k vertices to 53k vertices, we directly employ the segmentation mask (right/left eyebrow, right/left eye, nose, and upper/ lower lip) defined in [1]. Tab. 4 reports evaluation results on the Helen test set [32] using the IoU ratio. Note that the ground-truth here is generated by deformation-free coordinates [1]. The results indicate that the proposed RetinaFace (ResNet-50) outperforms DenseReg (ResNet-101), which is based on indirect UV coordinate regression. In contrast, RetinaFace employs direct vertex regression on the image plane, which is beneficial for more accurate localisation on the image, e.g. the substantial improvement for eyebrows. Given that RetinaFace is not optimized for the segmentation task, we believe that the pose-invariant facial component segmentation results in Fig. 9 are impressive. + +As we can directly predict 3D vertices, the pose estimation is only the estimation of a rotation matrix obtained as the least squares solution between the regressed landmarks and the landmarks of a template face in frontal pose. In Tab. 5, we compare RetinaFace (ResNet-50) with DenseReg [1] and PRN [19] on the yaw angle estimation. Both DenseReg [1] and PRN [19] use an intermediate UV representation, while RetinaFace employs direct vertex regression on the image plane. As we can see from Tab. 5, RetinaFace can predict more accurate yaw angles with low variance, while topology constraints can further improve pose estimation. Both $z$ coordinates regression and pose estimation try to predict indirect 3D information from 2D images, thus the inclusion of topology constraints can boost both tasks by building the connections between direct image clues and indirect information estimation. In Fig. 9, we present the pose estimation results at the nose tip. RetinaFace is robust on pose estimation under expression variations, illumination changes and occlusions. + +![](images/5c59d86543e59287ae75dc29538f7050e41897715849f6cdff083a96545a5463.jpg) + +![](images/b29ec1c0715e5213dfbfc272def44730b0bf11f10a7466330548bec8fbb7f9cd.jpg) +Figure 9. Example results of RetinaFace on the AFLW2000-3D dataset. First row: 1k 3D vertices predicted by RetinaFace (ResNet-50, $\mathcal{L}_{\text{pts} + \text{mesh}}$ ). Second row: 3D pose estimation and mesh render by the Vulkan toolkit. Third row: pose-invariant facial component segmentation. +Figure 10. Testing results of RetinaFace (ResNet-50, $\mathcal{L}_{5pts + mesh}$ ) compared to MFN [6] (first row). We show both the predicted 1k 3D vertices (Second row) and the 3D meshes rendered by the Vulkan toolkit (Third row). Please zoom in to check the missing faces (Column 2-4) and obvious mis-alignment (Column 5-6) by MFN. + +# 4.6. Multi-Face Reconstruction + +In Fig. 10, we compare RetinaFace with MFN [6] on multi-face images. MFN employs a single end-to-end network to jointly predict the bounding box locations and 3DMM parameters for multiple faces. However, 3DMM parameter regression is not as straightforward as our vertex regression on the image plane. In Columns 5 and 6, a misalignment problem in MFN can be observed. Even tiny variations in the predicted 3DMM parameters can significantly affect the reconstruction results. Nevertheless, RetinaFace can exactly fit the face boundary. In Columns 2, 3 and 4, it can be seen that several faces are missed by MFN. In contrast, our RetinaFace achieves state-of-the-art performance on WIDER FACE and can easily detect the tiny faces even under low illumination conditions. In the last row of Fig. 10, we render the 3D 1k vertices predicted by RetinaFace. + +# 5. Conclusion + +In this paper, we innovatively unify multi-level face localisation tasks under one common target: point regression on the image plane. We directly regress 3D vertices in the + +image space while constrained by the 3D topology of the employed 3D face template. Also, the proposed 3D mesh regression branch can be easily incorporated in parallel with the existing box and 2D landmark regression branches without any optimisation difficulty during joint training. Finally, extensive experimental results showed that the proposed mutually beneficial design can simultaneously achieve accurate face detection, 2D face alignment and 3D face reconstruction with efficient single-shot inference. + +Acknowledgements. We are thankful to Nvidia for the GPU donations and Amazon for the cloud credits. Jiankang Deng acknowledges financial support from the Imperial President's PhD Scholarship. Stefanos Zafeiriou acknowledges support from the EPSRC Fellowship DEFORM (EP/S010203/1), FACER2VM (EP/N007743/1) and a Google Faculty Fellowship. An early version of RetinaFace can be found in [13], where Yuxiang Zhou has contributed to the coloured mesh decoder by graph convolution and Jinke Yu has contributed to the face detection experiments on mobile devices. + +# References + +[1] Riza Alp Guler, George Trigeorgis, Epameinondas Antonakos, Patrick Snape, Stefanos Zafeiriou, and Iasonas Kokkinos. Densereg: Fully convolutional dense shape regression in-the-wild. In CVPR, 2017. 1, 2, 7 +[2] Chandrasekhar Bhagavatula, Chenchen Zhu, Khoa Luu, and Marios Savvides. Faster than real-time facial alignment: A 3d spatial transformer network approach in unconstrained poses. In ICCV, 2017. 7 +[3] James Booth, Anastasios Roussos, Evangelos Ververas, Epameinondas Antonakos, Stylianos Ploumpis, Yannis Panagakis, and Stefanos Zafeiriou. 3d reconstruction of "inthe-wild" faces in images and videos. TPAMI, 2018. 5 +[4] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR, 2018. 4 +[5] Feng-Ju Chang, Anh Tuan Tran, Tal Hassner, Iacopo Masi, Ram Nevatia, and Gerard Medioni. Deep, landmark-free fame: Face alignment, modeling, and expression estimation. IJCV, 2019. 1, 7 +[6] Bindita Chaudhuri, Noranart Vesdapunt, and Baoyuan Wang. Joint face detection and facial motion retargeting for multiple faces. In CVPR, 2019. 2, 5, 7, 8 +[7] Dong Chen, Gang Hua, Fang Wen, and Jian Sun. Supervised transformer network for efficient face detection. In ECCV, 2016. 2, 6 +[8] Dong Chen, Shaoqing Ren, Yichen Wei, Xudong Cao, and Jian Sun. Joint cascade face detection and alignment. In ECCV, 2014. 2 +[9] Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv:1512.01274, 2015. 5 +[10] Cheng Chi, Shifeng Zhang, Junliang Xing, Zhen Lei, Stan Z Li, and Xudong Zou. Selective refinement network for high performance face detection. AAAI, 2019. 2 +[11] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017. 4 +[12] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In CVPR, 2019. 1 +[13] Jiankang Deng, Jia Guo, Yuxiang Zhou, Jinke Yu, Irene Kotsia, and Stefanos Zafeiriou. Retinaface: Single-stage dense face localisation in the wild. In arXiv:1905.00641, 2019. 5, 8 +[14] Jiankang Deng, Qingshan Liu, Jing Yang, and Dacheng Tao. M3 csv: Multi-view, multi-scale and multi-component cascade shape regression. IVC, 2016. 1 +[15] Jiankang Deng, Anastasios Roussos, Grigorios Chrysos, Evangelos Ververas, Irene Kotsia, Jie Shen, and Stefanos Zafeiriou. The menpo benchmark for multi-pose 2d and 3d facial landmark localisation and tracking. *IJCV*, 2019. 1, 5 +[16] Jiankang Deng, George Trigeorgis, Yuxiang Zhou, and Stefanos Zafeiriou. Joint multi-view face alignment in the wild. TIP, 2019. 1 + +[17] Jiankang Deng, Yuxiang Zhou, Shiyang Cheng, and Stefanos Zaferiou. Cascade multi-view hourglass model for robust 3d face alignment. In FG, 2018. 1 +[18] Jiankang Deng, Yuxiang Zhou, and Stefanos Zafeiriou. Marginal loss for deep face recognition. In CVPR Workshops, 2017. 1 +[19] Yao Feng, Fan Wu, Xiaohu Shao, Yanfeng Wang, and Xi Zhou. Joint 3d face reconstruction and dense alignment with position map regression network. In ECCV, 2018. 1, 2, 7 +[20] Spyros Gidaris and Nikos Komodakis. Object detection via a multi-region and semantic segmentation-aware cnn model. In ICCV, 2015. 5 +[21] Ross Girshick. Fast r-cnn. In ICCV, 2015. 2, 3 +[22] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010. 4 +[23] Jia Guo, Jiankang Deng, Niannan Xue, and Stefanos Zafeiriou. Stacked dense u-nets with dual transformers for robust face alignment. In BMVC, 2018. 1 +[24] Yudong Guo, Jianfei Cai, Boyi Jiang, Jianmin Zheng, et al. CNN-based real-time dense face reconstruction with inverse-rendered photo-realistic face images. TPAMI, 2018. 2 +[25] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In ICCV, 2017. 2 +[26] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 5 +[27] Peiyun Hu and Deva Ramanan. Finding tiny faces. In CVPR, 2017. 2 +[28] Vidit Jain and Erik Learned-Miller. Fddb: A benchmark for face detection in unconstrained settings. Technical report, UMass Amherst Technical Report, 2010. 2, 5 +[29] Amin Jourabloo and Xiaoming Liu. Large-pose face alignment via cnn-based dense 3d model fitting. In CVPR, 2016. 2 +[30] Martin Koestinger, Paul Wohlhart, Peter M Roth, and Horst Bischof. Annotated facial landmarks in the wild: A large-scale, real-world database for facial landmark localization. In ICCV workshops, 2011. 2, 5, 6 +[31] Felix Kuhnke and Jorn Ostermann. Deep head pose estimation using synthetic images and partial adversarial domain adaption for continuous label spaces. In ICCV, 2019. 1 +[32] Vuong Le, Jonathan Brandt, Zhe Lin, Lubomir Bourdev, and Thomas S Huang. Interactive facial feature localization. In ECCV, 2012. 7 +[33] Jian Li, Yabiao Wang, Changan Wang, Ying Tai, Jianjun Qian, Jian Yang, Chengjie Wang, Jilin Li, and Feiyue Huang. Dsfd: dual shot face detector. arXiv:1810.10220, 2018. 6 +[34] Jinpeng Lin, Hao Yang, Dong Chen, Ming Zeng, Fang Wen, and Lu Yuan. Face parsing with roi tanh-warping. In CVPR, 2019. 1 +[35] Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 2, 4 +[36] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In ICCV, 2017. 2, 4 + +[37] Feng Liu, Luan Tran, and Xiaoming Liu. 3d face modeling from diverse raw scan data. In ICCV, 2019. 3 +[38] 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 +[39] Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Agedb: The first manually collected in-the-wild age database. In CVPR Workshops, 2017. 1 +[40] Mahyar Najibi, Pouya Samangouei, Rama Chellappa, and Larry S Davis. Ssh: Single stage headless face detector. In ICCV, 2017. 2, 4, 5, 6 +[41] Hongyu Pan, Hu Han, Shiguang Shan, and Xilin Chen. Mean-variance loss for deep age estimation from a face. In CVPR, 2018. 1 +[42] Pascal Paysan, Reinhard Knothe, Brian Amberg, Sami Romdhani, and Thomas Vetter. A 3d face model for pose and illumination invariant face recognition. In Advanced Video and Signal Based Surveillance, 2009. 3 +[43] Deva Ramanan and Xiangxin Zhu. Face detection, pose estimation, and landmark localization in the wild. In CVPR, 2012. 1 +[44] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, 2016. 2 +[45] Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. In CVPR, 2017. 2 +[46] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 2 +[47] Elad Richardson, Matan Sela, and Ron Kimmel. 3d face reconstruction by learning from synthetic data. In 3DV, 2016. 2 +[48] Nataniel Ruiz, Eunji Chong, and James M Rehg. Fine-grained head pose estimation without keypoints. In CVPR Workshops, 2018. 1 +[49] Abhinav Shrivastava, Abhinav Gupta, and Ross Girshick. Training region-based object detectors with online hard example mining. In CVPR, 2016. 5 +[50] Brandon M Smith, Li Zhang, Jonathan Brandt, Zhe Lin, and Jianchao Yang. Exemplar-based face parsing. In CVPR, 2013. 1 +[51] Xu Tang, Daniel K Du, Zeqiang He, and Jingtuo Liu. Pyramidbox: A context-assisted single shot face detector. In ECCV, 2018. 2, 4, 5, 6 +[52] Ayush Tewari, Michael Zollhofer, Hyeongwoo Kim, Pablo Garrido, Florian Bernard, Patrick Perez, and Christian Theobalt. Mofa: Model-based deep convolutional face autoencoder for unsupervised monocular reconstruction. In ICCV, 2017. 2 +[53] Anh Tuan Tran, Tal Hassner, Iacopo Masi, and Gerard Medioni. Regressing robust and discriminative 3d morphable models with a very deep neural network. In CVPR, 2017. 2 +[54] Paul Viola and Michael J Jones. Robust real-time face detection. IJCV, 2004. 1 + +[55] Jianfeng Wang, Ye Yuan, and Gang Yu. Face attention network: an effective face detector for the occluded faces. arXiv:1711.07246, 2017. 2, 4 +[56] Jing Yang, Adrian Bulat, and Georgios Tzimiropoulos. Fanface: a simple orthogonal improvement to deep face recognition. In AAAI, 2020. 1 +[57] Jing Yang, Jiankang Deng, Kaihua Zhang, and Qingshan Liu. Facial shape tracking via spatio-temporal cascade shape regression. In ICCV Workshops, 2015. 1 +[58] Jing Yang, Qingshan Liu, and Kaihua Zhang. Stacked hourglass network for robust facial landmark localisation. In CVPR Workshops, 2017. 1 +[59] Shuo Yang, Ping Luo, Chen-Change Loy, and Xiaou Tang. Wider face: A face detection benchmark. In CVPR, 2016. 2, 5, 6 +[60] Tsun-Yi Yang, Yi-Ting Chen, Yen-Yu Lin, and Yung-Yu Chuang. Fsa-net: Learning fine-grained structure aggregation for head pose estimation from a single image. In CVPR, 2019. 1 +[61] Ronald Yu, Shunsuke Saito, Haoxiang Li, Duygu Ceylan, and Hao Li. Learning dense facial correspondences in unconstrained images. In ICCV, 2017. 7 +[62] Stefanos Zafeiriou, Cha Zhang, and Zhengyou Zhang. A survey on face detection in the wild: past, present and future. CVIU, 2015. 1 +[63] Changzheng Zhang, Xiang Xu, and Dandan Tu. Face detection using improved faster rcnn. arXiv:1802.02142, 2018. 2 +[64] Feifei Zhang, Tianzhu Zhang, Qirong Mao, and Changsheng Xu. Joint pose and expression modeling for facial expression recognition. In CVPR, 2018. 1 +[65] Hongkai Zhang, Hong Chang, Bingpeng Ma, Shiguang Shan, and Xin Chen. Cascade retina: Maintaining consistency for single-stage object detection. In BMVC, 2019. 4 +[66] Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. SPL, 2016. 2, 6 +[67] Shifeng Zhang, Cheng Chi, Zhen Lei, and Stan Z Li. Refine-face: Refinement neural network for high performance face detection. In arXiv:1909.04376, 2019. 6 +[68] Shifeng Zhang, Longyin Wen, Hailin Shi, Zhen Lei, Siwei Lyu, and Stan Z Li. Single-shot scale-aware network for real-time face detection. IJCV, 2019. 6 +[69] Shifeng Zhang, Xiangyu Zhu, Zhen Lei, Hailin Shi, Xiaobo Wang, and Stan Z Li. S3fd: Single shot scale-invariant face detector. In ICCV, 2017. 2, 5, 6 +[70] Yuxiang Zhou, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Dense 3d face decoding over 2500fps: Joint texture & shape convolutional mesh decoders. In CVPR, 2019. 1 +[71] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. arXiv:1811.11168, 2018. 4 +[72] Xiangyu Zhu, Zhen Lei, Xiaoming Liu, Hailin Shi, and Stan Z Li. Face alignment across large poses: A 3d solution. In CVPR, 2016. 1, 2, 5, 6, 7 \ No newline at end of file diff --git a/retinafacesingleshotmultilevelfacelocalisationinthewild/images.zip b/retinafacesingleshotmultilevelfacelocalisationinthewild/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..66b5f59015415d7b7ecb15329f19607085d5bffd --- /dev/null +++ b/retinafacesingleshotmultilevelfacelocalisationinthewild/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f091a920c9027bed079e50a292883285d7a13fc7e6e8d0cc7879c5023a3eec9 +size 685130 diff --git a/retinafacesingleshotmultilevelfacelocalisationinthewild/layout.json b/retinafacesingleshotmultilevelfacelocalisationinthewild/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..aa9aed6b8e8d95b4c9bec1e210c0c314915c9633 --- /dev/null +++ b/retinafacesingleshotmultilevelfacelocalisationinthewild/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ae9e9f6ce69562abdcf1e2b40292857b093f8b8d82dd8e00ec5a42ca4a44fa3 +size 464710 diff --git a/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_content_list.json b/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ea56c7ca052c6be8bb7fc4f5bf0117a482ce3804 --- /dev/null +++ b/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057025b85f83aea43883af4591f4047f3c8efc15f0361e28f2e4ebcbb4196e09 +size 68003 diff --git a/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_model.json b/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6f9f2ecceccef45254f4d67519f9291b2bf34071 --- /dev/null +++ b/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36fa749cf43906d1d946773453f9d8b944ab897e18a030dbae0801600b184557 +size 80975 diff --git a/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_origin.pdf b/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e3237a884bdf46c9abb8f1ebcbf07c1d2c8ecb2c --- /dev/null +++ b/retinalikevisualimagereconstructionviaspikingneuralmodel/2214f7fc-cc44-4c58-9c57-7e4441c323bb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d4f494b57386dd6bac0e4eaf83e3c07314e20ad6e9dcb8604694f32f5a1baaa +size 2851063 diff --git a/retinalikevisualimagereconstructionviaspikingneuralmodel/full.md b/retinalikevisualimagereconstructionviaspikingneuralmodel/full.md new file mode 100644 index 0000000000000000000000000000000000000000..146f6a7ab7ed08675a67de56bc69f6eb6c7317b5 --- /dev/null +++ b/retinalikevisualimagereconstructionviaspikingneuralmodel/full.md @@ -0,0 +1,309 @@ +# Retina-like Visual Image Reconstruction via Spiking Neural Model + +Lin Zhu $^{1,2}$ Siwei Dong $^{1}$ JianingLi $^{1,2}$ Tiejun Huang $^{1}$ Yonghong Tian $^{1,2,*}$ Peking University $^{1}$ Pengcheng Laboratory $^{2}$ + +{linzhu,swdong,lijianing,tjhuang,yhtian}@pku.edu.cn + +# Abstract + +The high-sensitivity vision of primates, including humans, is mediated by a small retinal region called the fovea. As a novel bio-inspired vision sensor, spike camera mimics the fovea to record the nature scenes by continuous-time spikes instead of frame-based manner. However, reconstructing visual images from the spikes remains to be a challenge. In this paper, we design a retina-like visual image reconstruction framework, which is flexible in reconstructing full texture of natural scenes from the totally new spike data. Specifically, the proposed architecture consists of motion local excitation layer, spike refining layer and visual reconstruction layer motivated by bio-realistic leaky integrate and fire (LIF) neurons and synapse connection with spiketiming-dependent plasticity (STDP) rules. This approach may represent a major shift from conventional frame-based vision to the continuous-time retina-like vision, owing to the advantages of high temporal resolution and low power consumption. To test the performance, a spike dataset is constructed which is recorded by the spike camera. The experimental results show that the proposed approach is extremely effective in reconstructing the visual image in both normal and high speed scenes, while achieving high dynamic range and high image quality. + +# 1. Introduction + +Autonomous driving, wearable computing, unmanned aerial vehicles, are typical emerging real-time applications which require rapid reaction in vision processing [19]. Conventional cameras compress the video data in the exposure time into one frame, and the temporal changes in that time will be lost [11]. When performing image analysis tasks such as detecting or tracking an object, these consecutive frames have to be compared to recover temporal changes, which is computationally expensive and is difficult to achieve satisfactory results [21]. + +If we turn attention to the human vision, the visual sam + +pling is quite different from that of a digital camera. There is no concept of frames or pictures in human vision. Although the mechanism of human vision is too complicated to be fully understood, the physical structures and the signal processing in human retina give us some hints and inspirations. Among them, the dynamic vision sensor (DVS) is the most well-recognized [8, 1]. In DVS, each pixel responds independently to the changes of luminance intensity by generating asynchronous spikes. This mechanism is similar to the periphery of the retina, which is sensitive only to moving objects. The temporal redundancy of the output spikes is natively reduced, however, it is not able to reconstruct the visual images as the conventional camera does. Although there are some hybrid sensors combing DVS and conventional image sensor (DAVIS) [5], or adding an extra photo-measurement circuit (ATIS [23], CeleX [13]), there exists motion mismatch since the difference of the sampling time resolution. + +To solve the problem of capturing visual texture while maintaining the continuous-time signal, researchers designed a class of time-based sensors to make each pixel mimics the behaviour of an integrate-and-fire neuron and works asynchronously [2, 6, 16]. Instead of choosing a fixed integration time for all pixels like a conventional camera, the time-based sensor ensures that each pixel selects its own optimal integration time to achieve a high dynamic range and an improved signal-to-noise ratio. This kind of sensor enables the reconstruction of visual textures in a frame-free manner. Using a time window or the inter-spike interval, the image texture can be reconstructed [6]. + +Recently, [28] proposed a fovea-like sampling method (FSM) which falls into the category of time-based sensors. Compared to previous time-based sensors, this sensor namely spike camera is with high spatial $(250 \times 400)$ and temporal resolutions $(40000\mathrm{Hz})$ , which is suitable to deal with high-speed vision tasks [28]. However, the previous reconstruction algorithms [6, 28] will suffer the problem of low contrast or blur in complex environments. Therefore, how to flexibly use the time-continuous spike information is a key problem of high-quality image reconstruction. + +In this paper, we propose a new retina-like visual im + +![](images/5c32921facadd1cc5abf6bc511daaafa955be5a49dc9ad3fa2d4f7e82c78f360.jpg) +Figure 1. The spike camera based on fovea-like sampling and visual image reconstruction. + +age reconstruction framework, as shown in Fig 1. The main contributions of this paper include: 1) We propose a three-layer spiking neural model which relies on a combination of biologically plausible mechanisms. Using time-continuous spike data, our method can reconstruct images at any sampling moment, and retain the details of high-speed motion and static background simultaneously. 2) We propose a dynamic neuron extraction model to distinguish the neuron states (dynamic or static) in an incremental way, which is useful for reconstructing high quality high-speed motion scenes. 3) We construct a new spike dataset for evaluating the reconstruction method, and make these available to the research community. + +# 2. Spike Data Analysis + +# 2.1. Spike Data Representation + +In FSM, the intensity of light is converted into voltage by the photoreceptor [28]. Once the voltage reaches a predefined threshold, a one-bit spike is outputted and a signal to reset the integrator is dispatched at the same time. This process is quite similar to the integrate-and-fire neuron. Different luminance stimuli $I$ leads to a different spike firing rate, the output and the reset are triggered asynchronously among various pixels. Typically, the brighter the light, the faster the firing speed: + +$$ +\int I d t \geq \phi \tag {1} +$$ + +The raw data from the spike camera is a three-dimensional spike array $D$ . The spike camera only cares about the integration of the luminance intensity and fires spikes in an ultra high frequency. At each sampling moment, if a spike is just fired, a digital signal "1" (i.e. a spike) is outputted, otherwise "0" is generated. We define $S_{i,j}(t) \in \{0,1\}$ to represent the spike firing status of pixel $(i,j)$ at the moment $t$ . For simplicity, we use spike plane to represent the spike signal outputted by all pixel at a certain moment, while the time-continuous spike signals generated by a certain pixel is called a spike train (see Fig 5 (a)). + +# 2.2. Spike Data Distribution + +The integrator has a predefined capacity which is also known as the spike firing threshold $\phi$ . If the integrator is + +filled, it will be reset and fires a spike. Due to the variation of the light, the duration of filling the integrator from empty to fulfilled is not constant. Microscopically, a spike is generated means a fixed number of photons have been recorded. We define $N(t,\delta)$ as the number of photons arrived at the photoreceptor within the time interval $[t,t + \delta)$ , and $R(t,\delta)$ as the number of photons recorded actually in the same period. However, the dead time $\tau$ between two consecutive photon arrivals makes $N(t,\delta)$ and $R(t,\delta)$ are not equal. If the former arrival is recorded at time $t$ , any latter photon arrivals during $(t,t + \tau]$ will not be recorded. + +In fact, the photon record process $R(t,\delta)$ can be seemed as a renewal process, which involves recurrent patterns after each of which the process starts from scratch. The photon arrival process is usually assumed to be a homogeneous Poisson process. It is parameterized by a single scalar $\lambda$ which gives the mean rate of the photon arrivals. If the waiting time between one renewal and the next has ensemble mean and variance, the photo recording process with dead time $\tau$ is asymptotically Gaussian distributed [7]: + +$$ +E \sim \frac {\lambda \delta}{1 + \lambda \tau}, V a r \sim \frac {\lambda \delta}{(1 + \lambda \tau) ^ {3}} \tag {2} +$$ + +To validate the model, we record several spike sequences using the spike camera under various light conditions. We assume that the record of $n$ photons will reach the dispatch threshold $\phi$ and generate a spike. If the spike firing time is denoted as $t_i$ , the inter-spike interval is $t_{isi} = t_i - t_{i-1}$ . As shown in Fig 2, the blocks with different grayscale values represent the luminance intensities, which indicates that larger intensities lead to higher spike firing rates and shorter inter-spike intervals (ISIs). The RMSE shows that the interspike interval distribution histogram can be well fitted by the approximate Gaussian distribution. + +Based on the above, we are able to model the ISI distribution of a certain intensity by a Gaussian distribution. In Sec 3.2, a dynamic neuron extraction model is proposed to extract the spike signal representing moving object according to the ISI distribution. + +# 3. Spiking Neural Model + +To address the challenge of visual image reconstruction from the spike data, we propose a novel spike neural mod + +![](images/982670f27698387b6a60161bf49d4f4cdf363dff795c5ce1ccffd8a4f62af1a0.jpg) +Figure 2. The spike data distribution under different intensities. Left: The spike train generated by different light intensity. Larger intensities lead to higher spike firing rates and shorter inter-spike intervals. Right: the exact ISI distribution histogram, approximate Gaussian distribution and their Root Mean Squard Error (RMSE). The RMSE shows that the approximate Gaussian distribution can well fit the real ISI distribution. + +![](images/9de96fcf99945421d221257fe5a8951b5c5c77b1da9baa7f95ee6a0f051241d4.jpg) + +el based on the inspiration from the biological neural dynamics and the adaptation. In biological neural systems, a neuron receiving the stimuli and firing a spike can be abstracted as a leaky integrate-and-fire (LIF) model [14]. In LIF model, the membrane potential $V(t)$ is governed by the following differential equation: + +$$ +\tau_ {m} \frac {d V}{d t} = - (V (t) - V _ {\text {r e s t}}) + R I (t) \tag {3} +$$ + +where $V_{\text{rest}}$ is the rest potential, $I(t)$ is the total synaptic current, $R$ is the membrane resistance and $\tau_m$ is the membrane time constant. In the absence of input, the membrane potential decays exponentially to its resting. With the input spikes, each input yields the input potential onto the membrane potential $V(t)$ . Each time the membrane potential hits the threshold, the membrane potential $V(t)$ is reset to $V_{\text{rest}}$ and a spike is fired [14]. The refractory period in a neuron occurs after one output spike, which is quite different in various neurons. + +In addition, there exists multiple adaptation mechanisms in biological neuron. The neuron is adaptively adjusted according to the input spike characteristics. For instance, the synapse plasticity [3, 4] modulates the efficiency of neural connections by its weight, while the membrane potential thresholds (spike firing thresholds) of various neurons are different to adapt to different stimuli. The dynamic threshold [9] allows that more frequent stimuli may lead to greater thresholds, and vice versa. + +Based on the inspiration from biological neurons, we propose a spiking neural model to solve the problem of image reconstruction. The model shown in Fig 3 includes motion local excitation layer, spike refining layer and visual reconstruction layer. The motion local excitation layer receives spikes input and marks the motion state of neurons (static or dynamic). Then the spike refining layer adjusts the refractory period of each neuron according to its motion state, which acts as a temporal filter. The last visual reconstruction layer adopts the adaptation mechanism widely existed in biological neurons, and maps the dynamic threshold of each neuron into a grayscale image as the output. + +The overall architecture of the spiking neural model is illustrated in Fig 3 and in more detail in Fig 5. The architecture of the spiking neural model is described in Sec 3.1. The dynamic neuron extraction based on graph cuts is shown in Sec 3.2. Sec 3.3 presents the synapse connection, while the visual image reconstruction is introduced in Sec 3.4. + +# 3.1. Model Architecture + +Motion Local Excitation Layer The motion local excitation layer operates on the input spike data and outputs spike train with binary marks (dynamic or static). The purpose is to distinguish the neuron state according to the input spike data. Each neuron in this layer is connected to the input spike data in one-to-one connections. In this layer, the input spike data is modelled as a motion confidence matrix according to the historical firing distribution. Then, for current moment, the neuron states can be abstracted into the first-order Markov Random Field with binary labels [12], and a motion local extractor based on the graph cuts is performed. In this way, each output spike has a dynamic or static mark to distinguish the state of the neuron. The detail will be described in Sec 3.2. + +Spike Refining Layer To model neuronal dynamics, the LIF model is introduced in spike refine layer. In this layer, the input spikes are filtered to keep the fast response to the motion while removing the noise. The size of this layer is the same as the motion local excitation layer, each input is fed to one neuron in this layer. In order to rapidly respond to the motion, we set the threshold voltage to a very small value. To eliminate the noise, according to the mark given by the motion local excitation layer, a relatively long refractory period should be set if the current input spike is marked static; otherwise, if the spike comes from a dynamic neuron, a relatively short refractory period should be set. By the above mechanism, the spike refining layer can significantly eliminate the noise, and mitigate the over-exposure by reducing the firing rate. Meanwhile, this layer retains as much detail as possible to maintain the fidelity of dynamic spike while preserved high dynamic range. + +![](images/a89da8138604a02c88d58c7daf7431590d3384cf318af9c0e232e4e8350eeab4.jpg) +Figure 3. The overall architecture of spiking neural model. + +Visual Reconstruction Layer As in the previous layer, the neurons in this layer are LIF neurons. Each neuron receives the spike train from the spike refining layer, and the neuron and the synaptic connection make various adaptive adjustments. The visual image is reconstructed according to the state of the neuron. The neurons of this layer are connected in a one-to-many fashion to that of spike refining layer. These neurons have no refractory period. STDP learning rule [4] is performed between these two layers to learn to adjust the spike firing rate (see Sec 3.3). In addition, to achieve the homeostasis of the system, threshold adaptation [9] is introduced in this layer. According to the statistics of the neuron state and dynamic threshold, high quality visual images including dynamic and static scenes can be reconstructed simultaneously (see Sec 3.4). + +# 3.2. Dynamic Neuron Extraction + +In this section, we propose a dynamic neuron extraction model to mark input spikes as dynamic or static. As analyzed in Sec 2.2, the ISI is equal to the time of a fixed number of photons have been recorded, which is proportional to the firing threshold $\phi$ of the integrator. For a constant photon arrival rate $\lambda$ , the ISI distribution has an unimodal and symmetric distribution which approaches a Gaussian distribution. The region visited by a moving object has a dissimilar ISI distribution from that driven by static region. Therefore, we associate the ISI of each neuron with a Gaussian probability model with mean $\mu$ and covariance $\sigma$ : + +$$ +\operatorname {I S I} \sim \mathcal {N} (\mu , \sigma) \tag {4} +$$ + +Assuming that each neuron corresponds to a coordinate $(i,j), i \in [1,m], j \in [1,n]$ , where $m$ and $n$ are the resolution of spike camera. The $ij$ -th neuron is denoted as $ij$ , we evaluate all the moments against their corresponding ISI distribution models and obtain the confidence map $C_{ij}(t) \in \mathbb{R}^{T \times 1}$ , which corresponds to the confidence of the location belong to static region. Therefore, the motion confidence of each neuron at different moment is: + +$$ +O = \left[ \begin{array}{c c c} C _ {1 1} & \dots & C _ {1 n} \\ \vdots & \ddots & \vdots \\ C _ {m 1} & \dots & C _ {m n} \end{array} \right] \in \mathbb {R} ^ {m \times n \times T} \tag {5} +$$ + +![](images/13b17de88af3e29fd5c39cb4dd92952a672b6df538ea12d02f5f2423011d3c4c.jpg) +Figure 4. The illustration of dynamic neuron extraction. This operation is performed in motion local excitation layer. The dynamic neurons corresponding to digital and turntable center are extracted. Top: the visualized result of the motion confidence matrix $O$ . Bottom: the dynamic neuron extraction results. + +At the moment $t$ , the mark matrix $M^t \in \{0,1\}^{m \times n}$ is a binary matrix denoting the states of the neurons: + +$$ +M _ {i j} ^ {t} = \left\{ \begin{array}{l l} 1 & \text {i f i j b e l o n g s t o m o t i o n r e g i o n a t m o m e n t} t \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {6} +$$ + +We use $\mathcal{P}_{M^t}(X)$ to represent the orthogonal projection of a matrix $X$ onto the linear space of matrices supported by $M^t$ , + +$$ +\mathcal {P} _ {M ^ {t}} (X) (i, j) = \left\{ \begin{array}{l l} 0 & \text {i f} M _ {i j} ^ {t} = 0 \\ X _ {i j} & \text {i f} M _ {i j} ^ {t} = 1 \end{array} \right. \tag {7} +$$ + +and $\mathcal{P}_{M^{t\perp}}(X)$ to be its complementary projection, i.e., $\mathcal{P}_{M^t}(X) + \mathcal{P}_{M^{t\perp}}(X) = X$ + +The binary matrix $M^t$ can be naturally modeled by a Markov Random Field (MRF) [12]. Consider a graph $\mathcal{G} = (\mathcal{V},\mathcal{E})$ , where $\mathcal{V}$ is the set of vertices denoting all $m \times n$ neurons and $\mathcal{E}$ is the set of edges connecting spatially neighboring neurons. According to the Ising model [17], the energy of $M$ can be represented as: + +$$ +\sum_ {i j \in \mathcal {V}} u _ {i j} \left(M _ {i j}\right) + \sum_ {(i j, k l) \in \mathcal {E}} \lambda_ {i j, k l} \left| M _ {i j} - M _ {k l} \right| \tag {8} +$$ + +where + +$$ +u _ {i j} \left(M _ {i j}\right) = \left\{ \begin{array}{l l} \lambda_ {i j} & \text {i f} M _ {i j} = 1 \\ 0 & \text {i f} M _ {i j} = 0 \end{array} \right. \tag {9} +$$ + +where $\lambda_{ij,kl}$ controls the strength of dependency between $M_{ij}$ and $M_{kl}$ , and $\lambda_{ij}$ controls the sparsity of $M_{ij} = 1$ . + +Since $O^t$ denotes the motion confidence, we assume that $O^t = M^t + N^t$ , where $N^t$ denotes the noise. For the static neurons of $M_{ij}^t = 0$ , the noise $N^t = \mathcal{P}_{M^{t\perp}}(O^t)$ should be minimized. Combining the above motion model and noise model, we propose the following optimization: + +$$ +\begin{array}{l} \min _ {M _ {i j} ^ {t} \in 0, 1} \frac {1}{2} \sum_ {i j} \mathcal {P} _ {M ^ {t \perp}} \left(O _ {i j} ^ {t}\right) ^ {2} + \sum_ {i j \in \mathcal {V}} u _ {i j} \left(M _ {i j} ^ {t}\right) \tag {10} \\ + \sum_ {(i j, k l) \in \mathcal {E}} \\ \end{array} +$$ + +For simplicity, we set $\lambda_{ij} = \alpha$ and $\lambda_{ij,kl} = \beta$ . Eq. 10 can be rewritten as follows: + +$$ +\min _ {M _ {i j} ^ {t} \in 0, 1} \sum_ {i j} \left(\alpha - \frac {1}{2} \left(O _ {i j} ^ {t}\right) ^ {2}\right) M _ {i j} ^ {t} + \beta \| E \operatorname {v e c} \left(M ^ {t}\right) \| _ {1} + c \tag {11} +$$ + +where $c = \frac{1}{2}\sum_{ij}(O_{ij}^t)^2$ , $E$ is the node-edge incidence matrix of $\mathcal{G}$ . Eq. 11 is the standard form of the first-order MRFs with binary labels, which can be solved exactly by graph cuts [15]. + +The illustration of dynamic neuron extraction is shown in Fig 4. The proposed model is sufficient to distinguish the neuron state. When a new set of spikes arrives, the confidence matrix is updated incrementally, and the graph cuts can be operated for each moment separately. + +# 3.3. Synapse Connection + +Synapse is a structure that permits a neuron to pass a voltage signal to another neuron according to their weights. In applications of spiking neural network (SNN), the weights can be trained following a learning rule or set to constant values. Synaptic plasticity is the basic mechanism of underlying learning in biological networks [3]. It is defined as the ability to modulate the efficiency (also known as weight) of neural connections. In the biological vision system, information coding is established in an unsupervised way. Among the SNN learning rules, spike timing dependent plasticity (STDP) [3] is the most popular one. With STDP, if the presynaptic spike to a neuron tends to shortly before it fires, then the synaptic weight is made stronger (Long-Term Potentiation, LTP); whereas if an input spike tends to occur immediately after an output spike, then that particular input is made somewhat weaker (Long-Term Depression, LTD). In this work, biological STDP [4] is used to learn the rule of spike firing of static neurons, which is defined as: + +$$ +\Delta \omega = \sum_ {t _ {p r e}} \sum_ {t _ {p o s t}} W \left(t _ {p o s t} - t _ {p r e}\right) \tag {12} +$$ + +where $\Delta \omega$ is the weight variation, $t_{pre}$ and $t_{post}$ denote the firing time of the input neuron (presynaptic spike time) and + +output neuron (postsynaptic spike time), respectively. The function $W$ is defined as: + +$$ +W (\Delta t) = \left\{ \begin{array}{l l} A _ {p r e} \exp (- \Delta t / \tau_ {p r e}) & \text {i f} \Delta t > 0 \\ A _ {p o s t} \exp (\Delta t / \tau_ {p o s t}) & \text {i f} \Delta t < 0 \end{array} \right. \tag {13} +$$ + +where the parameters $A_{pre}$ and $A_{post}$ depend on the current value of the synaptic weight $\omega$ . + +The neurons between two adjacent layers can be connected in different ways. As mentioned above, between the second and third layers, we use a one-to-many manner to connect their neurons. We assume that neurons are distributed in a regular grid and that the distance between adjacent neurons is a constant. A presynaptic neuron will connect to multiple postsynaptic neurons if the following conditions are met: + +$$ +\sqrt {\left(x _ {p r e} - x _ {p o s t}\right) ^ {2} + \left(y _ {p r e} - y _ {p o s t}\right) ^ {2}} < R \tag {14} +$$ + +where $x$ and $y$ are the coordinates of neurons, $R$ is the connection range. And the initial weights for each synapse are obtained as following: + +$$ +\omega = \exp \left(- k \sqrt {\left(x _ {p r e} - x _ {p o s t}\right) ^ {2} + \left(y _ {p r e} - y _ {p o s t}\right) ^ {2}} / R\right) \tag {15} +$$ + +where $k$ controls the weight distribution. The initial weights are adaptively updated at the arrival of each spike according to STDP learning rules. + +# 3.4. Visual Image Reconstruction + +In this section, we reconstruct visual information suitable for human viewing according to the state of neuron. The inhomogeneity of the input leads to different firing rates of the excitatory neuron. In order to ensure that the neurons adapt to input spike train, we hope that all neurons will have approximately equal firing rates. To this end, a common method to adapt thresholds is to use leaky adaptive thresholds [9]: when a neuron fires a spike, a dynamic adjusting is performed for threshold to adapt the firing rate to prevent it from firing too often. The more frequently a neuron fires spikes, the higher will be its threshold. In turn, the neuron needs more inputs to fire a spike in the near future. Similar to [10], we define the model of the dynamic threshold as: + +$$ +\vartheta_ {i j} (t) = \vartheta_ {0} + \int_ {0} ^ {\infty} \theta_ {i j} (s) S _ {i j} ^ {\prime} (t - s) d s \tag {16} +$$ + +where $\vartheta_0$ is the initial threshold of neuron in the absence of spiking, and $S_{ij}^{\prime}$ denotes the fired spikes of this layer. The firing threshold of the neuron is increased by an amount $\theta_{ij}$ and is exponentially decaying after firing a spike. The increase amount $\theta_{ij}$ is defined as: + +$$ +\theta_ {i j} (t) = \left\{ \begin{array}{l l} \eta_ {0} \exp \left(\frac {- (t - t _ {f})}{\tau}\right) & \text {i f} M _ {i j} ^ {t} = 0 \\ \eta_ {0} \exp \left(\frac {- (t - t _ {w})}{\tau \int_ {t _ {w}} ^ {t} S _ {i j} (x) d x}\right) & \text {i f} M _ {i j} ^ {t} = 1 \end{array} \right. \tag {17} +$$ + +![](images/ddbfd81315f6b9a21de4162df1eedfc8133353dcc5d44701e9e3038aeb41ff66.jpg) +Figure 5. The microscopic analysis of spiking neural model. (a) The input spike data is converted to spike plane (black dashed box) and spike train (red dashed box). The spike plane connects to the motion local excitation layer, and the dynamic neurons at this moment are marked, while the spike train with the mark information input to the next layer. (b) The noise spikes are eliminated by the mechanism of the refractory period while the static and dynamic spikes are preserved. (c) Each input spikes yield a potential according to STDP, and if the accumulated membrane potential reaches the threshold, the model is adaptively adjusted to fit the input spikes. According to Eq. 18 and 19, the pixel intensity at each moment can be reconstructed (i.e. $t_1$ : dynamic spikes, $t_2$ : static spikes), as shown in (d). + +where $S_{i,j}(t)$ is the spike train input to this layer, $t_f$ denotes the most recent firing time, $t_w$ is a moment before $t$ that can be set as a constant, and $\tau$ is the time constant. In practice, we can set $t_w$ to a small value so as to avoid threshold instability due to dynamic spike. + +Finally, the grayscale value of the visual image can be estimated from the neuron state and firing threshold: if the neuron $(i,j)$ belongs to a static neuron at moment $t$ , in other words, $M_{i,j}^{t} = 0$ , then the grayscale value is + +$$ +G _ {i, j, t} = \vartheta_ {i j} (t) \tag {18} +$$ + +Otherwise + +$$ +G _ {i, j, t} = \vartheta_ {i j} \left(t ^ {-}\right) * \kappa (t) ^ {\gamma} \tag {19} +$$ + +where $\vartheta_{ij}(t^{-})$ denotes the convergence value of $\vartheta_{ij}$ before time $t$ , $\kappa(t) = t^{-} / (t_{isi} \int_0^t S_{ij}(x) dx)$ is an adjustment parameter to reconstruct the accurate gray value of dynamic + +region, $t_{isi}$ denotes the inter-spike interval corresponding to time $t$ , and $\gamma$ controls the contrast of reconstructed dynamic region. + +# 4. Experiment + +# 4.1. Spike Dataset + +To test the proposed spiking neural model, we build a dataset including spike sequences captured by the spike camera1. This dataset contains eight sequences including two categories of normal speed (Class A) and high speed (Class B) scenarios. Each sequence is captured by the spike camera with $40,000\mathrm{Hz}$ sampling rate. Class A contains four sequences, of which "Office" is an indoor scene, and "Gallery", "Lake" and "Flower" are outdoor scenes. Class + +![](images/126fc28017940fdd93c54e929a12e7deb717400f9ba92ce03d8e4e607b168838.jpg) +Class A (Normal speed) +Figure 6. The reconstruction results on Class A and B. We compared our method with TFW, TFI and TFA [28] on Class A. Since TFP and TFA have no ability to reconstruct dynamic scenes, we only compare our methods with TFI on Class B. + +Table 1. The quantitative metrics on Class A and B. (a higher value means better image quality) + +
MetricMethodClass A (Normal speed)Class B (High speed)
OfficeGalleryLakeFlowerCarTrainRo1Ro2Mean
2-D entropyTFW9.128.689.459.22----9.12
TFA7.3812.4112.6911.88----11.09
TFI10.019.8510.5110.0110.7111.0110.239.8110.27
Ours10.3812.3812.8312.6310.7610.8511.7211.6911.66
OG-IQA [20]TFW0.57290.44450.75750.8959----0.6677
TFA0.27370.67070.83690.8660----0.6618
TFI0.57380.41340.51100.85230.86370.78290.56020.53050.6359
Ours0.59210.68790.83790.87270.87200.78970.60090.81050.7579
+ +B includes "Car", "Train", "Rotation1 (Ro1)" and "Rotation2 (Ro2)". Among them, "Car" describes a car traveling at a speed of $100\mathrm{km/h}$ (kilometers per hour), while "Train" records a train with $350\mathrm{km/h}$ speed. The sequence "Rotation1" describes a disk with $2000\mathrm{rpm}$ (revolutions per minute), and the sequence "Rotation2" depicts an electric fan with $2600\mathrm{rpm}$ . + +# 4.2. Visual Texture Reconstruction + +# 4.2.1 Qualitative Analysis + +The spiking neural model is implemented using the Brian2 neural simulator [27]. All neurons are modeled as LIF neurons. The dimension of the network is designed to fit the camera resolution of $250 \times 400$ , in other words, each layer using 100,000 neurons. + +To evaluate the performance of our method, we compared three methods proposed in [28], namely TFW (texture from window), TFI (texture from inter-spike interval) and TFA (adaptive texture reconstruction). The parameters of the three methods are set according to the default parameters given in original paper. Fig 6 shows the experimental results. The results of TFW and TFI have low contrasts, which makes it difficult to distinguish the details of the image. TFA improves contrast, but some regions in the image are too bright, which affects the overall visual effect of the image. Our method solves the above problems. Subjectively, the reconstructed image quality is better than the other three methods. + +Class B contains four high-speed motion scenes. Since TFP and TFA have no ability to reconstruct dynamic scenes, we only compare our method to TFI on Class B. TFI is a method of image reconstruction based on instantaneous intensity, it has the ability to reconstruct high-speed motion because it conforms to the sampling principle of the camera. However, TFI only uses the information of the current moment, the historical information in temporal domain is not used. Benefit from the three-layer spiking neural model, our approach makes full use of both historical and current information. The results show that the contrast of static region is improved, while the saliency and clarity of dynamic region are enhanced. + +# 4.2.2 Quantitative Analysis + +In Table 1, we give a quantitative evaluation on the proposed dataset. Two no-reference image quality assessment metrics, two-dimensional (2-D) entropy [18] and OG-IQA [20], are employed into our experiment. 2-D entropy uses both the gray value of a pixel and its local average gray value, it measures the amount of information in the image. OG-IQA uses perceptual image features for image quality assessment and gives a score (the range is 0-1, 1 is the best). As shown in Table 1, our method achieves better than other methods in both 2-D entropy and OG-IQA metrics, this is consistent with the results of subjective observation in Fig 6. + +Quantitatively, for further evaluate the high-speed scenes in Class B, we employ standard deviation (STD) and a no-reference image blur metric called CPBD [22]. The result + +![](images/d1ad98c09035aa1e33a1ebc99542b4263d9cd011bf8b4ae8ceae06c190f75d7c.jpg) +Figure 7. The effect of STDP. The blue line denotes the noise level estimated by [24], while the red line represents the signal-to-noise ratio. The experiment was performed on Class A. Intuitively, when the STDP strength is 0.2, the result is the best. + +Table 2. The STD and CPBD metrics on Class B. + +
MetricMethodCarTrainRo1Ro2Mean
STDTFI53.8260.5722.7931.5542.18
Ours58.4366.9137.5747.1152.51
CPBDTFI0.77970.90090.84610.65160.7946
[22]Ours0.79600.90720.84820.79580.8368
+ +is shown in Table 2. The STD is related to the contrast of the image. Generally speaking, larger standard deviation (STD) means higher contrast. CPBD is used to measure the motion blur. Lower CPBD values mean more blur and vice versa. In summary, our method maintains sharpness while maintaining a higher contrast. + +To better understand the effect of STDP, we performed an experiment on our dataset. STDP learning rule can adjust synaptic weight adaptively according to the input spike. If an irregular spike is input, which is usually caused by noise, the STDP mechanism can make its influence smaller and achieve the purpose of denoising. In the experiment, an image noise estimation method [24] is used, and signal-to-noise ratio (SNR) is obtained by standard deviation and noise. We adjust the STDP strength from 0 to 0.50, and compare the noise and SNR of the results. As shown in Fig 7, with appropriate STDP strength (0.20 gets the highest SNR), the windows and buildings are clearer, and most of the noise is eliminated. + +# 4.3. Comparisons with other vision sensors + +Fig 8 shows the comparison of spike camera, CeleX, DAVIS240B and Huawei P30. Spike camera with the proposed reconstruction method can clearly show the detail of movement process. DVS only records the change of luminance intensity, it is very difficult to reconstruct the texture. We use two recently published DVS reconstruction methods [26] and [25] to generate visual image, but the results are unsatisfactory; while CeleX can roughly see the process of falling pages, but the shadow is serious, the edges of front and back pages can not be clearly distinguished; Huawei P30 rear camera can record videos with 60 FPS in default mode, the pages and electric fan are blurred. The video results can be found in our supplementary material. + +![](images/0dccae822a8629ef4ada872a7f5731942a69ccf3bc6ef3ec44aaa643a86fe01c.jpg) +Figure 8. The reconstruction results of different vision sensors. + +There are also some limitations in our method: some mechanisms in our model (e.g. motion confidence matrix and STDP) need a short period of previous spike data (about 15ms) to calculate the current state. If the camera itself moves too fast, the spike train received by the neuron may comes from different objects thus causing blur. Despite of this, we think it does not affect the application. + +# 5. Conclusion + +In this paper, we have proposed a novel three-layer spiking neural model to reconstruct visual images for spike camera. We comprehensively discuss the spike distribution and construct a probability model to describe it. Additionally, a dynamic neuron extraction model is proposed to distinguish the dynamic and static neurons. A combination of biologically plausible mechanisms in introduced to process the continuous-time spikes. Finally, the visual image can be reconstructed according to the state of the neuron and the firing threshold. To test our method, we build a dataset including normal-speed and high-speed scenes. The results show that our method can reconstruct high quality visual images in both high-speed motion and static scenes. + +Acknowledgments. This work is partially supported by grants from the National Natural Science Foundation of China under contract No. 61825101 and No. U1611461. + +# References + +[1] Patrick Lichtsteiner an Christoph Posch and Tobi Delbruck. A $128 \times 128$ 120 db 15 μs latency asynchronous temporal contrast vision sensor. IEEE Journal of Solid-State Circuits, 43(2):566-576, 2008. 1 +[2] Juan Antonio Lenero Bardallo, Jose-Maria Guerrero-Rodriguez, Ricardo Carmona-Galan, and Angel Rodriguez-Vazquez. On the analysis and detection of flames with an asynchronous spiking image sensor. IEEE Sensors Journal, 18(16):6588-6595, Aug 2018. 1 +[3] Michel Baudry. Synaptic plasticity and learning and memory: 15 years of progress. Neurobiology of learning and memory, 70(1-2):113-118, 1998. 3, 5 +[4] Guo-qiang Bi and Mu-ming Poo. Synaptic modifications in cultured hippocampal neurons: dependence on spike timing, synaptic strength, and postsynaptic cell type. Journal of Neuroscience, 18(24):10464-10472, 1998. 3, 4, 5 +[5] 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. 1 +[6] Eugenio Culurciello, Ralph Etienne-Cummings, and Kwabena A Boahen. A biomorphic digital image sensor. IEEE Journal of Solid-State Circuits, 38(2):281-294, 2003. 1 +[7] F Yu Daniel and Jeffrey A Fessler. Mean and variance of single photon counting with deadtime. Physics in Medicine & Biology, 45(7):2043, 2000. 2 +[8] Tobi Delbrück, Bernabe Linares-Barranco, Eugenio Culurciello, and Christoph Posch. Activity-driven, event-based vision sensors. In IEEE International Symposium on Circuits and Systems, pages 2426-2429, 2010. 1 +[9] Peter U Diehl and Matthew Cook. Unsupervised learning of digit recognition using spike-timing-dependent plasticity. Frontiers in Computational Neuroscience, 9:99, 2015. 3, 4, 5 +[10] Pierre Falez, Pierre Tirilly, Joan Marius Bilasco, Philippe Devienne, and Pierre Boulet. Mastering the output frequency in spiking neural networks. In 2018 International Joint Conference on Neural Networks (IJCNN), pages 1-8. IEEE, 2018. 5 +[11] Daniel Gehrig, Henri Rebecq, Guillermo Gallego, and Davide Scaramuzza. Asynchronous, photometric feature tracking using events and frames. In 2018 European Conference on Computer Vision (ECCV), pages 750-765, 2018. 1 +[12] Stuart Geman and Donald Geman. Stochastic relaxation, gibbs distributions, and the bayesian restoration of images. IEEE Transactions on Pattern Analysis and Machine Intelligence, (6):721-741, 1984. 3, 4 +[13] Menghan Guo, Jing Huang, and Shoushun Chen. Live demonstration: A $768 \times 640$ pixels 200meps dynamic vision sensor. In 2017 IEEE International Symposium on Circuits and Systems (ISCAS), pages 1-1. IEEE, 2017. 1 +[14] Christof Koch and Idan Segev. Methods in neuronal modeling: from ions to networks. MIT press, 1998. 3 +[15] Vladimir Kolmogorov and Ramin Zabih. What energy functions can be minimized via graph cuts? IEEE Transactions + +on Pattern Analysis and Machine Intelligence, (2):147-159, 2004. 5 +[16] Juan Antonio Leero-Bardallo, D. H. Bryn, and Philipp Hfliger. Bio-inspired asynchronous pixel event tricolor vision sensor. IEEE Transactions on Biomedical Circuits and Systems, 8(3):345-357, June 2014. 1 +[17] Stan Z Li. Markov random field modeling in image analysis. Springer Science & Business Media, 2009. 4 +[18] 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, Oct 1999. 7 +[19] Martin Litzenberger, Christoph Posch, D Bauer, Ahmed Nabil Belbachir, P Schon, B Kohn, and H Garn. Embedded vision system for real-time object tracking using an asynchronous transient vision sensor. In Digital Signal Processing Workshop-signal Processing Education Workshop, pages 173-178, 2006. 1 +[20] Lixiong Liu, Yi Hua, Qingjie Zhao, Hua Huang, and Alan Conrad Bovik. Blind image quality assessment by relative gradient statistics and adaboosting neural network. Signal Processing: Image Communication, 40:1-15, 2016. 7 +[21] Ana I Maqueda, Antonio Loquercio, Guillermo Gallego, Narciso García, and Davide Scaramuzza. Event-based vision meets deep learning on steering prediction for self-driving cars. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5419-5427, 2018. 1 +[22] Niranjan D Narvekar and Lina J Karam. A no-reference image blur metric based on the cumulative probability of blur detection (cpbd). IEEE Transactions on Image Processing, 20(9):2678-2683, 2011. 7, 8 +[23] Christoph Posch, Daniel Matolin, and Rainer Wohlgenan-nt. An asynchronous time-based image sensor. IEEE International Symposium on Circuits and Systems, pages 2130-2133, 2008. 1 +[24] Stanislav Pyatykh, Jürgen Hesser, and Lei Zheng. Image noise level estimation by principal component analysis. IEEE Transactions on Image Processing, 22(2):687-699, 2012. 8 +[25] Henri Rebecq, René Ranftl, Vladlen Koltun, and Davide S-caramuzza. Events-to-video: Bringing modern computer vision to event cameras. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3857-3866, 2019. 8 +[26] Cedric Scheerlinck, Nick Barnes, and Robert Mahony. Continuous-time intensity estimation using event cameras. In 2018 Asian Conference on Computer Vision (ACCV), pages 308-324. Springer, 2018. 8 +[27] Marcel Stimberg, Romain Brette, and Dan Goodman. Brian 2: an intuitive and efficient neural simulator. BioRxiv, page 595710, 2019. 7 +[28] Lin Zhu, Siwei Dong, Tiejun Huang, and Yonghong Tian. A retina-inspired sampling method for visual texture reconstruction. In 2019 IEEE International Conference on Multimedia and Expo (ICME), pages 1432-1437, 2019. 1, 2, 7 \ No newline at end of file diff --git a/retinalikevisualimagereconstructionviaspikingneuralmodel/images.zip b/retinalikevisualimagereconstructionviaspikingneuralmodel/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..84d2cc599c454875e91596a3ea5d2bc4223bd1ad --- /dev/null +++ b/retinalikevisualimagereconstructionviaspikingneuralmodel/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97a18a7c6e20f4b7c1ed686593d7eedaa2c586885267ea0d45dc1608ff377452 +size 587620 diff --git a/retinalikevisualimagereconstructionviaspikingneuralmodel/layout.json b/retinalikevisualimagereconstructionviaspikingneuralmodel/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fdf603dd0131fd0f6ebbf201c5ce45f926c7db90 --- /dev/null +++ b/retinalikevisualimagereconstructionviaspikingneuralmodel/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d7d8a436f5f602776bda3818e9fb77472fe72574f90a353e8e6192d68b92f9b +size 359334 diff --git a/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_content_list.json b/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..240951f61ec7f21e476976684bbbadf721122816 --- /dev/null +++ b/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c611b0e2a98e04349767b1ac0638fc1477cf516db2cc05955431f16383998f4e +size 89343 diff --git a/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_model.json b/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6e7d95294a9ec14471013885f90b9364126b7c2a --- /dev/null +++ b/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5de17dfcb490989381909f0ecbb3e37483c31d27e7c777d57b62487141f1f92 +size 111269 diff --git a/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_origin.pdf b/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f759cc5b86ba7837b7b65ac647685158aedeb29e --- /dev/null +++ b/retinatrackonlinesinglestagejointdetectionandtracking/13e0fd3f-63f7-42b5-8086-9cc83697681e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad6a49750e039a111b8ca81a7f10e417bcf9f82189433cb55effb0e13b7b1b9f +size 2960157 diff --git a/retinatrackonlinesinglestagejointdetectionandtracking/full.md b/retinatrackonlinesinglestagejointdetectionandtracking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..80c61e61f3fe34b0edadfddeaf1f945c569c349a --- /dev/null +++ b/retinatrackonlinesinglestagejointdetectionandtracking/full.md @@ -0,0 +1,358 @@ +# RetinaTrack: Online Single Stage Joint Detection and Tracking + +Zhichao Lu*, Vivek Rathod*, Ronny Votel, Jonathan Huang Google + +{lzc,rathodv,ronnyvotel,jonathanhuang}@google.com + +# Abstract + +Traditionally multi-object tracking and object detection are performed using separate systems with most prior works focusing exclusively on one of these aspects over the other. Tracking systems clearly benefit from having access to accurate detections, however and there is ample evidence in literature that detectors can benefit from tracking which, for example, can help to smooth predictions over time. In this paper we focus on the tracking-by-detection paradigm for autonomous driving where both tasks are mission critical. We propose a conceptually simple and efficient joint model of detection and tracking, called RetinaTrack, which modifies the popular single stage RetinaNet approach such that it is amenable to instance-level embedding training. We show, via evaluations on the Waymo Open Dataset, that we outperform a recent state of the art tracking algorithm while requiring significantly less computation. We believe that our simple yet effective approach can serve as a strong baseline for future work in this area. + +# 1. Introduction + +The tracking-by-detection paradigm today has become the dominant method for multi object tracking (MOT) and works by detecting objects in each frame independently and then performing data association across frames of a video. In recent years, both aspects of this approach (detection and data association) have seen significant technological advances due to the adoption of deep learning. + +Despite the fact that these two tasks often go hand in hand and the fact that deep learning has made models easily amenable to multitask training, even today it is far more common to separate the two aspects than to train them jointly in one model, with most papers often focusing on detection metrics or tracking metrics and rarely both. This task separation has led to more complex models and less efficient approaches. It is telling that the flagship benchmark in this area (MOT Challenge [42]) assumes that models will make use of publicly available detections and that papers continue to claim the use of a real-time tracker while not measuring the time required to perform detection. + +In this paper we are interested primarily in the autonomous driving domain where object detection and multi-object tracking are mission-critical technologies. If we cannot detect and track, we will not be able to predict where vehicles and pedestrians are going (and at what speed), and consequently we will not, e.g., know whether to yield to a pedestrian at the corner or whether to drive full speed down a street despite cars coming down an opposing lane. + +We focus specifically on RGB inputs which, while typically not the only sensing modality used within a modern autonomous vehicle, play an important role; RGB cameras do not have the same range constraints as LIDAR, are considerably cheaper and are capable of detecting much smaller objects which are important particularly for highway driving where the faster driving speeds make it important to be able to react to distant vehicles or pedestrians. + +In the setting of autonomous driving, speed and accuracy are both essential and therefore the choice of architecture is critical as one cannot simply take the heaviest/most performant model or the most lightweight but not as accurate model. We base our model on the RetinaNet detector [36] which is real-time while reaching state of art accuracy and is specifically designed to detect small objects well. To this base detector, we add instance-level embeddings for the purposes of data association. However the vanilla RetinaNet architecture is not suitable for these per-instance embeddings — we propose a simple but effective modification to RetinaNet's post-FPN prediction subnetworks to address these issues. We show via ablations that our model, which we dub, RetinaTrack, benefits from joint training of the tracker and detector. It has small computational overhead compared to base RetinaNet and is therefore fast — due to its simplicity, it is also easy to train via Google TPUs. + +To summarize, our main contributions are as follows: + +- We propose a jointly trained detection and tracking model - our method is simple, efficient and could be feasibly deployed in an autonomous vehicle. +- We propose a simple modification to single shot detection architectures that allow for extracting instance level features; we use these features for tracking, but they could also be useful for other purposes. + +![](images/728023148674662af9cba2d1016bdf910a66433db743151aaddb103c6f6e4bfe.jpg) + +![](images/fcdf42ab91cd436c4fff5ac990163eebc2e0894ec684f83410b07bf0f3082cea.jpg) + +![](images/0a880d795804f1fbc302f17b91d40a04962c9a7e0f7686f11f34ede0228a0e3c.jpg) + +![](images/1b63238ac0baf23ba1d3c228a635a04cd5fca82232643871667669bb8e39603a.jpg) + +![](images/76d4a3ad7baac12fd6988d1152397796aec21ae8b96bc57b6e3955e0f82abb5a.jpg) + +![](images/ad2937d71628bbf37935b33883849f283cf4f60f0d9f393cb0ca7a044ba7b266.jpg) +Figure 1: Example vehicle tracking results on the Waymo Open Dataset — tracks are color coded and for clarity we highlight two tracks in each sequence with arrows. Challenges in this dataset include small objects, frequent occlusions due to other traffic or pedestrians, changing scales and low illumination. + +![](images/566abfe0d9e819ccf94d24bd5bf3b4ecf8d6550c5d91b9ea605499bef1684025.jpg) + +![](images/40e547b6d8ae2f6f8c7c3ef7d6650642f0375a2b56b9ff4eafcc55fd372a8136.jpg) + +![](images/2b59772d3d8fc18e662bce5e0317b7d2269ed13c0d4eda33bc5610f6482296b6.jpg) + +![](images/36c9976630066bae131fe99346fe5ee5ed6afe478a4ad9661ed11aaba3e12f02.jpg) + +- We establish initial strong baselines for detection and tracking from 2d images on the Waymo Open dataset [2] (Figure 1) and show that our method achieves state of the art performance. + +We hope our simple model will serve as a solid baseline and ease future research in joint detection and tracking. + +# 2. Related Work + +Traditionally multi-object tracking and detection have been treated in two separate literatures with trackers often using detectors as black box modules but not necessarily incorporating them deeply. In recent years both fields have begun to rely heavily on deep learning which makes it natural to model both tasks jointly. However with a few exceptions, joint training of detection and tracking remains the exception rather than the rule. And there are few papers that evaluate both tracking and detection with papers often focusing on one evaluation exclusively. + +# 2.1. Object Detection in Images and Video + +In recent years there has been an explosion of technological progress in the field of object detection driven largely by community benchmarks like the COCO challenge [37] and Open Images [31]. There have also been a number of advances in detection specific model architectures including anchor-based models, both single stage (e.g., SSD [39], RetinaNet [36], Yolo variants [44, 45]) and two-stage detectors (e.g., Fast/Faster R-CNN [19, 24, 47], R-FCN [13]), as well as the newer anchor-free models (e.g., CornerNet [32, 33], CenterNet [65], FCOS [55]). + +Building on these single frame architectures are methods incorporating temporal context for better detection in video (specifically to combat motion blur, occlusion, rare poses of objects, etc). Approaches include the use of 3d convolutions (e.g., I3D, S3D) [8,41,62] or recurrent networks [29,38] to extract better temporal features. There are also a number of works that use tracking-like concepts of some form in order to aggregate, but their main focus lies in detection and + +not tracking. For example, there are works exploiting flow (or flow-like quantities) to aggregate features [6, 66-68]. Recently there are also papers that propose object level attention-based aggregation methods [14, 51, 59, 60] which effectively can be viewed at high level as methods to aggregate features along tracks. In many of these cases, simple heuristics to "smooth" predictions along time are also used, including tubelet smoothing [20] or SeqNMS [22]. + +# 2.2. Tracking + +Traditionally trackers have played several different roles. In the cases mentioned above, the role of the tracker has been to improve detection accuracy in videos (e.g. by smoothing predictions over time). In other cases, trackers have also been used to augment (traditionally much slower) detectors allowing for real-time updates based on intermittent detector updates (e.g. [3, 7]). + +Finally in applications such as self-driving and sports analysis, track outputs are themselves of independent interest. For example typical behavior prediction modules take object trajectories as input in order to forecast future trajectories (and thereby react to) predicted behavior of a particular object (like a car or pedestrian) [9, 54, 56, 63, 64]. In this role, the tracking-by-detection paradigm has become the predominant approach taken for multi-object tracking, where detection is first run on each frame of an input sequence, then the results linked across frames (this second step is called data association). + +In the pre-deep learning era, tracking-by-detection methods [11, 21, 61] tended to focus on using whatever visual features were available and finding a way to combat the combinatorial explosion of the various graph optimization problems [12, 17,46] that have been formulated to determine optimal trajectories. In recent years, this trend has been reversed with authors using simple matching algorithms (e.g. Hungarian matching [43]) and focusing on learning features that are better for data association e.g., via deep metric learning [4, 34, 48, 50, 52, 53, 58]. For example [58] proposed + +Deep Sort, a simple yet strong baseline that takes offline detections (produced by Faster RCNN) and links them using an offline trained deep ReID model and Kalman filter motion model. In this context, our work can be viewed as a simplified pipeline compared to Deep Sort, relying on a more lightweight detection network which is unified with a subnetwork tasked with performing ReID. + +# 2.3. Detection meets Tracking + +Strong detection is critical to strong tracking. This can be seen via the commonly used CLEAR MOT metric (MOTA, multiple object tracking accuracy) [42] which penalizes false positives, false negatives and identity switches (the first two terms of which are detection related). The recent Tracktor paper [4] pushes this observation to the limit achieving strong results using only a single frame Faster R-CNN detection model. Tracking itself is accomplished by exploiting the behavior of the second stage of Faster R-CNN that allows an imprecisely specified proposal (e.g. a detection from the previous frame) to be "snapped" onto the closest object in the image. With a few small modifications (including an offline trained ReID component), Tracktor is currently state of the art on the MOT17 Challenge and we compare against this strong baseline in our experiments. + +To address the issue that detection can have such an outsized impact on tracking metrics, benchmarks such as the MOT Challenge have tried to make things "fair" by having multiple methods use exactly the same out-of-the-box provided detections. However this restriction unnecessarily ties one hands as it assumes that the two will be done separately and consequently can preclude jointly trained models such as our own. One wonders whether the paucity of joint detection/tracking literature may be due in part to this emphasis on using black box detections. + +Prior to our work, there have been several recent attempts to train joint tracking/detection models. Feichtenhofer et al. [16] run an R-FCN ([13]) base detection architecture and simultaneously compute correlation maps between high level feature maps of consecutive frames which are then passed to a secondary prediction tower in order to predict frame-to-frame instance motion. Like [16], we train for both tasks jointly. However where they focus exclusively on detection metrics for Imagenet Vid, motivated by autonomous driving needs, we evaluate both tracking and detection metrics. Our architecture is also considerably simpler, faster and based on a stronger single stage detector. + +There are also several works that predict 3d tubelets [18, 26] directly using 3d inputs by using 2d anchor grids that are allowed to "wiggle" in time via a predicted temporal sequence of spatial offsets. However these methods are typically heavier and require a mechanism to associate tubelets amongst each other, often relying on simple heuristics combining single frame scores and IOU overlap. We directly learn to associate detections (and show that this is useful). + +Finally the work most related to our approach is Wang et al. [57] which also combines an FPN based model (with YOLO v3) with an additional embedding layer. In contrast, we use a modification of RetinaNet which has stronger detection performance and we show that without our modifications to the FPN, performance suffers. + +# 3. The RetinaTrack Architecture + +In this section we describe the design of a variant of RetinaNet that allows us to extract per-instance level features. Like other anchor based detectors, every detection produced by RetinaNet is associated with an anchor. In order to link a detection to those in another frame, we would like to be able to identify a feature vector associated with its corresponding anchor and pass it to an embedding network which will be trained with metric learning losses. + +# 3.1. RetinaNet + +To begin, we review the popular RetinaNet architecture [36] and explain why the vanilla model is not suitable for instance level embeddings. Modern convolutional object detectors extract feature maps from sliding window positions arranged along a regular grid over the image. In anchor-based methods such as RetinaNet, we place $K$ anchor boxes $\{A_1,\dots ,A_K\}$ of different shapes (varying aspect ratios and sizes) on top of each grid point and ask the model to make predictions (e.g., classification logits, box regression offsets) relative to these anchors. + +In the case of RetinaNet, we use an FPN-based (feature pyramid network) feature extractor [35] which produces multiple layers of feature maps $F_{i}$ with different spatial resolutions $W_{i} \times H_{i}$ (Figure 2a). Each feature map $F_{i}$ is then passed to two post-FPN task-specific convolutional subnetworks predicting $K$ tensors (one for each possible anchor shape) $\{Y_{i,k}^{cls}\}_{k=1:K}$ each of shape $W_{i} \times H_{i} \times N$ representing $N$ -dimensional classification logits, as well as $K$ tensors $\{Y_{i,k}^{loc}\}_{k=1:K}$ of shape $W_{i} \times H_{i} \times 4$ representing box regression offsets. (Figure 2b). Note that typically papers collapse these outputs to be a single combined tensor instead of $K$ tensors with one for each anchor shape — however for our purposes we separate these predictions for clarity (with the end result being equivalent). + +More formally, we can write the RetinaNet classification and location prediction tensors as a function of each of the feature maps $F_{i}$ as follows: + +$$ +Y _ {i, k} ^ {c l s} \left(F _ {i}\right) \equiv \operatorname {S i g m o i d} \left(\operatorname {C o n v} \left(\operatorname {C o n v} ^ {(4)} \left(F _ {i}; \theta^ {c l s}\right); \phi_ {k} ^ {c l s}\right)\right), \tag {1} +$$ + +$$ +Y _ {i, k} ^ {l o c} \left(F _ {i}\right) \equiv \operatorname {C o n v} \left(\operatorname {C o n v} ^ {(4)} \left(F _ {i}; \theta^ {l o c}\right); \phi_ {k} ^ {l o c}\right), \tag {2} +$$ + +where $k\in \{1,\ldots K\}$ ) indexes into the $K$ anchors. We use $\mathrm{Conv}^{(4)}$ to refer to 4 intermediate $3\times 3$ convolution layers (which include batch norm and ReLu layers unless otherwise specified). The model parameters after the FPN are $\theta^{cls},\{\phi_k^{cls}\}_{k = 1}^K,\theta^{loc}$ and $\{\phi_k^{loc}\}_{k = 1}^K$ . Importantly, while + +![](images/a2d0f062e9fcb93214bb5abbf5b114a7333dd3f2dccba809f73dd7a328227dab.jpg) +(a) + +![](images/f1b166a78a449c3334279c625173065bcdb989a4485f6224fab5f7d75002dec8.jpg) +(b) + +![](images/721b490caa7ea1d3ee08d68f5695e32d6f16aa95c26045a016730d2dc97df06b.jpg) +(c) +Figure 2: Architecture diagrams. (a) Feature Pyramid Network (FPN) and Post-FPN layers of (vanilla) (b) RetinaNet and (c) RetinaTrack. In order to capture instance level features RetinaTrack splits the computational pathways among different anchor shapes at an earlier stage in the Post-FPN subnetwork of RetinaNet. Yellow boxes $F_{i}$ represent feature maps produced by the FPN. In both models we share convolutional parameters across all FPN layers. At level of a single FPN layer, gray boxes represent convolutional layers that are unshared while colored boxes represent sharing relationships (boxes with the same color share parameters). + +![](images/8b595f84b5ff9b66ee12dd8aa61c13c5669c201a45c29b3de5d1994dd69e1737.jpg) +Figure 3: In order to track successfully through occlusions, we need to be able to model that objects that share the same anchor grid center have distinct tracking features. Here, green boxes represent two anchors centered at the same location which match the cars in the scene. Blue dots represent centers of the anchor grid. + +the classification and box regression subnetworks have different parameters for a given FPN layer, the parameters are shared across FPN layers which allow us to treat feature vectors extracted from different layers as if they belonged to compatible embedding spaces. + +# 3.2. Modifying task-prediction subnetworks to have anchor-level features + +From Equations 1,2 all convolutional parameters of RetinaNet are shared amongst all $K$ anchors until the final convolution for the classification and regression subnetworks. Therefore there is no clear way to extract per-instance features since if two detections match to anchors at the same location with different shapes, then the only point in the network at which they would be distinguished are at the final class and box regression predictions. This can be especially problematic when tracking through occlusions when objects are more likely to correspond to anchors which share the same location (Figure 3). + +Our solution is to force the split among the anchors to occur earlier among the post-FPN prediction layers, allowing us to access intermediate level features that can still be + +uniquely associated with an anchor (and consequently a final detection). Our proposed modification is simple — we end up with a similar architecture to RetinaNet, but tie/untie weights in a different manner compared to the vanilla architecture. In our RetinaTrack model we predict via the following parameterization (c.f. Equations 1, 2): + +$$ +F _ {i, k} = \operatorname {C o n v} ^ {\left(m _ {1}\right)} \left(F _ {i}; \theta_ {k}\right), \tag {3} +$$ + +$$ +Y _ {i, k} ^ {c l s} \equiv \operatorname {S i g m o i d} \left(\operatorname {C o n v} \left(\operatorname {C o n v} ^ {\left(m _ {2}\right)} \left(F _ {i, k}; \theta^ {c l s}\right); \phi^ {c l s}\right)\right), \tag {4} +$$ + +$$ +Y _ {i, k} ^ {l o c} \equiv \operatorname {C o n v} \left(\operatorname {C o n v} ^ {\left(m _ {2}\right)} \left(F _ {i, k}; \theta^ {l o c}\right); \phi^ {l o c}\right). \tag {5} +$$ + +Thus for each post-FPN layer $F_{i}$ , we first apply $K$ convolutional sequences (with $m_{1}$ layers) in parallel to predict the $F_{i,k}$ tensors, which we view as per-anchor instance-level features, since from this point on, there will be a unique $F_{i,k}$ associated with every detection produced by the RetinaNet architecture (Figure 2c). We will refer to this first segment of the model as the task-shared post-FPN layers which use separate parameters $\theta_{k}$ for each of the $K$ anchor shapes, but share $\theta_{k}$ across FPN layers (as well as the two tasks of classification and localization). + +The $F_{i,k}$ are not task-specific features, but we next apply two parallel sequences of task-specific post-FPN layers to each $F_{i,k}$ . Each sequence consists of $m_2$ $3 \times 3$ convolutions followed by a $3 \times 3$ final convolution with $N$ output channels in the case of classification logits (where $N$ is the number of classes) and 4 output channels in the case of box regression offsets. For our two task specific subnetworks, we share parameters $\theta^{cls}$ , $\phi^{cls}$ , $\theta^{loc}$ and $\phi^{loc}$ across both the $K$ anchor shapes as well as all FPN layers so that after the task-shared layers, all features can be considered as belonging to compatible spaces. + +# 3.3. Embedding architecture + +Having the instance level features $F_{i,k}$ now in hand, we additionally apply a third sequence of task-specific layers + +consisting of $m_3 \times 1$ convolution layers projecting the instance level features to a final track embedding space with each convolution layer mapping to 256 output channels: + +$$ +Y _ {i, k} ^ {e m b} \equiv \operatorname {C o n v} ^ {\left(m _ {3}\right)} \left(F _ {i, k}; \theta^ {e m b}\right). \tag {6} +$$ + +We use batch norm [28] and ReLU nonlinearities after each convolution except at the final embedding layer and use the same shared parameters across all FPN layers and all $K$ anchor shapes (see again Figure 2c). + +To summarize, RetinaTrack predicts per-anchor instance-level features $F_{i,k}$ . Given a detection $d$ , there is a unique anchor that generated $d$ — and the feature maps $F_{i,k}$ now give us a unique feature vector associated with $d$ . Where RetinaNet models run 4 convolutional layers for each of the two task-specific subnetworks, in RetinaTrack, each output tensor is the result of $m_1 + m_2 + 1$ (or $m_1 + m_3$ in the case of the track embeddings) convolutional layers where $m_1$ , $m_2$ and $m_3$ are structural hyperparameters. We discuss ablations for these settings further in Section 4. + +# 3.4. Training details + +At training time we minimize an unweighted sum of the two standard RetinaNet losses (Sigmoid Focal Loss for classification, and Huber Loss for box regression) as well as an additional embedding loss which encourages detections corresponding to the same track to have similar embeddings. Specifically we train with triplet loss [10, 49] using the BatchHard strategy for sampling triplets [25]. + +$$ +\mathcal {L} _ {B H} (\theta ; X) = \sum_ {j = 1} ^ {A} \text {S o f t P l u s} \left(m + \max _ {\substack {p = 1 \dots A \\ t _ {j} = t _ {p}}} D _ {j p} - \min _ {\substack {\ell = 1 \dots A \\ t _ {j} \neq t _ {\ell}}} D _ {j \ell}\right), \tag{7} +$$ + +where $A$ is the number of anchors that match to groundtruth boxes, $t_y$ is the track identity assigned to anchor $y$ , $D_{ab}$ is the non-squared Euclidean distance between the embeddings of anchor $a$ and anchor $b$ and $m$ is the margin (set to $m = 0.1$ in experiments). Thus triplets are produced by finding a hard positive and a hard negative for each anchor. In practice, we sample 64 triplets for computing the loss. + +For detection losses we follow a target assignment convention similar to that described in [36]. Specifically, an anchor is assigned to a groundtruth box if it has intersection-over-union (IOU) overlap of 0.5 or higher and to background otherwise. Additionally, for each groundtruth box, we force the nearest anchor (with respect to IOU) to be a match even if this IOU is less than the threshold. For triplet losses, we follow a similar convention for assigning track identities to anchors, using a more stringent criterion of $IOU = .7$ or higher for positive matches — finding that this more stringent criterion leads to improved tracking results. Only anchors that match to track identities are used to produce triplets. Further, triplets are always produced from within the same clip. + +We train on Google TPUs (v3) [30] using Momentum SGD with weight decay 0.0004 and momentum 0.9. We construct each batch using 128 clips, drawing two frames for each clip spaced 8 frames apart (Waymo sequences run at $10\mathrm{Hz}$ , so this corresponds to a temporal stride of 0.8 seconds). Batches are placed on 32 TPU cores, colocating frames from the same clip, yielding a per-core batch size of 4 frame pairs. Unless otherwise specified, images are resized to $1024 \times 1024$ resolution, and in order to fit this resolution in TPU memory, we use mixed precision training with bfloat16 type in all our training runs [1]. + +We initialize the model using a RetinaTrack model (removing embedding projections) pretrained on the COCO dataset. Next (unless otherwise stated) we train using a linear learning rate warmup for the first 1000 steps increasing to a base learning rate of 0.001, then use a cosine annealed learning rate [40] for 9K steps. Following RetinaNet, we use random horizontal flip and random crop data augmentations. We also allow all batch norm layers to update independently during training and do not force them to be tied even if neighboring convolution layers are shared. + +# 3.5. Inference and Tracking Logic + +We use our embeddings within a simple single hypothesis tracking system based on greedy bipartite matching. At inference time we construct a track store holding stateful track information. For each track we save previous detections (including bounding boxes, class predictions and scores), embedding vectors and "track states" indicating whether a track is alive or dead (for simplicity, we do not consider tracks to ever be in a "tentative" state, c.f. [58]). We initialize the track store to be empty, then for each frame in a clip, we take the embedding vectors corresponding to the top scoring 100 detections from RetinaTrack. + +These detections are filtered by score thresholding and then we compare the surviving embedding vectors against those in the track store via some specified similarity function $S$ and run greedy bipartite matching disallowing matches where the cosine distance is above a threshold $1 - \epsilon$ . Based on this greedy matching, we then add a detection to an existing track in the track store or we use it to initialize a new track. In our experiments, our similarity function $S$ is always a uniformly weighted sum of IOU overlap (using a truncation threshold of 0.4) and a cosine distance between embeddings. + +For each live track in the track store, we save up to $H$ of its most recent (detection, embedding vector, state) triplets thus allowing new detections to match to any of these $H$ most recent observations for all tracks. Tracks are kept alive for up to 40 frames for re-identification purposes. Conversely we mark a track as dead if it has not been re-identified in over 40 frames. + +
ArchitectureShare task weightsm1m2KmAPInference time (ms per frame)
RetinaNetNo--636.1745
RetinaNetYes--635.3540
RetinaNetNo--131.4537
RetinaNetYes--130.7130
RetinaTrack-13635.1183
RetinaTrack-22635.5575
RetinaTrack-31635.7474
+ +Figure 4: COCO17 ablations. Performance of vanilla RetinaNet and RetinaTrack (without tracking embedding layers) in terms of single image object detection performance on COCO17. $m_{1}$ denotes the number of task-shared post-FPN layers and $m_{2}$ denotes the number of task-specific post-FPN layers. + +# 4. Experiments + +In our experiments we focus on the recently released Waymo Open dataset [2] v1 (Waymo for short). We also report results on the larger v1.1 release in Section 4.4. This dataset contains annotations on 200K frames collected at 10 Hz in Waymo vehicles and covers various geographies and weather conditions. Frames come from 5 camera positions (front and sides). For the purposes of this paper, we focus on 2d detection and tracking and more specifically only on the 'vehicle' class as the dataset has major class imbalance, which is not our main focus. In addition to Waymo, we report ablations on the COCO17 dataset [37]. + +Finally we evaluate both detection and tracking metrics as measured by standard mean AP [15,18,37] (mAP) as well as CLEAR MOT tracking metrics [5,42], specifically using the COCO AP (averaging over IOU thresholds between 0.5 and 0.95) and the py-motmetrics library. We also benchmark using Nvidia V100 GPUs reporting inference time in milliseconds per frame. For all models we only benchmark the "deep learning part", ignoring any bookkeeping logic required by the tracker which is typically very lightweight. + +Evaluating a model simultaneously for detection and tracking requires some care. Detection mAP measures a model's average ability to trade off between precision and recall without requiring a hard operating point — it's therefore better to use a low or zero score threshold for detection mAP. However CLEAR MOT tracking metrics such as MOTA require selecting a single operating point as they directly reference true/false positives and in practice are fairly sensitive to these hyperparameter choices. It is often better to use a higher score threshold to report tracking metrics so as to not admit too many false positives. In our experiments we simple use separate thresholds for evaluation: we evaluate our model as a detector using a near-zero score threshold and as a tracker using a higher score threshold. + +# 4.1. Evaluating RetinaTrack as a detector + +As a preliminary ablation (Table 4), we study the effect of our architectural modifications to RetinaNet on standard single image detection by evaluating on COCO17. In these experiments we drop the embedding layers of RetinaTrack since COCO is not a video dataset. + +For these experiments only, we train with a slightly different setup compared to our later Waymo experiments. We use Resnet-50 as a base feature extractor (Imagenet initialized), and train at $896 \times 896$ resolution with bfloat16 [1] mixed precision. We train with batches of size 64 split across 8 TPU v3 cores, and performing per-core batch normalization. We use a linear learning rate warmup for the first 2K steps increasing to a base learning rate of 0.004, then use a cosine annealed learning rate [40] for 23K steps. Note that we could use heavier feature extractors or higher image resolutions to improve performance, but the main objective of these ablations is to shed light on variations of the Post-FPN subnetworks of RetinaNet and RetinaTrack. + +Recall that $m_{1}$ and $m_{2}$ refer to the number of convolutions for the task-shared and task-specific post-FPN subnetworks respectively. We set $m_{1} + m_{2} = 4$ so as to be comparable to RetinaNet. $K$ is the number of anchor shapes per location which we set to 6 by default but to show that having multiple anchor shapes per location is important for detection, we also compare against a simplified RetinaNet which uses only 1 box per location. Finally we experiment with a version of vanilla RetinaNet where the task-specific subnetworks are forced to share their weights (the "Share task weights" column in Table 4) since this is closer to the task-shared post-FPN layers of RetinaTrack. + +We note firstly that using $K = 6$ anchors per location is very important to strong performance on COCO and that it is better to have separate task-specific subnetworks than it is to share, confirming observations by [36]. We also observe that by using RetinaTrack, we are able to extract per-instance features by design (which we will next use for tracking, but could be generally useful) while achieving similar detection performance on COCO. If one does not need per-instance level features, one can still get slightly better numbers with the original prediction head layout of RetinaNet (which is similar to that of SSD [39] and the RPN used by many papers, e.g., [23, 47]). Among the 3 settings of $(m_1, m_2)$ for RetinaTrack, we find that using 3 task-shared layers $(m_1 = 3)$ followed a single task-specific layer $(m_2 = 1)$ , has a slight edge over the other configurations. + +We report running times (averaged over 500 COCO images) in Table 4. Our modifications increase running time over vanilla RetinaNet — this is unsurprising since the + +
ArchitectureShare task weightsm1m2m3KMOTAmAPInference time (ms per frame)
RetinaNetNo---6-38.1934
RetinaNet*No---638.0237.4344
RetinaNetYes---6-37.9530
RetinaNet*Yes---637.6336.7540
RetinaNetNo--2130.9435.2033
RetinaNetYes--2131.2035.0829
RetinaTrack-132638.7137.9688
RetinaTrack-222639.0838.1481
RetinaTrack-312639.1238.2470
+ +Figure 5: Waymo ablations. Performance of vanilla RetinaNet and RetinaTrack (including tracking embedding layers) in terms of detection mAP and tracking MOTA on the Waymo Open Dataset. $m_{1}$ denotes the number of task-shared post-FPN layers, $m_{2}$ denotes the number of task-specific post-FPN layers, and $m_{3}$ denotes the number of embedding layers. RetinaNet* is a vanilla RetinaNet model (with $K = 6$ ) trained with tracking losses where instance embedding vectors are shared among "colliding anchors". + +
# embedding layersMOTAmAP
038.5237.93
239.1938.24
438.8538.24
+ +Figure 6: Track embedding subnetwork depth ablation. We train versions of RetinaTrack with $m_3 = 0, 2$ , and 4 projection layers. + +cost of the post-FPN subnetworks have now been multiplied by $K$ . Among the three variants of RetinaTrack, $(m_{1} = 3, m_{2} = 1)$ is again the fastest. + +# 4.2. Architectural ablations + +For our remaining experiments we evaluate on Waymo, this time including the embedding network with triplet loss training and additionally evaluating tracking performance using the system described in Section 3.5. + +We first ablate the depth of the embedding network (see Table 6) in which we train models using $m_3 = 0, 2$ and 4 projection layers (fixing $m_1 = 3$ and $m_2 = 1$ as was shown to be best on the COCO ablation above), obtaining best performance for both detection and tracking with 2 layers. + +Setting $m_3 = 2$ layers for the embedding subnetwork, we present our ablations on the Waymo dataset in Table 5, training via the method described in Section 3.4. + +To demonstrate the value of RetinaTrack's anchor-level features for tracking, we evaluate two baseline versions of the vanilla RetinaNet architecture — (1) one where we use $K = 1$ anchor shapes since in this case it is possible to extract per-instance feature vectors, and (2) the standard $K = 6$ setting where during tracking we simply force embeddings for anchors that "collide" at the same spatial center to be the same (we refer to this baseline as RetinaNet*). + +As with the COCO ablations, we see that using multiple $(K = 6)$ anchor shapes is important to both detection and tracking metrics. Thus it is unsurprising that RetinaTrack significantly outperforms the RetinaNet based $(K = 1)$ tracking baseline likely mostly by virtue of being a stronger detector. However both RetinaNet* rows exhibit lower MOTA and mAP results compared to their nonstarred counterparts, suggesting that "abusing" vanilla Reti + +naNet to perform tracking by ignoring colliding anchors is harmful both for detection and tracking, thus underscoring the importance of RetinaTrack's per-anchor embeddings. + +Our best RetinaTrack configuration reaches 39.12 MOTA and has a mAP of 38.24. In contrast to the COCO ablations where vanilla RetinaNet retains a slight edge over RetinaTrack, here we see that RetinaTrack outperforms RetinaNet as a detector, suggesting that by including tracking losses, we are able to boost detection performance. + +Finally with a running time of 70ms per frame, we note that inference with RetinaTrack is faster than the sensor framerate (10 Hz) in the Waymo dataset. Compared to the COCO setting, RetinaTrack must run additional convolution layers for embeddings, but since COCO has 80 classes which makes the top of the network slightly heavier, the final running time is slightly lower in the Waymo setting. + +# 4.3. Joint vs Independent training + +To demonstrate the benefit of joint training with detection and tracking tasks, we now compare RetinaTrack against three natural baselines which use the same tracking system as RetinaTrack but change the underlying data association similarity function (Table 8): + +- An IOU baseline, where detection similarity is measured only by IOU overlap (with no embeddings), +- RetinaTrack w/o triplet loss, in which we ignore the triplet loss (and thus do not train the model specifically for tracking) and measure embedding similarity via the per-instance feature vectors $F_{i,k}$ , and +- RetinaTrack w/R-50 ReID, in which again we ignore triplet loss when training RetinaTrack and feed the detections to an offline-trained re-identification (ReID) model. For the ReID model, we train a Resnet-50 based TriNet model [25] to perform ReID on Waymo. + +We observe that even the IOU-only tracker provides a reasonably strong baseline on Waymo, most likely by virtue of have a strong detection model — it is likely that this tracker is more accurate when the car is driving slowly (compared to, e.g., highway driving). However, using visual + +
ModelMOTATPFPID switchesmAPInference time (ms per frame)
Tracktor35.30106006156171665236.1745
Tracktor++37.94112801156421037036.172645
RetinaTrack39.1911202511669571238.2470
+ +Figure 7: We compare RetinaTrack to Tracktor/Tracktor++ [4] which are currently state of the art on the MOT17 Challenge. + +
ModelMOTAmAPInference time (ms)
IOU baseline35.3638.5370
RetinaTrack w/o triplet loss37.9238.5870
RetinaTrack, w/R-50 ReID37.3938.5880
RetinaTrack39.1938.2470
+ +embeddings allows us to outperform this simple baseline in all cases, and RetinaTrack when trained with detection and metric learning losses jointly outperforms these baselines. + +# 4.4. Comparison against state of the art + +We finally compare (Table 7) against the recent Tracktor and Tracktor++ algorithms which are currently state of the art on MOT Challenge. For these experiments we use our own Tensorflow reimplementations of Tracktor and Tracktor++ which adds a ReID component and camera motion compensation (CMC). Our implementation differs in some details from that described in the original paper in that it is based on the Tensorflow Object Detection API [27] and does not use an FPN. We use the same ReID model as the one in Section 4.3, which matches the approach taken in the Tracktor paper. To verify that our reimplementations are competitive, we submitted results from our Resnet-101 based Tracktor models to the official MOT Challenge server, which achieve nearly identical MOTA numbers as the official submission which uses an FPN (53.4 vs. 53.5). We also submitted results from a Resnet-152 based Tracktor which currently outperforms all entries on the public leaderboard (with 56.7 MOTA). + +On Waymo, we use a Resnet-50 based Tracktor running at $1024 \times 1024$ resolution to be comparable to our model. If we compare the Tracktor (without CMC or ReID) MOTA score to the IOU tracking performance in Table 8, we see that the two approaches are roughly on par. We believe that IOU based tracking can achieve parity with Tracktor here due to (1) having highly accurate detections to begin with, and (2) significant camera motion which hurts Tracktor. + +In fact we observe that Tracktor needs the $++$ to significantly outperform the IOU based tracker. However it is far slower — in addition to running Faster R-CNN, it must run a second Resnet-50 model for ReID followed by CMC (which is time consuming).2 + +Figure 8: Comparison of joint training (RetinaTrack) with alternatives: (1) IOU based similarity tracker, (2) RetinaTrack w/o triplet loss, (3) RetinaTrack w/R-50 ReID, + +
ModelMOTAmAPInference time (ms)
IOU baseline38.2545.7870
Tracktor++42.6242.412645
RetinaTrack44.9245.7070
+ +Figure 9: Evaluations on the Waymo v1.1 dataset (which has a $4 \times$ larger training set than the v1 dataset). + +RetinaTrack outperforms both variants on tracking and detection. It is able to achieve these improvements by significantly reducing the number of false positives and ID switches. And despite being slower than vanilla Tracktor (whose running time is dominated by Faster R-CNN), RetinaTrack is significantly faster than Tracktor++. + +Evaluation on the Waymo v1.1 dataset. As a baseline for future comparisons, we also reproduce our evaluations on the Waymo v1.1 release with $\sim 800\mathrm{K}$ frames for training containing $\sim 1.7\mathrm{M}$ annotated vehicles. For these evaluations, we train for $100\mathrm{K}$ steps with a base learning rate of 0.004 (and all other hyperparameters fixed). Results are shown in Table 9, where we again see the same trends with RetinaTrack significantly outperforming a baseline IOU based tracker as well as outperforming Tracktor++ with a significantly faster running time. + +# 5. Conclusion + +In this paper we have presented a simple but effective model, RetinaTrack, which trains jointly on detection and tracking tasks and extends single stage detectors to handle instance-level attributes, which we note may be of independent interest for applications beyond tracking. + +Additionally we have demonstrated the effectiveness of joint training over the prevailing approach of training independent detection and tracking models. This approach allows RetinaTrack to outperform the current state of the art in multi-object tracking while being significantly faster and able to track through long periods of object disappearance. Finally we hope that our work can serve as a strong baseline for future research in detection and tracking. + +# Acknowledgements + +We are grateful to Sara Beery, Yuning Chai, Wayne Hung, Henrik Kretzschmar, David Ross, Tina Tian, and Jack Valmadre for valuable discussions. + +# References + +[1] Bfloat16: The secret to high performance on cloud tpus. https://cloud.google.com/blog/ products/ai-machine-learning/bfloat16-the-secret-to-high-performance-on-cloud-tpus.5,6 +[2] Waymo open dataset: An autonomous driving dataset, 2019. 2, 6 +[3] Ben Benfold and Ian Reid. Stable multi-target tracking in real-time surveillance video. In CVPR 2011, pages 3457-3464. IEEE, 2011. 2 +[4] Philipp Bergmann, Tim Meinhardt, and Laura Leal-Taixe. Tracking without bells and whistles. arXiv preprint arXiv:1903.05625, 2019. 2, 3, 8 +[5] Keni Bernstein and Rainer Stiefelhagen. Evaluating multiple object tracking performance: the clear mot metrics. Journal on Image and Video Processing, 2008;1, 2008. 6 +[6] Gedas Bertasius, Lorenzo Torresani, and Jianbo Shi. Object detection in video with spatiotemporal sampling networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 331-346, 2018. 2 +[7] Jean-Yves Bouguet et al. Pyramidal implementation of the affine lucas kanade feature tracker description of the algorithm. 2001. 2 +[8] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299-6308, 2017. 2 +[9] Yuning Chai, Benjamin Sapp, Mayank Bansal, and Dragomir Anguelov. Multipath: Multiple probabilistic anchor trajectory hypotheses for behavior prediction. arXiv preprint arXiv:1910.05449, 2019. 2 +[10] Gal Chechik, Varun Sharma, Uri Shalit, and Samy Bengio. Large scale online learning of image similarity through ranking. Journal of Machine Learning Research, 11(Mar):1109-1135, 2010. 5 +[11] Wongun Choi. Near-online multi-target tracking with aggregated local flow descriptor. In Proceedings of the IEEE international conference on computer vision, pages 3029-3037, 2015. 2 +[12] Ingemar J. Cox and Sunita L. Hingorani. An efficient implementation of reid's multiple hypothesis tracking algorithm and its evaluation for the purpose of visual tracking. IEEE Transactions on pattern analysis and machine intelligence, 18(2):138-150, 1996. 2 +[13] Jifeng Dai, Yi Li, Kaiming He, and Jian Sun. R-fcn: Object detection via region-based fully convolutional networks. In Advances in neural information processing systems, pages 379-387, 2016. 2, 3 +[14] Hanming Deng, Yang Hua, Tao Song, Zongpu Zhang, Zhengui Xue, Ruhui Ma, Neil Robertson, and Haibing Guan. Object guided external memory network for video object detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 6678-6687, 2019. 2 +[15] Mark Everingham, SM Ali Eslami, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The + +pascal visual object classes challenge: A retrospective. International journal of computer vision, 111(1):98-136, 2015. 6 +[16] Christoph Feichtenhofer, Axel Pinz, and Andrew Zisserman. Detect to track and track to detect. In Proceedings of the IEEE International Conference on Computer Vision, pages 3038-3046, 2017. 3 +[17] Thomas Fortmann, Yaakov Bar-Shalom, and Molly Scheffe. Sonar tracking of multiple targets using joint probabilistic data association. IEEE journal of Oceanic Engineering, 8(3):173-184, 1983. 2 +[18] Rohit Girdhar, Georgia Gkioxari, Lorenzo Torresani, Manohar Paluri, and Du Tran. Detect-and-track: Efficient pose estimation in videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 350-359, 2018. 3, 6 +[19] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440-1448, 2015. 2 +[20] Georgia Gkioxari and Jitendra Malik. Finding action tubes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 759-768, 2015. 2 +[21] Seyed Hamid Rezatofighi, Anton Milan, Zhen Zhang, Qinfeng Shi, Anthony Dick, and Ian Reid. Joint probabilistic data association revisited. In Proceedings of the IEEE international conference on computer vision, pages 3047-3055, 2015. 2 +[22] Wei Han, Pooya Khorrami, Tom Le Paine, Prajit Ramachandran, Mohammad Babaeizadeh, Honghui Shi, Jianan Li, Shuicheng Yan, and Thomas S Huang. Seq-nms for video object detection. arXiv preprint arXiv:1602.08465, 2016. 2 +[23] 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. 6 +[24] 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. 2 +[25] Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. 5, 7 +[26] Rui Hou, Chen Chen, and Mubarak Shah. Tube convolutional neural network (t-cnn) for action detection in videos. In Proceedings of the IEEE International Conference on Computer Vision, pages 5822-5831, 2017. 3 +[27] Jonathan Huang, Vivek Rathod, Chen Sun, Menglong Zhu, Anoop Korattikara, Alireza Fathi, Ian Fischer, Zbigniew Wojna, Yang Song, Sergio Guadarrama, et al. Speed/accuracy trade-offs for modern convolutional object detectors. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7310-7311, 2017. 8 +[28] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. 5 +[29] Kai Kang, Hongsheng Li, Tong Xiao, Wanli Ouyang, Junjie Yan, Xihui Liu, and Xiaogang Wang. Object detection in videos with tubelet proposal networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 727-735, 2017. 2 + +[30] Sameer Kumar, Victor Bitorff, Dehao Chen, Chiachen Chou, Blake Hechtman, HyoukJoong Lee, Naveen Kumar, Peter Mattson, Shibo Wang, Tao Wang, et al. Scale mlperf-0.6 models on google tpu-v3 pods. arXiv preprint arXiv:1909.09756, 2019. 5 +[31] 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. 2 +[32] 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 +[33] Hei Law, Yun Teng, Olga Russakovsky, and Jia Deng. Cornernet-lite: Efficient keypoint based object detection. arXiv preprint arXiv:1904.08900, 2019. 2 +[34] Laura Leal-Taixe, Cristian Canton-Ferrer, and Konrad Schindler. Learning by tracking: Siamese cnn for robust target association. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 33-40, 2016. 2 +[35] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117-2125, 2017. 3 +[36] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. 1, 2, 3, 5, 6 +[37] 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 +[38] Mason Liu and Menglong Zhu. Mobile video object detection with temporally-aware feature maps. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5686-5695, 2018. 2 +[39] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pages 21-37. Springer, 2016. 2, 6 +[40] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.5, 6 +[41] Wenjie Luo, Bin Yang, and Raquel Urtasun. Fast and furious: Real time end-to-end 3d detection, tracking and motion forecasting with a single convolutional net. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 3569-3577, 2018. 2 +[42] Anton Milan, Laura Leal-Taixe, Ian Reid, Stefan Roth, and Konrad Schindler. Mot16: A benchmark for multi-object tracking. arXiv preprint arXiv:1603.00831, 2016. 1, 3, 6 + +[43] James Munkres. Algorithms for the assignment and transportation problems. Journal of the society for industrial and applied mathematics, 5(1):32-38, 1957. 2 +[44] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 779-788, 2016. 2 +[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] Donald Reid. An algorithm for tracking multiple targets. IEEE transactions on Automatic Control, 24(6):843-854, 1979. 2 +[47] 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. 2, 6 +[48] Amir Sadeghian, Alexandre Alahi, and Silvio Savarese. Tracking the untrackable: Learning to track multiple cues with long-term dependencies. In Proceedings of the IEEE International Conference on Computer Vision, pages 300-311, 2017. 2 +[49] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 815-823, 2015. 5 +[50] Samuel Schulter, Paul Vernaza, Wongun Choi, and Manmohan Chandraker. Deep network flow for multi-object tracking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6951-6960, 2017. 2 +[51] Mykhailo Shvets, Wei Liu, and Alexander C Berg. Leveraging long-range temporal relationships between proposals for video object detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 9756-9764, 2019. 2 +[52] Jeany Son, Mooyeol Baek, Minsu Cho, and Bohyung Han. Multi-object tracking with quadruplet convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5620-5629, 2017. 2 +[53] Siyu Tang, Bjoern Andres, Mykhaylo Andriluka, and Bernt Schiele. Multi-person tracking by multicut and deep matching. In European Conference on Computer Vision, pages 100-111. Springer, 2016. 2 +[54] Yichuan Charlie Tang and Ruslan Salakhutdinov. Multiple futures prediction. arXiv preprint arXiv:1911.00997, 2019. 2 +[55] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. arXiv preprint arXiv:1904.01355, 2019. 2 +[56] Chris Urmson, Joshua Anhalt, Drew Bagnell, Christopher Baker, Robert Bittner, MN Clark, John Dolan, Dave Duggins, Tugrul Galatali, Chris Geyer, et al. Autonomous driving in urban environments: Boss and the urban challenge. Journal of Field Robotics, 25(8):425-466, 2008. 2 +[57] Zhongdao Wang, Liang Zheng, Yixuan Liu, and Shengjin Wang. Towards real-time multi-object tracking. arXiv preprint arXiv:1909.12605, 2019.3 + +[58] Nicolai Wojke, Alex Bewley, and Dietrich Paulus. Simple online and realtime tracking with a deep association metric. In 2017 IEEE International Conference on Image Processing (ICIP), pages 3645-3649. IEEE, 2017. 2, 5 +[59] Chao-Yuan Wu, Christoph Feichtenhofer, Haoqi Fan, Kaiming He, Philipp Krahenbuhl, and Ross Girshick. Long-term feature banks for detailed video understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 284-293, 2019. 2 +[60] Haiping Wu, Yuntao Chen, Naiyan Wang, and Zhaoxiang Zhang. Sequence level semantics aggregation for video object detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 9217-9225, 2019. 2 +[61] Yu Xiang, Alexandre Alahi, and Silvio Savarese. Learning to track: Online multi-object tracking by decision making. In Proceedings of the IEEE international conference on computer vision, pages 4705-4713, 2015. 2 +[62] Saining Xie, Chen Sun, Jonathan Huang, Zhuowen Tu, and Kevin Murphy. Rethinking spatiotemporal feature learning: Speed-accuracy trade-offs in video classification. In Proceedings of the European Conference on Computer Vision (ECCV), pages 305–321, 2018. 2 +[63] Raymond A Yeh, Alexander G Schwing, Jonathan Huang, and Kevin Murphy. Diverse generation for multi-agent sports games. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4610-4619, 2019. 2 +[64] Eric Zhan, Stephan Zheng, Yisong Yue, Long Sha, and Patrick Lucey. Generating multi-agent trajectories using programmatic weak supervision. arXiv preprint arXiv:1803.07612, 2018. 2 +[65] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. arXiv preprint arXiv:1904.07850, 2019. 2 +[66] Xizhou Zhu, Jifeng Dai, Lu Yuan, and Yichen Wei. Towards high performance video object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7210-7218, 2018. 2 +[67] Xizhou Zhu, Yujie Wang, Jifeng Dai, Lu Yuan, and Yichen Wei. Flow-guided feature aggregation for video object detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 408-417, 2017. 2 +[68] Xizhou Zhu, Yuwen Xiong, Jifeng Dai, Lu Yuan, and Yichen Wei. Deep feature flow for video recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2349-2358, 2017. 2 \ No newline at end of file diff --git a/retinatrackonlinesinglestagejointdetectionandtracking/images.zip b/retinatrackonlinesinglestagejointdetectionandtracking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..27897ff46087405a3426e5969f7f5ba22b78e06c --- /dev/null +++ b/retinatrackonlinesinglestagejointdetectionandtracking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4414a5556cf658e86c762aaf57ecd7a2b48bd3ee2f243ce5620ce3f65d5a6ee7 +size 317554 diff --git a/retinatrackonlinesinglestagejointdetectionandtracking/layout.json b/retinatrackonlinesinglestagejointdetectionandtracking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0a3d5f7f02a3406e463ee694a2f82f48e5a2d704 --- /dev/null +++ b/retinatrackonlinesinglestagejointdetectionandtracking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d55f43d7ed120bccd4f385d6d7c3161653db0db7ef5934374b9b06f1c6f09cc4 +size 445460 diff --git a/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_content_list.json b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..88069833229306668c8975206b55d7d577da2b61 --- /dev/null +++ b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ee109d7f0113645df241a4ca25f1907bdadd6ef68b77966174613043f2e239a +size 88707 diff --git a/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_model.json b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_model.json new file mode 100644 index 0000000000000000000000000000000000000000..27a8bb06ad6f253c7e4a82425a45fa390d8df287 --- /dev/null +++ b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c418f44c0cb803de6df9165b8de3135bb667e180dadd83e9767c8e819a5d2e4c +size 100888 diff --git a/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_origin.pdf b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8d105b865d3eb49498eb83f97acc7bd117bf8961 --- /dev/null +++ b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/c97f805a-6d0d-4e5d-9db8-7d1a68317f70_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b8125002e6a4d77121330727bb64bdc327a167bcbe86ffb4f7fd43a4e2c3cab +size 1185406 diff --git a/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/full.md b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..655a27cbedfd13ab7995456051c5256247de7e85 --- /dev/null +++ b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/full.md @@ -0,0 +1,386 @@ +# Reusing Discriminators for Encoding: Towards Unsupervised Image-to-Image Translation + +Runfa Chen, Wenbing Huang, Binghui Huang, Fuchun Sun*, Bin Fang Institute for Artificial Intelligence, Tsinghua University (THUAI) Beijing National Research Center for Information Science and Technology (BNRist), State Key Lab on Intelligent Technology and Systems, Department of Computer Science and Technology, Tsinghua University, Beijing, P.R.China + +crf18@mails.tsinghua.edu.cn, hwenbing@126.com + +{hbh18@mails., fcsun@, fangbin@mail.}tsinghua.edu.cn + +# Abstract + +Unsupervised image-to-image translation is a central task in computer vision. Current translation frameworks will abandon the discriminator once the training process is completed. This paper contends a novel role of the discriminator by reusing it for encoding the images of the target domain. The proposed architecture, termed as NICE-GAN, exhibits two advantageous patterns over previous approaches: First, it is more compact since no independent encoding component is required; Second, this plug-in encoder is directly trained by the adversary loss, making it more informative and trained more effectively if a multiscale discriminator is applied. The main issue in NICE-GAN is the coupling of translation with discrimination along the encoder, which could incur training inconsistency when we play the min-max game via GAN. To tackle this issue, we develop a decoupled training strategy by which the encoder is only trained when maximizing the adversary loss while keeping frozen otherwise. Extensive experiments on four popular benchmarks demonstrate the superior performance of NICE-GAN over state-of-the-art methods in terms of FID, KID, and also human preference. Comprehensive ablation studies are also carried out to isolate the validity of each proposed component. Our codes are available at https://github.com/alpc91/NICE-GAN-pytorch. + +# 1. Introduction + +Image-to-Image translation transforming images from one domain to the other has boosted a variety of applications in vision tasks, from colorization [39], image editing [6], super-resolution [20] to video generation [35]. Given the extensive effort of collecting paired images between do + +![](images/c788824577f0951987bfaaa4d79ac69e9f1d6dab83c0222bf507d73c01c61e18.jpg) +Figure 1: Illustrative difference between CycleGAN-alike methods and our NICE-GAN. + +mains, a more practical line of research [40, 25, 12, 21, 16] directs the goal to unsupervised scenario where no paired information is characterized. Due to the non-identifiability problem [25] in unsupervised translation, various methods have been proposed to address this issue by using additional regulations including weight-coupling [25], cycle-consistency [40, 17, 38], forcing the generator to the identity function [34], or more commonly, combination of them. + +When we revisit current successful translation frameworks (such as the one proposed by CycleGAN [40]), most of them consist of three components for each domain: an encoder to embed the input image to a low-dimension hidden space, a generator to translate hidden vectors to images of the other domain, and a discriminator for domain alignment by using GAN training [9]. While this piled-up way is standard, we are still interested in asking: is there any possibility to rethink the role of each component in current translation frameworks? and more importantly, can we change the current formulation (for example, to a more compact architecture) based on our rethinking? + +The answer is yes, if we check the relation between the encoder and the discriminator. Basically, the discriminator is to distinguish between the translated image of the source domain and the real image of the target domain. To do so, the discriminator should conduct sort of semantics encoding of the input images before it can tell what images are true and what are false. This, in other words, contends the two roles of the discriminator: encoding and classifying. Indeed, the DCGAN paper [30] has revealed the encoding ability of the discriminator: strongly responses to the input image are observed in the first 6 learned convolutional features from the last convolution layer in the discriminator. + +Upon the motivation mentioned above, this paper proposes to reuse the discriminator for encoding. In particular, we reuse early layers of certain number in the discriminator as the encoder of the target domain, as illustrated in Figure. 1. Such kind of reusing exhibits two-fold advantages: I. A more compact architecture is achieved. Since the encoder now becomes part of the discriminator, we no longer require an independent component for encoding. Also, unlike existing methods where the discriminator is abandoned after training, its encoding part is still kept for inference in our framework. II. The encoder is trained more effectively. Traditional training of the encoder is conducted by back-propagating the gradients from the generator, which is indirect. Here, by plugging it into the discriminator, the encoder is directly trained through the discriminative loss. Moreover, modern discriminators have resorted to the multi-scale scheme for more expressive power [8, 13, 7, 36]; our encoder will inherit the expressive ability by nature if the multi-scale discriminator is applied. + +A remaining issue of our approach is how to perform adversary training. For traditional methods [40, 25, 12, 21, 16], the encoder is trained along with the generator for minimizing the GAN loss, while the discriminator is trained separately to maximize the objective. In our framework, the encoder and the discriminator become overlap, and it will bring in instability if we apply traditional training setting—the encoder as part of translation is trained for minimizing, and at the same time it belongs to the discriminator and is also trained for maximizing. To eliminate the inconsistency, we develop a decoupled training paradigm. Specifically, the training of the encoder is only associated with the discriminator, independent of the generator. Our experiments on several benchmarks show that such simple decoupling promotes the training remarkably (see details in Section 4.7). Another intuition behind is that disentangling the encoder from the training of translation will make it towards more general purpose of encoding other than translation along, thereby enabling more generality. + +We summarize our contributions as follow. + +- To the best of our knowledge, we are the first to reuse discriminators for encoding specifically for un- + +supervised image-to-image translation. By such a reusing, a more compact and more effective architecture is derived, which is dubbed as No-Independent-Component-for-Encoding GAN (NICE-GAN). + +- Given that the reusing of discriminator will incur instability in terms of typical training procedure, this paper develops a decoupled training paradigm, which is simple yet efficient. +- Extensive experimental evaluations on several popular benchmarks reveal that the proposed method outperforms various state-of-the-art counterparts. The comprehensive ablation studies are also conducted to verify the effectiveness of each proposed component. + +# 2. Related Work + +Image-to-image translation. Conditional GAN-based standard framework, proposed by Isola et al. [14], promotes the study on image-to-image translation. Several works extend it to deal with super-resolution[36] or video generation[35]. Despite of the promising results they attain, all these approaches need paired data for training, which limits their practical usage. + +Unsupervised image-to-image translation. In terms of unsupervised image-to-image translation with unpaired training data, CycleGAN [40], DiscoGAN [17], DualGAN [38] preserve key attributes between the input and the translated image by using a cycle-consistency loss. Various studies have been proposed towards extension of CycleGAN. The first kind of development is to enable multimodal generations: MUNIT [12] and DRIT [21] decompose the latent space of images into a domain-invariant content space and a domain-specific style space to get diverse outputs. Another enhancement of CycleGAN is to perform translation across multiple (more than two) domains simultaneously, such as StarGAN [5]. A more functional line of research focuses on transformation between domains with larger difference. For example, CoupledGAN [26], UNIT [25], ComboGAN [2] and XGAN [31] using domain-sharing latent space, and U-GAT-IT [16] resort to attention modules for feature selection. Recently, TransGAGA [37] and TravelGAN [1] are proposed to characterize the latent representation by using Cartesian product of geometry and preserving vector arithmetic, respectively. + +Introspective Networks. Exploring the double roles of the discriminator has been conducted by Introspective Neural Networks (INN) [15, 19, 23] and Introspective Adversarial Networks (IAN) [4, 33]. Although INN does share the same purpose of reusing discriminator for generation, it exhibits several remarkable differences compared to our NICE-GAN. First, INN and NICE-GAN tackle different tasks. INN is for pure generation, and the discriminator is reused for generation from hidden vectors to images (as decoding); our NICE-GAN is for translation, and the discrimi + +inator is reused for embedding from images to hidden vectors (as encoding). Furthermore, INN requires sequential training even when doing inference, while NICE-GAN only needs one forward pass to generate a novel image, depicting more efficiency. Regarding IAN, it is also for pure generation and reuses one discriminator to generate self-false samples, which is an introspective mechanism; our NICE-GAN reuses the discriminator of one domain to generate a false sample of the other, which is indeed a mutual introspective mechanism. + +# 3. Our NICE-GAN + +This section presents the detailed formulation of our method. We first introduce the general idea, and then follow it up by providing the details of each component in NICE-GAN. The decoupled training mechanism is specified as well. + +# 3.1. General Formulation + +Problem Definition. Let $\mathcal{X},\mathcal{Y}$ be two image domains. While supervised image-to-image translation requires to learn the conditional mappings $f_{x\rightarrow y} = p(\mathcal{Y}|\mathcal{X})$ and $f_{y\rightarrow x} = p(\mathcal{X}|\mathcal{Y})$ given the joint distribution $p(\mathcal{X},\mathcal{Y})$ , unsupervised translation learns $f_{x\rightarrow y}$ and $f_{y\rightarrow x}$ with only the marginals $p(\mathcal{X})$ and $p(\mathcal{Y})$ provided. Unsupervised translation is ill-posed, since there are infinitely many conditional probabilities corresponded to the same marginal distributions. To address this issue, current methods resort to adding extra regulations, such as weight-coupling [26, 25, 21], cycle-consistency [40, 17, 38], and identity-mapping-enforcing [34, 40], the latter two of which are employed in this paper. + +In most of existing frameworks, the translation $f_{x \to y}$ (resp. $f_{y \to x}$ ) is composed of an encoder $E_x$ (resp. $E_y$ ) and a generator $G_{x \to y}$ (resp. $G_{y \to x}$ ). By combining them all together, it gives $y' = f_{x \to y}(x) = G_{x \to y}(E_x(x))$ (resp. $x' = f_{y \to x}(y) = G_{y \to x}(E_y(y))$ ). The GAN [9] training fashion is usually adopted to enable the translated output to fit the distribution of the target domain. Namely, we use a discriminator $D_y$ (resp. $D_x$ ) to classify between the true image $y$ and the translated image $y'$ (resp. $x$ and $x'$ ). + +No Independent Component for Encoding (NICE). As mentioned in introduction, our NICE-GAN reuses discriminators for encoding, delivering the advantages of efficiency and effectiveness for training. Formally, we divide the discriminator $D_y$ into the encoding part $E_y^D$ and classification part $C_y$ . The encoding part $E_y^D$ will replace the original encoder in $f_{y\to x}$ , resulting in a new translation $f_{y\rightarrow x}(y) = G_{y\rightarrow x}(E_y^D (y))$ . Similarly for the discriminator $D_x$ , we define $E_x^D$ and $C_x$ , and reformulate the translation function as $f_{x\rightarrow y}(x) = G_{x\rightarrow y}(E_x^D (x))$ . As for the classification components $C_x$ and $C_y$ , we further employ the multiscale structure to boost the expressive power. Besides, the + +newly-formulated encoders $E_{x}^{D}$ and $E_{y}^{D}$ exist in the training loops of both translation and discrimination, making them difficult to train. Hence we proposed a decoupled training flowchart in NICE-GAN. The details of the architecture's build-up and training are presented in Section 3.2 and Section 3.3, respectively. Figure 2 illustrates our framework. Unless otherwise noticed, we will remove the superscript $D$ from $E_{x}^{D}$ and $E_{y}^{D}$ for simplicity in what follows. + +# 3.2. Architecture + +Multi-Scale Discriminators $D_x$ and $D_y$ . We only discuss $D_x$ here, since the formulation of $D_y$ is similar. Full details are provided in the supplementary material (SP). Our usage of multi-scale discriminators is inspired from previous works [8, 13, 7, 36]. In these approaches, the discriminator of different scale is applied to the image of different size (the small-size images are attained from the original image by down-sampling). In this paper, we consider a more efficient way by regarding the feature maps in different layers of the single input to be the images of different scales, and then feed each of them to the classifier with the corresponding input size for discriminating, which is similar to the application of feature pyramid representations in object detection (e.g. SSD [27] and FPN [24]). + +We now introduce our idea in a formal way. As mentioned above, the discriminator $D_{x}$ contains two parts: the encoder $E_{x}$ and the classifier $C_x$ . To enable multi-scale processing, the classifier $C_x$ is further divided into three sub-classifiers: $C_x^0$ for local scale (10 x 10 receptive field), $C_x^1$ for middle scale (70 x 70 receptive field), and $C_x^2$ for global scale (286 x 286 receptive field). $C_x^0$ is directly connected to the output of $E_{x}$ . Then, a down-sampling-convolution layer is conducted on $E_{x}$ to provide the feature maps of smaller scale, which are concatenated to two branches: one is linked to $C_x^1$ , and the other one is further down sampled through convolution layers followed by $C_x^2$ . For a single input image, $C_x^0$ , $C_x^1$ , and $C_x^2$ are all trained to predict whether the image is true or false. The multi-scale discriminator is also illustrated in Figure 2. + +Besides the multi-scale design, we develop a residual attention mechanism to further facilitate the feature propagation in our discriminator. Using attention in discriminator is originally proposed by U-GAT-IT [16]. Suppose the encoder contains feature maps of number $K$ (i.e. $E_{x} = \{E_{x}^{k}\}_{k=1}^{K}$ ). The idea of U-GAT-IT is first learning an attention vector $w$ , each element of which counts the importance of each feature map. Then, the attended features computed by $a(x) = w \times E_{x}(x) = \{w_{k} \times E_{x}^{k}(x)\}_{k=1}^{K}$ are leveraged for later classification. Upon but beyond U-GAT-IT, this paper further takes the residual connection into account, that is, we use $a(x) = \gamma \times w \times E_{x}(x) + E_{x}(x)$ , where the trainable parameter $\gamma$ determines the trade-off between the attended features and the original ones. When $\gamma = 0$ , it + +![](images/8a015cf91119fe234681a2006f0fc4aa9431584a668b22ebce18ff0ef0875d70.jpg) +Figure 2: Illustration of the flowchart of NICE-GAN. Here we only display one translation stream from $\mathcal{X}$ to $\mathcal{Y}$ (from dog to cat). Note that we apply a decoupled training fashion: the encoder $E_{y}$ is fixed when minimizing the adversarial loss, the reconstruction loss and the cycle loss, and it is trained when maximizing the adversarial loss. + +returns to $E_{x}(x)$ indicating no attention is used, and otherwise, the attention is activated. By this modification, our method becomes more flexible on adjusting the importance of different feature maps and thus attains more effectiveness in training, which will be clarified by our experiments. + +Generators $G_{x \to y}$ and $G_{y \to x}$ . Both $G_{x \to y}$ and $G_{y \to x}$ are composed of six residual blocks [10], and two sub-pixel convolutional layers for up-sampling [32]. And, we use the AdaLIN light version similar to the paper [16]. In addition, spectral normalization [29] used for the discriminator and cycle-consistency loss is conducted to prevent generators from mode collapse. Full details are presented in the SP. + +# 3.3. Decoupled Training + +The training process is proceeded in terms of three kinds of losses: adversarial loss, identity reconstruction loss, and cycle-consistency loss. The adversarial loss is to pursue domain transfer, while both reconstruction loss and cycle-consistency loss are for tackling the non-identifiability issue as pointed out before. + +Since the encoder $E_{x}$ is not only a part of the discriminator $D_{x}$ but is also taken as the input of the generator $G_{x\rightarrow y}$ , it will incur inconsistency if we apply conventional adversarial training. To overcome this defect, we decouple the training of $E_{x}$ from that of the generator $G_{x\rightarrow y}$ . The details of formulating each loss are provided below. + +Adversarial loss. First, we make use of the least-square adversarial loss by [28] for its more stable training and higher quality of generation. The min-max game is conducted by + +$$ +\begin{array}{l} \min _ {G _ {x \to y}} \max _ {D _ {y} = (C _ {y} \circ E _ {y})} L _ {g a n} ^ {x \to y} := \mathbb {E} _ {y \sim y} \left[ (D _ {y} (y)) ^ {2} \right] \\ + \mathbb {E} _ {x \sim \chi} \left[\left(1 - D _ {y} \left(G _ {x \rightarrow y} \left(E _ {x} (x)\right)\right)\right) ^ {2} \right], \tag {1} \\ \end{array} +$$ + +where, $E_{x}$ is fixed and $E_{y}$ is trained when maximizing + +$L_{\text{gan}}^{x \to y}$ , and both of them are fixed when minimizing $L_{\text{gan}}^{x \to y}$ . + +Cycle-consistency loss. The cycle-consistency loss is first introduced by CycleGAN [40] and DiscoGAN [17], which is to force the generators to be each other's inverse. + +$$ +\min _ {\begin{array}{l}G _ {x \rightarrow y}\\G _ {y \rightarrow x}\end{array}} L _ {\text {c y c l e}} ^ {x \rightarrow y} := \mathbb {E} _ {x \sim \mathcal {X}} \left[ | x - G _ {y \rightarrow x} (E _ {y} (G _ {x \rightarrow y} (E _ {x} (x)))) | _ {1} \right], \tag {2} +$$ + +where $|\cdot|_1$ computes the $\ell_1$ norm, and both $E_x$ and $E_y$ are also frozen. + +Reconstruction loss. Forcing the generator to be close to the identity function is another crucial regulation technique in CycleGAN [40]. Unlike CycleGAN where the identity loss is based on domain similarity assumption, our reconstruction is based on the shared-latent space assumption. Reconstruction loss is to regularize the translation to be near an identity mapping when real samples' hidden vectors of the source domain are provided as the input to the generator of the source domain. Namely, + +$$ +\min _ {G _ {y \rightarrow x}} L _ {\text {r e c o n}} ^ {x \rightarrow y} := \mathbb {E} _ {x \sim \mathcal {X}} \left[ | x - G _ {y \rightarrow x} \left(E _ {x} (x)\right) | _ {1} \right], \tag {3} +$$ + +where $E_{x}$ is still kept unchanged. + +Similarly, we can define the losses from domain $\mathcal{V}$ to $\mathcal{X}$ : $L_{\text{gan}}^{y \to x}, L_{\text{cycle}}^{y \to x}$ , and $L_{\text{recon}}^{y \to x}$ . + +Full objective. The discriminators' final objective is + +$$ +\max _ {E _ {x}, C _ {x}, E _ {y}, C _ {y}} \lambda_ {1} L _ {\text {g a n}}; \tag {4} +$$ + +while the generators' final loss objective is + +$$ +\min _ {G _ {x \rightarrow y}, G _ {y \rightarrow x}} \lambda_ {1} L _ {g a n} + \lambda_ {2} L _ {c y c l e} + \lambda_ {3} L _ {r e c o n}, +$$ + +where, $L_{\text{gan}} = L_{\text{gan}}^{x \to y} + L_{\text{gan}}^{y \to x}, L_{\text{cycle}} = L_{\text{cycle}}^{x \to y} + L_{\text{cycle}}^{y \to x}, L_{\text{recon}} = L_{\text{recon}}^{x \to y} + L_{\text{recon}}^{y \to x}$ , and $\lambda_1, \lambda_2, \lambda_3$ are + +![](images/270befc61b077b5bf10d89e142958982249dee31ccf3ca876d283a047b503aa0.jpg) + +![](images/0764cab12730719a1b13d0e54249275e360f1d698d7478b0d15be2fabaed33ca.jpg) + +![](images/fba985912c4d528e1fd350b60dc8703e149dd7d552365546ac582dc96bebff54.jpg) + +![](images/d9b5fe298c982ace3e640ded70405ef09f31180113e5ffeba12b9fdf7f2df3a6.jpg) + +![](images/a99708fcfbedf0f7ff5265fb8332dbfb5fe8fb91fc758cefc1ba37a658295908.jpg) + +![](images/f7d482a5da5352fea6b5684852803b6805caa36e2e3aaac356f76856811a57bd.jpg) + +![](images/32594cc0dfca6d38f9558d99fb6b4597cb9982df932e81afc2e3b3f424738caa.jpg) + +![](images/41124de46e367114bdde7d169e640927c14356c8975d3433580edc397dcce46c.jpg) +a)Input + +![](images/e57848968a45e7fd08921b91a155d1df1271fdeb389b242f0da5281badc73ccb.jpg) + +![](images/98ed0175a1c5bd7ae48a05a231af5ca156205b363db7c270d4eb456d2cabe7d8.jpg) + +![](images/d76d4dc6877514b36a5907d9fe4e4cd154caaf664a4acc3c41618bb537daf965.jpg) + +![](images/eaf75009e2708ce81a8c363721599551491911f756b06bc13e4f43732c1bfc8b.jpg) + +![](images/f7d1563b3bc2529ee4b136a275c3030fe8cf5dcc229a032c960aaa54803e0554.jpg) + +![](images/ca4069dc74d875f01402a2c5520cb92cc4548c08aa25bd228acf0026a6935d9b.jpg) + +![](images/a070e70815ffd7148fcccc508a57fa867fc09c06778178075ef6a6f914581800.jpg) + +![](images/a8a09bd3c019ec7359c62bb3463fbc995421bdcef3706ce0fdce361f2912449f.jpg) +b)NICE-GAN + +![](images/dfed62d42a854ce5a3afa9f09696e371d82000771d9a42f1643567cfea8fe517.jpg) + +![](images/41c54bbbeeaa2cb83e4be2329d18d0dca0ff324aa7e8021896cc8e18bcbdee1c.jpg) + +![](images/1e8aeb3f4338cc1ea692bdbe973d975624e1e5c08c8a091b62698c93a8eaf725.jpg) + +![](images/6eb73249e1cef72943cc799e1885ceb0dc6f4c8d89e4b213c6fe3b094e364285.jpg) + +![](images/5bbeb63ca693c13e07f6087ab0bec7b32be264fc845287177e66f9ddf39171f3.jpg) + +![](images/602383927659ecac4de734e22479dd1f47fbfc0737871060470e19043f5c8b9d.jpg) + +![](images/e62c7f9c4245bf2f3ab3bdb704875f80c11945b307388873cc4d2c6731c530d4.jpg) + +![](images/f92c47b23afaed4243ee7f9f95dcde9d0b143a9b1908d598c44e5673110090a5.jpg) +c)UGATIT + +![](images/da2767e11affd57ffde934487b09938be6563931dc967d513c8c4244767e4434.jpg) + +![](images/d67b7f804a4ed5d618eb4295dc2d58975494aca32622564fcd30e9ec59c8cf29.jpg) + +![](images/bcda20ced703615fa87e71a4a7b4f2c3a4f7766aa09daccfbeaec6b80d527585.jpg) + +![](images/a07587a99c901a757497260d28e1497fe8c590fdbf711a640ea25da12b129412.jpg) + +![](images/ffb6c70bfd066f07bdb0e5780203743a6701b47f193cadba50607be6fd3a3506.jpg) + +![](images/44814cc99d3b2e9da4ada5b0c155ab6f57dee001c02733606e735689ea8d1e9e.jpg) + +![](images/900b9d01a52e1c1e3554d8dc530637f8efafa6f82e49c95c10ca856fc86194a9.jpg) + +![](images/a868b9dae3fe12473974f527d9504013a13d68f857a99b89336ea38e6c799bda.jpg) +d)CycleGAN +Figure 3: Examples of generated outputs. From top to bottom: dog $\leftrightarrow$ cat, winter $\leftrightarrow$ summer, photo $\leftrightarrow$ vangogh, and zebra $\leftrightarrow$ horse. + +![](images/dbfdc64792b729f5c08621a283bf1e4ecc8e325d1365ffdbcbe58eab26610d97.jpg) + +![](images/2272b2f7da92c4b5a7fd04f79661258386e70db0cf000e8c8d56cead4bec2a2f.jpg) + +![](images/6571ffe53a04b54acc2097353513e2134710e24af07b740cc0215f944d9db769.jpg) + +![](images/a084e72466ff81797aad4331386b0bca961465600b104d44063830996afc4b7c.jpg) + +![](images/17a19daec2610d5b685e2ca383894619fa9c27e47f84ea5719185918cdc8aaf4.jpg) + +![](images/d67781b25e1ed8eb487250384aed232f48921883224f23a611646b8526769283.jpg) + +![](images/672af4f4c44322c1276e1ce5e8de0c839a629da0ac975bbdb263c9804577de34.jpg) + +![](images/134fd8775b0d49b5b03a0e0be24e122635d773fb518446ca3f7fa612e3a84920.jpg) +e)UNIT + +![](images/d9cbe37dbc6349a0e98e87fd4ed6fee41355086cbc4eaf7cf06cb2a06bc9328c.jpg) + +![](images/d0c7a8d1fa9e4d56caa79b114bb44aa493c0acf61abcc2cacb5dd5ceed81a0ed.jpg) + +![](images/339f66e94fd38def16d88a98688a90bfb47929117a77947852f37a7a3636219d.jpg) + +![](images/ac0a8b3826b3e2b85aa3b9c9b5be4ae5ec9506012799a4158a68343e577b5b41.jpg) + +![](images/32da3f14de08d462d7c31bf8c92efea7750f0c8b4d9785f1d832ce0d90649a34.jpg) + +![](images/6ebf18c537d41abe2b00d209fbb4a8f995705d7e8e433918aef8ac77111f5a8a.jpg) + +![](images/e6d52f322425e05117e6e62e0c77e3fa183a7b035158fc0241740dea1c6cc26f.jpg) + +![](images/4b8e7fc91050da8594e9a18edc480445cd5525c4eff7aec5ae61da1fc200c9db.jpg) +f)MUNIT + +![](images/3a21c8623a9c9e6592aa53035e5aff253d28684346602dca80128d042999a8ed.jpg) + +![](images/4bff4b38dc11e096c62e59c9b3d185bb52ecf5195f0022084397db951d7cdb7b.jpg) + +![](images/6c91036c6fc385b01bfb6c7b5bf267805b7c35c5b07e468ec0f878b5ac71d1d6.jpg) + +![](images/44c17b7a045452488d745d5dc5b68dc85b0f0cac782744423b1444e26c2b6291.jpg) + +![](images/342a6afed58a8d69800f3da37e5d438611feda205bffad628f4ab914b2209686.jpg) + +![](images/340503a50fb7218b3241e6ea72b7f1f491eca8af28aa74b63dd97a10105c75e9.jpg) + +![](images/a9590e1977cc1c91b38fe55195de5d3a8a17848c771f215ea198efc8f128e4bc.jpg) + +![](images/53cb5aea5fcf7abedc1ccb87b5af51d5ed5ef3cab4858180f66886038ee0d348.jpg) +g)DRIT + +the trade-off weights (they are fixed as $\lambda_1 = 1$ , $\lambda_2 = 10$ , and $\lambda_3 = 10$ throughout our experiments). + +Note again, the encoders $E_{x}$ and $E_{y}$ are trained under the discriminator's objective but are decoupled from the training of generators. The benefit of the proposed decoupled training paradigm will be analyzed by our experiments. + +# 4. Experiments + +# 4.1. Baselines + +We compare the performance NICE-GAN with state-of-the-art methods including CycleGAN [40], UNIT [25], + +MUNIT [12], DRIT [21], and U-GAT-IT [16] considering their competitive performance on unsupervised image-to-image translation. All compared methods are conducted by using the public codes. Specifically for U-GAT-IT, we use its light version due to the memory limit of our GPU machine. The details of all baselines are introduced in the SP. + +# 4.2. Dataset + +The experiments are carried out on four popular benchmarks of unpaired images: horse $\leftrightarrow$ zebra, summer $\leftrightarrow$ winter-yosemite, yangogh $\leftrightarrow$ photo and cat $\leftrightarrow$ dog. The first three datasets are used in Cy + +Table 1: The FID and the KID $\times 100$ for different algorithms. Lower is better. All of the methods are trained to the 100K-th iterations. NICE-GAN* is the version that the generator network is composed of only four residual blocks. + +
Dataset Methoddog → catwinter → summerphoto → vangoghzebra → horse
FIDKID × 100FIDKID × 100FIDKID × 100FIDKID × 100
NICE-GAN48.791.5876.441.22122.273.71149.484.29
NICE-GAN*51.981.5079.021.35122.593.53150.574.43
U-GAT-IT-light80.753.2280.331.82137.706.03145.473.39
CycleGAN119.324.9379.581.36136.974.75156.195.54
UNIT59.561.9495.934.63136.805.17170.766.30
MUNIT53.251.2699.144.66130.554.50193.437.25
DRIT94.505.2078.611.69136.245.43200.4110.12
Dataset Methodcat → dogsummer → wintervangogh → photohorse → zebra
FIDKID × 100FIDKID × 100FIDKID × 100FIDKID × 100
NICE-GAN44.671.2076.030.67112.002.7965.932.09
NICE-GAN*55.721.8977.130.73117.813.6184.893.29
U-GAT-IT-light64.362.4988.411.43123.574.91113.445.13
CycleGAN125.306.9378.760.78135.014.7195.983.24
UNIT63.781.94112.075.36143.967.44131.047.19
MUNIT60.842.42114.085.27138.866.19128.706.92
DRIT79.574.5781.641.27142.695.62111.637.40
+ +Table 2: Total number of parameters and FLOPs of network modules. NICE-GAN* are the version that the generator network is composed of only four residual blocks. + +
Module MethodTotal number of params(FLOPs)
GeneratorsDiscriminators
U-GAT-IT-light21.2M(105.0G)112.8M(15.8G)
NICE-GAN16.2M(67.6G)93.7M(12.0G)
NICE-GAN*11.5M(48.2G)93.7M(12.0G)
+ +cleGAN [40], whose train-test splits are respectively: 1,067/120 (horse), 1,334/140 (zebra); 1,231/309 (summer), 962/238 (winter); 400/400 (vangogh), 6,287/751 (photo). The last dataset is studied in DRIT [21][22], whose train-test splits are: 771/100 (cat), 1,264/100 (dog). All images of all datasets are cropped and resized to $256 \times 256$ for training and testing. + +# 4.3. Evaluation Metrics + +Human Preference. To compare the veracity of translation outputs generated by different methods, we carry out human perceptual study. Similar to Wang et al. [36], volunteers are shown an input image and three translation outputs from different methods, and given unlimited time they select which translation output looks better. + +The Fréchet Inception Distance (FID) proposed by Heusel et al. (2017) [11] contrast the statistics of generated samples against real samples. The FID fits a Gaussian distribution to the hidden activations of InceptionNet for each compared image set and then computes the Fréchet distance (also known as the Wasserstein-2 distance) between those Gaussians. Lower FID is better, corresponding to generated images more similar to the real. + +![](images/1ee3501f6d5198a2eccac283180b9cc55a0b82e13e0db76609c28b8939057fd8.jpg) +Figure 4: Human preference results. The number indicates the percentage of preference on that translation task. Abbreviation: (D)og, (C)at; (W)inter, (S)ummer; (P)hoto, (V)angogh; (Z)ebra, (H)orse. + +The Kernel Inception Distance (KID) developed by [3] is a metric similar to the FID but uses the squared Maximum Mean Discrepancy(MMD) between Inception representations with a polynomial kernel, $k(x,y) = \left(\frac{1}{d} x^{\mathrm{T}}y + 1\right)^{3}$ , where $d$ is the representation dimension. It can also be viewed as an MMD directly on input images with the kernel $K(x,y) = k(\theta(x),\theta(y))$ , where $\theta$ is the function mapping images to Inception representations. Unlike FID, KID has a simple unbiased estimator, making it more reliable especially when there are much more inception features channels than image numbers. Lower KID indicates more visual similarity between real and generated images. Our implementation of KID is based on https://github.com/mbinkowski/MMD-GAN where the hidden representations are from the Inception-v3 pool3 layer. + +# 4.4. Setup + +We use ReLU as the actionvation function in the generator and leaky-ReLU with a slope of 0.2 in the discriminator. We train all models using the Adam [18] optimizer with the learning rate 0.0001 and $(\beta 1, \beta 2) = (0.5, 0.999)$ on NVIDIA RTX 2080Ti GPUs. For data augmentation, we flip the images horizontally with a probability of 0.5, resized them to $286 \times 286$ , and randomly cropped them to $256 \times 256$ . The batch size is set to 1 for all experiments. We also use a weight decay at the rate of 0.0001. All models are trained over 100K iterations. More details on the training process and network architecture are provided in the SP. + +# 4.5. Comparisons with state of the arts + +Table 1 shows that our approach generally achieves the lowest FID or KID scores on all cases except zebra $\rightarrow$ horse, indicating the promising translation ability of our NICE framework on varying tasks. These two metrics maintain good consistency in relative scores, which fully demonstrates our NICE-GAN reasonably performs well regardless of what measure we have used. By contrast, other methods only perform well on certain datasets; for instance, U-GAT-IT-light, UNIT and MUNIT successfully transforms the semantic of objects(e.g. animal faces), while CycleGAN is good at modifying low-level characteristics (e.g. colors and textures). U-GAT-IT-light roughly shares the same structures (multi-scale discriminators and generators) as NICE-GAN, and it differs from NICE-GAN mainly in its independent formulation of encoders. Table 2 reports total number of parameters and FLOPs of U-GAT-IT-light and NICE-GAN, and it reads that our architecture is more compact by reusing discriminators for encoding. To further observe the visual difference, Figure 3 depicts the translated images of different methods on test sets. The generated images by NICE-GAN are almost more meaningful and have less artifacts than others (see the cat $\leftrightarrow$ dog task for an example). + +In addition to our method, we select two baselines achieving lowest KID scores in each dataset to conduct a human perceptual study. Firstly, volunteers are shown an example pair consisting of source-domain image and a target-domain image as a reference to better understand what style is translating. Secondly, they are given an input image, and three translated outputs among which one is from NICE-GAN and the other two from the selected baselines. They have unlimited time to choose which looks most real based on perceptual realism. The synthesized images are displayed in a randomized order to ensure fair comparisons. Besides, checkpoint questions are set and distributed to each volunteer to validating human effort. A total of 123 questionnaires are collected in which we find that 120 are valid. Figure 4 shows that NICE-GAN wins the majority of votes in all cases except for zebra→horse. These results + +Table 3: Ablation Study. Results of methods are all in 100K iterations of discriminator. NICE: No Independent Component for Encoding; RA: add residual connection in CAM attention module; $C_x^0$ for local scale (10 x 10 receptive field), $C_x^1$ for middle scale (70 x 70 receptive field), and $C_x^2$ for global scale (286 x 286 receptive field); -: decreasing the number of shared layers by 1; +: increasing by 1. + +
Data SetComponentsFIDKID × 100
NICERA\(C_x^0\)\(C_x^1\)\(C_x^2\)
dog → cat××✓✓✓80.753.22
×✓✓✓✓67.602.94
✓×✓✓✓63.803.27
-✓✓✓✓48.551.23
✓✓✓✓✓48.791.58
+✓✓✓✓53.521.84
✓✓✓✓×203.5615.27
✓✓✓××216.0318.57
cat → dog××✓✓✓64.362.49
×✓✓✓✓64.622.41
✓×✓✓✓51.491.68
-✓✓✓✓52.921.82
✓✓✓✓✓44.671.20
+✓✓✓✓54.902.17
✓✓✓✓×238.6221.41
✓✓✓××231.2422.12
+ +are also consistent with the quantitative metrics in Table 1. More examples of the results from our model are included in the SP. + +# 4.6. Ablation study + +We conduct ablation studies on the cat $\leftrightarrow$ dog datasets in Table 3 to isolate the validity of the key components of our method: the NICE strategy, the multi-scale formulation and the Residual Attention (RA) mechanism in discriminators. We perform four groups of experiments. + +NICE and RA. The first group keeps employing the multiscale formulation but removes either or both of NICE and RA to draw the performance difference. The results are reported in Table 3. It verifies that each of NICE and RA contributes to the performance improvement while the importance of NICE is more significant. Overall, by combining all components, NICE-GAN remarkably outperforms all other variants. Figure 5 shows the latent vectors of each domain w/ and w/o NICE on cat $\leftrightarrow$ dog via t-SNE, as well as MMD to compute domain difference. Interestingly, with NICE training, the latent distributions of two domains become more clustered and closer, yet separable to each other. Such phenomenon explains why our NICE-GAN performs promisingly. By shortening the transition path between domains in the latent space, NICE-GAN built upon the shared latent space assumption can probably facilitate domain translation in the image space. + +The number of shared layers. For consistent comparison, + +![](images/0fcedebf33bbc2422c615f16e144e71047f8940254cbe219da6a6596128b1542.jpg) +Figure 5: The t-SNE visualization of the latent vectors, as well as the MMD to measure domain difference. + +we employ the commonly-used ResNet backbone in [40] as our generator and naturally share the whole encoder therein. We also evaluate the effect of changing the number of layers shared by discriminator and encoder. Table 3 shows that whether decreasing or increasing the number of layers generally hinders the performance. Thus, the best choice here is sharing the whole default encoder. + +Multi-scale. The third group of experiments is to evaluate the impact of the multi-scale formulation $(C_x^0, C_x^1, C_x^2)$ in discriminators. The results are summarized in Table 3. We find that removing $C_x^2$ will cause a serious detriment; the importance of $C_x^0$ and $C_x^1$ is task-dependent, and adding $C_x^1$ upon $C_x^0$ does not exhibit clear enhancement on this task. Actually, all three scales are generally necessary and multiscale is more robust, with more discussions in the SP. + +Weight-coupling. Besides, there are existing methods of model compression, such as weight-coupling [25, 21]. Sharing a few layers between two generators enables model compression but detriments the translation performance. For example on $\text{cat} \leftrightarrow \text{dog}$ , the FID increases from 48.79/44.67 to 49.67/56.32 if sharing the first layer of the decoders, and from 48.79/44.67 to 55.00/55.60 if sharing the last layer of encoders. Similar results are observed if we reuse the first layer of the classifiers, the FID increases from 48.79/44.67 to 61.73/46.65. It implies weight-coupling could weaken the translation power for each domain. + +# 4.7. Decoupled Training Analysis + +In our NICE framework, we decouple the training of $E_{x}$ from that of the generator $G_{x\rightarrow y}$ . To prove the effectiveness of this strategy, we develop two additional variants: NICE-GAN-1 and NICE-GAN-2. To be specific, NICE-GAN-1 adopts the conventional training approach, where the encoders are jointly trained with the discriminators and generators. As for NICE-GAN-2, it is also performed in a decoupled way but acts oppositely with our method, that is, the encoders are trained along with the generator, independent to the classifiers in the discriminators. From a more essential sense, the discriminators indeed degenerate to the classifiers in NICE-GAN-2. + +Figure 6 reports the training curves of NICE-GAN, NICE-GAN-1 and NICE-GAN-2. Clearly, the training of NICE-GAN-1 is unstable, which is consistent with our analysis. NICE-GAN-2 performs more stably and better than NICE-GAN-1, but is still inferior to our NICE-GAN. We conjecture that in NICE-GAN-2, using the classifiers for + +![](images/2a72e8778e686e3340500920ded14449595883dc2a2a5b84bca73912f4073f6a.jpg) + +![](images/b73c1f31c65675c64e642dddd8e7e450bd7b370a5cfd644524c2b05cf07ff938.jpg) +Figure 6: Decoupled Training Analysis. NICE-GAN: decoupled training, $E_{x}$ and $E_{y}$ will only be updated by $maxL_{gan}$ ; NICE-GAN-1: jointly train the discriminators and generators, $E_{x}$ and $E_{y}$ will be updated by $minmaxL_{gan}, minL_{cycle}$ and $minL_{recon}$ ; NICE-GAN-2: decoupled training, $E_{x}$ and $E_{y}$ will be updated by $minL_{gan}, minL_{cycle}$ and $minL_{recon}$ . + +![](images/cf4f6ed2e57db44b7d747ae54b0a2c80767553af574401c8af2b8226592aaa53.jpg) + +![](images/bc18117793130eda058c0a0fa63a6040e31035c93d6e54d60967374728f6475a.jpg) + +discriminating is actually aligning the distributions of hidden vectors. Nevertheless, NICE-GAN leverages both the encoders and classifiers for discriminating, underlying that it is matching the distributions of image space, thus more precise information is captured. + +A clear disentanglement of responsibilities of different components makes NICE-GAN simple and effective. Besides, It further supports the idea [4] that features learned by a discriminatively trained network tend to be more expressive than those learned by an encoder network trained via maximum likelihood, and thus better suited for inference. + +# 5. Conclusion + +In this paper, we present NICE-GAN, a novel framework for unsupervised image-to-image translation. It reuses discriminators for encoding and develops a decoupled paradigm for efficient training. Comparable experimental evaluations on several popular benchmarks reveal that NICE-GAN generally achieves superior performance over state-of-the-art methods. Our research is expected to evoke the rethinking on what discriminators actually can do, and it is potentially applicable to refresh the GAN-based models in other cases. + +Acknowledgement. This research was jointly funded by the National Natural Science Foundation of China (NSFC) and the German Research Foundation (DFG) in project Cross Modal Learning, NSFC 61621136008/DFG TRR-169, and the National Natural Science Foundation of China(Grant No.91848206). We thank Chengliang Zhong, Mingxuan Jing and Dr. Tao Kong for the insightful advice. + +# References + +[1] Matthew Amodio and Smita Krishnaswamy. Travelgian: Image-to-image translation by transformation vector learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8983-8992, 2019. +[2] Asha Anoosheh, Eirikur Agustsson, Radu Timofte, and Luc Van Gool. Combogan: Unrestrained scalability for image domain translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 783-790, 2018. +[3] M Binkowski, DJ Sutherland, M Arbel, and A Gretton. Demystifying mmd gans. In International Conference on Learning Representations, 2018. +[4] Andrew Brock, Theodore Lim, James Millar Ritchie, and Nicholas J Weston. Neural photo editing with introspective adversarial networks. In 5th International Conference on Learning Representations, 2017. +[5] Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8789-8797, 2018. +[6] Tali Dekel, Chuang Gan, Dilip Krishnan, Ce Liu, and William T Freeman. Sparse, smart contours to represent and edit images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3511-3520, 2018. +[7] Ugur Demir and Gozde Unal. Patch-based image inpainting with generative adversarial networks. arXiv preprint arXiv:1803.07422, 2018. +[8] Ishan Durugkar, Ian Kemp, and Sridhar Mahadevan. Generative multi-adversarial networks. In International Conference on Learning Representations, 2017. +[9] 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. +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +[11] 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. +[12] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In ECCV, 2018. +[13] Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and locally consistent image completion. ACM Transactions on Graphics (ToG), 36(4):107, 2017. +[14] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adver + +sarial networks. In Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on, 2017. +[15] Long Jin, Justin Lazarow, and Zhuowen Tu. Introspective classification with convolutional nets. In Advances in Neural Information Processing Systems, pages 823-833, 2017. +[16] Junho Kim, Minjae Kim, Hyeonwoo Kang, and Kwang Hee Lee. U-gat-it: Unsupervised generative attentional networks with adaptive layer-instance normalization for image-to-image translation. In International Conference on Learning Representations, 2020. +[17] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1857–1865. JMLR.org, 2017. +[18] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[19] Justin Lazarow, Long Jin, and Zhuowen Tu. Introspective neural networks for generative modeling. In Proceedings of the IEEE International Conference on Computer Vision, pages 2774-2783, 2017. +[20] Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photorealistic single image super-resolution using a generative adversarial network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4681-4690, 2017. +[21] Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Kumar Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In European Conference on Computer Vision, 2018. +[22] Hsin-Ying Lee, Hung-Yu Tseng, Qi Mao, Jia-Bin Huang, Yu-Ding Lu, Maneesh Kumar Singh, and Ming-Hsuan Yang. Drit++: Diverse image-to-image translation viadisentangled representations. arXiv preprint arXiv:1905.01270, 2019. +[23] Kwonjoon Lee, Weijian Xu, Fan Fan, and Zhuowen Tu. Wasserstein introspective neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3702-3711, 2018. +[24] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117-2125, 2017. +[25] Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In Advances in neural information processing systems, pages 700-708, 2017. +[26] Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Advances in neural information processing systems, pages 469-477, 2016. +[27] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pages 21-37. Springer, 2016. +[28] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative + +adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2794-2802, 2017. +[29] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. +[30] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. +[31] Amélie Royer, Konstantinos Bousmalis, Stephan Gouws, Fred Bertsch, Inbar Mosseri, Forrester Cole, and Kevin Murphy. Xgan: Unsupervised image-to-image translation for many-to-many mappings. arXiv preprint arXiv:1711.05139, 2017. +[32] Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1874-1883, 2016. +[33] Jianlin Su. O-gan: Extremely concise approach for auto-encoding generative adversarial networks, 2019. +[34] Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. In International Conference on Learning Representations, 2016. +[35] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. In Advances in Neural Information Processing Systems, pages 1144-1156, 2018. +[36] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8798-8807, 2018. +[37] Wayne Wu, Kaidi Cao, Cheng Li, Chen Qian, and Chen Change Loy. Transgaga: Geometry-aware unsupervised image-to-image translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8012-8021, 2019. +[38] Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In Proceedings of the IEEE international conference on computer vision, pages 2849-2857, 2017. +[39] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pages 649-666. Springer, 2016. +[40] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networkss. In Computer Vision (ICCV), 2017 IEEE International Conference on, 2017. \ No newline at end of file diff --git a/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/images.zip b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..07530136d8d0d63bc25cd1b37facd37f72f8ef26 --- /dev/null +++ b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54af4b84aafa7b87b56e3163843410e2d923020e1e6900566c7230b611bb96e5 +size 802951 diff --git a/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/layout.json b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..128e7f1ca40fbdabcbe0d7c448a37e099bd2bf12 --- /dev/null +++ b/reusingdiscriminatorsforencodingtowardsunsupervisedimagetoimagetranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:728190b7590bfc4731e12be2a139114d4b2af6cfbd4ec5b6f71739567f0f25ec +size 496871 diff --git a/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_content_list.json b/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5fe1e5bfc3f1ea85edd65099a11b1d5d9ea35bf2 --- /dev/null +++ b/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ef201747798267cfda9419943a44df9c1d7a37a9ac3790dae05b317d4bf237a +size 65569 diff --git a/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_model.json b/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7f31a5ccde1580e2411a3f1c95b94ab428469ae5 --- /dev/null +++ b/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5342e900e619a1d3aa2078f13304a83d80265ed321953902c8dd07fae88983bd +size 81409 diff --git a/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_origin.pdf b/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c7b4f5dd5838de831630369a35e49fd1b2225cca --- /dev/null +++ b/revealnetseeingbehindobjectsinrgbdscans/2336c82a-6f6d-4bd0-a344-87b2f9663588_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0804763e76df0e6e0196e49c577b72a5dd3540a09b3776df9365b51136458f0 +size 3203791 diff --git a/revealnetseeingbehindobjectsinrgbdscans/full.md b/revealnetseeingbehindobjectsinrgbdscans/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0f7e4aa7f12dc2d013dc2422692d86abd35c3a74 --- /dev/null +++ b/revealnetseeingbehindobjectsinrgbdscans/full.md @@ -0,0 +1,258 @@ +# RevealNet: Seeing Behind Objects in RGB-D Scans + +Ji Hou + +Angela Dai + +Matthias Nießner + +Technical University of Munich + +![](images/e4b41ac403e95629865c719b7287b5590992c38bbe62653325f629f29a177f9d.jpg) +Figure 1: RevealNet takes an RGB-D scan as input and learns to "see behind objects": from the scan's color images and geometry (encoded as a TSDF), objects in the observed scene are detected (as 3D bounding boxes and class labels) and for each object, the complete geometry of that object is predicted as per-instance masks (in both seen and unseen regions). + +# Abstract + +During 3D reconstruction, it is often the case that people cannot scan each individual object from all views, resulting in missing geometry in the captured scan. This missing geometry can be fundamentally limiting for many applications, e.g., a robot needs to know the unseen geometry to perform a precise grasp on an object. Thus, we introduce the task of semantic instance completion: from an incomplete RGB-D scan of a scene, we aim to detect the individual object instances and infer their complete object geometry. This will open up new possibilities for interactions with objects in a scene, for instance for virtual or robotic agents. We tackle this problem by introducing RevealNet, a new data-driven approach that jointly detects object instances and predicts their complete geometry. This enables a semantically meaningful decomposition of a scanned scene into individual, complete 3D objects, including hidden and unobserved object parts. RevealNet is an end-to-end 3D neural network architecture that leverages joint color and geometry feature learning. The fully-convolutional nature of our 3D network enables efficient inference of semantic instance completion for 3D scans at scale of large indoor environments in a single forward pass. We show that pre + +dicting complete object geometry improves both 3D detection and instance segmentation performance. We evaluate on both real and synthetic scan benchmark data for the new task, where we outperform state-of-the-art approaches by over 15 in mAP@0.5 on ScanNet, and over 18 in mAP@0.5 on SUNCG. + +# 1. Introduction + +Understanding 3D environments is fundamental to many tasks spanning computer vision, graphics, and robotics. In particular, in order to effectively navigate, and moreover interact with an environment, an understanding of the geometry of a scene and the objects it comprises of is essential. This is in contrast to the partial nature of reconstructed RGB-D scans; e.g., due to sensor occlusions. For instance, for a robot exploring an environment, it needs to infer where objects are as well as what lies behind the objects it sees in order to efficiently navigate or perform tasks like grasping. That is, it needs not only instance-level knowledge of objects in the scene, but to also estimate the missing geometry of these objects. Additionally, for content creation or mixed reality applications, captured scenes must be decomposable + +into their complete object components, in order to enable applications such as scene editing or virtual-real object interactions; i.e., it is often insufficient to segment object instances only for observed regions. + +Thus, we aim to address this task of "seeing behind objects," which we refer to as semantic instance completion: predicting object detection as well as instance-level completion for an input partial 3D scan of a scene. Previous approaches have addressed these tasks independently: 3D instance segmentation segments object instances from the visible surface of a partial scan [43, 14, 46, 45, 18, 26, 23, 8], and 3D scan completion approaches predict the full scene geometry [39, 7], but lack the notion of individual objects. In contrast, our approach focuses on the instance level, as knowledge of instances is essential towards enabling interaction with the objects in an environment. + +In addition, the task of semantic instance completion is not only important towards enabling object-level understanding and interaction with 3D environments, but we also show that the prediction of complete object geometry informs the task of semantic instance segmentation. Thus, in order to address the task of semantic instance completion, we propose to consider instance detection and object completion in an end-to-end, fully differentiable fashion. + +From an input RGB-D scan of a scene, our RevealNet model sees behind objects to predict each object's complete geometry. First, object bounding boxes are detected and regressed, followed by object classification and then a prediction of complete object geometry. Our approach leverages a unified backbone from which instance detection and object completion are predicted, enabling information to flow from completion to detection. We incorporate features from both color image and 3D geometry of a scanned scene, as well as a fully-convolutional design in order to effectively predict the complete object decomposition of varying-sized scenes. To address the task of semantic instance completion for real-world scans, where ground truth complete geometry is not readily available, we further introduce a new semantic instance completion benchmark for ScanNet [4], leveraging the Scan2CAD [1] annotations to evaluate semantic instance completion (and semantic instance segmentation). + +In summary, we present a fully-convolutional, end-to-end 3D CNN formulation to predict 3D instance completion that outperforms state-of-the-art, decoupled approaches to semantic instance completion by 15.8 in $\mathrm{mAP} @ 0.5$ on real-world scan data, and 18.5 in $\mathrm{mAP} @ 0.5$ on synthetic data: + +- We introduce the task of semantic instance completion for 3D scans; +- we propose a novel, end-to-end 3D convolutional network which predicts 3D semantic instance completion as object bounding boxes, class labels, and complete object geometry, + +- and we show that semantic instance completion task can benefit semantic instance segmentation and detection performance. + +# 2. Related Work + +Object Detection and Instance Segmentation Recent advances in convolutional neural networks have now begun to drive impressive progress in object detection and instance segmentation for 2D images [9, 33, 23, 32, 20, 13, 21]. Combined with the increasing availability of synthetic and real-world 3D data [4, 39, 2], we are now seeing more advances in object detection [37, 38, 31, 30] for 3D. Sliding Shapes [37] predicted 3D object bounding boxes from a depth image, designing handcrafted features to detect objects in a sliding window fashion. Deep Sliding Shapes [38] then extended this approach to leverage learned features for object detection in a single RGB-D frame. Frustum PointNet [31] tackles the problem of object detection for an RGB-D frame by first detecting object in the 2D image before projecting the detected boxes into 3D to produce final refined box predictions. VoteNet [30] propose a reformulation of Hough voting in the context of deep learning through an end-to-end differentiable architecture for 3D detection purpose. + +Recently, several approaches have been introduced to perform 3D instance segmentation, applicable to single or multi-frame RGB-D input. Wang et al. [43] introduced SGPN to operate on point clouds by clustering semantic segmentation predictions. Li et al. [46] leverages an object proposal-based approach to predict instance segmentation for a point cloud. Simultaneously, Hou et al. [14] presented an approach leveraging joint color-geometry feature learning for detection and instance segmentation on volumetric data. Lahoud et al. [18] proposes to use multi-task losses to predict instance segmentation. Yang et al. [45] and Liu et al. [22] both use bottom-up methods to predict instance segmentation for a point cloud. Our approach also leverages an anchor-based object proposal mechanism for detection, but we leverage object completion to predict instance completion, as well as show that completing object-level geometry can improve detection and instance segmentation performance on volumetric data. + +3D Scan Completion Scan completion of 3D shapes has been a long-studied problem in geometry processing, particularly for cleaning up broken mesh models. In this context, traditional methods have largely focused on filling small holes by locally fitting geometric primitives, or through continuous energy minimization [40, 27, 47]. Surface reconstruction approaches on point cloud inputs [15, 16] can also be applied in this fashion to locally optimize for missing surfaces. Other shape completion approaches leverage priors such as symmetry and structural priors [42, 24, 29, + +36, 41], or CAD model retrieval [25, 34, 17, 19, 35] to predict the scan completion. + +Recently, methods leveraging generative deep learning have been developed to predict the complete geometry of 3D shapes [44, 6, 11, 12]. Song et al. [39] extended beyond shapes to predicting the voxel occupancy for a single depth frame leveraging the geometric occupancy prediction to achieve improved 3D semantic segmentation. Recently, Dai et al. [7] presented a first approach for data-driven scan completion of full 3D scenes, leveraging a fullyconvolutional, autoregressive approach to predict complete geometry along with 3D semantic segmentation. Both Song et al. [39] and Dai et al. [7] show that inferring the complete scan geometry can improve 3D semantic segmentation. With our approach for 3D semantic instance completion, this task not only enables new applications requiring instance-based knowledge of a scene (e.g., virtual or robotic interactions with objects in a scene), but we also show that instance segmentation can benefit from instance completion. + +# 3. Method Overview + +Our network takes as input an RGB-D scan, and learns to join together features from both the color images as well as the 3D geometry to inform the semantic instance completion. The architecture is shown in Fig. 2. + +The input 3D scan is encoded as a truncated signed distance field (TSDF) in a volumetric grid. To combine this with color information from the RGB images, we first extract 2D features using 2D convolutional layers on the RGB images, which are then back-projected into a 3D volumetric grid, and subsequently merged with geometric features extracted from the geometry. The joint features are then fed into an encoder-decoder backbone, which leverages a series of 3D residual blocks to learn the representation for the task of semantic instance completion. Objects are detected through anchor proposal and bounding box regression; these predicted object boxes are then used to crop and extract features from the backbone encoder to predict the object class label as well as the complete object geometry for each detected object as per-voxel occupancies. + +We adopt in total five losses to supervise the learning process illustrated in Fig. 2. Detection contains three losses: (1) objectness using binary cross entropy to indicate that there is an object, (2) box location using a Huber loss to regress the 3D bounding box locations, and (3) classification of the class label loss using cross entropy. Following detection, the completion head contains two losses: per-instance completion loss using binary cross entropy to predict per-voxel occupancies, and a proxy completion loss using binary cross entropy to classify the surface voxels belonging to all objects in the scene. + +Our method operates on a unified backbone for detection + +followed by instance completion, enabling object completion to inform the object detection process; this results in effective 3D detection as well as instance completion. Its fully-convolutional nature enables us to train on cropped chunks of 3D scans but test on a whole scene in a single forward pass, resulting in an efficient decomposition of a scan into a set of complete objects. + +# 4. Network Architecture + +From an RGB-D scan input, our network operates on the scan's reconstructed geometry, encoded as a TSDF in a volumetric grid, as well as the color images. To jointly learn from both color and geometry, color features are first extracted in 2D with a 2D semantic segmentation network [28], and then back-projected into 3D to be combined with the TSDF features, similar to [5, 14]. This enables complementary semantic features to be learned from both data modalities. These features are then input to the backbone of our network, which is structured in an encoder-decoder style. + +The encoder-decoder backbone is composed of a series of five 3D residual blocks, which generates five volumetric feature maps $\mathbb{F} = \{f_i|i = 1\dots 5\}$ . The encoder results in a reduction of spatial dimension by a factor of 4, and symmetric decoder results in an expansion of spatial dimension by a factor of 4. Skip connections link spatially-corresponding encoder and decoder features. For a more detailed description of the network architecture, we refer to the appendix. + +# 4.1. Color Back-Projection + +As raw color data is often of much higher resolution than 3D geometry, to effectively learn from both color and geometry features, we leverage color information by back-projecting 2D CNN features learned from RGB images to 3D, similar to [5, 14]. For each voxel location $v_{i} = (x,y,z)$ in the 3D volumetric grid, we find its pixel location $p_i = (x,y)$ in 2D views by camera intrinsic and extrinsic matrices. We assign the voxel feature at location $v_{i}$ with the learned 2D CNN feature vector at $p_i$ . To handle multiple image observations of the same voxel $v_{i}$ , we apply element-wise view pooling; this also allows our approach to handle a varying number of input images. Note that this back-projection is differentiable, allowing our model to be trained end-to-end and benefit from both RGB and geometric signal. + +# 4.2. Object Detection + +For object detection, we predict the bounding box of each detected object as well as the class label. To inform the detection, features are extracted from feature maps $F_{2}$ and $F_{3}$ of the backbone encoder. We define two set of anchors on these two features maps, $A_{s} = \{a_{i}|i = 1\ldots N_{s}\}$ and + +![](images/ac177b39def56a4253e4e63947f9c7d0e21fd222c23cb816ebefbea5601c89c4.jpg) +Figure 2: Our RevealNet network architecture takes an RGB-D scan as input. Color images are processed with 2D convolutions to spatially compress the information before back-projecting into 3D, to be merged with the 3D geometry features of the scan (following [5, 14]). These joint features are used for object detection (as 3D bounding boxes and class labels) followed by per-instance geometric completion, for the task of semantic instance completion. In contrast to [14], which leverages separate backbones for detection and instance segmentation, our network maintains one unified backbone for both detection and completion head, allowing the completion task to directly inform the detection parameters. + +$A_{b} = \{a_{i}|i = 1\ldots N_{b}\}$ representing 'small' and 'large' anchors for the earlier $F_{2}$ and later $F_{3}$ , respectively, so that the larger anchors are associated with the feature map of larger receptive field. These anchors $A_{s}\cup A_{b}$ are selected through a k-means clustering of the ground truth 3D bounding boxes. For our experiments, we use $N_{s} + N_{b} = 9$ . From these $N_{s} + N_{b}$ clusters, $A_{b}$ are those with any axis $>1.125\mathrm{m}$ , and the rest are in $A_{s}$ . + +The two features maps $F_{2}$ and $F_{3}$ are then processed by a 3D region proposal to regress the 3D object bounding boxes. The 3D region proposal first employs a $1 \times 1 \times 1$ convolution layer to output objectness scores for each potential anchor, producing an objectness feature map with $2(N_{s} + N_{b})$ channels for the positive and negative objectness probabilities. Another $1 \times 1 \times 1$ convolution layer is used to predict the 3D bounding box locations as 6-dimensional offsets from the anchors; we then apply a nonmaximum suppression based on the objectness scores. We use a Huber loss on the log ratios of the offsets to the anchor sizes to regress the final bounding box predictions: + +$$ +\Delta_ {x} = \frac {\mu - \mu_ {a n c h o r}}{\phi_ {a n c h o r}} \quad \Delta_ {w} = \ln (\frac {\phi}{\phi_ {a n c h o r}}) +$$ + +where $\mu$ is the box center point and $\phi$ is the box width. The final bounding box loss is then: + +$$ +L _ {\Delta} = \left\{ \begin{array}{l l} \frac {1}{2} \Delta^ {2}, & \text {i f} | \Delta | \leq 2 \\ | \Delta |, & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Using these predicted object bounding boxes, we then predict the object class labels using features cropped from + +the bounding box locations from $F_{2}$ and $F_{3}$ . We use a 3D region of interest pooling layer to unify the sizes of the cropped feature maps to a spatial dimension of $4 \times 4 \times 4$ to be input to an object classification MLP. + +# 4.3. Instance Completion + +For each object, we infer its complete geometry by predicting per-voxel occupancies. Here, we crop features from feature map $F_{5}$ of the backbone, which has a feature map resolution matching the input spatial resolution, using the predicted object bounding box. These features are processed through a series of five 3D convolutions which maintain the spatial resolution of their input. The complete geometry is then predicted as voxel occupancy using a binary cross entropy loss. + +We predict $N_{\mathrm{class}}$ potential object completions for each class category, and select the final prediction based on the predicted object class. We define ground truth bounding boxes $b_{i}$ and masks $m_{i}$ as $\gamma = \{(b_i,m_i)|i = 1\dots N_b\}$ . Further, we define predicted bounding boxes $\hat{b}_i$ along with predicted masks $\hat{m}_i$ as $\hat{\gamma} = \{(\hat{b}_i,\hat{m}_i)|i = 1\dots \hat{N}_b\}$ . During training, we only train on predicted bounding boxes that overlap with the ground truth bounding boxes: + +$$ +\begin{array}{l} \Omega = \left\{\left(\hat {b} _ {i}, \hat {m} _ {i}, b _ {i}, m _ {i}\right) \mid \operatorname {I o U} \left(\hat {b} _ {i}, b _ {i}\right) \geq 0. 5, \right. \\ \left. \forall (\hat {b} _ {i}, \hat {m} _ {i}) \in \hat {\gamma}, \forall (b _ {i}, m _ {i}) \in \gamma \right\} \\ \end{array} +$$ + +We can then define the instance completion loss for each + +
displaytablebathtubtrashbinsofachaircabinetbookshelfavg
Scene Completion + Instance Segmentation1.650.644.5511.259.099.090.185.455.24
Instance Segmentation + Shape Completion2.273.901.141.6814.869.937.113.035.49
Ours - RevealNet (no color)13.1611.2813.6418.1924.7915.878.6010.6014.52
Ours - RevealNet (no proxy)21.947.6312.5528.2420.3822.5813.429.5117.03
Ours - RevealNet26.8613.2122.3128.9329.4123.6415.3514.4821.77
+ +Table 1: 3D Semantic Instance Completion on ScanNet [4] scans with Scan2CAD [1] targets at mAP@0.5. Our end-to-end formulation achieves significantly better performance than alternative, decoupled approaches that first use state-of-the-art scan completion [7] and then instance segmentation [14] method or first instance segmentation [14] and then shape completion [6]. + +associated pair in $\Omega$ : + +$$ +L _ {\text {c o m p l}} = \frac {1}{| \Omega |} \sum_ {\Omega} \operatorname {B C E} (\operatorname {s i g m o i d} \left(\hat {m} _ {i}\right), m _ {i} ^ {\prime}), +$$ + +$$ +m _ {i} ^ {\prime} (v) = \left\{ \begin{array}{l l} m _ {i} (v) & \text {i f} v \in \hat {b _ {i}} \cap b _ {i} \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +We further introduce a global geometric completion loss on entire scene level that serves as an intermediate proxy. To this end, we use feature map $F_{5}$ as input to a binary cross entropy loss whose target is the composition of all complete object instances of the scene: + +$$ +L _ {\text {g e o m e t r y}} = \mathrm {B C E} (\operatorname {s i g m o i d} (F _ {5}), \cup_ {(b _ {i}, m _ {i}) \in \gamma}). +$$ + +Our intuition is to obtain a strong gradient during training by adding this additional constraint to each voxel in the last feature map $F_{5}$ . We find that this global geometric completion loss further helps the final instance completion performance; see Sec 6. + +# 5. Network Training + +# 5.1.Data + +The input 3D scans are represented as truncated signed distance fields (TSDFs) encoded in volumetric grids. The TSDFs are generated through volumetric fusion [3] during the 3D reconstruction process. For all our experiments, we used a voxel size of $\approx 4.7\mathrm{cm}$ and truncation of 3 voxels. We also input the color images of the RGB-D scan, which we project to the 3D grid using their camera poses. We train our model on both synthetic and real scans, computing 9 anchors through $k$ -means clustering; for real-world ScanNet [4] data, this results in 4 small anchors and 5 large anchors, and for synthetic SUNCG [39] data, this results in 3 small anchors and 6 large anchors. + +At test time, we leverage the fully-convolutional design to input the full scan of a scene along with its color images. During training, we use random $96 \times 48 \times 96$ crops $(4.5 \times 2.25 \times 4.5$ meters) of the scanned scenes, along with a greedy selection of $\leq 5$ images covering the most object geometry in the crop. Only objects with $50\%$ of their complete geometry inside the crop are considered. + +# 5.2. Optimization + +We train our model jointly, end-to-end from scratch. We use an SGD optimizer with batch size 64 for object proposals and 16 for object classification, and all positive bounding box predictions ( $>0.5$ IoU with ground truth box) for object completion. We use a learning rate of 0.005, which is decayed by a factor of 0.1 every 100k steps. We train our model for 200k steps ( $\approx 60$ hours) to convergence, on a single Nvidia GTX 1080Ti. Additionally, we augment the data for training the object completion using ground truth bounding boxes and classification in addition to predicted object detection. + +# 6. Results + +We evaluate our approach on semantic instance completion performance on synthetic scans of SUNCG [39] scenes as well as on real-world ScanNet [4] scans, where we obtain ground truth object locations and geometry from CAD models aligned to ScanNet provided by Scan2CAD [1]. To evaluate semantic instance completion, we use a mean average precision metric on the complete masks (at IoU 0.5). Qualitative results are shown in Figs. 3 and 4. + +Comparison to state-of-the-art approaches for semantic instance completion. Tables 1 and 2 evaluate our method against state of the art for the task of semantic instance completion on our real and synthetic scans, respectively. Qualitative comparisons on ScanNet scans [4] with Scan2CAD [1] targets (which provide ground truth for complete object geometry) are shown in Fig. 3. We compare to state-of-the-art 3D instance segmentation and scan completion approaches used sequentially; that is, first applying a 3D instance segmentation approach followed by a shape completion method on the predicted instance segmentation, as well as first applying a scene completion approach to the input partial scan, followed by a 3D instance segmentation method. For 3D instance segmentation, we evaluate 3D-SIS [14], which achieves state-of-the-art performance on a dense volumetric grid representation (the representation we use), and for scan completion we evaluate the 3D + +![](images/d237e05c8b6848ab111b1e6c025e6b6909d06d413974f932512dbd02d50645f9.jpg) +Figure 3: Qualitative results on real-world ScanNet [4] scenes with Scan2CAD [1] targets. Close-ups are shown on the right. Note that different colors denote distinct object instances in the visualization. Our approach effectively predicts complete individual object geometry, including missing structural components (e.g., missing chair legs), across varying degrees of partialness in input scan observations. + +![](images/37ba4049c26979e9a6871633e1af5847da494202c66a67e39147da216f0c732b.jpg) + +EPN [6] shape completion approach and ScanComplete [7] scene completion approach. Our end-to-end approach for semantic instance completion results in significantly improved performance due to information flow from instance completion to object detection. For instance, this allows our instance completion to more easily adapt to some inaccuracies in detection, which strongly hinders a decoupled approach. Note that the ScanComplete model applied on + +ScanNet data is trained on synthetic data, due to the lack of complete ground truth scene data (Scan2CAD provides only object ground truth) for real-world scans. + +Does instance completion help instance detection and segmentation? We can also evaluate our semantic instance completion predictions on the task of semantic instance segmentation by taking the intersection between the predicted complete mask and the input partial scan geom- + +
cabbedchairsofatabldoorwindbkshfcntrdeskshlfcurtdrsrmirrtvnightoilsinklampbathostrofurnopropavg
SC + IS3.00.619.50.818.115.90.000.01.02.33.00.00.50.09.210.423.93.49.10.00.00.09.15.5
IS + SC0.30.07.40.43.09.10.00.00.20.00.00.02.30.03.00.02.60.01.80.00.00.04.61.5
no color19.0541.838.211.923.99.10.00.02.521.69.10.012.64.649.433.863.436.938.814.715.90.023.820.5
no proxy12.946.139.426.830.31.015.90.09.118.23.40.01.10.043.634.069.132.429.631.114.60.023.320.9
Ours14.758.338.228.829.50.015.954.69.112.19.10.06.20.049.433.561.234.529.527.116.40.023.524.0
+ +Table 2: 3D Semantic Instance Completion on synthetic SUNCG [39] scans at mAP@0.5. Our semantic instance completion approach achieves significantly better performance than alternative approaches with decoupled state-of-the-art scan completion (SC) [7] followed by instance segmentation (IS) [14], as well as instance segmentation followed by shape completion [6]. We additionally evaluate our approach without color input (no color) and without a completion proxy loss on the network backbone (no proxy). + +![](images/23aa011061dd098cd738128fb65918be5320ebd8d0af30d8c10c7298f82d62fa.jpg) +Figure 4: Qualitative results on SUNCG dataset [39] (left: full scans, right: close-ups). We sample RGB-D images to reconstruct incomplete 3D scans from random camera trajectories inside SUNCG scenes. Note that different colors denote distinct object instances in the visualization. + +![](images/18ad77c16b270696faa3e5af2b2e338ecfd03265492021c48db180782c4c8c74.jpg) + +etry to be the predicted instance segmentation mask. We show that predicting instance completion helps instance segmentation, evaluating our method on 3D semantic instance segmentation with and without completion, on Scan- + +Net [4] and SUNCG [39] scans in Tables 3 and 4, as well as 3D-SIS [14], an approach jointly predicts 3D detection and instance segmentation, which also operates on dense volumetric data, achieving state-of-the-art performance on this + +
3D DetectionInstance Segmentation
3D-SIS [14]25.7020.78
Ours (no compl)31.9324.49
Ours (no color)29.2923.55
Ours (no proxy)31.5225.92
Ours36.3930.52
+ +Table 3: 3D Detection and Instance Segmentation on ScanNet [4] scans with Scan2CAD [1] annotations at mAP@0.5. We evaluate our instance completion approach on the task of instance segmentation and detection to justify our contribution that instance completion task helps instance segmentation and detection. We evaluate our approach without completion (no compl), without color input (no color), and without a completion proxy loss on the network backbone (no proxy). Predicting instance completion notably increases performance of predicting both instance segmentation and detection (Ours vs. no compl). We additionally compare against 3D-SIS [14], a state-of-the-art approach for both 3D detection and instance segmentation on 3D dense volumetric data (the representation we use). + +
3D DetectionInstance Segmentation
3D-SIS [14]24.7020.61
Ours (no compl)29.8023.86
Ours (no color)31.7531.59
Ours (no proxy)34.0532.59
Ours37.8136.28
+ +Table 4: 3D Detection and Instance Segmentation on synthetic SUNCG [39] scans at mAP@0.5. To demonstrate the benefits of instance completion task for instance segmentation and 3D detection, we evaluate our semantic instance completion approach on the task of instance segmentation and 3D detection. Predicting instance completion notably benefits 3D detection and instance segmentation (Ours vs. no compl). + +representation. We find that predicting instance completion significantly benefits instance segmentation, due to a more unified understanding of object geometric structures. + +Additionally, we evaluate the effect on 3D detection in Tables 3 and 4; predicting instance completion also significantly improves 3D detection performance. Note that in contrast to 3D-SIS [14] which uses separate backbones for detection and instance segmentation, our unified backbone helps 3D mask information (complete or non-complete) propagate through detection parameters to improve 3D detection performance. + +What is the effect of a global completion proxy? In Tables 1 and 2, we demonstrate the impact of the geometric completion proxy loss; here, we see that this loss improves the semantic instance completion performance on both real + +and synthetic data. In Tables 3 and 4, we can see that it also improves 3D detection and semantic instance segmentation performance. + +Can color input help? Our approach takes as input the 3D scan geometry as a TSDF as well as the corresponding color images. We evaluate our approach with and without the color input stream; on both real and synthetic scans, the color input notably improves semantic instance completion performance, as shown in Tables 1 and 2. + +# 7. Limitations + +Our approach shows significant potential in the task of semantic instance completion, but several important limitations still remain. First, we output a binary mask for the complete object geometry, which can limit the amount of detail represented by the completion; other 3D representations such as distance fields or sparse 3D representations [10] could potentially resolve greater geometric detail. Our approach also uses axis-aligned bounding boxes for object detection; it would be helpful to additionally predict the object orientation. We also do not consider object movement over time, which contains significant opportunities for semantic instance completion in the context of dynamic environments. + +# 8. Conclusion + +In this paper, we tackle the problem of "seeing behind objects" by predicting the missing geometry of individual objects in RGB-D scans. This opens up many possibilities for complex interactions with objects in 3D, for instance for efficient navigation or robotic grasping. To this end, we introduced the new task of semantic instance completion along with RevealNet, a new 3D CNN-based approach to jointly detect objects and predict their complete geometry. Our proposed 3D CNN learns from both color and geometry features to detect and classify objects, then predicts the voxel occupancy for the complete geometry of the object in an end-to-end fashion, which can be run on a full 3D scan in a single forward pass. On both real and synthetic scan data, we significantly outperform state-of-the-art approaches for semantic instance completion. We believe that our approach makes an important step towards higher-level scene understanding and helps to enable object-based interactions and understanding of scenes, which we hope will open up new research avenues. + +# Acknowledgments + +This work was supported by the ZD.B, a Google Research Grant, an Nvidia Professor Partnership, a TUM-IAS Rudolf Moßbauer Fellowship, and the ERC Starting Grant Scan2CAD (804724). + +# References + +[1] Armen Avetisyan, Manuel Dahnert, Angela Dai, Manolis Savva, Angel X. Chang, and Matthias Nießner. Scan2cad: Learning cad model alignment in rgb-d scans. In Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 2019. 2, 5, 6, 8 +[2] Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niessner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3D: Learning from RGB-D data in indoor environments. International Conference on 3D Vision (3DV), 2017. 2 +[3] Brian Curless and Marc Levoy. A volumetric method for building complex models from range images. In Proceedings of the 23rd annual conference on Computer graphics and interactive techniques, pages 303-312. ACM, 1996. 5 +[4] Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 2017. 2, 5, 6, 7, 8 +[5] Angela Dai and Matthias Nießner. 3dmv: Joint 3d-multiview prediction for 3d semantic scene segmentation. In Proceedings of the European Conference on Computer Vision (ECCV), 2018. 3, 4 +[6] Angela Dai, Charles Ruizhongtai Qi, and Matthias Nießner. Shape completion using 3d-encoder-predictor cnns and shape synthesis. In Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 2017. 3, 5, 6, 7 +[7] Angela Dai, Daniel Ritchie, Martin Bokeloh, Scott Reed, Jürgen Sturm, and Matthias Nießner. Scancomplete: Large-scale scene completion and semantic segmentation for 3d scans. In Proc. Computer Vision and Pattern Recognition (CVPR), IEEE, 2018. 2, 3, 5, 6, 7 +[8] Cathrin Elich, Francis Engelmann, Jonas Schult, Theodora Kontogianni, and Bastian Leibe. 3d-bevis: Birds-eye-view instance segmentation. arXiv preprint arXiv:1904.02199, 2019. 2 +[9] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440-1448, 2015. 2 +[10] Benjamin Graham and Laurens van der Maaten. Submanifold sparse convolutional networks. arXiv preprint arXiv:1706.01307, 2017. 8 +[11] Xiaoguang Han, Zhen Li, Haibin Huang, Evangelos Kalogerakis, and Yizhou Yu. High Resolution Shape Completion Using Deep Neural Networks for Global Structure and Local Geometry Inference. In IEEE International Conference on Computer Vision (ICCV), 2017. 3 +[12] Christian Hane, Shubham Tulsiani, and Jitendra Malik. Hierarchical surface prediction for 3d object reconstruction. arXiv preprint arXiv:1704.00710, 2017. 3 +[13] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Computer Vision (ICCV), 2017 IEEE International Conference on, pages 2980-2988. IEEE, 2017. 2 +[14] Ji Hou, Angela Dai, and Matthias Nießner. 3d-sis: 3d semantic instance segmentation of rgb-d scans. In Proc. Computer + +Vision and Pattern Recognition (CVPR), IEEE, 2019. 2, 3, 4, 5, 7, 8 +[15] Michael Kazhdan, Matthew Bolitho, and Hugues Hoppe. Poisson surface reconstruction. In Proceedings of the fourth Eurographics symposium on Geometry processing, volume 7, 2006. 2 +[16] Michael Kazhdan and Hugues Hoppe. Screened poisson surface reconstruction. ACM Transactions on Graphics (TOG), 32(3):29, 2013. 2 +[17] Young Min Kim, Niloy J Mitra, Dong-Ming Yan, and Leonidas Guibas. Acquiring 3d indoor environments with variability and repetition. ACM Transactions on Graphics (TOG), 31(6):138, 2012. 3 +[18] Jean Lahoud, Bernard Ghanem, Marc Pollefeys, and Martin R Oswald. 3d instance segmentation via multi-task metric learning. arXiv preprint arXiv:1906.08650, 2019. 2 +[19] Yangyan Li, Angela Dai, Leonidas Guibas, and Matthias Nießner. Database-assisted object retrieval for real-time 3d reconstruction. In Computer Graphics Forum, volume 34, pages 435-446. Wiley Online Library, 2015. 3 +[20] Tsung-Yi Lin, Piotr Dólár, Ross B Girshick, Kaiming He, Bharath Hariharan, and Serge J Belongie. Feature pyramid networks for object detection. In CVPR, volume 1, page 4, 2017. 2 +[21] Tsung-Yi Lin, Priyal Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. IEEE transactions on pattern analysis and machine intelligence, 2018. 2 +[22] Chen Liu and Yasutaka Furukawa. Masc: Multi-scale affinity with sparse convolution for 3d instance segmentation. arXiv preprint arXiv:1902.04478, 2019. 2 +[23] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pages 21-37. Springer, 2016. 2 +[24] Niloy J Mitra, Leonidas J Guibas, and Mark Pauly. Partial and approximate symmetry detection for 3d geometry. In ACM Transactions on Graphics (TOG), volume 25, pages 560-568. ACM, 2006. 3 +[25] Liangliang Nan, Ke Xie, and Andrei Sharf. A search-classify approach for cluttered indoor scene understanding. ACM Transactions on Graphics (TOG), 31(6):137, 2012. 3 +[26] Gaku Narita, Takashi Seno, Tomoya Ishikawa, and Yohsuke Kaji. Panopticfusion: Online volumetric semantic mapping at the level of stuff and things. arXiv preprint arXiv:1903.01177, 2019. 2 +[27] Andrew Nealen, Takeo Igarashi, Olga Sorkine, and Marc Alexa. Laplacian mesh optimization. In Proceedings of the 4th international conference on Computer graphics and interactive techniques in Australasia and Southeast Asia, pages 381-389. ACM, 2006. 2 +[28] 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. 3 +[29] Mark Pauly, Niloy J Mitra, Johannes Wallner, Helmut Pottmann, and Leonidas J Guibas. Discovering structural + +regularity in 3d geometry. In ACM transactions on graphics (TOG), volume 27, page 43. ACM, 2008. 3 +[30] Charles R Qi, Or Litany, Kaiming He, and Leonidas J Guibas. Deep hough voting for 3d object detection in point clouds. arXiv preprint arXiv:1904.09664, 2019. 2 +[31] Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3d object detection from rgb-d data. arXiv preprint arXiv:1711.08488, 2017. 2 +[32] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 779-788, 2016. 2 +[33] 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. 2 +[34] Tianjia Shao, Weiwei Xu, Kun Zhou, Jingdong Wang, Dongping Li, and Baining Guo. An interactive approach to semantic modeling of indoor scenes with an rgbd camera. ACM Transactions on Graphics (TOG), 31(6):136, 2012. 3 +[35] Yifei Shi, Pinxin Long, Kai Xu, Hui Huang, and Yueshan Xiong. Data-driven contextual modeling for 3d scene understanding. Computers & Graphics, 55:55-67, 2016. 3 +[36] Ivan Sipiran, Robert Gregor, and Tobias Schreck. Approximate symmetry detection in partial 3d meshes. In Computer Graphics Forum, volume 33, pages 131-140. Wiley Online Library, 2014. 3 +[37] Shuran Song and Jianxiong Xiao. Sliding shapes for 3d object detection in depth images. In European conference on computer vision, pages 634-651. Springer, 2014. 2 +[38] Shuran Song and Jianxiong Xiao. Deep sliding shapes for amodal 3d object detection in rgb-d images. arXiv preprint arXiv:1511.02300, 2015. 2 +[39] Shuran Song, Fisher Yu, Andy Zeng, Angel X Chang, Manolis Savva, and Thomas Funkhouser. Semantic scene completion from a single depth image. Proceedings of 30th IEEE Conference on Computer Vision and Pattern Recognition, 2017. 2, 3, 5, 7, 8 +[40] Olga Sorkine and Daniel Cohen-Or. Least-squares meshes. In Shape Modeling Applications, 2004. Proceedings, pages 191–199. IEEE, 2004. 2 +[41] Pablo Speciale, Martin R Oswald, Andrea Cohen, and Marc Pollefeys. A symmetry prior for convex variational 3d reconstruction. In European Conference on Computer Vision, pages 313-328. Springer, 2016. 3 +[42] Sebastian Thrun and Ben Wegbreit. Shape from symmetry. In Tenth IEEE International Conference on Computer Vision (ICCV'05) Volume 1, volume 2, pages 1824-1831. IEEE, 2005. 3 +[43] Weiyue Wang, Ronald Yu, Qiangui Huang, and Ulrich Neumann. Sgpn: Similarity group proposal network for 3d point cloud instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2569-2578, 2018. 2 +[44] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In + +Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1912-1920, 2015. 3 +[45] 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. arXiv preprint arXiv:1906.01140, 2019. 2 +[46] Li Yi, Wang Zhao, He Wang, Minhyuk Sung, and Leonidas Guibas. Gspn: Generative shape proposal network for 3d instance segmentation in point cloud. arXiv preprint arXiv:1812.03320, 2018. 2 +[47] Wei Zhao, Shuming Gao, and Hongwei Lin. A robust hole-filling algorithm for triangular mesh. The Visual Computer, 23(12):987-997, 2007. 2 \ No newline at end of file diff --git a/revealnetseeingbehindobjectsinrgbdscans/images.zip b/revealnetseeingbehindobjectsinrgbdscans/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..39de8491a210f46260c8c96a5879427f60c603b3 --- /dev/null +++ b/revealnetseeingbehindobjectsinrgbdscans/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c9698f76330f9376a6c66306dc57fef3174f2786f9085458e587edf09e04b4d +size 722931 diff --git a/revealnetseeingbehindobjectsinrgbdscans/layout.json b/revealnetseeingbehindobjectsinrgbdscans/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2be1e9670148afc8626906e24c438e97dbfa9f2a --- /dev/null +++ b/revealnetseeingbehindobjectsinrgbdscans/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f10660fc4f04f12c7dff48f4956cd3a9e00b399df5b333b5181a0a648f4d0c2b +size 294550 diff --git a/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_content_list.json b/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0f3ae23507138905423c95fad95e3a238113e742 --- /dev/null +++ b/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dae11adc806bbd21cdd842107f8503c791f9512e9e13bd8960d60721cca98297 +size 79476 diff --git a/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_model.json b/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_model.json new file mode 100644 index 0000000000000000000000000000000000000000..599ed2acb8bc70871f6b36b3550f78d4845c8700 --- /dev/null +++ b/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6577e4344e6ae7891d34ec93bea54dd3dca31d757d331f9e60d1370df0f2e734 +size 97455 diff --git a/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_origin.pdf b/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5d5a001875f9c1cad7fd16ba6300ee38c82dcf9e --- /dev/null +++ b/reverseperspectivenetworkforperspectiveawareobjectcounting/c249461c-2e4e-4105-990d-ded7e045dc60_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78e3cdaf0a78b67b0e36c60a22eb6936a79c8e9b9fceffe09c85e2da430001b6 +size 5189518 diff --git a/reverseperspectivenetworkforperspectiveawareobjectcounting/full.md b/reverseperspectivenetworkforperspectiveawareobjectcounting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f9d1319fc269074f2e7ace2f4e46d80150b6e6aa --- /dev/null +++ b/reverseperspectivenetworkforperspectiveawareobjectcounting/full.md @@ -0,0 +1,377 @@ +# Reverse Perspective Network for Perspective-Aware Object Counting + +Yifan Yang $^{1}$ , Guorong Li $^{*,1,2}$ , Zhe Wu $^{1}$ , Li Su $^{1,2}$ , Qingming Huang $^{1,2,3}$ , Nicu Sebe $^{4}$ + +$^{1}$ School of Computer Science and Technology, UCAS, Beijing, China + +$^{2}$ Key Lab of Big Data Mining and Knowledge Management, UCAS, Beijing, China + +3Key Lab of Intelligent Information Processing, Institute of Computing Technology, CAS, + +Beijing, China + +4University of Trento, Trento, Italy + +{yangyifan16,wuzhe14}@mails.ucas.ac.cn,{liguorong,suli,qmhuang}@ucas.ac.cn,niculae.sebe@unitn.it + +# Abstract + +One of the critical challenges of object counting is the dramatic scale variations, which is introduced by arbitrary perspectives. We propose a reverse perspective network to solve the scale variations of input images, instead of generating perspective maps to smooth final outputs. The reverse perspective network explicitly evaluates the perspective distortions, and efficiently corrects the distortions by uniformly warping the input images. Then the proposed network delivers images with similar instance scales to the regressor. Thus the regression network doesn't need multiscale receptive fields to match the various scales. Besides, to further solve the scale problem of more congested areas, we enhance the corresponding regions of ground-truth with the evaluation errors. Then we force the regressor to learn from the augmented ground-truth via an adversarial process. Furthermore, to verify the proposed model, we collected a vehicle counting dataset based on Unmanned Aerial Vehicles (UAVs). The proposed dataset has fierce scale variations. Extensive experimental results on four benchmark datasets show the improvements of our method against the state-of-the-arts. + +# 1. Introduction + +Counting objects is a hot topic in computer vision because of its wide applications in many areas. The most critical challenge of the counting task is scale variations. Significant effort has been devoted to addressing this issue [30, 19, 20, 32, 29, 4, 23, 13]. These approaches employ detection framework [20, 24] or regression framework [30, 19, 20]. + +Several approaches [39, 4, 18, 21] employ a network with multi-scale receptive fields to adapt to the various + +![](images/9ff04e4bc65d1cee70bcee0575f3cd9d88d2c99e9cfad9ac1f5d18b8f630347b.jpg) +Figure 1: To diminish the scale variation, we uniformly expand the space near the horizon and shrink the space near the lens. The warped image with similar scales releases the burden of training a regression network. + +scales. These methods significantly increase the computation cost brought by learning implicit perspective representations. However, Li et al. [19] prove that the various reception fields deliver similar results. Several other methods [31, 37, 36, 8] exploit perspective maps to normalize the final density maps and achieve accuracy improvements. However, these approaches learn from extra annotations or density maps to generate perspective maps in a supervised way. Besides, the generated perspective maps are highly noised. Therefore, smoothing the outputs with these perspective maps inevitably introduces noises. + +As shown in Fig. 1, in the original image, there is significant scale variation caused by the perspective. Due to networks share the convolution kernels across space, it is challenging for them to adapt to the continuous scales. In + +![](images/d4eafa7f0e466dececdc6d0ab7656a0222808a24f1b7d2b741acf107b7ffbbb0.jpg) +Figure 2: Compared with the existing datasets, the proposed dataset has more dramatic scale variations. + +![](images/a19dd7878224066a88dec988787d08ec42159cc60d6f7099567dc6a8b81b0e6f.jpg) + +spired by a drawing style named reverse perspective [35], in which all the objects have similar scales despite their various locations, we seek to transform the input images to obtain similar instance scales. While reversing the perspective, it is critical to maintain local structures to avoid introducing distortions. Therefore, we uniformly warp the images. As shown in Fig. 1, the warped image has similar instance scales. Therefore, unlike the multi-branch approaches [39, 4, 18, 21], the regression network doesn't need different receptive fields to adapt to the various scales. Thus we efficiently reduce the model complexity. + +In this paper, we propose a reverse perspective network to diminish the scale variations of input images in an unsupervised way. Concretely, the proposed network consists of a perspective estimator and a coordinate transformer. The perspective estimator firstly evaluates the degrees of perspective distortions to obtain perspective factors. Then, guided by the perspective factors, the coordinate transformer warps the input images to obtain similar instance scales. After this transformation, we employ a single branch fully convolutional network to estimate the density maps. Before training the regressor, we pre-train the reverse perspective network to learn to correct the perspective distortions. As the perspective information is rarely available, we propose an objective function to optimize the reverse perspective network in an unsupervised way. Besides, as the reverse perspective network is a lightweight network and is easy to overfit, we look upon the perspective correction problem as a few-shot learning approach and train the proposed method through meta-learning. + +The reverse perspective network still has limitations while encountering seriously crowded regions. To further solve the scale problem in these areas, we strengthen the ground-truth with the evaluation errors. Then the proposed framework forces the regressor to learn from the augmented density maps via an adversarial network. + +To verify the ability of the reverse perspective network to solve scale variations, we collected a vehicle counting dataset with dramatic scale variations1, based on UAVs and + +![](images/48180a2a2cb8423994526178501db004c19e5e89441e6b2cc819e3537365d362.jpg) +a) + +![](images/90e997f7f0246cd8da5182f8ecc7b54a1a8dec210887c988e60a2f5609151cd7.jpg) +b) +Figure 3: a) and b) are the perspective maps generated by PACNN [31] and PGCNet [36] respectively, which are highly noised. The proposed network warps a uniform grid map, and c) is the warped image. + +![](images/5b167cf1df054038ee1646cd26f50a0a10b70637a40f8e8afc6db6bc6e3417b3.jpg) +c) + +named UAVVC, which has more dramatic scale variations than the existing datasets (see Fig. 2). Our proposed method achieves state of the art results. + +The main contributions of our method are summarized as follows: + +- We propose a reverse perspective network to diminish the scale variations of input images in an unsupervised way. Therefore, we efficiently reduce the model complexity of the regression network. +- To improve the estimation accuracies in more congested areas, we strengthen the ground-truth with evaluation errors and force the regressor to learn from it via an adversarial network. +- To verify the ability of the proposed method to handle scale variations, we collect a vehicle counting dataset based on UAVs, which has dramatic scale variations. + +# 2. Related Work + +We categorize the object counting literature into scale-aware approaches and perspective-aware methods. In this section, we analyze the methods in both trends. + +# 2.1. Scale-Aware Approaches + +Most existing approaches solve the scale variations by employing a network with various receptive fields. Zhang et al. [39] and Sam et al. [28] employ multi-column networks with various kernel sizes, while Deb et al. [7] expand the multi-column network with different dilation rates. Otherwise, several other approaches utilize inception blocks to gain different receptive fields [4, 18, 21]. These algorithms significantly increase the computation cost brought by learning implicit perspective representations and want the receptive fields to match the corresponding scales automatically. However, Li et al. [19] prove that the various receptive fields deliver similar results. Besides changing the convolution kernels, a deep network can also obtain various receptive fields from its different layers. Many counting approaches utilize similar architectures with U-net [27] to count crowds and achieve promising performance + +![](images/24e9080a54570f3ccf3f2d22c079eb86f51b5e7aa82efa90081b724e7b133dac.jpg) +Figure 4: The framework of the proposed method. The reverse perspective network estimates the perspective factor of input images and warps the images with generated sampling grids. The regressor then estimates the crowd count in the warped images. We further deliver the estimation results and strengthen ground-truth to the adversarial residual network. The reverse perspective network is pre-trained through unsupervised meta-learning, while the regressor is trained with pixel-loss and the adversarial network. + +[30, 4, 22, 18]. Moreover, some approaches employ multiagents to handle various scales. Sam et al. [29] and Shi et al. [32] train a set of regressors to match the image patches with various densities. Liu et al. [20] use a detector and a regressor to estimate the crowd count and propose a decisionnet to merge the estimation results of two agents. However, these approaches achieve restricted scale diversity, comparing with the continuous scales. + +In this work, we uniformly transform the images to obtain similar scales. The warped images reduce the model complexity as well as the burden of training the regressor to adapt to the continuous scales. + +# 2.2. Perspective-Aware Approaches + +Several algorithms have been proposed to handle the scale variations with perspective information. Shen et al. [30], Sam et al. [29] and Cao et al. [4] split an image into several patches and estimate the crowd count in them. A narrow view angle relieves the variation of target scale, yet the coarse scene splitting strategy has limited influence on the arbitrary perspectives. Besides, some approaches employ perspective maps to normalize the output density maps. Liu et al. [22] design a branch to integrate perspective maps into density maps. However, perspective maps are rarely available. Shi et al. [31] and Zhang et al. [37] generate perspective maps with extra annotations. Yan et al. [36] generate perspective maps from density maps. However, as shown in Fig. 3, the generated perspective maps are highly noised. Therefore, smoothing the outputs with these perspective maps inevitably introduce noises. + +Different from them, we evaluate the perspective distor + +tion in an unsupervised way, and uniformly correct the distortions to avoid introducing new deformities. + +# 3. Method + +The framework of our proposed method is shown in Fig. 4. We employ a single branch regressor to evaluate the crowd count. Before the regressor, the reverse perspective network effectively diminishes the scale variations of input images. Thus the proposed network reduces the model complexity and releases the burden of training the regressor to adapt to the continuous scales. Concretely, the reverse perspective network first evaluates the perspective distortions of input images and generates grid maps for sampling. The proposed network then samples the original images to diminish the scale variations, and the regressor network evaluates the crowd count in the warped images. However, the reverse perspective network still has limitations while encountering regions with serious scale variations. We further address this issue by forcing the regressor to learn from augmented ground-truth via an adversarial network. In this section, we first elaborate on the reverse perspective network and the training method. In the last subsection, we explain the adversarial residual learning method. + +# 3.1. Reverse Perspective Network + +As shown in Fig. 4, the reverse perspective network consists of a perspective estimator and a coordinate transformer. Both components are trained end-to-end with unsupervised meta-learning. + +A key observation is that the information about objects + +is embedded in intermediate CNN features of classification networks [3, 6, 9]. Correspondingly, we evaluate the spatial capacity with the features extracted by the first ten convolutional layers of the pre-trained VGG-16 [33]. We denote the features as $G(X; \psi) \in \mathbb{R}^{CWH}$ , where $\psi$ denotes the parameters of the convolutional layers, $X$ is the input images, $C, W, H$ stand for the number of channels, width, and height respectively. + +While training, the reverse perspective network warps the extracted features to estimate space capacities. In the reference stage, we transfer the input image instead. + +Perspective Estimation As perspective information is rarely available, we estimate the spatial capacity to predict the perspective. The perspective estimator firstly regresses a class-agnostic density map from the extracted features via a convolutional network. The density map is formulated as: + +$$ +Y ^ {C L} = f _ {d} (G (X, \psi), \zeta), \tag {1} +$$ + +where $Y^{CL} \in \mathbb{R}^{1WH}$ , $f_{d}(\cdot)$ denotes dilated convolution operation, and $\zeta$ is the parameters of the convolutional layers. + +As $Y^{CL}$ reveals the spatial capacity rather than the count of specific objects, we exploit the perspective information from it. Images are commonly captured with approaching horizontal viewpoints, so the spatial capacity linearly transforms vertically. Consequently, we embed the vertical capacity of an image into a capacity vector with an adaptive average pooling operation. The capacity vector is defined as: + +$$ +c _ {v} = \text {A d a p t i v e A v e r a g e P o o l i n g} (Y ^ {C L}, K), \tag {2} +$$ + +where $K$ is a pre-defined vertical dimension. As the horizon vector of $Y^{CL}$ is pooled to a single element, $c_{v} \in \mathbb{R}^{1K1}$ . The pooling operation embeds an image with an arbitrary resolution to a scale fixed capacity vector. + +Afterward, we transfer the vector to capacity features with $K$ channels, marked as $c_v^T \in \mathbb{R}^{K11}$ . The perspective estimator then employs fully connected layers to regress the perspective factor $\alpha_o$ as follows: + +$$ +\alpha_ {o} = f _ {p} \left(c _ {v} ^ {T}, \eta\right), \tag {3} +$$ + +where $f_{p}(\cdot)$ is the full connected operation, and $\eta$ indicates the parameters. Since the perspective factor has a clear geometric meaning and guides the coordinate transformer to warp the images, we normalize the factor to a range of (0,1]: + +$$ +\alpha = \exp (- r e l u \left(\alpha_ {o}\right)) + \epsilon , \tag {4} +$$ + +where $\epsilon$ is a constant close to zero. + +Coordinate Transformer As the instance scales are related to the capacity of their belonging space, we shrink the space near the lens to diminish the perspective distortions. A toy example with a dramatic scale variation is shown in + +![](images/2b0fb7750856a5519ad848d31b41ac55af5b8c631514a80dc14721c72b0dc9e2.jpg) +Figure 5: Sketch of a toy example, which simulates the changing of densities and capacities of a density map during coordinates transformation. + +Fig. 5(a). The higher density of the upper area indicates smaller instance scales, while the down area with lower density contains relative bigger objects. When we compress the down area in Fig. 5(b), the density increases, and the scale variation is diminished as well. + +While correcting the perspective distortions, it is critical to maintain local structures to avoid introducing new deformities. Therefore, we employ a coordinate transformation method to uniformly compress the vertical space of images and maintain the horizontal structure. Notably, the transformation method reconstructs the original image from elliptic coordinates to the cartesian coordinates. + +Here, we first explain the elliptic coordinate. In geometry, the elliptic coordinate system is a two-dimensional orthogonal coordinate system in which the coordinate lines are confocal ellipses and hyperbolas. The two foci are fixed, and the focal length is denoted as $2c$ . The most common coordinate system $(\mu, \nu)$ for elliptic curves is defined as: + +$$ +\begin{array}{l} \begin{array}{r l} x & = c * \cosh (\mu) \cos (\nu) \\ y & = c * \sinh (\mu) \sin (\nu) \end{array} \tag {5} \\ { y } { = c * \sinh ( \mu ) \sin ( \nu ) , } \\ \end{array} +$$ + +where $\mu$ is a nonnegative real number which denotes the distance from the pixel to the centre, $\nu \in [0,2\pi ]$ is the corresponding eccentric angle. When transforming from elliptic coordinates to the cartesian coordinates, the space near the x-axis virtually stays the same, yet the space far from the x-axis is compressed. + +The perspective factor is utilized as an adjustment term to guide the perspective correction, and is given the geometry meaning of ratio of the focal length to the image width. As shown in Fig. 6, as the radius is fixed, the perspective factor decides the curvature of confocal ellipses. In other word, it determines the intensity of deformations, and when the perspective factor is smaller, the deformation is more fierce. Moreover, we normalize the $X$ coordinate to $X_{E}\in [0,\pi ]$ , and $Y$ coordinate to $Y_{E}\in [0,1]$ . Therefore, + +![](images/69b457cbcfc8e841b38422999a615a0c86b5a119f8b15dae8aed6719275c4ca0.jpg) +Figure 6: The influence of different perspective factors on the coordinates transformation. + +the transformation is formulated as: + +$$ +\begin{array}{l} x _ {C T} = \frac {\alpha}{2} * \cosh (x _ {E}) \cos (y _ {E}) \\ y _ {1} = \frac {\alpha}{2} + \sinh (x _ {E}) \sin (y _ {E}) \end{array} \tag {6} +$$ + +$$ +{y _ {C T}} {= \frac {\alpha}{2} * \sinh (x _ {E}) \sin (y _ {E}),} +$$ + +where $(x_{CT},y_{CT})$ are the cartesian coordinates of the warped image. + +We employ the transformation method to generate the grid maps of the new image, then employ the differentiable sampler, which was proposed by Jaderberg et al. [16], to warp the original image. + +Ideally, the reverse perspective network can be trained end-to-end with the regression network. However, such a strategy ignores the internal structure of the perspective maps and results in inferior results. Otherwise, we warp the images rather than the features to maintain the semantic information in deeper features. + +# 3.2. Training Method + +Unsupervised Loss The ground-truth perspective factors are rarely available. Thus we propose an unsupervised loss in this subsection to train the reverse perspective network without extra annotations. + +While an image row is compressed, the activated features are constrained to the central part, and the row density of the active region is changed as well. Based on this observation, we exploit the row densities of the warped features to reveal the global density distribution. We first formulate the average row density as: + +$$ +D _ {j} ^ {H} = \frac {1}{w _ {j}} \sum_ {i = 1} ^ {W} \sum_ {k = 1} ^ {C} G _ {\text {w a r p e d}} (i, j, k), \tag {7} +$$ + +where $G_{\text{warped}}(i,j,k)$ stands for warped features, and $i,j,k$ are the indexes of column, row, channel respectively. Moreover, $D_j^H$ is the average density of j-th row, and $w_j$ is the number of effective pixels in this row. Accordingly, the row density vector of warped features is defined as $D_H = [D_1^H,D_2^H,\dots ,D_W^H]$ . + +As shown in Fig. 5, subfigures (b) and (d) are the corresponding row density vectors of (a) and (c). A small variance of the row density vector indicates more uniform scale + +![](images/1c6312467a87130927c58dac251b3d99977a204d930ed8d27bae3ed8178bc384.jpg) +Figure 7: The two example images with various perspectives. The first row is the outputs of the proposed network which is trained with SGD method. While the second row is the outputs of the proposed method, which trained with meta-learning. + +distributions in the frames. Thus we devise an unsupervised regression loss to constrain the row density vector of the warped features. We formulate the objective function as: + +$$ +\mathcal {L} _ {v d} = \operatorname {V a r} \left(D ^ {H}\right). \tag {8} +$$ + +Meta Learning It is desirable to employ the standard training process, for instance, SGD method, to train the reverse perspective network. However, the reverse perspective is a lightweight network and is easy to overfit. As shown in Fig. 7, the reverse perspective network, which is trained by the SGD, generates similar perspective factors. + +To address the above issues, we treat perspective correction as a few-short learning problem and employ a meta-learning algorithm to optimize the proposed network. The meta-learning specializes in learning from small amounts of data, and the learned meta-model can fast adapt to indeterminate scenes. In the pre-training stage, we split the data into several small tasks, and employ Reptile [25], which is an efficient meta-learning algorithm, to train our regression network with only raw and unlabeled observations. Afterward, we fine-tune the learned meta-model to adapt to each image in both training and reference stages. + +In short, Reptile averages several updates of the network, instead of updating the network on the average loss function. This strategy is guaranteeing to learn an initialization that is good for fast adaptations. The Reptile method $\mathcal{M}(\cdot)$ randomly samples the training dataset into p-tasks $\mathcal{T}_p$ . During training, $\mathcal{M}(\cdot)$ inputs a set of tasks $\mathcal{T}_i$ , and produces a learning procedure $\mathrm{SGD}(L,\theta ,k)$ . The learning procedure performs $k$ gradient steps on loss $L$ starting with $\theta$ and returns the final parameter vector. The training process on a single task $\tau$ is formulated as: + +$$ +\begin{array}{r c l} W & = & \operatorname {S G D} \left(L _ {\tau}, \theta , k\right) \\ \hat {\theta} & = & \theta + \eta (\theta - W), \end{array} \tag {9} +$$ + +where the $\hat{\theta}$ is the updated parameters, and $\eta$ is a scalar. + +Benefiting from the sample and efficient Reptile method, we obtain a more sensitive meta-model, which is fine-tuned on each test image. + +![](images/caa5f1bf2422e1efad897a0378cc3b08a946086ab988ea08f88992f75bf858b3.jpg) +Figure 9: Representative frames of UAVVC, which have different perspectives, for instance, high latitude, front-view in low latitude, side-view, and top-view. + +![](images/47cc0705143c67150dfab299aef2eea64efce78ac8d2ac8e2dd02b87b4e6c904.jpg) + +![](images/dacc406976c0363f911f719e07495c434a72e9cdc24532bc46fc98384d93c6b3.jpg) + +![](images/6d012d1facaaa5a29059cbd1d555d28f8fe313de3bbfa128a5fc654561ab63fc.jpg) + +# 3.3. Adversarial Residual Learning + +The reverse perspective network still has limitations while encountering seriously crowded regions. Therefore, we augment the ground-truth density map with the evaluation error, which highlights the congested area. The augmented ground-truth is formulated as: + +$$ +Y _ {A u g} = Y + \varphi (Y - \hat {Y}), \tag {10} +$$ + +where $Y$ is the ground-truth density map, $\hat{Y}$ is the evaluation output, and $\varphi$ is a scalar. + +To force the regressor to learn from the augmented ground-truth, we employ an adversarial structure named Adversarial Structure Matching (ASM) [14] to extract the structures of congested areas. ASM employs an auto encoder-decoder framework. The encoder analyzes the structure of both estimated and the augmented density maps, while the decoder reconstructs the augmented density maps from the hidden features. While training, the regressor is trained to minimize the distance between hidden features of the evaluation and the augmented ground-truth, while the encoder is trained to enlarge the distance. The adversarial loss function is formulated as: + +$$ +\max _ {A} \min _ {R} \mathcal {L} _ {a r} = \mathbb {E} _ {X Y} \left[ | A (R (X)) - A \left(Y _ {A u g}\right) | \right], \tag {11} +$$ + +where $R(\cdot)$ is the regression network, $A(\cdot)$ is the encoder, and $X$ is the input image. The adversarial approach forces the regression network to pay more attention to the objects that are easily overlooked. + +# 4. UAV-based Vehicle Counting Dataset + +There are limited datasets for the vehicle counting task. Among them TRANCOS_v3 [10] is collected by fixed cameras, while CARPK [12] and PUCPR+ [1] contain images captured by UAVs. We show a representative frame of each dataset in Fig. 8. As shown, they only present constrained traffic circumstances with narrow viewpoints, which have limited scale variations, as such, are not suitable to verify the proposed method. + +To fill this gap, we collected a UAV-based dataset with 50 different scenarios for vehicle counting, termed as UAVVC. The proposed dataset is manually annotated with 32,770 bounding boxes, instead of traditional point annotations. We show representative frames in Fig. 9. The proposed dataset has four kinds of perspectives, i.e., front-view in + +![](images/8490ccf5ad88f0371d91bca2281dc2ece194660bb816a1ca0b4a09d56cc7fc13.jpg) +TRANCOS_v3 +Figure 8: Representative frame of TRANCOS_v3, CARPK, and PUCPR+, which have limited perspectives. + +![](images/e39c351d8824dff11361557e7bf8bfc24dad0fc9095d9d581f287b21792da992.jpg) +CARPK + +![](images/0a6adcbeccf9f18509b6f38b1df67629161df186a1672c92d044308f742e56c4.jpg) +PUCPR+ + +Table 1: Summary of existing related datasets. + +
DatasetResolutionFramesView-PointsScenesWeatherNotation
TRANCOS640x480824fixed432Points
CARPK1,280x7201,448fixed71BoundingBox
PUCPR+1,280x720125fixed13BoundingBox
Ours1,024x540738flexible505BoundingBox
+ +Table 2: The evaluation results on ShanghaiTech datasets + +
ShanghaiTech Part AShanghaiTech Part B
MethodMAEMSEMAEMSE
MCMM [39]110.2173.226.441.3
SANet [4]67.0104.58.413.6
CSRNet [19]68.2115.010.616.0
IG-CNN [26]72.5118.213.621.1
TEDnet [18]64.2109.18.212.8
ADCrowdNet [21]63.298.98.215.7
CG-DRCN [34]64.098.48.514.4
ADMG [17]64.797.18.113.6
ANF [2]63.999.48.313.2
Ours61.296.98.111.6
+ +high latitude, front-view in low latitude, side-view, and top-view. With the unconstrained viewing points, there are dramatic scale variations. The frames are also collected in different weather conditions, for instance, sunny, raining, fog, night, and raining night. All these shooting conditions increase the diversity of the dataset and make it closer to the real traffic circumstances. More importantly, the dramatic scale variation can be used to verify our proposed method. + +The statistics of our proposed dataset and existing datasets are shown in Table 1. The UAVVC is more diverse and provides more precise annotations. Moreover, three critical distributions are shown in Fig. 2. As shown, the proposed dataset has more dramatic scale variations, also is more balanced than others in all the criterions. The dataset and all the experimental results are available on https://github.com/CrowdCounting. + +# 5. Experiments + +We evaluate our approach on four datasets: ShanghaiTech [39], WorldExpo10 [15], UCSD [5], and the proposed UAVVC. In this section, we first evaluate and compare our method with the previous state-of-the-art approaches [39, 4, 26, 21, 19, 18, 34, 17, 2] on these datasets. Then we present ablation study results on ShanghaiTech + +Table 3: The MAE evaluation results on the WorldExpo10 dataset. + +
MethodSce.1Sce.2Sce.3Sce.4Sce.5Avg.
MCMM [39]3.420.612.913.08.111.6
SANet [4]2.613.29.013.33.08.2
CSRNet [19]2.911.58.616.63.48.6
IG-CNN [26]2.616.110.1520.27.611.3
TEDnet [18]2.310.111.313.82.68.0
ADCrowdNet [21]1.615.811.010.93.28.5
ADMG [17]4.018.17.212.35.79.5
Ours2.410.29.711.53.88.2
+ +![](images/2fb8d8ff4bc273e427f4596d9c6f237a77df9d6553a5beddf928c3176f24f4ef.jpg) +Figure 10: Examples in ShanghaiTech dataset. The first column is the input images, and the second column is the warped images, while the third column is the estimated density maps. The proposed method adaptively warps the images and delivers accurate estimations. + +Part A dataset. In these experiments, we evaluate the performance with MAE and MSE metrics. + +# 5.1. Implementation details + +We employ CSRNet as our regression network. The most time-consuming operation of the proposed method is generating the grid maps. During transformation, we first generate initial grid maps with a resolution of $10^{*}10$ , then enlarge them to the desired resolution. Therefore, the reverse perspective network introduces limited time complexity. The reverse perspective network is pre-trained on the training set of each dataset, respectively. For meta-learning, we set the inner batch size to 5, inner iterations to 20, and the learning rate to 1e-6. When training the regression network, we also warp the ground-truth density maps with the generated grid maps. The learning rate is set to 1e-7, and the $\varphi$ is set to 1e-6, while the $K$ is set to 20. + +# 5.2. Evaluation and comparison + +ShanghaiTech dataset [37] focuses on the pedestrian counting. There are 1,198 images with different perspectives and resolutions. This dataset has two parts named Part A and Part B. We report the comparison between our method and state-of-arts in Table 2. Our method achieves the lowest MAE (the highest accuracy) on both parts. Fig. 10 shows samples of Part A and Part B. It can be seen that the proposed method is well adaptable to arbitrary perspectives. + +WorldExpo10 dataset [39] has 3,980 annotated frames. + +Table 4: The evaluation results on the UCSD dataset + +
MethodMAEMSE
MCMM [39]1.071.35
SANet [4]1.021.29
CSRNet [19]1.161.47
ADCrowdNet [21]0.981.25
Ours1.321.23
+ +Table 5: The evaluation results on UAVVC dataset, where IFSV stands for intra-frame scale variance and the second to the fifth columns are the corresponding MAE results. + +
MethodIFSV ∈ [0.0, 1.0]IFSV ∈ [1.0, 3.0]IFSV ∈ [3.0, 5.0]IFSV ∈ [5.0, 10.0]Total MAETotal MSE
MCMM [39]32.1446.3764.4861.2250.6385.46
VGG-16 [38]51.3262.4180.3476.3167.12103.20
CSRNet [19]13.1119.6128.0225.6518.3232.27
Ours12.9813.2621.0019.7013.2120.07
+ +We divide this dataset into a training set with 3,380 frames and a testing set with 600 frames. We list the result comparisons of MAE in Table 3, where our method achieves the best 8.2 average MAE against other methods. Some of the scenes are sparse, and the MAE is already quite low, being thus hard to achieve a significant improvement. + +UCSD dataset [5] contains 2,000 frames captured by surveillance cameras, and the frames have the same perspective. The comparison between state-of-the-art crowd counting methods and our method is summarized in Table 4. Our approach overall performs comparably with the best algorithm, but much better than the others. This is because there are limited scale variations in the UCSD dataset, so our method achieves limited improvements. + +UAVVC is our newly proposed dataset with 500 and 385 images for training / testing. Table 5 shows the comparisons of our method against MCNN [39], VGG-16 [33] and CSRNet [19], and our method achieves the best results. More importantly, according to intra-frame scale standard variance, we classify the testing images into four groups and respectively evaluate the MAE metric on each group. Our proposed method achieves improvement in each group. Especially on the image group with larger-scale variation, the performance improvements of our method are more prominent. These experiments verify the ability of the proposed algorithm to handle dramatic scale variations. We show three examples in Fig. 11, each of which has a unique perspective. In the dataset, we do not provide the region of interesting masks. Thus it is challenging for the regressors to recognize the objects in complicated scenes. As shown, compared with the baseline [19], our method delivers more accurate results, and is less likely to recognize backgrounds as vehicles. The similar scales in warped images facilitate the regressor to tell the vehicles from backgrounds. + +# 5.3. Ablation study + +In this section, we conduct several experiments to study the effect of different aspects of our method on ShanghaiTech Part A and show the results in Table 6. + +Baseline Our method achieves $10.3\%$ accuracy improve + +Table 6: The ablation study results on ShanghaiTech Part A. Where RAN stands for residual adversarial network. + +
MethodBaselineOursw/o RANEnd-to-End TrainedWarp FeaturesTrained with SGDNew BaselineModified New Baseline
MAE68.261.263.472.166.270.6109.694.3
+ +![](images/b7ec46e056d7687b53a3d00bcd8b8133571a9e03e0d8ef16ac8dffd3249b275e.jpg) +Figure 11: Examples in UAVVC. In each row, the first image is the input image, the second one is the output of CSR-Net, and the third one is the output of our algorithm. + +![](images/69228884812d743814f90ef7d231a7e4c1685cd1429656c3f4aab805b94cddd6.jpg) +Figure 12: We show two examples in ShanghaiTech Part A. The first column is the input images, the second column is the outputs of baseline, while the third column is the warped images, and the last column is the outputs of proposed method. + +ment compared with the baseline. We show the qualitative comparison between baseline and our method in Fig. 12. The two congested scenes have different perspectives, and our method achieves more accurate estimation results. More importantly, our density maps are brighter. That is because we diminish the scale variations of the input images, and the density maps of the proposed method have fewer picture contrasts. + +Without Adversarial Network While we only employ the reverse perspective network, the MAE decreases by $7.0\%$ , yet it is still not as good as that of ours. This is because the reverse perspective network has limitations, for instance, in the first example of Fig. 12, the most congested areas are not enough stretched, and the scale variation is still fierce. The adversarial network force the regressor to pay more attention to these areas. + +End-to-End Training We train the reverse perspective network with the regression network in an end-to-end fashion, and the performance decreases by $5.7\%$ . This is because such a strategy ignores the internal structure of the perspective maps and results in inferior results. + +Warp Features Instead We pre-train the reverse perspective network, and utilize it to warp the features directly. + +This strategy is less time consuming, yet it only receives $2.9\%$ performance increase. This is because warping features wrecks the semantic information of the deep features and makes the objects unrecognizable. + +Traditional Learning Method We pre-train the reverse perspective network with the SGD method. As a result, the network is overfitted and delivers similar perspective factors with limited variance. Thus the method obtains a $3.5\%$ performance decrease. This is because simple averaging the loss function wears down the implicit information of perspectives and scenes. + +Extensibility To evaluate the extensibility of the proposed framework, we employ a new backbone with various receptive fields as the backbone of CSRNet, which is the first ten convolution layers of ResNet-101 [11]. The new baseline is trained with original and warped images, respectively. As shown in Table. 6, our proposed method decreases MAE by $14.0\%$ compared with new baseline, yet not as good as the VGG based one. Moreover, the VGG based one with warped images obtains better performance than ResNet one with original images. This experiment affirms that the proposed network is more effective than the various receptive fields. + +# 6. Conclusion + +In this paper, we propose a reverse perspective network to diminish the scale variations while estimating the crowd densities. The reverse perspective network estimates the perspective distortions in an unsupervised way and warps the original images to obtain similar scales. To further solve the scale issue in seriously congested areas, we force the regressor to learn from the augmented ground-truth via an adversarial network. Moreover, to verify the proposed framework, we collected a UAV-based vehicle counting dataset, which has dramatic intra-scene and inter-scene scale variations. Extensive experimental results demonstrate the state-of-the-art performance of our method. In the future work, we will research the perspective evaluation of videos, which has continuous perspectives and scenes. + +Acknowledgements This work was supported in part by the Italy-China collaboration project TALENT:2018YFE0118400, in part by National Natural Science Foundation of China: 61620106009, 61772494, 61931008, U1636214, 61836002 and 61976069, in part by Key Research Program of Frontier Sciences, CAS: QYZDJ-SSW-SYS013, in part by Youth Innovation Promotion Association CAS, in part by the University of Chinese Academy of Sciences. + +# References + +[1] Paulo Almeida, Luiz S Oliveira, Alceu De Souza Britto, Eunelson J Silva, and Alessandro L Koerich. Pklot-a robust dataset for parking lot classification. Expert Systems With Applications, 42(11):4937-4949, 2015. 6 +[2] Zhang Anran, Yue Lei, Shen Jiayi, Zhu Fan, Zhen Xiantong, Cao Xianbin, and Shao Ling. Attentional neural fields for crowd counting. IEEE International Conference on Computer Vision, 2019. 6 +[3] David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. Computer Vision and Pattern Recognition, 2017. 4 +[4] Xinkun Cao, Zhipeng Wang, Yanyun Zhao, and Fei Su. Scale aggregation network for accurate and efficient crowd counting. Computer Vision and Pattern Recognition, pages 757-773, 2018. 1, 2, 3, 6, 7 +[5] Antoni B Chan, Zhangsheng John Liang, and Nuno Vasconcelos. Privacy preserving crowd monitoring: Counting people without people models or tracking. Computer Vision and Pattern Recognition, pages 1-7, 2008. 6, 7 +[6] Edo Collins, Radhakrishna Achanta, and Sabine Susstrunk. Deep feature factorization for concept discovery. European Conference on Computer Vision, 14:352-368, 2018. 4 +[7] Diptodip Deb and Jonathan Ventura. An aggregated multicolumn dilated convolution network for perspective-free counting. Computer Vision and Pattern Recognition, pages 195-204, 2018. 2 +[8] Junyu Gao, Qi Wang, and Xuelong Li. Pcc net: Perspective crowd counting via spatial convolutional network. IEEE Transactions on Circuits and Systems for Video Technology, abs/1905.10085, 2019. 1 +[9] Abel Gonzalezgarcia, Davide Modolo, and Vittorio Ferrari. Do semantic parts emerge in convolutional neural networks. International Journal of Computer Vision, 126(5):476-494, 2018. 4 +[10] Ricardo Guerrerogomezolmedo, Beatrix Torrejimenez, Roberto Javier Lopezstare, Saturnino Maldonadobascon, and Daniel Onor Rubio. Extremely overlapping vehicle counting. Computer Vision and Pattern Recognition, pages 423-431, 2015. 6 +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Computer Vision and Pattern Recognition, pages 770-778, 2016. 8 +[12] Meng-Ru Hsieh, Yen-Liang Lin, and Winston H. Hsu. Drone-based object counting by spatially regularized regional proposal networks. IEEE International Conference on Computer Vision, 2017. 6 +[13] Siyu Huang, Xi Li, Zhongfei Zhang, Fei Wu, Shenghua Gao, Rongrong Ji, and Junwei Han. Body structure aware deep crowd counting. IEEE Transactions on Image Processing, 27(3):1049-1059, 2018. 1 +[14] Jyhjing Hwang, Tsungwei Ke, Jianbo Shi, and Stella X Yu. Adversarial structure matching for structured prediction tasks. Computer Vision and Pattern Recognition, pages 4056-4065, 2019. 6 + +[15] Haroon Idrees, Imran Saleemi, Cody Seibert, and Mubarak Shah. Multi-source multi-scale counting in extremely dense crowd images. Computer Vision and Pattern Recognition, pages 2547-2554, 2013. 6 +[16] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. Neural Information Processing Systems, pages 2017-2025, 2015. 5 +[17] Wan Jia and Chan Antoni. Adaptive density map generation for crowd counting. IEEE International Conference on Computer Vision, 2019. 6, 7 +[18] Xiaolong Jiang, Zehao Xiao, Baochang Zhang, Xiantong Zhen, Xianbin Cao, David Doermann, and Ling Shao. Crowd counting and density estimation by trellis encoder-decoder network. Computer Vision and Pattern Recognition, 2019. 1, 2, 3, 6, 7 +[19] Yuhong Li, Xiaofan Zhang, and Deming Chen. Csrnet: Dilated convolutional neural networks for understanding the highly congested scenes. Computer Vision and Pattern Recognition, pages 1091-1100, 2018. 1, 2, 6, 7 +[20] Jiang Liu, Chenqiang Gao, Deyu Meng, and Alexander G Hauptmann. Decidenet: Counting varying density crowds through attention guided detection and density estimation. Computer Vision and Pattern Recognition, pages 5197-5206, 2018. 1, 3 +[21] Ning Liu, Yongchao Long, Changqing Zou, Qun Niu, Li Pan, and Hefeng Wu. Adcrowdnet: An attention-injective deformable convolutional network for crowd understanding. Computer Vision and Pattern Recognition, pages 3220-3229, 2018. 1, 2, 6, 7 +[22] Weizhe Liu, Mathieu Salzmann, and Pascal Fua. Context-aware crowd counting. Computer Vision and Pattern Recognition, pages 5094-5103, 2019. 3 +[23] Xialei Liu, Joost Van De Weijer, and Andrew D Bagdanov. Leveraging unlabeled data for crowd counting by learning to rank. Computer Vision and Pattern Recognition, pages 7661-7669, 2018. 1 +[24] Yuting Liu, Miaojing Shi, Qijun Zhao, and Xiaofang Wang. Point in, box out: Beyond counting persons in crowds. Computer Vision and Pattern Recognition, 2019. 1 +[25] Alex Nichol and John Schulman. Reptile: a scalable meta-learning algorithm. Learning, 2018. 5 +[26] Viresh Ranjan, Hieu Le, and Minh Hoai. Iterative crowd counting. European Conference on Computer Vision, pages 278-293, 2018. 6, 7 +[27] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. Medical Image Computing and Computer Assisted Intervention, pages 234-241, 2015. 2 +[28] Deepak Babu Sam and R Venkatesh Babu. Top-down feedback for crowd counting convolutional neural network. National Conference on Artificial Intelligence, pages 7323-7330, 2018. 2 +[29] Deepak Babu Sam, Neeraj Sajjan, R Venkatesh Babu, and Mukundhan Srinivasan. Divide and grow: Capturing huge diversity in crowd images with incrementally growing cnn. Computer Vision and Pattern Recognition, pages 3618-3626, 2018. 1, 3 + +[30] Zan Shen, Yi Xu, Bingbing Ni, Minsi Wang, Jianguo Hu, and Xiaokang Yang. Crowd counting via adversarial cross-scale consistency pursuit. In Computer Vision and Pattern Recognition, pages 5245-5254, June 2018. 1, 3 +[31] Miaojing Shi, Zhaohui Yang, Chao Xu, and Qijun Chen. Revisiting perspective information for efficient crowd counting. Computer Vision and Pattern Recognition, pages 7271-7280, 2018. 1, 2, 3 +[32] Zenglin Shi, Le Zhang, Yun Liu, Xiaofeng Cao, Yangdong Ye, Mingming Cheng, and Guoyan Zheng. Crowd counting with deep negative correlation learning. Computer Vision and Pattern Recognition, pages 5382-5390, 2018. 1, 3 +[33] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations, abs/1409.1556, 2014. 4, 7 +[34] Sindagi Vishwanath, Yasarla Rajeev, and Patel Vishal. Pushing the frontiers of unconstrained crowd counting: New dataset and benchmark method. IEEE International Conference on Computer Vision, 2019. 6 +[35] Wikipedia. Reverse perspective. https://en.wikipedia.org/wiki/Reverse_perspective.2 +[36] Zhaoyi Yan, Yuchen Yuan, Wangmeng Zuo, Xiao Tan, Yezhen Wang, Shilei Wen, and Errui Ding. Perspective-guided convolution networks for crowd counting. Computer Vision and Pattern Recognition, 2019. 1, 2, 3 +[37] Cong Zhang, Hongsheng Li, Xiaogang Wang, and Xiaokang Yang. Cross-scene crowd counting via deep convolutional neural networks. Computer Vision and Pattern Recognition, pages 833-841, 2015. 1, 3, 7 +[38] Shanghang Zhang, Guanhang Wu, Joao Paulo Costeira, and Jose M F Moura. Fcn-rlstm: Deep spatio-temporal neural networks for vehicle counting in city cameras. International Conference on Computer Vision, pages 3687–3696, 2017. 7 +[39] Yingying Zhang, Desen Zhou, Siqin Chen, Shenghua Gao, and Yi Ma. Single-image crowd counting via multi-column convolutional neural network. Computer Vision and Pattern Recognition, pages 589-597, 2016. 1, 2, 6, 7 \ No newline at end of file diff --git a/reverseperspectivenetworkforperspectiveawareobjectcounting/images.zip b/reverseperspectivenetworkforperspectiveawareobjectcounting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ac57a61c643fcc89fc586bd842f57e9a031d9759 --- /dev/null +++ b/reverseperspectivenetworkforperspectiveawareobjectcounting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4d30ca0acdbe597a86e07e7d20935c184d3833ae6748eff72221b323d1e6fde +size 643032 diff --git a/reverseperspectivenetworkforperspectiveawareobjectcounting/layout.json b/reverseperspectivenetworkforperspectiveawareobjectcounting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..70ef2382f458835dde33aad68b06d6c3810632cc --- /dev/null +++ b/reverseperspectivenetworkforperspectiveawareobjectcounting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f9ee6d97f1962ff114d1cb8012a87864f95625936e2b544c441275d70088af5 +size 392548 diff --git a/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_content_list.json b/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..39e7d0040c3bba6f26c7f3f18bc7728bdc28e423 --- /dev/null +++ b/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee014604349df7bf70515a6a373efbb45f54b3f445bf29c34965ceda1dc9d94b +size 70384 diff --git a/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_model.json b/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_model.json new file mode 100644 index 0000000000000000000000000000000000000000..04699ac0436d00f08b89825d766afe167b4f10eb --- /dev/null +++ b/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f22439678e7f237594eba06ad162e17840f87d82001235564da24b2af67fdea3 +size 84357 diff --git a/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_origin.pdf b/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3c481b63d8e7a4a89f6ea6b3609ed85d5715a2b7 --- /dev/null +++ b/revisitingknowledgedistillationvialabelsmoothingregularization/1ca73900-f58b-4a06-a51f-145d2d902b57_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1af1256116e8004fe1851718a09c87b84367c1343c2ef2d131edd3c972b9ad68 +size 495164 diff --git a/revisitingknowledgedistillationvialabelsmoothingregularization/full.md b/revisitingknowledgedistillationvialabelsmoothingregularization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..37370c9cec95b47a17c196d8f63fc0ad998878f5 --- /dev/null +++ b/revisitingknowledgedistillationvialabelsmoothingregularization/full.md @@ -0,0 +1,297 @@ +# Revisiting Knowledge Distillation via Label Smoothing Regularization + +Li Yuan $^{1}$ Francis EH Tay $^{1}$ Guilin Li $^{2}$ Tao Wang $^{1}$ Jiashi Feng $^{1}$ + +$^{1}$ National University of Singapore $^{2}$ Huawei Noah's Ark Lab $\{\text { ylustcnus, twangnh } \} @$ gmail.com, $\{\text { mpetayeh,elefjia } \} @$ nus.edu.sg, guilinli2@huawei.com + +# Abstract + +Knowledge Distillation (KD) aims to distill the knowledge of a cumbersome teacher model into a lightweight student model. Its success is generally attributed to the privileged information on similarities among categories provided by the teacher model, and in this sense, only strong teacher models are deployed to teach weaker students in practice. In this work, we challenge this common belief by following experimental observations: 1) beyond the acknowledgment that the teacher can improve the student, the student can also enhance the teacher significantly by reversing the KD procedure; 2) a poorly-trained teacher with much lower accuracy than the student can still improve the latter significantly. To explain these observations, we provide a theoretical analysis of the relationships between KD and label smoothing regularization. We prove that 1) KD is a type of learned label smoothing regularization and 2) label smoothing regularization provides a virtual teacher model for KD. From these results, we argue that the success of KD is not fully due to the similarity information between categories from teachers, but also to the regularization of soft targets, which is equally or even more important. + +Based on these analyses, we further propose a novel Teacher-free Knowledge Distillation (Tf-KD) framework, where a student model learns from itself or manually-designed regularization distribution. The Tf-KD achieves comparable performance with normal KD from a superior teacher, which is well applied when a stronger teacher model is unavailable. Meanwhile, Tf-KD is generic and can be directly deployed for training deep neural networks. Without any extra computation cost, Tf-KD achieves up to $0.65\%$ improvement on ImageNet over well-established baseline models, which is superior to label smoothing regularization. + +# 1. Introduction + +Knowledge Distillation (KD) [7] aims to transfer knowledge from one neural network (teacher) to another (student). Usually, the teacher model has a strong learning capacity + +with higher performance, which teaches a lower-capacity student model through providing "soft targets". It is commonly believed that the soft targets of the teacher model can transfer "dark knowledge" containing privileged information on similarity among different categories [7] to enhance the student model. + +In this work, we first examine such a common belief through following exploratory experiments: 1) let student models teach teacher models by transferring soft targets of the students; (2) let poorly-trained teacher models with worse performance teach students. Based on the common belief, it is expected that the teacher model would not be enhanced significantly via training from the students and poorly-trained teachers would not enhance the students, as the weak student and poorly-trained teacher models cannot provide reliable similarity information between categories. However, after extensive experiments on various models and datasets, we observe contradictory results: the weak student can improve the teacher and the poorly-trained teacher can also enhance the student remarkably. Such intriguing results motivate us to interpret KD as a regularization term, and we re-examine knowledge distillation from the perspective of Label Smoothing Regularization (LSR) [16] that regularizes model training by replacing the one-hot labels with smoothed ones. + +We then analyze theoretically the relationships between KD and LSR. For LSR, by splitting the smoothed label into two parts and examining the corresponding losses, we find the first part is the ordinary cross-entropy for ground-truth distribution (one-hot label) and outputs of model, and the second part corresponds to a virtual teacher model which provides a uniform distribution to teach the model. For KD, by combining the teacher's soft targets with the one-hot ground-truth label, we find that KD is a learned LSR where the smoothing distribution of KD is from a teacher model but the smoothing distribution of LSR is manually designed. In a nutshell, we find KD is a learned LSR and LSR is an ad-hoc KD. Such relationships can explain the above counterintuitive results—the soft targets from weak student and poorly-trained teacher models can effectively + +regularize the model training, even though they lack strong similarity information between categories. We therefore argue that the similarity information between categories cannot fully explain the dark knowledge in KD, and the soft targets from the teacher model indeed provide effective regularization for the student model, which are equally or even more important. + +Based on the analyses, we conjecture that with nonreliable or even zero similarity information between categories from the teacher model, KD may still well improve the student models. We thus propose a novel Teacher-free Knowledge Distillation (Tf-KD) framework with two implementations. The first one is to train the student model by itself (i.e., self-training), and the second is to manually design a target distribution as a virtual teacher model which has $100\%$ accuracy. The first method is motivated by replacing the dark knowledge with predictions from the model itself, and the second method is inspired by the relationships between KD and LSR. We validate through extensive experiments that the two implementations of Tf-KD are both simple yet effective. Particularly, in the second implementation without similarity information in the virtual teacher, Tf-KD still achieves comparable performance with normal KD, which clearly justifies: + +Dark knowledge does not just include the similarity between categories, but also imposes regularization on the student training. + +Tf-KD well applies to scenarios where the student model is too strong to find teacher models or computational resource is limited for training teacher models. For example, if we take a cumbersome single model ResNeXt101- $32\times 8\mathrm{d}$ [18] as the student model (with 88.79M parameters and 16.51G FLOPs on ImageNet), it is hard or computationally expensive to train a stronger teacher model. We deploy our virtual teacher to teach this powerful student and achieve $0.48\%$ improvement on ImageNet without any extra computation cost. Similarly, when taking a powerful single model ResNeXt29- $8\times 64\mathrm{d}$ with 34.53M parameters as a student model, our self-training implementation achieves more than $1.0\%$ improvement on CIFAR100 (from $81.03\%$ to $82.08\%$ ). + +Our contributions are summarized as follows: + +- By designing two exploratory experiments on teacher models of KD, we observe counterintuitive results, which motivate us to interpreted KD as a regularization method. +- We then provide theoretical analysis to reveal the relationships between KD and label smoothing regularization. +- We propose Teacher-free Knowledge Distillation (Tf-KD), which achieves comparable performance with + +normal knowledge distillation and superior performance to label smoothing regularization on ImageNet-2012. + +# 2. Exploratory Experiments and Counterintuitive Observations + +To examine the common belief on dark knowledge in KD, we conduct two exploratory experiments: + +1) The standard knowledge distillation is to adopt a teacher to teach a weaker student. What if we reverse the operation? Based on the common belief, the teacher should not be improved significantly because the student is too weak to transfer effective knowledge. +2) If we use a poorly-trained teacher which has much worse performance than the student to teach the student, it is assumed to bring no improvement to the latter. For example, if a poorly-trained teacher with only $10\%$ accuracy is adopted in an image classification task, the student would learn from its soft targets with $90\%$ error, thus the student should not be improved or even suffer worse performance. + +We name the "student teach teacher" as Reversed Knowledge Distillation (Re-KD), and the "poorly-trained teacher teach student" as Defective Knowledge Distillation (De-KD) (Fig. 1). We conduct Re-KD and De-KD experiments on CIFAR10, CIFAR100 and Tiny-ImageNet datasets with a variety of neural networks. For fair comparisons, all experiments are conducted with the same settings and hyper-parameters are obtained by grid search from 70 epochs training (200 epochs in total). Detailed implementation and experiment settings are given in Supplementary Material. + +# 2.1. Reversed Knowledge Distillation + +We conduct Re-KD experiments on the three datasets respectively. CIFAR10 and CIFAR100 [9] contain natural RGB images of 32x32 pixels with 10 and 100 classes, respectively, and Tiny-ImageNet is a subset of ImageNet [3] with 200 classes, where each image is down-sized to 64x64 pixels. For generality of the experiments, we adopt 5-layer plain CNN, MobileNetV2 [15] and ShufflenetV2 [10] as student models and ResNet18, ResNet50 [6], DenseNet121 [8] and ResNeXt29-8×64d as teachers. The results of Re-KD on the three datasets are given in Tabs. 1 to 3. + +In Tab. 1, the teacher models are improved significantly by learning from students, especially for teacher models ResNet18 and ResNet50. The two teachers obtain more than $1.1\%$ improvement when taught by MobileNetV2 and ShuffleNetV2. We can also observe similar results on CIFAR10 and Tiny-ImageNet. When comparing Re-KD + +![](images/a11a48da9379fa9424bde2ee60bd5cde68a4d89f5881ca07f20888bf0d41975b.jpg) +(a) Normal KD + +![](images/a08b763020f845179c61cfcb18a610755a87bb3231a4bd218f8fd8399db7ea56.jpg) +(b) Reversed KD + +![](images/722f42a16f43373d55f4330ea85fb6e1e7ac37d8c95414ed293e5d072de27d36.jpg) +(c) Defective KD +Figure 1. (a) Normal KD framework. (b)(c) Diagrams of exploratory experiments we conduct. + +$(S \rightarrow T)$ with Normal KD $(T \rightarrow S)$ , we can see in most cases, Normal KD achieves better results. It should be noted that Re-KD takes the teacher's accuracy as the baseline accuracy, which is much higher than that of Normal KD. However, in some cases, we can find Re-KD outperforms Normal KD. For instance, in Tab. 2 (3rd row), the student model (plain CNN) can only be improved by $0.31\%$ when taught by MobileNetV2, but the teacher (MobileNetV2) can be improved by $0.92\%$ by learning from the student. We have similar observations for ResNeXt29 and ResNet18 (4th row in Tab. 2). + +We claim that while the standard knowledge distillation can improve the performance of students on all datasets, the superior teacher can also be enhanced significantly by learning from a weak student, as suggested through the Re-KD experiments. + +# 2.2. Defective Knowledge Distillation + +We conduct De-KD on CIFAR100 and Tiny-ImageNet. We adopt MobileNetV2 and ShuffleNetV2 as student models and ResNet18, ResNet50 and ResNeXt29 $(8\times 64\mathrm{d})$ as teacher models. The poorly-trained teachers are trained by 1 epoch (ResNet18) or 50 epochs (ResNet50 and ResNeXt29), with very poor performance. For example, ResNet18 only obtains $15.48\%$ accuracy on CIFAR100 and $9.41\%$ accuracy on Tiny-ImageNet after trained with 1 epoch, and ResNet50 obtains $45.82\%$ and $31.01\%$ on CIFAR100 and Tiny-ImageNet, after trained with 50 epochs (200 epochs in total). + +From De-KD experiment results on CIFAR100 in Tab. 4, we observe that the student can be greatly promoted even when distilled by a poorly-trained teacher. For instance, the MobileNetV2 and ShuffleNetV2 can be promoted by $2.27\%$ and $1.48\%$ when taught by the one-epoch-trained ResNet18 with only $15.48\%$ accuracy (2nd row). For poorly-trained ResNeXt29 with $51.94\%$ accuracy (4th row), we find ResNet18 can still be improved by $1.41\%$ and MobileNetV2 obtains $3.14\%$ improvement. From the De-KD experiment results on Tiny-ImageNet in Tab. 4, we find + +ResNet18 with $9.14\%$ accuracy can still enhance the teacher model MobileNetV2 by $1.16\%$ . Other poorly-trained teachers are all able to enhance the students to some degree. + +To better demonstrate the distillation accuracy of a student when taught by poorly-trained teachers with different levels of accuracy, we save 9 checkpoints of ResNet18 and ResNeXt29 in the normal training process. Taking these checkpoints as teacher models to teach MobileNetV2, we observe that MobileNetV2 can always be improved by poorly-trained ResNet18 or poorly-trained ResNeXt29 with different levels of accuracy (Fig. 2). So we can say while a poorly-trained teacher provides much more noisy logits to the student, the student can still be enhanced. The De-KD experiment results are also conflicted with the common belief. + +The counterintuitive results of Re-KD and De-KD make us rethink the "dark knowledge" in KD, and we argue that it does not just contain the similarity information. Lacking enough similarity information, a model can still provide "dark knowledge" to enhance other models. To explain this, we make a reasonable assumption and view knowledge distillation as a model regularization, and investigate what is the additional information in the "dark knowledge" of a model. In the next, we will analyze the relationships between knowledge distillation and label smoothing regularization to explain the experimental results of Re-KD and De-KD. + +# 3. Knowledge Distillation and Label Smoothing Regularization + +We mathematically analyze the relationships between Knowledge Distillation (KD) and Label Smoothing Regularization (LSR), hoping to explain the intriguing results of exploratory experiments in Sec. 2. Given a neural network $S$ to train, we first give loss function of LSR for $S$ . For each training example $x$ , $S$ outputs the probability of each label $k \in \{1 \dots K\} : p(k|x) = \text{softmax}(z_k) = \frac{\exp(z_k)}{\sum_{i=1}^{K} \exp(z_i)}$ , where $z_i$ is the logit of the neural network $S$ . The ground + +Table 1. Normal KD and Re-KD experiment results on CIFAR100. We report mean±std (in %) over 3 runs. The number in parenthesis means increased accuracy over baseline (T: teacher, S: student). + +
Teacher: baselineStudent: baselineNormal KD (T→S)Re-KD (S→T)
ResNet18: 75.87MobileNetV2: 68.3871.05±0.16 (+2.67)77.28±0.28 (+1.41)
ShuffleNetV2: 70.3472.05±0.13 (+1.71)77.35±0.32 (+1.48)
ResNet50: 78.16MobileNetV2: 68.3871.04±0.20 (+2.66)79.30±0.11 (+1.14)
ShuffleNetV2: 70.3472.15±0.18 (+1.81)79.43±0.39 (+1.27)
DenseNet121: 79.04MobileNetV2: 68.3871.29±0.23 (+2.91)79.55±0.11 (+0.51)
ShuffleNetV2: 70.3472.32±0.25 (+1.98)79.83±0.05 (+0.79)
ResNeXt29: 81.03MobileNetV2: 68.3871.65±0.41 (+3.27)81.53±0.14 (+0.50)
ResNet18: 75.8777.84±0.15 (+1.97)81.62±0.22 (+0.59)
+ +Table 2. Re-KD experiment results (accuracy, mean±std over 3 runs in %) on CIFAR10. + +
Teacher: baselineStudent: baselineNormal KD (T→S)Re-KD (S→T)
ResNet18: 95.12Plain CNN: 87.1487.67±0.17 (+0.53)95.33±0.12 (+0.21)
MobileNetV2: 90.9891.69±0.14 (+0.71)95.71±0.11 (+0.59)
MobileNetV2: 90.98Plain CNN: 87.1487.45±0.18 (+0.31)91.81±0.23 (+0.92)
ResNeXt29: 95.76ResNet18: 95.1295.80±0.13 (+0.68)96.49±0.15 (+0.73)
+ +Table 3. Re-KD experiment results (accuracy, in %) on Tiny-ImageNet. + +
Teacher: baselineStudent: baselineNormal KD (T→S)Re-KD (S→T)
ResNet18: 63.44MobileNetV2: 55.0656.70 (+1.64)64.12 (+0.68)
ShuffleNetV2: 60.5161.19 (+0.68)64.35 (+0.91)
ResNet50: 67.47MobileNetV2: 55.0656.02 (+0.96)67.68 (+0.21)
ShuffleNetV2: 60.5160.79 (+0.28)67.62 (+0.15)
ResNet18: 63.4464.23 (+0.79)67.89 (+0.42)
+ +Table 4. De-KD accuracy (in %) on two datasets. Pt-Teacher is "Poorly-trained Teacher". Refer to the "Normal KD" in Tabs. 1 to 3 for the accuracy of students taught by "fully-trained teacher". + +
DatasetPt-Teacher: baselineStudent: baselineDe-KD
CIFAR100ResNet18: 15.48MobileNetV2: 68.3870.65±0.35 (+2.27)
ShuffleNetV2: 70.3471.82±0.11 (+1.48)
ResNet50: 45.82MobileNetV2: 68.3871.45±0.23 (+3.09)
ShuffleNetV2: 70.3472.11±0.09 (+1.77)
ResNet18: 75.8777.23±0.11 (+1.23)
ResNeXt29: 51.94MobileNetV2: 68.3871.52±0.27 (+3.14)
ShuffleNetV2:70.3472.26±0.36 (+1.92)
ResNet18: 75.8777.28±0.17 (+1.41)
Tiny-ImageNetResNet18: 9.41MobileNetV2: 55.0656.22 (+1.16)
ShuffleNetV2: 60.5160.66 (+0.15)
ResNet50: 31.01MobileNetV2:55.0656.02 (+0.96)
ShuffleNetV2: 60.5161.09 (+0.58)
+ +truth distribution over the labels is $q(k|x)$ . We write $p(k|x)$ as $p(k)$ and $q(k|x)$ as $q(k)$ for simplicity. The model $S$ can be trained by minimizing the cross-entropy loss: $H(q,p) = -\sum_{k=1}^{K} q(k)\log(p(k))$ . For a single ground-truth label $y$ , the $q(y|x) = 1$ and $q(k|x) = 0$ for all $k \neq y$ . + +In LSR, it minimizes the cross-entropy between modified label distribution $q^{\prime}(k)$ and the network output $p(k)$ , where + +$q^{\prime}(k)$ is the smoothed label distribution formulated as + +$$ +q ^ {\prime} (k) = (1 - \alpha) q (k) + \alpha u (k), \tag {1} +$$ + +which is a mixture of $q(k)$ and a fixed distribution $u(k)$ , with weight $\alpha$ . Usually, the $u(k)$ is uniform distribution as $u(k) = 1 / K$ . The cross-entropy loss $H(q', p)$ defined over the smoothed labels is + +![](images/b5b0de6a2b12679eb9b6d7543a8a1db93caa42b71895af30351a5eeefcebaaf3.jpg) +(a) ResNet18 + +![](images/f6d5d256fbbc2f06704cde1401698e84117c217d475610ba1c1eba6016c7a10d.jpg) +(b) ResNeXt29 +Figure 2. MobileNetV2 taught by ResNet18 and ResNeXt29 with different accuracy on CIFAR100. MobileNetV2 is enhanced by different poorly-trained teachers compared with baseline (the red line). The final point of two blue lines is the result taught by "fully-trained teacher". + +$$ +\begin{array}{l} H \left(q ^ {\prime}, p\right) = - \sum_ {k = 1} ^ {K} q ^ {\prime} (k) \log p (k) = (1 - \alpha) H (q, p) + \alpha H (u, p) \\ = (1 - \alpha) H (q, p) + \alpha \left(D _ {K L} (u, p) + H (u)\right), \tag {2} \\ \end{array} +$$ + +where $D_{KL}$ is the Kullback-Leibler divergence (KL divergence) and $H(u)$ denotes the entropy of $u$ and is a constant for the fixed uniform distribution $u(k)$ . Thus, the loss function of label smoothing to model $S$ can be written as + +$$ +\mathcal {L} _ {L S} = (1 - \alpha) H (q, p) + \alpha D _ {K L} (u, p). \tag {3} +$$ + +For knowledge distillation, the teacher-student learning mechanism is applied to improve the performance of the student. We assume the student is the model $S$ with output prediction $p(k)$ , and the output prediction of the teacher network is $p_{\tau}^{t}(k) = \text{softmax}(z_{k}^{t}) = \frac{\exp(z_{k}^{t} / \tau)}{\sum_{i=1}^{K} \exp(z_{i}^{t} / \tau)}$ , where $z^{t}$ is the output logits of the teacher network and $\tau$ is the temperature to soften $p^{t}(k)$ (written as $p_{\tau}^{t}(k)$ after softened). The idea behind knowledge distillation is to let the student (the model $S$ ) mimic the teacher by minimizing the cross-entropy loss and KL divergence between the predictions of student and teacher as + +$$ +\mathcal {L} _ {K D} = (1 - \alpha) H (q, p) + \alpha D _ {K L} \left(p _ {\tau} ^ {t}, p _ {\tau}\right). \tag {4} +$$ + +Comparing Eq. (3) and Eq. (4), we find the two loss functions have a similar form. The only difference is that the $p_{\tau}^{t}(k)$ in $D_{KL}(p_{\tau}^{t}, p_{\tau})$ is a distribution from a teacher model and $u(k)$ in $D_{KL}(u, p)$ is the pre-defined uniform distribution. From this view, we can consider KD as a special case of LSR where the smoothing distribution is learned but not pre-defined. On the other hand, if we view the regularization term $D_{KL}(u, p)$ as a virtual teacher model of knowledge distillation, this teacher model will give a uniform probability to all classes, meaning it has a random accuracy (1% accuracy for CIFAR100, 0.1% accuracy for ImageNet). + +Since $D_{KL}(p_{\tau}^{t}, p_{\tau}) = H(p_{\tau}^{t}, p_{\tau}) - H(p_{\tau}^{t})$ , where the entropy $H(p_{\tau}^{t})$ is constant for a fixed teacher model, we + +can reformulate Eq. (4) to + +$$ +\begin{array}{l} L _ {K D} = (1 - \alpha) H (q, p) + \alpha \left(D _ {K L} \left(p _ {\tau} ^ {t}, p _ {\tau}\right) + H \left(p _ {\tau} ^ {t}\right)\right) \\ = (1 - \alpha) H (q, p) + \alpha H \left(p _ {\tau} ^ {t}, p _ {\tau}\right). \tag {5} \\ \end{array} +$$ + +If we set the temperature $\tau = 1$ , we have $L_{KD} = H(\tilde{q}^t,p)$ where $\tilde{q}^t$ is + +$$ +\tilde {q} ^ {t} (k) = (1 - \alpha) q (k) + \alpha p ^ {t} (k). \tag {6} +$$ + +If we compare Eq. (6) with Eq. (1), it is more clearly seen that KD is a special case of LSR. Moreover, the distribution $p^t(k)$ is a learned distribution (from a trained teacher) instead of a uniform distribution $u(k)$ . We visualize the output probability $p^t(k)$ of a teacher and compare it with label smoothing in Supplementary Material, and find with higher temperature $\tau$ , the $p^t(k)$ is more similar to the uniform distribution $u(k)$ of label smoothing. + +Based on the comparison of the two loss functions, we summarize the relationships between knowledge distillation and label smoothing regularization as follows: + +- Knowledge distillation is a learned label smoothing regularization, which has a similar function with the latter, i.e. regularizing the classifier layer of the model. +- Label smoothing is an ad-hoc knowledge distillation, which can be revisited as a teacher model with random accuracy and temperature $\tau = 1$ . +- With higher temperature, the distribution of teacher's soft targets in knowledge distillation is more similar to the uniform distribution of label smoothing. + +Therefore, the experiment results of Re-KD and De-KD can be explained as the soft targets of the model in high temperature are closer to a uniform distribution of label smoothing, where the learned soft targets can provide model regularization for the teacher model. That is why a student can enhance the teacher and a poorly-trained teacher can still improve the student model. + +# 4. Teacher-free Knowledge Distillation + +As we above analyzed, the "dark knowledge" in the teacher model is more of a regularization term than the similarity information between categories. Intuitively, we consider replacing the output distribution of the teacher model with a simple one. We therefore propose a novel Teacher-free Knowledge Distillation (Tf-KD) framework with two implementations. Tf-KD is especially applicable to cases where a stronger teacher model is not available, or only limited computation resources are provided. + +The first Tf-KD method is self-training knowledge distillation, denoted as $\mathrm{Tf - KD}_{\text{self}}$ . As aforementioned, the teacher can be taught by a student and a poorly-trained teacher can also enhance the student. Hence when a stronger teacher model is not available, we propose to deploy "self-training". It should be noted that the teacher in KD always means a stronger model. We name self-training as a teacher-free method because the model is not a teacher with stronger learning capacity than itself. Our $\mathrm{Tf - KD}_{\text{self}}$ is similar to Born-again networks [4], but there are two differences. Our motivation (self-training/self-regularization) is different from Born-again networks; and our method use soft targets of model self as regularization, while Born-again networks utilize an ensemble of student models to train itself iteratively. Specifically, we first train the student model in the normal way to obtain a pre-trained model, which is then used to provide soft label to train itself as in Eq. (4). Formally, given a model $S$ , we denote its pretrained model as $S^p$ ; then we try to minimize the KL divergence of the logits between $S$ and $S^p$ by $\mathrm{Tf - KD}_{\text{self}}$ . The loss function of $\mathrm{Tf - KD}_{\text{self}}$ to train model $S$ is + +$$ +L _ {s e l f} = (1 - \alpha) H (q, p) + \alpha D _ {K L} \left(p _ {\tau} ^ {t}, p _ {\tau}\right), \tag {7} +$$ + +where $p, p_{\tau}^{t}$ are the output probability of $S$ and $S^p$ respectively, $\tau$ is the temperature and $\alpha$ is the weight. + +The second implementation of our Tf-KD method is to manually design a teacher with $100\%$ accuracy. In Sec. 3, we reveal LSR is a virtual teacher model with random accuracy. So, if we design a teacher with higher accuracy, we can assume it would bring more improvement to the student. We propose to combine KD and LSR to build a simple teacher model which will output distribution for classes as the following: + +$$ +p ^ {d} (k) = \left\{ \begin{array}{l l} a & \text {i f} k = c, \\ (1 - a) / (K - 1) & \text {i f} k \neq c, \end{array} \right. \tag {8} +$$ + +where $K$ is the total number of classes, $c$ is the correct label and $a$ is the correct probability for the correct class. We always set $a \geq 0.9$ , so the probability of a correct class is much higher than that of an incorrect one, and the manually-designed teacher model has $100\%$ accuracy for any dataset. + +![](images/00f69d03eaced9f1db9610c582b66918db1d938472f85f59f878161d91690ca5.jpg) +Figure 3. Distribution of manually designed teacher (softened by $\tau = 20$ ) on 10-class dataset. C6 is the correct label. As a comparison, the orange bar is the uniform distribution of LSR. + +We name this method as Teacher-free KD by manually-designed regularization, denoted as $\mathrm{Tf - KD}_{reg}$ . The loss function is + +$$ +L _ {r e g} = (1 - \alpha) H (q, p) + \alpha D _ {K L} (p _ {\tau} ^ {d}, p _ {\tau}), \qquad (9) +$$ + +where $\tau$ is the temperature to soften the manually-designed distribution $p^d$ (as $p_{\tau}^{d}$ after softening). We set a high temperature $\tau \geq 20$ to make this virtual teacher output a soft probability, in which way it gains the smoothing property as LSR. We visualize the distribution of the manually designed teacher in Fig. 3. As Fig. 3 shows, this manually designed teacher model outputs soft targets with $100\%$ classification accuracy, and also has the smoothing property of label smoothing. But the $\mathrm{Tf - KD}_{reg}$ is not an over-parameterized version of LSR because the temperature $\tau \gg 1$ , thus Eq. 9 will not be equal to Eq. 3 when we adjust the parameters $\alpha$ , $a$ or $u(k)$ . + +The two Teacher-free methods, $\mathrm{Tf - KD_{self}}$ and $\mathrm{Tf - KD_{reg}}$ , are very simple yet effective, as validated via extensive experiments in the next section. + +# 5. Experiments on Tf-KD + +In this section, we conduct experiments to evaluate Tf-KD $_{self}$ and Tf-KD $_{reg}$ on three datasets for image classification: CIFAR100, Tiny-ImageNet and ImageNet. For fair comparisons, all experiments are conducted with the same setting. + +# 5.1. Experiments for Self-training + +For our $\mathrm{Tf - KD}_{\mathrm{self}}$ and Normal KD, the hyperparameters (temperature $\tau$ and $\alpha$ ) are obtained by grid search from 70 epochs training (200 epochs), the values of hyper-parameters are given in Supplementary Material. + +CIFAR100. On CIFAR100, we use baseline models including MobileNetV2, ShuffleNetV2, GoogLeNet, ResNet18, DenseNet121 and ResNeXt29(8×64d). The baselines are trained for 200 epochs, with batch size 128. The initial learning rate is 0.1 and then divided by 5 at the + +Table 5. Accuracy improvement comparison (in %) on CIFAR100 (T: Teacher, R: ResNet, RX: ResNeXt, D: DenseNet). + +
ModelBaselineTf-KDselfNormal KD [T]
MobileNetV268.3870.96 (+2.58)+2.67 [R18]
ShuffleNetV270.3472.23 (+1.89)+1.71 [R18]
ResNet1875.8777.10 (+1.23)+1.19 [R50]
GoogLeNet78.7280.17 (+1.45)+1.39 [RX29]
DenseNet12179.0480.26 (+1.22)+1.15 [RX29]
ResNeXt2981.0382.08 (+1.05)+1.12 [RX101]
+ +60th, 120th, 160th epoch. We use SGD optimizer with the momentum of 0.9, and weight decay is set to 5e-4. + +Tab. 5 shows the test accuracy of the six models. It can be seen that our $\mathrm{Tf - KD}_{\text{self}}$ consistently outperforms the baselines. For example, as a powerful model with 34.52M parameters, ResNeXt29 improves itself by $1.05\%$ with self-regularization. Even when compared to Normal KD with a superior teacher in Tab. 5 (4th column), our method achieves comparable performance (experiment settings for Tf-KD and Normal KD are the same and hyper-parameters are searched for both $\mathrm{Tf - KD}_{\text{self}}$ and Normal KD). For example, with ResNet50 to teach ReseNet18, the student has a $1.19\%$ improvement, but our method achieves $1.23\%$ improvement without using any stronger teacher model. We also obtain similar results for MobileNetV2 by $\mathrm{Tf - KD}_{\text{self}}$ in Fig. 4. + +![](images/8b690e6f12b1d021901e6a6f20d70d8fb8d189d4dbc619b05aaa202683cb93e8.jpg) +Figure 4. MobileNetV2 obtains similar improvement by self-regularization or taught by ResNet18. + +Tiny-ImageNet. On Tiny-ImageNet, we use baseline models including MobileNetV2, ShuffleNetV2, ResNet50, DenseNet121. They are trained for 200 epochs with batch size $bn = 128$ for MobileNetV2, ShuffleNetV2 and $bn = 64$ for ResNet50, DenseNet121. The initial learning rate is $\eta = 0.1 * \frac{bn}{128}$ and then divided by 10 at the 60th, 120th, 160th epoch. We use SGD optimizer with momentum of 0.9, and weight decay is set to 5e-4. Tab. 6 shows the results of Tf-KD $_{self}$ on Tiny-ImageNet. It can be seen that Tf-KD $_{self}$ consistently improves the baseline models and achieves comparable improvement with Normal KD. + +ImageNet. ImageNet-2012 is one of the largest datasets for object classification, with over 1.3m hand-annotated images. The baseline models we use on this dataset include + +Table 6. Tf-KD ${}_{\text{self }}$ experiment results on Tiny-ImageNet (in %). + +
ModelBaselineTf-KDselfNormal KD [T]
MobileNetV255.0656.77 (+1.71)+1.64 [R18]
ShuffleNetV260.5161.36 (+0.85)+0.68 [R18]
ResNet5067.4768.18 (+0.71)+0.76 [D121]
DenseNet12168.1568.29 (+0.14)+0.16 [RX29]
+ +ResNet18, ResNet50, DenseNet121, RexNeXt101 (32x8d), and we adopt official implementation of Pytorch to train them. We set batch size $bn = 512$ for ResNet18, ResNet50, DenseNet121, and $bn = 256$ for RexNeXt101. Following common experiment settings [5], the initial learning rate is $\eta = 0.1 * \frac{bn}{256}$ which is then divided by 10 at the 30th, 60th, 80th epoch in total 90 epochs. We use SGD optimizer with momentum of 0.9, and weight decay is 1e-4. Results are reported in Tab. 7. We can see that the self-training can further improve the baseline performance on ImageNet-2012. As a comparison, we also use DenseNet121 to teach ResNet18 on ImageNet, and ResNet18 obtains $0.56\%$ improvement, which is comparable with our Tf-KDself (Tab. 8). + +Table 7. Tf-KD $_{self}$ experiment results on ImageNet (Top1 accuracy, in%). + +
ModelBaselineTf-KDself
ResNet1869.8470.42 (+0.58)
ResNet5075.7776.41 (+0.64)
DenseNet12175.2875.72 (+0.44)
ResNeXt10179.2879.56 (+0.28)
+ +Table 8. Comparison between Tf-KD ${}_{\text{self }}$ and Normal KD on ImageNet (Top1 accuracy, in %). + +
ModelBaselineTf-KDselfNormal KD [T]
ResNet1869.8470.42 (+0.58)70.40 (+0.56) [D121]
+ +# 5.2. Experiments for Manually-designed Regularization + +For all experiments of $\mathrm{Tf - KD}_{reg}$ , we adopt the same implementation settings with $\mathrm{Tf - KD}_{\text{self}}$ , except for using a virtual output distribution as a regularization term (Eq. (9)). For fair comparisons, experiment settings for Normal KD and $\mathrm{Tf - KD}_{reg}$ are the same. See Supplementary Material for hyper-parameters of $\mathrm{Tf - KD}_{reg}$ . + +CIFAR100 and Tiny-ImageNet. For $\mathrm{Tf - KD_{reg}}$ experiments on CIFAR100 and Tiny-ImageNet, we set the probability for correct classes as $a = 0.99$ (Eq. (8)). The temperature $\tau$ and $\alpha$ in Eq. (9) are different for different baseline models (see Supplementary Material). From Tab. 9 and Tab. 10, we can observe with no teacher used and just a regularization term added, $\mathrm{Tf - KD_{reg}}$ achieves comparable performance with Normal KD on both CIFAR100 and Tiny-ImageNet. + +ImageNet. For the $\mathrm{Tf - KD}_{reg}$ on ImageNet, we adopt temperature $\tau = 20$ as normal knowledge distillation, and + +Table 9. Tf-KDreg achieves comparable results with Normal KD on CIFAR100. + +
ModelBaselineTf-KDregNormal KD [Teacher]+ LSR
MobileNetV268.3870.88 (+2.50)71.05 (+2.67) [ResNet18]69.32 (+0.94)
ShuffleNetV270.3472.09 (+1.75)72.05 (+1.71) [ResNet18]70.83 (+0.49)
ResNet1875.8777.36 (+1.49)77.19 (+1.32) [ResNet50]77.26 (+1.39)
GoogLeNet78.1579.22 (+1.07)78.84 (+0.99) [ResNeXt29]79.07 (+0.92)
+ +Table 10. Tf- $\mathrm{KD}_{reg}$ experiment results on Tiny-ImageNet. + +
ModelBaselineTf-KDregNormal KD [Teacher]+ LSR
MobileNetV255.0656.47 (+1.41)56.53 (+1.47) [ResNet18]56.24 (+1.18)
ShuffleNetV260.5160.93 (+0.42)61.19 (+0.68) [ResNet18]60.66 (+0.11)
ResNet5067.4767.92 (+0.45)68.15 (+0.68) [ResNeXt29]67.63 (+0.16)
DenseNet12168.1568.37 (+0.18)68.44 (+0.26) [ResNeXt29]68.19 (+0.04)
+ +$\alpha = 0.1$ as label smoothing regularization. The probability for correct classes in the manually-designed teacher is $a = 0.99$ (Eq. (9)). We test our $\mathrm{Tf - KD_{reg}}$ with four baseline models: ResNet18, ResNet50, DenseNet121 and ResNeXt101 (32x8d). As a regularization term, the manually designed teacher achieves consistent improvement compared with baselines. For example, the proposed Tf $\mathrm{KD}_{reg}$ improves the top1 accuracy of ResNet50 by $0.65\%$ on ImageNet-2012 (Tab. 11). Even for a huge single model ResNeXt101 (32x8d) with 88.79M parameters, our method achieves $0.48\%$ improvement by using the manually designed teacher. + +Table 11. Test accuracy improvement (in %) on ImageNet. + +
ModelBaseline+Tf-KDreg+ LSR
ResNet1869.8470.24 (+0.40)70.02 (+0.18)
ResNet5075.7776.42 (+0.65)76.38 (+0.51)
DenseNet12175.2875.62 (+0.34)75.24 (-0.04)
ResNeXt10179.2879.76 (+0.48)79.67 (+0.39)
+ +Comparing our two methods $\mathrm{Tf - KD_{self}}$ and $\mathrm{Tf - KD_{reg}}$ , we observe that $\mathrm{Tf - KD_{self}}$ works better in small dataset (CIFAR100) while $\mathrm{Tf - KD_{reg}}$ performs slightly better in large dataset (ImageNet). + +Comparison with LSR The $\mathrm{Tf - KD_{reg}}$ is motivated by LSR, which can be seen as a modification of LSR. This modification significantly improves the performance of neuron networks without extra computation cost. Same as LSR, $\mathrm{Tf - KD_{reg}}$ can serve as a generic regularization method to normally train neural networks. We compare our $\mathrm{Tf - KD_{reg}}$ with label smoothing on CIFAR100, TinyImageNet and ImageNet. For fair comparisons, experiment settings for $\mathrm{Tf - KD_{reg}}$ and LSR are the same. The results are shown in Tab. 9, 10 and 11. It can be seen that $\mathrm{Tf - KD_{reg}}$ consistently outperforms LSR. Additionally, the formulation of $\mathrm{KDR}_{man}$ is similar to LSR, but it is not an overparameterized version of label smoothing. We give detailed comparison between $\mathrm{Tf - KD_{reg}}$ and LSR to show the difference in Supplementary Material. + +# 6. Related Work + +Knowledge Distillation Since [7] proposed knowledge distillation based on prior work [2], KD has been widely + +adopted or modified [14, 19, 20, 4, 1, 11, 17]. Different from existing works, our work challenges the common belief of knowledge distillation based on our designed exploratory experiments. A related work is deep mutual learning [21], which proposes to let an ensemble of student models to learn with each other by minimizing the KL Divergence of predictions. Comparatively, our work reveals the relationship between KD and label smoothing, and our proposed Tf-KD can serve as a general method for neural network training. Another related work is Born-again networks [4], which use similar method as $\mathrm{Tf - KD}_{\text{self}}$ . The difference is that Born-again networks utilize an ensemble of students to train itself in the final step. + +Label Smoothing Szegedy et al. [16] proposed LSR to replace the "hard labels" with smoothed labels, boosting performance of many tasks like image classification, language translation and speech recognition [13]. Recently, [12] empirically showed label smoothing can also help improve model calibration. In our work, we adopt label smoothing regularization to understand the regularization function of knowledge distillation. + +# 7. Conclusion + +In this work, we find through experiments and analyses that the "dark knowledge" of a teacher model is more of a regularization term than similarity information of categories. Based on the relationship between KD and LSR, we propose Teacher-free KD. Experiment results show our Tf-KD can achieve comparable results with Normal KD in image classification. Our work also suggests that, when it is hard to find a stronger teacher for a powerful model or computation resource is limited to train teacher models, the targeted model can still get enhanced by self-training or a manually-designed regularization term. + +Acknowledgement Jiashi Feng was partially supported by AI.SG R-263-000-D97-490, NUS ECRA R-263-000-C87-133 and MOE Tier-II R-263-000-D17-112. Besides, we thank Dr.Jianan Li, Mr.Daquan Zhou and Mr.Yujun Shi for discussion during this work. + +# References + +[1] R. Anil, G. Pereyra, A. Passos, R. Ormandi, G. E. Dahl, and G. E. Hinton. Large scale distributed neural network training through online distillation. arXiv preprint arXiv:1804.03235, 2018. +[2] J. Ba and R. Caruana. Do deep nets really need to be deep? In Advances in neural information processing systems, pages 2654-2662, 2014. +[3] 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, pages 248-255. IEEE, 2009. +[4] T. Furlanello, Z. C. Lipton, M. Tschannen, L. Itti, and A. Anandkumar. Born again neural networks. arXiv preprint arXiv:1805.04770, 2018. +[5] P. Goyal, P. Dollár, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. Accurate, large minibatch sgd: TrainingImagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. +[6] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +[7] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. +[8] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700-4708, 2017. +[9] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009. +[10] N. Ma, X. Zhang, H.-T. Zheng, and J. Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), pages 116-131, 2018. +[11] S.-I. Mirzadeh, M. Farajtabar, A. Li, and H. Ghasemzadeh. Improved knowledge distillation via teacher assistant: Bridging the gap between student and teacher. arXiv preprint arXiv:1902.03393, 2019. +[12] R. Müller, S. Kornblith, and G. Hinton. When does label smoothing help? arXiv preprint arXiv:1906.02629, 2019. +[13] G. Pereyra, G. Tucker, J. Chorowski, L. Kaiser, and G. Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017. +[14] A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta, and Y. Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. +[15] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen. Mobilenetv2: Inverted residuals and linear bottle-necks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4510-4520, 2018. +[16] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818-2826, 2016. +[17] T. Wang, L. Yuan, X. Zhang, and J. Feng. Distilling object detectors with fine-grained feature imitation. In The + +IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +[18] S. Xie, R. Girshick, P. Dollar, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492-1500, 2017. +[19] J. Yim, D. Joo, J. Bae, and J. Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4133-4141, 2017. +[20] R. Yu, A. Li, V. I. Morariu, and L. 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. +[21] Y. Zhang, T. Xiang, T. M. Hospedales, and H. Lu. Deep mutual learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4320-4328, 2018. \ No newline at end of file diff --git a/revisitingknowledgedistillationvialabelsmoothingregularization/images.zip b/revisitingknowledgedistillationvialabelsmoothingregularization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9e9facc20d633440eec09d65295d228cb86b9e22 --- /dev/null +++ b/revisitingknowledgedistillationvialabelsmoothingregularization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1201bc87c6b41759cd845aba296446d6dd5548c4f95e209e2891e7a60cd4d1ec +size 611969 diff --git a/revisitingknowledgedistillationvialabelsmoothingregularization/layout.json b/revisitingknowledgedistillationvialabelsmoothingregularization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..da004a63a54221fd12554f50e339ba23c1d04ddf --- /dev/null +++ b/revisitingknowledgedistillationvialabelsmoothingregularization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05d2ca86cae4527f01409b420bf0fb487a1e64ced848a177d79750de5668ca79 +size 422783 diff --git a/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_content_list.json b/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9cbd116ba0479e60104b8b1c90960115c405704e --- /dev/null +++ b/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fc4b83804c8abffa851a067bea44371d54de2a59e99af5a7bf8563ca0505549 +size 71117 diff --git a/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_model.json b/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d050f378ed6aeb110699dbc182bbacdd3875d0ea --- /dev/null +++ b/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4705c164f24a7c3d833f37b05517fd5249bd175e21e2356626b531906a9de168 +size 86375 diff --git a/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_origin.pdf b/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f700de02906a06755148743fabcd5ff21254edfe --- /dev/null +++ b/revisitingposenormalizationforfinegrainedfewshotrecognition/b75f6653-a181-4cb4-abff-82bfd3ae15a4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:246a81b722cc14f0db0a02347d15c14a59c044134714246a242e12d18c13fdcd +size 976857 diff --git a/revisitingposenormalizationforfinegrainedfewshotrecognition/full.md b/revisitingposenormalizationforfinegrainedfewshotrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1734ebbc22c4089c888e10eb47035efe27de8e84 --- /dev/null +++ b/revisitingposenormalizationforfinegrainedfewshotrecognition/full.md @@ -0,0 +1,285 @@ +# Revisiting Pose-Normalization for Fine-Grained Few-Shot Recognition + +Luming Tang Davis Wertheimer Bharath Hariharan Cornell University + +{1t453,dww78,bh497}@cornell.edu + +# Abstract + +Few-shot, fine-grained classification requires a model to learn subtle, fine-grained distinctions between different classes (e.g., birds) based on a few images alone. This requires a remarkable degree of invariance to pose, articulation and background. A solution is to use pose-normalized representations: first localize semantic parts in each image, and then describe images by characterizing the appearance of each part. While such representations are out of favor for fully supervised classification, we show that they are extremely effective for few-shot fine-grained classification. With a minimal increase in model capacity, pose normalization improves accuracy between 10 and 20 percentage points for shallow and deep architectures, generalizes better to new domains, and is effective for multiple few-shot algorithms and network backbones. Code is available at https://github.com/Tsingularity/PoseNorm_Fewshot. + +# 1. Introduction + +The ability to generalize with minimal fine-tuning is a crucial property for learned neural models, not just to unseen data but also to unseen types of data. Consider the task shown in Figure 1. We are given just a single image (or a very small number) from a few bird species, and from this information alone we must learn to recognize them. Humans are known to be very good at this few-shot learning task [19], but machines struggle: in spite of dramatic progress in visual recognition and two years of focused research, performance on several few-shot benchmarks remains far below that of fully supervised approaches. + +This is a problem in practice, especially for fine-grained classification problems (such as that in Figure 1). In this setting, distinct classes can number in the hundreds, while the expertise and effort required to correctly label these classes can make annotation expensive. Together, this makes the collection of large labeled training sets for fine-grained classification difficult, sometimes prohibitively so. The ability of neural networks to handle fine-grained, few-shot learning + +can thus be crucial for real-world applications. + +What is the reason behind the large gap between machine and human performance on this task? An intuitive hypothesis is that humans use a much more stable feature representation, which is invariant to large spatial deformations. For example, in the bird classification task, we might characterize a bird image using the attributes of its various parts: the shape of the beak, the color of the wing, the presence or absence of a crown. Such a characterization is invariant not just to changes in the image background, but also to variation in camera pose and articulation, allowing us to effectively perceive similarities and differences across a wide range of bird species, and individual images of them. + +Such a featurization is "pose normalized", and was explored as a promising direction for fine-grained classification before the re-discovery of convolutional networks [32]. Researchers found, however, that end-to-end training with black-box architectures, and without pose normalization, led to great improvement in the standard benchmarks (albeit with consistent modifications, such as bilinear pooling [16]). Indeed, in recent years, winners on the annual fine-grained classification challenges [1] have mostly focused on these black-box architectures. The intuitive idea of pose normalization has fallen by the wayside. + +In contrast, we argue that the dominance of black-box architectures over pose-normalized representations is an artifact of the fully-supervised classification problem. In these settings, all classes to be distinguished are known a priori, and we have significant amounts of training data for each class. This reduces the need for pose and background invariance, since the training data will likely include a broad range of variation within each class. At the same time, leveraging category-specific biases in pose and background will likely be beneficial, since the representation need not generalize to new classes. These factors act in favor of black-box architectures with no built-in inductive biases. However, if we want the learnt model to adapt to new classes from limited data, as in few-shot learning, the intuitive invariance of pose normalization becomes more useful. + +In this paper, we revisit pose normalization for the task of few-shot, fine-grained classification, and demonstrate its + +![](images/755aa01821b6ee77223d213bcabe2e5171b74192bf204499772cb0b90710ff5f.jpg) +Figure 1. Left: The fine-grained few-shot recognition task. Objects share the same part structure and differences between categories are subtle. Middle: Based on a simple pose estimator, a pose-normalized representation can capture semantic part information. Right: On both shallow and deep backbones, pose normalization increases few-shot learning performance significantly. A shallow architecture with our representation (4-layer ConvNet+Pose Normalization) even outperforms a much deeper blackbox network without it (ResNet18). + +![](images/4bfaf2db8c51adf4dbb8f682afbba5166a5f6cb7ee62599917fb6ef91f38345a.jpg) + +![](images/e1d9ba0c5ba6e7030ab1b72d0c1ad143c438b2b9701acbe3dd1981d9cff20696.jpg) + +usefulness in this setting. Pose normalization is implemented through an extremely simple modification to convolutional architectures, adding very few new parameters (in contrast to prior methods that increase network size by a factor of two or higher [34, 10]). Our method is orthogonal to the choice of few-shot learning technique and backbone neural architecture. We evaluate our approach on three different few-shot learning techniques, two differently-sized backbone architectures, and three fine-grained classification datasets of bird species and aircraft. We find that: + +1. Pose normalization provides significant gains across the board, in some cases providing a more than 20 point improvement in accuracy, while requiring no part annotations for novel classes. +2. In all settings, pose normalization outperforms black-box modifications to the neural architecture, such as bilinear pooling. +3. The advantages of pose normalization are apparent even when as little as only $5\%$ of the base class training data is annotated with pose. +4. Pose normalization is effective for both shallow and deep network architectures. Shallow networks with pose normalization outperform deeper blackbox ones. + +The large performance gains we observe, along with the simplicity of the architecture itself, points to the power of pose normalization in fine-grained, few-shot classification. + +# 2. Related Work + +Fine-grained recognition is a classic problem in computer vision, and a recurring challenge [1]. While we focus on bird species classification [26], the presented ideas apply to other fine-grained tasks, such as identifying models of + +aircraft [17], cars [15], or any other problem where objects have a consistent set of parts. In the context of fine-grained recognition, Farrell et al. [6] proposed the idea of pose normalization: predicting the parts of the object and recording the appearance of each part as a descriptor. Many versions of the idea have since been explored, including varying the kind of parts [32, 10, 33], the part detector [31], and the combination of these ideas with neural networks [34]. The last of these is the most similar to our work. However, all of these approaches are concerned with fully supervised recognition, whereas here we look at few-shot recognition. + +Pose normalization has also served as inspiration for black-box models where the parts are unsupervised. Lin et al. [16] introduce bilinear pooling as a generalization of such normalization, and we compare to this idea in our work. Spatial Transformer Networks [14] instantiate unsupervised pose normalization explicitly and train it end-to-end. Other instantiations of this intuition have also been proposed [4, 11, 21]. However, these unsupervised approaches add significant complexity and computation, making it difficult to discern the benefits of pose-normalization alone. In contrast, we focus on a lightweight, straightforward, semantic approach to show that pose normalization, not added network power, is responsible for improved performance. + +Few-shot learning methods can be loosely organized into the following three groups: 1) Transfer learning baselines train standard classification networks on base classes, and then learn a new linear classifier for the novel classes on the frozen representation. Recent work has shown this to be competitive [3, 27, 18]. 2) Meta-learning techniques train a "learner": a function that maps small labeled training sets and test images to test predictions. Examples include ProtoNet [20], MatchingNet [25], RelationNet [22] and MAML [7]. These learners might sometimes include learnt data augmentation [28], which some methods train + +using pose annotations [5]. 3) Weight generation techniques generate classification weights for new categories [8, 9]. + +Most few-shot learning methods use blackbox network architectures, which function well given enough labeled data, but may suffer in the highly constrained few-shot learning scenario. Wertheimer and Hariharan [29] revisit the bilinear pooling of Lin et al. [16] and find it to work well. They also introduce a simple, effective localization-normalized representation, but which is limited to coarse object bounding boxes instead of fine-grained parts. Zhu et al. [35] introduce a semantic-guided multi-attention module to help zero-shot learning, but is fully unsupervised. We compare to an unsupervised baseline in our experiments. + +Pose normalization increases invariance to common modes of variation. An alternative to increasing invariance is to use learnt data augmentation [12, 28, 5]. However, this typically requires large additional networks and significant computation. Instead, we focus on a lightweight approach. Note also that one of our baselines [8] already outperforms a recent augmentation method [28]. + +In the following sections, we first overview few-shot recognition. We then show that pose-normalization of features can act as a plug-and-play network layer in a range of few-shot learning algorithms. + +# 3. Few-Shot Recognition + +The goal of few-shot learning is to build a learner that can produce an effective classifier given only a small labeled set of examples. In the classic few-shot setting, the learner is first provided a large labeled set (the representation set, $D_{\text{repre}}$ ) consisting of many labeled images from base classes $Y_{\text{base}}$ . The learner must set its parameters, and any hyper-parameters, using this data. It then encounters a disjoint set of novel classes $Y_{\text{novel}}$ from which it gets a small set of reference images $D_{\text{refer}}$ . The learner must then learn a classifier for the novel classes from this set. + +In most techniques, we can divide the learner into three modules: a feature-map extractor $f_{\theta}$ , a feature aggregator $g_{\phi}$ , and a learning algorithm $h_w$ . + +The feature map extractor $f_{\theta}$ is usually implemented as a deep convolutional neural network, with learnable parameters $\theta$ . For each input image $x$ , the network yields the corresponding feature map tensor $\mathbf{F} = f_{\theta}(x) \in \mathbb{R}^{C \times H \times W}$ , where $C, H, W$ denote respectively the channel, height, and width dimensions of the feature map. + +The feature aggregator $g_{\phi}$ is a transformation parameterized by $\phi$ , converting feature maps into global feature vectors: $\pmb{v} = g_{\phi}(\pmb{F}) \in \mathbb{R}^{d}$ , where $d$ is the latent dimensionality. Typically $g_{\phi}$ is a global average pooling module. + +The learning algorithm $h_w$ takes a dataset $S$ of training feature vectors and corresponding labels, and a test feature vector $v$ , and outputs a probability distribution over labels + +$\hat{p}$ for the latter: $\hat{p}(x) = h_w(v, S)$ . For our purposes we consider three representative methods: + +Transfer learning follows the standard network pretraining and fine-tuning procedure. $h_w$ is implemented by a simple linear classifier with a learned weight matrix and softmax activation. Functions $f_{\theta}, g_{\phi}$ are trained concurrently with $h_w$ , minimizing the standard cross-entropy loss over data in $D_{repre}$ . To adapt the model to novel classes, feature extractor parameters $\theta, \phi$ are frozen, and $h_w$ trains a new linear classifier on the novel classes in $D_{refer}$ . + +Prototypical network [20] is a representative meta-learning method that produces a prototype representation for each class by averaging the feature vectors within that class. $h_w$ is then a non-parametric classifier assigning class probabilities based on the distance between a datapoint's feature vector and each class prototype. Every training episode samples $N$ classes from the base categories $Y_{base}$ , and a small support set and query set of images from within each one. Support images form class prototypes, while N-way classification on the query set produces the loss, and corresponding update gradients to parameters $\theta, \phi$ . + +In Dynamic few-shot learning [8], $h_w$ is once again a linear (or cosine) classifier, but instead of being directly fine-tuned on $D_{\text{refer}}$ , the classifier is generated by a learnt weight generator $G$ . The training process consists of two stages. The first is standard classification training on $D_{\text{repre}}$ . During the second stage, the feature extractor parameters $\theta, \phi$ are frozen. To train the generator $G$ , the algorithm randomly picks several "fake" novel classes from $Y_{\text{base}}$ , and treats them as if they were truly novel, performing classification with the classifier weights generated by $G$ and minimizing the classification loss on simulated "test" examples from these classes. + +# 4. Pose-Normalized Feature Vectors + +Two intuitions motivate our proposed method. First, for fine-grained recognition, the difference in appearances between two classes tends to be extremely small. In the few-shot setting, it is even harder for an algorithm to capture these subtle differences, as only a few examples are available for reference. Using pose normalization to focus the feature representation on the most informative parts of each image should then benefit the learning process. Second, because fine-grained recognition involves similar kinds of objects, they are likely to share the same semantic structures. Thus it is highly probable that a pose estimator trained on base classes will generalize, even to unseen novel classes. + +We assume $M$ distinct parts. Part annotations are available for (some) base-class training samples in $D_{\text{repr}}$ , but not for novel classes. We format part annotations for each image $x$ as an $M \times H \times W$ location tensor $\boldsymbol{m}^*$ , where $H \times W$ is the spatial resolution of the feature map. + +We now present our method for extracting pose + +![](images/a4a25cebc58bf4d38f3be9d73ca23b02547251c11763b9e4997207fe359cce04.jpg) +Figure 2. The pose normalization framework for training and inference. The pose estimator takes an intermediate output of the network backbone as input and generates pose heatmap predictions. The feature vector is calculated by applying each heatmap as an attention over the feature map. The final representation is the concatenation of these vectors. In this example, the number of parts $M = 2$ . + +![](images/044f5d86656994a919ab78efc2853f1e7681ab0a9ca3bbd2bc27b7e42fa523cd.jpg) + +normalized feature vectors. For this, the network must first estimate pose. We use an extremely small, two-layer convolutional network $q_{\phi}$ . This operates on a feature map tensor $\pmb{F}^{\prime} \in \mathbb{R}^{C^{\prime} \times H^{\prime} \times W^{\prime}}$ extracted from an intermediate layer of the feature map extractor $f_{\theta}$ . $q_{\phi}$ uses sigmoid activation in the final layer and produces a heatmap location prediction for all annotated parts $\pmb{m} = q_{\phi}(\pmb{F}^{\prime}) \in \mathbb{R}^{M \times H \times W}$ . We deliberately use a small $q_{\phi}$ and reuse computation in $f_{\theta}$ to minimize the effect the additional parameters might have on the final performance of the classifier. Improved performance should indicate that pose information is useful for fine-grained few-shot learning, not a larger network. + +Given the heatmap $\pmb{m}$ and feature map $\pmb{F}$ , we must construct a feature vector $\pmb{v}$ . Each channel in $\pmb{m}$ is applied as a spatial attention mask to the feature map, producing an attention-normalized feature vector. Concatenating these $M$ part description vectors produces the final representation vector for the image. Formally, denoting $\pmb{F}(h,w) \in \mathbb{R}^{C}$ as the feature vector for location $(h,w)$ in feature map $\pmb{F}$ , and $m_{i}(h,w) \in \mathbb{R}$ as the heatmap pixel value at position $(h,w)$ for the $i$ -th part category, $\pmb{v} \in \mathbb{R}^{CM}$ is calculated as: + +$$ +\boldsymbol {v} _ {i} = \frac {\sum_ {h , w} ^ {H , W} \boldsymbol {F} (h , w) \cdot m _ {i} (h , w)}{\epsilon + \sum_ {h , w} ^ {H , W} m _ {i} (h , w)} \tag {1} +$$ + +$$ +\boldsymbol {v} = \left[ \boldsymbol {v} _ {0}, \dots , \boldsymbol {v} _ {i}, \dots , \boldsymbol {v} _ {M} \right] \tag {2} +$$ + +where $\epsilon = 10^{-5}$ . The loss during training is the sum of the pixel-wise log loss between the ground truth part location heatmap $m^{*}$ and the predicted heatmap $m$ , and the original few-shot classification loss: + +$$ +\begin{array}{l} L _ {p o s e} = - \frac {1}{M H W} \sum_ {i, h, w} ^ {M, H, W} [ m _ {i} ^ {*} (h, w) \log m _ {i} (h, w) \\ \left. + \left(1 - m _ {i} ^ {*} (h, w)\right) \log \left(1 - m _ {i} (h, w)\right) \right] \tag {3} \\ \end{array} +$$ + +$$ +L _ {t o t a l} = L _ {f e w s h o t} + \alpha \cdot L _ {p o s e} \tag {4} +$$ + +where $\alpha$ is a balancing hyper-parameter. To facilitate learning in the classification branch, feature vectors for few-shot classification are initially produced from the ground truth part annotation heatmap $m^{*}$ instead of the predicted heatmap $m$ . Afterwards, the pose estimation network's parameters $\phi$ are frozen. In subsequent adaptation/fine-tuning and evaluation/inference stages on novel classes, feature vectors are calculated from the predicted heatmap $m$ . An overview of our approach is provided in figure 2. + +Note that while we assume a fixed set of consistent part labels during training, we do not require parts to consistently appear across all objects, nor must any particular object contain all the specified parts. Thus, our pose estimator should generalize broadly: any fine-grained classification of objects that depends on the appearance of various parts (e.g., cars, furniture, insects) is amenable to this approach. + +# 5. Experiments + +# 5.1. Datasets and implementation details + +We experiment with the CUB dataset [26] which consists of 11,788 images from 200 classes. It also includes 15 part annotations for each image, thus $M = 15$ . Following the evaluation setup in [29, 3], we randomly split the dataset into 100 base, 50 validation and 50 novel classes. Base category images form the representation set $D_{\text{repre}}^{CUB}$ . For each validation and novel class, we randomly sample $20\%$ of its images to form the reference set $D_{\text{refer}}^{CUB}$ . The remaining novel images form the query set $D_{\text{query}}^{CUB}$ , which is used for evaluating algorithms. Note that our models have access to part annotations only in base classes. No part annotation information is available for any image in the validation or novel classes, including both their reference and query sets. + +NABird evaluation: There are only 50 novel classes in CUB's evaluation set, which can potentially make evaluation noisy. The accuracy differences between few-shot learning algorithms also decrease significantly in the pres + +ence of domain shift [3]. Thus, in order to verify the robustness and generalization capacity of our proposed method, we also evaluate our CUB models on another, much larger bird dataset: NABird [23] (NA), which, after removing overlap with CUB, contains 418 classes and 35,733 images. As before, we randomly sample $20\%$ of images from each category to form the reference set $D_{refer}^{NA}$ . The remaining images form the query set $D_{query}^{NA}$ . + +Network backbone: For the feature map extractor $f_{\theta}$ , previous work [20, 29, 8] adopts a standard architecture: a 4-layer, 64-channel convolution network with batch normalization and ReLU. In this setting, the input image size is $84 \times 84$ and the output feature map is $64 \times 10 \times 10$ . Deeper backbones can significantly reduce the differences in performance between these methods [3], so in addition to the 4-layer network, we also train and evaluate a ResNet18 [13] backbone, with a few technical modifications that increase performance across all models. We change the stride of the last block's first convolution and downsampling layers from 2 to 1. The output size of the last block thus remains at $14 \times 14$ instead of $7 \times 7$ . We also add a $1 \times 1$ convolution with batch normalization to the last layer of the original ResNet18, which reduces the number of channels from 512 to 32. The input size of our modified ResNet18 is still $224 \times 224$ , but the output size becomes $32 \times 14 \times 14$ . + +Pose estimation module: The layers of the pose estimation network $q_{\phi}$ are composed as Conv-BN-ReLU-Conv, where Conv denotes $3 \times 3$ convolution. In the 4-layer ConvNet, $q_{\phi}$ takes as input the feature map after the second convolution. The number of input/output channels for the two convolution layers in $q_{\phi}$ are $64 / 30$ and $30 / M$ where $M$ is the number of part categories. In the ResNet18, $q_{\phi}$ takes the third block's feature map as input, and the corresponding convolution channel sizes are $256 / 64$ and $64 / M$ . It can be seen that the number of learnable parameters introduced by $q_{\phi}$ is small compared to the original backbone network. + +# 5.2. Baseline methods + +For the few-shot learning algorithm, we denote transfer learning, prototypical networks, and dynamic few-shot learning as transfer, proto, and dynamic, respectively. We compare our proposed pose normalization approach (PN) with the following feature aggregation methods, across all learning algorithms and network backbones: + +Average pooling is the most straightforward method, commonly adopted in previous work. All subsequent models use average pooling when a feature aggregator is not otherwise specified. + +We also present a baseline that trains this average-pooled feature extractor and classifier jointly with a localizer, with the latter discarded at test time. This Multi-Task model, denoted MT, examines whether pose estimation functions purely as a regularizer in few-shot training. + +Bilinear pooling (BP) [16] is an effective module for expanding the latent feature space and increasing expressive power in fine-grained visual classifiers. Recent work [29] found that BP can be adapted to prototypical networks, improving performance without increasing parameter count. + +Few-shot localization (FSL) [29] uses bounding box annotations in the representation and reference sets. The model learns to localize an object before classifying it, thus improving few-shot classification accuracy. Since this model's localizer is learnt in a prototypical way, it doesn't introduce any additional convolutional layers. + +Bounding box normalization (bbN) is a more direct comparison to bounding box based methods that does not require box annotations for novel classes. We use the PN model but set $M = 2$ , and train the localizer to separate images into foreground/background regions based on the ground truth bounding boxes for base class training data. + +Unsupervised pose normalization (uPN) is based on unsupervised localization [29], a competitive localization method where feature maps are partitioned into soft regions based on feature distance from a set of learned parameter vectors. Following the same core idea, we introduce $M = 15$ learned, category-agnostic pose vectors, and spatially partition the feature map based on relative feature distance to each vector at each location. We mean-pool over the resulting 15 soft regions, as if they were 15 predicted part locations, to produce a feature vector for the classifier. The pose vectors are learned parameters, trained end-to-end and jointly with the classifier architecture, requiring no part annotations or separate localization module. + +In addition, we include an oracle version of our model: Pose normalization with ground truth pose (PN gt). + +# 5.3. Few-shot recognition results + +We first train all models on $D_{\text{repre}}^{CUB}$ , using the validation set to select the best hyper-parameters and stopping point for each model. We then evaluate them on $D_{\text{query}}^{CUB}$ using the limited set of labeled novel class images in $D_{\text{refer}}^{CUB}$ . For the evaluation metric, we use the all-way evaluation [29, 12, 28] rather than the commonly adopted 5-way task. The algorithm is required to distinguish all novel classes simultaneously, a more challenging setup. For the number of reference images, we consider both the standard 1-shot/5-shot and the all-shot setting proposed by [29], i.e. utilizing all the labeled images for each novel category in $D_{\text{refer}}^{CUB}$ . + +For CUB, all-shot results are shown in table 1. For 1 and 5 shot settings, we plot the mean of 600 randomly generated test episodes in figures 3 and 4. The $95\%$ confidence intervals are all less than 0.6 percentage points. Using the above models trained on CUB, we then do the same evaluation on NA, using $D_{refer}^{NA}$ and $D_{query}^{NA}$ . The number of novel classes in NA is large (418), and the number of images per class is unbalanced. We therefore only report the all-way + +![](images/95f6b8da605c848abe81b17685336ee5b6cc1b981926caa20ecfe6e6af05010a.jpg) +Figure 3. Accuracy comparison on CUB. All models use a ResNet18 prototypical network. Pose normalization dominates other methods under all settings. + +all-shot results in table 2, with both mean accuracy over all test samples and mean accuracy per class. We average over 8 trials for the proto, proto+uPN, and proto+PN models in each of the above mentioned settings. $95\%$ confidence intervals are all within 0.9 percentage points. + +From these experimental results, we conclude that: + +1. Pose normalization provides significant and consistent performance gains over the (average-pooled) baseline. Accuracy improves for both shallow and deep network backbones, for all three few-shot learning approaches, and for both evaluation datasets. Under the all-way, all-shot setting on CUB, the accuracy gain is consistently greater than 15 points for the 4-layer ConvNet, across all three learning algorithms, and reaches 20 points on ResNet18. Shallow networks with pose normalization can even outperform their deeper counterparts. +2. In all settings, pose normalization outperforms other aggregation functions, including black-box modifications (bilinear pooling), techniques based on bounding box localization (FSL and bbN) and unsupervised pose normalization. It also outperforms multi-task training, indicating that normalization, rather than the additional auxiliary loss, is key. +3. Pose information is more effective than coarse object location. In table 1, PN and bbN contribute similar quantities of new learnable parameters, but the fine-grained pose information in PN causes it to outperform bbN, which only focuses on a coarse bounding box. By comparing PN with PN-gt, we see that a better pose estimator could potentially contribute an even larger boost to performance. + +# 5.4. Impact of the number of pose annotations + +While part locations are often cheaper to obtain than fine-grained expert class labels (see the careful labelling + +
Model4-layer ConvNetResNet18
transfer33.4246.47
transfer+PN49.9657.53
transfer+PN-gt56.4058.54
proto32.0942.73
proto+MT35.5650.93
proto+BP35.5641.04
proto+FSL39.6047.43
proto+bbN37.7544.02
proto+uPN46.2453.18
proto+PN49.5663.44
proto+PN-gt59.5562.63
dynamic35.7743.27
dynamic+PN54.1760.19
dynamic+PN-gt62.6760.09
+ +Table 1. Few-shot classification results for different models on the CUB dataset. Models are organized by few-shot learning algorithm, then by feature representation method. Pose normalization gives a significant performance boost for all three few-shot learning algorithms, with both shallow and deep network backbones. + +
Model4-layer +meanConvNet +per-classResNet18
meanper-class
transfer12.6311.2420.2217.54
transfer+PN24.6021.7628.3625.57
proto8.738.3713.3312.55
proto+MT10.5910.1016.4115.42
proto+BP10.479.8315.0914.04
proto+FSL12.3411.6115.6214.81
proto+bbN10.5710.0013.0512.32
proto+uPN18.9117.5122.1220.77
proto+PN21.0219.4732.6630.59
dynamic12.1311.2614.8213.44
dynamic+PN26.1724.0730.1027.86
+ +Table 2. Performance of CUB models on NA. The performance boost introduced by pose normalization is still significant in this new domain. Performance is consistent with CUB observations. + +![](images/02fd6e832d4e43e1c72a2e3d676608d1c102a229b58bb39aa364a3dce8631825.jpg) +Figure 4. Performance comparison for dynamic few-shot learning models on CUB. The accuracy boost from pose normalization is significant and consistent. + +pipeline of [23]), it could still be the case that high-quantity part annotations are difficult to collect. We therefore consider an ablation of our model, where a limited number of training images have part annotations. For the remaining images, $L_{\text{pose}}$ is not computed, and the predicted pose + +![](images/692d6bc84f07a425855acbdae3f217b89d0b02563782797755bd6b8282cd6bcb.jpg) +Figure 5. Few-shot test accuracy for pose normalization when part annotations are sparse. The performance drop is surprisingly small. Pose normalization outperforms bilinear pooling even when only $5\%$ of annotations are available during training. + +heatmap produces feature vectors for classifier training instead of the ground truth. + +We evaluate prototypical networks on CUB with both shallow and deep backbones, and vary the percentage of images with part annotation. Results are given in figure 5. Pose normalization is highly robust to annotation sparsity during training (less than 5 points fluctuation when above $30\%$ availability), and consistently outperforms BP even with as few as $5\%$ pose annotations available. + +# 5.5. Evaluation on FGVC-Aircraft + +We evaluate the generality of these conclusions on fine-grained aircraft classification [17] (FGVC-Aircraft), which contains 10,000 images spanning 100 aircraft models. Following the same ratio as CUB, we split the classes into 50 base, 25 validation and 25 novel. The reference/query split is as described in Section 5.1. Since this dataset doesn't contain any part annotation, we use an independent dataset OID-Aircraft [24] (OID) to jointly train our pose normalization module. OID contains 6,357 images, ignoring those shared with FGVC, and 5 part annotations per image (thus $M = 5$ ). OID contains no classification labels. + +Each training iteration samples an image batch from OID and FGVC. OID images are used to calculate $L_{\text{pose}}$ , while FGVC images use predicted pose heatmaps to get feature vectors. Results are shown in Table 3. Although the pose estimator is trained on disjoint images, it remains effective at boosting aircraft recognition performance. We conclude that pose normalization generalizes across fine-grained few-shot classification tasks. Extending this approach to non-fine-grained tasks or class-specific parts is not straightforward, but could be a valuable direction for future research. + +
Model4-layer ConvNetResNet18
1-shot5-shotall-shot1-shot5-shotall-shot
proto24.4043.2452.0646.2763.1567.76
proto+PN26.0450.3560.8358.7277.7581.96
+ +Table 3. Few-shot results under all three evaluation settings on the FGVC-Aircraft dataset. Results averaged over five trials. + +# 6. Analysis + +# 6.1. Model interpretation + +Accuracy notwithstanding, we would like for pose-normalized representations to be human-interpretable, unlike prior black-box representations. To investigate what the model actually learns, we conduct two experiments to analyze the learnt pose normalized representation. Both use the proto+PN model with a ResNet18 backbone. + +Part importance: Every type of bird is likely to have a set of particularly distinguishable part attributes. To verify that our model learns this, we conduct the following test. For each class, we iterate over the parts and calculate the test accuracy when the corresponding part feature vector is removed from the representation. The magnitude of the resulting drop in accuracy can be construed as the importance of each part for this class as learned by the model. We visualize this learned importance for three species in figure 6 and compare it with species descriptions from a field guide. Our network scores largely conform to expert judgments. + +Nearest neighbors: Different birds might share the same part attribute; for example, the California Gull and the Ring-billed Gull have the same beak shape. Therefore in pose normalization, the beak vectors for these two birds should be close, as part vectors are designed to encode regional information in a class-agnostic way. To verify this, we find the top-5 images in the reference set with the closest part vectors to a given vector from a query image/part pair. Four random examples are given in figure 7. Generally, our assumption holds - the vector describing the given part in each query image does generalize to other species. + +# 6.2. Pose estimation + +Following prior work on evaluating pose estimation [30, 2] we calculate the normalized PCK (normalized using the diagonal of the bounding box) at different thresholds for both shallow and deep network backbones. Results are given in figure 8. We see that both estimates can give accurate results. While the deeper network backbone does produce a better estimate, this boost is also quite limited. We believe that a more sophisticated pose estimator could lead to better results on few-shot recognition. + +# 6.3. Unsupervised pose normalization + +We note that unsupervised pose normalization also performs well from a classification perspective (see table 1). + +![](images/3cdb278953e114ec1cacd3c7a89fa00a7141d90140d8d43de59f34e5e7baba42.jpg) +Figure 6. Visualizing accuracy drop for selected bird species when removing individual part vectors (part importance). On the right are quoted descriptions from bird experts on how to recognize those species. The estimated part importance matches well to expert judgments. + +![](images/048eb7277c7dd5bbd92eb1b998c1990694a7d9d0419ac2b13a5cc2eaa6d37bb8.jpg) +Figure 7. Images with the closest part vector to the query image, for a given part location. Images are labeled with a green box if it belongs to the same category as the query image. We see that part representations capture semantically meaningful attributes of the part location across classes. + +![](images/b443ea8c82228fffa4d49fbb22ef744ad257e88e60d229f103361bc82b4ac79b.jpg) +Figure 8. Pose estimation results for different network backbones. + +As shown in Figure 9, the deeper backbone with unsupervised pose normalization does produce localized keypoints, which might help classification. However, observe that the semantic meaning of these keypoints is not consistent + +![](images/a1f5ef0d0e02697fbcd90812d293aa38e16c8e31b151e773afbaaa488ad1bc83.jpg) +Figure 9. Visualization of unsupervised heatmaps. Semantic content is highly inconsistent, and difficult to interpret meaningfully. + +across images (figure 9, top two rows). The prediction is also unstable, with different channels sometimes providing similar heatmaps (figure 9, bottom row). This inconsistency could help to explain why machine-discovered parts underperform hand-designed ones in fine-grained, few-shot classification. + +# 7. Conclusion + +We show that a simple, lightweight pose normalization module can lead to consistently large performance gains on fine-grained few-shot recognition without any part annotations at test time. Our results hold for shallow and deep network backbones, multiple few-shot learning algorithms, and multiple domains. In addition to significant accuracy improvements, we also show that pose-normalized representations are highly human-interpretable. We therefore highly recommend pose normalization as a general area for the fine-grained few-shot learning community to revisit. + +# Acknowledgements + +This work was partly supported by a DARPA LwLL grant. + +# References + +[1] https://sites.google.com/view/fgvc6/home. +[2] Mykhaylo Andriluka, Leonid Pishchulin, Peter Gehler, and Bernt Schiele. 2d human pose estimation: New benchmark and state of the art analysis. In Proceedings of the IEEE Conference on computer Vision and Pattern Recognition, pages 3686-3693, 2014. +[3] Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Wang, and Jia-Bin Huang. A closer look at few-shot classification. In International Conference on Learning Representations, 2019. +[4] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 764-773, 2017. +[5] Mandar Dixit, Roland Kwitt, Marc Niethammer, and Nuno Vasconcelos. Aga: Attribute-guided augmentation. In CVPR, 2017. +[6] Ryan Farrell, Om Oza, Ning Zhang, Vlad I Morariu, Trevor Darrell, and Larry S Davis. Birdlets: Subordinate categorization using volumetric primitives and pose-normalized appearance. In 2011 International Conference on Computer Vision, pages 161-168. IEEE, 2011. +[7] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1126-1135. JMLR.org, 2017. +[8] Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4367-4375, 2018. +[9] Spyros Gidaris and Nikos Komodakis. Generating classification weights with cnn denoising autoencoders for few-shot learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 21-30, 2019. +[10] Pei Guo and Ryan Farrell. Aligned to the object, not to the image: A unified pose-aligned representation for fine-grained recognition. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1876-1885. IEEE, 2019. +[11] Junwei Han, Xiwen Yao, Gong Cheng, Xiaoxu Feng, and Dong Xu. P-cnn: Part-based convolutional neural networks for fine-grained visual categorization. IEEE transactions on pattern analysis and machine intelligence, 2019. +[12] Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In Proceedings of the IEEE International Conference on Computer Vision, pages 3018-3027, 2017. +[13] 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. +[14] Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pages 2017-2025, 2015. + +[15] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013. +[16] Tsung-Yu Lin, Aruni RoyChowdhury, and Subhransu Maji. Bilinear cnn models for fine-grained visual recognition. In Proceedings of the IEEE international conference on computer vision, pages 1449-1457, 2015. +[17] S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013. +[18] Akihiro Nakamura and Tatsuya Harada. Revisiting fine-tuning for few-shot learning. arXiv preprint arXiv:1910.00216, 2019. +[19] Lauren A Schmidt. Meaning and compositionality as statistical induction of categories and constraints. PhD thesis, Massachusetts Institute of Technology, 2009. +[20] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, pages 4077-4087, 2017. +[21] Yifan Sun, Liang Zheng, Yali Li, Yi Yang, Qi Tian, and Shengjin Wang. Learning part-based convolutional features for person re-identification. IEEE transactions on pattern analysis and machine intelligence, 2019. +[22] 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. +[23] 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 Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 595-604, 2015. +[24] A. Vedaldi, S. Mahendran, S. Tsogkas, S. Maji, B. Girshick, J. Kannala, E. Rahtu, I. Kokkinos, M. B. Blaschko, D. Weiss, B. Taskar, K. Simonyan, N. Saphra, and S. Mohamed. Understanding objects in detail with fine-grained attributes. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2014. +[25] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pages 3630-3638, 2016. +[26] C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. +[27] 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. +[28] Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7278-7286, 2018. + +[29] Davis Wertheimer and Bharath Hariharan. Few-shot learning with localization in realistic settings. In Computer Vision and Pattern Recognition (CVPR), 2019. +[30] Yi Yang and Deva Ramanan. Articulated human detection with flexible mixtures of parts. IEEE transactions on pattern analysis and machine intelligence, 35(12):2878-2890, 2012. +[31] Ning Zhang, Jeff Donahue, Ross Girshick, and Trevor Darrell. Part-based r-cnns for fine-grained category detection. In European conference on computer vision, pages 834-849. Springer, 2014. +[32] Ning Zhang, Ryan Farrell, and Trever Darrell. Pose pooling kernels for sub-category recognition. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 3665-3672. IEEE, 2012. +[33] Ning Zhang, Manohar Paluri, Marc'Aurelio Ranzato, Trevor Darrell, and Lubomir Bourdev. Panda: Pose aligned networks for deep attribute modeling. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1637-1644, 2014. +[34] Ning Zhang, Evan Shelhamer, Yang Gao, and Trevor Darryll. Fine-grained pose prediction, normalization, and recognition. arXiv preprint arXiv:1511.07063, 2015. +[35] Yizhe Zhu, Jianwen Xie, Zhiqiang Tang, Xi Peng, and Ahmed Elgammal. Learning where to look: Semantic-guided multi-attention localization for zero-shot learning. arXiv preprint arXiv:1903.00502, 2019. \ No newline at end of file diff --git a/revisitingposenormalizationforfinegrainedfewshotrecognition/images.zip b/revisitingposenormalizationforfinegrainedfewshotrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..438e499365bc6289462e7bd31071abd44aa20f47 --- /dev/null +++ b/revisitingposenormalizationforfinegrainedfewshotrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2edaee44c906e5313fa1b09c8ebbf4ed92960842c72ed47a297056f1e0f8b3b0 +size 453155 diff --git a/revisitingposenormalizationforfinegrainedfewshotrecognition/layout.json b/revisitingposenormalizationforfinegrainedfewshotrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cb6f9e0ff1e91d62ae4c5c3e81824e8aba50dc7f --- /dev/null +++ b/revisitingposenormalizationforfinegrainedfewshotrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53fbd6af00dac31f82e6e3ca1b9bc5b933fd2ade7a0af610f711fe92f9d6d828 +size 373508 diff --git a/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_content_list.json b/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2554b9072465a7c2e9409a9b5f3c7fd91261127a --- /dev/null +++ b/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61a4328f2376203be54d0ac494b6024850e99014ec6d3ef0a37712687d9c5b72 +size 85575 diff --git a/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_model.json b/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_model.json new file mode 100644 index 0000000000000000000000000000000000000000..38ebf88c6cbb135ba0acfd92e697677c9874065e --- /dev/null +++ b/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b540e05f322c8bc464e8fbf6d8710029e3ab151145756e21a58cd444fb07f6e +size 109248 diff --git a/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_origin.pdf b/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..38b0adaf525d780f1dc7cbc7da2144bfbd61a594 --- /dev/null +++ b/revisitingsaliencymetricsfarthestneighborareaundercurve/d5f4d1bd-1b96-4fa9-be93-923b03d6a240_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1b29ab0cc24764346b0e7827d1bfa2105696b4266d7cdb24d906d35ec4cb8dc +size 2173067 diff --git a/revisitingsaliencymetricsfarthestneighborareaundercurve/full.md b/revisitingsaliencymetricsfarthestneighborareaundercurve/full.md new file mode 100644 index 0000000000000000000000000000000000000000..787092f6497cc2915bda8dd9d3f30b05c01fe316 --- /dev/null +++ b/revisitingsaliencymetricsfarthestneighborareaundercurve/full.md @@ -0,0 +1,331 @@ +# Revisiting Saliency Metrics: Farthest-Neighbor Area Under Curve + +Sen Jia + +Ryerson University + +sen.jia@ryerson.ca + +Neil D. B. Bruce + +Ryerson University, Vector Institute + +bruce@ryerson.ca + +# Abstract + +In this paper, we propose a new metric to address the long-standing problem of center bias in saliency evaluation. We first show that distribution-based metrics cannot measure saliency performance across datasets due to ambiguity in the choice of standard deviation, especially for Convolutional Neural Networks. Therefore, our proposed metric is AUC-based because ROC curves are relatively robust to the standard deviation problem. However, this requires sufficient unique values in the saliency prediction to compute AUC scores. Secondly, we propose a global smoothing function for the problem of few value degrees in predicted saliency output. Compared with random noise, our smoothing function can create unique values without losing the existing relative saliency relationship. Finally, we show our proposed AUC-based metric can generate a more directional negative set for evaluation, denoted as Farthest-Neighbor AUC (FN-AUC). Our experiments show FN-AUC can measure spatial biases, central and peripheral, more effectively than S-AUC without penalizing the fixation locations. The generated negative samples are available at: https://github.com/ SenJia/Farthest-Neighbor-AUC. + +# 1. Introduction + +Extensive studies have been proposed to predict the most salient region within an image. Saliency methods can be roughly grouped into two categories, bottom-up and top-down. The former considers the visual stimuli of an image to determine the Regions Of Interest(ROIs); while the latter one assumes the ROI is task-dependent, prior knowledge plays a significant part in saliency prediction. With the recent development of Convolutional Neural Networks (CNNs), saliency prediction heavily relies on model-based algorithms which can be trained in an end-to-end fashion. A new question has emerged regarding what type of saliency features are the best design for applications, top-down or bottom-up? Hand-crafted or CNN-learned? + +The measurement of saliency is still challenging because the definition of "saliency" varies depending on the vi + +![](images/30b466c1faaabdc6687f4e90aa7d6c8b9e76130b50326e18710c33be5f9071f1.jpg) +Image + +![](images/ae41a2043b8a704b3bb5dd19e0089dbce07c9ae9f56b416c9f9b959ec4159dd0.jpg) +Fixation +Figure 1. A saliency sample from the SALICON dataset. + +![](images/36f2a07a4bc0299669e3b345d1cb98b98d02912e8f66e8d26f61e423a72f07e9.jpg) +Distribution + +sion task [2], so saliency algorithms can also be grouped by different taxonomies for different purposes [10, 16, 6]. In this paper, we follow the common problem setting in [29, 45], computational models are trained to predict the most salient region to the Human Visual System(HVS). Not only is this a common assumption to all the CNN-based methods [27, 9, 28, 34, 13, 12, 31, 24, 25], but it also can be used in an extremely wide range of applications [48, 1, 47, 44, 26, 22, 35]. However, it is still difficult to comprehensively evaluate saliency models due to the bias of each metric. For instance, the challenge of Large-Scale Scene Understanding [27] uses seven saliency metrics, Shuffled Area Under Curve (S-AUC), Information Gain (IG) [32], Normalized Scanpath Saliency (NSS) [38], Pearson's Correlation Coefficient (CC), AUC-Judd, SIMilarity (SIM) and Kullback-Leibler Divergence (KLD) [30]. Another public saliency benchmark, MIT300 [28], applies eight saliency metrics, AUC-Judd, AUC-Borji, S-AUC, NSS, CC, KLD, SIM and Earth Mover's Distance (EMD) [40]. The use of multiple measures indicates that it is difficult to evaluate a model from only one angle. Previous studies intended to categorize and compare those metrics, e.g., [39, 11] grouped the metrics into location-based and distribution-based. As shown in Figure 1, the location-based measure consists of a set of fixation locations captured by an eye tracker or mouse click. While the distribution of saliency is normally considered as a post-process on the raw data by applying a Gaussian filter. + +To evaluate a saliency model, one solution is to overcome the "disagreement" among the metrics. Kummerer et al. [32] proposed to optimize the saliency scale, center bias and spatial blurring jointly. But their post-process can hardly satisfy all the metrics simultaneously, the process requires all the compared models and optimization only uses the loss of IG. Later this idea was extended to a metric- + +tailored design [33], saliency models and saliency maps are decoupled so that one model can output different metric specific maps. However, their solutions are based on the assumption that all the metrics are able to evaluate saliency reasonably, the output should be optimized separately and specifically for each metric. In this work, we are more interested in investigating the differences among those metrics in theory. We believe some of the metrics may contain inherent drawbacks so that not necessarily all the metrics should be considered. The first contribution of this work is that we revisit the widely used saliency metrics based on [11], showing that the "balanced" metrics, NSS and CC, still have limitations in evaluating modern CNN-based systems. Saliency datasets have been created using their own choices of Gaussian standard deviation and a CNN model learns to fit this biased distribution, see Section 2. + +Center bias is a long-standing problem in saliency evaluation, simply placing a Gaussian distribution at the center could outperform a well-designed system on most of the metrics [46]. S-AUC is a common solution used by the SALICON and the MIT benchmarks, a negative set is sampled based on the positive from other images within the same dataset. The study [11] shows a centered Gaussian distribution can only achieve an S-AUC score of 0.5. However, S-AUC has a strong bias that it only considers negatives near the center, peripherally-favored systems can achieve higher scores [8]. In this paper, we propose a new saliency metric which introduces one more constraint on the spatial relationship between the positive and negative. We show that the distribution of all fixations can be interpreted as a 2D probability density distribution. Our method builds the negative set for each image by searching its farthest neighbors according to the distribution similarity, denoted as FN-AUC. We also propose a fast version of our FN-AUC in case the size of the dataset is too large. To compare with S-AUC, we propose a strategy to measure the quality of the sampled negative set, which takes the spatial relationship of both the center bias and the positive into account, see Section 3.2. Our experiment shows FN-AUC can draw a more reasonable negative set in order to penalize the center bias only without undermining the true positives, Section 4.3. + +Another contribution of this work is that we propose a global smoothing strategy in computing AUC metrics. Based on the MIT benchmark, it is problematic to compute the receiver operating characteristic (ROC) property when many locations share the same value magnitude, which could result in a lower performance as well. This is a scenario that is common for CNN based models which can produce near binary outputs. One solution could be jittering a map by adding small random noise, but this may break the relative saliency rank. We propose to apply a Gaussian filter using a relatively large standard deviation, the output is expected to cover all regions within a map. In this way, our + +
DatasetSize (Width by Height)σCC
Toronto [9]681 × 51120.998
MIT1003 [29](Min - Max)405 - 102424.998
CAT2000 [3]1920 × 108041.998
SALICON [27]640 × 48019.999
+ +Table 1. The attributes of the four saliency datasets. Gaussian processes with different standard deviations are used to generate the distribution ground-truth. + +method can generate a map with unique values for an AUC metric, meanwhile retaining the relative saliency relationship, see Section 2.3. + +# 2. Revisiting Saliency Metrics + +In this section, we first revisit the widely used saliency metrics based on previous studies [39, 8, 11]. We further investigate the impact of applying the balanced saliency metrics across datasets, NSS and CC. + +# 2.1. Distribution-based Metrics + +The distribution-based saliency metrics, SIM, CC, EMD and KLD, consider each saliency map as a distribution then the similarity between two maps can be measured based on a probabilistic view. The drawbacks of IG, SIM and KLD have already been studied in that they focus more on FNs than $\mathrm{FPs}^1$ which leads to a biased evaluation. While the EMD metric is sensitive to the sparsity of the map, a lower score can be obtained due to fewer bins requiring moving. The CC measure is recommended for penalizing FPs and FNs equally [11]. However, when comparing two distributions, the "shape" of each distribution also plays an important role (the choice of the Gaussian sigma $\sigma$ ). Especially for CNN-based saliency systems, a CNN model is designed to learn the distribution information from the training set, a lower performance may be achieved only because the test set is drawn from a different distribution. This is a common problem in practice because there is no standard on how to build the ground-truth, each dataset was built using a different $\sigma$ value. The Gaussian filter can be written as: + +$$ +g (m, n) = \frac {1}{2 \pi \sigma^ {2}} \cdot e ^ {- \frac {m ^ {2} + n ^ {2}}{2 \sigma^ {2}}} \tag {1} +$$ + +where $m$ and $n$ represent the distance from the current location and $\sigma$ denotes the standard deviation. We search the $\sigma$ value used by the four saliency datasets, Toronto[9], MIT1003[29], CAT2000[3] and SALICON [27], based on the highest CC score achieved. As we can see in Table 1, the $\sigma$ value used varies across those datasets. A high performance can be achieved simply because the distributions of the training and test sets are similar and vice versa. We believe the location of ROI should be considered more for saliency instead of the distribution, a good model should + +capture the correct region but the shape (or contrast) is less important. One can imagine that all the distribution-based metrics suffer from the inherent drawback of shape sensitivity and it is difficult to avoid the center bias problem, see Section 4. + +# 2.2. Location-based Metrics + +Location-based metrics do not rely on the distribution built by the Gaussian process(Equation 1). Similar to CC, NSS is the recommended metric due to its equal penalty on FPs and FNs [11]. However, NSS essentially considers all the fixation locations as positive and the others as negative, more FPs will be introduced when a larger $\sigma$ is applied on the training set. Our experiment validates this hypothesis by showing the highest NSS score is achieved when training on the setting of the smallest $\sigma$ , see Section 4.1. This bias of NSS also makes it challenging to evaluate models across datasets. + +The family of AUC metrics was criticized for ignoring FPs with small values [11]. But the FPs will be ignored only when its value is smaller than the smallest threshold (value at fixations). That is, in practice, the ignored FPs would be relatively small and this relative saliency is considered to be more important than absolute magnitudes [8]. One study [11] has shown that AUC metrics are robust to $\sigma$ , but this happens only when the highest value of prediction is a TP. Our experiment shows the AUC metric is also slightly affected by the choice of $\sigma$ , Section 4.1, but they are relatively more robust than CC and NSS. Nevertheless, the AUC metric is still the most promising way to overcome the center bias issue because we can directly sample negatives rather than considering distribution properties. Before discussing the center bias and demonstrating our method, we first show a potential problem in computing AUC metrics and our proposed global smoothing function in the next section. + +# 2.3. Global Smoothing Strategy + +As shown in Figure 1, there are different ways to represent the fixation ground-truth. Both of the maps can be considered as matrices, the distribution map can also be interpreted as a 2D probability function and the fixation map can be converted into a set of positive locations. In this work, we demonstrate our method using all interpretations of saliency. For clarity, we denote a matrix as $\mathbf{X}$ or $\mathbf{Y}$ (an image or the fixation map, the first and second graphs in Figure 1), a set of coordinates as $\mathcal{P}$ or $\mathcal{N}$ and the probability function as $f_{\mathbf{X}}$ (density or distribution maps, third graph in Figure 1) and they can be converted to each other, see Section 3.2. + +All the AUC-based metrics are computed by applying various thresholds on the map to draw an ROC curve. This can be problematic when different positive locations share + +![](images/a65190444f6a82d5916fab05b1fc1c688eb3f9f816e85deafdbf48174f86d0f4.jpg) +(a) Quantized + +![](images/5b83553bd60380b374e60ac7f9a8b5dbbd99cf56b4d3adc355bda3748aa62356.jpg) +Figure 2. (a) A quantized example map to show the problem of limited value degrees. (b) A random noise map, $\mathbf{O}$ , to jitter the output. (c) Our proposed global Gaussian map. $\mathbf{G}$ . + +![](images/cecf70794ef297a8febd897a551e560d96223d26bfdd09624311d188c74c4db6.jpg) +(b) Random Noise +(c) Global Gaussian + +![](images/a35dd213a337d96830c6dc2cea30eb5a4fb3526f15a7419bd9d7e0872530437b.jpg) +Figure 3. ROC curves of the three maps, the AUC scores are: Quantized(black): 0.573, Jittered with Random Noise(blue): 0.774, Jittered with Global Gaussian(red): 0.790 + +the same magnitude value. Let's denote an output map as $\hat{\mathbf{Y}}$ and we quantize the map into three value degrees to demonstrate this problem, $\{0,0.5,1\}$ . It is worth noting that this problem is not artificial since the output image format only contains 255 value degrees in most cases. One naive solution2 is to add a noise matrix $\mathbf{O}$ to the prediction map, $\hat{\mathbf{Y}} + \varepsilon \mathbf{O}$ , $O_i \sim \mathcal{U}(0,1)$ , $\mathbf{O} \in R^{h \times w}$ , where $O_i$ is $i$ th element of the noise matrix and $\varepsilon$ is a small number. But this operation may break the relative saliency relationship due to the randomness. + +In this work, we propose a global smoothing process to solve this problem. Instead of introducing random noise, we build a global Gaussian map, $\mathbf{G}$ , by applying Equation 1 using a relatively large standard deviation to diversify the value range, e.g., $\sigma = \min(h/4, w/4)$ . As shown in Figure 2, the noise matrix $\mathbf{O}$ used by [28] is similar to white Gaussian noise. Our global Gaussian map, $\mathbf{G}$ , covers most areas of the image for tie-breaking. From Figure 3, we can see that our proposed map $\mathbf{G}$ achieves a larger AUC compared with the random noise $\mathbf{O}$ . Note that this improvement is model-agnostic in evaluation, but we are hoping it results in a more meaningful prediction for a fair model comparison. This operation can be also combined with the widely used Gaussian post-process, which utilizes a small value of $\sigma$ to achieve "local" smoothness. Given the small performance differences between models, this operation may arguable help to disambiguate which are in fact the best performing. + +# 3. Center Bias and Spatial Metrics + +# 3.1. Center Bias + +The measurement of saliency has suffered from the center bias problem for a long time. There exist various causes for center bias, e.g., viewing strategy, initial orbital positions or motor bias. The main reason behind this may also be the photographer bias, humans tend to place the most interesting object or region near the center of an image [43, 36, 37, 42]. Therefore this tendency makes it difficult to show how good a saliency model is, a "faked" high performance may result from centrally biased methods. An early saliency study [36] has shown the stimuli in an image, e.g., color, intensity and orientation, are important in guiding attention. They also showed a discrepancy that the predictions are uniformly distributed within an image while the fixations are more likely to be near the center. This leads to a hypothesis that the low-level visual features have an indirect effect on attention, while the resulting 'objectness' is more significant [15]. Later an alternative explanation to their work was proposed by [4], the good performance achieved is because the objectness corresponds more with the center bias. + +We show the distribution maps by applying Equation 1 on all the fixation locations within each dataset in Figure 4. The center bias is intrinsic to HVS across the datasets such that a synthetic center bias map, fourth map in Figure 4 denoted as CB, can achieve a decent performance by covering most of the fixation locations. We believe the objective of saliency prediction is to model the mechanism of HVS regardless of what types of features should be used or what the bias could be. The metric applied is expected to differentiate a good system from a synthetic map. Most of the metrics suffer from this problem because they are not designed for spatial biases, especially for the distribution-based case. In contrast, the location-based metric seems more promising on this issue. + +The standard AUC metric was originally used for statistical analysis, and later was introduced to measure saliency performance by [7], also known as AUC-Judd [29], which considers all the non-fixated locations as negative. AUC-Borji [5] proposed to randomly sample negatives from all the non-fixated locations, which can be considered as a subset of AUC-Judd. But these two variants of AUC are not designed for the problem of center bias. S-AUC is a widely used metric specifically for the center bias, which samples negatives based on positive locations from other images within the same dataset. The assumption behind this is that the positives are also subject to a central Gaussian distribution so that they can be used to penalize the synthetic center map CB, see Figure 4. But this sampling strategy ignores the spatial relationship between the positive and negative, which may result in an "over-penalty" to TPs. + +![](images/d00ee955e194b0d4f0d97bfcc4a133448c09e6775f00f3dacc1070511f57a156.jpg) +Toronto +SALICON +CAT2000 +Center Bias +Figure 4. Distribution maps generated using all the fixations within each dataset and the center bias map from the MIT benchmark. + +Furthermore, S-AUC may favor an "anti-center" prediction, saliency methods [21, 41] that are biased to peripheral regions and can achieve a higher S-AUC score [8]. + +# 3.2. Farthest-Neighbor AUC + +Before we show our proposed FN-AUC, we first formalize AUC metrics in different representations and discuss their own focuses in evaluation. Let $\mathbf{X} \in R^{h \times w \times 3}$ and $\mathbf{Y} \in R^{h \times w}$ denote the input image and its fixation ground-truth (second image in Figure 1) respectively. The fixation map $\mathbf{Y}$ can be converted into a set of fixation locations, denoted as $\mathcal{F} = \{(m,n): \mathbf{Y}(m,n) = 1, m = 1 \ldots w, n = 1 \ldots h\}$ . The set of all the possible locations $\mathcal{S}$ can be formulated as $\mathcal{S} = \{(m,n): m = 1 \ldots w, n = 1 \ldots h\}$ , $\mathcal{F} \subseteq \mathcal{S}$ . When computing an AUC score, the positive set is $\mathcal{P} = \mathcal{F}$ , but the generation of the negative set varies depending on the AUC metric applied. For AUC-Judd, it considers all the non-fixated locations as negative, $\mathcal{N}^J = \{\forall l \in \mathcal{S}: l \notin \mathcal{P}\} \iff \mathcal{S} \setminus \mathcal{P}$ . For AUC-Borji, the negative set can be considered as applying Bernoulli sampling on $\mathcal{N}^J$ with a cardinality constraint, $\mathcal{N}^B = \{s \in \mathcal{N}^J: |\mathcal{N}^B| = |\mathcal{P}|\}$ , $\mathcal{N}^B \subseteq \mathcal{N}^J$ (a bijective function could be applied). It is obvious that both the AUC metrics actually focus on the same statistical property, but they can not overcome the center bias problem because no spatial information is utilized. + +For S-AUC, we build the positive set for the entire dataset by $\mathcal{P}_{all} = \{\mathcal{F}_1,\mathcal{F}_2,\dots ,\mathcal{F}_N\}$ , assuming there are $N$ samples in the dataset. The positive set of S-AUC is the same as AUC-Judd and AUC-Borji, $\mathcal{P} = \mathcal{F},\mathcal{P}\subseteq \mathcal{P}_{all}$ . For the negative set, S-AUC draws samples according to $\mathcal{N}^S = \{s\in \mathcal{P}_{all}:s\notin \mathcal{P},|\mathcal{N}^S | = |\mathcal{P}|\}$ . It is interesting to see that both S-AUC and AUC-Borji sample negatives from other sets, $\mathcal{P}_{all}$ and $\mathcal{N}^J$ respectively using the Bernoulli sampling process. But S-AUC implicitly assumes that the set $\mathcal{P}_{all}$ is spatially subject to a centered Gaussian distribution (empirically validated by Figure 4) so that the sampled negatives can be used to penalize the center bias. But AUC-Judd and AUC-Borji do not make use of this spatial information. + +Given the size of the image $(h,w)$ , we can easily "vectorize" the total positive set $\mathcal{P}_{all}$ into a fixation map by first initializing a zero matrix, $\mathbf{Y}_{\mathrm{all}} = \mathbf{0} \in R^{h \times w}$ , then $\mathbf{Y}_{\mathrm{all}}(m,n) = 1 : \forall (m,n) \in \mathcal{P}_{all}$ , let $v(\cdot)$ denote this "vectorization" conversion. A Gaussian filter (Equation 1) is applied on the map $\mathbf{Y}_{\mathrm{all}}$ to build the distribution map $f_{\mathbf{Y}_{\mathrm{all}}}$ for each dataset as shown in Figure 4. Al + +![](images/af217638b06696c84da09e15e503dc75412a29915e92b3aff808d8dd45ce9f9d.jpg) + +![](images/8001eb344c4762ca5a2cc17ff095977ecda352844dcd1716f36be97ee8300ba2.jpg) +Figure 5. Diagram of our proposed FN-AUC vs S-AUC, our method aims at sampling a more directional negative set. +S-AUC +Figure 6. Distribution maps of the negative set sampled by S-AUC and FN-AUC, with different numbers of neighbors on the Toronto dataset. + +![](images/f39acf4aedcd5cb758131dcbf50a6d99aa1a45b69925ce9dd32c9fa8a289477b.jpg) +FN-AUC(K=5) + +![](images/40c391e7bd98115df01eb24fd8a02407c5dd769cc92a2a240ef057d065166cd1.jpg) +FN-AUC(K=20) + +![](images/87e9fcb7663d5ce16ee6bfab831a2b4f250e1b9d90dcd374881453a70f85c86f.jpg) +FN-AUC(K=50) + +![](images/6965f8f980d49e166275784420a7f52da35de877824c4accf6da9e5fe1af8f8d.jpg) +FN-AUC(K=70) + +though the distribution map is a matrix, it can be interpreted as a 2D probability density function given the constraint $\sum_{m=1}^{h}\sum_{n=1}^{w}f_{\mathbf{Y}_{\mathrm{all}}}(m,n) = 1$ . In this way, the density maps in Figure 4 can be viewed as the probability function of the S-AUC sampling process. Although each element in the negative set $\mathcal{N}^S \subseteq \mathcal{P}_{all}$ is drawn by Bernoulli sampling, spatially it can be interpreted as a Poisson sampling process such that the sampled elements have a higher probability to be located near the center (equal probability for sampling). + +Given the synthetic center bias map $\mathbf{CB}$ (as shown in Figure 4) and its probability function $f_{\mathbf{CB}}$ , we can reformulate the center bias problem in terms of the distribution similarity between $f_{\mathbf{CB}}$ and $f_{\mathbf{Y}_{\mathrm{all}}}$ . The synthetic map is designed to "mimic" the distribution of the total fixations as a baseline such that the distance between the distributions should be low or minimized, $\arg \min(d(f_{\mathbf{CB}}, f_{\mathbf{Y}_{\mathrm{all}}}))$ . The S-AUC metric can penalize the center bias because the probability distribution of $f_{v(\mathcal{N}^S)}$ is similar to $f_{\mathbf{CB}}$ , given that $\mathcal{N}^S$ is sampled from $\mathcal{P}_{all}$ . + +The S-AUC metric only considers global position information that the negative sample should be near the center, but it ignores the relative spatial relationship between the positive and negative. The positive set is also a subset of the total $\mathcal{P} \subseteq \mathcal{P}_{all}$ , which means spatially the probability function of $f_{v(\mathcal{N}^S)}$ also overlaps with $f_{v(\mathcal{P})}$ . This may lead to an over-penalty on the TP rate and also explains why S-AUC blindly favors peripherally-focused methods [8]. To solve this problem, we propose to not only make use of the global information, but also take the relative spatial rela + +tionship into account. The sampled negative set should be able to penalize the center bias map CB meanwhile without affecting the positive set. It is easy to formulate this constraint in the representation of a probability function, $\arg \max (d(f_{v(\mathcal{P})},f_{v(\mathcal{N}^{FN})}))$ , the sampled negative set by FN-AUC should be far apart from the positive locations. We visually show the relationship between the negative sets drawn by S-AUC and our method in Figure 5. The negative set of S-AUC is near the center, which overlaps with the positive. While our method intends to avoid the positive locations but still sample within the area of the synthetic map CB. + +# Algorithm 1 Farthest-Neighbor AUC + +Input: $(\mathbf{X_i},\mathbf{Y_i})$ ,ith Data Sample in the dataset. $\mathcal{P}_{all} = \{\mathcal{F}_1,\mathcal{F}_2,\dots ,\mathcal{F}_N\}$ , a set contains all the fixation locations within the dataset. + +Output: $\mathcal{N}_i^{FN}$ the negative set for $i$ th sample. + +1: Initialize an empty list, denoted as $L$ . +2: for $j = 1$ to $N$ do +3: if $i \neq j$ then +4: $d_{j} = d(f_{v(\mathcal{F}_{i})},f_{v(\mathcal{F}_{j})})$ +5: add $(d_j, \mathcal{F}_j)$ to $L$ . +6: Sort $L$ in descending order based on $d_{j}$ . $\triangleright$ suppose $d(\cdot ,\cdot)$ is a similarity measure. +7: Add the associated fixation set to the $\mathcal{N}_i^{FN}$ based on the top $K$ elements in $L$ , $\mathcal{N}_i^{FN} = \{\mathcal{F}_k : (d_k, \mathcal{F}_k) \in L, k = 1 \dots K\}$ . +8: return $\mathcal{N}^{FN}$ + +We show how our FN-AUC samples the negative set $\mathcal{N}^{FN}$ in Algorithm 1. The negative set consists of fixations from the neighbors that are least similar to the positive set, i.e. the farthest neighbors. Then we can sample from this negative set to have the same cardinality as the positive, $|\mathcal{N}^{FN}| = |\mathcal{P}|$ . It is obvious that the FN-AUC sampling process has a complexity of $O(n)$ . It is feasible to apply FN-AUC on a small dataset, e.g., Toronto, but it becomes problematic for large-scale datasets, e.g., SALICON. We also propose a fast version of FN-AUC for better scalability. Normally the number of fixations of each image is similar within one dataset. We can select only one farthest neighbor, $K = 1$ in Algorithm 1 and omitting the cardinality constraint. More importantly, we can set an empirical threshold to select the first matched element without iterating over the entire dataset, e.g., a CC score below zero (inversely related). One extreme case could be that there exists one sample whose positive set is near the corner, every other sample may select it as the farthest neighbor such that FP rate is always zero. In this case, increasing the number of neighbors $K$ can deliver a more robust sampling process. However, we did not experience this problem on the datasets even applying $K = 5$ . When $K$ equals to the total number of the images within a dataset ( $K = N - 1$ ), FN- + +![](images/25afb704afbc38197812b7b9f410bf4a281308fe4d41051fbb7521669b957da2.jpg) +Pos + +![](images/840194da7e6ada7a7e5b94b05a28f69c1d23d6429bda78bcb7eec29232b9cce5.jpg) +S(.769.758.987) + +![](images/96ce6bcb935e11d2e3eee4483e071fc14c19554154391c6b8a2448f279a032da.jpg) +S(.812.772.951) + +![](images/d724be91a1e002ca9db648dd7fa0d8857de5030eba41346351751b6942b09036.jpg) +S(.779, .798, 1.025) + +![](images/e3435991a1b05d851474b6fb24c8ada0b021c05db23026f59cdd567adddbe699.jpg) + +![](images/bc6472b49bb11692b8a70368dbaead5c4598cbe715e641d243203101cc9f51ad.jpg) + +![](images/bf187be6737eb66b95276d15ec4667b96b4363f7d53be42ff25c546a5deaa4c3.jpg) + +![](images/1f46c72fcccfb108bc4c7caa073bfa77cc21c072018bed0ffb6c3d93307c3030.jpg) + +![](images/f7bd12b3e97f7bdf5346a0b79b410b59cb6a77c23a47a7e2b0a3e00a9af2b90c.jpg) +Pos + +![](images/2c0538bb7d52e39445dddd1ab13f1082a3d9cd626ff2567dd4eb35b2378f3a24.jpg) +S(0.561, 0.687, 1.223) + +![](images/00892e943fec1c2f5ad7c1792b81d5cfba6948f6cc6afabc716365b4568d7688.jpg) +S(0.567, 0.624, 1.102) +Figure 7. The negative set sampled by S-AUC and FN-AUC. The first column is the distribution map of positive locations. Columns 2-4 are negative maps by S-AUC, column 5-7 are negative maps by FN-AUC. The last column is the final output map of FN-AUC, sampled from columns 5-7. The top row is a sample from the Toronto dataset drawn using Algorithm 1, while the bottom is from the SALICON dataset drawn using the fast version of FN-AUC $(K = 3, CC < 0)$ . The annotation represents $(\beta, \gamma, \gamma/\beta)$ . + +![](images/923e4590285b2f59079bc61fa50085d8befd6cb0ca6c31841f9d368acdeda77c.jpg) +S(.578, .627, 1.085) + +![](images/fce6e478743c01c100d922d22a13f9b7f45e99fd4e077dccffe0e04f8e6d4f53.jpg) +FN(.614.552.899) +FN(0.791, 0.561, 0.710) + +![](images/4474089d4abdd2697a476ee9d2b42ee329a624238918700216002e0b096f4179.jpg) +FN(.648.631.974) +FN(0.751, 0.391, 0.520) + +![](images/81c82be9289dbec33ec181c95605046db06f8bfcd255bdeebfc71686ac239cf2.jpg) +FN(.780.689.884) +FN(0.829, 0.579, 0.698) + +![](images/163189fc58c9a2cc1ed661034e89b90ceb899e1a58ef09bdd33005038466c17b.jpg) +Neg(.649, .494, .761) +Neg(0.802, 0.529, 0.659) + +AUC will reduce to S-AUC by sampling from $\mathcal{P}_{all}$ . That is the larger value of $K$ , the more we penalize the center bias map, we can see the effect of this trade-off of $K$ in Figure 6. + +To compare with S-AUC, we propose to measure the quality of the negative set in two terms: 1) considering the negative set as positive locations and the center bias map CB as a prediction to measure the performance, hoping that a high score (e.g., CC or AUC) can be achieved so that the negative set can penalize CB. 2) considering the negative set as a prediction map $(f_{v(\mathcal{N})})$ to measure its performance on the ground-truth $\mathcal{P}$ , a low score is expected so that the negative set has little impact on the positive. Let's denote these two measures as $\uparrow \beta$ (the higher the better) and $\downarrow \gamma$ (the lower the better) respectively, we also show the ratio $\downarrow \gamma / \beta$ as an indicator of the quality. + +We can visually check the negative sets of $\mathcal{N}^S$ and $\mathcal{N}^{FN}$ in Figure 7 (presented in distribution for visualization). Unsurprisingly, the random samples from S-AUC, columns 2-4, tend to locate near the center, which leads to a higher $\beta$ value. But S-AUC dose not take the relative spatial relationship into account, the sampled negative map also largely overlaps with the positive, which results in a higher $\gamma$ value as well. While the three negative candidates drawn by FN-AUC(columns 5-7) try to avoid penalizing the positive, therefore a lower $\gamma$ can be achieved. Moreover, the negative set still intersects with the center bias map, because the samples are drawn from $\mathcal{P}_{all}$ whose 2D distribution is similar to $f_{\mathrm{CB}}$ . The final output negative set (the last column) sampled from the neighbors also achieves low scores of $\gamma$ and $\gamma/\beta$ . It is interesting to see that our proposed FN-AUC has a more significant effect when evaluating on the SALICON dataset. The maps of S-AUC(bottom row) have ratio values of $\gamma/\beta > 1$ , which indicates the negative set is penalized more on the positive over the center bias. The reason behind this is that the fixations of this dataset are more spread-out covering almost the whole image, see Figure 4. While our method can still generate more directional negative sets achieving low $\gamma/\beta$ values. (More examples are shown in Figure 1 in the supplementary material.) + +# 4. Experiment + +Implementation Details: SALICON is the largest saliency dataset. Its training set SALICON-train contains 10,000 images with a resolution of $480 \times 640$ for training. We train CNN models on SALICON-train and report result on SALICON-val and the other datasets as shown in Table 1. The Toronto dataset has a similar image size to SALICON, so we simply resize the Toronto dataset during evaluation. But for MIT1003 and CAT2000, the ratio of the image size is completely different from SALICON. We apply the padding strategy used in [13, 12], each image has been resized and padded to keep the same ratio (3/4) as the input. + +The network used is the ResNet-50 model [20], which has been pretrained on the ImageNet dataset. We simply apply the multi-level strategy used in [12, 31, 25] on the model, the side outputs from $\{conv1, conv10, conv22, conv40, conv49\}$ are combined to generate the final prediction. The initial learning rate was set to 0.1 with a weight decay of $1e^{-4}$ . The total number of training epochs was 10 and we reduced the learning rate every three epochs by multiplying by a factor of 0.1. The batch size was set to 8 and stochastic gradient descent was used to update the model after computing the mean squared error as the loss. + +Negative Set of FN-AUC: To compute FN-AUC scores, we first build the negative set $\mathcal{N}^{FN}$ for each dataset. The metric of CC was used to compare the two distributions however other similarity measures can also be applied. To compare with S-AUC, we build a more directional negative set for FN-AUC in this experiment, $K = 5$ , and the final negative set is randomly drawn from the neighbors such that the number of elements is the same as the positive set. For Toronto, MIT1003 and CAT2000, we used the standard procedure as shown in Algorithm 1. For SALICON, we applied the fast version of FN-AUC due to its large size with selected candidates chosen according to the first $K = 5$ neighbors satisfying the requirement of $CC < 0$ . An optimal way to choose $K$ could be based on the average ratio of $\gamma/\beta$ across the entire dataset. + +
DatasetMetricσ = 10σ = 20σ = 30σ = 40σ = 50Deviation
Toronto σ=20CC0.6840.6940.6840.6690.6470.016
NSS2.0161.9381.8391.7541.6650.125
AUC-J0.8520.8560.8550.8530.8540.001
AUC-B0.8100.8280.8370.8400.8420.011
S-AUC0.7130.7170.7130.7050.6940.008
FN-AUC0.8050.8170.8240.8240.8200.006
CAT2000 σ=41CC0.5390.5560.5560.5580.5590.007
NSS1.6881.6971.6681.6551.6410.020
AUC-J0.8460.8530.8540.8590.8640.005
AUC-B0.8140.8370.8440.8520.8600.015
S-AUC0.7020.7160.7190.7250.7320.010
FN-AUC0.7040.7160.7160.7190.7170.005
MIT1003 σ=24CC0.6230.6100.5860.5580.5320.033
NSS2.4972.3302.1752.0241.9060.210
AUC-J0.8970.8990.8980.8970.8950.001
AUC-B0.8600.8730.8790.8800.8800.007
S-AUC0.8070.8160.8160.8120.8090.003
FN-AUC0.7580.7780.7880.7880.7830.011
SALICON σ=19CC0.8430.8630.8600.8390.8120.018
NSS1.8951.8321.7571.6681.5800.112
AUC-J0.8580.8590.8570.8530.8480.004
AUC-B0.8110.8340.8430.8450.8420.012
S-AUC0.7810.7990.8050.8040.7990.008
FN-AUC0.8330.8570.8680.8670.8610.012
+ +Table 2. CNN models trained on ground-truth maps built using different $\sigma$ values. The $\sigma$ value used by each test set is shown. The highest score of each row is highlighted in bold. The standard deviation shows how robust each metric is to the change of $\sigma$ . (AUC-J for AUC-Judd and AUC-B for AUC-Borji.) + +
CC0.018NSS0.116AUC-J0.002
AUC-B0.011S-AUC0.007FN-AUC0.008
+ +# 4.1. The choice of $\sigma$ + +As discussed in Section 2, the distribution map of ground-truth varies according to the choice of $\sigma$ . In this experiment, we show how this problem affects CNN-based systems when evaluating across datasets. Five different $\sigma$ values $\{10, 20, 30, 40, 50\}$ are applied on SALICON-train to build ground-truth for training using Equation 1. Then five CNN models with the same architecture are trained on each of the created ground-truth distributions. We evaluate the five models on different test sets using different metrics to show how sensitive those metrics are to the choice of $\sigma$ . A metric can be considered biased if a score for one model clearly outperforms or underperforms compared to the other models for the same metric since that the model architecture is the same. + +We report the results of the five models in Table 2. We can see that a high score of CC tends to be achieved by the matched distribution when similar $\sigma$ values are applied. The NSS metric favors a small $\sigma$ value and thus, less FPs are produced (a more sparse prediction). This experiment validates our discussion in Section 2. NSS is sensitive to the $\sigma$ value applied on the training set while CC relies more on the $\sigma$ difference between the training and test set. A potential risk that may further limit the practical use of distribution-based metrics is that interpolation operations (e.g., bi-linear) can also affect distribution properties. As shown in Table 2, the AUC metrics are also sensitive to the + +Table 3. The average deviation for each metric across datasets. + +
MethodCCNSSAUC-JAUC-BS-AUCFN-AUC
CB0.3970.9690.8020.7860.5150.607
Itti [23]0.2700.8200.6930.6770.6380.701
AIM [9]0.3120.8960.7250.7200.6590.725
GBVS [19]0.5691.5190.8290.8190.6360.747
SUN [46]0.2150.6500.6650.6520.6100.654
SDSR [41]0.4031.0960.7630.7560.6970.786
CAS [18]0.4491.2710.7810.7680.6880.781
AWS [17]0.4661.3410.7870.7750.7070.789
SWD [14]0.5751.5230.8360.8280.6320.741
ImageSig [21]0.3961.0850.7620.7490.6790.753
CNN0.6941.9380.8560.8280.7170.817
+ +Table 4. Comparison of different saliency methods on the Toronto dataset. + +choice of $\sigma$ . For the AUC metrics, AUB-Borji, S-AUC and FN-AUC, there exists a sampling process which may deliver slight randomness into evaluation. We report the deviation of each setting in the last column of Table 2 and its average score across datasets in Table 3. We can see that the sensitivity of AUC metric is relatively smaller than CC and NSS. Even though AUC-Judd seems correlated with $\sigma$ from Table 2, a low deviation score denotes that it does not show which setting has a clear advantage. Larger deviations of CC and NSS may result from their value range or the computation process and due to this, they may deliver false intuitions with respect to the quality of the model. + +# 4.2. Spatial Biases + +The inner workings of NNs are still under exploration but it is established that the features learned by NNs contain high-level objectness, therefore CNN-based methods may share the same spatial bias as discussed in [4]. Our proposed metric aims at solving the spatial bias problem, so we compare different types of "early" visual features(low-level) as well as the center bias map (Figure 4) using our metric. The center bias map, CB, is taken from the MIT benchmark. The traditional saliency methods for comparison include: Itti [23], AIM [9], GBVS [19], SUN [46], SDSR [41], CAS [18], AWS [17], SWD [14] and ImageSig(RGB) [21]. It has been shown that those traditional methods utilize various low-level features [8, 4, 46], which leads to relatively different predictions. Some of the hand-crafted methods are considerably time consuming (e.g., CAS needs more than 20 seconds to process each image due to its multiscale design). Therefore we only focus on the smallest dataset, Toronto, for simplicity. We take the model $(\sigma = 20)$ from the last experiment as a CNN baseline because it is the closest to the default settings of Toronto and SALICON. The metrics can be roughly categorized into biastolerant (CC, NSS, AUC-J, AUC-B) and bias-sensitive (S-AUC, FN-AUC). + +As shown in Table 4 and Figure 8, we can see that the CNN model achieves the best performance on all the metrics, including FN-AUC. While it is trivial to compare high-level vs low-level features in this experiment, we are more interested in how the metrics measure the intrinsic spatial + +![](images/eaf20779044b887cf8141ae03dc67ae47456f2c4edd70e5e10d462f15f231e71.jpg) +Figure 8. Bar graph of the compared methods using different saliency metrics. + +![](images/41a907df6315e4d98f59086355af13f37b327d12ccdbf82f4d3391d053de194a.jpg) +Image +Prediction +Fixation +FN-Negative +Figure 9. Samples which have a large score difference between S-AUC and FN-AUC. From top to bottom (S-AUC, FN-AUC), 1:(0.573, 0.762), 2:(0.665, 0.867), 3:(0.540, 0.379), 4:(0.445, 0.285). The third column is the ground-truth distribution (positive) and the fourth column is the negative map drawn by FN-AUC. + +bias each method has. The first row, CB, indicates a Gaussian map can achieve decent scores on most of the metrics. The CB map achieves higher FN-AUC (0.607) than S-AUC (0.515) because S-AUC only penalizes center bias as discussed in Section 3.1 (all the methods can outperform random guess 0.5 on S-AUC). Moreover, Itti, AIM and SUN, all achieve lower performances on the bias-tolerant metrics, but our FN-AUC can still distinguish those methods from CB. From the study [45], the methods GBVS and AWS are the least and the most spatially consistent algorithms respectively. Therefore GBVS outperforms AWS on the bias-tolerant metrics, but AWS obtains higher scores on both of the bias-sensitive metrics, S-AUC and FN-AUC. We can also see this contrast between GBVS and other relatively consistent methods, SDSR, CAS and ImageSig. Moreover, our experiment shows the SWD method is even more spatially inconsistent than GBVS. When comparing with "early" vision, we are not surprised by the high perfor + +mance achieved by the CNN due to its ability to learn high-level features. One thing that should be noted is although CNNs may tend to output center-favored maps due to its "objectness" knowledge, the CNN model still outperforms GBVS and SWD by a large margin. Both S-AUC and FN-AUC can penalize the spatial bias and we further investigate the difference between the two metrics in the next section. + +# 4.3. Case Discussion + +Our FN-AUC differs from S-AUC in that we also consider the relative relationship with the positive set. It is important to visually check the samples on which the metrics disagree with each other the most. We show samples which achieve a large score difference between S-AUC and FN-AUC in Figure 9. We can see from the scores, the top five rows achieve higher FN-AUC than S-AUC. From the third column, we can see that the ground-truth is near the center, but S-AUC will penalize the prediction regardless of whether it is a reasonable output or not. In contrast, our proposed FN-AUC achieves a higher score because the sampled negative is a more directional, rather than blind penalty. From the bottom four rows of Figure 9, we can see that the S-AUC score is higher than FN-AUC. We can see that the ground-truth is still near the center, but the predicted saliency region is near the periphery. In this case, those predictions should be considered as low-scoring outputs. But the negative set sampled by S-AUC will always be near the center as shown in Figure 4 so that it cannot penalize the FPs. FN-AUC has a higher probability to penalize this type of prediction because it takes the spatial relationship into account. (More examples are shown in Figure 2 in the supplementary material.) + +# 5. Conclusion + +In this paper, we have shown that the NSS and CC metrics still suffer from sensitivity to the choice of the $\sigma$ value. This indicates that they can not fairly evaluate the CNN-based system on commonly used saliency datasets. NSS has been shown to be sensitive to the training set only, while CC is affected by the difference of $\sigma$ applied on the training and the test sets. The AUC metrics are relatively more robust to the change of $\sigma$ . We delved into the AUC metrics based on different mathematical representations to show the drawback of S-AUC. Our proposed FN-AUC metric considers the relative position information so that a more directional negative set can be built to penalize the center bias only. Finally, our proposed global smoothing strategy can deliver a more stable AUC computation by retaining the saliency relationship. By no means can our method completely solve the problem of saliency evaluation, but our work sheds new light on the drawbacks of existing metrics as well as introduces a new sampling process. + +# References + +[1] C. O. Ancuti, C. Ancuti, and P. Bekaert. Enhancing by saliency-guided decolorization. In Proceedings of the 2011 IEEE Conference on Computer Vision and Pattern Recognition, CVPR '11, pages 257-264, Washington, DC, USA, 2011. IEEE Computer Society. 1 +[2] Jonathan Boisvert and Neil Bruce. Predicting task from eye movements: On the importance of spatial distribution, dynamics, and image features. Neurocomputing, 207, 05 2016. 1 +[3] Ali Borji and Laurent Itti. CAT2000: A large scale fixation dataset for boosting saliency research. CoRR, abs/1505.03581, 2015. 2 +[4] Ali Borji, Dicky N. Sihite, and Laurent Itti. Objects do not predict fixations better than early saliency: A re-analysis of Einhäuser et al.'s data. Journal of Vision, 13(10):18-18, 08 2013. 4, 7 +[5] A. Borji, D. N. Sihite, and L. Itti. Quantitative analysis of human-model agreement in visual saliency modeling: A comparative study. IEEE Transactions on Image Processing, 22(1):55-69, Jan 2013. 4 +[6] A. Borji, H. R. Tavakoli, D. N. Sihite, and L. Itti. Analysis of scores, datasets, and models in visual saliency prediction. In 2013 IEEE International Conference on Computer Vision, pages 921-928, Dec 2013. 1 +[7] Neil D.B. Bruce and John K. Tsotsos. A statistical basis for visual field anisotropies. Neurocomputing, 69(10):1301 - 1304, 2006. Computational Neuroscience: Trends in Research 2006. 4 +[8] Neil D.B. Bruce, Calden Wloka, Nick Frosst, Shafin Rahman, and John K. Tsotsos. On computational modeling of visual saliency: Examining what's right, and what's left. Vision Research, 116:95 - 112, 2015. Computational Models of Visual Attention. 2, 3, 4, 5, 7 +[9] Neil D. B. Bruce and John K. Tsotsos. Saliency based on information maximization. In Proceedings of the 18th International Conference on Neural Information Processing Systems, NIPS'05, pages 155-162, Cambridge, MA, USA, 2005. MIT Press. 1, 2, 7 +[10] Z. Bylinskii, E.M. DeGennaro, R. Rajalingham, H. Ruda, J. Zhang, and J.K. Tsotsos. Towards the quantitative evaluation of visual attention models. Vision Research, 116:258 - 268, 2015. Computational Models of Visual Attention. 1 +[11] Z. Bylinskii, T. Judd, A. Oliva, A. Torralba, and F. Durand. What do different evaluation metrics tell us about saliency models? IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(3):740-757, March 2019. 1, 2, 3 +[12] Marcella Cornia, Lorenzo Baraldi, Giuseppe Serra, and Rita Cucchiara. A deep multi-level network for saliency prediction. CoRR, abs/1609.01064, 2016. 1, 6 +[13] M. Cornia, L. Baraldi, G. Serra, and R. Cucchiara. Predicting human eye fixations via an LSTM-based saliency attentive model. IEEE Transactions on Image Processing, 27(10):5142-5154, Oct 2018. 1, 6 +[14] L. Duan, C. Wu, J. Miao, L. Qing, and Y. Fu. Visual saliency detection by spatially weighted dissimilarity. In CVPR 2011, pages 473-480, June 2011. 7 + +[15] Wolfgang Einhäuser, Merrielle Spain, and Pietro Perona. Objects predict fixations better than early saliency. Journal of Vision, 8(14):18-18, 11 2008. 4 +[16] Simone Frintrop, Erich Rome, and Henrik I. Christensen. Computational visual attention systems and their cognitive foundations: A survey. ACM Trans. Appl. Percept., 7(1):6:1-6:39, Jan. 2010. 1 +[17] A. Garcia-Diaz, X.R. Fdez-Vidal, X.M. Pardo, and R. Dosil. Saliency from hierarchical adaptation through decorrelation and variance normalization. Image and Vision Computing, 30(1):51-64, 2012. 7 +[18] S. Goferman, L. Zelnik-Manor, and A. Tal. Context-aware saliency detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(10):1915-1926, Oct 2012. 7 +[19] Jonathan Harel, Christof Koch, and Pietro Perona. Graph-based visual saliency. In Proceedings of the 19th International Conference on Neural Information Processing Systems, NIPS'06, pages 545-552, Cambridge, MA, USA, 2006. MIT Press. 7 +[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. 6 +[21] X. Hou, J. Harel, and C. Koch. Image signature: Highlighting sparse salient regions. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(1):194-201, Jan 2012. 4, 7 +[22] Yuan-Ting Hu, Jia-Bin Huang, and Alexander G. Schwing. Unsupervised video object segmentation using motion saliency-guided spatio-temporal propagation. CoRR, abs/1809.01125, 2018. 1 +[23] L. Itti, C. Koch, and E. Niebur. A model of saliency-based visual attention for rapid scene analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(11):1254-1259, Nov 1998. 7 +[24] Saumya Jetley, Naila Murray, and Eleonora Vig. End-to-end saliency mapping via probability distribution prediction. CoRR, abs/1804.01793, 2018. 1 +[25] Sen Jia and Neil D.B. Bruce. Eml-net: an expandable multilayer network for saliency prediction. Image and Vision Computing, page 103887, 2020. 1, 6 +[26] S. Jia, Y. Zhang, D. Agrafiotis, and D. Bull. Blind high dynamic range image quality assessment using deep learning. In 2017 IEEE International Conference on Image Processing (ICIP), pages 765-769, Sept 2017. 1 +[27] Ming Jiang, Shengsheng Huang, Juanyong Duan, and Qi Zhao. Silicon: Saliency in context. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. 1, 2 +[28] Tilke Judd, Frédo Durand, and Antonio Torralba. A benchmark of computational models of saliency to predict human fixations. 01 2012. 1, 3 +[29] T. Judd, K. Ehinger, F. Durand, and A. Torralba. Learning to predict where humans look. In 2009 IEEE 12th International Conference on Computer Vision, pages 2106-2113, Sep. 2009. 1, 2, 4 +[30] S. Kullback and R. A. Leibler. On information and sufficiency. Ann. Math. Statist., 22(1):79-86, 03 1951. 1 + +[31] Matthias Kümmerer, Lucas Theis, and Matthias Bethge. Deep gaze i: Boosting saliency prediction with feature maps trained onImagenet. CoRR, abs/1411.1045, 2014. 1, 6 +[32] Matthias Kümmerer, Thomas S. A. Wallis, and Matthias Bethge. Information-theoretic model comparison unifies saliency metrics. Proceedings of the National Academy of Sciences, 112(52):16054-16059, 2015. 1 +[33] Matthias Kümmerer, Thomas S. A. Wallis, and Matthias Bethge. Saliency benchmarking made easy: Separating models, maps and metrics. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision – ECCV 2018, pages 798–814, Cham, 2018. Springer International Publishing. 2 +[34] Matthias Kummerer, Thomas S. A. Wallis, Leon A. Gatys, and Matthias Bethge. Understanding low- and high-level contributions to fixation prediction. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017. 1 +[35] Shengxi Li, Mai Xu, Yun Ren, and Zulin Wang. Closed-form optimization on saliency-guided image compression for hevc-msp. Trans. Multi., 20(1):155-170, Jan. 2018. 1 +[36] Derrick Parkhurst, Klinton Law, and Ernst Niebur. Modeling the role of salience in the allocation of overt visual attention. Vision Research, 42(1):107 - 123, 2002. 4 +[37] Derrick Parkhurst and Ernst Niebur. Scene content selected by active vision. Spatial vision, 16:125-54, 02 2003. 4 +[38] Robert J. Peters, Asha Iyer, Laurent Itti, and Christof Koch. Components of bottom-up gaze allocation in natural images. Vision Research, 45(18):2397 - 2416, 2005. 1 +[39] N. Riche, M. Duvinage, M. Mancas, B. Gosselin, and T. Dutoit. Saliency and human fixations: State-of-the-art and study of comparison metrics. In 2013 IEEE International Conference on Computer Vision, pages 1153-1160, Dec 2013. 1, 2 +[40] Y. Rubner, C. Tomasi, and L. J. Guibas. A metric for distributions with applications to image databases. In Sixth International Conference on Computer Vision (IEEE Cat. No.98CH36271), pages 59-66, Jan 1998. 1 +[41] Hae Jong Seo and Peyman Milanfar. Static and space-time visual saliency detection by self-resemblance. Journal of Vision, 9(12):15-15, 11 2009. 4, 7 +[42] Benjamin W. Tatler, Roland J. Baddeley, and Iain D. Gilchrist. Visual correlates of fixation selection: effects of scale and time. Vision Research, 45(5):643 - 659, 2005. 4 +[43] Po-He Tseng, Ran Carmi, Ian G. M. Cameron, Douglas P. Munoz, and Laurent Itti. Quantifying center bias of observers in free viewing of dynamic natural scenes. Journal of Vision, 9(7):4-4, 07 2009. 4 +[44] Fei Wang, Mengqing Jiang, Chen Qian, Shuo Yang, Cheng Li, Honggang Zhang, Xiaogang Wang, and Xiaou Tang. Residual attention network for image classification. CoRR, abs/1704.06904, 2017. 1 +[45] C. Wloka and J. Tstotsos. Spatially binned roc: A comprehensive saliency metric. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 525-534, June 2016. 1, 8 +[46] Lingyun Zhang, Matthew H. Tong, Tim K. Marks, Honghao Shan, and Garrison W. Cottrell. SUN: A Bayesian frame + +work for saliency using natural statistics. Journal of Vision, 8(7):32-32, 12 2008. 2, 7 +[47] W. Zhang, A. Borji, Z. Wang, P. Le Callet, and H. Liu. The application of visual saliency models in objective image quality assessment: A statistical evaluation. IEEE Transactions on Neural Networks and Learning Systems, 27(6):1266-1278, June 2016. 1 +[48] F. Zünd, Y. Pritch, A. Sorkine-Hornung, S. Mangold, and T. Gross. Content-aware compression using saliency-driven image retargeting. In 2013 IEEE International Conference on Image Processing, pages 1845-1849, Sep. 2013. 1 \ No newline at end of file diff --git a/revisitingsaliencymetricsfarthestneighborareaundercurve/images.zip b/revisitingsaliencymetricsfarthestneighborareaundercurve/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a9e1f5ee9421f7c11cc3df20b80f9ec12811a87e --- /dev/null +++ b/revisitingsaliencymetricsfarthestneighborareaundercurve/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ddaf9a389b51ed5478570169868fc80e3c5e9e2c1e7f8a04140eb25af94f012 +size 334879 diff --git a/revisitingsaliencymetricsfarthestneighborareaundercurve/layout.json b/revisitingsaliencymetricsfarthestneighborareaundercurve/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dfbb146f1c691df64f72d5d223ea6e7da4fe6da5 --- /dev/null +++ b/revisitingsaliencymetricsfarthestneighborareaundercurve/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c45b486c0e3c871eafda614bf559eacb378bd06b13d7773a9ba275051dac01d7 +size 505730 diff --git a/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_content_list.json b/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..45ac5b593b67b1e4f06fd9d880d6249d77323f95 --- /dev/null +++ b/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa11020d7e01da3b942835f5c250a2291498795246ae95363dd549f17c1d2f76 +size 82673 diff --git a/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_model.json b/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_model.json new file mode 100644 index 0000000000000000000000000000000000000000..42fc15e0cc3495b9ccdb0336028107d35a629be7 --- /dev/null +++ b/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37a8183790ab80f9d3ca2356b56f7a48c5437d1a4e5538a4cbdfd64990912b98 +size 98694 diff --git a/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_origin.pdf b/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4a9bb66f6a10e9d69aab0838c8ae90e66bc6ab84 --- /dev/null +++ b/revisitingthesiblingheadinobjectdetector/39f093a8-03b3-4bcf-8b2f-e2529861b782_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88a239735829381037b6a183ed9da5455b30e81ce8e8b5832f0bec8c78f8f8ce +size 1147612 diff --git a/revisitingthesiblingheadinobjectdetector/full.md b/revisitingthesiblingheadinobjectdetector/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0f561746db233f9e2de73a3e1b10707aed7edc58 --- /dev/null +++ b/revisitingthesiblingheadinobjectdetector/full.md @@ -0,0 +1,334 @@ +# Revisiting the Sibling Head in Object Detector + +Guanglu Song1 Yu Liu2* Xiaogang Wang2 +1SenseTime X-Lab + +2The Chinese University of Hong Kong, Hong Kong +1songguanglu@sensetime.com, 2yuliu, xgwang}@ee.cuhk.edu.hk + +# Abstract + +The "shared head for classification and localization" (sibling head), firstly denominated in Fast RCNN [9], has been leading the fashion of the object detection community in the past five years. This paper provides the observation that the spatial misalignment between the two object functions in the sibling head can considerably hurt the training process, but this misalignment can be resolved by a very simple operator called task-aware spatial disentanglement (TSD). Considering the classification and regression, TSD decouples them from the spatial dimension by generating two disentangled proposals for them, which are estimated by the shared proposal. This is inspired by the natural insight that for one instance, the features in some salient area may have rich information for classification while these around the boundary may be good at bounding box regression. Surprisingly, this simple design can boost all backbones and models on both MS COCO and Google OpenImage consistently by $\sim 3\%$ mAP. Further, we propose a progressive constraint to enlarge the performance margin between the disentangled and the shared proposals, and gain $\sim 1\%$ more mAP. We show the TSD breaks through the upper bound of nowadays single-model detector by a large margin (mAP 49.4 with ResNet-101, 51.2 with SENet154), and is the core model of our 1st place solution on the Google OpenImage Challenge 2019. + +# 1. Introduction + +Since the breakthrough of object detection performance has been achieved by seminal R-CNN families [10, 9, 30] and powerful FPN [21], the subsequent performance enhancement of this task seems to be hindered by some concealed bottlenecks. Even the advanced algorithms bolstered by AutoML [8, 38] have been delved, the performance gain is still limited to an easily accessible improvement range. As the most obvious distinction from the + +![](images/c854bf531ea9e730e1a44cd7554e54aa99b0e5c6a48b73502864bc66ee92803b.jpg) +Figure 1. Illustration of the task spatial misalignment. The first column is the sensitive location for classification and the second column is the sensitive location for localization. The third column is the 3D visualization of the sensitivity distribution. + +generic object classification task, the specialized sibling head for both classification and localization comes into focus and is widely used in most of advanced detectors including single stage family [25, 33, 12], two-stage family [5, 18, 40, 26, 19] and anchor free family [17]. Considering the two different tasks share almost the same parameters, a few works become conscious about the conflict between the two object functions in the sibling head and try to find a trade-off way. + +IoU-Net [15] is the first to reveal this problem. They find the feature which generates a good classification score always predicts a coarse bounding box. To handle this problem, they first introduce an extra head to predict the IoU as the localization confidence, and then aggregate the localization confidence and the classification confidence together to be the final classification score. This approach does reduce the misalignment problem but in a compromise manner – the essential philosophy behind it is relatively raising the confidence score of a tight bounding box and reduce the score of a bad one. The misalignment still exists in each spatial point. Along with this direction, Double-Head R-CNN [35] is proposed to disentangle the sibling head into + +two specific branches for classification and localization, respectively. Despite of elaborate design of each branch, it can be deemed to disentangle the information by adding a new branch, essentially reduce the shared parameters of the two tasks. Although the satisfactory performance can be obtained by this detection head disentanglement, conflict between the two tasks still remain since the features fed into the two branches are produced by ROI Pooling from the same proposal. + +In this paper, we meticulously revisit the sibling head in the anchor-based object detector to seek the essence of the tasks misalignment. We explore the spatial sensitivity of classification and localization on the output feature maps of each layer in the feature pyramid of FPN. Based on the commonly used sibling head (a fully connected head $2-fc$ ), we illustrate the spatial sensitive heatmap in Figure.1. The first column is the spatial sensitive heatmap for classification and the second column is for localization. The warmer the better for the color. We also show their 3D visualizations in the third column. It's obvious that for one instance, the features in some salient areas may have rich information for classification while these around the boundary may be good at bounding box regression. This essential tasks misalignment in spatial dimension greatly limits the performance gain whether evolving the backbone or enhancing the detection head. In other words, if a detector try to infer the classification score and regression result from a same spatial point/anchor, it will always get an imperfect trade-off result. + +This significant observation motivates us to rethink the architecture of the sibling head. The optimal solution for the misalignment problem should be explored by the spatial disentanglement. Based on this, we propose a novel operator called task-aware spatial disentanglement (TSD) to resolve this barrier. The goal of TSD is to spatially disentangle the gradient flows of classification and localization. To achieve this, TSD generates two disentangled proposals for these two tasks, based on the original proposal in classical sibling head. It allows two tasks to adaptively seek the optimal location in space without compromising each other. With the simple design, the performance of all backbones and models on both MS COCO and Google OpenImage are boosted by $\sim 3\%$ mAP. Furthermore, we propose a progressive constraint (PC) to enlarge the performance margin between TSD and the classical sibling head. It introduces the hyper-parameter margin to advocate the more confident classification and precise regression. $\sim 1\%$ more mAP is gained on the basis of TSD. Whether for variant backbones or different detection frameworks, the integrated algorithms can steadily improve the performance by $\sim 4\%$ and even $\sim 6\%$ for lightweight MobileNetV2. Behind the outstanding performance gains, only a slight increased parameter is required, which is negligible for some heavy backbones. + +To summarize, the contributions of this paper are as follows: + +1) We delve into the essential barriers behind the tangled tasks in RoI-based detectors and reveal the bottlenecks that limit the upper bound of detection performance. +2) We propose a simple operator called task-aware spatial disentanglement (TSD) to deal with the tangled tasks conflict. Through the task-aware proposal estimation and the detection head, it could generate the task-specific feature representation to eliminate the compromises between classification and localization. +3) We further propose a progressive constraint (PC) to enlarge the performance margin between TSD and the classical sibling head. +4) We validate the effectiveness of our approach on the standard COCO benchmark and large-scale OpenImage dataset with thorough ablation studies. Compared with the state-of-the-art methods, our proposed method achieves the mAP of 49.4 using a single model with ResNet-101 backbone and mAP of 51.2 with heavy SENet154. + +# 2. Methods + +In this section, we first describe the overall framework of our proposed task-aware spatial disentanglement (TSD), then detail the sub-modules in Sec. 2.2 and 2.3. Finally, we delve into the inherent problem in sibling head and demonstrate the advantage of TSD. + +# 2.1. TSD + +As shown in Figure.2 (a), denote a rectangular bounding box proposal as $P$ and the ground-truth bounding box as $B$ with class $y$ , the classical Faster RCNN [30] aims to minimize the classification loss and localization loss based on the shared $P$ : + +$$ +\mathcal {L} = \mathcal {L} _ {c l s} \left(\mathcal {H} _ {1} \left(F _ {l}, P\right), y\right) + \mathcal {L} _ {l o c} \left(\mathcal {H} _ {2} \left(F _ {l}, P\right), \mathcal {B}\right) \tag {1} +$$ + +where $\mathcal{H}_1(\cdot) = \{f(\cdot),\mathcal{C}(\cdot)\}$ and $\mathcal{H}_2(\cdot) = \{f(\cdot),\mathcal{R}(\cdot)\}$ . $f(\cdot)$ is the feature extractor and $\mathcal{C}(\cdot)$ and $\mathcal{R}(\cdot)$ are the functions for transforming feature to predict specific category and localize object. Seminal work [35] thinks the shared $f$ for classification and localization is not optimal, and they disentangle it to $f_{c}$ and $f_{r}$ for classification and regression, respectively. Although the appropriate head-decoupling brings a reasonable improvement, the inherent conflict caused by the tangled tasks in the spatial dimension is still lurking. + +For this potential problem, our goal is to alleviate the inherent conflict in sibling head by disentangling the tasks from the spatial dimension. We propose a novel TSD head for this goal as shown in Figure 2. In TSD, the Eq. 1 can be written as: + +$$ +\mathcal {L} = \mathcal {L} _ {c l s} ^ {D} \left(\mathcal {H} _ {1} ^ {D} \left(F _ {l}, \hat {P} _ {c}\right), y\right) + \mathcal {L} _ {l o c} ^ {D} \left(\mathcal {H} _ {2} ^ {D} \left(F _ {l}, \hat {P} _ {r}\right), \mathcal {B}\right) \tag {2} +$$ + +![](images/d5ea1b1426d0382b8cf0fbeb5bd5ecfc6728a74634e0762de757d7f0897b0a3e.jpg) +Figure 2. Illustration of the proposed TSD cooperated with Faster RCNN [30]. Input images are first fed into the FPN backbone and then, region proposal $P$ is generated by RPN. TSD adopts the RoI feature of $P$ as input and estimates the derived proposals $\hat{P}_c$ and $\hat{P}_r$ for classification and localization. Finally, two parallel branches are used to predict specific category and regress precise box, respectively. + +where disentangled proposals $\hat{P}_c = \tau_c(P, \Delta C)$ and $\hat{P}_r = \tau_r(P, \Delta R)$ are estimated from the shared $P$ . $\Delta C$ is a pointwise deformation of $P$ and $\Delta R$ is a proposal-wise translation. In TSD, $\mathcal{H}_1^D(\cdot) = \{f_c(\cdot), \mathcal{C}(\cdot)\}$ and $\mathcal{H}_2^D(\cdot) = \{f_r(\cdot), \mathcal{R}(\cdot)\}$ . + +In particular, TSD tasks the RoI feature of $P$ as input, and then generates the disentangled proposals $\hat{P}_c$ and $\hat{P}_r$ for classification and localization, respectively. Different tasks can be disentangled from the spatial dimension via the separated proposals. The classification-specific feature maps $\hat{F}_c$ and localization-specific feature maps $\hat{F}_r$ can be generated through parallel branches. In the first branch, $\hat{F}_c$ is fed into a three-layer fully connected networks for classification. In the second branch, the RoI feature $\hat{F}_r$ corresponding to derived proposal $\hat{P}_r$ will be extracted and fed into a similar architecture with the first branch to perform localization task. By disentangling the shared proposal for the classification and localization, TSD can learn the task-aware feature representation adaptively. TSD is applicable to most existing RoI-based detectors. As the training procedure adopts an end-to-end manner cooperated with the well-designed progressive constraint (PC), it is robust to the change of backbones and input distributions (e.g., training with different datasets.). + +# 2.2. Task-aware spatial disentanglement learning + +Inspired by Figure.1, we introduce the task-aware spatial disentanglement learning to alleviate the misalignment caused by the shared spatial clues. As shown in Figure.2 (b), define the RoI feature of $P$ as $F$ , we embed the deformation-learning manner into TSD to achieve this goal. For localization, a three-layer fully connected network $\mathcal{F}_r$ is designed to generate a proposal-wise translation on $P$ to produce a new derived proposal $\hat{P}_r$ . This procedure can be formulated as: + +$$ +\Delta R = \gamma \mathcal {F} _ {r} (F; \theta_ {r}) \cdot (w, h) \tag {3} +$$ + +where $\Delta R\in \mathbb{R}^{1\times 1\times 2}$ and the output of $\mathcal{F}_r$ for each layer is $\{256,256,2\}$ . $\gamma$ is a pre-defined scalar to modulate the magnitude of the $\Delta R$ and (w, h) is the width and height of $P$ . The derived function $\tau_r(\cdot)$ for generating $\hat{P}_r$ is: + +$$ +\hat {P} _ {r} = P + \Delta R \tag {4} +$$ + +Eq. 4 indicates the proposal-wise translation where the coordinate of each pixel in $P$ will be translated to a new coordinate with the same $\Delta R$ . The derived proposal $\hat{P}_r$ only focuses on the localization task and in the pooling function, we adopt the bilinear interpolation the same as [5] to make $\Delta R$ differentiable. + +For classification, given the shared $P$ , a pointwise deformation on a regular grid $k \times k$ is generated to estimate a derived proposal $\hat{P}_c$ with an irregular shape. For (x,y)-th grid, the translation $\Delta C(x, y, *)$ is performed on the sample points in it to obtain the new sample points for $\hat{P}_c$ . This procedure can be formulated as: + +$$ +\Delta C = \gamma \mathcal {F} _ {c} (F; \theta_ {c}) \cdot (w, h) \tag {5} +$$ + +where $\Delta C\in \mathbb{R}^{k\times k\times 2}$ . $\mathcal{F}_c$ is a three-layer fully connected network with output $\{256,256,k\times k\times 2\}$ for each layer and $\theta_{c}$ is the learned parameter. The first layer in $\mathcal{F}_r$ and $\mathcal{F}_c$ is shared to reduce the parameter. For generating feature map $\hat{F}_c$ by irregular $\hat{P}_c$ , we adopt the same operation with deformable RoI pooling [5]: + +$$ +\hat {F} _ {c} (x, y) = \sum_ {p \in G (x, y)} \frac {\mathcal {F} _ {B} \left(p _ {0} + \Delta C (x , y , 1) , p _ {1} + \Delta C (x , y , 2)\right)}{| G (x , y) |} \tag {6} +$$ + +where $G(x,y)$ is the (x,y)-th grid and $|G(x,y)|$ is the number of sample points in it. $(p_x,p_y)$ is the coordinate of the sample point in grid $G(x,y)$ and $\mathcal{F}_B(\cdot)$ is the bilinear interpolation [5] to make the $\Delta C$ differentiable. + +# 2.3. Progressive constraint + +At the training stage, the TSD and the sibling detection head defined in Eq. 1 can be jointly optimized by $\mathcal{L}_{cls}$ and $\mathcal{L}_{loc}$ . Beyond this, we further design the progressive constraint (PC) to improve the performance of TSD as shown in Figure.2 (c). For classification branch, PC is formulated as: + +$$ +\mathcal {M} _ {c l s} = \left| \mathcal {H} _ {1} (y | F _ {l}, P) - \mathcal {H} _ {1} ^ {D} \left(y | F _ {l}, \tau_ {c} (P, \Delta C)\right) + m _ {c} \right| _ {+} \tag {7} +$$ + +where $\mathcal{H}(y|\cdot)$ indicates the confidence score of the $y$ -th class and $m_c$ is the predefined margin. $|\cdot|_+$ is same as ReLU function. Similarly, for localization, there are: + +$$ +\mathcal {M} _ {l o c} = \left| I o U (\hat {\mathcal {B}}, \mathcal {B}) - I o U (\hat {\mathcal {B}} _ {D}, \mathcal {B}) + m _ {r} \right| _ {+} \tag {8} +$$ + +where $\hat{\mathcal{B}}$ is the predicted box by sibling head and $\hat{\mathcal{B}}_D$ is regressed by $\mathcal{H}_2^D (F_l,\tau_r(P,\Delta R))$ . If $P$ is a negative proposal, $M_{loc}$ is ignored. According to these designs, the whole loss function of TSD with Faster RCNN can be define as: + +$$ +\mathcal {L} = \underbrace {\mathcal {L} _ {r p n} + \mathcal {L} _ {c l s} + \mathcal {L} _ {l o c}} _ {\text {c l a s s i c a l} \text {l o s s}} + \underbrace {\mathcal {L} _ {c l s} ^ {D} + \mathcal {L} _ {l o c} ^ {D} + \mathcal {M} _ {c l s} + \mathcal {M} _ {l o c}} _ {\text {T S D} \text {l o s s}} \tag {9} +$$ + +We directly set the loss weight to 1 without carefully adjusting it. Under the optimization of $\mathcal{L}$ , TSD can adaptively learn the task-specific feature representation for classification and localization, respectively. Extensive experiments in Sec.3 indicates that disentangling the tangled tasks from the spatial dimension can significantly improve the performance. + +# 2.4. Discussion in context of related works + +In this section, we delve into the inherent conflict in tangled tasks. Our work is related to previous works in different aspects. We discuss the relations and differences in detail. + +# 2.4.1 Conflict in sibling head with tangled tasks + +Two core designs in classical Faster RCNN are predicting the category for a given proposal and learning a regression function. Due to the essential differences in optimization, classification task requires translation-agnostic property and to the contrary, localization task desires translation-aware property. The specific translation sensitivity property for classification and localization can be formulated as: + +$$ +\begin{array}{l} \mathcal {C} (f (F _ {l}, P)) = \mathcal {C} (f (F _ {l}, P + \varepsilon)), \\ \mathcal {C} (f ^ {\prime} (F _ {l}, P)) = \mathcal {C} (f ^ {\prime} (F _ {l}, P + \varepsilon)). \end{array} \tag {10} +$$ + +$$ +\mathcal {R} (f (F _ {l}, P)) \neq \mathcal {R} (f (F _ {l}, P + \varepsilon)) +$$ + +where $\forall \varepsilon, IoU(P + \varepsilon, \mathcal{B}) \geq T$ . $\mathcal{C}$ is to predict category probability and $\mathcal{R}$ is the regression function whose output is $(\Delta \hat{x}, \Delta \hat{y}, \Delta \hat{w}, \Delta \hat{h})$ . $f(\cdot)$ is the shared feature extractor + +in classical sibling head and $T$ is the threshold to determine whether $P$ is a positive sample. There are entirely different properties in these two tasks. The shared spatial clues in $F_{l}$ and feature extractor for these two tasks will become the obstacles to hinder the learning. Different from [35, 15, 5, 43] where the evolved backbone or feature extractor is designed, TSD decouples the classification and regression from spatial dimension by separated $\hat{P}_{*}$ and $f_{*}(\cdot)$ . + +# 2.4.2 Different from other methods + +IoU-Net [15] first illustrates the misalignment between classification and regression. To alleviate this, it directly predicts the IoU to adjust the classification confidence via an extra branch. Unfortunately, this approach does not solve the inherent conflict between tangled tasks. For this same problem, Double-Head R-CNN [35] explores the optimal architectures for classification and localization, respectively. To learn more effective feature representation, DCN [5] with deformable RoI pooling is proposed to extract the semantic information from the irregular region. Whether evolving the backbone or adjusting the detection head, performance can be improved, but the increase is limited. + +In this paper, we observe that the essential problem behind the limited performance is the misaligned sensitivity in the spatial dimension between classification and localization. Neither designing better feature extraction methods nor searching for the best architecture can solve this problem. In this dilemma, TSD is proposed to decouple the classification and localization from both the spatial dimension and feature extractor. TSD first performs spatial disentanglement for classification and localization via separated proposals and feature extractors to break the predicament. With the further well-designed PC, it can learn the optimal sensitive location for classification and localization, respectively. Moreover, TSD is still applicable to DCN [5] although deformable RoI pooling in DCN is used to assist in estimating $\hat{F}_c$ . By task-aware spatial disentanglement, the simple TSD can easily achieve excellent performance for different backbones. + +# 3. Experiments + +We perform extensive experiments with variant backbones on the 80-category MS-COCO dataset [23] (object detection and instance segmentation) and 500-category OpenImageV5 challenge dataset [16]. For COCO dataset, following the standard protocol [27], training is performed on the union of $80\mathrm{k}$ train images and $35\mathrm{k}$ subset of val images and testing is evaluated on the remaining $5\mathrm{k}$ val images (minimal). We also report results on $20\mathrm{k}$ test-dev. For OpenImage dataset, following the official protocol [16], the model is trained on 1,674,979 training images and evaluated + +![](images/09f8c22d3deea27a7fc0002734fe8032f1ef754be43ac15bc94607a3db1a9e6d.jpg) +(a) $\mathrm{D}_{s8}$ + +![](images/fdd5736b03b8cb0d6d80dee87f1c926fbd202edbddbbe320595bb81fbb18296a.jpg) +(b) $\mathrm{D}_{s16}$ + +![](images/dadfc11eab48e40e379db50b6a86f5bd39d80bbf96db148bd85bdfa86bf96a40.jpg) +(c) $\mathrm{D}_{s32}$ + +![](images/ac2e58d810f4bf5143e167bbf2b80034ff30b0e559286113681b4809f0a67f26.jpg) +(d) $\mathrm{D}_{head}$ +Figure 3. Ablation studies on variant disentanglement options. (a)-(d) indicate disentangling the detector from stride 8, stride 16, stride 32 and sibling head, respectively. + +on the 34,917 val images. The $\mathrm{AP}_{5}$ on public leaderboard is also reported. + +# 3.1. Implementation details + +We initialize weights from pre-trained models on ImageNet [31] and the configuration of hyper-parameters follows existing Faster RCNN [30]. Images are resized such that the shorter edge is 800 pixels. The anchor scale and aspect ratio are set to 8 and $\{0.5, 1, 2\}$ . We train the models on 16 GPUs (effective mini-batch size is 32) for 13 epochs, with a learning rate warmup strategy [11] from 0.00125 to 0.04 in the first epoch. We decrease the learning rate by 10 at epoch 8 and epoch 11, respectively. RoIAlign [13] is adopted in all experiments, and the pooling size is 7 in both $\mathcal{H}_1^*$ and $\mathcal{H}_2^*$ . We use SGD to optimize the training loss with 0.9 momentum and 0.0001 weight decay. No data augmentations except standard horizontal flipping are used. Synchronized BatchNorm mechanism [29, 11] is used to make multi-GPU training more stable. At the inference stage, NMS with 0.5 IoU threshold is applied to remove duplicate boxes. For experiments in the OpenImage dataset, class-aware sampling is used. + +# 3.2. Ablation studies + +In this section, we conduct detailed ablation studies on COCO minival to evaluate the effectiveness of each module and illustrate the advance and generalization of the proposed TSD. $m_{c}$ and $m_{r}$ are set to 0.2 in these experiments. + +Task-aware disentanglement. When it comes to tangled tasks conflict in sibling detection head, it's natural to think about decoupling different tasks from the backbone or detection head. To evaluate these ideas, we conduct several experiments to illustrate the comparison between them. As shown in Figure.3, we design different decoupling options including backbone disentanglement and head disentanglement. Detailed performance is shown in Table.1. Decoupling the classification and localization from the backbone largely degrades the performance. It clearly shows that the + +
Disentanglement#paramAPAP.5AP.75
ResNet-5041.8M36.158.038.8
ResNet-50+Ds881.1M22.346.316.7
ResNet-50+Ds1674.0M22.046.216.3
ResNet-50+Ds3259M20.344.713.2
ResNet-50+Dhead55.7M37.359.440.2
TSD w/o PC58.9M38.260.541.1
+ +semantic information in the backbone should be shared by different tasks. As expected, the task-specific head can significantly improve the performance. Compared with $\mathrm{D}_{\text {head }}$ , TSD w/o PC can further enhance the AP with the slight increased parameters, even for the demanding $\mathrm{AP}_{.75}$ . When faced with heavy backbones, a slight increased parameter is trivial but can still significantly improve the performance. This also substantiates the discussion in Sec. 2.4.1 that disentangling the tasks from spatial dimension can effectively alleviate the inherent conflict in sibling detection head. + +Table 1. Detailed performance and #parameter of different disentanglement methods. + +
MethodAPAP.5AP.75
TSD w/o PC38.260.541.1
+ Joint training with sibling head H*39.761.742.8
+ +Joint training with sibling head $\mathcal{H}_{*}$ . In TSD, the shared proposal $P$ can also be used to perform classification and localization in an extra sibling head. We empirically observe that the training of sibling head is complementary to the training of TSD, and the results are demonstrated in Table.2. This indicates that the derived proposals $\hat{P}_c$ and $\hat{P}_r$ are not conflict with the original proposal $P$ . At the inference stage, only the TSD head is retained. + +Table 2. Result of joint training with sibling $\mathcal{H}_{*}$ . The ResNet-50 with FPN is used as the basic detector. + +
MethodTSDPCAPAP.5AP.75
MclsMloc
ResNet-50✓39.761.742.8
ResNet-50✓✓40.161.743.2
ResNet-50✓✓40.861.743.8
ResNet-50✓✓✓41.061.744.3
+ +Table 3. Ablation studies on PC. All of the experiments is joint training with sibling head $\mathcal{H}_{*}$ . $\mathrm{m}_c$ and $\mathrm{m}_r$ are set to 0.2. + +Effectiveness of PC. In Sec. 2.3, we further propose the PC to enhance the performance of TSD. Table.3 reports the detailed ablations on it. We find that PC significantly improves the $\mathrm{AP}_{.75}$ by 1.5 and $\mathrm{AP}_{.5}$ is barely affected. This demonstrates that PC aims to advocate more confidential classification and precise regression for the accurate boxes. Even on the strict testing standards AP (IoU from 0.5:0.95), + +1.3 AP gain can also be obtained. + +
MethodPCPcPrAPAP.5AP.75
TSDPoint.w-38.060.340.89
TSDPoint.wPoint.w38.560.741.7
TSDPoint.wProp.w38.260.541.1
TSD✓Prop.wProp.w39.860.142.9
TSD✓Point.wPoint.w40.761.844.4
TSD✓Point.wProp.w41.061.744.3
+ +Derived proposal learning manner for $\mathcal{H}_*^D$ . There are different programmable strategies to generate the derived proposal $\hat{P}_r$ and $\hat{P}_c$ including proposal-wise translation (Prop.w) in Eq. 4, pointwise deformation (Point.w) such as deformable RoI pooling [5] or the tricky combination of them. To explore the differences of these learning manners, we conduct extensive experiments for COCO minival with ResNet-50. Table.4 demonstrates the comparison results. These comparisons illustrate that Point.w is beneficial to the classification task and cooperated with PC, Prop.w performs a slight advantage on localization. For generating the derived proposals, classification requires the optimal local features without regular shape restrictions and regression requires the maintenance of global geometric shape information. + +![](images/d1a23898cf0c3b14ed8febecf79e80cfcb82bd970272763003e038c527e5352f.jpg) +Figure 4. Results of TSD with variant $\mathfrak{m}_{*}$ for PC. These experiments are conducted based on ResNet-50 with FPN. + +Delving to the effective PC. PC demonstrates its superiority on regressing more precise bounding boxes. The hyper-parameters $m_{c}$ and $m_{r}$ play important roles in the training of TSD and to better understand their effects on performance, we conduct detailed ablation studies on them. Figure.4 reports the results and note that both of the $\mathcal{M}_{los}$ and $\mathcal{M}_{cls}$ can further improve the performance. + +# 3.3. Applicable to variant backbones + +Since the TSD and PC have demonstrated their outstanding performance on ResNet-50 with FPN, we further delve + +Table 4. Results of different proposal learning manners for ${\mathcal{H}}_{ * }^{D}$ . + +
MethodOursAPAP.5AP.75runtime
ResNet-5036.158.038.8159.4 ms
ResNet-50✓41.061.744.3174.9 ms
ResNet-10138.660.641.8172.4ms
ResNet-101✓42.463.146.0189.0ms
ResNet-101-DCN40.863.244.6179.3ms
ResNet-101-DCN✓43.564.447.0200.8ms
ResNet-15240.762.644.6191.3ms
ResNet-152✓43.964.547.7213.2ms
ResNeXt-101 [36]40.562.644.2187.5ms
ResNeXt-101 [36]✓43.564.546.9206.6ms
+ +into the adaptation on variant backbones. Based on Faster R-CNN, we directly conduct several experiments with different backbones and Table.5 summarizes the detailed performance on COCO minival. TSD can steadily improve the performance by $3\% \sim 5\%$ with additional $\sim 10\%$ time cost. Note that ResNet-50+TSD with 58.9M parameter can even outperform the ResNet-152 with 76.39M parameter. Based on the ResNet family, TSD is a more preferred choice than increasing backbone to improve performance. If not specified, all subsequent TSD indicates TSD+PC. + +Table 5. Results of TSD + PC with variant backbones. DCN means deformable convolution. The runtime includes network forward and post-processing (e.g., NMS for object detection). The runtime is the averaged value on a single Tesla V100 GPU and CPU E5-2680 v4. + +
MethodTSDAP.5 (Val)AP.5 (LB)
ResNet-5064.6449.79
ResNet-50✓68.1852.55
Cascade-DCN-SENet15469.2755.979
Cascade-DCN-SENet154✓71.1758.34
DCN-ResNeXt101*68.7055.05
DCN-ResNeXt101*✓71.7158.59
DCN-SENet154*7057.771
DCN-SENet154*✓72.1960.5
+ +Table 6. Results of TSD on OpenImage dataset. * indicates we expand the anchor scale to $\{8,11,14\}$ and anchor aspect ratio to $\{0.1,0.5,1,2,4,8\}$ . Furthermore, mult-scale test is used for public leaderboard (LB) except for ResNet-50. + +# 3.4. Applicable to Mask R-CNN + +The proposed algorithms largely surpass the classical sibling head in Faster R-CNN. Its inherent properties determine its applicability to other R-CNN families such as Mask R-CNN for instance segmentation. To validate this, we conduct experiments with Mask R-CNN [13]. Performances are shown in Table.7 and the training configuration in Mask R-CNN is the same as the experiments in Faster R-CNN. It's obvious that TSD is still capable of detection branch in Mask R-CNN. The instance segmentation mask AP can also obtain promotion. + +
MethodOurs\( AP^{bb} \)\( AP^{bb}_{.5} \)\( AP^{bb}_{.75} \)\( AP^{mask} \)\( AP^{mask}_{.5} \)\( AP^{mask}_{.75} \)
ResNet-50 w. FPN37.258.840.233.655.335.4
ResNet-50 w. FPN✓41.562.144.835.858.337.7
ResNet-101 w. FPN39.561.243.035.757.938.0
ResNet-101 w. FPN✓43.063.646.837.259.939.5
+ +Table 7. Results of Mask R-CNN with TSD. The proposed methods are only applied on the detection branch in Mask R-CNN. $\mathrm{AP}^{bb}$ means the detection performance and $\mathrm{AP}^{mask}$ indicates the segmentation performance. + +
Methodbackboneb&wAP\( AP_{.5} \)\( AP_{.75} \)\( AP_s \)\( AP_m \)\( AP_l \)
RefineDet512 [41]ResNet-10136.457.539.516.639.951.4
RetinaNet800 [22]ResNet-10139.159.142.321.842.750.2
CornerNet [17]Hourglass-104 [28]40.556.543.119.442.753.9
ExtremeNet [42]Hourglass-104 [28]40.155.343.220.343.253.1
FCOS [34]ResNet-10141.560.745.024.444.851.6
RPDet [39]ResNet-101-DCN✓46.567.450.930.349.757.1
CenterNet511 [6]Hourglass-104✓47.064.550.728.949.958.9
TridentNet [20]ResNet-101-DCN✓48.469.753.531.851.360.3
NAS-FPN [8]AmoebaNet (7 @ 384)✓48.3-----
Faster R-CNN w FPN [21]ResNet-10136.259.139.018.239.048.2
\( Auto-FPN^† \)[38]ResNet-10142.5-----
Regionlets [37]ResNet-10139.359.8-21.743.750.9
Grid R-CNN [27]ResNet-10141.560.944.523.344.954.1
Cascade R-CNN [2]ResNet-10142.862.146.323.745.555.2
DCR [4]ResNet-10140.764.444.624.343.751.9
\( IoU-Net^† \)[15]ResNet-10140.659.0----
Double-Head-Ext \( ^† \)[35]ResNet-10141.962.445.923.945.255.8
SNIPER [32]ResNet-101-DCN✓46.167.051.629.648.958.1
DCNV2 [43]ResNet-101✓46.067.950.827.849.159.5
PANet [24]ResNet-101✓47.467.251.830.151.760.0
GCNet [3]ResNet-101-DCN✓48.467.652.7---
\( TSD^† \)ResNet-10143.163.646.724.946.857.5
TSDResNet-10143.264.046.924.046.355.8
\( TSD^* \)ResNet-101-DCN✓49.469.654.432.752.561.0
\( TSD^* \)SENet154-DCN [14]✓51.271.956.033.854.864.2
+ +Table 8. Comparisons of single-model results for different algorithms evaluated on the COCO test-dev set. $b\& w$ indicates training with bells and whistles such as multi-scale train/test, Cascade R-CNN or DropBlock [7]. $\dagger$ indicates the result on COCO minival set. + +# 3.5. Generalization on large-scale OpenImage + +In addition to evaluate on the COCO dataset, we further corroborate the proposed method on the large-scale OpenImage dataset. As the public dataset with large-scale boxes and hierarchy property, it brings a new challenge to the generalization of detection algorithms. To fully delve the effectiveness of the proposed algorithm, we run a number of ablations to analyze TSD. Table.6 illustrates the comparison and note that, even for heavy backbone, TSD can still give satisfactory improvements. Furthermore, TSD is complementary to Cascade R-CNN [2] and embedding it into this framework can also enhance the performance by a satisfactory margin. + +# 3.6. Comparison with state-of-the-Arts + +In this section, we evaluate our proposed method on COCO test-dev set and compare it with other state-of-the + +art methods. $m_{c}$ and $m_{r}$ are set to 0.5 and 0.2, respectively. For a fair comparison, we report the results of our methods under different settings in Table.8. For comparison with Grid R-CNN [27], we extend the training epochs for ResNet-101 to be consistent with it. For comparing with the best single-model TridentNet*, in TSD*, we apply the same configuration with it including multi-scale training, soft-NMS [1], deformable convolutions and the $3 \times$ training scheme on ResNet-101. The best single-model ResNet-101-DCN gives an AP of 49.4, already surpassing all of the other methods with the same backbone. To our best knowledge, for a single model with ResNet-101 backbone, our result is the best entry among the state-of-the-arts. TSD demonstrates its advantage on promoting precise localization and confidential classification, especially on higher IoU thresholds (AP.75). Furthermore, we explore the upper-bound of TSD with a heavy backbone. Surprisingly, it can + +![](images/0cbe302c2c207334ae472f1d3668865f2593bd35b84bc1fd1de4fff5a7a64e7c.jpg) + +![](images/23153a3b6942920696ad719adb8328f9332ec15af4790d8ae6567f060b41eef6.jpg) + +![](images/d5e98f49b96df0bba3bc092352bb95468443a23d6500378d7cda65a94cfddc1d.jpg) + +![](images/0d30977ae9e67b1cce76b0be771f35373f1c2a7bbd158159684e262f32e01321.jpg) + +![](images/9853436483ca52bbe40d44acf954c2f70a0856d1e9e17f8b4f54851ffe1f2667.jpg) + +![](images/219d69e6e290821c294768607e3cc691790a193483eb467e3f077d2f51a7ac6e.jpg) + +![](images/017c9cef15b951eda9e0b8484972d061e95c72aa5300ff8a870f39d09cab77a6.jpg) +Figure 5. Visualization of the learnt $\hat{P}_r$ and $\hat{P}_c$ on examples from the COCO minival set. The first row indicates the proposal $P$ (yellow box) and the derived $\hat{P}_r$ (red box) and $\hat{P}_c$ (pink point, center point in each grid). The second row is the final detected boxes where the white box is ground-truth. TSD deposes the false positives in the first two columns and in other columns, it regresses more precise boxes. + +![](images/fcfde863454383afce02793f5c2ed004c13e48e76ac2f432a14953d1590928d1.jpg) + +![](images/7111608d6a29bf9cccd0c7d16c28606e925ba6bebd9299b9e2f0a183c1b9f9fd.jpg) + +![](images/40826b7e8ed30c58b8b85cef00f56ba31dd2486ba716e7eed5761e07fee799ab.jpg) + +![](images/3ab19b0eb9bb8e9416b8d6e95d06c1700bc129e4c55c280e5250ab419168aa6c.jpg) + +![](images/b4d4c9c25d8239be06f042e37222b2ba3b1c83fcfddbf7c8873ef08d6fd8332c.jpg) + +![](images/dd130b15422bfec7e1d86e648af60e8a726432080f330473e49192d09c92dfc1.jpg) +Figure 6. mAP across IoU criteria from 0.5 to 0.9 with 0.1 interval. + +achieve the AP of 51.2 with the single-model SENet154-DCN on COCO test-dev set. Soft-NMS is not used in this evaluation. + +# 3.7. Analysis and discussion + +Performance in different IoU criteria. Since TSD exhibits superior ability on regressing precise localization and predicting confidential category, we conduct several evaluations with more strict IoU criteria on COCO minival. Figure.6 illustrates the comparison between TSD based Faster R-CNN and baseline Faster R-CNN with the same ResNet-50 backbone across IoU thresholds from 0.5 to 0.9. Obviously, with the increasing IoU threshold, the improvement brought by TSD is also increasing. + +Performance in different scale criteria. We have analyzed the effectiveness of TSD under different IoU criteria. To better explore the specific improvement, we further test the mAP under objects with different scales. Table.9 reports the performance and TSD shows successes in objects with variant scales, especially for medium and large objects. + +What did TSD learn? Thanks to the task-aware spatial disentanglement (TSD) and the progressive constraint (PC), stable improvements can be easily achieved whether for variant backbones or variant datasets. Beyond the quantitative promotion, we wonder what TSD learned compared with the sibling head in Faster R-CNN. To better interpret + +
CriteriaTSDAP.5AP.6AP.7AP.8AP.9
APsmall38.433.726.716.23.6
APsmall✓40.035.628.817.75.3
APmedium62.958.449.733.68.7
APmedium✓67.762.454.940.215.4
APlarge69.565.556.843.214.8
APlarge✓74.871.665.053.227.9
+ +Table 9. mAP across scale criteria from 0.5 to 0.9 with 0.1 interval. + +this, We showcase the illustrations of our TSD compared with sibling head as shown in Figure. 5. As expected, through TSD, it can depose many false positives and regress the more precise box boundary. For $\hat{P}_r$ , it tends to translate to the boundary that is not easily regressed. For $\hat{P}_c$ , it tends to concentrate on the local appearance and object context information as it did in sibling head with deformable RoI pooling [5]. Note that the tangled tasks in sibling head can be effectively separated from the spatial dimension. + +# 4. Conclusion + +In this paper, we present a simple operator TSD to alleviate the inherent conflict in sibling head, which learns the task-aware spatial disentanglement to bread through the performance limitation. In particular, TSD derives two disentangled proposals from the shared proposal and learn the specific feature representation for classification and localization, respectively. Further, we propose a progressive constraint to enlarge the performance margin between the disentangled and the shared proposals, which provides additional performance gain. Without bells and whistles, this simple design can easily boost most of the backbones and models on both COCO and large scale OpenImage consistently by $3\% \sim 5\%$ , and is the core model in our 1st solution of OpenImage Challenge 2019. + +# References + +[1] Navaneeth Bodla, Bharat Singh, Rama Chellappa, and Larry S Davis. Soft-nms-improving object detection with one line of code. In Proceedings of the IEEE international conference on computer vision, pages 5561-5569, 2017. 7 +[2] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6154-6162, 2018. 7 +[3] Yue Cao, Jiarui Xu, Stephen Lin, Fangyun Wei, and Han Hu. Gcnet: Non-local networks meet squeeze-excitation networks and beyond. arXiv preprint arXiv:1904.11492, 2019. 7 +[4] Bowen Cheng, Yunchao Wei, Honghui Shi, Rogerio Feris, Jinjun Xiong, and Thomas Huang. Revisiting rcnn: On awakening the classification power of faster rcnn. In The European Conference on Computer Vision (ECCV), September 2018. 7 +[5] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 764-773, 2017. 1, 3, 4, 6, 8 +[6] Kaiwen Duan, Song Bai, Lingxi Xie, Honggang Qi, Qingming Huang, and Qi Tian. Centernet: Keypoint triplets for object detection. In The IEEE International Conference on Computer Vision (ICCV), October 2019. 7 +[7] Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A regularization method for convolutional networks. In Advances in Neural Information Processing Systems, pages 10727-10737, 2018. 7 +[8] Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Nas-fpn: Learning scalable feature pyramid architecture for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7036-7045, 2019. 1, 7 +[9] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440-1448, 2015. 1 +[10] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Region-based convolutional networks for accurate object detection and segmentation. IEEE transactions on pattern analysis and machine intelligence, 38(1):142-158, 2015. 1 +[11] Priya Goyal, Piotr Dolkar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. 5 +[12] Zekun Hao, Yu Liu, Hongwei Qin, Junjie Yan, Xiu Li, and Xiaolin Hu. Scale-aware face detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6186-6195, 2017. 1 +[13] 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. 5, 6 + +[14] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018. 7 +[15] Borui Jiang, Ruixuan Luo, Jiayuan Mao, Tete Xiao, and Yun-ting Jiang. Acquisition of localization confidence for accurate object detection. In Proceedings of the European Conference on Computer Vision (ECCV), pages 784–799, 2018. 1, 4, 7 +[16] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Tom Duerig, and Vittorio Ferrari. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. arXiv:1811.00982, 2018. 4 +[17] 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. 1, 7 +[18] Buyu Li, Yu Liu, and Xiaogang Wang. Gradient harmonized single-stage detector. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 8577-8584, 2019. 1 +[19] Hongyang Li, Yu Liu, Wanli Ouyang, and Xiaogang Wang. Zoom out-and-in network with map attention decision for region proposal and object detection. International Journal of Computer Vision, 127(3):225-238, 2019. 1 +[20] Yanghao Li, Yuntao Chen, Naiyan Wang, and Zhaoxiang Zhang. Scale-aware trident networks for object detection. arXiv preprint arXiv:1901.01892, 2019. 7 +[21] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117-2125, 2017. 1, 7 +[22] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. 7 +[23] 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. 4 +[24] 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. 7 +[25] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pages 21-37. Springer, 2016. 1 +[26] Yu Liu, Hongyang Li, Junjie Yan, Fangyin Wei, Xiaogang Wang, and Xiaou Tang. Recurrent scale approximation for object detection in cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 571-579, 2017. 1 +[27] Xin Lu, Buyu Li, Yuxin Yue, Quanquan Li, and Junjie Yan. Grid r-cnn. In Proceedings of the IEEE Conference on Com + +puter Vision and Pattern Recognition, pages 7363-7372, 2019. 4, 7 +[28] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In European conference on computer vision, pages 483-499. Springer, 2016. 7 +[29] Chao Peng, Tete Xiao, Zeming Li, Yuning Jiang, Xiangyu Zhang, Kai Jia, Gang Yu, and Jian Sun. Megdet: A large mini-batch object detector. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6181-6189, 2018. 5 +[30] 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. 1, 2, 3, 5 +[31] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. 5 +[32] Bharat Singh, Mahyar Najibi, and Larry S Davis. Sniper: Efficient multi-scale training. In Advances in Neural Information Processing Systems, pages 9310-9320, 2018. 7 +[33] Guanglu Song, Yu Liu, Ming Jiang, Yujie Wang, Junjie Yan, and Biao Leng. Beyond trade-off: Accelerate fcn-based face detector with higher accuracy. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7756-7764, 2018. 1 +[34] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In The IEEE International Conference on Computer Vision (ICCV), October 2019. 7 +[35] Yue Wu, Yinpeng Chen, Lu Yuan, Zicheng Liu, Lijuan Wang, Hongzhi Li, and Yun Fu. Rethinking classification and localization in r-cnn. arXiv preprint arXiv:1904.06493, 2019. 1, 2, 4, 7 +[36] Saining Xie, Ross Girshick, Piotr Dólár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492-1500, 2017. 6 +[37] Hongyu Xu, Xutao Lv, Xiaoyu Wang, Zhou Ren, Navaneeth Bodla, and Rama Chellappa. Deep regionlets for object detection. In Proceedings of the European Conference on Computer Vision (ECCV), pages 798-814, 2018. 7 +[38] Hang Xu, Lewei Yao, Wei Zhang, Xiaodan Liang, and Zhenguo Li. Auto-fpn: Automatic network architecture adaptation for object detection beyond classification. In The IEEE International Conference on Computer Vision (ICCV), October 2019. 1, 7 +[39] Ze Yang, Shaohui Liu, Han Hu, Liwei Wang, and Stephen Lin. Reppoints: Point set representation for object detection. arXiv preprint arXiv:1904.11490, 2019. 7 +[40] Xingyu Zeng, Wanli Ouyang, Junjie Yan, Hongsheng Li, Tong Xiao, Kun Wang, Yu Liu, Yucong Zhou, Bin Yang, Zhe Wang, et al. Drafting gbd-net for object detection. IEEE transactions on pattern analysis and machine intelligence, 40(9):2109-2123, 2017. 1 + +[41] Shifeng Zhang, Longyin Wen, Xiao Bian, Zhen Lei, and Stan Z Li. Single-shot refinement neural network for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4203-4212, 2018. 7 +[42] Xingyi Zhou, Jiacheng Zhuo, and Philipp Krahenbuhl. Bottom-up object detection by grouping extreme and center points. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 850-859, 2019. 7 +[43] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9308-9316, 2019. 4, 7 \ No newline at end of file diff --git a/revisitingthesiblingheadinobjectdetector/images.zip b/revisitingthesiblingheadinobjectdetector/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..46085edc56a9214e6c98f502eb48e826afedef86 --- /dev/null +++ b/revisitingthesiblingheadinobjectdetector/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:286799a3fabe0dbd176881085faee4b651db07134f95943627b13a26aa770162 +size 725190 diff --git a/revisitingthesiblingheadinobjectdetector/layout.json b/revisitingthesiblingheadinobjectdetector/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1766a390f1fde3086712f4fae5565b400c2bfdda --- /dev/null +++ b/revisitingthesiblingheadinobjectdetector/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:279b23c147975f15265725b9da45b16f49fd43808f78cdb419e05efa6d75439f +size 450057 diff --git a/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_content_list.json b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..17559deaf9b2eb1b98cd5d1235912e8c4cf4e60f --- /dev/null +++ b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b30928cff8e2c5dbad13876e7f9e636101b18d48ee851eb4319d9409207ed1c +size 77087 diff --git a/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_model.json b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_model.json new file mode 100644 index 0000000000000000000000000000000000000000..26e40b3c41e708f5f0baede82ad1bfb71508905a --- /dev/null +++ b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:947b260ff7de7b6b2282c0b19692f54e634a3141193db1d66a14f56c065626b5 +size 96086 diff --git a/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_origin.pdf b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ec1aa681c17e1e370ccb935ed6334f72107aa93 --- /dev/null +++ b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/1b0456e9-12eb-4b10-a2ca-1aaf78686a62_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df70158511e392e2c627ca5093123c26c46456bf559ad6aa93c6fe914a6a7154 +size 7195181 diff --git a/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/full.md b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8a89251583c9523140f2ddd64988e3b70250c327 --- /dev/null +++ b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/full.md @@ -0,0 +1,343 @@ +# RiFeGAN: Rich Feature Generation for Text-to-Image Synthesis from Prior Knowledge + +Jun Cheng $^{1,2}$ , Fuxiang Wu $^{1,2*}$ , Yanling Tian $^{3}$ , Lei Wang $^{1,2}$ , Dapeng Tao $^{4}$ +$^{1}$ CAS Key Laboratory of Human-Machine Intelligence-Synergy Systems, Shenzhen Institutes of Advanced Technology, CAS, China +2 The Chinese University of Hong Kong, Hong Kong, China +3 Graduate School of Information, Production and Systems, Waseda University, Japan +$^{4}$ School of Information Science and Engineering, Yunnan University, China + +{jun.cheng,fx.wul,lei.wang1}@siat.ac.cn,tianyanling@fuji.waseda.jp,dptao@ynu.edu.cn + +# Abstract + +Text-to-image synthesis is a challenging task that generates realistic images from a textual sequence, which usually contains limited information compared with the corresponding image and so is ambiguous and abstractive. The limited textual information only describes a scene partly, which will complicate the generation with complementing the other details implicitly and lead to low-quality images. To address this problem, we propose a novel rich feature generation text-to-image synthesis, called RiFeGAN, to enrich the given description. In order to provide additional visual details and avoid conflicting, RiFeGAN exploits an attention-based caption matching model to select and refine the compatible candidate captions from prior knowledge. Given enriched captions, RiFeGAN uses self-attentional embedding mixtures to extract features across them effectually and handle the diverging features further. Then it exploits multi-captions attentional generative adversarial networks to synthesize images from those features. The experiments conducted on widely-used datasets show that the models can generate images from enriched captions effectually and improve the results significantly. + +# 1. Introduction + +Generating realistic images from text descriptions is one of the most active research areas in recent years [10, 12, 16, 21, 24, 26, 33, 37]. Since natural language is one of the easiest ways to interact with people, text-to-image synthesis plays an important role in many areas, like the dual learning mechanism in captioning [31], and has wide potential applications, for instance, art generation, computer-aided design, and early-childhood education. Recently, many meth + +1) this bird is yellow with black and has a long, pointy beak. +(2) the bird has a black body with yellow belly and black crown and bill. +3) a small bird with black crown and throat and yellow wingbars and belly. +(4) a bird with a yellow bottom half and black upper half with black yellow and white .... +(5) yellow belly bird with black throat, crown, and wings with a white wingbars. +6) this bird is yellow with black and has a long beak. +7) this is a black bird with a yellow abdomen and tail coverts. +8) this bird is yellow with black and has a yellow belly. +9) this bird has wings that are black and has a yellow belly. +10) this bird has a yellow belly and a black head and wing. + +![](images/dc6122c0b4c9a8437e8d8863d57beb8f0492b0d78e05c63f10a0848a69eb24da.jpg) +(a) Real Image + +![](images/6d263d4c7886c2b6a6bde3759672ea5dd9dbec5cd3b5e9c04aa948bbf529657b.jpg) +(b) DM-GAN + +![](images/3ae56ec30ddb4f6d4200cc98aaf66ad5fb15a7aa4ac7515e8d0b707fd6348162.jpg) +(c) Our +Figure 1. Captions and their corresponding images: $(a)$ is a real image; $(b)$ is generated by DM-GAN [37] with the first caption; $(c)$ is synthesized by our model without SAEMs with all captions; $(d)$ is synthesized by our model with all captions. The bold words in a caption indicate the prominent features of a bird, and a caption only describes part of the features. + +![](images/3b37743878e129a1e3d840af42718c3f4085ab123bb95e10a7633484b1e2b34b.jpg) +(d) Our + +ods have focused on improving generators of Generative Adversarial Networks (GANs) [8], like BigGANs [5], and training methods, such as Wasserstein GANs [2,9], to synthesize high-quality images. However, due to the ambiguity, abstraction and limited information of natural language, one caption lacks of much detailed information of objects. Thus the conditional generator is required to complement those details, which will make the generator complex and its training difficult. + +As shown in Fig.1, each caption only describes part of the features of a bird $(a)$ . Training with several corresponding captions from the same image, such as captions of $I$ - $10$ , can be simultaneously exploited to provide more detailed information. Therefore, the generated image $(d)$ is closer to the real image, compared with image $(b)$ synthesized with only one caption with limited information. + +Moreover, a large set of captions is hard to be handled directly to synthesize images. Thus image $(c)$ generated by our model without self-attentional embedding mixtures (SAEMs) is worse than image $(d)$ . To alleviate the problem of limited information and generate desirable visual details efficiently, additional captions, explicit complement, should be retrieved to enrich the description. To retrieve the compatible captions, we introduce an attention-based caption matching model to select candidate captions from prior knowledge built by the training dataset. The complement captions are selected from the candidates by comparing their embedding and the given one's to improve semantic consistency. For example, given the first caption 1) in Fig. 1, the others can be retrieved as complements to provide additional information. + +More captions can provide more visual details, but understanding their semantic meaning will be much harder since even understanding a long caption is not a trivial task. To resolve this dilemma, we transform the complex task of understanding the full captions into a relatively simpler task of understanding one caption and fusing the representations of the captions. Thus, we extract features from each caption via using an attentional model, followed by self-attentional embedding mixtures (SAEMs) to fuse those embeddings. + +In summary, this work has the following contributions: + +- We propose a novel framework called RiFeGAN for enriching the given caption from prior knowledge, formed by the training dataset, to tackle the problem of limited information and improve the quality of synthesized images. +- We introduce a caption matching method, by using an attentional text-matching model, to retrieve compatible captions from prior knowledge automatically. Then, multicaptions attentional GANs with SAEMs to extract rich features are exploited to synthesize high-quality images. Consequently, we improve the performance on widely-used datasets significantly. + +# 2. Related Work + +In this section, we review the recent works of text matching and text-to-image synthesis. + +Text Matching: Pang et al. [18] model text matching as image recognition. They construct a matching matrix represented the similarities between words and utilize a convolutional neural network to capture matching patterns. Wan et al. [29] propose a deep architecture exploiting positional sentence representations, generated by a bidirectional long short term memory (Bi-LSTM), k-Max pooling, and a multi-layer perceptron, to match two sentences. Lee et al. [14] propose a Stacked Cross Attention model to align image regions and words and compute the image-text similarity. Yang et al. [32] present a fast and strong RE2 with multiple alignment processes to match two sentences. + +Most of GANs-based generative methods have achieved + +great progress on image generation and will be introduced from four aspects as follows: + +Generating with One Caption: Reed et al. [21] exploit deep symmetric structured joint embedding strategy to create visually-discriminative embeddings of text descriptions and propose an effective conditional GAN to synthesize plausible images according to the embeddings. Zhang et al. [35] transform the complex generating problem into several sub-problems and exploit multiple generators arranged in a tree-like structure to synthesize images progressively. Besides, they introduce a conditioning augmentation to stabilize the training process. Zhang et al. [36] introduce a single-stream generator architecture, which applies the hierarchical-nested adversarial objectives to regularize mid-level representations, to adapt jointed discriminators better and generate high-resolution images. + +Generating with One Caption and Understanding: Qiao et al. [19] propose a LeicaGAN to learn and imagine the prior of the diverse objects about semantics, textures, colors, shapes, and layouts. Qiao et al. [20] introduce a MirrorGAN to connect the dual tasks, text-to-image synthesis and text captioning, and constrain the regenerated caption aligning with the given caption. + +Generating with One Caption Attentionally: Xu et al. [30] propose multi-stage AttnGANs that synthesize different parts of a scene by focusing on different words in a caption. At the first stage, the generator uses the sentence embedding to synthesize an image. In the next stage, the word-context features are calculated by an attentional model and fed into the next generator. Based on AttnGANs, Zhu et al., [37] propose the Dynamic Memory Generative Adversarial Network (DM-GAN) to address the problems of heavily relying on the initial images and unchanged text representation in different stages. + +Generating with Multi-captions: Sharma et al. [24] extend the caption by adding a dialogue describing the scene further. Then the Skip-thought [13] or recurrent neural networks (RNNs) [1, 23] are exploited to get the embedding of the dialogue, and the StackGAN [35] is employed to generate images. Joseph et al. [11] propose Cross-Caption Cycle-Consistent (C4Synth) models to synthesize an image from multiple captions. They are inspired by CycleGAN and construct image generators, text captioners, and the discriminators. The models take the noise and the first caption to generate an image, followed by a discriminator to classify it from the real one and a captioner to generate the caption that should be similar to the next real caption. Next, the models iteratively process the remaining captions as described previously by replacing the noise with the output features of the previous generator. Thus, to generate an image, the generator needs to run as many times as the number of captions. + +Difference to Existing Works: Chatpainter [24] ex + +![](images/0a79dc4232af8f07fb1bd79a316eff452f57e047dcac7a4fc24cbfc048b3285c.jpg) +Figure 2. Model structure: given a caption, several captions, enriched features, will be retrieved from the knowledge base by exploiting text matching and refining models. + +ploits Skip-thought or RNNs to encode the sentences of dialogue to compute the embedding, then directly feeds the embedding into the StackGAN to synthesize images. Our work utilizes caption matching to enrich the descriptions and exploit SAEMs to extract features from multi-captions in an attentional framework. The results demonstrate the effectivity of our models. C4Synth [11] needs to run many times to synthesize an image, and the models need captioning models to generate captions, which makes the models more complex in training. Different from them, our work directly exploits a caption with enriched or multiple captions so that the full generator only executes only one time per image, and does not need the captioning model to help the training. Moreover, our work, firstly, exploits caption enriching to generate rich features and SAEMs to utilize multi-captions more effectively and achieves significant improvement. + +# 3. Text-to-Image Synthesis with Rich Feature + +In Fig 2, given a caption, we firstly enrich it instead of synthesizing images directly. In the caption matching, since there are several captions of an image in common datasets, similar to human memory, we treat each image and its captions of the training part as an item in the knowledge base (memories). Thus, the enriching process will retrieve the compatible items from the knowledge base and refine the captions of the items to return the best complement as the middle part of Fig. 2. Then, given enriched captions, an attentional GAN with SAEMs is introduced to synthesize images with the captions efficiently. + +# 3.1. Caption Matching with Prior Knowledge + +Given a caption, caption matching needs to return its compatible captions to enhance it, which are hard tasks in NLP. In order to simplify this problem, we treat the problem as an information retrieval problem and recall the relevant captions from the training dataset. Thus, given a dataset, we treat it as prior knowledge, a knowledge base $\Omega = \{\omega_i\}$ , where each item $\omega_{i}$ consists of an image $I_{i}$ and its captions $\{t_{i,k}\}_{k = 0}^{N^T}$ . Given a caption $t$ and an item $\omega_{i}$ , to evaluate their compatible score, we exploit RE2 [32], a fast and strong neural architecture for general purpose text match + +ing, to measure their score as, + +$$ +S _ {c o m p a t} (t, \omega_ {i}) = \frac {1}{N ^ {T}} \sum_ {k = 0} ^ {N ^ {T}} S _ {R E 2} (t, t _ {i, k}) \tag {1} +$$ + +where scorer $S_{RE2}(t_1, t_2)$ returns the matching score of given captions $t_1$ and $t_2$ . The scorer consists of several encoders, alignment layers, and fusion layers as shown in the second block of Fig. 2. The encoders stack several convolutional networks with the same padding to extract context embedding of words instead of recurrent networks. The alignment layer computes aligned representations of two sequences $\{c_{1,i}\}$ and $\{c_{2,i}\}$ as, + +$$ +\left\{ \begin{array}{l} c _ {1, i} ^ {\prime} = \sum_ {j} \alpha_ {i, j} ^ {\prime} \cdot c _ {2, j} \\ c _ {2, i} ^ {\prime} = \sum_ {j} \alpha_ {j, i} ^ {\prime} \cdot c _ {1, j} \end{array} \right. \tag {2} +$$ + +where $\alpha_{i,j}^{\prime}$ is an attentional weight proportional to the dot product of $c_{1,i}$ and $c_{1,j}$ . Fusion layers consist of feedforward networks to fuse $c_{*,i}^{\prime}$ and $c_{*,i}$ . Then, the multi-layer feed-forward neural network is exploited to return their matching score. + +Since the captions $\{t_{i,k}\}_{k = 0}^{NT}$ of item $\omega_{i}$ depict $I_{i}$ simultaneously, they are compatible with each other. Thus, we construct a positive sample $(t_i,\omega_{i,c})$ by selecting a caption from an item $\omega_{i}$ as $t_i$ randomly, and select the rest of the item as the context $\omega_{i,c}$ . Because the captions of different classes are likely conflicted with each other, we construct the negative samples $(t_{r(i)},\omega_{i,c})$ by selecting a caption $t_{r(i)}$ of $\omega_{r(i)}$ , where $r(i)\neq i$ returns a random index to $\Omega$ , and the classes of indexed items are different. Therefore, similar to the Pairwise Ranking Loss focusing on relative preferences between items, the compatible score is formed as a logistic regression, and the training loss is as follows, + +$$ +\begin{array}{l} L _ {c o m p a t} (\Omega) = - \frac {1}{N ^ {T}} \sum_ {i = 0} ^ {N ^ {T}} \sigma \left(S _ {c o m p a t} \left(t _ {i}, \omega_ {i, c}\right)\right) \tag {3} \\ + \sigma \left(S _ {c o m p a t} \left(t _ {r (i)}, \omega_ {i, c}\right)\right) \\ \end{array} +$$ + +where $\sigma$ is a sigmoid function. Given a caption $t$ , the K-best candidate captions, denoted by $\Omega_K(t)$ , can be retrieved from $\Omega$ by using Eq. 1. To improve the semantic consistency and exclude the conflicted captions further, we refine the captions by selecting $N^{test}$ captions whose embeddings are more closer to that of $t$ than others in terms of cosine similarity. + +![](images/42a1ac73e8e55f2e172424a22e7b652792f3823fdea516c5f97f6a3d7ca7bd39.jpg) +Figure 3. The processing flow of multi-captions attentional GANs with SAEMs: $F_{i}$ is an upsampling module; $G_{i}$ and $D_{i}$ are the generator and discriminator respectively; $F_{i}^{attn}$ is an attention module taking $h_{i}$ and word embeddings as input; SAEM and MultiCaps-DAMSM state for self-attentional embedding mixer and multi-captions deep attentional multimodal similarity model respectively. + +# 3.2. Multi-captions Attentional GANs + +In text-to-image synthesis, given a caption, its embedding $e$ is created by using a text encoder and fed into conditional GANs to generate images. AttnGAN [30] can efficiently draw different sub-regions with different words. Thus, as described in Fig. 3, we construct the attentional GANs with SAEMs and MultiCaps-DAMSM, which will be elaborated in the following part, to support multicaptions. $F_{1}$ is an upsampling module which consists of a fully connected layer, followed by several upsampling modules constructed by an upsampling layer, a $3\times 3$ convolutional layer, a batch normalization layer, and a gated linear layer. $F_{2}$ and $F_{3}$ are upsampling modules which consist of several residual networks and an upsampling module. The module $G_{i}$ converts the inner feature $h_i\in R^{N_i\times N_w\times N_h}$ into an image by using a $3\times 3$ convolutional layer and a tanh activation function. $D_{i}$ is a discriminator constructed by several convolutional layers, batch normalization layers, and leaky rectified linear units. $F_{i}^{\text{attn}}$ is an attention module which takes the word features $w$ and the inner feature $h_{i}$ as input and computed as follows, + +$$ +F _ {i} ^ {a t t n} (h _ {i}, w) = \left[ \sum_ {k = 1} ^ {T} \alpha_ {1, k} w _ {k}, \dots , \sum_ {k = 1} ^ {T} \alpha_ {N _ {3}, k} w _ {k} \right] \quad (4) +$$ + +where $N_{3} = N_{w}\cdot N_{h}$ ; $\mathrm{T}$ is the length of $w$ ; the attentional weights are computed as, + +$$ +\alpha_ {j, k} = \frac {\exp \left(s _ {j , k}\right)}{\sum_ {k} \left(\exp \left(s _ {j , k}\right)\right)} \tag {5} +$$ + +where $s_{j,k}$ is the dot product of $h_{i,j}$ and $w_{k}$ ; $F_{ca}$ is the Conditioning Augmentation [35] projecting the text embedding into a lower conditional space to enforce the smoothness and encourage robustness. + +In Fig. 3, given a set of captions $\mathbf{T} = \{t_j\}_{j=0}^{N_T}$ , we exploit text encoders $f_{word}^{txt}$ and $f_{cap}^{txt}$ , which are bi-direction Long Short-Term Memories (LSTMs) [23], to extract the word features and the sentence feature of $t_j$ . In the first stage, $F_1$ takes $\hat{c}$ , the total feature computed by a SAEM, as input to + +calculate the inner features $h_1$ and synthesize an image. In the next stage, the attentional model $F_1^{attn}$ takes the word features and $h_1$ as input to get the attentional features for each caption, followed by a SAEM to compute the total attentional features $\hat{w}_1^j$ . Then $\hat{w}_1^j$ and $h_1$ are combined to synthesize the larger image by $F_2$ and $G_2$ . The third stage is similar to the second stage except MultiCaps-DAMSM will introduce an additional constraint in training. + +# 3.2.1. Self-Attentional Embedding Mixture + +Attention-based models have been applied successfully in many areas, like the dual task, captioning [7, 15]. Moreover, Zhang et al. [34] introduce a self-attention mechanism into convolutional GANs and achieve significant improvement in terms of Inception score [22]. Thus, we introduce SAEMs to fuse the embeddings of captions. Given the hidden state $h_i$ , generated by $F_i$ , for each $t_j$ , its corresponding embeddings are calculated as follows, + +$$ +\left\{ \begin{array}{l} \hat {c} ^ {j} = F _ {c a} \left(f _ {c a p} ^ {t x t} \left(t _ {j}\right)\right) \\ \hat {w} _ {i} ^ {j} = F _ {i} ^ {\text {a t t n}} \left(h _ {i}, f _ {\text {w o r d}} ^ {t x t} \left(t _ {j}\right)\right) \end{array} \right. \tag {6} +$$ + +where $\hat{c}^j\in R^{N_c}$ is the whole embedding of $t_j$ . $\hat{w}_i^j\in$ $R^{N_i\times N_i\times N_w}$ is the conditional embedding where each element focuses on different words. Therefore, in order to extract the whole embedding of captions $\mathbf{T}$ , we exploit selfattentional module [27] to fuse those embeddings as follows, + +$$ +\left\{ \begin{array}{l} \hat {c} = f _ {\text {m a x}} \left(f _ {\text {p o s w}} \left(L _ {\text {M H A}} \left(\left[ \hat {c} ^ {0}, \hat {c} ^ {1}, \dots , \hat {c} ^ {N _ {T}} \right]\right)\right)\right) \\ \hat {w} _ {i} = f _ {\text {m a x}} \left(f _ {\text {p o s w}} \left(L _ {\text {M H A}} \left(\left[ \hat {w} _ {i} ^ {0}, \hat {w} _ {i} ^ {1}, \dots , \hat {w} _ {i} ^ {N _ {T}} \right]\right)\right)\right) \end{array} \right. \tag {7} +$$ + +where $f_{max}(x)$ returns a tensor, the element of which is maximal across columns of $x$ ; $f_{posw}$ is the Position-wise Feed-Forward Networks, $L_{MHA}(v)$ is a multi-head attenuated version of the feedforward network. + +![](images/eff5f6d77ddcd73cb2eb46ee6bd5062a6ec3500e6bf09f2f22c415efef4f454d.jpg) +Figure 4. Multi-captions deep attentional multimodal similarity model. + +tion layer as follows, + +$$ +\begin{array}{l} L _ {M H A} (v) = \\ L _ {n l} \left(L _ {d r o p} \left(\left[ \begin{array}{c} H _ {0} (v) \\ \dots \\ H _ {N _ {H}} (v) \end{array} \right] ^ {T} \cdot M _ {3}\right) + v\right) \end{array} \tag {8} +$$ + +where $M_3 \in R^{N_H \cdot N_i \times N_i}$ is a projecting matrix; $L_{nl}$ is a layer normalization. The attentional function $H_i(E)$ is defined as, + +$$ +H _ {k} (v) = L _ {a t t} \left(M _ {4, 1} ^ {k} \cdot v, M _ {4, 2} ^ {k} \cdot v, M _ {4, 3} ^ {k} \cdot v\right) \tag {9} +$$ + +where $M_{4,1}^{j}, M_{4,2}^{j}, M_{4,3}^{j} \in R^{N_{i} \times N_{i}}$ are the matrixes projecting the input embedding into question, key, value space, respectively. The function $L_{att}(Q, K, V) = \text{softmax}(\beta \cdot Q \cdot K^{T}) \cdot V$ is the Scaled Dot-Product Attention [27], where $\beta$ is a scale value to counteract the problem of small gradients. + +# 3.2.2. Multi-Caps DAMSM + +As shown in Fig. 4, we consider the captions $\mathbf{T}$ simultaneously and employ the DAMSM [30] to guide the generator. Therefore, the Multi-Caps DAMSM loss is defined as, + +$$ +\hat {L} _ {D A M S M} (I, \mathbf {T}) = \sum_ {k = 0} ^ {N _ {T}} \mu_ {k} \cdot L _ {D A M S M} (I, t _ {k}) \tag {10} +$$ + +where $\mu_{k}$ is the weight of the sentence $t_k$ to indicate its importance. Eq. 10 forces the generated image $I$ to fit the whole descriptions $\mathbf{T}$ . $L_{DAMSM}(Q,D)$ is the loss of DAMSM as, + +$$ +\begin{array}{l} L _ {D A M S M} (I, t _ {k}) = L _ {1} ^ {w} \left(f _ {\text {p a r t}} ^ {\text {i m g}} (I), f _ {\text {w o r d}} ^ {\text {t x t}} (t _ {k})\right) \\ + L _ {2} ^ {w} \left(f _ {\text {p a r t}} ^ {\text {a m g}} (I), f _ {\text {w o r d}} ^ {\text {t x t}} \left(t _ {k}\right)\right) \\ + L _ {1} ^ {s} \left(f _ {\text {f u l l}} ^ {\text {i m g}} (I), f _ {\text {c a p}} ^ {\text {t x t}} \left(t _ {k}\right)\right) \tag {11} \\ + L _ {2} ^ {s} \left(f _ {f u l l} ^ {i m g} (I), f _ {c a p} ^ {t x t} \left(t _ {k}\right)\right) \\ \end{array} +$$ + +where $L_1^w, L_2^w$ and $L_1^s, L_2^s$ are the word and sentence loss functions [30] describing the matching probability between the images and their corresponding captions. Given a batch of image-sentence pairs, $L_1^w$ computes the cross entropy loss of the similarities between images and captions; The similarity between an image $I$ and a caption $t$ is computed by using the cosine similarity between embeddings + +of words and their corresponding attentional representations extracted from $I$ . $L_2^w$ , $L_1^s$ and $L_2^s$ are handled similarly. $f_{part}^{img}$ and $f_{full}^{img}$ extract the sub-region features and the global feature by using an image encoder built upon the Inception-v3 model [25], followed by a $1 \times 1$ convolutional layer and a multi-layer perceptron, respectively. + +# 3.2.3. Jointed Training Value Function + +An image synthesized by multi-captions should be conformed to those captions. Thus training with that constraint is beneficial to the generation. With the constraint of multicaptions, the total value function can be written as, + +$$ +\begin{array}{l} V \left(D _ {1}, \dots , D _ {K}, G _ {1}, \dots , G _ {K} | \mathbf {T}\right) = \\ \begin{array}{l} \sum_ {i = 1} ^ {K} \left\{\mathbb {E} _ {\boldsymbol {x} \sim p _ {\text {d a t a}} (\boldsymbol {T})} \left[ \log D _ {i} (\boldsymbol {x} | \boldsymbol {T}) \right] + \right. \\ \left. \mathbb {E} _ {\hat {\boldsymbol {x}} \sim p _ {G _ {i}} (\boldsymbol {T})} \left[ \log \left(1 - D _ {i} (\hat {x} | \boldsymbol {T})\right) \right] \right\} + \end{array} \tag {12} \\ \boldsymbol {\lambda} \cdot \mathbb {E} _ {\hat {\boldsymbol {x}} \sim p _ {G _ {K}} (\mathbf {T})} [ \hat {L} _ {D A M S M} (\hat {\boldsymbol {x}}, \mathbf {T}) ]. \\ \end{array} +$$ + +where $\hat{\pmb{x}}\sim p_{G_i}(\mathbf{T})$ is the image synthesized by the generator $G_{i}$ , given the condition $\mathbf{T}$ ; $\lambda$ is a hyper-parameter for adjusting the constraint; $K$ is the number of the stages of the generators. + +# 4. Experiments + +# 4.1. Datasets + +We conduct experiments on widely-used datasets, Caltech-UCSD Birds-200-2011 (CUB200) [28] and Oxford-Flower-102 (Oxford102) [17] datasets. Each image in the datasets has 10 captions to describe the fine-grained visual details. Following the works [30, 35], we use the same settings and employ the class zero-shot setting. Despite notable flaws [3] of Inception score, we adopt the fine-tuned Inception models1 to measure the results since it prefers meaningful and diversifying images. In addition to the Inception score, following Xu et al. [30], we exploit the R-precision to measure the caption-image alignment. Specifically, given one ground truth caption and 99 mismatching captions selected randomly, if the cosine similarity between the ground truth and the image is higher than that of others, the retrieving is relevant. The R-precision is the ratio of the relevant in retrieving captions. Since the text-to-image synthesize utilizes several captions explicitly or implicitly, we report the average R-precision between an image $x$ and its caption set $T$ . Besides, we analyze the R-precision between an image and its captions as supplementary. + +# 4.2. Quantitative Results + +The Inception scores for CUB200 and Oxford102 are shown in Tab. 1, where the baseline systems are taken from AttnGAN [30] and DM-GAN [37]. We evaluate the models with the whole dataset as the knowledge base to retrieve + +Table 1. Inception scores on CUB200 and Oxford102 datasets + +
DatasetAttnGANDM-GANC4SynthOurFOurKBOurSAFOurKB
CUB2004.36 ± 0.034.75 ± 0.074.07 ± 0.134.90 ± 0.074.79 ± 0.045.23 ± 0.094.85 ± 0.08
Oxford1023.91 ± 0.054.03 ± 0.053.52 ± 0.154.23 ± 0.034.09 ± 0.034.53 ± 0.054.23 ± 0.05
+ +![](images/5ac9c265b837764288eeec2ea82aeabebd9145023dd6190592a21e5c63923fc5.jpg) +Figure 5. Diagram of Inception score and $N_{test}$ . + +![](images/41649df6908dd1432dc94596ccc3db8b38d695142e005909e5004e6f639e2b0b.jpg) + +![](images/68b494c8b709800af61dfa5ee754d677325e4a3e9eb26a9897145f03fdac838b.jpg) +Figure 6. Diagram of R-precision and the caption index. + +![](images/bb61bfa3b8930e93a760210c2d2f56eb3e1e369da2504aa963103726df9b3ee1.jpg) + +![](images/8111167d9b79b4c3370adbf7035de891ff7e47f58f09836130f3e9123f1209d5.jpg) +Figure 7. Diagram of Inception score and R-precision influenced by repeat times. + +![](images/f03b18db4fae7902d8d7492b67776565cc09c24067bbba72ea2b361c33b30d72.jpg) + +the best matching captions, denoted with the subscript "F". For the class zero-shot setting, we evaluate them with the knowledge base constructed by the training part of the corresponding dataset, denoted with the subscript "KB". Besides, in order to verify the generating ability, we exploit arbitrary $N_{test}$ captions to synthesize images, denoted with the subscript "RND". + +For comparison, we construct the multi-captions attentional GAN without SAEMs, $\mathrm{Our}_F$ and $\mathrm{Our}_{KB}$ , by concatenating the multi-captions into a caption and training with the multi-caps DAMSM and jointed training value function. In the setting "F", the Inception scores of our models at least increase by 0.48 on CUB200 and 0.50 on Oxford102 over the baselines. In the setting "KB", the score of $\mathrm{Our}_{KB}$ at least increases by 0.10 on CUB200 and 0.20 on Oxford102 over the baselines. Without SAEMs, the scores + +Table 2. Average R-precision on CUB200 and Oxford102 datasets + +
CUB200Oxford102
AttnGAN0.198 ± 0.0140.203± 0.015
DM-GAN0.215 ± 0.0130.199± 0.014
OurF0.182 ± 0.0120.213 ± 0.015
OurKB0.130 ± 0.0120.163± 0.014
OurSA0.238± 0.0150.267± 0.016
OurSA KB0.183± 0.0130.210 ± 0.014
Ground-truth0.225± 0.0150.215± 0.014
+ +![](images/e73cb3bc43f514bcf2fa310b3dccfb5f54876875b9481644b62c3ebe380eaf84.jpg) +Figure 8. The images synthesized with the captions: $\mathrm{Our}_F$ and $\mathrm{Our}_F^{SA}$ synthesize more semantically consistent images with the real images than DM-GAN by using the original captions, while $\mathrm{Our}_F^{SA}$ is better than $\mathrm{Our}_F$ . + +will drop 0.33 on CUB200 and 0.30 on Oxford102. In Fig. 5, Inception score is in an upward trend and higher with more captions. Besides, we evaluate Our $^{SA}$ on MS-COCO, and it largely improves the score from 25.89 to 31.70 with the original captions, comparing with AttnGAN. + +In Fig. 6, since the images are generated by using the first caption with the caption index 0, the R-precisions between the images and the 0th captions are higher than the others except for the ground truth. Besides, R-precisions between the images and the other captions are higher than that of the irrelevant selecting, because their models are trained with the pairs of an image and a caption selected from its captions randomly and would memory the visual details of other associated captions. Moreover, the R-precisions between the real image and its captions are about 0.22, which are smaller than those of synthesized images at index 0 and indicates that photo-realistic images should contain more visual details than that included in a caption. Our methods explicitly model that associative process by using multi-captions, and their R-precisions are almost higher than those of the real images for $\mathrm{Our}_{F}^{SA}$ , which shows that the synthesized images contain more relevant visual details than the real images depicted by the captions. For $\mathrm{Our}_{KB}^{*}$ , since they exploit the 0th original caption and the recalling captions, which may be not similar to other original captions, to synthesize images. The synthesized image will be close to those captions which may be different from the + +![](images/49fbc432c5de064ddac8c5fa6b22afe795541690f95341bd04e5d5c2f99e2ad4.jpg) +(a) 1. this fat little bird has a blueish gray body and a faded red head with a black mask. +2. this bird has wings that are black and has a tan belly. + +![](images/29ec1332e1502e2f5599452266cf4c264057c756ea938da164ab9c70a380f7fc.jpg) + +![](images/ee6217f939c7762f7cc02aa4ebe3f0edbee9247b2439ff212f289bd1ebfcfb0e.jpg) + +![](images/7b6be13a53488502da4fde55476e4ce3eaa5995806b0aef43c176da1a76baa4d.jpg) +Figure 9. Examples synthesized by two captions: the black bold words indicate prominent visual details, while the red words indicate conflicting visual details in captions. Words in black boxes are prominent features in generating steps, specifically, $F_1^{attn}$ and $F_2^{attn}$ . + +![](images/331ae441d73d33ebbbeee48118cd4ab59c98aca35bd2c2ca282e8b3daacdb7ce.jpg) +(b) 1. this flower has bright pink petals with yellow highlights. +2. this flower is yellow and has hundreds of slender yellow petals. + +![](images/1110e7a563e4bbacaff4d7611c64c7da4abe5d07d8c7044ee3d64c2bb7aabfc5.jpg) + +![](images/e6e7f03f4407a8f1c17bb5ea15d34157f497e38fd3b597d730aeb09ff7079ecd.jpg) + +![](images/aabb746936aa5ce901f67e8cf7fcc38b1972665696b2144d7cb24cbd5dab9250.jpg) +(d) 1. long thin yellow petals with ridged edges form two layers around a cluster of short bright yellow stamens. 2. the flower has large rounded white clored petals with yellow inner part of petals. + +![](images/d9f83f1f500d90b91549145512dff40e283dfa8b6b60fa2834d51c1e198c7cb5.jpg) + +![](images/05354cf3cfb805f52a2b1a917b7b2d0f9171075262fceaf55e8f6883b9b96601.jpg) +Figure 10. The synthesized images with increasing captions: the bold words in a caption indicate the prominent features, and $1 - b$ indicates the image is generated with the captions from the first one to the $b^{th}$ one. + +![](images/14eb2c1596b0c999e23e19d2cf4944869e9ddae1d856c5d177fc40b3eb51e0f1.jpg) + +original ones because of including additional compatible details. Thus, the R-precisions of the images and the other captions will be lower than those of real images. + +In Fig. 7, the R-precision (Inception score) of images synthesized with two captions will be lower (higher) than that with one caption. However, R-precision can be improved by repeating the corresponding caption simply to emphasize it in SAEMs as shown in Fig. 7b). The scores are listed in Tab. 2. The average scores of $\mathrm{Our}_F^{SA}$ are higher than others, specifically, increasing by 0.023 on CUB200 and 0.064 on Oxford102 over the baselines. For $\mathrm{Our}_{KB}^{SA}$ , the score is higher than those of baselines on Oxford102. On CUB200, since classes of birds are more than that of + +flowers on Oxford102, the recalling captions may be less relevant to the other original captions than those of flowers, which will result in lower scores compared with that of baselines. + +# 4.3. Qualitative Results + +In Fig. 8, the results show that images generated by $\mathrm{Our}_F$ and $\mathrm{Our}_F^{SA}$ , with the original captions, are more semantically consistent than that synthesized by DM-GAN, and $\mathrm{Our}_F^{SA}$ is more stable than $\mathrm{Our}_F$ because of the difficulty of extracting the correct visual details from a very long textual sequence. In Fig. 9(a), our models can synthesize the features "black wing" and "tan belly" in the sec + +![](images/74c937172260c303dc984ce203b9092891168c8950301241a2050c6eca029d24.jpg) +Figure 11. Synthesized examples by exploiting the recalling captions: given a caption, caption matching will retrieve the compacted items and select their captions, masked as bold, to synthesize images. + +ond caption while retaining the features "gray body" and "black mask" in the first caption. The Fig. 9(b)-(d) show similar results, which indicates our model can extract features from multi-captions effectively and synthesize images in an incremental manner. Besides, for the captions contained some conflicting features, our models will combine the conflicting features into an intermediate feature. For examples, in Fig. 9(c), the conflicting features "tan belly" and "white belly" will be combined into "pale tan belly", in Fig. 9(b), the inner of petals is pink-yellow; in Fig. 9(d), the weight of "yellow" is smaller than that of "white", namely white: $1.000>$ yellow:0.744, thus the feature "yellow petals" is unapparent. Therefore, our models can handle the conflicting features, and combine them into some reasonable intermediate representation. + +In Fig. 10, we demonstrate the generated images by adding more captions gradually, which shows that $\mathrm{Our}_F$ and $\mathrm{Our}_F^{SA}$ generate more realistic images than the baseline by utilizing more captions. Besides, it is shown that $\mathrm{Our}_F^{SA}$ can generate more relevant images than $\mathrm{Our}_F$ . For example, in the top left example, $\mathrm{Our}_F$ synthesizes an image with a blue crown when the $8^{th}$ caption is touched. However, "black crown/head" is mentioned four times before the $8^{th}$ caption, which indicates the bird should have a black crown as the images synthesized by our model $\mathrm{Our}_F^{SA}$ . Therefore, the long textual sequence constructed by concatenating captions will confuse $\mathrm{Our}_F$ that it is hard to select and retain the prominent words. Our model $\mathrm{Our}_F^{SA}$ can alleviate those issues by considering each caption individually to divide the complex problem into the easier sub-problems. In the right part of Fig. 10, we further exploit randomly selected captions to synthesize images to explore the generating ability. There are many conflicting features in the randomly selected captions, and the results show that our models can synthesize images with reasonable semantics meaning. For example, in the top right example, when the 7th caption is exploited, "duck" is the prominent feature that causes the synthesized bird similar to a duck. When using 1)-8) captions or more captions, the synthesized images retain the + +"mainly black" feature. However, there may be many conflicting features or unseen combination of some visual features in the randomly selecting captions. Therefore, the synthesized images will degrade and may be worse than the one synthesized by one caption since the large set of those features will not provide useful information to the generator but hinder it from extracting the correct features. + +In Fig. 11, we present enriching examples with the given captions. Given a caption "the bird has a small black bill and grey breast", the matching will retrieve the compact items, "retrieved item 0" and "retrieved item 1" in Fig. 11, in the knowledge base. The features of items contain both "a small black beak" and "gray breast". The images in the last row show that our model can synthesize high-quality images with more compact visual details than that of AttnGAN. For flowers, the "retrieved item 1" include the features of the given caption, while the "retrieved item 0" only contains "pink petals", thus the matching selects more captions of item 1 than that of item 0. The results demonstrate our model can synthesize high-quality images as well. + +# 4.4. Limitation and Discussion + +Our models synthesize images based on enriched multicaptions and provide more information to the generator, which alleviates the problem of limited information. The experiments show that it can improve the quality of generated images. Moreover, our model supports incrementally generating, increasing $N_{test}$ , by some interactive operations as the Neural Painter [4], and the SeqAttnGAN [6]. However, images synthesized from multi-captions is not a trivial task. It needs more sophisticated methods in natural language understanding and image synthesis to improve the performance further, such as semantic sentence embeddings [38] and BigGANs [5], which will be our future works. + +# 5. Conclusion + +In this paper, to address the problem of limited information on the text descriptions and extract high-quality features, we propose a novel text-to-image synthesis model, RiFeGAN, to enrich the given caption and exploit enriched multi-captions to synthesize images. The experiments conducted on widely-used datasets show that our models can synthesize more realistic images and improve Inception scores significantly. Moreover, the results demonstrate that the models can effectively extract visual details across multi-captions even in the conflicting captions. + +# Acknowledgments + +This work was supported in part by the National Natural Science Foundation of China (U1713213, 61772508, 61772455, U1913202, U1813205), in part by CAS Key Technology Talent Program. + +# References + +[1] Abrar H. Abdulnabi, Bing Shuai, Zhen Zuo, Lap-Pui Chau, and Gang Wang. Multimodal recurrent neural networks with information transfer layers for indoor scene labeling. IEEE Transactions on Multimedia, 20(7):1656-1671, 2018. +[2] Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. In Proceedings of International Conference on Machine Learning, ICML, volume 1, pages 298-321, 2017. +[3] Shane Barratt and Rishi Sharma. A note on the inception score. arXiv preprint arXiv:1801.01973, 2018. +[4] Ryan Y Benmalek, Claire Cardie, Serge Belongie, Xiadong He, and Jianfeng Gao. The neural painter: Multi-turn image generation. arXiv preprint arXiv:1806.06183, 2018. +[5] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. In Proceedings of International Conference on Learning Representations, ICLR, 2019. +[6] Yu Cheng, Zhe Gan, Yitong Li, Jingjing Liu, and Jianfeng Gao. Sequential attention gan for interactive image editing via dialogue. arXiv preprint arXiv:1812.08352, 2018. +[7] Lianli Gao, Zhao Guo, Hanwang Zhang, Xing Xu, and Heng Tao Shen. Video captioning with attention-based LSTM and semantic consistency. IEEE Transactions on Multimedia, 19(9):2045-2055, 2017. +[8] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Proceedings of Advances in Neural Information Processing Systems, NeurIPS, pages 2672-2680, 2014. +[9] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. In Proceedings of Advances in Neural Information Processing Systems, NeurIPS, pages 5768-5778, 2017. +[10] Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 1219–1228, 2018. +[11] KJ Joseph, Arghya Pal, Sailaja Rajanala, and Vineeth N Balasubramanian. C4synth: Cross-caption cycle-consistent text-to-image synthesis. arXiv preprint arXiv:1809.10238, 2018. +[12] Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. arXiv preprint arXiv:1807.03039, 2018. +[13] Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Proceedings of Advances in Neural Information Processing System, NeurIPS, pages 3294-3302, 2015. +[14] Kuanghuei Lee, Xi Chen, Gang Hua, Houdong Hu, and Xiaodong He. Stacked cross attention for image-text matching. In Proceedings of European Conference on Computer Vision, ECCV, pages 212-228, 2018. +[15] Linghui Li, Sheng Tang, Yongdong Zhang, Lixi Deng, and Qi Tian. Gla: Global-local attention for image description. IEEE Transactions on Multimedia, 20(3):726-737, 2018. + +[16] Yitong Li, Zhe Gan, Yelong Shen, Jingjing Liu, Yu Cheng, Yuexin Wu, Lawrence Carin, David Carlson, and Jianfeng Gao. Storygan: A sequential conditional gan for story visualization. arXiv preprint arXiv:1812.02784, 2018. +[17] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Proceedings of Computer Vision, Graphics & Image Processing, ICVGIP, pages 722-729. +[18] Liang Pang, Yanyan Lan, Jiafeng Guo, Jun Xu, Shengxian Wan, and Xueqi Cheng. Text matching as image recognition. In AAAI Conference on Artificial Intelligence, pages 2793-2799, 2016. +[19] Tingting Qiao, Jing Zhang, Duanqing Xu, and Dacheng Tao. Learn, imagine and create: Text-to-image generation from prior knowledge. In Advances in Neural Information Processing Systems, pages 885-895. 2019. +[20] Tingting Qiao, Jing Zhang, Duanqing Xu, and Dacheng Tao. Mirrorgan: Learning text-to-image generation by redescription. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1505-1514, 2019. +[21] Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In Proceedings of International Conference on Machine Learning, ICML, pages 1681-1690, 2016. +[22] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Proceedings of Advances in Neural Information Processing Systems, NeurIPS, pages 2234-2242, 2016. +[23] Mike Schuster and Kuldip K Paliwal. Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing, 45(11):2673-2681, 1997. +[24] Shikhar Sharma, Dendi Suhubdy, Vincent Michalski, Samira Ebrahimi Kahou, and Yoshua Bengio. Chatpainter: Improving text to image generation using dialogue. In Proceedings of International Conference on Learning Representations Workshop, 2018. +[25] 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, CVPR, pages 2818-2826, 2016. +[26] Fuwen Tan, Song Feng, and Vicente Ordonez. Text2scene: Generating abstract scenes from textual descriptions. arXiv preprint arXiv:1809.01110, 2018. +[27] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of Advances in Neural Information Processing Systems, NeurIPS, pages 5998-6008, 2017. +[28] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. (CNS-TR-2011-001), 2011. +[29] Shengxian Wan, Yanyan Lan, Jiafeng Guo, Jun Xu, Liang Pang, and Xueqi Cheng. A deep architecture for semantic matching with multiple positional sentence representations. + +In AAAI Conference on Artificial Intelligence, volume 16, pages 2835-2841, 2016. +[30] Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, and Xiaodong He. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 1316-1324, 2018. +[31] Min Yang, Wei Zhao, Wei Xu, Yabing Feng, Zhou Zhao, Xiaojun Chen, and Kai Lei. Multitask learning for cross-domain image captioning. IEEE Transactions on Multimedia, 21(4):1047-1061, 2019. +[32] Runqi Yang, Jianhai Zhang, Xing Gao, Feng Ji, and Haiqing Chen. Simple and effective text matching with richer alignment features. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4699-4709, 2019. +[33] Mingkuan Yuan and Yuxin Peng. Text-to-image synthesis via symmetrical distillation networks. In Proceedings of ACM Multimedia Conference, ACM MM, pages 1047-1415, 2018. +[34] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv preprint arXiv:1805.08318, 2018. +[35] Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaogang Wang, Xiaolei Huang, and Dimitris N. Metaxas. Stackgan++: Realistic image synthesis with stacked generative adversarial networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018, doi:10.1109/TPAMI.2018.2856256. +[36] Zizhao Zhang, Yuanpu Xie, and Lin Yang. Photographic text-to-image synthesis with a hierarchically-nested adversarial network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 6199-6208, 2018. +[37] Minfeng Zhu, Pingbo Pan, Wei Chen, and Yi Yang. DMGAN: dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 5802-5810, 2019. +[38] Xunjie Zhu, Tingfeng Li, and Gerard de Melo. Exploring semantic properties of sentence embeddings. In Proceedings of Annual Meeting of the Association for Computational Linguistics, ACL, pages 632-637, 2018. \ No newline at end of file diff --git a/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/images.zip b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4dcff6cfd90928f1338e83736a13cbe58919219 --- /dev/null +++ b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd52aafcc3e206bdb95616fd46f9d0511a8efd122cb5edbcf5358848ec1309ba +size 901393 diff --git a/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/layout.json b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..18d63764cb5d7b75c985ac324360757ba71f883a --- /dev/null +++ b/rifeganrichfeaturegenerationfortexttoimagesynthesisfrompriorknowledge/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bba1541e68334bcfdd5155dd6f73dc242b66c30acad52bc3494326f90b5ad24 +size 476418 diff --git a/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_content_list.json b/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7e2964dc03c4d6aeca2a4eeaf1bce9da53e4a5a2 --- /dev/null +++ b/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:524c137709e29fa00c2a4ab2933c709a67599382c94c9c7ebcaccf0d2b2271fd +size 74796 diff --git a/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_model.json b/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..56e34fd641599e58909e0b6a0237f3a3119c1ce9 --- /dev/null +++ b/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f570c5853af00bf62a307ec9711036bfb98dad50270778e2485f631a606ef4ec +size 98458 diff --git a/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_origin.pdf b/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..618078766ba7e54b77f9603c3e62ca1a1c497ee1 --- /dev/null +++ b/robothoranopensimulationtorealembodiedaiplatform/38148b08-adfe-4546-8d03-02a9c5068b7b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:804ec5c56cc075a34304f0cca7e26c0ff3875b153fe535e52734efe62dcd0294 +size 2540867 diff --git a/robothoranopensimulationtorealembodiedaiplatform/full.md b/robothoranopensimulationtorealembodiedaiplatform/full.md new file mode 100644 index 0000000000000000000000000000000000000000..38e63b30b3af8be76c1d9e6a324ddebbda73dfcb --- /dev/null +++ b/robothoranopensimulationtorealembodiedaiplatform/full.md @@ -0,0 +1,277 @@ +# RoboTHOR: An Open Simulation-to-Real Embodied AI Platform + +Matt Deitke $^{2*}$ , Winson Han $^{1*}$ , Alvaro Herrasti $^{1*}$ , Aniruddha Kembhavi $^{1,2*}$ , Eric Kolve $^{1*}$ , Roozbeh Mottaghi $^{1,2*}$ , Jordi Salvador $^{1*}$ , Dustin Schwenk $^{1*}$ , Eli VanderBilt $^{1*}$ , Matthew Wallingford $^{2*}$ , Luca Weihs $^{1*}$ , Mark Yatskar $^{1*}$ , Ali Farhadi $^{2}$ $^{1}$ PRIOR @ Allen Institute for AI $^{2}$ University of Washington ai2thor.allenai.org/robothor + +![](images/8c953b67958e888704a1a119acf93f9bf7d86218cb3d1c84f4d0abe0d0d86d79.jpg) +Figure 1: We present ROBOTHOR, a platform to develop and test embodied AI agents with corresponding environments in simulation and the physical world. The complexity of environments in ROBOTHOR along with disparities in appearance and control dynamics between simulation and reality pose new challenges and open many avenues for further research. + +# Abstract + +Visual recognition ecosystems (e.g. ImageNet, Pascal, COCO) have undeniably played a prevailing role in the evolution of modern computer vision. We argue that interactive and embodied visual AI has reached a stage of development similar to visual recognition prior to the advent of these ecosystems. Recently, various synthetic environments have been introduced to facilitate research in embodied AI. Notwithstanding this progress, the crucial question of how well models trained in simulation generalize to reality has remained largely unanswered. The creation of a comparable ecosystem for simulation-to-real embodied AI presents many challenges: (1) the inherently interactive nature of the problem, (2) the need for tight alignments between real and simulated worlds, (3) the difficulty of replicating physical conditions for repeatable experiments, (4) and the associated cost. In this paper, we introduce ROBOTHOR to democratize research in interactive and embodied visual AI. ROBOTHOR offers a framework of simulated environments + +paired with physical counterparts to systematically explore and overcome the challenges of simulation-to-real transfer, and a platform where researchers across the globe can remotely test their embodied models in the physical world. As a first benchmark, our experiments show there exists a significant gap between the performance of models trained in simulation when they are tested in both simulations and their carefully constructed physical analogs. We hope that ROBOTHOR will spur the next stage of evolution in embodied computer vision. + +# 1. Introduction + +For decades, the AI community has sought to create perceptive, communicative and collaborative agents that can augment human capabilities in real world tasks. While the advent of deep learning has led to remarkable breakthroughs in computer vision [33, 24, 48] and natural language processing [45, 16], creating active and intelligent embodied agents continues to be immensely challenging. + +The widespread availability of large and open, computer + +vision and natural language datasets [50, 34, 47, 66], massive amounts of compute, and standardized benchmarks have been critical to this fast progress. In stark contrast, the considerable costs involved in acquiring physical robots and experimental environments, compounded by the lack of standardized benchmarks are proving to be principal hindrances towards progress in embodied AI. In addition, current state of the art supervised and reinforcement learning algorithms are data and time inefficient; impeding the training of embodied agents in the real world. + +Recently, the vision community has leveraged progress in computer graphics and created a host of simulated perceptual environments such as AI2-THOR [32], Gibson [72], MINOS [53] and Habitat [54], with the promise of training models in simulation that can be deployed on robots in the physical world. These environments are free to use, continue to be improved and lower the barrier of entry to research in real world embodied AI; democratizing research in this direction. This has led to progress on a variety of tasks in simulation, including visual navigation [22, 69], instruction following [5, 68] and embodied question answering [21, 15]. But the elephant in the room remains: How well do these models trained in simulation generalize to the real world? + +While progress has been ongoing, the large costs involved in undertaking this research has restricted pursuits in this direction to a small group of well resourced organizations. We believe that creating a free and accessible framework that pairs agents acting in simulated environments with robotic counterparts acting in the physical world will open up this important research topic to all—bringing faster progress and potential breakthroughs. As a step towards this goal, we present ROBOTHOR. + +ROBOTHOR is a platform to develop artificial embodied agents in simulated environments and test them in both, simulation as well as the real world. A key promise of ROBOTHOR is to serve as an open and accessible benchmarking platform to stimulate reproducible research in embodied AI. With this in mind, it has been designed with the following properties: + +- Simulation and Real Counterparts - ROBOTOR consists of a training and validation corpus of 75 scenes in simulation at present. A total of 14 test-dev and test-standard scenes are present in simulation and their counterparts constructed in the physical world. Scenes are designed to have diverse wall and furniture layouts, and all are densely populated by a variety of object categories. Figure 1 shows a view of the dining room in one of the test-dev scenes, in simulation as well as real. +- Modular - Scenes in ROBOTHOR are built in a modular fashion, drawing from an asset library containing + +wall structures, flooring components, ceilings, lighting elements, furniture pieces and objects; altogether totaling 731 unique assets distributed across scenes. This enables scene augmentation and easy expansion of ROBOTHOR to fit the needs of researchers. + +- Re-configurable - The physical environments are also built using modular and movable components, allowing us to host scenes with vastly different layouts and furniture arrangements within a single physical space. This allows us to scale our test corpora while limiting their cost and physical footprint. Reconfiguring the space to a new scene can be accomplished in roughly 30 minutes. +- Accessible to all - The simulation environment, assets and algorithms we develop will be open source. More critically, researchers from all over the world will be able to remotely deploy their models on our hardware at no cost to them. We will be setting up a systematic means of reserving time in our environment. +- Replicable - The physical space has been designed to be easily replicable by other researchers should they wish to construct their own physical environment. This is achieved through open sourced plans, readily available building components, IKEA furniture, and a low cost amounting to roughly $10,000 in materials and assets to create the physical space. In addition, we use LoCoBot, an inexpensive and easily obtainable robot. +- Benchmarked - In addition to open sourcing baseline models, we will host challenges involving several embodied AI tasks with a focus on the ability to transfer these models successfully onto robots running in a physical environment. + +ROBOTHOR has been designed to support a variety of embodied AI tasks. In this work we benchmark models for semantic navigation, the task of navigating to an instance of the specified category in the environment. The complexity and density of scenes in ROBOTHOR renders this task quite challenging, with humans requiring 49.5 steps (median statistic) to find the target object. We train a set of competitive models using a pure reinforcement learning (RL) approach with asynchronous actor critic (A3C) on the simulated training environments, measure their performance on the simulated as well as real validation environments and arrive at the following revealing findings. (1) Similar to findings in past works such as [69], semantic navigation models struggle with generalizing to unseen environments in simulation. We show that their performance takes an even larger hit when deployed onto a physical robot in the real world. (2) We analyze simulated and real world egocentric views and find a disparity in feature space in spite of the images from the two modalities looking fairly similar to the naked + +eye; a key factor affecting the transfer of policies to the real world. (3) As expected and noted in previous works, control dynamics in the real world vary significantly owing to motor noise, slippage, and collisions. (4) Off the shelf image correction mechanisms such as image-to-image translation do not improve performance. + +These findings reveal that training embodied AI models that generalize to unseen simulated environments and further yet to the real world remains a daunting challenge; but also open up exciting research frontiers. We hope that ROBOTOR will allow more research teams from across the globe to participate in this research which will result in new model architectures and learning paradigms that can only benefit the field. + +# 2. Related Work + +Embodied AI Environments. In recent years, several synthetic frameworks have been proposed to investigate tasks including visual navigation, task completion and question answering in indoor scenes [32, 53, 70, 8, 74, 72, 46, 54]. These free virtual environments provide excellent testbeds for embodied AI research by abstracting away the noise in low-level control, manipulation and appearance and allowing models to focus on the high-level end goal. ROBOTHOR provides a framework for studying these problems as well as for addressing the next frontier: transferring models from simulation to the real world. + +Robotics research platforms [1, 2] have traditionally been expensive to acquire. More recent efforts have led to low cost robot solutions [58, 3, 43] opening up the space to more research entities. There has been a long history of using simulators in conjunction with physical robots. These largely address tasks such as object manipulation using robotic arms [11] and autonomous vehicles [58, 55]. + +Visual Navigation. In this paper, we explore models for the task of visual navigation, a popular topic in the robotics and computer vision communities. The navigation problem can be divided into two broad categories, spatial navigation and semantic navigation. Spatial navigation approaches [62, 17, 64, 23, 25, 56, 79, 49, 30, 14, 10] typically address navigating towards a pre-specified coordinate or a frame of a scene and they focus on understanding the geometry of the scene and learning better exploration strategies. For example, [79] address navigation towards a given input image, [10] address navigation towards a point in a scene and [30] learn a collision-free navigation policy. Semantic navigation approaches [22, 75, 69, 71, 39, 52, 41] attempt to learn the semantics of the target in conjunction with navigation. For example, [75] use prior knowledge of object relations to learn a policy that better generalize to unseen scenes or objects. [69] use meta-learning to learn a self-supervised navigation policy toward a specified object category. [71] use prior knowledge of scene layouts to navigate to a spe + +cific type of room. We benchmark models on the task of semantic navigation. + +Navigation using language instructions has been explored by [5, 68, 18, 31, 67, 36, 37]. This line of work has primarily been tested in simulation; transferability to the real world remains an open question and addressing this via ROBOTOR is a promising future endeavour. Navigation has also been explored in other contexts such as autonomous driving (e.g., [12, 73]) or city navigation (e.g., [38, 13]). In this work, we focus on indoor navigation. + +Sim2Real Transfer. Domain adaptation in general as well as Sim2Real in particular, have a long history in computer vision. There are different techniques to adapt models from a source domain to a target domain. The main approaches are based on randomization of the source domain to better generalize to the target domain [63, 29, 51, 44, 61], learning the mapping between some abstraction or higher order statistics of the source and target domains [27, 59, 19, 35, 76, 42, 78], interpolating between the source and the target domain on a learned manifold [20, 9], or generating the target domain using generative adversarial training [7, 60, 57, 6, 26, 28]. ROBOTHOR enables source randomization via scene diversity and asset diversity. We also experiment with using an off the shelf target domain mapping method, the GAN-based model of [77]. + +# 3. RoboTHOR + +State of the art learning algorithms for embodied AI use reinforcement learning based approaches to train models, which typically require millions of iterations to converge to a reasonable policy. Training policies in the real world with real robots would take years to complete, due to the mechanical constraints of robots. Synthetic environments, on the other hand, provide a suitable platform for such training strategies, but how well models trained in simulation transfer to the real world, remains an open question. ROBOTHOR is a platform, built upon the AI2-THOR framework [32] to build and test embodied agents with an emphasis on studying this problem of domain transfer from simulation to the real world. + +Scenes. ROBOTHER consists of a set of 89 apartments, 75 in train/val (we use 60 for training and 15 for validation), 4 in test-dev (which are used for validation in the real world) and 10 in test-standard (blind physical test set) drawn from a set of 15, 2 and 5 wall layouts respectively. Apartments that share the same wall layout have completely different room assignments and furniture placements (for example, a bedroom in one apartment might be an office in another). Apartment layouts were designed to encompass a wide variety of realistic living spaces. Figure 3 shows a heatmap of wall placements across the train/val subset. This set of apartments is only instantiated in simulation, while the test-dev and test-standard apartments are also substantiated in + +![](images/115ca14206126788626e4060d17376dd7279f5b416eebb7b29c88b9ff9c19001.jpg) +Figure 2: Distribution of object categories in ROBOTHOR + +![](images/4be6bafb3da94a6ce644d216386be0dbce628e36f09b53a42a3839f8da7506c5.jpg) + +![](images/c048f38d6ce55e3c88d7570aa77f88f62f8dfe5245ea0fc491dabb430d894813.jpg) + +the physical world. The layouts, furniture, objects, lighting, etc. of the simulation environments have been designed carefully so as to closely resemble the corresponding scenes in their physical counterparts, while avoiding any overlap between the wall layouts and object instances among train/val, test-dev and test-standard. This resemblance will enable researchers to study the discrepancies between the two modalities and systematically identify the challenges of the domain transfer. + +Assets. A guiding design principle of ROBOTHOR is modularity, which allows us to easily augment and scale scenes. A large asset library was created by digital artists from which scenes were created by selectively drawing from these assets. This is in contrast to environments that are based on 3D scans of rooms which are challenging to alter and interact with. The framework includes 11 types of furniture (e.g. TV stands and dining tables) and 32 types of small objects (e.g. mugs and laptops) across all scenes. The majority of real furniture and objects were gathered from IKEA. Among the small objects categories, 14 are designated as targets and guaranteed to be found in all scenes for use in semantic navigation tasks. In total there are 731 unique object instances in the asset library with no overlap among train/val, test-dev and test-standard scenes. Figure 2 shows the distribution of object categories amongst the asset library. We distribute object categories as uniformly as possible to avoid bias toward specific locations. Figure 3 shows the spatial distribution of target objects, background objects and furniture in the scenes. Figure 4 shows the distribution of the number of visible objects in a single frame. A large number of frames consist of the agent looking at the wall as is common in apartments, but outside these views many objects are visible to the agent at any given point as it navigates the environment. + +Physical space. The physical space for ROBOTHOR is $8.8m \times 3.9m$ . The space is partitioned into rooms and corridors using ProPanel walls, which are designed to be lightweight and easy to set up and tear down, allowing us to easily configure a new apartment layout in a few minutes. + +Agent. The physical robot used is a LoCoBot1, which + +![](images/4efeafbcf2b66a6558a9dedf44099b01eb35d2b8d0ec5d71c33da484240a0e65.jpg) +Figure 3: Spatial distribution of objects and walls. Heatmaps illustrate the diverse spatial distribution of target objects, background objects, furniture, and walls. + +![](images/3c07d48aba01621125a736efb31c5a69606b891526ec1ada2d065e53f4787f72.jpg) +Figure 4: Object visibility statistics. The distribution of objects visible to an agent at a single time instant. + +is equipped with an Intel RealSense RGB-D camera. We replicate the robot in simulation with the same physical and camera properties. To mimic the noisy dynamics of the robot movements, we add noise to the controller in simulation. The noise parameters are estimated by manually measuring the error in orientation and displacement over multiple runs. + +API. To enable a seamless switch between the synthetic and the real environments, we provide an API that is agnostic to the underlying platform. Hence, agents trained in sim + +ulation can be easily deployed onto the LoCoBot for testing. The API was built upon the PyRobot [43] framework to manage control of the LoCoBot base as well as camera. + +Connectivity. A main goal of this framework is to provide access to researchers across the globe to deploy their models onto this physical environment. With this in mind, we developed the infrastructure for connecting to the physical robot or the simulated agent via HTTP. A scheduler prevents accessing the same physical hardware by multiple parties. + +Localization. We installed Super-NIA-3D localization modules across the physical environment to estimate the location of the robot and return that to the users. For our experiments, we do not use the location information for training as this type of training signal is not usually available in real world scenes. We use this location information only for evaluation and visualization. + +# 4. Visual Semantic Navigation + +In this paper, we benchmark models for the task of visual semantic navigation, i.e. navigating towards an instance of a pre-specified category. ROBOTHOR enables various embodied tasks such as question answering, task completion and instruction following. Navigation is a key component of all these tasks and is a necessary and important first step towards studying transfer in the context of embodied tasks. + +Visual semantic navigation evaluates the agent's capabilities not only in avoiding obstacles and making the right moves towards the target, but also understanding the semantics of the scene and targets. The agent should learn how different instances of an object category look like and should be able to reason about occlusion, scale changes and other variations in object appearance. + +More specifically, our goal is to navigate towards an instance of an object category specified by a noun (e.g., Apple) given ego-centric sensory inputs. The sensory input can be an RGB image, a depth image, or combination of both. At each time step the agent must issue one of the following actions: Move Ahead, Rotate Right, Rotate Left, Look Up, Look Down, Done. The action Done signifies that the agent reports that it has reached its goal and leads to an end of episode. We consider an episode successful if (a) the object is in view (b) the agent is within a threshold of distance to the target and (c) the agent reports that it observes the object. The starting location of the agent is a random location in the scene. + +The motion of the agent in the simulated world is stochastic in nature, mirroring its behavior in the real world. This renders the task more challenging. Previous works such as [69] consider agent motion along the axes on a grid. But given the end goal of navigating in the real world with motor noise and wheel slippage, deterministic movements in training lead to sub optimal performance during testing. + +The semantic navigation task is very challenging owing + +to the size and complexity of the scenes. Figure 5 shows the lengths of shortest paths to the target objects, in terms of the Move Ahead and Rotate actions. But shortest path statistics are a bit misleading for the task of semantic navigation because they assume that the agent already knows the location it must travel towards. In fact, the agent must explore until it observes the target, and then move swiftly towards it. We conducted a study where humans were posed with the problem of navigating in scenes in ROBOTHOR (simulation) to find targets. The median number of steps was 49.5 (compared to 22.0 for shortest paths), illustrating the exploration nature of the task. Figure 6 shows an example trajectory from a human compared to the corresponding shortest path. + +![](images/cada3faf04d80057dc971544dfc846324978be180b92049cc19fda9b646638e9.jpg) +Figure 5: Histogram of actions along the shortest path. The number of actions invoked along the shortest paths to targets in the training scenes. Note that the shortest path is very difficult to obtain in practice, since it assumes a priori knowledge of the scene. + +![](images/0ac162549623d77f6c995e114ee2d48a242ed861eea592e9023a20e4cc907003.jpg) +Figure 6: Example human trajectory. The shortest path to a target vs the path taken by a human from the same starting location are visualized. The human wanders around looking for the TV and on seeing it, walks straight towards it. + +# 4.1. Baseline models + +We measure the performance of the following baseline models: + +Random - This model chooses an action randomly amongst the set of possible actions. This includes invoking the Done action. The purpose of this baseline is to ascertain if the scenes and starting locations are not overly simplistic. + +Instant Done - This model invokes the Done action at the very first time step. The purpose of this baseline is to measure the percentage of trivial starting locations. + +Blind - This model receives no sensory input. It only consists of an LSTM with simply a target embedding input. Its purpose is to establish a baseline that can only leverage starting and target location bias in the dataset. + +Image-A3C - The agent perceives the scene at time $t$ in the form of an image $o_t$ . The image is fed into a pre-trained and frozen ResNet-18 to obtain a $7 \times 7 \times 512$ tensor, followed by two $1 \times 1$ convolution layers to reduce the channel depth to 32 and finally concatenated with a 64 dimensional embedding of the target word and provided to an LSTM which generates the policy. The agent is trained using the asynchronous advantage actor-critic (A3C) [40] formulation, to act to maximize its expected discounted cumulative reward. Two kinds of rewards are provided: a positive success reward and a negative step reward to encourage efficient paths. + +Image+Detection-A3C - The image is fed into Faster-RCNN [48] trained on the MSCOCO dataset. Each resulting detection has a category, probability and box locations and dimensions, which are converted to an embedding using an MLP. The resulting set of embeddings are converted into a tensor $7 \times 7 \times 120$ by aligning detection boxes to spatial grid cells and only considering the top 3 boxes per location. This tensor is concatenated to the tensor obtained for the image modality and then processed as above. + +# 4.2. Metrics + +We report Success Rate and Success weighted by Path Length (SPL) [4], common metrics for evaluating navigation models. In addition, we also report path lengths in terms of the number of actions taken as well as distance travelled. This quantifies the exploration carried out by the agent. + +# 5. Experiments + +Training. We train models to navigate towards a single target, a Television with an action space of 4 including Move Ahead, Rotate Right, Rotate Left and Done. The rotation actions rotate the agent by 45 degrees. The agent must issue the Done action when it observes the object. If an agent is successful, it receives a reward of $+5$ . The step penalty at each time step is -0.01. To mimic the noisy dynamics of the real robot, we add noise to the movement of the virtual agent. For translation, we add a gaussian noise with mean $0.001\mathrm{m}$ and standard deviation $0.005\mathrm{m}$ , and for rotation we use a mean of $0^{\circ}$ and standard deviation of $0.5^{\circ}$ . + +Models were trained on 8 TITAN X GPUs for 100,000 episodes using A3C with 32 threads. For each episode, we sample a random training scene and random starting location in the scene for the agent. We use the Adam optimizer with a learning rate of 0.0001. + +We train the models on a subset of 50 train scenes and report numbers on 2 of the test-dev scenes. We report metrics on starting locations categorized into easy, medium and hard. If the length of the shortest path from the starting point to the target is among the lowest $20\%$ path lengths in that scene, it is considered easy. If it is between $20\%$ and $60\%$ , it is considered medium, and longer paths are considered as hard. + +Sim-to-Sim Table 1 shows the results of our benchmarked models when trained on simulation and evaluated on the test-dev scenes in simulation. The trivial baselines Random, Instant Done and Blind perform very poorly, indicating that the dataset lacks a bias that is trivial to exploit using these models. The Image only model performs reasonably well, succeeding at over $50\%$ of easy trajectories but doing very poorly at hard ones. Adding object detection does not help performance. Our analysis in Section 6 shows that object detectors trained in the real world show a drop in performance in simulation, which might be contributing to their ineffectiveness. + +Sim-to-Real Due to the slow motion of the robot, episodes on the robot last as long as 10 minutes. This limits the amount of testing that can be done in the real world. Table 2 shows the result of the best performing model on Sim-to-Sim, evaluated on a real scene on a subset of starting locations as those reported in Table 1. This shows that there is a sizeable drop in performance for the real robot, especially in SPL. The robot however, does learn to navigate around and explore its environment fairly safely and over $80\%$ of the trajectories have no collisions with obstacles. This leads to high values for episode lengths in all 3 cases - easy, medium and hard. + +Overfit Sim-to-Real The semantic navigation sim-to-real task in ROBOTHOR tests two kinds of generalization: Moving to new scenes and moving from simulation to real. To factor out the former and focus on the latter, we trained a policy on a test-dev scene, (which expectedly led to overfitting on sim) and then deployed this on the robot. Table 3 shows these results and demonstrates the upper bound of current models in the real world if they had memorized the test-dev scene perfectly in simulation. The robot does very well on the easy targets, but is affected a lot on hard targets. For all three modes, the SPL is affected tremendously. Appearance and control variations often lead the robot to spaces away from the target, which does not happen in simulation due to overfitting. + +
EasyMediumHard
SuccessSPLEpisode lengthPath lengthSuccessSPLEpisode lengthPath lengthSuccessSPLEpisode lengthPath length
Random7.585.324.360.340.000.004.270.300.000.003.060.19
Instant Done4.553.791.000.000.000.001.000.000.000.001.000.00
Blind4.553.791.000.000.000.001.000.000.000.001.000.00
Image55.3038.1245.879.2628.7919.1278.4914.821.470.9781.0914.22
Image+Detection36.3619.8963.4111.3911.365.2590.3716.650.740.6183.0114.00
+ +Table 1: Benchmark results for Sim-to-Sim + +
EasyMediumHard
SuccessSPLEpisode lengthPath lengthSuccessSPLEpisode lengthPath lengthSuccessSPLEpisode lengthPath length
Image33.333.5353.167.1816.663.7043.835.330.000.0067.837.00
+ +Table 2: Benchmark results for Sim-to-Real + +# 6. Analysis + +We now dig deeper into the appearance disparities between real and simulation images via t-sne embeddings, object detection results and the output policies for both modalities. We also provide a study showing the effect of changing camera parameters between real and simulation for the transfer problem. Finally, we evaluate using an image translation method for the purposes of domain adaptation. + +Appearance disparities. To the naked eye, images between the real and simulation worlds in ROBOTHOR look quite similar. However when we look at embeddings provided by networks, the disparity becomes more visible. We considered 846 images, each from simulation and real collected from the same locations in the scene, passed these images through ResNet-18 to obtain a 512 dim feature vector and then used t-SNE [65] to reduce the dimensionality to 3. Figure 7 shows these embeddings. One can clearly see the separation of points into real and simulation clusters. This indicates that embeddings of images in the two modalities are different, which goes towards explaining the drop in performance between simulation and real test-dev scenes (see Table 1 and Table 2). Figure 7 also shows the nearest neighbor (cosine similarity) simulation image to one of the real images. We found that although nearest neighbors are not far away spatially, they are still slightly different, sometimes having a different view, or a different distance to an obstacle. This might explain why the robot takes different actions in the real world. This analysis indicates that methods of representation learning might need to be revisited, especially when these representations must work across real and simulation modalities. + +Object detection transfer. Since we leverage an off the shelf object detector (Faster-RCNN) trained on natural images (MS-COCO), it is imperative to compare the accuracy of this model on images collected in the real and simulated + +![](images/3ddd8d451d0881e826d8a4c14fd5ca2660cee18a490b9905c16f71b10a5b5f2d.jpg) +Figure 7: Comparison of embeddings for real and synthetic images. The scatter plot shows a t-SNE visualization of ResNet-18 (pre-trained on ImageNet) features for images from real and simulated apartments. Also shown are the nearest neighbor in feature space and spatial nearest neighbor, which differ slightly in the viewpoint of the agent. + +apartments. We collected 761 corresponding images from both environments, ran Faster-RCNN on them and obtained ground truth annotations for 10 object classes (all of which intersected with MS-COCO classes) on Amazon Mechanical Turk. At an Intersection-over-Union (IOU) of 0.5, we obtained a mAP of 0.338 for real images and 0.255 for simulated ones; demonstrating that there is a performance hit going across modalities. Furthermore, detection probabilities tend to differ between the two modalities as demonstrated in Figure 8, rendering transfer more challenging for + +
EasyMediumHard
SuccessSPLEpisode lengthPath lengthSuccessSPLEpisode lengthPath lengthSuccessSPLEpisode lengthPath length
Image Sim-2-Sim10082.178.091.0510086.1727.524.7794.1283.1842.267.90
Image Sim-2-Real10012.2815.002.3383.3318.6843.335.55028.5330.167.54
+ +Table 3: Benchmark results for Sim-to-Real trained on a single test-dev scene. + +![](images/faad51fb5812526e8bbc5ff994b8f63bcd95aa5ac3eb398a1e08ceba6932ee2f.jpg) +Figure 8: Object detection. Results of object detection in a real and simulated image. Solid lines denote high confidence detections whereas dashed lines denote low confidence detections. + +models that exploit these probabilities. Note that this transfer is in the opposite direction (Real to Sim) compared to our current transfer setup, but is revealing nonetheless. + +Modifying camera parameters. Since the real and simulation apartments were both designed by us, we were able to model the simulation camera close to the one present on LoCoBot. However, to test the sensitivity of the learnt policy to the camera parameters, we performed an experiment where we trained with a Field Of View (FOV) of $90^{\circ}$ and tested with an FOV of $42.5^{\circ}$ . The resulting real world experiments for the Image only model show a huge drop of performance to $16\%$ for easy, and $0\%$ for medium and hard. Interestingly, the robot tends to move very little and instead rotate endlessly. We hypothesize that models trained on simulation likely overfit to the image distribution observed at training, and the images captured at a different FOV vary so significantly in feature space, that they invoke unexpected behaviors. Since popular image representation models are trained on images from the internet, they are biased towards the distribution of cameras that people use to take pictures. Cameras on robots are usually quite different. This suggests that we should fine tune representations to match robot cameras and also consider different camera parameters as a camera augmentation step during training in simulation. + +Domain adaptation via image translation. Since appearance statistics vary between real and simulation, we experimented with applying an image-to-image translation technique, CycleGAN [77] to translate real world images towards simulation images. This would enable us to train in simulation and apply the policy on the real robot while processing the translated images. We needed to use a trans + +lation model that could use unpaired image data, since we are unable to obtain paired images with 0 error in the placement of the agent. Paired images were obtained for 3 test-dev scenes to train CycleGAN. The policy (trained in simulation) was run on the robot on the remaining test-dev scene. Interestingly, the CycleGAN model does learn to flatten textures and adjust lighting and shadows as seen in Figure 9. However, the resultant robot performance is very poor and obtains $0\%$ accuracy. While image translation looks pleasing to the eye, it does introduce spurious errors which hugely affect the image embeddings and thus the resultant policy. + +![](images/5b75319436a7979dac2a81a3d60af35f338a90418642cba5e4baf8f1b17090a6.jpg) +Figure 9: Examples of real to simulation transfer. We use CycleGAN [77] to translate real images towards simulated ones. The model learns to flatten out the texture and adjust the shadows to look like a simulated image. + +# 7. Conclusion + +In this paper, we presented ROBOTOR, an open, modular, re-configurable and replicable embodied AI platform with counterparts in simulation and the real world, where researchers across the globe can remotely deploy their models onto physical robots and test their algorithms in the physical world. Our preliminary findings show the performance of models drops significantly when transferring from simulation to real. We hope that ROBOTOR will enable more research towards this important problem. + +Acknowledgements. This work is in part supported by NSF IIS 1652052, IIS 17303166, DARPA N66001-19-2-4031, 67102239 and gifts from Allen Institute for AI. + +# References + +[1] Baxter. https://en.wikipedia.org/wiki/Baxter_(robot).3 +[2] Sawyer. https://www.rethinkrobotics.com/sawyer.3 +[3] The MIT RACECAR. https://mit-racecar.github.io, 2016.3 +[4] Peter Anderson, Angel X. Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, and Amir Roshan Zamir. On evaluation of embodied navigation agents. arXiv, 2018. 6 +[5] 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 CVPR, 2018. 2, 3 +[6] Konstantinos Bousmalis, Alex Irpan, Paul Wohlhart, Yunfei Bai, Matthew Kelcey, Mrinal Kalakrishnan, Laura Downs, Julian Ibarz, Peter Pastor, Kurt Konolige, Sergey Levine, and Vincent Vanhoucke. Using simulation and domain adaptation to improve efficiency of deep robotic grasping. In ICRA, 2018. 3 +[7] Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In CVPR, 2017. 3 +[8] Simon Brodeur, Ethan Perez, Ankesh Anand, Florian Golemo, Luca Celotti, Florian Strub, Jean Rouat, Hugo Larochelle, and Aaron C. Courville. Home: a household multimodal environment. arXiv, 2017. 3 +[9] Rui Caseiro, Joao F. Henriques, Pedro Martins, and Jorge Batista. Beyond the shortest path: Unsupervised domain adaptation by sampling subspaces along the spline flow. In CVPR, 2015. 3 +[10] Devendra Singh Chaplot, Saurabh Gupta, Dhiraj Gandhi, Abhinav Gupta, and Ruslan Salakhutdinov. Learning to explore using active neural mapping. In CVPR Workshop on Habitat Embodied Agents, 2019. 3 +[11] Yevgen Chebotar, Ankur Handa, Viktor Makoviychuk, Miles Macklin, Jan Issac, Nathan D. Ratliff, and Dieter Fox. Closing the sim-to-real loop: Adapting simulation randomization with real world experience. In ICRA, 2019. 3 +[12] Chenyi Chen, Ari Seff, Alain Kornhauser, and Jianxiong Xiao. Deepdriving: Learning affordance for direct perception in autonomous driving. In ICCV, 2015. 3 +[13] Howard Chen, Alane Suhr, Dipendra Misra, Noah Snavely, and Yoav Artzi. Touchdown: Natural language navigation and spatial reasoning in visual street environments. In CVPR, 2019. 3 +[14] Tao Chen, Saurabh Gupta, and Abhinav Gupta. Learning exploration policies for navigation. In ICLR, 2019. 3 +[15] Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Embodied question answering. In CVPR, 2018. 2 + +[16] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019. 1 +[17] Dieter Fox, Wolfram Burgard, and Sebastian Thrun. Markov localization for reliable robot navigation and people detection. In Sensor Based Intelligent Robots, 1999. 3 +[18] 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 NeurIPS, 2018. 3 +[19] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. JMLR, 2016. 3 +[20] Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In CVPR, 2012. 3 +[21] Daniel Gordon, Aniruddha Kembhavi, Mohammad Rastegari, Joseph Redmon, Dieter Fox, and Ali Farhadi. IQA: Visual question answering in interactive environments. In CVPR, 2018. 2 +[22] Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In CVPR, 2017. 2, 3 +[23] Raia Hadsell, Pierre Sermanet, Jan Ben, Ayse Erkan, Marco Scoffier, Koray Kavukcuoglu, Urs Muller, and Yann LeCun. Learning long-range vision for autonomous off-road driving. J. of Field Robotics, 2009. 3 +[24] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 1 +[25] Peter Henry, Christian Vollmer, Brian Ferris, and Dieter Fox. Learning to navigate through crowded environments. In ICRA, 2010. 3 +[26] Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darrell. CyCADA: Cycle-consistent adversarial domain adaptation. In ICML, 2018. 3 +[27] Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcns in the wild: Pixel-level adversarial and constraint-based adaptation. arXiv, 2016. 3 +[28] Haoshuo Huang, Qixing Huang, and Philipp Krahenbuhl. Domain transfer through deep activation matching. In ECCV, 2018. 3 +[29] Stephen James, Andrew J. Davison, and Edward Johns. Transferring end-to-end visuomotor control from simulation to real world for a multi-stage task. In CORL, 2017. 3 +[30] Gregory Kahn, Adam Villaflor, Bosen Ding, Pieter Abbeel, and Sergey Levine. Self-supervised deep reinforcement learning with generalized computation graphs for robot navigation. In ICRA, 2018. 3 +[31] Liyiming Ke, Xiujun Li, Yonatan Bisk, Ari Holtzman, Zhe Gan, Jingjing Liu, Jianfeng Gao, Yejin Choi, and Siddhartha Srinivasa. Tactical rewind: Self-correction via backtracking in vision-and-language navigation. In CVPR, 2019. 3 + +[32] 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, 3 +[33] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012. 1 +[34] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, C. Lawrence Zitnick, and Piotr Dólar. Microsoft coco: Common objects in context. In ECCV, 2014. 2 +[35] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. In ICML, 2015. 3 +[36] Chih-Yao Ma, Jiasen Lu, Zuxuan Wu, Ghassan AlRegib, Zsolt Kira, Richard Socher, and Caiming Xiong. Self-monitoring navigation agent via auxiliary progress estimation. In ICLR, 2019. 3 +[37] Chih-Yao Ma, Zuxuan Wu, Ghassan AlRegib, Caiming Xiong, and Zsolt Kira. The regretful agent: Heuristic-aided navigation through progress estimation. In CVPR, 2019. 3 +[38] Piotr Mirowski, Matthew Koichi Grimes, Mateusz Malinowski, Karl Moritz Hermann, Keith Anderson, Denis Teplayashin, Karen Simonyan, Koray Kavukcuoglu, Andrew Zisserman, and Raia Hadsell. Learning to navigate in cities without a map. In NeurIPS, 2018. 3 +[39] Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J. Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, Dharshan Kumaran, and Raia Hadsell. Learning to navigate in complex environments. In ICLR, 2017. 3 +[40] Volodymyr Mnih, Adrià Puigdomènech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, 2016. 6 +[41] Arsalan Mousavian, Alexander Toshev, Marek Fiser, Jana Kosecka, and James Davidson. Visual representations for semantic target driven navigation. In ECCV Workshop on Visual Learning and Embodied Agents in Simulation Environments, 2018. 3 +[42] Matthias Mueller, Alexey Dosovitskiy, Bernard Ghanem, and Vladlen Koltun. Driving policy transfer via modularity and abstraction. In CORL, 2018. 3 +[43] Adithyavairavan Murali, Tao Chen, Kalyan Vasudev Alwala, Dhiraj Gandhi, Lerrel Pinto, Saurabh Gupta, and Abhinav Gupta. Pyrobot: An open-source robotics framework for research and benchmarking. arXiv, 2019. 3, 5 +[44] Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In ICRA, 2018. 3 +[45] Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke S. Zettlemoyer. Deep contextualized word representations. In NAACL, 2018. 1 +[46] Xavier Puig, Kevin Ra, Marko Boben, Jiaman Li, Tingwu Wang, Sanja Fidler, and Antonio Torralba. Virtualhome: Simulating household activities via programs. In CVPR, 2018. 3 + +[47] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100, $000+$ questions for machine comprehension of text. In EMNLP, 2016. 2 +[48] 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, 6 +[49] Charles Richter and Nicholas Roy. Safe visual navigation via deep learning and novelty detection. In RSS, 2017. 3 +[50] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Fei-Fei Li. Imagenet large scale visual recognition challenge. IJCV, 2014. 2 +[51] Fereshteh Sadeghi and Sergey Levine. CAD2RL: real single-image flight without a single real image. In RSS, 2017. 3 +[52] Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In ICLR, 2018. 3 +[53] Manolis Savva, Angel X. Chang, Alexey Dosovitskiy, Thomas A. Funkhouser, and Vladlen Koltun. MINOS: multimodal indoor simulator for navigation in complex environments. arXiv, 2017. 2, 3 +[54] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, Devi Parikh, and Dhruv Batra. Habitat: A platform for embodied ai research. In ICCV, 2019. 2, 3 +[55] Shital Shah, Debadeepta Dey, Chris Lovett, and Ashish Kapoor. Airsim: High-fidelity visual and physical simulation for autonomous vehicles. In Field and Service Robotics, 2017. 3 +[56] Shaojie Shen, Nathan Michael, and Vijay Kumar. Autonomous multi-floor indoor navigation with a computationally constrained mav. In ICRA, 2011. 3 +[57] Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Josh Susskind, Wenda Wang, and Russell Webb. Learning from simulated and unsupervised images through adversarial training. In CVPR, 2017. 3 +[58] Siddhartha S. Srinivasa, Patrick Lancaster, Johan Michalove, Matt Schmittle, Colin Summers, Matthew Rockett, Joshua R. Smith, Sanjiban Chouhury, Christoforos Mavrogiannis, and Fereshteh Sadeghi. MuSHR: A low-cost, open-source robotic racecar for education and research. arXiv, 2019. 3 +[59] Baochen Sun, Jiashi Feng, and Kate Saenko. Return of frustratingly easy domain adaptation. In AAAI, 2016. 3 +[60] Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. In ICLR, 2017. 3 +[61] Jie Tan, Tingnan Zhang, Erwin Coumans, Atil Iscen, Yunfei Bai, Danijar Hafner, Steven Bohez, and Vincent Vanhoucke. Sim-to-real: Learning agile locomotion for quadruped robots. In RSS, 2018. 3 +[62] Charles Thorpe, Martial H. Hebert, Takeo Kanade, and Steven A. Shafer. Vision and navigation for the carnegiemellon navlab. TPAMI, 1988. 3 +[63] Joshua Tobin, Rachel H Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In IROS, 2017. 3 + +[64] Chris Urmson, Joshua Anhalt, Drew Bagnell, Christopher Baker, Robert Bittner, M. N. Clark, John Dolan, Dave Duggins, Tugrul Galatali, Chris Geyer, Michele Gittleman, Sam Harbaugh, Martial Hebert, Thomas M. Howard, Sascha Kolski, Alonzo Kelly, Maxim Likhachev, Matt McNaughton, Nick Miller, Kevin Peterson, Brian Pilnick, Raj Rajkumar, Paul Rybski, Bryan Salesky, Young-Woo Seo, Sanjiv Singh, Jarrod Snider, Anthony Stentz, William "Red" Whittaker, Ziv Wolkowicki, Jason Ziglar, Hong Bae, Thomas Brown, Daniel Demitrish, Bakhtiar Litkouhi, Jim Nickolaou, Varsha Sadekar, Wende Zhang, Joshua Struble, Michael Taylor, Michael Darms, and Dave Ferguson. Autonomous driving in urban environments: Boss and the urban challenge. J of Field Robotics, 2008. 3 +[65] Laurens van der Maaten and Geoffrey E. Hinton. Visualizing data using t-sne. JMLR, 2008. 7 +[66] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In BlackboxNLP@EMNLP, 2018. 2 +[67] 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 CVPR, 2019. 3 +[68] Xin Wang, Wenhan Xiong, Hongmin Wang, and William Yang Wang. Look before you leap: Bridging model-free and model-based reinforcement learning for planned-ahead vision-and-language navigation. In ECCV, 2018. 2, 3 +[69] Mitchell Wortsman, Kiana Ehsani, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. Learning to learn how to learn: Self-adaptive visual navigation using meta-learning. In CVPR, 2019. 2, 3, 5 +[70] Yi Wu, Yuxin Wu, Georgia Gkioxari, and Yuandong Tian. Building generalizable agents with a realistic and rich 3d environment. arXiv, 2018. 3 +[71] Yi Wu, Yuxin Wu, Aviv Tamar, Stuart Russell, Georgia Gkioxari, and Yuandong Tian. Bayesian relational memory for semantic visual navigation. In ICCV, 2019. 3 +[72] 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, 3 +[73] Huazhe Xu, Yang Gao, Fisher Yu, and Trevor Darrell. End-to-end learning of driving models from large-scale video datasets. In CVPR, 2017. 3 +[74] Claudia Yan, Dipendra Kumar Misra, Andrew Bennett, Aaron Walsman, Yonatan Bisk, and Yoav Artzi. CHALET: cornell house agent learning environment. arXiv, 2018. 3 +[75] Wei Yang, Xiaolong Wang, Ali Farhadi, Abhinav Gupta, and Roozbeh Mottaghi. Visual semantic navigation using scene priors. In ICLR, 2019. 3 +[76] Yang Zhang, Philip David, and Boqing Gong. Curriculum domain adaptation for semantic segmentation of urban scenes. In ICCV, 2017. 3 +[77] 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, 8 + +[78] Xinge Zhu, Hui Zhou, Ceyuan Yang, Jianping Shi, and Dahua Lin. Penalizing top performers: Conservative loss for semantic segmentation adaptation. In ECCV, 2018. 3 +[79] 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 ICRA, 2017. 3 \ No newline at end of file diff --git a/robothoranopensimulationtorealembodiedaiplatform/images.zip b/robothoranopensimulationtorealembodiedaiplatform/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0dc01a07372207fd776edcf6f64fb27302aaae79 --- /dev/null +++ b/robothoranopensimulationtorealembodiedaiplatform/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94737a874ae6383fead023239e3395d96798ee3b96092860754b41621350b529 +size 490539 diff --git a/robothoranopensimulationtorealembodiedaiplatform/layout.json b/robothoranopensimulationtorealembodiedaiplatform/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..29820f0cb6ffe7ba03777c79193aa06d45a40b93 --- /dev/null +++ b/robothoranopensimulationtorealembodiedaiplatform/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af077cd7ddcfd80722c51e4c1ffbf12067dfe38f7526b04c4564c2b2a8cac839 +size 346300 diff --git a/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_content_list.json b/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f9d52b9020853bae22579fd0f0bf8380ab1fd714 --- /dev/null +++ b/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c2e813e7b9574bb60816ddbaff16e6789781a5da3e8739b43f9b5b82e8b8607 +size 84377 diff --git a/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_model.json b/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a8829ab026f682b72bcba2ae9ffad8f926bfe625 --- /dev/null +++ b/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d278b0edf51546a3c0ab068172f47a7fdf0e153740853464cee3b7e4a20738a7 +size 103005 diff --git a/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_origin.pdf b/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4cf3746e100463555bbe7f59c654a2f199c0c92c --- /dev/null +++ b/robust3dselfportraitsinseconds/21b2ef82-3d9b-43d3-ae96-df62904e57b0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78b365a50cbb295e8c60127ba33b343d5cf783fab031cb57da7c2fdab63e8f2a +size 3965040 diff --git a/robust3dselfportraitsinseconds/full.md b/robust3dselfportraitsinseconds/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f1fd08c947682225a9e95bd34b07f9c6767443d6 --- /dev/null +++ b/robust3dselfportraitsinseconds/full.md @@ -0,0 +1,405 @@ +# Robust 3D Self-portraits in Seconds + +Zhe Li $^{1}$ , Tao Yu $^{1}$ , Chuanyu Pan $^{1}$ , Zerong Zheng $^{1}$ , Yebin Liu $^{1,2}$ + +$^{1}$ Department of Automation, Tsinghua University, China + +$^{2}$ Institute for Brain and Cognitive Sciences, Tsinghua University, China + +# Abstract + +In this paper, we propose an efficient method for robust 3D self-portraits using a single RGBD camera. Benefiting from the proposed PIFusion and lightweight bundle adjustment algorithm, our method can generate detailed 3D self-portraits in seconds and shows the ability to handle subjects wearing extremely loose clothes. To achieve highly efficient and robust reconstruction, we propose PIFusion, which combines learning-based 3D recovery with volumetric non-rigid fusion to generate accurate sparse partial scans of the subject. Moreover, a non-rigid volumetric deformation method is proposed to continuously refine the learned shape prior. Finally, a lightweight bundle adjustment algorithm is proposed to guarantee that all the partial scans can not only "loop" with each other but also remain consistent with the selected live key observations. The results and experiments show that the proposed method achieves more robust and efficient 3D self-portraits compared with state-of-the-art methods. + +# 1. Introduction + +Human body 3D modeling, aiming at reconstructing the dense 3D surface geometry and texture of the subject, is a hot topic in both computer vision and graphics and is of great importance in the area of body measurement, digital content creation, virtual try-ons, etc. Traditional human body 3D modeling methods usually rely on experts for data capture and are therefore hard to use. Compared with traditional 3D scanning methods, 3D self-portrait methods, which allow users to capture their own portraits without any assistance, have significant potential for wide usage. + +Current 3D self-portrait methods can be classified into 3 categories: learning-based methods, fusion-based methods, and bundle-adjustment-based methods. Learning-based methods mainly focus on 3D human recovery from a single RGB image ([13, 25]). Thus, the results are still far from accurate due to occlusions and depth ambiguities. Fusion-based methods reconstruct scene geometries in an incremental manner, so error accumulation is inevitable, especially for non-rigid scenarios [20], which is detrimental for loop closure reconstruction (e.g., 3D self-portraits). To suppress the accumulated error in incremental fusion, an- + +![](images/730cb4fe8a2b4be03dd00ccd72ffd06b016fb68a71653052dcb2bf8c06838f7b.jpg) + +![](images/a271061bf4270748c00ba52258b5a2820127cb18a34e1ea2fa3bba9f6558f9ef.jpg) + +![](images/8d5c8d9d2f65aa7d2bfc4015279bec3155480cbf8b2a79b641daa7664ade5f19.jpg) +Figure 1: Our system reconstructs a detailed and textured portrait after the subject self-rotates in front of an RGBD sensor. + +![](images/0cd8454ce44839c78fc1ba8d5d29de460d12449e523880589e56736cdf69563a.jpg) + +other branch of 3D self-portrait methods also utilizes bundle adjustment algorithms [17, 29, 7, 8, 30, 31]. The whole sequence is first segmented into several chunks, and then fusion methods are applied to each chunk to fuse a smooth partial scan. Finally, non-rigid bundle adjustment is used to "loop" all the partial scans simultaneously by non-rigid registration based on explicit loop closure correspondences and bundling correspondences. Although RGBD bundle adjustment methods have achieved state-of-the-art performance for 3D self-portraits, they still suffer from complicated hardware setups (e.g., relying on multiple sensors or electric turntables [29, 1, 2] or low efficiency [17, 5, 8, 7, 30, 31]). + +One of our observations is that a good combination of non-rigid fusion and bundle adjustment should guarantee both efficiency and accuracy. However, non-rigid fusion methods (e.g., [20] etc.) usually suffer from heavy drifts and error accumulation during tracking, which limit their ability to generate accurate large partial scans. This limitation has led to the fact that previous bundle adjustment methods have to be conducted on considerably large numbers of small partial scans, which significantly increase the optimizing variables in the bundling step. For example, in [8], 40-50 small partial scans need to be bundled together, which takes approximately 5 hours. + +To produce large and accurate partial scans by non-rigid fusion, a complete shape prior is necessary. To this end, we propose PIFusion, which utilizes learning-based 3D body recovery (PIFu [25]) as an inner layer in non-rigid fusion [20]. Specifically, in each frame, the inner layer generated by learning-based methods acts as a strong shape prior to improve the tracking accuracy and robustness, and the fused + +mesh in return improves the accuracy of the inner layer by the proposed non-rigid volumetric deformation (Sec. 5.3). We also improve the original PIFu [25] by incorporating pixel-aligned depth features for more accurate and robust inner-layer generation (Fig. 3). + +Another important observation is that to generate accurate portraits, all the partial scans produced by PIFusion should not only construct a looped model ([8, 17]) but also always remain consistent with the real-world observations, especially the depth point clouds and silhouettes. Instead of using the dense bundle method in [8, 30], we contribute a lightweight bundle adjustment method that involves live terms, key frame selection and joint optimization. Specifically, during each iteration, all the partial scans are not only optimized to "loop" with each other in the reference frame but are also warped to fit each key input in live frames. The key frames are selected adaptively according to the proposed live depth/silhouette energies. This method further improves the bundle accuracy without losing efficiency. + +In summary, by carefully designing the reconstruction pipeline, our method integrates all the advantages from learning, fusion and bundle adjustment methods while avoiding the disadvantages and finally enables efficient and robust 3D self-portraits using a single RGBD sensor. + +The contributions can be summarized as follows: + +- A new 3D self-portrait pipeline that leverages fusion, learning and bundle adjustment methods and achieves efficient and robust 3D self-portrait reconstruction using a single RGBD sensor. +- A new non-rigid fusion method, PIFusion, which combines a learning-based shape prior and a non-rigid volumetric deformation method to generate large and accurate partial scans. +- A lightweight bundle adjustment method that involves key frame selection and new live energy terms to jointly optimize the loop deformation in the reference frame, as well as the warp fields to live key frames, and finally improves the bundling accuracy without losing efficiency. + +# 2. Related Work + +# 2.1. Learning-based 3D Human Recovery + +Learning-based 3D body reconstruction has become more and more popular in recent years. By "seeing" a large amount of ground truth 3D human models, current deep neural networks can infer plausible 3D bodies from various easy-to-obtained inputs, e.g., a single RGB image[13, 23, 15, 24, 9, 6, 38, 19, 25, 36]. For example, Kanazawa et al. [13], Omran et al. [23] and Kolotouros et al. [15] proposed to directly regress the parameters of a statistical body template from a single RGB image. Zhu et al. [38] and Alldieck et al. [6] took a step forward by deforming the body template according to shading and silhouettes in order to capture more surface details. To address the challenge of varying cloth topology, recent studies have explored many 3D surface representations for deep neural networks, including voxel grids[36], multi-view + +silhouettes[19], depth maps[9] and implicit functions[25]. Although these methods enable surprisingly convenient 3D human capture, they fail to generate detailed and accurate results due to occlusions and inherent depth ambiguities. + +# 2.2. 3D Human Using Fusion-based Methods + +In fusion-based methods, given a noisy RGBD sequence, the scene geometry is first registered to each frame and then updated based on the observations. As a result, the noise in the depth map can be significantly filtered out and the scene can be completed in a incremental manner. The pioneer work in this direction is KinectFusion[21], which was designed for rigid scene scanning using a RGBD sensor. Thus, when scanning live targets like humans, the subjects are required to keep absolutely static in order to get accurate portraits, which is not consistent with the fact that humans are ultimately moving. To handle this problem, Zeng et al. [34] proposed a method for quasi-rigid fusion, but it still relies on rotating sensors for data capture, which is hard-to-use. DynamicFusion[20] extended KinectFusion and contributed the first non-rigid volumetric fusion method for real-time dynamic scene reconstruction. Following works [12, 26, 27, 10, 16, 32, 35] kept improving the performance of DynamicFusion by incorporating different types of motion priors or appearance information. For instance, based on the double-layer surface representation, DoubleFusion[33] achieved state-of-the-art performance for dynamic human body reconstruction (with implicit loop closure) using non-rigid fusion. However, constrained by the parametric inner layer representation, DoubleFusion has limited performance for reconstructing extremely wide clothes like long skirts and coats. Moreover, the A-posed requirement for system initialization complicates the portrait scanning process for more general poses. + +# 2.3. 3D Self-portrait Using Bundle Adjustment + +To suppress the accumulated error in incremental fusion, another branch of 3D self-portrait methods also utilizes bundle adjustment algorithms. Based on KinectFusion[21], Tong et al. [29] used 3 Kinects and a turntable for data capture and non-rigid bundle adjustment for portrait reconstruction. Cui et al. [7] achieved self-rotating portrait reconstruction via non-rigid bundle. However, the efficiency is low due to large partial scan numbers. Wang et al. [30] conducted bundle adjustment for all point sets without volumetric fusion, which leads to over-smoothed results. The method in [17] is a very related work to ours for it also fuses large partial scans for portrait reconstruction. However, it needs the subject to keep static during the partial scanning process, thus cannot handle self-rotating reconstructions. + +Besides above RGBD methods, using a RGB (without depth) video of a rotating human to reconstruct a plausible portrait is also a practical direction. Alldieck et al. [5, 4, 3] used silhouette-based joint optimization and Zhu et al. [37] used multi-view stereo technologies. However, current methods in this direction still rely on offsetting parametric models to represent cloth, which inherently limits + +![](images/e4c87d39e9431d5ae22624ea8cfd4beeb57e4fd528cc8fca4dc20289380cb7b7.jpg) +Figure 2: System pipeline. In the first frame, we utilize RGBD-PIFu to generate a roughly correct inner model as a prior. Then we perform PIFusion to generate large and accurate partial scans while the performer is turning around in front of the RGBD sensor. Finally, we conduct lightweight bundle adjustment to merge all the partial scans and generate an accurate and detailed 3D portrait. + +their performance for more general clothed human reconstruction. Moreover, sparse feature points from RGB videos are not sufficient for detailed dense surface reconstruction. + +# 3. Overview + +As shown in Fig. 2, given an RGBD sequence with a naturally self-rotating motion of the subject, our system performs 3 steps sequentially: + +1. RGBD-PIFu: In this step, we use a neural network to infer a roughly accurate model of the subject from the first RGBD frame. +2. PIFusion: For each frame, we first perform double-layer-based non-rigid tracking with the inferred model as the inner layer and then fuse the observations into the reference frame using the traditional non-rigid fusion method. Finally, non-rigid volumetric deformation is used to further optimize the inner model to improve both tracking and the fusion accuracy. The partial scans are then generated by splitting the whole sequence into several chunks and fusing each chunk separately. +3. Lightweight bundle adjustment: In each iteration, we first use key frame selection to select effective key frames to construct the live depth and silhouette terms. Then, joint optimization is performed to not only assemble all the partial scans in the reference frame but also optimize the warping fields to live key frames alternately. + +# 4. RGBD-PIFu + +In this work, we extend pixel-aligned implicit functions (PIFu)[25] and propose RGBD-PIFu for 3D self-portrait inference from an RGBD image. PIFu is a spatially aligned representation for 3D surfaces. It is a level-set function $f$ that defines the surface implicitly, e.g., $f(X) = 0$ , $X \in \mathbb{R}^3$ . + +![](images/4b9eed3d6a5c7d8aacf5db005edcee4322252b3e98e605f4fb15463e5f9de1bc.jpg) +(a) + +![](images/e2de57126bc6ba012cb9f383c052f8bb6530600bab9306e435cfee44498fd81f.jpg) +(b) + +![](images/0821cb15bd2901d22c51ba04f5f832197546688ef57f65aa124fc9ef420c6729.jpg) +(c) + +![](images/405d68dff63506dd06b762c8802f7708ccdbb167efe2b5595673c6bd947cc80d.jpg) +Figure 3: Comparison of RGBD-PIFu and PIFu [25]. (a) Reference color image; (b) RGBD-PIFu result; (c) PIFu result. + +In our RGBD-PIFu method, this function is expressed as a composite function $f$ , which consists of a fully convolutional RGBD image encoder $g$ and an implicit function $h$ represented by multilayer perceptrons: + +$$ +f (X; I) = h \left(G (x; I), X _ {z}\right), X \in \mathbb {R} ^ {3}, \tag {1} +$$ + +where $I$ is the input RGBD image, $x = \pi (X)$ is the 2D projection of a 3D point $X$ , $G(x;I)$ is the feature vector of $x$ on the encoded feature map $g(I)$ , and $X_{z}$ is the depth value of $X$ . Different from [25], our image encoder also encodes depth information, which forces the inner model to be consistent with the depth input, thus resolving the depth ambiguity problem and improving the reconstruction accuracy. The training loss is defined as the mean squared error: + +$$ +\mathcal {L} = \frac {1}{n} \sum_ {i = 1} ^ {n} \left| f \left(X _ {i}; I\right) - f ^ {*} \left(X _ {i}\right) \right| ^ {2}, \tag {2} +$$ + +where $X_{i}$ is a sampled point, $f^{*}(X_{i})$ is the ground-truth value, and $n$ is the number of sampled points. + +In the model inference stage, to avoid dense sampling of the implicit function as in [25], we utilize the depth input to ignore empty regions and only perform uniform sampling of the implicit function in the invisible regions. The isosurface + +is extracted by the marching cube algorithm [18]. By incorporating depth features, our network is more robust and accurate than the original RGB-PIFu, thus producing a better mesh as the inner model for robust fusion performance, as shown in Fig. 3. + +# 5. PIFusion + +# 5.1. Initialization + +In the first frame, we initialize the TSDF (truncated signed distance function) volume by direct depth map projection and then fit the inner model to the initialized TSDF volume. The deformation node graph ([28]) is then uniformly sampled on the inner model using geodesic distance, which is used to parameterize the non-rigid deformation of the fused surface and the inner model. + +# 5.2. Double-layer Non-rigid Tracking + +Given the inner model and the fused mesh (i.e., the double-layer surface) in the $(t - 1)$ -th frame, we need to deform them to track the depth map in the $t$ -th frame. Different from DynamicFusion [20], an inner layer is used to assist non-rigid tracking. Hence, there are two types of correspondences: one is between the fused mesh (outer layer) and the depth observation, and the other is between the inner model (inner layer) and the depth observation. The energy function is then formulated as: + +$$ +E _ {\text {t r a c k i n g}} = \lambda_ {\text {o u t e r}} E _ {\text {o u t e r}} + \lambda_ {\text {i n n e r}} E _ {\text {i n n e r}} + \lambda_ {\text {s m o o t h}} E _ {\text {s m o o t h}}, \tag {3} +$$ + +where $E_{\text{outer}}$ and $E_{\text{inner}}$ are the energies of the two types of correspondences, $E_{\text{smooth}}$ is a smooth term to regularize local as-rigid-as-possible deformations, and $\lambda_{\text{outer}}, \lambda_{\text{inner}}, \lambda_{\text{smooth}}$ are the term weights. + +Outer and Inner Term The two terms measure the misalignment between the double layers and the depth map, and they have similar formulations: + +$$ +E _ {\text {o u t e r / i n n e r}} = \sum_ {(\mathbf {v}, \mathbf {u}) \in \mathcal {C} _ {\text {o u t e r / i n n e r}}} \left| \hat {\mathbf {n}} _ {\mathbf {v}} ^ {\top} (\hat {\mathbf {v}} - \mathbf {u}) \right| ^ {2}, \tag {4} +$$ + +where $\mathcal{C}_{\text{outer}}$ and $\mathcal{C}_{\text{inner}}$ are two types of correspondence sets, and $(\mathbf{v}, \mathbf{u})$ is a correspondence pair; $\mathbf{v}$ is a vertex on the outer layer (fused mesh) or the inner layer (inner model), and $\mathbf{u}$ is the closest point to $\mathbf{v}$ on the depth map. Note that $\mathbf{v}$ is the coordinate in the reference frame, while $\hat{\mathbf{v}}$ and $\hat{\mathbf{n}}_{\mathbf{v}}$ are the position and normal of $\mathbf{v}$ in the live frame warped by its KNN nodes using dual quaternion blending: + +$$ +\mathbf {T} (\mathbf {v}) = S E 3 \left(\sum_ {k \in \mathcal {N} (\mathbf {v})} w (k, \mathbf {v}) \mathbf {d q} _ {k}\right), \tag {5} +$$ + +where $\mathbf{dq}_k$ is the dual quaternion of the $k$ -th node, $SE3(\cdot)$ maps a dual quaternion to the $\mathbf{SE}(3)$ space, $\mathcal{N}(\mathbf{v})$ are the KNN nodes of $\mathbf{v}$ , $w(k,\mathbf{v}) = \exp(-\|\mathbf{v} - \mathbf{x}_k\|_2^2/(2r^2))$ is the blending weight, $\mathbf{x}_k$ is the position of the $k$ -th node, and $r$ is the active radius. + +Smooth Term The smooth term is defined on all edges of the node graph to guarantee local rigid deformation. This term is defined as + +$$ +E _ {\text {s m o o t h}} = \sum_ {i} \sum_ {j \in \mathcal {N} (i)} \| \mathbf {T} _ {i} \mathbf {x} _ {j} - \mathbf {T} _ {j} \mathbf {x} _ {j} \| _ {2} ^ {2}, \tag {6} +$$ + +where $\mathbf{T}_i$ and $\mathbf{T}_j$ are the transformations associated with the $i$ -th and $j$ -th nodes, and $\mathbf{x}_i$ and $\mathbf{x}_j$ are the positions of the $i$ -th and $j$ -th nodes in the reference frame, respectively. + +We solve Eq. 3 by the iterative closest point (ICP) algorithm and use the Gauss-Newton algorithm to solve the energy optimization problem. After tracking, we use the typical fusion method [20] to fuse the current depth observations and update the TSDF volume. + +# 5.3. Non-rigid Volumetric Deformation + +The initial inner model inferred by RGBD-PIFu is by no means accurate enough for double-layer surface tracking, and the correspondences between the inner model and the depth map may even reduce the tracking performance. To deal with this issue, inspired by [33], we conduct a non-rigid volumetric deformation algorithm to continue correcting the inner model by fitting it to the fused mesh (i.e., the 0-level set of the TSDF) in the reference volume. Moreover, the weight of the inner term, $\lambda_{\mathrm{inner}}$ in Eq. 3, is also designed to decrease along the ICP iterations to enable a more accurate outer surface fitting performance. + +We utilize the initialized node graph to parameterize the non-rigid deformation of the inner model. Given the updated TSDF volume of the fused mesh, the energy function of non-rigid volumetric deformation is defined as: + +$$ +E _ {\mathrm {v o l}} = E _ {\mathrm {t s d f}} + \lambda_ {\text {s m o o t h}} E _ {\text {s m o o t h}}, \tag {7} +$$ + +where $E_{\mathrm{tsdf}}$ measures the misalignment error between the inner model and the isosurface at threshold 0, and $E_{\mathrm{smooth}}$ is the same as Eq. 6. The TSDF term is defined as + +$$ +E _ {\mathrm {t s d f}} = \sum_ {\mathbf {v} \in \mathbf {T}} | \operatorname {T S D F} (\hat {\mathbf {v}}) | ^ {2}, \tag {8} +$$ + +where $\mathbf{T}$ is the initial inner model without non-rigid deformations in the reference frame, $\mathbf{v}$ is a vertex of $\mathbf{T}$ , $\hat{\mathbf{v}}$ is the position warped by the KNN nodes of $\mathbf{v}$ , TSDF( $\cdot$ ) is a trilinear sampling function that takes a point in the reference frame and returns the interpolated TSDF value. By minimizing the squared sum of the TSDF values of all the vertices of the deformed inner model, the inner model will perfectly align with the fused mesh in the reference frame. + +For the next frame, the corrected inner model is warped to the live frame to search for correspondences in the tracking step. This step provides more accurate correspondences and significantly improves the registration accuracy compared with directly warping the initial inner model. + +# 5.4. Partial Scan Fusion + +To guarantee that the following bundle adjustment is only conducted on a small number of partial scans, we fuse + +![](images/5b122c6f26852112a47234dd43a1bddff83df61e40c4fb77b688605ecdbfc42d.jpg) +Figure 4: Illustration of bundle adjustment with joint optimization. The bundle deformations are optimized to "loop" these partial scans in the reference frame, while the live warp fields are optimized to deform the partial scans to fit live input. + +the partial scans within several large chunks of the whole sequence in the reference frame. Specifically, given a sequence of the performer turning around in front of the sensor, we calculate the orientation of the performer and then split the whole sequence into 5 chunks, which cover the front, back and two side views of the performer. Due to the accumulated error, the first and last partial scans that compose a loop may not align very well. The proposed lightweight bundle adjustment will resolve this problem and finally generate accurate 3D portraits. + +# 6. Lightweight Bundle Adjustment + +Regarding non-rigid bundle adjustment (BA), we argue that a well-looped model after typical BA is an accurate model. Our insight is that after BA, all the partial scans should not only construct a looped model in the reference frame but also be well fitted to all the live observations after non-rigid warping using the live warp fields. To this end, we propose an efficient algorithm to jointly optimize the bundle deformations (for loop closure reconstruction) and live warp fields (for live depth fitting), as shown in Fig. 4. Novel energy terms, including the live depth and silhouette energies, are incorporated to enforce the consistency between the warped partial scans and live depth inputs. However, optimizing the live warp fields corresponding to all the live frames in bundle adjustment will significantly decrease the efficiency. In practice, we found that performing live depth fitting on only several key frames is sufficient for generating accurate results. Therefore, we propose a key frame selection strategy to select effective key frames by sorting the live depth and silhouette energies. + +# 6.1. Joint Optimization + +After PIFusion, we can acquire $N$ partial scans. As illustrated in Fig. 4, we first construct a node graph for each partial scan for describing the bundle deformation, which is then optimized using loop closure correspondences to deform the partial scan to "loop" with the others in the reference frame. Moreover, all the partial scans are deformed together to fit each live frame by optimizing the corresponding live warp field, which is similar to the non-rigid tracking + +in PIFusion. As a result, each partial scan has its own bundle deformation, and all the partial scans share live warp fields in common. + +We solve the joint optimization problem by optimizing the bundle deformations and live warp fields alternately. In each iteration, both bundle deformations and live warp fields will be updated to minimize the total energy. + +# 6.2. Key Frame Selection + +To maintain the efficiency of our algorithm, we propose a key frame selection strategy for constructing efficient and effective live depth fitting terms. Specifically, we uniformly divide the whole sequence into $K$ segments, and before each iteration of joint optimization, for each frame, we calculate two types of metrics: the geometric misalignment error and the silhouette error. The first metric is the misalignment between warped partial scans and the corresponding input depth point cloud. The silhouette error is calculated by first rendering a mask map in the camera view using all the warped partial scans and then calculating the difference between the rendered mask and the input silhouette. We then select the frames with the largest geometric misalignment error and silhouette error in each segment as depth key frames $\mathcal{K}_{\mathrm{dep}}$ and silhouette key frames $\mathcal{K}_{\mathrm{sil}}$ , respectively. + +# 6.3. Formulation + +Different from other bundle adjustment algorithms ([8, 30]), we not only "loop" these partial scans but also introduce live frame observations into the optimization procedure to improve the accuracy. The total energy function is defined as + +$$ +\begin{array}{l} E \left(\mathbf {W} _ {b} ^ {j}, \mathbf {W} _ {l} ^ {i}\right) = \lambda_ {\text {l o o p}} E _ {\text {l o o p}} + \lambda_ {\text {d e p t h}} E _ {\text {d e p t h}} \tag {9} \\ + \lambda_ {\text {s i l l o u t e t t e}} E _ {\text {s i l l o u t e t t e}} + \lambda_ {\text {s m o o t h}} E _ {\text {s m o o t h}}, \\ \end{array} +$$ + +where $\mathbf{W}_b^j$ is the bundle deformation corresponding to the $j$ -th partial scan, $\mathbf{W}_l^i$ is the live warp field from the reference frame to the $i$ -th key frame, and $E_{\mathrm{loop}}$ , $E_{\mathrm{depth}}$ , $E_{\mathrm{silhouette}}$ and $E_{\mathrm{smooth}}$ are the energies of loop closure, live depth, live silhouette and smooth regularization terms, respectively. + +In each iteration, we optimize the bundle deformation and live warp fields alternately to minimize Eq. 9. Note that after PIFusion, although the partial scans have already been well aligned with the live depth inputs, the live warp fields are still not accurate enough to guarantee all the fused partial scans to construct a loop in the reference frame directly. Thus, the bundle deformation in the reference frame will conflict with live depth fitting in the live frames without simultaneously optimizing the live warp fields. + +Loop Term The loop term measures the amount of misalignment among these partial scans and is defined as + +$$ +E _ {\text {l o o p}} = \sum_ {\substack {i, j = 1 \\ i \neq j}} ^ {N} \sum_ {(\mathbf {v} _ {p}, \mathbf {v} _ {q}) \in \mathcal {C} _ {i, j}} \left| \mathbf {W} _ {b} ^ {i} (\mathbf {n} _ {p}) ^ {\top} \left(\mathbf {W} _ {b} ^ {i} (\mathbf {v} _ {p}) - \mathbf {W} _ {b} ^ {j} (\mathbf {v} _ {q})\right) \right| ^ {2}, \tag{10} +$$ + +where $N$ is the number of partial scans, $\mathcal{C}_{i,j}$ is the correspondence set between the $i$ -th and $j$ -th partial scans acquired by searching the closest points, $(\mathbf{v}_p,\mathbf{v}_q)$ is a correspondence pair, $\mathbf{v}_p$ and $\mathbf{v}_q$ are vertices on the $i$ -th and $j$ -th partial scans, respectively, $\mathbf{n}_p$ is the normal of $\mathbf{v}_p$ on the $i$ -th partial scan, and $\mathbf{W}_b^i (\mathbf{v}_p)$ and $\mathbf{W}_b^i (\mathbf{n}_p)$ represent the position and normal warped by bundle deformation. This term forces all the partial scans to register with each other in the reference frame. + +Live Depth Term This term measures the misalignment of all the partial scans with all the depth maps in $\kappa_{\mathrm{depth}}$ : + +$$ +\begin{array}{l} E _ {\text {d e p t h}} = \sum_ {i = 1} ^ {K} \sum_ {j = 1} ^ {N} \sum_ {(\mathbf {v}, \mathbf {u}) \in \mathcal {D} _ {j, i}} \tag {11} \\ \left| \mathbf {W} _ {l} ^ {i} (\mathbf {W} _ {b} ^ {j} (\mathbf {n})) ^ {\top} \left(\mathbf {W} _ {l} ^ {i} (\mathbf {W} _ {b} ^ {j} (\mathbf {v})) - \mathbf {u}\right) \right| ^ {2}, \\ \end{array} +$$ + +where $K = |\mathcal{K}_{\mathrm{depth}}|$ is the number of key frames, $\mathcal{D}_{j,i}$ is the correspondence set between the $j$ -th partial scan and the depth map in the $i$ -th key frame, $(\mathbf{v},\mathbf{u})$ is a correspondence pair, $\mathbf{v}$ is a vertex on the $j$ -th partial scan, $\mathbf{u}$ is a point on the depth map, and $\mathbf{W}_l^i (\cdot)$ takes a point or normal in the reference frame as input and returns the warped position or normal in the $i$ -th key frame. This term is designed to force partial scans to align with depth point clouds in $\mathcal{K}_{\mathrm{depth}}$ . + +Live Silhouette Term This term measures the misalignment between the rendered mask of all the warped partial scans and the input mask of the body shape in the live frames. Similar to LiveCap[11], we preprocess the input mask using the distance transform. For the $i$ -th key frame, we render a mask image of all partial scans deformed by the live warp field and then filter a boundary vertex set $\mathcal{B}_i$ . We define the live silhouette term as + +$$ +E _ {\text {s i l h o u e t t e}} = \sum_ {i = 1} ^ {K} \sum_ {j = 1} ^ {N} \sum_ {\mathbf {v} _ {j} \in \mathcal {B} _ {i}} d _ {j} \cdot \left| I _ {\mathrm {D T}} ^ {i} \left(\pi \left(\mathbf {W} _ {l} ^ {i} \left(\mathbf {W} _ {b} ^ {j} (\mathbf {v} _ {j})\right)\right)\right) \right| ^ {2}, \tag {12} +$$ + +where $K = |\mathcal{K}_{\mathrm{sil}}|$ is the number of key frames, $\mathbf{v}_j$ is a boundary vertex on the $j$ -th partial scan (note that the boundary means that the vertex is projected near the boundaries of the rendered mask image rather than the boundary of this partial scan), $d_j \in \{-1, +1\}$ is an indicated value that indicates the correct direction in the distance field[11], $I_{\mathrm{DT}}^i$ is the distance-transformed image of the input mask and $\pi(\cdot)$ is the projection function. This term will deform the shape of the partial scans to fit with the input silhouettes. + +The smooth term is defined similarly to Eq. 6. We solve Eq. 9 using the Gauss-Newton method. Within each iteration, we construct a large sparse system of linear equations and then utilize an efficient preconditioned conjugate gradient (PCG) solver on a GPU to obtain the updates. + +# 6.4. Non-rigid Multi-texturing + +After lightweight bundle adjustment, we fuse all the partial scans into a watertight mesh using Poisson reconstruction [14]. For each live frame, we project each visible vertex + +to the color image to retrieve a color value. After processing all the frames, we blend the retrieved color values according to the normal direction and obtain the final vertex color. Specifically, for vertex $\mathbf{v}_i$ , we calculate its color $C_{\mathbf{v}_i}$ as a weighted average of the color values retrieved from all the live frames. The blending weight $\omega_{i,j}$ is defined as: + +$$ +\omega_ {i, j} = \left\{ \begin{array}{l l} 0 & , \mathbf {v} _ {i} \text {i s i n v i s i b l e i n t h e} j \text {- t h f r a m e} \\ \frac {\left| \mathbf {n} _ {\mathbf {v} _ {i}} \cdot \hat {z} \right|}{\left| \mathbf {n} _ {\mathbf {v} _ {i}} \right|} & , \mathbf {v} _ {i} \text {i s v i s i b l e i n t h e} j \text {- t h f r a m e} \end{array} , \right. \tag {13} +$$ + +where $\mathbf{n}_{\mathbf{v}_i}$ is the normal of $\mathbf{v}_i$ and $\hat{z}$ is the direction the camera is looking. To avoid oversmoothing, for each vertex, only the top $15\%$ of weighted color values are blended. + +# 7. Results + +In this section, we first report the system performance and our implementation. Then, we compare our method with current state-of-the-art works. Finally, we evaluate the core parts of our system. In Fig. 5, we demonstrate several 3D portraits acquired by our system. + +# 7.1. Performance and Implementation + +Our 3D self-portrait system is very efficient. The whole pipeline is implemented on one NVIDIA Geforce RTX 2080Ti GPU. The initialization that generates the inner model by RGBD-PIFu and initializing PIFusion takes almost 10 seconds. PIFusion runs in real-time (at $30~\mathrm{ms}$ per frame). For each frame, the tracking, volumetric deformation and fusion take $20~\mathrm{ms}$ , $3~\mathrm{ms}$ and $6~\mathrm{ms}$ , respectively. + +Similar to [25], we adapt a stacked hourglass network [22] as the image encoder, and the implicit function is presented by a MLP with 257, 1024, 512, 256, 128, and 1 neurons in each layer. We render the Twindom dataset (https://web.twindom.com/) to acquire depth and color images and utilize 3500 images to train this network. When training, the batch size is 4, the learning rate is $1 \times 10^{-3}$ , and the number of epochs is 28. The training procedure takes one day on one RTX 2080Ti GPU. + +In the tracking of PIFusion, the number of ICP iterations is 5 per frame, and we set $\lambda_{\mathrm{outer}} = 1.0$ , $\lambda_{\mathrm{inner}} = 1.0$ , and $\lambda_{\mathrm{smooth}} = 5.0$ , while $\lambda_{\mathrm{inner}}$ will decrease linearly as the iteration continues. For each vertex, we use its 4 nearest neighbors for non-rigid deformation, and the number of neighbors of each node is 8. In bundle adjustment, the numbers of partial scans and key frames are both 5, we set $\lambda_{\mathrm{loop}} = 1.0$ , $\lambda_{\mathrm{depth}} = 0.5$ , $\lambda_{\mathrm{silhouette}} = 0.001$ and $\lambda_{\mathrm{smooth}} = 2.0$ , and the number of iterations is 25. This procedure takes only 15 seconds, and texturing takes 1 second. + +# 7.2. Comparison + +Comparison with Fusion Methods We compared our fusion method PIFusion with DynamicFusion [20] and DoubleFusion [33] using sequences captured by a Kinect V2 sensor. Fig. 6 demonstrates that our method improves the tracking and implicit loop-closure performance compared to the other methods, especially for subjects wearing loose + +![](images/d6d50fce430f65a3b2036485a1a8ae3c2732bc15e6cf0960e85462ca28010f4d.jpg) +Figure 5: Examples of 3D portraits acquired by our system. + +![](images/cdec6954ef1c5868014f9454ec46efce89d4d3a2e26d9cb7be7414bb6f0db3ab.jpg) +(a) + +![](images/29c21a73ac3174ec12cbb1ee0da5f558673582c4136450006bd61e9ecf1e59ce.jpg) + +![](images/7de54612f6937e51ddc7565ea646eec1774ee69aee22c3513a2f77dd1692c22a.jpg) +(b) + +![](images/625d3ea91f6f79d6c3b15dc0eadadd991f8f82eac083640644dceeeb7343191d.jpg) + +![](images/5f917a3929fce53c542bca610f2622333935f0a8bc4400aa5e57c0d5539354a7.jpg) +(c) + +![](images/04f594e10a4a5eb69b48426dda29299d2c02e4b46715f027652385183ff733cf.jpg) + +![](images/f15480846bf3c4002985736e4da96e8c04206dc1b82d26b4a8ea7dbb0bfb4218.jpg) +(d) +Figure 6: Comparison of the proposed PIFusion, DynamicFusion [20] and DoubleFusion [33] methods. (a) Reference depth input; (b), (c) and (d) are the results of PIFusion, DynamicFusion and DoubleFusion, respectively. + +clothes. Note that for this experiment, we use PIFusion to fuse the whole sequence without generating partial scans. + +Comparison with Bundle Adjustment Methods We compare our method with the state-of-the-art non-rigid bundle adjustment method Wang et al. [30]. As shown in Fig. 7, our method achieves much more detailed and accurate 3D self-portraits than [30]. Moreover, as mentioned in the related work section of [30], although the results are plausible, [17] requires the subject to remain static several times during scanning, thus complicating the scanning process. + +![](images/51ddca5d5d5c9f45478ce12daf311afd8a59d38312fb428ae7a085822809de2b.jpg) +Figure 7: Comparison of our method (the top row) with the method proposed by Wang et al. [30] (the bottom row). + +![](images/0e59662ae8044f1bd636a3cfc9b5ff30be719230dbbfe91514d385981413bd69.jpg) + +# 7.3. Evaluation + +# Ablation Studies on Energy Terms + +- Inner and Outer Terms in PIFusion Without the inner term, PIFusion will degenerate into DynamicFusion [20], which suffers from heavy drifts and tracking errors (Fig. 6). Moreover, the lack of the outer term makes the final reconstruction accuracy fully depend on the accuracy of the shape prior, which is usually not accurate enough. + +- Live Silhouette Term in Bundle Adjustment Fig. 8 demonstrates that the live silhouette term could deform partial scans to be consistent with input silhouettes, thus further improving the accuracy of the optimized partial scans. + +Non-rigid Volumetric Deformation We evaluate the non-rigid volumetric deformation qualitatively, as shown in + +![](images/54439038ba6b8d78c196d953c072ff036a2ecfec2f5f15e88f2c6d265166f229.jpg) +(a) + +![](images/6d01af7ce3e62a75610ddabc64fe787b3e55640acac8525ad4d51977687603b3.jpg) +Figure 8: Evaluation of the live silhouette term. (a) Optimized partial scans with (left) and without (right) the live silhouette term, (b) the mask error maps in the 1st key frame with (left) and without (right) the live silhouette term, (c) mask error maps in the 3rd key frame with (left) and without (right) the live silhouette term (nonblack pixels represent errors). + +![](images/70490c8d54e93c93797fe114f3e11d466cb6e5b41e458bda27f711372fa2f5f6.jpg) +(b) + +![](images/b943fd6bd54abeb16893853dd70404625c8ad272d9e5a7ba039735d3caa1f5c5.jpg) +(c) + +![](images/c117d28d942689787e687e733863f5a1e87f91455132834ad6340b54105ae86b.jpg) +(a) + +![](images/ae92f93eab52bd9cbaf8f9fd10ceb6e6d14e44137dd34e1492d35f2243adab3b.jpg) + +![](images/13b4189a20405a322b7b4e15393d10ff0262c1f2ca0ef8640fa955dfb78f145b.jpg) + +![](images/87b58d9f42e6b8996ac6a35978a9e38f6d292653c8b7323ee7598647e7a5cb6f.jpg) +(b) + +![](images/63b5b833ca78250a43e6f8294f9b6508c83ff1cef89b07e5584a63c66fe9761d.jpg) +(c) +Figure 9: Evaluation of the non-rigid volumetric deformation step. Fused mesh without (a) and with (b) volumetric deformation; (c) the original inner model generated by RGBD-PIFu; (d) the inner model after volumetric deformation. + +![](images/b3754c060721c3dddeec990b5b335ecc149251d4dea73300ab7a3f0d6f2cf301.jpg) +(d) + +Fig. 9. The results demonstrate that without volumetric deformation, the fused geometry will highly depend on the original inner model generated by RGBD-PIFu. With non-rigid volumetric deformation, the outer observations are introduced to update the inner model in each frame. This step will alleviate the errors brought by the inner model and improve the accuracy of our reconstruction results. + +Loop Closure We compare the reconstructed result after lightweight bundle adjustment with the mesh completely fused using PIFusion in Fig. 10. This comparison demonstrates that PIFusion still suffers from loop-closure problems, especially in the cases of challenging motion (very articulated motion) and an inaccurate initial inner model. With the help of bundle adjustment, we can obtain more accurate portraits efficiently than the fusion methods. + +Joint Optimization We evaluate the joint optimization by the total energy of Eq. 9 in each iteration. Fig. 11 demonstrates that joint optimization of both the bundle deformation and live warp fields can achieve a lower optimum than the method without joint optimization. + +Body Measurement We quantitatively evaluated the accuracy of our results on body measurements. To evaluate the measurement error, we first utilized a laser scanner to obtain the ground-truth shape of a tight-clothed subject and then scanned the subject again using our system. Tab. 1 shows the measurement results of several body parts, which illustrates that our method acquires more accurate re + +![](images/5d12a4613f35f1f2141a94dbac7375b8ccaa308837209697c435127aa6913a51.jpg) +(a) + +![](images/280b787fc8d04bc173675bbdab95520a497313117ba69ebc42622cdecbe5ee64.jpg) +(b) + +![](images/208c3bbb43044ec6ff95c7698408541afef4fb31c86e39f35849bbdb60aa418e.jpg) +Figure 10: Evaluation of the loop closure. (a) Fused mesh by PIFusion; (b) the reconstructed mesh after bundle adjustment. +Figure 11: The total energy in each bundle adjustment iteration. + +
Methodchestwaistright knee
DoubleFusion[33]98.792.543.1
PIFusion97.687.240.7
Bundle Adjustment94.684.539.6
Ground Truth91.279.737.7
+ +Table 1: Evaluation of body measurements on case "lz": the circumference of some body parts (cm). + +sults than the state-of-the-art fusion-based body reconstruction method, DoubleFusion[33]. Moreover, the proposed lightweight bundle adjustment method is effective in further improving the accuracy of the final reconstruction. + +# 8. Discussion + +Conclusion In this paper, we have proposed a new method for robust and efficient 3D self-portrait reconstruction from a single RGBD camera. We propose PIFusion, a novel volumetric non-rigid fusion method constrained by a learned shape prior, for generating large and accurate partial scans. More importantly, the proposed lightweight bundle adjustment method not only guarantees the generation of a looped model in the reference frame but also ensures the alignment with live key observations, which further improves the accuracy of the final portrait without losing efficiency. In conclusion, with the proposed method, users can conveniently obtain detailed and accurate 3D self-portraits in seconds. + +Limitations Our method still relies on the completeness of the shape prior provided by RGBD-PIFu. Specifically, if the inferred shape prior loses some body parts, the final reconstruction may also lose these parts. Moreover, if some cases (e.g., object interactions) are not included in the training dataset of RGBD-PIFu, they may also not be well handled. However, growing the deformation node graph according to live observations may solve these problems. + +Acknowledgments This paper is supported by the NSFC No.61827805, No.61531014 and No.61861166002. + +# References + +[1] https://texel.graphics/. +[2] https://www.shapify.me/. +[3] T. Alldieck, M. Magnor, B. L. Bhatnagar, C. Theobalt, and G. Pons-Moll. Learning to reconstruct people in clothing from a single RGB camera. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), jun 2019. +[4] T. Alldieck, M. Magnor, W. Xu, C. Theobalt, and G. Pons-Moll. Detailed human avatars from monocular video. In International Conference on 3D Vision (3DV), sep 2018. +[5] T. Alldieck, M. Magnor, W. Xu, C. Theobalt, and G. Pons-Moll. Video based reconstruction of 3d people models. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. +[6] T. Alldieck, G. Pons-Moll, C. Theobalt, and M. Magnor. Tex2shape: Detailed full human body geometry from a single image. In IEEE International Conference on Computer Vision (ICCV). IEEE, 2019. +[7] Y. Cui, W. Chang, T. Noll, and D. Stricker. Kinectavatar: Fully automatic body capture using a single kinect. In J.-I. Park and J. Kim, editors, Computer Vision - ACCV 2012 Workshops, pages 133-147, Berlin, Heidelberg, 2013. SPRINGER Berlin Heidelberg. +[8] M. Dou, J. Taylor, H. Fuchs, A. Fitzgibbon, and S. Izadi. 3d scanning deformable objects with a single rgbd sensor. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 493-501, Boston, 2015. IEEE. +[9] V. Gabeur, J. Franco, X. Martin, C. Schmid, and G. Rogez. Moulding humans: Non-parametric 3d human shape estimation from single images. CoRR, abs/1908.00439, 2019. +[10] K. Guo, F. Xu, T. Yu, X. Liu, Q. Dai, and Y. Liu. Real-time geometry, albedo and motion reconstruction using a single rgbd camera. ACM Transactions on Graphics, 36(3):32:1-32:13, 2017. +[11] M. Habermann, W. Xu, M. Zollhöfer, G. Pons-Moll, and C. Theobalt. Livecap: Real-time human performance capture from monocular video. ACM Transactions on Graphics, 38(2):14:1-14:17, Mar. 2019. +[12] M. Innmann, M. Zollhöfer, M. Nießner, C. Theobalt, and M. Stamminger. Volumedeform: Real-time volumetric non-rigid reconstruction. In European Conference on Computer Vision (ECCV), volume 9912, pages 362-379, Amsterdam, 2016. SPRINGER. +[13] A. Kanazawa, M. J. Black, D. W. Jacobs, and J. Malik. End-to-end recovery of human shape and pose. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7122-7131, Salt Lake City, 2018. IEEE. +[14] M. Kazhdan, M. Bolitho, and H. Hoppe. Poisson surface reconstruction. In Proceedings of the Fourth Eurographics Symposium on Geometry Processing, SGP '06, pages 61-70, Aire-la-Ville, Switzerland, Switzerland, 2006. Eurographics Association. +[15] N. Kolotouros, G. Pavlakos, and K. Daniilidis. Convolutional mesh regression for single-image human shape reconstruction. In CVPR, 2019. +[16] C. Li, Z. Zhang, and X. Guo. Articulatedfusion: Real-time reconstruction of motion, geometry and segmentation using a single depth camera. In European Conference on Computer Vision (ECCV), pages 324-40, Munich, 2018. SPRINGER. +[17] H. Li, E. Vouga, A. Gudym, L. Luo, J. T. Barron, and G. Gusev. 3d self-portraits. ACM Transactions on Graphics, 32(6):187:1-187:9, 2013. + +[18] W. E. Lorensen and H. E. Cline. Marching cubes: A high resolution 3d surface construction algorithm. In ACM SIGGRAPH, pages 163-169, New York, NY, USA, 1987. ACM. +[19] R. Natsume, S. Saito, Z. Huang, W. Chen, C. Ma, H. Li, and S. Morishima. Siccope: Silhouette-based clothed people. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +[20] R. A. Newcombe, D. Fox, and S. M. Seitz. Dynamicfusion: Reconstruction and tracking of non-rigid scenes in real-time. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 343-352, Boston, 2015. IEEE. +[21] R. A. Newcombe, S. Izadi, O. Hilliges, D. Molyneaux, D. Kim, A. J. Davison, P. Kohli, J. Shotton, S. Hodges, and A. Fitzgibbon. Kinectfusion: Real-time dense surface mapping and tracking. In IEEE International Symposium on Mixed and Augmented Reality (ISMAR), pages 127-136, Washington, DC, USA, 2011. IEEE Computer Society. +[22] A. Newell, K. Yang, e. B. Deng, Jia", J. Matas, N. Sebe, and M. Welling. Stacked hourglass networks for human pose estimation. In European Conference on Computer Vision (ECCV), pages 483-499, Cham, 2016. SPRINGER. +[23] M. Omran, C. Lassner, G. Pons-Moll, P. Gehler, and B. Schiele. Neural body fitting: Unifying deep learning and model based human pose and shape estimation. In International Conference on 3D Vision (3DV), pages 484-494, Verona, sep 2018. IEEE. +[24] G. Pavlakos, V. Choutas, N. Ghorbani, T. Bolkart, A. A. A. Osman, D. Tzionas, and M. J. Black. Expressive body capture: 3d hands, face, and body from a single image. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1-8, Long Beach, 2019. IEEE. +[25] S. Saito, , Z. Huang, R. Natsume, S. Morishima, A. Kanazawa, and H. Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. In IEEE International Conference on Computer Vision (ICCV), 2019. +[26] M. Slavcheva, M. Baust, D. Cremers, and S. Ilic. Killing-Fusion: Non-rigid 3D Reconstruction without Correspondences. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5474-5483, Honolulu, 2017. IEEE. +[27] M. Slavcheva, M. Baust, and S. Ilic. Sobolevfusion: 3d reconstruction of scenes undergoing free non-rigid motion. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2646-2655, Salt Lake City, June 2018. IEEE. +[28] R. W. Sumner, J. Schmid, and M. Pauly. Embedded deformation for shape manipulation. ACM Transactions on Graphics, 26(3), July 2007. +[29] J. Tong, J. Zhou, L. Liu, Z. Pan, and H. Yan. Scanning 3d full human bodies using kinetics. IEEE Transactions on Visualization and Computer Graphics, 18(4):643-650, 2012. +[30] K. Wang, G. Zhang, and S. Xia. Templateless non-rigid reconstruction and motion tracking with a single rgb-d camera. IEEE Transactions on Image Processing, 26(12):5966-5979, Dec 2017. +[31] S. Wang, X. Zuo, C. Du, R. Wang, J. Zheng, and R. Yang. Dynamic non-rigid objects reconstruction with a single rgb-d sensor. Sensors (Basel, Switzerland), 18, 03 2018. +[32] T. Yu, K. Guo, F. Xu, Y. Dong, Z. Su, J. Zhao, J. Li, Q. Dai, and Y. Liu. Bodyfusion: Real-time capture of human motion and surface geometry using a single depth camera. In IEEE International Conference on Computer Vision (ICCV), pages 910-919, Venice, 2017. IEEE. + +[33] T. Yu, Z. Zheng, K. Guo, J. Zhao, Q. Dai, H. Li, G. Pons-Moll, and Y. Liu. Doublefusion: Real-time capture of human performances with inner body shapes from a single depth sensor. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7287-7296, Salt Lake City, June 2018. IEEE. +[34] M. Zeng, J. Zheng, X. Cheng, and X. Liu. Templateless quasi-rigid shape modeling with implicit loop-closure. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2013. +[35] Z. Zheng, T. Yu, H. Li, K. Guo, Q. Dai, L. Fang, and Y. Liu. Hybridfusion: Real-time performance capture using a single depth sensor and sparse imus. In European Conference on Computer Vision (ECCV), pages 389-406, Munich, Sept 2018. SPRINGER. +[36] Z. Zheng, T. Yu, Y. Wei, Q. Dai, and Y. Liu. Deephuman: 3d human reconstruction from a single image. In IEEE International Conference on Computer Vision (ICCV), October 2019. +[37] H. Zhu, Y. Liu, J. Fan, Q. Dai, and X. Cao. Video-based outdoor human reconstruction. IEEE Transactions on Circuits and Systems for Video Technology, 27(4):760-770, Apr. 2017. +[38] H. Zhu, X. Zuo, S. Wang, X. Cao, and R. Yang. Detailed human shape estimation from a single image by hierarchical mesh deformation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. \ No newline at end of file diff --git a/robust3dselfportraitsinseconds/images.zip b/robust3dselfportraitsinseconds/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c1989f6c0385f36b926e2696ddda70155c30f991 --- /dev/null +++ b/robust3dselfportraitsinseconds/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01d00a6c216553f1dcdc62c19dae6721238e16d15bcdfa9c9aa78761528542ab +size 542515 diff --git a/robust3dselfportraitsinseconds/layout.json b/robust3dselfportraitsinseconds/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f2ae0cd085c02473c61996a16e94e47f95720f02 --- /dev/null +++ b/robust3dselfportraitsinseconds/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa0a3bf8b0d1781efd1bb72a7bf8c5f498dd01e9c77a9ad97099d8e31e58c668 +size 477136 diff --git a/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_content_list.json b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f666a22ef4dc29c43b2ec8bd5fe83079e34e2a3 --- /dev/null +++ b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5e8075c9cd0e012e4b6bafda485e869008ecbb978442a4976772e553e6c4b00 +size 77611 diff --git a/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_model.json b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1425cda044520080105082b35913f12e74c20060 --- /dev/null +++ b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:257b3414e6ba5edf11375069d10f3e437fc438660c4f7e5d2133cc6e6ec7e58b +size 92514 diff --git a/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_origin.pdf b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d14cade10c9efa5446c338f0450c36473f971bd2 --- /dev/null +++ b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/72e53f13-e7c7-4b9d-a190-174e600a6f6a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9467ae79ed42e1f604e09ab7d9da44ffdfc7d8d967008588b25a6816ed65dda +size 236525 diff --git a/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/full.md b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d9191fa8241e7207553c7084009365f9d2c0acad --- /dev/null +++ b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/full.md @@ -0,0 +1,265 @@ +# Robust Design of Deep Neural Networks against Adversarial Attacks based on Lyapunov Theory + +Arash Rahnama Modzy arash.rahnama@modzy.com + +Andre T. Nguyen Booz Allen Hamilton nguyen_andre@bah.com + +Edward Raff Booz Allen Hamilton raff_edward@bah.com + +# Abstract + +Deep neural networks (DNNs) are vulnerable to subtle adversarial perturbations applied to the input. These adversarial perturbations, though imperceptible, can easily mislead the DNN. In this work, we take a control theoretic approach to the problem of robustness in DNNs. We treat each individual layer of the DNN as a nonlinear system and use Lyapunov theory to prove stability and robustness locally. We then proceed to prove stability and robustness globally for the entire DNN. We develop empirically tight bounds on the response of the output layer, or any hidden layer, to adversarial perturbations added to the input, or to any preceding hidden layer. We show how the spectral norm of the weight matrix for an individual layer relates to Lyapunov properties of that layer, and consequently to the local and global stability and robustness of the DNN. Our results give new insights into how spectral norm regularization can mitigate the adversarial effects. Finally, we evaluate the power of our approach on a variety of data sets and network architectures and against some of the well-known adversarial attacks. + +# 1. Introduction + +The objective of a supervised learning task for the input $u \in \mathbb{R}^d$ , and its associated target value $y$ for a given DNN denoted by $H_{\theta}(u)$ , where $\theta$ is a set of parameters to be learned during the training, is to classify the instance $u$ correctly such that $y = H_{\theta}(u)$ . Recently, the research community has become interested in adversarial attacks, where the adversary's goal is to introduce a small amount of engineered perturbation $\Delta \in \mathbb{R}^d$ to $u$ , so that $u' = u + \Delta$ , while still maintaining its perceptual similarity to $u$ , can deceive the DNN into making a mistake, i.e., $H_{\theta}(u + \Delta) \neq y$ . The adversary is usually assumed to be constrained by an $\ell_p$ -norm + +so that $\| u' - u\|_{\ell_p} \leq \epsilon$ , where $\epsilon$ bounds the adversaries' freedom to alter the input. While this does not capture the full scope of potential adversaries [4], attacks of this form have proven difficult to prevent [32, 5, 2, 31]. While optimal defenses have been developed for simple linear models [3, 24], the over-parameterized nature of DNNs and the complexity of surfaces learned during training make the development of robust solutions against the adversary difficult [14]. + +In this work, we use Lyapunov theory of stability and robustness of nonlinear systems to develop a new understanding of how DNNs respond to changes in their inputs, and thus, to adversarial attacks under the $\ell_2$ norm framework. By treating each layer $l$ in the DNN as a nonlinear system $h_l$ , we develop a new framework which sets tight bounds on the response of the individual layer to adversarial perturbations (maximum changes in $\| h_l(u) - h_l(u + \Delta)\| _2^2$ ) based on the spectral norm of the weights, $\rho (W_{l})$ , of the individual layer. We characterize Lyapunov properties of an individual layer and their relationship to local and global stability and robustness of the network. + +Since our analysis is based on a sequence of nonlinear transformations $h_{l = 1,\dots,n}$ , our method is the first to bound the response to input alterations by the attack parameter $\Delta_l$ for any layer $l$ in the DNN. For simple forward networks (fully connected and convolutional), our results show that an attack's success under the $\ell_2$ ball is independent of the depth of the DNN and that the spectral norm of the weight matrix for the first and last layer of a network have the largest effect on robustness. Our Lyapunov analysis of Residual Blocks shows that the skip-connections of these blocks contribute to their lack of robustness against adversarial attacks [13] and that these blocks require more restrictive Lyapunov conditions (a tighter spectral norm regularization) for maintaining the same level of robustness. This may compromise the DNN's accuracy on the clean data set [34, 10]. Previous works [11, 28, 37, 8] have used a penalty on the spec + +tral norm to build networks more robust to attack. However, their analysis requires using one penalty for all layers, which over-regularizes the networks (reducing accuracy in all cases [10]), and provides only loose bounds that can not be empirically evaluated. Our approach shows how and why to set different spectral penalties for each layer, improving the accuracy of the model on clean and perturbed inputs. Simultaneously, our bound is empirically tight and has no hidden constants, giving us greater insight to the impact of attacks and how perturbations propagate through the network. + +In summary, our contributions revolve around showing that adversarial ML research can leverage control theory to understand and build defenses against strong adversaries. This can accelerate the research progress in this area. We prove that with our proposed training approach, the perturbation to the final activation function $(\Delta_{n}\in \mathbb{R}^{d})$ is bounded by $\| \Delta_n\| _2\leq \sqrt{c}\cdot \epsilon$ , where $c$ is a constant determined by the hyper-parameters chosen and $\epsilon$ models the adversarial perturbation magnitude. Our bound is empirically tight, and applies to all possible inputs, and to attacks applied at any layer of the network (input, or hidden), with no distributional assumptions. Our analysis shows how Residual Blocks can aid adversarial attacks, and extensive empirical tests show that our approach's defensive advantages increase with the adversary's freedom $\epsilon$ . + +# 2. Related work + +To provide certifiable defenses, complex optimization schemes are usually adopted to show that all the data points inside an $\ell_p$ ball around a sample data point have the same prediction [36, 21, 7, 9]. The bounds provided by these methods are usually loose, and the computational costs associated with them increase exponentially with the size of the network. These approaches are only applicable to parts of the input space for which feasible solutions exist. Works such as [39] have empirically shown that bounding a layer's response to the input generally improves robustness. Works such as [35, 40] focus on certifying robustness for a DNN by calculating the bounds for the activation functions' responses to the inputs. The closest to our work are the results given in [11, 28, 37, 8]. [8] utilizes Lipschitz properties of the DNN to improve robustness against adversarial attacks. Unlike [8], our approach does not require a predetermined set of hyper-parameters to prove robustness. Our analysis provides a range of possible values which determine different levels of robustness and may be selected per application. Similarly, [28] empirically explores the benefits of bounding the response of the DNN by regularizing the spectral norm of layers based on the Lipschitz properties of the DNN. These Lipschitz based approaches may be seen as one subset of our Lyapunov based approach. As we will describe, our Lyapunov based analysis is built upon a more general input-output nonlinear mapping which does not necessarily + +depend on restricting the networks's Lipschitz property. [37] explores the benefits of training networks with spectral regularization for improving generalizability against input perturbations. However, their work bounds the spectral norm of all layers by 1. As we will show, this approach limits the performance on the clean data set and does not produce the most robust DNN. [11] uses PAC-Bayes generalization analysis to estimate the robustness of DNNs trained by spectral regularization against adversarial attacks. The analysis given in their work however, requires the same regularization condition enforced across all layers of the DNN. Our work provides per layer conditions for robustness, which may be utilized for the selection of the best regularization parameters for each layer independently, given a data set and architecture through cross-validation. Although, we have not empirically shown in the paper, our approach theoretically should provide a level of robustness against intermediate level attacks recently introduced in [18]. Our work provides a theoretical backing for the empirical findings in [28, 36] which state that Leaky ReLu, a modified version of the ReLu function, may be more robust comparatively. Finally, only one prior work has looked at control theory for adversarial defense, but their method covered only a toy adversary constrained to perturbing the input by a constant [29]. + +![](images/3d19d27b3b00e147d22f1c8cefe0ee1c574b9ab0b8bdd16431349757517fe233.jpg) + +![](images/e1e91399bb3eded319ec295c7182769fc387f51bffcbcd4ab3224ad5750975f4.jpg) +Figure 1: A nonlinear system (top). The DNN modeled as a cascade of nonlinear systems (bottom). + +# 3. Preliminaries and Motivation + +In this work, we address the machine learning problem of adversarial attacks on DNNs from a control theoretic perspective. To aid in bridging the gap between these two fields, we will briefly review the core control theory results needed to understand our work, with further exposition in Appendix A for less familiar readers. The design of stable and robust systems that maintain their desired performance in the presence of external noise and disturbance has been studied in the control theory research literature. Our work is based on the Lyapunov theory of stability and robustness of nonlinear systems which dates back to more than a century ago [22]. We treat each layer of the DNN as a nonlinear system and model the DNN as a cascade connection of nonlinear systems. A nonlinear system is defined as a system which produces an output signal for a given input signal + +through a nonlinear relationship. More specifically, consider the following general definition for the nonlinear system $H$ (Fig. 1), + +$$ +H: \left\{ \begin{array}{l} \dot {x} = f (x, u) \\ y = h (x, u), \end{array} \right. +$$ + +where $x \in X \subseteq R^n$ , $u \in U \subseteq R^m$ , and $y \in Y \subseteq R^k$ are respectively the state, input and output of the system, and $X, U$ and $Y$ are the local state, input and output sub-spaces around the current operating points. The nonlinear mappings $f$ and $h$ model the relationship among the input signal $u$ , the internal states of the system $x$ and the output signal $y$ . To help connect these control theory notations and definitions to our analysis of DNN models, see Table 1. + +Table 1: A control theory to machine learning mapping. + +
Control theoretic definitionContext for our work
uInput of the nonlinear systemInputs to the DNN (e.g., image) or the inputs to a hidden layer from the previous layer
yOutput of the nonlinear systemOutput of the DNN or the output of any hidden layer
xStates of the nonlinear systemWeights and biases of a layer
x̂Transient changes of the states over discrete or continuous stepsChanges of the weights and biases during t training steps
f(.)Nonlinear function modeling the transient changes of the states of the system based on the previous state and current inputModels the updates applied to the weights' and biases' of a layer over the t training steps
h(.)Nonlinear function modeling the steady-state behavior of the system given the current state and inputModels the input-output relationship of a hidden layer given the current values of weights, biases and input
ρ,νLyapunov parameters modeling the input-output behavior (robustness and stability properties) of the system (explained in Subsection 4.3)Values determining the extent of spectral regularization enforced at a layer given the desired level of robustness and accuracy (Theorem 3, Corollary 2)
+ +The behavior of a layer inside the DNN may be modeled as a nonlinear system defined above. More specifically, for the layer $l$ , the input signal $u$ takes the size of the layer + +$l - 1$ and stands for the input to the layer $l$ before it is transformed by the weights and biases. $y$ has the size of layer $l$ and may be defined as the output of the layer $l$ after the activation functions. The weights and biases of the DNN are the states of the nonlinear systems. In this vein, $h$ and $f$ are general functions which model the relationship between the states $x$ , and the nonlinear transformation applied to the input of the layer $u$ to produce the output $y$ of the layer after activation functions. The states are dynamically updated through gradient descent, given the inputs from the training data set during the training iterations $t$ . $\dot{x}_l$ is the derivative taken over training iterations indicating that the weights and biases are changing during training, and $f$ models this nonlinear behavior during the training iterations. Please see Appendix A for further details. + +Our analysis is based on Lyapunov theory which gives us the freedom to define stability and robustness purely based on the input-output relationship of the layers without the exact knowledge of the internal state changes $\dot{x}$ (i.e., we do not need to know the specific weight and bias values). More specifically, Lyapunov theory combined with the fact that we are showing bounded-input-bounded-output (BIBO) stability and robustness of the layer, allows us to abstract out the transient behavior of the nonlinear systems during the training iterations $t$ , i.e., $\dot{x}_l(t) = f_l(x_l(t), u_l(t))$ where $x_l(t) = \{W_l(t), B_l(t)\}$ , from the robustness analysis and focus only on the steady-state behavior of the nonlinear system, i.e., the input-output mapping of the layer, $y_l = h_l(x_l, u_l) = h_l(\{W_l, B_l\}, u_l)$ where $h_l(.)$ models the nonlinear transformation. By analyzing $h_l(.)$ , we can derive robust conditions to be enforced during training for the states of a layer $\{W_l, B_l\}$ . + +Next, we define an input-output stability and robustness Lyapunov criterion for a nonlinear system. A nonlinear system is said to be bounded-input-bounded-output (BIBO) stable, if it produces bounded outputs for bounded input signals. A nonlinear system is said to be stable and robust, if it produces bounded output signals that are close in the Euclidean space, when their respective input signals are also close enough in the Euclidean space [22]. Mathematically, these definitions can be represented as follows, + +Definition 1 [22] System $H$ is instantaneously incrementally finite-gain (IIFG) $\ell_2$ -stable and robust, if for any two inputs $u_1, u_2 \in U$ , there exists a positive gain $\gamma$ , such that the relation, + +$$ +\left| \left| y _ {2} - y _ {1} \right| \right| _ {\ell_ {2}} \leq \gamma \left| \left| u _ {2} - u _ {1} \right| \right| _ {\ell_ {2}}. +$$ + +locally holds. Here, $\| y_2 - y_1 \|_{\ell_2}$ and $\| u_2 - u_1 \|_{\ell_2}$ represent the Frobenius $\ell_2$ -norm of the input signals $u_1$ and $u_2$ and their respective output signals $y_1$ and $y_2$ . + +If a system is IIFG stable and robust, then the changes in the output of the entire system are bounded by the changes in the + +input of the entire system. As a result, if the changes in the input are minuscule, which is the assumption for the majority of $\ell_2$ adversarial attacks, then the changes in their respective outputs are also minuscule. This is the exact behavior that we would like to encourage for each layer of the DNN so that the entire network is robust against adversarial attacks. + +Remark 1 It is important to note that the relationship given in Definition 1 is more general than enforcing Lipschitz continuity. In particular, the above relationship should only hold locally for the input signals $u_{1}$ and $u_{2}$ for the DNN to be IIFG. Further, the above assumption does not place any constraints on the initial conditions of the DNN. Additionally, Lipschitz continuity implies uniform continuity, but the relationship given above potentially allows for discontinuous distributions and does not enforce any continuously differentiable condition on the mapping from the input to the output of the DNN [22, 12, 19]. Finally, we will show that the enforcement of the relationship given in Definition 1 locally at the layer level is not necessary. We will show that by enforcing a much looser condition at each layer, we can encourage the behavior given in Definition 1 globally for the DNN. + +Lyapunov theory of dissipativity provides a fundamental framework for the stability and robustness analysis of systems based on a generalized notion of the "energy" supplied and dissipated in the system [22]. This generalized notion of "energy" is defined based on a relationship that solely relies on the input and output of the system. This theory states that a passive system which dissipates energy is robust and stable. The benefit of this approach is that by only enforcing a relationship between the input and output of the DNN, we can define a measure of stability and robustness for the entire DNN against adversarial attacks and characterize robust conditions for the states of the DNN (weights and biases). This is done by first defining an input-output mapping which characterizes a specific relationship between the input and output of the layers inside the DNN and then enforcing that the relationship should hold for the DNN for all the inputs supplied to the model and the outputs produced by the model during training so that the same will hold during inference. The following definition provides the mathematical representation of the aforementioned concept, + +Definition 2 [38] System $H$ is considered to be instantaneously incrementally Input Feed-Forward Output Feedback Passive (IIFOFP), if it is dissipative with respect to the input-output mapping $\omega(\cdot, \cdot)$ , + +$$ +\begin{array}{l} \omega \left(u _ {2} - u _ {1}, y _ {2} - y _ {1}\right) = \left(u _ {2} - u _ {1}\right) ^ {T} \left(y _ {2} - y _ {1}\right) \\ - \delta (y _ {2} - y _ {1}) ^ {T} (y _ {2} - y _ {1}) - \nu (u _ {2} - u _ {1}) ^ {T} (u _ {2} - u _ {1}), \\ \end{array} +$$ + +for some value $\nu \in \mathbb{R}$ and $\delta \in \mathbb{R}$ where $\nu \cdot \delta \leq 0.25$ . + +Remark 2 Although $\nu$ and $\delta$ may take negative or positive values, our goal is to design layers that have positive $\delta$ 's. Further, a positive set of $\delta$ and $\nu$ for a layer implies IIFG stability and robustness for that layer. Nevertheless, as we will show, for the entire network to be robust and stable, the $\nu$ and $\delta$ for an individual layer can take any value as long as certain conditions are met. $\nu$ and $\delta$ define a range of possible stability and robustness properties for a system. The lack of stability and robustness in one layer may be compensated for by an excess of robustness and stability in another layer [22]. In Subsection 4.3, we provide an interpretation of the above relations and outline the implications behind the selection of $\nu$ and $\delta$ . + +Theorem 1 [22] If the nonlinear system $H$ is IIFOFP with $\delta > 0$ , then it is IIFG stable and robust with the finite gain $\gamma = \frac{1}{\delta}$ . + +Our goal in this paper is to connect Definition 2 to Definition 1 to achieve robustness and the property given in Theorem 1. By enforcing the looser condition given in Definition 2, where $\nu$ and $\delta$ can take a range of values locally at the layer level, we encourage a robust global behavior for the entire DNN as given in Definition 1. According to Lyapunov theory for a layer to have the instantaneously IIFOFP property in Definition 2, the following condition should hold for the input-output mapping of all the inputs $u_{1}, u_{2}$ fed to the layer and their respective output signals $y_{1}, y_{2} \colon \omega(u_{2} - u_{1}, y_{2} - y_{1}) > 0$ [22]. If this holds, then the layer is dissipative with respect to the nonlinear relation given in Definition 2. Our results will show how we can reach Definition 1 and robustness globally by enforcing Definition 2 locally. Lastly, we will use the following matrix properties in our proofs, + +Definition 3 [20] A square matrix $A$ is a quasi-dominant matrix (diagonally dominant), if there exists a positive diagonal matrix $P = \text{diag}\{p_1, p_2, \ldots, p_n\}$ such that $a_{ii}p_i \geq \sum_{j \neq i} |a_{ij}|p_j$ , $\forall i$ , and/or $a_{jj}p_j \geq \sum_{i \neq j} |a_{ji}|p_i$ , $\forall j$ . If these inequalities are met strictly, then the matrix is said to be strictly row-sum (or column-sum) quasi-dominant. If $P$ can be chosen as the identity matrix, then the matrix is said to be row- or column- diagonally dominant. + +Corollary 1 [33] Every symmetric quasi-dominant matrix is positive definite. + +# 4. Theoretical Analysis and Main Results + +In our analysis, we treat each layer of the DNN as a nonlinear system as defined in Section 3 i.e., $H_{i}$ for all layers $i = 1,\dots,n$ (Fig. 1). A nonlinear system is defined as a layer in the network that accepts an input vector from the previous layer and produces an output vector with the size of the current layer after the weights, biases and activation functions are applied to the input signal. We prove the conditions under + +which each layer $H_{i}$ is instantaneously IIFOFP with specific hyper-parameters $\delta_{i}$ and $\nu_{i}$ . One can interpret the values of $\delta_{i}$ and $\nu_{i}$ as measures of robustness for the specific layer $i$ . Our results place specific constraints on the weight matrices at the given layer based on the values of the hyper-parameters $\delta_{i}$ and $\nu_{i}$ . We train the model and enforce these conditions during back-propagation. Consequently, we can show that the entire DNN is instantaneously IIFOFP and IIFG stable and robust. This means that the DNN maintains a level of robustness against adversarial changes added to the input for up to a specific adversarial $\ell_{2}$ norm $\epsilon$ . This is because the changes in the output of the DNN are now bounded by the changes introduced to the input by the adversary. Robustness in this sense means that the adversary now needs to add a larger amount of noise to the input of the DNN in order to cause larger changes in the output of the DNN and affect the decision making process. Our approach improves robustness against adversarial changes added to the input signal and the output of a hidden layer before it is fed into the next layer. + +In our approach, we consider Leaky ReLU activation functions, even though our results hold for ReLU as well. Our results and the Lyapunov theory suggest that Leaky ReLU is a more robust activation function than ReLu. We expand on this in Subsection 4.3. $\Delta$ is a measure for intervention. $\Delta$ models the extent of adversarial noise introduced to the input by the adversary. The effects of the majority of $\epsilon$ -based attacks of different norms such as the fast gradient method (FGM) and projected gradient descent (PGD) method may be modeled by $\Delta$ [23, 25, 26]. Given a DNN, we are interested in the (local) robustness of an arbitrary natural example $u$ by ensuring that all of its neighborhood has the same inference outcome. The neighborhood of $u$ may be characterized by an $\ell_2$ ball centered at $u$ . We can define an adversarial input as follows, + +Definition 4 Consider the input $u$ of the layer of size $n$ , i.e., $u \in R^n$ and the perturbed input signal $u + \Delta$ where $\Delta \in R^n$ is the attack vector that can take any value. The perturbed input vector $u + \Delta$ is within a $\Delta^0$ -bounded $\ell_2$ -ball centered at $u$ if $u + \Delta \in B_2(u, \Delta^0)$ , where $B_2(u, \Delta^0) := \{u + \Delta | ||u + \Delta - u||_2 = ||\Delta||_2 \leq \Delta^0\}$ . + +Geometrically speaking, the minimum distance of a misclassified nearby instance to $u$ is the smallest adversarial strength needed to alter the DNN's prediction, which is also the largest possible robustness measure for $u$ . We will use the conic behavior of the activation function, spectral norm of the weights and their relation to Lyapunov theory to train DNNs that are BIBO stable and robust against the adversary. + +# 4.1. Robustness analysis of each layer in the DNN + +Each layer of a DNN can be modeled as $y_{l} = h_{l}(W_{l}u_{l} + b_{l})$ for $l = 1,\dots,n$ for some $n > 2$ , where $u_{l}\in R^{n_{l - 1}^{\prime}}$ is the input of the $l$ -th layer, and $W_{l}\in R^{n_{l}^{\prime}\times n_{l - 1}^{\prime}}$ and $b_{l}\in R^{n_{l}^{\prime}}$ + +are respectively the layer-wise weight matrix and bias vector applied to the flow of information from the layer $l - 1$ to the layer $l$ . $h_{l}: R^{n_{l-1}^{\prime}} \to R^{n_{l}^{\prime}}$ models the entire numerical transformation at the $l$ -th layer including the (nonlinear) activation functions. $n_{l-1}^{\prime}$ and $n_{l}^{\prime}$ represent the number of neurons in layers $l - 1$ and $l$ . For a set of weight and bias parameters, $\{W_{l}, b_{l}\}_{l=1}^{n}$ , we can model the behavior of the entire DNN as $H_{\{W_{l}, b_{l}\}_{l=1}^{n}}(u_{1}) = y_{n}$ where $H_{\{W_{l}, b_{l}\}_{l=1}^{n}}: R^{n_{1}^{\prime}} \to R^{n_{n}^{\prime}}$ and $u_{1}$ is the initial input to the DNN. Given the training data set of size $K$ , $(u_{i}, y_{i})_{i=1}^{K}$ , where $u_{i} \in R^{n_{1}^{\prime}}$ and $y_{i} \in R^{n_{n}^{\prime}}$ , the loss function is defined as $\frac{1}{K} L(H_{\{W_{l}, b_{l}\}_{l=1}^{n}}(u_{i}), y_{i})$ , where $L$ is usually selected to be cross-entropy or the squared $\ell_{2}$ -distance for classification and regression tasks, respectively. The model parameters to be learned is $x$ . We consider the problem of obtaining a model that is insensitive to the perturbation of the input. The goal is to obtain parameters, $\{W_{l}, b_{l}\}_{l=1}^{n}$ , such that the $\ell_{2}$ -norm of $h(u + \Delta) - h(u)$ is small, where $u \in R^{n_{1}^{\prime}}$ is an arbitrary vector and $\Delta \in R^{n_{1}^{\prime}}$ is an engineered perturbation vector with a small $\ell_{2}$ -norm added by the adversary. To be more general and further investigate the properties of the layers, we assume that each activation function, modeled by $h_{l}$ is a modified version of element-wise ReLU called the Leaky ReLU: $h_{l}(y_{l}) = \max(y_{l}, ay_{l})$ , where $0 < a < 1$ . It follows that, to bound the variations in the output of the DNN by the variations in the input, it suffices to bound these variations for each $l \in \{1, \dots, n\}$ . Here, we consider that the attack variations $\Delta$ are added by the adversary into the initial input or the input of the hidden layers. This motivates us to consider a new form of regularization scheme, which is based on an individual layer's Lyapunov property. The first question we seek to answer is the following: what are the conditions under which a layer $l$ is IIFOFP with a positive $\delta_{l}$ and a $\nu_{l}$ that may take any value? In practice, it is best to train layers so that both $\nu_{l}$ and $\delta_{l}$ are positive, as this means a tighter bound and a more robust layer (Subsection 4.3), however, this is not a necessary condition for our results. The following theorem relates the spectral norm of the weight matrix to IIFOFP and IIFG stability and robustness of a layer to answer the above question. + +Theorem 2 The numerical transformation at the hidden layer $l$ of the DNN as defined in Subsection 4.1 is instantaneously IIFOP and consequently IIFG stable and robust, if the spectral norm of the weight matrix for the layer satisfies the following condition, + +$$ +\rho (W _ {l}) \leq \frac {1}{\delta_ {l} ^ {2}} + \frac {2 | \nu_ {l} |}{\delta_ {l}} +$$ + +where $\rho(W_l)$ is the spectral norm of the weight matrix at the layer $l$ , and the hyper-parameters $\delta_l > 0$ and $\nu_l$ meet the condition $\delta_l \cdot \nu_l \leq 0.25$ . + +Proof in Appendix B + +Remark 3 It is important to note that the above theorem shows a relationship between the spectral norm of the weight matrix at the layer $l$ and instantaneously IIFG stability and robustness of the layer as defined in the Definition 1 and Theorem 1 through the hyper-parameters $\delta_l$ and $\nu_l$ . Namely, a larger value for $\nu_l$ leads to a larger upper-bound for the spectral norm of the weight matrix at layer $l$ . Larger values of $\delta_l$ however, have a reciprocal relation to the spectral norm of the weight matrix. The relationship between parameters $\delta_l$ , $\nu_l$ and the spectral norm of the weight matrix may be utilized during the robust training of DNNs through the spectral regularization enforced at each layer. + +We can implement the above condition for each layer during the training of the network. Theorem 2 provides a wide range of possible regularization designs for the DNN and commonly used hyper-parameter selection approaches may be used to select the spectral regularization parameters per layer. If the above condition is met for each layer, then we can posit that the DNN is stable and robust in Lyapunov sense. The exact measure of stability and robustness depends on the selection of $\delta_l$ and $\nu_{l}$ . The global effects of this choice are outlined in Subsection 4.2. The extension of Theorem 2 to convolutional layers follows in a similar pattern and is given in Appendix C. Appendix D includes the robustness analysis of ResNet building blocks. It is important to note that $\nu_{l}$ and $\delta_l$ are design hyper-parameters that are selected before the training starts. The only real conditions placed on the hyper-parameters are that $\delta_l$ should be positive and $\delta_l\times \nu_l\leq 0.25$ . The exact implications of choosing the hyperparameters and their effects on the robustness of the layer against adversarial noise are detailed in Subsection 4.3. + +# 4.2. Robustness analysis of the entire DNN + +Next, we connect our results from Theorem 2 to the robustness of the entire DNN, i.e., we show how the selection of individual $(\delta_i,\nu_i)$ for layers $i = 1,\dots,n$ affect the robustness of the entire DNN represented by the global set $(\delta ,\nu)$ . + +Theorem 3 Consider the cascade interconnection of hidden layers inside the DNN as given in Fig. 1 where $n > 2$ , and each layer $H_{l}$ for $l = 1, \ldots, n$ is instantaneously IIFOPF with their respective $\nu_{l}$ and $\delta_{l}$ as given in Theorem 2, i.e., for any two incremental inputs $u_{l1}, u_{l2}$ for the layer $l$ we have, + +$$ +\begin{array}{l} \omega \left(u _ {l 2} - u _ {l 1}, y _ {l 2} - y _ {l 1}\right) = \left(u _ {l 2} - u _ {l 1}\right) ^ {T} \left(y _ {l 2} - y _ {l 1}\right) \\ - \delta_ {l} \left(y _ {l 2} - y _ {l 1}\right) ^ {T} \left(y _ {l 2} - y _ {l 1}\right) - \nu_ {l} \left(u _ {l 2} - u _ {l 1}\right) ^ {T} \left(u _ {l 2} - u _ {l 1}\right), \\ \end{array} +$$ + +as the nonlinear input-output mapping of the layer where $\omega (u_{l2} - u_{l1},y_{l2} - y_{l1}) > 0$ . Then the entire DNN is also instantaneously IIFOPP with the hyper-parameters $\nu$ , $\delta$ and input-output mapping, + +$$ +\begin{array}{l} \omega \left(u _ {2} - u _ {1}, y _ {2} - y _ {1}\right) = \left(u _ {2} - u _ {1}\right) ^ {T} \left(y _ {2} - y _ {1}\right) \\ - \delta (y _ {2} - y _ {1}) ^ {T} (y _ {2} - y _ {1}) - \nu (u _ {2} - u _ {1}) ^ {T} (u _ {2} - u _ {1}), \\ \end{array} +$$ + +where $u_{1}$ and $u_{2}$ are the initial inputs to the DNN and $y_{1}$ and $y_{2}$ are their respective output signals, if the matrix $-A$ is quasi-dominant, where $A$ is defined as, + +$$ +A = \left[ \begin{array}{c c c c c} \nu - \nu_ {1} & \frac {1}{2} & 0 & \dots & - \frac {1}{2} \\ \frac {1}{2} & - \delta_ {1} - \nu_ {2} & \frac {1}{2} & \dots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \dots & \frac {1}{2} & - \delta_ {n - 1} - \nu_ {n} & \frac {1}{2} \\ - \frac {1}{2} & 0 & \dots & \frac {1}{2} & \delta - \delta_ {n} \end{array} \right]. +$$ + +Proof in Appendix E + +Remark 4 For the DNN to be IIFOFP with $\delta >0$ and $\nu >0$ and consequently stable and robust, we need to set the hyper-parameters for training such that $\delta_l > 0$ for $l = 1,\dots,n$ , $\delta_{n} > \delta >0$ , $\nu_{1} > 0$ , and $\nu_{1} > \nu >0$ . The rest of $\nu_{l}$ 's are selected such that the matrix $-A$ is quasi-dominant. Note that theoretically, the $\delta_l$ 's or $\nu_{l}$ 's for some hidden layers may take negative values, as long as the matrix $-A$ stays quasi-dominant, i.e., $\delta_l + \nu_{l + 1} > 1$ for $l = 1,\dots,n - 1$ and $\delta_{n - 1} + \nu_n > 1$ . By selecting the hyper-parameters according to Theorem 3, one is indirectly setting the spectral regularization rule for each layer. Appendix $F$ details an example on the selection of these hyper-parameters. + +Theorem 3 points to an interesting fact that the first and last hidden layer may have the largest effect on the robustness of the DNN. To keep the matrix $-A$ quasi-dominant, $\delta$ and $\nu$ have a direct dependence on the values of $\delta_{n}$ and $\nu_{1}$ . Next, we can characterize a relationship between the incremental changes in the input signals of a DNN, i.e., $\Delta_{1}$ , and their effects on the output of the DNN, i.e., $\Delta_{n}$ . + +Corollary 2 Consider the cascade interconnection of hidden layers inside the DNN as given in Fig. 1 where $n > 2$ , if each layer $H_{l}$ is instantaneously IIFOP with their respective $\nu_{i}$ and $\delta_{i}$ , and the DNN is trained to meet the conditions given in Theorem 3, then the entire DNN is also instantaneously IIFOP with its respective $\nu$ and $\delta$ and the input-output mapping $\omega (u_{2} - u_{1},y_{2} - y_{1}) = (u_{2} - u_{1})^{T}(y_{2} - y_{1}) - \delta (y_{2} - y_{1})^{T}(y_{2} - y_{1}) - \nu (u_{2} - u_{1})^{T}(u_{2} - u_{1})$ where $\delta >0$ . One can show that the variations in the final output of the entire DNN $(\Delta_{n})$ are upper-bounded (limited) by the variations in the input signal $(\Delta_{1})$ through the following relation. + +$$ +\| \Delta_ {n} \| _ {2} ^ {2} \leq \left(\frac {1}{\delta^ {2}} + \frac {2 \nu}{\delta}\right) \| \Delta_ {1} \| _ {2} ^ {2} = \left(\frac {1}{\delta^ {2}} + \frac {2 \nu}{\delta}\right) \epsilon^ {2} +$$ + +where the design parameter $\delta$ and $\nu$ are both positive. + +Proof in Appendix G + +# 4.3. Conic interpretation of the proposed approach + +[38] was the first work that connected Lyapunov notion of stability and robustness to the conicity (boundedness) behavior of the input-output mapping of a nonlinear + +system. According to [38], a nonlinear numerical transformation is stable, if it produces bounded outputs for bounded inputs. The same nonlinear transformation is also robust, if it produces outputs that are insensitive to small changes added to the input. A stable and robust nonlinear numerical transformation then exhibits a conic behavior. + +According to [38], a nonlinear transformation exhibits a conic behavior, if the mapping between the changes in the input and the respective changes in the output, given the nonlinear transformation, always fits inside a conic sector on the input-output plane i.e., a conic nonlinear + +numerical transformation in the Hilbert space is one whose input changes $\Delta u$ and output changes $\Delta y$ are restricted to some conic sector of the $\Delta U\times \Delta Y$ inner product space as given in Fig. 2. This conic behavior is usually defined by the center line of the cone $c$ and the radius $r$ : + +![](images/6935c9013facd2ce42f616dff60684bd4ed77b1d8957b48865f0f0ef55bc5312.jpg) +Figure 2: A depiction of the interior conic behavior of a nonlinear system. + +Definition 5 [38] A relation $H$ is interior conic, if there are real constants $r \geq 0$ and $c$ for which $||\Delta y - c\Delta u||_{\ell_2} \leq r||\Delta u||_{\ell_2}$ is satisfied. + +This is the exact behavior that we are encouraging for each layer of the DNN so that the outputs of each layer become insensitive to small changes in the input. In particular, we have $\Delta u = \Delta_1$ , $\Delta y = \Delta_n$ , $c = \frac{a + b}{2}$ and $r = \frac{b - a}{2}$ where $a$ and $b$ are the slopes of the lower and upper bounds of the cone, and $c$ and $r$ are the center and radius of the cone. One can show that, + +$$ +\begin{array}{l} \left(\Delta_ {n} - c \Delta_ {1}\right) ^ {T} \left(\Delta_ {n} - c \Delta_ {1}\right) \leq r ^ {2} \Delta_ {1} ^ {T} \Delta_ {1} \\ \rightarrow \left(\Delta_ {n} - \left(\frac {a + b}{2}\right) \Delta_ {1}\right) ^ {T} \left(\Delta_ {n} - \left(\frac {a + b}{2}\right) \Delta_ {1}\right) \\ \leq \left(\frac {b - a}{2}\right) ^ {2} \Delta_ {1} ^ {T} \Delta_ {1} \rightarrow 0 \leq \Delta_ {1} ^ {T} \Delta_ {n} \\ - \left(\frac {1}{a + b}\right) \Delta_ {n} ^ {T} \Delta_ {n} - \left(\frac {b a}{a + b}\right) \Delta_ {1} ^ {T} \Delta_ {1}. \\ \end{array} +$$ + +Hence by selecting $\delta = \frac{1}{a + b}$ and $\nu = \frac{ba}{b + a}$ , we are bounding the output changes by the changes in the input as depicted in Fig. 2 and by that, we make the numerical transformations occurring at each layer of the DNN insensitive to small changes in the input. Particularly, a positive $\delta$ implies $b > 0$ with a larger $\delta$ implying a smaller positive $b$ and a larger distance between the slope of the upper-bound of the cone and the $\Delta Y$ axis. This implies that $\Delta Y$ increases in a slower rate with increases in $\Delta U$ . A positive $\nu$ implies $a > 0$ with a larger $\nu$ implying a larger $a$ and a larger distance + +between the lower-bound of the cone and the $\Delta U$ axis [22]. We are encouraging the pair $(\Delta_1, \Delta_n)$ to be instantaneously confined to a sector of the plane as depicted. The conic interpretation described here combined with the results given in the previous sections support the findings presented in [28, 36] that the use of Leaky Relu activation in the architecture of DNNs may contribute to robustness. + +# 5. Experiments + +We validate our results by performing a diverse set of experiments on a variety of architectures (fully-connected, AlexNet, ResNet) and data sets (MNIST, CIFAR10, SVHN and ImageNet). Appendix L contains the details on hyperparameters and training process for the above architecture and data set combinations. The experiments are implemented in TensorFlow [1] and the code will be made readily available. We test the DNNs against the fast gradient method (FGM) attack [15] with Frobenius $\ell_2$ norm of $\epsilon \in [0.1, 0.4]$ , and iterative projected gradient descent (PGD) attack [25] with 100 iterations, $\alpha = 0.02\epsilon$ and the same range of epsilons. Further, we show in Appendix J that our approach provides improved robustness against the Carlini & Wagner (C&W) attack [6]. + +Our robust Lyapunov training method regularizes the spectral norm of a layer $l$ so that, $\rho(W_l) \leq \beta_l$ where $\beta_l = \frac{1}{\delta_l^2} + \frac{2|\nu_l|}{\delta_l}$ . Given $n$ layers, one can pick $n$ different combinations of $(\delta_l, \nu_l)$ for a given data set and architecture as long as the conditions given in Theorem 2, Theorem 3 and Remark 4 are met. With these defined, we also have a global $\delta$ and $\nu$ . These values are implied by setting $\delta_{1,\dots,n}$ and $\nu_{1,\dots,n}$ , where any $\delta < \delta_n$ and $\nu < \nu_1$ is valid, so long as $\delta \cdot \nu \leq 1/4$ holds true. As such, we set $(\delta_1, \nu_1)$ , $(\delta_n, \nu_n)$ tighter to make the network robust, and choose a single set of looser $(\delta_m, \nu_m)$ for all intermediate layers, to maximize the model's expressive capability, which our theory guarantees is safe and gives the attacker no additional advantage. Appendix F outlines the process for selecting the Lyapunov hyper-parameters according to our proofs, or one could select them by simple cross validation. The different sets of Lyapunov design parameters used in our experiments are detailed in Appendix H. We represent a robust DNN with its global Lyapunov parameters $(\delta, \nu)$ . It is important to note that the greater flexibility (higher expressiveness [10]) allowed for the intermediate layers leads to a better generalization on the clean and adversarial data sets. This is not true for DNNs trained by weight-decay or spectral norm regularization against a single threshold $\beta$ . All the previous works on this subject [11, 28, 37, 8], keep $\beta$ constant across layers. These harder constraints over-regularize and thus impair the DNN's ability against attacks. Our results outlined in Appendix K show that our Lyapunov DNNs are more robust and perform better in comparison to the aforementioned works. + +Table 2: The incremental output variations $(\Delta_{n})$ for the 3 layer forward-net given an attack strength and the bounds calculated according to Corollary 2 (MNIST, PGD attack) + +
Lyapunov ParametersMean output change ||Δn||2 ≤ Lyapunov Bound
ε = 0.1ε = 0.2ε = 0.3
δ = 0.89,ν = 0.280.244 ≤ 0.4350.490 ≤ 0.6150.736 ≤ 0.753
δ = 0.95,ν = 0.260.202 ≤ 0.4070.406 ≤ 0.5760.610 ≤ 0.706
δ = 1.1,ν = 0.220.170 ≤ 0.3520.340 ≤ 0.4970.511 ≤ 0.609
Baseline1.2332.4463.641
+ +Table 2 details the effectiveness of our approach in bounding the incremental changes in the output of the DNN caused by the attack. Given an adversarial perturbation of size $\| \Delta_1\| _2^2$ , our Corollary 1 states the change to the final logits $(\| \Delta_n\| _2^2)$ should be bounded by $\| \Delta_n\| _2^2\leq \sqrt{\left(\frac{1}{\delta^2} + \frac{2\nu}{\delta}\right)}\| \Delta_1\| _2^2$ . Baseline represents a DNN with no regularization enforced during training. The results show that our bounds are never violated, however as $\epsilon$ gets larger, the output changes get closer to our proposed bounds. Given the empirical tightness of the bounds, one may be able to a-priori determine the worst case vulnerabilities against an attack for a network, i.e., connect the adversarial output changes to decision boundaries between classes. + +When we consider the accuracy under attack, our Lyapunov approach dominates prior works. [11] for instance, obtained an accuracy of $62\%$ at $\epsilon = 0.1$ with adversarial training on CIFAR10 under the $\ell_2$ PGD adversary with a lower number of iterations. Our approach obtains an accuracy of $\geq 73\%$ at $\epsilon = 0.1$ and still dominates with an accuracy of $\geq 63\%$ at $\epsilon = 0.4$ (Table 11 in Appendix I). Fig. 3 reports the CIFAR10 test accuracy under the iterative PGD and FGM attacks for different values of $\epsilon$ . As noted in Section 4, DNNs trained with larger global $(\delta, \nu)$ maintain their robustness in a more consistent way for larger $\epsilon$ 's. This is because enforcing a larger global $(\delta, \nu)$ leads to DNNs with a more restricted conic behavior able to more effectively bound the negative effects of the adversarial noise. $\ell_2$ weight-decay training seems ineffective against the attacks and our testing shows that adversarial training does not improve the performance of models trained with weight-decay regularization (Fig. 4 in Appendix I). + +Lastly, to show that our approach scales to larger architectures and data sets, Table 3 represents our results for Lyapunov-based robust ResNet50 architectures trained on the ImageNet data set. A comprehensive set of results for a larger set of experiments is given in Appendix I. This appendix also includes our mathematical proofs on how Lyapunov based spectral regularization of the weights can improve the robustness of residual blocks. The bottom five rows of Table 3 show the effectiveness of our Lyapunov based regularization in improving the robustness of the ResNet model + +![](images/8496357dba86db13c42f807d6114536551624b8f91b8cfa1568f18b1eb0ccd2a.jpg) + +![](images/42c2db1768553718bd7911baaf194676de4f8a901b0040cc16f28599a985bf09.jpg) +Figure 3: Accuracy of the DNN under PGD attack ( $k = 100$ iterations) (top) and FGM attack (bottom) using AlexNet on CIFAR10. Plots share the same legend and axis. + +trained on ImageNet against FGM based attacks across a spectrum of $\epsilon$ values. The first two rows further show that our approach remains compatible with adversarial training, gaining further improvements in accuracy while under attack. + +Table 3: Experiment results for ResNet50 trained on the ImageNet dataset under the FGM attack. + +
Network TypeTop 1 Accuracy on the Adversarial Test Dataset (Attack Strength ε)
ε = 0.1ε = 0.2ε = 0.3ε = 0.4
δ = 1.0, ν = 0.24 with ℓ2 FGM Adv. Training0.690.680.680.68
δ = 0.89, ν = 0.26 with ℓ2 FGM Adv. Training0.670.650.630.61
δ = 0.95, ν = 0.260.610.510.440.38
δ = 0.86, ν = 0.290.600.510.430.37
δ = 0.74, ν = 0.330.600.500.420.36
Baseline Training0.570.450.400.34
Baseline Training with Freb. ℓ2 reg., λ = 0.010.580.460.390.32
+ +# 6. Conclusion + +In this paper, we analyzed the robustness of forward, convolutional, and residual layers against adversarial attacks based on Lyapunov theory of stability and robustness. We proposed a new robust way of training which improves robustness and allows for independent selection of the regularization parameters per layer. Our work bounds the layers' response to the adversary and gives insights into how different architectures, activation functions, and network designs behave against attacks. + +# References + +[1] Martin Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghe-mawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th {USENIX} Symposium on Operating Systems Design and Implementation (OSDI) 16), pages 265-283, 2016. +[2] Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples. In International Conference on Machine Learning (ICML), 2018. +[3] Battista Biggio, Giorgio Fumera, and Fabio Roli. Multiple classifier systems for robust classifier design in adversarial environments. International Journal of Machine Learning and Cybernetics, 1(1):27-41, 12 2010. +[4] Tom B. Brown, Nicholas Carlini, Chiyuan Zhang, Catherine Olsson, Paul Christiano, and Ian J. Goodfellow. Unrestricted Adversarial Examples. arXiv preprint, 2018. +[5] 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, AISec '17, pages 3-14, New York, NY, USA, 2017. ACM. +[6] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pages 39-57. IEEE, 2017. +[7] Chih-Hong Cheng, Georg Nuhrenberg, and Harald Ruess. Maximum resilience of artificial neural networks. In International Symposium on Automated Technology for Verification and Analysis, pages 251-268. Springer, 2017. +[8] Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 854–863. JMLR.org, 2017. +[9] Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. arXiv preprint arXiv:1902.02918, 2019. +[10] Nicolas Couellan. The coupling effect of lipschitz regularization in deep neural networks. arXiv preprint arXiv:1904.06253, 2019. +[11] Farzan Farnia, Jesse M Zhang, and David Tse. Generalizable adversarial training via spectral normalization. arXiv preprint arXiv:1811.07457, 2018. +[12] Alhussein Fawzi, Hamza Fawzi, and Omar Fawzi. Adversarial vulnerability for any classifier. arXiv preprint arXiv:1802.08686, 2018. +[13] 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 ICLR, 2019. +[14] Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial Spheres. In ICLR Workshop, 2018. + +[15] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. +[16] Henry Gouk, Eibe Frank, Bernhard Pfahringer, and Michael Cree. Regularisation of neural networks by enforcing lipschitz continuity. arXiv preprint arXiv:1804.04368, 2018. +[17] 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. +[18] Qian Huang, Zeqi Gu, Isay Katsman, Horace He, Pian Pawakapan, Zhiqiu Lin, Serge Belongie, and Ser-Nam Lim. Intermediate level adversarial attack for enhanced transferability. arXiv preprint arXiv:1811.08458, 2018. +[19] Ming Jin and Javad Lavaei. Stability-certified reinforcement learning: A control-theoretic perspective. arXiv preprint arXiv:1810.11505, 2018. +[20] Eugenius Kaszkurewicz and Amit Bhaya. Matrix diagonal stability in systems and computation. Springer Science & Business Media, 2012. +[21] Guy Katz, Clark Barrett, David L Dill, Kyle Julian, and Mykel J Kochenderfer. Reluplex: An efficient smt solver for verifying deep neural networks. In International Conference on Computer Aided Verification, pages 97-117. Springer, 2017. +[22] Hassan K. Khalil. Nonlinear Systems, volume 2. Prentice Hall New Jersey, 1996. +[23] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016. +[24] Chang Liu, Bo Li, Yevgeniy Vorobeychik, and Alina Oprea. Robust Linear Regression Against Training Data Poisoning. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, AISec '17, pages 91-102, New York, NY, USA, 2017. ACM. +[25] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. +[26] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing with virtual adversarial training. arXiv preprint arXiv:1507.00677, 2015. +[27] Nicolas Papernot, Fartash Faghri, Nicholas Carlini, Ian Goodfellow, Reuben Feinman, Alexey Kurakin, Cihang Xie, Yash Sharma, Tom Brown, Aurko Roy, Alexander Matyasko, Vahid Behzadan, Karen Hambardzumyan, Zhishuai Zhang, Yi-Lin Juang, Zhi Li, Ryan Sheatsley, Abhibhav Garg, Jonathan Uesato, Willi Gierke, Yinpeng Dong, David Berthelot, Paul Hendricks, Jonas Rauber, and Rujun Long. Technical report on the cleverhans v2.1.0 adversarial examples library. arXiv preprint arXiv:1610.00768, 2018. +[28] Haifeng Qian and Mark N Wegman. L2-nonexpansive neural networks. arXiv preprint arXiv:1802.07896, 2018. +[29] Arash Rahnama, Andre T. Nguyen, and Edward Raff. Connecting Lyapunov Control Theory to Adversarial Attacks. In Proceedings of AdvML'19: Workshop on Adversarial Learning Methods for Machine Learning and Data Mining at KDD, 2019. + +[30] Hanie Sedghi, Vineet Gupta, and Philip M Long. The singular values of convolutional layers. arXiv preprint arXiv:1805.10408, 2018. +[31] Jiawei Su, Danilo Vasconcellos Vargas, and Sakurai Kouichi. One pixel attack for fooling deep neural networks. arXiv, 2017. +[32] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. +[33] Olga Taussky. A recurring theorem on determinants. The American Mathematical Monthly, 56(10P1):672-676, 1949. +[34] Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. stat, 1050:11, 2018. +[35] Tsui-Wei Weng, Huan Zhang, Hongge Chen, Zhao Song, Cho-Jui Hsieh, Duane Boning, Inderjit S Dhillon, and Luca Daniel. Towards fast computation of certified robustness for relu networks. arXiv preprint arXiv:1804.09699, 2018. +[36] Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning, pages 5283-5292, 2018. +[37] Yuichi Yoshida and Takeru Miyato. Spectral norm regularization for improving the generalizability of deep learning. arXiv preprint arXiv:1705.10941, 2017. +[38] George Zames. On the input-output stability of time-varying nonlinear feedback systems part one: Conditions derived using concepts of loop gain, conicity, and positivity. IEEE transactions on automatic control, 11(2):228-238, 1966. +[39] Valentina Zantedeschi, Maria-Irina Nicolae, and Ambrish Rawat. Efficient defenses against adversarial attacks. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pages 39-49. ACM, 2017. +[40] Huan Zhang, Tsui-Wei Weng, Pin-Yu Chen, Cho-Jui Hsieh, and Luca Daniel. Efficient neural network robustness certification with general activation functions. In Advances in Neural Information Processing Systems, pages 4939–4948, 2018. \ No newline at end of file diff --git a/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/images.zip b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..76b4f329e848c90b13d9396c4f09820294ef9acd --- /dev/null +++ b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c445fac96829848702b235839d122e832e4676edd150a025a10ba3369b7815d0 +size 324913 diff --git a/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/layout.json b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..208e58bd218bab4df7f1bd60e4bd050a74e7b862 --- /dev/null +++ b/robustdesignofdeepneuralnetworksagainstadversarialattacksbasedonlyapunovtheory/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70121e74d85a889e894a6f40a39bc369c12fdaeb4c3b661fb4066b59a1ad24e2 +size 542060 diff --git a/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_content_list.json b/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cf09d0262130422e5ff2c50d10e2d4640ce1fa08 --- /dev/null +++ b/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94320815b16aa68e1987c634b05944e690f96687f72e61ce3c919da7d13e2f20 +size 86982 diff --git a/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_model.json b/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dbf23d61c35c66c7da5a435e450859fad1943a5a --- /dev/null +++ b/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ed347815fbb95290a9c8dd46b807d91d22efe18188f2e19ca64697457eafb0e +size 108541 diff --git a/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_origin.pdf b/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9bb29e16f4beb5e4a4b652abfc81f887ad3eed05 --- /dev/null +++ b/robusthomographyestimationviadualprincipalcomponentpursuit/b98edf92-f79b-496a-85fd-4803146fd5eb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9e1cc38a34538a53deeaca04e005474f1e224a7ad03967c8077b215a2170d4b +size 1245748 diff --git a/robusthomographyestimationviadualprincipalcomponentpursuit/full.md b/robusthomographyestimationviadualprincipalcomponentpursuit/full.md new file mode 100644 index 0000000000000000000000000000000000000000..305c0e5f54010ed9a4a9da5ef27488d3e3366f38 --- /dev/null +++ b/robusthomographyestimationviadualprincipalcomponentpursuit/full.md @@ -0,0 +1,289 @@ +# Robust Homography Estimation via Dual Principal Component Pursuit + +Tianjiao Ding1 Yunchen Yang1 Zhihui Zhu2 Daniel P. Robinson3 René Vidal4 Laurent Kneip1 Manolis C. Tsakiris1 + +# Abstract + +We revisit robust estimation of homographies over point correspondences between two or three views, a fundamental problem in geometric vision. The analysis serves as a platform to support a rigorous investigation of Dual Principal Component Pursuit (DPCP) as a valid and powerful alternative to RANSAC for robust model fitting in multiple-view geometry. Homography fitting is cast as a robust nullspace estimation problem over either homographic or epipolar/trifocal embeddings. We prove that the nullspace of epipolar or trifocal embeddings in the homographic scenario, of dimension 3 and 6 for two and three views respectively, is defined by unique, computable homographies. Experiments show that DPCP performs on par with USAC with local optimization, while requiring an order of magnitude less computing time, and it also outperforms a recent deep learning implementation for homography estimation. + +# 1. Introduction + +A linear image-to-image map in homogeneous space—commonly known as a homography or a projective transformation in the plane—is a fundamental model in many contexts in photogrammetry and computer vision. Assuming the imaging device follows the pinhole or perspective camera model, the notion of homography provides a simple model of the image warping that occurs if the camera rotates and translates in front of a planar scene or undergoes a pure rotation. Thus, it has played an important role in camera calibration [1, 2], metric rectification [3, 4], panorama imaging [5], augmented reality [6, 7], optical flow based on piece-wise planar scene modelling [8] and video stabilization [9, 10]. The present paper focuses on robust homography estimation from image correspondences across two or three views, with points in each view extracted from a local + +invariant key point detector [11], and the correspondences established by appearance descriptor matching techniques. + +The quality of the correspondences depends on a number of factors such as the invariance properties of the employed feature detector, motion blur, the texture of the environment, and the efficiency versus accuracy trade-off of the matching algorithm. It is therefore common that only a fraction of the identified cross-view correspondences are of high enough quality to yield an accurate homography estimate. As a result, the model fitting algorithm needs to be robust with respect to outliers in the set of correspondences, and the predominant scheme in computer vision to address this issue is RANSAC [12] and its more sophisticated derivatives developed over the last couple of decades, e.g., see [13, 14, 15, 16, 17] and references therein. Typically, these schemes may exhibit a high computational complexity due to a large ratio of outliers, high dimension of the inlier model, adaptive threshold determination, or local model refinement also known as local optimization. + +On the other hand, over the past decade a variety of robust subspace learning methods have appeared, admitting efficient implementations and strong theoretical guarantees [18, 19]. Among these, Dual Principal Component Pursuit (DPCP) [20, 21, 22, 23, 24] stands as one of the few methods able to handle subspaces of high relative dimension or equivalently low relative codimension. This is precisely the case in homography estimation, since, under homographic embeddings, it can be cast as a robust hyperplane learning problem in $\mathbb{R}^9$ and $\mathbb{R}^{27}$ for two and three views respectively. DPCP formulates the hyperplane learning problem as an $\ell_1$ non-convex optimization problem on the sphere, which can then be solved by a variety of methods such as recursive linear programming [20, 22], alternating minimization [25, 22], Iteratively-Reweighed-Least-Squares (DPCP-IRLS) [21, 22, 26], projected sub-gradient (DPCP-PSGM) [23, 24] and Riemannian sub-gradient (DPCP-RSGM) [27, 28] methods, or geodesic-gradient-descent [29]. In particular, DPCP-PSGM has been shown to tolerate $M < \mathcal{O}(N^2)$ outliers (here $N$ , $M$ is the number of inliers and outliers respectively), a notable result that contrasts sharply the typical guarantee $M < \mathcal{O}(N)$ of alternative methods [19]. More + +over, DPCP-PSGM and DPCP-IRLS have been shown to be able to outperform RANSAC with the same running time budget and optimal threshold in surface normal [23, 24] and trifocal tensor [21] estimation. + +In this paper we apply a group version of DPCP to the problem of robust homography estimation by casting the latter as a robust nullspace estimation problem. Here the groupings refer to the fact that each correspondence gives a group of embeddings. The nullspace of the matrix of embeddings is 1-dimensional under the traditional choice of homographic embeddings. On the other hand, it is also well understood that—for example in the case of a planar 3D point distribution—the epipolar or trifocal embeddings contribute a 3-dimensional or 6-dimensional nullspace, sitting inside 9-dimensional and 27-dimensional ambient space respectively. A fundamental property that we contribute here is that the structure of this nullspace is uniquely defined by the underlying homographies $^{2}$ ( $\S 2$ ). The computation of these higher dimensional nullspaces can still be done by using extensions of the aforementioned methods from the unit sphere to the Stiefel manifold, the working choice here being DPCP-IRLS, and a global optimality theorem is given for the group DPCP problem ( $\S 3$ ). Rigorous experiments suggest that DPCP performs competitively with the full-blown implementation of USAC [14], while running an order of magnitude faster ( $\S 4$ ). When local optimization in USAC is disabled, DPCP not only remains faster, but is also significantly more accurate. Finally, DPCP outperforms the deep learning approach of [32] by a large margin. + +# 2. Geometry: homographies and new insights + +We start by giving a brief review of epipolar and homographic constraints for two views (§2.1). We discuss the traditional way of extracting homographies from 1-dimensional nullspaces of matrices of homographic embeddings. Then we show that homographies are also uniquely encoded in 3-dimensional nullspaces associated with epipolar embeddings. We then discuss the analogue in three views, namely homographic and trifocal constraints, and prove the unique recovery of homographies from 6-dimensional nullspaces of matrices of trifocal embeddings (§2.2). The importance of estimating homographies from higher-dimensional nullspaces is discussed in §3. + +# 2.1. Two-view geometry + +Epipolar embeddings. Let $P = [I \, 0]$ , $P' = [A \, a]$ be the camera matrices for two perspective views $\mathcal{V}, \mathcal{V}'$ . It is well known that if $x_i \leftrightarrow x_i'$ are the projections of points $\xi_i$ in 3-space onto $\mathcal{V}$ and $\mathcal{V}'$ , then $x_i'^\top F x_i = 0$ , where $F := [a] A$ + +is the so-called fundamental matrix. This is the well-known epipolar constraint which we rewrite as + +$$ +\phi \left(x _ {i}, x _ {i} ^ {\prime}\right) ^ {\top} \operatorname {v e c} (F) = 0, \tag {1} +$$ + +with the $\phi (x_i,x_i^{\prime})\in \mathbb{R}^{9}$ bilinear functions of the correspondence pair $x_{i},x_{i}^{\prime}$ , referred to as epipolar embeddings. If the displacement between the two views $\nu ,\nu^{\prime}$ is nondegenerate and the 3D points $\xi_{i}$ are in general position, then eight correspondences uniquely determine $F$ up to scale. That is, the following $9\times 8$ matrix has a 1-dimensional left nullspace spanned by $\operatorname {vec}(F)$ : + +$$ +[ \phi (x _ {1}, x _ {1} ^ {\prime}) \dots \phi (x _ {8}, x _ {8} ^ {\prime}) ] +$$ + +Homographic embeddings. Consider a plane $\pi$ in 3-space whose normal vector is $(h^{\top},1)^{\top} \in \mathbb{R}^{4}$ . Let $\xi_{i}$ now be points on $\pi$ and $x_{i} \leftrightarrow x_{i}^{\prime}$ their projections onto $\nu$ and $\nu^{\prime}$ . Then $x_{i}^{\prime} \sim Hx_{i}$ , where $H := A - ah^{\top}$ is the homography matrix. Here $x^{\prime} \sim Hx$ means that $x^{\prime}$ and $Hx$ are colinear, which implies that $[x_{i}^{\prime}]_{\times}Hx_{i} = 0$ . Since the matrix $[x_{i}^{\prime}]_{\times}$ is of rank 2, out of these three linear equations in $H$ , at most two are linearly independent. It is enough to consider the first two which we write as + +$$ +\psi_ {j} \left(x _ {i}, x _ {i} ^ {\prime}\right) ^ {\top} \operatorname {v e c} (H) = 0, j = 1, 2. +$$ + +The $\psi_j(x_i, x_i') \in \mathbb{R}^9$ are homographic embeddings, which are bilinear functions of the correspondence pair $x_i, x_i'$ . Assuming a non-degenerate configuration of the 3D points $\xi_i$ on the plane $\pi$ , 4 correspondences are sufficient to uniquely determine $H$ up to scale, i.e., the left nullspace of the $9 \times 8$ matrix of homographic embeddings has dimension 1. + +Homography estimation via epipolar embeddings. Now we discuss how to extract a homography from a nullspace of dimension higher than 1 arising from epipolar embeddings. We have not been able to find these arguments in the literature, especially those on the uniqueness of the homography. + +Let $H$ be a homography between $\mathcal{V}$ and $\mathcal{V}'$ induced by a plane $\pi$ . It is well-known that the fundamental matrix $F$ of $\mathcal{V}, \mathcal{V}'$ admits a factorization $F = [a]_{\times} H$ . It is equally well-known that if one constructs the usual epipolar embeddings in $\mathbb{R}^9$ for 8 correspondences $x_i \leftrightarrow x_i' = Hx_i$ , as in the 8-point algorithm, one will find a 3-dimensional nullspace. What is perhaps less well known is that the homography $H$ uniquely defines the structure of this nullspace. + +Proposition 1. A homography represented by $H$ induces a 3-dimensional vector space $\mathcal{F}_H = \{[v]_{\times}H : v \in \mathbb{R}^3\}$ of compatible fundamental matrices. Moreover, if $\mathcal{F}_{H'} \subseteq \mathcal{F}_H$ for some $H' \neq 0$ then $\mathcal{F}_{H'} = \mathcal{F}_H$ and $H' \sim H$ . + +Proof. $\mathcal{F}_H$ is a vector space since $[v_1]_{\times} + [v_2]_{\times} = [v_1 + v_2]_{\times}$ for any $v_1, v_2$ . Now $\mathcal{F}_H$ is spanned by $[e_1]_{\times} H, [e_2]_{\times} H, [e_3]_{\times} H$ where the $e_i$ 's are canonical vectors. Since $H$ is invertible these are linearly independent, thus $\dim \mathcal{F}_H = 3$ . Let $F \in \mathcal{F}_H$ . Then $F = [v]_{\times} H \in \mathcal{F}_H$ for some $v \neq 0$ . Since $H$ is invertible $[v]_{\times} H$ is a fundamental matrix. Moreover, it is compatible with the homography represented by $H$ because $H^{\top}[v]_{\times} H$ is skew-symmetric. + +For the last statement, we proceed in two steps. First we consider the case where $H'$ is invertible. Let $x \in \mathcal{V}$ and let $x' \in \mathcal{V}'$ with $x' \sim Hx$ . Let $F' = [v]_{\times} H' \in \mathcal{F}_{H'}$ . If $\mathcal{F}_{H'} \subseteq \mathcal{F}_H$ then $F'$ is a fundamental matrix compatible with the homography $H$ . That is $x'^{\top}[v]_{\times} H'x = 0$ . This is to say that $H'x \in \operatorname{Span}(x', v)$ for any $v \neq 0$ so that $H'x \in \operatorname{Span}(x')$ . Since $H'$ is invertible, $H'x \sim x'$ and therefore $H'x \sim Hx$ . This is true for any $x$ , thus $H' \sim H$ . + +Now we consider the general statement for any $H^{\prime}$ . The set of $H^{\prime}$ 's such that $\mathcal{F}_{H^{\prime}}\subseteq \mathcal{F}_H$ is a linear subspace $\mathcal{W}$ of $\mathbb{R}^{3\times 3}$ . The set $\mathcal{U}$ of invertible $3\times 3$ matrices is an open set in the Zariski topology of $\mathbb{R}^{3\times 3}$ [33, 34]. Then $\mathcal{W}_{\mathcal{U}}\coloneqq \mathcal{W}\cap \mathcal{U}$ is an open set in the subspace topology of $\mathcal{W}$ . We know that $\mathcal{W}_{\mathcal{U}}$ is non-empty because $H\in \mathcal{W}_{\mathcal{U}}$ . Since nonempty Zariski open subsets of linear subspaces are dense, the Zariski closure of $\mathcal{W}_{\mathcal{U}}$ is $\mathcal{W}$ itself. But we proved above that $\mathcal{W}_{\mathcal{U}}$ is exactly the line spanned by $H$ excluding the zero matrix. Adding back the zero matrix we get a 1-dimensional linear subspace of $\mathcal{W}$ , which is a closed set. That is $\mathcal{W} = \mathcal{W}_{\mathcal{U}}\cup \{0_{3\times 3}\} = \{\lambda H:\lambda \in \mathbb{R}\}$ . + +The vector space $\mathcal{F}_H$ of Proposition 1 is the 3-dimensional left nullspace $\mathcal{N}$ of the $9\times 6$ matrix $\Phi$ of epipolar embeddings of 6 point correspondences $x_{i}\leftrightarrow Hx_{i}$ . Proposition 1 asserts that $H$ is uniquely encoded in any basis $F_{1},F_{2},F_{3}$ of $\mathcal{F}_H$ in the following strong form. Consider the homogeneous linear system in the $c_{ij}$ 's and $H^{\prime}$ + +$$ +\sum_ {j = 1} ^ {3} c _ {i j} F _ {j} = \left[ e _ {i} \right] _ {\times} H ^ {\prime}, i = 1, 2, 3. \tag {2} +$$ + +To say that $H'$ is a solution is to say that $\mathcal{F}_{H'} \subseteq \mathcal{F}_H$ . Then Proposition 1 gives $H' \sim H$ . In other words, (2) admits a unique up to scale solution in $H'$ , the homography $H$ . + +Even when the correspondences are slightly noisy, $\mathcal{N}$ need not have the structure of $\mathcal{F}_H$ . One then computes an $\hat{H}$ such that $\mathcal{F}_{\hat{H}}$ is closest to $\mathcal{N}$ in a Euclidean sense as follows. Let $B_{j} \in \mathbb{R}^{3 \times 3}$ , $j = 1, \ldots, 6$ be the matrices that + +correspond to the top 6 left singular vectors of $\Phi$ . Following [35, A5.6],[36] $\hat{H}$ is obtained in closed form in terms of a singular value decomposition by solving + +$$ +\min _ {H ^ {\prime}} \sum_ {i, j} \| B _ {j} ^ {\top} [ e _ {j} ] H ^ {\prime} \| _ {F} ^ {2} \mathrm {s . t .} \| ([ e _ {1} ] _ {\times} [ e _ {2} ] _ {\times} [ e _ {3} ] _ {\times}) H ^ {\prime} \| _ {F} = 1 (3) +$$ + +# 2.2. Three-view geometry + +Trifocal embeddings. The analogue of the fundamental matrix in three views is the (uncalibrated) trifocal tensor [35, 37, 38]. Consider three views $\mathcal{V},\mathcal{V}^{\prime},\mathcal{V}^{\prime \prime}$ with projection matrices $[I0],[Aa],[Bb]$ . Let $x\leftrightarrow x^{\prime}\leftrightarrow x^{\prime \prime}$ be the projections on the three views of a point $\xi$ in 3-space. In analogy with the epipolar constraint that captures the geometry of two views the triplet of correspondences satisfies + +$$ +[ x ^ {\prime} ] \left(\sum_ {i = 1} ^ {3} x _ {i} T _ {i}\right) [ x ^ {\prime \prime} ] = 0, \quad T _ {i} := a _ {i} b ^ {\top} - a b _ {i} ^ {\top}, \tag {4} +$$ + +where $a_i, b_i$ are the $i$ th columns of $A, B$ and $x_i$ is the $i$ th coordinate of $x$ . The matrices $T_i \in \mathbb{R}^{3 \times 3}$ are the slices of the trifocal tensor $\mathcal{T}$ . Conversely, any tensor $(T_1', T_2', T_3')$ is a trifocal tensor if it admits a decomposition as in (4). Viewed as elements of $\mathbb{P}^{26}$ the trifocal tensors form a dense set in an irreducible projective variety of dimension 18. + +The system (4) consists of 9 equations trilinear in $x, x', x''$ and linear in $\mathcal{T}$ . Viewed as equations in $\mathcal{T}$ , their coefficients are the trifocal embeddings of the correspondence $x \leftrightarrow x' \leftrightarrow x''$ . Among these 9 trifocal embeddings only 4 are in general linearly independent. Then 7 general correspondences suffice to uniquely solve for $\mathcal{T}$ up to scale. This is done by computing the 1-dimensional left nullspace of a $27 \times 28$ matrix of trifocal embeddings. + +Homographic embeddings. Suppose now that points $\xi_{i}$ from a plane $\pi$ are projected onto three views $\mathcal{V},\mathcal{V}^{\prime},\mathcal{V}^{\prime \prime}$ to yield correspondences $x_{i}\leftrightarrow x_{i}^{\prime}\leftrightarrow x_{i}^{\prime \prime}$ . Then there exist homographies $H,G$ such that $Hx_i^\prime \sim x_i$ , $Gx_{i}^{\prime \prime}\sim x_{i}$ . As a consequence $\mathrm{rank}([x_iHx_i'Gx_i'']) = 1$ . Thus, + +$$ +[ x _ {i} ] _ {\times} H x _ {i} ^ {\prime} = [ x _ {i} ] _ {\times} G x _ {i} ^ {\prime \prime} = [ H x _ {i} ^ {\prime} ] _ {\times} G x _ {i} ^ {\prime \prime} = 0. \tag {5} +$$ + +With $\mathcal{H}_{ijk} := (h_j \times g_k)_i$ the $i$ th coordinate of the cross product of the $j$ th column of $H$ and the $k$ th column of $G$ , (5) can be written as [39] + +$$ +\sum_ {i, j = 1} ^ {3} x _ {i} x _ {j} ^ {\prime} \mathcal {H} _ {i j k} = \sum_ {i, j = 1} ^ {3} x _ {i} x _ {j} ^ {\prime \prime} \mathcal {H} _ {i k j} = \sum_ {i, j = 1} ^ {3} x _ {i} ^ {\prime \prime} x _ {j} ^ {\prime} \mathcal {H} _ {k j i} = 0, +$$ + +for $k = 1,2,3$ . These are 9 equations linear in the homography tensor $\mathcal{H} \in \mathbb{R}^{3 \times 3 \times 3}$ , which is a bilinear function of $H, G$ and takes values in a codimension 10 irreducible algebraic variety of $\mathbb{P}^{26}$ [40, 41]. The coefficients are bilinear functions in pairs of correspondences and as in the + +case of two views can be thought of as homographic embeddings into $\mathbb{R}^{27}$ . Among the 9 homographic embeddings produced by each corresponding triplet, 7 of them are in general linearly independent. Therefore, assuming a nondegenerate point configuration, 4 such triplets are sufficient to uniquely determine the 1-dimensional left nullspace of the $27\times 28$ matrix of homographic embeddings, from which the homography tensor $\mathcal{H}$ is computed up to scale. $H,G$ are subsequently obtained following the work [39]. + +Homography estimation via trifocal embeddings. Notably, two homographies can also be uniquely computed from a nullspace of dimension 6 arising from trifocal embeddings. Let $\pi$ be a plane in 3-space. We have: + +Proposition 2. The homographies $\mathcal{V} \xrightarrow{H} \mathcal{V}', \mathcal{V} \xrightarrow{G} \mathcal{V}''$ induced by the plane $\pi$ induce a 6-dimensional vector space $\mathcal{T}_{H,G}$ of trifocal tensors. Each $T \in \mathcal{T}_{H,G}$ is compatible with point correspondences $x \leftrightarrow x' \leftrightarrow x''$ obtained by projecting points from $\pi$ . Moreover, $\mathcal{T}_{H,G}$ is uniquely determined by $H, G$ and uniquely determines $H, G$ up to scale. + +Proof. As per Proposition 1 $H$ induces a 3-dimensional vector space $\mathcal{F}_H$ of fundamental matrices. These matrices have the form $[v]_{\times}H$ with $v$ varying in $\mathbb{R}^3$ . They induce a 3-parameter family of projection matrices $[H v]$ for $\mathcal{V}'$ , all compatible with correspondences $x \leftrightarrow x'$ obtained by projecting points from $\pi$ . A similar argument shows the existence of a 3-parameter family of projection matrices $[G d]$ for $\mathcal{V}''$ compatible with correspondences $x \leftrightarrow x''$ obtained by projecting points from $\pi$ . As $H, G$ are induced by the same plane, we have a 6-parameter family $[I0], [H v], [G w]$ of camera projections all compatible with correspondences $x \leftrightarrow x' \leftrightarrow x''$ obtained by projecting points from $\pi$ . Each element of the family gives a trifocal tensor $T$ with $T_i = h_i w^\top - v g_i^\top$ , $i = 1, 2, 3$ where $h_i, g_i$ are the $i$ th columns of $H, G$ . These form a 6-dimensional vector space $\mathcal{T}_{H,G}$ . The last statement follows again from Proposition 1 since $H$ uniquely determines $\mathcal{F}_H$ and is uniquely determined by it up to scale and similarly for $G, \mathcal{F}_G$ . + +Let $x_{i} \leftrightarrow x_{i}' \leftrightarrow x_{i}''$ be correspondences obtained by projecting 6 general points from $\pi$ . A consequence of Proposition 2 is that the $27 \times 24$ matrix of trifocal embeddings (4 embeddings for each correspondence) will have a 6-dimensional left nullspace. The homographies $H, G$ can be uniquely recovered from that nullspace by means analogous to those for epipolar embeddings and similarly for the case of slightly imperfect correspondences. + +# 3. Optimization: group-DPCP + +Suppose we are given a set of $N$ inlier groups $X = [X_1, \ldots, X_N] \in \mathbb{R}^{D \times NK}$ , where each group $X_i \in \mathbb{R}^{D \times K}$ contains $K$ inlier points in its columns lying in a linear + +Table 1: Two-view and three-view motion models, number $K$ of embeddings per correspondence, embedding type, subspace type for homography estimation, and codimension parameter $c$ to be used in (7). + +
Motion modelKEmbeddingEstimation ofc
2-view rigid body1epipolara hyperplane in R91
3-view rigid body4trifocala hyperplane in R271
2-view homography1epipolara 6-dim. subspace in R93
2homographica hyperplane in R91
3-view homography4trifocala 21-dim. subspace in R276
7homographica hyperplane in R271
+ +subspace $S \subset \mathbb{R}^D$ of low relative codimension $c / D, c = D - \dim S$ , contaminated by a set of $M$ arbitrary outlier groups $O = [O_1, \ldots, O_M] \in \mathbb{R}^{D \times MK}, O_j \in \mathbb{R}^{D \times K}$ , and we wish to find $S$ . Let $\tilde{X} = [X, O] \Pi \in \mathbb{R}^{D \times LK}$ with $\Pi$ an unknown group permutation indicating that the segmentation of $\tilde{X}$ into inlier and outlier groups is not available a priori. With $\tilde{X}_i$ the $i$ -th group of points of $\tilde{X}$ (could be inliers or outliers) and $1(y) = 1$ if $y \neq 0$ and $1(y) = 0$ otherwise, under mild general position assumptions on $\tilde{X}$ , $S$ is the orthogonal complement of the range-space of the unique global minimum of the optimization problem + +$$ +\min _ {B \in \mathbb {R} ^ {D \times c}} \sum_ {i = 1} ^ {L} 1 \left(\| \tilde {X} _ {i} ^ {\top} B \| _ {F}\right) \quad \text {s . t .} \quad \operatorname {r a n k} (B) = c. \tag {6} +$$ + +As (6) is computationally intractable and in practice the inlier groups do not lie exactly in $S$ , we replace it with the following robust $\ell_1$ optimization problem on the Stiefel manifold (the set of orthonormal matrices) + +$$ +\min _ {B \in \mathbb {R} ^ {D \times c}} \sum_ {i = 1} ^ {L} \| \tilde {X} _ {i} ^ {\top} B \| _ {F} \text {s . t .} B ^ {\top} B = I _ {c}. \tag {7} +$$ + +The range-space of an optimal solution $B^{*}$ of (7) contains $c$ orthogonal directions of minimal $\ell_{1}$ norm for the projected dataset and for this reason we refer to them as dual principal components in analogy with the classical principal components. In this work, we adopt the group-DPCP formulation (7) to address the robust homography estimation in the presence of a large number of mismatches7. For example, suppose we have a 2-view homography estimation problem with $L$ given correspondences $\tilde{x}_i \leftrightarrow \tilde{x}_i'$ , where $N$ of them are high-quality $x \leftrightarrow x'$ and $M$ of them are mismatches $o \leftrightarrow o'$ . Recall from §2.1 that each correspondence $\tilde{x}_i \leftrightarrow \tilde{x}_i'$ contributes two homographic embeddings $\tilde{X}_i \in \mathbb{R}^{9 \times 2}$ , i.e., $K = 2$ . The embeddings $X \in \mathbb{R}^{9 \times 2N}$ of the high quality correspondences lie close to a hyperplane + +of $\mathbb{R}^9$ whose normal vector directly encodes the homography. On the other hand no linear structure is expected in the embeddings $O\in \mathbb{R}^{9\times 2M}$ of the mismatches. Then we may robustly estimate the homography by solving (7) with $c = 1$ . Alternatively, we may work with epipolar embeddings where the task is to extract the homography from a 3-dimensional nullspace (§2.1). In that case we solve (7) for $c = 3$ (now $\tilde{X}_i$ are the epipolar embeddings) to get an orthonormal basis for that nullspace and subsequently extract the homography by solving (3). Similarly, a choice of $c = 1$ is needed for homographic embeddings of 3-view correspondences or $c = 6$ for trifocal ones (Table 1). + +The importance of working with epipolar or trifocal embeddings in this context is computational: Note that the matrix of epipolar/trifocal embeddings has a smaller size than that of homographic embeddings. For example, each correspondence gives 1 epipolar embedding as opposed to 2 homographic ones in $\mathbb{R}^9$ or 4 versus 7 in $\mathbb{R}^{27}$ for the 3-view case. This results in faster computation and lighter memory usage, which is also evidenced in §4. Another potential advantage comes from the theory of robust subspace learning [18]: it is well-known that detecting outliers is a much simpler task when the intrinsic dimension $d$ of the inlier data is small compared to the ambient dimension $D$ . In such a regime a state-of-the-art toolbox of low-rank and sparse representation based methods with efficient implementations is available [43, 44, 45, 46, 47, 48, 49]. In contrast, the task is significantly more challenging when $d / D$ is large [22, 50]. + +# 3.1. Global optimality of (7) + +We present a novel condition for the global optimality of (7) in the noiseless case and otherwise under great generality. This condition is derived by extending the analysis of [23] for constraints of the form $B^T B = I_c$ as well as groupings of points. Suppose that for any $\{i_1, \ldots, i_s\} \subset \{1, \ldots, M\}$ we have $\mathrm{rank}([O_{i_1} \cdots O_{i_s}]) = \min \{D, Ks\}$ . Any random $O_i$ satisfies this with probability 1 and so do the homographic embeddings of random mismatches. We define three quantities that depend on either inliers $X$ or outliers $O$ : + +$$ +\begin{array}{l} \pi_ {X} := \frac {1}{N} \min _ {b \in \mathcal {S} \cap \mathbb {S} ^ {D - 1}} \sum_ {i = 1} ^ {N} \| X _ {i} ^ {\top} b \| _ {2} \\ \rho_ {O} := \frac {1}{M} \max _ {B ^ {T} B = I _ {c}} \left\| (I _ {D} - B B ^ {\top}) \sum_ {i = 1} ^ {M} O _ {i} \operatorname {S i g n} (O _ {i} ^ {\top} B) \right\| _ {F} \\ \delta_ {O} := \frac {1}{M} (\max _ {B ^ {T} B = I _ {c}} \sum_ {i = 1} ^ {M} \| O _ {i} ^ {\top} B \| _ {F} - \min _ {B ^ {T} B = I _ {c}} \sum_ {i = 1} ^ {M} \| O _ {i} ^ {\top} B \| _ {F}). \\ \end{array} +$$ + +Here $\mathbb{S}^{D - 1}$ denotes the unit sphere while for a matrix $A$ we define $\operatorname {Sign}(A)$ as $A / \| A\| _F$ if $A\neq 0$ and 0 otherwise. These quantities are measures of uniformity of $X,O$ . For example, the more uniformly the $X_{i}$ are distributed in $\mathcal{S}$ the larger $\pi_X$ is. Similarly, more uniformly distributed outliers + +$O_{i}$ in $\mathbb{R}^D$ lead to smaller values for $\rho_O$ and $\delta_O$ . Letting $\nu_{O} = \max_{i = 1,\dots,M}\| O_{i}\|_{F}$ , our result reads: + +Proposition 3. Any global solution $B^{*}\in \mathbb{R}^{D\times c}$ to (7) with $c = D - d$ is an orthonormal basis for $\mathcal{S}^{\perp}$ whenever + +$$ +\frac {M}{N} \frac {\sqrt {\left(\rho_ {O} \sqrt {c} + \frac {\nu_ {O} \sqrt {c}}{M} \min \left\{M , \frac {d}{K} \right\}\right) ^ {2} + \delta_ {O} ^ {2}}}{\pi_ {X}} < 1. \tag {8} +$$ + +To interpret (8) let us fix the ratio $M / N$ to a constant value. Then the rest of the left-hand-side of (8) is a fraction whose denominator depends only on the inliers and its numerator only on the outliers. The more uniformly distributed $X, O$ are the larger the denominator and the smaller the numerator become, i.e., (8) is more likely to be satisfied. A study of how (8) behaves when $X, O$ are homographic embeddings is left to a longer version of this manuscript. + +# 4. Experimental evaluation + +We perform an experimental study of homography estimation using DPCP $^8$ . The algorithm used to solve (7) is DPCP-IRLS, to be henceforth referred to as DPCP(c) where $c$ is the dimension of the target nullspace. For example, for 2-view homographic embeddings $c = 1$ , while for epipolar embeddings $c = 3$ . Similarly, for 3-view homographic or trifocal embeddings we have $c = 1, 6$ respectively. We employ a $\mathrm{C}++$ implementation of DPCP for 2-view problems as well as a MATLAB implementation for 3-views. + +We use three RANSAC variations as alternatives. The first one, USAC [14], is a fair representative of the state-of-the-art. USAC generates a model hypothesis using homographic embeddings from 4 sampled correspondences, and determines the proximity of a correspondence to the homography model via reprojection error. The threshold is set to 2 pixels across all experiments. Additional options are available such as local optimization, progressive sampling and model verification. We always use the latter, while (L) or (P) indicate whether the first two have been activated. An off-the-shelf integrated $\mathrm{C + + }$ implementation of USAC is used, but is available only for 2-view problems. Thus we will compare this USAC implementation to the $\mathrm{C + + }$ implementation of DPCP for 2-views only. + +For 3-view experiments we use our own optimized MATLAB implementation of two vanilla RANSAC algorithms termed RP-RANSAC and SD-RANSAC. These use reprojection and subspace distance errors respectively. The threshold for RP-RANSAC is consistently set to 2 pixels. This is used to optimally set a threshold for SD-RANSAC. The running time of both is set to be equal to the running time of the MATLAB implementation of DPCP. + +Table 2: Homography estimation on 339 synthetically warped images from the MS-COCO dataset. Corner errors are in pixels and running times are in milliseconds. + +
methodAUCCorner ErrorTime
meanDPCP(1)0.892.531.13
DPCP(3)0.885.080.88
USAC0.843.345.38
USAC(L)0.921.1816.6
USAC(P)0.7112.621.4
USAC(PL)0.846.7522.7
medianDPCP(1)0.940.810.98
DPCP(3)0.930.960.74
USAC0.882.373.28
USAC(L)0.950.4813.0
USAC(P)0.768.581.43
USAC(PL)0.930.8311.3
+ +![](images/2200e9a72158f8f22d1ade37ed1287388f4c5e0f908c8d6d821d98d13981dec7.jpg) +Figure 1: A random patch on the original image is taken as reference (red) and its corners are perturbed to get the second patch (blue). This defines a homography warp (right). + +# 4.1. Homography warping + +We follow the protocol of [51, 32] to generate warped images from the MS-COCO dataset [52] as shown in Fig. 1. We resize each image to $640 \times 480$ pixels in gray-scale and extract a $256 \times 256$ reference patch (red) at a random location. A perturbed patch (blue) is then generated by taking the corners of the reference patch and adding uniform noise up to 64 pixels. A ground-truth homography is computed by establishing correspondences between the corners of the two patches (§2.1). By warping the perturbed patch with the ground-truth homography, the second patch is brought back to the same size and format as the reference patch. The task is to estimate the homography given the two square patches. Correspondences are obtained by extracting and matching ORB features [53] between the two patches using a matching threshold of 0.3 and a ratio test threshold of 0.7. + +Table 2 reports mean/median area under the precision-recall curve (AUC), corner error in pixels as defined in [51] and running time over 339 randomly sampled images from the MS-COCO dataset. To begin with, USAC(PL) achieves a mean and median corner error of 6.75 and 0.83 pixels re + +spectively, which is in agreement with what was reported in [32, Figure 2]. Remarkably, DPCP outperforms both USAC(PL) and the deep learning approach reported in [32, Figure 2]: the latter has mean and median corner error of about 5 and 1.2 pixels while DPCP(1) has 2.53 and 0.81 respectively. On the other hand DPCP(3) appears to be less robust than DPCP(1) having twice the mean corner error of the latter. We conjecture that this is due to the homography estimation pipeline of DPCP(3), which involves two consecutive optimization problems, i.e. (7) followed by (3). It is the subject of current research to merge these into a single optimization problem, which is expected to improve the robustness. Note furthermore that the progressive sampling strategy of USAC seems to yield higher mean corner error, e.g., USAC(PL) has a mean error of 6.75 which drops to 1.18 for USAC(L), for which progressive sampling is switched off. Based on our investigations, the reason appears to be that the affinity score between matched ORB features—used for prioritizing the sampling [14, 54]—does not discriminate well between true and false matches.[10] Overall, USAC(L) gives the smallest mean corner error of about 1 pixel and the highest mean AUC value of 0.92. This is not a surprise since local optimization is known to lead to high accuracy [13, 14, 42]. However, note that DPCP(1) runs on average about 15 times faster than USAC(L) and has performance only slightly less accurate than USAC(L). + +# 4.2. Structure from motion + +We solve the structure from motion problem via homographies on sequences from the KITTI odometry [55] and the TUM RGB-D [56] datasets. The sequences cover outdoor driving scenes, as well as indoor man-made environments, which turn out to be well modeled by homographies. We match putative 2-view or 3-view correspondences over each pair/triplet of images.[11] We discard frames that have fewer than 30 correspondences among three views. For each method, homographies for view pairs $(\mathcal{V},\mathcal{V}^{\prime})$ and $(\mathcal{V},\mathcal{V}^{\prime \prime})$ are estimated. For the purpose of evaluation, we further convert the estimated homographies to calibrated homographies using the provided camera calibration information, and then perform homography decomposition [57, 58] to obtain rotation and translation matrices. For a homography, there are at most four pairs of possible rotations and translations, and the one with smallest error with regard to ground-truth is used for evaluation.[12] Finally, the 20 correspondences with the smallest reprojection error for each estimated homography model are used for refining the poses via bundle adjustment [59]. + +![](images/9c0fd5a8658bfb6d8e990782310caf7655b8a9049dd092aa99a5219dff5450b3.jpg) +(a) Homography inliers (red) lie close to a wall plane. + +![](images/e5da9916c5f858e6f85c08dc416bff6f160c2c4827238e1eff9e9573757772b4.jpg) +(b) Homography inliers (red) are non-planar but have large depth and are close to the direction of motion. +Figure 2: A homography is fit to frames 101 and 105 from sequence 0 (see Figure 2a) and frames 3301 and 3305 from sequence 8 (see Figure 2b) of the KITTI dataset. Points compatible with the epipolar geometry (blue and red) and the homography model (red) are shown in the first view. + +KITTI odometry. This is an autonomous driving dataset that includes images taken from a camera looking forward fixed on top of a car. As shown in Fig. 2 a homography can be successfully used due to the presence of correctly matched points that either 1) lie in a planar part of the scene (Fig. 2a) or 2) have large depth and are close to the direction of motion (Fig. 2b). For each sequence13, frames $\{1, 101, 201\ldots\}$ are sampled to be the first views, and then a gap of 4 is chosen to generate triplets of views, e.g., frames $(100, 105, 109)$ will be a triplet for evaluation14. We compare the use of 2-view and 3-view embeddings by working with view triplets: in the former case we treat view triplets as pairs of two views. + +Table 3 (top) reports mean rotation error and translation error in angles, and reprojection error for the ground-truth inliers before and after bundle adjustment (BA) for sequence 8 of KITTI. The lowest rotation error among the 2-view methods is $0.42^{\circ}$ achieved by USAC(L), which takes $13.1\mathrm{ms}$ to complete. Remarkably DPCP(1) converges in $0.64\mathrm{ms}$ with a rotation error of only $0.1^{\circ}$ higher than that of USAC(L). Moreover, DPCP(1) has the lowest translation error and the lowest reprojection error before and after BA: 1.46 pixels as opposed to 2.26 pixels for USAC(L). + +Interestingly, lower errors are achieved by 3-view methods before BA. In particular, DPCP(1) gives the lowest rotation, translation and reprojection errors before BA among + +all methods. Moreover, DPCP(6) seems to be much more robust than DPCP(3) giving the second lowest errors. Notably, DPCP(6) converges in 2.8ms and has smaller errors than the USAC(L) for two views. This is interesting because—even though it is known that for the same number of correspondences optimizing over three views jointly gives more accurate poses than over pairs of two views independently [37, 60]—in practice there are fewer correspondences over 3-views. This experiment shows that working with 3-view embeddings can be advantageous. + +Finally, even though for the purpose of homography estimation penalizing the reprojection error is more suitable than penalizing the subspace distance, SD-RANSAC appears to be more accurate than RP-RANSAC given the same time budget. This is because RP-RANSAC contains additional matrix multiplications and a matrix inversion in order to compute the symmetric transfer error. For example, in 4.76ms SD-RANSAC(1) completes 17 iterations as opposed to 8 iterations in 4.92ms for RP-RANSAC(1). + +TUM RGB-D. This dataset includes sequences of different indoor environments taken from a hand-held RGB-D camera. We test the methods on two interesting sequences: 'fr3/nostructure Texture_near_withloop' where the scene is a planar wall with posters on it so that rich features can be detected and matched, and 'fr2/360_hemisphere' where the motion is almost translation free. For convenience we will refer to them as 'near' and 'hemisphere' respectively. We choose a frame gap of 20 for 'near' and 10 for 'hemisphere'. + +As seen in the middle part of Table 3 the best performance for the sequence 'near' across all 2-view and 3-view methods is uniformly achieved by USAC(L). Rotation, translation and reprojection errors are $0.42^{\circ}, 3.16^{\circ}$ and 0.66 pixels respectively. Notice that USAC(L) takes 30.6ms to terminate. Remarkably, DPCP(1) for two views converges in only 0.84ms and has almost the same performance of $0.46^{\circ}, 3.3^{\circ}$ and 0.67 pixels. If we switch off local optimization, USAC may terminate slightly faster than DPCP(1), however at the cost of a significant degradation in terms of accuracy: it has more than $1^{\circ}$ and $9^{\circ}$ higher rotation and translation errors than DPCP(1). Note also that DPCP(3) performs almost as good as DPCP(1). Finally, the 3-view counterparts of these methods, that is DPCP(1) and DPCP(6), outperform their RANSAC analogues by a nonnegligible margin. In particular, the angular translation error for DPCP(1) is $3.9^{\circ}$ while RANSAC methods give at least $3^{\circ}$ higher error. + +The bottom of Table 3 indicates the results for the sequence 'hemisphere'. Note that all methods give very large translation errors owing to the fact that the motion in this sequence is almost purely rotational, which results in a low signal-to-noise ratio in the translation direction [61, 62]. Note that over three views, trifocal embeddings clearly produce better results than homographic ones. + +Table 3: Homography estimation from three views using 2-view or 3-view embeddings. Dataset/sequence in boldface. Rotation and translation errors are in degrees, reprojection error is in pixels and running time is in milliseconds. BA stands for bundle adjustment. + +
KITTI-8before BAafter BA
2view-methodsTimeRot.Tran.Repr.Repr.
DPCP(1)0.640.524.022.021.46
DPCP(3)0.551.124.858.212.30
USAC5.800.6910.53.432.86
USAC(L)13.10.426.042.392.26
before BAafter BA
3view-methodsTimeRot.Tran.Repr.Repr.
DPCP(1)4.630.353.961.681.73
DPCP(6)2.800.424.111.811.71
SD-RANSAC(1)4.760.505.772.332.19
SD-RANSAC(6)2.890.557.322.352.15
RP-RANSAC(1)4.920.807.825.6411.3
RP-RANSAC(6)3.411.6910.736.59.75
TUM-nearbefore BAafter BA
2view-methodsTimeRot.Tran.Repr.Repr.
DPCP(1)0.840.463.300.670.67
DPCP(3)0.650.463.360.680.68
USAC0.661.6312.91.450.99
USAC(L)30.60.423.160.660.66
before BAafter BA
3view-methodsTimeRot.Tran.Repr.Repr.
DPCP(1)7.640.503.900.690.69
DPCP(6)4.770.513.960.690.69
SD-RANSAC(1)7.970.946.930.970.82
SD-RANSAC(6)5.070.887.571.200.86
RP-RANSAC(1)8.334.4523.036.47.91
RP-RANSAC(6)6.866.0129.548.037.1
TUM-hemispherebefore BAafter BA
2view-methodsTimeRot.Tran.Repr.Repr.
DPCP(1)0.890.9535.91.000.84
DPCP(3)0.601.1334.71.040.81
USAC0.901.3849.91.300.95
USAC(L)27.80.7237.60.990.79
before BAafter BA
3view-methodsTimeRot.Tran.Repr.Repr.
DPCP(1)4.122.4636.52.691.01
DPCP(6)2.701.3235.71.060.86
SD-RANSAC(1)4.281.8547.11.671.82
SD-RANSAC(6)2.821.4747.61.170.97
RP-RANSAC(1)4.445.0953.536.937.4
RP-RANSAC(6)3.415.3154.512.94.63
+ +Indeed, DPCP(6) gives the best performance among all 3-view methods with rotation and reprojection errors more than $1^{\circ}$ and 1 pixel lower than those for DPCP(1). Moreover, DPCP(6) converges in about half the time required DPCP(1). In fact, across all experiments DPCP consistently converges faster with epipolar or trifocal embeddings as opposed to homographic embeddings. This is because, as already mentioned in §2 and §3, the former are more economic than the latter: for three views the data matrix of trifocal embeddings has 4/7 times the size of the matrix of homographic embeddings, while this size ratio is 1/2 for two-views. An additional potential factor is the effect of the lower intrinsic dimension of epipolar/trifocal embeddings; indeed as per Theorem 6 $^{15}$ in [22] DPCP is known to converge faster for higher codimensions. + +# 5. Discussion + +We have shown that modern robust subspace fitting techniques are amenable to the solution of geometric vision problems. DPCP produces results that are competitive to state-of-the-art methods in terms of the achievable accuracy, and does so using substantially reduced computational effort. We have furthermore demonstrated that working over epipolar or trifocal embeddings can lead to another advantage in terms of computational efficiency, especially for the three-view scenario, at the cost of only slightly reduced accuracy. We believe the reduced accuracy is not inherent to our approach but rather an artifact of our computational pipeline that solves two consecutive optimization problems (efforts are being made to reduce this to a single problem). From a theoretical point of view, our contribution relies on a new global optimality condition for the DPCP algorithm. Moreover, in the context of homography fitting, we prove that the nullspace over epipolar or trifocal embeddings is uniquely defined by the underlying homographies, thus enabling a reduction in the intrinsic dimension and therefore another boost in computational efficiency. + +We placed significant emphasis on comparing our proposed approach to the highly successful RANSAC algorithm through rigorous and exhaustive experimental evaluation. We applied all algorithms to multiple scenarios for both two and three view configurations while carefully considering practical implications such as a reduction in the number of correspondences over three views. Comparisons to state-of-the-art implementations of variants of RANSAC for regular CPU architectures were performed. From a practical point of view, we believe the available time budget is the most important concern in robust estimation, and in this regard we demonstrated that DPCP is superior to RANSAC. + +# References + +[1] Z. Zhang, “A Flexible New Technique for Camera Calibration,” IEEE transactions on pattern analysis and machine intelligence, vol. 22, no. 11, pp. 1330-1334, 2000. 1 +[2] Z. Chuan, T. D. Long, Z. Feng, and D. Z. Li, “A planar homography estimation method for camera calibration,” in IEEE International Symposium on Computational Intelligence in Robotics and Automation, vol. 1, pp. 424–429, 2003. 1 +[3] R. T. Collins and J. R. Beveridge, “Matching perspective views of coplanar structures using projective unwarping and similarity matching,” in IEEE Conference on Computer Vision and Pattern Recognition, pp. 240–245, 1993. 1 +[4] D. Liebowitz and A. Zisserman, "Metric rectification for perspective images of planes," in IEEE Conference on Computer Vision and Pattern Recognition, pp. 482-488, 1998. 1 +[5] M. Brown and D. G. Lowe, “Recognising poranoras,” IEEE International Conference on Computer Vision, vol. 2, pp. 1218–1225, 2003. 1 +[6] G. Simon, A. W. Fitzgibbon, and A. Zisserman, “Markerless tracking using planar structures in the scene,” in IEEE and ACM International Symposium on Augmented Reality, pp. 120–128, 2000. 1 +[7] Z. Zhou, H. Jin, and Y. Ma, “Robust plane-based structure from motion,” IEEE Conference on Computer Vision and Pattern Recognition, pp. 1482–1489, 2012. 1 +[8] J. Yang and H. Li, “Dense, accurate optical flow estimation with piecewise parametric model,” in IEEE Conference on Computer Vision and Pattern Recognition, pp. 1019–1027, 2015. 1 +[9] M. Grundmann, V. Kwatra, D. Castro, and I. Essa, “Calibration-free rolling shutter removal,” IEEE International Conference on Computational Photography, 2012. 1 +[10] Z. Zhou, H. Jin, and Y. Ma, "Plane-based content preserving warps for video stabilization," IEEE Conference on Computer Vision and Pattern Recognition, no. 1, pp. 2299-2306, 2013. 1 +[11] T. Tuytelaars and K. Mikolajczyk, “Local Invariant Feature Detectors: A Survey,” Foundations and Trends in Computer Graphics and Vision, vol. 3, no. 3, pp. 177–280, 2007. 1 +[12] M. A. Fischler and R. C. Bolles, “Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography,” Communications of the ACM, vol. 24, no. 6, pp. 381–395, 1981. 1 +[13] O. Chum, J. Matas, and J. Kittler, "Locally optimized ransac," in Joint Pattern Recognition Symposium, pp. 236-243, Springer, 2003. 1, 6 +[14] R. Raguram, O. Chum, M. Pollefeys, J. Matas, and J. M. Frahm, "USAC: A universal framework for random sample consensus," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 35, no. 8, pp. 2022-2038, 2013. 1, 2, 5, 6 + +[15] L. Moisan, P. Moulon, and P. Monasse, “Fundamental Matrix of a Stereo Pair, with A Contrario Elimination of Outliers,” Image Processing On Line, vol. 5, pp. 89–113, 2016. 1 +[16] D. Barath and J. Matas, “Graph-Cut RANSAC,” IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 6733–6741, 2018. 1 +[17] D. Barath, J. Matas, and J. Noskova, “MAGSAC: Marginalizing sample consensus,” IEEE Conference on Computer Vision and Pattern Recognition, pp. 10189–10197, 2019. 1 +[18] R. Vidal, Y. Ma, and S. S. Sastry, Generalized Principal Component Analysis, vol. 40. Springer Verlag, 2016. 1, 5 +[19] G. Lerman and T. Maunu, “An Overview of Robust Subspace Recovery,” Proceedings of the IEEE, vol. 106, pp. 1380–1410, 2018. 1 +[20] M. C. Tsakiris and R. Vidal, “Dual principal component pursuit,” in ICCV Workshop on Robust Subspace Learning and Computer Vision, pp. 10–18, 2015. 1 +[21] M. C. Tsakiris and R. Vidal, “Hyperplane clustering via dual principal component pursuit,” in International Conference on Machine Learning, 2017. 1, 2 +[22] M. C. Tsakiris and R. Vidal, "Dual principal component pursuit," Journal of Machine Learning Research, vol. 19, no. 18, pp. 1-50, 2018. 1, 2, 5, 8 +[23] Z. Zhu, Y. Wang, D. Robinson, D. Naiman, R. Vidal, and M. C. Tsakiris, "Dual principal component pursuit: Improved analysis and efficient algorithms," Neural Information Processing Systems, 2018. 1, 2, 5 +[24] T. Ding, Z. Zhu, T. Ding, Y. Yang, D. Robinson, M. C. Tsakiris, and R. Vidal, "Noisy dual principal component pursuit," in International Conference on Machine Learning, pp. 1617-1625, 2019. 1, 2 +[25] Q. Qu, J. Sun, and J. Wright, "Finding a sparse vector in a subspace: Linear sparsity using alternating directions," in Advances in Neural Information Processing Systems 27, pp. 3401-3409, 2014. 1 +[26] G. Lerman and T. Maunu, "Fast, robust and non-convex subspace recovery," Information and Inference: A Journal of the IMA, vol. 7, no. 2, pp. 277-336, 2017. 1 +[27] Z. Zhu, T. Ding, D. Robinson, M. C. Tsakiris, and R. Vidal, “A Linearly Convergent Method for Non-Smooth Non-Convex Optimization on the Grassmannian with Applications to Robust Subspace and Dictionary Learning,” in Advances in Neural Information Processing Systems 32, pp. 9442–9452, 2019. 1 +[28] X. Li, S. Chen, Z. Deng, Q. Qu, Z. Zhu, and A. M. C. So, "Weakly Convex Optimization over Stiefel Manifold Using Riemannian Subgradient-Type Methods," pp. 1-27, 2019. 1 +[29] T. Maunu, T. Zhang, and G. Lerman, “A well-tempered landscape for non-convex robust subspace recovery,” Journal of Machine Learning Research, vol. 20, pp. 1–59, 2019. 1 +[30] G. Lerman and T. Zhang, "Robust recovery of multiple subspaces by geometric $\ell_p$ minimization," Annals of Statistics, vol. 39, no. 5, pp. 2686-2715, 2011. 2 + +[31] G. Lerman and T. Zhang, “ $\ell_p$ -recovery of the most significant subspace among multiple subspaces with outliers,” Constructive Approximation, vol. 40, no. 3, pp. 329-385, 2014. 2 +[32] R. Ranftl and V. Koltun, “Deep Fundamental Matrix Estimation,” in European Conference on Computer Vision, pp. 284–299, Springer Verlag, 2018. 2, 6 +[33] J. Harris, Algebraic geometry: a first course, vol. 133. Springer Science & Business Media, 2013. 3 +[34] D. Cox, J. Little, and D. OShea, Ideals, varieties, and algorithms: an introduction to computational algebraic geometry and commutative algebra. Springer Science & Business Media, 2015. 3 +[35] R. Hartley and A. Zisserman, Multiple view geometry in computer vision. Cambridge university press, 2003. 3 +[36] S. B. Heinrich and W. E. Snyder, "Robust Estimation of the Trifocal Tensor: A Comparative Performance Evaluation," Preprint, https://shorturl.at/abhqu, 2011.3 +[37] R. Vidal and R. Hartley, “Three-view multibody structure from motion,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 30, no. 2, pp. 214–227, 2008. 3, 7 +[38] A. Shashua and M. Werman, "Trilinearity of three perspective views and its associated tensor," in IEEE International Conference on Computer Vision, pp. 920-925, 1995. 3 +[39] A. Shashua and L. Wolf, “Homography tensors: On algebraic entities that represent three views of static or moving planar points,” in European Conference on Computer Vision, pp. 507–521, Springer, 2000. 3, 4 +[40] C. Aholt and L. Oeding, “The ideal of the trifocal variety,” Arxiv preprint arXiv:1205.3776, pp. 1–27, 2012. 3 +[41] L. Oeding, “The quadrifocal variety,” Linear Algebra and Its Applications, 2017. 3 +[42] J. Šerych, J. Matas, and O. Drbohlav, “Fast 11-based ransac for homography estimation,” in 21st Computer Vision Winter Workshop Luka Cehovin, 2016. 4, 6 +[43] H. Xu, C. Caramanis, and S. Sanghavi, “Robust pca via outlier pursuit,” IEEE transactions on information theory, vol. 58, no. 5, pp. 3047–3064, 2012. 5 +[44] M. Soltanolkotabi, E. J. Candes, et al., “A geometric analysis of subspace clustering with outliers,” The Annals of Statistics, vol. 40, no. 4, pp. 2195–2238, 2012. 5 +[45] M. Rahmani and G. K. Atia, “Coherence pursuit: Fast, simple, and robust principal component analysis,” IEEE Transactions on Signal Processing, vol. 65, no. 23, pp. 6260–6275, 2017. 5 +[46] C. Peng, C. Chen, Z. Kang, J. Li, and Q. Cheng, “RES-PCA: A scalable approach to recovering low-rank matrices,” IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 7309–7317, 2019. 5 +[47] Y. Zhang, D. Shi, J. Gao, and D. Cheng, “Low-rank-sparse subspace representation for robust regression,” IEEE Conference on Computer Vision and Pattern Recognition, pp. 2972–2981, 2017. 5 + +[48] H. Q. Cai, J. F. Cai, and K. Wei, "Accelerated alternating projections for robust principal component analysis," Journal of Machine Learning Research, vol. 20, pp. 1-33, 2019. 5 +[49] M. Rahmani and P. Li, "Outlier Detection and Robust PCA Using a Convex Measure of Innovation," Neural Information Processing Systems, pp. 1-11, 2019. 5 +[50] Y. Wang, C. Dicle, M. Sznaier, and O. Camps, "Self Scaled Regularized Robust Regression," IEEE Conference on Computer Vision and Pattern Recognition, pp. 3261-3269, 2015. 5 +[51] D. DeTone, T. Malisiewicz, and A. Rabinovich, "Deep Image Homography Estimation," Arxiv preprint arXiv:1606.03798, 2016. 6 +[52] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollar, and C. L. Zitnick, "Microsoft coco: Common objects in context," in European conference on computer vision, pp. 740-755, Springer, 2014. 6 +[53] E. Rublee, V. Rabaud, K. Konolige, and G. Bradski, “ORB: An efficient alternative to SIFT or SURF,” IEEE International Conference on Computer Vision, pp. 2564–2571, 2011. 6 +[54] O. Chum and J. Matas, “Matching with PROSAC - Progressive sample consensus,” IEEE Computer Society Conference on Computer Vision and Pattern Recognition, vol. I, no. I, pp. 220–226, 2005. 6 +[55] A. Geiger, P. Lenz, and R. Urtasun, "Are we ready for autonomous driving? the kitti vision benchmark suite," in IEEE Conference on Computer Vision and Pattern Recognition, 2012. 6 +[56] J. Sturm, N. Engelhard, F. Endres, W. Burgard, and D. Cremers, “A benchmark for the evaluation of rgb-d slam systems,” in International Conference on Intelligent Robot Systems, Oct. 2012. 6 +[57] O. FAUGERAS and F. LUSTMAN, “Motion and Structure From Motion in a Piecewise Planar Environment,” International Journal of Pattern Recognition and Artificial Intelligence, vol. 02, no. 03, pp. 485–508, 1988. 6 +[58] Z. Zhang and a. R. Hanson, “3D Reconstruction Based on Homography Mapping,” ARPA Image Understanding Workshop, pp. 249–6399, 1996. 6 +[59] M. I. Lourakis and A. A. Argyros, “SBA: A software package for generic sparse bundle adjustment,” ACM Transactions on Mathematical Software, vol. 36, no. 1, 2009. 6 +[60] P. Moulon, P. Monasse, and R. Marlet, “Global fusion of relative motions for robust, accurate and scalable structure from motion,” IEEE International Conference on Computer Vision, pp. 3248–3255, 2013. 7 +[61] R. Vidal and J. Oliensis, “Structure from planar motions with small baselines,” in European conference on computer vision, pp. 383–398, 2002. 7 +[62] O. Enqvist, F. Kahl, and C. Olsson, “Non-sequential structure from motion,” in IEEE International Conference on Computer Vision Workshops, pp. 264–271, 2011. 7 \ No newline at end of file diff --git a/robusthomographyestimationviadualprincipalcomponentpursuit/images.zip b/robusthomographyestimationviadualprincipalcomponentpursuit/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e90178d09e0985837c6177a73a8afbb70131b148 --- /dev/null +++ b/robusthomographyestimationviadualprincipalcomponentpursuit/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:979c589d345942db5faf375952b3994b3341f89b263bb96a0887ee5115d9a2e5 +size 401002 diff --git a/robusthomographyestimationviadualprincipalcomponentpursuit/layout.json b/robusthomographyestimationviadualprincipalcomponentpursuit/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..283e1922e5687ec16dda70d435f27b0de2085310 --- /dev/null +++ b/robusthomographyestimationviadualprincipalcomponentpursuit/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7f8494fee66beb4b6bd0cb8cff8e4d11dd3747467a1603d31cfabc6074e75a7 +size 605627 diff --git a/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_content_list.json b/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a85cc22d5371300b673d0dd448908b11ae35e181 --- /dev/null +++ b/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49f1159959b46b1a0d6ed97c1e438e3368f8be14c3a06ec7df12dc520c93da24 +size 94852 diff --git a/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_model.json b/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e9ea9709790511da464dd60f2d0271d1a0010b1d --- /dev/null +++ b/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a82e547f22c609c3cb2b31147e53d25c4a0ac0dc195e3cecccbdc7e27fbc84c +size 115998 diff --git a/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_origin.pdf b/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..efbb0ca51206e28adb9be95cfb8f4e51f77df286 --- /dev/null +++ b/robustlearningthroughcrosstaskconsistency/7566c55c-9292-4128-aef0-82dfaf9fc31f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057d52e91972f9388dc24d75f7cade79dae183cd158ae248ce7452bee0ebd099 +size 3716417 diff --git a/robustlearningthroughcrosstaskconsistency/full.md b/robustlearningthroughcrosstaskconsistency/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5b4e746d76b1578b4467c4e1d1e7056f9437d4e3 --- /dev/null +++ b/robustlearningthroughcrosstaskconsistency/full.md @@ -0,0 +1,373 @@ +# Robust Learning Through Cross-Task Consistency + +Amir R. Zamir\* Alexander Sax\* Nikhil Cheerla\* Rohan Suri\* Zhangjie Cao\* Jitendra Malik\* Leonidas Guibas + +† Swiss Federal Institute of Technology (EPFL) ‡ Stanford University ‡ UC Berkeley http://consistency.epfl.ch/ + +# Abstract + +Visual perception entails solving a wide set of tasks, e.g., object detection, depth estimation, etc. The predictions made for multiple tasks from the same image are not independent, and therefore, are expected to be 'consistent'. We propose a broadly applicable and fully computational method for augmenting learning with Cross-Task Consistency. The proposed formulation is based on inference-path invariance over a graph of arbitrary tasks. We observe that learning with cross-task consistency leads to more accurate predictions and better generalization to out-of-distribution inputs. This framework also leads to an informative unsupervised quantity, called Consistency Energy, based on measuring the intrinsic consistency of the system. Consistency Energy correlates well with the supervised error $(r = 0.67)$ , thus it can be employed as an unsupervised confidence metric as well as for detection of out-of-distribution inputs (ROC-AUC=0.95). The evaluations are performed on multiple datasets, including Taskonomy, Replica, CocoDoom, and ApolloScape, and they benchmark cross-task consistency versus various baselines including conventional multi-task learning, cycle consistency, and analytical consistency. + +# 1. Introduction + +What is consistency: suppose an object detector detects a ball in a particular region of an image, while a depth estimator returns a flat surface for the same region. This presents an issue – at least one of them has to be wrong, because they are inconsistent. More concretely, the first prediction domain (objects) and the second prediction domain (depth) are not independent and consequently enforce some constraints on each other, often referred to as consistency constraints. + +Why is it important to incorporate consistency in learning: first, desired learning tasks are usually predictions of different aspects of one underlying reality (the scene that underlies an image). Hence inconsistency among predictions + +![](images/8a677d19f8905cb4c727d88e702b56618636bc360aed5fea6f63115195fe9355.jpg) +Figure 1: Cross-Task Consistent Learning. The predictions made for different tasks out of one image are expected to be consistent, as the underlying scene is the same. This is exemplified by a challenging query and four sample predictions out of it. We propose a general method for learning utilizing data-driven cross-task consistency constraints. The lower and upper rows show the results of the baseline (independent learning) and learning with consistency, which yields higher quality and more consistent predictions. Red boxes provide magnifications. [Best seen on screen] + +implies contradiction and is inherently undesirable. Second, consistency constraints are informative and can be used to better fit the data or lower the sample complexity. Also, they may reduce the tendency of neural networks to learn "surface statistics" (superficial cues) [18], by enforcing constraints rooted in different physical or geometric rules. This is empirically supported by the improved generalization of models when trained with consistency constraints (Sec. 5). + +How can we design a learning system that makes consistent predictions: this paper proposes a method which, given an arbitrary dictionary of tasks, augments the learning objective with explicit constraints for cross-task consistency. The constraints are learned from data rather than apriori given relationships. This makes the method applicable to any pairs of tasks as long as they are not statistically independent; even if their analytical relationship is unknown, hard to program, or non-differentiable. The primary concept behind the method is 'inference-path invariance'. That + +is, the result of inferring an output domain from an input domain should be the same, regardless of the intermediate domains mediating the inference (e.g., RGB $\rightarrow$ normals and RGB $\rightarrow$ depth $\rightarrow$ normals and RGB $\rightarrow$ shading $\rightarrow$ normals are expected to yield the same normal results). When inference paths with the same endpoints, but different intermediate domains, yield similar results, this implies the intermediate domain predictions did not conflict as far as the output was concerned. We apply this concept over paths in a graph of tasks, where the nodes and edges are prediction domains and neural network mappings between them, respectively (Fig. 2(d)). Satisfying this invariance constraint over all paths in the graph ensures the predictions for all domains are in global cross-task agreement. $^3$ + +To make the associated large optimization job manageable, we reduce the problem to a 'separable' one, devise a tractable training schedule, and use a 'perceptual loss' based formulation. The last enables mitigating residual errors in networks and potential ill-posed/one-to-many mappings between domains (Sec. 3). + +Interactive visualizations, trained models, code, and a live demo are available at http://consistency.epfl.ch/. + +# 2. Related Work + +The concept of consistency and methods for enforcing it are related to various topics, including structured prediction, graphical models [22], functional maps [30], and certain topics in vector calculus and differential topology [10]. We review the most relevant ones in context of computer vision. + +Utilizing consistency: Various consistency constraints have been commonly found beneficial across different fields, e.g., in language as 'back-translation' [2, 1, 25, 7] or in vision over the temporal domain [41, 6], 3D geometry [9, 32, 8, 13, 49, 46, 15, 44, 51, 48, 23, 5], and in recognition and (conditional/unconditional) image translation [12, 28, 17, 50, 14, 4]. In computer vision, consistency has been extensively utilized in the cycle form and often between two or few domains [50, 14]. In contrast, we consider consistency in the more general form of arbitrary paths with varied-lengths over a large task set, rather than the special cases of short cyclic paths. Also, the proposed approach needs no prior explicit knowledge about task relationships [32, 23, 44, 51]. + +Multi-task learning: In the most conventional form, multi-task learning predicts multiple output domains out of a shared encoder/representation for an input. It has been speculated that the predictions of a multi-task network may be automatically cross-task consistent as the representation from which the predictions are made are shared. This has been observed to not be necessarily true in several + +![](images/c357bd3117349fba482cd4b803d524bc148b530ca3be3ec5c33592ebe5b4bcbf.jpg) +Figure 2: Enforcing Cross-Task Consistency: (a) shows the typical multitask setup where predictions $x \rightarrow y_1$ and $x \rightarrow y_2$ are trained without a notation of consistency. (b) depicts the elementary triangle consistency constraint where the prediction $x \rightarrow y_1$ is enforced to be consistent with $x \rightarrow y_2$ using a function that relates $y_1$ to $y_2$ (i.e. $y_1 \rightarrow y_2$ ). (c) shows how the triangle unit from (b) can be an element of a larger system of domains. Finally, (d) illustrates the generalized case where in the larger system of domains, consistency can be enforced using invariance along arbitrary paths, as long as their endpoints are the same (here the blue and green paths). This is the general concept behind inference-path invariance. The triangle in (b) is the smallest unit of such paths. + +works [21, 47, 43, 38], as consistency is not directly enforced during training. We also make the same observation (see visuals here) and quantify it (see Fig. 9(a)), which signifies the need for explicit augmentation of consistency in learning. + +Transfer learning predicts the output of a target task given another task's solution as a source. The predictions made using transfer learning are sometimes assumed to be cross-task consistent, which is often found to not be the case [45, 36], as transfer learning does not have a specific mechanism to impose consistency by default. Unlike basic multi-task learning and transfer learning, the proposed method includes explicit mechanisms for learning with general data-driven consistency constraints. + +Uncertainty metrics: Among the existing approaches to measuring prediction uncertainty, the proposed Consistency Energy (Sec. 4) is most related to Ensemble Averaging [24], with the key difference that the estimations in our ensemble are from different cues/paths, rather than retraining/reevaluating the same network with different random initializations or parameters. Using multiple cues is expected to make the ensemble more effective at capturing uncertainty. + +# 3. Method + +We define the problem as follows: suppose $x$ denotes the query domain (e.g., RGB images) and $y = \{y_1, \dots, y_n\}$ is the set of $n$ desired prediction domains (e.g. normals, depth, objects, etc). An individual datapoint from domains $(x, y_1, \dots, y_n)$ is denoted by $(x, y_1, \dots, y_n)$ . The goal is to learn functions that map the query domain onto the prediction domains, i.e. $\mathcal{F}_x = \{f_{xy_j} | y_j \in y\}$ where $f_{xy_j}(x)$ outputs $y_j$ given $x$ . We also define $\mathcal{F}_y = \{f_{y_i y_j} | y_i, y_j \in y, i \neq j\}$ , which is the set of 'cross-task' functions that map the prediction domains onto each other; we use them in the consistency constraints. For now assume $\mathcal{F}_y$ is given apriori and frozen; in Sec. 3.3 we discuss all functions $f_s$ are neural networks in this paper, and we learn $\mathcal{F}_y$ just like $\mathcal{F}_x$ . + +# 3.1. Triangle: The Elementary Consistency Unit + +A common way of training neural networks in $\mathcal{F}_x$ , e.g. $f_{xy_1}(x)$ , is to find parameters of $f_{xy_1}$ that minimize a loss of the form $|f_{xy_1}(x) - y_1|$ using a common distance function + +![](images/29a58708a316b57bafca2e57faeb8fe480194e773d21788dc42d28c1e28bf5de.jpg) +Figure 3: Impact of disregarding cross-task consistency in learning, illustrated using surface normals domain. Each subfigure shows the results of predicting surface normals out of the prediction of an intermediate domain; using the notation $x \rightarrow y_1 \rightarrow y_2$ , here $x$ is RGB image, $y_2$ is surface normals, and each column represents a different $y_1$ . The upper row demonstrates the normals are noisy and dissimilar when cross-task consistency is not incorporated in learning of $x \rightarrow y_1$ networks. Whereas enforcing consistency when learning $x \rightarrow y_1$ results in more consistent and better normals (the lower row). We will show this causes the predictions for the intermediate domains themselves to be more accurate and consistent. More examples available in supplementary material. The Consistency Energy (Sec. 4) captures the variance among predictions in each row. + +as $|\cdot|$ , e.g. $\ell_1$ norm. This standard independent learning of $f_{xy_i}$ satisfies various desirable properties, including crosstalk consistency, if given infinite amount of data, but not under the practical finite data regime. This is shown in Fig. 3 (upper). Thus we introduce additional constraints to guide the training toward cross-task consistency. We define the loss for predicting domain $y_1$ from $x$ while enforcing consistency with domain $y_2$ as a directed triangle depicted in Fig. 2(b): + +$$ +\mathcal {L} _ {\mathcal {X Y} _ {1} \mathcal {Y} _ {2}} ^ {\text {t r i a n g l e}} \triangleq | f _ {\mathcal {X Y} _ {1}} (x) - y _ {1} | + | f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X Y} _ {1}} (x) - f _ {\mathcal {X Y} _ {2}} (x) | + | f _ {\mathcal {X Y} _ {2}} (x) - y _ {2} |. \tag {1} +$$ + +The first and last terms are the standard direct losses for training $f_{xy_1}$ and $f_{xy_2}$ . The middle term is the consistency term which enforces predicting $y_2$ out of the predicted $y_1$ yields the same result as directly predicting $y_2$ out of $x^4$ . Thus learning to predict $y_1$ and $y_2$ are not independent anymore. + +The triangle loss 1 is the smallest unit of enforcing cross-task consistency. Below we make two improving modifications on it via function 'separability' and 'perceptual losses'. + +# 3.1.1 Separability of Optimization Parameters + +The loss $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{triangle}}$ involves simultaneous training of two networks $f_{\mathcal{X}\mathcal{Y}_1}$ and $f_{\mathcal{X}\mathcal{Y}_2}$ , thus it is resource demanding. We show $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{triangle}}$ can be reduced to a 'separable' function [39] resulting in two terms that can be optimized independently. + +From triangle inequality we can derive: + +$$ +\left| f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - f _ {\mathcal {X} \mathcal {Y} _ {2}} (x) \right| \leq \left| f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - y _ {2} \right| + \left| f _ {\mathcal {X} \mathcal {Y} _ {2}} (x) - y _ {2} \right|, +$$ + +which after substitution in Eq. 1 yields: + +$$ +\mathcal {L} _ {\mathcal {X Y} _ {1} \mathcal {Y} _ {2}} ^ {\text {t r i a n g l e}} \leq \left| f _ {\mathcal {X Y} _ {1}} (x) - y _ {1} \right| + \left| f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X Y} _ {1}} (x) - y _ {2} \right| + 2 \left| f _ {\mathcal {X Y} _ {2}} (x) - y _ {2} \right|. \tag {2} +$$ + +The upper bound for $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{triangle}}$ in inequality 2 can be optimized in lieu of $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{triangle}}$ itself, as they both have the same minimizer. The terms of this bound include either $f_{\mathcal{X}\mathcal{Y}_1}$ + +or $f_{xy_2}$ , but not both, hence we now have a loss separable into functions of $f_{xy_1}$ or $f_{xy_2}$ , and they can be optimized independently. The part pertinent to the network $f_{xy_1}$ is: + +$$ +\mathcal {L} _ {\mathcal {X y} _ {1} \mathcal {Y} _ {2}} ^ {\text {s e p a r a t e}} \triangleq \left| f _ {\mathcal {X y} _ {1}} (x) - y _ {1} \right| + \left| f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X y} _ {1}} (x) - y _ {2} \right|, \tag {3} +$$ + +named separate, as we reduced the closed triangle objective $\mathcal{X}^{\mathcal{Y}_1} \triangle \mathcal{Y}_2$ in Eq. 1 to two equivalent separate path objectives $\mathcal{X} \to \mathcal{Y}_1 \to \mathcal{Y}_2$ and $\mathcal{X} \to \mathcal{Y}_2$ . The first term of Eq. 3 enforces the general correctness of predicting $y_1$ , and the second term enforces its consistency with $y_2$ domain. + +# 3.1.2 Reconfiguration into a "Perceptual Loss" + +Training $f_{xy_1}$ using the loss $\mathcal{L}_{xy_1y_2}^{separate}$ requires a training dataset with multi domain annotations for one input: $(x, y_1, y_2)$ . It also relies on availability of a perfect function $f_{y_1y_2}$ for mapping $y_1$ onto $y_2$ ; i.e. it demands $y_2 = f_{y_1y_2}(y_1)$ . We show how these two requirements can be reduced. + +Again, from triangle inequality we can derive: + +$$ +\begin{array}{l} \left| f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - y _ {2} \right| \leq \left| f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} (y _ {1}) \right| + \\ \left| f _ {y _ {1} y _ {2}} \left(y _ {1}\right) - y _ {2} \right|, \tag {4} \\ \end{array} +$$ + +which after substitution in Eq. 3 yields: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathcal {X} \mathcal {Y} _ {1} \mathcal {Y} _ {2}} ^ {\text {s e p a r a t e}} \leq | f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - y _ {1} | + | f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} (y _ {1}) | + \\ \left| f _ {y _ {1} y _ {2}} \left(y _ {1}\right) - y _ {2} \right|. \tag {5} \\ \end{array} +$$ + +Similar to the discussion for inequality 2, the upper bound in inequality 5 can be optimized in lieu of $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{separate}}$ as both have the same minimizer. As the last term is a constant w.r.t. $f_{\mathcal{X}\mathcal{Y}_1}$ , the final loss for training $f_{\mathcal{X}\mathcal{Y}_1}$ is: + +$$ +\mathcal {L} _ {\mathcal {X} \mathcal {Y} _ {1}, \mathcal {Y} _ {2}} ^ {\text {p e r c e p u r a l}} \triangleq | f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - y _ {1} | + | f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} (y _ {1}) |. \tag {6} +$$ + +Figure 4: Learning with and without cross-task consistency shown for a sample query. Using the notation $x \rightarrow y_1 \rightarrow Y$ , here $x$ is RGB image, $y_1$ is surface normals, and five domains in $Y$ are reshading, 3D curvature, texture edges (Sobel filter), depth, and occlusion edges. +![](images/769cee09468d0ddb40050f8d59eb22aff0703c35d36e51a1a448716b3ab6f31d.jpg) +Top row shows the results of standard training of $x \to y_1$ . After convergence of training, the predicted normals $(y_1)$ are projected onto other domains $(Y)$ which reveals various inaccuracies. This demonstrates such cross-task projections $y_1 \to Y$ can provide additional cues to training $x \to y_1$ . + +This term $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{perceptual}}$ no longer includes $y_{2}$ , hence it admits pair training data $(x,y_1)$ rather than triplets $(x,y_{1},y_{2})$ . Comparing $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{perceptual}}$ and $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{separate}}$ shows the modification boiled down to replacing $y_{2}$ with $f_{\mathcal{Y}_1\mathcal{Y}_2}(y_1)$ . This makes intuitive sense too, as $y_{2}$ is the match of $y_{1}$ in the $y_{2}$ domain. + +Ill-posed tasks and imperfect networks: If $f_{\mathcal{Y}_1\mathcal{Y}_2}$ is a noisy estimator, then $f_{\mathcal{Y}_1\mathcal{Y}_2}(y_1) = y_2 + noise$ rather than $f_{\mathcal{Y}_1\mathcal{Y}_2}(y_1) = y_2$ . Using a noisy $f_{\mathcal{Y}_1\mathcal{Y}_2}$ in $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{separate}}$ corrupts the training of $f_{\mathcal{X}\mathcal{Y}_1}$ since the second loss term does not reach 0 if $f_{\mathcal{X}\mathcal{Y}_1}(x)$ correctly outputs $y_1$ . That is in contrast to $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{percepalual}}$ where both terms have the same global minimum and are always 0 if $f_{\mathcal{X}\mathcal{Y}_1}(x)$ outputs $y_1 -$ even when $f_{\mathcal{Y}_1\mathcal{Y}_2}(y_1) = y_2 + noise$ . This is crucial since neural networks are almost never perfect estimators, e.g. due to lacking an optimal training process for them or potential ill-posedness of the task $y_1 \rightarrow y_2$ . Further discussion and experiments are available in supplementary material. + +Perceptual Loss: The process that led to Eq. 6 can be generally seen as using the loss $|g \circ f(x) - g(y)|$ instead of $|f(x) - y|$ . The latter compares $f(x)$ and $y$ in their explicit space, while the former compares them via the lens of function $g$ . This is often referred to as "perceptual loss" in superresolution and style transfer literature [19]–where two images are compared in the representation space of a network pretrained on ImageNet, rather than in pixel space. Similarly, the consistency constraint between the domains $y_1$ and $y_2$ in Eq. 6 (second term) can be viewed as judging the prediction $f_{xy_1}(x)$ against $y_1$ via the lens of the network $f_{xy_1y_2}$ ; here $f_{xy_1y_2}$ is a "perceptual loss" for training $f_{xy_1}$ . However, unlike the ImageNet-based perceptual loss [19], this function has the specific and interpretable job of enforcing consistency with another task. We also use multiple $f_{xy_1y_i}$ s + +Figure 5: Schematic summary of derived losses for $f_{\mathcal{X}\mathcal{Y}_1}(\mathbf{a})$ : $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{triangle}}$ (Eq.1). (b): $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{separate}}$ (Eq.3). (c): $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{perceptual}}$ (Eq.6). (d): $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1Y}^{\text{perceptual}}$ (Eq.7). +![](images/73f402aa87dbf985eacf241671ad2d2fc4b3df0b1192ea0dcea4db8d7a229c32.jpg) +Middle row shows the results of consistent training of $x \to y_1$ by leveraging $y_1 \to Y$ in the loss. The predicted normals are notably improved, especially in hard to predict fine-grained details (zoom into the yellow markers. Best seen on screen). +Bottom row provides the ground truth. See video examples at visualizations webpage. + +simultaneously which enforces consistency of predicting $y_{1}$ against multiple other domains (Sections 3.2 and 3.3). + +# 3.2. Consistency of $f_{\chi \mathcal{V}_1}$ with 'Multiple' Domains + +The derived $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{perceptual}}$ loss augments learning of $f_{\mathcal{X}\mathcal{Y}_1}$ with a consistency constraint against one domain $\mathcal{Y}_2$ . Straightforward extension of the same derivation to enforcing consistency of $f_{\mathcal{X}\mathcal{Y}_1}$ against multiple other domains (i.e. when $f_{\mathcal{X}\mathcal{Y}_1}$ is part of multiple simultaneous triangles) yields: + +$$ +\mathcal {L} _ {\mathcal {X Y} ^ {1}} ^ {\text {p e r c e p t u a l}} \triangleq | Y | \times | f _ {\mathcal {X Y} _ {1}} (x) - y _ {1} | + \sum_ {\mathcal {Y} _ {i} \in Y} | f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {i}} \circ f _ {\mathcal {X Y} _ {1}} (x) - f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {i}} (y _ {1}) |, \tag {7} +$$ + +where $Y$ is the set of domains with which $f_{\mathcal{X}\mathcal{Y}_1}$ must be consistent, and $|Y|$ is the cardinality of $Y$ . Notice that $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1\mathcal{Y}_2}^{\text{perceptual}}$ is a special case of $\mathcal{L}_{\mathcal{X}\mathcal{Y}_1Y}^{\text{perceptual}}$ where $Y = \{y_2\}$ . Fig. 5 summarizes the derivation of losses for $f_{\mathcal{X}\mathcal{Y}_1}$ . + +Fig. 4 shows qualitative results of learning $f_{xy_1}$ with and without cross-task consistency for a sample query. + +# 3.3. Beyond Triangles: Globally Consistent Graphs + +The discussion so far has provided losses for the cross-task consistent training of one function $f_{xy_1}$ with elementary triangle based units. We also assumed the functions $\mathcal{F}_y$ were given apriori. The more general multi-task setup is: given a large set of domains, we are interested in learning functions that map the domains onto each other in a globally cross-task + +consistent manner. This objective can be formulated using a graph $\mathcal{G} = (\mathcal{D},\mathcal{F})$ with nodes representing all of the domains $\mathcal{D} = (x\cup y)$ and edges being neural networks between them $\mathcal{F} = (\mathcal{F}_{\mathcal{X}}\cup \mathcal{F}_{\mathcal{Y}})$ ; see Fig.2(c). + +Extension to Arbitrary Paths: The transition from three domains to a large graph $\mathcal{G}$ enables forming more general consistency constraints using arbitrary-paths. That is, two paths with same endpoint should yield the same results - an example is shown in Fig.2(d). The triangle constraint in Fig.2(b,c) is a special and elementary case of the more general constraint in Fig.2(d), if paths with lengths 1 and 2 are picked for the green and blue paths. Extending the derivations done for a triangle in Sec. 3.1 to paths yields: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathcal {X} \mathcal {Y} _ {1} \mathcal {Y} _ {2} \dots \mathcal {Y} _ {k}} ^ {\text {p e r c e p t u a l}} = \left| f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - y _ {1} \right| + \\ \left| f _ {\mathcal {Y} _ {k - 1} \mathcal {Y} _ {k}} \circ \dots \circ f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} \circ f _ {\mathcal {X} \mathcal {Y} _ {1}} (x) - f _ {\mathcal {Y} _ {k - 1} \mathcal {Y} _ {k}} \circ \dots \circ f _ {\mathcal {Y} _ {1} \mathcal {Y} _ {2}} (y _ {1}) \right|, \tag {8} \\ \end{array} +$$ + +which is the loss for training $f_{\mathcal{X}\mathcal{Y}_1}$ using the arbitrary consistency path $\mathcal{X} \to \mathcal{Y}_1 \to \mathcal{Y}_2 \dots \to \mathcal{Y}_k$ with length $k$ (full derivation provided in supplementary material). Notice that Eq. 6 is a special case of Eq. 8 if $k = 2$ . Equation 8 is particularly useful for incomplete graphs; if the function $y_1 \to y_k$ is missing, consistency between domains $y_1$ and $y_k$ can still be enforced via transitivity through other domains using Eq. 8. + +Also, extending Eq. 8 to multiple simultaneous paths (as in Eq. 7) by summing the path constraints is straightforward. + +Global Consistency Objective: We define reaching global cross-task consistency for graph $\mathcal{G}$ as satisfying the consistency constraint for all feasible paths in $\mathcal{G}$ . We can write the global consistency objective for $\mathcal{G}$ as $\mathcal{L}_{\mathcal{G}} = \sum_{p \in \mathcal{P}} \mathcal{L}_p^{\text{perceptual}}$ , where $p$ represents a path and $\mathcal{P}$ is the set of all feasible paths in $\mathcal{G}$ . + +Optimizing the objective $\mathcal{L}_{\mathcal{G}}$ directly is intractable as it would require simultaneous training of all networks in $\mathcal{F}$ with a massive number of consistency paths. In Alg.1 we devise a straightforward training schedule for an approximate optimization of $\mathcal{L}_{\mathcal{G}}$ . This problem is similar to inference in graphical models, where one is interested in marginal distribution of unobserved nodes given some observed nodes by passing "messages" between them through the graph until convergence. As exact inference is usually intractable for unconstrained graphs, often an approximate message passing algorithm with various heuristics is used. + +Algorithm 1 selects one network $f_{ij} \in \mathcal{F}$ to be trained, selects consistency path(s) $p \in \mathcal{P}$ for it, and trains $f_{ij}$ with $p$ for a fixed number of steps using loss 8 (or its multi path version if multiple paths selected). This is repeated until all networks in $\mathcal{F}$ satisfy a convergence criterion. + +A number of choices for the selection criterion in SelectNetwork and SelectPath is possible, including round-robin and random selection. While we did not observe a significant difference in the final results, we achieved the best results + +Algorithm 1: Globally Cross-Task Consistent Learning of Networks $\mathcal{F}$ +Result: Trained edges $\mathcal{F}$ of graph $\mathcal{G}$ +1 Train each $f\in \mathcal{F}$ independently. $\triangleright$ initialization by standard direct training. +2 for $k\gets 2$ to L do +3 while LossConvergence(F) not met do +4 $\begin{array}{r}f_{ij}\leftarrow SelectNetwork(\mathcal{F})\triangleright$ selects target network to be trained. +5 $p\gets SelectPath(f_{ij},k,\mathcal{P})\triangleright$ selects a feasible consistency path for $f_{ij}$ with maximum length $k$ from $\mathcal{P}$ . +6 optimize $\mathcal{L}_{ijp}^{\mathrm{perceptual}}\triangleright$ trains $f_{ij}$ using path constraint $p$ in loss 8. +7 end +8 end + +using maximal violation criterion: at each step select the network and path with the largest loss8. Also, Alg.1 starts from shorter paths and progressively opens up to longer ones (up to length $L$ ) only after shorter paths have converged. This is based on the observation that the value of short and long paths in terms of enforcing cross-task consistency overlap, while shorter paths are computationally cheaper8. For the same reason, all of the networks are initialized by training using the standard direct loss (Op.1 in Alg.1) before progressively adding consistency terms. + +Finally, Alg.1 does not distinguish between $\mathcal{F}_x$ and $\mathcal{F}_x$ and can be used to train them all in the same pool. This means the selected path $p$ may include networks not fully converged yet. This is not an issue in practice, because, first, all networks are pre-trained with their direct loss (Op.1 in Alg.1) thus they are not wildly far from their convergence point. Second, the perceptual loss formulation makes training $f_{ij}$ robust to imperfections in functions in $p$ (Sec. 3.1.2). However, as practical applications primarily care about $\mathcal{F}_x$ , rather than $\mathcal{F}_y$ , one can first train $\mathcal{F}_y$ to convergence using Alg.1, then start the training of $\mathcal{F}_x$ with well trained and converged networks $\mathcal{F}_y$ . We do the latter in our experiments. + +Please see supplementary material for how to normalize and balance the direct and consistency loss terms, as they belong to different domains with distinct numerical properties. + +# 4. Consistency Energy + +We quantify the amount of cross-task consistency in the system using an energy-based quantity [26] called Consistency Energy. For a single query $x$ and domain $y_{k}$ , the consistency energy is defined to be the standardized average of pairwise inconsistencies: + +$$ +\operatorname {E n e r g y} _ {\mathcal {Y} _ {k}} (x) \triangleq \frac {1}{| \mathcal {Y} | - 1} \sum_ {\mathcal {Y} _ {i} \in \mathcal {Y}, i \neq k} \frac {| f \mathcal {Y} _ {i} \mathcal {Y} _ {k} \circ f \mathcal {X} \mathcal {Y} _ {i} (x) - f \mathcal {X} \mathcal {Y} _ {k} (x) | - \mu_ {i}}{\sigma_ {i}}, \tag {9} +$$ + +where $\mu_{i}$ and $\sigma_{i}$ are the average and standard deviation of $|f_{y_i y_k} \circ f_{x y_i}(x) - f_{x y_k}(x)|$ over the dataset. Eq. 9 can be computed per-pixel or per-image by average over its pixels. Intuitively, the energy can be thought of as the amount of variance in predictions in the lower row of Fig. 3 – the higher the variance, the higher the inconsistency, and the higher the energy. The consistency energy is an intrinsic quantity of the system and needs no ground truth or supervision. + +![](images/6207ac749040138a45091e2628be31061f27ff8ada6295a10d982bf4d8fdfeca.jpg) +Figure 6: Qualitative results of predicting multiple domains along with the pixel-wise Consistency Energy. The top queries are from the Taskonomy dataset's test set. The results of networks trained with consistency are more accurate, especially in fine-grained regions (zoom into the yellow markers), and more correlated across different tasks. The bottom images are external queries (no ground truth available) demonstrating the generalization and robustness of consistency networks to external data. Comparing the energy against a prediction domain (e.g. normals) shows that energy often correlates with error. More examples are provided in the project page, and a live demo for user uploaded images is available at the demo page. External Queries: Bedroom in Arles, Van Gogh (1888); Cotton Mill Girl, Lewis Hine (1908); Chernobyl Pripyat Abandoned School (c. 2009). [best seen on screen] + +![](images/921e7adba60e29dbb37b19f09d48cca9eae23867102d9569676b747c1943f725.jpg) + +In Sec. 5.3, we show this quantity turns out to be quite informative as it can indicate the reliability of predictions (useful as a confidence/uncertainty metric) or a shift in the input domain (useful for domain adaptation). This is based on the fact that if the query is from the same data distribution as the training and is unchallenging, all inference paths of a system trained with consistency path constraints work well and yield similar results (as they were trained to); whereas under a distribution shift or for a challenging query, different paths break in different ways resulting in dissimilar predictions. In other words, usually correct predictions are consistent while mistakes are inconsistent. (Plots 9(b), 9(c), 9(d).) + +# 5. Experiments + +The evaluations are organized to demonstrate the proposed approach yields predictions that are I. more consistent (Sec.5.1), II. more accurate (Sec.5.2), and III. more generalizable to out-of-training-distribution data (Sec.5.4). We also IV. quantitatively analyze the Consistency Energy and report its utilities (Sec.5.3). + +Datasets: We used the following datasets in the evaluations: + +Taskonomy [45]: We adopted Taskonomy as our main training dataset. It includes 4 million real images of indoor scenes with multi-task annotations for each image. The experiments were performed using the following 10 domains from the dataset: RGB images, surface normals, principal curvature, depth (zbuffer), reshading, 3D (occlusion) edges, 2D (Sobel) texture edges, 3D keypoints, 2D keypoints, semantic segmentation. The tasks were selected to cover 2D, 3D, and semantic domains and have sensor-based/semantic ground truth. We report results on the test set. + +Replica[40] has high resolution 3D ground truth and enables more reliable evaluations of fine-grained details. We test on 1227 images from Replica (no training), besides Taskonomy test data. + +CocoDoom [27] contains synthetic images from the Doom video game. We use it as one of the out-of-training-distribution datasets. + +ApolloScape [16] contains real images of outdoor driving scenes. We use it as another out-of-training-distribution dataset. + +NYU [37]: We also evaluated on NYUv2. The findings are similar to those on Taskonomy and Replica (in supplementary material). + +Architecture & Training Details: We used a UNet [34] backbone architecture. All networks in $\mathcal{F}_{\chi}$ and $\mathcal{F}_{\mathcal{V}}$ have a similar architecture. The networks have 6 down and 6 up sampling blocks and were trained using AMSGrad [33] and Group Norm [42] with learning rate $3 \times 10^{-5}$ , weight decay $2 \times 10^{-6}$ , and batch size 32. Input and output images were linearly scaled to the range $[0,1]$ and resized down to $256 \times 256$ . We used $\ell_{1}$ as the norm in all losses and set the max path length $L = 3$ . + +Baselines: The main baseline categories are described below. To prevent confounding factors, our method and all baselines were implemented using the same UNet network when feasible and were re-trained on Taskonomy dataset. + +Baseline UNet (standard independent learning) is the main baseline. It is identical to consistency models in all senses, except being trained with only the direct loss and no consistency terms. + +Multi-task learning: A network with one shared encoder and multiple decoders each dedicated to a task, similar to [21]. + +Cycle-based consistency, e.g.[50], is a way of enforcing consistency requiring a bijection between domains. This baseline is the special case of the triangle in Fig.2(b) by setting $f_{xy_2} = identity$ . + +Baseline perceptual loss network uses frozen random (Gaussian weight) networks as $\mathcal{F}_{\mathcal{V}}$ , rather than training them to be cross-task functions. This baseline would show if the improvements were owed to the priors in the architecture of constraint networks, rather than them executing cross-task consistency constraints. + +GAN-based image translation: We used Pix2Pix [17]. + +Blind guess: A query-agnostic statistically informed guess computed from data for each domain (visuls in supplementary). It shows what can be learned from general dataset regularities. [45] + +![](images/d22d7ee365960cbfdb5d9f9cda8738022e3f2da8bccfb1337a02aa1ea58918bc.jpg) +Figure 7: Learning with cross-task consistency vs various baselines compared over surface normals. Queries are from Taskonomy dataset (top) or external data (bottom). More examples are provided in project page, and a live demo for user uploaded images is available at demo page. [best seen on screen] + +
SetupMethodReplica DatasetTaskonomy Dataset
NormalsDepthreShadingNormalsDepthreShadingSemantic Segm.
Perceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectPerceptual Err.DirectX-Entropy (↓)
Depth reShadeε1Err.Norm. reShadeε1Err.Norm.Norm.Depthε1Err.Depth reShadeCuv.Edge(2D)ε1Err.Norm.edgeEdge(2D)ε1Err.Norm.edgeX-Entropy (↓)
Blind Guess4.7533.3116.0222.2319.944.8115.745.1416.457.3938.113.9112.0517.7722.3727.277.9612.777.0719.967.143.5312.6224.85
Taskonomy Networks3.7311.076.5518.0615.393.728.703.8511.437.1922.683.6810.707.5418.8220.836.6514.104.5511.724.693.5411.1916.58
Multi-Task5.5822.116.0315.3016.142.447.243.3610.328.7827.323.6510.167.0717.1819.557.5413.672.819.193.543.5610.7511.61
GeoNet (original)6.2319.347.4813.8814.034.01×××7.7127.353.329.099.5815.4418.734.0310.784.07×××××××
Cycle Consistency5.6522.397.138.8130.333.8410.268.68
Baseline Perceptual Loss4.8815.344.998.5923.983.4110.016.17
Pix2Pix4.5219.037.708.1226.233.8310.339.40
Baseline UNet (ε1)4.6913.154.9610.4712.991.996.902.749.558.1720.943.419.985.9513.6215.687.3112.612.279.583.383.7810.8510.450.246
GeoNet (updated)4.6212.794.7010.4712.751.83×××8.1820.843.409.995.9113.7715.767.5212.672.26××××××
X-Task Consistency2.079.994.807.0111.211.635.501.969.224.3212.153.299.506.089.4612.663.619.822.297.132.513.289.3810.520.237
0.25% Data: Baseline5.6521.767.618.8626.913.7810.318.17
0.25% Data: Consistency2.4112.267.285.0715.963.749.939.19
+ +Table 1: Quantitative Evaluation of Cross-Task Consistent Learning vs Baselines. Results are reported on Replica and Taskonomy Datasets for four prediction tasks (normals, depth, reshading, pixel-wise semantic labeling) using 'Direct' and 'Perceptual' error metrics. The Perceptual metrics evaluate the target prediction in another domain (e.g., the leftmost column evaluates the depth inferred out of the predicted normals). Bold marks the best-performing method. If more than one value is bold, their performances were statistically indistinguishable from the best, according to 2-sample paired t-test $\alpha = 0.01$ . Learning with consistency led to improvements with large margins in most columns. (In all tables, $\ell$ norm values are multiplied by 100 for readability. Methods that cannot be run for a given target are denoted by $\times$ .) + +GeoNet [32] is a task-specific consistency method analytically curated for depth and normals. This baseline shows how closely the task-specific consistency methods based on known analytical relationships perform vs the proposed generic data-driven method. The "original" and "updated" variants represent original authors' released networks and our re-implemented and re-trained version. + +# 5.1. Consistency of Predictions + +Fig.9(a) (blue) shows the amount of inconsistency in test set predictions (Consistency Energy) successfully decreases over the course of training. The convergence point of the network trained with consistency is well below baseline independent learning (orange) and multi-task learning (green)—which shows consistency among predictions does not naturally emerge in either case without explicit constraining. + +# 5.2. Accuracy of Predictions + +Figures 6 and 7 compare the prediction results of networks trained with cross-task consistency against the baselines in different domains. The improvements are considerable particularly around the difficult fine-grained details. + +Quantitative evaluations are provided in Tab. 1 for Replica dataset and Taskonomy datasets on depth, normal, reshading, and pixel-wise semantic prediction tasks. Learning with consistency led to large improvements in most of the setups. As most of the pixels in an image belong to easy to predict regions governed by the room layout (e.g. ceiling, walls), the + +standard pixel-wise error metrics (e.g. $\ell_1$ ) are dominated by them and consequently insensitive to fine-grained changes. Thus, besides standard Direct metrics, we report Perceptual error metric (e.g. normal $\rightarrow$ curvature) that evaluate the same prediction, but with a non-uniform attention to pixel properties. $^9$ Each perceptual error provides a different angle, and the optimal results would have a low error for all metrics. + +Tab. 1 also includes evaluation of the networks when trained with little data (0.25% subset of Taskonomy dataset), which shows the consistency constraints are useful under low-data regime as well. + +We adopted normals as the canonical task for more extensive evaluations, due to its practical value and abundance of baselines. The conclusions remained the same regardless. + +# 5.3. Utilities of Consistency Energy + +Below we quantitatively analyze the Consistency Energy. The energy is shown (per-pixel) for sample queries in Fig. 6. + +Consistency Energy as a Confidence Metric: The plot 9(b) shows the energy of predictions has a strong positive correlation with the error computed using ground truth (Pearson corr. 0.67). This suggests the energy can be adopted for confidence quantification and handling uncertainty. This experiment was done on Taskonomy test set. + +![](images/66eee9ea85f4fa8102596c3e2334736484f24a6383b80a7066bb96dd6f17d943.jpg) +Figure 8: Error with Increasing (Smooth) Domain Shift. The network trained with consistency is more robust to the shift. + +
Novel DomainError (Post-Adaption)Error (Pre-Adaptation)
# imagesConsistencyBaselineConsistencyBaseline
Gaussian blur (Taskonomy)12817.4 (+14.7%)20.446.2 (+12.8%)53.0
1622.3 (+8.6%)24.4
CocoDoom12818.5 (+19.2%)22.954.3 (+15.8%)64.5
1627.1 (+24.5%)35.9
ApolloScape840.5 (+11.9%)46.055.8 (+5.5%)59.1
+ +Table 2: Domain generalization and adaptation on CocoDoom, ApolloScape, and Taskonomy blur data. Networks trained with consistency show better generalization to new domains and a faster adaptation with little data. (relative improvement in parentheses) + +![](images/6c0fe11de91c187368ec340844b4cd3aafeff0f86d67d379e00208aeef0e1552.jpg) +(a) Energy During Training + +![](images/0d075ba51b0d433da2a2fae20a5cdac359b9c31319845f4ce2656cda9dac6a00.jpg) +(b) Energy vs Error + +![](images/ba3acc2a5d71ee8aa124a2bdc009d12d603e9d622577c6f90edbe95a01ca4e9f.jpg) +(c)Energy vs Discrete Domain Shift (d) Energy vs Continuous Domain Shift +Figure 9: Analyses of Consistency Energy. + +![](images/1ee0ee5ab044a0ceef49e11606344c3432004555b6f6ee3113f7fae9de23feff.jpg) + +Consistency Energy as a Domain Shift Detector: Plot 9(c) shows the energy distribution of in-distribution (Taskonomy) and out-of-distribution datasets (ApolloScape, CocoDoom). Out-of-distribution datapoints have notably higher energy values, which suggests that energy can be used to detect anomalous samples or domain shifts. Using the per-image energy value to detect out-of-distribution images achieved ROC-AUC=0.95; the out-of-distribution detection method OC-NN [3] scored 0.51. + +Plot 9(d) shows the same concept as 9(c) (energy vs domain shift), but when the shift away from the training data is smooth. The shift was done by applying a progressively stronger Gaussian blur with kernel size 6 on Taskonomy test images. The plot also shows the error computed using ground truth which has a pattern similar to the energy. + +We find the reported utilities noteworthy as handling uncertainty, domains shifts, and measuring prediction confidence in neutral networks are open topics of research [29, 11] with critical values in, e.g. active learning [35], real-world decision making [20], and robotics [31]. + +# 5.4. Generalization & Adaptation to New Domains + +To study: I. how well the networks generalize to new domains without any adaptation and quantify their resilience, and II. how efficiently they can adapt to a new domain given a few training examples by fine-tuning, we test the networks trained on Taskonomy dataset on various new domains. + +In interest of space, we defer the details to the supplementary and provide the results in Fig. 8 and Tab. 2. Networks trained with consistency generally show higher resilience + +w.r.t. domain shifts and better adaptation with little data. + +Supplementary Material: We defer additional discussions and experiments, particularly analyzing different aspects of the optimization, stability analysis of the experimental trends, and proving qualitative results at scale to the supplementary material and the project page. + +# 6. Conclusion and Limitations + +We presented a general and data-driven framework for augmenting standard learning with cross-task consistency. The evaluations showed learning with cross-task consistency fits the data better yielding more accurate predictions and leads to models with improved generalization. The Consistency Energy was found to be an informative intrinsic quantity with utilities toward confidence estimation and domain shift detection. We briefly discuss some of the limitations: + +Path Ensembles: we used the various inference paths only as a way of enforcing consistency. Aggregation of multiple (comparably weak) inference paths into a single strong estimator (e.g. in a manner similar to boosting) is a promising direction that this paper did not address. + +Categorical/Low-Dimensional Tasks: We primarily experimented with pixel-wise tasks. Classification tasks, and generally tasks with low-dimensional outputs, will be interested to experiment with, especially given the more severely ill-posed cross-task relationships they induce. + +Unlabeled/Unpaired Data: The current framework requires labeled training data. Extending the concept to unlabeled/unpaired data, e.g. as in [50], remains open. + +**Optimization Limits:** The improvements gained by incorporating consistency are bounded by the success of the available optimization techniques, as addition of consistency constrains at times makes the optimization job harder. Also, implementing cross-task functions using neural networks makes them subject to certain output artifacts similar to those seen in image synthesis with neural networks. + +Adversarial Robustness: Lastly, if learning with cross-task consistency indeed reduces the tendency of neural networks to learn surface statistics [18] (Sec. 1), studying its implications in defenses against adversarial attacks will be valuable. + +Acknowledgement: We thank Teresa Yeo and Oğuzhan Kar. This work was supported by ONR MURI (N00014-14-1-0671), an Amazon AWS Machine Learning Award, Google Cloud, and TRI. Toyota Research Institute ("TRI") provided funds to assist the authors with their research but this article solely reflects the opinions and conclusions of its authors and not TRI or any other Toyota entity. + +# References + +[1] Mikel Artetxe and Holger Schwenk. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. CoRR, abs/1812.10464, 2018. 2 +[2] Richard W. Brislin. Back-translation for cross-cultural research. Journal of Cross-Cultural Psychology, 1(3):185-216, 1970. 2 +[3] Raghavendra Chalopathy, Aditya Krishna Menon, and Sanjay Chawla. Anomaly detection using one-class neural networks. arXiv preprint arXiv:1802.06360, 2018. 8 +[4] Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8789-8797, 2018. 2 +[5] Luca Cosmo, Emanuele Rodola, Andrea Albarelli, Facundo Memoli, and Daniel Cremers. Consistent partial matching of shape collections via sparse modeling. In Computer Graphics Forum, volume 36, pages 209-221. Wiley Online Library, 2017. 2 +[6] Debidatta Dwibedi, Yusuf Aytar, Jonathan Tompson, Pierre Sermanet, and Andrew Zisserman. Temporal cycle-consistency learning. CoRR, abs/1904.07846, 2019. 2 +[7] Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. Understanding back-translation at scale. CoRR, abs/1808.09381, 2018. 2 +[8] Ravi Garg, Vijay Kumar BG, Gustavo Carneiro, and Ian Reid. Unsupervised cnn for single view depth estimation: Geometry to the rescue. In European Conference on Computer Vision, pages 740-756. Springer, 2016. 2 +[9] Clément Godard, Oisin Mac Aodha, and Gabriel J Brostow. Unsupervised monocular depth estimation with left-right consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 270-279, 2017. 2 +[10] V. Guillemin and A. Pollack. Differential Topology. Mathematics Series. Prentice-Hall, 1974. 2 +[11] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks, 2017. 8 +[12] Aaron Hertzmann, Charles E Jacobs, Nuria Oliver, Brian Curless, and David H Salesin. Image analogies. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pages 327-340. ACM, 2001. 2 +[13] Steven Hickson, Karthik Raveendran, Alireza Fathi, Kevin Murphy, and Irfan Essa. Floors are flat: Leveraging semantics for real-time surface normal prediction. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 0–0, 2019. 2 +[14] 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. CoRR, abs/1711.03213, 2017. 2 +[15] Qi-Xing Huang and Leonidas Guibas. Consistent shape maps via semidefinite programming. In Proceedings of the Eleventh Eurographics/ACMSIGGRAPH Symposium on Geometry Processing, SGP '13, pages 177-186, Aire-la-Ville, Switzerland, Switzerland, 2013. Eurographics Association. 2 +[16] Xinyu Huang, Xinjing Cheng, Qichuan Geng, Binbin Cao, Dingfu Zhou, Peng Wang, Yuanqing Lin, and Ruigang Yang. + +The apolloscape dataset for autonomous driving. CoRR, abs/1803.06184, 2018. 6 +[17] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-image translation with conditional adversarial networks. CoRR, abs/1611.07004, 2016. 2, 6 +[18] Jason Jo and Yoshua Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017. 1, 8 +[19] Justin Johnson, Alexandre Alahi, and Fei-Fei Li. Perceptual losses for real-time style transfer and super-resolution. CoRR, abs/1603.08155, 2016. 4 +[20] Mykel J. Kochenderfer, Christopher Amato, Girish Chowdhary, Jonathan P. How, Hayley J. Davison Reynolds, Jason R. Thornton, Pedro A. Torres-Carrasquillo, N. Kemal Üre, and John Vian. Decision Making Under Uncertainty: Theory and Application. The MIT Press, 1st edition, 2015. 8 +[21] Iasonas Kokkinos. Ethernet: Training a 'universal' convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. CoRR, abs/1609.02132, 2016. 2, 6 +[22] Daphne Koller and Nir Friedman. Probabilistic Graphical Models: Principles and Techniques - Adaptive Computation and Machine Learning. The MIT Press, 2009. 2 +[23] Uday Kusupati, Shuo Cheng, Rui Chen, and Hao Su. Normal assisted stereo depth estimation. arXiv preprint arXiv:1911.10444, 2019. 2 +[24] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pages 6402-6413, 2017. 2 +[25] Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. CoRR, abs/1901.07291, 2019. 2 +[26] Yann LeCun, Sumit Chopra, and Raia Hadsell. A tutorial on energy-based learning. 2006. 5 +[27] Aravindh Mahendran, Hakan Bilen, João F. Henriques, and Andrea Vedaldi. Researchdoom and cocodoom: Learning computer vision with games. CoRR, abs/1610.02431, 2016. 6 +[28] Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014. 2 +[29] Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, D Sculley, Sebastian Nowozin, Joshua V. Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift, 2019. 8 +[30] Maks Ovsjanikov, Mirela Ben-Chen, Justin Solomon, Adrian Butscher, and Leonidas Guibas. Functional maps: A flexible representation of maps between shapes. ACM Trans. Graph., 31(4):30:1-30:11, July 2012. 2 +[31] F Proctor, Marek Franaszek, and J Michaloski. Tolerances and uncertainty in robotic systems. In ASME 2017 International Mechanical Engineering Congress and Exposition. American Society of Mechanical Engineers Digital Collection, 2017. 8 +[32] Xiaojuan Qi, Renjie Liao, Zhengzhe Liu, Raquel Urtasun, and Jiaya Jia. Geonet: Geometric neural network for joint depth and surface normal estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 283-291, 2018. 2, 7 + +[33] Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. arXiv preprint arXiv:1904.09237, 2019. 6 +[34] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. CoRR, abs/1505.04597, 2015. 6 +[35] Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint arXiv:1708.00489, 2017. 8 +[36] Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features off-the-shelf: an astounding baseline for recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 806-813, 2014. 2 +[37] Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor Segmentation and Support Inference from RGBD Images, pages 746-760. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. 6 +[38] Trevor Standley, Amir R. Zamir, Dawn Chen, Leonidas Guibas, Jitendra Malik, and Silvio Savarese. Which Tasks Should Be Learned Together in Multi-task Learning? arXiv e-prints, page arXiv:1905.07553, May 2019. 2 +[39] James Stewart. Essential calculus: Early transcendents. Cengage Learning, 2012. 3 +[40] Julian Straub, Thomas Whelan, Lingni Ma, Yufan Chen, Erik Wijmans, Simon Green, Jakob J Engel, Raul Mur-Artal, Carl Ren, Shobhit Verma, et al. The replica dataset: A digital replica of indoor spaces. arXiv preprint arXiv:1906.05797, 2019. 6 +[41] Xiaolong Wang, Allan Jabri, and Alexei A. Efros. Learning correspondence from the cycle-consistency of time. CoRR, abs/1903.07593, 2019. 2 +[42] Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European Conference on Computer Vision (ECCV), pages 3-19, 2018. 6 +[43] Dan Xu, Wanli Ouyang, Xiaogang Wang, and Nicu Sebe. Padnet: Multi-tasks guided prediction-and-distillation network for simultaneous depth estimation and scene parsing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 675-684, 2018. 2 +[44] Wei Yin, Yifan Liu, Chunhua Shen, and Youliang Yan. Enforcing geometric constraints of virtual normal for depth prediction. In Proceedings of the IEEE International Conference on Computer Vision, pages 5684-5693, 2019. 2 +[45] Amir R Zamir, Alexander Sax, William Shen, Leonidas J Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling task transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3712-3722, 2018. 2, 6 +[46] Yinda Zhang, Shuran Song, Ersin Yumer, Manolis Savva, Joon-Young Lee, Hailin Jin, and Thomas Funkhouser. Physically-based rendering for indoor scene understanding using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5287–5295, 2017. 2 +[47] Yu Zhang and Qiang Yang. A survey on multi-task learning. CoRR, abs/1707.08114, 2017. 2 + +[48] Zaiwei Zhang, Zhenxiao Liang, Lemeng Wu, Xiaowei Zhou, and Qixing Huang. Path-invariant map networks. CoRR, abs/1812.11647, 2018. 2 +[49] Tinghui Zhou, Philipp Kähenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A. Efros. Learning dense correspondence via 3d-guided cycle consistency. CoRR, abs/1604.05383, 2016. 2 +[50] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. CoRR, abs/1703.10593, 2017. 2, 6, 8 +[51] Yuliang Zou, Zelun Luo, and Jia-Bin Huang. Df-net: Unsupervised joint learning of depth and flow using cross-task consistency. In Proceedings of the European Conference on Computer Vision (ECCV), pages 36-53, 2018. 2 \ No newline at end of file diff --git a/robustlearningthroughcrosstaskconsistency/images.zip b/robustlearningthroughcrosstaskconsistency/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..763094db24075b20e6225b3253d4a22e5d72d01e --- /dev/null +++ b/robustlearningthroughcrosstaskconsistency/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:403c89c72790b73d63e0abed92b16d71fc5534f318b2e19313c1cfd520de9758 +size 737257 diff --git a/robustlearningthroughcrosstaskconsistency/layout.json b/robustlearningthroughcrosstaskconsistency/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..66ada7de048c9928122065109cd268c6f3f9e516 --- /dev/null +++ b/robustlearningthroughcrosstaskconsistency/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b17fb04d9a61dbea331ab14f6ce46443aebeee1fe42bcc2155d0317668ade2d +size 567130 diff --git a/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_content_list.json b/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ec8db1216275adc8710707eb68a3d8f19834e0d8 --- /dev/null +++ b/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:161f6ac82070ffd938186318f7721e16e4b68280c9bba248576ca77b3d99fc4f +size 84208 diff --git a/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_model.json b/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bf69cb6412220c28a6d28804ceac527ad8a94ea8 --- /dev/null +++ b/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13ddff91bef501ad04168c9a7f5bb1e8875d864e570143b8c3f46e1f0d9e90cb +size 100329 diff --git a/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_origin.pdf b/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c42efd60ae0b04cd76b76e54bc0ce8e121c5e13e --- /dev/null +++ b/robustnessguaranteesfordeepneuralnetworksonvideos/2d5d4e66-1bff-4da4-bd9d-7cc135247b09_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daac53133dd079fe4004049af6bfa747388cd19f5a62e82471d71d3c5b8140b0 +size 1606293 diff --git a/robustnessguaranteesfordeepneuralnetworksonvideos/full.md b/robustnessguaranteesfordeepneuralnetworksonvideos/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0e6dc7e59ad2ac0eec1a55f04fc2839072eadd07 --- /dev/null +++ b/robustnessguaranteesfordeepneuralnetworksonvideos/full.md @@ -0,0 +1,354 @@ +# Robustness Guarantees for Deep Neural Networks on Videos + +Min Wu and Marta Kwiatkowska +Department of Computer Science, University of Oxford, UK +{min.wu, marta.kwiatkowska@cs.ox.ac.uk} + +# Abstract + +The widespread adoption of deep learning models places demands on their robustness. In this paper, we consider the robustness of deep neural networks on videos, which comprise both the spatial features of individual frames extracted by a convolutional neural network and the temporal dynamics between adjacent frames captured by a recurrent neural network. To measure robustness, we study the maximum safe radius problem, which computes the minimum distance from the optical flow sequence obtained from a given input to that of an adversarial example in the neighbourhood of the input. We demonstrate that, under the assumption of Lipschitz continuity, the problem can be approximated using finite optimisation via discretising the optical flow space, and the approximation has provable guarantees. We then show that the finite optimisation problem can be solved by utilising a two-player turn-based game in a cooperative setting, where the first player selects the optical flows and the second player determines the dimensions to be manipulated in the chosen flow. We employ an anytime approach to solve the game, in the sense of approximating the value of the game by monotonically improving its upper and lower bounds. We exploit a gradient-based search algorithm to compute the upper bounds, and the admissible $A^*$ algorithm to update the lower bounds. Finally, we evaluate our framework on the UCF101 video dataset. + +# 1. Introduction + +Deep neural networks (DNNs) have been developed for a variety of tasks, including self-driving cars, malicious software classification, and abnormal network activity detection. While the accuracy of neural networks has significantly improved, matching human cognitive perception, they are susceptible to adversarial examples. An adversarial example is an input which, whilst initially classified correctly, is misclassified with a slight, often imperceptible, perturbation. Robustness of neural networks has been an active topic of investigation, and a number of approaches have been proposed (see Related Work below.) However, most + +existing works focus on robustness of neural networks on image classification problems, where convolutional neural networks (CNNs) are sufficient. One assumption that CNNs rely on is that inputs are independent of each other, and they are unable to accept a sequence of input data when the final output is dependent on intermediate outputs. In reality, though, tasks often contain sequential data as inputs, for instance, in machine translation [23], speech/handwriting recognition [9, 10, 6], and protein homology detection [12]. To this end, recurrent neural networks (RNNs) come into play. For RNNs, the connections between neurons form a directed graph along a temporal sequence, which captures temporal dynamic behaviours. Unlike CNNs, RNNs can use the internal state (memory) to process sequential inputs. + +In this work, we study robustness guarantees for neural networks, including CNNs and RNNs, on videos. Video classification is challenging because it comprises both the spatial features on each individual frames, which can be extracted by CNNs, as well as the temporal dynamics between neighbouring frames, which can be captured by RNNs. Specifically, we develop a methodology for evaluating robustness of videos based on the notion of maximum safe radius (or dually, minimum adversarial distortion [28]), which captures the maximum allowed magnitude of a perturbation. Our method is based on a game-based approach of [31] and provides guarantees against perturbations up to a given magnitude. We compute upper and lower bounds of the maximum safe radius, and demonstrate their convergence trend on the UCF101 video dataset. + +Related work Robustness of neural networks has been mainly studied in the context of image classification, and, to the best of our knowledge, very few works address robustness guarantees for videos. We review only approaches most relevant to our approach. Early methods evaluate the robustness of networks by checking whether they are vulnerable to adversarial attacks, which attempt to craft a perturbation imposed on the input so that it is misclassified by a well-trained network. In the computer vision and security communities, various attack techniques have been developed, such as the limited-memory Broyden-Fletcher-Goldfarb-Shanno algorithm [24], the fast gradient + +sign method [8] and its extended Jacobian saliency map based attack [19], as well as the optimisation-based C&W attack [2]. Nevertheless, adversarial attacks cannot provide guarantees. To this end, various verification approaches for neural networks emerged in the formal methods community. These include constraint solving tools Reluplex [16] and Planet [4]; mixed integer linear programming method Sherlock [3]; the $\mathrm{Al}^2$ approach [7] involving abstract interpretation; algorithms utilising linear approximation such as FastLin/FastLip [29] and Crown [32]; and also search-based DLV [14] and game-based tool DeepGame [31]. + +The above approaches evaluate the robustness of feedforward networks, but we are interested in providing guarantees for both convolutional and recurrent layers with time-series inputs. Although there are some adversarial attacks against RNNs [20] and videos [15, 27], verification approaches are rare. For example, POPQORN [17] employs the linear approximation method, bounding the network output by two linear functions in terms of input; and Wang et al. [25] extract deterministic finite automata from RNNs as the oracle and use them to evaluate adversarial accuracy. Our approach instead draws on DeepGame [31], where a game-based verification framework is proposed for computing the maximum safe radius for feedforward networks through discretising the input space via Lipschitz continuity [11], but in this work we are able to handle CNN + RNN architectures and video inputs. + +# 2. Preliminaries + +# 2.1. Deep neural networks + +Let $\mathcal{N}$ be a neural network with a set of classes $C$ . Given an input $\pmb{v}$ and a class $c \in C$ , we use $\mathcal{N}(\pmb{v}, c)$ to denote the confidence of $\mathcal{N}$ believing that $\pmb{v}$ is in class $c$ . We work with the Softmax logit value of the last layer, but the methods can be adapted to the probability value after normalisation. Thus, $\mathcal{N}(\pmb{v}) = \arg \max_{c \in C} \mathcal{N}(\pmb{v}, c)$ is the class into which $\mathcal{N}$ classifies $\pmb{v}$ . Moreover, as $\mathcal{N}$ in this work can have convolutional and recurrent layers, we let $\mathcal{N}_C$ denote the convolutional part and $\mathcal{N}_R$ the recurrent part. Specifically, since the inputs we consider are videos, we let the input domain D be $\mathbb{R}^{l \times w \times h \times ch}$ , where $l$ is the length of $\pmb{v}$ , i.e., the number of frames, and $w, h, ch$ are the width, height, and channels of each frame, respectively. + +# 2.2. Optical flow + +In order to capture the dynamic characteristics of the moving objects in a video, we utilise optical flow [1, 26], which is a pattern of the apparent motion of the image objects between two consecutive frames caused by the movement of the objects or the camera. Several methods exist in the computer vision community to compute flows, e.g., the Lucas-Kanade [18] and Gunnar Farnebäck [5] algorithms. + +Definition 1 (Optical Flow). Consider a pixel $\mathcal{P}(x,y,t)$ in a frame, where $x,y$ denote the horizontal and vertical positions respectively, and $t$ denotes time dimension. If after dt time, the pixel moves by distance $(\mathrm{dx},\mathrm{dy})$ in the next frame, then $\mathcal{P}(x,y,t) = \mathcal{P}(x + \mathrm{dx},y + \mathrm{dy},t + \mathrm{dt})$ holds. After taking Taylor series approximation, removing common terms, and dividing by dt, the Optical Flow Equation is $f_{x}u + f_{y}v + f_{t} = 0$ , such that $f_{x} = \frac{\partial f}{\partial x}$ , $f_{y} = \frac{\partial f}{\partial y}$ , $u = \frac{\partial x}{\partial t}$ , $v = \frac{\partial y}{\partial t}$ , where $f_{x},f_{y}$ are the image gradients, $f_{t}$ is the gradient along time, and the motion $(u,v)$ is unknown. + +# 2.3. Distance metrics and Lipschitz continuity + +In robustness evaluation, $L^p$ distance metrics are often used to measure the discrepancy between inputs, denoted as $\| \alpha -\alpha '\| _p$ , where $p\in \{1,2,\infty \}$ indicates Manhattan $(L^{1})$ , Euclidean $(L^2)$ , and Chebyshev $(L^{\infty})$ distances. Because our inputs are videos, i.e., sequences of frames, we will need a suitable metric. In this work, we work directly with $L^p$ metrics on optical flows, as described in the next section. Moreover, we consider neural networks that satisfy Lipschitz continuity, and note that all networks with bounded inputs are Lipschitz continuous, such as the common fully-connected, convolutional, ReLU, and softmax layers. We denote by $\mathrm{Lip}_c$ the Lipschitz constant for class $c$ . + +# 3. Robustness: formulation and approximation + +In this section, we formulate the robustness problem and provide an approximation with provable guarantees. + +# 3.1. Robustness and maximum safe radius + +In this work, we focus on pointwise robustness, which is defined as the invariance of a network's classification over a small neighbourhood of a given input. Following this, the robustness of a classification decision for a specific input can be understood as the non-existence of adversarial examples in the neighbourhood of the input. Here, we work with the norm ball as a neighbourhood of an input, that is, given an input $\pmb{v}$ , a distance metric $L^p$ , and a distance $d$ , $\mathsf{B}(\pmb{v}, L^p, d) = \{\pmb{v}' \mid \| \pmb{v} - \pmb{v}' \|_p \leq d\}$ is the set of inputs whose distance to $\pmb{v}$ is no greater than $d$ based on the $L^p$ norm. Intuitively, the norm ball $\mathsf{B}$ with centre $\pmb{v}$ and radius $d$ limits perturbations to at most $d$ with respect to $L^p$ . Then (pointwise) robustness is defined as follows. + +Definition 2 (Robustness). Given a network $\mathcal{N}$ , an input $\pmb{v}$ , a distance metric $L^p$ , and a distance $d$ , an adversarial example $\pmb{v}'$ is such that $\pmb{v}' \in \mathsf{B}(\pmb{v}, L^p, d)$ and $\mathcal{N}(\pmb{v}') \neq \mathcal{N}(\pmb{v})$ . Define the robustness of $\pmb{v}$ by $\mathsf{ROBUST}(\mathcal{N}, \pmb{v}, L^p, d) \models \not\exists \pmb{v}' \in \mathsf{B}(\pmb{v}, L^p, d)$ s.t. $\mathcal{N}(\pmb{v}') \neq \mathcal{N}(\pmb{v})$ . If this holds, we say $\mathcal{N}$ is safe w.r.t. $\pmb{v}$ within $d$ based on the $L^p$ norm. + +While the above definition returns only True or False, we take a step further to quantify the measurement of robustness. That is, we compute the distance to the original + +![](images/78f49dc905b634c9aee846d82616f0e678f7e099a15cadccff59593c42f3a3ee.jpg) +Figure 1. Maximum safe radius. + +![](images/1243130fda91bc0e51303f973117d9ae27817b62c96915eb08a295f864131b4e.jpg) +Figure 2. Error bounds. + +![](images/0476db9bdb8f15794326baf4e5afebf7f901a6a91fa406430eeb3cbc3c9f740f.jpg) +Figure 3. Robustness verification workflow. + +input in the sense that, if exceeding the distance, there definitely exists an adversarial example, whereas, within the distance, all the points are safe, see Figure 1. We formally define this distance as the maximum safe radius as follows. + +Definition 3 (Maximum Safe Radius). Given a network $\mathcal{N}$ , an input $\pmb{v}$ , a distance metric $L^p$ , and a distance $d$ , the maximum safe radius (MSR) problem is to compute the minimum distance from input $\pmb{v}$ to an adversarial example $\pmb{v}'$ , i.e., + +$$ +\operatorname {M S R} (\mathcal {N}, \boldsymbol {v}, L ^ {p}, d) = \min _ {\boldsymbol {v} ^ {\prime} \in \mathrm {D}} \left\{\| \boldsymbol {v} - \boldsymbol {v} ^ {\prime} \| _ {p} \mid \boldsymbol {v} ^ {\prime} \in \mathrm {B} (\boldsymbol {v}, L ^ {p}, d) \right. +$$ + +$$ +\left. \text {s u c h} \mathcal {N} \left(\boldsymbol {v} ^ {\prime}\right) \neq \mathcal {N} (\boldsymbol {v}) \right\}. \tag {1} +$$ + +If $\pmb{v}'$ does not exist in $\mathsf{B}$ , we let $\mathsf{MSR} = d + \epsilon$ , i.e., $d$ plus a small value $\epsilon$ . + +# 3.2. Maximum safe radius w.r.t. optical flow + +In existing works that evaluate a network's robustness over images, it is common to manipulate each image at pixel- or channel-level, and then compute the distance between the perturbed and original inputs. However, as we deal with time-series inputs, i.e., videos, instead of manipulating directly on each individual frame, we impose perturbation on each optical flow that is extracted from every pair of adjacent frames, so that both spatial features on frames and temporal dynamics between frames can be captured. + +Definition 4 (Optical Flow). Given an input video $\mathbf{v}$ with number $l$ of frames, i.e., $\mathbf{v} = \{\mathcal{F}_1,\dots ,\mathcal{F}_t,\dots ,\mathcal{F}_l\} ,t\in [1,l],t\in \mathbb{N}^+$ , the optical flow extraction function $f:\mathcal{F}_t,\mathcal{F}_{t + 1}\mapsto \mathfrak{p}_t$ maps every two adjacent frames $\mathcal{F}_t,\mathcal{F}_{t + 1}$ into an optical flow $\mathfrak{p}_t$ . Then, for the sequential video $\mathbf{v}$ , a sequence of optical flows can be extracted, i.e., $\mathsf{P}(\mathbf{v}) = \{\mathsf{p}_1,\ldots ,\mathsf{p}_t,\ldots ,\mathsf{p}_{l - 1}\} ,t\in [1,l - 1],t\in \mathbb{N}^{+}$ . + +We remark that the distance between the flow sequences of two videos, denoted as $\| \mathsf{P}(\pmb {v}) - \mathsf{P}(\pmb {v}^{\prime})\|_{p}$ , can be measured similarly to that of two videos $\| \pmb {v} - \pmb{v}^{\prime}\|_{p}$ by the $L^p$ norms in the standard way, as they are essentially tensors. + +Then, to study the crafting of adversarial examples, we construct manipulations on the optical flow to obtain perturbed inputs. Note that if the input values are bounded, + +e.g., [0, 255] or [0, 1], then the perturbed inputs need to be restricted to be within the bounds. + +Definition 5 (Optical Flow Manipulation). Given an input $\mathbf{v}$ with optical flow sequence $\mathsf{P}(\mathbf{v})$ , an instruction function $\Theta : \mathbb{N}^{+} \to \mathbb{Z}$ , and a manipulation magnitude $\tau \in \mathbb{R}$ , we define the optical flow manipulation $\mathcal{M}_{\Theta, \tau}(\mathfrak{p}_t)(i) =$ + +$$ +\left\{ \begin{array}{l l} \mathrm {p} _ {t} [ i ] + \Theta (i) \cdot \tau , & \text {i f} i \in [ 1, w \times h ], i \in \mathbb {N} ^ {+} \\ \mathrm {p} _ {t} [ i ], & \text {o t h e r w i s e} \end{array} \right. \tag {2} +$$ + +where $w, h$ denote the width and height, i.e., $\Theta$ acts on flow dimensions. In particular, when $\theta : \mathbb{N}^{+} \to \{+1, -1\}$ , we say the manipulation is atomic, denoted as $\mathcal{M}_{\theta, \tau}$ . + +Instead of manipulating input $\pmb{v}$ directly, we manipulate the optical flow using $\mathcal{M}_{\Theta,\tau}(\mathsf{P}(\pmb{v}))$ , and then impose the manipulated flow on the original frames to obtain the corresponding perturbed input $\pmb{v}'$ such that $\mathsf{P}(\pmb{v}') = \mathcal{M}_{\Theta,\tau}(\mathsf{P}(\pmb{v}))$ . To this end, we compute the distance from $\mathcal{M}_{\Theta,\tau}(\mathsf{P}(\pmb{v}))$ to $\mathsf{P}(\pmb{v})$ instead of that from $\pmb{v}'$ to $\pmb{v}$ because the former reflects both spatial and temporal manipulations. That is, we compute the maximum safe radius w.r.t. optical flow $\mathsf{MSR}(\mathcal{N}, \mathsf{P}(\pmb{v}), L^p, d)$ rather than $\mathsf{MSR}(\mathcal{N}, \pmb{v}, L^p, d)$ . + +# 3.3. Approximation based on Lipschitz continuity + +Here, we utilise the fact that the networks studied in this work are Lipschitz continuous, which allows us to discretise the neighbourhood space of an optical flow sequence and consider a finite number of points on a grid instead of infinitely many. First, based on the definitions of optical flow and input manipulation, we transform the MSR problem into the following finite maximum safe radius problem. + +Definition 6 (Finite Maximum Safe Radius). Given an input $\mathbf{v}$ with the optical flow sequence $\mathsf{P}(\mathbf{v})$ and a manipulation operation $\mathcal{M}_{\Theta,\tau}$ , then the finite maximum safe radius (FMSR) w.r.t. optical flow is + +$$ +\operatorname {F M S R} (\mathcal {N}, \mathrm {P} (\boldsymbol {v}), L ^ {p}, d, \tau) = \min _ {\mathrm {P} _ {t} \in \mathrm {P} (\boldsymbol {v})} \min _ {\theta \in \Theta} \{ +$$ + +$$ +\left\| \mathsf {P} (\boldsymbol {v}) - \mathcal {M} _ {\theta , \tau} (\mathsf {P} (\boldsymbol {v})) \right\| _ {p} \mid \mathcal {M} _ {\theta , \tau} (\mathsf {P} (\boldsymbol {v})) \in \mathsf {B} (\mathsf {P} (\boldsymbol {v}), L ^ {p}, d) +$$ + +$$ +s. t. \mathcal {N} (\boldsymbol {v} ^ {\prime}) \neq \mathcal {N} (\boldsymbol {v}) a n d \mathrm {P} (\boldsymbol {v} ^ {\prime}) = \mathcal {M} _ {\theta , \tau} (\mathrm {P} (\boldsymbol {v})) \}. \tag {3} +$$ + +If $\pmb{v}'$ does not exist in $\mathsf{B}$ , we let FMSR = d + ε. + +Intuitively, we aim to find a set of atomic manipulations $\theta \in \Theta$ to impose on a sequence of optical flows $\mathfrak{p}_t \in \mathsf{P}(\mathbf{v})$ , such that the distance between the flow sequences is minimal, and the corresponding perturbed input $\mathbf{v}'$ is an adversarial example. Considering that, within a norm ball $\mathsf{B}(\mathsf{P}(\mathbf{v}), L^p, d)$ , the set of manipulations is finite for a fixed magnitude $\tau$ , the FMSR problem only needs to explore a finite number of the 'grid' points. To achieve this, we let $\overline{g}$ be a $\tau$ -grid point such that $|\overline{g} - \mathsf{P}(\mathbf{v})| = n \times \tau$ , and $\Gamma(\mathsf{P}(\mathbf{v}), L^p, d)$ be the set of $\tau$ -grid points whose corresponding optical flow sequences are in $\mathsf{B}$ . Note that all the $\tau$ -grid points are reachable from each other via manipulation. By selecting an appropriate $\tau$ , we ensure that the optical flow space can be covered by small sub-spaces. That is, $\mathsf{B}(\mathsf{P}(\mathbf{v}), L^p, d) \subseteq \bigcup_{\overline{g} \in \Gamma} \mathsf{B}(\overline{g}, L^p, \frac{1}{2} \tilde{d}(L^p, \tau))$ , where the grid width $\tilde{d}(L^p, \tau)$ is $|\mathsf{D}| \tau$ for $L^1$ , $\sqrt{|\mathsf{D}| \tau^2}$ for $L^2$ , and $\tau$ for $L^\infty$ . Now, we can use FMSR to estimate MSR within the error bounds, as shown in Figure 2. We remark that approximation is only involved in the estimation of MSR from FMSR, which does not compromise the guarantees provided by FMSR. + +Theorem 1 (Error Bounds). Given a manipulation magnitude $\tau$ , the optical flow space can be discretised into a set of $\tau$ -grid points, and MSR can be approximated as + +$$ +\begin{array}{l} \operatorname {F M S R} (\mathcal {N}, \mathrm {P} (\boldsymbol {v}), L ^ {p}, d, \tau) - \frac {1}{2} \tilde {d} (L ^ {p}, \tau) \\ \leq \operatorname {M S R} (\mathcal {N}, \mathrm {P} (\boldsymbol {v}), L ^ {p}, d) \leq \operatorname {F M S R} (\mathcal {N}, \mathrm {P} (\boldsymbol {v}), L ^ {p}, d, \tau). \tag {4} \\ \end{array} +$$ + +We next show how to determine $\tau$ . Note that, in order to make sure each $\tau$ -grid point $\overline{g}$ covers all the possible manipulation points in its neighbourhood, we compute the largest $\tau$ , which can be obtained via Lipschitz continuity. For a network $\mathcal{N}$ that is Lipschitz continuous at input $\pmb{v}$ , given Lipschitz constant $\mathrm{Lip}_c, c \in C$ , we have + +$$ +\tilde {d} ^ {\prime} \left(L ^ {p}, \tau\right) \leq \frac {\underset {c \in C , c \neq \mathcal {N} (\boldsymbol {v})} {\min } \left\{\mathcal {N} (\boldsymbol {v} , \mathcal {N} (\boldsymbol {v})) - \mathcal {N} (\boldsymbol {v} , c) \right\}}{\underset {c \in C , c \neq \mathcal {N} (\boldsymbol {v})} {\max } \left(\operatorname {L i p} _ {\mathcal {N} (\boldsymbol {v})} + \operatorname {L i p} _ {c}\right)}. \tag {5} +$$ + +The proof is given in Appendix A.1 of an extended version of the paper [30]. Here we remark that, while $\tilde{d}^{\prime}(L^{p},\tau)$ is with respect to input $\mathbf{v}$ and $\tilde{d} (L^p,\tau)$ is with respect to the flow sequence $\mathsf{P}(\boldsymbol {v})$ , the relation between them is dependent on the flow extraction method used. As this is not the main focus of this work, we do not expand on this topic. + +# 4. A game-based verification approach + +In this section, we show that the finite optimisation problem FMSR of Definition 6 can be reduced to the computation of a player's reward when taking an optimal strategy in a game-based setting. The verification workflow is in Figure 3. To this end, we adapt the game-based approach proposed in [31] for robustness evaluation of CNNs on images. + +# 4.1. Problem solving as a two-player game + +We define a two-player turn-based game, where Player I chooses which optical flow to perturb, and Player II then imposes atomic manipulations within the selected flow. + +Definition 7 (Game). Given a network $\mathcal{N}$ , an input $\pmb{v}$ and its extracted optical flow sequence $\mathsf{P}(\pmb{v})$ , we let $\mathcal{G}(\mathcal{N}, \pmb{v}, L^p, d) = (S \cup (S \times \mathsf{P}(\pmb{v})), s_0, \{T_{\mathbb{I}}, T_{\mathbb{II}}\}, L)$ be a game model, where + +- $S \cup (S \times \mathsf{P}(\pmb{v}))$ denotes the set of game states, in which $S$ is the set of Player I's states whereas $S \times \mathsf{P}(\pmb{v})$ is the set of Player II's states. Each $s \in S$ corresponds to an optical flow sequence $\mathsf{P}(s)$ in the norm ball $\mathsf{B}(\mathsf{P}(\pmb{v}), L^p, d)$ . +- $s_0 \in S$ is the initial state such that $\mathsf{P}(s_0)$ corresponds to the original optical flow sequence $\mathsf{P}(\pmb{v})$ . +- $T_{\mathrm{I}}: S \times \mathsf{P}(\mathbf{v}) \to S \times \mathsf{P}(\mathbf{v})$ is Player I's transition relation defined as $T_{\mathrm{I}}(s, \mathfrak{p}_t) = (s, \mathfrak{p}_t)$ , and $T_{\mathrm{II}}: (S \times \mathsf{P}(\mathbf{v})) \times \Theta \to S$ is Player II's transition relation defined as $T_{\mathrm{II}}((s, \mathfrak{p}_t), \theta) = \mathcal{M}_{\theta, \tau}(\mathfrak{p}_t)$ , where $\mathcal{M}_{\theta, \tau}$ is the atomic manipulation of Definition 5. Intuitively, in a game state $s$ , Player I selects a flow $\mathfrak{p}_t$ of $\mathsf{P}(s)$ and enters into a Player II's state $(s, \mathfrak{p}_t)$ , where Player II then chooses an atomic manipulation $\mathcal{M}_{\theta, \tau}$ on $\mathfrak{p}_t$ . +- $L: S \cup (S \times \mathsf{P}(\mathbf{v})) \to C$ is the labelling function that assigns to each game state the corresponding class. + +To compute FMSR of Definition 6, we let the game $\mathcal{G}$ be cooperative. When it proceeds, two players take turns - Player I employs a strategy $\sigma_{\mathrm{I}}$ to select optical flow, then Player II employs a strategy $\sigma_{\mathrm{II}}$ to determine atomic manipulations - thus forming a path $\rho$ , which is a sequence of states and actions $s_0p_0s_1\theta_1s_2p_2s_3\dots$ . Formally, we define the strategy of the game as follows. Let $Path_{\mathrm{I}}^{F}$ be a set of finite paths ending in Player I's state, and $Path_{\mathrm{II}}^{F}$ be a set of finite paths ending in Player II's state, then we define a strategy profile $\sigma = (\sigma_{\mathrm{I}},\sigma_{\mathrm{II}})$ , such that $\sigma_{\mathrm{I}}: Path_{\mathrm{I}}^{F} \to \mathcal{D}(\mathsf{P}(\boldsymbol{v}))$ of Player I maps a finite path to a distribution over next actions, and similarly $\sigma_{\mathrm{II}}: Path_{\mathrm{II}}^{F} \to \mathcal{D}(\Theta)$ for Player II. + +Intuitively, by imposing atomic manipulations in each round, the game searches for potential adversarial examples with increasing distance to the original optical flow. Given $\rho$ , let $v_{\rho}^{\prime}$ denote the input corresponding to the last state of $\rho$ , and $\mathsf{P}(v_{\rho}^{\prime})$ denote its optical flow sequence, we write the termination condition $tc(\rho) \equiv (\mathcal{N}(v_{\rho}^{\prime}) \neq \mathcal{N}(\pmb{v})) \vee (\| \mathsf{P}(v_{\rho}^{\prime}) - \mathsf{P}(\pmb{v}) \|_p > d)$ , which means that the game is in a state whose corresponding input is either classified differently, or the associated optical flow sequence is outside the norm ball. To quantify the distance accumulated along a path, we define a reward function as follows. Intuitively, the reward is the distance to the original optical flow if an adversarial example is found, and otherwise it is the weighted summation of the rewards of its children on the game tree. + +Definition 8 (Reward). Give a finite path $\rho$ and a strategy profile $\sigma = (\sigma_{\mathrm{I}},\sigma_{\mathrm{II}})$ , we define a reward function $R(\sigma ,\rho)$ + +$$ += \left\{ \begin{array}{l} \left\| \mathrm {P} \left(\boldsymbol {v} _ {\rho} ^ {\prime}\right) - \mathrm {P} (\boldsymbol {v}) \right\| _ {p}, \\ \text {i f} t c (\rho) \text {a n d} \rho \in \operatorname {P a t h} _ {\mathrm {I}} ^ {F} \\ \sum_ {\mathfrak {p} _ {t} \in \mathrm {P} (\boldsymbol {v})} \sigma_ {\mathrm {I}} (\rho) \left(\mathfrak {p} _ {t}\right) \cdot R \left(\sigma , \rho T _ {\mathrm {I}} (\operatorname {l a s t} (\rho), \mathfrak {p} _ {t})\right), \\ \text {i f} \neg t c (\rho) \text {a n d} \rho \in \operatorname {P a t h} _ {\mathrm {I}} ^ {F} \\ \sum_ {\theta \in \Theta} \sigma_ {\mathrm {I I}} (\rho) (\theta) \cdot R \left(\sigma , \rho T _ {\mathrm {I I}} (\operatorname {l a s t} (\rho), \theta)\right), \\ \text {i f} \rho \in \operatorname {P a t h} _ {\mathrm {I I}} ^ {F} \end{array} \right. \tag {6} +$$ + +where $\sigma_{\mathrm{I}}(\rho)(\mathfrak{p}_t)$ is the probability of Player I choosing flow $\mathfrak{p}_t$ along $\rho$ , and $\sigma_{\mathrm{II}}(\rho)(\theta)$ is that of Player II determining atomic manipulation $\mathcal{M}_{\theta,\tau}$ along $\rho$ . Also, $\rho T_{\mathrm{I}}(last(\rho), \mathfrak{p}_t)$ and $\rho T_{\mathrm{II}}(last(\rho), \theta)$ are the resulting paths of Player I, Player II applying $\sigma_{\mathrm{I}}$ , $\sigma_{\mathrm{II}}$ , respectively, i.e., extending $\rho$ by adding a new state after transition. + +# 4.2. Robustness guarantees + +We now confirm that the game can return the optical value of the reward function as the solution to the FMSR problem. Proof of Theorem 2 is in Appendix A.2 of [30]. + +Theorem 2 (Guarantees). Given an input $\pmb{v}$ , a game model $\mathcal{G}(\mathcal{N},\pmb{v},L^p,d)$ , and an optimal strategy profile $\sigma = (\sigma_{\mathrm{I}},\sigma_{\mathrm{II}})$ , the finite maximum safe radius problem is to minimise the reward of initial state $s_0$ based on $\sigma$ , i.e., + +$$ +\operatorname {F M S R} (\mathcal {N}, \mathrm {P} (\boldsymbol {v}), L ^ {p}, d, \tau) = \min R (\sigma , s _ {0}). \tag {7} +$$ + +# 5. Computation of the converging upper and lower bounds + +Since computing FMSR directly is difficult, we instead exploit algorithms to compute its upper and lower bounds. We emphasise that there is no approximation in the guarantees provided by the bounds, e.g., any adversarial perturbation of magnitude less than the lower bound will definitely not cause a misclassification. This includes all the possible inputs within the lower bound, not just a discrete subset. + +# 5.1. Upper bound: gradient-based search + +We propose a gradient-based search algorithm to compute an upper bound of FMSR. Here, we utilise the spatial features extracted from individual frames. + +Definition 9 (Spatial Features). Given a network $\mathcal{N}$ , let $\mathcal{N}_{\mathbb{C}}$ denote the convolutional part, then $\mathcal{N}_{\mathbb{C}}: \boldsymbol{v} \mapsto \eta \in \mathbb{R}^{l \times m}$ maps from input $\boldsymbol{v}$ to its extracted spatial features $\eta$ , which has consistent length $l$ of $\boldsymbol{v}$ and feature dimension $m$ of a frame. Then, we pass $\eta$ into the recurrent part $\mathcal{N}_{\mathbb{R}}$ and obtain the classification, i.e., $\mathcal{N}_{\mathbb{R}}: \eta \mapsto \mathcal{N}(\boldsymbol{v}, c)$ , $c \in C$ . + +The objective is to manipulate optical flow as imperceptibly as possible while altering the final classification. We + +write the objective function as follows: + +$$ +\begin{array}{l} \forall t \in [ 1, l - 1 ], t \in \mathbb {N} ^ {+}, \min _ {\mathbf {p} _ {t}} + \epsilon \cdot \nabla_ {\mathbf {p} _ {t}} (\mathcal {N}, \boldsymbol {v}) \\ s. t. \quad \nabla_ {\mathbf {p} _ {t}} (\mathcal {N}, \boldsymbol {v}) = \frac {\partial 1 _ {\boldsymbol {v}} ^ {\mathcal {N}}}{\partial \eta} \odot \frac {\partial \eta}{\partial \mathbf {p} _ {t}} \tag {8} \\ \end{array} +$$ + +where $\epsilon$ is a constant, and $\nabla_{\mathbb{P}_t}(\mathcal{N},\boldsymbol {v})$ is the perturbation imposed on $\mathfrak{p}_t$ . The key point is to minimise $\nabla_{\mathfrak{p}_t}(\mathcal{N},\boldsymbol {v})$ so that the perturbation is not noticeable while simultaneously changing $\mathcal{N}(\boldsymbol {v})$ . Here, we utilise the loss of $\mathcal{N}$ on $\boldsymbol{v}$ , denoted as $1_{\boldsymbol{v}}^{\mathcal{N}}$ , to quantify the classification change. Intuitively, if $1_{\boldsymbol{v}}^{\mathcal{N}}$ increases, $\mathcal{N}(\boldsymbol {v})$ is more likely to change. By utilising the concept of spatial features $\eta$ , we rewrite $\nabla_{\mathfrak{p}_t}(\mathcal{N},\boldsymbol {v})$ as $\partial 1_{\boldsymbol{v}}^{\mathcal{N}} / \partial \eta \odot \partial \eta /\partial \mathfrak{p}_t$ , where $\partial 1_{\boldsymbol{v}}^{\mathcal{N}} / \partial \eta$ denotes the gradient of the network's loss w.r.t. the spatial features, $\partial \eta /\partial \mathfrak{p}_t$ denotes the gradient of the spatial features w.r.t. the optical flow, and $\odot$ denotes the Hadamard product. + +We introduce the computation of the two parts below. On one hand, $\partial \eta / \partial \mathfrak{p}_t$ essentially exhibits the relation between spatial features and optical flow. Here we reuse input manipulation (Definition 5) to compute $\partial \eta / \partial \mathfrak{p}_t$ , though instead of manipulating the flow we impose perturbation directly on the frame. Intuitively, we manipulate the pixels of each frame to see how the subtle optical flow between the original and the manipulated frames will influence the spatial features. Each time we manipulate a single pixel of a frame, we get a new frame which is slightly different. If we perform $\mathcal{M}_{\Theta,\tau}$ on pixel $\mathcal{F}[m,n]$ , and denote the manipulated frame as $\mathcal{F}_{m,n}$ , its spatial features as $\eta_{m,n}$ , the subtle optical flow between $\mathcal{F}_{m,n}$ and $\mathcal{F}$ as $\delta \mathfrak{p}_{m,n}$ , then $\partial \eta / \partial \mathfrak{p}_t$ can be computed as in Equation (9) below. + +$$ +\frac {\partial \eta}{\partial \mathbf {p} _ {t}} = \left( \begin{array}{c c c} \frac {\| \eta_ {1 , 1} - \eta \| _ {p}}{\| \delta \mathbf {p} _ {1 , 1} \| _ {p}} & \dots & \frac {\| \eta_ {1 , w} - \eta \| _ {p}}{\| \delta \mathbf {p} _ {1 , w} \| _ {p}} \\ \vdots & \ddots & \vdots \\ \frac {\| \eta_ {h , 1} - \eta \| _ {p}}{\| \delta \mathbf {p} _ {h , 1} \| _ {p}} & \dots & \frac {\| \eta_ {w , h} - \eta \| _ {p}}{\| \delta \mathbf {p} _ {w , h} \| _ {p}} \end{array} \right) \tag {9} +$$ + +On the other hand, $\partial \mathbb{1}_{\boldsymbol{v}}^{\mathcal{N}} / \partial \eta$ shows how the spatial features will influence the classification, which can be reflected by the loss of the network. After getting $\eta$ from $\mathcal{N}_{\mathbb{C}}$ , we can obtain $\mathbb{1}_{\boldsymbol{v}}^{\mathcal{N}}$ from $\mathcal{N}_{\mathbb{R}}$ . If we perform pixel manipulation $\mathcal{M}_{\Theta,\tau}(\mathcal{F}[m,n])$ on frame $\mathcal{F}$ , and obtain a new input, denoted as $\boldsymbol{v}_{\mathcal{F}[m,n]}$ , then for this frame we have the gradient in Equation (10) below. + +$$ +\frac {\partial \mathbf {l} _ {\boldsymbol {v}} ^ {\mathcal {N}}}{\partial \eta} = \left( \begin{array}{c c c} \frac {\mathbf {l} _ {\boldsymbol {v} , \mathcal {F} [ 1 , 1 ]} ^ {\mathcal {N}} - \mathbf {l} _ {\boldsymbol {v}} ^ {\mathcal {N}}}{\| \eta_ {1 , 1} - \eta \| _ {p}} & \dots & \frac {\mathbf {l} _ {\boldsymbol {v} , \mathcal {F} [ 1 , w ]} ^ {\mathcal {N}} - \mathbf {l} _ {\boldsymbol {v}} ^ {\mathcal {N}}}{\| \eta_ {1 , w} - \eta \| _ {p}} \\ \vdots & \ddots & \vdots \\ \frac {\mathbf {l} _ {\boldsymbol {v} , \mathcal {F} [ h , 1 ]} ^ {\mathcal {N}} - \mathbf {l} _ {\boldsymbol {v}} ^ {\mathcal {N}}}{\| \eta_ {h , 1} - \eta \| _ {p}} & \dots & \frac {\mathbf {l} _ {\boldsymbol {v} , \mathcal {F} [ w , h ]} ^ {\mathcal {N}} - \mathbf {l} _ {\boldsymbol {v}} ^ {\mathcal {N}}}{\| \eta_ {w , h} - \eta \| _ {p}} \end{array} \right) \tag {10} +$$ + +Remark. From Definition 9, we know that the spatial features $\eta = \mathcal{N}_{\mathsf{C}}(\pmb{v})$ only depend on each individual frame $\mathcal{F}$ of $\pmb{v}$ and do not capture the temporal information be + +Algorithm 1: Admissible A* for DNN Verification +Input: Game $\mathcal{G}(\mathcal{N},\boldsymbol {v},L^p,d)$ , terminating condition tc Output: Lower bound of FMSR +1 procedure ADMISSIBLEA\* $(\mathcal{G}(\mathcal{N},\boldsymbol {v},L^{p},d),tc)$ . +2 root $\leftarrow s_0$ . +3 while $(\neg tc)$ do +4 P(root) $\leftarrow$ Player I(root, Farneback); +5 for pt in P(root) do +6 $\mathrm{pt}_i[i]\gets \mathrm{Player~II}(\mathrm{pt}_i)$ . +7 newnodes $\leftarrow \mathcal{M}_{\theta ,\tau}(\mathrm{pt}_i)(i)$ . +8 for node in newnodes do +9 dist $\leftarrow$ DistanceEstimation(node); +10 root $\leftarrow$ MaximumSafeRadius(distance); +11 return $\| \mathsf{P}(\mathsf{root}) - \mathsf{P}(\mathsf{s}_0)\| _p$ + +tween frames. That is, when $\mathcal{N}_{\mathbb{C}}$ remains unchanged, $\eta$ and $\mathcal{F}$ have a direct relation, which indicates that the gradient of the latter can reflect that of the former. Therefore, during implementation, instead of the distance between $\eta_{m,n}$ and $\eta$ , we calculate that between $\mathcal{F}_{m,n}$ and $\mathcal{F}$ , i.e., $\| \mathcal{F}_{m,n} - \mathcal{F}\|_p$ . + +# 5.2. Lower bound: admissible A* + +We exploit admissible $\mathbf{A}^*$ to compute a lower bound of Player I's reward, i.e., FMSR. An $\mathbf{A}^*$ algorithm gradually unfolds the game model into a tree, in the sense that it maintains a set of children nodes of the expanded partial tree, and computes an estimate for each node. The key point is that in each iteration it selects the node with the least estimated value to expand. The estimation comprises two components: (1) the exact reward up to the current node, and (2) the estimated reward to reach the goal node. To guarantee the lower bound, we need to make sure that the estimated reward is minimal. For this part, we let the $\mathbf{A}^*$ algorithm be admissible, which means that, given a current node, it never overestimates the reward to the terminal goal state. For each state $s$ in the game model $\mathcal{G}$ , we assign an estimated distance value DistanceEstimation $(s) = \| \mathsf{P}(s) - \mathsf{P}(s_0)\| _p +$ heuristic $(\mathsf{P}(s))$ , where $\| \mathsf{P}(s) - \mathsf{P}(s_0)\| _p$ is the distance from the original state $s_0$ to the current state $s$ based on the $L^p$ norm, and heuristic $(\mathsf{P}(s))$ is the admissible heuristic function that estimates the distance from the current state $s$ to the terminal state. Here, we use $\tilde{d} (L^p,\tau)$ in Equation (4). We present the admissible $\mathbf{A}^*$ algorithm in Algorithm 1. + +# 6. Experimental results + +This section presents the evaluation results of our framework to approximate the maximum safe radius w.r.t. optical flow on a video dataset. We perform the experiments on a Linux server with NVIDIA GeForce GTX Titan Black GPUs, and the operating system is Ubuntu 14.04.3 LTS. The results are obtained from a VGG16 [21] + LSTM [13] network on the UCF101 [22] video dataset. Details about + +![](images/9f1e7357e5d4f43be5892ba99037191df8d8f62ecdbc946f2c0f4f01d283b52f.jpg) +(a) SoccerJuggling at 0 s and 1 s. + +![](images/06796cba434c4c70389fa6df3656c583c83bf11cb4acaf30741dae02a34bea22.jpg) +(b) Optical flow and its magnitude (left) and direction (right). + +![](images/6abcab4fab6e9d46059e954cd61cb2fedfcbf4a2c116c5c988ffc3558112695d.jpg) + +![](images/204e3a119efd19f3c1309e933f6dea5ed9470113137886c3c97b8f28b6091d7c.jpg) + +![](images/45da600610ce1ac3aa5179bd8c6371039bac9e4e0abfdae48f43b2cb3e945893.jpg) +Figure 4. Illustration of how optical flow is able to capture the dynamics of the moving objects. (a) Two sampled frames from SoccerJuggling with original size $320 \times 240 \times 3$ . (b) The optical flow (red arrows) extracted between the frames, and its two characteristics: magnitude and direction. + +![](images/bb54b3ede27f6e2b239c221995c5d82b8d1ca8aa15b97affc3650ab188e51c10.jpg) +(b) magnitude: original, difference, and perturbed. + +![](images/72ea7b04a890b94667d85dd566258fe2466ffa676effa30aaf3c5bb5a3677f22.jpg) + +![](images/3714f14ccaffe8dfea2e4050d587f63e2bf5b38473c001e5f883e6af848ae6bf.jpg) + +![](images/3a66573a372f2eb1eb34ac52ff9b9fb3d6fc196c4c96ed94aecf6d9cba3bc4ad.jpg) +(a) Frame at 1 s. +(c) Frame at 2s. +Figure 5. Imperceptible perturbations on optical flow, in terms of magnitude and direction, leading to misclassification from LongJump (100.00%) to FloorGymnastics (86.10%). (a)(c) Sampled frames at 1 s and 2 s with size $224 \times 224 \times 3$ . (b) Original and perturbed magnitude. (d) Original and perturbed direction. + +![](images/0d41afa5ebc38141ab78a5420d7de1e698a1f7ec0fa3c2b28f80297f099a1e05.jpg) +(d) direction: original, difference, and perturbed. + +![](images/a4e392a721c2626f3658ba2fbc727cbb5bf6f42f51bc11b95e67ac4473d47667.jpg) + +![](images/9e443aa9247e0aaa9538fd03ac66106d833924ae6ed8acd5daf5c6507fe2ed6a.jpg) + +the dataset, the network structure, and training/testing parameters can be found in Appendix A.3 of [30]. + +# 6.1. Adversarial examples via manipulating flows + +We illustrate how optical flow can capture the temporal dynamics of the moving objects in neighbouring frames. In this case, we exploit the Gunnar Farnebäck algorithm [5] as it computes the optical flow for all the pixels in a frame, i.e., dense optical flow, instead of a sparse feature set. Figure 4 presents an optical flow generated from two adjacent frames of a video labelled as SoccerJuggling: (a) shows two frames sampled at $0\mathrm{s}$ and $1\mathrm{s}$ ; and (b) exhibits the characteristics of the flow: magnitude and direction. We observe that, when the indoor background essentially remains unchanged, the motion of playing football is clearly captured by the flow. More examples are included in Appendix A.4 of [30]. + +We now demonstrate how a very slight perturbation on the flow, almost imperceptible to human eyes, can lead to a + +![](images/61f6a35d611407d22ebd8c8f904ddba80608f3cf0dfdaaabdfc8c43bd419f446.jpg) +Figure 6. Examples of unsafe and safe perturbations on the optical flows of a HammerThrow video. Top row: sampled frames from 0 s to 3 s. 2nd row: optical flows of the frames from 0 s to 4 s. 3rd row: unsafe perturbations on the flows corresponding to the upper bound. Bottom row: safe perturbations reflecting the lower bound. + +misclassification of the whole video. Figure 5 exhibits that a video originally classified as LongJump with confidence $100.00\%$ is manipulated into FloorGymnastics with confidence $86.10\%$ . Two sampled frames at 1 s and 2 s are shown in the 1st column. If we compare the original optical flow of magnitude and direction (2nd column) generated from the frames with the perturbed ones (4th column), we can hardly notice the difference (3rd column). However, the classification of the video has changed. + +# 6.2. Converging upper and lower bounds + +We illustrate the convergence of the bound computation for the maximum safe radius with respect to manipulations on the optical flows extracted from the consecutive frames of a video. Take a HammerThrow video as an example. Figure 6 exhibits four sampled frames (top row) and the optical flows extracted between them (2nd row). By utilising our framework, we present an approximation of MSR in Figure 7, where the red line indicates the descending trend of the upper bound, whereas the blue line denotes the ascending trend of the lower bound. Intuitively, after 20 iterations of the gradient-based algorithm, the upper bound, i.e., minimum distance to an adversarial example, is 5670.31 based on the $L^2$ distance metric. That is, manipulations imposed on the flows exceeding this upper bound may be unsafe. Figure 6 (3rd row) shows some of such unsafe perturbations on each optical flow, which result in the misclassification of the video into FrontCrawl with confidence $99.86\%$ . As + +![](images/22ce936971106ba2e8de227db7545162280c3cbcaecc753ac526cf3de39b08a3.jpg) +Figure 7. Converging bounds of the maximum safe radius of the HammerThrow video with respect to manipulations on extracted flows. Decreasing upper bound from the gradient-based algorithm shown in red, and increasing lower bound from admissible $\mathrm{A}^*$ in blue. Note that these two vertical axes have different scales. + +![](images/e5a75fc1e52be0ff21aef1cf5f5d4d3122edfa48c1f0f49aec4392c5a7e197d8.jpg) +(a) Brightness increase and the corresponding unaffected optical flow. + +![](images/177a0b06c7bf2e5e84e29ffa7312d51426b00fff00a1b8ed0cf6024c5c5a1c44.jpg) +(b) Lower bounds of the maximum safe radius. +Figure 8. Safe brightness changes to the HammerThrow video and the corresponding lower bounds of the maximum safe radius. (a) The frame at $2\mathrm{s}$ of HammerThrow with increasing brightness, and the optical flow extracted from the same frame taking into account the brightness change. (c) The ascending lower bounds of the maximum safe radius reflecting the brightness change. + +for the lower bound, we observe that, after 1000 iterations of the admissible $\mathrm{A}^*$ algorithm, the lower bound reaches 52.95. That is, manipulations within this $L^2$ norm ball are absolutely safe. Some of such safe perturbations can be found in the bottom row of Figure 6. Due to space limit, we include another example in Appendix A.5 of [30]. + +# 6.3. Extension to naturally plausible distortions + +Our framework can be extended to practical applications where distortions are more natural and physically plausible to the modality of the data itself, because all the perturbations preserving the semantic content of a video are essentially compositions of various atomic manipulations, and thus can be easily incorporated. + +Take the "brightness change" perturbation as an example. As illustrated in Figure 8, we increase the brightness of + +![](images/f34bc6f7b4029b2fb6e26ee56d116cb852b6a5f46a4c647db3fc87ad5f140ff0.jpg) +Figure 9. Some possible extensions of the adversarial perturbations to more naturally plausible distortions. Top: "camera occlusion" to the SoccerJuggling video with the Horn-Schunck optical flow method. Middle: "horizontal flip" to the FloorGymnastics video. Bottom: "angular rotation" to the FrontCrawl video. + +the HammerThrow video on the frame level. That is, each pixel in the same frame is simultaneously brightened by the atomic manipulation $\tau$ , thus resulting in the overall distance to the original video increasing by $d'(L^p, \tau \cdot w \cdot h)$ , where $w$ denotes the width of the frame and $h$ height. The corresponding lower bounds of MSR are computed in Figure 8(b). Intuitively, this means that any degree of brightness alteration is definitely safe as long as the distance to the original video is less than the computed lower bound. For instance, after 10 iterations, the lower bound is 548.68 based on the $L^2$ norm, then any frame-level brightness increase less than 548.68 in the Euclidean distance will not change the classification of this video. One interesting phenomenon observed is that, as exhibited in Figure 8(a), when the brightness of a frame increases, the extracted optical flow on the same frame is not significantly affected, due to the fact that the motion is relatively unchanged. In other words, optical flow can naturally discard some perturbations that do not alter the underlying temporal dynamics. + +Apart from the "brightness change", we include some other possible natural distortions of the adversarial perturbations in Figure 9. We observe that the "camera occlusion" here is very similar to the safe perturbations of the HammerThrow video in Figure 6 (bottom row), and thus can be handled using similar methods. The "horizontal flip" and the "angular rotation" involve manipulations that form a group, and to deal with those our approach would need to be extended, for example by incorporating network invariances. Finally, regarding these various adversarial perturbations, we remark that whether the perturbations are visible for a human largely depends on the manipulation type - with the same distance to the original input, manipulations such as these physically plausible distortions are cer- + +![](images/7c494ad418e6a6a7f5322b7ffd7da2b28981affed950f033e7d381c3b782cf55.jpg) +Figure 10. Different lower bounds of the maximum safe radius of a HammerThrow video with varying number of manipulated flows. + +tainly more visible than unsafe perturbations produced by the gradient-based search algorithm and the safe perturbations created from the admissible $\mathrm{A}^*$ algorithm. + +# 6.4. Efficiency and scalability + +As for the computation time, the upper bound requires the gradient of optical flow with respect to the frame, and because we extract dense optical flow, the algorithm needs to traverse each pixel of a frame to impose atomic manipulations; thus it takes around 30 minutes to retrieve the gradient of each frame. Once the gradient of the whole video is obtained, and the framework enters into the cooperative game, i.e., the expansion of the tree, each iteration takes minutes. Meanwhile, for the lower bound, the admissible $\mathrm{A}^*$ algorithm expands the game tree in each iteration which takes minutes, and updates the lower bound wherever applicable. Note that initially the lower bound may be updated in each iteration, but when the size of the game tree increases, it can take hours to update. Moreover, we analyse the scalability of our framework via an example of a HammerThrow video in Figure 10, which shows the lower bounds obtained with respect to varying dimensions of the manipulated flows. We observe that, within the same number of iterations, manipulating fewer flows leads to faster convergence, especially when the flows contain more spatial and temporal features. + +# 7. Conclusion + +In this work, we study the maximum safe radius problem for neural networks, including CNNs and RNNs, with respect to the optical flow extracted from sequential videos. Possible future work includes extending our framework to provide robustness guarantees for application domains where time-series input data and recurrent units are also involved, for example natural language processing. + +Acknowledgements: This project has received funding from the European Research 20 Council (ERC) under the European Unions Horizon 2020 research and innovation programme (grant agreement No. 834115) and the EPSRC Programme Grant on Mobile Autonomy (EP/M019918/1). + +# References + +[1] Andrew Burton and John Radford. Thinking in perspective: critical essays in the study of thought processes, volume 646. Routledge, 1978. +[2] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pages 39-57. IEEE, 2017. +[3] Souradeep Dutta, Susmit Jha, Sriram Sankaranarayanan, and Ashish Tiwari. Output range analysis for deep feedforward neural networks. In NASA Formal Methods, pages 121-138, 2018. +[4] Rüdiger Ehlers. Formal verification of piece-wise linear feed-forward neural networks. In Automated Technology for Verification and Analysis, pages 269-286, 2017. +[5] Gunnar Farnebäck. Two-frame motion estimation based on polynomial expansion. In Scandinavian conference on Image analysis, pages 363-370. Springer, 2003. +[6] Santiago Fernández, Alex Graves, and Jürgen Schmidhuber. An application of recurrent neural networks to discriminative keyword spotting. In International Conference on Artificial Neural Networks, pages 220-229. Springer, 2007. +[7] Timon Gehr, Matthew Mirman, Dana Drachsler-Cohen, Petar Tsankov, Swarat Chaudhuri, and Martin Vechev. AI2: Safety and robustness certification of neural networks with abstract interpretation. In 2018 IEEE Symposium on Security and Privacy (SP), pages 3-18, May 2018. +[8] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. +[9] Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In 2013 IEEE international conference on acoustics, speech and signal processing, pages 6645–6649. IEEE, 2013. +[10] Alex Graves and Jürgen Schmidhuber. Frameworkwise phoneme classification with bidirectional LSTM and other neural network architectures. Neural Networks, 18(5-6):602-610, 2005. +[11] Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems 30, pages 2266-2276. 2017. +[12] Sepp Hochreiter, Martin Heusel, and Klaus Obermayer. Fast model-based protein homology detection without alignment. Bioinformatics, 23(14):1728-1736, 2007. +[13] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. +[14] Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety verification of deep neural networks. In International Conference on Computer Aided Verification, pages 3-29. Springer, 2017. +[15] Nathan Inkawich, Matthew Inkawich, Yiran Chen, and Hai Li. Adversarial attacks for optical flow-based action recognition classifiers. arXiv preprint arXiv:1811.11875, 2018. +[16] Guy Katz, Clark Barrett, David L Dill, Kyle Julian, and Mykel J Kochenderfer. Reluplex: An efficient SMT solver + +for verifying deep neural networks. In International Conference on Computer Aided Verification, pages 97-117. Springer, 2017. +[17] Ching-Yun Ko, Zhaoyang Lyu, Lily Weng, Luca Daniel, Ngai Wong, and Dahua Lin. POPQORN: Quantifying robustness of recurrent neural networks. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 3468-3477, 2019. +[18] Bruce D. Lucas and Takeo Kanade. An iterative image registration technique with an application to stereo vision. In Proceedings of the 7th International Joint Conference on Artificial Intelligence - Volume 2, IJCAI'81, pages 674-679, 1981. +[19] Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In 2016 IEEE European Symposium on Security and Privacy (EuroS&P), pages 372-387. IEEE, 2016. +[20] Nicolas Papernot, Patrick McDaniel, Ananthram Swami, and Richard Harang. Crafting adversarial input sequences for recurrent neural networks. In MILCOM 2016-2016 IEEE Military Communications Conference, pages 49-54, 2016. +[21] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015. +[22] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. In CRCV-TR-12-01, 2012. +[23] 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. +[24] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014. +[25] Qinglong Wang, Kaixuan Zhang, Xue Liu, and C Lee Giles. Verification of recurrent neural networks through rule extraction. arXiv preprint arXiv:1811.06029, 2018. +[26] David H Warren and Edward R Strelow. Electronic spatial sensing for the blind: contributions from perception, rehabilitation, and computer vision, volume 99. Springer Science & Business Media, 2013. +[27] Xingxing Wei, Jun Zhu, Sha Yuan, and Hang Su. Sparse adversarial perturbations for videos. In Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence, pages 8973–8980, 2019. +[28] Tsui-Wei Weng, Huan Zhang, Pin-Yu Chen, Jinfeng Yi, Dong Su, Yupeng Gao, Cho-Jui Hsieh, and Luca Daniel. Evaluating the robustness of neural networks: An extreme value theory approach. In 6th International Conference on Learning Representations, 2018. +[29] Tsui-Wei Weng, Huan Zhang, Hongge Chen, Zhao Song, Cho-Jui Hsieh, Luca Daniel, Duane Boning, and Inderjit Dhillon. Towards fast computation of certified robustness for ReLU networks. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 5276-5285, 2018. + +[30] Min Wu and Marta Kwiatkowska. Robustness guarantees for deep neural networks on videos. arXiv preprint arXiv:1907.00098, 2019. +[31] Min Wu, Matthew Wicker, Wenjie Ruan, Xiaowei Huang, and Marta Kwiatkowska. A game-based approximate verification of deep neural networks with provable guarantees. Theoretical Computer Science, 807:298 - 329, 2020. +[32] Huan Zhang, Tsui-Wei Weng, Pin-Yu Chen, Cho-Jui Hsieh, and Luca Daniel. Efficient neural network robustness certification with general activation functions. In Advances in Neural Information Processing Systems 31, pages 4939–4948. 2018. \ No newline at end of file diff --git a/robustnessguaranteesfordeepneuralnetworksonvideos/images.zip b/robustnessguaranteesfordeepneuralnetworksonvideos/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6c6b097a7b69ef6dd7251052d9a995f26923a93a --- /dev/null +++ b/robustnessguaranteesfordeepneuralnetworksonvideos/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19626f28621984fc24474bb4482c4401aac70625a38fdf32b0c25bc2d1b43b9f +size 413544 diff --git a/robustnessguaranteesfordeepneuralnetworksonvideos/layout.json b/robustnessguaranteesfordeepneuralnetworksonvideos/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2861472a0057d20df1077b0ef940b572f589a63c --- /dev/null +++ b/robustnessguaranteesfordeepneuralnetworksonvideos/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0fa55f104798a622b9a87f248864998c85567f6a5665f73a3f9d17ecc300f38 +size 584468 diff --git a/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_content_list.json b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ed036967caf65d622018cf4e8e8294bcc612f3e2 --- /dev/null +++ b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dadcbd79a36582c1d052b307477adce96af01bece0e1aca4ed89f0827866a66 +size 80292 diff --git a/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_model.json b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6341cdbda26c813601d2d48ecf5f57d7507976aa --- /dev/null +++ b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:323f4b3bec2193199f07878beb10710e11479426507ae5ae8d60dddf3346d45e +size 95841 diff --git a/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_origin.pdf b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0d06bf1f615dc5087988ba6c2baa9469546b5e6c --- /dev/null +++ b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/8bf8cc8d-ee94-49a9-8113-be6935eba97f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2baff2ad1afd2a75055127341b180f5bd748d2c6ffe221932ccd86c26c6fcea4 +size 3711796 diff --git a/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/full.md b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..25655c704a1ea0d9ac8bd2ea7691f199fd4d4f36 --- /dev/null +++ b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/full.md @@ -0,0 +1,344 @@ +# Robust Object Detection under Occlusion with Context-Aware CompositionalNets + +Angtian Wang* Yihong Sun* Adam Kortylewski† Alan Yuille† Johns Hopkins University + +# Abstract + +Detecting partially occluded objects is a difficult task. Our experimental results show that deep learning approaches, such as Faster R-CNN, are not robust at object detection under occlusion. Compositional convolutional neural networks (CompositionalNets) have been shown to be robust at classifying occluded objects by explicitly representing the object as a composition of parts. In this work, we propose to overcome two limitations of CompositionalNets which will enable them to detect partially occluded objects: 1) CompositionalNets, as well as other DCNN architectures, do not explicitly separate the representation of the context from the object itself. Under strong object occlusion, the influence of the context is amplified which can have severe negative effects for detection at test time. In order to overcome this, we propose to segment the context during training via bounding box annotations. We then use the segmentation to learn a context-aware CompositionalNet that disentangles the representation of the context and the object. 2) We extend the part-based voting scheme in CompositionalNets to vote for the corners of the object's bounding box, which enables the model to reliably estimate bounding boxes for partially occluded objects. Our extensive experiments show that our proposed model can detect objects robustly, increasing the detection performance of strongly occluded vehicles from PASCAL3D+ and MS-COCO by $41\%$ and $35\%$ respectively in absolute performance relative to Faster R-CNN. + +# 1. Introduction + +In natural images, objects are surrounded and partially occluded by other objects. Recognizing partially occluded objects is a difficult task since the appearances and shapes of occluders are highly variable. Recent work [42, 21] has shown that deep learning approaches are significantly less robust than humans at classifying partially occluded ob + +![](images/476b69dccf17151dc87677ad8fd44b0dad8628c1f3a8bc24d4edf35c80818c9f.jpg) +Figure 1: Bicycle detection result for an image of the MS-COCO dataset. Blue box: ground truth; red box: detection result by Faster R-CNN; green box: detection result by context-aware CompositionalNet. Probability maps of three-point detection are to the right. The proposed context-aware CompositionalNet are able to detect the partially occluded object robustly. + +![](images/ee46b3cbccd112d453d15f4ae15709ed39795ae1f774049d6d8945117011f2c2.jpg) +# + +![](images/c9734b6ea9bbd89119f2b7163d7bdd833a6b258d763189d7beca016bebc498cf.jpg) +C + +![](images/3e0eb61278a324f4328ea5c65e52445f82ac443b25ee91ceded3bb0c0012c63e.jpg) +Rrrnne + +jects. Our experimental results show that this limitation of deep learning approaches is even amplified in object detection. In particular, we find that Faster R-CNN is not robust under partial occlusion, even when it is trained with strong data augmentation with partial occlusion. Our experiments show that this is caused by two factors: 1) The proposal network does not localize objects accurately under strong occlusion. 2) The classification network does not classify partially occluded objects robustly. Thus, our work highlights key limitations of deep learning approaches to object detection under partial occlusion that need to be addressed. + +In contrast to deep convolutional neural networks (DCNNs), compositional models can robustly classify partially occluded objects from a fixed viewpoint [11, 19] and detect semantic parts of partially occluded object [34, 40]. These models are inspired by the compositionality of human cognition [2, 33, 10, 3] and share similar characteristics with biological vision systems, such as bottom-up sparse compositional encoding and top-down attentional modulations found in the ventral stream [30, 29, 5]. Recent work [20] proposed the Compositional Convolutional Neural Network + +(CompositionalNet), a generative compositional model of neural feature activations that can robustly classify images of partially occluded objects. This model explicitly represents objects as compositions of parts, which are combined with a voting scheme that enables a robust classification based on the spatial configuration of a few visible parts. However, we find that CompositionalNets as proposed in [20] are not suitable for object detection because of two major limitations: 1) CompositionalNets, as well as other DCNN architectures, do not explicitly disentangle the representation of the context from that of the object. Our experiments show that this has negative effects on the detection performance since context is often biased in the training data (e.g. airplanes are often found in blue background). If objects are strongly occluded, the detection thresholds must be lowered. This in turn increases the influence of the objects' context and leads to false-positive detections in regions with no object (e.g. if a strongly occluded car must be detected, a false airplane might be detected in the sky, seen in Figure 4). 2) CompositionalNets lack mechanisms for robustly estimating the bounding box of the object. Furthermore, our experiments show that region proposal networks do not estimate the bounding boxes robustly when objects are partially occluded. + +In this work, we propose to build on and significantly extend CompositionalNets in order to enable them to detect partially occluded objects robustly. In particular, we introduce a detection layer and propose to decompose the image representation as a mixture of context and object representation. We obtain such decomposition by generalizing contextual features in the training data via bounding box annotations. This context-aware image representation enables us to control the influence of the context on the detection result. Furthermore, we introduce a robust voting mechanism to estimate the bounding box of the object. In particular, we extend the part-based voting scheme in CompositionalNets to also vote for two opposite corners of the bounding box in addition to the object center. + +Our extensive experiments show that the proposed context-aware CompositionalNets with robust bounding box estimation detect objects robustly even under severe occlusion (Figure 1), increasing the detection performance on strongly occluded vehicles from PASCAL3D+ [38] and MS-COCO [26] by $41\%$ and $35\%$ respectively in absolute performance relative to Faster R-CNN. In summary, we make several important contributions in this work: + +1. We propose to decompose the image representation in CompositionalNets as a mixture model of context and object representation. We demonstrate that such context-aware CompositionalNets allow for precise control of the influence of the object's context on the detection result, hence, increasing the robustness when classifying strongly occluded objects. + +2. We propose a robust part-based voting mechanism for bounding box estimation that enables the accurate estimation of an object's bounding box even under severe occlusion. + +3. Our experiments demonstrate that context-aware Com-positionalNets combined with a part-based bounding box estimation outperform Faster R-CNN networks at object detection under partial occlusion by a significant margin. + +# 2. Related Work + +Region selection under occlusion. The detection of an object involves the estimation of its location, class and bounding box. While a search over the image can be implemented efficiently, e.g. using a scanning window [24], the number of potential bounding boxes is combinatorial with the number of pixels. The most widely applied approach for solving this problem is to use Region Proposal Networks (RPNs) [13] which enable the learning of fast approaches to object detection [12, 28, 4]. However, our experiments demonstrate that RPNs do not estimate the bounding box of an object correctly under occlusion. + +Image classification under occlusion. The classification network in deep object detection approaches is typically chosen to be a DCNN, such as ResNet [14] or VGG [32]. However, recent work [42, 21] has shown that standard DCNNs are significantly less robust to partial occlusion compared to humans. A potential approach to overcome this limitation of DCNNs is to use data augmentation with partial occlusion [8, 39] or top-down cues [36]. However, our experiments demonstrate that data augmentation approaches have only a limited impact on the generalization of DCNNs under occlusion. In contrast to deep learning approaches, generative compositional models [17, 43, 9, 6, 23] have proven to be robust to partial occlusion in the context of detecting object parts [34, 19, 40] and recognizing objects from a fixed viewpoint [11, 22]. Additionally, CompositionalNets [20], which integrate compositional models with DCNN architecture, were shown to be significantly more robust for image classification under occlusion. + +Object Detection under occlusion. Sheng [37] et al. propose a boosted cascade framework for detecting partially visible objects. However, their approach uses handcrafted features and can only be applied to images where objects are artificially occluded by cutting out image patches. Additionally, a number of deep learning approaches have been proposed for detecting occluded objects [31, 27]; however, these methods require detailed part-level annotations to reconstruct the occluded objects. Xiang and Savarese [35] propose to use 3D models and to treat occlusion as a multi-label classification task. However, in a real-world scenario, the classes of occluders can be difficult to model in 3D and + +are often not known a priori (e.g. the particular type of fence in Figure 1). Also, other approaches are based on videos or stereo images [25, 16], however, we focus on object detection in still images. Most related to our work is part-based voting approaches [41, 15] that have proven to work reliably for semantic part detection under occlusion. However, these methods assume a fixed size bounding box which limits their applicability in the context of object detection. + +In this work, we extend CompositionalNets to context-aware object detectors with a part-based voting mechanism that can robustly estimate the object's bounding box even under very strong partial occlusion. + +# 3. Object Detection with CompositionalNets + +In Section 3.1 we discuss prior work on Compositional-Nets. We propose a generalization of CompositionalNets to detection in Section 3.2, introducing a detection layer and a robust bounding box estimation mechanism. Finally, we introduce context-aware CompositionalNets in Section 3.3, enabling the model to separate the context from the object representation, making it robust to contextual biases in the training data, while still being able to leverage contextual information under strong occlusion. + +Notation. The output of a layer $l$ in a DCNN is referenced as feature map $F^l = \psi (I,\Omega)\in \mathbb{R}^{H\times W\times D}$ , where $I$ is the input image and $\Omega$ are the parameters of the feature extractor. Feature vectors are vectors in the feature map $f_{p}^{l}\in \mathbb{R}^{D}$ at position $p$ , where $p$ is defined on the 2D lattice of $F^l$ with $D$ being the number of channels in the layer. We omit subscript $l$ in the following for convenience because this layer is fixed a priori in our experiments. + +# 3.1. Prior work: CompositionalNets + +CompositionalNets [20] are DCNNs with an inherent robustness to partial occlusion. Their architecture resembles that of a VGG-16 network [32], where the fully connected head is replaced with a differentiable generative compositional model of the feature activations $p(F|y)$ and $y$ is the category of the object. The compositional model is defined as a mixture of von-Mises-Fisher (vMF) distributions: + +$$ +p (F | \Theta_ {y}) = \sum_ {m} \nu_ {m} p (F | \theta_ {y} ^ {m}), \tag {1} +$$ + +$$ +p \left(F \mid \theta_ {y} ^ {m}\right) = \prod_ {p} p \left(f _ {p} \mid \mathcal {A} _ {p, y}, \Lambda\right), \tag {2} +$$ + +$$ +p \left(f _ {p} \mid \mathcal {A} _ {p, y}, \Lambda\right) = \sum_ {k} \alpha_ {p, k, y} p \left(f _ {p} \mid \lambda_ {k}\right), \tag {3} +$$ + +with $\{\nu_{m}\in \{0,1\} ,\sum_{m = 1}^{M}\nu_{m} = 1\}$ . Here $M$ is the number of mixtures of compositional models and $\nu_{m}$ is a binary assignment variable that indicates which mixture component is active. $\Theta_y = \{\theta_y^m = \{\mathcal{A}_y^m,\Lambda \} |m = 1,\dots ,M\}$ are the + +![](images/237c38736ed57692b90e58b0df492c1251ca060fef158d0cf10f08ed4b8af482.jpg) +Figure 2: Object detection under occlusion with RPNs and proposed robust bounding box voting. Blue box: ground truth; red box: Faster R-CNN (RPN+VGG); yellow box: RPN+CompositionalNet; green box: context-aware CompositionalNet with robust bounding box voting. Note how the RPN-based approaches fail to localize the object, while our proposed approach can accurately localize the object. + +overall compositional model parameters and $\mathcal{A}_y^m = \{\mathcal{A}_{p,y}^m\}$ are the parameters of the mixture components at every position $p\in \mathcal{P}$ on the 2D lattice of the feature map $F$ .In particular, $\mathcal{A}_{p,y}^{m} = \{\alpha_{p,0,y}^{m},\dots ,\alpha_{p,K,y}^{m}|\sum_{k = 0}^{K}\alpha_{p,k,y}^{m} = 1\}$ are the vMF mixture coefficients, $K$ is the number of mixture components and $\Lambda = \{\lambda_k = \{\sigma_k,\mu_k\} |k = 1,\ldots ,K\}$ are the parameters of the vMF mixture distributions: + +$$ +p \left(f _ {p} \mid \lambda_ {k}\right) = \frac {e ^ {\sigma_ {k} \mu_ {k} ^ {T} f _ {p}}}{Z \left(\sigma_ {k}\right)}, \| f _ {p} \| = 1, \| \mu_ {k} \| = 1, \tag {4} +$$ + +where $Z(\sigma_k)$ is the normalization constant. The model parameters $\{\Omega, \{\Theta_y\}\}$ can be trained end-to-end as described in [20]. + +Occlusion modeling. Following the approach presented in [19], CompositionalNets can be augmented with an occlusion model. Intuitively, an occlusion model defines a robust likelihood, where at each position $p$ in the image either the object model $p(f_{p}|\mathcal{A}_{p,y}^{m},\Lambda)$ or an occluder model $p(f_{p}|\beta ,\Lambda)$ is active: + +$$ +\begin{array}{l} p \left(F \mid \Theta_ {y} ^ {m}, \beta\right) = \prod_ {p} p \left(f _ {p}, z _ {p} ^ {m} = 0\right) ^ {1 - z _ {p} ^ {m}} p \left(f _ {p}, z _ {p} ^ {m} = 1\right) ^ {z _ {p} ^ {m}}, (5) \\ p \left(f _ {p}, z _ {p} ^ {m} = 1\right) = p \left(f _ {p} \mid \beta , \Lambda\right) p \left(z _ {p} ^ {m} = 1\right), (6) \\ p \left(f _ {p}, z _ {p} ^ {m} = 0\right) = p \left(f _ {p} \mid \mathcal {A} _ {p, y} ^ {m}, \Lambda\right) (1 - p \left(z _ {p} ^ {m} = 1\right)). (7) \\ \end{array} +$$ + +The binary variables $\mathcal{Z}^m = \{z_p^m\in \{0,1\} |p\in \mathcal{P}\}$ indicate if the object is occluded at position $p$ for mixture component + +![](images/5e79aaf57100d8f7bc07ed7c5fd0ef13a520c471e3e1a9574c5b05975cb1715f.jpg) +Figure 3: Example of robust bounding box voting results. Blue box: ground truth; red box: bounding box by Faster R-CNN; green box: bounding box generated by robustly combining voting results. Our proposed part-based voting mechanism generates probability maps (right) for the object center (cyan point), the top left corner (purple point) and the bottom right corner (yellow point) of the bounding box. + +$m$ . The occluder model is defined as a mixture model: + +$$ +\begin{array}{l} p \left(f _ {p} | \beta , \Lambda\right) = \prod_ {n} p \left(f _ {p} | \beta_ {n}, \Lambda\right) ^ {\tau_ {n}} (8) \\ = \prod_ {n} \left(\sum_ {k} \beta_ {n, k} p \left(f _ {p} \mid \sigma_ {k}, \mu_ {k}\right)\right) ^ {\tau_ {n}}, (9) \\ \end{array} +$$ + +where $\{\tau_n\in \{0,1\} ,\sum_n\tau_n = 1\}$ indicates which component of the occluder model best explains the data. The parameters of the occluder model $\beta_{n}$ can be learned in an unsupervised manner from clustered features of random natural images that do not contain any object of interest. + +# 3.2. Detection with Robust Bounding Box Voting + +A natural way of generalizing CompositionalNets to object detection is to combine them with RPNs. However, our experiments in Section 4.1 show that RPNs cannot reliably localize strongly occluded objects. Figure 2 illustrates this limitation by depicting the detection results of Faster R-CNN trained with CutOut [8] (red box) and a combination of $\mathrm{RPN + }$ CompositionalNet (yellow box). We propose to address this limitation by introducing a robust part-based voting mechanism to predict the bounding box of an object based on the visible object parts (green box). + +CompositionalNets with detection layer. CompositionalNets as introduced in [20] are part-based object representations. In particular, the object model $p(F|\Theta_y)$ is decomposed into a mixture of compositional models $p(F|\theta_y^m)$ , where each mixture component represents the object class $y$ from a different pose [20]. During inference, each mixture component accumulates votes from part models $p(f_p|A_{p,y})$ across different spatial positions $p$ of the feature map $F$ . Note that CompositionalNets are learned from images that are cropped based on the bounding box of the object [20]. By making the object centered in the image (see Figure 5), each mixture component $p(F|\theta_y^m)$ can be thought + +![](images/68d3889c754fd2728ccf7dab72103a2c08457157c4558a7f43f715f3de8c4bc6.jpg) +Figure 4: Influence of context in aeroplane detection under occlusion. Blue box: ground truth; orange box: bounding box by CompositionalNets ( $\omega = 0.5$ ); green box: bounding box by Context-Aware CompositionalNets ( $\omega = 0.2$ ). Probability maps of the object center are on the right. Note how reducing the influence of the context improves the localization response. + +of as accumulating votes from the part models for the object being in the center of the feature map. + +Based on this intuition, we generalize Compositional-Nets to object detection by introducing a detection layer that accumulates votes for the object center over all positions $p$ in the feature map $F$ . In order to achieve this, we propose to compute the object likelihood by scanning. Thus, we shift the feature map w.r.t. the object model along all points $p$ from the 2D lattice of the feature map. This process will generate a spatial likelihood map: + +$$ +R = \left\{p \left(F _ {p} \mid \Theta_ {y}\right) \mid p \in \mathcal {P} \right\}, \tag {10} +$$ + +where $F_{p}$ denotes the feature map centered at the position $p$ . Using this generalization we can perform object localization by selecting all maxima in $R$ above a threshold $t$ after non-maximum suppression. Our proposed detection layer can be implemented efficiently with modern hardware using convolution-like operations. + +Robust bounding box voting. While Compositional-Nets can be generalized to localize partially occluded objects using our proposed detection layer, estimating the bounding box of an object under occlusion is more difficult because a significant amount of the object might not be visible (Figure 3). We propose to solve this problem by generalizing the part-based voting mechanism in CompositionalNets to vote for the bounding box corners in addition to the object center. In particular, we learn additional mixture components that model the expected feature activations $F$ around bounding box corners $p(F_{p}|\Theta_{y}^{c})$ , where $c = \{ct,bl,tr\}$ are the object center $ct$ and two opposite bounding box corners $\{bl,tr\}$ . Figure 3 illustrates the spatial likelihood maps $R^c$ of all three models. We generate a bounding box using the two points that have maximal likelihood. Note how the bounding boxes can be localized accurately despite large parts of the object being occluded. + +![](images/55bcbf6bd07fcbb1d2db545b82fc1225247084147fc7c49a984245ea15a90a4f.jpg) + +![](images/69f880cd417a795f92389c2ff746bab544e4059d6b09d46e5da33b8c1bde2cdc.jpg) +Figure 5: Context segmentation results. A standard CompositionalNet learns a joint representation of the image including the context. Our context-aware CompositionalNet will disentangle the representation of the context from that of the object based on the illustrated segmentation masks. + +![](images/d9a9a1b83e82eae1e2375bc4cdb89634fe821ffa5a9086f4ca91ce8a33723a4b.jpg) + +![](images/8a41d6ddb3ff139c41f151dc106b378b2b69120f2ce902ff6cf3eb19ed9e38e2.jpg) + +![](images/6166ea21a4d02ed65c040331961f644fd047bea260cc70487bfb3ed1ffde08da.jpg) + +![](images/022b7e5b83ab17acc3ed846fe8c11a3f49d418090598246612e061a124ffe53d.jpg) + +We discuss how the parameters of all models can be learned jointly in an end-to-end manner in Section 3.4. + +# 3.3. Context-aware CompositionalNets + +CompositionalNets, as well as standard DCNNs, do not separate the representation of the context from the object. The context can be useful for recognizing objects due to biases, e.g. aeroplanes are often surrounded by blue sky. Relying too strongly on context can be misleading when objects are strongly occluded (Figure 4), since the detection thresholds must be lowered under strong occlusion. This in turn increases the influence of the objects' context and leads to false-positive detection in regions with no object. Hence, it is important to have control over the influence of contextual cues on the detection result. + +In order to gain control over the influence of context, we propose a Context-aware CompositionalNets (CA-CompositionalNets), which separates the representation of the context from the object in the original CompositionalNets by representing the feature map $F$ as a mixture of two models: + +$$ +p \left(f _ {p} \mid \mathcal {A} _ {p, y} ^ {m}, \chi_ {p, y} ^ {m}, \Lambda\right) = \omega p \left(f _ {p} \mid \chi_ {p, y} ^ {m}, \Lambda\right) + \tag {11} +$$ + +$$ +(1 - \omega) p \left(f _ {p} \mid \mathcal {A} _ {p, y} ^ {m}, \Lambda\right). \tag {12} +$$ + +Here, $\chi_{p,y}^{m}$ are the parameters of the context model that is defined to be a mixture of vMF likelihoods (Equation 3). The parameter $\omega$ is a prior that controls the trade-off between context and object, which is fixed a priori at test time. Note that setting $\omega = 0.5$ retains the original CompositionaNet as proposed in [20]. Figure 4 illustrates the benefits of reducing the influence of the context on the detection result under partial occlusion. The context parameters $\chi_{p,y}^{m}$ and object parameters $\mathcal{A}_{p,y}^{m}$ can be learned from the training data using maximum likelihood estimation. However, this presumes an assignment of the feature vectors $f_{p}$ in the training data to either the context or the object. + +Context segmentation. Therefore, we propose to segment the training images into context and object based on the available bounding box annotation. Here, our assumption is that any feature that has a receptive field outside of the scope of the bounding boxes would be considered as a part of the context. We first randomly extract features that are considered to be context into a population during training. Then, we cluster the population using K-means++ algorithm[1] and receive a dictionary of context feature centers $E = \{e_q \in \mathbb{R}^D | q = 1, \dots, Q\}$ . We apply a threshold on the cosine similarity $s(E, f_p) = \max_q[(e_q^T f_p) / (\| e_q \| \| f_p \|)]$ to segment the context and the object in any given training image (Figure 5). + +# 3.4. Training Context-Aware CompositionalNets + +We train our proposed CA-CompositionalNet including the robust bounding box voting mechanism jointly end-to-end using backpropagation. Overall, the trainable parameters of our models are $T^{c} = \{\Omega, \Lambda, \{\Theta_{y}^{c}\}, \{\chi_{y}^{c}\}\}$ where $c \in \{ct, bl, tr\}$ . The loss function has three main objectives: optimizing the parameters of the generative compositional model such that it can explain the data with maximal likelihood $(\mathcal{L}_{g})$ , while also localizing $(\mathcal{L}_{detect})$ and classifying $(\mathcal{L}_{cls})$ the object accurately in the training images. While $\mathcal{L}_{g}$ is learned from images $\hat{I}^{c}$ with feature maps $F^{c}$ that are centered at $c \in \{c, bl, tr\}$ , the other losses are learned from unaligned training images $I$ with feature maps $F$ . + +Training Classification with Regularization. We optimize the parameters jointly using SGD: + +$$ +\mathcal {L} _ {\text {c l s}} \left(y, y ^ {\prime}\right) = \mathcal {L} _ {\text {c l a s s}} \left(y, y ^ {\prime}\right) + \mathcal {L} _ {\text {w e i g h t}} (\Omega) \tag {13} +$$ + +where $\mathcal{L}_{\text{class}}(y, y')$ is the cross-entropy loss between the network output $y' = \psi(I, \Omega)$ and the true class label $y$ . We use a temperature $\mathcal{T}$ in the softmax classifier: $f(y)_i = \frac{e^{y_i \cdot \mathcal{T}}}{\sum_i e^{y_i \cdot \mathcal{T}}}$ . $\mathcal{L}_{\text{weight}} = \| \Omega \|_2^2$ is a weight regularization on the DCNN parameters. + +Training the generative context-aware CompositionalNet. The overall loss function for training the parameters of the generative context-aware model is composed of two terms: + +$$ +\mathcal {L} _ {g} \left(F ^ {c}, T\right) = \mathcal {L} _ {v m f} \left(F ^ {c}, \Lambda\right) \tag {14} +$$ + +$$ ++ \sum_ {c} \sum_ {p} \mathcal {L} _ {\text {c o n}} \left(f _ {p} ^ {c}, \mathcal {A} _ {y} ^ {c}, \chi_ {y} ^ {c}\right) \tag {15} +$$ + +In order to avoid the computation of the normalization constants $\{Z[\sigma_k]\}$ , we assume that the vMF variances $\{\sigma_k\}$ are constant. Under this assumption, the vMF parameters $\{\mu_k\}$ can be optimized with the loss $\mathcal{L}_{vmf}(F,\Lambda) = \mathcal{C}\sum_{p}\min_{k}\mu_{k}^{T}f_{p}$ , where $\mathcal{C}$ is a constant factor [20]. The parameters of the context-aware model $\mathcal{A}_y^c$ and $\chi_y^c$ are learned by optimizing the context loss: + +$$ +\mathcal {L} _ {\text {c o n}} \left(f _ {p}, \mathcal {A} _ {y} ^ {c}, \chi_ {y} ^ {c}\right) = \pi_ {p} \mathcal {L} _ {\text {m i x}} \left(f _ {p}, \mathcal {A} _ {p, y} ^ {c}\right) \tag {16} +$$ + +where $\pi_p\in \{0,1\}$ is a context assignment variable that indicates if a feature vector $f_{p}$ belongs to the context or to the object model. We estimate the context assignments a priori using segmentation as described in Section 3.3. Given the assignments we can optimize the model parameters $\mathcal{A}_{p,y}^{c}$ by minimizing [21]: + +$$ +\mathcal {L} _ {m i x} \left(F, \mathcal {A} _ {y} ^ {c}\right) = - \sum_ {p} \left(1 - z _ {p} ^ {\uparrow}\right) \log \left[ \sum_ {k} \alpha_ {p, k, y} ^ {m \uparrow , c} p \left(f _ {p} \mid \lambda_ {k}\right) \right] \tag {17} +$$ + +The context parameters $\chi_{p,y}^{c}$ can be learned accordingly. Here, $z_{p}^{\uparrow}$ and $m^{\uparrow}$ denote the variables that were inferred in the forward process. Note that the parameters of the occluder model are learned a priori and then fixed. + +Training for localization and bounding box localization. We denote the normalized response map of the ground truth class as $X^{c} \in \mathbb{R}^{H \times W}$ and the ground truth annotation as $\bar{X}^{c} \in \mathbb{R}^{H \times W}$ . The elements of the response map are computed as: + +$$ +x _ {p} ^ {c} = \frac {x _ {p , \hat {m}}}{\sum_ {p} x _ {p , \hat {m}}}, \hat {m} = \underset {m} {\operatorname {a r g m a x}} \underset {p} {\max } p \left(f _ {p} \mid \mathcal {A} _ {p, y} ^ {m}, \chi_ {p, y} ^ {m}, \Lambda\right). \tag {18} +$$ + +The ground truth map $\bar{X}^c$ is a binary map where the ground truth position is set to $X^c(c) = 1$ and all other entries are set to zero. The detection loss is then defined as: + +$$ +\mathcal {L} _ {\text {d e t e c t}} \left(X ^ {c}, \bar {X} ^ {c}, F, T ^ {c}\right) = 1 - \frac {2 \cdot \sum_ {p} \left(x _ {p} ^ {c} \cdot \bar {x} _ {p} ^ {c}\right)}{\sum_ {p} x _ {p} ^ {c} + \sum_ {p} \bar {x} _ {p} ^ {c}} \tag {19} +$$ + +End-to-end training. We train all parameters of our model end-to-end with backpropagation. The overall loss function is: + +$$ +\begin{array}{l} \mathcal {L} = \mathcal {L} _ {c l s} \left(y, y ^ {\prime}\right) + \sum_ {c} \left(\epsilon_ {1} \mathcal {L} _ {g} \left(F ^ {c}, T ^ {c}\right) \right. (20) \\ + \epsilon_ {2} \mathcal {L} _ {\text {d e t e c t}} \left(X ^ {c}, \bar {X} ^ {c}, F, T ^ {c}\right)) (21) \\ \end{array} +$$ + +$\epsilon_{1}, \epsilon_{2}$ control the trade-off between the loss terms. The optimization process is discussed in more detail in Section 4. + +# 4. Experiments + +We perform experiments on object detection under artificially-generated and real-world occlusion. + +Datasets. While it is important to evaluate algorithms on real images of partially occluded objects, simulating occlusion enables us to quantify the effects of partial occlusion more accurately. Inspired by the success of datasets with artificially-generated occlusion in image classification [15], we propose to generate an analogous dataset for object detection. In particular, we build on the PASCAL3D+ dataset, which contains 12 classes of unoccluded objects. We synthesize an OccludedVehiclesDetection dataset similar to the + +![](images/500f8f191a3e7cfbf7c6ca01cedf79794ddfc7f41afd2ce6622a007336bea95f.jpg) +Figure 6: Example of images in OccludedVehiclesDetection dataset. Each row shows increasing amounts of context occlusion, whereas each column shows increasing amounts of object occlusion. + +dataset proposed in [15] for classification, which contains 6 classes of vehicles at a fixed scale (224 pixels) and various levels of occlusion. The occluders, which include humans, animals and plants, are cropped from the MS-COCO dataset [26]. In an effort to accurately depict real-world occlusions, we superimpose the occluders onto the object, such that the occluders are placed not only inside the bounding box of the objects, but also on the background. We generate the dataset in a total of 9 occlusion levels along two dimensions. We define three levels of object occlusion: FG-L1: $20 - 40\%$ , FG-L2: $40 - 60\%$ and FG-L3: $60 - 80\%$ of the object area occluded. Furthermore, we define three levels of context occlusion around the object: BG-L1: $0 - 20\%$ , BG-L2: $20 - 40\%$ and BG-L3: $40 - 60\%$ of the context area occluded. An example of occlusion levels are showed in Figure 6. + +In order to evaluate the tested models on real-world occlusions, we test them on a subset of the MS-COCO dataset. In particular, we extract the same classes of objects and scale as in the OccludedVehiclesDetection dataset from the MS-COCO dataset. We select occluded images and manually separate them into two groups: light occlusion (2 sub-levels) and heavy occlusions (3 sub-levels), with increasing occlusion levels. This dataset is built from images in both Training2017 and Val2017 set of MS-COCO due to a limited amount of heavily occluded objects in MS-COCO Dataset. The light occlusion set contains 2890 images, and the heavy occlusion set contains 788 images. We term this dataset OccludedCOCO. + +Evaluation. In order to exclusively observe the effects of foreground and background occlusions on various models, we only consider the occluded object in the image for evaluation. Evidently, for the majority of the dataset, there is often only one object of a particular class that is present in the image. This enables us to quantify the effects of levels of occlusions in the foreground and background on the + +
methodFG L0FG L1FG L2FG L3Mean -
BG L0BG L1BG L2BG L3BG L1BG L2BG L3BG L1BG L2BG L3
Faster R-CNN98.088.885.883.672.966.060.746.336.127.066.5
Faster R-CNN with reg.97.489.586.389.276.770.667.854.245.037.571.1
CA-CompNet via RPN ω=0.574.268.267.667.261.460.359.646.248.046.960.0
CA-CompNet via RPN ω=073.167.066.366.159.460.658.647.949.946.559.6
CA-CompNet via BBV ω=0.591.785.886.586.578.077.277.961.861.259.876.6
CA-CompNet via BBV ω=0.292.687.988.588.682.282.281.171.569.968.281.3
CA-CompNet via BBV ω=094.089.289.088.482.581.680.772.069.866.881.4
+ +Table 1: Detection results on the Occluded VehiclesDetection dataset under different levels of occlusions (BBV as in Bounding Box Voting). All models trained on PASCAL3D+ unoccluded dataset except Faster R-CNN with reg. was trained with CutOut. The results are measured by correct AP(\%) @IoU0.5, which means only corrected classified images with IoU > 0.5 of first predicted bounding box are treated as true-positive. Notice with $\omega = 0.5$ , context-aware model reduces to a CompositionalNet as proposed in [20]. + +
methodlight occ.heavy occ.
L0L1L2L3L4
Faster R-CNN81.766.159.040.824.6
Faster R-CNN with reg.84.371.863.345.033.3
Faster R-CNN with occ.85.176.166.050.745.6
CA-CompNet via RPN ω=062.055.049.745.438.6
CA-CompNet via BBV ω=0.583.577.170.851.740.4
CA-CompNet via BBV ω=0.288.782.277.865.459.6
CA-CompNet via BBV ω=091.883.676.261.154.4
+ +Table 2: Detection results on OccludedCOCO Dataset, measured by $\mathrm{AP}(\%)$ @IoU0.5. All models are trained on PASCAL3D+ dataset, Faster R-CNN with reg. is trained with CutOut and Faster R-CNN with occ. is trained with images in the same dataset but occluded by all levels of occlusion with the same set of occluders. + +accuracy of the model predictions. Thus, the means of object detection evaluation must be altered for our proposed occlusion dataset. Given any model, we only evaluate the bounding box proposal with the highest confidence given by the classifier via IoU at $50\%$ . + +Runtime. The convolution-like detection layer has an inference time of 0.3s per image. + +Training setup. We implement the end-to-end training of our CA-CompositionalNet with the following parameter settings: training minimizes loss described in Equation 20, with $\epsilon_{1} = 0.2$ and $\epsilon_{2} = 0.4$ . We applied the Adam Optimizer [18] with various learning rates of $lr_{vgg} = 2 \cdot 10^{-6}$ , $lr_{vc} = 2 \cdot 10^{-5}$ , $lr_{mixture\_model} = 5 \cdot 10^{-5}$ and $lr_{corner\_model} = 5 \cdot 10^{-5}$ on different parts of CompositionalNets. The model is trained for a total of 2 epochs with 10600 iteration per epoch. The training costs in total of 3 hours on a machine with 4 NVIDIA TITAN Xp GPUs. + +Faster R-CNN is trained for 30000 iterations, with a learning rate, $lr = 1 \cdot 10^{-3}$ , and a learning rate decay, + +$lr_{decay} = 0.1$ . Specifically, the pretrained VGG-16 [32] on the ImageNet dataset [7] was modified in its fully-connected layer to accommodate the experimental settings. In the experiment on OccludedCOCO, we set the threshold of Faster R-CNN to 0, preventing the occluded targets to be ignored due to low confidence and guarantees at least one proposal in the required class. + +# 4.1. Object Detection under Simulated Occlusion + +Table 1 shows the results of the tested models on the OccludedVehiclesDetection dataset (see Figure 7 for qualitative results). The models are trained on the images from the original PASCAL3D+ dataset with unoccluded objects. + +Faster R-CNN. As we evaluate the performance of the Faster R-CNN, we observe that under low levels of occlusion, the neural network performs well. In mid to high levels of occlusions, however, the neural network fails to detect the objects robustly. When trained with strong data augmentation in terms of partial occlusion using CutOut [8], the detection performance increases under strong occlusion. However, the model still suffers from a $59.9\%$ drop in performance on strong occlusion, compared to the non-occlusion setup. We suspect that the inaccurate prediction is due to two major factors: 1) The Region Proposal Network (RPN) in the Faster R-CNN is not able to predict accurate proposals of objects that are heavily occluded. 2) The VGG-16 classifier cannot successfully classify valid object regions under heavy occlusion. + +We proceed to investigate the performance of the region proposals on occluded images. In particular, we replace the VGG-16 classifier in the Faster R-CNN with a standard CompositionalNet classifier [20], which is expected to be more robust to occlusion. From the results in Table 1, we observe two phenomena: 1) In high levels of occlusion, the performance is better than Faster R-CNN. Thus, the CompositionalNet generalizes to heavy occlusions better than the VGG-16 classifier. 2) In low levels of occlu + +![](images/15d1d46e348f20d5123d33f2000da9d9a1b5efd9c10f7b25e088ac8c20ed2b36.jpg) + +![](images/4fe63c64b273bce2b427c8d266aebc720b937aa1340921db3c33d8acda5601fa.jpg) +Figure 7: Selected examples of detection results on the OccludedVehiclesDetection dataset. All of these 6 images are the heaviest occluded images (foreground level 3, background level 3). Blue box: ground truth; green box: proposals of CA-CompositionalNet via BB Voting; yellow box: proposals of CA-CompositionalNet via RPN; red box: proposals of Faster R-CNN. + +sion, the performance is worse than Faster R-CNN. The proposals generated by the RPN seem to be not accurate enough to be correctly classified, as CompositionalNets are high-precision models and require a precise alignment of the bounding box to the object center. + +Effect of robust bounding box voting. Our approach of estimating corners of the bounding box substantially improves the performance of the CompositionalNets, in comparison to the RPN. This further validates our conclusion that the CompositionalNet classifier requires precise proposals to classify objects correctly with partial occlusions. + +Effect of context-aware representation. With $\omega = 0.5$ , we observe that the precision of the detection decreases. Furthermore, the performance between $\omega = 0.5$ and $\omega = 0$ follows a similar trend over all three levels of foreground occlusions: the performance decreases as the level of background occlusion increases from BG-L1 to BG-L3. This further confirms our understanding of the effects of the context as a valuable source of information in object detection. + +# 4.2. Object Detection under Realistic Occlusion + +In the following, we evaluate our model on the OccludedCOCO dataset. As shown in Table 2 and Figure 8, our CA-CompositionalNet with robust bounding box voting outperforms Faster R-CNN and CompNet+RPN significantly. In particular, fully deactivating the context $(\omega = 0)$ increases the performance compared to the original model $(\omega = 0.5)$ , indicating that too much weight is put on the contextual information in the standard CompNets. Furthermore, controlling the prior of the context model to $\omega = 0.2$ reaches an optimal performance under strong occlusion where the context is helpful, but does slightly decrease the performance under low occlusion. + +![](images/ca836912593b518c9be33aa325f78229f1c591af08b42505739286df7ecd64e6.jpg) + +![](images/6369a5778e226acf863af08f2a3ef7b5047f7e4e2c20a4969e0f8d08abfd93dd.jpg) +Figure 8: Selected examples of detection results on OccludedCOCO Dataset. Blue box: ground truth; green box: proposals of CA-CompositionalNet via BB Voting; yellow box: proposals of CA-CompositionalNet via RPN; red box: proposals of Faster R-CNN. + +![](images/02d6624e77a40e38075def86451e81a1315e92c56747863761e7a0628b43de40.jpg) + +![](images/964e9374c0eb871f19d02bf240661541ccb1afd5fd76b9e9e77d955e22019364.jpg) + +![](images/aa7fbceb81b66582368d7b3450cda86695cd833bd17ceabfa038ba9c6d2d9c4c.jpg) + +![](images/ced8df8f14f52746107f5e8d760022ba2144bb2ada5e4786268ceded3c804e2c.jpg) + +# 5. Conclusion + +In this work, we studied the problem of detecting partially occluded objects under occlusion. We found that standard deep learning approaches that combine proposal networks with classification networks do not detect partially occluded objects robustly. Our experimental results demonstrate that this problem has two causes: 1) Proposal networks are more strongly misguided the more context is occupied by the occluders. 2) Classification networks do not classify partially occluded objects robustly. We made the following contributions to resolve these problems: + +CompositionalNets for object detection. CompositionalNets have proven to classify partially occluded objects robustly. We generalize CompositionalNets to object detection by extending their architecture with a detection layer. + +Robust bounding box voting. We proposed a robust part-based voting mechanism for bounding box estimation by leveraging the unoccluded parts of the object, which enabled the accurate estimation of an object's bounding box even under severe occlusion. + +Context-aware CompositionalNets. Compositional-Nets, and other DCNN-based classifiers, do not separate the representation of the context from that of the object. We proposed to segment the object from its context using bounding box annotations and showed how the segmentation can be used to learn a representation in an end-to-end manner that disentangles the context from the object. + +Acknowledgement. This work was partially supported by the Swiss National Science Foundation (P2BSP2.181713) and the Office of Naval Research (N00014-18-1-2119). + +# References + +[1] D. Arthur and S. Vassilvitskii. k-means++: The advantages of careful seeding. In Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 2007. 5 +[2] Elie Bienenstock and Stuart Geman. Compositionality in neural systems. In The Handbook of Brain Theory and Neural Networks, pages 223-226. 1998. 1 +[3] Elie Bienenstock, Stuart Geman, and Daniel Potter. Compositionality, mdI priors, and object recognition. In Advances in Neural Information Processing Systems, pages 838-844, 1997. 1 +[4] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. IEEE Conference on Computer Vision and Pattern Recognition, 2018. 2 +[5] Rasquinha R.J. Zhang K. Connor C.E. Carlson, E.T. A sparse object coding scheme in area v4. Current Biology, 2011. 1 +[6] Jifeng Dai, Yi Hong, Wenze Hu, Song-Chun Zhu, and Ying Nian Wu. Unsupervised learning of dictionaries of hierarchical compositional models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2505-2512, 2014. 2 +[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, 2009. 7 +[8] Terrance DeVries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 2, 4, 7 +[9] Sanja Fidler, Marko Boben, and Ales Leonardis. Learning a hierarchical compositional shape vocabulary for multiclass object representation. arXiv preprint arXiv:1408.5516, 2014. 2 +[10] Jerry A Fodor, Zenon W Pylyshyn, et al. Connectionism and cognitive architecture: A critical analysis. Cognition, 28(1-2):3-71, 1988. 1 +[11] Dileep George, Wolfgang Lehrach, Ken Kansky, Miguel Lázaro-Gredilla, Christopher Laan, Bhaskara Marthi, Xinghua Lou, Zhaoshi Meng, Yi Liu, Huayan Wang, et al. A generative vision model that trains with high data efficiency and breaks text-based captions. Science, 358(6368):eaag2612, 2017. 1, 2 +[12] Ross Girshick. Fast r-cnn. IEEE International Conference on Computer Vision, 2015. 2 +[13] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 580-587, 2014. 2 +[14] 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. 2 +[15] Z. Zhang J. Zhu L. Xie J. Wang, C. Xie and A. Yuille. Detecting semantic parts on partially occluded objects. British Machine Vision Conference, 2017. 3, 6 + +[16] Yin Li, Jian Sun and Sing Bing Kang. Symmetric stereo matching for occlusion handling. IEEE Conference on Computer Vision and Pattern Recognition, 2018. 3 +[17] Ya Jin and Stuart Geman. Context and hierarchy in a probabilistic image model. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition, volume 2, pages 2145-2152. IEEE, 2006. 2 +[18] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 7 +[19] Adam Kortylewski. Model-based image analysis for forensic shoe print recognition. PhD thesis, University_of_Basel, 2017. 1, 2, 3 +[20] Adam Kortylewski, Ju He, Qing Liu, and Alan Yuille. Compositional convolutional neural networks: A deep architecture with innate robustness to partial occlusion. IEEE Conference on Computer Vision and Pattern Recognition, 2020. 1, 2, 3, 4, 5, 7 +[21] Adam Kortylewski, Qing Liu, Huiyu Wang, Zhishuai Zhang, and Alan Yuille. Combining compositional models and deep networks for robust object classification under occlusion. arXiv preprint arXiv:1905.11826, 2019. 1, 2, 6 +[22] Adam Kortylewski and Thomas Vetter. Probabilistic compositional active basis models for robust pattern recognition. In British Machine Vision Conference, 2016. 2 +[23] Adam Kortylewski, Aleksander Wieczorek, Mario Wieser, Clemens Blumer, Sonali Parbhoo, Andreas Morel-Forster, Volker Roth, and Thomas Vetter. Greedy structure learning of hierarchical compositional models. arXiv preprint arXiv:1701.06171, 2017. 2 +[24] C. H. Lampert, M. B. Blaschko, and T. Hofmann. Beyond sliding windows: Object localization by efficient subwindow search. IEEE Conference on Computer Vision and Pattern Recognition, 2008. 2 +[25] Ang Li and Zejian Yuan. Symmnet: A symmetric convolutional neural network for occlusion detection. British Machine Vision Conference, 2018. 3 +[26] 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. 2, 6 +[27] N. Dinesh Reddy Minh Vo Srinivasa G. Narasimhan. Occlusion-net: 2d/3d occluded keypoint localization using graph networks. IEEE Conference on Computer Vision and Pattern Recognition, 2019. 2 +[28] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in Neural Information Processing Systems 28, 2015. 2 +[29] Chelazzi L. Connor C.E. Conway B.R. Fujita I. Gallant J.L. Lu H. Vanduffel W. Roe, A.W. Toward a unified theory of visual area v4. Neuron, 2012. 1 +[30] Emeric E. Stuphorn V. Connor C.E. Sasikumar, D. First-pass processing of value cues in the ventral visual pathway. Current Biology, 2018. 1 + +[31] Xiao Bian Zhen Lei Shifeng Zhang, Longyin Wen and Stan Z. Li. Occlusion-aware r-cnn: Detecting pedestrians in a crowd. arXiv preprint arXiv:1807.08407, 205. 2 +[32] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 2, 3, 7 +[33] Ch von der Malsburg. Synaptic plasticity as basis of brain organization. The Neural and Molecular Bases of Learning, 411:432, 1987. 1 +[34] Jianyu Wang, Cihang Xie, Zhishuai Zhang, Jun Zhu, Lingxi Xie, and Alan Yuille. Detecting semantic parts on partially occluded objects. British Machine Vision Conference, 2017. 1, 2 +[35] Yu Xiang and Silvio Savarese. Object detection by 3d aspectlets and occlusion reasoning. IEEE International Conference on Computer Vision, 2013. 2 +[36] Mingqing Xiao, Adam Kortylewski, Ruihai Wu, Siyuan Qiao, Wei Shen, and Alan Yuille. Tdapnet: Prototype network with recurrent top-down attention for robust object classification under partial occlusion. arXiv preprint arXiv:1909.03879, 2019. 2 +[37] Shengye Yan and Qingshan Liu. Inferring occluded features for fast object detection. Signal Processing, Volume 110, 2015. 2 +[38] Roozbeh Mottaghi Yu Xiang and Silvio Savarese. Beyond Pascal: A benchmark for 3d object detection in the wild. IEEE Winter Conference on Applications of Computer Vision, 2014. 2 +[39] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. arXiv preprint arXiv:1905.04899, 2019. 2 +[40] Zhishuai Zhang, Cihang Xie, Jianyu Wang, Lingxi Xie, and Alan L Yuille. Deepvoting: A robust and explainable deep network for semantic part detection under partial occlusion. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1372-1380, 2018. 1, 2 +[41] Jianyu Wang Lingxi Xie Alan L. Yuille Zhishuai Zhang, Cihang Xie. Deepvoting: A robust and explainable deep network for semantic part detection under partial occlusion. IEEE Conference on Computer Vision and Pattern Recognition, 2018. 3 +[42] Hongru Zhu, Peng Tang, Jeongho Park, Soojin Park, and Alan Yuille. Robustness of object recognition under extreme occlusion in humans and computational models. CogSci Conference, 2019. 1, 2 +[43] Long Leo Zhu, Chenxi Lin, Haoda Huang, Yuanhao Chen, and Alan Yuille. Unsupervised structure learning: Hierarchical recursive composition, suspicious coincidence and competitive exclusion. In European Conference on Computer Vision, pages 759-773. Springer, 2008. 2 \ No newline at end of file diff --git a/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/images.zip b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8345442d27db33bbdee072d14239d70b0fa31a00 --- /dev/null +++ b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2778edae425a7f3bd3ae6daec66c9e72bea2bba29cd7004e96a1fdeedc8f1b73 +size 629071 diff --git a/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/layout.json b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2d55749034c7a537a36d45c569694375261bca15 --- /dev/null +++ b/robustobjectdetectionunderocclusionwithcontextawarecompositionalnets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd861c2a577cb8f8a2759f6dbac09bc4f4f606622adb56dd74c2be55d8945b1f +size 417004 diff --git a/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_content_list.json b/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..10e4f9e26b6a1b05df053c1b06065c5343643f7a --- /dev/null +++ b/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f72cf090ab947c5ff42c38c789032b8da17fa6345b0966e520426b1cc0cae2b1 +size 79821 diff --git a/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_model.json b/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a0f14c521c38a3178e6fa9209be15182e26f3038 --- /dev/null +++ b/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52fdfc38a5abf4ee1927811f3ec9fa47c435465c4d40655b50a928dea6d49dfe +size 94963 diff --git a/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_origin.pdf b/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd56dcf0df01441077c9a55c20f2034561a8362e --- /dev/null +++ b/robustpartialmatchingforpersonsearchinthewild/67cc041f-8fc5-4c59-9921-b0232b280589_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69ded34990a652ea01cddf2beee7f1d030523322d624e64948edb4e6724623a7 +size 783710 diff --git a/robustpartialmatchingforpersonsearchinthewild/full.md b/robustpartialmatchingforpersonsearchinthewild/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5cd71dacbb1d37ca73dea0901c6e16061cc689d2 --- /dev/null +++ b/robustpartialmatchingforpersonsearchinthewild/full.md @@ -0,0 +1,359 @@ +# Robust Partial Matching for Person Search in the Wild + +Yingji Zhong $^{1}$ , Xiaoyu Wang $^{2,3}$ , Shiliang Zhang $^{1}$ $^{1}$ Peking University, $^{2}$ Intellifusion, $^{3}$ The Chinese University of Hong Kong, Shenzhen + $^{1}\{zhongyj, slzhang.jdl\} @pku.edu.cn, ^{2,3}$ fanghuaxue@gmail.com + +# Abstract + +Various factors like occlusions, backgrounds, etc., would lead to misaligned detected bounding boxes, e.g., ones covering only portions of human body. This issue is common but overlooked by previous person search works. To alleviate this issue, this paper proposes an Align-to-Part Network (APNet) for person detection and re-Identification (reID). APNet refines detected bounding boxes to cover the estimated holistic body regions, from which discriminative part features can be extracted and aligned. Aligned part features naturally formulate reID as a partial feature matching procedure, where valid part features are selected for similarity computation, while part features on occluded or noisy regions are discarded. This design enhances the robustness of person search to real-world challenges with marginal computation overhead. This paper also contributes a Large-Scale dataset for Person Search in the wild (LSPS), which is by far the largest and the most challenging dataset for person search. Experiments show that APNet brings considerable performance improvement on LSPS. Meanwhile, it achieves competitive performance on existing person search benchmarks like CUHK-SYSU and PRW. + +# 1. Introduction + +Thanks to recent research efforts [27, 17, 10, 8, 25, 22, 30, 34, 31], the performance of person re-Identification (reID) has been significantly improved. However, one potential issue with current reID setting is that, it treats person detection and reID as two isolated steps. This issue can be compensated by person search [24, 33, 1, 28, 3, 15] to jointly accomplish person detection and reID. Being able to jointly optimize person detection and reID, person search is attracting more and more attention, and is potential to present advantages in flexibility, efficiency, and accuracy. + +Compared with reID, person search needs to design pedestrian detectors robust to variances of scales, illuminations, backgrounds, occlusions, etc. Some person search works refine detectors by jointly training detectors and reID models [24, 15, 4, 3]. Although strong detectors are gen + +![](images/936ecf3b4a71bd4c23164a8c06d408fecce67a284be0c4e027db01cecc218b18.jpg) +Figure 1. Illustration of misaligned person bounding boxes and issues of person matching with global feature. Misalignments commonly occur in person search and can not be eliminated by training stronger detectors. This paper addresses this issue with bounding box alignment and partial matching. + +erally helpful for reID, they may still produce misaligned person bounding boxes. As shown in Fig. 1, occlusions and limited camera viewing field lead to many accurate but misaligned bounding boxes covering portions of pedestrians. Most of existing person search methods extracts global feature from the detected bounding boxes, no matter the joint models [24, 15] or the separate models [1, 28, 3]. As shown in Fig. 1, misalignment degrades the performance of global features, because it is not reasonable to match partial features against global features. More detailed reviews to person search works can be found in Sec. 2. + +This paper targets to design a unified person search framework robust to the misaligned bounding boxes. As shown in Fig. 1, the basic idea is to refine detected bounding boxes to cover the estimated holistic body regions to eliminate misalignment errors. Then, aligned part features could be extracted from refined bounding boxes with simple region division. Part features hence allow for robust partial matching across bounding boxes, where features on the mutual visible regions are matched for similarity computation, and features on noisy regions are not considered for matching. In other words, our strategy improves both the feature resolution and robustness to misalignment errors. + +The above idea leads to the Align-to-Part Network (AP-Net) for person search. Built on OIM [24], APNet consists of the additional Bounding Box Aligner (BBA) and Region + +Sensitive Feature Extractor (RSFE). The BBA module is implemented by predicting 4 bounding box offset values. It can be trained by automatic data augmentation without requiring manual annotations. Because of enlarged receptive fields of neurons in feature extraction CNN layer, noisy or occluded parts would affect features of their adjacent parts in the same bounding box. We further design the RSFE module to extract part features. RSFE reinforces local cues in each part feature, hence effectively alleviates the negative effects of adjacent noises in part feature learning. + +We test our approach on current person search benchmarks, i.e., PRW [33] and CUHK-SYSU [24]. Experiment results show that, our APNet achieves competitive performance compared with recent works. To test our approach in more challenging scenarios, we contribute a new person search dataset named as Large-Scale dataset for Person Search in the wild (LSPS). Compared with PRW and CUHK-SYSU, LSPS presents several new features that would encourage the research towards more realistic person search: 1) large scale: it contains a large number of pedestrians and bounding boxes; 2) automatically detected bounding boxes, which differ with the manually annotated ones in PRW and CUHK-SYSU; 3) collected in scenarios with occlusions and crowdings. On this challenging LSPS, our method exhibits substantial advantages. + +Compared with reID, person search is still relatively under-explored. It is critical to deal with the challenge occurring in both person detection and reID. To the best of our knowledge, the proposed APNet is an early attempt in boosting the robustness to misalignment issue in person search. As shown in our experiments, the APNet brings considerable performance gains. The proposed LSPS dataset simulates realistic scenarios and presents a more challenging person search task than existing datasets. We believe that, the proposed methods and the contributed LSPS can inspire more research efforts in person search. + +# 2. Related Work + +This paper is closely related to person reID and person search. The following parts review those two lines of works. + +Person reID extracts robust and discriminative features from given person bounding boxes. Current fully supervised reID methods can be briefly summarized into the following categories. 1) Learn local features of regions utilizing offline detector to split body into several regions [27, 17, 10, 11], or uniformly split the body into several stripes [31, 22, 26]; 2) Learn the robust feature utilizing additional attribute annotation [19, 18, 20, 23]; 3) Enhance the discriminativeness of feature by attention mechanism [12, 9, 25]; 4) Impose constraints on feature space with loss functions, like verification loss [36] and triplet loss [8]. Among the above methods, PCB [22] and its variants [31, 26] dominate the state-of-the-art performance. + +PCB uniformly splits the feature map into stripes and supervises them to ensure their discriminative power. However, PCB requires a strict alignment of the input images since misalignment breaks the correspondence of stripes on the same spatial position. The performance of PCB thus degrades substantially when misalignments exist [21]. + +There are some reID works focusing on partial reID. Zheng et al. [35] propose $\mathrm{AMC + SWM}$ to solve the partial reID. AMC collects patches from all gallery images and set up a dictionary for patch level matching. He et al. [7] propose DSR to reconstruct the partial image by holistic image and utilize the reconstruction error as the similarity. Both AMC [35] and DSR [7] are optimisation-based thus it is expensive to get the similarity of each query-gallery pair. PGFA [14] applies partial matching scheme with the aligned input images, whose occluded parts are indicated by the expensive offline keypoint detector. Sun et al. [21] propose a VPM to extract local features while simultaneously being aware of the visibility of each body part. However, VPM does not consider the deformation mentioned in DSR. Our method addresses the deformation by an explicit alignment step and gets rid of the time-consuming comparison of each query-gallery pair during the inference stage. + +Person search considers the detection stage in raw video frames before reID. Current methods of person search can be divided into two categories. One integrates detection and reID into a unified framework [24, 15, 4, 29]. Based on Faster-RCNN [16], OIM proposed by Xiao et al. [24] inserts an additional feature extraction branch on top of the detector head, which is the first end-to-end learning framework for person search. Similar to NPSM of Liu et al. [4], Munjal et al. [15] apply a query-guided method for person search while it is end-to-end optimized compared to NPSM. The other category solves detection and re-identification with two separate models, i.e., performing person search in a sequential manner [1, 28, 3]. Chen et al. [1] propose a mask-guided feature learning method to make the reID network focus more on foregrounds. Lan et al. [28] propose CLSA which utilizes multi-level features from reID network to solve the multi-scale matching problem. Han et al. [3] claim that bounding box from detector might not be optimal for re-identification, they thus refine the detector results driven by re-identification loss. + +Our work belongs to the first category of person search, integrating detection and reID into a unified framework. Different from existing person search works, this work further addresses the misalignment issue of detected bounding boxes and optimizes aligned part feature learning to achieve robust partial matching in person search. + +# 3. Problem Formulation + +Given a query person image $q$ and a gallery set $\mathcal{G} = \{g_i\}_{i=1:N}$ containing $N$ frames, person search aims at + +![](images/e2beaccc9e63f61365ca1e42886e0972c2afcbe918c996769f1d07b19e7ffd4a.jpg) +Figure 2. Architecture of the proposed Align-to-Part Network (APNet), which consists of person detector, Bounding Box Aligner (BBA), and Region Sensitive Feature Extractor (RSFE). The detection branch returns bounding boxes $\mathcal{B}$ and global feature $F$ . BBA refines detected boxes $\mathcal{B}$ to aligned ones, i.e., $\hat{\mathcal{B}}$ . Red and green bounding boxes denotes detected boxes $\mathcal{B}$ and refined boxes $\hat{\mathcal{B}}$ , respectively. RSFE extracts part features $\{f^{(k)}\}_{k=1:K}$ from refined boxes and alleviates negative effects of adjacent noises. RAP and GAP denote Regional Average Pooling and Global Average Pooling, respectively. $F_{\mathrm{RSM}}$ is the global feature from Region Sensitive Map, which is only used for training RSFE. + +detecting a collection of person bounding boxes $\mathcal{B} = \{b_i\}_{i=1:M}$ from $\mathcal{G}$ , then matching $q$ against the bounding boxes in $\mathcal{B}$ . Suppose a person can be divided into $K$ body parts, we could represent the bounding box $b_i$ containing a complete person as a collection of $K$ parts, i.e., $\mathcal{P}_i = \{p_i^{(k)}\}_{k=1:K}$ , where $p_i^{(k)}$ denotes the $k$ -th part. + +With the above formulation, person detection is expected to return bounding boxes containing complete persons with $K$ parts. Person reID targets to extract a discriminative feature to identify the same identity of $q$ in $\mathcal{B}$ . Most of existing works extract a global feature $F$ and performs reID by L2-distance. Due to the occlusions or background clutters, certain bounding boxes only contain portions of body parts, making the global feature degrades to a partial feature, i.e., the global feature is extracted from $l, l < K$ visible parts. Such partial features lead to inaccurate person matching when compared with global features. + +Our solution is to introduce a part identifier $\operatorname{E}(\cdot)$ to identify visible parts in each detected bounding box, i.e., $\mathcal{P}_i = \operatorname{E}(b_i)$ . With identified parts, the person image matching could be treated as a part feature matching task, where features on mutual visible parts of two bounding boxes are matched. The distance between $q$ and $b_{i}$ can be denoted as, i.e., + +$$ +\operatorname {d i s t} _ {P} (q, b _ {i}) = \frac {\sum_ {k \in \mathcal {P} _ {q} \cap \mathcal {P} _ {i}} \mathrm {D} \left(f _ {q} ^ {(k)} , f _ {i} ^ {(k)}\right)}{| \mathcal {P} _ {q} \cap \mathcal {P} _ {i} |}, \tag {1} +$$ + +where $f_{q}^{(k)}$ and $f_{i}^{(k)}$ are features extracted from $k$ -th part from $q$ and $b_{i}$ , and $\mathrm{D}(\cdot)$ refers the L2-distance. + +The training of our person search model should guarantee an accurate person detector, the reliable part identifier, and discriminative part features. We formulate our training + +objective as, + +$$ +\mathcal {L} = \mathcal {L} _ {D} + \mathcal {L} _ {P} + \sum_ {k = 1} ^ {K} \mathcal {L} _ {f ^ {(k)}}, \tag {2} +$$ + +where $\mathcal{L}_D$ denotes loss of the detector, which is optimized with both bounding box locations and person reID. $\mathcal{L}_P$ denotes the loss of part identification. $\mathcal{L}_f^{(k)}$ evaluates the discriminative power of the $k$ -th part feature, which can be implemented with reID loss. The following section presents details of our implementation to person detector, part identifier, part feature extraction, as well as the network optimization. + +# 4. Proposed Methods + +We propose the Align-to-Part Network (APNet) to implement the formulation in Sec. 3. The architecture of APNet is shown in Fig. 2. APNet consists of a person detector, Bounding Box Aligner (BBA), and the Region Sensitive Feature Extractor (RSFE), respectively. The following parts present details of those components. + +The detector is built upon OIM [24], which is an end-to-end person detector returning bounding boxes $\mathcal{B}$ as well as their corresponding global feature $F$ . As shown in Fig. 2, the detector is trained with RPN loss $(\mathcal{L}_{\mathrm{rpncls}}, \mathcal{L}_{\mathrm{rpnreg}})$ [16], ROI Head loss $(\mathcal{L}_{\mathrm{cls}}, \mathcal{L}_{\mathrm{reg}})$ , as well as reID loss. We denote the detector training loss as + +$$ +\mathcal {L} _ {D} = \mathcal {L} _ {\mathrm {c l s}} + \mathcal {L} _ {\mathrm {r e g}} + \mathcal {L} _ {\mathrm {r p n c l s}} + \mathcal {L} _ {\mathrm {r p n r e g}} + \mathcal {L} _ {\mathrm {I D}}, \tag {3} +$$ + +where $\mathcal{L}_{\mathrm{cls}}$ and $\mathcal{L}_{\mathrm{reg}}$ denotes the person classification loss and bounding box regression loss in ROI Head. $\mathcal{L}_{\mathrm{rpncls}}$ and $\mathcal{L}_{\mathrm{rpnreg}}$ denote the objectiveness loss and proposal regression loss in RPN. $\mathcal{L}_{\mathrm{ID}}$ is the reID loss computed on the + +![](images/bf0f9bb2c39cd7ccd820bb160f1384df36629f52a5ee7210e5ca3332a2f4288e.jpg) +Figure 3. Illustration of BBA for bounding box refinement. Red and green boxes refer to detected boxes and refined boxes, respectively. BBA predicts four bounding box offset values $o_t$ , $o_b$ , $o_l$ , and $o_r$ , which shift the detected bounding boxes to cover the estimated holistic body region. 0, 1 indicate the validity of each part. + +global feature. We refer readers to OIM [24] for more details of the loss computation. + +As shown in Fig. 1, a well trained detector may produce misaligned person bounding boxes. We hence design a part estimator with BBA to estimate visible body parts of each detected box. + +# 4.1. Bounding Box Aligner + +BBA implements part identifier $\mathrm{E}(\cdot)$ in Sec. 3 to identify visible parts in each bounding box. This could be achieved with various methods, e.g., through segmenting person foregrounds [13] or estimating body keypoints [2]. However, those methods require extra annotations and considerable computations. We implement BBA with a more efficient solution. + +Because most pedestrians show upright posture in surveillance videos, aligned body parts can be extracted by dividing a holistic body region into horizontal and vertical stripes. This operation generates aligned part regions, e.g., top and bottom horizontal stripes correspond to head and foot, respectively. With this intuition, BBA first refines detected bounding boxes, then extracts horizontal and vertical stripes as body parts. We illustrate this procedure in Fig. 3. + +BBA estimates an offset vector $O = \{o_t, o_b, o_l, o_r\}$ to refine each detected bounding box to cover the holistic body region, where each offset value is in the range of $[-1, 1]$ . The four offset values move the top, bottom, left, and right boundaries of each bounding box. Fig. 3 shows examples of moving the boundaries by $o_t$ and $o_b$ . Suppose the coordinate of a bounding box $b$ is $\{x_{min}, y_{min}, x_{max}, y_{max}\}$ , its coordinate after refinement with $O$ can be denoted as $\{\hat{x}_{min}, \hat{y}_{min}, \hat{x}_{max}, \hat{y}_{max}\}$ , e.g., + +$$ +\hat {y} _ {\text {m i n}} = y _ {\text {m i n}} - \frac {h \cdot o _ {t}}{1 - o _ {t} - o _ {b}} \tag {4} +$$ + +$$ +\hat {y} _ {m a x} = y _ {m a x} + \frac {h \cdot o _ {b}}{1 - o _ {t} - o _ {b}}, +$$ + +where $h$ is the height of detected bounding box, computed + +as $y_{max} - y_{min}$ . Similar computation can be applied to compute the $\hat{x}_{min}$ and $\hat{x}_{max}$ with $o_l$ and $o_r$ . + +We denote the refined bounding box as $\hat{b}$ , which is used to extracted horizontal and vertical stripes as parts. As shown in Fig. 3, refinements may introduce occluded parts and noises into $\hat{b}$ . To extract $K$ horizontal stripes, we introduce a $K$ -dim validity vector $v$ to record the visibility of each stripe. The $k$ -th stripe is considered as valid, i.e., $v[k] = 1$ , if + +$$ +\left. \left[ K \cdot \max \left(0, o _ {t}\right) \right] \leq k \leq K - \left\lfloor K \cdot \max \left(0, o _ {b}\right) \right\rfloor . \right. \tag {5} +$$ + +Similar computation is applied to extract valid vertical stripes. The final valid part collection $\mathcal{P}$ of each bounding box collects valid stripes. + +As shown in Fig. 2, BBA predicts $O$ based on the bounding box feature extracted with ROAlign. BBA can be trained by automatically generating training data. We first crop bounding boxes from frames by their groundtruth coordinates, which we denote as $\mathcal{B}_{gt}$ . AlphaPose [2] is utilized to estimate the keypoints of each bounding box, which provide cues about missing body parts. We then transform $\mathcal{B}_{gt}$ to $\hat{\mathcal{B}}_{gt}$ to cover the holistic body region. Comparing $\mathcal{B}_{gt}$ and $\hat{\mathcal{B}}_{gt}$ generates the groundtruth offset labels $O_{gt} = \{o_{gt - t}, o_{gt - b}, o_{gt - l}, o_{gt - r}\}$ . The training of BBA can thus be supervised by following loss + +$$ +\mathcal {L} _ {P} = \sum_ {i \in \{t, b, l, r \}} \operatorname {s m o o t h} _ {l 1} \left(o _ {i}, o _ {g t - i}\right), \tag {6} +$$ + +where $\mathrm{smooth}_{l1}$ computes differences between predicted offset values and the groundtruth values. More details of $\mathrm{smooth}_{l1}$ can be found in [16]. + +# 4.2. Region Sensitive Feature Extractor + +The part collection $\mathcal{P}$ makes it possible to extract part features for partial matching. The following section shows our method to extract horizontal stripe features. Vertical stripe features can be extracted with similar way. + +Vanilla Part Feature Extractor: Part features can be extracted by applying Region Average Pooling (RAP) on the feature map of video frame. As shown in Fig. 2, for a refined bounding box $\hat{b}_i$ , we first extract its feature map from the frame feature map $\mathcal{M}$ with ROIAAlign, which is then input into a convolutional block to generate a feature map $T \in \mathbb{R}^{H \times W \times D}$ . We denote part features of $\hat{b}_i$ extracted by RAP as, + +$$ +\left\{\bar {f} _ {i} ^ {(k)} \right\} _ {k = 1: l} = \operatorname {R A P} (T, \mathcal {P} _ {i}), l = | \mathcal {P} _ {i} |, \tag {7} +$$ + +where $l$ denotes the number of valid horizontal stripes of bounding box $\hat{b}_i$ . + +Part feature learning can be achieved by computing the reID loss on each valid part feature, i.e., + +$$ +\mathcal {L} _ {f} ^ {(k)} = \mathcal {L} _ {\mathrm {I D}} (\bar {f} ^ {(k)}, y), \tag {8} +$$ + +![](images/e46b3b47757c53a06d0d35cd8c711712586dd89e465ab3f6337897b52eba315a.jpg) + +![](images/7c47c72627e48a516c8f51ea579dd09378ba58d8252a1169000a99ad8ba20902.jpg) + +![](images/2ff6a830015c704e93d63f537240a480814b65628123e5c9a8d134d6efd15188.jpg) + +![](images/757dbb27282b0bc4219cf5251d0bbadafc15b37e86b472c4d3d8a620a789821b.jpg) + +![](images/a0f34b2baf378e776f6d3056ad979946d05ff9e7a95fec6832f5e7379302d967.jpg) + +![](images/d568611dbd42a3d3b93c501cea09e3c1374319d224e373ab1e4069b232fc2fc8.jpg) + +![](images/b36f7af8f33e072acb7b4660a0880f18805472b3e144e16749eb8b57c72bdcd4.jpg) +(a) + +![](images/8e1e087ae1a0d8e2aefb4200ee9a2d150ae8112dd96064bbd1a7be4c5b90dbb3.jpg) +(b) + +![](images/5a782a1f3571402b0eb9a6537534befef6419ee9b5a7fb2e6930f9fe07de43d8.jpg) +(c) + +![](images/f4aac785b09f80c5256884b23efaef0fb49c9926b893732795f73354008b6646.jpg) +(a) + +![](images/71748640e0746074cfab39dfa7ce27ac03ad6222edc9d8940edc3c8f0e802487.jpg) +(b) +Figure 4. Illustration of detected boxes (red) and refined boxes (green), as well as their feature maps. (b) and (c) show feature maps of refined boxes trained with vanilla part feature extractor and our RSFE. It is clear that, RSFE depresses noises on noisy and invalid regions. + +![](images/c4a6294512bcd508fc1277c869fb536a925b9b904e4369fa1983874c3c77427c.jpg) +(c) + +where $\mathcal{L}_{\mathrm{ID}}$ refers to reID loss which is implemented with OIM loss [24]. $y$ is the ground truth person ID label. + +Fig. 4 (b) shows feature maps of aligned bounding boxes trained by the above feature extractor. It is clear that, noisy or invisible regions still have strong responses. This could be because the training procedure in Eq. (8) focuses on visible body parts, and can not tune the features on noisy parts. Because of enlarged receptive fields of neurons in feature extraction CNN layer, the strong CNN activations on noisy or occluded parts would affect features of their adjacent valid parts. This may degrades the validity of the above feature extractors. Therefore, part feature extractors robust to occlusions and noises are required. + +Feature Extraction with Region Sensitive Map: Our RSFE introduces a Region Sensitive Map (RSM) to suppress responses of invalid regions. To tune the responses of each feature stripe, we generate the RSM $M \in \mathbb{R}^{H \times W \times d}$ by applying $1 \times 1$ convolution on each horizontal feature stripe $T[i] \in \mathbb{R}^{W \times D}, i = 1 : H$ . The computation of $M[i] \in \mathbb{R}^{W \times d}$ can be denoted as, + +$$ +M [ i ] = \operatorname {c o n v} _ {1 \times 1} ^ {\left(\mathrm {i}\right)} (T [ i ]), i = 1: H, \tag {9} +$$ + +where $\mathrm{conv}_{1\times 1}^{(\mathrm{i})}$ refers to the $i$ -th convolution kernel. Different from a global $1\times 1$ convolution, $H$ convolutional kernels in Eq. (9) do not share parameters to deal with complicated occlusions on different spatial locations. + +To suppress noisy regions, we supervise $M$ with a global feature. The loss can be computed by applying Average Pooling on $M$ and supervise the resulted feature $F_{\mathrm{RSM}}$ , i.e., + +$$ +\mathcal {L} _ {\mathrm {R S M}} = \mathcal {L} _ {\mathrm {I D}} \left(F _ {\mathrm {R S M}}, y\right). \tag {10} +$$ + +This loss enforces the network to depress activations on noisy regions to generate a better $F_{\mathrm{RSM}}$ , which is then used for stripe feature extraction. Fig. 4 (c) shows feature maps + +after training with Eq. (10), where invalid regions are effectively suppressed. + +From $M$ , the stripe features can be extracted by RAP as, + +$$ +\left\{f _ {i} ^ {(k)} \right\} _ {k = 1: l} = \operatorname {R A P} (M, \mathcal {P} _ {i}), l = | \mathcal {P} _ {i} |, \tag {11} +$$ + +where each part feature can be trained with part feature loss in Eq. (7). + +Eq. (9) applies different $1 \times 1$ convolution kernels on spatial locations of $T$ . This enables more specific refinements for each part feature. Besides that, different spatial locations show varied probabilities of occlusion, e.g., the foot area is more likely to be occluded. This property makes Eq. (9) more effective in depressing occlusions and noises than learning a global $1 \times 1$ convolution kernel. + +The methods above extracts features from horizontal stripes. Similar procedure can be applied to extract features from vertical stripes. Given a query person image $q$ and a detected gallery bounding boxes $b_{i}$ to be compared, we utilize both global and part features for person reID. The part feature distance can be computed with Eq. (1). We also utilize the global feature $F$ from detector branch for distance computation. The overall distance between $q$ and $b_{i}$ can be computed as: + +$$ +\operatorname {d i s t} \left(q, b _ {i}\right) = \operatorname {d i s t} _ {P} \left(q, b _ {i}\right) + \lambda \cdot \mathrm {D} \left(F _ {q}, F _ {i}\right), \tag {12} +$$ + +where $F_{q}$ and $F_{i}$ correspond to the global features of $q$ and $b_{i}$ respectively. We set $\lambda$ to 1 in the following experiments. + +# 5. LSPS Dataset + +# 5.1. Previous Datasets + +CUHK-SYSU [24] consists of 5,694 frames captured from movie snapshots, and 12,490 frames from street snap. Both bounding boxes and identities are labeled manually. The dataset provides 8,432 labeled identities, and 23,430 labeled bounding boxes. 96,143 bounding boxes are provided in total. 11,206 frames with 5,532 identities make up the training set. CUHK-SYSU does not annotate bounding boxes with partial bodies. + +PRW [33] is captured with six cameras deployed at a campus, containing 11,816 frames with 932 identities in total. 5,134 frames are selected as training set with 432 identities, while the rest 6,112 frames make up the test set. A total of 34,304 bounding boxes are annotated with identity. Similar to CUHK-SYSU, bounding box locations in PRW are also manually labeled. PRW includes some misaligned bounding boxes in both queries and galleries. + +# 5.2. Description to LSPS + +This paper contributes a new Large-Scale dataset for Person Search in the wild (LSPS), which shows the following characteristics: + +
DatasetLSPSPRW [33]CUHK [24]
frames51,83611,81618,184
identities4,0679328,432
anno. boxes60,43334,30423,430
cameras176-
detectorFaster-RCNNHandHand
inc/query~60%~6%~0%
+ +Complex scene and appearance variations: The video frames are collected from 17 cameras, deployed at both indoor and outdoor scenes. Different cameras exhibit different backgrounds, viewpoints, view fields, illuminations, pedestrian densities, etc. Those factors lead to substantial appearance variances for the same person. Meanwhile, due to limited view fields of each camera and high person density, lots of pedestrians are occluded, leading to bounding boxed covering partial body region. LSPS includes partial bounding boxes into both query and gallery sets. Fig. 5 (a) compares the body completeness in queries between LSPS and PRW. It is clear that, LSPS has a substantially larger number of incomplete query bounding boxes. Compared with existing person search datasets, LSPS presents more complex scenes and appearance variations. + +Larger scale: Different with previous benchmarks, where bounding boxes are manually labeled. LSPS utilizes bounding boxes detected by Faster-RCNN [16], based on which we manage to collect a dataset with larger number of bounding boxes. We show the comparison between LSPS and the other two datasets in Table 1. In LSPS, a total number of 51,836 frames are collected, from which 60,433 bounding boxes and 4,067 identities are annotated. Table 1 shows that, LSPS presents the larger number of frames, annotated person bounding boxes, cameras, respectively. Moreover, about $60\%$ queries in LSPS cover partial body. Larger scale and incomplete query bounding boxes make LSPS a more challenging and realistic dataset than the others in Table 1. + +# 5.3. Evaluation Protocol + +LSPS is split into a training set with 18,154 frames and a test set with 33,673 frames. The training and test set contain 1,041 and 3,026 identities, respectively. Statistics of the training and test set are summarized in Table 2. We utilize mean Average Precision (mAP) and rank-1 accuracy as evaluation metrics, which are widely adopted in person reID [24, 15, 1, 28, 3]. In person search, a retrieved bounding box is considered as true positive if it shares the same ID label with query and it has the overlap rate larger than 0.5 with the ground truth bounding box. Therefore, both + +![](images/c4adfa5a20c95f05e825c258cbdce7b1bed039cadd3ec1cea769be8442c6ebc7.jpg) +Figure 5. (a) compares the body completeness in queries between LSPS and PRW. (b) illustrates several query and gallery bounding boxes. It can be observed that, misalignment occurs in both query and gallery bounding boxes. + +Table 1. Comparison between LSPS and the other two person search datasets. "detector" refers to the way to obtain the ground truth of bounding box location. "inc/query" means the percentage of query bounding boxes with partial body. + +
Splitframesidentitiesboxesanno. boxes
Training18,1631,04171,56318,928
Test33,6733,026116,17041,505
+ +Table 2. Statistics of training/test sets on LSPS. "anno. boxes" refers bounding boxes annotated with person ID. "boxes" denotes the number of provided bounding boxes. + +mAP and rank-1 accuracy in person search are affected by the detector performance. + +# 6. Experiment + +The following parts conduct experiments on CUHK-SYSU [24], PRW [33] and the new LSPS. + +# 6.1. Implementation Details + +Our APNet is implemented based on OIM [24]. We use the ResNet50 [6] initialized with ImageNet pretrained model as the backbone. The backbone adopts similar setting with the one in [15] and it uses RoIAlign [5] rather than RoIPooling [16]. For all experiments, we train the APNet with SGD optimizer. We divide the training into two stages, i.e., the first stage trains the detector branch with $\mathcal{L}_D$ . The second stage fixes parameters of the detector and trains BBA and RSFE with $\mathcal{L}_P$ and $\mathcal{L}_f$ , respectively. We set $K$ to 7 for horizontal stripes. For PRW and CUHK-SYSU, we do not use features from vertical stripes since the misalignment in these two datasets mainly occurs in vertical direction. + +On CUHK-SYSU, the first stage lasts 40k iterations. We set the initial learning rate to 1e-3 and decay it by 0.1 at 30k. RSFE is trained for 40k with learning rate as 1e-3, decayed at 30k. On PRW, the first stage lasts 80k. We set learning rate to 1e-4, decayed at 60k. RSFE is trained for 40k with learning rate as 1e-3, decayed at 30k. On LSPS, the first + +
MethodsmAPrank-1
feature
upper boundglobal53.574.6
global matchingglobal13.630.4
stripe23.152.5
partial matchingvalid region23.946.7
mutual region21.448.6
mutual stripe30.970.0
+ +![](images/8ee19196d49c652695ad9cc825b77872cfbc08b1c3a0e42967d2e5aa2c3573a6.jpg) +Figure 6. Performance on LSPS with different stripe number $K$ . + +stage lasts $120\mathrm{k}$ , with learning rate as 1e-4 and is decayed by 0.1 at $80\mathrm{k}$ and $100\mathrm{k}$ , respectively. RSFE is trained for $60\mathrm{k}$ with learning rate as 1e-3, decayed at $30\mathrm{k}$ and $50\mathrm{k}$ , respectively. BBA on three datasets are trained for $30\mathrm{k}$ with learning rate as 1e-3, and is decayed at $20\mathrm{k}$ . + +# 6.2. Ablation Study + +Validity of Partial Matching. APNet addresses misalignment issue with partial matching based on stripe features. This part demonstrates the validity of this strategy. We first modify the Market-1501 [32] by adding random occlusions to query and gallery images. Based on this modified dataset, we compare different feature matching strategies and summarize the results in Table 3, where "global matching" does not differentiate occlusions in feature extraction and "partial matching" extracts features from valid regions. + +Table 3 shows that, occlusion is harmful for reID, e.g., degrades the mAP of global feature from $53.5\%$ to $13.6\%$ . Extracting stripe features from the entire bounding box boosts the reID performance. This shows the validity of part feature. Because partial matching extracts features from visible regions, it achieves better performance than global matching. Among three features used in partial matching, features extracted from mutual stripes achieve the best performance. It outperforms the feature from mutual region by large margins, e.g., $30.9\%$ vs. $21.4\%$ in mAP. It also significantly outperforms the global feature in global matching. The above experiments hence shows the validity of the idea illustrated in Fig. 1, where features on the mutual visible regions are matched for similarity computation. + +Table 3. Validity of partial matching on Market1501 modified by adding artificial occlusions. "upper bound" refers to performance of global feature on original Market-1501. Other methods are tested on modified Market-1501. Valid region refers to common visible region of tow matched bounding boxes. + +
FeaturesPRWLSPS
mAPrank-1mAPrank-1
global34.275.814.447.7
stripe39.179.113.041.6
VPM [21]40.080.216.049.5
stripe (BBA)40.881.016.450.2
RSFE (BBA)41.981.417.151.6
+ +Table 4. Validity of BBA and RSFE in stripe feature extraction. Global refers to global feature extracted from detected bounding box. "stripe (BBA)" denotes extracting stripe features with vanilla part feature extractor based on BBA output. "RSFE (BBA)" denotes stripe feature extracted by RSFE. + +Validity of BBA: BBA performs bounding box refinement and valid part estimation. We proceed to verify the validity of BBA in person search. Table 4 shows the performance of global feature and stripe feature before applying BBA. It is clear that, extracting valid stripe features from BBA refined bounding boxes, substantially boosts the reID performance. For instance, "stripe (BBA)" achieves mAP of $40.8\%$ on PRW, better than the $34.2\%$ and $39.1\%$ of original global feature and stripe feature, respectively. We also show performance of the reproduced VPM [21], which is a recent method for partial matching. As shown in Table 4, stripe feature extracted with BBA performs better than VPM on both PRW and LSPS. This experiment hence shows the validity of BBA in bounding box refinement and valid part extraction. + +Validity of RSFE: RSFE is designed to alleviate the negative effects of noisy regions illustrated in Fig. 4 (b). It is also designed to refine each part feature. Table 4 compares the stripe feature extracted by RSFE, i.e., "RSFE (BBA)" against the one extracted by vanilla part feature extractor, i.e., "stripe (BBA)". It can be observed that, RSFE is important in boosting the stripe feature performance. For example, RSFE boosts the mAP by $1.1\%$ and $0.7\%$ on PRW and LSPS, respectively. The combination of BBA and RSFE achieves the best performance and outperforms the VPM by large margins. More comparisons with person search works will be presented in the next section. + +Effects of part number $K$ : We proceed to study the influence of part number $K$ , and summarize the results in Fig. 6. $K = 1$ degrades the partial feature to global feature. The maximum horizontal stripe number $K$ equals to the height of $T$ , i.e., 7 in our experiment. The figure shows that, stripes with finer scale help to boost the performance. This might due to the fact that larger $K$ improves the feature resolution and robustness to occlusions and noises. + +Discussions: To show the effects of BBA in bounding boxes refinement, we visualize bounding boxes before and after refinement in Fig. 7. The results show that, BBA effectively shifts the original bounding boxes to cover holistic body regions. This procedure eliminates misalignment errors and guarantees aligned stripe feature extraction. + +![](images/73ec4c5e7d965cb4bc0e2f87406040b0b9ee4db3425ad07d24b80fde2d71a15a.jpg) +Figure 7. Visualization of refined bounding boxes by BBA. Red and green boxes denote bounding boxes before and after refinement. BBA effectively estimates the holistic body region to eliminate misalignment errors. + +
Methods# params (M)speed (sec.)TFLOPs
OIM360.2540.383
APNet670.2560.397
+ +Table 5. Comparison of parameter and computational complexity between APNet and baseline OIM [24]. Speed and TFLOPS are measured on the NVIDIA 2080Ti GPU. + +
MethodsReferenceCUHK-SYSUPRW
mAPrank-1mAPrank-1
OIM [24]CVPR201775.578.721.349.9
NPSM [4]ICCV201777.981.224.253.1
CLSA [28]ECCV201887.288.538.765.0
MGTS [1]ECCV201883.083.732.672.1
CGPS [29]CVPR201984.186.533.473.6
QEEPS [15]CVPR201988.989.137.176.7
RDLR [3]ICCV201993.094.242.972.1
APNet88.989.341.981.4
+ +Besides the detector branch based on baseline OIM, APNet introduces additional BBA and RSFE modules. We compare the parameter and computational complexity between OIM and APNet in Table 5. The comparison shows that APNet achieves promising performance with comparable speed with baseline OIM, e.g., 0.397 TFLOPs of APNet vs. 0.383 TFOLPs of OIM. Although the BBA and RSFE modules bring more parameters to APNet, they do not degrade its computational speed substantially. APNet is likely to be faster than person search works that treat detection and reID in separated steps, and is faster than some works like QEEPS [15], which compares each query-gallery pair for person search. + +# 6.3. Comparison with recent works + +CUHK-SYSU. We experiment on CUHK-SYSU with gallery size 100. APNet achieves the rank-1 accuracy of $89.3\%$ and mAP of $88.9\%$ , outperforming most of recent works. Note that RDLR [3] uses a stronger backbone ResNet50-FPN as well as ranking-based loss. Methods like CLSA [28], MGTS [1], and RDLR solve detection and reID with two separate models, which are expensive in both computation and storage. Compared with those works, our AP + +Table 6. Comparison with recent works on CUHK-SYSU and PRW, respectively. + +
LSPSOIM [24]VPM [21]APNetAPNet+v
mAP14.416.017.118.8
rank-147.749.551.655.7
+ +Table 7. Comparisons with recent works on LSPS. APNet denotes our method. APNet+v considers extra vertical stripe features. + +Net is a unified model and is likely to present better computational and memory efficiencies. + +PRW. On PRW, APNet achieves competitive performance, e.g., $81.4\%$ in rank-1 accuracy and $41.9\%$ in mAP, outperforming most of recent works. APNet also significantly outperforms the RDLR [3] in rank-1 accuracy with a weaker backbone, i.e., by $9.3\%$ in rank-1 accuracy. Since certain query images in PRW cover partial body parts, APNet exhibits more substantial advantages with partial matching. It also outperforms CGPS [29] and QEEPS [15] by $7.8\%$ and $4.7\%$ in rank-1, respectively. Note that, CGPS [29] and QEEPS [15] input each query-gallery pair into CNN for similarity computation, hence also present inferior retrieval efficiency compared with APNet. + +LSPS. We finally present experimental results on LSPS. OIM [24] is compared as the baseline. APNet brings $3.9\%$ rank-1 improvement over the baseline, achieving $51.6\%$ and $17.1\%$ in rank-1 and mAP, respectively. APNet also outperforms the recent VPM [21], which solves the partial reID problem. To consider the misalignment in horizontal direction, we further apply additional vertical stripe features. The corresponding method, i.e., $\mathrm{APNet + v}$ achieves the best performance, achieving $55.7\%$ and $18.8\%$ in rank-1 and mAP, respectively. It is also clear that, the performance of APNet on LSPS is substantially lower than the ones on PRW and CUHK-SYSU, indicating the challenges of LSPS. + +# 7. Conclusion + +This paper proposes an APNet to solve the bounding box misalignment issues in person search. APNet refines detected boxes to cover the estimated holistic body regions, meanwhile extracting part features from visible body parts. This formulates reID as a partial feature matching procedure, where valid part features are selected for similarity computation, while part features on occluded or noisy regions are discarded. This paper also contributes a LSPS dataset, which is by far the largest and the most challenging dataset for person search. Experiments show that APNet brings considerable performance improvement on LSPS. Moreover, it achieves competitive performance on existing person search benchmarks like CUHK-SYSU and PRW. + +Acknowledgments This work is supported in part by The National Key Research and Development Program of China under Grant No. 2018YFE0118400, in part by Beijing Natural Science Foundation under Grant No. JQ18012, in part by Natural Science Foundation of China under Grant No. 61936011, 61425025, 61620106009, 61572050, 91538111. + +# References + +[1] Di Chen, Shanshan Zhang, Wanli Ouyang, Jian Yang, and Ying Tai. Person search via a mask-guided two-stream cnn model. In ECCV, 2018. +[2] Hao-Shu Fang, Shuqin Xie, Yu-Wing Tai, and Cewu Lu. RMPE: Regional multi-person pose estimation. In ICCV, 2017. +[3] Chuchu Han, Jiacheng Ye, Yunshan Zhong, Xin Tan, Chi Zhang, Changxin Gao, and Nong Sang. Re-id driven localization refinement for person search. In ICCV, 2019. +[4] Liu Hao, Jiashi Feng, Zequn Jie, Karlekar Jayashree, Zhao Bo, Meibin Qi, Jianguo Jiang, and Shuicheng Yan. Neural person search machines. In ICCV, 2017. +[5] Kaiming He, Georgia Gkioxari, Piotr Dolkar, and Ross Girshick. Mask r-cnn. In ICCV, 2017. +[6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. +[7] Lingxiao He, Liang Jian, Haiqing Li, and Zhenan Sun. Deep spatial feature reconstruction for partial person re-identification: Alignment-free approach. In CVPR, 2018. +[8] Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. +[9] Ruibing Hou, Bingpeng Ma, Hong Chang, Xinqian Gu, Shiguang Shan, and Xilin Chen. Interaction-and-aggregation network for person re-identification. In CVPR, 2019. +[10] Mahdi M Kalayeh, Emrah Basaran, Muhittin Gokmen, Mustafa E Kamasak, and Mubarak Shah. Human semantic parsing for person re-identification. In CVPR, 2018. +[11] Jianing Li, Shiliang Zhang, Qi Tian, Meng Wang, and Wen Gao. Pose-guided representation learning for person re-identification. IEEE transactions on pattern analysis and machine intelligence, 2019. +[12] Wei Li, Xiatian Zhu, and Shaogang Gong. Harmonious attention network for person re-identification. In CVPR, 2018. +[13] Yi Li, Haozhi Qi, Jifeng Dai, Xiangyang Ji, and Yichen Wei. Fully convolutional instance-aware semantic segmentation. In ECCV, 2016. +[14] Jiaxu Miao, Yu Wu, Ping Liu, Yuhang Ding, and Yi Yang. Pose-guided feature alignment for occluded person re-identification. In ICCV, 2019. +[15] Bharti Munjal, Sikandar Amin, Federico Tombari, and Fabio Galasso. Query-guided end-to-end person search. In CVPR, 2019. +[16] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015. +[17] Chi Su, Jianing Li, Shiliang Zhang, Junliang Xing, Wen Gao, and Qi Tian. Pose-driven deep convolutional model for person re-identification. In ICCV, 2017. +[18] Chi Su, Fan Yang, Shiliang Zhang, Qi Tian, Larry S Davis, and Wen Gao. Multi-task learning with low rank attribute embedding for person re-identification. In CVPR, 2015. +[19] Chi Su, Shiliang Zhang, Junliang Xing, Wen Gao, and Qi Tian. Deep attributes driven multi-camera person re-identification. In ECCV, 2016. + +[20] Chi Su, Shiliang Zhang, Fan Yang, Guangxiao Zhang, Qi Tian, Wen Gao, and Larry S Davis. Attributes driven tracklet-to-tracklet person re-identification using latent prototypes space mapping. Pattern Recognition, 66:4–15, 2017. +[21] Yifan Sun, Qin Xu, Yali Li, Chi Zhang, Yikang Li, Shengjin Wang, and Jian Sun. Perceive where to focus: Learning visibility-aware part-level features for partial person re-identification. In CVPR, 2019. +[22] Yifan Sun, Liang Zheng, Yi Yang, Qi Tian, and Shengjin Wang. Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). In ECCV, 2018. +[23] Chiat-Pin Tay, Sharmili Roy, and Kim-Hui Yap. Aanet: Attribute attention network for person re-identifications. In CVPR, 2019. +[24] Xiao Tong, Li Shuang, Bochao Wang, Lin Liang, and Xiaogang Wang. Joint detection and identification feature learning for person search. In CVPR, 2017. +[25] Cheng Wang, Qian Zhang, Chang Huang, Wenyu Liu, and Xinggang Wang. Mancs: A multi-task attentional network with curriculum sampling for person re-identification. In ECCV, 2018. +[26] Guanshuo Wang, Yufeng Yuan, Chen Xiong, Jiwei Li, and Zhou Xi. Learning discriminative features with multiple granularities for person re-identification. In ACM MM, 2018. +[27] Longhui Wei, Shiliang Zhang, Hantao Yao, Wen Gao, and Qi Tian. Glad: Global-local-alignment descriptor for pedestrian retrieval. In ACM MM, 2017. +[28] Lan Xu, Xiatian Zhu, and Shaogang Gong. Person search by multi-scale matching. In ECCV, 2018. +[29] Yichao Yan, Qiang Zhang, Bingbing Ni, Wendong Zhang, and Xiaokang Yang. Learning context graph for person search. In CVPR, 2019. +[30] Wenjie Yang, Houjing Huang, Zhang Zhang, Xiaotang Chen, Kaiqi Huang, and Shu Zhang. Towards rich feature discovery with class activation maps augmentation for person re-identification. In CVPR, 2019. +[31] Feng Zheng, Cheng Deng, Xing Sun, Xinyang Jiang, Xiaowei Guo, Zongqiao Yu, Feiyue Huang, and Rongrong Ji. Pyramidal person re-identification via multi-loss dynamic training. In CVPR, 2019. +[32] Liang Zheng, Liyue Shen, Lu Tian, Shengjin Wang, Jingdong Wang, and Qi Tian. Scalable person re-identification: A benchmark. In ICCV, 2015. +[33] Liang Zheng, Hengheng Zhang, Shaoyan Sun, Manmohan Chandraker, and Qi Tian. Person re-identification in the wild. In CVPR, 2017. +[34] Meng Zheng, Srikrishna Karanam, Ziyan Wu, and Richard J Radke. Re-identification with consistent attentive siamese networks. In CVPR, 2019. +[35] WeiShi Zheng, Li Xiang, Xiang Tao, Shengcai Liao, Jianhuang Lai, and Shaogang Gong. Partial person re-identification. In CVPR, 2016. +[36] Zhedong Zheng, Liang Zheng, and Yi Yang. A discriminatively learned cnn embedding for person reidentification. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 14(1):13, 2018. \ No newline at end of file diff --git a/robustpartialmatchingforpersonsearchinthewild/images.zip b/robustpartialmatchingforpersonsearchinthewild/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..82f5e57929bef0e62e4e8575d0daaed4ca5a4164 --- /dev/null +++ b/robustpartialmatchingforpersonsearchinthewild/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70cab39f8f3eca25902c5ac9864dc0c49b509e836c44ec87a388df5978008a8f +size 425675 diff --git a/robustpartialmatchingforpersonsearchinthewild/layout.json b/robustpartialmatchingforpersonsearchinthewild/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..344b5c610a4e9558366b36ea64ad723e7d324758 --- /dev/null +++ b/robustpartialmatchingforpersonsearchinthewild/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85a424955b4e606cffe46cddf4d967961c18ada873c8151f1eb04ad7d46b61b4 +size 461280 diff --git a/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_content_list.json b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..df28638e58f06a74bcb5206a7890528765d63a26 --- /dev/null +++ b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4018966b8fd2241f74bbb101ab665151ed2d2dc71949ff0de9a638d102ab2914 +size 69874 diff --git a/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_model.json b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3d8d6cf87a343380873b1c4728cc8bedda0ca5b0 --- /dev/null +++ b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3876c1679a2e1b361dd4b788ec5ec234f2028e9b218a13f431cb7e867750bb98 +size 86106 diff --git a/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_origin.pdf b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b31444af081a3b303edfc902e93e378051b341c4 --- /dev/null +++ b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/dbb88380-b267-4519-a801-915fceceb87d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18db13733ad69c76ee584ab403e7dbafb2ff7e67f49260e24bc18fe313c4644c +size 8802680 diff --git a/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/full.md b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..66113a3be05b28cf5a4e0d880e5b3392f74a6489 --- /dev/null +++ b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/full.md @@ -0,0 +1,285 @@ +# Robust Reference-based Super-Resolution with Similarity-Aware Deformable Convolution + +Gyumin Shim Jinsun Park In So Kweon + +Robotics and Computer Vision Laboratory + +Korea Advanced Institute of Science and Technology, Republic of Korea + +{shimgyumin, zzangjinsun, iskweon77}@kaist.ac.kr + +# Abstract + +In this paper, we propose a novel and efficient reference feature extraction module referred to as the Similarity Search and Extraction Network (SSEN) for reference-based super-resolution (RefSR) tasks. The proposed module extracts aligned relevant features from a reference image to increase the performance over single image super-resolution (SISR) methods. In contrast to conventional algorithms which utilize brute-force searches or optical flow estimations, the proposed algorithm is end-to-end trainable without any additional supervision or heavy computation, predicting the best match with a single network forward operation. Moreover, the proposed module is aware of not only the best matching position but also the relevancy of the best match. This makes our algorithm substantially robust when irrelevant reference images are given, overcoming the major cause of the performance degradation when using existing RefSR methods. Furthermore, our module can be utilized for self-similarity SR if no reference image is available. Experimental results demonstrate the superior performance of the proposed algorithm compared to previous works both quantitatively and qualitatively. + +# 1. Introduction + +Single Image Super-Resolution (SISR) aims to reconstruct a high-resolution (HR) image from a low-resolution (LR) image. Despite its notorious difficulty, SISR [34, 9] has received substantial attention due to its importance and practicality. As the Convolutional Neural Network (CNN) has demonstrated its capability in various research areas, including SISR, numerous deep learning-based SISR methods have been proposed [5, 14, 18] and have shown substantial performance improvements, especially with respect to reconstruction accuracy. To achieve a high peak signal-to-noise ratio (PSNR), the optimization process is typically defined as the minimization of the mean-squared-error (MSE) or the mean-absolute-error (MAE) between a ground truth + +![](images/24ccbda3abb250b833c845446044cc1b49d41a85f7e38fc2aac92a3be879b14e.jpg) +Figure 1: RefSR results with reference images with varying levels of similarity. XH, H, M, L, and XL denote very-high, high, middle, low, and very-low similarity levels, respectively. + +image and a predicted high-resolution image. This type of algorithm has a critical limitation in that the generated solution is the mean or median of possible high-resolution images, with a lack of high-frequency details and a blurred visual quality level. + +In order to obtain high-resolution images with realistic textures, high-level feature similarity between the high-resolution and reconstructed images is enforced. Perceptual loss [12] or Generative Adversarial Network (GAN)-based algorithms [17, 24] are proposed for better output perceptual quality levels in SR. Specifically, adversarial learning helps a generator network to synthesize more realistic images while competing with a discriminator which attempts to differentiate super-resolved and original HR images. Although those algorithms provide visually pleasing outputs, they do not ensure an accurate reconstruction of the original high-resolution image, and this leads to PSNR degradation. + +To mitigate this problem, some methods explicitly exploit additional information to make the SR outputs more like the ground truth and more visually pleasing [42, 40]. + +Because the original high-frequency information is lost due to the down-sampling process, it is highly challenging to reconstruct the precise high-frequency details of the ground truth. For such high-frequency details, providing similar content explicitly is a more reasonable approach compared to generating fake textures. Hence, the importance of reference-based SR (RefSR) is rapidly arising to overcome the limitations of SISR. RefSR aims to recover high-resolution images by utilizing an external reference (Ref) containing similar content to generate rich textures, changing the one-to-many to an one-to-one mapping problem (i.e., mapping textures from the reference to the output). Many existing SR algorithms can be regarded as special cases of RefSR based on which reference image is paired with the input. For instance, reference images can be diversely acquired from video frames [19, 3], web image searches [35], or from different view points [42]. Conventional RefSR algorithms [2, 41, 42] are known to have a critical limitation in that the reference image should contain similar content to avoid any unexpected degradation in the performance. The most desired behavior of the RefSR algorithm is that it should be aware of the degree of similarity between low-resolution and reference images so as not to be affected by irrelevant reference images. + +Inspired by recent works on video SR [26, 28] and RefSR methods [35, 42, 40], we propose a novel reference feature extraction module for the RefSR task. The module consists of stacked deformable convolution layers, and it can be inserted into any existing super-resolution network. The major benefit of our approach is that we aggressively search for similarity using a sophisticatedly designed offset estimator which learns the offsets of the deformable convolution. We adopt a non-local block [29] for our offset estimator, which performs pixel- or patch-wise similarity matching in a multi-scale manner. With the benchmark dataset used with RefSR, which has images paired with reference images with five different levels of similarity [40], we conduct experiments to demonstrate the superiority of the proposed algorithm. Experimental results show that our reconstruction results are more accurate and realistic with the help of the proposed module compared to the outcomes of previous algorithms. + +Figure 1 shows the result of our method with reference images with different levels of similarity. Our method shows robustness to similarity variations. Even with a reference image with unrelated content or a much lower similarity level, our method still produces less noisy output, demonstrating the adaptiveness/robustness to various levels of content similarity in RefSR. + +In summary, our contributions are as follows: + +- We propose a novel end-to-end trainable reference feature extraction module termed the Similarity Search and Extraction Network, with similarity-aware deformable convolutions. +- The proposed method shows superior robustness/adaptiveness without any PSNR degradation given irrelevant references. +- The proposed method can be utilized not only for RefSR but also for exploiting self-similarity if no reference image is available. + +# 2. Related Works + +# 2.1. Single Image Super-Resolution + +Conventional SISR algorithms aim to reconstruct HR images as accurately as possible by optimizing pixel-level reconstruction errors such as MSE and MAE. Dong et al. [5] propose a three-layer CNN-based SISR algorithm, referred to as SRCNN. Each layer of SRCNN is closely related to sparse representation, and it shows substantial performance improvements compared to those of conventional algorithms. Kim et al. [13, 14] propose a very deep CNN with input-output skip connections and a recursive architecture, offering stable and rapid convergence. Recently, the reconstruction accuracy was improved even further by adopting deeper networks with residual blocks and subpixel convolutions [18]. + +To overcome the major drawback of reconstruction-oriented SISR algorithms which produce blurred and nonrealistic textures [17], perceptual loss [12] has been proposed to improve the perceptual quality of the generated images by minimizing feature-level differences extracted from a ImageNet [15] pre-trained network. Currently, GAN is known to be effective when used to generate realistic images [8], and numerous GAN-based SISR algorithms [17, 30] have been proposed. SRGAN [17] is the first GAN-based SISR algorithm which generates more realistic SR images compared to those of conventional algorithms. However, it was also found that degradation of the reconstruction accuracy is inevitable with GAN-based approaches, because generated realistic textures do not always correspond to ground truth textures. + +# 2.2. Reference-based SR + +Earlier works on RefSR derive from patch matching or patch synthesis schemes [2, 41]. Zheng et al. [41] propose a RefSR algorithm based on patch matching and synthesis with a deep network. Down-sampled patches are used for patch matching and for finding correspondences between input and reference images. However, those schemes have critical drawbacks in that they produce blur and grid artifacts and are unable to handle non-rigid image deformations + +![](images/fbbd994519cc71ba7f1fc606c8fc02b063d0be1f0290b757c3424a71180caa9c.jpg) +Figure 2: Illustration of our RefSR framework. A stack of two deformable convolution layers is depicted in the figure. + +or inter-patch misalignments. Moreover, optimization including patch matching is inefficient due to its high computational cost. CrossNet [42] defines RefSR as a task where the reference image shares a similar viewpoint with a LR input image, and proposes an end-to-end neural network combining a warping process and image synthesis based on an optical flow [6, 10]. However, the ground truth for the optical flow is obtained at a high cost, and the flow estimation from other pre-trained networks is not accurate. In addition, although warping somewhat handles non-rigid deformation, it is highly vulnerable to large motions. SRNTT [40] points out the problem of robustness in CrossNet [42], arguing that severe performance degradation occurs when an unrelated reference image is paired with an input image. In SRNTT [40], a patch-wise matching scheme is adopted at the multi-scale feature level, which sacrifices computational efficiency for capturing long distance dependencies. + +# 2.3. Self-Similarity and Non-local Block in SR + +In a natural image, similar patterns tend to recur within the same image. Various methods have been studied regarding how to exploit self-similarity for image restoration [7, 33]. Those approaches attempt to utilize the internal information as a reference to reconstruct high-quality images. Huang et al. [9] propose a model allowing geometric transformation, which handles perspective distortions and affine transformations. However, the method of utilizing the intrinsic properties of images in deep learning-based methods remains ambiguous. + +To deal with this problem, non-local block [29] based approaches [20, 38] have been proposed. The non-local operation computes pixel-wise correlations to capture long-range and global dependencies. The correlation is computed as a weighted sum of all positions in the input feature maps. This approach largely overcomes the locality of pre + +vious CNNs and is therefore suitable for various computer vision applications that require large receptive fields. The proposed method can be used to search not only for correspondences between input and reference image but also for self-similarity within a single image with the help of non-local blocks. + +# 3. Similarity Search and Extraction Network + +# 3.1. Network Architecture + +The goal of reference-based super-resolution is to estimate a high-resolution image given a low-resolution input image and a high-resolution reference image. Inspired by the feature aligning capability of deformable convolution [26, 28], we formulate the RefSR problem as an integrative reconstruction process of matching similar contents between input and reference features and extracting the reference features in an aligned form. We propose an end-to-end unified framework that transfers HR details from reference images to restore high-frequency textures with the help of the proposed reference feature extraction module, specifically Similarity Search and Extraction Network (SSEN). The overall structure of SSEN is shown in Fig. 2. As input-reference pair of images are fed into the framework to reconstruct the high-resolution image, SSEN extracts features from the reference images in an aligned form, matching the contents in the pixel space without any flow supervision. + +We design deformable convolution layers in a sequential approach, noting that the receptive field becomes larger as stacking continues in a sequential manner. Stacking multiple layers of deformable convolution, we discover that three layers of deformable convolution are the optimal structure for the best performance (c.f., Tab. 4). As RefSR expects to search for similar areas within the entire image, a large receptive field is the most critical issue during this task. For + +this purpose, a multi-scale structure and non-local blocks are adopted to propagate offset information. Our module softly conducts pixel- or patch-level matching with an extremely large receptive field, estimating the offsets for deformable convolution kernels. + +# 3.2. Stacked Deformable Convolution Layers + +Deformable convolution [4] is proposed to improve the CNN's capability to model geometric transformations. It is trained with a learnable offset, which helps with the sampling of pixel points with a deformed sampling grid. Due to this characteristic, it is widely leveraged for feature alignments or implicit motion estimations without any optical-flow priors [26, 28]. In this work, we leverage the deformable convolution for the similarity search and extraction steps, adopting modulated deformable convolution [43] which additionally learns the dynamic weights of the sampling kernels with a modulation scalar. + +In the modulated deformable convolution, modulation scalars are learned together with offsets to make the kernels more spatially-variant. Formally, the deformable convolution operation is defined as follows: + +$$ +Y (p) = \sum_ {k = 1} ^ {K} w _ {k} \cdot X \left(p + p _ {k} + \triangle p _ {k}\right) \cdot \triangle m _ {k}, \tag {1} +$$ + +where $X$ is the input, $Y$ is the output, and $k$ and $K$ correspondingly denote the index and the number of kernel weights. $w_{k}$ , $p$ , $p_{k}$ and $\triangle p_{k}$ are the $k$ -th kernel weight, indices of the center, the $k$ -th fixed offset and the learnable offsets for the $k$ -th location, respectively. $\triangle m_{k}$ is the modulation scalar, which enables relevancy-aware weight learning to robustly extract correspondences for cluttered or irrelevant input data in RefSR. + +SSEN consists of several deformable convolution layers arranged in a sequential manner as shown in Fig. 2. The purpose of the stacking of deformable convolution layers sequentially is to sample more locations from reference images for aligning features with a larger receptive field. SSEN gradually aligns reference features to input features in each layer according to the offset provided from the dynamic offset estimator, which will be covered in detail in the following section. + +# 3.3. Dynamic Offset Estimator + +To capture the similarity located from near to far distances, the offset should be learned dynamically (i.e., the offset should be able to cover a wide range of area, actively reaching various and distant positions). We design an offset estimator for learning the dynamic offsets, called dynamic offset estimator. Because the offset for deformable convolution should be learned based on the similarity between the reference image and the input low-resolution image, a reference feature and an input feature are concatenated as an + +![](images/ffb6e316e9f577708ec12a18a76dbc3969489dca8b9a88b4f1fd32b9d4b1f147.jpg) +Figure 3: The proposed dynamic offset estimator. Features are down-sampled and fed into non-local blocks. The estimator is designed to learn residuals with skip connections. + +input for the dynamic offset estimator, as shown in Fig. 3. We follow the multi-scale philosophy commonly adopted in optical flow estimations [6, 10]. The concatenated input is down-sampled three times such that multiple levels of scales can be considered when predicting offsets. + +To localize relevant features which can be located at far distances effectively, we exploit non-local blocks in the dynamic offset estimator. The non-local operations capture the global correlation of intra- or inter-features, which helps with the prediction of dynamic offsets with an extremely large receptive field to handle both small and large displacements. We utilize three non-local blocks in the dynamic offset estimator so that the features are amplified with attention in each level of scale. Note that the processing of non-local operations with regard to down-sampled features can be considered as measuring the patch-wise similarity rather than the pixel-wise similarity. + +Given an input $\mathbf{x}$ and an output $\mathbf{y}$ , the non-local block operation is defined as follows: + +$$ +\mathbf {y} _ {i} = \mathbf {x} _ {i} + W _ {\mathbf {y}} \frac {1}{C (\mathbf {x})} \sum_ {j} f \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}\right) g \left(\mathbf {x} _ {j}\right), \tag {2} +$$ + +where $i$ is the index of the output position and $j$ is the index of all possible positions. $W_{\mathbf{y}}$ denotes the weight matrix and $C(\mathbf{x})$ is the normalization factor. $f(\cdot)$ and $g(\cdot)$ represent the pair-wise operation and the linear embedding function, respectively. + +Here, we can consider $\mathbf{y}$ as an attention guided feature, which highlights the global correlation between the input feature and the reference feature at the pixel- or patch-level. The function $g(\mathbf{x}_j)$ can be expressed as $\mathbf{W}_g\mathbf{x}_j$ , which computes the linear embedding of the input signal $\mathbf{x}$ at position $j$ . $f(\mathbf{x}_i,\mathbf{x}_j)$ calculates the pairwise similarity between $\mathbf{x}_i$ and $\mathbf{x}_j$ . In this operation, we expect the similarity to be calculated in a similar manner to an inner product which is commonly used in patch matching. We adopt an embedded Gaussian function [29] for this pairwise operation defined + +![](images/a017b86e50c49f3e8e49d04cdeb1c551ba5866851a200201722d61bc19e96323.jpg) +Figure 4: Illustration of the self-similarity SR framework + +as follows: + +$$ +f \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}\right) = \exp \left(\theta \left(\mathbf {x} _ {i}\right) ^ {T} \phi \left(\mathbf {x} _ {j}\right)\right), \tag {3} +$$ + +where $\theta (\cdot)$ and $\phi (\cdot)$ are two linear embedding functions. For parameter-efficiency, we halve the dimension of the embeddings within the dynamic offset estimator. + +# 3.4. RefSR and Self-Similarity SR Framework + +RefSR The baseline is implemented with stacked residual blocks [18], which consist of residual blocks without batch normalization. Following previous work [18], we remove batch normalization from the network for better super-resolution performance. Note that SSEN can easily be attached to any existing super-resolution architecture. + +The reference features extracted from the SSEN are fused with the input feature at the mid-level, after which the fused features are processed further at reconstruction network before they are up-sampled (c.f., Fig. 2). In addition, a global skip connection between the input and output layers is adopted to ensure that our network focuses on residual feature learning. All feature manipulations are conducted at one-quarter of the size of the input spatial dimensions for efficient computation. + +Self-Similarity SR If no appropriate reference image is available, the SSEN can be utilized in a self-reference manner. As shown in Fig. 4, the feature to be referenced is extracted from the same input image. In this situation, the proposed module is expected to exploit cues from the input image (i.e., cues from itself), which can be helpful to minimize the reconstruction loss. + +For the reconstruction network, we adopt RCAN [37] as our baseline network, which shows the best performance in SISR without a self-ensemble scheme. RCAN is designed with a residual-in-residual structure, which consists of several residual blocks with short skip connections. In addition, it adopts a channel attention mechanism to consider inter-dependencies among channels. The performance of SISR can be improved by seamlessly inserting the SSEN into a baseline network. + +# 3.5. Training Objective + +For the objective function, we adopt the Charbonnier penalty function [16] as the final training objective, which is + +known to help with the handling of outliers to improve the performance. The Charbonnier penalty is defined as follows: + +$$ +\mathcal {L} _ {r e c} = \sqrt {\| I ^ {H R} - I ^ {S R} \| ^ {2} + \varepsilon^ {2}}, \tag {4} +$$ + +where $I^{HR}$ and $I^{SR}$ denote the ground truth and the output from the proposed algorithm, respectively. $\varepsilon$ is set to $1e^{-6}$ . + +Moreover, perception-oriented objectives [12, 11] can be incorporated together to generate rich and realistic textures. For instance, PatchGAN judges realism at the scale of the image patches and shows performance superior to those of other GAN classifiers [11]. + +The objective of the PatchGAN is defined as follows: + +$$ +\begin{array}{l} \mathcal {L} _ {a d v} = \min _ {G} \max _ {D} \mathbb {E} _ {I ^ {H R} \sim \mathbb {P} _ {r}} [ \log D (I ^ {H R}) ] \\ + \mathbb {E} _ {I ^ {S R} \sim \mathbb {P} _ {g}} [ \log (1 - D (I ^ {S R})) ], \tag {5} \\ \end{array} +$$ + +where $G$ denotes the generator which generates $I^{SR}$ , and $D$ stands for the discriminator. $\mathbb{P}_r$ and $\mathbb{P}_g$ are the real data distribution and the model distribution, respectively. + +# 4. Experimental Results + +# 4.1. Dataset + +We use the CUFED dataset [31] which contains 1883 albums that describe daily life events, to train the network for RefSR. For the RefSR task, there is the assumption that reference images contain contents similar to those of the input low-resolution images. To guarantee this assumption, Zhang et al. [40] reorganize the CUFED dataset into 13,761 image pairs scored based on the number of SIFT [22] correspondence matches. Furthermore, to evaluate the RefSR methods, the authors propose the CUFED5 dataset with 126 groups. Each high-resolution image is paired with five different reference images with five different levels of similarity. We adopt a random $90^{\circ}$ rotation for augmentation during the training process. + +For self-similarity SR, we utilize the DIV2K dataset [27], which has been widely used as a benchmark dataset in SR tasks. We augment the training data with random cropping with a patch size of $192 \times 192$ and a random $90^{\circ}$ rotation. For the evaluation, the Urban100 [9], Set5 [1], Set14 [36], and B100 [23] datasets are utilized. + +# 4.2. Training Details + +All experiments are conducted with a scaling factor of $\times 4$ between the LR and HR images. The network is trained with an initial learning rate of $1e^{-4}$ using the ADAM optimizer with $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ . We use PyTorch to implement the model on an NVIDIA 1080Ti GPU. For the training of the network with $L_{adv}$ , we initially pre-train the network only with the reconstruction loss, after which we fine-tune the network with the GAN loss attached to + +
SISRPSNRSSIM
Bicubic24.180.684
SRCNN [5]25.330.745
LapSRN [16]24.920.730
MDSR [18]25.930.777
SRGAN [17]24.400.702
ENet [24]24.240.695
Baseline26.360.779
+ +(a) SISR + +
RefSRPSNRSSIM
Landmark [35]24.910.718
CrossNet [42]25.480.764
SRNTT [40]25.610.764
SRNTT-ℓ2 [40]26.240.764
Ours26.780.791
+ +the training objective. We train the network for 100K iterations with a batch size of 32 and adopt a cosine learning rate schedule scheme [21] with $\gamma = 0.9$ . + +# 4.3. Quantitative and Qualitative Evaluations + +RefSR We compare the quantitative and qualitative results to those of other GAN-based SISR and RefSR methods to demonstrate the superior performance of the proposed method. Figure 5 shows comparisons of our method with other SISR and RefSR methods in terms of the visual quality. Overall, our method shows better visual quality with less noise, clear contents, and greater relevancy with the ground truth. + +To evaluate our approach quantitatively, we measure the PSNR and SSIM (structural similarity) [32] as a means of distortion-oriented measurements. As shown in Tab. 1, our method is compared with various methods, including SISR and RefSR methods. The SISR methods are SRCNN [5], LapSRN [16], MDSR [18], SRGAN [17], and ENet [24], and the RefSR methods are Landmark [35], CrossNet [42], SRNTT [40], and SRNTT- $\ell_2$ . The difference between SRNTT and SRNTT- $\ell_2$ is the presence of perceptual and adversarial losses during the training. SRNTT- $\ell_2$ is trained only with the reconstruction loss to achieve a higher PSNR. All methods are trained with the CUFED dataset and are tested on the CUFED5 dataset. Our method achieves the highest PSNR and outperforms all previous methods by a large margin (see Tab. 1). We emphasize that the effectiveness of the proposed algorithm is caused by less noisy outputs, the clearer boundaries, and the relevant textures softly transferred from the reference (see Fig. 5). + +Self-Similarity SR For a fair comparison with the SISR methods, we utilize SSEN in a self-reference manner. As depicted in Fig. 4, the overall network is modified to enable the self-reference capability. In this variant, a LR input image is fed into the baseline and the SSEN simultaneously to extract self-reference features from the input image. Our method is mainly tested on the Urban100 [9] dataset, which contains structured scenes and rich textures to be utilized for self-similarity SR. + +Figure 6 shows a qualitative comparison between models with and without the SSEN on the Urban100 dataset. We + +(b) RefSR +Table 1: PSNR / SSIM comparisons with other SR methods on the CUFED5 dataset. We group methods by (a) SISR and (b) RefSR. The best performances are written in bold. + +
MethodsUrban100Set5Set14B100
Bicubic23.14/0.65728.42/0.81026.00/0.70225.96/0.667
SRCNN [5]24.52/0.72230.48/0.86227.50/0.75126.90/0.710
VDSR [14]25.18/0.75431.35/0.88328.02/0.76827.29/0.072
LapSRN [16]25.21/0.75631.54/0.88528.19/0.77227.32/0.727
MemNet [25]25.50/0.76331.74/0.88928.26/0.77227.40/0.728
EDSR [18]26.64/0.80332.46/0.89628.80/0.78727.71/0.742
RDN [39]26.61/0.80232.47/0.89928.81/0.78727.72/0.741
RCAN [37]26.82/0.80832.63/0.90028.87/0.78827.77/0.743
Baseline26.61/0.80232.46/0.89828.79/0.78727.69/0.740
Ours26.71/0.80832.48/0.89928.84/0.78827.72/0.742
+ +Table 2: PSNR / SSIM comparisons with other SISR methods on benchmark datasets. + +
MethodsXHHMLXL
SRNTT25.17/0.73425.13/0.72925.06/0.72825.07/0.72025.14/0.729
SRNTT-ℓ226.06/0.76525.97/0.76025.90/0.75825.88/0.75825.87/0.757
Baseline26.36/0.779
Ours26.78/0.79126.52/0.78326.48/0.78226.42/0.78126.41/0.780
Ours (GAN+)25.35/0.74225.05/0.73224.99/0.73024.95/0.72924.98/0.730
+ +Table 3: PSNR / SSIM comparisons with five different levels of similarity. The best numbers for each level of similarity are written in bold. + +confirm that our method successfully recovers structured and recurring details by transferring finer textures from distant pixels. Relevant reference features extracted from distant pixels are well aligned by the SSEN, and this leads to more accurate and visually pleasing reconstruction results. + +Table 2 shows quantitative comparisons with other SISR methods. SRCNN [5], VDSR [14], LapSRN [16], MemNet [25], EDSR [18], RDN [39], and RCAN [37] are compared with our self-similarity SR method. We mainly demonstrate the effectiveness of our module by verifying the performance improvement when the SSEN is attached during the training process. Note that while we reproduce our baseline with the RCAN [37] network unit, we achieve a slightly lower PSNR than the result reported in an earlier paper [37]. However, a PSNR improvement of 0.1dB is observed with our module on the Urban100 dataset. This confirms the effectiveness of the SSEN in self-similarity SR. + +# 4.4. Ablation Studies + +Robustness to Irrelevancy In this section, we compare the robustness to irrelevancy of the proposed method and SRNTT [40] at five different similarity levels. In Tab. 3, XH, H, M, L, and XL denote very-high, high, middle, low, and very-low similarities, respectively. In a perceptual quality-oriented training condition (i.e., SRNTT and ours $(\mathrm{GAN}+))$ , our method outperforms at the very-high similarity level. Note that the performance of the proposed method with GAN for the other similarity levels can be improved by adjusting the weights for $L_{rec}$ and $L_{adv}$ . In a reconstruction-oriented training condition (i.e., SRNTT- $\ell_2$ and ours), our method shows superior robustness at every + +![](images/9c5b855304f9fb8369074b6da72ef8b38c704212fef639a3aeef61adea2ee0f4.jpg) +Figure 5: Qualitative comparisons with other SR methods on the CUFED5 dataset. + +level of similarity compared to SRNTT- $\ell_2$ . Robustness can be strongly proven given that our method consistently outperforms the baseline, which means that even a reference image with a low level of similarity is still quite effectively utilized by our method. + +Number of Deformable Convolution Layers As shown in Tab. 4, we conduct an ablation study to investigate the optimal number of deformable convolution layers in Sec. 3.2. We confirm that three layers of deformable convolution are the optimal number for the best performance. Compared to the performance of the baseline, adding only one deformable convolution layer shows a great improvement, + +with a PSNR of 0.23dB at the XH level, whereas the performance rarely improves without any deformable convolution layers. Because the output features in each layer have different levels of alignment, a skip connection would be inappropriate if added to each deformable convolution layer. This implies that the deeper the network, the more difficult it is to train. Hence, stacking more layers (e.g., more than four layers) does not guarantee better performance. + +Effect of Non-Local Block To validate the importance of non-local blocks in our dynamic offset estimator in Sec. 3.3, we compare the performance of the proposed algorithm with and without non-local blocks, as shown in + +![](images/1a143167a4caa97775df59a5c19381edab2919d4de01679e8e7857d24527f6fd.jpg) +Figure 6: Qualitative results of self-similarity SR. PSNR and SSIM scores are shown together. + +
# of layersXHHMLXL
Baseline26.36/0.779
No layers26.42/0.77926.40/0.77926.39/0.77926.39/0.77826.39/0.778
1 layer26.59/0.78526.47/0.78126.44/0.78026.43/0.78026.41/0.779
2 layers26.64/0.78626.47/0.78126.44/0.78026.41/0.78026.40/0.779
3 layers26.78/0.79126.52/0.78326.48/0.78226.42/0.78126.41/0.780
4 layers26.70/0.78926.45/0.78126.43/0.78126.40/0.78026.38/0.779
w/o NB26.68/0.78826.47/0.78226.44/0.78126.41/0.78026.39/0.780
w NB26.78/0.79126.52/0.78326.48/0.78226.42/0.78126.41/0.780
+ +Table 4: PSNR / SSIM comparisons of (top) the number of layers and (bottom) the presence of non-local blocks (NB). The best numbers are written in bold. + +Tab. 4. The network with non-local blocks consistently outperforms that without non-local blocks. This implies that the non-local blocks are helpful to capture the global context and the correlations of each feature, which are necessary to estimate the long-range dependencies. Without nonlocal blocks, we observe performance degradation of $0.1\mathrm{dB}$ at the XH level, as shown in Tab. 4. + +Visualization of Offset To validate the similarity- and relevancy-awareness of the proposed method, we visualize offsets which are the sampling locations of deformable convolution. We visualize all sampling locations of a pixel of the reference image. As the SSEN consists of three layers of deformable convolution with a $3 \times 3$ kernel, there are $9^{3}$ sampling points in total per pixel. + +As shown in Fig. 7, the sampling points in the originally aligned regions tend to cluster near the output pixel location. On the other hand, in the misaligned area, the sampling locations tend to be spread apart by enlarging their receptive field. By enlarging its receptive field, the SSEN attempts + +![](images/67e32eaf0acf51f78217046186c7da5ccfdcad8724ddba753a24bae66ab055f4.jpg) +Figure 7: Offset visualization for (a) RefSR and (b) Self-Similarity SR. Reference points are shown on the left images and their corresponding sampling points are shown on the right images. Sampling points are drawn in colors identical to those of the reference points. + +to find the best matching pairs of pixels between the input image and the reference image. In the self-similarity SR case, the input and reference images are previously aligned. Therefore, the sampling points are spread out along similar regions or structures. + +Computation Time We validate the efficiency of our algorithm further by comparing its computation time with those of other algorithms on a $\times 4$ SR task. PatchMatch [2] takes 86.3s and SS-Net [41] takes 105.6s on average on a GPU. SRNTT [40] takes 9.053s for the patch matching process and 2.909s for reconstruction, i.e., 11.962s in total. The patch matching process is the bottleneck in these methods. Our method generates a $322 \times 550$ image within 0.95s on average due to the effective feature alignment capability without any patch matching process. This is highly beneficial for many real-time applications. The inference time is measured on a machine equipped with an Intel Xeon CPU (2.10 GHz) and an NVIDIA GTX 1080 Ti GPU. + +# 5. Conclusion + +In this paper, we introduced a reference feature extraction module termed the Similarity Search and Extraction Network (SSEN), which extracts features from reference images in an aligned form relative to the low-resolution features. The proposed method is the first end-to-end trainable RefSR method that does not require heavy computation or explicit flow estimations. Our algorithm outperforms other RefSR methods with more robustness. Moreover, the proposed module can be utilized for self-similarity SR if no reference image is available. To deal with the long distance similarity issue, we adopt a multi-scale structure and non-local blocks for the dynamic offset estimator to predict a wide range of offsets. Experimental results demonstrate that our method achieves state-of-the-art performance quantitatively and qualitatively. + +Acknowledgements This work was supported by the Institute for Information & Communications Technology Promotion (2017-0-01772) grant funded by the Korea government. + +# References + +[1] Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. In Proc. of British Machine Vision Conf. (BMVC), 2012. +[2] Vivek Boominathan, Kaushik Mitra, and Ashok Veeraraghavan. Improving resolution and depth-of-field of light field cameras using a hybrid imaging system. In IEEE Int'l Conf. on Computational Photography (ICCP), 2014. +[3] Jose Caballero, Christian Ledig, Andrew Aitken, Alejandro Acosta, Johannes Totz, Zehan Wang, and Wenzhe Shi. Realtime video super-resolution with spatio-temporal networks and motion compensation. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2017. +[4] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proc. of Int'l Conf. on Computer Vision (ICCV), 2017. +[5] Chao Dong, Chen Change Loy, Kaiming He, and Xiaou Tang. Learning a deep convolutional network for image super-resolution. In Proc. of European Conf. on Computer Vision (ECCV), 2014. +[6] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In Proc. of Int'l Conf. on Computer Vision (ICCV), 2015. +[7] Gilad Freedman and Raanan Fattal. Image and video upscaling from local self-examples. ACM Trans. on Graph. (ToG), 2011. +[8] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Proc. of Advances in Neural Information Processing Systems, 2014. +[9] Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2015. +[10] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2017. +[11] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2017. +[12] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In Proc. of European Conf. on Computer Vision (ECCV), 2016. +[13] Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Deeplyrecursive convolutional network for image super-resolution. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2016. +[14] Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2016. + +[15] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Proc. of Advances in Neural Information Processing Systems, 2012. +[16] Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2017. +[17] 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. of Computer Vision and Pattern Recognition (CVPR), 2017. +[18] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Young Mu Lee. Enhanced deep residual networks for single image super-resolution. In Proc. of Computer Vision and Pattern Recognition Workshops (CVPRW), 2017. +[19] Ce Liu and Deqing Sun. A bayesian approach to adaptive video super resolution. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2011. +[20] Ding Liu, Bihan Wen, Yuchen Fan, Chen Change Loy, and Thomas S Huang. Non-local recurrent network for image restoration. In Proc. of Advances in Neural Information Processing Systems, 2018. +[21] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In Proc. of International Conference on Learning Representations (ICLR), 2017. +[22] David G Lowe et al. Object recognition from local scale-invariant features. In Proc. of Int'l Conf. on Computer Vision (ICCV), 1999. +[23] David Martin, Charless Fowlkes, Doron Tal, Jitendra Malik, et al. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proc. of Int'l Conf. on Computer Vision (ICCV), 2001. +[24] Mehdi SM, Sajjadi, Bernhard Scholkopf, and Michael Hirsch. Enhancenet: Single image super-resolution through automated texture synthesis. In Proc. of Int'l Conf. on Computer Vision (ICCV), 2017. +[25] Ying Tai, Jian Yang, Xiaoming Liu, and Chunyan Xu. Memnet: A persistent memory network for image restoration. In Proc. of Int'l Conf. on Computer Vision (ICCV), 2017. +[26] Yapeng Tian, Yulun Zhang, Yun Fu, and Chenliang Xu. Tdan: Temporally deformable alignment network for video super-resolution. arXiv preprint arXiv:1812.02898, 2018. +[27] Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, and Lei Zhang. Ntire 2017 challenge on single image super-resolution: Methods and results. In Proc. of Computer Vision and Pattern Recognition Workshops (CVPRW), 2017. +[28] Xintao Wang, Kelvin CK Chan, Ke Yu, Chao Dong, and Chen Change Loy. Edvr: Video restoration with enhanced deformable convolutional networks. In Proc. of Computer Vision and Pattern Recognition Workshops (CVPRW), 2019. +[29] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2018. + +[30] Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. Esrgan: Enhanced super-resolution generative adversarial networks. In Proc. of European Conf. on Computer Vision (ECCV), 2018. +[31] Yufei Wang, Zhe Lin, Xiaohui Shen, Radomir Mech, Gavin Miller, and Garrison W Cottrell. Event-specific image importance. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2016. +[32] Zhou Wang, Alan C Bovik, Hamid R Sheikh, Eero P Simoncelli, et al. Image quality assessment: from error visibility to structural similarity. IEEE Trans. on Image Processing (TIP), 2004. +[33] Chih-Yuan Yang, Jia-Bin Huang, and Ming-Hsuan Yang. Exploiting self-similarities for single frame super-resolution. In Proc. of Asian Conf. on Computer Vision (ACCV), pages 497-510. Springer, 2010. +[34] Jianchao Yang, John Wright, Thomas S Huang, and Yi Ma. Image super-resolution via sparse representation. IEEE Trans. on Image Processing (TIP), 2010. +[35] Huanjing Yue, Xiaoyan Sun, Jingyu Yang, and Feng Wu. Landmark image super-resolution by retrieving web images. IEEE Trans. on Image Processing (TIP), 2013. +[36] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In Proc. of Int'l Conf. on Curves and Surfaces, 2010. +[37] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In Proc. of European Conf. on Computer Vision (ECCV), 2018. +[38] Yulun Zhang, Kunpeng Li, Kai Li, Bineng Zhong, and Yun Fu. Residual non-local attention networks for image restoration. arXiv preprint arXiv:1903.10082, 2019. +[39] Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image superresolution. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2018. +[40] Zhifei Zhang, Zhaowen Wang, Zhe Lin, and Hairong Qi. Reference-conditioned super-resolution by neural texture transfer. arXiv preprint arXiv:1804.03360, 2018. +[41] Haitian Zheng, Mengqi Ji, Lei Han, Ziwei Xu, Haoqian Wang, Yebin Liu, and Lu Fang. Learning cross-scale correspondence and patch-based synthesis for reference-based super-resolution. In Proc. of British Machine Vision Conf. (BMVC), 2017. +[42] Haitian Zheng, Mengqi Ji, Haoqian Wang, Yebin Liu, and Lu Fang. Crossnet: An end-to-end reference-based super resolution network using cross-scale warping. In Proc. of European Conf. on Computer Vision (ECCV), 2018. +[43] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In Proc. of Computer Vision and Pattern Recognition (CVPR), 2019. \ No newline at end of file diff --git a/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/images.zip b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..66194d8780278ea81f7636dcce1f82da0f25f5ef --- /dev/null +++ b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23d632a4ea7dc2ce01ac6fe2f6c5b29fbe9fcdb396ce4af11f73ed9ff842e26b +size 904506 diff --git a/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/layout.json b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b2f2900aebf38dba031ae904ad29146c036080f4 --- /dev/null +++ b/robustreferencebasedsuperresolutionwithsimilarityawaredeformableconvolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98ce6e02d0aefc3a309c1bb705b7df946c120ea26b7603fbea025108e338d301 +size 323936 diff --git a/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_content_list.json b/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d86cc9d8599ac4c74ba9dc31ce6432e5735c3a9c --- /dev/null +++ b/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:caf81efe48430594e1538ed95aae2dc6d9af29df9987bc91f5d164fede248a2a +size 76569 diff --git a/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_model.json b/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fffe006c04ab830e094df82caea107133d2c8f23 --- /dev/null +++ b/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2276e3a1de21a700112902bf6d9e7a30f4c5ccb5358ef73b85a9b5f776d8389 +size 93422 diff --git a/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_origin.pdf b/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bddd780f1a327b66fe3bea4f74c3aba9832be3af --- /dev/null +++ b/robustsuperpixelguidedattentionaladversarialattack/61bfa74e-3aa3-41a8-8ab6-4f354e4e675d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bed62125f1a91c8fc877bf92746ecc33d7beff4e372b70f9f7054dea2f811796 +size 13520689 diff --git a/robustsuperpixelguidedattentionaladversarialattack/full.md b/robustsuperpixelguidedattentionaladversarialattack/full.md new file mode 100644 index 0000000000000000000000000000000000000000..297c730f5d43b2b66865da22752a7339a15de461 --- /dev/null +++ b/robustsuperpixelguidedattentionaladversarialattack/full.md @@ -0,0 +1,296 @@ +# Robust Superpixel-Guided Attentional Adversarial Attack + +Xiaoyi Dong $^{1}$ , Jiangfan Han $^{2}$ , Dongdong Chen $^{3*}$ , Jiayang Liu $^{1}$ , Huanyu Bian $^{1}$ , Zehua Ma $^{1}$ , Hongsheng Li $^{2}$ , Xiaogang Wang $^{2}$ , Weiming Zhang $^{1}$ , Nenghai Yu $^{1}$ , $^{1}$ University of Science and Technology of China $^{2}$ The Chinese University of Hong Kong, $^{3}$ Microsoft Cloud AI + +{dlight@,1jyljy@,hybian@,mzh045@,}mail.ustc.edu.cn + +{jiangfanhan@link.,hsli@ee.,xgwang@ee.}cuhk.edu.hk + +{zhangwm@, ynh@}ustc.edu.cn, cddlyf@gmail.com + +# Abstract + +Deep Neural Networks are vulnerable to adversarial samples, which can fool classifiers by adding small perturbations onto the original image. Since the pioneering optimization-based adversarial attack method, many following methods have been proposed in the past several years. However most of these methods add perturbations in a "pixel-wise" and "global" way. Firstly, because of the contradiction between the local smoothness of natural images and the noisy property of these adversarial perturbations, this "pixel-wise" way makes these methods not robust to image processing based defense methods and steganalysis based detection methods. Secondly, we find adding perturbations to the background is less useful than to the salient object, thus the "global" way is also not optimal. Based on these two considerations, we propose the first robust superpixel-guided attentional adversarial attack method. Specifically, the adversarial perturbations are only added to the salient regions and guaranteed to be the same within each superpixel. Through extensive experiments, we demonstrate our method can preserve the attack ability even in this highly constrained modification space. More importantly, compared to existing methods, it is significantly more robust to image processing based defense and steganalysis based detection. + +# 1. Introduction + +Deep neural networks(DNNs) have achieved great achievements on many artificial intelligence tasks such as image recognition [15, 19], object detection [33] and natural language processing [40]. But recent works [37] found that DNNs are vulnerable to adversarial samples. Adversarial samples are carefully crafted images by making small and + +![](images/bca86bc05a9cdab949117a594b8c99ad09625370c3174eb4e5fb1b017824945c.jpg) +SAI-FGM(ours) + +![](images/8fa18723b5fb382c80a820b1b2c55baf13d80ffe6710d34b0729898f6aa51ae0.jpg) +Original Image + +![](images/f7cbb0c9afe18a07f4fa309fc42d431e6929b4788be8abb50640a3c734ce307e.jpg) +I-FGM +Figure 1. Original image and corresponding adversarial samples generated by SAI-FGM(proposed method) and I-FGM. Meanwhile, we enlarge part of the images to show the difference of smoothness between the three images. + +invisible perturbations on the original images. Although they are indistinguishable to the original images by human being, they can make DNNs make totally wrong predictions. Adversarial samples reveal the defect and sensitivity of DNNs, but can also help us to get better understanding of DNNs and train more robust models. + +First proposed by [37], methods to generate adversarial sample are various. Among all of them, gradient-based methods [9, 17] which calculate the modification pattern by taking the gradient with respect to the input sample are simple and effective. Fast Gradient Sign Method(FGSM) proposed in [9] using the gradient of classification loss with respect to the input image as the adversarial noise to fool the recognition models. It provides a quick solution to get adversarial samples. Then [17] proposes iterative version of FGSM(I-FGSM) to get better attack performance. [5] further adds a momentum term to improve the transferability of adversarial sample to unseen models. Other works [41, 6] provide various methods to get more robust adversarial sample to unknown even defensive models. + +Notwithstanding their success, all of these methods add adversarial perturbations in a "pixel-wise" and "global" way. Here "pixel-wise" means these adversarial perturbations are added onto each pixel independently, thus very noisy in most cases. By contrast, from the statistic perspec + +![](images/75e25616efe8663133094323c87ddcd69e033bd2c76ae49aa3ece882953579d3.jpg) +Figure 2. Pipeline of generating background and foreground adversarial samples. Background and foreground noise are generated by splitting the adversarial noise to two equal size parts with the attention map. + +tive, natural images often have the local smoothness property. As illustrated in Figure 1, comparing with original image, adversarial samples generated by I-FGSM are much noisy and rough. Such contradiction makes these methods not robust to existing image processing based defense methods and steganalysis based detection methods. For image processing based defense methods, they often process the adversarial samples in a local way (e.g., smoothing, resizing) and destroy the original noisy adversarial pattern. Similarly, the reason why steganalysis based detection methods can detect adversarial samples is also because steganalysis features can detect the small adversarial perturbations that do not follow the local smoothness property. + +For "global", it means that most existing methods treat all the pixels in one image equally and add perturbations to all pixels. In this paper, we argue this "global" way is not optimal and has two obvious drawbacks. Firstly, as shown in Figure 2, we split the adversarial noise to two equal size parts as the foreground object part and the background part and we find that adding adversarial noise to foreground object is more useful than to the background. Because the target classifier only focuses on the foreground part, which is demonstrated by its activation map. Secondly, foreground objects often contain more textures than background regions (e.g., sky, lake) statistically, so perturbations in the background regions are also much easier to be detected. + +Based on the above two considerations, we propose the first robust superpixel-guided attentional adversarial attack method. Specifically, given an input image, we first leverage traditional superpixel generation method [32] to get the over-segmented superpixel map, where pixels in each superpixel have similar colors and follow the local smoothness property. Then we generate the adversarial perturbations in a superpixel manner, i.e., the perturbation within each superpixel must be the same. To further ensure the local smoothness, we improve the original superpixel method [32] by adaptively merging similar superpixels. For the above "global" problem, we replace it with an "attentional" way by using the auxiliary information from the class activation map [43]. In other words, we constrain that the per + +turbations are only added onto the foreground object (i.e., the class activated regions) rather than the whole image. + +With the above locally smooth and attentional constraint, though the adversarial perturbation space of our method is much smaller than previous "pixel-wise and global" methods, extensive experiments demonstrate our method can still preserve the attack ability with dedicated designs. More importantly, we show that the proposed superpixel-guided attentional adversarial attack is significantly more robust to image processing based defense and steganalysis based detection methods by a large margin. + +To summarize, our contributions are threefold as below. + +- We clearly analyze the limitations of existing "pixelwise and global" adversarial attack methods, and clarify the underlying reason of why they are not robust to image processing and steganalysis. +- Based on the analysis, we propose the first superpixel-guided attentional adversarial attack method, which not only guarantees the local smoothness but also modifies the image in a more effective way. +- Extensive experiments demonstrate the proposed method can preserve the original attack ability and achieve superior robustness simultaneously. + +# 2. Related Work + +Adversarial Attack. Current adversarial sample methods can be categorized into three types: optimization-based [37, 2], gradient-based [9, 17], and generation-based [1, 31, 14]. Optimization-based methods model the generation of adversarial samples as an optimization problem and use optimizers like box-constrained L-BGFS or Adam to solve it, which are powerful but quite slow. Goodfellow /etal [9] proposed the first gradients-based method Fast Gradient Sign Method (FGSM) and following work [17] performed small step size iteratively to get better attack performance (I-FGSM). Generation-based methods aim to train a model to generate adversarial samples with a single forward path, which is very fast but requires extra training time. Different from their "pixel-wise and global" way, the proposed method is the first super-pixel level and foreground only adversarial sample generation method. + +Adversarial Detection. There are roughly four different types of adversarial detection methods: model-based [11, 8], PCA-based [16, 20], preprocessing-based [22, 42] and steganalysis-based [24]. Model-based methods view adversarial samples as an additional category and retrain the network to classify adversarial samples to this new category. PCA-based methods leverage the fact that adversarial samples place a higher weight on the larger principal components compared with clean images. Preprocessing-based + +methods apply some image transformation on the input images and check the prediction variance. Recently, motivated by steganalysis, [24] proposes to use steganalysis features to detect adversarial samples, because these features are sensitive to the change of image statistics and small perturbations such as C&W [2]. Our idea is partially inspired by this method, and this method is also used as one important metric to evaluate the robustness of adversarial samples. + +Adversarial Defense. Compared with adversarial detection, adversarial defense is another active way to protect the target model against adversarial attack. Adversarial training proposed by [9] is one of the most popular way to train a robust network by adding the adversarial sample into the training set. In [12, 28, 3, 23, 44], they add one preprocessing step to remove the adversarial noise of the input images before feeding into the target model. For example, method [25] proposes DNN-Oriented JPEG compression with the idea of feature distillation to remove adversarial noise. Another work [13] proposes to use JPEG compression, total variance minimization(TVM) and image quilting to defence adversarial attack. Another type of methods like [38, 29, 30] use some regularizers or smooth labels to make the target model more robust to the perturbation on input images. Among the aforementioned methods, image preprocessing is the most lightweight method as it does not need to change model architecture or parameters. In this paper, we also use this type of methods to evaluate the final adversarial robustness. + +Superpixels. In the era before deep learning, superpixel segmentation [32, 27] aims to oversegment the image by grouping pixels that share similar properties. It captures the redundancy of image and is regarded as representative primitive for computing image features. They are widely used in many computer vision algorithms, such as image compression [34], depth estimation [26], and stereo matching [10]. Motivated by the smooth property within each superpixel, we are the first who leverages superpixel as the guidance to add adversarial perturbations. This helps us to generate local smooth and robust adversarial samples. + +# 3. Method + +# 3.1. Problem Definition. + +We denote $\mathbf{x}$ as the source image and $y$ as the corresponding ground-truth label. Let $\mathcal{H}$ be the target model with parameters $\theta$ . Then $\mathcal{H}(\mathbf{x};\theta)$ is the probability prediction for each class. For an ideal model we should get $\arg \max_c\mathcal{H}(\mathbf{x};\theta)_c = y$ . For a real model, the equation is also satisfied for most samples. An adversarial sample $\mathbf{x}^{adv} = \mathbf{x} + \mathbf{r}$ is generated by adding noise $\mathbf{r}$ to the original image $\mathbf{x}$ and satisfies $\arg \max_c\mathcal{H}(\mathbf{x}^{adv};\theta)_c\neq y$ . In the mean time, the noise $\mathbf{r}$ should be small enough to guarantee the adversarial sample is similar to the original one. In most + +cases $\mathbf{r}$ is measured by $l_{p}$ norm and the constraint $\| \mathbf{r}\| _p\leqslant \epsilon$ is proposed to fulfill the similarity requirement. Here $\epsilon$ is a predefined threshold constant. + +White-Box vs. Gray-Box vs. Black-Box. If we have the full knowledge about the target model to attack, including the model architecture and parameters, such an attack is called as white-box attack. In this case, we can generate adversarial samples with back-propagated gradients directly. If we have the full access to the model, but there are some unknown input transformations before feeding images into the model, we call such an attack as gray-box attack. For black-box attack, we have no knowledge about the target model, so adversarial samples are often generated by other white-box models and fool the target model with transferability. + +# 3.2. Motivation + +As briefly described in the introduction part, our method is motivated from the below two observations: + +1). The contradiction between the local smoothness of natural images and the noisy property of adversarial perturbations. Although previous attack methods can generate strong adversarial samples, most of them add adversarial perturbations in a "pixel-wise" way and do not consider the original neighborhood information. This causes the generated adversarial perturbations to be noisy as shown in the Figure 1(Right). However, pixels in natural images often have the local smooth property, which implies neighboring pixels often have similar pixel values. This is also the theoretical building block for many image processing tasks like image compression. Therefore, adding pixel-wise perturbations will destroy the original local statistics such as first-order and second-order Markov process statistics. This also motivates the method [24] to use steganalysis features to detect adversarial samples as steganalysis features considers such types of local statistics. Besides, this contradiction also makes these adversarial attack methods not robust to image processing based defense methods. This is because processing techniques like resizing or smoothing are based on the local smooth property and will destroy the original noisy pattern of adversarial perturbations. Take I-FGSM as an example, if we use the local average smoothing with $3 \times 3$ kernel as the processing step before feeding the white-box model, the attack success rate will decrease from $99.40\%$ to $73.67\%$ . Hence, the local smooth property should be considered when adding the adversarial perturbations. + +2). It is more effective to add adversarial perturbations to salient object the classifier focuses on. Another observation is that most existing adversarial sample methods treat all the pixels equally and add perturbations to the image globally, but we argue this global way is not optimal. To verify it, we conduct one simple experiment that only keeps the perturbations of background regions and the foreground + +![](images/905d1356dfb0cea2fea0d30c25e05142e5ebd762d7cd021d9849733bd81fba2e.jpg) +Figure 3. Pipeline of Generating Superpixel Adversarial Samples. We first use SLIC [32] to generate superpixel image $\mathbf{x}'$ from $\mathbf{x}$ as the noise template $\mathbf{t}$ . Then we calculate the noise vector $\mathbf{n}$ and use a mapping function $f(\mathbf{n};\mathbf{t})$ to map it to superpixel-level noise with the template $\mathbf{t}$ . Then we crop it with the binarized attention mask $\mathbf{m}^*$ and scale it to the threshold $\epsilon$ to get the final adversarial noise. + +regions respectively. For I-FGM $(\delta = 2)$ , the attack success rates of foreground/background regions adversarial noise are $94.03\%$ and $46.35\%$ respectively. This means adding perturbations to the foreground objects is more effective and can get better attack performance under the global distance measurement. In fact, this phenomenon is also consistent with the attention map the classifier focuses. + +Another intuition is that foreground regions often have more textures than the background regions (e.g., sky, ocean) statistically, which implies hiding perturbations in the foreground regions is much easier. To support this hypothesis, we randomly select 2000 images from the ImageNet [4] dataset and use the smoothness metric HILL [18] to measure the texture richness. The average HILL of foreground regions and background regions are 5269.94 and 18853.42 respectively, here larger HILL indicates less textures. + +# 3.3. Superpixel-Guided Attentional Adv Attack + +Inspired by the above two observations, we propose the first superpixel-guided attentional adversarial attack method. Rather than adding pixel-wise adversarial perturbations, we use the oversegemented superpixels as guidance and constrain the perturbations within each superpixel should be same. In this way, the generated perturbations are also locally smooth in the superpixel level. Another guidance we use is the foreground attention map, which ensures the perturbations are only added to the foreground objects. + +Figure 3 is the overall pipeline of our method, which consists of three steps: 1) Generate the superpixel-guided noise template $\mathbf{t}$ and initialize the adversarial noise $\mathbf{n}$ whose length equals to the superpixel number. 2) Crop and enhance the adversarial perturbations based on the attention map. 3) Use the generated adversarial sample to update $\mathbf{n}$ iteratively. + +Template Generation. Instead of generating the template + +by sampling pixels with grid steps, we use superpixel algorithms to get the segmentation map as the modification template. It can help to ensure local smoothness and reduce the statistical difference between the source image and the adversarial sample. In this paper, the superpixel algorithm SLIC [32] is used by default. Specifically, both the perceptual color distance and spatial distance are considered as the distance measure: + +$$ +\begin{array}{l} d i s = d _ {c} + \frac {p}{S} d _ {s} \\ d _ {c} = \sqrt {\left(l _ {k} - l _ {i}\right) ^ {2} + \left(a _ {k} - a _ {i}\right) ^ {2} + \left(b _ {k} - b _ {i}\right) ^ {2}} \tag {1} \\ d _ {s} = \sqrt {(x _ {k} - x _ {i}) ^ {2} + (y _ {k} - y _ {i}) ^ {2}} \\ \end{array} +$$ + +where $dis$ is the distance between the $i_{th}$ pixel and the $k_{th}$ superpixel cluster. Denote $N, K$ as the total pixel number and the pre-defined superpixel number, then each superpixel cluster $C_k$ is represented as the tuple $(l_k, a_k, b_k, x_k, y_k)$ . Here $l_k, a_k, b_k$ is the pixel values of $C_k$ in the CIELAB color space and $x_k, y_k$ is the spatial coordinate. $S = \sqrt{N / K}$ is the grid interval, and $p$ is the parameter to control the compactness of a superpixel. By sampling pixels at regular grid steps $S$ as initialization, SILC updates the clustering result by using a linear iterative clustering algorithm to cluster every pixel to its proximate super-pixel center. + +One weakness of SLIC is that the clustering number $K$ is fixed, which means a large smooth region will be clustered into many different small superpixels. If we use it as the template of adversarial noise, different perturbations will be added to each small superpixel. This will influence both the visual quality and statistics of the adversarial samples. To overcome this shortcoming, we propose an adaptive combination strategy to combine neighboring superpixels with similar pixel values. If the color difference between two neighboring superpixels is smaller than $\beta$ , we combine them as a new superpixel. + +Attention Mask. In this paper, we use Class Activation Mapping (CAM) [43] method to generate the attention map of the input image. A class activation map for a particular category indicates the discriminative image regions used by CNN to identify that category. CAM calculates this map by simply projecting back the output layer on to the convolutional feature maps. However, all pixel values in the attention map generated by CAM [43] are between 0 to 1, so it cannot be used to guide the noise cropping directly. We use a binarization factor $\phi$ to transform the attention map to a binarized map. The binarization can be expressed as + +$$ +m _ {i, j} ^ {*} = \left\{ \begin{array}{l l} 0 & m _ {i, j} < \phi \\ 1 & m _ {i, j} \geqslant \phi \end{array} \right. \tag {2} +$$ + +where $\mathbf{m}$ is the attention map and $\mathbf{m}^*$ is the binarized attention map, $m_{i,j}$ and $m_{i,j}^{*}$ are the value of them at the position $i,j$ . With the binarized attention map $\mathbf{m}^*$ as the mask, we crop the adversarial noise to realize attentional attack. + +Adversarial Perturbation Generation. To describe how to generate the target adversarial perturbation, we first use I-FGM [17] as the baseline and propose the Superpixel-guided attentional version I-FGM called SAI-FGM by using the superpixel and attention map guidance. + +For the baseline I-FGM, adversarial noises are generated by calculating the gradient of the loss function with the input image. However, we find calculating gradients for all superpixel is non-trivial. If we simply use the average or max gradient of all pixels within a superpixel as its gradient, it is neither efficient nor effective, which will be verified in the ablation part. Inspired by optimization based methods, we propose a substitute method to generate adversarial noise. We initialize a noise vector $\mathbf{n}$ whose length equals to the superpixel number, and calculate the gradient with respect to $\mathbf{n}$ directly. During each iteration, one mapping function $f$ is first used to fill $\mathbf{n}$ into the superpixel level noise template $\mathbf{t}$ to get filled noise $f(\mathbf{n};\mathbf{t})$ . Then $f(\mathbf{n};\mathbf{t})$ is cropped and scaled to the threshold $\epsilon$ before adding to the original sample $\mathbf{x}$ . At each iteration step $i + 1$ , $\mathbf{n}$ will be updated from $\mathbf{n_i}$ to $\mathbf{n}_{i + 1}$ with gradient ascent. Formally, our SAI-FGM can be expressed as + +$$ +\mathbf {x} _ {0} ^ {\mathbf {a d v}} = \mathbf {x} + f (\mathbf {n} _ {0}; \mathbf {t}) \tag {3} +$$ + +$$ +\mathbf {x} _ {\mathrm {i}} ^ {\mathrm {a d v}} = \mathbf {x} + S c a l e _ {\epsilon} \left\{C r o p _ {\mathbf {m}} (f (\mathbf {n} _ {\mathrm {i}}; \mathbf {t})) \right\} +$$ + +$$ +\mathbf {n} _ {\mathbf {i} + \mathbf {1}} = \mathbf {n} _ {\mathbf {i}} + \alpha \cdot \frac {\nabla_ {\mathbf {n}} L \left(\mathbf {x} _ {\mathbf {i}} ^ {\mathrm {a d v}} , y , \theta\right)}{\| \nabla_ {\mathbf {n}} L \left(\mathbf {x} _ {\mathbf {i}} ^ {\mathrm {a d v}} , y , \theta\right) \| _ {2}} \tag {4} +$$ + +where $L(\mathbf{x}_{\mathbf{i}}^{\mathrm{adv}},y,\theta)$ is the loss function and $\nabla_{\mathbf{n}}L(\mathbf{x}_{\mathbf{i}}^{\mathrm{adv}},y,\theta)$ is the gradient of $L(\mathbf{x}_{\mathbf{i}}^{\mathrm{adv}},y,\theta)$ with respect to $\mathbf{n_i}$ . Crop and Scale represent the crop operation based on the attention map $\mathbf{m}$ and scale operation based on the perturbation scale factor $\epsilon$ respectively. + +
AttackInc-v3*Inc-v4IncRes-v2Inc-v3adv
FGM84.0054.7556.7556.05
SA-FGM(Ours)73.8056.2051.5556.75
I-FGM99.8040.6538.0030.70
SAI-FGM(Ours)100.0068.3564.9565.05
MI-FGM99.9066.4567.9562.40
M-SAI-FGM(Ours)99.9568.5066.1067.45
+ +Table 1. The attack success rate $(\%)$ of adversarial attack on the ImageNet [4] dataset. * indicates the white-box attacks. + +M-SAI-FGM. Our method is general to most existing gradient-based methods. So we can extend our method with other attack methods to get more powerful attack ability. For example, when combining our method with MI-FGSM [5] by integrating the momentum term, we get Momentum Superpixel-guided Attentional Version I-FGM called M-SAI-FGM. Comparing with SAI-FGM, we update $\mathbf{n_i}$ by replacing Eq.4 with: + +$$ +\mathbf {g} _ {\mathrm {i} + 1} = \mu \cdot \mathbf {g} _ {\mathrm {i}} + \frac {\nabla_ {\mathbf {n}} L \left(\mathbf {x} _ {\mathrm {i}} ^ {\mathrm {a d v}} , y , \theta\right)}{\| \nabla_ {\mathbf {n}} \mathbf {L} \left(\mathbf {x} _ {\mathrm {i}} ^ {\mathrm {a d v}} , y , \theta\right) \| _ {1}} \tag {5} +$$ + +$$ +\mathbf {n _ {i + 1}} = \mathbf {n _ {i}} + \boldsymbol {\alpha} \cdot \frac {\mathbf {g _ {i + 1}}}{\| \mathbf {g _ {i + 1}} \| _ {2}} +$$ + +# 4. Experiments + +As introduced above, the adversarial perturbations of our method have two key constraints: superpixel level and only added to attentional regions, so our perturbation space is much smaller. Considering such a constrained space, the first question to answer is that "whether the original attack ability can be preserved or not". After answering this question, another key question would be "whether the proposed method can boost the adversarial robustness". + +Therefore in this section, the proposed method is evaluated from two aspects: attack ability and attack robustness. In the following experiments, we use $L_{2}$ norm as the distance measurement, threshold of the $L_{2}$ norm $\epsilon$ is calculated by $\delta \sqrt{N}$ , where $N = C \times H \times W$ is the dimension of input images $\mathbf{x}$ . Inception-V3 [36] is adopted as the default target attack model. Unless specified, $\phi = 4 / 12$ , $\alpha = \delta \sqrt{N} / T$ and the total iteration number $T = 10$ . + +# 4.1. Attack Ability Comparison + +To evaluate the attack ability, we compare the basic attack performance on the ImageNet [4] dataset, including white-box attack success rate and black-box attack success rate. As shown in Table 1, we compare three baselines FGM [9], I-FGM [17], MI-FGM [5] with our corresponding superpixel-guided attentional version SA-FGM, SAI-FGM, M-SAI-FGM. The column "Inc-v3" is white-box attack results while another three "Inc-v4", "IncRes-v2", "Inc-v3adv" represent black-box attack results on model Inception-v4 [35], Inception Resnet-v2 [35], Inception-v3adv respectively. Here Inc-v3adv is Inception-v3 [36] + +
Generation methodδ = 2δ = 4δ = 6δ = 8
FGM94.3295.5996.2897.09
I-FGM94.1194.7495.4596.01
SAI-FGM(β = 0)75.5082.1085.0087.20
SAI-FGM(β = 2)72.4078.2082.0084.20
SAI-FGM(β = 4)63.3072.1076.4080.90
+ +![](images/05dfab8ef0bfec6edc3db68b0bc11925b915e4eacac405d52a5443cca08cad64.jpg) +Table 2. Detect rate $(\%)$ of steganalysis-based detection. Lower success rate indicate the adversarial samples are more robust. +Figure 4. Attack success rate of adversarial samples with image resizing. Resize factor $\gamma$ varies from 1.0 to 3.0. + +model with ensemble adversarial training [38]. Here we set $\delta = 16$ . + +Result shows that the single step attack method FGM performs better than our SA-FGM, this means the influence of constrained perturbation space is inevitable. However, if we use multiple step attack method I-FGM or MI-FGM, our SAI-FGM and M-SAI-FGM can achieve similar white-box attack success rate (nearly $100\%$ ). This implies that our method can preserve the attack ability once multiple steps are used. For black-box attack, we find that our method performs better than baseline methods in most cases. For example, our SAI-FGM outperforms I-FGM by nearly $30\%$ for all the black-box models. When we introduce momentum into the attack iterations, we find that performance of our method slightly increases, similar to MI-FGM. + +# 4.2. Attack Robustness Comparison + +To evaluate the attack robustness, we do comparisons on two different types of methods: steganalysis based adversarial detection methods and image processing based adversarial defense methods. + +# Robustness to Steganalysis based Detection Methods + +Steganalysis-based adversarial detection method [24] uses steganalysis features as the main indicators to detect adversarial samples. We follow their experiment setting and train detector for every adversarial sample generation method including ours for $\delta = 2,4,6,8$ respectively. As shown in Table 2, our SAI-FGM outperforms the baseline methods by a large margin for different $\delta$ . For example, if adversarial samples are generated with $\delta = 2$ , detect success rate on SAI-FGM with $\beta = 0$ are only $75.50\%$ , while pixel-wise baselines like FGM and I-FGM are $94.32\%$ and $94.11\%$ re + +![](images/07116061c7d5711d8f0e8bbc41bbbacf2fbe1a8b8c937eaea39f484d400966ca.jpg) + +![](images/34e7af8a04e5d1275283c5d64b16b14c2cf09df25ea5eaa01768cf187c188092.jpg) +Figure 5. (a) Relation between attack success rate and JPEG quality factor $q$ . (b) Relation between attack success rate and DNN-Oriented JPEG quality factor $q$ . + +spectively, nearly $20\%$ higher than SAI-FGM. This proves the superiority of the proposed superpixel-guided adversarial samples over the pixel-wise ones. + +We further compare SAI-FGM with different $\beta$ to evaluate the proposed superpixel combination strategy. Obviously, by combining adjacent similar superpixels, SAI-FGM can further reduce the detect success rate for all $\delta$ . For example, when $\delta = 8$ , detect success rate on SAI-FGM with $\beta = 0$ is $87.20\%$ , while on SAI-FGM with $\beta = 4$ , the detect success rate decreases to $80.90\%$ . This is because the statistical difference between adversarial samples and source images is significantly reduced when adjacent similar superpixels are merged. + +Robustness to Image Processing based Defense Methods Another important type of adversarial defense methods leverage image processing techniques to remove the adversary before feeding images into the target model. Their underlying hypothesis is similar, i.e., the noisy distribution of perturbations does not match the distribution of real images. In this part, many different image processing techniques are utilized for robustness evaluation, including resizing, JPEG compression [7], DNN-Oriented JPEG Compression [25], pooling, total variance minimization (TVM)[13] and Bit-depth Reduction [42]. To ensure the mis-classification are caused by the adversary of adversarial samples instead of these image processing themselves. We select 2000 robust images from the ImageNet [4] dataset which can be classified correctly after image processing. + +Resizing. Resizing is a common and easy image processing method, it can reduce the effectiveness of adversarial samples with local interpolation. Given an adversarial sample with size $H \times W$ , we first downscale its size into $\frac{H}{\gamma} \times \frac{W}{\gamma}$ then upscale back to the origin size $H \times W$ . Figure 4 is the attack success rate curve when varying the scale factor $\gamma$ from 1 to 3 with step 0.1. Obviously, for different perturbation scales $\delta = 4,8,16$ and different baseline methods, our superpixel-guided attentional versions "SA*" are always much more robust and achieve a higher attack success rate. Especially when $\delta = 16$ , the success rate of our SAI-FGM is always at a high level over $80\%$ while that of the baseline I-FGM decreases quickly when $\gamma$ increases. + +
OperationThresholdAttack methodKernel Size
357
AVG4√NI-FGM73.6720.557.07
SAI-FGM93.2765.1436.91
8√NI-FGM85.9431.2111.47
SAI-FGM97.4479.9658.03
16√NI-FGM95.1346.0220.36
SAI-FGM99.5791.4877.35
MAX4√NI-FGM41.4516.6713.47
SAI-FGM70.3739.2034.67
8√NI-FGM54.7927.2920.39
SAI-FGM85.1061.6455.73
16√NI-FGM68.3637.0630.38
SAI-FGM93.8583.2979.82
+ +Table 3. The gray-box attack success rate $(\%)$ of adversarial samples after average/max pooling operation on the ImageNet [4] dataset with different $\epsilon$ and different kernel size $l$ . + +JPEG Compression and DNN-Oriented JPEG Compression. Based on the local smoothness property, JPEG compression significantly compresses the high-frequency components of one image while ensuring similar visual quality. As adversarial perturbations are also of high frequency, their attack ability will be weakened by JPEG compression in most cases. As shown in Figure 5 (a), when the images are only compressed a little with high quality factor $q = 95$ , both I-FGM and SAI-FGM can still achieve a quite high attack success rate. But as the quality factor decreases from 95 to 5, attack success rate of I-FGM decrease quickly while SAI-FGM still keep a high success rate. For example, when $q = 55$ , success rate of I-FGM with $\delta = 4$ decrease $31\%$ from $99.4\%$ to $68.4\%$ and SAI-FGM only decrease $7.5\%$ . Especially at low quality regions $(q < 25)$ , performance of both I-FGM and SAI-FGM decrease greatly as the low quality compression removes most detail of the images, but our method still performs better than I-FGM. For DNN-Oriented JPEG compression shown in Figure 5 (b), the superiority of our method is even more obvious. + +Pooling. Pooling is a popular operation in DNNs, which is often conducted by sampling the maximum or average pixels within each grid kernel. Similar to smoothing/resizing, this operation will change the original distribution of adversary, so it can reduce the attack ability especially for large grid kernel size. As shown in Table 3, the proposed superpixel-guided attentional adversarial attack is always much better than the baseline methods for different kernel sizes and perturbation levels. For example, when $\delta = 16$ and the kernel size is 5, our SAI-FGM can still achieve $79.82\%$ attack success rate while the baseline I-FGM only has $30.38\%$ success rate, far behind us with about $50\%$ . + +TVM. TVM [13] randomly selects a small set of pixels and reconstructs the "simplest" image that is consistent with the selected pixels. Here we follow the setting in [13] with pixel drop rate as 0.5 and tvm weight as 0.03. From Figure 6(a), it can be seen that SAI-FGM outperforms I-FGM + +![](images/0d582ff9b8e2f1ff253553e43ff9383d500c6aa7230380e1cf3da488e7e18662.jpg) +Figure 6. (a) Relation between attack success rate and threshold $\epsilon$ after TVM operation. (b) Relation between attack success rate and image reduce depth $d$ . + +![](images/a99f2b49504fdc66dca014c57ec5b4c54d068928a313595b431fb786a39700ec.jpg) + +
MethodWhite-BoxDetectionResizingJPEGTVM
I-FGM99.4094.7446.0568.4044.60
SLIC-adv98.9082.1082.1791.4082.00
LSC-adv98.9082.7583.1091.8083.50
SEEDS-adv98.7582.0081.6591.2181.70
+ +Table 4. Attack ability and robustness of adversarial samples generated by SAI-FGM with different superpixel algorithms. + +in all settings. For example, when $\delta = 4$ , attack success rate of SAI-FGM are $82.00\%$ , while attack performance of I-FGM dropped from $99.48\%$ to $44.60\%$ . + +Bit-depth Reduction. Bit-depth Reduction [42] is a simple quantization method to remove small adversarial noises. Here we vary the depth factor $d$ from 2 to 4(64 colors to 4096 colors). In all the cases as shown in Figure 6 (b), our method outperforms baseline methods consistently. + +# 4.3. Visual Results + +Besides the visual result shown in Figure 1, we further show several adversarial samples generated by our method SAI-FGM and the baseline I-FGM with $\delta = 4,16$ in Figure 7. It can be seen that these adversarial samples look overall similar, but the adversarial perturbations of our method are more attentional and superpixel-wise smooth. + +# 4.4. Ablation Study + +Superpixel Size $S$ . In this experiment, we study the relationship between the superpixel size $S$ and the attack performance. Intuitively, large $S$ leads to better robustness while small $S$ leads to better attack ability. To prove it, we adopt the attack success rate of original adversarial samples and resized adversarial samples (downscale and upscale) as the indicators of attack ability and attack robustness respectively. To have a clearer difference, $\delta = 4$ is used here. As shown in Figure 8(a), when $S$ varies from 2 to 8, the attack ability decreases slightly while the robustness first increases then decreases (best at $S = 5$ ). The reason why the robustness of too large $S$ is worse is because the absolute attack ability decreases a lot in such case. + +Binarization Factor $\phi$ . Here we explore the influence of the binarization factor $\phi$ . Intuitively, if $\phi$ is too small, most parts of the image are modified so the attentional attack is meaningless. And if $\phi$ is too large, only a small part of the image will be modified and it performs badly. To show the + +![](images/5ef735945900ecc7be7c1d4693856dce0b7fef634ec1b4bc1ffedc4f555e5de5.jpg) +Figure 7. Some visual comparison about the adversarial samples generated by the baseline method I-FGM (top) and our SAI-FGM (bottom) with $\delta = 4$ (left) and $\delta = 16$ (right) respectively. + +![](images/a5215e2d3784c22484fc7508c70f7efd3b23968b0084b0b72dabefd21a54b871.jpg) + +![](images/afc1a3ad45987f8834bcb81b992fe82972d65f5f436fc3db64c9758e8481949b.jpg) +Figure 8. (a) Relation between superpixel size $S$ and attack success rate. Success rate is evaluated by both original and scaled adversarial samples with scale factor $\gamma = 3.0$ . (b) Relation between binarization factor $k$ and black-box attack success rate. + +![](images/2f009b69ac4b35a8df0c5af73faee8c2147dcd335cf3fe631d26ceb80c5614d9.jpg) + +performance difference, we use the black-box attack success rate as the indicator and vary $\phi$ from 0 to $11 / 12$ . It can be seen from Figure 8(b) that the attack success rate first increases then decreases. The best performance is achieved when $\phi = 4 / 12$ , which is better than the case that does not use attention ( $\phi = 0$ ) by $10\%$ . When $\phi$ is too large, the perturbation space is too small to achieve good attack ability. + +Superpixel Algorithms. To evaluate the influence of robustness of different superpixel algorithms, besides the default SLIC used in Sec.4, we further consider another two classic superpixel segmentation methods LSC [21] and SEEDS[39]. In the following, we denote SLIC-adv, LSC-adv, and SEEDS-adv as the adversarial samples generated with the corresponding method. We follow the setting in Sec.4 with $\delta = 4$ . For the robustness to resizing, we set $\gamma = 2.0$ , and for the robustness to JPEG Compression, we set $q = 55$ . As shown in Table.4, we can find that the performance of adversarial samples generated with different superpixel methods are very similar. It indicates that our method is very robust and insensitive to different superpixel segmentation methods. Because the inherent key reason for our robustness is based on the local consistency constraint, as long as the superpixel results follow the rule that pixels within each cluster have similar pixel values (satisfy the requirement of local consistency), our method can always achieve very good performance. + +Image Gradient vs. Noise Gradient. As we stated in the method part, calculating max or average gradient of pixels within one superpixel as the gradient of the superpixel (here we denote these two methods as MAX and AVG respec + +tively) is neither efficient nor effective. In this section, we use the white-box performance to prove that our proposed method are better. When $\delta = 4$ , success rate of our method are $98.90\%$ , while success rate of MAX are only $84.20\%$ and AVG are $95.95\%$ . Meanwhile, it's hard to calculate max or average value of irregular image parts parallelly, so we have to use a large memory cost method as substitute, this leads to the result that both MAX and AVG are nearly 30 times slower than our noise gradient method under the same computation resources. + +# 5. Conclusion + +In this paper, the limitations of existing "pixel-wise and global" adversarial attack methods are analyzed, which are shown to be the reasons why they are not robust to image processing based defense and steganalysis based detection methods. To address these limitations, we propose the first superpixel-guided attentional adversarial attack method. It constrains the perturbations are only added into the foreground regions and pixels within each superpixel have the same perturbation. Even with such a highly constrained perturbation space, experiments demonstrate that the proposed method can still preserve the original attack ability. Because of better statistical consistency between adversarial samples and source images, our method shows much better robustness to both adversarial detection and defense. + +# Acknowledgement + +This work is supported in part by the Natural Science Foundation of China under Grant U1636201 and 61572452, and by Anhui Initiative in Quantum Information Technologies under Grant AHY150400, and by National Key Research and Development Program of China under Grant 2018YFB0804100, and by Exploration Fund Project of University of Science and Technology of China under Grant YD3480002001. Jiangfan Han, Hongsheng Li, Xiaogang Wang are partially supported by SenseTime Group Limited and the General Research Fund through the Research Grants Council of Hong Kong under Grants CUHK14202217,14203118,14205615,14207814,14213616, 14207319,14208619, and Research Impact Fund R5001-18. + +# References + +[1] Shumeet Baluja and Ian Fischer. Adversarial transformation networks: Learning to generate adversarial examples. arXiv, 2017. +[2] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In SP, pages 39-57. IEEE, 2017. +[3] Nilaksh Das, Madhuri Shanbhogue, Shang-Tse Chen, Fred Hohman, Li Chen, Michael E Kounavis, and Duen Horng Chau. Keeping the bad guys out: Protecting and vaccinating deep learning withjpeg compression. arXiv, 2017. +[4] 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. +[5] Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Xiaolin Hu, Jianguo Li, and Jun Zhu. Boosting adversarial attacks with momentum. arXiv, 2017. +[6] Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. CoRR, abs/1904.02884, 2019. +[7] Gintare Karolina Dziugaite, Zoubin Ghahramani, and Daniel M Roy. A study of the effect of jpg compression on adversarial images. arXiv, 2016. +[8] Zhitao Gong, Wenlu Wang, and Wei-Shinn Ku. Adversarial and clean data are not twins. arXiv, 2017. +[9] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015. +[10] Rafael Gouveia, Aristotle Spyropoulos, and Philippos Mordohai. Confidence estimation for superpixel-based stereo matching. In 3dv, pages 180-188. IEEE, 2015. +[11] Kathrin Grosse, Praveen Manoharan, Nicolas Papernot, Michael Backes, and Patrick McDaniel. On the (statistical) detection of adversarial examples. arXiv, 2017. +[12] Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014. +[13] Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens Van Der Maaten. Countering adversarial images using input transformations. arXiv, 2017. +[14] Jiangfan Han, Xiaoyi Dong, Ruimao Zhang, Dongdong Chen, Weiming Zhang, Nenghai Yu, Ping Luo, and Xiaogang Wang. Once a man: Towards multi-target attack via learning multi-target adversarial network once. In Proceedings of the IEEE International Conference on Computer Vision, pages 5158-5167, 2019. +[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. +[16] Dan Hendrycks and Kevin Gimpel. Visible progress on adversarial images and a new saliency map. arXiv, 2016. +[17] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv, 2016. +[18] Bin Li, Ming Wang, Jiwu Huang, and Xiaolong Li. A new cost function for spatial image steganography. In 2014 IEEE International Conference on Image Processing (ICIP), pages 4206-4210. IEEE, 2014. + +[19] Suichan Li, Dapeng Chen, Bin Liu, Nenghai Yu, and Rui Zhao. Memory-based neighbourhood embedding for visual recognition. In The IEEE International Conference on Computer Vision (ICCV), October 2019. +[20] Xin Li and Fuxin Li. Adversarial examples detection in deep networks with convolutional filter statistics. In CVPR, pages 5764-5772, 2017. +[21] Zhengqin Li and Jiansheng Chen. Superpixel segmentation using linear spectral clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1356-1363, 2015. +[22] Bin Liang, Hongcheng Li, Miaoqiang Su, Xirong Li, Wenchang Shi, and Xiaofeng Wang. Detecting adversarial image examples in deep networks with adaptive noise reduction. arXiv, 2017. +[23] Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In CVPR, pages 1778-1787, 2018. +[24] Jiayang Liu, Weiming Zhang, Yiwei Zhang, Dongdong Hou, Yujia Liu, Hongyue Zha, and Nenghai Yu. Detection based defense against adversarial examples from the steganalysis point of view. In CVPR, pages 4825-4834, 2019. +[25] Zihao Liu, Qi Liu, Tao Liu, Yanzhi Wang, and Wujie Wen. Feature distillation: Dnn-oriented JPEG compression against adversarial examples. arXiv, 2018. +[26] S Mahmoudpour and M Kim. Depth from defocus using superpixel-based affinity model and cellular automata. *Electronics Letters*, 52(12):1020-1022, 2016. +[27] Alastair P Moore, Simon JD Prince, Jonathan Warrell, Umar Mohammed, and Graham Jones. Superpixel lattices. In CVPR, pages 1-8. Citeseer, 2008. +[28] Margarita Osadchy, Julio Hernandez-Castro, Stuart Gibson, Orr Dunkelman, and Daniel Pérez-Cabo. No bot expects the deepcaptcha! introducing immutable adversarial examples, with applications to captcha generation. TIFs, 12(11):2640-2653, 2017. +[29] Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In ASIACCS, pages 506-519. ACM, 2017. +[30] Nicolas Papernot, Patrick McDaniel, Arunesh Sinha, and Michael Wellman. Towards the science of security and privacy in machine learning. arXiv, 2016. +[31] Omid Poursaeed, Isay Katsman, Bicheng Gao, and Serge Belongie. Generative adversarial perturbations. arXiv, 2017. +[32] Achanta Radhakrishna, Shaji Appu, Smith Kevin, Lucchi Aurelien, Fua Pascal, and Susstrunk Sabine. Slic superpixels compared to state-of-the-art superpixel methods. TPAMI, 34(11):2274-2282, 2012. +[33] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, pages 91-99, 2015. +[34] Ionut Schiopu, Moncef Gabbouj, Atanas Gotchev, and Miska M Hannuksela. Lossless compression of subaperture images using context modeling. In 3DTV-CON, pages 1-4. IEEE, 2017. + +[35] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-reset and the impact of residual connections on learning. In AAAI, 2017. +[36] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, pages 2818-2826, 2016. +[37] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv, 2013. +[38] Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv, 2017. +[39] Michael Van den Bergh, Xavier Boix, Gemma Roig, Benjamin de Capitani, and Luc Van Gool. Seeds: Superpixels extracted via energy-driven sampling. In European conference on computer vision, pages 13-26. Springer, 2012. +[40] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pages 5998-6008, 2017. +[41] Cihang Xie, Zhishuai Zhang, Jianyu Wang, Yuyin Zhou, Zhou Ren, and Alan L. Yuille. Improving transferability of adversarial examples with input diversity. CoRR, abs/1803.06978, 2018. +[42] Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv, 2017. +[43] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, pages 2921-2929, 2016. +[44] Hang Zhou, Kejiang Chen, Weiming Zhang, Han Fang, Wenbo Zhou, and Nenghai Yu. Dup-net: Denoiser and upsampler network for 3d adversarial point clouds defense. In Proceedings of the IEEE International Conference on Computer Vision, pages 1961-1970, 2019. \ No newline at end of file diff --git a/robustsuperpixelguidedattentionaladversarialattack/images.zip b/robustsuperpixelguidedattentionaladversarialattack/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d52a9e97fc080b41375882e5efb8581d4d58a207 --- /dev/null +++ b/robustsuperpixelguidedattentionaladversarialattack/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aadfbf2ab170d8b53817d059082c0b28ce6158445fd2e864a3a97b025eb54706 +size 579408 diff --git a/robustsuperpixelguidedattentionaladversarialattack/layout.json b/robustsuperpixelguidedattentionaladversarialattack/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9ee35d2ad662f514a60c5f7449ec0971e5c7ecfc --- /dev/null +++ b/robustsuperpixelguidedattentionaladversarialattack/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab3859c4e4a2556998d986440c9488627ca65af8f65774151333311ac9d68f98 +size 449927 diff --git a/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_content_list.json b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6ed7418e4960cf0103ff3dbe036d93574fff53e4 --- /dev/null +++ b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1c7317b94ea6702d976a8e3481d43d71493dc9edebd4141c631d17d7427a369 +size 78150 diff --git a/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_model.json b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ef0d52d245e331758d1ecc40956c2a737ed0bbd1 --- /dev/null +++ b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e9eb069e7bf8a59b12968d5077ed2679d378615d09169ebb2782236946ab3b4 +size 96711 diff --git a/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_origin.pdf b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..24ef6911f184035514cad1aeeed2b8b2c418f30e --- /dev/null +++ b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/06c6b1f6-f807-4c1b-aa50-733da256a1f7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc91409f459fa839659d6c9c2cae6f42d282d3b6bf95271683883f10a6279fc9 +size 1844098 diff --git a/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/full.md b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..344f2f2ecf508d04df1bcd9383accb45624d528b --- /dev/null +++ b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/full.md @@ -0,0 +1,363 @@ +# Rotate-and-Render: Unsupervised Photorealistic Face Rotation from Single-View Images + +Hang Zhou $^{1*}$ Jihao Liu $^{2*}$ Ziwei Liu $^{1}$ Yu Liu $^{1\dagger}$ Xiaogang Wang $^{1}$ $^{1}$ The Chinese University of Hong Kong $^{2}$ SenseTime Research + +{zhouhang@link,yuliu@ee,xgwang@ee}.cuhk.edu.hk liujihao@sensetime.com zwliu.hust@gmail.com + +![](images/aeb9a38e3a8c453504de5728db79132693cb824850f43f84abbe97dcd4be28b5.jpg) +Figure 1: The rotated faces synthesized by our approach on CelebA-HQ dataset. The first row is the input and the second row is our result. It can be observed that our unsupervised framework produces near photo-realistic results even under extreme poses and expressions. + +# Abstract + +Though face rotation has achieved rapid progress in recent years, the lack of high-quality paired training data remains a great hurdle for existing methods. The current generative models heavily rely on datasets with multi-view images of the same person. Thus, their generated results are restricted by the scale and domain of the data source. To overcome these challenges, we propose a novel unsupervised framework that can synthesize photo-realistic rotated faces using only single-view image collections in the wild. Our key insight is that rotating faces in the 3D space back and forth, and re-rendering them to the 2D plane can serve as a strong self-supervision. We leverage the recent advances in 3D face modeling and high-resolution GAN to constitute our building blocks. Since the 3D rotation-and-render on faces can be applied to arbitrary angles without losing details, our approach is extremely suitable for in-the-wild scenarios (i.e. no paired data are available), where existing methods fall short. Extensive experiments demonstrate that our approach has superior synthesis quality as well as identity preservation over the state-of-the-art methods, across a wide range of poses and domains. + +Furthermore, we validate that our rotate-and-render framework naturally can act as an effective data augmentation engine for boosting modern face recognition systems even on strong baseline models1. + +# 1. Introduction + +Face rotation, or more generally speaking multi-view face synthesis, has long been a topic of great research interests, due to its wide applications in computer graphics, augmented reality and particularly, face recognition. It is also an ill-posed task with inherent ambiguity that can not be well solved by existing methods. Traditionally, this problem is addressed by using 3D models such as 3DMM [1]. A common challenge here is that invisible areas would appear when rotating a 3D-fitted face. Previous researchers propose to solve this problem through symmetric editing and invisible region filling [48]. However, this filling process usually introduces visible artifacts which lead to nonrealistic results. + +With the rapid progress of deep learning and generative adversarial networks (GANs), reconstruction-based methods have been widely applied to face frontalization and ro + +tation [42, 14, 33, 12, 32]. Due to the information loss when encoding the given face to bottleneck embeddings, reconstruction-based methods often suffer from the loss of local details such as known facial textures and shapes. It further leads to the confusion of identity information. Moreover, the most notable drawback of existing reconstruction-based methods is that multi-view data of the same person has to be provided as direct supervisions in most cases. To this end, the datasets used for training are constraint to ones in controlled environments such as Multi-PIE [7], and synthetic ones such as 300W-LP [48]. Models trained on controlled datasets can only generate results within a specific domain, lacking the desired generalization ability. Also, their generated resolutions are normally limited to under $128 \times 128$ , far from perceptually satisfying. + +To overcome these challenges, we propose a novel unsupervised framework that can synthesize photorealistic rotated faces using only single-view image collections in the wild, and can achieve arbitrary-angle face rotation. While details and ID information tend to degrade during the encoding process of 2D-based methods, we propose to keep as much known information about the given face as possible with 3D model. + +Our key insight is that rotating faces in the 3D space back and forth, and re-rendering them to the 2D plane can serve as a strong self-supervision. We take the advantage of both 3D face modeling and GANs by using off-the-shelf 3D-fitting network 3DDFA [49] and the neural renderer [18]. Invisible parts would appear to one fixed 2D view when a face is rotated from one pose to another. While previous methods require both images to form an {input, ground truth} pair, we use the self-supervision of one single image. The key is to create and then eliminate the artifacts caused by rotations. Given one face at pose $\mathbf{P}_a$ , we rotate its 3D-mesh firstly to another arbitrary pose $\mathbf{P}_b$ , and render it to the 2D space to get a 2D-rendered image $\mathrm{Rd}_b$ . Then we rotate it back to its original position and render it to be $\mathrm{Rd}_{a'}$ using textures extracted from $\mathrm{Rd}_b$ . Finally, we use an image-to-image translation network to fill the invisible parts and map the rendered image to real image domain. The overview of our pipeline is shown in Fig. 2. In this way, existing local texture information can be preserved while GAN is responsible for fixing the occluded parts. As the whole pipeline rotates and renders a face forward and backward, we term it Rotate-and-Render framework. + +Remarkably, our proposed framework does not rely on paired data or any kind of label, thus any face image can be used as our training source. With unlimited training data, our model can be leveraged to boost large-scale face recognition, providing augmentations and alignments for profile faces. While previous methods are often evaluated on small datasets with moderate baselines, we validate the effectiveness of our approach for large-scale face recognition on + +![](images/16a2af62f0616170a3e1ed634ca80e594e04914bc84cef2ff434962e5161f319.jpg) +Figure 2: Overview of our unsupervised face rotation framework from only single-view image collections. We rotate the 3D-mesh firstly to an arbitrary pose $\mathbf{P}_b$ , and render it to the 2D space to get a 2D-rendered image $\mathrm{Rd}_b$ . Then we rotate it back to its original position $\mathbf{P}_a$ and render it to be $\mathrm{Rd}_{a'}$ using textures extracted from $\mathrm{Rd}_b$ . Finally we use an render-to-image translation network to fill the invisible parts and map the rendered image to real image domain. + +strong baseline models. + +Our contributions are summarized as follows: 1) We propose a novel Rotate-and-Render framework for training face rotation in a fully unsupervised manner under inthe-wild scenarios. No paired data or any label is needed. 2) We convert incomplete rendered images to real images using an image-to-image translation network, with which photo-realistic face rotation results can be generated. 3) We validate that our generation results benefit large-scale face recognition even on strong baseline models. + +# 2. Related Work + +# 2.1. Face Rotation and Multi-View Synthesis + +The problem of face rotation aims to synthesize multiview faces given a single face image regardless of its viewpoint. Among all views, the frontal view particularly attracts much more research interests. Traditionally, this problem is tackled by building 3D models and warping textures on 3D or 2D [9, 48]. OpenGL can also be used to also easier cases [24]. However, their synthesized results are usually blurry and not photorealistic. + +Reconstruction-based Methods. Recently, with the progress of deep learning [22] and GANs [6], reconstruction-based models have revolutionized the field of face frontalization [33, 14, 12, 34, 29, 30]. DRGAN [33, 34], for the first time, adopts GAN to generate frontal faces with an encoder-decoder architecture. Although they do not use multi-view data, the generated results are not satisfying and have perceptually-visible artifacts. Then TP-GAN [14] utilizes global and local networks together with a multi-task learning strategy to + +frontalize faces. CAPG-GAN [12] uses face heatmap to guide the generation of multi-view faces. Most of the methods are trained on Multi-PIE dataset, which makes them overfit the dataset's environment and cannot generalize well to unseen data. Even FNM [30] which proposes to combine both labeled and unlabeled data can only normalize faces to a standard MultiPIE-like frontal-view. The common shortcoming that almost all of them share is the requirement of paired multi-view training data. + +3D Geometry-based Methods. Several attempts have been made to incorporate 3D prior knowledge into GAN-based frontalization pipeline. FF-GAN [44] proposes to integrate the regression of 3DMM coefficients into the network and employ them for generation. But its generation results are of low-quality. UV-GAN [3] proposes to complete UV-map using image-to-image translation, which is similar to our work. However, their pipeline requires high precision 3D fitting and ground-truth UV-maps, which are both difficult to obtain. Besides, their generated results are not photorealistic under in-the-wild scenarios. Recently, HF-PIM [2] achieves high-quality face frontalization results using facial texture map and correspondence fields. However, their method also requires paired data for training. In this work, our proposed approach not only gets rid of the requirement for paired training data, but also has the capacity to generate high-quality results which preserve texture and identity information. + +# 2.2. Image-to-Image Translation + +Image-to-image translation aims at translating an input image to a corresponding output image, typically from a different modality or domain. The core idea is to predict pixel values directly with encoder-decoder architecture and low-level connections. GANs are widely adopted in this field [16, 47, 35, 26, 37, 5, 45, 43, 21, 20], since the adversarial loss can alleviate the blurry issue by $L_{1}$ reconstruction loss. Pix2Pix framework [16] firstly uses image-conditional GANs for this task. Pix2PixHD [35] used stacked structures to produce high-quality images. Recently, SPADE [26] and MaskGAN [20] discovers that semantic information can be infused via conditional batch normalization to further improve the results. + +Cycle Consistency in Unsupervised Image-to-Image Translation. Cycle consistency has been proven useful on various tasks [47, 28, 38, 36], particularly for image translation without paired data. For example, CycleGAN [47] achieves unpaired image-to-image translation, and GANimation [28] proposes to generation animation without supervision. Our idea shares similar intuition with cycle consistency. However, The difference is that for most unpaired translation papers, they focus on mapping across domain by training neural networks, while our proposed Rotate-and-Render operation is performed off-line. + +![](images/15db0f073f8c29c65759bcd3d8987a35ffa16c1011527f9e9e1b200a4d551ffb.jpg) +Figure 3: The process of getting texture and rendering. 3D points lying on the same lines will correspond to the same texture in the 2D space. The subscript $a$ and $b$ are associated with pose $a$ and $b$ in Fig 4. + +![](images/c4f55b881a3f9f55bbf2f4acf998be1af4c60be04361f4e9201e02dafc71141f.jpg) + +Inpainting with GAN. After the rendering step, our target is to synthesize photorealistic images from renders with artifacts, which is substantially a combination of image translation and inpainting. Recently, advanced inpainting techniques also benefit from the image-to-image translation pipeline with GAN [27, 40, 37, 46]. Therefore we adopt the recent advances in image-to-image translation to realize render-to-image generation. + +# 3. Our Approach + +Overall Framework. Our whole face rotation framework consists of three parts: 3D face fitting, the rotate-and-render strategy for training data preparation, and the render-to-image translation module. We elaborate each component as follows. + +# 3.1. 3D Face Modeling and Render + +3D Face Fitting. Our method relies on a rough 3D parametric fitting of a given face, where all kinds of 3D models and predicting methods are applicable. Here we briefly introduce the notations and concepts of 3D face model we use as an instruction for the following sections. + +Given one definition of 3D face model with $n$ vertices, the shape prediction of a face $\mathbf{V} = [v_{1}, v_{2}, \dots, v_{n}]$ represents the normalized position of its vertices in the 3D space with $\boldsymbol{v}_{i} = [x_{i}, y_{i}, z_{i}]^{\mathrm{T}}$ . The projection of a 3D shape onto the 2D image can be written as: + +$$ +\Pi (\mathbf {V}, \mathbf {P}) = f * \mathbf {p} _ {\mathbf {r}} * \mathbf {R} * \mathbf {V} + \mathbf {h} _ {\mathbf {2 d}}, \tag {1} +$$ + +where $\Pi$ is the projection function that maps model vertices to their 2D positions. The matrix multiplication is denoted by $" * "$ . $f$ is the scale factor, $\mathbf{p_r}$ is the orthographic projection matrix, $\mathbf{R}$ is the rotation matrix and $\mathbf{h_{2d}}$ is the 2D shift. Here we regard all the above defined projection related parameters to be a joint representation of the face's relative pose $\mathbf{P} = \{f,\mathbf{R},\mathbf{h_{2d}}\}$ . + +![](images/6d46b035de087dc8a111f70670444e938cd0e331b843ad45ae0098d93fe68b32.jpg) +Figure 4: Our framework for unsupervised photorealistic face rotation. Our key insight is that rotating faces in the 3D space back and forth, and re-rendering them to the 2D plane can serve as a strong self-supervision. After two rotate-and- render processes, we can create a rendered image $\mathrm{Rd}_{a'}$ which has the artifacts of a face rotated to the position $a$ from any position $b$ . So that the input image $\mathrm{I}_a$ itself can serve as ground truth for training. Only the Render-to-Image module needs training during the whole process. + +Acquiring Textures. Textures also play a crucial role when transforming a complete 3D representation to 2D space. For each vertex $\mathbf{v}_i$ , there exists an associated texture $\mathbf{t}_i = [r_i, g_i, b_i]^{\mathrm{T}}$ on a colored face. We use the simplest vertical projection to get the colors of the vertices from the original image I. The color of each vertex can be written as: + +$$ +\boldsymbol {t} _ {i} = \mathbf {I} (\Pi (\boldsymbol {v} _ {i}, \mathbf {P})), \tag {2} +$$ + +where $\Pi (\pmb {v}_i,\mathbf{P})$ is the projected 2D coordinate of the vertical $\pmb{v}_{i}$ . In this way we get all corresponding textures $\mathbf{T} = [t_1,\dots ,t_n]$ . This process can be easily depicted in Fig 3. We refer to the whole process of getting textures uniformly as: + +$$ +\mathbf {T} = \operatorname {G e t T e x} (\mathbf {I}, \{\mathbf {V}, \mathbf {P} \}). \tag {3} +$$ + +The projected result $\Pi (\mathbf{V},\mathbf{P})$ is irrelevant to the vertices' $z$ coordinate due to the orthographic matrix $\mathbf{p_r}$ . For each position $(x_{j},y_{j})$ on the 2D space, there might exist multiple rotated vertices on the line $\{x = x_{j}$ and $y = y_{j}\}$ in 3D space, then the same texture will be assigned to every one of them. For all $\boldsymbol {v}_k\in \{\boldsymbol {v}\mid (x_j,y_j) = \Pi (\boldsymbol {v}_k,\mathbf{P})\}$ , only the outermost one with the largest $z$ axis value gets the correct texture. Its index is + +$$ +K _ {j} = \underset {k} {\arg \max } ([ 0, 0, 1 ] * \boldsymbol {v} _ {k}). \tag {4} +$$ + +The rest are actually invisible vertices due to occlusion in the 2D space. We keep the wrongly acquired textures and regard them as artifacts that we aim to deal with. + +**Rendering.** Given a set of 3D representation of a face $\{\mathbf{V},\mathbf{P},\mathbf{T}\}$ , rendering is to map it to the 2D space and generate an image. The rendering process is the reverse of acquiring texture as depicted in Fig 3 (b). Same as equation 4, + +it is known that $K_{j}$ is the index of outermost vertex given a 2D point $(x_{j},y_{j})$ . The rendered color image Rd can be calculated as: + +$$ +\operatorname {R d} \left(x _ {j}, y _ {j}\right) = \left\{ \begin{array}{l l} \mathbf {T} \left\{K _ {j} \right\}, & \exists K _ {j} \in \mathbb {N}, \\ 0, & \notin K _ {j} \in \mathbb {N}. \end{array} \right. \tag {5} +$$ + +Finally, we denote the whole rendering process as: + +$$ +\mathrm {R d} = \operatorname {R e n d e r} \left(\left\{\mathbf {V}, \mathbf {P}, \mathbf {T} \right\}\right). \tag {6} +$$ + +We use the open-sourced Neural Mesh Renderer [18] to perform rendering without any training. + +# 3.2. Rotate-and-Render Training Strategy + +It can be discovered that with an accurately fitted 3D model, our aim is to fill the invisible vertices with the correct textures for getting another view of a face. However, existing works with similar ideas [2, 3] require ground truth supervision from multi-view images which are difficult to get. + +Here we propose a simple strategy to create training pairs called Rotate-and-Render (R&R) which consists of two rotate-and-render operations. The key idea is to create the artifacts caused by rotating occluded facial surface to the front and eliminate them. Thus we can leverage only self-supervision to train networks. The whole pipeline and visualizations of each step are all illustrated in Fig 4. + +Given an input image $\mathrm{I}_a$ , we firstly get the 3D model parameters by a 3D-face fitting model: + +$$ +\left\{\mathbf {V}, \mathbf {P} _ {a} \right\} = \operatorname {F i t t i n g} \left(\mathrm {I} _ {a}\right), \tag {7} +$$ + +![](images/406aa50331ae9cfda556c4f92accca5f517d5ee30119150bcd8df493d565430e.jpg) +Figure 5: Our render-to-image module. Rendered images $\mathrm{Rd}_{a'}$ and $\mathrm{Rd}_b$ are sent into the generator G to get the results $\mathrm{F}_{a'}$ and $\mathrm{F}_b$ . Losses are conducted between generated $\mathrm{F}_{a'}$ and the ground truth $\mathbf{I}_a$ through the discriminator and the pretrained VGG network. + +where $a$ denotes the current view of this face in the 2D space, with $\mathbf{P}_a = \{f,\mathbf{R}_a,\mathbf{h}_{\mathbf{2d}}\}$ . The textures of its vertices can be acquired as: + +$$ +\mathbf {T} _ {a} = \operatorname {G e t T e x} \left(\mathrm {I} _ {a}, \{\mathbf {V}, \mathbf {P} _ {a} \}\right). \tag {8} +$$ + +We then rotate the 3D representation of this face to another random 2D view $b$ by multiplying $\mathbf{R}_a$ with another rotation matrix $\mathbf{R}_{random}$ to get $\mathbf{P}_b = \{f, \mathbf{R}_b, \mathbf{h}_{\mathbf{2d}}\}$ . And we render the current 3D presentation to $\mathrm{Rdb} = \mathrm{Render}(\{\mathbf{V}, \mathbf{P}_b, \mathbf{T}_a\})$ . This completes the first rotate-and-render operation. + +Under this circumstance, another set of textures can be acquired as: + +$$ +\mathbf {T} _ {b} = \operatorname {G e t T e x} \left(\mathrm {R d} _ {b}, \left\{\mathbf {V}, \mathbf {P} _ {b} \right\}\right). \tag {9} +$$ + +We discover that the vertex set whose textures are correct under view $b$ is the subset of the vertex set whose textures are correct under view $a$ . So unlike previous works rely on a ground truth image $\mathbf{I}_b$ as supervision to recover a face under view $b$ given view $a$ , we propose to recover $\mathbf{T}_a$ regarding $\mathbf{T}_b$ as input. + +Specifically, we rotate the 3D position $\mathbf{P}_b$ back to $\mathbf{P}_a$ and render it back to its original 2D position with + +$$ +\mathrm {R d} _ {a ^ {\prime}} = \operatorname {R e n d e r} \left(\left\{\mathbf {V}, \mathbf {P} _ {a}, \mathbf {T} _ {b} \right\}\right). \tag {10} +$$ + +This $\mathrm{Rd}_{a'}$ is basically a rendered image with artifacts caused by rotating a face from view $b$ to $a$ in the 2D space. In this way, we get our input/ground truth pair $\{\mathrm{Rd}_{a'},\mathrm{I}_a\}$ for training. + +# 3.3. Render-to-Image Generation + +In order to eliminate the artifacts and map the rendered images $\mathrm{Rd}_b$ and $\mathrm{Rd}_{a'}$ from the rendered domain to real image domain, we propose the render-to-image generation module to create $\mathrm{F}_{a'} = \mathrm{G}(\mathrm{Rd}_{a'})$ and $\mathrm{F}_b = \mathrm{G}(\mathrm{Rd}_b)$ using generator G, as shown in Fig 5. + +The basic generator G is adopted from CycleGAN [47], which is enough to handle most images in our datasets. + +![](images/d5cab6027a297874d47e00c839160c6436ee467fd8b8fb7d007b85284004742c.jpg) +Figure 6: Illustration of the miss-alignment effect and the results of the erosion preprocessing. + +The multi-layer discriminator and perceptual loss from Pix2PixHD [35] are borrowed directly. The loss function of the discriminator includes the adversarial loss + +$$ +\mathcal {L} _ {\mathrm {G A N}} (\mathbf {G}, \mathrm {D}) = \mathbb {E} _ {\mathrm {I}} [ \log \mathrm {D} \left(\mathrm {I} _ {a}\right) ] + \mathbb {E} _ {\mathrm {R d}} [ \log (1 - \mathrm {D} (\mathbf {G} (\mathrm {R d} _ {a ^ {\prime}})) ], \tag {11} +$$ + +and a feature matching loss. The feature matching loss is realized by extracting features from multiple layers of the discriminator and regularizing the distance between input and generated images. We use $F_{D}^{(i)}(\mathbf{I})$ to denote the feature extracted from the $i$ th layer of the discriminator for an input I. For total $N_{D}$ layers, the feature matching loss can be written as: + +$$ +\mathcal {L} _ {F M} (G, D) = \frac {1}{N _ {D}} \sum_ {i = 1} ^ {N _ {D}} \| F _ {D} ^ {(i)} \left(\mathrm {I} _ {a}\right) - F _ {D} ^ {(i)} \left(\mathrm {G} \left(\mathrm {R d} _ {a ^ {\prime}}\right)\right) \| _ {1}. \tag {12} +$$ + +Perceptual loss is achieved by using ImageNet pretrained VGG network. It is used to regularize both the generation results and the generated identity. The perceptual loss is very similar to that of $\mathcal{L}_{FM}$ , with the features denoted by $F_{vgg}^{(i)}$ , the loss function is: + +$$ +\mathcal {L} _ {v g g} (\mathrm {G}, \mathrm {D}) = \frac {1}{N _ {v g g}} \sum_ {i = 1} ^ {N _ {v g g}} \| F _ {v g g} ^ {(i)} \left(\mathrm {I} _ {a}\right) - F _ {v g g} ^ {(i)} \left(\mathrm {G} \left(\mathrm {R d} _ {a ^ {\prime}}\right)\right) \| _ {1}. \tag {13} +$$ + +Our full objective function can be written as: + +$$ +\mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {\mathrm {G A N}} + \lambda_ {1} \mathcal {L} _ {F M} + \lambda_ {2} \mathcal {L} _ {v g g}. \tag {14} +$$ + +During testing, our desired output can be directly generated by assigning the target view $\mathbf{P}_{\mathbf{c}}$ to form $\mathrm{Rd}_c = \mathrm{Render}(\{\mathbf{V},\mathbf{P}_c,\mathbf{T}_a\})$ , and send the rendered $\mathrm{Rd}_c$ into the trained generator $\mathbf{G}$ . + +# 3.4. Building Block Details + +3D Fitting Tool. Our choice of 3D face model is the 3D Morpohable Model (3DMM) [1]. Its flattened vertex matrix $\mathbf{V}$ can be denoted by $\mathbf{S} = [\pmb{v}_1^{\mathrm{T}},\pmb{v}_2^{\mathrm{T}},\dots ,\pmb{v}_n^{\mathrm{T}}]^{\mathrm{T}}$ . Its description of 3D faces is based on PCA: + +$$ +\mathbf {S} = \overline {{\mathbf {S}}} + \mathbf {A} _ {i d} \boldsymbol {\alpha} _ {i d} + \mathbf {A} _ {e x p} \boldsymbol {\alpha} _ {e x p}. \tag {15} +$$ + +Here $\overline{\mathbf{S}}$ is the mean shape, $\mathbf{A}_{id}$ and $\mathbf{A}_{exp}$ are the principle axes for identities and expressions, respectively. + +We use the open-sourced implementation and the pretrained model of 3DDFA [49] for 3D face fitting. It is a deep learning based model for regressing the parameters $\left[\mathbf{P}^{\mathrm{T}},\boldsymbol{\alpha}_{id},\boldsymbol{\alpha}_{exp}\right]$ , from a single 2D face image. Therefore the face's 3D shape and its relative position in 2D space $\{\mathbf{V},\mathbf{P}\}$ can be predicted. Please be noted that we do not train the 3DDFA. The usage of it is only for fast application, and its miss-alignment on 3D shape prediction can cast certain problems to the final results. An alternative way is to tune the 3D model using identity labels. However, in a fully unsupervised setting, we propose to solve it using a novel eroding preprocessing. + +Pre-Render and Erosion. Due to the inaccuracy of 3D fitting methods, the projection of wrongly fitted vertices sometimes lies outside the true edges of a face. When this kind of 3D miss alignment happens, background pixels would be assigned to these vertices. During the rotate-and-render process, those wrongly acquired textures will be rendered onto the rotated $\mathrm{Rd}_b$ (see Fig. 6 left column). However, such artifacts are difficult to create directly on $\mathrm{Rd}_{a'}$ by the rotate-and-render process, which means that they do not exist in training input-output pairs. Thus they cannot be handled by our generator. + +The way to solve it is to pre-render the fitted 3D representation $\{\mathbf{V},\mathbf{P}_a,\mathbf{T}_a\}$ to $\mathrm{Rd}_{a0}$ , and erode the rendered image by certain pixels. The erosion is performed basing on the projected edge of $\mathbf{V}$ with an average color of all vertices. Then texture $\mathbf{T}_a$ is renewed to + +$$ +\mathbf {T} _ {a} = \operatorname {G e t T e x} \left(\operatorname {e r o d e} \left(\mathrm {R d} _ {a}\right), \left\{\mathbf {V}, \mathbf {P} _ {a} \right\}\right). \tag {16} +$$ + +So that $\mathrm{Rd}_b$ can only contain artifacts that exist in $\mathrm{Rd}_{a'}$ . The output after the erosion can be found at Fig. 6. + +# 4. Experiments + +# 4.1. Experimental Settings + +Implementation Details. We firstly run 3DDFA across all datasets to get the parameters $\{\mathbf{V},\mathbf{P}\}$ for all images. With known $\mathbf{V}$ , we are able to know the facial key points and perform alignment for faces according to their eye centers and noses. The generator G contains 4 downsample and upsample blocks and 9 residual blocks. Spectral Normalization [23] and Batch Normalization [15] are applied to all layers. The discriminator consists of two scales. + +Our models are trained using Pytorch on 8 Tesla V100 GPUs with 16 GB memory. Two graphical cards are used for rendering and the others for training. The time for rotating one single image is about 0.1s. The weights $\lambda_{1}$ and $\lambda_{2}$ are both set to 10. Please refer to our code and models for more details. + +![](images/351291857b3f4fc66068375e2904943d118fb91a999c194e437d495e2c09af33.jpg) +Figure 7: Frontalization results with 3D-based Methods. the first row is the input. From top to down rows are results from: LFW-3D [9]; HPEN [48]; FF-GAN [44] and the last is ours. The samples are selected from LFW [13]. + +Datasets. Using our rotate-and-render strategy, we do not rely on any paired multi-view data or supervision, so there is no problem of over-fitting in evaluation. Theoretically, we have unlimited number of data for training our system. As datasets in controlled environments are not always applicable to real-world scenarios, we focus more on large-scale in-the-wild problems. + +CASIA-WebFace [41] and MS-Celeb-1M [8] are selected as training sets for both our render-to-image module and our face recognition network. Specifically, we adopt the version named MS1MV2 cleaned in [4]. For evaluating our boost on strong face recognition systems, we test on the standard LFW [13], IJBA [19] which contain profile faces in videos, and MegaFace 1-million Challenge [25]. MegaFace is the most challenging and wildly applied dataset for evaluating face recognition results. + +# 4.2. Qualitative Results + +As most papers do not release their code and models, we directly borrow the results reported from some of the papers and perform frontalization with the corresponding image in the reported dataset. Our results are cropped for better visualization. It is recommended to zoom-in for a better view. Results on CelebA-HQ [17] are shown in Fig 1 to validate that we can generate high-quality results under extreme poses and expressions + +Comparison with 3D-based methods. Fig 7 illustrates the results of 3D-based methods and FFGAN [44], which combines 3D and GAN. It can be seen from the figure that while pure 3D methods attempt to fill the missing part with symmetric priors, they would create great artifacts when coming + +![](images/2caf43656656e35082b47a9e607166484f08748d9fe87f2675cae5f517d23899.jpg) +Figure 8: Frontalization results comparing with GAN-based methods. The samples are selected from LFW. + +to large poses. This figure is extracted from FFGAN [44]. However, FFGAN fails to rotate faces to the front fully with serious loss of details. Our results seem much appealing comparing to theirs. + +Comparison with GAN-based methods. Fig 8 depicts our comparisons with GAN-based methods. TPGAN [14], CAPG-GAN [12], and FNM [30] are all purely reconstruction-based methods trained on a constrained dataset. As a consequence, the generated results lie only in the domain where their networks are trained. This limits their applications in the field of entertainment. Ours, on the other hand, preserves the illumination and environment satisfyingly. Besides, the results of TP-GAN [14] change the facial shape, CAPG-GAN [12] suffers from identity change. HF-PIM [2] is the previous state-of-the-art method. However, the results reported seem to change more details of identity than that of ours. For example, nose and jaw shapes on the first person (Keanu Reeves) in their results have been changed. FNM [30] is a GAN-based method that takes both constraint and in-the-wild data. Their results tend to generate the standard frontal face with neutral expressions in even the same background. + +Numerical Results. We have conducted an additional numerical experiments on VidTIMIT dataset [31] to directly compare frontalization results on pixel level. The multiview frames part is used. We select frames with yaw angle larger than $45^{\circ}$ as input and frontal face as ground truth. We unify the scale to $128 \times 128$ to compute the PSNR. Only open-sourced methods are used for comparison. The results of ours, FNM [30] and CR-GAN [32] are 28.8, 27.9 and 28.2 (dB), respectively. This is only for reference because it is almost impossible for frontalized results to match the ground truth. However, we can still find our results outperform others. + +# 4.3. Face Recognition Results + +Face Recognition Settings. Normally, previous works report face recognition results to validate the success of + +
Training DataMethodACC(%)AUC(%)
CASIATP-GAN[14]96.1399.42
CASIAFF-GAN[44]96.4299.45
-CAPG-GAN[12]99.3799.90
-LightCNN in [2]99.3999.87
-HF-PIM[2]99.4199.92
CASIARes1898.7799.90
CASIA+rot.Res18(ours)98.9599.91
MS1MV2Res1899.6399.91
MS1MV2+rot.Res18(ours)99.6899.92
+ +Table 1: Verification performance on LFW dataset. Our method can still boost the performance on a strong baseline. + +
Training DataMethod@FAR=.01@FAR=.001
CASIAFF-GAN85.2±1.066.3±3.3
CASIADR-GAN87.2±1.478.1±3.5
CASIAFNM[30]93.4±0.983.8±2.6
-HF-PIM[2]95.2±0.789.7±1.4
CASIARes1890.57±1.280.0±4.1
CASIA+rot.Res18(ours)91.98±0.782.48±2.5
MS1MV2Res1897.28±0.695.39±0.9
MS1MV2+rot.Res18(ours)97.30±0.695.63±0.7
+ +Table 2: Verification performance on IJB-A dataset [19]. + +their identity preserving quality after frontalization. However, clear descriptions about their settings are seldom given. Moreover, they report results on the baseline of LightCNN [39] with different structures and baseline scores, which are non-comparable. As a result, we will only report their final numbers as a reference. + +Meant for proposing a real-world applicable system, we use the state-of-the-art loss function ArcFace [4] and standard ResNet18 [10] backbone which has slightly smaller parameter size than LightCNN29 [39] for face recognition. Both results trained on CASIA and MS1MV2 are provided. We propose a different way of using frontalized data to boost the performance of face recognition by augmenting the original datasets with our 3D generated ones. Then the networks are trained on our augmented datasets. For fair comparison, best results are provided for baselines. + +Quantitative Results. We do a comprehensive study on the LFW dataset. The 1:1 face verification accuracy and area-under-curve (AUC) results are reported. It can be discovered that regardless of both weak (CAISA) or strong (MS1M) baselines, augmenting the training set with our frontalized results can boost the performance. Particularly, HF-PIM improves less on their baseline than our proposed method. Improvements can be found on IJB-A as listed in Table 2 with the verification experiments conducted on ResNet18. MultiPIE [7] is also evaluated with the same + +
Angle±30°±45°±60°±75°±90°
Res1810099.796.076.439.0
FF-GAN[44]92.589.785.277.261.2
TP-GAN[14]98.195.487.777.464.6
CAPG-GAN[12]99.697.390.376.466.1
HF-PIM[2]10099.999.196.492.3
Res18(ours)10010099.799.394.4
+ +Table 3: Rank-1 recognition rates $(\%)$ across views on Multi-PIE dataset. + +
Training DataMethodId%
MS1MV2R100 (ArcFace)98.35
MS1MV2R1897.00
MS1MV2+rotateR1897.48
MS1MV2R5098.26
MS1MV2+rotateR5098.44
+ +Table 4: Evaluation on MegaFace dataset, "Id" refers to the rank-1 face identification accuracy with 1M distractors. + +settings as [14] and all works listed in Table 3. As stated before, controlled datasets are not our focus. However, with our strong baseline, we can improve the recognition results on MultiPIE as well. + +Finally, we conduct experiments on MegaFace dataset, which is wildly used in the field of face recognition. However, no face frontalization paper has reported results on this dataset. Rank-1 face identification accuracy with 1 million distractors has been evaluated. We use the modified version of the 18 and 50 layers ResNet introduced by the ArcFace [4], and compare with their state-of-the-art result on R100. With our rotated augmentation, we can boost the performance of R50 to outperform the ArcFace R100 model, reaching $98.44\%$ . + +# 4.4. Ablation Study + +We train the same network with the same set of parameters and training strategy additionally without (i) the VGG loss; (ii) using multi-scale discriminator and the feature matching loss, as they are proposed together. Instead, we change it to the PatchGAN in the original Pix2Pix paper [16]. An additional $L_{1}$ loss on image level is added for regularization. + +Quantitative Results. Frechet Inception Distance (FID) [11] is widely used to measure the distances between generated and real image domains. The results of FID scores are listed in Table 5. We can observe that the performance reaches the best FID scores with our full model. + +Qualitative Results. We show two sets of frontalization results on the LFW dataset. It can be seen that without the multi-scale D, it is difficult for the network to discriminate the real domain, so the results contain certain GAN artifacts. + +![](images/d28f16de85bb547ed16ee369412135e8b7bda01eef6676cbedb2f65492871ffb.jpg) +Input + +![](images/4d420747be1efc2529ae0bcaaaaedf3b43ecdadc1840a01421d94e5983a43a58.jpg) +Ours w/o {MultiD} + +![](images/344b4bb694ecd506860056fd35a8798bdda69bac13f139ce3091b77c5a7b91c6.jpg) +Ours w/o {VGG} + +![](images/e21012f91017ddca12bd1e4eb8bdf6d112dabc498b18b314d3687aed4dc961c3.jpg) +Ours + +Figure 9: Ablation study of frontalization results. + +
Approach \ DatasetLFWIJB-A
Ours w/o {VGG}93.1126.5
Ours w/o {MultiD}83.9132.3
Ours83.170.9
+ +Table 5: Ablation study on loss functions with FID metric. For FID scores, the lower the better. + +Without the VGG loss, the results tend to be smooth. They are both crucial when it comes to large poses. + +Note that the modules we use are the least ones to generate reasonable results. Our method can still create visible artifacts, but there is great potential for improvements. + +# 5. Conclusion + +In this work, we take the advantage of 3D face priors and propose a novel strategy called Rotate-and-Render for unsupervised face rotation. Our key insight is to create self-supervision signal by rotating and rendering the roughly-predicted 3D representation to a random pose and back to its original place. So that self-supervision can be leveraged to create photo-realistic results by translating rendered image to real-image domain. Through comprehensive experiments, the following strengths of our pipeline have been validated: 1) No multi-view or paired-data, nor any kind of labels, including identities are needed for training our method. 2) Instead of purely frontalization a single-view face can be rotated to any desired angle. 3) Near photorealistic face rotation results which preserve details and illumination condition can be generated. Visualization indicates the superiority of our method. 4) It can be used to augment face datasets and boost recognition results on large-scale benchmarks with strong baseline models. + +Acknowledgements. We thank Hao Shao for helpful discussions. This work is supported by SenseTime Group Limited, the General Research Fund through the Research Grants Council of Hong Kong under Grants CUHK14202217, CUHK14203118, CUHK14205615, CUHK14207814, CUHK14208619, CUHK14213616, and Research Impact Fund R5001-18. + +# References + +[1] Volker Blanz, Thomas Vetter, et al. A morphable model for the synthesis of 3d faces. In Siggraph, 1999. 1, 5 +[2] Jie Cao, Yibo Hu, Hongwen Zhang, Ran He, and Zhenan Sun. Learning a high fidelity pose invariant model for high-resolution face frontalization. In NeurIPS, 2018. 3, 4, 7, 8 +[3] Jiankang Deng, Shiyang Cheng, Niannan Xue, Yuxiang Zhou, and Stefanos Zafeiriou. Uv-gan: Adversarial facial uv map completion for pose-invariant face recognition. In CVPR, 2018. 3, 4 +[4] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In CVPR, 2019. 6, 7, 8 +[5] Yixiao Ge, Zhuowan Li, Haiyu Zhao, Guojun Yin, Shuai Yi, Xiaogang Wang, et al. Fd-gan: Pose-guided feature distilling gan for robust person re-identification. In Advances in neural information processing systems, pages 1222–1233, 2018. 3 +[6] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014. 2 +[7] Ralph Gross, Iain Matthews, Jeffrey Cohn, Takeo Kanade, and Simon Baker. Multi-pie. Image and Vision Computing. 2, 7 +[8] Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In ECCV, 2016. 6 +[9] Tal Hassner, Shai Harel, Eran Paz, and Roee Enbar. Effective face frontalization in unconstrained images. In CVPR, 2015. 2, 6 +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 7 +[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 NeurIPS, 2017. 8 +[12] Yibo Hu, Xiang Wu, Bing Yu, Ran He, and Zhenan Sun. Pose-guided photorealistic face rotation. In CVPR, 2018. 2, 3, 7, 8 +[13] Gary B Huang, Marwan Mattar, Tamara Berg, and Eric Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. 2008. 6 +[14] Rui Huang, Shu Zhang, Tianyu Li, and Ran He. Beyond face rotation: Global and local perception gan for photorealistic and identity preserving frontal view synthesis. In ICCV, 2017. 2, 7, 8 +[15] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. 6 +[16] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. CVPR, 2017. 3, 8 + +[17] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. *ICLR*, 2018. 6 +[18] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In CVPR, 2018. 2, 4 +[19] Brendan F Klare, Ben Klein, Emma Taborsky, Austin Blanton, Jordan Cheney, Kristen Allen, Patrick Grother, Alan Mah, and Anil K Jain. Pushing the frontiers of unconstrained face detection and recognition: Iarpa janus benchmark a. In CVPR, 2015. 6, 7 +[20] Cheng-Han Lee, Ziwei Liu, Lingyun Wu, and Ping Luo. Maskgan: towards diverse and interactive facial image manipulation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. 3 +[21] Xihui Liu, Guojun Yin, Jing Shao, Xiaogang Wang, and Hongsheng Li. Learning to predict layout-to-image conditional convolutions for semantic image synthesis. In Advances in Neural Information Processing Systems, pages 568-578, 2019. 3 +[22] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In ICCV, 2015. 2 +[23] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957, 2018. 6 +[24] Joel Ruben Antony Moniz, Christopher Beckham, Simon Rajotte, Sina Honari, and Chris Pal. Unsupervised depth estimation, 3d face rotation and replacement. In Advances in Neural Information Processing Systems, pages 9736-9746, 2018. 2 +[25] Aaron Nech and Ira Kemelmacher-Shlizerman. Level playing field for million scale face recognition. In CVPR, 2017. 6 +[26] Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In CVPR, 2019. 3 +[27] 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. 3 +[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 European Conference on Computer Vision (ECCV), pages 818-833, 2018. 3 +[29] Shengju Qian, Kwan-Yee Lin, Wayne Wu, Yangxiaokang Liu, Quan Wang, Fumin Shen, Chen Qian, and Ran He. Make a face: Towards arbitrary high fidelity face manipulation. In Proceedings of the IEEE International Conference on Computer Vision, pages 10033–10042, 2019. 2 +[30] Yichen Qian, Weihong Deng, and Jiani Hu. Unsupervised face normalization with extreme pose and expression in the wild. In CVPR, 2019. 2, 3, 7 +[31] Conrad Sanderson and Brian C Lovell. Multi-region probabilistic histograms for robust and scalable identity inference. + +In International conference on biometrics, pages 199-208. Springer, 2009. 7 +[32] Yu Tian, Xi Peng, Long Zhao, Shaoting Zhang, and Dimitris N Metaxas. Cr-gan: learning complete representations for multi-view generation. *IJCAI*, 2018. 2, 7 +[33] Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning gan for pose-invariant face recognition. In CVPR, 2017. 2 +[34] Luan Quoc Tran, Xi Yin, and Xiaoming Liu. Representation learning by rotating your faces. IEEE transactions on pattern analysis and machine intelligence, 2018. 2 +[35] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. In CVPR, 2018. 3, 5 +[36] 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. 3 +[37] Yi Wang, Xin Tao, Xiaojuan Qi, Xiaoyong Shen, and Jiaya Jia. Image inpainting via generative multi-column convolutional neural networks. In Advances in neural information processing systems, 2018. 3 +[38] Wayne Wu, Yunxuan Zhang, Cheng Li, Chen Qian, and Chen Change Loy. Reenactgan: Learning to reenact faces via boundary transfer. In ECCV, 2018. 3 +[39] Xiang Wu, Ran He, Zhenan Sun, and Tieniu Tan. A light cnn for deep face representation with noisy labels. IEEE Transactions on Information Forensics and Security, 2018. 7 +[40] Raymond A Yeh, Chen Chen, Teck Yian Lim, Alexander G Schwing, Mark Hasegawa-Johnson, and Minh N Do. Semantic image inpainting with deep generative models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5485-5493, 2017. 3 +[41] Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z Li. Learning face representation from scratch. arXiv preprint arXiv:1411.7923, 2014. 6 +[42] Junho Yim, Heechul Jung, ByungIn Yoo, Changkyu Choi, Dusik Park, and Junmo Kim. Rotating your face using multitask deep neural network. In CVPR, 2015. 2 +[43] Weidong Yin, Ziwei Liu, and Chen Change Loy. Instance-level facial attributes transfer with geometry-aware flow. In AAAI, 2019. 3 +[44] Xi Yin, Xiang Yu, Kihyuk Sohn, Xiaoming Liu, and Manmohan Chandraker. Towards large-posed face frontalization in the wild. In ICCV, 2017. 3, 6, 7, 8 +[45] Hang Zhou, Yu Liu, Ziwei Liu, Ping Luo, and Xiaogang Wang. Talking face generation by adversarially disentangled audio-visual representation. In AAAI, 2019. 3 +[46] Hang Zhou, Ziwei Liu, Xudong Xu, Ping Luo, and Xiaogang Wang. Vision-infused deep audio inpainting. In ICCV, 2019. 3 +[47] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networkss. In Computer Vision (ICCV), 2017 IEEE International Conference on, 2017. 3, 5 + +[48] Xiangyu Zhu, Zhen Lei, Junjie Yan, Dong Yi, and Stan Z Li. High-fidelity pose and expression normalization for face recognition in the wild. In CVPR, 2015. 1, 2, 6 +[49] Xiangyu Zhu, Xiaoming Liu, Zhen Lei, and Stan 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, 6 \ No newline at end of file diff --git a/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/images.zip b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f21d009475e297093e602e117ac55dc198a8f27e --- /dev/null +++ b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ad44129a47273d5b3789695834df36ffdfdc64cc28cb0e24b19648dd1550298 +size 574846 diff --git a/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/layout.json b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9b19f8e3bfdf0129b3723ee41b7a3e8973340cb1 --- /dev/null +++ b/rotateandrenderunsupervisedphotorealisticfacerotationfromsingleviewimages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3894b34acd92aa01c04d01aebf95b594a169ce1e4f96c455bd1999c96153f98d +size 425542 diff --git a/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_content_list.json b/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..60be25db64c198c3dc3fb45b0432a59e079cd42b --- /dev/null +++ b/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf6b3f37fb9c735a3bd742bec142d7c7a8f211149c2d60e49e8b9363727fea84 +size 87090 diff --git a/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_model.json b/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5b138c7caf3f03c2e0dea5771421dd0e7b2fa77f --- /dev/null +++ b/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99d9572c68e4982f99ea8fe4522dde08614eec68b8cfc77778f5e0391d4cfe40 +size 109825 diff --git a/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_origin.pdf b/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..41b82d029974a33e60e1872e85c5a4fbc776f778 --- /dev/null +++ b/rotationconsistentmarginlossforefficientlowbitfacerecognition/7a8e4d5f-a6e9-4c6f-a02a-6ad0dc1677ee_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7007b48119eefaea659393b3f44581ccd632c0f74d79414e418a3a58967d250 +size 687739 diff --git a/rotationconsistentmarginlossforefficientlowbitfacerecognition/full.md b/rotationconsistentmarginlossforefficientlowbitfacerecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b1bfd8197ef83b0b19887790e8d946544032f110 --- /dev/null +++ b/rotationconsistentmarginlossforefficientlowbitfacerecognition/full.md @@ -0,0 +1,400 @@ +# Rotation Consistent Margin Loss for Efficient Low-bit Face Recognition + +Yudong Wu $^{1}$ , Yichao Wu $^{1}$ , Ruihao Gong $^{1,2}$ , Yuanhao Lv $^{1}$ , Ken Chen $^{1}$ , Ding Liang $^{1}$ , Xiaolin Hu $^{3}$ , Xianglong Liu $^{2}$ , Junjie Yan $^{1}$ + +$^{1}$ SenseTime Group Limited $^{2}$ BeiHang University $^{3}$ Tsinghua University + +{wuyudong, wuyichao, liangding, yanjunjie}@sensetime.com + +# Abstract + +In this paper, we consider the low-bit quantization problem of face recognition (FR) under the open-set protocol. Different from well explored low-bit quantization on closed-set image classification task, the open-set task is more sensitive to quantization errors (QEs). We redefine the QEs in angular space and disentangle it into class error and individual error. These two parts correspond to inter-class separability and intra-class compactness, respectively. Instead of eliminating the entire QEs, we propose the rotation consistent margin (RCM) loss to minimize the individual error, which is more essential to feature discriminative power. Extensive experiments on popular benchmark datasets such as MegaFace Challenge, Youtube Faces (YTF), Labeled Face in the Wild (LFW) and IJB-C show the superiority of proposed loss in low-bit (e.g., 4-, 3-bit) FR quantization tasks. + +# 1. Introduction + +The problem of face recognition (FR) has been well investigated [41, 42, 12, 4, 25, 8, 46, 54] in recent years. Among them, the deep FR technique, which leverages hierarchical and heavy-weight network architectures [43, 34, 38, 14, 16], has significantly improved the state-of-the-art performance and fostered wide-spread applications. Whereas excessive memory and computational consumption make it impractical to deploy massive networks on mobile or embedded devices. + +Quantization technique [6, 5, 31, 55, 56, 10] emerges as an elegant compression solution to address this problem. The core idea of this method is to reduce bit-width of weights and activations by mapping continuous values to discrete integers, which can not only reduce the memory footprint but also accelerate the inference directly. Despite the attractive benefits, low bit-width may degrade accuracy due to quantization errors (QEs). To minimize QEs, many methods have been proposed [53, 36, 2, 1], and have been demonstrated successful in the fields of closed-set computer + +![](images/1520a9e80528d47468696bdf8ab8e5cb512a9a43cfdc7183e6b901e787ea9373.jpg) +(a) Quantization processes of closed-set and open-set + +![](images/ebfe9fbf5452dbb840b1d9661e1fcb92eca3ea8212bf5285806221e72bf14e9f.jpg) + +![](images/6cba253bb7c1e6c140a4039af0883b377af14267bd96fdb9c3b23e4bf444c71c.jpg) +(b) Comparison of accuracy + +![](images/3b0aaa6d441769a9815c3302e9c1cce08b8d01ba0b316e6100524511dd52b926.jpg) +(c) Angles of positive pairs +Figure 1: Difference between closed-set and open-set quantization. (a) sketches the quantization processes of closed and open-set, respectively. $W_{i}$ is the $i$ -th column of the weight of the last fully connected layer ( $i$ -th class weight). Gray circle represents unknown face categories in test set, and the green dotted line denotes decision boundary. (b) compares the degradation of top1 accuracy and TPR after quantization. FP refers to full precision. (c) illustrates the increase of angles between positive pairs caused by quantization. + +vision problems $^{1}$ , such as image classification and object detection [23]. However, for real-world FR, it is common that the testing identities (IDs) are disjoint from the training set, which makes open-set $\mathrm{FR}^2$ problems more challenging and practical [25, 11]. In this study, we show that FR is much more sensitive to the QEs than closed-set classification tasks, thus novel sophisticated techniques are required to address this issue. + +Essentially, FR is a typical scenario of metric learning where features of different IDs are expected to have discriminative large-margins rather than just be separable, as illustrated in Fig. 1a. To demonstrate the difficulty in open-set model quantization, we conduct a toy experiment. For + +closed-set protocol, we select 100 categories from CASIA-WebFace [52], and then choose $70\%$ of all the data as training set and the rest as the test set. For open-set protocol, 10 additional categories are collected as open test set. We train a ResNet18 [14] and quantize it into 4-bit. As shown in Fig. 1b, the top1 accuracy of classification keeps almost unchanged after quantization, while the true positive ratio (TPR) of FR decreases more than $20\%$ , especially on the open test set. Angles between positive pairs (two samples belong to the same id) also increase significantly after quantization (Fig. 1c), which indicates the reduced intra-class compactness. + +Previous methods for closed-set classification quantization training attempt to completely eliminate the QEs by well-designed quantizers [53, 1, 2] or knowledge distillation (KD) [31]. In this paper, we argue that improving performance of low-bit FR models is not entirely equivalent to reducing the QEs, and propose a novel rotation consistent margin (RCM) loss function for efficient low-bit FR quantization. We define the QEs of face feature representation as the angle between its full precision (FP) feature and its quantized feature, named "A-QE". For a single sample, A-QE can be disentangled into two parts: class error and individual error. The class error refers to the overall rotation of a class caused by quantization. We observe that although it is enormous in low-bit models, it does not weaken the inter-class separability. On the other hand, individual error refers to the within-class deviation of each sample. It represents intra-class structural changes, which affect the performance of the quantized FR models essentially. Therefore, in this study, we attempt to minimize the individual error instead of the entire entangled A-QE by introducing it into cosine-based softmax loss function as an angular margin, which we call rotation consistent margin (RCM). + +It is known that the embedding features of FR distribute on a fixed radius hypersphere [35, 8, 46, 45, 54]. Thus, QEs can be considered as rotation over the original distribution. Rotation consistent means that intra-class compactness remains unchanged regardless of class rotations, which can maintain same feature discrimination as the FP model. The proposed method rebuilds intra-class compactness efficiently by focusing on minimizing individual error. Meanwhile, rotation consistent is more realistic and easier to achieve because QEs are intrinsical and cannot be eliminated completely. Extensive experiments on MegaFace [21], LFW [17], YTF [51] and IJB-C [28] show that RCM loss function significantly improves the performance of low-bit FR models. Moreover, our method can be combined with other quantization methods and boost their performance. + +To sum up, our contributions could be summarized into three parts: + +We redefine the QEs of FR in angular space, and dis + +entangle QEs into class error and individual error. The former modifies inter-classes distribution, and the later determines the change of intra-class compactness. + +- We rethink the essence of improving quantized FR models, and propose a novel loss function named as rotation consistent margin (RCM) loss for efficient low-bit FR model training by minimizing individual errors. +- To the best of our knowledge, we are the first to explore the quantization of FR. Extensive experiments on several accessible benchmark datasets demonstrate that our method effectively improves the performance of different low-bit FR models. + +# 2. Related Work + +# 2.1. Large-scale face recognition + +Practical applications of FR are usually under the open-set protocol, where test categories are different from training categories. Therefore, FR is regarded as a typical metric learning task [33, 40, 47, 25, 46], whose objective is to increase the intra-class compactness and inter-class discrepancy. To this end, many loss functions have been proposed. Sun et al. [41, 42] and Wang et al. [50] combine softmax loss with contrast loss or center loss, respectively, to explicitly increase the margin between different classes or reduce the distance between positive sample pairs. FaceNet [38] adopts triplet loss to optimize the embedding features directly, and greatly boost the performance. Recent works [26, 25, 46, 8, 45] propose the cosine-based softmax loss function and incorporate with margin to enhance the feature discriminative power. In these methods, features and class weights are normalized to a fixed scale, and the hypersphere manifold distribution hypothesis arises correspondingly and is widely recognized due to the concise geometric interpretation and impressive performance achieved by those loss functions. + +# 2.2. Network quantization + +Network quantization is a technique of network compression that works as an analog-to-digital converter: quantizing FP weights and activations into low precision fixed-point integers. Through efficient bit operation or integer-only arithmetic, it can both reduce the storage overhead and accelerate the inference significantly. Common quantization types include binary/ternary [5, 6, 18, 22, 57], uniform [58, 31, 29, 55, 20, 48] and non-uniform [56, 44, 3, 53, 13] quantization. Both uniform and binary/ternary quantizers are hardware-friendly that can enjoy acceleration directly on off-the-shelf hardware [20, 19, 9, 30]. Posttraining quantization and quantization-aware training are two typical quantization schemes. The former solves the value ranges without re-training. The later finetunes the optimized FP model in a simulated quantization scheme and usually yields higher accuracy. + +# 3. Preliminaries + +# 3.1. Cosine-based softmax loss function + +In original deep FR methods [43, 41], models are trained using softmax cross-entropy loss function3, + +$$ +\mathcal {L} _ {\text {s o f t m a x}} = - \log \frac {e ^ {z _ {i , j}}}{\sum_ {j = 1} ^ {n} e ^ {z _ {i , j}}}, \tag {1} +$$ + +where $z_{i,j} = \boldsymbol{W}_j^T\boldsymbol{f}_i$ is the logit of $j$ -th class. $\boldsymbol{W}_j \in \mathbb{R}^d$ is the $j$ -th column of weights of last fully connected layer, and bias is omitted for simplicity, $\boldsymbol{f}_i \in \mathbb{R}^d$ refers to the feature of $i$ -th sample. + +Recently, it is argued that the vanilla softmax loss cannot force features to have higher discriminative power, and cosine-based softmax incorporated with margin is proposed [8, 54, 46], where $\mathbf{W}_j^T\mathbf{f}_i$ is reformulated as $s \cdot \cos \theta_{i,j}$ , and $\theta_{i,j}$ is the angle between $\mathbf{W}_j$ and $\mathbf{f}_i$ , and $s$ is a scale hyperparameter. ArcFace [8] uses additive angular margin $z_{i,j} = s \cdot \cos (\theta_{i,j} + \mathbb{1}\{j = y_i\} \cdot m)$ , CosFace [46] uses additive cosine margin $z_{i,j} = s \cdot (\cos \theta_{i,j} - \mathbb{1}\{j = y_i\} \cdot m)$ , and SphereFace [25] uses multiplicative angular margin $z_{i,j} = s \cdot \cos (\mathbb{1}\{j = y_i\} \cdot m \cdot \theta_{i,j})$ . The indicator function $\mathbb{1}\{j = y_i\}$ returns 1 when $j = y_i$ and 0 otherwise. All of them achieve significant improvement. + +# 3.2. Quantization process + +Generally, weights and activations of deep models are represented in FP values with 32-bit. Network quantization represents them in fixed-point integers with lower bit-width (e.g., 8-, 4-bit etc.). Among popular quantizers, the binary and uniform quantizers are hardware-friendly, which enables us to accelerate the inference directly on off-the-shelf hardwares [20, 19, 9, 30]. Therefore, the following discussions are all under the uniform protocol. + +For $n$ -bit uniform quantization, the process can be defined as: + +$$ +x _ {Q} = \operatorname {r o u n d} \left(\frac {\operatorname {c l a m p} \left(x _ {\min } , x _ {\max } , x\right) - x _ {\min }}{\Delta}\right), \tag {2} +$$ + +where $x_{Q}$ is the integer number in $n$ -bit width, and $x_{min}$ , $x_{max}$ is the lower and upper bound of FP values. For per-layer quantization scheme, an entire layer shares the same $(x_{min}, x_{max})$ , and for per-channel scheme, each channel has different boundaries. $\Delta = \frac{x_{max} - x_{min}}{2^n - 1}$ is the interval length. + +# 4. Proposed Approach + +# 4.1. Angle based quantization errors in FR + +Generally, when the bit-width goes down, the accuracy of quantized models degrades dramatically due to QEs. QEs refer to the rounding and truncation errors introduced by + +representing continuous values in $n$ -bit fixed-point number. For a single value $x$ , QE defines as follows, + +$$ +\mathrm {Q E} (x) = x - \mathrm {Q} (x) \tag {3} +$$ + +where $\mathrm{Q}(x)$ is de-quantization FP value of $x_{Q}$ . For $r$ uniform quantization, the de-quantization operation is: + +$$ +\mathrm {Q} (x) = x _ {\text {m i n}} + x _ {Q} * \Delta . \tag {4} +$$ + +In previous works [53, 1], QE of the $d$ -dimension feature or tensor is defined as the average error of each dimension, + +$$ +\operatorname {Q E} \left(\boldsymbol {f} _ {i}\right) = \frac {1}{d} \sum_ {l = 1} ^ {d} \left(f _ {i} ^ {l} - \mathrm {Q} \left(f _ {i} ^ {l}\right)\right) ^ {2}, \tag {5} +$$ + +where $f_{i}^{l}$ is the $l$ -th dimension of feature $\pmb{f}_{i}$ . As for FR, features are angularly distributed, i.e., on the surface of a fixed radius hypersphere, and the angle or cosine similarity models the interrelation between samples. Reasonably, we redefine the QE of face feature as the angle between its quantized feature and its FP feature, + +$$ +\operatorname {A} - \operatorname {Q E} \left(\boldsymbol {f} _ {i}\right) = \arccos \left(\left\langle \frac {\boldsymbol {f} _ {i}}{\| \boldsymbol {f} _ {i} \| _ {2}}, \frac {\hat {\mathrm {Q}} \left(\boldsymbol {f} _ {i}\right)}{\| \hat {\mathrm {Q}} \left(\boldsymbol {f} _ {i}\right) \| _ {2}} \right\rangle\right), \tag {6} +$$ + +where $\hat{\mathrm{Q}}(f_i)$ is the feature of quantized model. Compared with the vanilla mean-square error definition, A-QE has a more clear geometric interpretation and is also more intuitive in FR. It intuitively reflects the rotation caused by quantization. + +# 4.2. Disentangling A-QE + +In this subsection, we investigate the effects of A-QE on FR by theoretical analysis and empirical experiments, and then propose to disentangle the A-QE of a single sample into class error and individual error. + +Initially, we represent the class center as the mean of all sample features: + +$$ +\boldsymbol {c} _ {y _ {i}} = \frac {1}{n} \sum_ {i = 0} ^ {n} \boldsymbol {f} _ {i}, \quad s. t. \boldsymbol {f} _ {i} \in \mathcal {C} _ {y _ {i}}, \tag {7} +$$ + +where $\mathcal{C}_{y_i}$ is the $y_{i}$ -th class set. For $\pmb {f}_i\in \mathcal{C}_{y_i}$ , we denote the QE of $l$ -dimension as $\delta^l$ , then the center of the quantized class, + +$$ +\begin{array}{l} q c _ {y _ {i}} ^ {l} = \frac {1}{n} \sum \hat {Q} (f _ {i} ^ {l}) \\ = \frac {1}{n} \sum \left(f _ {i} ^ {l} + \delta_ {i} ^ {l}\right) \tag {8} \\ = \frac {1}{n} \sum f _ {i} ^ {l} + \frac {1}{n} \sum \delta_ {i} ^ {l}, \\ \end{array} +$$ + +where $q c_{y_i}$ denotes the center of the quantized class. If we assume that $\delta^l$ is a Gaussian distribution, i.e. $\delta^l \sim \mathcal{N}(\mu_{y_i}, \sigma_{y_i}^2)$ , then $q c_{y_i}^l = c_{y_i}^l + \mu_{y_i}^l$ . The rotation angle of class center after quantization is + +$$ +\theta_ {c _ {y _ {i}}} = \operatorname {a r c c o s} \left(\frac {\sum_ {l = 0} ^ {d} c _ {y _ {i}} ^ {l} \cdot \left(c _ {y _ {i}} ^ {l} + \mu_ {y _ {i}} ^ {l}\right)}{\left\| \boldsymbol {c} _ {y _ {i}} \right\| _ {2} \cdot \left\| \boldsymbol {q} \boldsymbol {c} _ {y _ {i}} \right\| _ {2}}\right). \tag {9} +$$ + +![](images/b77f3896ea525697e854d249cba8b479d24ff654a7ae0f98b5759fa097bb5e56.jpg) +(a) QEs of class centers + +![](images/34fe3399a2a433184588de2929f7522e9e407b1f41762ad91a802aa3fa6aa1bb.jpg) + +![](images/0aff5dc19bddb4a22a1cf8b353259f47ef0ddb26f9d62d2acc0c1f0d802e683e.jpg) +(b) Inter-class angles +(c) Intra-class angles +Figure 2: QEs analysis of FR model. We train a ResNet18 [14] on CASIA-WebFace [52] dataset and quantize it into 8-, 6-, 4-bit, respectively. (a) plots the rotation angles of class centers of different bit-width models. (b) illustrates the angles between all class center pairs (inter-class angles). (c) demonstrates the within-class angles. + +To reveal the actual rotation angles in FR, we conduct experiments on the CASIA-WebFace [52] and plot the distribution of A-QE of each class center in Fig. 2a. Specifically, we train an FP ResNet18 [14] model using Arcface [8] and quantize it into 8-, 6-, 4-bit, respectively. To avoid modifying model weights, we adopt the post-training quantization scheme. + +Observation #1. As shown in Fig. 2a, the rotation angles of class centers are significant and increase dramatically as the bit-width decreases. We name this rotation caused by quantization, i.e., $\mathrm{A - QE(c_{y_i})}$ , as class error. + +Analysis. The significant class error indicates that the A-QEs of samples in the same category are not completely random; samples are rotated in a common direction. Accordingly, the entire class is rotated. Repeat experiments are performed on MobileNetV2 [37], VGG [39] to exclude the effect of network architectures, and the same phenomena are observed. + +The distribution of classes mainly determines the inter-class separability. To further investigate, we use the angles between class center pairs (inter-class angles) to demonstrate the overall inter-class separability of different bitwidth models. The distributions are shown in Fig. 2b. + +Observation #2. Compared with the original FP model, there is no obvious change of the inter-class angles after quantization: most remain around $\frac{\pi}{2}$ . This observation holds when the bit-width is reduced. + +Analysis. The stationary inter-class angle means the inter-class discrepancy keeps stable after quantization. Based on the above two observations, we can briefly summarize that although QEs rotate classes sorely, the discriminative power between classes has not been weakened. + +On the other hand, we also investigate the change of intra-class compactness after quantization. The original definition of within-class scatter is based on the distance between samples and class centers4. We replace the Euclidean distance by angle and show within-class angles in Fig. 2c. + +Observation #3. The within-class angles increase significantly after quantization, which means that the intraclass compactness is noticeably reduced, especially in low-bit models. The within-class angles are about $30^{\circ}$ in the FP model, whereas they surge to $90^{\circ}$ when quantized to 4-bit. + +Analysis. We can empirically conclude that QEs weaken the intra-class compactness, and as the bit width decreases, the degree of weakening increases. + +Based the on above investigations, we propose to decompose A-QE of a sample into class error and individual error two parts, + +$$ +\mathrm {A} - \mathrm {Q E} \left(\boldsymbol {f} _ {i}\right) = \mathrm {A} - \mathrm {Q E} \left(\boldsymbol {c} _ {\mathrm {y} _ {\mathrm {i}}}\right) + \mathcal {I} \left(\boldsymbol {f} _ {i}\right), \tag {10} +$$ + +where $\mathcal{I}(\pmb{f}_i)$ refers to the individual error. From the perspective of a single sample, its rotation caused by quantization can be considered to follow the class center and then deflect within the class. The within-class deflection degrades the original stable intra-class compactness and leads to inferior performance. The dissection is sketched in Fig.3. + +![](images/1a814134e450d23a7ef44b1e3fbc8c5ee4a5fefae00dc359b10d7987f60348d6.jpg) +Figure 3: Dissection of A-QE. The left showcases a class of FP model, and the right illustrates that class after quantization. Circles and stars refer to the class centers and individual samples, respectively. The green solid line represents the entire A-QE of the sample, blue represents class error and orange represents the individual error. For a clear illustration, we use euclidean distances instead of vector angles to denote errors. + +# 4.3. Rotation consistent margin + +Initially, quantization methods [20, 49, 18] ignore QEs by taking quantizers as general operators and directly use task loss to tune models in quantization aware training. Afterward, several methods attempt to minimize the entire QEs by well-designed quantizers [53, 1, 2] or knowledge distillation [31], and usually yield higher performance. In spite of the improvement brought by reducing the entire QEs, a question worth thinking about is: Is improving the + +![](images/a943faca4558d8a3e3a1420962b0b882876831d047eb9d2717889056823ba822.jpg) +Figure 4: Training process for low-bit FR models supervised by RCM loss function $\mathcal{L}_{\mathrm{A}}$ . Firstly, $\theta_{y_i}$ in quantized class is calculated. Then we employ two class centers (before and after quantization, represented in big circles) as anchors to obtain the class error $(\theta_1)$ . The entire A-QE of samples (represented in stars) is also calculated, i.e., $\theta_{2} = \arccos \left(\left\langle \frac{\boldsymbol{f}_{i}}{||\boldsymbol{f}_{i}||_{2}}, \frac{\hat{\mathbb{Q}}(\boldsymbol{f}_{i})}{||\hat{\mathbb{Q}}(\boldsymbol{f}_{i})||_{2}} \right\rangle\right)$ , and individual error is $|\theta_{1} - \theta_{2}|$ . We use the $\theta^{*} = \theta_{y_{i}} + \lambda |\theta_{1} - \theta_{2}| + m$ as the final angle to calculate logits. The logits then go through the softmax function and contribute to the cross-entropy loss. The FP feature $\boldsymbol{f}_{i}$ is extracted off-line before training. + +# accuracy of quantized models exactly equivalent to reducing all the quantization errors? + +Our answer is "not for FR", the essence of improving low-bit FR models is to rebuild the intra-class compactness and the inter-class separability. By dissecting A-QE, we disentangle the QE of a sample into class error and individual error. The class error is the common part of all class samples (class-wise) which rotates class as a whole. Although it is considerable, it dose not impair inter-class discrepancy. Actually, due to the sparsity of high-dimensional class weights, the inter-class angles keep around $\frac{\pi}{2}$ during the whole training process, and this phenomenon has also been validated in other works [58, 15]. We validate that this phenomenon also exists in the low-bit scenario. It indicates that during training, the objective of inter-class separability maintains as a regularization other than pushing class weights further apart in whether FP or low-bit models. In contrast, the individual error is a unique part of each sample (sample-wise), and it changes the intra-class structure. As shown in Fig. 2c, the within-class scatter increases significantly after quantization, which implies the individual error cracks the intra-class compactness. Therefore, we argue that improving the accuracy of quantized FR models is not completely equivalent to reducing all the quantization error. If we directly minimize the entire A-QE, supervision of class error would drive the model to pull the class towards the FP position instead of rebuilding the impaired intra-class compactness. + +Alternatively, we propose to only minimize the individual error. We introduce the individual error into the popular cosine-based softmax loss function as an additive angular margin, named rotation consistent margin (RCM), + +$$ +\mathcal {L} _ {\mathrm {A}} = - \log \frac {e ^ {s \cdot \cos (\theta_ {i , j} + \mathbb {1} \cdot m + \mathbb {1} \cdot \lambda \theta_ {Q})}}{\sum e ^ {s \cdot \cos (\theta_ {i , j} + \mathbb {1} \cdot m + \mathbb {1} \cdot \lambda \theta_ {Q})}} , \tag {11} +$$ + +where $\lambda$ is the scaling parameter, and we write $\mathbb{1}\{j = y_i\}$ as $\mathbb{1}$ for the clear demonstration. As the original cosine-based softmax loss function is not the focus of our discussion, for simplicity and fairness, we choose currently the competitive loss function, ArcFace [8], as our baseline. We keep the original additive margin $m$ . The individual error is calculated as follows, + +$$ +\theta_ {Q} = \left| \mathrm {A} - \mathrm {Q E} \left(\boldsymbol {f} _ {i}\right) - \mathrm {A} - \mathrm {Q E} \left(\boldsymbol {c} _ {y _ {i}}\right) \right|. \tag {12} +$$ + +The complete training pipeline supervised by $L_{A}$ is illustrated in Fig. 4. + +Rotation consistent means that intra-class compactness stays stable regardless of the huge rotation of the classes, and the performance is improved even though the class errors are still huge, which is validated in Sec 5.2. By minimizing the individual error, the proposed loss can enhance the impaired compactness efficiently. Meanwhile, interclass distribution is tuned appropriately via classification loss rather than being pulled towards the original position. + +# 4.4. Discussions + +Why angle margin. Besides incorporating individual error to cosine-based softmax as an angular margin, combining by weighted sum is also an intuitive way to reduce individual error, + +$$ +\mathcal {L} _ {\text {s u m}} = \mathcal {L} _ {\cos} + \lambda \theta_ {Q}, \tag {13} +$$ + +where $\mathcal{L}_{\mathrm{cos}}$ refers to the cosine-based softmax loss function. The reasons for adopting the angular margin are two-folds. On the one hand, angular margin brings more clear geometric interpretation and directly links to the discrimination on the hypersphere manifold. On the other hand, incorporating as an angular margin has stronger supervision on most medium hard samples, and produces superior optimization by weakening the influence of too simple and hard samples. + +The gradient of $\mathcal{L}_{\mathrm{A}}$ respect to $\theta_{Q}$ is, + +$$ +\frac {d \mathcal {L} _ {\mathrm {A}}}{d \theta_ {Q}} = \lambda s ^ {2} \frac {\sum_ {j = 1 , j \neq i} ^ {C} e ^ {z _ {i , j}}}{\sum_ {j = 1 , j \neq i} ^ {C} e ^ {z _ {i , j}} + e ^ {s \cdot \cos (\theta^ {*})}} \cdot \sin (\theta^ {*}), \tag {14} +$$ + +where $\theta^{*} = \theta +m + \lambda \theta_{Q}$ and $C$ is the class number. For non-corresponding classes $j\neq i,\theta_{i,j}$ always stays around $\frac{\pi}{2}$ during training, thus we assume $e^{z_{i,j}}\approx 1$ as in [54]. We plot $\frac{d\mathcal{L}_A}{d\theta_Q} = \lambda s^2\frac{C}{C - 1 + e^{s\cdot\cos(\theta^*)}}\sin (\theta^*)$ with different $C$ in Fig. 5. At around $\theta^{*} = \frac{\pi}{2}$ , the gradient has a maximum value. By appropriate $\lambda$ , $\mathcal{L}_A$ can have stronger supervision at the medium hard samples instead of equal supervision for too simple or too hard samples. Too hard samples can be noise, which is common in large scale FR training datasets, and too simple samples are hard to be further optimized whereas would dominate the training and result in inferior models [24]. + +Decision boundary. Considering a binary-classes scenario, the decision boundaries of the proposed loss function is defined by, + +$$ +\cos \left(\theta_ {1} + m + \lambda \theta_ {Q}\right) = \cos \left(\theta_ {2}\right). \tag {15} +$$ + +For $c_{1}$ , it requires $\theta_{1} < \theta_{2} - m - \lambda \theta_{Q}$ . In ArcFace, the margin $m$ is immutable and identical for all samples, and the decision boundary also stays the same during training (Fig. 6a). Whereas the rotation consistent margin of the proposed approach is sample-wise and dynamically shrinks during the training (Fig. 6b). In the beginning, significant individual errors generate strong supervision to rebuild intra-class compactness efficiently. At the later stages of training, the rotation consistent margin becomes steady, and optimization turns to learn customized model weights in discrete parameter space. + +![](images/803ff3587ab6da08f94c8e1c480e6898b71a12ae3af81e036552994dea7dc72f.jpg) +Figure 5: The gradient of $\mathcal{L}_{\mathrm{A}}$ respect to $\theta_{Q}$ of different class number $C$ . $s$ is set to 64 as in ArcFace [8] and $\lambda$ is set to 1. + +# 5. Experiment + +# 5.1. Experiments setting + +Datasets. For datasets, we separately employ publicly available CASIA-WebFace [52] and MS1MV1 [7] cleaned by deepglint as training datasets. The CASIA-WebFace dataset contains 0.49M images of 10,575 face identities. + +![](images/1ee741f51cebdf884a8cfc8dae6a07088ebc5b6995075c4ea4f0de1c9606e4d1.jpg) +(a) ArcFace +(b) $L_{A}$ +Figure 6: The comparison of decision boundaries. (a): Decision boundary of ArcFace, which is the same for all samples and immutable during training. (b): Decision boundary of $L_{A}$ . It is sample-wise and dynamically changing during training. + +Cleaned MS1MV1 is a large scale dataset that consists of 3.9M images from 87K face identities. We extensively evaluate the performance of our approach on several most widely used benchmark face datasets, including MegaFace [21], Labeled Face in the Wild (LFW) [17], Youtube Faces (YTF) [51] and IJB-C [28]. + +Training. We employ the widely used CNN architectures, ResNet18 [14] and MobileNetV2 [37]. Following [8], BN-Dropout-FC-BN structure is adopted to get the final 256-D features. We use the SGD algorithm with a momentum of 0.9 and set weight decay 0.0005. Eight GPUs are used with a single batch size of 64. For training on CASIA-WebFace, the learning rate is initially 0.1 and divided by 10 at the 20K, 28K iterations, and the training finished at 32K iterations. For large scale dataset MS1MV1, the learning rate dropped at 100k, 160k iterations, and terminates at 180K. + +Quantization setting. In this paper, we employ the asymmetric uniform quantizer, which is hardware-friendly. As per-channel quantization scheme usually yields higher accuracy, we adopt it for weights. As for activations, the per-layer scheme is used because per-channel would complicate the inner product computation at the core of conv and matmul operations [20]. All convolution and fully-connected layers except the first and last one are quantized. We adopt quantization-aware training and initialize quantized weights from FP models. + +# 5.2. Ablation studies on RCM loss + +Selection of $\lambda$ and formulas. There are three potential positions for margin in cosine-based softmax, like additive angle margin in ArcFace [8] (i.e., $\mathcal{L}_{\mathrm{A}}$ ), additive cosine margin in CosFace [46] and multiplicative angular margin in SphereFace [25]. We denote another two feasible formulas as + +$$ +\mathcal {L} _ {\mathrm {B}} = - \log \frac {e ^ {s \cdot (\cos (\theta_ {i , j} + \mathbb {1} \cdot m) - \mathbb {1} \cdot \lambda \theta_ {Q})}}{\sum e ^ {s \cdot (\cos (\theta_ {i , j} + \mathbb {1} \cdot m) - \mathbb {1} \cdot \lambda \theta_ {Q})}} +$$ + +and + +$$ +\mathcal {L} _ {\mathrm {C}} = - \log \frac {e ^ {s \cdot \cos ((1 \cdot \lambda \theta_ {Q} + 1) \theta_ {i , j} + 1 \cdot m)}}{\sum e ^ {s \cdot \cos ((1 \cdot \lambda \theta_ {Q} + 1) \theta_ {i , j} + 1 \cdot m)}}. +$$ + +In this part, we explore the effect of the scaling parameter $\lambda$ and the performance of different formulas. To this end, + +we train an FP ResNet18 on CASIA-WebFace. Then we quantize the resulting model into 4-bit using three different formulas with $\lambda$ varying from 1 to 7. Performance is evaluated on MegaFace and illustrated in Fig. 7a. We can see that the performance of $\mathcal{L}_{\mathrm{A}}$ outperforms the other two formulas slightly. For $\mathcal{L}_{\mathrm{A}}$ , the performance gets saturated at $\lambda = 5.0$ , thus we use $\mathcal{L}_{\mathrm{A}}$ with $\lambda = 5.0$ in the subsequent experiments of this study. + +![](images/1517d892bd69d380c08780062e22811e13ce14ab96177b276ed5c99249e50bf8.jpg) +(a) + +![](images/9e8202b45045051d4befbd0efdcbb110bbc2bcba026b5e86dd24fae35ba8ddbe.jpg) + +![](images/29bc52dc3b4c4a606e5ed740bb774707a1ee93cdfe64ef818eafb132de04f3fe.jpg) +(b) +(c) +Figure 7: Ablation studies on rotation consistent margin loss. (a) accuracy(%) of 4-bit ResNet18 with different formulas and various $\lambda$ on MegaFace. (b) change of individual error of $\mathcal{L}_A$ with different $\lambda$ during the training. (c) class errors of 4-bit ResNet18 trained by ArcFace, ArcFace+Mimic and $\mathcal{L}_A$ . The errors are in angle. + +Change of RCM during training. In this part, we will show the change of RCM $\theta_{Q}$ of $\mathcal{L}_A$ loss during training. Fig. 7b illustrates $\theta_{Q}$ of different $\lambda$ settings. As we can see, the margin gradually decreases as training, and the larger $\lambda$ brings stronger supervision, which leads to a smaller $\theta_{Q}$ . Whereas when the $\lambda$ increases to 5, the RCM becomes stable and hard to be further compressed. Meanwhile, the accuracy also reaches the inflection point, and the larger $\lambda$ would degrade the accuracy. It is due to that $\lambda$ balances the supervision of classification and minimizing individual error, excessively increasing $\lambda$ cannot consistently improve intra-class compactness but weakens the supervision of classification. + +Comparison of class errors. To investigate the resulting class errors, we train 4-bit ResNet18 using ArcFace, ArcFace+Mimic and $L_{A}$ , respectively. Directly supervised by ArcFace ignores the QEs and takes quantizers as general operators. Combining with mimic or knowledge distillation (KD) not only finetunes the models according to the classification loss but also pulls the features towards the original position by extra supervision from FP models. Empirical evidence [27] shows that mimicking the feature layer brings more improvements for FR than KD. Thus we use Arc- + +
lossSize of MegaFace Distractor
101102103104105106
FP98.1395.7592.1086.9680.7273.35
ArcFace97.7394.5290.2884.2976.3767.75
+Mimic97.9394.8890.6584.7877.3969.04
LA97.8595.3291.4686.3379.3771.57
+ +Face+Mimic instead of ArcFace+KD. The performance on MegaFace and resulting class errors are illustrated in Tab. 1 and Fig. 7c. Compared with ArcFace, ArcFace+Mimic results in smaller class errors, meanwhile, improves performance. Whereas, our approach achieves higher accuracy than ArcFace+Mimic with larger class errors. The experimental phenomenon supports our hypothesis that improving the accuracy of quantized FR models is not precisely equivalent to reducing all the QEs, and minimizing only individual errors can bring more improvement. + +# 5.3. Results on LFW and YTF + +LFW [17] is a standard face verification testing dataset in unconstrained conditions, and all images are collected from the website. It contains 13,233 face images from 5,749 identities with a total of 6,000 ground-truth matches. Half of the matches are positive, while the other half are negative ones. YTF [51] consists of 3,425 videos from 1,595 different people. All the videos are collected from YouTube. In this paper, evaluation results are reported strictly following the standard protocol of unrestricted with labeled outside data. + +We train ResNet18 on CASIA-WebFace dataset and report performance of 4-bit and 3-bit quantized models supervised by several accessible loss functions in Tab. 2. On LFW and YTF, the proposed RCM loss achieves $98.91\%$ and $94.98\%$ at 4-bit, and $98.73\%$ and $94.56\%$ at 3-bit. The results outperform all compared loss functions. + +Table 1: Identification accuracy (%) of rank-1 of 4-bit ResNet18 on the MegaFace dataset. “+Mimic” refers to ArcFace+Mimic. + +
MethodLFWYTF
4-bit3-bit4-bit3-bit
FP98.9394.97
SoftMax98.6098.2694.2893.49
12-Softmax [35]98.5597.8594.0193.51
CosFace [46]98.6697.8894.3693.28
CosFace+Mimic98.7698.1894.3793.53
ArcFace [8]98.6398.5594.6293.50
ArcFace+Mimic98.6898.4694.7693.95
LA98.9198.7394.9594.56
+ +Table 2: Verification accuracy $(\%)$ on the LFW and the YTF datasets. The model ResNet18 is trained on WebFace. + +
ModelMethodAccuracy(%)
4-bit3-bit
ResNet18FP93.71
Softmax82.4327.22
CosFace [46]87.0460.41
CosFace+Mimic87.7357.68
ArcFace [8]87.3167.83
ArcFace+Mimic87.7472.84
LA88.5674.34
MobileNetV2FP91.31
Softmax69.2124.11
12-Softmax [35]71.6847.5
CosFace [46]74.9957.00
CosFace+Mimic74.0559.44
ArcFace [8]77.7356.79
ArcFace+Mimic77.9059.59
LA80.1262.58
+ +![](images/29ea47bd313f79b3842f211a986743f0cc121f26af2ee6ce864ec45a9a756c50.jpg) +Figure 8: TPR on IJB-C benchmark with FPR varying from $10^{-1}$ to $10^{-5}$ . The model is 4-bit ResNet18 and trained on MS1MV1. + +# 5.4. Results on MegaFace + +The MegaFace dataset [21] is a very challenging large-scale testing benchmark. It contains 1M images from 690K different individuals as the gallery set and 100K photos of 530 unique individuals from FaceScrub [32] as the probe set. We follow the testing protocol of ArcFace [8]. All the models are trained on the MS1MV1 dataset. + +The rank-1 identification accuracies with 1M distractors are summarized in Tab. 3. Our RCM approach shows its superiority on both the ResNet18 and MobileNetV2 with a clear margin. For ResNet18, RCM achieves $88.56\%$ and $74.34\%$ on 4- and 3-bit and outperforms other losses. MobileNetV2 has excellent speed-accuracy trade-off and is hard to quantize, and RCM loss boosts the accuracy significantly. Whereas the gap with FP model still exists, which needs further investigations. + +# 5.5. Results on IJB-C + +The IJB-C dataset [28] contains about 3,500 identities, with a total of 31,334 still facial images and 117,542 unconstrained video frames. In the 1:1 verification, there are a total of 19,557 positive pairs and 15.6M negative pairs. + +We employ the MS1MV1 dataset as training data and report TPR of 4-bit ResNet18 in Fig. 8. Compared with other popular loss functions, our proposed RCM achieves state-of-the-art performance at different FPR. + +# 5.6. Compatibility with other quantization baselines + +The proposed RCM loss improves the performance of the low-bit model from the perspective of the discriminative essence of open-set tasks. It can be combined with previous methods to boost their performance further. Here, we re-implement the recent two state-of-the-art quantization methods Dorefa-Net [55] and DSQ [10] as quantization baselines and combine them with different loss functions. + +We report the evaluation results of 4-bit ResNet18 on MegaFace. As shown in Tab. 4, both Dorefa-Net and DSQ can improve the baseline of different loss functions, and combining with RCM achieves the best accuracy. It demonstrates our approach is compatible with different quantization methods and can further boost their performance. + +Table 3: Identification accuracy (\%) of rank-1 on MegaFace dataset. The size of distractor is 1M. + +
BasicMethodAccuracy(%)
Dorefa-Net [55]+CosFace87.11
+CosFace+Mimic90.59
+ArcFace88.27
+ArcFace+Mimic89.63
+LA91.55
DSQ [10]+CosFace87.07
+CosFace+Mimic88.98
+ArcFace87.79
+ArcFace+Mimic88.42
+LA89.46
+ +Table 4: Identification accuracy (\%) of rank-1 4-bit ResNet18 on the MegaFace dataset. The size of distractor is 1M and the FP models are trained on MS1MV1. + +# 6. Conclusion + +In this work, we investigate the effect of quantization errors on FR and propose rotation consistent margin loss for efficient low-bit FR training. Competitive results on several popular face benchmarks demonstrate the superiority and great potentials of our approach. It is hoped that our substantial explorations will inspire more researches on quantization problems for the open-set scenario. + +Acknowledgement. This work was supported in part by the National Natural Science Foundation of China under Grant Nos. U19B2034 and 61836014. + +# References + +[1] Ron Banner, Yury Nahshan, Elad Hoffer, and Daniel Soudry. Aciq: Analytical clipping for integer quantization of neural networks. arXiv preprint arXiv:1810.05723, 2018. +[2] R Banner, Y Nahshan, E Hoffer, and D Soudry. Post training 4-bit quantization of convolution networks for rapid-deployment. CoRR, abs/1810.05723, 1:2, 2018. +[3] Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5918-5926, 2017. +[4] Ken Chen, Yichao Wu, Haoyu Qin, Ding Liang, Xuebo Liu, and Junjie Yan. R3 adversarial network for cross model face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9868-9876, 2019. +[5] Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pages 3123-3131, 2015. +[6] Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained to + 1 or -1. arXiv preprint arXiv:1602.02830, 2016. +[7] deepglint. Face feature test/trillion pairs. http://trillionpairs deepglint.com/overview. +[8] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4690-4699, 2019. +[9] Jiong Gong, Haihao Shen, Guoming Zhang, Xiaoli Liu, Shane Li, Ge Jin, Niharika Maheshwari, Evarist Fomenko, and Eden Segal. Highly efficient 8-bit low precision inference of convolutional neural networks with intelcaffe. In Proceedings of the 1st on Reproducible Quality-Efficient Systems Tournament on Co-designing Pareto-efficient Deep Learning, page 2. ACM, 2018. +[10] Ruihao Gong, Xianglong Liu, Shenghu Jiang, Tianxiang Li, Peng Hu, Jiazhen Lin, Fengwei Yu, and Junjie Yan. Differentiable soft quantization: Bridging full-precision and low-bit neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 4852–4861, 2019. +[11] Manuel Gunther, Steve Cruz, Ethan M Rudd, and Terrance E Boult. Toward open-set face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 71-80, 2017. +[12] Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In European Conference on Computer Vision, pages 87–102. Springer, 2016. +[13] Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015. + +[14] 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. +[15] Lanqing He, Zhongdao Wang, Yali Li, and Shengjin Wang. Softmax dissection: Towards understanding intra-and interclas objective for embedding learning. arXiv preprint arXiv:1908.01281, 2019. +[16] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018. +[17] Gary B Huang, Marwan Mattar, Tamara Berg, and Eric Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. 2008. +[18] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Advances in neural information processing systems, pages 4107-4115, 2016. +[19] Benoit Jacob et al. gemmlowp: a small self-contained low-precision gemm library.(2017), 2017. +[20] Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2704-2713, 2018. +[21] Ira Kemelmacher-Shlizerman, Steven M Seitz, Daniel Miller, and Evan Brossard. The megaface benchmark: 1 million faces for recognition at scale. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4873-4882, 2016. +[22] Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016. +[23] Rundong Li, Feng Liang, Hongwei Qin, Yan Wang, Rui Fan, and Junjie Yan. Fully quantized network for object detection. In Proceedings of the IEEE International Conference on Computer Vision, 2019. +[24] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. +[25] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Spherface: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 212-220, 2017. +[26] Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In ICML, volume 2, page 7, 2016. +[27] Ping Luo, Zhenyao Zhu, Ziwei Liu, Xiaogang Wang, and Xiaou Tang. Face model compression by distilling knowledge from neurons. In Thirtieth AAAI Conference on Artificial Intelligence, 2016. +[28] Brianna Maze, Jocelyn Adams, James A Duncan, Nathan Kalka, Tim Miller, Charles Otto, Anil K Jain, W Tyler Niggel, Janet Anderson, Jordan Cheney, et al. Iarpa janus + +benchmark-c: Face dataset and protocol. In 2018 International Conference on Biometrics (ICB), pages 158-165. IEEE, 2018. +[29] Jeffrey L McKinstry, Steven K Esser, Rathinakumar Appuswamy, Deepika Bablani, John V Arthur, Izzet B Yildiz, and Dharmendra S Modha. Discovering low-precision networks close to full-precision networks for efficient embedded inference. arXiv preprint arXiv:1809.04191, 2018. +[30] Szymon Migacz. 8-bit inference with tensorsr. In GPU technology conference, volume 2, page 7, 2017. +[31] Asit Mishra and Debbie Marr. Apprentice: Using knowledge distillation techniques to improve low-precision network accuracy. arXiv preprint arXiv:1711.05852, 2017. +[32] Hong-Wei Ng and Stefan Winkler. A data-driven approach to cleaning large face datasets. In 2014 IEEE International Conference on Image Processing (ICIP), pages 343-347. IEEE, 2014. +[33] Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4004-4012, 2016. +[34] Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, et al. Deep face recognition. In bmvc, volume 1, page 6, 2015. +[35] Rajeev Ranjan, Carlos D Castillo, and Rama Chellappa. L2-constrained softmax loss for discriminative face verification. arXiv preprint arXiv:1703.09507, 2017. +[36] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pages 525-542. Springer, 2016. +[37] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition*, pages 4510-4520, 2018. +[38] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 815-823, 2015. +[39] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +[40] Kihyuk Sohn. Improved deep metric learning with multiclass n-pair loss objective. In Advances in Neural Information Processing Systems, pages 1857-1865, 2016. +[41] Yi Sun, Yuheng Chen, Xiaogang Wang, and Xiaou Tang. Deep learning face representation by joint identification-verification. In Advances in neural information processing systems, pages 1988–1996, 2014. +[42] Yi Sun, Xiaogang Wang, and Xiaou Tang. Deeply learned face representations are sparse, selective, and robust. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2892-2900, 2015. +[43] Yaniv Taigman, Ming Yang, Marc'Aurelio Ranzato, and Lior Wolf. Deepface: Closing the gap to human-level performance in face verification. In Proceedings of the IEEE con + +ference on computer vision and pattern recognition, pages 1701-1708, 2014. +[44] Frederick Tung and Greg Mori. Clip-q: Deep network compression learning by in-parallel pruning-quantization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7873–7882, 2018. +[45] Feng Wang, Jian Cheng, Weiyang Liu, and Hajun Liu. Additive margin softmax for face verification. IEEE Signal Processing Letters, 25(7):926-930, 2018. +[46] Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5265-5274, 2018. +[47] Jian Wang, Feng Zhou, Shilei Wen, Xiao Liu, and Yuanqing Lin. Deep metric learning with angular loss. In Proceedings of the IEEE International Conference on Computer Vision, pages 2593-2601, 2017. +[48] Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization with mixed precision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8612-8620, 2019. +[49] Peisong Wang, Qinghao Hu, Yifan Zhang, Chunjie Zhang, Yang Liu, and Jian Cheng. Two-step quantization for low-bit neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4376-4384, 2018. +[50] Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In European conference on computer vision, pages 499-515. Springer, 2016. +[51] Lior Wolf, Tal Hassner, and Itay Maoz. Face recognition in unconstrained videos with matched background similarity. IEEE, 2011. +[52] Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z Li. Learning face representation from scratch. arXiv preprint arXiv:1411.7923, 2014. +[53] Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 365-382, 2018. +[54] Xiao Zhang, Rui Zhao, Yu Qiao, Xiaogang Wang, and Hongsheng Li. Adacos: Adaptively scaling cosine logits for effectively learning deep face representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10823-10832, 2019. +[55] Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016. +[56] Shu-Chang Zhou, Yu-Zhi Wang, He Wen, Qin-Yao He, and Yu-Heng Zou. Balanced quantization: An effective and efficient approach to quantized neural networks. Journal of Computer Science and Technology, 32(4):667-682, 2017. + +[57] Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016. +[58] Xiaotian Zhu, Wengang Zhou, and Houqiang Li. Adaptive layerwise quantization for deep neural network compression. In 2018 IEEE International Conference on Multimedia and Expo (ICME), pages 1-6. IEEE, 2018. \ No newline at end of file diff --git a/rotationconsistentmarginlossforefficientlowbitfacerecognition/images.zip b/rotationconsistentmarginlossforefficientlowbitfacerecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4539d735edd0a4235a9b4d767af1d6a400f99d4e --- /dev/null +++ b/rotationconsistentmarginlossforefficientlowbitfacerecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:654e874d8bb36558685ae285f56e0425f9ffb9c4ac77b400c81d5608b7243148 +size 467790 diff --git a/rotationconsistentmarginlossforefficientlowbitfacerecognition/layout.json b/rotationconsistentmarginlossforefficientlowbitfacerecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d444e24c75dabc91ef93c11ab9a8915abd533712 --- /dev/null +++ b/rotationconsistentmarginlossforefficientlowbitfacerecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:523951593c41bcef5aafa4dad4cc186f688951b8ba86d11e06e7a8de7fdbc047 +size 488321 diff --git a/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_content_list.json b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..526a38445b0fab40e6bfb39a43771b131a2a4de7 --- /dev/null +++ b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a132939b6e9959871a153612a638438b82bbb8978c255cc1d8d701b2a14a01a +size 77339 diff --git a/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_model.json b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8499937691cc5a0f2854d61505bcb67ff8bd9f2d --- /dev/null +++ b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fce13e7be2b174c028a3ed139bdbc728a85dc724f791bc658c56bd1ac0fdde96 +size 90697 diff --git a/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_origin.pdf b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2c6f8ad1d9409718cd3370892f6ed5ac16296e77 --- /dev/null +++ b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/83a61027-dd28-4850-b7b0-78397344c69e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6f3fb8316b4f6a8d570fe79ea26d93af8c8fca02cd710c62d7dfddd3013f0d0 +size 1004038 diff --git a/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/full.md b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8335a11d37179c566524590895e3f8616677a5c2 --- /dev/null +++ b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/full.md @@ -0,0 +1,281 @@ +# Rotation Equivariant Graph Convolutional Network for Spherical Image Classification + +Qin Yang $^{1}$ , Chenglin Li $^{1}$ , Wenrui Dai $^{1}$ , Junni Zou $^{1}$ , Guo-Jun Qi $^{2}$ , Hongkai Xiong $^{1}$ $^{1}$ Shanghai Jiao Tong University, $^{2}$ Futurewei Technologies + +{yangqin, lcl1985, daiwenrui, zoujunni, xionghongkai}@sjtu.edu.cn, guojunq@gmail.com + +# Abstract + +Convolutional neural networks (CNNs) designed for low-dimensional regular grids will unfortunately lead to non-optimal solutions for analyzing spherical images, due to their different geometrical properties from planar images. In this paper, we generalize the grid-based CNNs to a non-Euclidean space by taking into account the geometry of spherical surfaces and propose a Spherical Graph Convolutional Network (SGCN) to encode rotation equivariant representations. Specifically, we propose a spherical graph construction criterion showing that a graph needs to be regular by evenly covering the spherical surfaces in order to design a rotation equivariant graph convolutional layer. For the practical case where the perfectly regular graph does not exist, we design two quantitative measures to evaluate the degree of irregularity for a spherical graph. The Geodesic ICOshedral Pixelation (GICOPix) is adopted to construct spherical graphs with the minimum degree of irregularity compared to the current popular pixelation schemes. In addition, we design a hierarchical pooling layer to keep the rotation-equivariance, followed by a transition layer to enforce the invariance to the rotations for spherical image classification. We evaluate the proposed graph convolutional layers with different pixelations schemes in terms of equivariance errors. We also assess the effectiveness of the proposed $\mathrm{SGCN}^1$ in fulfilling rotation-invariance by the invariance error of the transition layers and recognizing the spherical images and 3D objects. + +# 1. Introduction + +Omnidirectional cameras generate spherical images with 360-degree view of the scenes that enable an immersive experience for users by freely adjusting their viewing orientations. Recently, omnidirectional cameras have become + +popular in virtual reality (VR) and augmented reality (AR) systems for applications ranging from robots [23, 27] to autonomous cars [15, 16], which results in an increasing demand for the analysis of spherical images. Convolutional neural networks (CNNs) have achieved significant improvement in analysis tasks related to planar images, e.g., image recognition [10], object detection [8], and image segmentation [9]. However, it is still challenging to generalize CNNs to analyzing spherical images defined on the non-Euclidean spheres, as distortions may be incurred when spherical images are projected onto a flat Euclidean surface to accommodate the grid-based architectures in CNNs [3]. + +CNNs commonly adapt to the non-Euclidean spherical images in two different ways. The first approach projects the spherical images into the planar format that can be processed directly by CNNs. Various projection methods have been studied, including the equirectangular projection (ERP) and the cube map projection [24], which lead to the inevitable projection distortions. For ERP, filter kernels are further designed for CNNs to compensate for the projection distortion [5, 26, 32]. [26] proposed to learn different kernels with variable size for each row in the projected images, however, the model size increases dramatically with the growth of image resolution. In [5, 32], the sampling location of filter kernel is changed to adapt to the distortion level. Without the guidance of rotation-equivariance, although model parameters could be reduced by sharing the kernels across all pixels, the model performance declines inevitably. + +The other approaches [3, 7] extend CNNs to non-Euclidean domains to avoid the projection distortions. Although CNNs have strong capability to exploit the local translation equivariance and some works seek to capture various transformation equivariant representations of regular 2D images [20, 21, 30], they do not adapt to the 3D rotation of spherical images properly. Therefore, it is important to explore rotation-equivariance in spherical image analysis. [3] and [7] develop spherical CNNs by introducing the rotation-equivariant spherical cross-correlation in the spectral domain. However, Fourier transform is required for the + +spherical correlation in each step, leading to high computational cost and significant memory overhead. [17] proposes a graph convolutional neural network for cosmological data that often come as spherical maps tailored by the Hierarchical Equal Area isoLatitude Pixelation (HEALPix). However, the irregular feature map in the HEALPix scheme still does not maintain the rotation-equivariance. + +As an almost uniform discretization of the sphere, icosahedron [1] has been adopted to represent the spherical domain [4, 11, 14, 29]. In [4, 29], the spherical signal is projected on the icosahedron mesh with 20 basic planar regions, which is further analyzed with the gauge-equivariant and orientation-aware CNNs. The distortion is however still large, and discontinuities between the basic planar regions need to be handled by carefully designed schemes such as the gauge transformation on the features [4] and padding [29]. Based on geodesic icosahedron with smaller distortion, [14] designs the convolution and pooling kernels of CNNs and [11] presents parameterized differential operators on the unstructured grids. Although the convolution kernel is flipped by 180 degrees when applied to the next adjacent triangle [14], the convolution kernels in [11, 14] are still anisotropy and thus not rotation equivariant. + +In this paper, we propose a Spherical Graph Convolutional Network (SGCN) to encode rotation-equivariance for spherical image analysis. Specially, we develop a graph convolutional layer through exploring the isometric transformation equivariance of the graph Chebyshev polynomial filters which is isotropy, a hierarchical pooling layer to exploit the multi-scale resolutions of the spherical images and keep the rotation-equivariance, and a transition layer to calculate the rotation-invariant statistics across multiple feature maps of the hierarchical pooling layer. + +To enforce rotation-equivariance in the proposed polynomial graph convolutional layer, we propose a spherical graph construction criterion based on regularity, and show that given the number of vertices, a regular graph (i.e., vertices distribute uniformly on the surface of the spherical image) is equivariant to more rotations than an irregular one. For the practical case where the perfectly regular graph does not exist, we design two quantitative measures to evaluate the degree of irregularity for a spherical graph, and empirically show that a graph construction scheme with a lower degree of irregularity will result in smaller equivariance errors of the graph convolutional layers. Further the Geodesic ICOsahedral Pixelation (GICOPix) scheme is adopted to construct the spherical graph, which empirically demonstrates to achieve a lower degree of irregularity with the least weight variance for edges and least degree variance for vertices. + +To demonstrate the effectiveness of the proposed criterion, we evaluate the equivariance errors of the graph convolutional layers by different graph construction schemes. We + +also assess the invariance errors of the proposed transition layers for the ability of capturing rotation-invariance and recognizing the spherical images. We further employ the proposed SGCN in spherical image classification, demonstrating that SGCN outperforms the state-of-the-art models on the Spherical MNIST (S-MNIST), Spherical CIFAR-10 (S-CIFAR-10) and achieve comparable performance to the 3D models on the ModelNet40 datasets in terms of rotation invariance classification accuracy. + +# 2. Preliminaries + +We represent a spherical image as an undirected and connected graph $G = (\mathcal{V}, \mathcal{E}, A)$ , where $\mathcal{V}$ is a set of $|\mathcal{V}| = N$ vertices, $\mathcal{E}$ is a set of edges, and $A$ is a weighted adjacency matrix with each element $a_{ij} = w(v_i, v_j)$ representing the connection weight between two vertices $v_i$ and $v_j$ . The weight $a_{ij}$ is zero if vertices $v_i$ and $v_j$ are not connected. The normalized graph Laplacian is then defined as $L = I - D^{-1/2} AD^{-1/2}$ , where $D \in \mathbb{R}^{N \times N}$ is a diagonal degree matrix with $D_{ii} = \sum_{j=1}^{N} a_{ij}$ , and $I$ is the identity matrix. + +By recursively computing a Chebyshev polynomial to approximate the convolution kernel [6], the spectral convolution with a spherical signal $x$ can be written as + +$$ +y = \sum_ {k = 0} ^ {K - 1} \theta_ {k} T _ {k} (\tilde {L}) x, \tag {1} +$$ + +where $\tilde{L} = 2L / \lambda_{max} - I$ , $\lambda_{max}$ is the largest eigenvalue of $L$ , and $\theta_{k}$ denotes the Chebyshev polynomial coefficient which is a learnable parameter. Consequently, the Chebyshev polynomial $T_{k}(\tilde{L}) \in \mathbb{R}^{N \times N}$ can be recursively computed through $T_{k}(\tilde{L}) = 2\tilde{L} T_{k-1}(\tilde{L}) - T_{k-2}(\tilde{L})$ with $T_{0} = I$ and $T_{1} = \tilde{L}$ . The spectral convolution with a $K$ -th order polynomial is $K$ -localized, i.e., the response of a vertex to the polynomial filter only depends on all the vertex values and edge weights on a path of length $k < K$ . + +It has been shown that a polynomial filter is equivariant to graph isometric transformations [13]. In the following, we give the definition of the graph isometric transformation and the graph isometric transformation equivariance. + +Definition 1. Graph isometric transformation [13]. A graph isometric transformation $g$ is a bijective mapping $g: \mathcal{V} \to \mathcal{V}$ that preserves the distance between two adjacent vertices on the graph. The corresponding transformation operator $L_g$ makes a permutation of signal $x$ by preserving their neighbourhoods. It can be formally depicted as + +$$ +\forall v _ {k} \in \mathcal {V}, \exists ! v _ {j} \in \mathcal {V}: \left[ L _ {g} x \right] \left(v _ {k}\right) = x \left(v _ {j}\right), \tag {2} +$$ + +where $L_{g}x$ is the transformed signal of $x$ , and $\exists!$ indicates that there exists and only exists a vertex $v_{j}$ corresponding to $v_{k}$ . + +![](images/28aebe7769def2e98befb0d84cece0b978647e0d32a889bd2f853d066ecb45c4.jpg) +Figure 1. The proposed SGCN architecture with a two-level graph construction, which comprises two stacks of graph convolutional layer (GConv) and hierarchical pooling layer (HPool) followed by a transition layer (Tran) and a fully-connected layer (FC). The input spherical image is represented as a level-2 graph $G_{2}^{*}$ based on GICOPix to achieve the rotation-equivariance. $[\mu_0,\sigma_0,\dots,\mu_K,\sigma_K]$ is the multi-scale statistics across the feature maps. The output is the distribution over the classes of the datasets. + +Definition 2. Graph isometric transformation equivariance. A graph convolutional layer is equivariant to a graph isometric transformation $g$ , if transforming the input signal by the graph isometric transformation operator $L_{g}$ and then feeding it through the graph convolution layer results in the same response as feeding the original signal through the graph convolutional layer followed by a corresponding transformation of the resultant feature maps, i.e., + +$$ +[ \Phi (L _ {g} x) ] (v) = [ L _ {g} (\Phi (x)) ] (v), \tag {3} +$$ + +where $\Phi$ represents the graph convolutional layer, and $x$ is the input spherical signal. + +We consider a unit sphere with the radius $r$ set to 1 in this paper. Any point $v$ on the sphere is then uniquely defined by its longitude $\theta$ and latitude $\phi$ , with $-\pi \leq \theta \leq \pi$ and $-\frac{\pi}{2} \leq \phi \leq \frac{\pi}{2}$ . + +Definition 3. 3D rotation group. The spherical 3D rotation group is denoted by $SO(3)$ , which is continuous. A rotation $R \in SO(3)$ is a rigid transformation preserving the Euclidean distance and orientation, which can be represented by a $3 \times 3$ matrix. + +Since a vertex $v$ on the rotated graph corresponds to the vertex $R^{-1}v$ on the original graph, we have + +$$ +[ L _ {R} x ] (v) = x \left(R ^ {- 1} v\right), \tag {4} +$$ + +where $L_{R}$ denotes the rotation transformation corresponding to $R$ . In this paper, we will consider a rotation subgroup $\mathcal{R}$ of $SO(3)$ with a finite number of elements. If a graph convolution layer is equivariant to all the rotations $R \in \mathcal{R}$ , i.e., $[ \Phi(L_{R}x) ](v) = [L_{R} \Phi(x)](v)$ , it is then equivariant to the rotation group $\mathcal{R}$ . + +# 3. Rotation-Equivariant Spherical GCN + +Fig. 1 depicts the proposed Spherical Graph Convolutional Network (SGCN) that encodes the graph rotation-equivalence for spherical image classification. + +# 3.1. Regularity Constrained Graph Construction + +As proved in [13], the polynomial filter in a graph convolution layer is equivariant to the graph isometric transformation. Therefore, the critical criterion here is to construct the graph with a rotation group that contains the largest possible number of graph isometric transformations. In the following, we show from two simple examples that given the number of vertices, such a graph can be constructed by ensuring its regularity. + +Definition 4. Graph regularity. A spherical graph is regular if its vertices are distributed uniformly on the spherical surface. In detail, two principles are considered to define graph regularity: i) the distance between any two adjacent vertices is identical, and ii) all the vertices share the same number of neighbors. + +Example 1: Regular graph with six vertices. In Fig. 2(a), we illustrate an example of regular spherical graph with 6 vertices, which is constructed based on a spherical octahedron with a rotation group $\mathcal{R}_o$ of order 24. Each rotation $R$ in the octahedral rotation group $\mathcal{R}_o$ is an invertible mapping of vertices in the three-dimensional Euclidean space that preserves all the relevant structure of the spherical octahedron. For simplicity, we consider a 5-point image pattern $x$ , where a vertex $v_{t0}$ is connected with vertices $v_{t1} \sim v_{t4}$ . After an exemplary rotation $R \in \mathcal{R}_o$ , the image pattern $x$ is transformed into $x_R = LRx$ . As illustrated in Fig. 2(a), for all the vertices $v_{r0} \sim v_{r4}$ in the rotated image $x_R$ , there exists and only exists a set of vertices $v_{t0} \sim v_{t4}$ in the original image $x$ satisfying $x_R(v_{rn}) = x(v_{tn}), \forall n = 0,1,\ldots,4$ . The illustrated rotation $R$ is therefore a graph isometric transformation. It can be further verified that all the 24 rotations in the octahedral rotation group $\mathcal{R}_o$ are graph isometric transformations. + +Example 2: Irregular graph with six vertices. On the contrary, if the graph is constructed irregularly, its rotation group $\mathcal{R}'$ will have fewer elements than the octahedral rotation group $\mathcal{R}_o$ . According to the definition, an irregular spherical graph may have different distances be + +![](images/5662aa74e664e299eae04382a53c94eb8ded5ce43ff592f484d5f6238f8adf06.jpg) +Figure 2. Regular and irregular spherical graphs with six vertices, showing how graph regularity affects rotation-equivariance. + +tween adjacent vertices or different number of neighbors for the vertices. In Fig. 2(b), we take an irregular graph with different distances between adjacent vertices for example. Given an arbitrary vertex $v_{r0}'$ in the rotated image $x_R'$ , there should be a vertex $v_{t0}'$ in the original image $x'$ that satisfies $x_R'(v_{r0}') = x'(v_{t0}')$ . Then, since the distance between two adjacent vertices differs from each other, for the neighbor vertices $v_{r1}' \sim v_{r4}'$ of the vertex $v_{r0}'$ in $x_R$ , there will no longer exist vertices $v_{t1}' \sim v_{t4}'$ in $x'$ satisfying $x_R'(v_{rn}') = x'(v_{tn}')$ , $\forall n = 1, 2, \ldots, 4$ . + +The above two examples conclude that the vertices in a regular graph can be rotated exactly to all the other vertices to satisfy the definition of graph isometric transformation, while the vertices in an irregular graph fail to do so. In other words, for a given number of vertices, fewer graph isometric transformations will be contained in the rotation group of an irregular graph than a regular one. To accurately represent a high-resolution spherical image, the number of vertices $N$ should be sufficiently large. A regular spherical graph constructed from the spherical polyhedron with only tens of vertices is far from enough. For a large number of finite vertices (e.g., thousands of vertices), however, it is impossible to construct a perfectly regular spherical graph. Therefore we design two quantitative measures to evaluate the degree of irregularity for a spherical graph: the variance of edge weights $V_{1}$ and the variance of neighbor numbers $V_{2}$ , as + +$$ +V _ {1} = \frac {1}{E} \sum_ {i = 1} ^ {E} \left(w _ {i} - \mu_ {w}\right) ^ {2}, V _ {2} = \frac {1}{N} \sum_ {i = 1} ^ {N} \left[ n \left(v _ {i}\right) - \mu_ {n} \right] ^ {2}, \tag {5} +$$ + +where $E = |\mathcal{E}|$ is the number of edges, $w_{i}$ is the weight for the $i$ -th edge, $\mu_w$ is the mean value of the edge weights; while $N = |\mathcal{V}|$ is the number of the vertices, $n(v_i)$ is the number of neighbors for each vertex $v_{i}$ , and $\mu_{n}$ is the mean value of neighbor numbers. According to the graph regularity definition, we have $V_{1} = V_{2} = 0$ if the graph is regularly constructed. For irregular graphs, these two irregularity measures become larger than zero, and reveal the degree of irregularity of the constructed graph, which in turn determine the number of graph isometric transformations contained in the rotation group. Therefore, smaller values of $V_{1}$ and $V_{s}$ are preferred in the spherical graph construction to preserve a higher degree of rotation equivariance of + +a graph convolutional layer. + +# 3.2. Rotation-Equivariant Convolutional Layer + +To reduce the degree of graph irregularity, we construct in this paper the spherical graph based on the Geodesic ICOshedral Pixelation (GICOPix). Compared with other popular pixelation schemes, such a graph is isotropic to a large extent, where the cells are minimally distorted and almost equilateral. A fine-grained binary division can even further increase the resolution of the resultant graph. As will be seen in the experiments, GICOPix can outperform the other pixelations schemes in terms of irregularity measures, equivariance errors and invariance errors. + +With GICOPix, the graph is constructed by repeatedly partitioning each equilateral triangle of a simpler geodesic icosahedron into four equilateral triangles, and then projecting the new vertices onto the sphere. All the vertices of the geodesic icosahedron become the graph vertices. Each vertex has six adjacent vertices except the twelve vertices of the original icosahedron that have five neighbors. We define the spherical graph constructed based on the original icosahedron as $G_0^*$ with $N = 12$ vertices, and denote $l$ as the subdivision level, i.e., the number of subdivision operation on the original icosahedron. Then, the graph constructed based on the first level ( $l = 1$ ) geodesic icosahedron is $G_1^*$ with $N = 42$ vertices. By induction, the graph based on the $l$ -th level geodesic icosahedron becomes $G_l^*$ with $N = 10 \times 2^{2l} + 2$ vertices. We show the constructed graph of GICOPix at levels 0, 2, 4 in bottom row of Fig. 4. + +The original icosahedron has a symmetry rotation group called icosahedral rotation group $\mathcal{R}_i$ of order 60, which is a subgroup of $SO(3)$ . The subdivision of each equilateral triangle is performed in the same fashion. Therefore, every rotation in $\mathcal{R}_i$ transforms a spherical graph $G_{l}$ to itself and preserves all the relevant structure of that spherical graph, which is therefore graph isometric. Since a Chebyshev polynomial filter is equivariant to the graph isometric transformation [13], the graph convolutional layer is thus equivariant to the icosahedral rotation group $\mathcal{R}_i$ . In this way, we construct a rotation-equivariant graph convolutional layer. + +# 3.3. Rotation-Equivariant Pooling Layer + +Multi-scale features with hierarchical representations of graphs need to be considered when generalizing CNNs to graphs. For this purpose, we propose a novel graphcoarsening scheme for the proposed pixelation process. The proposed pooling operator needs to be equivariant to the rotation, which is important for constructing the rotation-invariant classification architecture. + +Specifically, we coarsen the $l$ -th level spherical graph into the $(l - 1)$ -th level by maintaining the vertices of graph $G_{l - 1}^{*}$ , as illustrated in Fig. 3. We keep the hierarchical structure of the spherical graph without changing the under + +![](images/4a24aa76e0ccc78aef95d2b0f170e4dcfae253b60e35c7a4b469682bffb9e592.jpg) +Figure 3. Illustration of the proposed rotation-equivariant pooling operator. + +lying rotation group. Then we show that this can result in a rotation-equivariant pooling. Let us define $\mathcal{V}_l$ as the set of vertices of the $l$ -th level spherical graph. Given a rotation $R$ applied to $l$ -th level spherical signal, we have $[L_{R}x](v_{l}) = x(R^{-1}v_{l}), \forall v_{l} \in \mathcal{V}_{l}$ . The pooling layer $P$ keeps a coarser spherical signal as $P(x)(v_{l-1}) = x(v_{l-1}), \forall v_{l-1} \in \mathcal{V}_{l-1}$ . Rotating the $l$ -th level spherical signal and then feeding it through the pooling layer results in $[P(L_{R}x)](v_{l-1}) = x((R^{-1}v)_{l-1}) = x(R^{-1}(v_{l-1}))$ , $\forall v_{l-1} \in \mathcal{V}_{l-1}$ . And feeding the $l$ -th level spherical signal through the pooling layer followed by rotating the resultant feature maps gives $[L_{R}P(x)](v_{l-1}) = x(R^{-1}(v_{l-1}))$ , $\forall v_{l-1} \in \mathcal{V}_{l-1}$ . Thus, $[P(L_{R}x)](v_{l-1}) = [L_{R}P(x)](v_{l-1}), \forall v_{l-1} \in \mathcal{V}_{l-1}$ , i.e., the pooling operation is equivariant to the rotation. Since the proposed convolutional layers are rotation equivariant at different levels, the stacks of the graph convolutional layers and the pooling layers also maintain rotation-equivariance. + +In more detail, for all the feature maps $F_{i}^{h}, \forall i = 1,2,\dots,K_{h}$ of the $h$ -th graph convolutional layer, we perform the same pooling operation. Assume that the input spherical graph is at level $l_{0}$ . The $h$ -th feature map is a spherical graph at level $l_{0} - h$ . For the graph pooling layer following the $h$ -th graph convolutional layer, we keep all the vertices that belong to the spherical graph at the next level $l_{0} - h - 1$ , and the values on them are preserved. + +# 3.4. Rotation-Invariant Transition Layer + +By stacking graph convolutional layers and hierarchically pooling their results, we can fulfill the rotation-equivariance. After that, however, we would prefer to enforce the rotation invariance to performing classification tasks. In conventional CNNs, a stack of convolutional and pooling layers are followed by the fully-connected layers. However, the fully-connected layers are still spatial sensitive and not invariant to different rotations. Thus, a transition layer is required to extract the rotation-invariant features before the fully-connected layers. + +To enforce rotation-invariance, a computationally efficient method [13] is used to perform gradient computation and back propagation. Specifically, we compute a set of graph-convolved signals $t_k = T_k(\tilde{L})x$ using Chebyshev polynomials $T_k(\tilde{L})$ of different order $k$ with $k = 0,1,\dots,K$ for an input signal $x$ . The resultant signals $t_k, k = 0,1,\dots,K$ correspond to the responses on multi-scale resolutions, all of which are equivariant to the + +rotation-equivariance. Then, we collect the mean $\mu_{k}$ and variance $\sigma_{k}$ on each convolved feature map $t_k$ across the vertices of the spherical graph, and output a concatenated feature vector $[\mu_0,\sigma_0,\mu_1,\sigma_1,\dots,\mu_K,\sigma_K]$ . The resultant features are invariant to the rotation since they are spatially agnostic to the responses of vertices in the spherical graph. + +# 4. Experiments + +In this section, we compare the equivariance errors of graph convolutional layers and the invariance errors of transition layers achieved by the proposed SGCN with the three pixelation schemes under various degrees of graph irregularity. We also evaluate the effectiveness of the proposed SGCN and compare it with the state-of-the-art methods in the spherical image classification tasks on the S-MNIST dataset and the S-CIFAR-10 dataset. To show the capability of the SGCN for real problems, we further demonstrate the performance comparison of 3D object classification tasks on ModelNet40 dataset. In addition, we conduct ablation studies on the roles of the hierarchical pooling layer and transition layer. + +# 4.1. Degree of Irregularity + +We compare the proposed GICOPix with the two other popular pixelation schemes for the degree of graph irregularity, i.e., the Generalized Spiral Set Pixelation (GSSPix) and the Hierarchical Equal Area isoLatitude Pixelation (HEALPix), in terms of the proposed two measures. + +The GSSPix is an explicit construction of almost uniformly distributed points on a sphere [22]. For $N$ points, the set cut the sphere with $N$ horizontal planes with each latitude containing one point and the successive points having approximately the same distances. The HEALPix is commonly used for cosmological data with the properties that each pixel covers the same surface area as every other pixel. And 24 pixels at the corner of the rhombus connecting two rhombus of the base rhombic dodecahedron only have seven neighboring pixels. + +We illustrate the graphs constructed based on the three pixelation schemes in Fig. 4, where the proposed GICOPix scheme results in a more regular spherical graph. We also calculate the weight variance $V_{1}$ and degree variance $V_{2}$ of the spherical graphs at three different levels $L = 0,2,4$ . As shown in Table 1, the spherical graph based on the proposed GICOPix scheme has the smallest variance at all the levels. Especially, for the weight variance $V_{1}$ , it is smaller with one order of magnitude, which suggests that the proposed GICOPix-based spherical graph is the most regular one. + +# 4.2. Equivariance Error + +To assess the proposed criterion of graph construction, we measure the equivariance error for the first spherical convolutional layer of the three implementations of the + +![](images/9f73150b2bb2f6e01ccadf9c3ecdcb7b97b91757d746e95ff5e98418dd77c922.jpg) +Figure 4. The spherical graph of level $L = 0,2,4$ with the three different pixelation schemes, i.e., GSSPix, HEALPix and the proposed GICOPix. + +Table 1. Quantitative measurement of the degree of irregularity with the three different pixelation schemes. $v_{1}$ and $v_{2}$ are the variances of edge weights and vertex degrees, respectively. + +
SchemeLevel# of verticesV1(1e-2)V2(1e-1)
GSSPix0122.8672.500
21623.1836.327
425622.5144.800
HEALPix0121.0770
21921.2961.094
430721.4650.078
GICOPix01200
21620.1490.686
425620.1540.047
+ +SGCN with three different graph construction schemes, which are denoted as the GICOPix-SGCN, GSSPix-SGCN, and HEALPix-SGCN. Their pooling layers are slightly different from each other since they depend on different pixelation schemes. Following the work of [3], we define the equivariance error as + +$$ +\Delta = \frac {1}{n} \sum_ {i = 1} ^ {n} \operatorname {s t d} \left(L _ {R _ {i}} \Phi \left(x _ {i}\right) - \Phi \left(L _ {R _ {i}} x _ {i}\right)\right) / \operatorname {s t d} \left(\Phi \left(x _ {i}\right)\right). \tag {6} +$$ + +We sample $n = 1000$ spherical images $x_{i}, i = 1,2,\dots,n$ with random 3D rotations $R_{i}$ . Feeding each spherical image through the first graph convolutional layer results in 32 feature maps. By performing a graph isometric rotation on a completely regular graph, the equivariance error is expected to be zero. However, the constructed spherical graph is not ideally regular with random rotations from the continuous 3D rotation group $SO(3)$ . As shown in Table 2, the proposed GICOPix-SGCN has the smallest equivariance error, and the SGCN based on other pixelation schemes has a larger equivariance error with higher graph irregularity. This indicates that the proposed principles are effective for modeling + +Table 2. Equivariance error of the first spherical graph convolutional layer with the three pixelation schemes. The SGCN based on GICOPix has the smallest equivariance error. + +
SchemeGSSPixHEALPixGICOPix
Error0.9420.4340.385
+ +![](images/6795c4d7046dd69911ff78b5c9b06fe2965a91843b860927c13f8403ca72ce52.jpg) +Figure 5. Illustration of the invariance error of the SGCN with the three different pixelation schemes, where the numbers besides the colorbar are the normalized Euclidean distances indicating the degree of dissimilarity of different features. + +![](images/cdb672336f8b7c90e6e5f18364606f6665140971dfce2e0d655c4093f908ace8.jpg) + +![](images/b6fc0a68b78e812834cb0a5a3411b6787e74fb290a69518a8e858970b580de96.jpg) + +the rotation-equivariance. + +# 4.3. Invariance Error + +We evaluate the invariance error of the transition layer to assess the ability of the proposed SGCN capturing the rotation-invariance. Specially, we select three different spherical images from the S-MNIST dataset, i.e., $0^{\prime}$ , $2^{\prime}$ , and $7^{\prime}$ , and project each image in nine different positions $\theta \in \{-1/8, 0, 1/8\}, \phi \in \{0, 1/8, 1/4\}$ , totally yielding 27 spherical images. More details of spherical images creation will be introduced in the following section. By feeding these images into the SGCN, we obtain the features of the transition layer and evaluate the pairwise Euclidean distances in a $[27 \times 27]$ distance matrix. Ideally, the feature maps of different positions for the same spherical image should be identical, which means the three $[9 \times 9]$ diagonal sub-matrices of the $[27 \times 27]$ distance matrix should be zero (i.e., in blue in Fig. 5). + +As illustrated in Fig. 5, the GICOPix-SGCN has more similar feature maps for different positions of the same spherical image than the GSSPix-SGCN and HEALPix-SGCN. This suggests the SGCN has smaller invariance error and thus can encode the rotation-equivariance and fulfill rotation-invariance better with a more regular pixelation scheme. + +# 4.4. S-MNIST Classification + +Dataset. The S-MNIST dataset is created by placing the digits on a plane tangent to the sphere at point $(\theta, \phi)$ and projecting them on the spherical surfaces via the gnomonic projection [12, 5]. To evaluate the generalization performance of the proposed SGCN on the rotated images, we create two instances of this dataset: the non-rotated (NR) dataset and the rotated (R) ones. For the NR dataset, the tangent position is chosen randomly from a uniform distribution of spherical coordinates with the longitude $\theta \in$ + +![](images/447b001d09c9300392f6fea5640f18a35ee9aebce47c1704161b3c9ed294f23e.jpg) +Figure 6. ERP format examples in the S-MNIST dataset and S-CIFAR-10 dataset with $\phi = \{0, \frac{\pi}{3}, \frac{\pi}{6}, \frac{\pi}{2}\}$ . The distortion of the ERP format with $\phi = \frac{\pi}{2}$ is the largest. + +$\{-\frac{\pi}{2}, \frac{\pi}{2}\}$ , the latitude $\phi \in \{-\frac{\pi}{4}, \frac{\pi}{4}\}$ . For the R dataset, $\theta \in \{-\pi, \pi\}$ , $\phi \in \{-\frac{\pi}{2}, \frac{\pi}{2}\}$ . We show the ERP of a spherical image from the S-MNIST dataset with $\phi = 0, \frac{\pi}{3}, \frac{\pi}{6}, \frac{\pi}{2}$ in Fig. 6. + +Experiment setup. We benchmark our results against the S2CNNs [3], the GCNNs [12], the PDOs [11] and the SphereNet [5]. Except that the PDOs [11] have one Mesh-conv block, two ResBlocks, and an average pool layer and the transition layer of the SGCN has Chebyshev polynomials of the highest order 5, the architectures of all the models are the same. The network consists of two stacks of convolutional and pooling layers, followed by a fully-connected layer of ten neurons. The first stack has 32 filters, while the second has 64 filters. All the convolutional layer is followed by the ReLU activation. The order of the polynomial filter for the graph convolutional layer is set to 25. We input spherical signals at the level-4 resolution with 2562 pixels for GSSPix-SGCN and GICOPix-SGCN, 3072 pixels for HEALPix-SGCN. We train the models by the momentum optimizer with momentum 0.9 for 50 epochs with batch size 10. To avoid the overfitting, the batch normalization, weight decay rate $5e - 4$ and dropout 0.9 are adopted. The initial learning rate is 0.02 and reduced to 0.002 after 33 epochs. + +Result. The classification performances of different models on S-MNIST are compared in Table 3. We train each model on the rotated dataset and test on the rotated dataset as well (R/R). The GICOPix-SGCN outperform all the baselines except the Spherenet [5] based on the conventional CNNs. To evaluate the ability of models in encoding rotation-equivariance, we train the proposed model and Spherenet [5] on the non-rotated dataset and test on the rotated dataset (N/R). The Spherenet [5] performs much worse, while the performance of the proposed GICOPix-SGCN performs the best with only a slight decrease (Dec.) in performance compared to R/R. + +We also compare the performances of the three different pixelation schemes with the same network, i.e., the GSSPix-SGCN, the HEALPix-SGCN, and the GICOPix-SGCN. In the R/R and N/R settings, the proposed GICOPix-SGCN + +Table 3. Accuracy(%) of different models on the S-MNIST dataset. We achieve the comparable performance with less parameters in the R/R setting. In the N/R setting, the GICOPix-SGCN achieves the best performance. The performance under the "N/R" setting and "Dec" demonstrate the proposed model has stronger capability to capture rotation-equivariance. + +
ModelsR/RN/RDec.Param.
GCNNs [12]82.79--282K
S2CNNs [3]88.14--149K
PDOs [11]83.0061.0921.9162 K
SphereNet [5]94.4155.1839.22196K
GSSPix-SGCN74.4143.2631.1558K
HEALPix-SGCN92.3691.410.9558K
GICOPix-SGCN93.5893.430.1558K
+ +Table 4. Accuracy(%) of different models on the S-CIFAR-10 dataset. The GICOPix-SGCN achieves the best performance in both R/R and N/R settings. The performance under the "N/R" setting and "Dec" demonstrate the proposed model has stronger capability to capture the rotation-equivariance. + +
ModelsR/RN/RDec.Param.
SphereNet [5]53.9037.1816.72196K
GSSPix-SGCN47.5138.858.6658K
HEALPix-SGCN55.0851.903.1858K
GICOPix-SGCN58.0356.841.1958K
+ +outperforms the SGCNs based on the other two schemes with a significant performance gain, especially for the N/R setting. We attribute the success of the GICOPix-SGCN to the ability to explore rotation-equivariance. Besides, the SGCN based on a more regular spherical graph has a better performance on rotation-invariant classification for the SMNIST dataset. + +# 4.5. S-CIFAR-10 Classification + +Dataset. The S-CIFAR-10 dataset contains more photorealistic images than the S-MNIST dataset. We create the R and NR sets of the S-CIFAR-10 dataset in the same way as generating the S-MNIST dataset. The ERP of a spherical image from the S-CIFAR-10 dataset with $\phi = 0, \frac{\pi}{3}, \frac{\pi}{6}, \frac{\pi}{2}$ is shown in Fig. 6 + +Experiment setup. We adopt the SphereNet [5] as our baseline model. The network of the SGCN and implementation details are the same as the S-MNIST classification task except that the learning rate is reduced to 0.01 and 0.001. + +Result. The performances of different models on the S-CIFAR-10 dataset are compared in Table 4. The proposed GICOPix-SGCN achieve the state-of-the-art performance in both R/R and N/R settings. Especially, for the N/R setting, the proposed GICOPix-SGCN has the smallest decrease in the performance. This suggests that the proposed SGCN based on a more regular spherical graph has a stronger ability to encode rotation-equivariance and fulfill rotation-invariance, and thus performs better for the rotation invariant classification on the S-CIFAR-10 dataset. + +# 4.6.3D Object Classification + +Dataset. The ModelNet40 [28] dataset contains 40-class 3D models with 9843 training samples and 2468 testing samples. To apply the proposed SGCN in the 3D object classification task, we convert from the 3D geometries to signals on the sphere by following the method in [3, 11]. We project the 3D meshes onto a level-4 unit sphere with each mesh at the coordinate origin. First, we send a ray from the points on the sphere to the origin and record 3 channels information: the ray length from each point to the mesh and $\sin$ , $\cos$ of the surface angle. Further, we augment the signal with another 3 channels for the convex hull of the mesh, forming 6 channels of the signal in total. Following [7], for the NR dataset, the 3D objects are rotated with random azimuthal rotations. For the R dataset, the 3D objects are rotated with arbitrary rotations randomly. + +Experiment Setup. We benchmark our results against the 3D model, i.e., the PointNet [18], the SubVolSup MO [19], the MVCNN 12x [25], the RICNN [31], the ClusterNet [2], and the spherical CNN model, i.e., the PDOs [11] and the SphericalCNN [7]. Compared to the network of our SGCN with two stacks of convolutional layers and ploosing layers, all these baseline methods have a much more complex structure and a significantly enormous number of network parameters, such as 4 blocks with one meshconv block and three ResBlocks for the PDOs [11], and 8 spherical convolutional layers for the SphericalCNN [7]. The implementation details of the SGCN are the same as the S-MNIST classification task except that the networks are trained for 100 epochs with batch size 16. The initial learning rate is 0.01 and reduced to 0.001 after 50 epochs. + +Result. The performances of different models on ModelNet40 dataset are compared in Table 5. Compared to the 3D models which have a much more complex structure, the GICOPix-SGCN achieves comparable performance in the R/R setting and N/R setting. Compared to the spherical CNN models, the GICOPix-SGCN achieves comparable performance to the PDOs [11] and the SphericalCNN [7] in the R/R setting. The competing methods suffer a sharp drop in performance for the N/R setting with the unseen rotations presented, and the PDOs [11] perform no better than a random chance. In contrast, the GICOPix-SGCN is robust to this and still perform well. This indicates that our GICOPix-SGCN has strong applicability to real problems in 3D object classification. And the SGCN based on a more regular spherical graph has a stronger ability to explore rotation-equivariance and fulfill rotation-invariance. + +# 4.7. Ablation Study + +In Tables 3, 4 and 5, we have demonstrated the effectiveness of the proposed SGCN with a regular graph for rotation invariant classification, and the important role of the graph construction for modeling rotation-equivariance. + +Table 5. Accuracy(%) of different models on the ModelNet40 dataset. The GICOPix-SGCN achieves the comparable performance to the 3D models in both R/R and N/R settings. Compared to the spherical CNN models, the GICOPix-SGCN achieves the best performance in the N/R setting. The performance under the "N/R" setting and "Dec" demonstrate the ability of the proposed model to capture rotation-equivariance. + +
ModelsR/RN/RDec.Param.
PointNet [18]83.614.768.93.5M
SubVolSup MO [19]85.045.539.517M
MVCNN 12x [25]77.670.17.599M
RICNN [31]86.486.40.00.7M
ClusterNet [2]87.187.10.01.4M
PDOs [11]89.823.566.33.7M
SphericalCNN [7]86.978.610.20.5M
GSSPix-SGCN66.114.152.00.1M
HEALPix-SGCN83.978.45.50.1M
GICOPix-SGCN86.384.02.30.1M
+ +Table 6. The effect of different components in GICOPix-SGCN on the S-MNIST and ModelNet40 dataset. "HPool" denotes the proposed hierarchical pooling scheme and "Tran" indicates the proposed transition layer. + +
HPoolTranS-MNISTModelNet40
R/RN/RR/RN/R
✓✓93.5893.4386.2684.04
✓93.3192.6784.0083.31
✓93.9191.8585.5881.97
+ +We also study here the impact of the two main components of the proposed SGCN, i.e., the hierarchical pooling layer and the transition layer. In Table 6, "HPool" denotes the proposed hierarchical pooling, and "Tran" denotes the proposed transition layer. We replace the proposed pooling layer by the common method as in [6] and replace the transition layer by the global average pooling. In Table 6, we can see that the transition layer has a gain of $0.76\%$ for the S-MNIST classification and $0.73\%$ for the ModelNet40 classification in the N/R setting. The hierarchical pooling has an additional $1.58\%$ improvement for the S-MNIST classification and $2.07\%$ improvement for the ModelNet40 in the N/R setting. + +# 5. Conclusion + +In this paper, we have presented the spherical graph convolutional network (SGCN) based on GICOPix to encode rotation-equivariance for spherical image analysis. We proposed a spherical graph construction criterion and constructed the spherical graph based on GICOPix with the minimum degree of irregularity. In addition, we designed the SGCN with the hierarchical pooling operator and transition layer. The experiments have demonstrated that the GICOPix-SGCN could encode the rotation-equivariance with a stronger ability to recognize the spherical images. + +# References + +[1] John R Baumgardner and Paul O Frederickson. Icosahedral discretization of the two-sphere. SIAM Journal on Numerical Analysis, 22(6):1107-1115, 1985. +[2] Chao Chen, Guanbin Li, Ruijia Xu, Tianshui Chen, Meng Wang, and Liang Lin. Clusternet: Deep hierarchical cluster network with rigorously rotation-invariant representation for point cloud analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4994-5002, 2019. +[3] Taco S. Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical CNNs. In Proceedings of the International Conference on Learning Representations, Vancouver, BC, Canada, April 2018. +[4] Taco S. Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge equivariant convolutional networks and the icosahedral CNN. arXiv preprint arXiv:1902.04615, 2019. +[5] Benjamin Coors, Alexandru Paul Condurache, and Andreas Geiger. SphereNet: Learning spherical representations for detection and classification in omnidirectional images. In Proceedings of the European Conference on Computer Vision, pages 518-533, Munich, Germany, September 2018. +[6] Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pages 3844-3852, Barcelona, Spain, December 2016. +[7] Carlos Esteves, Christine Allen-Blanchette, Ameesh Makadia, and Kostas Daniilidis. Learning SO(3) equivariant representations with spherical CNNs. In Proceedings of the European Conference on Computer Vision, pages 54–70, Munich, Germany, September 2018. +[8] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 580-587, Columbus, OH, USA, June 2014. +[9] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask R-CNN. In Proceedings of the IEEE International Conference on Computer Vision, pages 2980-2988, Venice, Italy, October 2017. +[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770-778, Las Vegas, NV, USA, June 2016. +[11] Chiyu Jiang, Jingwei Huang, Karthik Kashinath, Prabhat, Philip Marcus, and Matthias Niessner. Spherical CNNs on unstructured grids. In Proceedings of the International Conference on Learning Representations, New Orleans, LA, USA, May 2019. +[12] Renata Khasanova and Pascal Frossard. Graph-based classification of omnidirectional images. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 860-869, Venice, Italy, October 2017. + +[13] Renata Khasanova and Pascal Frossard. Isometric transformation invariant graph-based deep neural network. arXiv preprint arXiv:1808.07366, 2018. +[14] Yeonkun Lee, Jaeseok Jeong, Jongseob Yun, Wonjune Cho, and Kuk-Jin Yoon. SpherePHD: Applying CNNs on a spherical PolyHeDron representation of $360^{\circ}$ images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9181-9189, Long Beach, CA, USA, June 2019. +[15] Shigang Li. Monitoring around a vehicle by a spherical image sensor. IEEE Transactions on Intelligent Transportation Systems, 7(4):541-550, April 2006. +[16] Maxime Meilland, Andrew I. Comport, and Patrick Rives. A spherical robot-centered representation for urban navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 5196-5201, Taipei, October 2010. +[17] Nathanaël Perraudin, Michael Defferrard, Tomasz Kacprzak, and Raphael Sgier. DeepSphere: Efficient spherical convolutional neural network with HEALPix sampling for cosmological applications. *Astronomy and Computing*, 27:130-146, April 2019. +[18] 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. +[19] Charles R. Qi, Hao Su, Matthias Nießner, Angela Dai, Mengyuan Yan, and Leonidas J. Guibas. Volumetric and multi-view CNNs for object classification on 3D data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5648-5656, Las Vegas, NV, USA, June 2016. +[20] Guo-Jun Qi. Learning generalized transformation equivariant representations via autoencoding transformations. arXiv preprint arXiv:1906.08628, 2019. +[21] Guo-Jun Qi, Liheng Zhang, Chang Wen Chen, and Qi Tian. Avt: Unsupervised learning of transformation equivariant representations by autoencoding variational transformations. In Proceedings of the IEEE International Conference on Computer Vision, pages 8130-8139, 2019. +[22] Evguenii A. Rakhmanov, E. B. Saff, and Y. M. Zhou. Minimal discrete energy on the sphere. Mathematical Research Letters, 1(6):647-662, January 1994. +[23] Lingyan Ran, Yanning Zhang, Qilin Zhang, and Tao Yang. Convolutional neural network-based robot navigation using uncalibrated spherical images. Sensors, 17(6):1341, 2017. +[24] Manuel Ruder, Alexey Dosovitskiy, and Thomas Brox. Artistic style transfer for videos and spherical images. International Journal of Computer Vision, 126(11):1199-1219, November 2018. +[25] Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik Learned-Miller. Multi-view convolutional neural networks for 3D shape recognition. In Proceedings of the IEEE International Conference on Computer Vision, pages 945-953, Santiago, Chile, December 2015. +[26] Yu-Chuan Su and Kristen Grauman. Learning spherical convolution for fast features from $360^{\circ}$ imagery. In Advances + +in Neural Information Processing Systems, pages 529-539, Long Beach, CA, USA, December 2017. +[27] Guofeng Tong, Ran Liu, and Jindong Tan. 3D information retrieval in mobile robot vision based on spherical compound eye. In Proceedings of the IEEE International Conference on Robotics and Biomimetics, pages 1895-1900, Phuket, Thailand, December 2011. +[28] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3D ShapeNets: A deep representation for volumetric shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1912-1920, Boston, MA, USA, June 2015. +[29] Chao Zhang, Stephan Liwicki, William Smith, and Roberto Cipolla. Orientation-aware semantic segmentation on icosahedron spheres. In Proceedings of the IEEE International Conference on Computer Vision, pages 3533-3541, 2019. +[30] Liheng Zhang, Guo-Jun Qi, Liqiang Wang, and Jiebo Luo. Aet vs. aed: Unsupervised representation learning by autoencoding transformations rather than data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2547-2555, 2019. +[31] Zhiyuan Zhang, Binh-Son Hua, David W Rosen, and Sai-Kit Yeung. Rotation invariant convolutions for 3D point clouds deep learning. In Proceedings of the International Conference on 3D Vision (3DV), pages 204–213. IEEE, 2019. +[32] Qiang Zhao, Chen Zhu, Feng Dai, Yike Ma, Guoqing Jin, and Yongdong Zhang. Distortion-aware CNNs for spherical images. In Proceedings of the International Joint Conference on Artificial Intelligence, pages 1198-1204, Stockholm, Sweden, July 2018. \ No newline at end of file diff --git a/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/images.zip b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..118de60397706e4837a281ca74d8692d59985bd2 --- /dev/null +++ b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9d772f30e99e1a0cf46c66bb457935197bbaeca0a824445656ccd3b011eb638 +size 446753 diff --git a/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/layout.json b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7299c15ceb3d79c1d45702f059f07dd1c298aee6 --- /dev/null +++ b/rotationequivariantgraphconvolutionalnetworkforsphericalimageclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a652789f9638be0cb0f215cb8c199242f25e5a2eceec85156a59f6fc1afe448 +size 439770 diff --git a/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_content_list.json b/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5eaed77382e2bc6ab8925365f1b758d3de18dca8 --- /dev/null +++ b/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed4fb5a9de0ecd1b68e1ce6c219ca63d76a552ac68f1c1d284d4150d140015b6 +size 87204 diff --git a/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_model.json b/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f461f66d243b6395745ec75d7ae294aaad6de13e --- /dev/null +++ b/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e892141b38aa711c796e6ba22bf3df1a8cf62b551a6c8e04958d74244644aedd +size 111660 diff --git a/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_origin.pdf b/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5b5a33689d6766000a711466a5b90d910a46e616 --- /dev/null +++ b/routedfusionlearningrealtimedepthmapfusion/2cc06df3-25b2-4e7a-89e4-03f2cbf48ed3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62a8973c310f5e29301d2349112025c203ff708cabc6f7e2cfedb52d6d26ead6 +size 5287454 diff --git a/routedfusionlearningrealtimedepthmapfusion/full.md b/routedfusionlearningrealtimedepthmapfusion/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d814fe38cc9243eb50b19cd50df9ebb66fbb2083 --- /dev/null +++ b/routedfusionlearningrealtimedepthmapfusion/full.md @@ -0,0 +1,359 @@ +# RoutedFusion: Learning Real-time Depth Map Fusion + +Silvan Weder ETH Zurich + +Johannes Schonberger +Microsoft + +Marc Pollefeys +ETH Zurich/Microsoft + +Martin R. Oswald +ETH Zurich + +# Abstract + +The efficient fusion of depth maps is a key part of most state-of-the-art 3D reconstruction methods. Besides requiring high accuracy, these depth fusion methods need to be scalable and real-time capable. To this end, we present a novel real-time capable machine learning-based method for depth map fusion. Similar to the seminal depth map fusion approach by Curless and Levoy, we only update a local group of voxels to ensure real-time capability. Instead of a simple linear fusion of depth information, we propose a neural network that predicts non-linear updates to better account for typical fusion errors. Our network is composed of a 2D depth routing network and a 3D depth fusion network which efficiently handle sensor-specific noise and outliers. This is especially useful for surface edges and thin objects for which the original approach suffers from thickening artifacts. Our method outperforms the traditional fusion approach and related learned approaches on both synthetic and real data. We demonstrate the performance of our method in reconstructing fine geometric details from noise and outlier contaminated data on various scenes. + +# 1. Introduction + +Multi-view 3D reconstruction has been a central research topic in computer vision for many decades. Fusing depth maps from multiple camera viewpoints is an essential processing step in the majority of recent 3D reconstruction pipelines [59, 58, 27, 1, 44, 43, 12, 10], especially for real-time applications [21, 37, 55, 11]. We revisit the problem of 3D reconstruction via depth map fusion from a machine learning perspective. The major difficulty of this task is to deal with various amounts of noise, outliers, and missing data. The classical approach [9, 21] to fusing noisy depth maps is to average truncated signed distance functions (TSDF). This approach has many advantages: $\mathbf{1} +$ ) The updates are local (truncated) and can be done in constant time for a fixed number of depth values. The high memory usage of voxel grids can be easily reduced with voxel hashing [37] or octrees [49]. $\mathbf{2} +$ ) Online updates are simple to implement and noisy measurements are fused into a + +![](images/ed34b1270630937723648f4ec7bc89af5058ab5574f1c2d063998fa53f331f8f.jpg) +Standard TSDF Fusion [9] +Figure 1: Standard TSDF fusion vs. our learned depth map fusion approach (on Kinect data [48]). Due to a more informed decision process, our approach better handles noise and fine geometric details. + +![](images/a6d5f7e4b5cdae98ba60bd7a1dc12433844cfb2175f2581c45ce11675d5c4fb6.jpg) + +![](images/041aa90a1ef2cc052bb5fbf18f1e4f3d3fe8cf84df1963203a25b3ca583ea9d3.jpg) +Ours + +single surface with very few operations. $3 + \cdot$ Due to local independent updates, the approach is computationally cheap and highly parallelizable. + +However, the approach also has a number of shortcomings: 1-) The average is only the optimal estimate for zero-mean Gaussian noise, but the real error distribution is typically non-Gaussian, non-centered and depth-dependent. 2-) The updates are linear and a minimal thickness assumption of surfaces has to be made according to the expected noise level. Therefore, thickening artifacts become apparent along surface edges and for thin object structures. 3-) This issue is even more severe when depth measurements of a thin object are made from opposite directions. Then the surface vanishes since the linear TSDF updates cancel each other out. 4-) The linear fusion weights do not properly account for view directional dependencies during TSDF aggregation. The noise level along the viewing direction is typically very different from the one in orthogonal directions. 5-) The fusion approach is unable to handle gross outliers. The depth map has to be pre-filtered or incorrect measurements will clutter the scene. 6-) The fusion param- + +eters must be tuned for specific scenes and sensors and it is often difficult to find a good trade-off between runtime and different aspects of reconstruction quality. + +In this paper, we aim to tackle the above mentioned disadvantages while maintaining all the advantages of traditional approach with a reasonable amount of additional computation time to still meet real-time requirements. To this end, we propose a learned approach that fuses noisy and outlier contaminated measurements into a single surface, performs non-linear updates to better deal with object boundaries and thin structures, and is fast enough for real-time applications. Figure 1 shows example outputs of our approach. In sum, this paper's contributions are as follows: + +- We present a learning-based method for real-time depth map fusion. Due to its compact architecture it requires only little training data, and is not prone to over-fitting. +- We propose a scalable and real-time capable neural architecture that is independent of the scene size. Therefore, it is applicable to a large set of real-world scenarios. +- We show significant improvement of standard TSDF fusion's shortcomings: 1) It better handles the fusion of anisotropic noise distributions that naturally arise from the multi-view setting, and 2) It mitigates the surface thickening effect on thin objects and surface boundaries by avoiding inconsistent updates. + +# 2. Related Work + +Volumetric Depth Map Fusion. With their seminal work, Curless and Levoy [9] proposed an elegant way for fusing noisy depth maps which later got adopted by numerous works like KinectFusion [21], more scalable generalizations like voxel hashing [37, 33], or hierarchical scene representations, such as voxel octrees [16, 49, 34] and hierarchical hashing [24]. Especially for SLAM pipelines like InfiniTAM [23], volumetric fusion became a standard approach due to its real-time capability. In this context, it was also extended to become more accurate and robust [8] as well as improve SLAM with additional surface registration of scene parts to account for pose drift as proposed in [55, 32, 11]. Approaches with additional median filtering [42, 34, 33] improve the robustness and are still real-time capable but with limited effectiveness. Global optimization approaches [59, 27] even better deal with noise and outliers if they further leverage semantic information [19, 6, 20, 44, 43], but they are computationally expensive and not real-time capable. In [65, 31], the authors propose methods for refinement of already fused SDF geometry based on shape-from-shading. The vast majority of these approaches directly fuse RGB-D images for which Zollhöfer et al. [66] provide a recent survey. All these methods handle noisy measurements by updating a wider band of voxels around the measured depth leading to thickening artifacts on thin geometry. + +Surfel-based Fusion Methods. Surfel-based methods approximate the surface with local point samples, which can further encode additional local properties such as normal or texture information. Multiple methods have been proposed, e.g. MRSMap [50] uses an octree to store multi-resolution surfel data. The point-based fusion methods [25, 29] combine a surfel representation with probabilistic fusion discussed in the next paragraph. ElasticFusion [55] handles real-time loop closures and corrects all surface estimates online. Schöps et al. [47] proposed a depth fusion approach with real-time mesh construction. A disadvantage of surfel-based methods is the missing connectivity information among surfels. The unstructured neighborhood relationships can only be established with a nearest neighbor search or simplified with space partitioning data structures. In our work, we decided to rely on volumetric representation, but extending our approach to unstructured settings is an interesting avenue of future work. + +Probabilistic Depth Map Fusion. To account for varying noise levels in the input depth maps and along different line-of-sight directions, the fusion problem can also be cast as probability density estimation [15] while typically assuming a Gaussian noise model. Keller et al. [25] propose a point-based fusion approach which directly updates a point cloud rather than a voxel grid. Lefloch et al. [29] extended this idea to anisotropic point-based fusion in order to account for different noise levels when a surface is observed from different incident angles. The mesh-based fusion approach by Zienkiewicz et al. [64] allows for depth fusion across various mesh resolutions for known fixed topology. The probabilistic fusion method by Woodford and Vogiatzis [56] incorporates long range visibility constraints. Similar ray-based visibility constraints were also used in [52, 51], but these methods are not real-time capable due to the complex optimization of ray potentials. Anisotropic depth map fusion methods additionally keep track of fusion covariances [57]. Similarly, PSDF Fusion [13] explicitly models directional dependent sensor noise. In contrast to our method, all these approaches assume particular noise distributions, primarily Gaussians, which often do not model the real sensor observations correctly. + +Learning-based Reconstruction Approaches. Several learning-based methods have been proposed to fuse, estimate, or improve geometry. SurfaceNet [22] jointly estimates multi-view stereo depth maps and their volumetric fusion, but is extremely memory demanding as each camera view requires a full voxel grid. In [30], multiview consistency is learned upon classical TSDF fusion. RayNet [39] models view dependencies along ray potentials with a Markov random field which is jointly learned with a view-invariant feature representation. 3DMV [10] combines 2D view information with a pre-fused TSDF scene to jointly optimize for shape and semantics. Riegler et + +![](images/f3ce7d626446f5eb832df0d8cd1c307a70930323fc6bd57fdfd8a29f78c9597f.jpg) +Figure 2: System overview for integrating depth maps into a global TSDF volume. A 2D Depth Routing Network takes depth input and decides the update location for every ray within the TSDF volume. The network corrects for noise, outliers and missing values and further estimates per-ray confidence values. Then, for each ray, we extract a depth and view-dependent local voxel grid (light blue) which also includes neighboring rays. We sample $S$ values along each ray, centered around the surface. A Depth Fusion Network then takes the local grid of existing TSDF values, the depth and confidences to predict adequate updates. The predicted TSDF values (red) are then written back into the global volume. Our method learns a robust weighting of input depths and performs non-linear updates to better handle noise, outliers, and thin objects. + +al. [40] fuse depth maps using standard TSDF and subsequently post-process the fused model with a neural network. Moreover, hierarchical volumetric deep learning-based approaches [3, 7, 12] tackle the effects of noisy measurements, outliers, and missing data. All these approaches operate on a voxel grid with high memory demands and are not real-time capable. Further, there are several works that learn to predict 3D meshes based on input images [18, 17, 54]. + +Learned Scene Representations. Ladicky et al. [28] directly estimate an iso-surface from a point cloud via learned local point features with a random forest. In addition, there exist multiple proposals for methods that learn 3D reconstruction in an implicit space [35, 38, 5, 36]. These methods show promising results, but they operate only on a unit cube and are thus limited to single objects or small scenes and they are neither suited for online reconstruction. Contrary to all these methods, our method is independent of the scene's size and can thus also operate on large-scale scenes. Additionally, our method uses learning in an online process, which allows to leverage already fused information for fusing a new depth map. In [2, 60], the authors propose neural models that learn a compact and estimizable 2.5D depth representation for SLAM applications. DeepTAM [62] also addresses SLAM, but the mapping part heavily relies on hand-crafted photoconsistencies and corresponding weights to form a traditional cost volume for depth estimation. None of these methods address global model fusion. + +# 3. Method + +We first review the standard TSDF fusion approach to provide context and to introduce notation before we present our learned TSDF fusion method. + +# 3.1. Review of Standard TSDF Fusion + +Standard TSDF fusion integrates given depth maps $\pmb{D}_{t=1,\dots,T} \in \mathbb{R}^{W \times H}$ from known viewpoints $\pmb{P}_t \in \mathrm{SE}(3)$ with camera intrinsics $\pmb{K}_t$ into a discretized signed distance function $\pmb{V}_t \in \mathbb{R}^{X \times Y \times Z}$ and weight function $\pmb{W}_t \in$ + +$\mathbb{R}^{X\times Y\times Z}$ defined over the entire scene. The fusion process is incremental, i.e. each depth map is integrated after one another for location $\pmb{x}$ using the update equations introduced by Curless and Levoy [9] as + +$$ +\boldsymbol {V} _ {t} (\boldsymbol {x}) = \frac {\boldsymbol {W} _ {t - 1} (\boldsymbol {x}) \cdot \boldsymbol {V} _ {t - 1} (\boldsymbol {x}) + w _ {t} (\boldsymbol {x}) \cdot v _ {t} (\boldsymbol {x})}{\boldsymbol {W} _ {t - 1} (\boldsymbol {x}) + w _ {t} (\boldsymbol {x})} \tag {1} +$$ + +$$ +\boldsymbol {W} _ {t} (\boldsymbol {x}) = \boldsymbol {W} _ {t - 1} (\boldsymbol {x}) + w _ {t} (\boldsymbol {x}), \tag {2} +$$ + +starting from zero-initialized volumes $V_{0}$ and $W_{0}$ . The signed distance update $v_{t}$ and its corresponding weight $w_{t}$ integrate the depth measurements of the next depth map $D_{t}$ at time step $t$ into the TSDF volume. These update functions are traditionally truncated before and after the surface in order to ensure efficient runtimes and robust reconstruction of fine-structured surfaces given noisy depth measurements. + +The choice of the truncation distance parameter typically requires cumbersome hand-tuning to adapt to a specific scene and depth sensor as well as accounting for runtime. If the truncation distance is chosen too large, the reconstruction of thin structures becomes more difficult due to larger thickening artifacts and the fusion process gets slower since more voxels have to be updated for each ray. Contrary, a small truncation distance results in time efficient updates but cannot deal with larger noise in the depth measurements. + +In this paper, we overcome this limitation by learning the function $v_{t}$ automatically from data. Our system is based on the same above mentioned update equations and our learned functions have only little computational overhead compared to traditional TSDF fusion. As such, our method facilitates real-time depth map fusion and can be readily integrated into existing reconstruction systems. In the following, we describe our proposed method in more detail. + +# 3.2. System Overview + +Our method contains two network components: a depth routing network and a depth fusion network. The pipeline consists of the following four essential processing steps which are also illustrated in Figure 2: + +1. Depth Routing: The depth routing network takes a raw depth map $D_{t}$ and estimates a denoised and outlier-corrected depth map $\hat{D}_{t}$ , and further estimates a corresponding confidence map $C_{t}$ . This network routes the depth location for reading and writing TSDF values along each viewing ray. +2. TSDF Extraction: Given the routed depth values $\hat{D}_t$ , we extract a local camera-aligned voxel grid with TSDF data $V_{t-1}^*$ and weight $W_{t-1}^*$ via trilinear interpolation from the corresponding global voxel grids $V_{t-1}$ , $W_{t-1}$ . +3. Depth Fusion: The depth fusion network takes the results of the previous processing steps $(\hat{D}_t, C_t, W_{t-1}^*, V_{t-1}^*)$ and computes the local TSDF update $v_t^*$ . +4. TSDF Update Integration: The predicted TSDF update $v_{t}^{*}$ is transferred back into the global coordinate frame to get $v_{t}$ which is then integrated into the global TSDF volumes $V_{t}, W_{t}$ using the TSDF updates in Eqs. (1), (2). + +These processing steps are detailed in the next subsections. + +# 3.3. Depth Routing + +Using the depth routing network, we pre-process the depth maps before passing them to the depth fusion network with the main motivation of denoising and outlier correction. Towards this end, the network predicts denoised depth maps and also per-pixel confidence maps $C_{t = 1,\dots,T} \in \mathbb{R}^{W \times H}$ . Figure 3 illustrates our network architecture, which is using a fully-convolutional U-Net [41] with a joint encoder and separate decoders for confidence and depth prediction. Further, we do not use normalization layers since it negatively influences the depth prediction performance by adding a depth-dependent bias to the result. The depth map and the confidence map are processed by two separate decoders to which the output of the bottleneck layers serves as an input. + +# 3.4. TSDF Extraction + +Instead of processing each ray of a view $t$ independently as in standard TSDF fusion, we deliberately choose to compute the TSDF updates based on the data of a larger neighborhood in order to make a more informed decision about the surface location. Further, the 2D input data also holds valuable information about surface locations as often indicated by depth discontinuities. We argue that the fusion network can best benefit from both 2D and 3D data sources when they are already in correspondence and therefore propose a view-aligned local neighborhood extraction. Then, the 3D TSDF data and the 2D input data can be easily concatenated and fed into the network. Hence, for efficient real-time updates of the global data $\boldsymbol{V}_{t-1}$ , $\boldsymbol{W}_{t-1}$ , we extract a local, view-dependent TSDF volume and corresponding weights $\boldsymbol{V}_{t-1}^{*}, \boldsymbol{W}_{t-1}^{*} \in \mathbb{R}^{W \times H \times S}$ . The first two volume dimensions $W, H$ correspond to the width and height of the + +depth map whereas the third dimension $S$ represents the local depth-sampling dimension of the window sampled along the ray. This number $S$ closely relates to the truncation distance in standard TSDF fusion. For each ray independently, the local windows are centered at their respective depth values $\hat{D}_t$ and discretely sampled into a fixed number of $S$ values from the volume $V_{t-1}$ . We choose the step size of the sampling according to the resolution of the scene and use trilinear interpolation to mitigate sampling artifacts. + +The input $I_{t}$ to the subsequent depth fusion is then a combination of all available local information, that is, corrected depth map $\hat{D}_t$ , confidence map $C_t$ as well as the extracted TSDF values $V_{t - 1}^{*}$ and TSDF weights $W_{t - 1}^{*}$ + +$$ +\boldsymbol {I} _ {t} = \left[ \begin{array}{l l l l} \hat {\boldsymbol {D}} _ {t} & \boldsymbol {C} _ {t} & \boldsymbol {W} _ {t - 1} ^ {*} & \boldsymbol {V} _ {t - 1} ^ {*} \end{array} \right] \in \mathbb {R} ^ {W \times H \times (2 S + 2)}. \tag {3} +$$ + +Before the subsequent update prediction step, we explicitly filter gross outliers where $C_t < C_{\mathrm{thr}}$ and set their corresponding feature values in $I_t$ to zero. + +# 3.5. Depth Fusion + +Our depth fusion network takes the local 3D feature volume $\mathbf{I}_t$ as input and predicts the local TSDF update $v_{t}^{*}\in \mathbb{R}^{W\times H\times S}$ . The architecture is fully convolutional in two dimensions and the channel dimension is along the camera viewing direction. Our network is relatively compact and thereby facilitates real-time computation. + +Our depth fusion network operates in a two-stage approach, as shown in Figure 3. The first stage encodes local and global information in the viewing frustum. We sequentially pass the input 3D feature volume through encoding blocks of two consecutive convolutional layers with interleaved batch normalization, non-linear activation using leaky RLUs, and a dropout layer. The output of every block is concatenated with its input and passed through the next block. With every block, the receptive field of the neural network increases. This sequential feature extraction results in a 100-dimensional feature vector for each ray in the viewing frustum. + +The second network part takes the feature volume and predicts the TSDF updates along each ray. The number of features is sequentially reduced by passing them through convolutional blocks with two $1 \times 1$ convolutional layers interleaved with leaky RLUs, batch normalization, and dropout layers. In the last block, we directly reduce from 40 features to 20 in the first layer and then to $S$ TSDF values in the last convolutional layer, where we apply a tanh-activation on the output mapping it to the range $[-1, 1]$ . + +Note that predicted TSDF update values $\boldsymbol{v}_t^*$ can take any value. The network can decide to not update the TSDF at all, e.g., in case of an outlier. Conversely, it can reduce the influence of existing TSDF values if they contained outliers. + +![](images/a7c14cafab93788743e016116a72bb0c00adf079933a8a95b20cd24ad6829043.jpg) +Figure 3: Proposed network architecture. Our depth routing network consists of a U-Net (depth one) with two separate decoders predicting a corrected depth map and a corresponding confidence map. The depth fusion network extracts in a series of encoding blocks 100 features along each ray. These features are then used to predict the TSDF updates along the ray. + +# 3.6. TSDF Update Integration + +In order to compute the updated global TSDF volume $V_{t}$ we transform the predicted local TSDF updates $v_{t}^{*}$ back into the global coordinate frame $v_{t}$ . To this end, we apply the inverse operation of the previous extraction step, that is, we redistribute the values using the same trilinear interpolation weights. In fact, we actually repurpose the update weights $w_{t}$ for this task, where $W_{t}$ accumulates the splating weights for each voxel in the scene. Moreover, we also use $W_{t}$ for post-filtering extreme outliers1. + +# 3.7. Loss Function and Training Procedure + +The two networks in our pipeline are trained in two steps. First, we train the depth routing network and then use the pre-trained routing output to train the fusion network. + +Depth Routing Network. We train the depth prediction head in a supervised manner by computing the L1 loss on absolute depth values as well as on the depth map gradient, as proposed in [14]. For training the confidence head, we chose a self-supervised approach [26]. Therefore, the final loss function has the form + +$$ +\mathcal {L} _ {\mathrm {2 D}} = \sum_ {i} c _ {i} \mathcal {L} _ {1} \left(y _ {i}, \hat {y} _ {i}\right) + c _ {i} \mathcal {L} _ {1} \left(\nabla y _ {i}, \nabla \hat {y} _ {i}\right) - \lambda \log c _ {i} \tag {4} +$$ + +where $y_{i}, \hat{y}_{i}$ are the predicted and ground-truth depth values at pixel $i$ respectively and $c_{i} \in C_{t}$ is the confidence value. The hyperparameter $\lambda$ is empirically set to 0.015. + +Depth Fusion Network. Despite the pre-processing of the routing network, the filtered depth map might still contain noise and outliers which should be further handled by the depth fusion network. Each global TSDF update step should a) integrate new information about the true geometry and b) not destroy valuable, previously fused surface information. We train the fusion network in a supervised manner by choosing random update steps at time $t$ during the fusion and penalize differences between the updated local volume $V_{t}^{*} = \frac{W_{t - 1}^{*}\cdot V_{t - 1}^{*} + w_{t}^{*}\cdot v_{t}^{*}}{W_{t - 1}^{*} + w_{t}^{*}}\in \mathbb{R}^{W\times H\times S}$ and the local ground-truth $\hat{\boldsymbol{V}}^{*}\in \mathbb{R}^{W\times H\times S}$ . Therefore, we define + +the loss function over all rays $i$ as + +$$ +\mathcal {L} _ {\mathrm {3 D}} = \sum_ {i} \lambda_ {1} \mathcal {L} _ {1} \left(\boldsymbol {V} _ {t i} ^ {*}, \hat {\boldsymbol {V}} _ {i} ^ {*}\right) + \lambda_ {C} D _ {C} \left(\boldsymbol {V} _ {t i} ^ {*}, \hat {\boldsymbol {V}} _ {i} ^ {*}\right) \tag {5} +$$ + +Here, $\mathcal{L}_1$ denotes the L1 loss over raw TSDF values and $D_C$ denotes the cosine distance between the signs of the TSDF values computed along each ray $i$ . The goal of the first term is to preserve fine surface detail (through means of $\mathcal{L}_1$ ), while, the term $D_C$ ensures that the surface is located at the zero-crossing of the signed distance field. The weights $\lambda_1 = 1$ and $\lambda_C = 0.1$ have been empirically found. + +# 4. Experiments + +In this section, we first present additional implementation details and our experimental setup. Next, we evaluate and discuss the efficacy of our approach on both synthetic and real-world data. We demonstrate that our approach outperforms traditional TSDF fusion and state-of-the-art learning-based approaches in terms of reconstruction accuracy with only little computational overhead. + +# 4.1. Implementation Details + +All networks were implemented in PyTorch and trained on an NVIDIA Titan Xp GPU. We trained both networks using the RMSProp optimization algorithm with momentum 0.9 and initial learning rate $1\mathrm{e} - 5$ for the depth routing network and $1\mathrm{e} - 3$ for the depth fusion network. The dropout layers were set to a probability of 0.2. For all experiments, we trained our neural networks in a sequential process, where we first pre-trained the depth routing and then the depth fusion network. A joint end-to-end refinement did not lead to an improvement of the overall performance of the system. To train the depth routing network, we use 10K frames sampled from 100 ModelNet [61] or ShapeNet [4] objects and perturb them with artificial speckle noise. The data is packed into batches of size 4 and the gradient is accumulated across 8 batches before updating the routing network weights. Because of the incremental nature of the TSDF update equation, we must train our depth fusion network using a batch size of 1. However, each batch updates a very large number of voxels in the volume over which the + +loss is defined and, together with batch normalization, we obtain robust convergence during training. Since our network has only very few parameters, it is hard to overfit and only little training data is required. In fact, we can train our entire network (given a pre-trained depth routing network) on only ten models from ModelNet [61] or ShapeNet [4] with a total of 1000 depth maps and it already generalizes robustly to other scenes. Furthermore, we can train the network from scratch in only 20 epochs (each epoch passes once over all 1000 frames). Unless otherwise specified, we used $S = 9$ and $C_{thr} = 0.9$ across all experiments². For all experiments, we used a voxel size $0.008m$ , corresponding to a grid resolution of $128^3$ for ShapeNet and ModelNet. + +Runtime. A forward pass through the depth routing network and the depth fusion network for one depth map $(W = 320, H = 240)$ takes $0.9\mathrm{ms}$ and $1.8\mathrm{ms}$ , respectively while the full pipeline runs at 15 fps. These numbers can be improved with a more efficient implementation, but already meet real-time requirements. + +# 4.2. Results + +We evaluate our method on synthetic and real-world data comparing to traditional TSDF fusion [9] as a baseline as well as to the state-of-the-art PSDF fusion method presented by Dong et al. [13]. Moreover, we compare to state-of-the-art learning-based 3D reconstruction methods OccupancyNetworks [35] and DeepSDF [38]. + +Evaluation Metrics. For quantifying the performance of our method, we compute the following four metrics by comparing the estimated TSDF against the ground-truth. + +- MAD: The mean absolute distance is computed over all TSDF voxels and measures the reconstruction performance on fine surface details. +- MSE: The mean squared error loss is computed over all TSDF voxels and measures the reconstruction performance on large surface deviations. +- Accuracy: We compare the actual reconstruction accuracy on the occupancy grid. We extract the occupancy grid in the ground-truth and the estimated TSDF by extracting all voxels with negative TSDF values. +- Intersection over Union (IoU): We compute the intersection-over-union on the occupancy grid, which is an alternative performance measure to the accuracy. + +These metrics not only quantify how well our pipeline fuses depth maps into a TSDF, but also how well it performs in classifying the occupancy and reconstructing the geometry. + +# 4.3. Synthetic Data + +To evaluate our method's performance in fusing noisy synthetic data, we train and test it on the ModelNet [61] and ShapeNet [4] datasets using rendered ground-truth depth + +
MethodMSE [e-05]MADAcc. [%]IoU [0, 1]
DeepSDF [38]464.00.049966.480.538
OccupancyNetworks [35]56.80.016685.660.484
TSDF Fusion [9]11.00.007888.060.659
TSDF Fusion + Routing27.00.008487.480.650
Ours w/o Routing5.90.005193.910.765
Ours5.90.005094.770.785
+ +Table 1: Quantitative Results on ShapeNet [4]. Our method outperforms TSDF fusion and other learning-based approaches in fusing noisy ( $\sigma = 0.005$ ) depth-maps rendered from ShapeNet objects. The benefit of the routing network increases with higher noise levels (see Fig. 5). + +![](images/4fda24750cbfa3376168f71cfcd1697bde276aacf456fd145b18e5a57a8f581d.jpg) +Figure 4: Qualitative Results on ShapeNet [4]. Our method is superior to all other methods in reconstructing fine details (see car wheels and spoiler) and produces smoother surfaces (input noise level $\sigma = 0.005$ ). + +maps that are perturbed with an artificial depth-dependent multiplicative noise distribution. For both, ModelNet and ShapeNet, we randomly sample our training and test data from the official train-test split. + +ShapeNet. The model trained on ShapeNet is then used to evaluate the performance of our method in comparison with other approaches. Therefore, we fuse noisy depth maps of 60 objects (10 per test class - plane, sofa, lamp, table, car, chair) from the test set, which have not been seen during training. For comparison, we use the provided pre-trained model for point cloud completion in the case of OccupancyNetworks. In the case of DeepSDF, we trained the model from scratch using the code provided by the authors and using ShapeNet as training data. The quantitative results of this evaluation are shown in Table 1. Our method consistently outperforms standard TSDF fusion as well as the pure learning-based approaches OccupancyNetworks [35] and DeepSDF [38] on all metrics. Our method significantly improves the accuracy of the fused implicit mesh as well as their IoU, MAD and MSE scores. The results also indicate the potential of our routing network. However, the full benefit of our routing network only becomes obvious when looking at the real-world data experiments and Figure 5. + +![](images/78dcc530102b82a1eac2a99cfd879b09477208bfcb1ce9dc383e98b93ad5a296.jpg) +Figure 5: Evaluation of different noise levels $\sigma$ . The left plot shows MAD for different noise levels $\sigma \in \{0.01, 0.03, 0.05\}$ . Our routing network stabilizes both, our method as well as standard TSDF fusion, for high noise levels. On the right, we show corresponding qualitative results on ModelNet test data for Standard TSDF and our method. The figures show the denoising capability of our method, where standard TSDF fusion completely fails. + +Figure 4 illustrates the strengths of our method in dealing with noise and in reconstructing thin structures. Flat surfaces in the ground-truth appear smoother in our results as compared to standard TSDF fusion. Furthermore, thin structures are better reconstructed and contain less thickening artifacts. The thickening artifacts are also visible on the car's rims, where our method yields accurate results and DeepSDF and OccupancyNetworks both fail. Both DeepSDF and OccupancyNetworks tend to over-smooth surface details less common in the training data, e.g., the spoiler of the car or the details on the chair's legs. + +ModelNet. In order to test our method's robustness against noise we trained and evaluated on various noise levels $\sigma \in \{0.01, 0.03, 0.05\}$ and compared it to standard TSDF fusion. We also analyze the effect of the depth routing network on the fusion result by omitting it in our pipeline and by testing it in combination with standard TSDF fusion. Figure 5 illustrates that our pipeline outperforms standard TSDF fusion for all tested noise levels. It also shows that our depth routing network stabilizes the fusion of data corrupted with extreme noise levels. When used for data preprocessing, our depth routing network also improves the results of standard TSDF fusion. + +# 4.4. Real-World Data + +We also evaluate on real-world datasets and compare to other state-of-the-art fusion methods. Due to lack of ground-truth data, we use the model trained on synthetic ModelNet data using an artificial and empirically chosen depth-dependent noise distribution with $\sigma = 0.01$ . As such, we also show that our method must not necessarily be trained on real-world data but generalizes robustly to the real domain from being trained on noisy synthetic data only. + +3D Scene Data [63]. To quantify the improvement of the reconstruction result, we evaluate our method compared to standard TSDF fusion on scenes provided by Zhou et al. [63]. Since there is no volumetric ground-truth avail + +
MethodLoungeCopyroomStonewallCactusgardenBurghers
TSDF0.00950.01100.01170.01040.0126
Ours w/o routing0.00550.00570.00470.00550.0071
Ours0.00510.00510.00430.00520.0067
+ +Table 2: Quantitative evaluation (MAD [mm]) of our method on 3D Scene Data [63]. Our method is consistently better than standard TSDF fusion on 3D Scene Data. These experiments also show the benefit of our routing network when applied to real-world data. + +able for these scenes, we fuse all frames of each scene using standard TSDF fusion and denoised the meshes. Then, we only fuse every 10th frame using standard TSDF fusion as well as our method for evaluation. + +Table 2 shows the quantitative reconstruction results from fusing 5 scenes of the 3D scene dataset [63]. Our method significantly outperforms standard TSDF fusion on all scenes without being trained on real-world data. + +We further show a qualitative comparison to standard TSDF as well as PSDF fusion [13] on the Burghers of Calais scene in Figure 8. The results illustrate that our method better reconstructs fine geometric details (hands, fingers and face) and produces smoother surfaces than standard TSDF fusion and PSDF fusion [13]. For more qualitative examples on this dataset, we refer to the supplementary material. + +Street Sign Dataset [53]. To evaluate the performance of our method on thin structures, we also evaluate on the street sign dataset, again without fine-tuning the network. This dataset consists of 50 RGB frames and we use the COLMAP SfM pipeline [45, 46] to compute camera poses and depth maps. Qualitative results on this scene for different state-of-the-art methods are shown in Figure 6. Our method clearly outperforms TV-Flux [58] and standard TSDF, while producing comparable results with ray potentials [43]. The results also make the benefit of our routing network apparent. With routing, our method reconstructs with better completeness and less noise artifacts than without. Note that both TV-Flux and ray potentials involve an offline optimization with a smoothness prior to reduce noise and complete missing data. This prevents real-time application for these approaches, since ray potentials on this small scene runs for many hours on a cluster. + +RGB-D Dataset 7-Scenes [48]. For qualitatively evaluating our method on Kinect data, we fuse the 7-Scenes [48] RGB-D dataset. For each scene, we have chosen the first trajectory and fused it using our pipeline as well as standard TSDF fusion. In Figure 7, we show that our method significantly reduces noise and mitigates the surface thickening effect compared to standard TSDF fusion. Notably, the chair leg and table edges are reconstructed with higher fidelity than it is done by standard TSDF fusion. Moreover, our method shows strong performance in denoising and removing outliers from the scene. + +![](images/ebeceed049bd1b5b81aafc4489156fd830321b49d4d6f13bd5089e7a28703443.jpg) + +![](images/7b977efd77079a1a0724009a5135c55291657866fd4858a653c48932239d1322.jpg) +RGB + +![](images/ce0a0d4e4091330983ed96167fd0c74affcb18a7e98fa7708208cbce6823f9d5.jpg) + +![](images/947160b720e77f820482712f330850e447983374188990393ee57dc2e940511f.jpg) +TV-Flux [58] + +![](images/d8265068ca4b7884790bb0f0b929113f94e02645a23f31a3948dc51e4993fb41.jpg) + +![](images/fec278d8e11ff1b5d0a7dbb2af05da2d6366e2d4323c9dc4df2949cfad65c060.jpg) +Ray Potentials [43] + +![](images/da46cc0f07829ac1c8c7a68093670c68a87e875504adbbbbd20857ad36034768.jpg) + +![](images/060ffcbf4c76a2cb29801de9cc6d5a785448ea81f4509706eb12473c1cea7265.jpg) +Standard TSDF [9] + +![](images/c90814f7a1126693f08875020b60c8e4e27c70e796d799c941d36772fc161612.jpg) + +![](images/2dc73677d21f6dbe9854c4ce45f7ec324716d8fc9f4628984a4225d062991748.jpg) +Ours w/o Routing + +![](images/4dc000c7a76a25e9900cfc8c6943ce87db516ffd68e9305e9b7a51baadb11c98.jpg) + +![](images/b6e3ad292cf6cf19a52590ca8418e35e10cd4a9a1dacb53cf8e90a18b1b06017.jpg) +Ours + +![](images/7b9cbd5429276bcf2a27ae593cd92108f948c1b12adcf4f4e4d248d55fa5da00.jpg) +Figure 6: Qualitative results of our method on the Roadsign dataset [53]. Our method compares favorably to standard TSDF fusion as well as TV-Flux [58] in reconstructing thin surfaces while showing comparable performance with ray potentials [43]. Our method generalizes reasonably well since it was trained on ModelNet and never saw the noise and outlier statistics of stereo depth maps nor the shape statistics of this scene and therefore has a less complete output. ( $C_{thr} = 0.5$ ) +Standard TSDF [9] + +![](images/73ee4fb4b906e78b44b0aa1e93e0e0c8454573424acf1a8fa36aed067cf5a9ed.jpg) +Ours w/o Routing + +![](images/4b4237940a7fbeafca82748c81f9c41c59c5638bddf9a18461ba7d75cc944cea.jpg) +Ours + +![](images/71c9e0b2851bd9a81cb6e7854cdaf7a1fd61cee2b6bbf0cab9c0fc6addbe4872.jpg) + +![](images/ab2450b9b6af6fdc0ec24ff3d867b17f5e1a0a53c7917afef48fa75305d7e1bc.jpg) +TSDF [9] +Figure 8: Qualitative comparison on the Burghers of Calais scene [63]. Our method reconstructs hands and face geometry with much higher degree of detail than standard TSDF fusion and PSDF fusion. + +![](images/300291348389a74a7ee669e6711db34eeb9d1f8c08cfa9171da5948909c77bc7.jpg) +Figure 7: Qualitative comparison on the heads scene of RGB-D Dataset 7-Scenes [48]. Our method significantly reduces noise artifacts and thickening effects - especially on the thin geometry of the chair's leg. + +![](images/7fc6d1841a1a4906325326ec128e189db84e21c28745508f07a69eb7f5f6e6f1.jpg) +PSDF [13] + +![](images/e5b14cb211d78b241b463ea9552adec33d4d242b094896b006be8d72abfd62f0.jpg) + +![](images/58d9bcbfa662cc4630aeb5242f680df97e4db78b3bea8830a44deee78e6284b9.jpg) +Ours + +# 5. Conclusion + +We presented a novel real-time capable depth map fusion method tackling the common limitations of standard TSDF fusion [9]. Due to learned non-linear TSDF updates – rather than hand-crafted linear updates – our method mitigates in- + +consistent reconstruction results that occur at object edges and thin structures. The proposed split of our network architecture into a 2D depth routing network and a 3D depth fusion network allows to effectively handle noise and outliers at different processing stages. Moreover, sensor-specific noise distributions can be learned from small amounts of training data. Our approach outperforms competing methods on both synthetic and real data experiments. Due to its low computational requirements and compact architecture, our method has the potential to replace standard TSDF fusion in a variety of tasks and applications. + +Acknowledgments. Special thanks go to Akihito Seki from Toshiba Japan for insightful discussions and comments that greatly improved the paper. This research was partially supported by Toshiba and the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/ Interior Business Center (DOI/IBC) contract number D17PC00280. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation thereon. Disclaimer: The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of IARPA, DOI/IBC, or the U.S. Government. + +# References + +[1] Maros Bláha, Christoph Vogel, Audrey Richard, Jan D. Wegner, Thomas Pock, and Konrad Schindler. Large-scale semantic 3d reconstruction: an adaptive multi-resolution model for multi-class volumetric labeling. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 1 +[2] Michael Bloesch, Jan Czarnowski, Ronald Clark, Stefan Leutenegger, and Andrew J. Davison. Codeslam - learning a compact, optimisable representation for dense visual SLAM. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 2560-2568, 2018. 3 +[3] Yan-Pei Cao, Zheng-Ning Liu, Zheng-Fei Kuang, Leif Kobbelt, and Shi-Min Hu. Learning to reconstruct high-quality 3d shapes with cascaded fully convolutional networks. In Proc. European Conference on Computer Vision (ECCV), pages 626–643, 2018. 3 +[4] Angel X. Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. ShapeNet: An Information-Rich 3D Model Repository. Technical Report arXiv:1512.03012 [cs.GR], Stanford University — Princeton University — Toyota Technological Institute at Chicago, 2015. 5, 6 +[5] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3 +[6] Ian Cherabier, Christian Hane, Martin R. Oswald, and Marc Pollefeys. Multi-label semantic 3d reconstruction using voxel blocks. In International Conference on 3D Vision (3DV), 2016. 2 +[7] Ian Cherabier, Johannes L. Schonberger, Martin R. Oswald, Marc Pollefeys, and Andreas Geiger. Learning priors for semantic 3d reconstruction. In European Conference on Computer Vision (ECCV), September 2018. 3 +[8] Sungjoon Choi, Qian-Yi Zhou, and Vladlen Koltun. Robust reconstruction of indoor scenes. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 5556-5565, 2015. 2 +[9] Brian Curless and Marc Levoy. A volumetric method for building complex models from range images. In Proceedings of the 23rd Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 1996, New Orleans, LA, USA, August 4-9, 1996, pages 303-312, 1996. 1, 2, 3, 6, 8 +[10] Angela Dai and Matthias Nießner. 3dmv: Joint 3d-multiview prediction for 3d semantic scene segmentation. In Proc. European Conference on Computer Vision (ECCV), pages 458-474, 2018. 1, 2 +[11] Angela Dai, Matthias Nießner, Michael Zollhöfer, Shahram Izadi, and Christian Theobalt. Bundlefusion: Real-time globally consistent 3d reconstruction using on-the-fly surface reintegration. ACM Trans. Graph., 36(3):24:1-24:18, 2017. 1, 2 +[12] Angela Dai, Daniel Ritchie, Martin Bokeloh, Scott Reed, Jürgen Sturm, and Matthias Nießner. Scancomplete: Large-scale scene completion and semantic segmentation for 3d + +scans. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1, 3 +[13] Wei Dong, Qiuyuan Wang, Xin Wang, and Hongbin Zha. Psdf fusion: Probabilistic signed distance function for onthe-fly 3d data fusion and scene reconstruction. In Proc. European Conference on Computer Vision (ECCV), September 2018. 2, 6, 7, 8 +[14] Simon Donne and Andreas Geiger. Learning non-volumetric depth fusion using successive reprojections. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 7634-7643, 2019. 5 +[15] Yong Duan, Mingtao Pei, and Yunde Jia. Probabilistic depth map fusion for real-time multi-view stereo. In Proceedings of the 21st International Conference on Pattern Recognition, ICPR 2012, Tsukuba, Japan, November 11-15, 2012, pages 368-371, 2012. 2 +[16] Simon Fuhrmann and Michael Goesele. Fusion of depth maps with multiple scales. ACM Trans. Graph., 30(6):148:1-148:8, 2011. 2 +[17] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Proc. International Conference on Computer Vision (ICCV), October 2019. 3 +[18] Thibault Groueix, Matthew Fisher, Vladimir G. Kim, Bryan C. Russell, and Mathieu Aubry. Atlasnet: A papier-mâché approach to learning 3d surface generation. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 216-224, 2018. 3 +[19] Christian Häne, Christopher Zach, Andrea Cohen, Roland Angst, and Marc Pollefeys. Joint 3d scene reconstruction and class segmentation. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 97-104, 2013. 2 +[20] Christian Häne, Christopher Zach, Andrea Cohen, and Marc Pollefeys. Dense semantic 3d reconstruction. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(9):1730-1743, 2017. 2 +[21] Shahram Izadi, Richard A. Newcombe, David Kim, Otmar Hilliges, David Molyneaux, Steve Hodges, Pushmeet Kohli, Jamie Shotton, Andrew J. Davison, and Andrew W. Fitzgibbon. Kinectfusion: real-time dynamic 3d surface reconstruction and interaction. In International Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 2011, Vancouver, BC, Canada, August 7-11, 2011, Talks Proceedings, page 23, 2011. 1, 2 +[22] Mengqi Ji, Juergen Gall, Haitian Zheng, Yebin Liu, and Lu Fang. Surfacenet: An end-to-end 3d neural network for multiview stereopsis. In Proc. International Conference on Computer Vision (ICCV), pages 2326-2334, 2017. 2 +[23] Olaf Kähler, Victor Adrian Prisacariu, Carl Yuheng Ren, Xin Sun, Philip H. S. Torr, and David W. Murray. Very high frame rate volumetric integration of depth images on mobile devices. IEEE Trans. Vis. Comput. Graph., 21(11):1241-1250, 2015. 2 +[24] Olaf Kähler, Victor Adrian Prisacariu, Julien P. C. Valentin, and David W. Murray. Hierarchical voxel block hashing for efficient integration of depth images. IEEE Robotics and Automation Letters, 1(1):192-197, 2016. 2 + +[25] Maik Keller, Damien Lefloch, Martin Lambers, Shahram Izadi, Tim Weyrich, and Andreas Kolb. Real-time 3d reconstruction in dynamic scenes using point-based fusion. In 2013 International Conference on 3D Vision, 3DV 2013, Seattle, Washington, USA, June 29 - July 1, 2013, pages 1-8, 2013. 2 +[26] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 5574-5584, 2017. 5 +[27] Kalin Kolev, Maria Klodt, Thomas Brox, and Daniel Cremers. Continuous global optimization in multiview 3d reconstruction. International Journal of Computer Vision, 84(1):80-96, 2009. 1, 2 +[28] Lubor Ladicky, Olivier Saurer, SoHyeon Jeong, Fabio Man-inchedda, and Marc Pollefeys. From point clouds to mesh using regression. In Proc. International Conference on Computer Vision (ICCV), pages 3913-3922, 2017. 3 +[29] Damien Lefloch, Tim Weyrich, and Andreas Kolb. Anisotropic point-based fusion. In 18th International Conference on Information Fusion, FUSION 2015, Washington, DC, USA, July 6-9, 2015, pages 2121-2128, 2015. 2 +[30] Vincent Leroy, Jean-Sébastien Franco, and Edmond Boyer. Shape reconstruction using volume sweeping and learned photoconsistency. In Proc. European Conference on Computer Vision (ECCV), pages 796-811, 2018. 2 +[31] R. Maier, K. Kim, D. Cremers, J. Kautz, and M. Nießner. Intrinsic3d: High-quality 3D reconstruction by joint appearance and geometry optimization with spatially-varying lighting. In International Conference on Computer Vision (ICCV), Venice, Italy, October 2017. 2 +[32] R. Maier, R. Schaller, and D. Cremers. Efficient online surface correction for real-time large-scale 3D reconstruction. In British Machine Vision Conference (BMVC), London, United Kingdom, September 2017. 2 +[33] Nico Marniok and Bastian Goldluecke. Real-time variational range image fusion and visualization for large-scale scenes using GPU hash tables. In 2018 IEEE Winter Conference on Applications of Computer Vision, WACV 2018, Lake Tahoe, NV, USA, March 12-15, 2018, pages 912-920, 2018. 2 +[34] Nico Marniok, Ole Johannsen, and Bastian Goldluecke. An efficient octree design for local variational range image fusion. In Proc. German Conference on Pattern Recognition (GCR), pages 401-412, 2017. 2 +[35] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 3, 6 +[36] Mateusz Michalkiewicz, Jhony K. Pontes, Dominic Jack, Mahsa Baktashmotlagh, and Anders Eriksson. Implicit surface representations as layers in neural networks. In Proc. International Conference on Computer Vision (ICCV), October 2019. 3 +[37] Matthias Nießner, Michael Zollhöfer, Shahram Izadi, and Marc Stamminger. Real-time 3d reconstruction at scale us- + +ing voxel hashing. ACM Trans. Graph., 32(6):169:1-169:11, 2013. 1, 2 +[38] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 3, 6 +[39] Despoina Paschalidou, Ali Osman Ulusoy, Carolin Schmitt, Luc Van Gool, and Andreas Geiger. Raynet: Learning volumetric 3d reconstruction with ray potentials. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 3897-3906, 2018. 2 +[40] Gernot Riegler, Ali Osman Ulusoy, Horst Bischof, and Andreas Geiger. Octnetfusion: Learning depth fusion from data. In 2017 International Conference on 3D Vision, 3DV 2017, Qingdao, China, October 10-12, 2017, pages 57-66, 2017. 3 +[41] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Nassir Navab, Joachim Hornegger, William M. Wells, and Alejandro F. Frangi, editors, Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015, pages 234–241, Cham, 2015. Springer International Publishing. 4 +[42] M. Rothermel, N. Haala, and D. Fritsch. A median-based depthmap fusion strategy for the generation of oriented points. In ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, volume III-3, 2016. 2 +[43] Nikolay Savinov, Christian Hane, Lubor Ladicky, and Marc Pollefeys. Semantic 3d reconstruction with continuous regularization and ray potentials using a visibility consistency constraint. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 5460-5469, 2016. 1, 2, 7, 8 +[44] Nikolay Savinov, Lubor Ladicky, Christian Hane, and Marc Pollefeys. Discrete optimization of ray potentials for semantic 3d reconstruction. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 5511-5518, 2015. 1, 2 +[45] Johannes Lutz Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 7 +[46] Johannes Lutz Schonberger, Enliang Zheng, Marc Pollefeys, and Jan-Michael Frahm. Pixelwise view selection for unstructured multi-view stereo. In European Conference on Computer Vision (ECCV), 2016. 7 +[47] Thomas Schöps, Torsten Sattler, and Marc Pollefeys. Surfelmeshing: Online surfel-based mesh reconstruction. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 2 +[48] Jamie Shotton, Ben Glocker, Christopher Zach, Shahram Izadi, Antonio Criminisi, and Andrew Fitzgibbon. Scene coordinate regression forests for camera relocalization in rgb-d images. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, June 2013. 1, 7, 8 +[49] Frank Steinbrücker, Christian Kerl, and Daniel Cremers. Large-scale multi-resolution surface reconstruction from + +RGB-D sequences. In IEEE International Conference on Computer Vision, ICCV 2013, Sydney, Australia, December 1-8, 2013, pages 3264-3271, 2013. 1, 2 +[50] Jörg Stuckler and Sven Behnke. Multi-resolution surfel maps for efficient dense 3d modeling and tracking. J. Visual Communication and Image Representation, 25(1):137-147, 2014. 2 +[51] Ali Osman Ulusoy, Michael J. Black, and Andreas Geiger. Patches, planes and probabilities: A non-local prior for volumetric 3d reconstruction. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 3280-3289, 2016. 2 +[52] Ali Osman Ulusoy, Andreas Geiger, and Michael J. Black. Towards probabilistic volumetric reconstruction using ray potentials. In 2015 International Conference on 3D Vision, 3DV 2015, Lyon, France, October 19-22, 2015, pages 10-18, 2015. 2 +[53] Benjamin Ummenhofer and Thomas Brox. Point-based 3d reconstruction of thin objects. In Proc. International Conference on Computer Vision (ICCV), pages 969-976, 2013, 7, 8 +[54] Chao Wen, Yinda Zhang, Zhuwen Li, and Yanwei Fu. Pixel2mesh++: Multi-view 3d mesh generation via deformation. In Proc. International Conference on Computer Vision (ICCV), October 2019. 3 +[55] Thomas Whelan, Renato F. Salas-Moreno, Ben Glocker, Andrew J. Davison, and Stefan Leutenegger. Elasticfusion: Real-time dense SLAM and light source estimation. I. J. Robotics Res., 35(14):1697-1716, 2016. 1, 2 +[56] Oliver J. Woodford and George Vogiatzis. A generative model for online depth fusion. In Proc. European Conference on Computer Vision (ECCV), pages 144-157, 2012. 2 +[57] Markus Ylimäki, Juho Kannala, and Janne Heikkila. Accurate 3-d reconstruction with rgb-d cameras using depth map fusion and pose refinement. 2018 24th International Conference on Pattern Recognition (ICPR), pages 1977-1982, 2018. 2 +[58] Christopher Zach. Fast and high quality fusion of depth maps. In International Symposium on 3D Data Processing, Visualization and Transmission (3DPVT), 2008. 1, 7, 8 +[59] Christopher Zach, Thomas Pock, and Horst Bischof. A globally optimal algorithm for robust tv-11 range image integration. In Proc. International Conference on Computer Vision (ICCV), pages 1-8, 2007. 1, 2 +[60] Shuaifeng Zhi, Michael Bloesch, Stefan Leutenegger, and Andrew J. Davison. Scenocode: Monocular dense semantic reconstruction using learned encoded scene representations. In Proc. International Conference on Computer Vision and Pattern Recognition (CVPR), pages 11776-11785, 2019. 3 +[61] Zhirong Wu, S. Song, A. Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and J. Xiao. 3d shapenets: A deep representation for volumetric shapes. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1912-1920, June 2015. 5, 6 +[62] Huizhong Zhou, Benjamin Ummenhofer, and Thomas Brox. Deeptam: Deep tracking and mapping. In Proc. European Conference on Computer Vision (ECCV), pages 851-868, 2018. 3 + +[63] Qian-Yi Zhou and Vladlen Koltun. Dense scene reconstruction with points of interest. ACM Trans. Graph., 32(4):112:1-112:8, 2013. 7, 8 +[64] Jacek Zienkiewicz, Akis Tsiotsios, Andrew J. Davison, and Stefan Leutenegger. Monocular, real-time surface reconstruction using dynamic level of detail. In Fourth International Conference on 3D Vision, 3DV 2016, Stanford, CA, USA, October 25-28, 2016, pages 37-46, 2016. 2 +[65] Michael Zollhöfer, Angela Dai, Matthias Innmann, Chenglei Wu, Marc Stamminger, Christian Theobalt, and Matthias Nießner. Shading-based refinement on volumetric signed distance functions. ACM Transactions on Graphics (TOG), 34(4), 2015. 2 +[66] M. Zollhöfer, P. Stotko, A. Görlitz, C. Theobalt, M. Nießner, R. Klein, and A. Kolb. State of the Art on 3D Reconstruction with RGB-D Cameras. Computer Graphics Forum (Eurographics State of the Art Reports 2018), 37(2), 2018. 2 \ No newline at end of file diff --git a/routedfusionlearningrealtimedepthmapfusion/images.zip b/routedfusionlearningrealtimedepthmapfusion/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..75885d7193837f84016f1ec46bc29f354089e57f --- /dev/null +++ b/routedfusionlearningrealtimedepthmapfusion/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:319e48c5f4d931f0c1d5ad6f570fddbb88fc38df2b8b28a18ae63bc01ff5778a +size 439234 diff --git a/routedfusionlearningrealtimedepthmapfusion/layout.json b/routedfusionlearningrealtimedepthmapfusion/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e0ddf9edacbf73e2c0d7bcf305aaedc46104ec3a --- /dev/null +++ b/routedfusionlearningrealtimedepthmapfusion/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39d2f2320665c8382cedbeb3302986d2239b90eeff27fb32786d1c432614c7a1 +size 456909 diff --git a/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_content_list.json b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..99c15efb4143d1dffcac69ba50a4f4c005e3ca90 --- /dev/null +++ b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:352bc1984f5de1971239991f355b424c80062dcdd3a1783a3b72e39d99adc1a6 +size 77914 diff --git a/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_model.json b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1859933f7a15e6276c9c661cd64e0dc534c3635e --- /dev/null +++ b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfed2ed62dbb9b85deb44288bd65d603796ea2e562f898dec50078379b249315 +size 96550 diff --git a/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_origin.pdf b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..38031de47c0091bc1b4e0ef075741d1b6a56780a --- /dev/null +++ b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/d23e7785-aae9-46a1-aac2-7801bdf4d2ce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:229f20c2bd5cc30ab4df2e11e59d6de2ec013989bdbb4e54016f7bc6f2e6cd27 +size 2204197 diff --git a/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/full.md b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2b3726447419dec50b03b88b0ad424fbf517004b --- /dev/null +++ b/s3vaeselfsupervisedsequentialvaeforrepresentationdisentanglementanddatageneration/full.md @@ -0,0 +1,301 @@ +# S3VAE: Self-Supervised Sequential VAE for Representation Disentanglement and Data Generation + +Yizhe Zhu $^{1,2}$ , Martin Renqiang Min $^{1}$ , Asim Kadav $^{1}$ , Hans Peter Graf $^{1}$ , yizhe.zhu@rutgers.edu, {renqiang, asim, hpg} @ nec-labs.com + +$^{1}$ NEC Labs America, $^{2}$ Department of Computer Science, Rutgers University + +# Abstract + +We propose a sequential variational autoencoder to learn disentangled representations of sequential data (e.g., videos and audios) under self-supervision. Specifically, we exploit the benefits of some readily accessible supervisory signals from input data itself or some off-the-shelf functional models and accordingly design auxiliary tasks for our model to utilize these signals. With the supervision of the signals, our model can easily disentangle the representation of an input sequence into static factors and dynamic factors (i.e., time-invariant and time-varying parts). Comprehensive experiments across videos and audios verify the effectiveness of our model on representation disentanglement and generation of sequential data, and demonstrate that, our model with self-supervision performs comparable to, if not better than, the fully-supervised model with ground truth labels, and outperforms state-of-the-art unsupervised models by a large margin. + +# 1. Introduction + +Representation learning is one of the essential research problems in machine learning and computer vision [5]. Real-world sensory data such as videos, images, and audios are often in the form of high dimensions. Representation learning aims to map these data into a low-dimensional space to make it easier to extract semantically meaningful information for downstream tasks such as classification and detection. Recent years have witnessed rising interests in disentangled representation learning, which tries to separate the underlying factors of observed data variations such that each factor exclusively interprets one type of semantic attributes of sensory data. The representation of sequential data is expected to be disentangled into time-varying factors and time-invariant factors. For video data, the identity of a moving object in a video is regarded as time-invariant factors, and the motion in each frame is considered as time-varying ones [36]. For speech data, the + +![](images/7b81141f0ad2b722cf4d3cd59a53b165aa7b5a1b263c9dd99eaf339dd36a82e4.jpg) +Figure 1. Self-supervision and regularizations enforce the latent variable of our sequential VAE to be disentangled into a static representation $\mathbf{z}_f$ and a dynamic representation $\mathbf{z}_t$ . + +representations of the timbre of speakers and the linguistic contents are expected to be disentangled [27]. There are several benefits of learning disentangled representations. First, the models that produce disentangled representations are more explainable. Second, disentangled representations make it easier and more efficient to manipulate data generation, which has potential applications in entertainment industry, training data synthesis [53, 54] and several downstream tasks [32, 19, 18, 43, 55]. + +Despite the vast amount of works [24, 33, 6, 15, 16, 7, 30] on disentangled representations of static data (mainly image data), fewer works [27, 36, 23, 46] have explored representation disentanglement for sequential data generation. For unsupervised models, FHVAE [27] and DSVAE [36] elaborately designed model architectures and factorized latent variables into static and dynamic parts. These models may well handle simple data forms such as synthetic animation data but fail when dealing with realistic ones as we will show later. Besides, as pointed out in [37], unsupervised representation disentanglement is impossible without inductive biases. Without any supervision, the performance of disentanglement can hardly be guaranteed and greatly depends on the random seed and the dimensionality of latent vectors set in the models. On the other hand, several works [23, 46] resort to utilizing label information or attribute annotation as strong supervision for disentanglement. For instance, VideoVAE [23] leveraged holistic attributes to constrain latent variables. Nevertheless, the + +costly annotation of data is essential for these models and prevents them from being deployed to most real-world applications, in which a tremendous amount of unlabeled data is available. + +To alleviate the drawbacks of both unsupervised and supervised models discussed above, this work tackles representation disentanglement for sequential data generation utilizing self-supervision. In self-supervised learning, various readily obtainable supervisory signals have been explored for representation learning of images and videos, employing auxiliary data such as the ambient sounds in videos [41, 3], the egomotion of cameras [1, 29], the geometry cue in 3D movies [20], and off-the-shelf functional models for visual tracking [51], and optical flow [42, 50]. However, how self-supervised learning benefits representation disentanglement of sequential data has barely been explored. + +In this paper, we propose a sequential variational autoencoder (VAE), a recurrent version of VAE, for sequence generation. In the latent space, the representation is disentangled into time-invariant and time-varying factors. We address the representation disentanglement by exploring intrinsic supervision signals, which can be readily obtained from both data itself and off-the-shelf methods, and accordingly design a series of auxiliary tasks. Specifically, on one hand, to exclude dynamic information from time-invariant variable, we exploit the temporal order of the sequential data and expect the time-invariant variable of the temporally shuffled data to be close to if not the same as that of the original data. On the other hand, the time-varying variable is expected to contain dynamic information in different modalities. For video data, we allow it to predict the location of the largest motion in every frame, which can be readily inferred from optical flow. For audio data, the volume in each segment as an intrinsic label is leveraged as the supervisory signal. To further encourage the representation disentanglement, the mutual information between static and dynamic variables are minimized as an extra regularization. + +To the best of our knowledge, this paper is the first work to explicitly use auxiliary supervision to improve the representation disentanglement for sequential data. Extensive experiments on representation disentanglement and sequence data generation demonstrate that, with these multiple freely accessible supervisions, our model dramatically outperforms unsupervised learning-based methods and even performs better than fully-supervised learning-based methods in several cases. + +# 2. Related Work + +Disentangled Sequential Data Generation With the success of deep generative models, recent works [24, 33, 6, 7, 30] resort to variational autoencoders (VAEs) [34] and generative adversarial networks (GANs) [22] to learn a dis + +entangled representation. Regularizations are accordingly designed. $\beta$ -VAE [24] imposed a heavier penalty on the KL divergence term for a better disentanglement learning. Follow-up researches [33, 6] derived a Total Correlation (TC) from the KL term, and highlights this TC term as the key factor in disentangled representation learning. In InfoGAN [7], the disentanglement of a latent code $c$ is achieved by maximizing a mutual information lower-bound between $c$ and the generated sample $\tilde{x}$ . + +Several works involving disentangled representation have been proposed for video prediction. Villegas et al. [48] and Denton et al. [12] designed two networks to encode pose and content separately at each timestep. Unlike video prediction, video generation from priors, which we perform in this work, is a much harder task since no frame is available for appearance and motion modeling in the generation phase. + +To handle video generation, VAEs are extended to a recurrent version [17, 4, 10]. However, these models do not explicitly consider static and dynamic representation disentanglement and fail to perform manipulable data generation. More recently, several works have proposed VAEs with factorized latent variables. FHVAE [27] presented a factorized hierarchical graphical model that imposes sequence-dependent priors and sequence-independent priors to different sets of latent variables in the context of speech data, but did not take advantage of the sequential prior. Combining the merits of recurrent VAE and FHVAE, DSVAE [36] is capable of disentangling latent factors by factorizing them into time-invariant and time-dependent parts and applies an LSTM sequential prior to keep a better sequential consistency for sequence generation. Although with elaborately designed complex architectures, these models may only perform decently on representation disentanglement of simple data, the disentanglement performance degrades rapidly when the complexity of data increases. In contrast, our work explores both model and regularization designs for representation disentanglement and sequential data generation. Our model fully factorizes the latent variables to time-invariant and time-varying parts, and both the posterior and the prior of the time-varying variable are modeled by LSTM for dynamic consistency. The auxiliary tasks with readily accessible supervisory signals are designed to regularize and encourage representation disentanglement. + +Self-Supervised Learning The concept of self-supervised learning traces back to the autoencoder [25], which uses the input itself as supervision to learn the representation. Denoising autoencoder[49] makes the learned representations robust to noise and partial corruption of the input pattern by adding noise to the input. Recent years have witnessed the booming interest in self-supervised learning. The sources of supervisory signals can be roughly categorized into three classes. (a) Intrinsic labels: Doersch et al. [13] explored + +![](images/8de90d94796e217ffe2af2fc5d7430e220c6b4dda45d42f1fd1db48a1d66da5b.jpg) +Figure 2. The framework of our proposed model in the context of video data. Each frame of a video $\pmb{x}_{1:T}$ is fed into an encoder to produce a sequence of visual features, which is then passed through an LSTM module to obtain the manifold posterior of a dynamic latent variable $\{q(\pmb{z}_t|\pmb{x}_{\leq t})\}_{t=1}^T$ and the posterior of a static latent variable $q(\pmb{z}_f|\pmb{x}_{1:T})$ . The static and dynamic representations $\pmb{z}_f$ and $\pmb{z}_{1:T}$ are sampled from the corresponding posteriors and concatenated to be fed into a decoder to generate reconstructed sequence $\widetilde{\pmb{x}}_{1:T}$ . Three regularizers are imposed on dynamic and static latent variables to encourage the representation disentanglement. + +the use of spatial context in images, and Noroozi et al. [40] trained a model to solve Jigsaw puzzles as a pretext task. Several works [52, 35] showed that colorizing a gray-scale photograph can be utilized as a powerful pretext task for visual understanding. Temporal information of video is another readily accessible supervisory signal. [38] trained a model to determine whether a sequence of frames from a video is in the correct temporal order and [31] made the model learn to arrange the permuted 3D spatiotemporal crops. (b) Auxiliary data: Agrawal et al. [1] and Jayaraman et al. [29] exploited the freely available knowledge of camera motion as a supervisory signal for feature learning. Ambient sounds in videos [41, 3] are used as a supervisory signal for learning visual models. The geometry cue in 3D movies [20] is utilized for visual representation learning. (c) Off-the-shelf tools: Wang et al. [51] leveraged the visual consistency of objects from a visual tracker in the video clips. [42] used segments obtained by motion-based segmentation based on optical flow as pseudo ground truth for the single-frame object segmentation. Instead of learning visual features as in aforementioned methods, this work aims to achieve static and dynamic representation disentanglement for sequential data such as video and speech. To this end, we leverage supervisory signals from intrinsic labels to regularize the static representation and off-the-shelf tools to regularize the dynamic representation. + +# 3. Sequential VAE Model + +We start by introducing some notations and the problem definition. $\mathcal{D} = \{\pmb{X}^i\}^N$ is given as a dataset that consists of $M$ i.i.d. sequences, where $\pmb{X}\equiv \pmb{x}_{1:T} = (x_1,x_2,\dots x_T)$ denotes a sequence of $T$ observed variables, such as a video of $T$ frames or an audio of $T$ segments. We propose a sequential variational autoencoder model, where the sequence is assumed to be generated from latent variable $\pmb{z}$ and $\pmb{z}$ is factorized into two disentangled variables: the time-invariant (or static) variable $\pmb{z}_f$ and the time-varying (or dynamic) + +variables $z_{1:T}$ + +**Priors** The prior of $z_{f}$ is defined as a standard Gaussian distribution: $z_{f} \sim \mathcal{N}(0,1)$ . The time-varying latent variables $z_{1:T}$ follow a sequential prior $z_{t} \mid z_{