diff --git a/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_content_list.json b/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d892bb50ead9e92099483b2fa4f3cab68ea45b82 --- /dev/null +++ b/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:064ea12b38d66b718d54a9a3fff53d980fc261af4d7fd0cf40bd0e318fd8650d +size 74763 diff --git a/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_model.json b/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_model.json new file mode 100644 index 0000000000000000000000000000000000000000..65b2606cc37083fa65e1f8869c56933a0aa8d57c --- /dev/null +++ b/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f06c91e30afaeb821f8708559267666d90bc272eba239e628c45649a7ee8f3b +size 93730 diff --git a/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_origin.pdf b/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9d5859c6aa3f5f45ab276a5dc698f45574c68a3d --- /dev/null +++ b/abandoningthebayerfiltertoseeinthedark/3848649e-055f-4b68-8c02-b79b217c5ead_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33c7b8b10210209445c7e0dec28917b9503167498d6e3d4607700fc951e86c19 +size 7752964 diff --git a/abandoningthebayerfiltertoseeinthedark/full.md b/abandoningthebayerfiltertoseeinthedark/full.md new file mode 100644 index 0000000000000000000000000000000000000000..261ee951edb571203087a96241d634d622ffeff5 --- /dev/null +++ b/abandoningthebayerfiltertoseeinthedark/full.md @@ -0,0 +1,336 @@ +# Abandoning the Bayer-Filter to See in the Dark + +Xingbo Dong $^{1,3*†}$ Wanyan Xu $^{1,2*†}$ Zhihui Miao $^{1,2†}$ Lan Ma $^{1}$ +Chao Zhang $^{1}$ Jiewen Yang $^{1}$ Zhe Jin $^{4}$ Andrew Beng Jin Teoh $^{3}$ Jiajun Shen $^{1}$ $^{1}$ TCL AI Lab $^{2}$ Fuzhou University $^{3}$ Yonsei University $^{4}$ Anhui University + +{xingbo.dong,bjteoh}@yonsei.ac.kr,{208527051,208527090}@fzu.edu.cn,{sjj,rubyma}@tcl.com + +# Abstract + +Low-light image enhancement, a pervasive but challenging problem, plays a central role in enhancing the visibility of an image captured in a poor illumination environment. Due to the fact that not all photons can pass the Bayer-Filter on the sensor of the color camera, in this work, we first present a De-Bayer-Filter simulator based on deep neural networks to generate a monochrome raw image from the colored raw image. Next, a fully convolutional network is proposed to achieve the low-light image enhancement by fusing colored raw data with synthesized monochrome data. Channel-wise attention is also introduced to the fusion process to establish a complementary interaction between features from colored and monochrome raw images. To train the convolutional networks, we propose a dataset with monochrome and color raw pairs named Mono-Colored Raw paired dataset (MCR) collected by using a monochrome camera without Bayer-Filter and a color camera with Bayer-Filter. The proposed pipeline takes advantages of the fusion of the virtual monochrome and the color raw images, and our extensive experiments indicate that significant improvement can be achieved by leveraging raw sensor data and data-driven learning. The project is available at https://github.com/TCL-AILab/Abandon_Bayer-Filter_See_in_the_Dark + +# 1. Introduction + +For a digitalized image, the quality of the image could be severely degraded due to the color distortions and noise under poor illumination conditions such as indoors, at night, or under improper camera exposure parameters. + +Long exposure time and high ISO (sensitivity to light) are often leveraged in low-light environments to preserve visual quality. However, overwhelming exposure leads to motion blur and unbalanced overexposing, and high ISO + +![](images/1cab1449950eb7d774bb9bdf076e465028a6274c282b0622af9fcf9589a03b44.jpg) +Figure 1. Overview of the proposed pipeline. We propose to generate monochrome raw data by a learned De-Bayer-Filter module. Then, a dual branch neural network is designed to bridge monochrome and colored raw to achieve the low-light image enhancement task. + +amplifies the noise. Though the camera's flash provides exposure compensation for the insufficient light, it is not suitable for long-distance shots, and also introduces color distortions and artifacts. On the other hand, various algorithms have been reported to enhance the low-light image. Recently, deep neural network models have been utilized to solve the low-light image restoration problem, such as DeepISP [22] and Seeing In the Dark (SID) [3]. + +However, those algorithms are restricted in the image processing pipeline, as the photons capture rate and quantum efficiency are usually overlooked. In general, high photons capture rate can improve the image's visual quality significantly. One of the typical examples is the RYYB-based color filter, which can capture $40\%$ more photons than the Bayer-RGGB-based color filter1. Hence, the RYYB-based color filter can achieve better performance naturally. + +Bayer filter removal is another plausible way to improve the photons capture rate. The Bayer filter is an array of + +many tiny color filters that cover the image sensor to render color information (see Fig. 1). By removing the Bayer filter and sacrificing the color information, the image sensor can capture more photons, which contributes to clearer visibility under poor illumination conditions compared to a camera with a Bayer filter (see Fig. 2 (a)). On the other hand, dual-cameras are one of the trends of today's smart devices such as smartphones. One type of dual-camera set is the combination of monochrome sensor and colored sensor2. The monochrome sensor is usually identical to the colored sensor but without a Bayer array filter. Such a dual-camera setting can achieve better imaging quality in a low-light environment due to more photons received by the sensor. However, an additional cost is needed for the extra camera equipped. Therefore, for most mobile phones that are only equipped with color cameras, preserving the same low-light image quality produced by dual-camera set while only using a single color camera is a challenging task. + +Motivated by the above discussion, we proposed a fully end-to-end convolutional neural model that consists of two modules (as illustrated in Fig. 1): a De-Bayer-Filter (DBF) module and a Dual Branch Low-light Enhancement module (DBLE). The DBF module learns to restore the monochrome raw image from the color camera raw data without requiring a monochrome camera. DBLE is designed to fuse colored raw with synthesized monochrome raw data and generate enhanced RGB images. + +In addition, we propose a dataset to train our end-to-end framework. To the best of our knowledge, no existing dataset contains monochrome and colored raw image pairs captured by an identical type of sensors. To establish such a dataset, one camera with a Bayer filter is used to capture color-patterned raw images. Another camera without a Bayer-filter but equipped with the same type of sensor is utilized to capture monochrome raw images (see Fig. 2(b)). The dataset is collected under various scenes, and each colored raw image has a corresponding monochrome raw image captured with identical exposure settings. + +Our contributions can be summarised as: + +1. A De-Bayer-Filter model is proposed to simulate a virtual monochrome camera and synthesize monochrome raw image data from the colored raw input. The DBF module aims at predicting the monochrome raw images, which resembles a monochrome sensor capability. To the best of our knowledge, we are the first to explore removing the Bayer-filter using a deep learning-based model. +2. We design a Dual Branch Low-light Enhancement model that is used to fuse the colored raw with the synthesized monochrome raw to produce the final monitor-ready RGB images. To bridge the domain gap + +between colored raw and monochrome raw, a channelwise attention layer is adopted to build an interaction between both domains for better restoration performance. The experiment results indicate that state-of-the-art performance can be achieved. + +3. We propose the MCR, a dataset of colored raw and monochrome raw image pairs, captured with the same exposure setting. It is publicly opened as a research material to facilitate community utilization and will be released after publication. + +# 2. Related Work + +To achieve the low-light image enhancement task, tremendous methods have been attempted. These methods can be categorized as histogram equalization (HE) methods [1, 15, 29], Retinex methods [5, 26, 28, 33], defogging model methods [4], statistical methods [16, 17, 23], and machine learning methods [7, 11, 30, 34]. Recently, several works on raw image data have been proposed [3, 9, 22]. Our work also falls into this category; we will mainly discuss the existing methods of raw-based approaches in this section. + +Deep neural networks have emerged as an approach to achieve the digital camera's image signal processing tasks. In 2018, a fully convolutional model, namely DeepISP, was proposed in [22] to learn mapping from the raw low-light mosaiced image to the final RGB image with high visual quality. To simulate the digital camera's image signal processing (ISP) pipeline, DeepISP first extracts low-level features and performs local modifications, then extracts higher-level features and performs a global correction. L1 norm and the multi-scale structural similarity index (MS-SSIM) loss in the Lab domain are utilized for training the DeepISP to simulate the ISP pipeline. When DeepISP is only used for low-level imaging tasks such as denoising and demosaicing, L2 loss will be utilized. Hence, both low-level tasks and higher-level tasks such as demosaicing, denoising, and color correction can be achieved by DeepISP. The results in [22] suggest superior performance compared with manufacturer ISP. + +Another parallel work similar to DeepISP, namely seeing in the dark (SID), was proposed in [3]. In SID, a U-net [21] network is utilized to operate directly on raw sensor data and output human visual ready RGB images. A dataset of raw short-exposure low-light images with corresponding long-exposure reference images was established to train the model. Compared with the traditional image processing pipeline, significant improvement can be made as the results in [3] indicate. Later, an improved version of SID was proposed in [27]. Using a similar U-net network as the backbone, the authors introduced wavelet transform to conduct down-sampling and up-sampling operations. Perceptual loss [10] is used in [27] to train the network to better + +![](images/7c8ff4e5060975149d8538df9b9f03b8de442986ff60d8b2de13e71b343d8445.jpg) +Figure 2. (a) Images captured by color and monochrome cameras under different exposure time.; (b) Monochrome and color cameras used in our work for data collection. + +![](images/237bf4bca7c1b25e3a1b1f392a6487d1b9a60151fb3ab01f4b0533204504761a.jpg) + +restore details in the image. In DID [18], the authors proposed replacing the U-net in SID with residual learning to better preserve the information from image features. Similar raw-based approaches have also been applied to videos, such as [2,9]. + +In addition to the raw-based approach, frequency-based decomposition has also been explored on the low-light image enhancement task. In [31], the authors proposed a pipeline, namely LDC, to achieve the low-light image enhancement task based on a frequency-based decomposition and enhancement model. The model first filters out high-frequency features and learns to restore the remaining low-frequency features based on an amplification operation. Subsequently, high-frequency details are restored. The results from [31] indicate that state-of-the-art performance can be achieved by LDC. + +Various research has also been done to improve the efficiency of low-light image enhancement in raw domain. To achieve a computationally fast low-light enhancement system, the authors in [14] proposed a lightweight architecture (RED) for extreme low-light image restoration. Besides, the authors also proposed an amplifier module to estimate the amplification factor based on the input raw image. In [6], a self-guided neural network (SGN) was proposed to achieve a balance between denoising performance and the computational cost. It aims at guiding the image restoration process at finer scales by utilizing the large-scale contextual information from shuffled multi-resolution inputs. + +Methods discussed above generally learn to map raw data captured by the camera to the human-visual-ready image. As raw data provides full information, the reviewed approach achieves state-of-the-art performance. However, the performance of those methods is upper bounded by the information contained in the raw data. While in our work, we consider to introduce extra information beyond the raw-RGB data. + +# 3. The Method + +Motivated by the above discussion and inspired by the monochrome camera's high light sensitivity, we propose + +a novel pipeline to further push the raw-based approaches forward. Specifically, our pipeline takes a raw image captured by a color camera with a Bayer-Filter as input. The De-Bayer-Filter module in our pipeline will first generate a monochrome image; a dual branch low-light enhancement module then fuses the monochrome raw data and color raw data to produce the final enhanced RGB image. Both modules work on raw images, as raw images are linearly dependent on the number of photons received, which contains additional information compared to RGB images such as the noise distribution [2, 20]. Details of each module will be discussed subsequently. A detailed architecture diagram of our framework is shown in Fig. 3(a) (more details are discussed in the supplementary). Furthermore, Fig. 3(b-f) and Fig. 3(g-k) visualize the output of each step of our model on our dataset and the SID dataset in [3], respectively. + +# 3.1. De-Bayer-Filter Module + +Millions of tiny light cavities are designed to collect photons and activate electrical signals on the camera sensor. However, using those light cavities alone can only produce gray images. A Bayer color filter is therefore designed to cover the light cavities and collect color information to produce color images. More specifically, a standard Bayer unit is a $2 \times 2$ pixel block with two green, one red and one blue color filters, and filters of a certain color will only allow photons with the corresponding wavelength to pass through. + +Simulating the camera imaging process using neural networks has been demonstrated feasible in several works [3,20,22]. Inspired by those works, we consider the removal of the Bayer array filter virtually by modeling the relationship between input and output photons for each color filter. Specifically, a De-Bayer-Filter (DBF) module is designed in this work to restore the monochrome raw images $A_{mono} \in \mathbb{R}^{H \times W}$ from the input colored raw $A_{color} \in \mathbb{R}^{\frac{H}{2} \times \frac{W}{2} \times 4}$ : + +$$ +A _ {M o n o} = f _ {M} \left(A _ {C o l o r}\right) \tag {1} +$$ + +where $f_{M}(\cdot)$ is a U-net-based fully convolutional network (see Fig. 3). L1 distance between the ground-truth monochrome image $A_{Mono}^{GT}$ and predicted image $A_{Mono}$ + +![](images/ab0970ce5f2e08ad947f972b8eb7a5ecfa47ef3787d1a55b03d5acfda18cb25d.jpg) + +![](images/6aebc6f8c92c288becfa0320736789297d9d764ce251ee3a51dff0edd9d0622c.jpg) + +![](images/4eef53747a4a2503a8d5ea65c61d513a00940fde47eb4ebe3a3fdb2811e5715d.jpg) +(a) Architecture of the pipeline + +![](images/f00e16fb95aaf43f717431df887a67af5d27182ec47b70004b17e79bbe16652f.jpg) + +![](images/b63a14a416c4e7478ba836779a8a3318ff0bddaf3118b6f61ce6e7653e58f8f1.jpg) + +![](images/65f89f4cc95cba47406cc05a097a02ff01195b7193ddb5bfa779d633bbaef6d1.jpg) + +![](images/67db215d7b8ae28307f0a4a0b2e55c9f6b486918caaf1d0e3889e9082d0a6d46.jpg) +(b) Input +(g) Input +Figure 3. (a) is the architecture of the pipeline. DBF module is designed to produce a monochrome image from the input raw image. DBLE module is proposed to fuse color and monochrome raw images to enhance the low-light input image. Each box denotes a multi-channel feature map produced by each layer. (b)-(f) are the images of our pipeline trained on our dataset. (g)-(k) are the images of our pipeline trained on SID [3] dataset; we convert RGB ground truth (GT) in SID dataset to gray image to replace the monochrome GT in our dataset. + +![](images/a2eec5f10a6eae2217c466b607fa31e6a6f5baf378d4e98a7e9a9e0a8cf8a0ba.jpg) +(c) Mono GT +(h) Synthetic Mono GT + +![](images/cdabd0f64dbc6e459aede4c357f7ccdbaad11e29518752ab3cea1b1c2037dd58.jpg) +(d) DBF Output +(i) DBF Output + +![](images/3223f8ca4d840e240845daf9bacd6cef968da4c7effed8a6c015cd4d7d4a1844.jpg) +(e) RGB GT +(j) RGB GT + +![](images/08b103ad273d966a1de7e180b799fe2f8304f3a6fbaa2b49dfc8651e88c5a7b6.jpg) +(f) DBLE Output +(k) DBLE Output + +is used as a loss to encourage the DBF to learn to restore monochrome images with more details from low-light raw images. We hypothesize that the generated monochrome raw image can enhance the low-light image by introducing more information into the subsequent module. + +# 3.2. Dual Branch Low-Light Image Enhancement Module + +There are many differences between the colored raw image and monochrome image: 1) colored raw images have mosaic patterns; 2) the colored raw images consist of four channels with a resolution of $\frac{H}{2} \times \frac{W}{2}$ , while their counterparts consist of one channel with $H \times W$ resolution; 3) + +no color information is included in the monochrome images; 4) better illuminating information is preserved on monochrome images as the monochrome camera sensor can better capture the light. + +Based on the above observations, we propose a dual branch low-light image enhancement (DBLE) module (see Fig. 3), which treats the DBF generated monochrome raw image and colored raw image separately in the down-sampling process. Meanwhile, different level feature maps of the two down-sampling branches are fused based on concatenation and followed by channel-wise attention (CA) layer [8] in the up-sampling branch to synthesize the human-visual ready RGB image $I_{rgb} \in \mathbb{R}^{H \times W \times 3}$ . The + +DBLE module is defined as: + +$$ +I _ {R G B} = f _ {C} \left(A _ {\text {C o l o r}}; A _ {\text {M o n o}}\right), \tag {2} +$$ + +where $f_{C}$ is a specifically designed fully convolutional network, which is shown in Fig. 3 (a). L1 distance between the ground truth RGB image $I_{RGB}^{GT}$ and predicted image $I_{RGB}$ is used as the loss to encourage the DBLE to learn to restore visual-ready RGB output from low-light raw images. + +As the conventional U-net network treats features from each channel equally, directly concatenating the feature map from the monochrome raw branch and colored raw branch may lead to contradiction due to the domain gap. The usage of strided convolution and transposed convolution layers will also lead to spatial information loss. Motivated by [32], after the concatenation operation, a CA layer [8] is adopted to achieve a channel-wise attention recalibration in DBLE to bridge the gap between monochrome and color images. The CA layer can explicitly model the interaction of colored raw and monochrome raw modalities to exploit the complementariness and reduce contradiction from both domains. + +It has been reported that upsampling layers (transposed convolutional layers) used in U-net causes images to be distorted by checkerboard artifacts [13, 19, 24, 25]. We also found such checkerboard artifacts in our settings on U-net, especially for images with white backgrounds. In our work, the CA layer also serves a role in avoiding checkerboard artifacts. As downscale and upscale operations are included in the CA layer, the CA layer is similar to the resize-convolution operation which discourages high-frequency artifacts in a weight-tying manner [19]. + +# 3.3. Dataset Design + +Mono-Colored Raw Paired (MCR) Dataset. To the best of our knowledge, no existing dataset contains monochrome and Bayer raw image pairs captured by the same type of sensors. To establish the dataset, we capture image pairs of the same scenes with two cameras, denoted as Cam-Color and Cam-Mono3. Both cameras have the same 1/2-inch CMOS sensor and output a $1,280\mathrm{H}\times 1,024\mathrm{V}$ imaging pixel array. However, only Cam-Color is equipped with a Bayer color filter. Cam-Color is used to capture colored raw images in our work, and Cam-Mono captures monochrome raw images. + +We collect the data in both indoor and outdoor conditions. The illuminance at the indoor scenes is between 50 lux and 2,000 lux under regular lights. The outdoor images were captured during daytime and night, under sun lighting or street lighting, with an illuminance between 900 lux and 14,000 lux. The captured scenes include toys, books, stationery objects, street views, and parks. + +Table 1. Summary of the dataset + +
ScenesExposure time (s)Data PairsFixed Settings
Indoor fixed position1/256, 1/128, 1/64, 1/32, 1/16, 1/8, 1/4, 3/82744 pairsFormat: .raw, resolution: 1280*1024
Indoor sliding platform1/256, 1/128, 1/64, 1/32, 1/16, 1/8, 1/4, 3/8800 pairs
Outdoor sliding platform1/4096, 1/2048, 1/1024, 1/512, 1/256, 1/128, 1/64, 1/32440 pairs
+ +The cameras are mounted on the sliding platform on sturdy tripods or a fixed platform on a sturdy table. When mounted on the sliding platform, the camera is adjusted to the same position by sliding the platform to minimize the position displacement among images captured by two cameras in the same scene. When mounted on the fixed platform, the camera is attached to the same position as the platform to minimize the position displacement. Camera gain is set with the camera default value. Focal lengths are adjusted to maximize the quality of the images under long exposure. The exposure time is adjusted according to the specific scene environment. + +Position displacement is unavoidable in the capture process. Hence, it is necessary to align the images captured from two cameras. The best exposure colored raw and monochrome raw is selected to align the images captured by two cameras in the same scenes. Then, homography feature matching is utilized to extract key points from the selected image pair, and a brute force matcher is utilized to find the matched key points. The extracted locations of good matches are filtered based on an empirical thresholding method. A homography matrix can be decided based on the filtered location of good matches. Finally, the homography transformation is applied to other images captured from the same scene. The statistic information of the dataset is summarized in Table 1. Fig. 2(a) demonstrates a series of monochrome-colored raw paired images from the dataset. + +Artificial Mono-Colored Raw SID Dataset. The original SID dataset collected in [3] contains 5,094 raw short-exposure images taken from the indoor and outdoor environments, while each short-exposure image has a corresponding long-exposure reference image. The short exposure time is usually between 1/30 second and 1/10 second, and the exposure time of the corresponding long-exposure image is 10 to 30 seconds. + +However, monochrome images are not available in the original SID dataset. To address this, we built an artificial Mono-colored raw dataset based on SID [3] dataset in this work. More specifically, we first convert the long-exposure raw images in the original SID dataset to RGB images, and these RGB images are further converted to grayscale by forming a weighted sum of the R, G, and B channels, as shown in Fig. 3(h). Such conversion can eliminate the hue and saturation information while retaining the luminance information. + +![](images/810ceb6d35df676a9d18a4bf60f960af8a783ebbc965ac9c40d3b6d2a131e7d5.jpg) +(a) Input raw + +![](images/7aaf360f6a9ff7f3cc21a082994c13c872c2f84d1f307fbde5e1d48c1aebc1f3.jpg) +(b) CSAIE + +![](images/2457e0d597f9fbd88f190d8899872bc1568ece7d4ad55c78b29049947e4fc890.jpg) + +![](images/ee39515e1b8044c715880deba2d9184f8f90f15db1185c64f6cf08ab2914ea74.jpg) + +![](images/308319e9965e199eee4d2dc3ea32ea91557b4c2d974b5dc32f6abb2d84c0700d.jpg) + +![](images/dbee6f3778b1b569fd4d563dc6ede19b7009d0bbb9102a8cc75794965c2d22a7.jpg) + +![](images/8f81d3e0019eeb5e185eee565cdf67ab583709074c37da7db01e5d8e03041ed3.jpg) + +![](images/2a3f5c6c415c69b4f21ac0c7c44dadfe5a6827292b41710337bfbef774f0d072.jpg) +(c) HE + +![](images/e8b6aefe5b9094ed1b1b87e89230ea5532e70df61f223eb4d9974e7159c8ca12.jpg) +(d) SGN [6] + +![](images/a8e9be97366ac3c34da7811a6b6404398081da9892dcf690e9585205d11f7eb6.jpg) +(e) DID [18] + +![](images/9f58e229f33c87c376da7d8c7a656e289ead7994ca56af3ad0626631275d4bc5.jpg) +(f) RED [14] + +![](images/d7cdf76387085d7c6ca0f70b859e176855e5a2c6cd3986c80ab08d8d9583c668.jpg) +(g) SID [3] + +![](images/bd781eb0e87764ac232ba67cebb4abe5d1016a2b1fcfb639984caa510c53d277.jpg) +(h) LDC [31] + +![](images/ab0a91485b9f5d48f6ada4d0e54223847948f5bdd4a220f5ea1262b8db8dad16.jpg) +(i) Ours + +![](images/995945318c5572558cb86923eb4cac5b7379a060e116aa91b4e95fcd2e059f3a.jpg) +(j) GT + +![](images/e0818c867fd6dbb506dc2eae10f55b3387a36325dda752eb713f83d4b3188fa6.jpg) +(A) Input raw +(F) RED +Figure 4. Visual results of state-of-the-art methods and ours on low-light images RAW in our dataset. The larger boxes show the zoom-in version of the regions in the smaller boxes of the same color. The 'CSAIE' means 'Commercial Software Automatic Image Enhancement'. + +![](images/4ac98661af38b2f012b85c1a7a7eb80ea7a95c64630a42c8017299a61d6578f3.jpg) +(B) CSAIE +(G) SID [3] + +![](images/3121186b5c974b44004338155379d3be614d7569f75a78a10e10e6aced3d86c3.jpg) +(C) HE +(H) LDC [31] + +![](images/888982965f4a37e2ec4b3e6ec6a5ab997dd7088f708caac0aa326e6ec176f79f.jpg) +(D) SGN [6] +(I) Ours + +![](images/de432d8b1a242aeba45078abefbb626d3b2e3b959654c5e67e02a00004aee343.jpg) +(E) DID [18] +(J) GT + +# 3.4. Training + +By default, we pre-process the input images similarly to [3] where images' pixel values are amplified with predefined ratios followed by a pack raw operation. We incorporate the CA layer [8] to bridge the domain gap between features from monochrome and colored raw images. The whole system is trained jointly with L1 loss to directly output the corresponding long-exposure monochrome and sRGB images. + +The dataset is split into train and test sets without overlapping by the ratio of 9:1. The input patches are randomly cropped from the original images with $512 \times 512$ . In the case of raw image input, the RGGB pixel position is carefully preserved in the cropping process. We implement our model with Pytorch 1.7 on the RTX 3090 GPU platform, and we train the networks from scratch using the Adam [12] optimizer. The learning rate was set to $10^{-4}$ and $10^{-5}$ after converging, and the weight-decay was set to 0. + +# 4. Experiments and Results + +In this section, we present a comprehensive performance evaluation of the proposed low-light image enhancement system. To measure the performance, we evaluate the system performance in terms of peak signal-to-noise ratio (PSNR) and structural similarity (SSIM). For PSNR and SSIM, a higher value means a better similarity between output image and ground truth. + +# 4.1. Comparison with State-of-the-Art Methods + +Qualitative Comparison. We first visually compare the results of the proposed method with other state-of-the-art deep learning-based image enhancement methods, including SID [3], DID [18],SGN [6],LDC [31],and RED [14]. In addition, the traditional histogram equalization (HE) approach and a Commercial Software Automatic Image Enhancement (CSAIE) method are also included in the com + +Table 2. Comparison with SOTA. + +
MCR DatasetSID Dataset
PSNR (dB)SSIMPSNR (dB)SSIM
RED [14] (21,CVPR)25.740.85128.660.790
SGN [6] (19,ICCV)26.290.88228.910.789
DID [18] (19,ICME)26.160.88828.410.780
SID [3] (18,CVPR)29.000.90628.880.787
LDC [31] (20,CVPR)29.360.90429.560.799
Ours31.690.90829.650.797
+ +parison. Fig. 4 shows the results of different methods on two low-light images (see more results in supplementary). + +As indicated by Fig. 4, our method can achieve better enhancement and denoising visual performance. Specifically, checkerboard artifacts are usually found on SID for images with white background. This is because of the usage of upsampling layers in the model. Foggy artifacts are usually observed on SGN; color distortions also are found on SGN, DID, and RED, as are shown in Fig. 4 (A-J), where the green plant enclosed by the yellow box becomes black after restoring by SGN, DID, and RED. Compared to LDC, our methods can preserve more details as over-smoothing is usually found on LDC. Note that over-smoothing may be more visual appealing, but details will be lost, for example, the wall crack becomes invisible on LDC as shown in Fig. 4 (H-I). In a nutshell, Fig. 4 demonstrates the satisfying visual performance achieved by our method, with fewer artifacts but more convincing restoration. + +Quantitative Comparison. A quantitative comparison against the state-of-the-art enhancement methods has also been performed. For a fair comparison, SID [3], DID [18], SGN [6], LDC [31], and RED [14] were trained on the MCR dataset. + +As Table 2 shows, our proposed method outperforms its counterparts by a large margin. Specifically, our method can achieve a PSNR of 31.69dB on MCR dataset, which is $7.9\%$ higher than the second-best method, i.e., the LDC [31]. Our method can also achieve an SSIM of 0.908, which is the highest among all compared methods. + +Compared to other methods, we incorporate the extra monochrome information into the processing pipeline, hence state-of-the-art performance can be achieved. As shown in the first two data rows in Table 2, both RED [14] and SGN [6] can only achieve a PSNR of around $26\mathrm{dB}$ . Both RED and SGN aim at reducing the computational cost and improving efficiency. Hence it is reasonable to observe the performance degradation. The result on DID [18] from Table 2 suggests that replacing U-net with residual learning cannot achieve superior performance on our dataset. + +On the MCR dataset, SID [3] achieves a PSNR of only 29.00dB. The checkerboard artifact may be the reason. From Table 2, we observe that LDC [31] achieves the second-best performance. This is because they are based on + +a frequency-based decomposition and enhancement model, which can better restore the noisy image and avoid noise amplification. We also train our model on the modified SID dataset to further validate our method for a fair comparison. The performance results are shown in the SID column in Table 2. As the results suggest, our method also outperforms all its counterparts. Specifically, our method can achieve a PSNR of $29.65\mathrm{dB}$ , which is around 0.1dB higher than LDC, while the SSIM can achieve similar performance. + +Other methods including SID, DID,SGN,and RED can only achieve a PSNR around 28dB. In summary, the results show that our model is more effective in enhancing lowlight images with noise. The performance of most existing methods is upper bounded by the information contained in the raw data. In our proposed pipeline, we further extend the upper bound by considering the monochrome domain. Hence, better performance can be achieved. + +# 4.2. Ablation Studies + +In this subsection, we provide several ablation studies for the proposed system to better demonstrate the effectiveness of each module of our system. + +Checkerboard artifacts are found in our preliminary exploration stage, especially for images with white backgrounds. To eliminate checkerboard artifacts, we incorporate the CA layer [8] in the DBLE module. In this ablation study, we first remove the CA layer in the DBLE module to demonstrate the checkerboard artifacts' elimination and performance upgrading. Besides, we also train an original SID [3] network on our dataset to show the visual effect of the checkerboard artifacts of U-net. The restored images from SID, DBLE without CA layer, and DBLE with CA layer are shown in Fig. 5. It is observed that checkerboard artifacts can be perfectly avoided by introducing the CA layer. Besides, as per the quantitative results shown in Table 3, CA layer can boost the image enhancement performance as the PSNR increases to $31.69\mathrm{dB}$ compared with its counterpart of $29.23\mathrm{dB}$ . + +We also train the model to learn the ratio directly instead of amplifying image pixel values with predefined ratios. Hence, we train a model without amplifying the input raw images with the predefined ratio. As a result, as shown in Table 3, such a model can still achieve comparable performance, with only a slight decrease in PSNR and SSIM. + +As suggested by [3], we change the packraw-based input into original one-channel raw images. As shown in the row of baseline without packraw in Table 3, PSNR and SSIM degradation is observed. We argue that the packing of raw can assist the model to better process the color information. + +The change of loss function from L1 to L2 cannot achieve better performance, as shown in Table 3. We also try to change the input raw into sRGB format. The result in the sRGB row from Table 3 shows a significant perfor + +![](images/64539c4d02c42e93e224ab70726c0c7bd15611cf641d8794c8ab966908050879.jpg) +(a) GT + +![](images/f84434afa637b08dfe53dbac6f2fa204fcad95d65e4fb58ea7bdbde63472a86b.jpg) +(b) SID [3] + +![](images/afa1df0c7f8332c68dbfb2bf8a2ffc61112f71ba3e24985ca7b53544098a53c5.jpg) +(c) Ours w/o CA [8] +Figure 5. Visual demonstration of checkerboard artifacts under different settings. + +![](images/0ac53dd99007d7bff00ff55e14833b16e9c03ae3e1201cb7487ea806a24ccf6e.jpg) +(d) Ours with CA [8] + +Table 3. Ablation study on the MCR dataset. + +
DBFDBLE
PSNR (dB)SSIMPSNR (dB)SSIM
Baseline21.06070.825431.69050.9083
Baseline wo CA [8]20.26730.794829.23500.8732
Baseline wo ratio19.89780.786829.35280.8878
Baseline wo packraw20.78460.803428.87280.8657
Baseline l1→l220.45870.801630.23590.8974
Baseline w/o DBF--29.99460.8839
Baseline raw→sRGB18.23690.762527.35210.8295
+ +mance drop, which is consistent with other works [3, 31]. + +The DBF module plays a key role in our system in generating the monochrome images, which assist the DBLE module in restoring the low-light images into monitor-ready sRGB images. We also explore the performance of a model without DBF module and the monochrome branch. As the results in Table 3 show, the performance drops to $29.99\mathrm{dB} / 0.883$ in terms of PSNR/SSIM when the DBF module is removed, hence providing a solid validation of the DBF's effectiveness. + +# 5. Limitations and Future Work + +There are various aspects to improve in the future. The cameras we adopted in this work can only output 8-bit raw images, the 16-bit cameras will be used to collect data in the future to cover more diverse scenes and objects. Besides, the network complexity needs to be more light-weighted to deploy the proposed system in the real world. Extending the proposed work to videos will also be one future direction. We hope the work presented in this paper can provide preliminary explorations for low-light image enhancement research in community and industry. When it comes to some extremely dark images on our MCR Dataset, the existing low-light image enhancement algorithms (SID [3], LDC [31], and ours) show unsatisfactory results sometimes. The restored images usually lost the high-frequency edge information compared to the ground truth image and became blurred (see in supplementary). Extremely dark settings sometimes yield quite weak signals in each color chan + +nel, leading to those color artifacts that commonly exist in both SoTA and our methods and require further study. + +# 6. Conclusion + +Removing the Bayer-filter allows more photos to be captured by the sensor. Motivated by this fact, this work proposes an end-to-end fully convolutional network consisting of a DBF module and a dual branch low-light enhancement module to achieve low-light image enhancement on a single colored camera system. The DBF module is devised to predict the corresponding monochrome raw image from the color camera raw data input. The DBLE is designed to restore the low-light raw images based on the raw input and the DBF-predicted monochrome raw images. DBLE treats the colored raw and monochrome raw separately by using a dual branch network architecture. In the DBLE upsampling stream, features from both monochrome raw and colored raw are fused together and a channel-wise attention is applied to the fused features. + +We also propose a Mono-Colored Raw paired dataset (MCR) which includes color and monochrome raw image pairs collected by a color camera with Bayer-Filter and a monochrome camera without Bayer-Filter. The dataset is collected in various scenes, and each colored raw image has a corresponding monochrome raw image captured with the same exposure settings. To better show our superiority, the SID dataset is also adopted in the evaluation. Gray image is generated from the corresponding ground truth color image in the SID dataset to serve as the monochrome image. Subsequently, a model is trained on the modified dataset to verify the performance. + +Our experiments prove that significant performance can be achieved by leveraging raw sensor data and data-driven learning. Our method can overcome the checkerboard artifact which is found on U-net, while preserving the visual quality. Our quantitative experiments indicate that our methods can achieve the state-of-the-art performance: a PSNR of 31.69dB on our own dataset, and 29.65dB on the SID dataset. + +# References + +[1] Tarik Arici, Salih Dikbas, and Yucel Altunbasak. A histogram modification framework and its application for image contrast enhancement. IEEE Transactions on image processing, 18(9):1921-1935, 2009. 2 +[2] Chen Chen, Qifeng Chen, Minh N Do, and Vladlen Koltun. Seeing motion in the dark. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 3185-3194, 2019. 3 +[3] Chen Chen, Qifeng Chen, Jia Xu, and Vladlen Koltun. Learning to see in the dark. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3291-3300, 2018. 1, 2, 3, 4, 5, 6, 7, 8 +[4] Xuan Dong, Guan Wang, Yi Pang, Weixin Li, Jiangtao Wen, Wei Meng, and Yao Lu. Fast efficient algorithm for enhancement of low lighting video. In 2011 IEEE International Conference on Multimedia and Expo (ICME), pages 1-6. IEEE, 2011. 2 +[5] Minhao Fan, Wenjing Wang, Wenhan Yang, and Jiaying Liu. Integrating semantic segmentation and retina model for low-light image enhancement. In Proceedings of the 28th ACM International Conference on Multimedia (ACMMM), pages 2317-2325, 2020. 2 +[6] Shuhang Gu, Yawei Li, Luc Van Gool, and Radu Timofte. Self-guided network for fast image denoising. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 2511-2520, 2019. 3, 6, 7 +[7] Chunle Guo, Chongyi Li, Jichang Guo, Chen Change Loy, Junhui Hou, Sam Kwong, and Runmin Cong. Zero-reference deep curve estimation for low-light image enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1780-1789, 2020. 2 +[8] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7132-7141, 2018. 4, 5, 6, 7, 8 +[9] Haiyang Jiang and Yinqiang Zheng. Learning to see moving objects in the dark. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 7324-7333, 2019. 2, 3 +[10] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, pages 694–711. Springer, 2016. 2 +[11] Guisik Kim, Dokyeong Kwon, and Junseok Kwon. Low-lightgan: Low-light enhancement via advanced generative adversarial network with task-driven training. In 2019 IEEE International Conference on Image Processing (ICIP), pages 2811-2815. IEEE, 2019. 2 +[12] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 +[13] Yuma Kinoshita and Hitoshi Kiya. Fixed smooth convolutional layer for avoiding checkerboard artifacts in cnns. In ICASSP 2020-2020 IEEE International Conference on + +Acoustics, Speech and Signal Processing (ICASSP), pages 3712-3716. IEEE, 2020. 5 +[14] Mohit Lamba and Kaushik Mitra. Restoring extremely dark images in real time. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3487-3497, 2021. 3, 6, 7 +[15] Chulwoo Lee, Chul Lee, and Chang-Su Kim. Contrast enhancement based on layered difference representation of 2d histograms. IEEE Transactions on Image Processing, 22(12):5372-5384, 2013. 2 +[16] Mading Li, Xiaolin Wu, Jiaying Liu, and Zongming Guo. Restoration of unevenly illuminated images. In 2018 25th IEEE International Conference on Image Processing (ICIP), pages 1118-1122. IEEE, 2018. 2 +[17] Zhetong Liang, Weijian Liu, and Ruohy Yao. Contrast enhancement by nonlinear diffusion filtering. IEEE Transactions on Image Processing, 25(2):673-686, 2015. 2 +[18] Paras Maharjan, Li Li, Zhu Li, Ning Xu, Chongyang Ma, and Yue Li. Improving extreme low-light image denoising via residual learning. In 2019 IEEE International Conference on Multimedia and Expo (ICME), pages 916-921. IEEE, 2019. 3, 6, 7 +[19] Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 1(10):e3, 2016.5 +[20] Hao Ouyang, Zifan Shi, Chenyang Lei, Ka Lung Law, and Qifeng Chen. Neural camera simulators. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7700-7709, 2021. 3 +[21] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted intervention, pages 234-241. Springer, 2015. 2 +[22] Eli Schwartz, Raja Giryes, and Alex M Bronstein. Deepisp: Toward learning an end-to-end image processing pipeline. IEEE Transactions on Image Processing, 28(2):912-923, 2018. 1, 2, 3 +[23] Haonan Su and Cheolkon Jung. Low light image enhancement based on two-step noise suppression. In 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1977-1981. IEEE, 2017. 2 +[24] Yusuke Sugawara, Sayaka Shiota, and Hitoshi Kiya. Superresolution using convolutional neural networks without any checkerboard artifacts. In 2018 25th IEEE International Conference on Image Processing (ICIP), pages 66-70. IEEE, 2018. 5 +[25] Yusuke Sugawara, Sayaka Shiota, and Hitoshi Kiya. Checkerboard artifacts free convolutional neural networks. APSIPA Transactions on Signal and Information Processing, 8, 2019. 5 +[26] Ruixing Wang, Qing Zhang, Chi-Wing Fu, Xiaoyong Shen, Wei-Shi Zheng, and Jiaya Jia. Underexposed photo enhancement using deep illumination estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6849-6857, 2019. 2 +[27] Yuanchen Wang, Xiaonan Zhu, Yuong Zhao, Ping Wang, and Jiquan Ma. Enhancement of low-light image based on + +wavelet u-net. In Journal of Physics: Conference Series, volume 1345, page 022030. IOP Publishing, 2019. 2 +[28] Chen Wei, Wenjing Wang, Wenhan Yang, and Jiaying Liu. Deep retina decomposition for low-light enhancement. arXiv preprint arXiv:1808.04560, 2018. 2 +[29] Xiaomeng Wu, Xinhao Liu, Kaoru Hiramatsu, and Kunio Kashino. Contrast-accumulated histogram equalization for image enhancement. In 2017 IEEE international conference on image processing (ICIP), pages 3190–3194. IEEE, 2017. 2 +[30] Ke Xu, Xin Yang, Baocai Yin, and Rynson WH Lau. Learning to restore low-light images via decomposition-and-enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2281-2290, 2020. 2 +[31] Ke Xu, Xin Yang, Baocai Yin, and Rynson WH Lau. Learning to restore low-light images via decomposition-and-enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2281-2290, 2020. 3, 6, 7, 8 +[32] Lu Zhang, Zhiyong Liu, Shifeng Zhang, Xu Yang, Hong Qiao, Kaizhu Huang, and Amir Hussain. Cross-modality interactive attention network for multispectral pedestrian detection. Information Fusion, 50:20-29, 2019. 5 +[33] Yonghua Zhang, Jiawan Zhang, and Xiaojie Guo. Kindling the darkness: A practical low-light image enhancer. In Proceedings of the 27th ACM international conference on multimedia (ACMMM), pages 1632-1640, 2019. 2 +[34] Minfeng Zhu, Pingbo Pan, Wei Chen, and Yi Yang. Eemefn: Low-light image enhancement via edge-enhanced multi-exposure fusion network. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13106-13113, 2020. 2 \ No newline at end of file diff --git a/abandoningthebayerfiltertoseeinthedark/images.zip b/abandoningthebayerfiltertoseeinthedark/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..40c7aa8ea31e10ac40a01a47f1cb5c65d655ea5d --- /dev/null +++ b/abandoningthebayerfiltertoseeinthedark/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fadb408711b0aa6488d6f0af099b5c9a39ef61f8ac1880d2f71bbf634006068c +size 550259 diff --git a/abandoningthebayerfiltertoseeinthedark/layout.json b/abandoningthebayerfiltertoseeinthedark/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c47ea7cfbb45cb15b0f8dbcfa5a7fe65b4069269 --- /dev/null +++ b/abandoningthebayerfiltertoseeinthedark/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9c9fde872764aa664df93776880c26a2927e4ed80b887034557147ed797298b +size 375247 diff --git a/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_content_list.json b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..07eab4a386795089977207276b904bf54e2f43ac --- /dev/null +++ b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5df04da9cb5a25d8bb8f985d9b38ba2fd9e9690f7fd98f08533310c4a93a70c7 +size 73706 diff --git a/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_model.json b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..51fc3efbed43f0db4655cca6b36ef7deb5ec7c3d --- /dev/null +++ b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bc18c05efb1a30e9d52c927843670766bf6d741f3fee538f11b242f891471fd +size 93465 diff --git a/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_origin.pdf b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e0b637d2839d599e28beec353f5759c4e83f1394 --- /dev/null +++ b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/165b1a6d-d340-46a6-8a6b-371c91127e9b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89789c736c71cc25a75731f8dd2f555c41815591208f6d65e8afba8243bc4e9e +size 6417627 diff --git a/abodatasetandbenchmarksforrealworld3dobjectunderstanding/full.md b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b684570fba28bf694d0a215d88351f7c2e46c78b --- /dev/null +++ b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/full.md @@ -0,0 +1,259 @@ +# ABO: Dataset and Benchmarks for Real-World 3D Object Understanding + +Jasmine Collins1, Shubham Goel1, Kenan Deng2, Achleshwar Luthra3, Leon Xu1,2, Erhan Gundogdu2, Xi Zhang2, Tomas F. Yago Vicente2, Thomas Dideriksen2, Himanshu Arora2, Matthieu Guillaumin2, and Jitendra Malik1 + +UC Berkeley, 2 Amazon, 3 BITS Pilani + +![](images/a607b822c22f3805cb0b5410b8dac6db5718957e3ac10f2a3fe2936f36b21ade.jpg) +Figure 1. ABO is a dataset of product images and realistic, high-resolution, physically-based 3D models of household objects. We use ABO to benchmark the performance of state-of-the-art methods on a variety of realistic object understanding tasks. + +![](images/f40075b894e735d382b2501316db33d1e309c093cfaf204a4696a2a5bcd252f9.jpg) + +# Abstract + +We introduce Amazon Berkeley Objects (ABO), a new large-scale dataset designed to help bridge the gap between real and virtual 3D worlds. ABO contains product catalog images, metadata, and artist-created 3D models with complex geometries and physically-based materials that correspond to real, household objects. We derive challenging benchmarks that exploit the unique properties of ABO and measure the current limits of the state-of-the-art on three open problems for real-world 3D object understanding: single-view 3D reconstruction, material estimation, and cross-domain multi-view object retrieval. + +# 1. Introduction + +Progress in 2D image recognition has been driven by large-scale datasets [15,26,37,43,56]. The ease of collecting 2D annotations (such as class labels or segmentation masks) has led to the large scale of these diverse, in-the-wild datasets, which in turn has enabled the development of 2D computer vision systems that work in the real world. + +Theoretically, progress in 3D computer vision should follow from equally large-scale datasets of 3D objects. However, collecting large amounts of high-quality 3D annotations (such as voxels or meshes) for individual real-world objects poses a challenge. One way around the challenging problem of getting 3D annotations for real images is to focus only on synthetic, computer-aided design (CAD) models [10, 35, 70]. This has the advantage that the data is large in scale (as there are many 3D CAD models available for download online) but many of the models are low quality or untextured and do not exist in the real world. This has led to a variety of 3D reconstruction methods that work well on clear-background renderings of synthetic objects [13, 24, 46, 65] but do not necessarily generalize to real images, new categories, or more complex object geometries [5, 6, 58]. + +To enable better real-world transfer, another class of 3D datasets aims to link existing 3D models with real-world images [63, 64]. These datasets find the closest matching CAD models for the objects in an image and have human annotators align the pose of each model to best match the + +image. While this has enabled the evaluation of 3D reconstruction methods in-the-wild, the shape (and thus pose) matches are approximate. Further, because this approach relies on matching CAD models to images, it inherits the limitations of the existing CAD model datasets (i.e. poor coverage of real-world objects, basic geometries and textures). + +The IKEA [41] and Pix3D [57] datasets sought to improve upon this by annotating real images with exact, pixel-aligned 3D models. The exact nature of such datasets has allowed them to be used as training data for single-view reconstruction [21] and has bridged some of the synthetic-to-real domain gap. However, the size of the datasets are relatively small (90 and 395 unique 3D models, respectively), likely due to the difficulty of finding images that exactly match 3D models. Further, the larger of the two datasets [57] only contains 9 categories of objects. The provided 3D models are also untextured, thus the annotations in these datasets are typically used for shape or pose-based tasks, rather than tasks such as material prediction. + +Rather than trying to match images to synthetic 3D models, another approach to collecting 3D datasets is to start with real images (or video) and reconstruct the scene by classical reconstruction techniques such as structure from motion, multi-view stereo and texture mapping [12, 54, 55]. The benefit of these methods is that the reconstructed geometry faithfully represents an object of the real world. However, the collection process requires a great deal of manual effort and thus datasets of this nature tend to also be quite small (398, 125, and 1032 unique 3D models, respectively). The objects are also typically imaged in a controlled lab setting and do not have corresponding real images of the object "in context". Further, included textured surfaces are assumed to be Lambertian and thus do not display realistic reflectance properties. + +Motivated by the lack of large-scale datasets with realistic 3D objects from a diverse set of categories and corresponding real-world multi-view images, we introduce Amazon Berkeley Objects (ABO). This dataset is derived from Amazon.com product listings, and as a result, contains imagery and 3D models that correspond to modern, real-world, household items. Overall, ABO contains 147,702 product listings associated with 398,212 unique catalog images, and up to 18 unique metadata attributes (category, color, material, weight, dimensions, etc.) per product. ABO also includes "360° View" turntable-style images for 8,222 products and 7,953 products with corresponding artist-designed 3D meshes. In contrast to existing 3D computer vision datasets, the 3D models in ABO have complex geometries and high-resolution, physically-based materials that allow for photorealistic rendering. A sample of the kinds of real-world images associated with a 3D model from ABO can be found in Figure 1, and sam + +
Dataset# Models# ClassesReal imagesFull 3DPBR
ShapeNet [10]51.3K55XX
3D-Future [19]16.6K8XX
Google Scans [54]1K-XX
CO3D [53]18.6K50XX
IKEA [42]21911X
Pix3D [57]3959X
PhotoShape [51]5.8K1X
ABO (Ours)8K63
+ +Table 1. A comparison of the 3D models in ABO and other commonly used object-centric 3D datasets. ABO contains nearly 8K 3D models with physically-based rendering (PBR) materials and corresponding real-world catalog images. + +![](images/48b9fe0e71a7fa23cce8fb1ddd3fd6b8209fc6338f1fb23fc0edb85a20ce8cbf.jpg) +Figure 2. Posed 3D models in catalog images. We use instance masks to automatically generate 6-DOF pose annotations. + +ple metadata attributes are shown in Figure 3. The dataset is released under CC BY-NC 4.0 license and can be downloaded at https://amazon-berkeley-objects.s3. amazonaws.com/index.html. + +To facilitate future research, we benchmark the performance of various methods on three computer vision tasks that can benefit from more realistic 3D datasets: (i) single-view shape reconstruction, where we measure the domain gap for networks trained on synthetic objects, (ii) material estimation, where we introduce a baseline for spatially-varying BRDF from single- and multi-view images of complex real world objects, and (iii) image-based multi-view object retrieval, where we leverage the 3D nature of ABO to evaluate the robustness of deep metric learning algorithms to object viewpoint and scenes. + +# 2. Related Work + +3D Object Datasets ShapeNet [10] is a large-scale database of synthetic 3D CAD models commonly used for training single- and multi-view reconstruction models. IKEA Objects [42] and Pix3D [57] are image collections with 2D-3D alignment between CAD models and real images, however these images are limited to objects for which there is an exact CAD model match. Similarly, Pascal3D+ [64] and ObjectNet3D [63] provide 2D-3D alignment for images and provide more instances and categories, however + +
BenchmarkDomainClassesInstancesImagesStructureRecall@1
trainvaltesttrainvaltest-targettest-query
CUB-200-2011Birds200---59940-579415 parts79.2% [30]
Cars-196Cars196---81440-8041-94.8% [30]
In-ShopClothes253997039852588201261214218Landmarks, poses, masks92.6% [33]
SOPEbay1211318011316595510-60502-84.2% [30]
ABO (MVR)Amazon5624906685483629884026235431323328Subset with 3D models30.0%
+ +Table 2. Common image retrieval benchmarks for deep metric learning and their statistics. Our proposed multi-view retrieval (MVR) benchmark based on ABO is significantly larger, more diverse and challenging than existing benchmarks, and exploits 3D models. + +![](images/709cab82e55696abb77b3c3a91783737e47d112f5664225f504da3b06b198817.jpg) +Figure 3. Sample catalog images and attributes that accompany ABO objects. Each object has up to 18 attribute annotations. + +![](images/6b3db90ad3e0b943bf54cabe8274e150835b7117577577f9e638db3433880b15.jpg) +Figure 4. 3D model categories. Each category is also mapped to a synset in the WordNet hierarchy. Note the y-axis is in log scale. + +the 3D annotations are only approximate matches. The Object Scans dataset [12] and Objectron [3] are both video datasets that have the camera operator walk around various objects, but are limited in the number of categories represented. CO3D [53] also offers videos of common objects from 50 different categories, however they do not provide full 3D mesh reconstructions. + +Existing 3D datasets typically assume very simplistic texture models that are not physically realistic. To improve on this, PhotoShapes [51] augmented ShapeNet CAD models by automatically mapping spatially varying (SV-) bidirectional reflectance distribution functions (BRDFs) to meshes, yet the dataset consists only of chairs. The works in [17, 20] provide high-quality SV-BRDF maps, but only for planar surfaces. The dataset used in [32] contains only homogenous BRDFs for various objects. [40] and [7] introduce datasets containing full SV-BRDFs, however their + +models are procedurally generated shapes that do not correspond to real objects. In contrast, ABO provides shapes and SV-BRDFs created by professional artists for real-life objects that can be directly used for photorealistic rendering. + +Table 1 compares the 3D subset of ABO with other commonly used 3D datasets in terms of size (number of objects and classes) and properties such as the presence of real images, full 3D meshes and physically-based rendering (PBR) materials. ABO is the only dataset that contains all of these properties and is much more diverse in number of categories than existing 3D datasets. + +3D Shape Reconstruction Recent methods for single-view 3D reconstruction differ mainly in the type of supervision and 3D representation used, whether it be voxels, point clouds, meshes, or implicit functions. Methods that require full shape supervision in the single-view [18, 22, 46, 57, 69] and multi-view [13, 31, 65] case are often trained using ShapeNet. There are other approaches that use more natural forms of multi-view supervision such as images, depth maps, and silhouettes [31, 59, 62, 66], with known cameras. Of course, multi-view 3D reconstruction has long been studied with classical computer vision techniques [27] like multi-view stereo and visual hull reconstruction. Learning-based methods are typically trained in a category-specific way and evaluated on new instances from the same category. Out of the works mentioned, only [69] claims to be category-agnostic. In this work we are interested in how well these ShapeNet-trained networks [13, 22, 46, 69] generalize to more realistic objects. + +Material Estimation Several works have focused on modeling object appearance from a single image, however realistic datasets available for this task are relatively scarce and small in size. [38] use two networks to estimate a homogeneous BRDF and an SV-BRDF of a flat surface from a single image, using a self-augmentation scheme to alleviate the need for a large training set. However, their work is limited to a specific family of materials, and each separate material requires another trained network. [67] extend the idea of self-augmentation to train with unlabeled data, but their work is limited by the same constraints. [16] use a modified U-Net and rendering loss to predict the SVBRDFs of flash-lit photographs consisting of only a flat sur + +![](images/32491d64102454f75b8a2dfe9a08f9d564c01993e76d997c37127c7257b43409.jpg) +Figure 5. Qualitative 3D reconstruction results for R2N2, Occupancy Networks, GenRe, and Mesh-RCNN on ABO. All methods are pre-trained on ShapeNet and show a decrease in performance on objects from ABO. + +face. To enable prediction for arbitrary shapes, [40] propose a cascaded CNN architecture with a single encoder and separate decoder for each SV-BRDF parameter. While the method achieves good results on semi-uncontrolled lighting environments, it requires using the intermediate bounces of global illumination rendering as supervision. More recent works have turned towards using multiple images to improve SV-BRDF estimation, but still only with simplistic object geometries. For instance, [17] and [20] use multiple input images with a flash lit light source, but only for a single planar surface. [7] and [8] both use procedurally generated shapes to estimate SV-BRDFs from multi-view images. ABO addresses the lack of sufficient realistic data for material estimation, and in this work we propose a simple baseline method that can estimate materials from single or multi-view images of complex, real-world shapes. + +2D/3D Image Retrieval Learning to represent 3D shapes and natural images of products in a single embedding space has been tackled by [39]. They consider various relevant tasks, including cross-view image retrieval, shape-based image retrieval and image-based shape retrieval, but all are inherently constrained by the limitations of ShapeNet [10] (cross-view image retrieval is only considered for chairs and cars). [36] introduced 3D object representations for fine-grained recognition and a dataset of cars with real-world 2D imagery (CARS-196), which is now widely used for deep metric learning (DML) evaluation. Likewise, other datasets for DML focus on instances/fine categories of few object types, such as birds [60], clothes [44], or a few object categories [50]. + +Due to the limited diversity and the similar nature of query and target images in existing retrieval benchmarks, the performance of state-of-the-art DML algorithms are near saturation. Moreover, since these datasets come with little structure, the opportunities to analyze failure cases and improve algorithms are limited. Motivated by this, we de + +rive a challenging large-scale benchmark dataset from ABO with hundreds of diverse categories and a proper validation set. We also leverage the 3D nature of ABO to measure and improve the robustness of representations with respect to changes in viewpoint and scene. A comparison of ABO and existing benchmarks for DML can be found in Table 2. + +# 3. The ABO Dataset + +Dataset Properties The ABO dataset originates from worldwide product listings, metadata, images and 3D models provided by Amazon.com. This data consists of 147,702 listings of products from 576 product types sold by various Amazon-owned stores and websites (e.g. Amazon, PrimeNow, Whole Foods). Each listing is identified by an item ID and is provided with structured metadata corresponding to information that is publicly available on the listing's main webpage (such as product type, material, color, and dimensions) as well as the media available for that product. This includes 398, 212 high-resolution catalog images, and, when available, the turntable images that are used for the "360° View" feature that shows the product imaged at $5^{\circ}$ or $15^{\circ}$ azimuth intervals (8, 222 products). + +3D Models ABO also includes 7,953 artist-created high-quality 3D models in gTF 2.0 format. The 3D models are oriented in a canonical coordinate system where the "front" (when well defined) of all objects are aligned and each have a scale corresponding to real world units. To enable these meshes to easily be used for comparison with existing methods trained on 3D datasets such as ShapeNet, we have collected category annotations for each 3D model and mapped them to noun synsets under the WordNet [47] taxonomy. Figure 4 shows a histogram of the 3D model categories. + +Catalog Image Pose Annotations We additionally provide 6-DOF pose annotations for 6,334 of the catalog images. To achieve this, we develop an automated pipeline for pose + +
Chamfer Distance (↓)Absolute Normal Consistency (↑)
benchchaircouchcabinetlamptablebenchchaircouchcabinetlamptable
3D R2N2 [13]2.46/0.851.46/0.771.15/0.591.88/0.253.79/2.022.83/0.660.51/0.550.59/0.610.57/0.620.53/0.670.51/0.540.51/0.65
Occ Nets [46]1.72/0.510.72/0.390.86/0.300.80/0.232.53/1.661.79/0.410.66/0.680.67/0.760.70/0.770.71/0.770.65/0.690.67/0.78
GenRe [69]1.54/2.860.89/0.791.08/2.181.40/2.033.72/2.472.26/2.370.63/0.560.69/0.670.66/0.600.62/0.590.59/0.570.61/0.59
Mesh R-CNN [22]1.05/0.090.78/0.130.45/0.100.80/0.111.97/0.241.15/0.120.62/0.650.62/0.700.62/0.720.65/0.740.57/0.660.62/0.74
+ +Table 3. Single-view 3D reconstruction generalization from ShapeNet to ABO. Chamfer distance and absolute normal consistency of predictions made on ABO objects from common ShapeNet classes. We report the same metrics for ShapeNet objects (denoted in gray), following the same evaluation protocol. All methods, with the exception of GenRe, are trained on all of the ShapeNet categories listed. + +estimation based on the knowledge of the 3D model in the image, off-the-shelf instance masks [28, 34], and differentiable rendering. For each mask $\mathbf{M}$ , we estimate $\mathbf{R} \in SO(3)$ and $\mathbf{T} \in \mathbb{R}^3$ such that the following silhouette loss is minimized + +$$ +\mathbf {R} ^ {*}, \mathbf {T} ^ {*} = \operatorname * {a r g m i n} _ {\mathbf {R}, \mathbf {T}} \| D R (\mathbf {R}, \mathbf {T}) - \mathbf {M} \| +$$ + +where $DR(\cdot)$ is a differentiable renderer implemented in PyTorch3D [52]. Examples of results from this approach can be found in Figure 2. Unlike previous approaches to CAD-to-image alignment [57, 63] that use human annotators in-the-loop to provide pose or correspondences, our approach is fully automatic except for a final human verification step. + +Material Estimation Dataset To perform material estimation from images, we use the Disney [9] base color, metallic, roughness parameterization given in glTF 2.0 specification [25]. We render $512 \times 512$ images from 91 camera positions along an upper icosphere of the object with a $60^{\circ}$ field-of-view using Blender's [14] Cycles path-tracer. To ensure diverse realistic lighting conditions and backgrounds, we illuminate the scene using 3 random environment maps out of 108 indoor HDRIs [23]. For these rendered images, we generate the corresponding ground truth base color, metallicness, roughness, and normal maps along with the object depth map and segmentation mask. The resulting dataset consists of 2.1 million rendered images and corresponding camera intrinsics and extrinsics. + +# 4. Experiments + +# 4.1. Evaluating Single-View 3D Reconstruction + +As existing methods are largely trained in a fully supervised manner using ShapeNet [10], we are interested in how well they will transfer to more real-world objects. To measure how well these models transfer to real object instances, we evaluate the performance of a variety of these methods on objects from ABO. Specifically we evaluate + +3D-R2N2 [13], GenRe [69], Occupancy Networks [46], and Mesh R-CNN [22] pre-trained on ShapeNet. We selected these methods because they capture some of the top-performing single-view 3D reconstruction methods from the past few years and are varied in the type of 3D representation that they use (voxels in [13], spherical maps in [69], implicit functions in [46], and meshes in [22]) and the coordinate system used (canonical vs. view-space). While all the models we consider are pre-trained on ShapeNet, GenRe trains on a different set of classes and takes as input a silhouette mask at train and test time. + +To study this question (irrespective of the question of cross-category generalization), we consider only the subset of ABO models objects that fall into ShapeNet training categories. Out of the 63 categories in ABO with 3D models, we consider 6 classes that intersect with commonly used ShapeNet classes, capturing 4,170 of the 7,953 3D models. Some common ShapeNet classes, such as "airplane", have no matching ABO category; similarly, some categories in ABO like "air conditioner" and "weights" do not map well to ShapeNet classes. + +For this experiment, we render a dataset (distinct from the ABO Material Estimation Dataset) of objects on a blank background from a similar distribution of viewpoints as in the rendered ShapeNet training set. We render 30 viewpoints of each mesh using Blender [14], each with a $40^{\circ}$ field-of-view and such that the entire object is visible. Camera azimuth and elevation are sampled uniformly on the surface of a unit sphere with a $-10^{\circ}$ lower limit on elevations to avoid uncommon bottom views. + +GenRe and Mesh-RCNN make their predictions in "view-space" (i.e. pose aligned to the image view), whereas R2N2 and Occupancy Networks perform predictions in canonical space (predictions are made in the same category-specific, canonical pose despite the pose of the object in an image). For each method we evaluate Chamfer Distance and Absolute Normal Consistency and largely follow the evaluation protocol of [22]. + +Results A quantitative comparison of the four methods + +we considered on ABO objects can be found in Table 3. We also re-evaluated each method's predictions on the ShapeNet test set from R2N2 [13] with our evaluation protocol and report those metrics. We observe that Mesh R-CNN [22] outperforms all other methods across the board on both ABO and ShapeNet in terms of Chamfer Distance, whereas Occupancy Networks performs the best in terms of Absolute Normal Consistency. As can be seen, there is a large performance gap between all ShapeNet and ABO predictions. This suggests that shapes and textures from ABO, while derived from the same categories but from the real world, are out of distribution and more challenging for the models trained on ShapeNet. Further, we notice that the lamp category has a particularly large performance drop from ShapeNet to ABO. Qualitative results suggest that this is likely due to the difficulty in reconstructing thin structures. We highlight some qualitative results in Figure 5, including one particularly challenging lamp instance. + +# 4.2. Material Prediction + +To date, there are not many available datasets tailored to the material prediction task. Most publicly available datasets with large collections of 3D objects [10, 12, 19] do not contain physically-accurate reflectance parameters that can be used for physically-based rendering to generate photorealistic images. Datasets like PhotoShape [51] do contain such parameters but are limited to a single category. In contrast, the realistic 3D models in ABO are artist-created and have highly varied shapes and SV-BRDFs. We leverage this unique property to derive a benchmark for material prediction with large amounts of photorealistic synthetic data. We also present a simple baseline approach for both single- and multi-view material estimation of complex geometries. + +Method To evaluate single-view and multi-view material prediction and establish a baseline approach, we use a U-Net-based model with a ResNet-34 backbone to estimate SV-BRDFs from a single viewpoint. The U-Net has a common encoder that takes an RGB image as input and has a multi-head decoder to output each component of the SV-BRDF separately. Inspired by recent networks in [7, 17], we align images from multiple viewpoints by projection using depth maps, and bundle the original image and projected image pairs as input data to enable an analogous approach for the multi-view network. We reuse the single-view architecture for the multi-view network and use global max pooling to handle an arbitrary number of input images. Similar to [16], we utilize a differentiable rendering layer to render the flash illuminated ground truth and compare it to similarly rendered images from our predictions to better regularize the network and guide the training process. Ground truth material maps are used for direct supervision. + +Our model takes as input 256x256 rendered images. For training, we randomly subsample 40 views on the icosphere + +
SV-netMV-net (no proj.)MV-net
Base Color (↓)0.1290.1320.127
Roughness (↓)0.1630.1550.129
Metallicness (↓)0.1700.1670.162
Normals (↑)0.9700.9490.976
Render (↓)0.0960.0900.086
+ +Table 4. ABO material estimation results for the single-view, multi-view, and multi-view network without projection (MV-net no proj.) ablation. Base color, roughness, metallicness and rendering loss are measured using RMSE (lower is better) - normal similarity is measured using cosine similarity (higher is better). + +for each object. In the case of the multi-view network, for each reference view we select its immediate 4 adjacent views as neighboring views. We use mean squared error as the loss function for base color, roughness, metallicness, surface normal and render losses. Each network is trained for 17 epochs using the AdamW optimizer [45] with a learning rate of 1e-3 and weight decay of 1e-4. + +Results Results for the single-view network (SV-net) and multi-view network (MV-net) can be found in Table 4. The multi-view network has better performance compared to single-view network in terms of the base color, roughness, metallicness, and surface normal prediction tasks. The multi-view network is especially better at predicting properties that affect view-dependent specular components like roughness and metallicness. + +We also run an ablation study on our multi-view network without using 3D structure to align neighboring views to reference view (denoted as MV-net: no projection). First, we observe that even without 3D structure-based alignment, the network still outperforms the single-view network on roughness and metallic predictions. Comparing to the multi-view network, which uses 3D structure-based alignment, we can see structure information leads to better performance for all parameters. We show some qualitative results from the test set in Figure 6. + +As a focus of ABO is enabling real-world transfer, we also test our multi-view network on catalog images of objects from the test set using the pose annotations gathered by the methodology in Section 3, and use the inferred material parameters to relight the object (Figure 7). Despite the domain gap in lighting and background, and shift from synthetic to real, our network trained on rendered images makes reasonable predictions on the real catalog images. In one case (last row), the network fails to accurately infer the true base color, likely due to the presence of self-shadow. + +# 4.3. Multi-View Cross-Domain Object Retrieval + +Merging the available catalog images and 3D models in ABO, we derive a novel benchmark for object retrieval + +![](images/d0952d0d3a5b56477b688640e398d2471af33ad166d41dad90bc9a301d7b32e1.jpg) +Figure 6. Qualitative material estimation results for single-view (SV-net) and multi-view (MV-net) networks. We show estimated SV-BRDF properties (base color, roughness, metallicness, surface normals) for each input view of an object compared to the ground truth. + +![](images/2821790ffd5eabe1ab0cc9dab18988106aab96d5e0df060cbf37e3ca78c7e5c7.jpg) +Figure 7. Qualitative multi-view material estimation results on real catalog images. Each of the multiple views is aligned to the reference view using the catalog image pose annotations. + +![](images/b24432dfa1c90c944559bc312084575cab8c306e388511988e14f769b7a161e2.jpg) + +with the unique ability to measure the robustness of algorithms with respect to viewpoint changes. Specifically, we leverage the renderings described in Section 3, with known azimuth and elevation, to provide more diverse views and scenes for training deep metric learning (DML) algorithms. We also use these renderings to evaluate the retrieval performance with respect to a large gallery of catalog images from ABO. This new benchmark is very challenging because the rendered images have complex and cluttered indoor backgrounds (compared to the cleaner catalog images) and display products with viewpoints that are not typically present in the catalog images. These two sources of images are indeed two separate image domains, making the test scenario a multi-view cross-domain retrieval task. + +Method To compare the performance of state-of-the-art DML methods on our multi-view cross-domain retrieval benchmark, we use PyTorch Metric Learning [2] implementations that cover the main approaches to DML: NormSoftmax [68] (classification-based), ProxyNCA [48] (proxy-based) and Contrastive, TripletMargin, NTXent [11] and Multi-similarity [61] (tuple-based). We leveraged the Powerful Benchmarker framework [1] to run fair and controlled comparisons as in [49], including Bayesian hyperparameter optimization. + +We opted for a ResNet-50 [29] backbone, projected it to 128D after a LayerNorm [4] layer, did not freeze the BatchNorm parameters and added an image padding transformation to obtain undistorted square images before resizing to $256 \times 256$ . We used batches of 256 samples with 4 samples per class, except for NormSoftmax and ProxyNCA where we obtained better results with a batch size of 32 and 1 sample per class. After hyperparameter optimization, we trained all losses for 1000 epochs and chose the best epoch based on the validation Recall@1 metric, computing it only every other epoch. + +Importantly, whereas catalog and rendered images in the training set are balanced (188K vs 111K), classes with and without renderings are not (4K vs. 45K). Balancing them in each batch proved necessary to obtain good performance: not only do we want to exploit the novel viewpoints and scenes provided by the renderings to improve the retrieval performance, but there are otherwise simply not sufficiently many negative pairs of rendered images being sampled. + +
Recall@k (%)Rendered imagesCatalog
k=1k=2k=4k=8k=1
Pre-trained5.08.111.415.318.0
Constrastive28.638.348.959.139.7
Multi-similarity23.132.241.952.138.0
NormSoftmax30.040.350.260.035.5
NTXent23.933.042.652.037.5
ProxyNCA29.439.550.060.135.6
TripletMargin22.131.141.351.936.9
+ +Table 5. Test performance of state-of-the-art deep metric learning methods on the ABO retrieval benchmark. Retrieving products from rendered images highlights performance gaps that are not as apparent when using catalog images. + +Results As shown in Table 5, the ResNet-50 baseline trained on ImageNet largely fails at the task (Recall@1 of $5\%$ ). This confirms the challenging nature of our novel benchmark. DML is thus key to obtain significant improvements. In our experiments, NormSoftmax, ProxyNCA and Contrastive performed better ( $\approx 29\%$ ) than the Multisimilarity, NTXent or TripletMargin losses ( $\approx 23\%$ ), a gap which was not apparent in other datasets, and is not as large when using cleaner catalog images as queries. Moreover, it is worth noting that the overall performance on ABO is significantly lower than for existing common benchmarks (see Table 2). This confirms their likely saturation [49], the value in new and more challenging retrieval tasks, and the need for novel metric learning approaches to handle the large scale and unique properties of our new benchmark. + +Further, the azimuth $(\theta)$ and elevation $(\varphi)$ angles available for rendered test queries allow us to measure how performance degrades as these parameters diverge from typical product viewpoints in ABO's catalog images. Figure 8 highlights two main regimes for both azimuth and elevation: azimuths beyond $|\theta| = 75^{\circ}$ and elevations above $\varphi = 50^{\circ}$ are significantly more challenging to match, consistently for all approaches. Closing this gap is an interesting direction of future research on DML for multi-view object retrieval. For one, the current losses do not explicitly model the geometric information in training data. + +# 5. Conclusion + +In this work we introduced ABO, a new dataset to help bridge the gap between real and synthetic 3D worlds. We demonstrated that the set of real-world derived 3D models in ABO are a challenging test set for ShapeNet-trained 3D reconstruction approaches, and that both view- and canonical-space methods do not generalize well to ABO meshes despite sampling them from the same distribution of training classes. We also trained both single-view and multi-view networks for SV-BRDF material estimation of + +![](images/ab34347bf20c3b17051e8c9262c1cd73c24581a7d472fb73fda3b4ca4bf70f17.jpg) + +![](images/87c210c5ae56b1f494dd0707a1ef148da5a600636c20683643de4a762d3e789a.jpg) +Figure 8. Recall@1 as a function of the azimuth and elevation of the product view. For all methods, retrieval performance degrades rapidly beyond azimuth $|\theta| > 75^{\circ}$ and elevation $\varphi > 50^{\circ}$ . + +complex, real-world geometries - a task that is uniquely enabled by the nature of our 3D dataset. We found that incorporating multiple views leads to more accurate disentanglement of SV-BRDF properties. Finally, joining the larger set of products images with synthetic renders from ABO 3D models, we proposed a challenging multi-view retrieval task that alleviates some of the limitations in diversity and structure of existing datasets, which are close to performance saturation. The 3D models in ABO allowed us to exploit novel viewpoints and scenes during training and benchmark the performance of deep metric learning algorithms with respect to the azimuth and elevation of query images. + +While not considered in this work, the large amounts of text annotations (product descriptions and keywords) and non-rigid products (apparel, home linens) enable a wide array of possible language and vision tasks, such as predicting styles, patterns, captions or keywords from product images. Furthermore, the 3D objects in ABO correspond to items that naturally occur in a home, and have associated object weight and dimensions. This can benefit robotics research and support simulations of manipulation and navigation. + +Acknowledgements We thank Pietro Perona and Frederic Devernay. This work was funded in part by an NSF GRFP (#1752814) and the Amazon-BAIR Commons Program. + +# References + +[1] Powerful benchmarker. https://kevinmusgrave.github.io/powerful-benchmarker. Accessed: 2022-03-19.7 +[2] Pytorch metric learning. https://kevinmusgrave.github.io/pytorch-metric-learning. Accessed: 2022-03-19. 7 +[3] Adel Ahmadyan, Liangkai Zhang, Jianing Wei, Artsiom Ablavatski, and Matthias Grundmann. Objectron: A large scale dataset of object-centric videos in the wild with pose annotations. arXiv preprint arXiv:2012.09988, 2020. 3 +[4] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 7 +[5] Miguel Angel Bautista, Walter Talbott, Shuangfei Zhai, Nitish Srivastava, and Joshua M Susskind. On the generalization of learning-based 3d reconstruction. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2180–2189, 2021. 1 +[6] Jan Bechtold, Maxim Tatarchenko, Volker Fischer, and Thomas Brox. Fostering generalization in single-view 3d reconstruction by learning a hierarchy of local and global shape priors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15880-15889, 2021. 1 +[7] Sai Bi, Zexiang Xu, Kalyan Sunkavalli, David Kriegman, and Ravi Ramamoorthi. Deep 3d capture: Geometry and reflectance from sparse multi-view images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5960-5969, 2020. 3, 4, 6 +[8] Mark Boss, Varun Jampani, Kihwan Kim, Hendrik Lensch, and Jan Kautz. Two-shot spatially-varying brdf and shape estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3982-3991, 2020. 4 +[9] Brent Burley and Walt Disney Animation Studios. Physically-based shading at disney. In ACM SIGGRAPH, volume 2012, pages 1-7. vol. 2012, 2012. 5 +[10] Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015. 1, 2, 4, 5, 6 +[11] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR, 2020. 7 +[12] Sungjoon Choi, Qian-Yi Zhou, Stephen Miller, and Vladlen Koltun. A large dataset of object scans. arXiv preprint arXiv:1602.02481, 2016. 2, 3, 6 +[13] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In European conference on computer vision, pages 628-644. Springer, 2016. 1, 3, 5, 6 + +[14] Blender Online Community. Blender - a 3D modelling and rendering package. Blender Foundation, Stichting Blender Foundation, Amsterdam, 2018. 5 +[15] 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. 1 +[16] Valentin Deschaintre, Miika Aittala, Fredo Durand, George Drettakis, and Adrien Bousseau. Single-image svbrdf capture with a rendering-aware deep network. ACM Transactions on Graphics (TOG), 37(4):128, 2018. 3, 6 +[17] Valentin Deschaintre, Miika Aittala, Frédo Durand, George Drettakis, and Adrien Bousseau. Flexible svbrdf capture with a multi-image deep network. In Computer Graphics Forum, volume 38, pages 1-13. Wiley Online Library, 2019. 3, 4, 6 +[18] Haoqiang Fan, Hao Su, and Leonidas J Guibas. A point set generation network for 3d object reconstruction from a single image. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 605-613, 2017. 3 +[19] Huan Fu, Rongfei Jia, Lin Gao, Mingming Gong, Binqiang Zhao, Steve Maybank, and Dacheng Tao. 3d-future: 3d furniture shape with texture. arXiv preprint arXiv:2009.09633, 2020. 2, 6 +[20] Duan Gao, Xiao Li, Yue Dong, Pieter Peers, Kun Xu, and Xin Tong. Deep inverse rendering for high-resolution svbrdf estimation from an arbitrary number of images. ACM Transactions on Graphics (TOG), 38(4):134, 2019. 3, 4 +[21] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In ICCV, 2019. 2 +[22] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 9785-9795, 2019. 3, 5, 6 +[23] Andreas Mischok Greg Zaal, Sergej Majboroda. Hdrihaven. https://hdrihaven.com/. Accessed: 2020-11-16. 5 +[24] Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A papier-mâché approach to learning 3d surface generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 216-224, 2018. 1 +[25] Khronos Group. gltf 2.0 specification. https://github.com/KhronosGroup/glTF. Accessed: 2020-11-16. 5 +[26] Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5356-5364, 2019. 1 +[27] Richard Hartley and Andrew Zisserman. Multiple view geometry in computer vision. Cambridge university press, 2003. 3 +[28] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In ICCV, 2017. 5 +[29] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 7 + +[30] HeeJae Jun, ByungSoo Ko, Youngjoon Kim, Insik Kim, and Jongtack Kim. Combination of multiple global descriptors for image retrieval. arXiv preprint arXiv:1903.10663, 2019. 3 +[31] Abhishek Kar, Christian Häne, and Jitendra Malik. Learning a multi-view stereo machine. In Advances in neural information processing systems, pages 365-376, 2017. 3 +[32] Kihwan Kim, Jinwei Gu, Stephen Tyree, Pavlo Molchanov, Matthias Nießner, and Jan Kautz. A lightweight approach for on-the-fly reflectance estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 20-28, 2017. 3 +[33] Sungyeon Kim, Dongwon Kim, Minsu Cho, and Suha Kwak. Proxy anchor loss for deep metric learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 3 +[34] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9799-9808, 2020. 5 +[35] Sebastian Koch, Albert Matveev, Zhongshi Jiang, Francis Williams, Alexey Artemov, Evgeny Burnaev, Marc Alexa, Denis Zorin, and Daniele Panozzo. Abc: A big cad model dataset for geometric deep learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9601-9611, 2019. 1 +[36] 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. 4 +[37] Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009. 1 +[38] Xiao Li, Yue Dong, Pieter Peers, and Xin Tong. Modeling surface appearance from a single photograph using self-augmented convolutional neural networks. ACM Transactions on Graphics (TOG), 36(4):45, 2017. 3 +[39] Yangyan Li, Hao Su, Charles Ruizhongtai Qi, Noa Fish, Daniel Cohen-Or, and Leonidas J. Guibas. Joint embeddings of shapes and images via cnn image purification. ACM Trans. Graph., 2015. 4 +[40] Zhengqin Li, Zexiang Xu, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Learning to reconstruct shape and spatially-varying reflectance from a single image. In SIGGRAPH Asia 2018 Technical Papers, page 269. ACM, 2018. 3, 4 +[41] Joseph J Lim, Hamed Pirsiavash, and Antonio Torralba. Parsing aka objects: Fine pose estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2992-2999, 2013. 2 +[42] Joseph J Lim, Hamed Pirsiavash, and Antonio Torralba. Parsing aka objects: Fine pose estimation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2992-2999, 2013. 2 +[43] 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. 1 + +[44] Ziwei Liu, Ping Luo, Shi Qiu, Xiaogang Wang, and Xiaou Tang. Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 4 +[45] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. 6 +[46] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4460-4470, 2019. 1, 3, 5 +[47] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39-41, 1995. 4 +[48] Yair Movshovitz-Attias, Alexander Toshev, Thomas K. Leung, Sergey Ioffe, and Saurabh Singh. No fuss distance metric learning using proxies. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct 2017. 7 +[49] Kevin Musgrave, Serge Belongie, and Ser-Nam Lim. A metric learning reality check. In European Conference on Computer Vision, pages 681-699. Springer, 2020. 7, 8 +[50] 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 (CVPR), June 2016. 4 +[51] Keunhong Park, Konstantinos Rematas, Ali Farhadi, and Steven M Seitz. Photoshape: Photorealistic materials for large-scale shape collections. arXiv preprint arXiv:1809.09761, 2018. 2, 3, 6 +[52] Nikhila Ravi, Jeremy Reizenstein, David Novotny, Taylor Gordon, Wan-Yen Lo, Justin Johnson, and Georgia Gkioxari. Accelerating 3d deep learning with pytorch3d. arXiv preprint arXiv:2007.08501, 2020. 5 +[53] Jeremy Reizenstein, Roman Shapovalov, Philipp Henzler, Luca Sbordone, Patrick Labatut, and David Novotny. Common objects in 3d: Large-scale learning and evaluation of real-life 3d category reconstruction. arXiv preprint arXiv:2109.00512, 2021. 2, 3 +[54] Google Research. Google scanned objects, August. 2 +[55] Arjun Singh, James Sha, Karthik S Narayan, Tudor Achim, and Pieter Abbeel. Bigbird: A large-scale 3d database of object instances. In 2014 IEEE international conference on robotics and automation (ICRA), pages 509-516. IEEE, 2014. 2 +[56] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017. 1 +[57] Xingyuan Sun, Jiajun Wu, Xiuming Zhang, Zhoutong Zhang, Chengkai Zhang, Tianfan Xue, Joshua B Tenenbaum, and William T Freeman. Pix3d: Dataset and methods for single-image 3d shape modeling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2974-2983, 2018. 2, 3, 5 +[58] Maxim Tatarchenko, Stephan R Richter, René Ranftl, Zhuwen Li, Vladlen Koltun, and Thomas Brox. What do + +single-view 3d reconstruction networks learn? In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3405-3414, 2019. 1 +[59] Shubham Tulsiani, Tinghui Zhou, Alexei A Efros, and Jitendra Malik. Multi-view supervision for single-view reconstruction via differentiable ray consistency. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2626-2634, 2017. 3 +[60] 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. 4 +[61] Xun Wang, Xintong Han, Weilin Huang, Dengke Dong, and Matthew R Scott. Multi-similarity loss with general pair weighting for deep metric learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5022-5030, 2019. 7 +[62] Olivia Wiles and Andrew Zisserman. Silnet: Single-and multi-view reconstruction by learning from silhouettes. arXiv preprint arXiv:1711.07888, 2017. 3 +[63] Yu Xiang, Wonhui Kim, Wei Chen, Jingwei Ji, Christopher Choy, Hao Su, Roozbeh Mottaghi, Leonidas Guibas, and Silvio Savarese. Objectnet3d: A large scale database for 3d object recognition. In European Conference on Computer Vision, pages 160-176. Springer, 2016. 1, 2, 5 +[64] Yu Xiang, Roozbeh Mottaghi, and Silvio Savarese. Beyond Pascal: A benchmark for 3d object detection in the wild. In IEEE winter conference on applications of computer vision, pages 75-82. IEEE, 2014. 1, 2 +[65] Haozhe Xie, Hongxun Yao, Xiaoshuai Sun, Shangchen Zhou, and Shengping Zhang. Pix2vox: Context-aware 3d reconstruction from single and multi-view images. In Proceedings of the IEEE International Conference on Computer Vision, pages 2690-2698, 2019. 1, 3 +[66] Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective transformer nets: Learning single-view 3d object reconstruction without 3d supervision. In Advances in neural information processing systems, pages 1696-1704, 2016. 3 +[67] Wenjie Ye, Xiao Li, Yue Dong, Pieter Peers, and Xin Tong. Single image surface appearance modeling with self-augmented cnns and inexact supervision. In Computer Graphics Forum, volume 37, pages 201-211. Wiley Online Library, 2018. 3 +[68] Andrew Zhai and Hao-Yu Wu. Classification is a strong baseline for deep metric learning. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (BMVC), 2019. 7 +[69] Xiuming Zhang, Zhoutong Zhang, Chengkai Zhang, Josh Tenenbaum, Bill Freeman, and Jiajun Wu. Learning to reconstruct shapes from unseen classes. In Advances in Neural Information Processing Systems, pages 2257-2268, 2018. 3, 5 +[70] Qingnan Zhou and Alec Jacobson. Thingi10k: A dataset of 10,000 3d-printing models. arXiv preprint arXiv:1605.04797, 2016. 1 \ No newline at end of file diff --git a/abodatasetandbenchmarksforrealworld3dobjectunderstanding/images.zip b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3ea826c758f88580d7aba3661563826b950e62e4 --- /dev/null +++ b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80e85ebddaa3aadbfb68c96753d7b0538d537c8141d2be380f3ffad6217766e6 +size 535029 diff --git a/abodatasetandbenchmarksforrealworld3dobjectunderstanding/layout.json b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1ae4154685e418118ae1f0e8d777ea3ae417abc9 --- /dev/null +++ b/abodatasetandbenchmarksforrealworld3dobjectunderstanding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d36df99b0655ab1bc5f08cbb46be00c8fffb7b853018caf33fdd3d36bc2010a1 +size 307664 diff --git a/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_content_list.json b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..312ec8f7aa8334153c53863bb7e7c4e48f6f10d5 --- /dev/null +++ b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ecad11078f54cbca924837ee3aa4710da0a07af1c18d97586433e6e2ed94ff2 +size 81479 diff --git a/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_model.json b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_model.json new file mode 100644 index 0000000000000000000000000000000000000000..859be937b9b868c7145b0f9276df0e04fb3c34a7 --- /dev/null +++ b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c9aa9ca1f41837557eb80cfd099388ce6fe0fed0666f3bfd1b0676f0cdd66ac +size 103731 diff --git a/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_origin.pdf b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6d71450cee2dcd5954407e674c28306be742e57f --- /dev/null +++ b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/0836d8e6-e6e7-4830-9182-ed9613a4b549_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0183f9c644ee2c40c20bceaa6dca3d68f5285b0b0fe105029d196dac3aac5fce +size 2935763 diff --git a/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/full.md b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2ef1e68f3a23ce7e6d13d31834959d8c3f04e90a --- /dev/null +++ b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/full.md @@ -0,0 +1,374 @@ +# ABPN: Adaptive Blend Pyramid Network for Real-Time Local Retouching of Ultra High-Resolution Photo + +Biwen Lei†, Xiefan Guo*, Hongyu Yang, Miaomiao Cui†, Xuansong Xie†, Di Huang† +†DAMO Academy, Alibaba Group + +biwen.lbw@alibaba-inc.com, {guoxiefan, hongyu.yang.csv}@gmail.com, miaomiao.cmm@alibaba-inc.com, xingtong.xxs@taobao.com, dhuang.csv@outlook.com + +# Abstract + +Photo retouching finds many applications in various fields. However, most existing methods are designed for global retouching and seldom pay attention to the local region, while the latter is actually much more tedious and time-consuming in photography pipelines. In this paper, we propose a novel adaptive blend pyramid network, which aims to achieve fast local retouching on ultra high-resolution photos. The network is mainly composed of two components: a context-aware local retouching layer (LRL) and an adaptive blend pyramid layer (BPL). The LRL is designed to implement local retouching on low-resolution images, giving full consideration of the global context and local texture information, and the BPL is then developed to progressively expand the low-resolution results to the higher ones, with the help of the proposed adaptive blend module and refining module. Our method outperforms the existing methods by a large margin on two local photo retouching tasks and exhibits excellent performance in terms of running speed, achieving real-time inference on 4K images with a single NVIDIA Tesla P100 GPU. Moreover, we introduce the first high-definition cloth retouching dataset CRHD-3K to promote the research on local photo retouching. The dataset is available at https://github.com/youngLBW/CRHD-3K. + +# 1. Introduction + +Photo retouching [25], especially portrait photo retouching, finds a vast range of applications in photography scenarios including wedding, advertisement, personal recording, etc. While extensive works [5, 12, 14, 21, 46, 57] yield impressive results on photo retouching, most of them manipulate the attributes of the entire image, such as color, illumination, and exposure. Few methods deal with the local region in photos (e.g., face, clothing, and commodity), + +![](images/b65fd658a80419d5f37e2a29f3033cbd3ec483b1ac8fa22494300efe3378d085.jpg) + +![](images/e9075a2c1bf06973e803e0e8e64aea436d743fe0e16e6eb71c60e3dd571e59ac.jpg) +(a) Input + +![](images/2d2ea59ae9da464ad8642cbe349da59f8afe1cd575316202cbac468417f34a46.jpg) + +![](images/67c167e3425642365ae9a7b697ba4dd04293b84239a4d6a4f554ac44eb057156.jpg) +(b) Ours + +![](images/450b20b8f8752798cc73328628343d7ba8c26f3f56366823ccefb99ece596205.jpg) + +![](images/2a4c95fc667f0f8a2868c30a22c4fd274ab9a3abd9cec60e18dfe794b3921ded.jpg) +(c) Target +Figure 1. High-fidelity retouched photos. From left to right: (a) raw photos, (b) our retouched results, and (c) ground-truth images. + +which is actually the most tedious and time-consuming step in professional photography pipelines. + +To focus on this kind of problem, we summarize them as the Local Photo Retouching (LPR) task, whose goal is to edit the target region in the photo and keep the rest area unchanged. Different from general local image editing tasks (such as image inpainting and rain removal), LPR pays more attention to enhancing the aesthetic perception and visual quality of the target object. Fig. 1 gives some LPR examples. + +We conclude three main challenges of the LPR task as: (1) accurate localization of the target region; (2) local generation with global consistency and detail fidelity; and (3) efficient processing of ultra high-resolution images. The first two are brought by the characteristics of the task itself, while the last one is determined by the application scenarios of LPR. As ultra high-resolution photos have been widely used in various photographic scenes, the ability to process them becomes a key factor of LPR methods in practice. Given these challenges above, we in this paper analyze the applicability of existing methods to the LPR task and attempt to propose a more suitable solution to it. + +In recent years, massive works have devoted to the image-to-image translation task and achieve impressive results in style transfer [11, 16, 19, 45], semantic image synthesis [7, 18, 37], etc. Most of them adopt a deep network with an encoding-decoding paradigm to fulfill faithful translation, which results in a heavy computational, thus severely limiting their applications in some high-resolution scenarios. Some methods [12, 25, 47, 52] try to accelerate the models by transferring the computational burden from high-resolution maps to low-resolution ones and successfully accomplish global translation on high-resolution images. However, due to the lack of attention to local regions, few of them well adapt to the LPR task. + +Instead of performing global translation, a number of works focus on the local image editing task, such as image inpainting [28, 39, 55], shadow removal [15, 32, 33], and rain removal [40-42, 48, 49]. Most of them rely on the masks that indicate the target region as input, while in the LPR task, accurately acquiring such masks is itself a quite challenging issue. Though some methods resort to the deep generative networks and perform local editing without specifying the masks, they are hardly capable of processing ultra high-resolution images directly. Besides, AutoRetouch [46] employs a sliding window strategy to achieve local modeling and retouching, but it fails to capture the global context, especially in the case of high resolution. + +Based on the observations, we propose a novel adaptive blend pyramid network (ABPN) for local retouching of ultra high-resolution photos, as shown in Fig. 3. The network addresses the three challenges aforementioned via two components: a context-aware local retouching layer (LRL) and an adaptive blend pyramid layer (BPL). In general, given a high-resolution image, the LRL performs local retouching on its thumbnail and the subsequent BPL expands the outputs of LRL to the original size of the input. For LRL, specifically, we design a novel multi-task architecture to fulfill mask prediction of the target region and local generation simultaneously. A local attentive module (LAM) is proposed, where the local semantics and texture of the target region and the global context can be fully captured and aggregated to achieve consistent local retouching. For BPL, inspired by the blend layer in digital image editing, we develop a light-weight adaptive blend module (ABM) and its reverse version (R-ABM) to implement the fast expansion from the low-resolution results to the higher ones, ensuring great extensibility and detail fidelity. Extensive experiments on two LPR tasks reveal that our method outperforms the existing methods by a large margin in terms of retouching quality and processing efficiency, demonstrating its superiority in the LPR task. + +Moreover, since the editing work is usually time-consuming and requires high image processing skills, there are few publicly available datasets for the LPR task. Ac + +cordingly, we build and release the first high-definition cloth retouching dataset (CRHD-3K) to facilitate the research. + +Our main contributions in this work are as follows: + +(A) We propose a novel framework ABPN for local retouching of ultra high-resolution photos, which exhibits the remarkable efficiency performance (real-time inference on 4K images with a single NVIDIA Tesla P100 GPU) and superior retouching quality to the existing methods. +(B) We present a local attentive module (LAM), which is effective in capturing and aggregating the global context and local texture. +(C) We design an adaptive blend module (ABM), which provides powerful extensibility to the framework, allowing the fast expansion from low-resolution results to the higher ones. +(D) To boost the research on LPR (e.g., cloth retouching), we introduce the first high-definition cloth retouching dataset CRHD-3K. + +# 2. Related Work + +Photo Retouching. Benefiting from the development of deep convolutional neural networks, learning-based methods [5,10,12,14,21,46,50,57] have recently been presented to produce exciting results on photo retouching. Most of those, however, are limited by the heavy computational and memory costs when the photo resolution is increased. In addition, these methods are designed for global photo retouching and do not well fit for the LPR task. + +Image-to-Image Translation. Image-to-image translation was originally defined by [18], in which many computer-vision tasks were summarized as a pixel-to-pixel predicting job and a conditional GANs-based framework was developed as a general solution. Following [18], various methods have been proposed to address the image translation problem, using paired images [7,18,27,37,43,47,52] or unpaired images [3,8,9,16,17,23,25,30,36,38,59]. Several works focus on a specific image translation task (such as semantic image synthesis [7,18,37] and style transfer [11,16,19,45]) and achieve impressive performance. However, the works above mainly concentrate on global transformation and give less attention to the local region, which limits their capability in the LPR task. + +Image Inpainting. Image Inpainting is the closest task to LPR, which refers to the process of reconstructing missing regions of an image given a corresponding mask. The deep generative methods [13,22,26,28,29,35,39,51,53-56,58] have achieved significant progress, owing to their powerful feature learning ability. However, acquiring accurate masks is itself a very challenging issue, and taking unreasonable masks tends to incur large errors in filled results. Recently, the blind image inpainting methods [6, 31, 53] relax the restriction by completing the visual contents without specifying masks for missing regions. Nevertheless, those methods + +![](images/a5d4d67c6efb0211cb361dc81fe46b6a2c7c5780553602ac4e335c45c8fef652.jpg) +Figure 2. Examples from the CRHD-3K Dataset (zoom in for a better view). Left: raw photos, right: retouched results by professional staffs with high image processing expertise. + +assume the contamination with simple data distributions or undesired images, which makes them fail to take full advantages of the inherent semantics and textures of the image for LPR. Moreover, the existing methods can only handle low-resolution inputs, ultra high-resolution image inpainting is still extremely challenging. There are also some local image editing tasks that aim to restore the local region in the image, including shadow removal [15, 32, 33], rain removal [40-42, 48, 49], etc. Unfortunately, due to the strong specificity of these methods, few of them are adaptive for the common LPR task. + +High-resolution Image Editing. To enable translation on high-resolution images, [12, 25, 47, 52] attempt to alleviate the space and time burden by shifting the major computation from high-resolution maps to low-resolution ones. Though yielding impressive efficiency performance, it is still problematic when applied to LPR as the lack of attention to the local regions. + +# 3. The CRHD-3K Dataset + +Photo retouching [24] refers to the process of enhancing the visual aesthetic quality of an image, and cloth retouching is one of the most representative tasks, which is conventionally achieved via hand-craft operations. However, the process of manual retouching is tedious and time-consuming. In order to facilitate the learning-based retouching methods, we introduce the first large-scale high-definition cloth retouching (CRHD-3K) dataset. + +Data collection. We initially collected more than 60,000 raw photos from Unsplash $^{1}$ , and further carefully checked them one by one, where outliers (e.g., severe motion blur) and duplicates (e.g., same content) were removed. The CRHD-3K dataset finally includes 3,022 high-definition raw portrait photos. + +Data labeling. To obtain high-quality retouched photos, the process is accomplished by a team of professional image editors, with the goal of removing the wrinkles, creases, and other blemishes on the clothes to make them look more smooth and beautiful. The retouching time for each photo is 3 to 5 minutes. Some retouched examples are shown in Fig. 2. + +Data statistics. The CRHD-3K dataset consists of 3,022 pairs of raw and retouched photos, of which 2,522 are for training and 500 for testing. The resolutions mainly vary in the range of 4K to 6K. + +Ethics guidelines. To avoid the attendant risk of harm from the data, we blurred and cropped the personally identifiable information contained in the photos (e.g., faces), and kept only the clothing components as much as possible. + +Cloth retouching is a typical and quite challenging LPR task due to the diversity of clothing patterns and the subjectivity of wrinkle judgment. More importantly, ultra high-resolution images from the CRHD-3K dataset place extremely strict requirements on the time and space efficiency of the model. + +# 4. Methods + +# 4.1. Overview + +As discussed above, subject to the lack of attention to local regions or the high computational costs, the existing methods are difficult to cope with the LPR task. To solve these problems, we develop an adaptive blend pyramid network for local retouching of ultra high-resolution photos. Fig. 3 shows an overview of our framework. The network is mainly composed of two components: a context-aware local retouching layer (LRL) and an adaptive blend pyramid layer (BPL). Given an image $I_0 \in \mathbb{R}^{h \times w \times 3}$ , we first build an image pyramid $P_I = [I_0, I_1, \dots, I_l]$ and a high-frequency component pyramid $P_H = [H_0, H_1, \dots, H_{l-1}]$ , where $P_H$ is acquired following Laplacian Pyramid [4] and $l$ is the number of downsampling operations ( $l = 2$ as default in Fig. 3). Then LRL is applied to $I_l \in \mathbb{R}^{\frac{h}{2l} \times \frac{w}{2l} \times 3}$ to predict the target region mask $M$ and generate the retouched results $R_l \in \mathbb{R}^{\frac{h}{2l} \times \frac{w}{2l} \times 3}$ . After that, we employ BPL to expand the low-resolution outputs $R_l$ to the original size of $I_0$ . Specifically, the reverse adaptive blend module (R-ABM) is introduced to generate the blend layer $B_l \in \mathbb{R}^{\frac{h}{2l} \times \frac{w}{2l} \times 3}$ , which records the translation information from $I_l$ to $R_l$ . By progressively upsampling and refining, the blend layer $B_0$ with high resolutions and abundant details is obtained. At last, we utilize the adaptive blend module (ABM) to apply $B_0$ to $I_0$ to generate the final results $R_0$ . + +We introduce these sub-networks and loss functions used + +![](images/235e345c25fd2b8162a9b7a77f3247992a889288be96a2dde150da4a61b516ee.jpg) +Figure 3. Overview of the proposed Adaptive Blend Pyramid Network (ABPN). + +![](images/d4195fcb9211ff31ff03b3f22455bf22c8ab7df5aeb8c6bf491255234a197cd5.jpg) +Figure 4. The details of the local attentive module (LAM). + +for training in detail in the following sections, including LRL in Sec. 4.2, BPL in Sec. 4.3, and loss functions in Sec. 4.4. + +# 4.2. Context-aware Local Retouching Layer + +In this section, we propose a context-aware local retouching layer (LRL) to address the first two challenges mentioned in Sec. 1: accurate localization of the target region and local generation with global consistency. As shown in Fig. 3, the LRL adopts a multi-task architecture and consists of a mutual encoder, a mask prediction branch (MPB) and a local retouching branch (LRB). + +Mutual Encoder. The mutual encoder is composed of six simple convolution blocks ( $3 \times 3$ convolutions, batch normalization, and ReLU) in series, and the output of each convolution block composes a feature pyramid $P_F = [F_{skip_i} \in \mathbb{R}^{\frac{h}{2^{l + i}} \times \frac{w}{2^{l + i}} \times c_i}]_{i=0}^6$ , where $c_i$ denotes the number of channels and $F_{skip_0} = I_0$ . Sharing the encoder with the subsequent MPB and LRB is feasible because both of the two branches rely on the semantic features and contextual information to generate their results. It also greatly reduces the computational complexity of the model. + +Mask Prediction Branch. MPB aims to automatically predict the mask $M \in \mathbb{R}^{\frac{h}{2^{l + 2}} \times \frac{w}{2^{l + 2}} \times 1}$ of the target region to guide subsequent local region generation. It consists of four convolution blocks (3 × 3 convolutions, batch normalization, and leakyReLU) and a classification head. Besides, we employ skip connections [44] to incorporate low-level features to improve the accuracy of segmentation. Note that + +$M$ is $4\times$ smaller than $\pmb{I}_l$ but it is sufficient for the guidance of LRB, without sacrifice to the overall performance. Although most of the datasets do not directly provide the target region mask $M_{gt}$ for supervision, owing to the characteristics of the LPR task, we can obtain the $M_{gt}$ by taking a difference between $\pmb{I}_l$ and its target and applying a threshold to it. + +The contributions of MPB to the network are two-fold. First, the predicted mask $M$ itself can help LRB focus on the target region to enhance the retouching quality. Second, through joint training, the global context and semantic information can be better perceived, thereby achieving consistent generation results. + +Local Retouching Branch. Most image translation methods adopt a traditional encoder-decoder architecture to implement global translation, which leads to insufficient attention to the target regions. Based on the gated convolution (GConv) [55], we thus design a local attentive module (LAM) to improve capturing local semantics and textures, as shown in Fig 4. Different from image inpainting, the target region in LPR contains rich texture information, which is essential to generate detailed and realistic results. In this case, we apply skip connections to incorporate low-level features $F_{skip_i}$ from the mutual encoder. Besides, instead of only involving the binary mask in the first or the last block of LRB, we concatenate the soft mask $M$ in every LAM to guide feature fusion and update at different levels. Owing to the gating mechanism of GConv, spatial attention and channel attention are simultaneously employed to fully fuse the features and capture the semantics and textures of the target region. By stacking LAM, LRB is then able to produce consistent and faithful local retouched results. Note that although the predicted mask may have errors, the final retouching area could still not be affected as the mask is only used as soft guidance in LRB. + +# 4.3. Adaptive Blend Pyramid Layer + +LRL achieves local retouching on a low-resolution image, and the following objective is to extend the result to a larger scale while simultaneously enhancing its detail fidelity. Inspired by the concept of blend layer (or top layer) in the digital image editing, we propose an adaptive blend module (ABM) and its reverse one (R-ABM) to achieve lossless transformation between two images with a sparse and smooth blend layer. Then, we build a pyramid to progressively upsample and refine the blend layer and finally apply it to the original input to generate the final result. We describe the implementation details of these components below. + +Adaptive Blend Module. The blend layer is often utilized to be blended with the image (or base layer) in various modes [1] to fulfill different image editing tasks, such as contrast adjustment, dodge and burn. Generally, given an input image $\mathbf{I} \in \mathbb{R}^{h \times w \times 3}$ and a blend layer $\mathbf{B} \in \mathbb{R}^{h \times w \times 3}$ , we blend the two layers to produce the result $\mathbf{R} \in \mathbb{R}^{h \times w \times 3}$ as: + +$$ +\boldsymbol {R} = f (\boldsymbol {I}, \boldsymbol {B}) \tag {1} +$$ + +where $f$ is a pixel-wise function and denotes the mapping formula determined by the blend mode. Limited by the translation ability, a certain blend mode with the fixed function $f$ is difficult to apply to various image editing tasks. To better adapt to the data distribution and the transformation patterns of different tasks, we refer to the Soft Light blend mode [2] and design an adaptive blend module (ABM) as follows: + +$$ +g (\boldsymbol {I}, i) = \boldsymbol {E} \underbrace {\odot \boldsymbol {I} \odot \boldsymbol {I} \cdots \odot \boldsymbol {I}} _ {i} \tag {2} +$$ + +$$ +\boldsymbol {R} = f _ {a} (\boldsymbol {I}, \boldsymbol {B}) = \sum_ {i = 0} ^ {2} \left(\left(j _ {i} \boldsymbol {B} + k _ {i} \boldsymbol {E}\right) \odot g (\boldsymbol {I}, i)\right) \tag {3} +$$ + +where $\odot$ indicates the Hadamard product, $j_{i}$ and $k_{i}$ are learnable parameters shared by ABMs and R-ABM in the framework, and $\pmb{E} \in \mathbb{R}^{h \times w \times 3}$ denotes a constant matrix with the value 1 for all items. + +Reverse Adaptive Blend Module. ABM is based on the prerequisite of the blend layer $\pmb{B}$ . However, we only obtain the low-resolution results $\pmb{R}_l$ in the previous LRL. To acquire the blend layer $\pmb{B}$ , we solve Eq. (3) and build a reverse adaptive blend module (R-ABM) as: + +$$ +\boldsymbol {B} = f _ {r} (\boldsymbol {I}, \boldsymbol {R}) = \frac {\boldsymbol {R} - \sum_ {i = 0} ^ {2} \left(k _ {i} g (\boldsymbol {I} , i)\right)}{\sum_ {i = 0} ^ {2} \left(j _ {i} g (\boldsymbol {I} , i)\right)} \tag {4} +$$ + +where $j_{i},k_{i}$ and $g$ are consistent with those in Eq. (3). + +In general, utilizing the blend layer as an intermediate medium, ABM and R-ABM offer an adaptive transformation between the image $\pmb{I}$ and the result $\pmb{R}$ . Instead of directly expanding the low-resolution result, we employ the + +blend layer to achieve this goal, which has its advantages on two aspects: (1) In the LPR task, the blend layer mainly records local transformation between two images. That means it contains less irrelevant information and can be readily refined with a light-weight network. (2) The blend layer is to be blended with the original image to implement final retouching, which makes full use of the information of the image itself, thereby delivering local retouching with a high detail fidelity. + +Actually, there are plenty of alternative functions or strategies to achieve adaptive blend. An intuitive way is to utilize two networks composed of $1 \times 1$ convolutions and nonlinear activation layers to replace Eq. (3) and Eq. (4) respectively. However, the transformations from the two networks are irreversible and may increase the difficulty in training. In contrast, good reversibility and consistency between ABM and R-ABM ensure that all the blend layers lie in the same domain, which effectively reduces the burden on the model. Moreover, Eq. (3) is a generalized form of the Pegtop's formula [2], which is easy to optimize and tends to produce a smooth and sparse blend layer (see Fig. 7 and Fig. 8). As in our framework, we fulfill the expansion by progressively upsampling and refining the blend layer. Smoothness and sparseness mean a smaller information gap between the low-resolution blend layer and its high-resolution target, which greatly eases the burden on the refining module. See experimental results toward ABM in Sec. 5.4 for its superiority. + +ABM and R-ABM hold simple structures but fully consider the characteristics of the LPR task and provide powerful extensibility to the framework, facilitating fast expansion of the low-resolution results at a negligible cost. + +Refining Module. To apply the low-resolution blend layers to high-resolution images, the refining module is essential to compensating the information loss caused by downsampling. Since the blend layer is initially generated from the low-resolution result, it is short of the transformation information of high-frequency components. We thus include the high-frequency component of the image as an additional input for the refining module. Owing to the smoothness and sparsity of the blend layer produced from R-ABM, we can build a light-weight refining module as: + +$$ +\boldsymbol {B} _ {i} = \phi_ {2} \left(h \left(\phi_ {1} \left(\operatorname {C a t} \left(\operatorname {u p} \left(\boldsymbol {B} _ {i + 1}\right), \boldsymbol {H} _ {i}\right)\right)\right)\right) + \operatorname {u p} \left(\boldsymbol {B} _ {i + 1}\right) \tag {5} +$$ + +where up denotes bilinear interpolation, Cat is channelwise concatenation, $H_{i}$ ( $i \in \{0,1,\dots,l - 1\}$ ) is the high-frequency component of image $I_{i}$ , $\phi_{1}$ and $\phi_{2}$ are $3 \times 3$ convolutions with 16 and 3 filters respectively, and $h$ indicates leaky ReLU with negative slop 0.2. + +Given the input and output of LRL, we first adopt Eq. (4) to calculate a primitive blend layer $B_{l}$ . By continuously upsampling and refining the blend layer, we then obtain a high-resolution blend layer $B_{0}$ with detailed transformation + +![](images/45e2fa5c9222fe9aeab37a91d321736c39b8d4533ad2599dc124f699b858b0ad.jpg) +Figure 5. Qualitative comparison on FFHQR and CRHD-3K (zoom in for a better view): (a) original images, (b) VCNet [53], (c) AutoRetouch [46], (d) pix2pixHD [52], (e) ASAPNet [47], (f) LPTN [25], (g) Ours, and (h) ground-truth images. + +information. At last, Eq. (3) is applied to $B_{0}$ and $I_{0}$ to deliver the final result. + +# 4.4. Loss Functions + +The model is trained in an end-to-end manner, and the loss functions that we utilize for training consist of (i) the multi-scale mean squared-error (MSE) loss $\mathcal{L}_{mse} = \sum_{i=0}^{l}||\pmb{R}_{gt_i} - \pmb{R}_i||_2^2$ , (ii) the perceptual loss $\mathcal{L}_{perc}$ [19] is only applied to the low-resolution outputs $\pmb{R}_l$ for saving training memory cost, (iii) the adversarial loss $\mathcal{L}_{adv}$ [18] for the final outputs $\pmb{R}_0$ , (iv) the dice loss $\mathcal{L}_{dice}$ [34] for the predicted mask $M$ of MPB, and (v) the total variation loss $\mathcal{L}_{tv}$ [19] for each blend layer $\pmb{B}_i$ ( $i \in \{0,1,\dots,l\}$ ). In summary, the joint loss is written as: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {j o i n t}} = \lambda_ {1} \mathcal {L} _ {\text {m s e}} + \lambda_ {2} \mathcal {L} _ {\text {p e r c}} + \lambda_ {3} \mathcal {L} _ {\text {a d v}} \\ + \lambda_ {4} \mathcal {L} _ {d i c e} + \lambda_ {5} \mathcal {L} _ {t v}, \\ \end{array} +$$ + +where $\lambda_1 = \lambda_4 = 1$ and $\lambda_{2} = \lambda_{3} = \lambda_{5} = 0.1$ as default. + +# 5. Experiments + +# 5.1. Experimental Settings + +Datasets. To verify the effectiveness and generalization of our model in LPR, we conduct experiments on two typical and popular local retouching scenarios: cloth retouching (CRHD-3K) and face retouching (FFHQR). The CRHD-3K dataset is described in Sec. 3. FFHQR [46] is a large-scale face retouching dataset based on FFHQ [20], which contains 70,000 high-definition face images from FFHQ and + +their corresponding retouched images. To enable comparison with the methods having diverse inference ability, we pad and resize all the images to $1024 \times 1024$ for training and evaluation in our experiments. Besides, we show the performance of the proposed network on CRHD-3K in the case of different resolutions (from $480\mathrm{p}$ to $4\mathrm{K}$ ) in Sec. 5.5. CRHD-3K is randomly divided into a training set of 2,522 images and a test set of 500 images, and FFHQR is split into train/val/test set as in [46]. + +Implementation details. Our model and baselines are implemented using PyTorch 1.0 on Python 3.6 and trained on a single NVIDIA Tesla P100 GPU. We train our model using the Adam optimizer. With a batch size of 8, the learning rate is $5 \times 10^{-4}$ initially and reduced by $10 \times$ after 100 epochs. We set $l$ at 2 as default in our experiments. Training the whole framework to convergence takes about 18 hours on CRHD-3K and about 70 hours on FFHQR. + +# 5.2. Qualitative Comparison + +Fig. 5 compares the images generated by the proposed model with those by the current state-of-the-art methods on the FFHQR [46] and CRHD-3K datasets. As we can see, pix2pixHD [52], ASAPNet [47], and LPTN [25] are limited in handling the LPR task, and fail to distinguish the retouching regions, resulting in global transfer. Moreover, visual artifacts are observed in the results of pix2pixHD [52] and ASAPNet [47]. VCNet [53] and AutoRetouch [46] yield competitive results; however, the details are still less elegant than ours. To sum up, the proposed model outperforms + +![](images/1d9cb0e4a702efa1fdac9714528b64b024f275c8519d9e6e7af81bc7795ffa3d.jpg) +(a) Input + +![](images/8c2315356aa2e79d603f10d909aa82ffb38f99d88e6cc3c9c89e93a1daacec7f.jpg) +(b) w/o MPB +IoU=10.8 +Figure 6. Ablation study toward MPB and LAM on CRHD-3K. The masks presented in the upper right corner of the last four columns show the changing area relative to the input, following the same processing method illustrated in Sec. 4.2. + +![](images/fe5a7c1b91640c56cb45d7cc8ee2852432869540e4f3e6fbcb813995c5ee6a38.jpg) +(c) w/o LAM +$\mathrm{IoU} = 72.9$ + +![](images/1864203641e201a629e9b7cff32d179c20e8c1cb0c52621002b53a45e18ba20b.jpg) + +![](images/248d52e4061ef16366951df9beb398a97af414a4163b1eabf185c3615ce49114.jpg) +(d) Ours +IoU=79.6 + +![](images/2193c0357c74f180c029eab6dba56e9dc299afef534f08ce9d2c4a25ae19921d.jpg) +(e) Target + +![](images/9cf6b32778435fc4a3348911f42112bdadeb5300c43e88adda3ab0c79d967fb2.jpg) + +
DatasetsFFHQR [46]CRHD-3K
MetricsLPIPS†PSNR¶SSIM¶User Study¶LPIPS†PSNR¶SSIM¶User Study¶Time†
VCNet [53]0.03938.360.97313.3%0.08431.990.9026.0%0.197
AutoRetouch [46]0.02541.830.98618.0%0.08132.700.9077.3%0.057
pix2pixHD [52]0.05331.390.9522.0%0.10127.230.8921.3%0.055
ASAPNet [47]0.16326.210.9100.0%0.10130.310.8874.7%0.015
LPTN [25]0.06937.420.9494.0%0.04235.090.96320.0%0.035
Ours0.01844.350.99362.7%0.02937.350.97160.7%0.009
+ +Table 1. Objective quantitative comparison ( ${}^{ \dagger }$ Lower is better; ${}^{\# }$ Higher is better). + +the counterparts with reasonable retouched results of high detail fidelity. + +# 5.3.Quantitative Comparison + +Objective evaluation. We quantitatively evaluate the proposed method with three metrics: LPIPS, PSNR and SSIM. Table 1 shows the results achieved on the FFHQR [46] and CRHD-3K datasets, where the proposed method achieves the best results compared with the other approaches, clearly demonstrating its effectiveness. + +User study. We evaluate the proposed method via a human subjective study. 10 volunteers with image processing expertise were invited to choose the most elegant image from those generated by the proposed method and the state-of-the-art approaches. Specifically, each participant has 15 questions from FFHQR [46] and 15 questions from CRHD-3K. We tally the votes and show the statistics in Table 1. Our method performs favorably against the other methods. + +Inference time. We evaluate the inference time of all the models on images of $1024 \times 1024$ pixels with a single NVIDIA Tesla P100 GPU (16 GB). As shown in Table 1, VCNet [53], AutoRetouch [46] and pix2pixHD [52] are computationally expensive on high-resolution images. Thanks to the proposed adaptive blend pyramid architecture, our model outperforms the other methods regarding the time consumption. + +# 5.4. Ablation Study + +In order to verify the rationality and effectiveness of the proposed components, we conduct extensive ablation experiments on the CRHD-3K dataset. Table 2 shows the quantitative results, including ablation comparison for MPB, + +LAM, the refining module (RM), and some major blend methods. As revealed in the table, MPB plays a key role in the architecture, contributing a $\sim 4\%$ improvement. We replace LAM with PCB proposed in VCNet [53], and the results show that LAM achieves a $\sim 1\%$ improvement. RM produces a $\sim 2.5\%$ improvement. We also compare the results by adopting different blend modes for image translation, and ABM yields an improvement of $1\sim 1.5\%$ compared to other methods. Below we analyze the effectiveness of each module in detail based on the visualization results. + +On MPB. MPB realizes the localization of the target region to guide local retouching. With the assistance of the mask predicted by MPB, LRB achieves a better semantic perception of the image under a limited model capacity. As shown in Fig. 6, without MPB (column b), the model produces a certain blur effect in the non-target region (the local region on the top), and it is susceptible to background distraction. The changing areas of the results show that MPB helps to keep the non-target region intact to a large extent. Moreover, thanks to the attention to the local target region, precise retouched results are obtained. + +On LAM. We compare LAM with PCB [53], which exhibits its effectiveness in the image inpainting task. As shown in Fig. 6 (column c), the network with PCB fails to make full use of the textures of the target region and results in the loss of details that should be preserved. In contrast, our LAM renders local retouching with high detail fidelity. + +On ABM. To validate the effectiveness of ABM for extending local retouched results from low resolution to high resolution, we compare it with various blend methods as well as other translation strategies. As shown in Fig. 7, directly upsampling and refining the RGB results loses plenty of + +![](images/ab6d545dc16de37f82c062bc54e6c4c6ce7a50aa31dd76b329395c33832d24e8.jpg) + +![](images/a825ac898915ab646313989b7895a86ed089fae4c9da2eeba4b9c2fb8bb7cd9c.jpg) +(a) Input + +![](images/e635d9285e49947aef6e48b11699e9874b75a80455be8c39fdab2bd38175ef60.jpg) + +![](images/24e66e40fa418d2d0fb8d54a45b480ef4419beb92d500604a896bbce28f2eec1.jpg) +(b)Refine RGB + +![](images/44c82b36fd0ae1ce5060c2cd33c7d7afbc67c6177b531b7a1b9a76cc6dbd53ba.jpg) + +![](images/1e378068af69346ef4f5a3a122b05d9cc20bb7d6147b0f63b1e64226bc78e718.jpg) +(c) Addition + +![](images/1b97134d4a6c8b748bfe3f1761ec6c79ace26e7cc796443c122d7a2a850e1faa.jpg) + +![](images/7430c55d7ad029af586bc804b5dc049565b9fef2d876fafa620aefed552ed965.jpg) +(d) Soft Light + +![](images/352c9c21c43bc46c09ff87cdbe3a55114813e06633baa83f02f7ae6e7e859ecb.jpg) + +![](images/eab99219ca63d946510a0657bc354924fe077c7d7665d565898b82a12004605c.jpg) +(e) Convs + +![](images/ece574a72e937b0637783bb8954432d14def741e03e69fcf4db4fdb90027cd71.jpg) + +![](images/6a12e8147b14cb32726b185483ab0ca21517a8e1ea51e337c6504ee3828512bd.jpg) +(f) Ours + +![](images/63a10ea9dc2f92763c2d7a98702393bdb58a7863899c79de4d75730152a91ee6.jpg) + +![](images/80791e4163ee29ffab28893d620eaa72d52dbfc783c56afdae0d2bf66f5a5e99.jpg) +(g) Target + +![](images/13676bb09a30ff21ffbf7fd42690ef4818cb3771c72af734c5d0d70391a21411.jpg) +Figure 7. Visual comparison among different blend methods on CRHD-3K, including (b) refining RGB directly, (c) Addition [1], (d) Soft Light [2], (e) adaptive blend with convolutions and (f) ours. To facilitate visualization, we scale all the blend layer values to $0 \sim 255$ . +(a) Input +Figure 8. Ablation study toward the Refining Module on FFHQR and CRHD-3K. For better observation, we only present some local regions of the blend layers and the corresponding RGB results. + +![](images/173ffeaed5d22b3abf8d02492d139566d820a69d835d8f856880786cd4bbf381.jpg) +(b) w/o Refining Module + +![](images/222037de4aecc2e0f08f2de739b71348ecc8880a706852a7a7cc9424ba80d330.jpg) +(c) Ours + +![](images/eb3539b57b2804e8008261026c18cf35e7800414edcdc1f56c589c9c055c31f8.jpg) +(d) Target + +details, resulting in blurred effects. We adopt some existing blend modes with fixed functions used in digital image editing, such as Addition [1] and Soft Light [2]. The Addition blend mode that adopts linear translation is unable to fit well when the color of the local region changes severely. Limited by the transformation ability, the soft light blend mode cannot greatly change the pixel value near 0 and 255 (as shown in the column d). We also design two 3-layer convolutional networks to replace Eq. (3) and Eq. (4) respectively for adaptive blend. However, subject to the irreversibility of the two translations, it is prone to produce a color difference. With powerful transformation capabilities and good reversibility, the proposed ABM module achieves much more smooth and realistic results. + +On RM. The refining module is proposed to progressively compensate for the deficiency of details in the low-resolution blend layer. As shown in Fig. 8, RM gains massive details for the blend layer, so as to complete precise retouching of the local region. + +# 5.5. High-resolution Expansion Capability + +BPL has a powerful ability to expand upward. By increasing $l$ in Fig. 3, we can achieve local retouching on ultra high-resolution photos at a very low cost. Table 3 shows the quantitative results and runtime of our model at different resolutions. It can be seen that even for 4K resolution images, the model still achieves good retouched results at a super fast speed. Visual examples of 4K images are pro + +
MPBLAMBlend methodsRMPSNR
RGBAdditionSoft LightConvsOurs
33.02
36.24
34.78
35.76
36.57
36.10
35.88
37.35
+ +Table 2. Quantitative ablation experiments on CRHD-3K. + +
ResolutionLPIPS†PSNR¶SSIM¶RuntimeMemory
512×512 (l=1)0.02737.500.9710.0081043MB
1024×1024 (l=2)0.02937.350.9710.0091329MB
2048×2048 (l=3)0.02937.240.9680.0102505MB
4096×4096 (l=4)0.03037.190.9690.0147191MB
+ +Table 3. Comparison of evaluation metrics, runtime, and memory consumption of our model in the case of different resolutions on CRHD-3K. The runtime denotes the average inference time of all test samples on a single NVIDIA Tesla P100 GPU (16 GB). + +vided in the supplementary material. + +# 6. Conclusion + +We summarize a kind of photo retouching as the local photo retouching (LPR) task and develop a novel solution to it, giving full consideration to the intrinsic characteristics of the task itself. Specifically, we design a context-aware local retouching layer based on a multi-task architecture to implement mask prediction and local retouching simultaneously. By utilizing the predicted mask as guidance, global context and local texture can be fully captured to render consistent retouching. Then, we build a pyramid based on the adaptive blend module and the refining module to expand the low-resolution results to the high-resolution ones progressively, showing great extensibility and high fidelity. Consequently, our method exhibits excellent performance in terms of the retouching quality as well as the running speed, achieving real-time inference on 4K images with a single NVIDIA Tesla P100 GPU. In addition, we introduce the first high-definition clothing retouching dataset CRHD-3K to promote the research on clothing retouching and LPR. + +# References + +[1] Blend modes. https://en.wikipedia.org/wiki/ Blend Modes.5,8 +[2] Pegtop blend modes: soft light. http://www.pegtop.net/delphi/articles/blendmodes/softlight.htm.5,8 +[3] Kyungjune Baek, Yunjoy Choi, Youngjung Uh, Jaejun Yoo, and Hyunjung Shim. Rethinking the truly unsupervised image-to-image translation. In ICCV, 2021. 2 +[4] P. J. Burt and E. H. Adelson. The laplacian pyramid as a compact image code. Readings in Computer Vision, 31(4):671-679, 1987. 3 +[5] Jianrui Cai, Shuhang Gu, and Lei Zhang. Learning a deep single image contrast enhancer from multi-exposure images. TIP, 2018. 1, 2 +[6] Nian Cai, Zhenghang Su, Zhineng Lin, Han Wang, Zhijing Yang, and Bingo Wing-Kuen Ling. Blind inpainting using the fully convolutional neural network. The Visual Computer, 2017. 2 +[7] Qifeng Chen and Vladlen Koltun. Photographic image synthesis with cascaded refinement networks. In ICCV, 2017. 2 +[8] 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 CVPR, 2018. 2 +[9] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. pages 8188-8197, 2020. 2 +[10] Yubin Deng, Chen Change Loy, and Xiaou Tang. Aesthetic-driven image enhancement by adversarial learning. In ACM MM, 2018. 2 +[11] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. 2 +[12] Michael Gharbi, Jiawen Chen, Jonathan T Barron, Samuel W Hasinoff, and Fredo Durand. Deep bilateral learning for real-time image enhancement. TOG, 2017. 1, 2, 3 +[13] Xiefan Guo, Hongyu Yang, and Di Huang. Image inpainting via conditional texture and structure dual generation. In ICCV, 2021. 2 +[14] Jingwen He, Yihao Liu, Yu Qiao, and Chao Dong. Conditional sequential modulation for efficient global image retouching. In ECCV, 2020. 1, 2 +[15] Xiaowei Hu, Yitong Jiang, Chi-Wing Fu, and Pheng-Ann Heng. Mask-shadowgan: Learning to remove shadows from unpaired data. In ICCV, 2019. 2, 3 +[16] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017. 2 +[17] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In ECCV, 2018. 2 +[18] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. 2, 6 + +[19] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016. 2, 6 +[20] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. 6 +[21] Satoshi Kosugi and Toshihiko Yamasaki. Unpaired image enhancement featuring reinforcement-learning-controlled image editing software. In AAAI, 2020. 1, 2 +[22] Jingyuan Li, Ning Wang, Lefei Zhang, Bo Du, and Dacheng Tao. Recurrent feature reasoning for image inpainting. In CVPR, 2020. 2 +[23] Xinyang Li, Shengchuan Zhang, Jie Hu, Liujuan Cao, Xiaopeng Hong, Xudong Mao, Feiyue Huang, Yongjian Wu, and Rongrong Ji. Image-to-image translation via hierarchical style disentanglement. In CVPR, 2021. 2 +[24] Jie Liang, Hui Zeng, Miaomiao Cui, Xuansong Xie, and Lei Zhang. Ppr10k: A large-scale portrait photo retouching dataset with human-region mask and group-level consistency. In CVPR, 2021. 3 +[25] Jie Liang, Hui Zeng, and Lei Zhang. High-resolution photorealistic image translation in real-time: A laplacian pyramid translation network. In CVPR, 2021. 1, 2, 3, 6, 7 +[26] Liang Liao, Jing Xiao, Zheng Wang, Chia-Wen Lin, and Shin'ichi Satoh. Image inpainting guided by coherence priors of semantics and textures. In CVPR, 2021. 2 +[27] Ji Lin, Richard Zhang, Frieder Ganz, Song Han, and JunYan Zhu. Anycost gans for interactive image synthesis and editing. In CVPR, 2021. 2 +[28] Guilin Liu, Fitsum A Reda, Kevin J Shih, Ting-Chun Wang, Andrew Tao, and Bryan Catanzaro. Image inpainting for irregular holes using partial convolutions. In ECCV, 2018. 2 +[29] Hongyu Liu, Bin Jiang, Yibing Song, Wei Huang, and Chao Yang. Rethinking image inpainting via a mutual encoder-decoder with feature equalizations. In ECCV, 2020. 2 +[30] Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In NeurIPS, 2017. 2 +[31] Yang Liu, Jinshan Pan, and Zhixun Su. Deep blind image inpainting. In IScIDE, 2019. 2 +[32] Zhihao Liu, Hui Yin, Yang Mi, Mengyang Pu, and Song Wang. Shadow removal by a lightness-guided network with training on unpaired data. TIP, 2021. 2, 3 +[33] Zhihao Liu, Hui Yin, Xinyi Wu, Zhenyao Wu, Yang Mi, and Song Wang. From shadow generation to shadow removal. In CVPR, 2021. 2, 3 +[34] Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 3DV, 2016. 6 +[35] Kamyar Nazeri, Eric Ng, Tony Joseph, Faisal Qureshi, and Mehran Ebrahimi. Edgeconnect: Structure guided image inpainting using edge prediction. In ICCVW, 2019. 2 +[36] Taesung Park, Alexei A Efros, Richard Zhang, and JunYan Zhu. Contrastive learning for unpaired image-to-image translation. In ECCV, 2020. 2 +[37] Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In CVPR, 2019. 2 + +[38] Taesung Park, Jun-Yan Zhu, Oliver Wang, Jingwan Lu, Eli Shechtman, Alexei A Efros, and Richard Zhang. Swapping autoencoder for deep image manipulation. In NeurIPS, 2020. 2 +[39] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In CVPR, 2016. 2 +[40] Rui Qian, Robby T Tan, Wenhan Yang, Jiajun Su, and Jiaying Liu. Attentive generative adversarial network for raindrop removal from a single image. In CVPR, 2018. 2, 3 +[41] Ruijie Quan, Xin Yu, Yuanzhi Liang, and Yi Yang. Removing raindrops and rain streaks in one go. In CVPR, 2021. 2, 3 +[42] Dongwei Ren, Wangmeng Zuo, Qinghua Hu, Pengfei Zhu, and Deyu Meng. Progressive image deraining networks: A better and simpler baseline. In CVPR, 2019. 2, 3 +[43] Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or. Encoding in style: a stylegan encoder for image-to-image translation. In CVPR, 2021. 2 +[44] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. 4 +[45] Artsiom Sanakoyeu, Dmytro Kotovenko, Sabine Lang, and Bjorn Ommer. A style-aware content loss for real-time hd style transfer. In ECCV, 2018. 2 +[46] Alireza Shafaei, James J Little, and Mark Schmidt. Autoretouch: Automatic professional face retouching. In WACV, 2021. 1, 2, 6, 7 +[47] Tamar Rott Shaham, Michael Gharbi, Richard Zhang, Eli Shechtman, and Tomer Michaeli. Spatially-adaptive pixelwise networks for fast image translation. In CVPR, 2021. 2, 3, 6, 7 +[48] Hong Wang, Qi Xie, Qian Zhao, and Deyu Meng. A model-driven deep neural network for single image rain removal. In CVPR, 2020. 2, 3 +[49] Hong Wang, Zongsheng Yue, Qi Xie, Qian Zhao, Yefeng Zheng, and Deyu Meng. From rain generation to rain removal. In CVPR, 2021. 2, 3 +[50] Ruixing Wang, Qing Zhang, Chi-Wing Fu, Xiaoyong Shen, Wei-Shi Zheng, and Jiaya Jia. Underexposed photo enhancement using deep illumination estimation. In CVPR, 2019. 2 +[51] Tengfei Wang, Hao Ouyang, and Qifeng Chen. Image inpainting with external-internal learning and monochromatic bottleneck. In CVPR, 2021. 2 +[52] 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. 2, 3, 6, 7 +[53] Yi Wang, Ying-Cong Chen, Xin Tao, and Jiaya Jia. Vcnet: A robust approach to blind image inpainting. In ECCV, 2020. 2, 6, 7 +[54] Jiahui Yu, Zhe Lin, Jamei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative image inpainting with contextual attention. In CVPR, 2018. 2 +[55] Jiahui Yu, Zhe Lin, Jamei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Free-form image inpainting with gated convolution. In ICCV, 2019. 2, 4 + +[56] Yingchen Yu, Fangneng Zhan, Shijian Lu, Jianxiong Pan, Feiying Ma, Xuansong Xie, and Chunyan Miao. Wavefill: A wavelet-based generation network for image inpainting. In ICCV, 2021. 2 +[57] Hui Zeng, Jianrui Cai, Lida Li, Zisheng Cao, and Lei Zhang. Learning image-adaptive 3d lookup tables for high performance photo enhancement in real-time. TPAMI, 2020. 1, 2 +[58] Yu Zeng, Zhe Lin, Huchuan Lu, and Vishal M Patel. Crfill: Generative image inpainting with auxiliary contextual reconstruction. In ICCV, 2021. 2 +[59] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 2 \ No newline at end of file diff --git a/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/images.zip b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2a759e246ed4aac0057b318d35618a4de88d75a8 --- /dev/null +++ b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84996cff1fa09319120c421aa581ffe9c1bae6c80883f11f42c7ca337d3aac36 +size 665462 diff --git a/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/layout.json b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8935f967385ed78c7da69aad9cf58e9cc58f23f1 --- /dev/null +++ b/abpnadaptiveblendpyramidnetworkforrealtimelocalretouchingofultrahighresolutionphoto/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:232ab857c2a2c8ce2b9afecd3379ba436f8e4c47258c13302d76373c7e4ff785 +size 450794 diff --git a/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_content_list.json b/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..630a6b4ec4a8f869617e2dd1f53f7b18b30ba0cf --- /dev/null +++ b/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ce45670004732644d146895ac8ad8e1f6cbbbe9d98415b51eb3f89f62c45118 +size 73493 diff --git a/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_model.json b/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d4ca8a8c553e458d987173490c46af05bb214877 --- /dev/null +++ b/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f72f3f24bad3916abf01c80ee010f1c5b7806978f7c8601c52571a43a8dd0bf2 +size 92106 diff --git a/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_origin.pdf b/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e5561020cd8433bf82b8d9f4b70cef4899f02df3 --- /dev/null +++ b/acceleratingdetrconvergenceviasemanticalignedmatching/93bf8c77-36d2-40ed-b94e-4226b5a6b6a2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4289c81575cae1ea825131bc287617bfc27d2f930e0ef1ed8a9ac11ff448e74 +size 5510511 diff --git a/acceleratingdetrconvergenceviasemanticalignedmatching/full.md b/acceleratingdetrconvergenceviasemanticalignedmatching/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9dd876053072e2e9c5a96ad74a03d8d3153b382e --- /dev/null +++ b/acceleratingdetrconvergenceviasemanticalignedmatching/full.md @@ -0,0 +1,273 @@ +# Accelerating DETR Convergence via Semantic-Aligned Matching + +Gongjie Zhang $^{1}$ Zhipeng Luo $^{1,2}$ Yingchen Yu $^{1}$ Kaiwen Cui $^{1}$ Shijian Lu $^{*1}$ $^{1}$ Nanyang Technological University, Singapore $^{2}$ SenseTime Research + +{gongjiezhang, shijian.lu}@ntu.edu.sg {zhipeng001, yingchen001, kaiwen001}@e.ntu.edu.sg + +# Abstract + +The recently developed DEetection Transformer (DETR) establishes a new object detection paradigm by eliminating a series of hand-crafted components. However, DETR suffers from extremely slow convergence, which increases the training cost significantly. We observe that the slow convergence is largely attributed to the complication in matching object queries with target features in different feature embedding spaces. This paper presents SAM-DETR, a Semantic-Aligned-Matching DETR that greatly accelerates DETR's convergence without sacrificing its accuracy. SAM-DETR addresses the convergence issue from two perspectives. First, it projects object queries into the same embedding space as encoded image features, where the matching can be accomplished efficiently with aligned semantics. Second, it explicitly searches salient points with the most discriminative features for semantic-aligned matching, which further speeds up the convergence and boosts detection accuracy as well. Being like a plug and play, SAM-DETR complements existing convergence solutions well yet only introduces slight computational overhead. Extensive experiments show that the proposed SAM-DETR achieves superior convergence as well as competitive detection accuracy. The implementation codes are publicly available at https://github.com/ZhangGongjie/SAM-DETR. + +# 1. Introduction + +Object detection is one of the most fundamental tasks in computer vision and has achieved unprecedented progress with the development of deep learning [27]. However, most object detectors often suffer from complex detection pipelines and sub-optimal performance due to their overreliance on hand-crafted components such as anchors, rule-based target assignment, and non-maximum suppression (NMS). The recently proposed DEtction TRansformer (DETR) [3] removes the need for such hand-designed components and establishes a fully end-to-end framework for + +![](images/0e74a7c22bef202c5f128b8777604f91f55abecb08aca548c0383fc34e40df2f.jpg) +Figure 1. Convergence curves of our proposed SAM-DETR and other detectors on COCO val 2017 under the 12-epoch training scheme. All competing methods are single-scale. SAM-DETR converges much faster than the original DETR, and can work in complementary with existing convergence-boosting solutions, reaching a comparable convergence speed with Faster R-CNN. + +object detection. Despite its simple design and promising results, one of the most significant drawbacks of DETR is its extremely slow convergence on training, which requires 500 epochs to converge on the COCO benchmark [26], while Faster R-CNN [35] only takes $12\sim 36$ epochs instead. This slow convergence issue significantly increases the training cost and thus hinders its more comprehensive applications. + +DETR employs a set of object queries in its decoder to detect target objects at different spatial locations. As shown in Fig. 2, in the cross-attention module, these object queries are trained with a set-based global loss to match the target objects and distill corresponding features from the matched regions for subsequent prediction. However, as pointed out in [10, 31, 63], each object query is almost equally matched to all spatial locations at initialization, thus + +![](images/7898d79a96ca0e130d4a9c7cbfb55a6fea85a370b4c6e9d71bcd74b87bc4c995.jpg) +Figure 2. The cross-attention module in DETR's decoder can be interpreted as a 'matching and feature distillation' process. Each object query first matches its own relevant regions in encoded image features, and then distills features from the matched regions, generating output for subsequent prediction. + +requiring tedious training iterations to learn to focus on relevant regions. The matching difficulty between object queries and corresponding target features is the major reason for DETR's slow convergence. + +A few recent works have been proposed to tackle the slow convergence issue of DETR. For example, Deformable DETR [63] replaces the original global dense attention with deformable attention that only attends to a small set of features to lower the complexity and speed up convergence. Conditional DETR [31] and SMCA-DETR [10] modify the cross-attention module to be spatially conditioned. In contrast, our approach works from a different perspective without modifying the attention mechanism. + +Our core idea is to ease the matching process between object queries and their corresponding target features. One promising direction for matching has been defined by Siamese-based architecture, which aligns the semantics of both matching sides via two identical sub-networks to project them into the same embedding space. Its effectiveness has been demonstrated in various matching-involved vision tasks, such as object tracking [1, 4, 20, 21, 46, 47], re-identification [5, 37, 38, 48, 59], and few-shot recognition [15, 19, 39, 41, 55]. Motivated by this observation, we propose Semantic-Aligned-Matching DETR (SAM-DETR), which appends a plug-and-play module ahead of the crossattention module to semantically align object queries with encoded image features, thus facilitating the subsequent matching between them. This imposes a strong prior for object queries to focus on semantically similar regions in encoded image features. In addition, motivated by the importance of objects' keypoints and extremities in recognition and localization [3, 31, 62], we propose to explicitly + +search multiple salient points and use them for semantic-aligned matching, which naturally fits in the DETR's original multi-head attention mechanism. Our approach only introduces a plug-and-play module into the original DETR while leaving most other operations unchanged. Therefore, the proposed method can be easily integrated with existing convergence solutions in a complementary manner. + +In summary, the contributions of this work are fourfold. First, we propose Semantic-Aligned-Matching DETR (SAM-DETR), which significantly accelerates DETR's convergence by innovatively interpreting its cross-attention as a 'matching and distillation' process and semantically aligning object queries with encoded image features to facilitate their matching. Second, we propose to explicitly search for objects' salient points with the most discriminative features and feed them to the cross-attention module for semantic-aligned matching, which further boosts the detection accuracy and speeds up the convergence of our model. Third, experiments validate that our proposed SAM-DETR achieves significantly faster convergence compared with the original DETR. Fourth, as our approach only adds a plug-and-play module into the original DETR and leaves other operations mostly unchanged, the proposed SAM-DETR can be easily integrated with existing solutions that modify the attention mechanism to further improve DETR's convergence, leading to a comparable convergence speed with Faster R-CNN even within 12 training epochs. + +# 2. Related Work + +Object Detection. Modern object detection methods can be broadly classified into two categories: two-stage and single-stage detectors. Two-stage detectors mainly include Faster R-CNN [35] and its variants [2, 9, 16, 23, 32, 44, 49, 51, 54], which employ a Region Proposal Network (RPN) to generate region proposals and then make per-region predictions over them. Single-stage detectors [17, 28, 29, 33, 34, 43, 57, 61, 62] skip the proposal generation and directly perform object classification and localization over densely placed sliding windows (anchors) or object centers. However, most of these approaches still rely on many handcrafted components, such as anchor generation, rule-based training target assignment, and non-maximum suppression (NMS) post-processing, thus are not fully end-to-end. + +Distinct from the detectors mentioned above, the recently proposed DETR [3] has established a new paradigm for object detection [50, 55, 56, 60, 63]. It employs a Transformer [45] encoder-decoder architecture and a set-based global loss to replace the hand-crafted components, achieving the first fully end-to-end object detector. However, DETR suffers from severe low convergence and requires extra-long training to reach good performance compared with those two-stage and single-stage detectors. Several works have been proposed to mitigate this issue: De + +formable DETR [63] replaces the original dense attention with sparse deformable attention; Conditional DETR [31] and SMCA-DETR [10] propose conditioned cross-attention and Spatially Modulated Co-Attention (SMCA), respectively, to replace the cross-attention module in DETR's decoder, aiming to impose spatial constraints to the original cross-attention to better focus on prominent regions. In this work, we also aim to improve DETR's convergence, but from a different perspective. Our approach does not modify the original attention mechanism in DETR, thus can work in complementary with existing methods. + +Siamese-based Architecture for Matching. Matching is a common concept in vision tasks, especially in contrastive tasks such as face recognition [36, 40], re-identification [5, 14,22,37,38,48,59], object tracking [1,4,8,11,20,21,42,46, 47,52,58,64], few-shot recognition [15, 19, 39, 41, 53, 55], etc. Its core idea is to predict the similarity between two inputs. Empirical results have shown that Siamese-based architectures, which project both matching sides into the same embedding space, perform exceptionally well on the tasks involving matching. Our work is motivated by this observation to interpret DETR's cross-attention as a 'matching and feature distillation' process. To achieve fast convergence, it is crucial to ensure the aligned semantics between object queries and encoded image features, i.e., both of them are projected into the same embedding space. + +# 3. Proposed Method + +In this section, we first review the basic architecture of DETR, and then introduce the architecture of our proposed Semantic-Aligned-Matching DETR (SAM-DETR). We also show how to integrate our approach with existing convergence solutions to boost DETR's convergence further. Finally, we present and analyze the visualization of a few examples to illustrate the mechanism of our approach and demonstrate its effectiveness. + +# 3.1. A Review of DETR + +DETR [3] formulates the task of object detection as a set prediction problem and addresses it with a Transformer [45] encoder-decoder architecture. Given an image $\mathbf{I} \in \mathbb{R}^{H_0 \times W_0 \times 3}$ , the backbone and the Transformer encoder produce the encoded image features $\mathbf{F} \in \mathbb{R}^{HW \times d}$ , where $d$ is the feature dimension, and $H_0$ , $W_0$ and $H$ , $W$ denote the spatial sizes of the image and the features, respectively. Then, the encoded image features $\mathbf{F}$ and a small set of object queries $\mathbf{Q} \in \mathbb{R}^{N \times d}$ are fed into the Transformer decoder to produce detection results, where $N$ is the number of object queries, typically $100 \sim 300$ . + +In the Transformer decoder, object queries are sequentially processed by a self-attention module, a cross-attention module, and a feed-forward network (FFN) to produce the + +outputs, which further go through a Multi-Layer Perceptron (MLP) to generate prediction results. A good way to interpret this process is: object queries denote potential objects at different spatial locations; the self-attention module performs message passing among different object queries; and in the cross-attention module, object queries first search for the corresponding regions to match, then distill relevant features from the matched regions for the subsequent predictions. The cross-attention mechanism is formulated as: + +$$ +\mathbf {Q} ^ {\prime} = \overbrace {\operatorname {S o f t m a x} \left(\frac {\left(\mathbf {Q W} _ {\mathrm {q}}\right) \left(\mathbf {F W} _ {\mathrm {k}}\right) ^ {\mathrm {T}}}{\sqrt {d}}\right) \left(\mathbf {F W} _ {\mathrm {v}}\right)} ^ {\text {t o m a t c h r e l e v a n t r e g i o n s}}, \tag {1} +$$ + +where $\mathbf{W}_{\mathrm{q}}$ , $\mathbf{W}_{\mathrm{k}}$ , and $\mathbf{W}_{\mathrm{v}}$ are the linear projections for query, key, and value in the attention mechanism. Ideally, the cross-attention module's output $\mathbf{Q}' \in \mathbb{R}^{N \times d}$ should contain relevant information distilled from the encoded image features to predict object classes and locations. + +However, as pointed out in [10,31,63], the object queries are initially equally matched to all spatial locations in the encoded image features, and it is very challenging for the object queries to learn to focus on specific regions properly. The matching difficulty is the key reason that causes the slow convergence issue of DETR. + +# 3.2. SAM-DETR + +Our proposed SAM-DETR aims to relieve the difficulty of the matching process in Eq. 1 by semantically aligning object queries and encoded image features into the same embedding space, thus accelerating DETR's convergence. Its major difference from the original DETR [3] lies in the Transformer decoder layers. As illustrated in Fig. 3 (a), the proposed SAM-DETR appends a Semantics Aligner module ahead of the cross-attention module and models learnable reference boxes to facilitate the matching process. Same as DETR, the decoder layer is repeated six times, with zeros as input for the first layer and previous layer's outputs as input for subsequent layers. + +The learnable reference boxes $\mathbf{R}_{\mathrm{box}} \in \mathbb{R}^{N \times 4}$ are modeled at the first decoder layer, representing the initial locations of the corresponding object queries. With the localization guidance of these reference boxes, the proposed Semantics Aligner takes the previous object query embeddings $\mathbf{Q}$ and the encoded image features $\mathbf{F}$ as inputs to generate new object query embeddings $\mathbf{Q}^{\mathrm{new}}$ and their position embeddings $\mathbf{Q}_{\mathrm{pos}}^{\mathrm{new}}$ , feeding to the subsequent cross-attention module. The generated embeddings $\mathbf{Q}^{\mathrm{new}}$ are enforced to lie in the same embedding space with the encoded image features $\mathbf{F}$ , which facilitates the subsequent matching process between them, making object queries able to quickly and properly attend to relevant regions in the encoded image features. + +![](images/26a78641a9708e4878bb93a570aa4e80de6bf7363b0d78f59e419faa59515dad.jpg) +Figure 3. The proposed Semantic-Aligned-Matching DETR (SAM-DETR) appends a Semantics Aligner into the Transformer decoder layer. (a) The architecture of one decoder layer in SAM-DETR. It models a learnable reference box for each object query, whose center location is used to generate corresponding position embeddings. With the guidance of the reference boxes, Semantics Aligner generates new object queries that are semantically aligned with the encoded image features, thus facilitating their subsequent matching. (b) The pipeline of the proposed Semantics Aligner. For simplicity, only one object query is illustrated. It first leverages the reference box to extract features from the corresponding region via RoIAAlign. The region features are then used to predict the coordinates of salient points with the most discriminative features. The salient points' features are then extracted as the new query embeddings with aligned semantics, which are further reweighted by previous query embeddings to incorporate useful information from them. + +![](images/d9aa21c55df11087acea2715997c16054b362a3958a5137df5733cf585b5bbbe.jpg) + +# 3.2.1 Semantic-Aligned Matching + +As shown in Eq. 1 and Fig. 2, the cross-attention module applies dot-product to object queries and encoded image features, producing attention weight maps indicating the matching between object queries and target regions. It is intuitive to use dot-product since it measures similarity between two vectors, encouraging object queries to have higher attention weights for more similar regions. However, the original DETR [3] does not enforce object queries and encoded image features being semantically aligned, i.e., projected into the same embedding space. Therefore, the object query embeddings are randomly projected to an embedding space at initialization, thus are almost equally matched to the encoded image features' all spatial locations. Consequently, extremely long training is needed to learn a meaningful matching between them. + +With the above observation, the proposed Semantics Aligner designs a semantic alignment mechanism to ensure object query embeddings are in the same embedding space with encoded image features, which guarantees the + +dot-product between them is a meaningful measurement of similarity. This is accomplished by resampling object queries from the encoded image features based on the reference boxes, as shown in Fig. 3(b). Given the encoded image features $\mathbf{F}$ and object queries' reference boxes $\mathbf{R}_{\mathrm{box}}$ , the Semantics Aligner first restores the spatial dimensions of the encoded image features from 1D sequences $HW \times d$ to 2D maps $H \times W \times d$ . Then, it applies RoIAlign [12] to extract region-level features $\mathbf{F}_{\mathrm{R}} \in \mathbb{R}^{N \times 7 \times 7 \times d}$ from the encoded image features. The new object queries $\mathbf{Q}_{\mathrm{pos}}^{\mathrm{new}}$ and $\mathbf{Q}_{\mathrm{pos}}^{\mathrm{new}}$ are then obtained via resampling from $\mathbf{F}_{\mathrm{R}}$ . More details are to be discussed in the ensuing subsection. + +$$ +\mathbf {F} _ {\mathrm {R}} = \operatorname {R o I A l i g n} (\mathbf {F}, \mathbf {R} _ {\text {b o x}}) \tag {2} +$$ + +$$ +\mathbf {Q} ^ {\text {n e w}}, \mathbf {Q} _ {\text {p o s}} ^ {\text {n e w}} = \operatorname {R e s a m p l e} \left(\mathbf {F} _ {\mathrm {R}}, \mathbf {R} _ {\text {b o x}}, \mathbf {Q}\right) \tag {3} +$$ + +Since the resampling process does not involve any projection, the new object query embeddings $\mathbf{Q}^{\mathrm{new}}$ share the exact same embedding space with the encoded image features $\mathbf{F}$ , yielding a strong prior for object queries to focus on semantically similar regions. + +# 3.2.2 Matching with Salient Point Features + +Multi-head attention plays an indispensable role in DETR, which allows each head to focus on different parts and thus significantly strengthens its modeling capacity. Besides, prior works [3, 31, 62] have identified the importance of objects' most discriminative salient points in object detection. Inspired by these observations, instead of naively resampling by average-pooling or max-pooling, we propose to explicitly search for multiple salient points and employ their features for the aforementioned semantic-aligned matching. Such design naturally fits in the multi-head attention mechanism [45] without any modification. + +Let us denote the number of attention heads as $M$ , which is typically set to 8. As shown in Fig. 3 (b), after retrieving region-level features $\mathbf{F}_{\mathrm{R}}$ via RoIAlign, we apply a ConvNet followed by a multi-layer perception (MLP) to predict $M$ coordinates $\mathbf{R}_{\mathrm{SP}} \in \mathbb{R}^{N \times M \times 2}$ for each region, representing the salient points that are crucial for recognizing and localizing the objects. + +$$ +\mathbf {R} _ {\mathrm {S P}} = \operatorname {M L P} \left(\operatorname {C o n v N e t} \left(\mathbf {F} _ {\mathrm {R}}\right)\right) \tag {4} +$$ + +It is worth noting that we constrain the predicted coordinates to be within the reference boxes. This design choice has been empirically verified in Section 4.3. Salient points' features are then sampled from $\mathbf{F}_{\mathrm{R}}$ via bilinear interpolation. The $M$ sampled feature vectors corresponding to the $M$ searched salient points are finally concatenated as the new object query embeddings, so that each attention head can focus on features from one salient point. + +$$ +\mathbf {Q} ^ {\text {n e w} \prime} = \operatorname {C o n c a t} \left(\left\{\mathbf {F} _ {\mathrm {R}} [ \dots , x, y, \dots ] \text {f o r} x, y \in \mathbf {R} _ {\mathrm {S P}} \right\}\right) \tag {5} +$$ + +The new object queries' position embeddings are generated using sinusoidal functions with salient points' image-scale coordinates as input. Similarly, position embeddings corresponding to $M$ salient points are also concatenated to feed to the subsequent multi-head cross-attention module. + +$$ +\mathbf {Q} _ {\text {p o s}} ^ {\text {n e w} \prime} = \operatorname {C o n c a t} \left(\operatorname {S i n u s o i d a l} \left(\mathbf {R} _ {\text {b o x}}, \mathbf {R} _ {\mathrm {S P}}\right)\right) \tag {6} +$$ + +# 3.2.3 Reweighting by Previous Query Embeddings + +The Semantics Aligner effectively generates new object queries that are semantically aligned with encoded image features, but also brings one issue: previous query embeddings $\mathbf{Q}$ that contain valuable information for detection are not leveraged at all in the cross-attention module. To mitigate this issue, the proposed Semantics Aligner also takes previous query embeddings $\mathbf{Q}$ as inputs to generate reweighting coefficients via a linear projection followed by a sigmoid function. Through element-wise multiplication with the reweighting coefficients, both new query embeddings and their position embeddings are reweighted to highlight important features, thus effectively leveraging useful + +information from previous query embeddings. This process can be formulated as: + +$$ +\mathbf {Q} ^ {\text {n e w}} = \mathbf {Q} ^ {\text {n e w} \prime} \otimes \sigma (\mathbf {Q W} _ {\mathrm {R W} 1}) \tag {7} +$$ + +$$ +\mathbf {Q} _ {\text {p o s}} ^ {\text {n e w}} = \mathbf {Q} _ {\text {p o s}} ^ {\text {n e w} \prime} \otimes \sigma (\mathbf {Q W} _ {\mathrm {R W} 2}), \tag {8} +$$ + +where $\mathbf{W}_{\mathrm{RW1}}$ and $\mathbf{W}_{\mathrm{RW2}}$ denote linear projections, $\sigma(\cdot)$ denotes sigmoid function, and $\otimes$ denotes element-wise multiplication. + +# 3.3. Compatibility with SMCA-DETR + +As illustrated in Fig. 3(a), our proposed SAM-DETR only adds a plug-and-play module with slight computational overhead, leaving most other operations like the attention mechanism unchanged. Therefore, our approach can easily work with existing convergence solutions in a complementary manner to facilitate DETR's convergence further. We demonstrate the excellent compatibility of our approach by integrating it with SMCA-DETR [10], a state-of-the-art method to accelerate DETR's convergence. + +SMCA-DETR [10] replaces the original cross-attention with Spatially Modulated Co-Attention (SMCA), which estimates the spatial locations of object queries and applies 2D-Gaussian weight maps to constrain the attention responses. In SMCA-DETR [10], both the center locations and the scales for the 2D-Gaussian weight maps are predicted from the object query embeddings. To integrate our proposed SAM-DETR with SMCA, we make slight modifications: we adopt the coordinates of $M$ salient points predicted by Semantics Aligner as the center locations for the 2D Gaussian-like weight maps, and simultaneously predict the scales of weight maps from pooled RoI features. Experimental results demonstrate the complementary effect between our proposed approach and SMCA-DETR [10]. + +# 3.4. Visualization and Analysis + +Fig. 4 visualizes the salient points searched by the proposed Semantics Aligner, as well as their attention weight maps generated from the multi-head cross-attention module. We also compare them with the original DETR's attention weight maps. Both models are trained for 12 epochs with ResNet-50 [13] as their backbones. + +It can be observed that the searched salient points mostly fall within the target objects and typically are the most distinctive locations that are crucial for object recognition and localization. This illustrates the effectiveness of our approach in searching salient features for the subsequent matching process. Besides, as shown in the attention weight maps from different heads, the sampled features from each salient point can effectively match target regions and narrow down the search range as reflected by the area of attention maps. Consequently, the model can effectively and efficiently attend to the extremities of the target objects as + +![](images/8bc8a462976141aa0aa78cf549e62b2f79e051323b3b9c40526fb0ea212eb112.jpg) +Figure 4. Visualization of SAM-DETR's searched salient points and their attention weight maps. The searched salient points mostly fall within the target objects and precisely indicate the locations with the most discriminative features for object recognition and localization. Compared with the original DETR, SAM-DETR's attention weight maps are more precise, demonstrating that our method effectively narrows down the search space for matching and facilitates convergence. In contrast, the original DETR's attention weight maps are more scattered, suggesting its inefficiency for matching relevant regions and distilling distinctive features. + +shown in the overall attention maps, which greatly facilitates the convergence. In contrast, the attention maps generated from the original DETR are much more scattered, failing to locate the extremities efficiently and accurately. Such observation aligns with our motivation that the complication in matching object queries to target features is the primary reason for DETR's slow convergence. The visualization also proves the effectiveness of our proposed design in easing the matching difficulty via semantic-aligned matching and explicitly searched salient features. + +# 4. Experiments + +# 4.1. Experiment Setup + +Dataset and Evaluation Metrics. We conduct experiments on the COCO 2017 dataset [26], which contains $\sim 117\mathrm{k}$ training images and $5\mathrm{k}$ validation images. Standard evaluation metrics for COCO are adopted to evaluate the performance of object detection. + +Implementation Details. The implementation details of SAM-DETR mostly align with the original DETR [3]. We adopt ImageNet-pretrained [7] ResNet-50 [13] as the backbone, and train our model with $8 \times$ Nvidia V100 GPUs using the AdamW optimizer [18, 30]. The initial learning rate is set as $1 \times 10^{-5}$ for the backbone and $1 \times 10^{-4}$ for the Transformer encoder-decoder framework, with a weight decay of $1 \times 10^{-4}$ . The learning rate is decayed at a later stage by 0.1. The batch size is set to 16. When using ResNet-50 with dilations (R50-DC5), the batch size is 8. Model-architecture-related hyper-parameters stay the same with DETR, except we increase the number of object queries $N$ from 100 to 300, and replace cross-entropy loss for classification with sigmoid focal loss [25]. Both design changes align with the recent works to facilitate DETR's convergence [10, 31, 63]. + +We adopt the same data augmentation scheme as DETR [3], which includes horizontal flip, random crop, and random resize with the longest side at most 1333 pixels and the shortest side at least 480 pixels. + +
Methodmulti-scale#Epochs#Params (M)GFLOPsAP\( AP_{0.5} \)\( AP_{0.75} \)\( AP_S \)\( AP_M \)\( AP_L \)
Baseline methods trained for long epochs:
Faster-RCNN-R50-DC5 [35]10816632041.161.444.322.945.955.0
Faster-RCNN-FPN-R50 [24,35]1084218042.062.145.526.645.453.4
DETR-R50 [3]500418642.062.444.220.545.861.1
DETR-R50-DC5 [3]5004118743.363.145.922.547.361.1
Comparison of SAM-DETR with other detectors under shorter training schemes:
Faster-RCNN-R50 [35]123454735.756.138.019.240.948.7
DETR-R50 [3]‡12418622.339.522.26.622.836.6
Deformable-DETR-R50 [63]12347831.851.433.515.035.744.7
Conditional-DETR-R50 [31]12449032.252.133.413.934.548.7
SMCA-DETR-R50 [10]12428631.651.733.114.134.446.5
SAM-DETR-R50 (Ours)125810033.154.233.713.936.551.7
SAM-DETR-R50 w/ SMCA (Ours)125810036.056.837.315.839.455.3
Faster-RCNN-R50-DC5 [35]1216632037.358.839.720.141.750.0
DETR-R50-DC5 [3]‡124118725.944.426.07.927.141.4
Deformable-DETR-R50-DC5 [63]123412834.954.337.619.038.947.5
Conditional-DETR-R50-DC5 [31]124419535.955.838.217.838.852.0
SMCA-DETR-R50-DC5 [10]124218732.552.833.914.235.448.1
SAM-DETR-R50-DC5 (Ours)125821038.359.140.121.041.855.2
SAM-DETR-R50-DC5 w/ SMCA (Ours)125821040.661.142.821.943.958.5
Faster-RCNN-R50 [35]363454738.458.741.320.742.753.1
DETR-R50 [3]‡50418634.955.536.014.437.254.5
Deformable-DETR-R50 [63]50347839.459.642.320.643.055.5
Conditional-DETR-R50 [31]50449040.961.843.320.844.659.2
SMCA-DETR-R50 [10]50428641.0--21.944.359.1
SAM-DETR-R50 (Ours)505810039.861.841.620.543.459.6
SAM-DETR-R50 w/ SMCA (Ours)505810041.863.243.922.145.960.9
Deformable-DETR-R50 [63]504017343.862.647.726.447.158.0
SMCA-DETR-R50 [10]504015243.763.647.224.247.060.4
Faster-RCNN-R50-DC5 [35]3616632039.060.542.321.443.552.5
DETR-R50-DC5 [3]‡504118736.757.638.215.439.856.3
Deformable-DETR-R50-DC5 [63]503412841.561.844.924.145.356.0
Conditional-DETR-R50-DC5 [31]504419543.864.446.724.047.660.7
SAM-DETR-R50-DC5 (Ours)505821043.364.446.225.146.961.0
SAM-DETR-R50-DC5 w/ SMCA (Ours)505821045.065.447.926.249.063.3
Accelerating DETR's convergence with self-supervised learning:
UP-DETR-R50 [6]150418640.560.842.619.044.460.0
UP-DETR-R50 [6]300418642.863.045.320.847.161.7
+ +Table 1. Comparison of the proposed SAM-DETR, other DETR-like detectors, and Faster R-CNN on COCO 2017 val set. $\ddagger$ denotes the original DETR [3] with aligned setups, including increased number of object queries (100→300) and focal loss for classification. + +We adopt two training schemes for experiments, which include a 12-epoch scheme where the learning rate decays after 10 epochs, as well as a 50-epoch scheme where the learning rate decays after 40 epochs. + +# 4.2. Experiment Results + +Table 1 presents a thorough comparison of the proposed SAM-DETR, other DETR-like detectors [3, 6, 10, 31, 63], and Faster R-CNN [35]. As shown, Faster R-CNN and DETR can both achieve impressive performance when trained for long epochs. However, when trained for only + +12 epochs, Faster R-CNN still achieves good performance, while DETR performs substantially worse due to its slow convergence. Several recent works [10, 31, 63] modify the original attention mechanism and effectively boost DETR's performance under the 12-epoch training scheme, but still have large gaps compared with the strong Faster R-CNN baseline. For standalone usage, our proposed SAM-DETR can achieve a significant performance gain compared with the original DETR baseline $(+10.8\%)$ AP) and outperform all DETR's variants [10, 31, 63]. Furthermore, the proposed SAM-DETR can be easily integrated with existing + +
SAMQuery Resampling StrategyRWAP\( AP_{0.5} \)\( AP_{0.75} \)
AvgMaxSP x1SP x8
22.339.522.2
25.248.923.3
27.050.225.8
28.650.328.1
30.352.029.8
32.053.432.8
33.154.233.7
+ +Table 2. Ablation studies on our proposed design choices. Results are obtained on COCO val 2017. 'SAM' denotes the proposed Semantic-Aligned Matching. 'RW' denotes reweighting by previous query embeddings. Different resampling strategies for SAM are studied, including average-pooling (Avg), max-pooling (Max), one salient point (SP x1), and eight salient points (SP x8). + +
Salient Point Search RangeAPAP0.5AP0.75
within ref boxwithin image
33.154.233.7
30.052.329.2
+ +Table 3. Ablation study on the salient point search range. Results are obtained on COCO val 2017. + +convergence-boosting methods for DETR to achieve even better performance. Combining our proposed SAM-DETR with SMCA [10] brings an improvement of $+2.9\%$ AP compared with the standalone SAM-DETR, and $+4.4\%$ AP compared with SMCA-DETR [10], leading to performance on par with Faster R-CNN within 12 epochs. The convergence curves of the competing methods under the 12-epoch scheme are also presented in Fig. 1. + +We also conduct experiments with a stronger backbone R50-DC5 and with a longer 50-epoch training scheme. Under various setups, the proposed SAM-DETR consistently improves the original DETR's performance and achieves state-of-the-art accuracy when further integrated with SMCA [10]. The superior performance under various setups demonstrates the effectiveness of our approach. + +# 4.3. Ablation Study + +We conduct ablation studies to validate the effectiveness of our proposed designs. Experiments are performed with ResNet-50 [13] under the 12-epoch training scheme. + +Effect of Semantic-Aligned Matching (SAM). As shown in Table 2, the proposed SAM, together with any query resampling strategy, consistently achieves superior performance than the baseline. We highlight that even with the naive max-pooling resampling, $\mathrm{AP}_{0.5}$ improves by $10.7\%$ , a considerable margin. The results strongly support our claim that SAM effectively eases the complication in matching object queries to their corresponding target features, thus accelerating DETR's convergence. + +Effect of Searching Salient Points. As shown in Table 2, different query resampling strategies lead to large variance in detection accuracy. Max-pooling performs better than average-pooling, suggesting that detection relies more on key features rather than treating all features equally. This motivates us to explicitly search salient points and use their features for semantic-aligned matching. Results show that searching just one salient point and resampling its features as new object queries outperforms the naive resampling strategies. Furthermore, sampling multiple salient points can naturally work with the multi-head attention mechanism, further strengthening the representation capability of the new object queries and boosting performance. + +# Searching within Boxes vs. Searching within Images. + +As introduced in Section 3.2.2, salient points are searched within the corresponding reference boxes. As shown in Table 3, searching salient points at the image scale (allowing salient points outside their reference boxes) degrades the performance. We suspect the performance drop is due to increased difficulty for matching with a larger search space. It is noteworthy that the original DETR's object queries do not have explicit search ranges, while our proposed SAM-DETR models learnable reference boxes with interpretable meanings, which effectively narrows down the search space, resulting in accelerated convergence. + +Effect of Reweighting by Previous Embeddings. We believe previous object queries' embeddings contain helpful information for detection that should be effectively leveraged in the matching process. To this end, we predict a set of reweighting coefficients from previous query embeddings to apply to the newly generated object queries, highlighting critical features. As shown in Table 2, the proposed reweighting consistently boosts performance, indicating effective usage of knowledge from previous object queries. + +# 4.4. Limitation + +Compared with Faster R-CNN [35], SAM-DETR inherits from DETR [3] superior accuracy on large objects and degraded performance on small objects. One way to improve accuracy on small objects is to leverage multi-scale features, which we will explore in the future. + +# 5. Conclusion + +This paper proposes SAM-DETR to accelerate DETR's convergence. At the core of SAM-DETR is a plug-and-play module that semantically aligns object queries and encoded image features to facilitate the matching between them. It also explicitly searches salient point features for semantic-aligned matching. The proposed SAM-DETR can be easily integrated with existing convergence solutions to boost performance further, leading to a comparable accuracy with Faster R-CNN within 12 training epochs. We hope our work paves the way for more comprehensive research and applications of DETR. + +# References + +[1] Luca Bertinetto, Jack Valmadre, Joao F Henriques, Andrea Vedaldi, and Philip HS Torr. Fully-convolutional siamese networks for object tracking. In ECCV, 2016. 2, 3 +[2] Zhaowei Cai and Nuno Vasconcelos. Cascade R-CNN: Delving into high quality object detection. In CVPR, 2018. 2 +[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 1, 2, 3, 4, 5, 6, 7, 8 +[4] Xin Chen, Bin Yan, Jiawen Zhu, Dong Wang, Xiaoyun Yang, and Hutchuan Lu. Transformer tracking. In CVPR, 2021. 2, 3 +[5] Dahjung Chung, Khalid Tahboub, and Edward J Delp. A two stream siamese convolutional neural network for person re-identification. In ICCV, 2017. 2, 3 +[6] Zhigang Dai, Bolun Cai, Yugeng Lin, and Junying Chen. UP-DETR: Unsupervised pre-training for object detection with transformers. In CVPR, 2021. 7 +[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. 6 +[8] Xingping Dong and Jianbing Shen. Triplet loss in siamese network for object tracking. In ECCV, 2018. 3 +[9] Qi Fan, Wei Zhuo, Chi-Keung Tang, and Yu-Wing Tai. Few-shot object detection with attention-RPN and multi-relation detector. In CVPR, 2020. 2 +[10] Peng Gao, Minghang Zheng, Xiaogang Wang, Jifeng Dai, and Hongsheng Li. Fast convergence of DETR with spatially modulated co-attention. In ICCV, 2021. 1, 2, 3, 5, 6, 7, 8 +[11] Anfeng He, Chong Luo, Xinmei Tian, and Wenjun Zeng. A twofold siamese network for real-time object tracking. In CVPR, 2018. 3 +[12] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask R-CNN. In ICCV, 2017. 4 +[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 5, 6, 8 +[14] Shuting He, Hao Luo, Pichao Wang, Fan Wang, Hao Li, and Wei Jiang. TransReID: Transformer-based object re-identification. In ICCV, 2021. 3 +[15] Ting-I Hsieh, Yi-Chen Lo, Hwann-Tzong Chen, and Tyng-Luh Liu. One-shot object detection with co-attention and co-excitation. In NeurIPS, 2019. 2, 3 +[16] Han Hu, Jiayuan Gu, Zheng Zhang, Jifeng Dai, and Yichen Wei. Relation networks for object detection. In CVPR, 2018. 2 +[17] Bingyi Kang, Zhuang Liu, Xin Wang, Fisher Yu, Jiashi Feng, and Trevor Darrell. Few-shot object detection via feature reweighting. In ICCV, 2019. 2 +[18] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 6 +[19] Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning Workshop, 2015. 2, 3 + +[20] Bo Li, Wei Wu, Qiang Wang, Fangyi Zhang, Junliang Xing, and Junjie Yan. SiamRPN++: Evolution of siamese visual tracking with very deep networks. In CVPR, 2019. 2, 3 +[21] Bo Li, Junjie Yan, Wei Wu, Zheng Zhu, and Xiaolin Hu. High performance visual tracking with siamese region proposal network. In CVPR, 2018. 2, 3 +[22] Yulin Li, Jianfeng He, Tianzhu Zhang, Xiang Liu, Yongdong Zhang, and Feng Wu. Diverse part discovery: Occluded person re-identification with part-aware transformer. In CVPR, 2021. 3 +[23] Minghui Liao, Pengyuan Lyu, Minghang He, Cong Yao, Wenhao Wu, and Xiang Bai. Mask TextSpotter: An end-to-end trainable neural network for spotting text with arbitrary shapes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(2):532-548, 2021. 2 +[24] Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 7 +[25] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólár. Focal loss for dense object detection. In ICCV, 2017. 6 +[26] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014. 1, 6 +[27] Li Liu, Wanli Ouyang, Xiaogang Wang, Paul Fieguth, Jie Chen, Xinwang Liu, and Matti Pietikainen. Deep learning for generic object detection: A survey. International Journal of Computer Vision, 128:261-318, 2020. 1 +[28] Songtao Liu, Di Huang, and Yunhong Wang. Receptive field block net for accurate and fast object detection. In ECCV, 2018. 2 +[29] 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 +[30] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2019. 6 +[31] Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, and Jingdong Wang. Conditional DETR for fast training convergence. In ICCV, 2021. 1, 2, 3, 5, 6, 7 +[32] Jiangmiao Pang, Kai Chen, Jianping Shi, Huajun Feng, Wanli Ouyang, and Dahua Lin. Libra R-CNN: Towards balanced learning for object detection. In CVPR, 2019. 2 +[33] Juan-Manuel Perez-Rua, Xiatian Zhu, Timothy M Hospedales, and Tao Xiang. Incremental few-shot object detection. In CVPR, 2020. 2 +[34] Joseph Redmon and Ali Farhadi. YOLO 9000: Better, faster, stronger. In CVPR, 2017. 2 +[35] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 1, 2, 7, 8 +[36] Florian Schroff, Dmitry Kalenichenko, and James Philbin. FaceNet: A unified embedding for face recognition and clustering. In CVPR, 2015. 3 + +[37] Chen Shen, Zhongming Jin, Yiru Zhao, Zhihang Fu, Rongxin Jiang, Yaowu Chen, and Xian-Sheng Hua. Deep siamese network with multi-level similarity perception for person re-identification. In ACM MM, 2017. 2, 3 +[38] Yantao Shen, Tong Xiao, Hongsheng Li, Shuai Yi, and Xiaogang Wang. Learning deep neural networks for vehicle Re-ID with visual-spatio-temporal path proposals. In ICCV, 2017. 2, 3 +[39] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017. 2, 3 +[40] Lingxue Song, Dihong Gong, Zhifeng Li, Changsong Liu, and Wei Liu. Occlusion robust face recognition based on mask learning with pairwise differential siamese network. In ICCV, 2019. 3 +[41] Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In CVPR, 2018. 2, 3 +[42] Ran Tao, Efstratos Gavves, and Arnold WM Smeulders. Siamese instance search for tracking. In CVPR, 2016. 3 +[43] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. FCOS: Fully convolutional one-stage object detection. In ICCV, 2019. 2 +[44] Lachlan Tychsen-Smith and Lars Petersson. Improving object localization with fitness NMS and bounded IoU loss. In CVPR, 2018. 2 +[45] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, L. Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. 2, 3, 5 +[46] Paul Voigtaender, Jonathon Luiten, Philip HS Torr, and Bastian Leibe. Siam R-CNN: Visual tracking by re-detection. In CVPR, 2020. 2, 3 +[47] Ning Wang, Wengang Zhou, Jie Wang, and Houqiang Li. Transformer meets tracker: Exploiting temporal context for robust visual tracking. In CVPR, 2021. 2, 3 +[48] Lin Wu, Yang Wang, Junbin Gao, and Xue Li. Where-and-when to look: Deep siamese attention networks for videobased person re-identification. IEEE Transactions on Multimedia, 21(6):1412-1424, 2018. 2, 3 +[49] Yang Xiao and Renaud Marlet. Few-shot object detection and viewpoint estimation for objects in the wild. In ECCV, 2020. 2 +[50] Chuhui Xue, Shijian Lu, Song Bai, Wenqing Zhang, and Changhu Wang. I2C2W: Image-to-character-to-word transformers for accurate scene text recognition. arXiv preprint arXiv:2105.08383, 2021. 2 +[51] Xiaopeng Yan, Ziliang Chen, Anni Xu, Xiaoxi Wang, Xiaodan Liang, and Liang Lin. Meta R-CNN: Towards general solver for instance-level low-shot learning. In ICCV, 2019. 2 +[52] Fangao Zeng, Bin Dong, Tiancai Wang, Xiangyu Zhang, and Yichen Wei. MOTR: End-to-end Multiple-Object tracking with TRansformer. arXiv preprint arXiv:2105.03247, 2021. 3 +[53] Gongjie Zhang, Kaiwen Cui, Rongliang Wu, Shijian Lu, and Yonghong Tian. PNPDet: Efficient few-shot detection without forgetting via plug-and-play sub-networks. In WACV, 2021. 3 + +[54] Gongjie Zhang, Shijian Lu, and Wei Zhang. CAD-Net: A context-aware detection network for objects in remote sensing imagery. IEEE Transactions on Geoscience and Remote Sensing, 57(12):10015–10024, 2019. 2 +[55] Gongjie Zhang, Zhipeng Luo, Kaiwen Cui, and Shijian Lu. Meta-DETR: Image-level few-shot object detection with inter-class correlation exploitation. arXiv preprint arXiv:2103.11731, 2021. 2, 3 +[56] Jingyi Zhang, Jiaxing Huang, Zhipeng Luo, Gongjie Zhang, and Shijian Lu. DA-DETR: Domain adaptive detection transformer by hybrid attention. arXiv preprint arXiv:2103.17084, 2021. 2 +[57] Shifeng Zhang, Longyin Wen, Xiao Bian, Zhen Lei, and Stan Z Li. Single-shot refinement neural network for object detection. In CVPR, 2018. 2 +[58] Zhipeng Zhang and Houwen Peng. Deeper and wider siamese networks for real-time visual tracking. In CVPR, 2019. 3 +[59] Meng Zheng, Srikrishna Karanam, Ziyan Wu, and Richard J Radke. Re-identification with consistent attentive siamese networks. In CVPR, 2019. 2, 3 +[60] Changqing Zhou, Zhipeng Luo, Yueru Luo, Tianrui Liu, Liang Pan, Zhongang Cai, Haiyu Zhao, and Shijian Lu. PTTR: Relational 3D point cloud object tracking with transformer. In CVPR, 2022. 2 +[61] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. In arXiv preprint arXiv:1904.07850, 2019. 2 +[62] Xingyi Zhou, Jiacheng Zhuo, and Philipp Krahenbuhl. Bottom-up object detection by grouping extreme and center points. In CVPR, 2019. 2, 5 +[63] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable DETR: Deformable transformers for end-to-end object detection. In ICLR, 2021. 1, 2, 3, 6, 7 +[64] Zheng Zhu, Qiang Wang, Bo Li, Wei Wu, Junjie Yan, and Weiming Hu. Distractor-aware siamese networks for visual object tracking. In ECCV, 2018. 3 \ No newline at end of file diff --git a/acceleratingdetrconvergenceviasemanticalignedmatching/images.zip b/acceleratingdetrconvergenceviasemanticalignedmatching/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c0fa3bf8365328f1c3bb82a162e00e1adb6a6f6b --- /dev/null +++ b/acceleratingdetrconvergenceviasemanticalignedmatching/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bebbb493db91593dfa02175add65fd0b8ceed738795399308d097d4db51e6ed2 +size 787554 diff --git a/acceleratingdetrconvergenceviasemanticalignedmatching/layout.json b/acceleratingdetrconvergenceviasemanticalignedmatching/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d487e09a05cce1d56e3514136f7c1bf17b1e60ef --- /dev/null +++ b/acceleratingdetrconvergenceviasemanticalignedmatching/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06c80ee7fb298c0fc4c4d7424c19237511676452d4896f6be177f907e81fd8a0 +size 335526 diff --git a/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_content_list.json b/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a2ad1bee3a7496cb6961c868be6591c505b65bd4 --- /dev/null +++ b/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5269f934dfe9598ae6a430f4357dae20a7fd663841972d80469f26e11cb3e620 +size 77088 diff --git a/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_model.json b/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0763e8a3393e1897f17bdeb6d8ee6e374e6f53e0 --- /dev/null +++ b/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:686a2bd7300646158a3c82d9ed9d6900eea0d091871d4ec9b5d1dfdfeff74223 +size 94591 diff --git a/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_origin.pdf b/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e9393946a9e762896c8cae4279a9291a5d468d1d --- /dev/null +++ b/acceleratingvideoobjectsegmentationwithcompressedvideo/8ac3eeea-b648-47f2-8829-27ee10c0ec1a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d3df016f4d945b390c181824fd17cb99689d8bf4c4168a77058d79c1ab5930b +size 2951778 diff --git a/acceleratingvideoobjectsegmentationwithcompressedvideo/full.md b/acceleratingvideoobjectsegmentationwithcompressedvideo/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6fa4431af26b4e14f8365cf684edd05f0284f750 --- /dev/null +++ b/acceleratingvideoobjectsegmentationwithcompressedvideo/full.md @@ -0,0 +1,309 @@ +# Accelerating Video Object Segmentation with Compressed Video + +Kai Xu Angela Yao National University of Singapore {kxu,ayao}@comp.nus.edu.sg + +# Abstract + +We propose an efficient plug-and-play acceleration framework for semi-supervised video object segmentation by exploiting the temporal redundancies in videos presented by the compressed bitstream. Specifically, we propose a motion vector-based warping method for propagating segmentation masks from keyframes to other frames in a bidirectional and multi-hop manner. Additionally, we introduce a residual-based correction module that can fix wrongly propagated segmentation masks from noisy or erroneous motion vectors. Our approach is flexible and can be added on top of several existing video object segmentation algorithms. We achieved highly competitive results on DAVIS17 and YouTube-VOS on various base models with substantial speed-ups of up to $3.5X$ with minor drops in accuracy. + +# 1. Introduction + +Video object segmentation (VOS) aims to obtain pixel-level masks of the objects in a video sequence. State-of-the-art methods [17,18,20,23] are highly accurate at segmenting the objects, but they can be slow, requiring as much as 0.2 seconds [20] to segment a frame. More efficient methods [3, 27, 37] typically trade off accuracy for speed. + +To minimize this trade-off, we propose to leverage compressed videos for accelerating video object segmentation. Most videos on the internet today are stored and transmitted in a compressed format. Video compression encoders take a sequence of raw images as input and exploit the inherent spatial and temporal redundancies to compress the size by several magnitudes [14]. The encoding gives several sources of "free" information for VOS. Firstly, the bitstream's frame type (I- vs. P-/B-frames) gives some indication for keyframes, as the encoder separates the frames according to their information content. Secondly, the motion compensation scheme used in compression provides motion vectors that serve as a cheap approximation to optical flow. + +![](images/64fcfb430d0175a18d59f7d948ed0e6bfd5446c80fe0c48508b581b350618501.jpg) +Figure 1. Comparison of VOS methods on the DAVIS 17 dataset. We double the speed of STM, MiVOS, and STCN with minor drops in accuracy. The other compressed video method CVOS [32] achieves comparable speed but has a significant drop in accuracy. + +Finally, the residuals give a strong indicator of problematic areas that may require refinement. + +We aim to develop an accurate yet efficient VOS acceleration framework. As our interest is in acceleration, it is natural to follow a propagation-based approach in which an (heavy) off-the-shelf base network is applied to only keyframes. Acceleration is then achieved by propagating the keyframe segmentations and features to non-keyframes. In our framework, we leverage the information from the compressed video bitstream, specifically, the motion vectors and residuals, which are ideal for an efficient yet accurate propagation scheme. + +Motion vectors are cheap to obtain – they simply need to be read out from the bitstream. However, they are also more challenging to work with than optical flow. Whereas optical flow fields are dense and defined on a pixel-wise basis, motion vectors are sparse. For example in HEVC [30], they are defined only for blocks of pixels, which greatly reduces the resolution of the motion information and introduces block + +artifacts. Furthermore, in cases where the coding bitrate limit is too low, the encoder may not estimate the motion correctly; this often happens in complex scenes or under fast motions. As such, we propose a dedicated soft propagation module that suppresses noise. For further improvement, we also propose a mask correction module based on the bitstream residuals. Putting all of this together, we designed a new plug-and-play framework based on compressed videos to accelerate standard VOS methods [4, 5, 20]. We use these off-the-shelf methods as base networks to segment keyframes and then leverage the compressed videos' motion vectors for propagation and residuals for correction. + +A key distinction between our motion vector propagation module and existing optical flow propagation methods [19,22, 23, 45] is that our module is bi-directional. We take advantage of the inherent bi-directional nature of motion vectors and propagate information both forwards and backwards. Our module is also multi-hop as we can propagate mask between non-keyframes. These features make our propagation scheme less prone to drift and occlusion errors. + +A closely related work to ours is CVOS [32]. CVOS aims to develop a stand-alone VOS framework based on compressed videos, whereas we are proposing a plug-and-play acceleration module. A shortcoming of CVOS is that it considers only I- and P-frames but not B-frames in their framework. This setting is highly restrictive and uncommon, since B-frames were introduced to the default encoding setting specified by the MPEG-1 standard [14] over 30 years ago. In contrast, we consider I-, P- and B-frames, making our method more applicable and practical for modern compressed video settings. + +Our experiments demonstrate that our module offers considerable speed-ups on several image sequence-based models (see Fig. 1). As a by-product of the keyframe selection, our module also reduces the memory of existing memory-networks [20, 28], which are some of the fastest and most accurate state-of-the-art VOS methods. We summarize our contributions below: + +- A novel VOS acceleration module that leverages information from the compressed video bitstream for segmentation mask propagation and correction. +- A soft propagation module that takes as input inaccurate and blocky motion vectors but yields highly accurate warps in a multi-hop and bi-directional manner. +- A mask correction module that refines propagation errors and artifacts based on motion residuals. +- Our plug-and-play module is flexible and can be applied to off-the-shelf VOS methods to achieve up to $3.5 \times$ speed-ups with negligible drops in accuracy. + +# 2. Related work + +Video object segmentation approaches are either semi-supervised, in which an initial mask is provided for the video, or unsupervised, in which no mask is available. We limit our discussion here to semi-supervised methods. Semi-supervised VOS methods can be further divided into two types: matching-based and propagation-based. Matching-based VOS methods rely on limited appearance changes to either match the template and target frame or to learn an object detector. For example, [2, 27, 35] fine-tune a segmentation network using provided and estimated masks with extensive data augmentation. Other examples include memory-networks [4, 5, 20, 28] that perform reference-query matching for the target object based on features extracted from previous frames. Propagation-based VOS methods rely on temporal correlations to propagate segmentation masks from the annotated frames. A simple propagation strategy is to copy the previous mask [23], assuming limited change from frame-to-frame. Others works use motion-based cues from optical flow [6, 10, 34]. + +Keyframe propagation. Frame-wise propagation of information from keyframes to non-keyframes has been used for efficient semantic video segmentation [13, 22, 45], but little has been explored for its role in efficient VOS [15] due to several reasons. Firstly, selecting keyframes is non-trivial. For maximum efficiency, keyframes should be as few and distinct as possible; yet if they are too distinct, the gap becomes too large to propagate across. As a result, existing works select keyframes conservatively with either uniform sampling [13, 45] or thresholding of changes in low-level features [16]. Secondly, frame-wise propagation relies on optical flow, and computing accurate flow fields [11, 33] is still computationally expensive. + +Our proposed framework is propagation-based, but we differ from similar approaches in that we use the compressed video bitstream for propagation and correction. Our method adaptively selects key-frames, and it is also the first to use a bi-directional and multi-hop propagation scheme. + +Compressed videos have been used in various vision tasks. Early methods [1, 26] used the compressed bitstream to form feature descriptors for unsupervised object segmentation and detection. In contrast, we utilize the bitstream for propagation and correction to accelerate semi-supervised VOS. More recently, the use of compressed videos has been explored for object detection [38], saliency detection [41], action recognition [40] and, as discussed earlier, VOS [32]. These works leverage motion vectors and residuals as motion cues or bit allocation as indicators of saliency. As features in the bitstream are inherently coarse, most of the previous works have a significant accuracy drop compared to methods that use full videos or optical flow. Our work is the first compressed video method that can fill this gap. + +# 3. Preliminaries + +# 3.1. Compressed video format + +Video in its raw form is a sequence of RGB images; however, it is unnecessary to store all the image frames. Video compression encoder-decoders, or CODECs, leverage frame-to-frame redundancies to minimize storage. We outline some essentials of the HEVC codec [30]; other CODEcs like MPEG-4 [29] and H.264 [39] follow similar principles. Note that this section introduces only concepts relevant to understanding our framework. We refer to [31] for a more comprehensive discussion. + +The HEVC coding structure consists of a series of frames called a Group of Pictures (GOP). Each GOP uses three frame types: I-frames, P-frames and B-frames. I-frames are fully encoded standalone, while P- and B-frames are encoded relatively based on motion compensation from other frames and residuals. Specifically, the P- and B-frames store motion vectors, which can be considered a block-wise analogue of optical flow between that frame and its' reference frame(s). Any discrepancies are then stored in that frame's residual. Fig. 2 shows the frame assignments of two sample GOPs. Video decoding is therefore an ordered process to ensure that reference frames are decoded first to preserve the chain of dependencies. Fig. 3 illustrates the dependencies in a sample sequence. + +# 3.2. Motion compensation in compressed videos + +A key difference between optical flow and motion vectors is that optical flow is a dense vector field with respect to a neighbouring frame in time, whereas motion vectors are block-wise displacements with respect to arbitrary reference frame(s) within the GOP. The associated blocks are called Prediction Units (PU), and they vary in size from $64 \times 64$ to $8 \times 4$ or $4 \times 8$ pixels. PUs can be uni-directional, with reference frames from either the past or the future, or bi-directional, with references to both the past and the future. P-frames have only uni-directional PUs, while B-frames have both uni-directional and bi-directional PUs. + +In this work, we denote a PU as $\Omega_{ij}$ , with constituent pixels $(x,y) \in \Omega_{ij}^2$ , where $i$ indexes the frame and $j$ indexes the PU in frame $i$ . In the general bi-directional case, $\Omega_{ij}$ is associated with a pair of forward and backward motion vectors $(\vec{v}_{ij}, \vec{\mathrm{v}}_{ij})$ , where the right and left arrows denote forward and backward motion, respectively. The forward motion vector $\vec{\mathbf{v}}_{ij} = [\vec{u}, \vec{v}, \vec{t}]$ is given by displacements $\vec{u}$ and $\vec{v}$ and reference frame $\vec{t}$ , where $\vec{t} < i$ ; analogously, $\vec{\mathbf{v}}_{ij} = [\vec{u}, \vec{v}, \vec{t}]$ denotes a backward motion vector with displacements $[\vec{u}, \vec{v}]$ and reference frame $\vec{t}$ , where $\vec{t} > i$ . + +Based on the motion vectors, the pixels $(x,y)\in \Omega_{ij}$ can be predicted from co-located blocks of the same size as $\Omega_{ij}$ + +![](images/7d0660a41db56a84f7d5b63a92193c29853a9df774fc27c95aa122a0cba401b2.jpg) + +![](images/92e2df4c79042a2bd1aca45eaed88986d7d9d4a528438294bbc485d2df67206f.jpg) + +![](images/3f88e6f9fe5e2813300e3f1f395436083e40d62d3af3e44614e52896cf554057.jpg) +Figure 2. Bar plots of a GOP visualizing frame assignments and the relative frame size. The 'bmx-trees' sequence has faster movements so it has more I/P-frames than 'bear' (37.5% vs. 23.2%). The red arrows mark displayed frames, which feature examples of block effects for the 'bear' sequence above and motion vector estimation failures for the 'bmx-trees' sequence below. + +from reference frames $I_{\vec{t}}$ and $I_{\bar{t}}$ . The reconstructed frame $\hat{I}_i^{x,y}$ at $(x,y)$ of frame $i$ , for $(x,y) \in \Omega_{ij}$ , is given as + +$$ +\hat {I} _ {i} ^ {x, y} = \vec {w} I _ {\vec {t}} ^ {x + \vec {u}, y + \vec {v}} + \vec {w} I _ {\vec {t}} ^ {x + \vec {u}, y + \vec {v}}, \tag {1} +$$ + +where $(\vec{w},\vec{w})$ are weighting components for the forward and backward motions, respectively, and $\vec{w} +\vec{w} = 1$ . In the case of a uni-directional PU, either $\vec{w}$ or $\vec{w}$ would be set to 0 and the corresponding $\vec{\mathbf{v}}$ or $\vec{\mathbf{v}}$ is undefined. + +In older and more restrictive codec settings, such as those used in CVOS [32], reference frames were limited to I-frames. Modern codecs like HEVC, i.e. what we consider in this work, allow P- and B-frames to reference pixels in other P- and B-frames, which are themselves reconstructed from other references. This makes the reconstruction in Eq. (1) multi-hop, which improves overall coding efficiency as the drifting problem can be alleviated with smaller temporal reference distance. Examples of PUs and frame predictions are illustrated in Fig. 3. Motion vectors are inherently coarse and noisy, due to their block-wise nature and encoding errors in areas of fast and abrupt movements (see examples in Fig. 2). As such, the remaining differences between the RGB image $I_{i}$ and prediction $\hat{I}_i$ at frame $i$ are stored in the residual $\mathbf{e}_i$ to recover pixel-level detailing: + +$$ +I _ {i} = \hat {I} _ {i} + \mathbf {e} _ {i}. \tag {2} +$$ + +![](images/2b38560abb7ff6fa7f0f4ce216427e7c82a303295f59fb9c6d69a25898d727db.jpg) +Figure 3. GOP schematic. Dashed lines denote motion compensation in prediction blocks. $I$ , $B$ and $P$ denote frame types. + +In principle, $\mathbf{e}_i$ is sparse; the sparsity is directly correlated with the accuracy of the motion vector prediction. The key to efficient video encoding is balancing the storage savings of using larger PUs for P- and B-frames, i.e. fewer motion vectors, versus requiring less sparse residuals to compensate for the coarser block motions. + +# 3.3. Dense frame-wise motion representation + +Performing frame-wise propagation directly from the motion vectors can be cumbersome as the vectors are defined block-wise according to PUs. The PUs in a given frame often have several (different) references over multiple hops. As such, we compute a dense frame-wise motion field to serve as a more convenient intermediate representation. Specifically, we define a bi-directional motion field as $M_{i} = [\vec{M}_{i},\vec{M}_{i}]$ , where $\vec{M}_i\in \mathbb{R}^{H\times W\times 3}$ is a dense pixel-wise representation of forward motions for frame $i$ and is represented by $[\vec{u},\vec{v},\vec{t}]$ , i.e. the displacements and the reference frame. Similar to the motion vectors, the right- and left-arrowed accents denote forward and backward motions respectively. As such, $\tilde{M}_i\in \mathbb{R}^{H\times W\times 3}$ stores backward motions for frame $i$ represented by $[\vec{u},\vec{v},\vec{t}]$ . The motion components are determined by aggregating all the PUs $\{\Omega_{ij}\} ,j\in \{1\dots J_i\}$ , where $J_{i}$ is the total number of PUs in frame $i$ . i.e. + +$$ +\vec {\mathbf {v}} _ {\Omega , i} \rightarrow \vec {M} _ {i} ^ {x, y}; \quad \left. \vec {\mathbf {v}} _ {\Omega , i} \rightarrow \vec {M} _ {i} ^ {x, y}, \quad (x, y) \in \Omega_ {i j}. \right. \tag {3} +$$ + +This assignment procedure, which is denoted by $\rightarrow$ , iterates through all the spatial locations of frame $i$ . If a given PU in the B-frame is uni-directional, then the elements in the opposite direction in either $\vec{M}$ or $\vec{M}$ is set to zero accordingly. For pixels where $\vec{t}$ or $\vec{t}$ is directed to a keyframe, the prediction is single-hop; for pixels where $\vec{t}$ or $\vec{t}$ is directed to another non-keyframe, this will be multi-hop as the current reference is chained to further references. + +# 4. Methodology + +We accelerate off-the-shelf VOS methods by applying these methods as a base network to selected keyframes (Sec. 4.4). The keyframe segmentations are propagated to non-keyframes with a soft motion vector propagation module (Sec. 4.2) and further refined via a residual-based cor + +rection module (Sec. 4.3). Fig. 4 illustrates the overall framework. The acceleration comes from the computational savings of propagation and correction compared to applying the base network to all frames in the sequence. + +# 4.1. Problem formulation + +We denote the decoded sequence from a compressed video bitstream of length $T$ as $\{(I_i, M_i, \mathbf{e}_i), i \in [1, T]\}$ . + +For convenience, we directly use the motion field $M_{i}$ instead of the raw motion vectors. Note that after decoding, we already have access to the RGB image $I_{i}$ for frame $i$ . For $P$ and $B$ frames, $I_{i}$ is reconstructed from the motion-predicted frame $\hat{I}_{i}$ and the residual $\mathbf{e}_i$ based on Eq. (2). For clarity, we maintain two redundant frame indices $n$ and $k$ for referring to non-keyframes and keyframes, respectively. We denote the base network as $\{F,G\}$ . The first portion of the network $F$ extracts low-level appearance features $V_{k}$ from the input keyframe $I_{k}$ ; $G$ denotes the subsequent part of the network that further processes $V_{k}$ to estimate the segmentation $P_{k}$ , i.e., for a keyframe $k$ , + +$$ +V _ {k} = F \left(I _ {k}\right), \quad P _ {k} = G \left(V _ {k}\right), \tag {4} +$$ + +where $P_{k}\in \mathbb{R}^{H\times W\times O}$ and $V_{k}\in \mathbb{R}^{H\times W\times C}$ . Here, $O$ is the number of objects in the video sequence, $C$ is the number of channels for the low-level feature and $H\times W$ is the spatial resolution of the prediction. + +For a non-keyframe $I_{n}$ , a standard approach [45] to propagate the segmentation predictions from a keyframe $k$ is to apply a warp based on the optical flow: + +$$ +\tilde {P} _ {n} = W \left(\mathrm {O F} _ {n}, P _ {k}\right), \tag {5} +$$ + +where $W$ is the warping operation, $OF_{n}$ is the optical flow between $P_{n}$ and $P_{k}$ , and $\tilde{P}$ is the propagated predictions. This form of propagation has two key drawbacks. Firstly, most schemes use optical flow computed only between two frames, which increases the possible errors that arise from occlusion. Secondly, estimating accurate optical flows still comes with considerable computational expense. + +# 4.2. Soft motion-vector propagation module + +In this section, we outline how motion vectors, specifically the motion vector field $M_{n}$ defined in Eq. (3) for a non-keyframe $I_{n}$ , can be used in place of optical flow $\mathrm{OF}_n$ in Eq. (5). We first introduce the motion vector warping operation, in which $\hat{P}_n$ and $\hat{V}_n$ denote the motion vector warped prediction and warped features, i.e. + +$$ +\hat {P} _ {n} = W _ {M V} \left(M _ {n}, P _ {\star}\right), \quad \hat {V} _ {n} = W _ {M V} \left(M _ {n}, V _ {\star}\right), \tag {6} +$$ + +where $P_{\star}$ and $V_{\star}$ denote the corresponding segmentations and features for key- and non-key reference frames, respectively. The warping operation $W_{MV}$ is defined as a backward warp which iterates over all the spatial locations of + +![](images/f628f969d8858f2769360587f9a4a0aab05db32bd4903d98c10a6593feb5a7bf.jpg) +Figure 4. Overall framework. Keyframe segmentation predictions are propagated to non-keyframes through a soft motion vector propagation module that suppresses inaccurate motion vectors. Propagated masks are then corrected based on the residuals and feature matching. + +frame $n$ . If we denote with $\Lambda$ the item, i.e. $P_{\star}$ or $V_{\star}$ , to be propagated, such that $\hat{\Lambda}_n = W_{MV}(M_n, \Lambda)$ , then the propagated value at $(x, y)$ for a non-keyframe $n$ , based on Eq. (1) can be defined as: + +$$ +\hat {\Lambda} _ {n} ^ {x, y} = \left\{ \begin{array}{l l} \Lambda_ {\bar {t}} ^ {x + \bar {u}, y + \bar {v}}, & \text {i f} \bar {t} = 0, \\ \Lambda_ {\bar {t} ^ {\prime}} ^ {x + \bar {u}, y + \bar {v}}, & \text {i f} \bar {t} = 0, \\ \frac {1}{2} \Lambda_ {\bar {t}} ^ {x + \bar {u}, y + \bar {v}} + \frac {1}{2} \Lambda_ {\bar {t} ^ {\prime}} ^ {x + \bar {u}, y + \bar {v}}, & \text {o t h e r w i s e .} \end{array} \right. \tag {7} +$$ + +$$ +w h e r e: \quad [ \vec {u}, \vec {v}, \vec {t}, \bar {u}, \bar {v}, \bar {t} ] = M _ {n} ^ {x, y}. \tag {8} +$$ + +The first two cases in Eq. (7) are for warping unidirectional motion vectors forwards and backwards in time, respectively, and the third case is used for bi-directional motion vectors. Note that in the third case, the forward and backward motion vectors are equally weighted and not according to $\vec{w}$ and $\vec{w}$ from Eq. (1). This is because we interpret the references to be equally indicative of the target mask; also, $\vec{w}$ and $\vec{w}$ are tuned for reconstructing the target RGB pixel value. In the case when $u$ , $v$ are not integers, nearest-neighbours or bilinear interpolation will be applied in the reference map; for simplicity, we omit the interpolation in the formulation. If the reference frame $\vec{t}$ or $\vec{t}$ is not a keyframe, then the warping becomes multi-hop. Hence, the warping procedure must follow the decoding order, as referenced non-keyframes must be completed before it can be propagated onwards. To mitigate the impact of noise and errors in the motion vector field, we propose a soft propagation scheme that makes use of a learned decoder $\mathcal{D}(\cdot)$ : + +$$ +\tilde {P} _ {n} = \mathcal {D} \left(\left[ \hat {P} _ {n}, V _ {n}, S \left(V _ {n}, \hat {V} _ {n}\right) \cdot \hat {P} _ {n} \right]\right), \tag {9} +$$ + +where the square braces $[,]$ denote concatenation. The decoder is lightweight, and denoises the originally propagated + +mask $\hat{P}_n = W_{MV}(M_n,P)$ based on the low-level features of the input frame $I_{n}$ , i.e. $V_{n} = F(I_{n})$ , and a confidence-weighted version of the propagated mask. The weighting term $S(V_{n},\hat{V}_{n})\in \mathbb{R}^{H\times W}$ is defined by a similarity between the extracted features $V_{n}\in \mathbb{R}^{H\times W\times C}$ and the propagated features $\hat{V}_n\in \mathbb{R}^{H\times W\times C}$ . We use dot product along the channel dimension to represent the similarity, i.e. + +$$ +S \left(V _ {n}, \hat {V} _ {n}\right) ^ {i j} = \sigma \left(V _ {n} ^ {i j} \cdot \hat {V} _ {n} ^ {i j}\right), \tag {10} +$$ + +where $\sigma$ is the standard sigmoid function. The similarity between the propagated features $\hat{V}_n$ and the actually estimated features $V_{n}$ serves as a confidence indicator to the decoder where the propagation is likely accurate. In areas which are not similar, the motion vector is likely inaccurate, so the propagated values should likely be suppressed and require more denoising. + +# 4.3. Residual-based correction module + +We introduce an additional correction module to further improve the quality of the propagated segmentation masks. As errors of the motion vectors are captured inherently in each frame's residuals, it is natural to use these as a cue for compensation. We choose to model such correction through patching generation and label matching explicitly. While implicitly adding residual to the decoder network could achieve similar performance, it requires relatively more data and a heavier decoder network. + +Let $\mathbf{e} \in \mathbb{R}^{H \times W \times 3}$ and $\hat{\mathbf{S}}^3$ denote the residuals and the propagated foreground mask, where $\hat{\mathbf{S}}$ can be obtained by taking $\text{argmax}$ of propagated prediction $\hat{P}$ . We first convert $\mathbf{e}$ into a greyscale image before converting it into a binary + +![](images/1cb0c707d1f2cf2c4ecda4adfdcc1d5b8f9152c85fa8468b7f1d6e5e40d11282.jpg) +Figure 5. Residual-based correction module selects pixels to correct in the propagated mask; the correction scheme replaces the segmentation labels via a feature matching scheme. + +mask $\mathbf{e}_b$ via thresholding. The corrected mask $\tilde{\mathbf{S}}$ is found by taking the intersection between $\mathbf{e}_b$ and $\hat{\mathbf{S}}_+$ , a dilated version of initially propagated mask $\hat{\mathbf{S}}$ , i.e., $\hat{\mathbf{S}} = \cap (\mathbf{e}_b, \hat{\mathbf{S}}_+)$ , where $\cap (\cdot)$ indicates an intersection operation and allows us to focus only on foreground areas of the dilated mask, which coincide with thresholded residual values. + +$\tilde{\mathbf{S}}$ provides an indication of which areas in the propagated mask will require correction. For each pixel in $\tilde{\mathbf{S}}$ indexed by $a$ at frame $n$ , we search in the temporally closest keyframe $k^*$ and match between $V_{n}$ and $V_{k^{*}}$ . Specifically, we define $\mathbf{W}^{ak}$ as the affinity between the feature at pixel $a$ in $V_{n}$ , i.e. $V_{n}^{a}$ , and all pixels in $V_{k^{*}}$ . The corrected mask prediction at pixel $a$ is then obtained by $P_{n}^{a} = \mathbf{W}^{ak}P_{k^{*}}$ . We use an L2-similarity function to compute the affinity matrix and defer the details to the Supplementary. + +# 4.4. Keyframe & base network selection + +In principle, any frame can be a keyframe. However, it is natural to define keyframes according to the compressed frame type, as the encoder designates types based on the video's dynamic content. In addition to I-frames, we also choose P-frames as keyframes. This is because less than $5\%$ of frames in a video sequence are I-frames in the default HEVC encoding, which is insufficient for accurate propagation, so we also include the $15 - 35\%$ of frames designated as P-frames. Considering P-frames as keyframes also helps improve the accuracy because the motion compensation in P-frames is strictly uni-directional. Otherwise, propagation to these frames may suffer inaccuracies arising from occlusions in the same manner as optical flow. + +For a base VOS model to be accelerated, most matching based segmentation models discussed in Sec. 2 are suitable as they rely only on the appearance of the target object. From preliminary experiments, we observed that VOS methods that use memory-networks such as STM [20], MiVOS [4], and STCN [5] are ideal for acceleration. This is because the choice of using I- and P-frames as keyframes naturally aligns with the memory concept and allows for the selection of a (even more) compact yet diverse memory. + +# 5. Experimentation + +# 5.1. Experimental settings + +Video Compression. We generated compressed video from images using the x265 library in FFmpeg on the default preset. To write out the bitstream, we modified the decoder from openHEVC [8, 9] and shared the code publicly to encourage others to work with compressed video. + +Datasets & Evaluation. We experimented with three video object segmentation benchmarks: DAVIS16 [24] and DAVIS17 [25], which are small datasets with 50 and 120 videos of single and multiple objects, respectively, and YouTube-VOS [42], a large-scale dataset with 3945 videos of multiple objects. We used the images in their original resolution for encoding the videos. The default HEVC encoding produced an average of $\{37\%, 36\%, 27\%$ of I/P-frames, and therefore keyframes per sequence for DAVIS16, DAVIS17 and YouTube-VOS, respectively. + +We evaluated with the standard criteria from [24]: Jaccard Index $\mathcal{J}$ (IoU of the output segmentation with groundtruth mask) for region similarity, and mean boundary $\mathcal{F}$ -scores for contour accuracy. Additionally, we report the average over all seen and unseen classes for YouTube-VOS. + +Propagation & Correction. In our propagation scheme, we applied reverse mapping for warping and nearest-neighbour interpolation kernels. The decoder in the soft propagation (Sec. 4.2) is a lightweight network of three residual blocks (see Supplementary for details). The decoder is trained from scratch, with a uniform initialization and a learning rate of 1e-4 with a decay factor of 0.1 every 10k iterations for 40k iterations. For residual-based correction, the binary threshold was set to $0.15*255$ for the absolute value of gray-scaled residual. + +Base Models. We show experiments accelerating four base models: STM [20], MiVOS [4], STCN [4] and FRTM-VOS [27]. The first three use a memory bank; for a fair comparison, we allow only keyframes to be stored in the memory bank. We set the memory frequency to 2 on DAVIS and 5 on Youtube-VOS, as the latter has higher frame rates. In the experiments, both settings reduced the memory bank size. We refer to Supplementary for the memory analysis. FRTM-VOS fine-tunes a network based on the labelled frame and associated augmentations. We fed only the keyframes into the network for segmentation and finetuning. In practice, this is equivalent to segmenting a temporally reduced video. + +# 5.2. Acceleration on different base models. + +Tab. 1 compares our accelerated results on the four base models with other state-of-the-art models. Our method achieves an excellent compromise between accuracy and speed. On DAVIS16 ( $\approx$ $37\%$ keyframes), we achieved $1.3 \times$ , $2.1 \times$ , $2.2 \times$ , $1.6 \times$ speed-ups with a minor drop of + +Table 1. Comparison of acceleration on different base models with state-of-the-art methods. $\dagger$ Frame rates were measured on our device if originally not provided; we also re-estimated STM time on our hardware as we obtained higher FPS than their reported value. FPS on Youtube-VOS is measured on the first 30 videos. + +
MethodDAVIS16 validationDAVIS17 validationYouTube-VOS 2018 validation
JFJ&FFPSJFJ&FFPSGJsFsJuFuFPS
CVOS [32]79.180.379.734.557.459.358.431.2------
TVOS [44]----69.974.772.33767.867.169.463.071.6-
Track-Seg [3]82.683.683.13968.676.072.3<3963.667.170.255.361.7-
PReMVOS [17]84.988.686.80.0373.981.777.8<0.0366.971.475.956.563.7-
SwiftNet [36]90.590.390.42578.383.981.12577.877.881.872.379.5-
CFBI+ [43]88.791.189.95.680.185.782.9<5.682.081.286.076.284.6-
FRTM-VOS [27]--83.521.9--76.7†14.172.172.376.265.974.1†7.7
FRTM-VOS + CoVOS82.382.282.328.669.775.272.520.665.668.071.058.265.425.3
STM [20]88.789.989.3†14.979.284.381.8†10.679.479.784.272.880.9-
STM + CoVOS87.087.387.231.578.382.780.523.8------
MiVOS [4]89.792.491.016.981.787.484.511.282.681.185.677.786.2†13
MiVOS + CoVOS89.089.889.436.879.784.682.225.579.378.983.073.581.745.9
STCN [5]90.493.091.726.982.088.685.320.284.383.287.979.087.3†16.8
STCN + CoVOS88.589.689.142.779.785.182.433.779.079.483.672.680.457.9
+ +$\mathcal{J}\& \mathcal{F} 1.2, 2.1, 1.6, 2.6$ on FRTM-VOS, STM, MiVOS and STCN, respectively. On DAVIS17 ( $\approx 36\%$ keyframes), we achieved $1.5 \times, 2.2 \times, 2.3 \times, 1.7 \times$ speed-ups with the drop on $\mathcal{J}\& \mathcal{F} 4.2, 1.3, 1.7, 2.9$ for the same order of models. + +On YouTube-VOS ( $\approx 27\%$ keyframes), we achieved $3.3 \times, 3.5 \times, 3.4 \times$ speed-ups with a 4.8, 2.4, 4.0 drop of $\mathcal{I}_s \& \mathcal{F}_s$ for FRTM-VOS, MiVOS and STCN, respectively. We have larger drops on $\mathcal{I}_u \& \mathcal{F}_u$ for unseen data because our decoder is not pre-trained on larger datasets. Note that the video lengths of YouTube-VOS are relatively long ( $>150$ frames), so the above methods require additional memory or additional online fine-tuning, which allows us to achieve higher speed-ups. Moreover, the lower keyframe percentage of YouTube-VOS also provides more speed-ups. We do not provide the result on STM as no pretrained weights are available. + +With an STCN base model, our performance on DAVIS17 is 1.3 to 10.1 higher than other efficient methods SwiftNet [36], TVOS [44] and Track-Seg [3] with comparable frame rates, though our success should also be attributed to the high STCN base accuracy. Another compressed video method CVOS [32] achieves comparable speed but has a significant accuracy gap. + +# 5.3. Ablation studies + +We verified each component of our framework. All ablations used MiVOS [4] as the base model on default video encode preset unless otherwise indicated. + +Propagation. We first compare with optical flow as a form of propagation, and consider a forward unidirectional flow warping as done in [7, 23, 45], using the flow from the state-of-the-art method RAFT [33] ('Optical Flow'). We also consider a bi-directional optical flow warping ('Bi-Optical Flow'), which is used in [21]. Additionally, we compare with two motion vector baselines from a work on + +Table 2. Comparison of propagation methods, $B'$ , $M'$ , $Sup'$ denotes bi-directional, multi-hop and noise suppression, respectively. No code given, we report the results from earlier work [32] + +
MethodDAVIS16DAVIS17
BMSupJFJF
Optical Flow77.479.271.577.6
Bi-Optical Flow [21]X85.087.475.981.7
MV I to P [32]\( 31.5^† \)---
MV to Flow [40]77.280.269.476.3
MV WarpXX85.789.277.284.4
MV Soft PropXXX89.089.879.784.6
No propagation [4]89.792.481.787.4
+ +compressed videos, CoViAR [40] ('MV to Flow'), and another work on compressed VOS, CVOS [32] ('MVI to P'). CoViAR converts motion vectors into a flow between two frames, i.e. for motion vector field $M_{i}$ at $(x,y)$ and frame $i$ , $M_{of}(x,y) = [u,v] / [(t - i)\cdot fps]$ is the motion of the pixel $(x,y)$ in the unit time on plane $i$ . CVOS has a further simplified motion vector usage and references all motions from one I-frame in the GOP. We compare our bi-directional, multi-hop motion vector warping with ('MV Soft Prop') and without ('MV Warp') the soft propagation, which performs further noise suppression. + +Tab. 2 verifies the effectiveness of our proposed propagation. Bi-directional optical flow, originally used for video generation [21], performs better than unidirectional optical flow because it is less affected by occlusion. CoViAR [40] is a compressed video action recognition system; their propagation is on par with optical flow. The simplified case in CVOS [32] fails to propagate meaningful segmentation masks and thus relies on heavy refinement. + +Our bi-directional multi-hop motion vector-based warping outperforms all of the above methods. Our soft propagation scheme with noise suppression gives further improvements to the accuracy, such that our propagated masks are + +within 4.0 points on both $\mathcal{I}$ and $\mathcal{F}$ below the upper bound without propagation, i.e. by applying each frame through the base network. Fig. 6 shows qualitative results on different propagation methods. + +Table 3. Ablations on decoder and mask correction module. + +
ModuleDAVIS16DAVIS17
JFJF
MV Warp85.789.277.284.4
+Decoder88.388.879.284.0
+Suppression88.889.679.684.5
+Residual Correction89.089.879.784.6
+ +Decoder and mask correction. Tab. 3 shows how adding each component of the mask decoder leads to progressive improvements for the $\mathcal{J}$ -index and boundary $\mathcal{F}$ -score. For 'MV Warp', we directly warp the prediction results on the original size of the frame. For the decoder, we warp the prediction and low-level features at $1/4$ size for speed consideration. Because the motion vector is coarse and noisy, only input propagated prediction and the low-level features to the decoder will decrease accuracy. The most significant gains come from the noise suppression module, i.e. by feeding the suppressed propagated prediction into the decoder. Further residual correction increases the robustness for the corner cases. + +Keyframe percentage. To highlight the speed-accuracy trade-off, we compare the percentage of keyframes in Tab. 4 by adjusting encoder presets. The default HEVC setting yields $\approx 37\%$ keyframes for DAVIS16 and DAVIS17. If we set the encoder to allocate more B-frames to have only approximately $25\%$ and $13\%$ keyframes ('B-frame biased' and 'Uniform B-frames', respectively), the propagated scores decrease while the FPS values increase accordingly. At the fastest setting, we can achieve $3.7\mathrm{x}$ speed-ups on MiVOS with $\mathcal{J} \& \mathcal{F}$ scores of 82.9 on DAVIS16 and $4.5\mathrm{x}$ speed-ups with $\mathcal{J} \& \mathcal{F}$ scores of 73.2 on DAVIS17. + +Table 4. Robustness to different video encoding presets on DAVIS16 and DAVIS17. B-frame biased: more weight on B-frame allocation (x265 option: bframe-bias=50). Uniform B-frames: fixed 8 B-frames between I/P frames. + +
PresetKeyframeDAVIS16DAVIS17
J&FFPSJ&FFPS
Default≈ 37%89.436.882.225.5
B-frame biased≈ 25%85.148.280.236.7
Uniform B-frames≈ 13%82.962.973.250.0
No Propagation-91.016.984.511.2
+ +# 5.4. Timing analysis + +To compute the FPS values in all our tables, we measured run times on an RTX-2080Ti for DAVIS dataset and on an RTX-A5000 for YouTube-VOS, as it requires extra memory. The amortized per frame inference time can be approx + +![](images/c7f95ea3d30eded23f3886e3ccb542334a4b10292f5e9a7f0030002176198371.jpg) +Figure 6. Optical flow propagation and motion-vector generated flows both suffer from ghosting effects and holes in areas of occlusion. Our propagation successfully prevents such artifacts. + +imately computed by $T_{\mathrm{base}} \cdot R + (T_{\mathrm{propagation}} + T_{\mathrm{correction}}) \cdot (1 - R)$ , where $R$ denotes the ratio of keyframes. Note that the measured $T_{\mathrm{base}}$ may not correspond to the published FPS values of the base model, e.g. for STM [20] and MiVOS [4]. Our $T_{\mathrm{base}}$ is lower because we store fewer frames in the memory bank (see Supplementary for more details). We measured the propagation and correction time on DAVIS17, and the sum $(T_{\mathrm{propagation}} + T_{\mathrm{correction}})$ is 12ms. + +# 6. Conclusion & limitations + +We propose an acceleration framework for semi-supervised VOS via propagation by exploiting the motion vectors and residuals of the compressed video bitstream. Such a framework can speed up the accurate but slow base VOS models with minor drops in segmentation accuracy. One limitation of our work is the possible latency introduced by the multiple reference dependencies. As a result, segmentation results of a non-keyframe get completed later than the future frame to which it refers. + +Given that $70\%$ of the internet traffic [12] is dedicated to (compressed) videos, we see broad applicability of our work for acceleration. Efficiency in VOS methods is especially relevant for applications such as video editing, given the growing trend of higher resolution videos, e.g. 4K standards. However, VOS could also be abused to falsify parts of videos or create malicious content. We maintain a rigorous attitude towards this while emphasizing its positive impact on content creation and other possible improvements for the community. + +# 7. Acknowledgements + +This research is supported by the National Research Foundation, Singapore under its NRF Fellowship for AI (NRF-NRFFAI1-2019-0001). Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of National Research Foundation, Singapore. + +# References + +[1] R Venkatesh Babu, KR Ramakrishnan, and SH Srinivasan. Video object segmentation: a compressed domain approach. TCSTV, 2004. 2 +[2] Sergi Caelles, Kevis-Kokitsi Maninis, Jordi Pont-Tuset, Laura Leal-Taixe, Daniel Cremers, and Luc Van Gool. One-shot video object segmentation. In CVPR, 2017. 1, 2 +[3] Xi Chen, Zuoxin Li, Ye Yuan, Gang Yu, Jianxin Shen, and Donglian Qi. State-aware tracker for real-time video object segmentation. In CVPR, 2020. 1, 7 +[4] Ho Kei Cheng, Yu-Wing Tai, and Chi-Keung Tang. Modular interactive video object segmentation: Interaction-to-mask, propagation and difference-aware fusion. In CVPR, 2021. 1, 2, 6, 7, 8 +[5] Ho Kei Cheng, Yu-Wing Tai, and Chi-Keung Tang. Rethinking space-time networks with improved memory coverage for efficient video object segmentation. In NeurIPS, 2021. 1, 2, 6, 7 +[6] Jingchun Cheng, Yi-Hsuan Tsai, Shengjin Wang, and Ming-Hsuan Yang. Segflow: Joint learning for video object segmentation and optical flow. In ICCV, 2017. 2 +[7] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In ICCV, 2015. 7 +[8] Wassim Hamidouche, Michael Raulet, and Olivier Déforges. Parallel shvc decoder: Implementation and analysis. In ICME, 2014. 6 +[9] Wassim Hamidouche, Michael Raulet, and Olivier Déforges. Real time shvc decoder: Implementation and complexity analysis. In ICIP, 2014. 6 +[10] Ping Hu, Gang Wang, Xiangfei Kong, Jason Kuen, and Yap-Peng Tan. Motion-guided cascaded refinement network for video object segmentation. In CVPR, 2018. 2 +[11] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, 2017. 2 +[12] Cisco Visual Networking Index. Forecast and methodology, 2016-2021. White paper, Cisco public, 2017. 8 +[13] Samvit Jain, Xin Wang, and Joseph Gonzalez. Accel: A corrective fusion network for efficient semantic segmentation on video. In CVPR, 2019. 2 +[14] Didier Le Gall. Mpeg: A video compression standard for multimedia applications. Communications of the ACM, 1991. 1, 2 +[15] Yong Jae Lee, Jaechul Kim, and Kristen Grauman. Key-segments for video object segmentation. In ICCV, 2011. 2 +[16] Yule Li, Jianping Shi, and Dahua Lin. Low-latency video semantic segmentation. In CVPR, 2018. 2 +[17] Jonathon Luiten, Paul Voigtlaender, and Bastian Leibe. Premvos: Proposal-generation, refinement and merging for video object segmentation. In ACCV, 2018. 1, 7 +[18] Kevis-Kokitsi Maninis, Sergi Caelles, Yuhua Chen, Jordi Pont-Tuset, Laura Leal-Taixe, Daniel Cremers, and Luc + +Van Gool. Video object segmentation without temporal information. TPAMI, 2017. 1 +[19] Seoung Wug Oh, Joon-Young Lee, Kalyan Sunkavalli, and Seon Joo Kim. Fast video object segmentation by reference-guided mask propagation. In CVPR, 2018. 1, 2 +[20] Seoung Wug Oh, Joon-Young Lee, Ning Xu, and Seon Joo Kim. Video object segmentation using space-time memory networks. In ICCV, 2019. 1, 2, 6, 7, 8 +[21] Junting Pan, Chengyu Wang, Xu Jia, Jing Shao, Lu Sheng, Junjie Yan, and Xiaogang Wang. Video generation from single semantic label map. In CVPR, 2019. 7 +[22] Matthieu Paul, Christoph Mayer, Luc Van Gool, and Radu Timofte. Efficient video semantic segmentation with labels propagation and refinement. In WACV, 2020. 2 +[23] Federico Perazzi, Anna Khoreva, Rodrigo Benenson, Bernt Schiele, and Alexander Sorkine-Hornung. Learning video object segmentation from static images. In CVPR, 2017. 1, 2, 7 +[24] F. Peruzzi, J. Pont-Tuset, B. McWilliams, L. Van Gool, M. Gross, and A. Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In CVPR, 2016. 6 +[25] Jordi Pont-Tuset, Federico Perazzi, Sergi Caelles, Pablo Arbeláez, Alexander Sorkine-Hornung, and Luc Van Gool. The 2017 davis challenge on video object segmentation. arXiv:1704.00675, 2017. 6 +[26] Fatih Porikli, Faisal Bashir, and Huifang Sun. Compressed domain video object segmentation. TCVT, 2009. 2 +[27] Andreas Robinson, Felix Jaremo Lawin, Martin Danelljan, Fahad Shahbaz Khan, and Michael Felsberg. Learning fast and robust target models for video object segmentation. In CVPR, 2020. 1, 2, 6, 7 +[28] Hongje Seong, Junhyuk Hyun, and Euntai Kim. Kernelized memory network for video object segmentation. In ECCV, 2020. 2 +[29] Thomas Sikora. Thempeg-4 video standard verification model. TCSVT, 1997. 3 +[30] Gary J. Sullivan, Jens-Rainer Ohm, Woo-Jin Han, and Thomas Wiegand. Overview of the high efficiency video coding (hevc) standard. TCSTV, 2012. 1, 3 +[31] Vivienne Sze, Madhukar Budagavi, and Gary J Sullivan. High efficiency video coding (hevc). In Integrated circuit and systems, algorithms and architectures. 2014. 3 +[32] Zhentao Tan, Bin Liu, Qi Chu, Hangshi Zhong, Yue Wu, Weihai Li, and Nenghai Yu. Real time video object segmentation in compressed domain. TCVT, 2020. 1, 2, 3, 7 +[33] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In ECCV, 2020. 2, 7 +[34] David Tsai, Matthew Flagg, Atsushi Nakazawa, and James M Rehg. Motion coherent tracking using multi-label mrf optimization. IJCV, 2012. 2 +[35] Paul Voigtlaender and Bastian Leibe. Online adaptation of convolutional neural networks for video object segmentation. arXiv:1706.09364, 2017. 2 +[36] Haochen Wang, Xiaolong Jiang, Haibing Ren, Yao Hu, and Song Bai. Swiftnet: Real-time video object segmentation. In CVPR, 2021. 7 + +[37] Qiang Wang, Li Zhang, Luca Bertinetto, Weiming Hu, and Philip HS Torr. Fast online object tracking and segmentation: A unifying approach. In CVPR, 2019. 1 +[38] Shiyao Wang, Hongchao Lu, and Zhidong Deng. Fast object detection in compressed video. In ICCV, 2019. 2 +[39] Thomas Wiegand, Gary J Sullivan, Gisle Bjontegaard, and Ajay Luthra. Overview of the h. 264/avc video coding standard. TCSVT, 2003. 3 +[40] Chao-Yuan Wu, Manzil Zaheer, Hexiang Hu, R Manmatha, Alexander J Smola, and Philipp Krahenbuhl. Compressed video action recognition. In CVPR, 2018. 2, 7 +[41] Mai Xu, Lai Jiang, Xiaoyan Sun, Zhaoting Ye, and Zulin Wang. Learning to detect video saliency with hevc features. TIP, 2017. 2 +[42] Ning Xu, Linjie Yang, Yuchen Fan, Dingcheng Yue, Yuchen Liang, Jianchao Yang, and Thomas Huang. Youtu-vos: A large-scale video object segmentation benchmark. arXiv:1809.03327, 2018. 6 +[43] Zongxin Yang, Yunchao Wei, and Yi Yang. Collaborative video object segmentation by multi-scale foreground-background integration. TPAMI, 2021. 1, 7 +[44] Yizhuo Zhang, Zhirong Wu, Houwen Peng, and Stephen Lin. A transductive approach for video object segmentation. In CVPR, 2020. 1, 7 +[45] Xizhou Zhu, Yuwen Xiong, Jifeng Dai, Lu Yuan, and Yichen Wei. Deep feature flow for video recognition. In CVPR, 2017. 2, 4, 7 \ No newline at end of file diff --git a/acceleratingvideoobjectsegmentationwithcompressedvideo/images.zip b/acceleratingvideoobjectsegmentationwithcompressedvideo/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4846fa71697bed983980ada414b8ea8e33342ca8 --- /dev/null +++ b/acceleratingvideoobjectsegmentationwithcompressedvideo/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f393318e48e07b3bc575a09a5c5700a36d36bddfa32afe528de07bdf4a3be3b8 +size 474348 diff --git a/acceleratingvideoobjectsegmentationwithcompressedvideo/layout.json b/acceleratingvideoobjectsegmentationwithcompressedvideo/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9669fd485bb2c99b7c02f09b4c14ce2494418b2e --- /dev/null +++ b/acceleratingvideoobjectsegmentationwithcompressedvideo/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50df317f873cc0526c9bf7ec4c8de0d45ed28b1ecd3287ed67cbea179be854ef +size 470327 diff --git a/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_content_list.json b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..151ea5216e3c25b6beb8850d52e115ceced94751 --- /dev/null +++ b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c9b08d648d19162ff39455b99b8099f4857540373d8581287484dc0c11b3fe4 +size 89389 diff --git a/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_model.json b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1250a5311fb89202b92a18b7cae20d806e072dc6 --- /dev/null +++ b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5205e6eea49af0d5b89f758e06188cd0b051490bb2afe48937530bc33aacff0e +size 110036 diff --git a/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_origin.pdf b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cc7a0feea6dfd761fc095b488d3bf122cd818af3 --- /dev/null +++ b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/55090ba8-e47f-43e1-99bb-5d8bd426be4e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e133a2dd31ea1940e1b48998c0f836a8f8f5f3ad736b2fa9648a6023ef6caab4 +size 6902850 diff --git a/accurate3dbodyshaperegressionusingmetricandsemanticattributes/full.md b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ad88e1695f4ca3ff744be5496e1288717621069c --- /dev/null +++ b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/full.md @@ -0,0 +1,379 @@ +# Accurate 3D Body Shape Regression using Metric and Semantic Attributes + +Vasileios Choutas\*, Lea Muller\*, Chun-Hao P. Huang, Siyu Tang, Dimitrios Tzionas, Michael J. Black1 Max Planck Institute for Intelligent Systems, Tübingen, Germany ETH Zürich + +{vchoutas, lea.mueller, paul.huang, stang, dtzionas, black}@tuebingen.mpg.de + +* Equal contribution, alphabetical order + +![](images/8eb9eddcbe24844b215d5ab2c23fc96f0a9a75b630ef8640bcf184a129d7a177.jpg) +Figure 1. Existing work on 3D human reconstruction from a color image focuses mainly on pose. We present SHAPY, a model that focuses on body shape and learns to predict dense 3D shape from a color image, using crowd-sourced linguistic shape attributes. Even with this weak supervision, SHAPY outperforms the state of the art (SOTA) [52] on in-the-wild images with varied clothing. + +![](images/0f97e62b13ec2a238c6538f123bb0dfa14d89e50f9f150ec967f44c2fe1381ff.jpg) + +# Abstract + +While methods that regress 3D human meshes from images have progressed rapidly, the estimated body shapes often do not capture the true human shape. This is problematic since, for many applications, accurate body shape is as important as pose. The key reason that body shape accuracy lags pose accuracy is the lack of data. While humans can label 2D joints, and these constrain 3D pose, it is not so easy to "label" 3D body shape. Since paired data with images and 3D body shape are rare, we exploit two sources of information: (1) we collect internet images of diverse "fashion" models together with a small set of anthropometric measurements; (2) we collect linguistic shape attributes for a wide range of 3D body meshes and the model images. Taken together, these datasets provide sufficient constraints to infer dense 3D shape. We exploit the anthropometric measurements and linguistic shape attributes in several novel ways to train a neural network, called SHAPY, that regresses 3D human pose and shape from an RGB image. + +We evaluate SHAPY on public benchmarks, but note that they either lack significant body shape variation, ground-truth shape, or clothing variation. Thus, we collect a new dataset for evaluating 3D human shape estimation, called HBW, containing photos of "Human Bodies in the Wild" for which we have ground-truth 3D body scans. On this new benchmark, SHAPY significantly outperforms state-of-the-art methods on the task of 3D body shape estimation. This is the first demonstration that 3D body shape regression from images can be trained from easy-to-obtain anthropometric measurements and linguistic shape attributes. Our model and data are available at: shapy.is.tue.mpg.de + +# 1. Introduction + +The field of 3D human pose and shape (HPS) estimation is progressing rapidly and methods now regress accurate 3D pose from a single image [7,26,28,30-33,43,65,67]. Un + +fortunately, less attention has been paid to body shape and many methods produce body shapes that clearly do not represent the person in the image (Fig. 1, top right). There are several reasons behind this. Current evaluation datasets focus on pose and not shape. Training datasets of images with 3D ground-truth shape are lacking. Additionally, humans appear in images wearing clothing that obscures the body, making the problem challenging. Finally, the fundamental scale ambiguity in 2D images, makes 3D shape difficult to estimate. For many applications, however, realistic body shape is critical. These include AR/VR, apparel design, virtual try-on, and fitness. To democratize avatars, it is important to represent and estimate all possible 3D body shapes; we make a step in that direction. + +Note that commercial solutions to this problem require users to wear tight fitting clothing and capture multiple images or a video sequence using constrained poses. In contrast, we tackle the unconstrained problem of 3D body shape estimation in the wild from a single RGB image of a person in an arbitrary pose and standard clothing. + +Most current approaches to HPS estimation learn to regress a parametric 3D body model like SMPL [37] from images using 2D joint locations as training data. Such joint locations are easy for human annotators to label in images. Supervising the training with joints, however, is not sufficient to learn shape since an infinite number of body shapes can share the same joints. For example, consider someone who puts on weight. Their body shape changes but their joints stay the same. Several recent methods employ additional 2D cues, such as the silhouette, to provide additional shape cues [51, 52]. Silhouettes, however, are influenced by clothing and do not provide explicit 3D supervision. Synthetic approaches [35], on the other hand, drape SMPL 3D bodies in virtual clothing and render them in images. While this provides ground-truth 3D shape, realistic synthesis of clothed humans is challenging, resulting in a domain gap. + +To address these issues, we present SHAPY, a new deep neural network that accurately regresses 3D body shape and pose from a single RGB image. To train SHAPY, we first need to address the lack of paired training data with real images and ground-truth shape. Without access to such data, we need alternatives that are easier to acquire, analogous to 2D joints used in pose estimation. To do so, we introduce two novel datasets and corresponding training methods. + +First, in lieu of full 3D body scans, we use images of people with diverse body shapes for which we have anthropometric measurements such as height as well as chest, waist, and hip circumference. While many 3D human shapes can share the same measurements, they do constrain the space of possible shapes. Additionally, these are important measurements for applications in clothing and health. Accurate anthropometric measurements like these are difficult for individuals to take themselves but they are often captured for + +![](images/bfa030a30a9c767dee39f88889583eb9983c078cdcc3d6096c6507851e279c45.jpg) +Figure 2. Model-agency websites contain multiple images of models together with anthropometric measurements. A wide range of body shapes are represented; example from pexels.com. + +![](images/df34701c57dd82525ec83d97e5b16e4d27a6c2c47434947ab3e6f465d2102de9.jpg) + +![](images/27239126ffb078c545c39c53cac0c7cbf234931b65f1b381ff876c441a161533.jpg) + +![](images/20a26214dbe54451b4e4857b91ca3d9e6d587c422413edc28debe5e5f4a5756e.jpg) +Figure 3. We crowd-source scores for linguistic body-shape attributes [57] and compute anthropometric measurements for CAESAR [47] body meshes. We also crowd-source linguistic shape attribute scores for model images, like those in Fig. 2 + +![](images/2108727c4ba1022b3ada9ff04d9cf935f8deb83af72b31acf848e0bbf23a0f48.jpg) + +![](images/59ee047256bb820b7fc69590de3d11acbff5c8fb33a13b3f93279a713b04d2f9.jpg) + +different applications. Specifically, modeling agencies provide such information about their models; accuracy is a requirement for modeling clothing. Thus, we collect a diverse set of such model images (with varied ethnicity, clothing, and body shape) with associated measurements; see Fig. 2. + +Since sparse anthropometric measurements do not fully constrain body shape, we exploit a novel approach and also use linguistic shape attributes. Prior work has shown that people can rate images of others according to shape attributes such as "short/tall", "long legs" or "pear shaped" [57]; see Fig. 3. Using the average scores from several raters, Streuber et al. [57] (BodyTalk) regress metrically accurate 3D body shape. This approach gives us a way to easily label images of people and use these labels to constrain 3D shape. To our knowledge, this sort of linguistic shape attribute data has not previously been exploited to train a neural network to infer 3D body shape from images. + +We exploit these new datasets to train SHAPY with three novel losses, which can be exploited by any 3D human body reconstruction method: (1) We define functions of the SMPL body mesh that return a sparse set of anthropometric measurements. When measurements are available for an image we use a loss that penalizes mesh measurements that differ from the ground-truth (GT). (2) We learn a "Shape to + +Attribute" (S2A) function that maps 3D bodies to linguistic attribute scores. During training, we map meshes to attribute scores and penalize differences from the GT scores. (3) We similarly learn a function that maps "Attributes to Shape" (A2S). We then penalize body shape parameters that deviate from the prediction. + +We study each term in detail to arrive at the final method. Evaluation is challenging because existing benchmarks with GT shape either contain too few subjects [61] or have limited clothing complexity and only pseudo-GT shape [51]. We fill this gap with a new dataset, named "Human Bodies in the Wild" (HBW), that contains a ground-truth 3D body scan and several in-the-wild photos of 35 subjects, for a total of 2543 photos. Evaluation on this shows that SHAPY estimates much more accurate 3D shape. + +Models, data and code are available at shapy.is.tue.mpg.de. + +# 2. Related Work + +3D human pose and shape (HPS): Methods that reconstruct 3D human bodies from one or more RGB images can be split into two broad categories: (1) parametric methods that predict parameters of a statistical 3D body model, such as SCAPE [3], SMPL [37], SMPL-X [43], Adam [26], GHUM [65], and (2) non-parametric methods that predict a free-form representation of the human body [24, 50, 59, 64]. Parametric approaches lack details w.r.t. non-parametric ones, e.g., clothing or hair. However, parametric models disentangle the effects of identity and pose on the overall shape. Therefore, their parameters provide control for re-shaping and re-posing. Moreover, pose can be factored out to bring meshes in a canonical pose; this is important for evaluating estimates of an individual's shape. Finally, since topology is fixed, meshes can be compared easily. For these reasons, we use a SMPL-X body model. + +Parametric methods follow two main paradigms, and are based on optimization or regression. Optimization-based methods [5, 7, 16, 43] search for model configurations that best explain image evidence, usually 2D landmarks [8], subject to model priors that usually encourage parameters to be close to the mean of the model space. Numerous methods penalize the discrepancy between the projected and ground-truth silhouettes [22, 34] to estimate shape. However, this needs special care to handle clothing [4]; without this, erroneous solutions emerge that "inflate" body shape to explain the "clothed" silhouette. Regression-based methods [9, 14, 25, 27, 30, 33, 35, 40, 66] are currently based on deep neural networks that directly regress model parameters from image pixels. Their training sets are a mixture of data captured in laboratory settings [23, 56], with model parameters estimated from MoCap markers [39], and in-the-wild image collections, such as COCO [36], that contain 2D keypoint annotations. Optimization and regression can be combined, for example via in-the-network model fitting [33, 40]. + +Estimating 3D body shape: State-of-the-art methods are effective for estimating 3D pose, but struggle with estimating body shape under clothing. There are several reasons for this. First, 2D keypoints alone are not sufficient to fully constrain 3D body shape. Second, shape priors address the lack of constraints, but bias solutions towards "average" shapes [7,33,40,43]. Third, datasets with in-the-wild images have noisy 3D bodies, recovered by fitting a model to 2D keypoints [7,43]. Fourth, datasets captured in laboratory settings have a small number of subjects, who do not represent the full spectrum of body shapes. Thus, there is a scarcity of images with known, accurate, 3D body shape. Existing methods deal with this in two ways. + +First, rendering synthetic images is attractive since it gives automatic and precise ground-truth annotation. This involves shaping, posing, dressing and texturing a 3D body model [20,51,53,60,62], then lighting it and rendering it in a scene. Doing this realistically and with natural clothing is expensive, hence, current datasets suffer from a domain gap. Alternative methods use artist-curated 3D scans [42,49,50], which are realistic but limited in variety. + +Second, 2D shape cues for in-the-wild images, (body-part segmentation masks [12,41,48], silhouettes [1,22,44]) are attractive, as these can be manually annotated or automatically detected [15, 18]. However, fitting to such cues often gives unrealistic body shapes, by inflating the body to "explain" the clothing "baked" into silhouettes and masks. + +Most related to our work is the work of Sengupta et al. [51-53] who estimate body shape using a probabilistic learning approach, trained on edge-filtered synthetic images. They evaluate on the SSP-3D dataset of real images with pseudo-GT 3D bodies, estimated by fitting SMPL to multiple video frames. SSP-3D is biased to people with tight-fitting clothing. Their silhouette-based method works well on SSP-3D but does not generalize to people in normal clothing, tending to over-estimate body shape; see Fig. 1. + +In contrast to previous work, SHAPY is trained with in-the-wild images paired with linguistic shape attributes, which are annotations that can be easily crowd-sourced for weak shape supervision. We also go beyond SSP-3D to provide HBW, a new dataset with in-the-wild images, varied clothing, and precise GT from 3D scans. + +Shape, measurements and attributes: Body shapes can be generated from anthropometric measurements [2, 54, 55]. Tsoli et al. [58] register a body model to multiple high-resolution body scans to extract body measurements. The "Virtual Caliper" [46] allows users to build metrically accurate avatars of themselves using measurements or VR game controllers. ViBE [21] collects images, measurements (bust, waist, hip circumference, height) and the dress-size of models from clothing websites to train a clothing recommendation network. We draw inspiration from these approaches for data collection and supervision. + +![](images/6cca75dc54f920624027b4ea05ed644d59801323e931a3f077ee865c3f01127f.jpg) +Figure 4. Shape representations and data collection. Our goal is 3D body shape estimation from in-the-wild images. Collecting data for direct supervision is difficult and does not scale. We explore two alternatives. Linguistic Shape Attributes: We annotate attributes ("A") for CAESAR meshes, for which we have accurate shape ("S") parameters, and learn the "A2S" and "S2A" models, to map between these representations. Attribute annotations for images can be easily crowd-sourced, making these scalable. Anthropometric Measurements: We collect images with sparse body measurements from model-agency websites. A virtual measurement module [46] computes the measurements from 3D meshes. Training: We combine these sources to learn a regressor with weak supervision that infers 3D shape from an image. + +Streuber et al. [57] learn BodyTalk, a model that generates 3D body shapes from linguistic attributes. For this, they select attributes that describe human shape and ask annotators to rate how much each attribute applies to a body. They fit a linear model that maps attribute ratings to SMPL shape parameters. Inspired by this, we collect attribute ratings for CAESAR meshes [47] and in-the-wild data as proxy shape supervision to train a HPS regressor. Unlike BodyTalk, SHAPY automatically infers shape from images. + +Anthropometry from images: Single-View metrology [10] estimates the height of a person in an image, using horizontal and vertical vanishing points and the height of a reference object. Günel et al. [17] introduce the IMDB-23K dataset by gathering publicly available celebrity images and their height information. Zhu et al. [68] use this dataset to learn to predict the height of people in images. Dey et al. [11] estimate the height of users in a photo collection by computing height differences between people in an image, creating a graph that links people across photos, and solving a maximum likelihood estimation problem. Bieler et al. [6] use gravity as a prior to convert pixel measurements extracted from a video to metric height. These methods do not address body shape. + +# 3. Representations & Data for Body Shape + +We use linguistic shape attributes and anthropometric measurements as a connecting component between in-the-wild images and ground-truth body shapes; see Fig. 4. To that end, we annotate linguistic shape attributes for 3D meshes and in-the-wild images, the latter from fashion-model agencies, labeled via Amazon Mechanical Turk. + +![](images/68c62eaebd0ba1d7f424c9500dba7f0418a9a1506e5a6d492f7972cfda8fef19.jpg) +Figure 5. Histogram of height and chest/waist/hips circumference for data from model-agency websites (Sec. 3.2) and CAESAR. Model-agency data is diverse, yet not as much as CAESAR data. + +# 3.1. SMPL-X Body Model + +We use SMPL-X [43], a differentiable model that maps shape, $\beta$ , pose, $\theta$ , and expression, $\psi$ , parameters to a 3D mesh, $M$ , with $N = 10,475$ vertices, $V$ . The shape vector $\beta \in \mathbb{R}^B$ ( $B \leq 300$ ) has coefficients of a low-dimensional PCA space. The vertices are posed with linear blend skimming with a learned rigged skeleton, $X \in \mathbb{R}^{55 \times 3}$ . + +# 3.2. Model-Agency Images + +Model agencies typically provide multiple color images of each model, in various poses, outfits, hairstyles, scenes, and with a varying camera framing, together with anthropometric measurements and clothing size. We collect training data from multiple model-agency websites, focusing on under-represented body types, namely: curve-models.com, cocaine models.com, nemesismodels.com, jayjay-models.de, kultmodels.com, modelwerk.de, models1.co.uk. showcase.de, the-models.de, and ullamodels.com. In addition to photos, we store gender and four anthropometric measurements, i.e. height, chest, waist and hip circumference, when available. To avoid having the same subject in both the training and test set, we match model identities across websites to identify models that work for several agencies. For details, see Sup. Mat. + +After identity filtering, we have 94,620 images of 4,419 models along with their anthropometric measurements. However, the distributions of these measurements, shown in Fig. 5, reveal a bias for "fashion model" body shapes, while other body types are under-represented in comparison to CAESAR [47]. To enhance diversity in body-shapes and avoid strong biases and log tails, we compute the quantized 2D-distribution for height and weight and sample up to 3 models per bin. This results in $N = 1$ , 185 models (714 females, 471 males) and 20, 635 images. + +# 3.3. Linguistic Shape Attributes + +Human body shape can be described by linguistic shape attributes [19]. We draw inspiration from Streuber et al. [57] who collect scores for 30 linguistic attributes for + +
Male & FemaleMale onlyFemale only
shortlong neckskinny armspear shaped
biglong legsaveragepetite
talllong torsorectangularslim waist
muscularshort armsdelicate buildlarge breasts
broad shoulderssoft bodyskinny legs
masculinefeminine
+ +Table 1. Linguistic shape attributes for human bodies. Some attributes apply to both genders, but others are gender specific. + +256 3D body meshes, generated by sampling SMPL's shape space, to train a linear "attribute to shape" regressor. In contrast, we train a model that takes as input an image, instead of attributes, and outputs an accurate 3D shape (and pose). + +We crowd-source linguistic attribute scores for a variety of body shapes, using images from the following sources: + +Rendered CAESAR images: We use CAESAR [47] bodies to learn mappings between linguistic shape attributes, anthropometric measurements, and SMPL-X shape parameters, $\beta$ . Specifically, we register a "gendered" SMPL-X model with 100 shape components to 1, 700 male and 2, 102 female 3D scans, pose all meshes in an A-pose, and render synthetic images with the same virtual camera. + +Model-agency photos: Each annotator is shown 3 body images per subject, sampled from the image pool of Sec. 3.2. + +Annotation: To keep annotation tractable, we use $A = 15$ linguistic shape attributes per gender (subset of BodyTalk's [57] attributes); see Tab. 1. Each image is annotated by $K = 15$ annotators on Amazon Mechanical Turk. Their task is to "indicate how strongly [they] agree or disagree that the [listed] words describe the shape of the [depicted] person's body"; for an example, see Sup. Mat. Annotations range on a discrete 5-level Likert scale from 1 (strongly disagree) to 5 (strongly agree). We get a rating matrix $\mathbf{A} \in \{1,2,3,4,5\}^{N \times A \times K}$ , where $N$ is the number of subjects. In the following, $a_{ijk}$ denotes an element of $\mathbf{A}$ . + +# 4. Mapping Shape Representations + +In Sec. 3 we introduce three body-shape representations: (1) SMPL-X's PCA shape space (Sec. 3.1), (2) anthropometric measurements (Sec. 3.2), and (3) linguistic shape attribute scores (Sec. 3.3). Here we learn mappings between these, so that in Sec. 5 we can define new losses for training body shape regressors using multiple data sources. + +# 4.1. Virtual Measurements (VM) + +We obtain anthropometric measurements from a 3D body mesh in a T-posed, namely height, $H(\beta)$ , weight, $W(\beta)$ , and chest, waist and hip circumferences, $C_{\mathrm{c}}(\beta)$ , $C_{\mathrm{w}}(\beta)$ , and $C_{\mathrm{h}}(\beta)$ , respectively, by following Wuhrer et al. [63] and the "Virtual Caliper" [46]. For details on how we compute these measurements, see Sup. Mat. + +# 4.2. Attributes and 3D Shape + +Attributes to Shape (A2S): We predict SMPL-X shape coefficients from linguistic attribute scores with a second-degree polynomial regression model. For each shape $\beta_{i}$ , $i = 1\ldots N$ , we create a feature vector, $\mathbf{x}_i^{\mathrm{A2S}}$ , by averaging for each of the $A$ attributes the corresponding $K$ scores: + +$$ +\mathbf {x} _ {i} ^ {\mathrm {A 2 S}} = \left[ \bar {a} _ {i, 1}, \dots , \bar {a} _ {i, A} \right], \quad \bar {a} _ {i, j} = \frac {1}{K} \sum_ {k = 1} ^ {K} a _ {i j k}, \tag {1} +$$ + +where $i$ is the shape index (list of "fashion" or CAESAR bodies), $j$ is the attribute index, and $k$ the annotation index. We then define the full feature matrix for all $N$ shapes as: + +$$ +\mathbf {X} ^ {\mathrm {A 2 S}} = \left[ \phi \left(\mathbf {x} _ {1} ^ {\mathrm {A 2 S}}\right), \quad \dots , \quad \phi \left(\mathbf {x} _ {N} ^ {\mathrm {A 2 S}}\right) \right] ^ {\top}, \tag {2} +$$ + +where $\phi (\mathbf{x}_i^{\mathrm{A2S}})$ maps $\mathbf{x}_i$ to $2^{\mathrm{nd}}$ order polynomial features. The target matrix $\mathbf{Y} = [\beta_{1},\dots,\beta_{N}]^{\top}$ contains the shape parameters $\beta_{i} = [\beta_{i,1},\dots,\beta_{i,B}]^{\top}$ . We compute the polynomial model's coefficients $\mathbf{W}$ via least-squares fitting: + +$$ +\mathbf {Y} = \mathbf {X} \mathbf {W} + \epsilon . \tag {3} +$$ + +Empirically, the polynomial model performs better than several models that we evaluated; for details, see Sup. Mat. + +Shape to Attributes (S2A): We predict linguistic attribute scores, $A$ , from SMPL-X shape parameters, $\beta$ . Again, we fit a second-degree polynomial regression model. S2A has "swapped" inputs and outputs w.r.t. A2S: + +$$ +\mathbf {x} _ {i} ^ {\mathrm {S 2 A}} = \left[ \boldsymbol {\beta} _ {i, 1}, \dots , \boldsymbol {\beta} _ {i, B} \right], \tag {4} +$$ + +$$ +\mathbf {y} _ {i} = \left[ \bar {a} _ {i, 1}, \dots , \bar {a} _ {i, A} \right] ^ {\top}. \tag {5} +$$ + +Attributes & Measurements to Shape (AHWC2S): Given a sparse set of anthropometric measurements, we predict SMPL-X shape parameters, $\beta$ . The input vector is: + +$$ +\mathbf {x} _ {i} ^ {\mathrm {H W C 2 S}} = \left[ h _ {i}, w _ {i}, c _ {c _ {i}}, c _ {w _ {i}}, c _ {h _ {i}} \right], \tag {6} +$$ + +where $c_{c}, c_{w}, c_{h}$ is the chest, waist, and hip circumference, respectively, $h$ and $w$ are the height and weight, and HWC2S means Height + Weight + Circumference to Shape. The regression target is the SMPL-X shape parameters, $\mathbf{y}_i$ . + +When both Attributes and measurements are available, we combine them for the AHWC2S model with input: + +$$ +\mathbf {x} _ {i} ^ {\mathrm {A H W C 2 S}} = \left[ \bar {a} _ {i, 1}, \dots , \bar {a} _ {i, A}, h _ {i}, w _ {i}, c _ {c _ {i}}, c _ {w _ {i}}, c _ {h _ {i}} \right]. \tag {7} +$$ + +In practice, depending on which measurements are available, we train and use different regressors. Following the naming convention of AHWC2S, these models are: AH2S, AHW2S, AC2S, and AHC2S, as well as their equivalents without attribute input H2S, HW2S, C2S, and HC2S. For an evaluation of the contribution of linguistic shape attributes on top of each anthropometric measurement, see Sup. Mat. + +Training Data: To train the A2S and S2A mappings we use CAESAR data, for which we have SMPL-X shape parameters, anthropometric measurements, and linguistic attribute scores. We train separate gender-specific models. + +![](images/2505352f6792ed72f95626b73ec73e1689dddf3d60e5884b87855504daccfa8a.jpg) +Figure 6. SHAPY first estimates shape, $\hat{\beta}$ , and pose, $\hat{\theta}$ . Shape is used by: (1) our virtual anthropometric measurement (VM) module to compute height, $\hat{H}$ , and circumferences, $\hat{C}$ , and (2) our S2A module to infer linguistic attribute scores, $\hat{A}$ . There are several SHAPY variations, e.g., SHAPY-H uses only VM to infer $\hat{H}$ , while SHAPY-HA uses VM to infer $\hat{H}$ and S2A to infer $\hat{A}$ . + +# 5. 3D Shape Regression from an Image + +We present SHAPY, a network that predicts SMPL-X parameters from an RGB image with more accurate body shape than existing methods. To improve the realism and accuracy of shape, we explore training losses based on all shape representations discussed above, i.e., SMPL-X meshes (Sec. 3.1), linguistic attribute scores (Sec. 3.3) and anthropometric measurements (Sec. 4.1). In the following, symbols with/-out a hat are regressed/ground-truth values. + +We convert shape $\hat{\beta}$ to height and circumferences values $\{\hat{H},\hat{C}_{\mathrm{c}},\hat{C}_{\mathrm{w}},\hat{C}_{\mathrm{h}}\} = \{H(\hat{\beta}),C_{\mathrm{c}}(\hat{\beta}),C_{\mathrm{w}}(\hat{\beta}),C_{\mathrm{h}}(\hat{\beta})\}$ , by applying our virtual measurement tool (Sec. 4.1) to the mesh $M(\hat{\beta})$ in the canonical T-posed. We also convert shape $\hat{\beta}$ to linguistic attribute scores, with $\hat{A} = \mathrm{S2A}(\hat{\beta})$ + +We train various SHAPY versions with the following "SHAPY losses", using either linguistic shape attributes, or anthropometric measurements, or both: + +$$ +L _ {\text {a t t r}} = \left\| A - \hat {A} \right\| _ {2} ^ {2}, \tag {8} +$$ + +$$ +L _ {\text {h e i g h t}} = \left\| H - \hat {H} \right\| _ {2} ^ {2}, \tag {9} +$$ + +$$ +L _ {\text {c i r c}} = \sum_ {i \in \{c, w, h \}} | | C _ {i} - \hat {C} _ {i} | | _ {2} ^ {2} \tag {10} +$$ + +These are optionally added to a base loss, $L_{\mathrm{base}}$ , defined below in "training details". The architecture of SHAPY, with all optional components, is shown in Fig. 6. A suffix of color-coded letters describes which of the above losses are used when training a model. For example, SHAPY-AH denotes a model trained with the attribute and height losses, i.e.: $L_{\mathrm{SHAPY - AH2S}} = L_{\mathrm{base}} + L_{\mathrm{attr}} + L_{\mathrm{height}}$ . + +Training Details: We initialize SHAPY with the ExPose [9] network weights and use curated fits [9], H3.6M [23], the SPIN [33] training data, and our model-agency dataset (Sec. 3.2) for training. In each batch, $50\%$ of the images are sampled from the model-agency images, for which we ensure a gender balance. The "SHAPY losses" of Eqs. (8) to (10) are applied only on the model-agency images. We use these on top of a standard base loss: + +$$ +L _ {\text {b a s e}} = L _ {\text {p o s e}} + L _ {\text {s h a p e}}, \tag {11} +$$ + +where $L_{\mathrm{joint}}^{2\mathrm{D}}$ and $L_{\mathrm{joint}}^{3\mathrm{D}}$ are 2D and 3D joint losses: + +$$ +L _ {\text {p o s e}} = L _ {\text {j o i n t s}} ^ {2 \mathrm {D}} + L _ {\text {j o i n t s}} ^ {3 \mathrm {D}} + L _ {\boldsymbol {\theta}}, \tag {12} +$$ + +$$ +L _ {\text {s h a p e}} = L _ {\beta} + L _ {\beta} ^ {\text {p r i o r}}, \tag {13} +$$ + +$L_{\theta}$ and $L_{\beta}$ are losses on pose and shape parameters, and $L_{\beta}^{\mathrm{prior}}$ is pixIE's [13] "gendered" shape prior. All losses are L2, unless otherwise explicitly specified. Losses on SMPL-X parameters are applied only on the pose data [9, 23, 33]. For more implementation details, see Sup. Mat. + +# 6. Experiments + +# 6.1. Evaluation Datasets + +3D_Poses in the Wild (3DPW) [61]: We use this to evaluate pose accuracy. This is widely used, but has only 5 test subjects, i.e., limited shape variation. For results, see Sup. Mat. Sports Shape and Pose 3D (SSP-3D) [51]: We use this to evaluate 3D body shape accuracy from images. It has 62 tightly-clothed subjects in 311 in-the-wild images from Sports-1M [29], with pseudo ground-truth SMPL meshes that we convert to SMPL-X for evaluation. + +Model Measurements Test Set (MMTS): We use this to evaluate anthropometric measurement accuracy, as a proxy for body shape accuracy. To create MMTS, we withhold 2699/1514 images of 143/95 female/male identities from our model-agency data, described in Sec. 3.2 + +CAESAR Meshes Test Set (CMTS): We use CAESAR to measure the accuracy of SMPL-X body shapes and linguistic shape attributes for the models of Sec. 4. Specifically, we compute: (1) errors for SMPL-X meshes estimated from linguistic shape attributes and/or anthropometric measurements by A2S and its variations, and (2) errors for linguistic shape attributes estimated from SMPL-X meshes by S2A. To create an unseen mesh test set, we withhold 339 male and 410 female CAESAR meshes from the crowd-sourced CAESAR linguistic shape attributes, described in Sec. 3.3. + +Human Bodies in the Wild (HBW): The field is missing a dataset with varied bodies, varied clothing, in-the-wild images, and accurate 3D shape ground truth. We fill this gap by collecting a novel dataset, called "Human Bodies in the Wild" (HBW), with three steps: (1) We collect accurate 3D body scans for 35 subjects (20 female, 15 male), and register a "gendered" SMPL-X model to these to recover 3D SMPL-X ground-truth bodies [45]. (2) We take photos of each subject in "photo-lab" settings, i.e., in front of a white background with controlled lighting, and in various everyday outfits and "fashion" poses. (3) Subjects upload full-body photos of themselves taken in the wild. For each subject we take up to 111 photos in lab settings, and collect up to 126 in-the-wild photos. In total, HBW has 2543 photos, 1,318 in the lab setting and 1,225 in the wild. We split the data into a validation and a test + +![](images/047559201dd4fd469f538cee17b928c0fe2ed2530ad1d116ad334ecd78f2b47b.jpg) +Figure 7. "Human Bodies in the Wild" (HBW) color images, taken in the lab and in the wild, and the SMPL-X ground-truth shape. + +set (val/test) with 10/25 subjects (6/14 female 4/11 male) and 781/1,762 images (432/983 female 349/779 male), respectively. Figure 7 shows a few HBW subjects, photos and their SMPL-X ground-truth shapes. All subjects gave prior written informed consent to participate in this study and to release the data. The study was reviewed by the ethics board of the University of Tübingen, without objections. + +# 6.2. Evaluation Metrics + +We use standard accuracy metrics for 3D body pose, but also introduce metrics specific to 3D body shape. + +Anthropometric Measurements: We report the mean absolute error in mm between ground-truth and estimated measurements, computed as described in Sec. 4.1. When weight is available, we report the mean absolute error in kg. MPJPE and V2V metrics: We report in Sup. Mat. the mean per-joint point error (MPJPE) and mean vertex-to-vertex error (V2V), when SMPL-X meshes are available. The prefix "PA" denotes metrics after Procrustes alignment. Mean point-to-point error $(\mathbf{P}2\mathbf{P}_{20\mathbf{K}})$ : SMPL-X has a highly non-uniform vertex distribution across the body, which negatively biases the mean vertex-to-vertex (V2V) error, when comparing estimated and ground-truth SMPL-X meshes. To account for this, we evenly sample 20K points on SMPL-X's surface, and report the mean point-to-point $(\mathrm{P2P_{20K}})$ error. For details, see Sup. Mat. + +# 6.3. Shape-Representation Mappings + +We evaluate the models A2S and S2A, which map between the various body shape representations (Sec. 4). + +A2S and its variations: How well can we infer 3D body shape from just linguistic shape attributes, anthropometric measurements, or both of these together? In Tab. 2, we report reconstruction and measurement errors using many combinations of attributes (A), height (H), weight (W), and circumferences (C). Evaluation on CMTS data shows that attributes improve the overall shape prediction across the board. For example, height+attributes (AH2S) has a lower point-to-point error than height alone. The best performing model, AHWC, uses everything, with $\mathrm{P2P_{20K}}$ -errors of $5.8 \pm 2.0 \mathrm{~mm}$ (males) and $6.2 \pm 2.4 \mathrm{~mm}$ (females). + +
MethodP2P20K(mm)Height(mm)Weight(kg)Chest(mm)Waist(mm)Hips(mm)
Male subjectsA2S11.1 ± 5.229 ± 215 ± 430 ± 2232 ± 2428 ± 21
H2S12.1 ± 6.15 ± 411 ± 1181 ± 66102 ± 8740 ± 33
AH2S6.8 ± 2.34 ± 33 ± 327 ± 2129 ± 2324 ± 18
HW2S8.1 ± 2.75 ± 41 ± 124 ± 1726 ± 2021 ± 18
AHW2S6.3 ± 2.14 ± 31 ± 119 ± 1519 ± 1420 ± 16
C2S19.7 ± 11.159 ± 479 ± 855 ± 4163 ± 4937 ± 28
AC2S9.6 ± 4.425 ± 193 ± 323 ± 1921 ± 1718 ± 14
HC2S7.7 ± 2.65 ± 42 ± 228 ± 2318 ± 1513 ± 11
AHC2S6.0 ± 2.04 ± 32 ± 221 ± 1717 ± 1413 ± 10
HWC2S7.3 ± 2.65 ± 41 ± 120 ± 1514 ± 1213 ± 11
AHWC2S5.8 ± 2.04 ± 31 ± 116 ± 1313 ± 1013 ± 10
+ +Table 2. Results of A2S variants on CMTS for male subjects, using the male SMPL-X model. For females, see Sup. Mat. + +
MethodModelHeightChestWaistHipsP2P20K
SMPLR [38]SMPL18226730930569
STRAPS [51]SMPL13516714510247
SPIN [33]SMPL59927810129
TUCH [40]SMPL5889755726
Sengupta et al. [52]SMPL821331076332
ExPose [9]SMPL-X8599929435
SHAPY (ours)SMPL-X5165695721
+ +Table 3. Evaluation on the HBW test set in mm. We compute the measurement and point-to-point $(\mathrm{P2P_{20K}})$ error between predicted and ground-truth SMPL-X meshes. + +S2A: How well can we infer linguistic shape attributes from 3D shape? S2A's accuracy on inferring the attribute Likert score is $75\% / 69\%$ for males/females; details in Sup. Mat. + +# 6.4. 3D Shape from an Image + +We evaluate all of our model's variations (see Sec. 5) on the HBW validation set and find, perhaps surprisingly, that SHAPY-A outperforms other variants. We refer to this below (and Fig. 1) simply as "SHAPY" and report its performance in Tab. 3 for HBW, Tab. 4 for MMTS, and Tab. 5 for SSP-3D. For images with natural and varied clothing (HBW, MMTS), SHAPY significantly outperforms all other methods (Tabs. 3 and 4) using only weak 3D shape supervision (Attributes). On these images, Sengupta et al.'s method [52] struggles with the natural clothing. In contrast, their method is more accurate than SHAPY on SSP-3D (Tab. 5), which has tight "sports" clothing, in terms of PVE-T-SC, a scale-normalized metric used on this dataset. These results show that silhouettes are good for tight/minimal clothing and that SHAPY struggles with high BMI shapes due to the lack of such shapes in our training data; see Fig. 5. Note that, as HBW has true ground-truth 3D shape, it does not need SSP-3D's scaling for evaluation. + +A key observation is that training with linguistic shape attributes alone is sufficient, i.e., without anthropometric measurements. Importantly, this opens up the possibility for significantly larger data collections. For a study of how different measurements or attributes impact accuracy, see Sup. Mat. Figure 8 shows SHAPY's qualitative results. + +![](images/1e1779b2ff7f968a7e0e516ce457ecc5ef7a309346f5198dbc11d526293fb161.jpg) +Figure 8. Qualitative results from HBW. From left to right: RGB, ground-truth shape, SHAPY and Sengupta et al. [52]. For example, in the upper- and lower- right images, SHAPY is less affected by pose variation and loose clothing. + +![](images/92f74e383f2b24024243d879120cf70015e814c6f7091e3cb996772cb35dc24b.jpg) + +![](images/277364a3ca64580fdf8cebb0967ccd582740298bf54c20f7007873f61a86ee85.jpg) + +![](images/f586dc83fde4030ff98dbe1ceb185545c90c5483f15f81d890d43f8b8a4b6d21.jpg) + +![](images/41586e20f72c2d39d03720933332e508f3f33c3bbb1a37dbb8d2d866354152e1.jpg) + +![](images/07c6453afac7248776ba39861d6db0a5bbfff78ca9d8278c7909b947310e7255.jpg) + +![](images/9f4dcd062913eb20cd99eb8cc4857c4b1a89d3763a64b79d5eaf4c96dfe76d3f.jpg) + +![](images/359c27a9ce6e697b91574bbc7458438b9632e3ed9f85aa851967a5622c2b3673.jpg) + +
MethodModelMean absolute error (mm) ↓
HeightChestWaistHips
Sengupta et al. [52]SMPL84186263142
TUCH [40]SMPL829212991
SPIN [33]SMPL7291129101
STRAPS [51]SMPL207278326145
ExPose [9]SMPL-X10710713692
SHAPY (ours)SMPL-X71649874
+ +Table 4. Evaluation on MMTS. We report the mean absolute error between ground-truth and estimated measurements. + +
MethodModelPVE-T-SCmIOU
HMR [27]SMPL22.90.69
SPIN [33]SMPL22.20.70
STRAPS [51]SMPL15.90.80
Sengupta et al. [52]SMPL13.6-
SHAPY (ours)SMPL-X19.2-
+ +Table 5. Evaluation on the SSP-3D test set [51]. We report the scaled mean vertex-to-vertex error in T-pose [51], and mIOU. + +# 7. Conclusion + +SHAPY is trained to regress more accurate human body shape from images than previous methods, without explicit 3D shape supervision. To achieve this, we present two different ways to collect proxy annotations for 3D body shape for in-the-wild images. First, we collect sparse anthropometric measurements from online model-agency data. Second, we annotate images with linguistic shape attributes using crowd-sourcing. We learn mappings between body shape, measurements, and attributes, enabling us to supervise a regressor using any combination of these. To evaluate SHAPY, we introduce a new shape estimation benchmark, the "Human Bodies in the Wild" (HBW) dataset. HBW has images of people in natural clothing and natural settings together with ground-truth 3D shape from a body scanner. HBW is more challenging than existing shape benchmarks like SSP-3D, and SHAPY significantly outperforms existing methods on this benchmark. We believe this work will open new directions, since the idea of leveraging linguistic annotations to improve 3D shape has many applications. + +Limitations: Our model-agency training dataset (Sec. 3.2) is not representative of the entire human population and this limits SHAPY's ability to predict larger body shapes. To address this, we need to find images of more diverse bodies together with anthropometric measurements and linguistic shape attributes describing them. + +Social impact: Knowing the 3D shape of a person has advantages, for example, in the clothing industry to avoid unnecessary returns. If used without consent, 3D shape estimation may invade individuals' privacy. As with all other 3D pose and shape estimation methods, surveillance and deep-fake creation is another important risk. Consequently, SHAPY's license prohibits such uses. + +Acknowledgments: This work was supported by the Max Planck ETH Center for Learning Systems and the International Max Planck Research School for Intelligent Systems. We thank Tsvetelina Alexiadis, Galina Henz, Claudia Gallatz, and Taylor McConnell for the data collection, and Markus Höschle for the camera setup. We thank Muhammed Kocabas, Nikos Athanasiou and Maria Alejandra Quiros-Ramirez for the insightful discussions. + +Disclosure: https://files.is.tue.mpg.de/black/CoI_CVPR_2022.txt + +# References + +[1] Ankur Agarwal and Bill Triggs. Recovering 3D human pose from monocular images. Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 28(1):44-58, 2006. 3 +[2] Brett Allen, Brian Curless, and Zoran Popovic. The space of human body shapes: Reconstruction and parameterization from range scans. Transactions on Graphics (TOG), 22(3):587-594, 2003. 3 +[3] Dragomir Anguelov, Praveen Srinivasan, Daphne Koller, Sebastian Thrun, Jim Rodgers, and James Davis. SCAPE: Shape completion and animation of people. Transactions on Graphics (TOG), 24(3):408-416, 2005. 3 +[4] Alexandru Balan and Michael J. Black. The naked truth: Estimating body shape under clothing. In European Conference on Computer Vision (ECCV), volume 5304, pages 15-29, 2008. 3 +[5] Alexandru O. Balan, Leonid Sigal, Michael J. Black, James E. Davis, and Horst W. Haussecker. Detailed human shape and pose from images. In Computer Vision and Pattern Recognition (CVPR), pages 1-8, 2007. 3 +[6] Didier Bieler, Semih Gunel, Pascal Fua, and Helge Rhodin. Gravity as a reference for estimating a person's height from video. In International Conference on Computer Vision (ICCV), pages 8568-8576, 2019. 4 +[7] Federica Bogo, Angjoo Kanazawa, Christoph Lassner, Peter Gehler, Javier Romero, and Michael J. Black. Keep it SMPL: Automatic estimation of 3D human pose and shape from a single image. In European Conference on Computer Vision (ECCV), volume 9909, pages 561-578, 2016. 1, 3 +[8] Zhe Cao, Gines Hidalgo Martinez, Tomas Simon, Shih-En Wei, and Yaser Sheikh. OpenPose: Realtime multiperson 2D pose estimation using part affinity fields. Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 43(1):172–186, 2019. 3 +[9] Vasileios Choutas, Georgios Pavlakos, Timo Bolkart, Dimitrios Tzionas, and Michael J. Black. Monocular expressive body regression through body-driven attention. In European Conference on Computer Vision (ECCV), volume 12355, pages 20-40, 2020. 3, 6, 7, 8 +[10] Antonio Criminisi, Ian Reid, and Andrew Zisserman. Single view metrology. International Journal of Computer Vision (IJCV), 40(2):123-148, 2000. 4 +[11] Ratan Dey, Madhurya Nangia, Keith W. Ross, and Yong Liu. Estimating heights from photo collections: A data-driven approach. In Conference on Online Social Networks (COSN), page 227-238, 2014. 4 +[12] Sai Kumar Dwivedi, Nikos Athanasiou, Muhammed Kocabas, and Michael J. Black. Learning to regress bodies from images using differentiable semantic rendering. In International Conference on Computer Vision (ICCV), pages 11250-11259, 2021. 3 +[13] Yao Feng, Vasileios Choutas, Timo Bolkart, Dimitrios Tzionas, and Michael J. Black. Collaborative regression of expressive bodies using moderation. In International Conference on 3D Vision (3DV), pages 792-804, 2021. 6 +[14] Georgios Georgakis, Ren Li, Srikrishna Karanam, Terrence Chen, Jana Košecka, and Ziyan Wu. Hierarchical kinematic + +human mesh recovery. In European Conference on Computer Vision (ECCV), volume 12362, pages 768-784, 2020. 3 +[15] Ke Gong, Yiming Gao, Xiaodan Liang, Xiaohui Shen, Meng Wang, and Liang Lin. Graphonomy: Universal human parsing via graph transfer learning. In Computer Vision and Pattern Recognition (CVPR), pages 7450-7459, 2019. 3 +[16] Peng Guan, Alexander Weiss, Alexandru Balan, and Michael J. Black. Estimating human shape and pose from a single image. In International Conference on Computer Vision (ICCV), pages 1381-1388, 2009. 3 +[17] Semih Gunel, Helge Rhodin, and Pascal Fua. What face and body shapes can tell us about height. In International Conference on Computer Vision Workshops (ICCVw), pages 1819-1827, 2019. 4 +[18] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross B. Girshick. Mask R-CNN. Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 42(2):386-397, 2020. 3 +[19] Matthew Hill, Stephan Streuber, Carina Hahn, Michael Black, and Alice O'Toole. Exploring the relationship between body shapes and descriptions by linking similarity spaces. Journal of Vision (JOV), 15(12):931-931, 2015. 4 +[20] David T. Hoffmann, Dimitrios Tzionas, Michael J. Black, and Siyu Tang. Learning to train with synthetic humans. In German Conference on Pattern Recognition (GCPR), pages 609-623, 2019. 3 +[21] Wei-Lin Hsiao and Kristen Grauman. ViBE: Dressing for diverse body shapes. In Computer Vision and Pattern Recognition (CVPR), pages 11056-11066, 2020. 3 +[22] Yinghao Huang, Federica Bogo, Christoph Lassner, Angjoo Kanazawa, Peter V. Gehler, Javier Romero, Ijaz Akhter, and Michael J. Black. Towards accurate marker-less human shape and pose estimation over time. In International Conference on 3D Vision (3DV), pages 421-430, 2017. 3 +[23] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3.6M: Large scale datasets and predictive methods for 3D human sensing in natural environments. Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 36(7):1325-1339, 2013. 3, 6 +[24] Yasamin Jafarian and Hyun Soo Park. Learning high fidelity depths of dressed humans by watching social media dance videos. In Computer Vision and Pattern Recognition (CVPR), pages 12753-12762, 2021. 3 +[25] Wen Jiang, Nikos Kolotouros, Georgios Pavlakos, Xiaowei Zhou, and Kostas Daniilidis. Coherent reconstruction of multiple humans from a single image. In Computer Vision and Pattern Recognition (CVPR), pages 5578-5587, 2020. 3 +[26] Hanbyul Joo, Tomas Simon, and Yaser Sheikh. Total capture: A 3D deformation model for tracking faces, hands, and bodies. In Computer Vision and Pattern Recognition (CVPR), pages 8320-8329, 2018. 1, 3 +[27] Angjoo Kanazawa, Michael J. Black, David W. Jacobs, and Jitendra Malik. End-to-end recovery of human shape and pose. In Computer Vision and Pattern Recognition (CVPR), pages 7122-7131, 2018. 3, 8 + +[28] Angjoo Kanazawa, Jason Y. Zhang, Panna Felsen, and Jitendra Malik. Learning 3D human dynamics from video. In Computer Vision and Pattern Recognition (CVPR), pages 5614-5623, 2019. 1 +[29] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), pages 1725–1732, 2014. 6 +[30] Muhammed Kocabas, Nikos Athanasiou, and Michael J. Black. VIBE: Video inference for human body pose and shape estimation. In Computer Vision and Pattern Recognition (CVPR), pages 5252-5262, 2020. 1, 3 +[31] Muhammed Kocabas, Chun-Hao P. Huang, Otmar Hilliges, and Michael J. Black. PARE: Part attention regressor for 3D human body estimation. In International Conference on Computer Vision (ICCV), pages 11127-11137, 2021. 1 +[32] Muhammed Kocabas, Chun-Hao P. Huang, Joachim Tesch, Lea Müller, Otmar Hilliges, and Michael J. Black. SPEC: Seeing people in the wild with an estimated camera. In International Conference on Computer Vision (ICCV), pages 11035-11045, 2021. 1 +[33] Nikos Kolotouros, Georgios Pavlakos, Michael J. Black, and Kostas Daniilidis. Learning to reconstruct 3D human pose and shape via model-fitting in the loop. In International Conference on Computer Vision (ICCV), pages 2252-2261, 2019. 1, 3, 6, 7, 8 +[34] Christoph Lassner, Javier Romero, Martin Kiefel, Federica Bogo, Michael J. Black, and Peter V. Gehler. Unite the people: Closing the loop between 3D and 2D human representations. In Computer Vision and Pattern Recognition (CVPR), pages 6050-6059, 2017. 3 +[35] Junbang Liang and Ming C. Lin. Shape-aware human pose and shape reconstruction using multi-view images. In International Conference on Computer Vision (ICCV), pages 4351-4361, 2019. 2, 3 +[36] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dálár, and C Lawrence Zitnick. Microsoft COCO: common objects in context. In European Conference on Computer Vision (ECCV), volume 8693, pages 740-755, 2014. 3 +[37] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black. SMPL: A skinned multi-person linear model. Transactions on Graphics (TOG), 34(6):248:1-248:16, 2015. 2, 3 +[38] Meysam Madadi, Hugo Bertiche, and Sergio Escalera. SMPLR: Deep learning based SMPL reverse for 3D human pose and shape recovery. Pattern Recognition (PR), 106:107472, 2020. 7 +[39] Naureen Mahmood, Nima Ghorbani, Nikolaus F. Troje, Gerard Pons-Moll, and Michael J. Black. AMASS: Archive of motion capture as surface shapes. In International Conference on Computer Vision (ICCV), pages 5442-5451, 2019. 3 +[40] Lea Müller, Ahmed A. A. Osman, Siyu Tang, Chun-Hao P. Huang, and Michael J. Black. On self-contact and human pose. In Computer Vision and Pattern Recognition (CVPR), pages 9990-9999, 2021. 3, 7, 8 + +[41] Mohamed Omran, Christoph Lassner, Gerard Pons-Moll, Peter V. Gehler, and Bernt Schiele. Neural body fitting: Unifying deep learning and model based human pose and shape estimation. In International Conference on 3D Vision (3DV), pages 484-494, 2018. 3 +[42] Priyanka Patel, Chun-Hao Paul Huang, Joachim Tesch, David Hoffmann, Shashank Tripathi, and Michael J. Black. AGORA: Avatars in geography optimized for regression analysis. In Computer Vision and Pattern Recognition (CVPR), pages 13468-13478, 2021. 3 +[43] Georgios Pavlakos, Vasileios Choutas, Nima Ghorbani, Timo Bolkart, Ahmed A. A. Osman, Dimitrios Tzionas, and Michael J. Black. Expressive body capture: 3D hands, face, and body from a single image. In Computer Vision and Pattern Recognition (CVPR), pages 10975-10985, 2019. 1, 3, 4 +[44] Georgios Pavlakos, Luyang Zhu, Xiaowei Zhou, and Kostas Daniilidis. Learning to estimate 3D human pose and shape from a single color image. In Computer Vision and Pattern Recognition (CVPR), pages 459–468, 2018. 3 +[45] Gerard Pons-Moll, Javier Romero, Naureen Mahmood, and Michael J. Black. Dyna: A model of dynamic human shape in motion. Transactions on Graphics (TOG), 34(4):120:1-120:14, 2015. 6 +[46] Sergi Pujades, Betty Mohler, Anne Thaler, Joachim Tesch, Naureen Mahmood, Nikolas Hesse, Heinrich H Bülthoff, and Michael J. Black. The virtual caliper: Rapid creation of metrically accurate avatars from 3D measurements. Transactions on Visualization and Computer Graphics (TVCG), 25(5):1887-1897, 2019. 3, 4, 5 +[47] Kathleen M. Robinette, Sherri Blackwell, Hein Daanen, Mark Boehmer, Scott Fleming, Tina Brill, David Hoeferlin, and Dennis Burnsides. Civilian American and European Surface Anthropometry Resource (CAESAR) final report. Technical Report AFRL-HE-WP-TR-2002-0169, US Air Force Research Laboratory, 2002. 2, 4, 5 +[48] Nadine Rueegg, Christoph Lassner, Michael J. Black, and Konrad Schindler. Chained representation cycling: Learning to estimate 3D human pose and shape by cycling between representations. In Conference on Artificial Intelligence (AAAI), pages 5561-5569, 2020. 3 +[49] Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Hao Li, and Angjoo Kanazawa. PIFu: Pixel-aligned implicit function for high-resolution clothed human digitization. In International Conference on Computer Vision (ICCV), pages 2304-2314, 2019. 3 +[50] Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. PIFuHD: Multi-level pixel-aligned implicit function for high-resolution 3D human digitization. In Computer Vision and Pattern Recognition (CVPR), pages 81-90, 2020. 3 +[51] Akash Sengupta, Ignas Budvytis, and Roberto Cipolla. Synthetic training for accurate 3D human pose and shape estimation in the wild. In British Machine Vision Conference (BMVC), 2020. 2, 3, 6, 7, 8 +[52] Akash Sengupta, Ignas Budvytis, and Roberto Cipolla. Hierarchical kinematic probability distributions for 3D human + +shape and pose estimation from images in the wild. In International Conference on Computer Vision (ICCV), pages 11219-11229, 2021. 1, 2, 3, 7, 8 +[53] Akash Sengupta, Ignas Budvytis, and Roberto Cipolla. Probabilistic 3D human shape and pose estimation from multiple unconstrained images in the wild. In Computer Vision and Pattern Recognition (CVPR), pages 16094–16104, 2021. 3 +[54] Hyewon Seo, Frederic Cordier, and Nadia Magnenat-Thalmann. Synthesizing animatable body models with parameterized shape modifications. In Symposium on Computer Animation (SCA), pages 120-125, 2003. 3 +[55] Hyewon Seo and Nadia Magnenat-Thalmann. An automatic modeling of human bodies from sizing parameters. In Symposium on Interactive 3D Graphics (SI3D), pages 19-26, 2003. 3 +[56] Leonid Sigal, Alexandru Balan, and Michael J Black. HumanEva: Synchronized video and motion capture dataset and baseline algorithm for evaluation of articulated human motion. International Journal of Computer Vision (IJCV), 87(1):4-27, 2010. 3 +[57] Stephan Streuber, M. Alejandra Quiros-Ramirez, Matthew Q. Hill, Carina A. Hahn, Silvia Zuffi, Alice O'Toole, and Michael J. Black. Body Talk: Crowdshaping realistic 3D avatars with words. Transactions on Graphics (TOG), 35(4):54:1-54:14, 2016. 2, 4, 5 +[58] Aggeliki Tsoli, Matthew Loper, and Michael J. Black. Model-based anthropometry: Predicting measurements from 3D human scans in multiple poses. In Winter Conference on Applications of Computer Vision (WACV), pages 83-90, 2014. 3 +[59] Gul Varol, Duygu Ceylan, Bryan Russell, Jimei Yang, Ersin Yumer, Ivan Laptev, and Cordelia Schmid. BodyNet: Volumetric inference of 3D human body shapes. In European Conference on Computer Vision (ECCV), volume 11211, pages 20-38, 2018. 3 +[60] Gül Varol, Javier Romero, Xavier Martin, Naureen Mahmood, Michael J. Black, Ivan Laptev, and Cordelia Schmid. Learning from synthetic humans. In Computer Vision and Pattern Recognition (CVPR), pages 4627-4635, 2017. 3 + +[61] Timo von Marcard, Roberto Henschel, Michael Black, Bodo Rosenhahn, and Gerard Pons-Moll. Recovering accurate 3D human pose in the wild using IMUs and a moving camera. In European Conference on Computer Vision (ECCV), volume 11214, pages 614-631, 2018. 3, 6 +[62] Andrew Weitz, Lina Colucci, Sidney Primas, and Brinnae Bent. InfiniteForm: A synthetic, minimal bias dataset for fitness applications. arXiv:2110.01330, 2021. 3 +[63] Stefanie Wuhrer and Chang Shu. Estimating 3D human shapes from measurements. Machine Vision and Applications (MVA), 24(6):1133-1147, 2013. 5 +[64] Yuliang Xiu, Jinlong Yang, Dimitrios Tzionas, and Michael J. Black. ICON: Implicit Clothed humans Obtained from Normals. In Computer Vision and Pattern Recognition (CVPR), 2022. 3 +[65] Hongyi Xu, Eduard Gabriel Bazavan, Andrei Zanfir, William T. Freeman, Rahul Sukthankar, and Cristian Sminchisescu. GHUM & GHUML: Generative 3D human shape and articulated pose models. In Computer Vision and Pattern Recognition (CVPR), pages 6183-6192, 2020. 1, 3 +[66] Andrei Zanfir, Eduard Gabriel Bazavan, Hongyi Xu, William T Freeman, Rahul Sukthankar, and Cristian Sminchisescu. Weakly supervised 3D human pose and shape reconstruction with normalizing flows. In European Conference on Computer Vision (ECCV), volume 12351, pages 465-481, 2020. 3 +[67] Hongwen Zhang, Yating Tian, Xinchi Zhou, Wanli Ouyang, Yebin Liu, Limin Wang, and Zhenan Sun. PyMAF: 3D human pose and shape regression with pyramidal mesh alignment feedback loop. In International Conference on Computer Vision (ICCV), pages 11446-11456, 2021. 1 +[68] Rui Zhu, Xingyi Yang, Yannick Hold-Geoffroy, Federico Perazzi, Jonathan Eisenmann, Kalyan Sunkavalli, and Manmohan Chandraker. Single view metrology in the wild. In European Conference on Computer Vision (ECCV), volume 12356, pages 316–333, 2020. 4 \ No newline at end of file diff --git a/accurate3dbodyshaperegressionusingmetricandsemanticattributes/images.zip b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d3c813f50c24271fbb84a608cc52859deb07aa06 --- /dev/null +++ b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b0b011e4446124556f49664eee4c1a36796d59de91f3dfb176a4a1b0ebb5880 +size 501872 diff --git a/accurate3dbodyshaperegressionusingmetricandsemanticattributes/layout.json b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1ca02513ce88d557ebd8f59f5be7ed130f5b5b2d --- /dev/null +++ b/accurate3dbodyshaperegressionusingmetricandsemanticattributes/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f356971b0d53e052a46bd0fc32556c068dc36fadb48334b9e1130082dc7b506 +size 420230 diff --git a/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_content_list.json b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..18be26e67bd101026b220aafe1d8cfa0e21b8b4e --- /dev/null +++ b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ad85c081c6873a08ba6a29fe13bcca2eaca617e8446a48e1d4e6d07733b7049 +size 78656 diff --git a/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_model.json b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_model.json new file mode 100644 index 0000000000000000000000000000000000000000..83878303f688c6bf4b72e8bf2f954bc101d489a3 --- /dev/null +++ b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d76865fb4cae3f9629ccd483da4a2cf39d300d85c8e8ff7aa76c7b5f619aa45 +size 94529 diff --git a/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_origin.pdf b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..636e8da9f1c42276e0331cd81b72d8e1832d1af7 --- /dev/null +++ b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/d6176429-3843-42b4-b235-8f7c679bc7da_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b144a7e91825068138606a15224c80f5e87f25eecc26c407f700f5473692d70f +size 2244408 diff --git a/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/full.md b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8121cf3a1d0a1b882eb4de43d6a9a8e8d35358ec --- /dev/null +++ b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/full.md @@ -0,0 +1,275 @@ +# ACPL: Anti-curriculum Pseudo-labelling for Semi-supervised Medical Image Classification + +Fengbei Liu $^{1*}$ Yu Tian $^{1*}$ Yuanhong Chen $^{1}$ Yuyuan Liu $^{1}$ Vasileios Belagiannis $^{2}$ Gustavo Carneiro $^{1}$ + +$^{1}$ Australian Institute for Machine Learning, University of Adelaide + $^{2}$ Universität Ulm, Germany + +# Abstract + +Effective semi-supervised learning (SSL) in medical image analysis (MIA) must address two challenges: 1) work effectively on both multi-class (e.g., lesion classification) and multi-label (e.g., multiple-disease diagnosis) problems, and 2) handle imbalanced learning (because of the high variance in disease prevalence). One strategy to explore in SSL MIA is based on the pseudo labelling strategy, but it has a few shortcomings. Pseudo-labelling has in general lower accuracy than consistency learning, it is not specifically designed for both multi-class and multi-label problems, and it can be challenged by imbalanced learning. In this paper, unlike traditional methods that select confident pseudo label by threshold, we propose a new SSL algorithm, called anti-curriculum pseudo-labelling (ACPL), which introduces novel techniques to select informative unlabelled samples, improving training balance and allowing the model to work for both multi-label and multi-class problems, and to estimate pseudo labels by an accurate ensemble of classifiers (improving pseudo label accuracy). We run extensive experiments to evaluate ACPL on two public medical image classification benchmarks: Chest X-Ray14 for thorax disease multi-label classification and ISIC2018 for skin lesion multi-class classification. Our method outperforms previous SOTA SSL methods on both datasets $^{12}$ . + +# 1. Introduction + +Deep learning has shown outstanding results in medical image analysis (MIA) [24, 34, 35]. Compared to computer vision, the labelling of MIA training sets by medical experts is significantly more expensive, resulting in low availability of labelled images, but the high availability of unlabelled + +![](images/9013c576f3285bc6e1b38f62b263dd6633947e54fd2561a59e126e15f68726d7.jpg) +(a) Diagram of our ACPL (top) and traditional pseudo-label SSL (bottom) + +![](images/0767c8e2fc388b322be54381b1ab0bb3fc19e3f3f6f71c1a2990be6d2070d94d.jpg) +(b) Imbalanced distribution on multi-label Chest X-ray14 [39] (left) and multi-class ISIC2018 [36] (right) + +![](images/7eff3aaa09a7728090044eb4940d2cf57946d72b6663d69774a8885cca74639f.jpg) +Figure 1. In (a), we show diagrams of the proposed ACPL (top) and the traditional pseudo-label SSL (bottom) methods, and (b) displays histograms of images per label for the multi-label Chest X-ray14 [39] (left) and multi-class ISIC2018 [36] (right). + +images from clinics and hospitals databases can be explored in the modelling of deep learning classifiers. Furthermore, differently from computer vision problems that tend to be mostly multi-class and balanced, MIA has a number of multi-class (e.g., a lesion image of a single class) and multi-label (e.g., an image from a patient can contain multiple diseases) problems, where both problems usually contain severe class imbalances because of the variable prevalence of diseases (see Fig. 1-(b)). Hence, MIA semi-supervised learning (SSL) methods need to be flexible enough to work with multi-label and multi-class problems, in addition to handle imbalanced learning. + +State-of-the-art (SOTA) SSL approaches are usually based on the consistency learning of unlabelled data [5, 6, 32] and self-supervised pre-training [25]. Even though consistency-based methods show SOTA results on multiclass SSL problems, pseudo-labelling methods have shown + +better results for multi-label SSL problems [29]. Pseudolabelling methods provide labels to confidently classified unlabelled samples that are used to re-train the model [22]. One issue with pseudo-labelling SSL methods is that the confidently classified unlabelled samples represent the least informative ones [30] that, for imbalanced problems, are likely to belong to the majority classes. Hence, this will bias the classification toward the majority classes and most likely deteriorate the classification accuracy of the minority classes. Also, selecting confident pseudo-labelled samples is challenging in multi-class, but even more so in multi-label problems. Previous papers [2, 29] use a fixed threshold for all classes, but a class-wise threshold that addresses imbalanced learning and correlations between classes in multi-label problems would enable more accurate pseudo-label predictions. However, such class-wise threshold is hard to estimate without knowing the class distributions or if we are dealing with a multi-class or multi-label problem. Furthermore, using the model output for the pseudo-labelling process can also cause confirmation bias [1], whereby the assignment of incorrect pseudo-labels will increase the model confidence in those incorrect predictions, and consequently decrease the model accuracy. + +In this paper, we propose the anti-curriculum pseudo-labelling (ACPL), which addresses multi-class and multi-label imbalanced learning SSL MIA problems. First, we introduce a new approach to select the most informative unlabelled images to be pseudo-labelled. This is motivated by our argument that there exists a distribution shift between unlabelled and labelled samples for SSL. An effective learning curriculum must focus on informative unlabelled samples that are located as far as possible from the distribution of labelled samples. As a result, these informative samples are likely to belong to the minority classes in MIA imbalanced learning problems. Selecting these informative samples will naturally balance the training process and, given that they are selected before the pseudolabelling process, we eliminate the need for estimating a class-wise classification threshold, facilitating our model to work well on multi-class and multi-label problems. The information content measure of an unlabelled sample is computed with our proposed cross-distribution sample informativeness that outputs how close an unlabelled sample is from the set of labelled anchor samples (anchor samples are highly informative labelled samples). Second, we introduce a new pseudo-labelling mechanism, called informative mixup, which combines the model classification with a K-nearest neighbor (KNN) classification guided by sample informativeness to improve prediction accuracy and mitigate confirmation bias. Third, we propose the anchor set purification method that selects the most informative pseudo-labelled samples to be included in the labelled anchor set to improve the pseudo-labelling accuracy of the KNN classi + +fer in later training stages. + +To summarise, our ACPL approach selects highly informative samples for pseudo-labelling (addressing MIA imbalanced classification problems and allowing multi-label multi-class modelling) and uses an ensemble of classifiers to produce accurate pseudo labels (tackling confirmation bias to improve classification accuracy), where the main technical contributions are: + +- A novel information content measure to select informative unlabelled samples named cross-distribution sample informativeness; +- A new pseudo-labelling mechanism, called informative mixup, which generates pseudo labels from an ensemble of deep learning and KNN classifiers; and +- A novel method, called anchor set purification (ASP), to select informative pseudo-labelled samples to be included in the labelled anchor set to improve the pseudo-labelling accuracy of the KNN classifier. + +We evaluate ACPL on two publicly available medical image classification datasets, namely the Chest X-Ray14 for thorax disease multi-label classification [39] and the ISIC2018 for skin lesion multi-class classification [8, 36]. Our method outperforms the current SOTA methods in both datasets. + +# 2. Related Work + +We first review consistency-based and pseudo-labelling SSL methods. Then, we discuss the curriculum and anticurriculum learning literature for fully and semi-supervised learning and present relevant SSL MIA methods. + +Consistency-based SSL optimises the classification prediction of labelled images and minimises the prediction outputs of different views of unlabelled images, where these views are obtained from different types of image perturbations, such as spatial/temporal [21, 33], adversarial [27], or data augmentation [5, 6, 32]. The performance of the consistency-based methods can be further improved with self-supervised pre-training [25]. Even though consistency-based SSL methods show SOTA results in many benchmarks [32], they depend on a careful design of perturbation functions that requires domain knowledge and would need to be adapted to each new type of medical imaging. Furthermore, Rizve et al. [29] show that pseudo-labelling SSL methods are more accurate for multi-label problems. + +Pseudo-labelling SSL methods [7, 29, 31, 41] train a model with the available labelled data, estimate the pseudo labels of unlabelled samples classified with high confidence [22], then take these pseudo-labelled samples to retrain the model. As mentioned above in Sec. 1 pseudo-label SSL approaches can bias classification toward the majority classes in imbalanced problems, is not seamlessly adaptable to multi-class and multi-label problems, and can also + +lead to confirmation bias. We argue that the improvement of pseudo-labelling SSL methods depends on the selection of informative unlabelled samples to address the majority class bias and the adaptation to multi-class and multi-label problems, and an accurate pseudo-labelling mechanism to handle confirmation bias, which are two points that we target with this paper. + +The selection of training samples based on their information content has been studied by fully supervised curriculum and anti-curriculum learning methods [40]. Curriculum learning focuses on the easy samples in the early training stages and gradually includes the hard samples in the later training stages, where easy samples [4, 15, 20] are usually defined as samples that have small losses during training, and hard samples tend to have large losses. On the other hand, anti-curriculum focuses on the hard samples first and transitions to the easy samples later in the training [14, 17]. The methods above have been designed to work in fully supervised learning. Cascante et al. [7] explored a pseudo labelling SSL method based on curriculum learning, but we are not aware of SSL methods that explore anti-curriculum learning. Since we target accurate SSL of imbalanced multi-class and multi-label methods, we follow anti-curriculum learning that pseudo-labels the most informative samples which are likely to belong to the minority classes (consequently, helping to balance the training) and enable the selection of samples without requiring the estimation of a class-wise classification threshold (enabling a seamless adaptation to multi-class and multi-label problems). + +The main benchmarks for SSL in MIA study the multi-label classification of chest X-ray (CXR) images [13, 39] and multi-class classification of skin lesions [8, 36]. For CXR SSL classification, pseudo-labelling methods have been explored [2], but SOTA results are achieved with consistency learning approaches [9, 23, 25, 26, 37]. For skin lesion SSL classification, the current SOTA is also based on consistency learning [26], with pseudo-labelling approaches [3] not being competitive. We show that our proposed pseudo-labelling method ACPL can surpass the consistency-based SOTA on both benchmarks, demonstrating the value of selecting highly informative samples for pseudo labelling and of the accurate pseudo labels from the ensemble of classifiers. We also show that our ACPL improves the current computer vision SOTA [29] applied to MIA, demonstrating the limitation of computer vision methods in MIA and also the potential of our approach to be applied in more general SSL problems. + +# 3. Methods + +To introduce our SSL method ACPL, assume that we have a small labelled training set $\mathcal{D}_L = \{(\mathbf{x}_i,\mathbf{y}_i)\}_{i = 1}^{|\mathcal{D}_L|}$ where $\mathbf{x}_i\in \mathcal{X}\subset \mathbb{R}^{H\times W\times C}$ is the input image of size + +Algorithm 1 Anti-curriculum Pseudo-labelling Algorithm +1: require: Labelled set $\mathcal{D}_L$ , unlabelled set $\mathcal{D}_U$ , and number of training stages $T$ +2: initialise $\mathcal{D}_A = \mathcal{D}_L$ , and $t = 0$ +3: warm-up train $p_{\theta_t}(\mathbf{x})$ with $\theta_t = \arg \min_\theta \frac{1}{|\mathcal{D}_L|} \sum_{(\mathbf{x}_i, \mathbf{y}_i) \in \mathcal{D}_L} \ell(\mathbf{y}_i, p_{\theta}(\mathbf{x}_i))$ +4: while $t < T$ or $|\mathcal{D}_U| \neq 0$ do +5: build pseudo-labelled dataset using CDSI from (2) and IM from (6): $\mathcal{D}_S = \{(x, \tilde{y}) | x \in \mathcal{D}_U, h(f_{\theta_t}(x), \mathcal{D}_A) = 1, \tilde{y} = g(f_{\theta_t}(x), \mathcal{D}_A)\}$ +6: update anchor set with ASP from (7): $\mathcal{D}_A = \mathcal{D}_A \bigcup (\mathbf{x}, \tilde{\mathbf{y}})$ , where $(x, \tilde{y}) \in \mathcal{D}_S$ , and $a(f_{\theta_t}(x), \mathcal{D}_U, \mathcal{D}_A) = 1$ +7: $t \gets t + 1$ +8: optimise (1) using $\mathcal{D}_L, \mathcal{D}_S$ to obtain $p_{\theta_t}(\mathbf{x})$ +9: update labelled and unlabelled sets: $\mathcal{D}_L \gets \mathcal{D}_L \bigcup \mathcal{D}_S, \mathcal{D}_U \gets \mathcal{D}_U \setminus \mathcal{D}_S$ +10: end while +11: return $p_{\theta_t}(\mathbf{x})$ + +$H\times W$ with $C$ colour channels, and $\mathbf{y}_i\in \{0,1\}^{|\mathcal{V}|}$ is the label with the set of classes denoted by $\mathcal{V} = \{1,\dots,|\mathcal{V}|\}$ (note that $\mathbf{y}_i$ is a one-hot vector for multi-class problems and a binary vector in multi-label problems). A large unlabelled training set $\mathcal{D}_U = \{\mathbf{x}_i\}_{i = 1}^{|D_U|}$ is also provided, with $|\mathcal{D}_L| < < |\mathcal{D}_U|$ . We assume the samples from both datasets are drawn from the same (latent) distribution. Our algorithm also relies on the pseudo-labelled set $\mathcal{D}_S$ that is composed of pseudo-labelled samples classified as informative unlabelled samples, and an anchor set $\mathcal{D}_A$ that contains informative pseudo-labelled samples. The goal of ACPL is to learn a model $p_{\theta}:X\to [0,1]^{|Y|}$ parameterised by $\theta$ using the labelled, unlabelled, pseudo-labelled, and anchor datasets. + +Below, in Sec. 3.1, we introduce our ACPL optimisation that produces accurate pseudo labels to unlabelled samples following an anti-curriculum strategy, where highly informative unlabelled samples are selected to be pseudolabelled at each training stage. In Sec. 3.2, we present the information criterion of an unlabelled sample, referred to as cross distribution sample informativeness (CDSI), based on the dissimilarity between the unlabelled sample and samples in the anchor set $\mathcal{D}_A$ . The pseudo labels for the informative unlabelled samples are generated using the proposed informative mixup (IM) method (Sec. 3.3) that mixes up the results from the model $p_{\theta}(.)$ and a $K$ nearest neighbor (KNN) classifier using the anchor set. At the end of each training stage, the anchor set is updated with the anchor set purification (ASP) method (Sec. 3.4) that only keeps + +![](images/71982ed51349b567b75d53935f6e6090c6b04a98e830f3fd9f18d6d7ac3b0abc.jpg) +Figure 2. Anti-curriculum pseudo-labelling (ACPL) algorithm. The algorithm is divided into the following iterative steps: 1) train the model with $\mathcal{D}_S$ and $\mathcal{D}_L$ ; 2) extract the features from the anchor and unlabelled samples; 3) estimate information content of unlabelled samples with CDSI from (4) with anchor set $\mathcal{D}_A$ ; 4) partition the unlabelled samples into high, medium and low information content using (2); 5) assign a pseudo label to high information content unlabelled samples with IM from (6); 6) update $\mathcal{D}_S$ with new pseudo-labelled samples; and 7) update $\mathcal{D}_A$ with ASP in (7). + +the most informative subset of pseudo-labelled samples, according to the CDSI criterion. + +# 3.1. ACPL Optimisation + +Our ACPL optimisation, described in Alg. 1 and depicted by Fig. 2, starts with a warm-up supervised training of the parameters of the model $p_{\theta}(.)$ using only the labelled set $\mathcal{D}_L$ . For the rest of the training, we use the sets of labelled and unlabelled samples, $\mathcal{D}_L$ and $\mathcal{D}_U$ , and update the pseudo-labelled set $\mathcal{D}_S$ and the anchor set $\mathcal{D}_A$ containing the informative unlabelled and pseudo-labelled samples, where $\mathcal{D}_S$ start as an empty set and $\mathcal{D}_A$ starts with the samples in $\mathcal{D}_L$ . The optimisation iteratively minimises the following cost function: + +$$ +\begin{array}{l} \ell_ {A C P L} (\theta , \mathcal {D} _ {L}, \mathcal {D} _ {S}) = \frac {1}{| \mathcal {D} _ {L} |} \sum_ {\left(\mathbf {x} _ {i}, \mathbf {y} _ {i}\right) \in \mathcal {D} _ {L}} \ell \left(\mathbf {y} _ {i}, p _ {\theta} \left(\mathbf {x} _ {i}\right)\right) \tag {1} \\ + \frac {1}{| \mathcal {D} _ {S} |} \sum_ {(\mathbf {x} _ {i}, \tilde {\mathbf {y}} _ {i}) \in \mathcal {D} _ {S}} \ell (\tilde {\mathbf {y}} _ {i}, p _ {\theta} (\mathbf {x} _ {i})), \\ \end{array} +$$ + +where $\ell(.)$ denotes a classification loss (e.g., cross-entropy), $\theta$ is the model parameter, $\mathbf{y}_i$ is the ground truth, and $\tilde{\mathbf{y}}_i$ is the estimated pseudo label. After optimising (1), the labelled and unlabelled sets are updated as $\mathcal{D}_L = \mathcal{D}_L \cup \mathcal{D}_S$ and $\mathcal{D}_U = \mathcal{D}_U \setminus \mathcal{D}_S$ , and a new iteration of optimisation takes place. + +# 3.2. Cross Distribution Sample Informativeness (CDSI) + +The function that estimates if an unlabelled sample has high information content is defined by + +$$ +h \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right) = \left\{ \begin{array}{l l} 1, & p _ {\gamma} (\zeta = \operatorname {h i g h} | \mathbf {x}, \mathcal {D} _ {A}) > \tau , \\ 0, & \text {o t h e r w i s e}, \end{array} \right. \tag {2} +$$ + +where $\zeta \in \mathcal{Z} = \{\mathrm{low, medium, high}\}$ represents the information content random variable, $\gamma = \{\mu_{\zeta}, \Sigma_{\zeta}, \pi_{\zeta}\}_{\zeta \in \mathcal{Z}}$ denotes the parameters of the Gaussian Mixture Model (GMM) $p_{\gamma}(.)$ , and $\tau = \max \{p_{\gamma}(\zeta = \mathrm{low} | \mathbf{x}, \mathcal{D}_A), p_{\gamma}(\zeta = \mathrm{medium} | \mathbf{x}, \mathcal{D}_A)\}$ . The function $p_{\gamma}(\zeta | \mathbf{x}, \mathcal{D}_A)$ can be decomposed into $p_{\gamma}(\mathbf{x} | \zeta, \mathcal{D}_A) p_{\gamma}(\zeta | \mathcal{D}_A) / p_{\gamma}(\mathbf{x} | \mathcal{D}_A)$ , where + +$$ +p _ {\gamma} (\mathbf {x} | \zeta , \mathcal {D} _ {A}) = n \left(d \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right) \mid \mu_ {\zeta}, \Sigma_ {\zeta}\right), \tag {3} +$$ + +with $n(:, \mu_{\zeta}, \Sigma_{\zeta})$ denoting a Gaussian function with mean $\mu_{\zeta}$ and covariance $\Sigma_{\zeta}$ , $p_{\gamma}(\zeta | \mathcal{D}_A) = \pi_{\zeta}$ representing the ownership probability of $\zeta$ (i.e., the weight of mixture $\zeta$ ), and $p_{\gamma}(\mathbf{x} | \mathcal{D}_A)$ being a normalisation factor. The probability in (3) is computed with the density of the unlabelled sample $\mathbf{x}$ with respect to the anchor set $\mathcal{D}_A$ , as follows: + +$$ +d \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right) = \frac {1}{K} \sum_ {\substack {\left(f _ {\theta} \left(\mathbf {x} _ {A}\right), \mathbf {y} _ {A}\right) \in \\ \mathcal {N} \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right)}} \frac {f _ {\theta} (\mathbf {x}) ^ {\top} f _ {\theta} \left(\mathbf {x} _ {A}\right)}{\| f _ {\theta} (\mathbf {x}) \| _ {2} \| f _ {\theta} \left(\mathbf {x} _ {A}\right) \| _ {2}}, \tag{4} +$$ + +where $\mathcal{N}(f_{\theta}(\mathbf{x}),\mathcal{D}_A)$ represents the set of K-nearest neighbors (KNN) from the anchor set $\mathcal{D}_A$ to the input image feature $f_{\theta}(\mathbf{x})$ , with each element in the set $\mathcal{D}_A$ denoted by $(f_{\theta}(\mathbf{x}_A),\mathbf{y}_A)$ . The $F$ -dimensional input image feature is extracted with $f_{\theta}:\mathcal{X}\to \mathbb{R}^{F}$ from the model $p_{\theta}(.)$ with $p_{\theta}(\mathbf{x}) = \sigma (f_{\theta}(\mathbf{x}))$ , where $\sigma (.)$ is the final activation function to produce an output in $[0,1]^{|\mathcal{V}|}$ . The parameters $\gamma$ in (2) are estimated with the expectation-maximisation (EM) algorithm [10], every time after the anchor set is updated. + +# 3.3. Informative Mixup (IM) + +After selecting informative unlabelled samples with (2), we aim to produce reliable pseudo labels for them. We can provide two pseudo labels for each unlabelled sample $\mathbf{x} \in \mathcal{D}_U$ : the model prediction from $p_\theta(\mathbf{x})$ , and the K-nearest neighbor (KNN) prediction using the anchor set, as follows: + +$$ +\tilde {\mathbf {y}} _ {\text {m o d e l}} (\mathbf {x}) = p _ {\theta} (\mathbf {x}), +$$ + +$$ +\tilde {\mathbf {y}} _ {\mathrm {K N N}} (\mathbf {x}) = \frac {1}{K} \sum_ {\left(f _ {\theta} \left(\mathbf {x} _ {A}\right), \mathbf {y} _ {A}\right) \in \mathcal {N} \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right)} \mathbf {y} _ {A}. \tag {5} +$$ + +$\mathbf{y}_A$ is the label of anchor set samples. However, using any of the pseudo labels from (5) can be problematic for model training. The pseudo label in $\tilde{\mathbf{y}}_{\mathrm{model}}(\mathbf{x})$ can cause confirmation bias, and the reliability of $\tilde{\mathbf{y}}_{\mathrm{KNN}}(\mathbf{x})$ depends on the size and representativeness of the initial labelled set to produce accurate classification. Inspired by MixUp [42], we propose the informative mixup method that constructs the pseudo-labelling function $g(.)$ in (1) with a linear combination of $\tilde{\mathbf{y}}_{\mathrm{model}}(\mathbf{x})$ and $\tilde{\mathbf{y}}_{\mathrm{KNN}}(\mathbf{x})$ weighted by the density + +![](images/ea44149b3894f52ff2c886b5f86406d869be2f9aef8988a7cbe2f9f125300bd6.jpg) +Figure 3. ASP: 1) find KNN samples from an informative unlabelled sample to the anchor set $\mathcal{D}_A$ ; 2) find KNN samples from each anchor sample of (1) to the unlabelled set $\mathcal{D}_U$ ; and 3) calculate the number of surviving nearest neighbours. Samples with the smallest values of $c(.)$ are selected to be inserted into $\mathcal{D}_A$ . + +score from (4), as follows: + +$$ +\begin{array}{l} \tilde {\mathbf {y}} = g \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right) = d \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right) \times \tilde {\mathbf {y}} _ {\text {m o d e l}} (\mathbf {x}) \\ + \left(1 - d \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {A}\right)\right) \times \tilde {\mathbf {y}} _ {\mathrm {K N N}} (\mathbf {x}). \tag {6} \\ \end{array} +$$ + +The informative mixup in (6) is different from MixUp [42] because it combines the classification results of the same image from two models instead of the classification from the same model of two images. Furthermore, our informative mixup weights the classifiers with the density score to reflect the trade-off between $\tilde{\mathbf{y}}_{\mathrm{model}}(\mathbf{x})$ and $\tilde{\mathbf{y}}_{\mathrm{KNN}}(\mathbf{x})$ . Since informative samples are selected from a region of the anchor set with low feature density, the KNN prediction $\tilde{\mathbf{y}}_{\mathrm{KNN}}(\mathbf{x})$ is less reliable than $\tilde{\mathbf{y}}_{\mathrm{model}}(\mathbf{x})$ , so by default, we should trust more the model classification. The weighting between the two predictions in (6) reflects this observation, where $\tilde{\mathbf{y}}_{\mathrm{model}}(\mathbf{x})$ will tend have a larger weight given that $d(f_{\theta}(\mathbf{x}),\mathcal{D}_A)$ is usually larger than 0.5, as displayed in Fig. 2 (see the informativeness score histogram at the bottom-right corner). When the sample is located in a high-density region, we place most of the weight on the model prediction given that in such case, the model is highly reliable. On the other hand, when the sample is in a low-density region, we try to balance a bit more the contribution of both the model and KNN predictions, given the low reliability of the model. + +# 3.4. Anchor Set Purification (ASP) + +After estimating the pseudo label for informative unlabelled samples, we aim to update the anchor set with informative pseudo-labelled samples to maintain density score from (4) accurate in later training stages. However, adding all pseudo-labelled samples will cause anchor set over-sized and increase hyper-parameter sensitivity. Thus, we propose + +the Anchor Set Purification (ASP) module to select the least connected pseudo-labelled samples to be inserted in the anchor set, as in (see Fig. 3): + +$$ +a \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {U}, \mathcal {D} _ {A}\right) = \left\{ \begin{array}{l l} 1, & c \left(f _ {\theta} (\mathbf {x}), \mathcal {D} _ {U}, \mathcal {D} _ {A}\right) \leq \alpha , \\ 0, & \text {o t h e r w i s e}, \end{array} \right. \tag {7} +$$ + +where the pseudo-labelled samples with $a(f_{\theta}(\mathbf{x}), \mathcal{D}_U, \mathcal{D}_A) = 1$ and $\tilde{\mathbf{y}} = g(f_{\theta}(\mathbf{x}), \mathcal{D}_A)$ from (6) are inserted into the anchor set. The information content $c(f_{\theta}(\mathbf{x}), \mathcal{D}_U, \mathcal{D}_A)$ of a pseudo-labelled sample $f_{\theta}(\mathbf{x})$ in (7) is computed in three steps (see Fig. 3): 1) find the KNN samples $\mathcal{N}(f_{\theta}(\mathbf{x}), \mathcal{D}_A)$ from $f_{\theta}(\mathbf{x})$ to the anchor set $\mathcal{D}_A$ ; 2) for each of the $K$ elements $(\mathbf{x}_A, \mathbf{y}_A) \in \mathcal{N}(f_{\theta}(\mathbf{x}), \mathcal{D}_A)$ , find the KNN set $\mathcal{N}(f_{\theta}(\mathbf{x}_A), \mathcal{D}_U)$ from $f_{\theta}(\mathbf{x}_A)$ to the unlabelled set $\mathcal{D}_U$ ; and 3) $c(f_{\theta}(\mathbf{x}), \mathcal{D}_U, \mathcal{D}_A)$ is calculated to be the number of times that the pseudo-labelled sample $\mathbf{x}$ appears in the KNN sets $\mathcal{N}(f_{\theta}(\mathbf{x}_A), \mathcal{D}_U)$ for the $K$ elements of set $\mathcal{N}(f_{\theta}(\mathbf{x}), \mathcal{D}_A)$ . The threshold $\alpha$ in (7) is computed with $\alpha = \min_{\mathbf{x} \in \mathcal{D}_S} c(f_{\theta}(\mathbf{x}), \mathcal{D}_U, \mathcal{D}_A)$ . + +# 4. Experiments + +For the experiments below, we use the Chest X-Ray14 [39] and ISIC2018 [8, 36] datasets. + +Chest X-Ray14 contains 112,120 CXR images from 30,805 different patients. There are 14 labels (each label is a disease) and No Finding class, where each patient can have multiple labels, forming a multi-label classification problem. To compare with previous papers [2, 26], we adopt the official train/test data split [39]. We report the classification result on the test set (26K samples) using area under the ROC curve (AUC), and the learning process uses training sets containing different proportions of the labelled data in $\{2\%, 5\%, 10\%, 15\%, 20\}$ . + +ISIC2018 is a skin lesion dataset that contains 10,015 images with seven labels. Each image is associated with one of the labels, forming a multi-class classification problem. We follow the train/test split from [26] for fair comparison, where the training set contains $20\%$ of labelled samples and $80\%$ of unlabelled samples. We report the AUC, Sensitivity, and F1 score results. + +# 4.1. Implementation Details + +For both datasets, we use DenseNet-121 [12] as our backbone model. For Chest X-Ray14, the dataset preprocessing consists of resizing the images to $512 \times 512$ for faster processing. For the optimisation, we use Adam optimizer [19], batch size 16 and learning rate 0.05. During training, we use data augmentation based on random crop and resize, and random horizontal flip. We first train 20 epochs on the initial labelled subset to warm-up the model for feature extraction. Then we train for 50 epochs, where in every 10 epochs we update the anchor set with ASP from + +Table 1. Mean AUC testing set results over the 14 disease classes of Chest X-Ray14 for different labelled set training percentages. * indicates the methods that use DenseNet-169 as backbone architecture. Bold number means the best result per label percentage and underline shows previous best results. + +
Method TypeLabel Percentage2%5%10%15%20%
Consistency basedSRC-MT* [26]66.9572.2975.2877.7679.23
NoTeacher [37]72.6077.0477.61N/A79.49
S2MTS2 [25]74.6978.9679.9080.3181.06
Pseudo LabelGraph XNet* [2]53.0058.0063.0068.0078.00
UPS [29]65.5173.1876.8478.9079.92
Ours74.8279.2080.4081.0681.77
+ +Table 2. Class-level AUC testing set results comparison between our approach and other semi-supervised SOTA approaches trained with $20\%$ of labelled data on Chest Xray-14. * denotes the models use DenseNet-169 as backbone. Bold number means the best result per class and underlined shows second best results. + +
Method TypeSupervisedConsistency basedPseudo-labelling
MethodDensenet-121MT [33]*SRC-MT [26]*S2MTS2[25]GraphXNet [2]UPS [29]Ours
Atelectasis75.7575.1275.3878.5771.8977.0979.53
Cardiomegaly80.7187.3787.788.0887.9985.7389.03
Effusion79.8780.8181.5882.8779.281.3583.56
Infiltration69.1670.6770.470.6872.0570.8271.40
Mass78.4077.7278.0382.5780.981.8282.49
Nodule74.4973.2773.6476.6071.1376.3477.73
Pneumonia69.5569.1769.2772.2576.6470.9673.86
Pneumothorax84.7085.6386.1286.5583.785.8686.95
Consolidation71.8572.5173.1175.4773.3674.3575.50
Edema81.6182.7282.9484.8380.283.5684.95
Emphysema89.7588.1688.9891.8884.0791.0093.36
Fibrosis79.3078.2479.2281.7380.3480.8781.86
Pleural Thicken73.4674.4375.6376.8675.775.5577.60
Hernia86.0587.7487.2785.9887.2285.6285.89
Mean78.1978.8379.2381.0678.0079.9281.77
+ +Sec. 3.4. For the KNN classifier in (2), we set K to be 200 for $2\%$ and $5\%$ (of labelled data) and 50 for remaining label proportions. These values are set based on validation results, but our approach is robust to a large range K values - we show an ablation study that compares the performance of our method for different values of K. For ISIC2018, we resize the image to $224 \times 224$ for fair comparison with baselines. For the optimisation, we use Adam optimizer [19], batch size 32 and learning rate 0.001. During training, data augmentation is also based on random crop and resize, and random horizontal flip. We warm-up the model for 40 epochs and then we train for 100 epochs, where in every 20 epochs, we update the anchor set with ASP. For the KNN classifier, K is set to 100 based on validation set. The code is written in Pytorch [28] and we use two RTX 2080ti Gpus for all experiments. KNN computation takes 5 sec for Chest X-ray14 unlabelled samples with Faisss [16] library for faster processing. We follow [25, 26, 33] to maintain an exponential moving average (EMA) version of the trained model, which is only used for evaluation not for training. + +# 4.2. Thorax Disease Classification Result + +For the results on Chest X-Ray14 in Table 1, our method, NoTeacher [37], UPS [29], and $\mathbf{S}^2\mathbf{M}\mathbf{T}\mathbf{S}^2$ [25] use the DenseNet-121 backbone, while SRC-MT [26] and GraphXNet [2] use DenseNet-169 [12]. SRC-MT [26] is a consistency-based SSL; NoTeacher [37] extends MT by replacing the EMA process with two networks combined with a probabilistic graph model; $\mathbf{S}^2\mathbf{M}\mathbf{T}\mathbf{S}^2$ [25] combines self-supervised pre-training with MT fine-tuning; and GraphXNet [2] constructs a graph from dataset samples and assigns pseudo labels to unlabeled samples through label propagation; and UPS [29] applies probability and uncertainty thresholds to enable the pseudo labelling of unlabeled samples. All methods use the official test set [39]. Our approach achieves the SOTA results for all percentages of training labels. Compared to the pseudo-labelling approaches UPS and GraphXNet, our approach outperforms them by a margin between $3\%$ to $20\%$ . Compared to the consistency-based approaches SRC-MT and NoTeacher, our method consistently achieves $2\%$ improvement for all cases, even though we use a backbone archi + +Table 3. AUC, Sensitivity and F1 testing results on ISIC2018, where $20\%$ of the training set is labelled. Bold shows the best result per measure, and underline shows second best results. + +
MethodAUCSensitivityF1
Supervised90.1565.5052.03
SS-DCGAN [11]91.2867.7254.10
TCSE [23]92.2468.1758.44
TE [21]92.7069.8159.33
MT [33]92.9669.7559.10
SRC-MT [26]93.5871.4760.68
Self-training [3]90.5867.6354.51
Ours94.3672.1462.23
+ +tecture of lower capacity (i.e., DenseNet-121 instead of DenseNet-169). Compared with the previous SOTA, our method outperforms $\mathrm{S}^2\mathrm{MTS}^2$ [25] by $1\%$ AUC in all cases, which is remarkable because our method is initialised with an ImageNet pre-trained model instead of an expensive self-supervised pre-training approach. + +The class-level performances using $20\%$ of the labelled data of SSL methods are shown in Table 2, which demonstrates that our method achieves the best result in 10 out of the 14 classes. Our method surpasses the previous pseudolabelling method GraphXNet by $3.7\%$ and threshold based pseudo-labelling method [29] by $1.8\%$ . Our method also outperforms consistency-based methods MT [33] and SRC-MT [26] by more than $2\%$ . For method $\mathrm{S}^2\mathrm{MTS}^2$ [25] with self-supervised learning, our method can outperform it using an ImageNet pre-trained model, alleviating the need of a computationally expensive self-supervised pre-training. + +# 4.3. Skin Lesion Classification Result + +We show the results on ISIC2018 in Table 3, where competing methods are based on self-training [3], generative adversarial network (GAN) to augment the labelled set [11], temporal ensembling [21], MT [33] and its extension [26], and a DenseNet-121 [12] baseline trained with $20\%$ of the training set. Compared with consistency-based approaches [23,26,33], our method improves between $0.7\%$ and $3\%$ in AUC and around $1\%$ in F1 score. Our method also outperforms previous self-training approach [3] by a large margin in all measures. + +# 4.4. Ablation Study + +For the ablation study, we test each of our three contributions and visualize the data distribution of selected subset with high and low informative samples on the Chest X-Ray14 [39] with $2\%$ labelled training set, where for CDSI and ASP, we run each experiment three times and show the mean and standard deviation of the AUC results. + +Cross-distribution Sample Informativeness (CDSI). We first study in Table 4 how performance is affected by + +![](images/4dbf6d0e698df45072ec343ec61dfb2f2fe73af8b8f5ed1f2e378072f479941a.jpg) +Figure 4. (Left) Mean AUC testing results for different values for K in the KNN (for CDSI in (4) and pseudo-labelling in (5)), where the green region uses ASP and blue region does not use ASP. (Right) Mean size of $\mathcal{D}_L$ at every training stage when adding unlabelled samples of high, medium and low information content according to (2). Model is trained on Chest X-Ray14, where 2% of the training is labelled. + +![](images/c811897f05e983ba7915b5f6ee01fd419e9b8b406226ff5b5e459d8f6349d9aa.jpg) + +Table 4. Ablation study on Chest X-ray14 (2% labelled). Starting with a baseline classifier (DenseNet-121), we test the selection of unlabelled samples (to be provided with a pseudo-label) with different information content, according to (2) (i.e., low, medium, high), and the use of the anchor set purification (ASP) module. + +
Information ContentASPAUC ± std
Baseline65.84 ± 0.14
LowX67.18 ± 2.40
67.76 ± 1.05
MediumX70.83 ± 1.49
71.16 ± 0.51
HighX73.81 ± 0.75
74.44 ± 0.38
+ +pseudo-labelling unlabelled samples with different degrees of informativeness (low, medium and high) using our CDSI. Starting from the baseline classifier DenseNet-121 that reaches an AUC of $65\%$ , we observe that pseudolabelling low-information content unlabelled samples yields the worst result (around $67\%$ AUC) and selecting high-information content unlabelled samples produces the best result (around $73\%$ AUC). Figure 4 (right) plots how the size of the labelled set $\mathcal{D}_L$ during training depends on the degree of informativeness of the unlabelled samples to be pseudo-labelled. These results show that: 1) unlabelled samples of high-information content enables the construction of a smaller labelled set (compared with unlabelled samples of low- or medium-information content), allowing a more efficient training process that produces a more accurate KNN classifier; and 2) the standard deviation of the results in Table 4 are smaller when selecting the unlabelled samples of high-information content, compared with the low- or medium-information content. This second point can be explained by the class imbalance issue in Chest X-Ray14, where the selection of low-information content samples will enable the training of majority classes, possibly producing an ineffective training for the minority classes that can increase the variance in the results. + +Table 5. AUC testing set results on Chest X-ray14 (2% labelled) for different pseudo labelling strategies ( $\alpha$ denotes the linear coefficient combining the model and KNN predictions). + +
Pseudo-label StrategiesMethodsAUC
Baseline-65.84
Single PredictionModel prediction72.63
KNN prediction72.45
Mixuprandom sampled α73.23
MixUp [42]69.28
OursInformative Mixup74.44
+ +Anchor Set Purification (ASP). Also in Table 4, we compare ASP with an alternative method that selects all pseudolabelled samples to be included into the anchor set for the low-, medium- and high-information content unlabelled samples. Results show that the ASP module improves AUC between $0.3\%$ and $1.0\%$ and reduces standard deviation between $0.4\%$ and $1.4\%$ . This demonstrates empirically that the ASP module enables the formation of a more informative anchor set that improves the pseudolabelling accuracy, and consequently the final AUC results. Furthermore, in Figure 4 (left), ASP is shown to stabilise the performance of the method with respect to $K \in \{50, 100, 150, 200, 250, 300\}$ for the KNN classifier of (4). In particular, with ASP, the difference between the best and worst AUC results is around $1\%$ , while without ASP, the difference grows to $2\%$ . This can be explained by the fact that without ASP, the anchor set grows quickly with relatively less informative pseudo-labelled samples, which reduces the stability of the method. + +Informative Mixup (IM) In Table 5, we show that our proposed IM in (6) produces a more accurate pseudo-label, where we compare it with alternative pseudo-label methods, such as with only the model prediction, only the KNN prediction, random sample $\alpha$ from beta distribution to replace the density score in (6), and regular MixUp [42]. It is clear that the use of model or KNN predictions as pseudo labels does not work well most likely because of confirmation bias (former case) or the inaccuracy of the KNN classifier (latter case). MixUp [42] does not show good accuracy either, as also observed in [38] and [18], when MixUp is performed in multi-label images or multiple single-object images. The random sampling of $\alpha$ for replacing density score shows a better result than MixUp, but the lack of an image-based weight to balance the two predictions, like in (6), damages performance. Our proposed IM shows a result that is at least $1.5\%$ better than any of the other pseudo-labelling approaches, showing the importance of using the density of the unlabelled sample in the anchor set to weight the contribution of the model and KNN classifiers. + +The imbalanced learning mitigation is studied in Figure 5, which shows the histogram of label distribution in percentage (for a subset of four disease minority classes and the No + +![](images/3c79b476774b837f8ff5686f204e8fb9e3874f9a62316c28d2b3d807e29d1de1.jpg) +Figure 5. The selection of highly informative unlabelled samples (blue) promote a more balanced learning process, where the difference in the number of samples belonging to the minority or majority classes is smaller than if we selected unlabelled samples with low informativeness (yellow). Green shows the original data distribution]. Full 14-class distributions are shown in the supplementary material. + +Finding majority class) by selecting unlabelled samples of high (blue) and low (yellow) information content. We also show the original label distribution in green for reference. + +Notice that the selection of highly informative samples significantly increases the percentage of disease minority classes (from between $5\%$ and $10\%$ to almost $30\%$ ) and decreases the percentage of the No Finding majority class (from $60\%$ to $30\%$ ), creating a more balanced distribution of these five classes. This indicates that our informative sample selection can help to mitigate the issue of imbalanced learning. We include the full 14-classes histograms in the supplementary material. + +# 5. Discussion and Conclusion + +In this work, we introduced the anti-curriculum pseudolabelling (ACPL) SSL method. Unlike traditional pseudolabelling methods that use a threshold to select confidently classified samples, ACPL uses a new mechanism to select highly informative unlabelled samples for pseudo-labelling and an ensemble of classifiers to produce accurate pseudolabels. This enables ACPL to address MIA multi-class and multi-label imbalanced classification problems. We show in the experiments that ACPL outperforms previous consistency-based, pseudo-label based and self-supervised SSL methods in multi-label Chest X-ray14 and multi-class ISIC2018 benchmarks. We demonstrate in the ablation study the influence of each of our contributions and we also show how our new selection of informative samples addresses MIA imbalanced classification problems. For future work, it is conceivable that ACPL can be applied can be applied to more general computer vision problems, so we plan to test ACPL in traditional computer vision benchmarks. We would also explore semi-supervised classification with out-of-distribution (OOD) data in the initial labelled and unlabelled sets as our method currently assume all samples are in-distribution. + +# References + +[1] Eric Arazo, Diego Ortega, Paul Albert, Noel E O'Connor, and Kevin McGuinness. Pseudo-labeling and confirmation bias in deep semi-supervised learning. In 2020 International Joint Conference on Neural Networks (IJCNN), pages 1-8. IEEE, 2020. 2 +[2] Angelica I Aviles-Rivero, Nicolas Papadakis, Ruoteng Li, Philip Sellars, Qingnan Fan, Robby T Tan, and Carola-Bibiane Schonlieb. Graphxnet chest x-ray classification under extreme minimal supervision. arXiv preprint arXiv:1907.10085, 2019. 2, 3, 5, 6 +[3] Wenjia Bai, Ozan Oktay, Matthew Sinclair, Hideaki Suzuki, Martin Rajchl, Giacomo Tarroni, Ben Glocker, Andrew King, Paul M Matthews, and Daniel Rueckert. Semisupervised learning for network-based cardiac mr image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 253-260. Springer, 2017. 3, 7 +[4] Yoshua Bengio, Jerome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41-48, 2009. 3 +[5] David Berthelot, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, and Colin Raffel. Remix-match: Semi-supervised learning with distribution matching and augmentation anchoring. In International Conference on Learning Representations, 2019. 1, 2 +[6] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. Advances in Neural Information Processing Systems, 32:5049-5059, 2019. 1, 2 +[7] Paola Cascante-Bonilla et al. Curriculum labeling: Revisiting pseudo-labeling for semi-supervised learning. arXiv preprint arXiv:2001.06001, 2020. 2, 3 +[8] Noel Codella, Veronica Rotemberg, Philipp Tschandl, M Emre Celebi, Stephen Dusza, David Gutman, Brian Helba, Aadi Kalloo, Konstantinos Liopyris, Michael Marchetti, et al. Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the international skin imaging collaboration (isic). arXiv preprint arXiv:1902.03368, 2019. 2, 3, 5 +[9] Wenhui Cui, Yanlin Liu, Yuxing Li, Menghao Guo, Yiming Li, Xiuli Li, Tianle Wang, Xiangzhu Zeng, and Chuyang Ye. Semi-supervised brain lesion segmentation with an adapted mean teacher model. In International Conference on Information Processing in Medical Imaging, pages 554-565. Springer, 2019. 3 +[10] Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1):1-22, 1977. 4 +[11] Andres Diaz-Pinto, Adrián Colomer, Valery Naranjo, Sandra Morales, Yanwu Xu, and Alejandro F Frangi. Retinal image synthesis and semi-supervised learning for glaucoma assessment. IEEE transactions on medical imaging, 38(9):2211-2218, 2019. 7 + +[12] 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. 5, 6, 7 +[13] Jeremy Irvin, Pranav Rajpurkar, Michael Ko, Yifan Yu, Silviana Ciurea-Ilicus, Chris Chute, Henrik Marklund, Behzad Haghgoo, Robyn Ball, Katie Shpanskaya, et al. Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 590-597, 2019. 3 +[14] Angela H Jiang, Daniel L-K Wong, Giulio Zhou, David G Andersen, Jeffrey Dean, Gregory R Ganger, Gauri Joshi, Michael Kaminsky, Michael Kozuch, Zachary C Lipton, et al. Accelerating deep learning by focusing on the biggest losers. arXiv preprint arXiv:1910.00762, 2019. 3 +[15] Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander G Hauptmann. Self-paced curriculum learning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015. 3 +[16] Jeff Johnson et al. Billion-scale similarity search with gpus. arXiv preprint arXiv:1702.08734, 2017. 6 +[17] Kenji Kawaguchi and Haihao Lu. Ordered sgd: A new stochastic optimization framework for empirical risk minimization. In International Conference on Artificial Intelligence and Statistics, pages 669-679. PMLR, 2020. 3 +[18] Jang-Hyun Kim, Wonho Choo, Hosan Jeong, and Hyun Oh Song. Co-mixup: Saliency guided joint mixup with supermodular diversity. arXiv preprint arXiv:2102.03065, 2021. 8 +[19] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 5, 6 +[20] M Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. Advances in neural information processing systems, 23:1189-1197, 2010. 3 +[21] Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016. 2, 7 +[22] Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. 2013. 2 +[23] Xiaomeng Li, Lequan Yu, Hao Chen, Chi-Wing Fu, and Pheng-Ann Heng. Semi-supervised skin lesion segmentation via transformation consistent self-ensembling model. arXiv preprint arXiv:1808.03887, 2018. 3, 7 +[24] Geert Litjens, Thijs Kooi, Babak Ehteshami Bejnordi, Arnaud Arindra Adiyoso Setio, Francesco Ciompi, Mohsen Ghafoorian, Jeroen Awm Van Der Laak, Bram Van Ginneken, and Clara I Sánchez. A survey on deep learning in medical image analysis. Medical image analysis, 42:60-88, 2017. 1 +[25] Fengbei Liu, Yu Tian, Filipe R Cordeiro, Vasileios Belagiannis, Ian Reid, and Gustavo Carneiro. Self-supervised mean teacher for semi-supervised chest x-ray classification. arXiv preprint arXiv:2103.03629, 2021. 1, 2, 3, 6, 7 + +[26] Quande Liu et al. Semi-supervised medical image classification with relation-driven self-ensembling model. IEEE transactions on medical imaging, 39(11):3429-3440, 2020. 3, 5, 6, 7 +[27] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979–1993, 2018. 2 +[28] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019. 6 +[29] Mamshad Nayeem Rizve et al. In defense of pseudolabeling: An uncertainty-aware pseudo-label selection framework for semi-supervised learning. In International Conference on Learning Representations, 2020. 2, 3, 6, 7 +[30] Burr Settles. Active learning literature survey. 2009. 2 +[31] Weiwei Shi, Yihong Gong, Chris Ding, Zhiheng MaXiaoyu Tao, and Nanning Zheng. Transductive semi-supervised deep learning using min-max features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 299-315, 2018. 2 +[32] Kihyuk Sohn, David Berthelot, Nicholas Carlini, Zizhao Zhang, Han Zhang, Colin A Raffel, Ekin Dogus Cubuk, Alexey Kurakin, and Chun-Liang Li. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. Advances in Neural Information Processing Systems, 33, 2020. 1, 2 +[33] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. Advances in Neural Information Processing Systems, 30, 2017. 2, 6, 7 +[34] Yu Tian, Gabriel Maicas, Leonardo Zorron Cheng Tao Pu, Rajvinder Singh, Johan W Verjans, and Gustavo Carneiro. Few-shot anomaly detection for polyp frames from colonoscopy. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 274-284. Springer, 2020. 1 +[35] Yu Tian, Guansong Pang, Fengbei Liu, Seon Ho Shin, Johan W Verjans, Rajvinder Singh, Gustavo Carneiro, et al. Constrained contrastive distribution learning for unsupervised anomaly detection and localisation in medical images. MICCAI2021, 2021. 1 +[36] Philipp Tschandl, Cliff Rosendahl, and Harald Kittler. The ham10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Scientific data, 5(1):1-9, 2018. 1, 2, 3, 5 +[37] Balagopal Unnikrishnan, Cuong Manh Nguyen, Shafa Balaram, Chuan Sheng Foo, and Pavitra Krishnaswamy. + +Semi-supervised classification of diagnostic radiographs with noteacher: A teacher that is not mean. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 624-634. Springer, 2020. 3, 6 +[38] Qian Wang, Ning Jia, and Toby P Breckon. A baseline for multi-label image classification using an ensemble of deep convolutional neural networks. In 2019 IEEE International Conference on Image Processing (ICIP), pages 644-648. IEEE, 2019. 8 +[39] Xiaosong Wang, Yifan Peng, Le Lu, Zhiyong Lu, Mohammadhadi Bagheri, and Ronald M Summers. Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2097-2106, 2017. 1, 2, 3, 5, 6, 7 +[40] Xiaoxia Wu, Ethan Dyer, and Behnam Neyshabur. When do curricula work? In International Conference on Learning Representations, 2021. 3 +[41] Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves imagenet classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10687-10698, 2020. 2 +[42] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 4, 5, 8 \ No newline at end of file diff --git a/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/images.zip b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bafa32d55976da8a9275dd39eaadbaab3f31e1cc --- /dev/null +++ b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59cdeef901179f4d8a4285894bee732e522a74fdc9f03e3cb67fc7970970d7c9 +size 407213 diff --git a/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/layout.json b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..35e63851ce667c9133ecf03b8cc005c9708b9d9e --- /dev/null +++ b/acplanticurriculumpseudolabellingforsemisupervisedmedicalimageclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1200817c0a4ed2971c3ebd7af631b4acf6ee68f38fac69d81e9a983cce88e3e8 +size 424530 diff --git a/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_content_list.json b/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bc9c596c58c421d2e7f84ee3f229f2d094c58652 --- /dev/null +++ b/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8d69280ce20ee131a678072256fc2f520fb6eb7a546ccdbeb7f5da12cd707b1 +size 77710 diff --git a/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_model.json b/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9c72c49fffd7c06e7abb7983ab792a5f9d001951 --- /dev/null +++ b/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3568cef535b1d628040571bbc73c8bcd4b17ce1fc67b1677073c94436b2021c2 +size 98025 diff --git a/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_origin.pdf b/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..881644d665ff4304f46bd715f8082dfc91565e74 --- /dev/null +++ b/acquiringadynamiclightfieldthroughasingleshotcodedimage/16a63fb6-6ee6-4340-b18b-b692eed45d81_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66f9159c5065947d84ddb44fc6af15aae7964b01c6ebfbf2bdc4c948d9982073 +size 5270432 diff --git a/acquiringadynamiclightfieldthroughasingleshotcodedimage/full.md b/acquiringadynamiclightfieldthroughasingleshotcodedimage/full.md new file mode 100644 index 0000000000000000000000000000000000000000..37bbc7c2270c124e2b0fd22fca3fde59a542dcf9 --- /dev/null +++ b/acquiringadynamiclightfieldthroughasingleshotcodedimage/full.md @@ -0,0 +1,335 @@ +# Acquiring a Dynamic Light Field through a Single-Shot Coded Image + +Ryoya Mizuno†, Keita Takahashi†, Michitaka Yoshida‡, Chihiro Tsutake†, Toshiaki Fujii†, Hajime Nagahara‡ †Nagoya University, Japan, ‡Osaka University, Japan + +# Abstract + +We propose a method for compressively acquiring a dynamic light field (a 5-D volume) through a single-shot coded image (a 2-D measurement). We designed an imaging model that synchronously applies aperture coding and pixel-wise exposure coding within a single exposure time. This coding scheme enables us to effectively embed the original information into a single observed image. The observed image is then fed to a convolutional neural network (CNN) for light-field reconstruction, which is jointly trained with the camera-side coding patterns. We also developed a hardware prototype to capture a real 3-D scene moving over time. We succeeded in acquiring a dynamic light field with $5 \times 5$ viewpoints over 4 temporal sub-frames (100 views in total) from a single observed image. Repeating capture and reconstruction processes over time, we can acquire a dynamic light field at $4 \times$ the frame rate of the camera. To our knowledge, our method is the first to achieve a finer temporal resolution than the camera itself in compressive light-field acquisition. Our software is available from our project webpage. $^{1}$ + +# 1. Introduction + +A light field is represented as a set of multi-view images, where dozens of views are aligned on a 2-D grid with tiny viewpoint intervals. This representation contains rich visual information of a target scene and thus can be used for various applications such as 3-D display [14, 38], view synthesis [20,58], depth estimation [34,51], synthetic refocusing [13, 25], and object recognition [17, 45]. The scope of applications will further expand if the target scene is able to move over time. However, a light field varying over time, i.e., a dynamic light field, is challenging to acquire due to the huge data rate, which is proportional to both the number of views and frame rate. + +Several approaches to acquire light fields have been investigated as summarized in Fig. 1. The most straightforward approach is to construct an array of cameras [5,37,49], which requires bulky and costly hardware. The second ap + +![](images/357ee0d242a4f1a21dc20c743d6abb142d56fc2892312dfb71c997117d8d1182.jpg) +Figure 1. Our achievement compared with representative previous works (camera array [49], lens-array camera [24], coded-aperture camera [12], and coded exposure camera [54]). Axes are in relative scales w.r.t. camera's spatial resolution and frame rate. + +proach is to insert a micro-lens array in front of an image sensor [1, 2, 24, 25, 29, 46], which enables us to capture a light field in a single-shot image. However, the spatial resolution of each viewpoint image is sacrificed for the angular resolution (number of views). In the above two approaches, the frame rate of the acquired light field is at most equivalent to that of the cameras. Moreover, the data rate is not compressed because each light ray is sampled individually. + +The third approach aims to acquire a light field compressively by using a single camera equipped with a coded mask or aperture [3, 6, 7, 12, 16, 18, 22, 23, 39, 41, 43]. This kind of camera was used to obtain a small number of coded images, from which a light field with the full-sensor spatial resolution can be reconstructed. For static scenes, taking more images with different coding patterns is beneficial to achieve higher reconstruction quality. However, for moving scenes, the use of multiple coded images involves additional complexities related to scene motions. Hajisharif et al. [8] used a high dimensional light-field dictionary that spanned several temporal frames. However, their dictionary-based light-field reconstruction required a prohibitively long computation time. Sakai et al. [31] handled scene motions by alternating two coding patterns over time and by training their CNN-based algorithm on dynamic scenes. However, the light field was reconstructed only for every two temporal + +frames (at $0.5 \times$ the frame rate of the camera). + +In this paper, we advance the compressive approach several steps further to innovate the imaging method for a dynamic light field. As shown in Fig. 1, our method pursues the full-sensor spatial resolution and a faster frame rate than the camera itself. To this end, we design an imaging model that synchronously applies aperture coding [12, 16, 23] and pixel-wise exposure coding [9, 30, 48, 54] within a single exposure time. This coding scheme enables us to effectively embed the original information (a 5-D volume of a dynamic light field) into a single coded image (a 2-D measurement). The coded image is then fed to a CNN for light-field reconstruction, which is jointly trained with the camera-side coding patterns. We also develop a hardware prototype to capture real 3-D scenes moving over time. As a result, we succeeded in acquiring the dynamic light field with $5 \times 5$ viewpoints over 4 temporal sub-frames (100 views in total) from a single coded image. Repeating capture and reconstruction processes over time, we acquired a dynamic light field at $4 \times$ the frame rate of the camera. To our knowledge, our method is the first to achieve a finer temporal resolution than the camera itself in compressive light-field acquisition. + +# 2. Background + +# 2.1. Computational Photography + +In the literature of computational photography, aperture coding has been used to encode the viewpoint (angular) dimension of a light field [6, 12, 16, 23], while exposure coding has been adopted to encode fast temporal changes in a monocular video [9, 28, 30, 48, 54]. Our method combines them to encode both the viewpoint (angular) and temporal dimensions simultaneously. Our method is also considered as an extreme case of snapshot compressive imaging [44, 56, 57], where a higher dimensional (typically 3-D) data volume is compressed into a 2-D sensor measurement. + +We noticed that Vargas et al. [42] recently proposed an imaging architecture similar to ours for compressive light field acquisition. However, their method was designed for static light fields. Accordingly, their image formation model implicitly assumed that the target light field should be invariant during an exposure time (during the period when the time-varying coding patterns were applied), which is theoretically incompatible with moving scenes. Moreover, they did not report hardware implementation for the pixel-wise exposure coding. In contrast, our method is designed to handle motions during each exposure time, and it is fully implemented as a hardware prototype. + +We model the entire imaging pipeline (coded-image acquisition and light-field reconstruction) as a deep neural network, and jointly optimize the camera-side coding patterns and the reconstruction algorithm. This design aligns with the recent trend of deep optics [4,11,12,15,26,31,36,52,54] + +where optical elements and computational algorithms are jointly optimized under the framework of deep learning. However, our method is designed to handle higher dimensional data (dynamic light fields) than the previous works. + +# 2.2. Light-Field Reconstruction + +Reconstruction of a light field from a coded/compressed measurement is considered as an inverse problem, for which several classes of methods can be used. Traditional methods [3, 18, 19] formulated this problem as energy minimization with rather simple explicitly-defined prior terms and solved them using iterative algorithms. These methods often result in insufficient reconstruction quality and long computation time. Recently, deep-learning-based methods [7, 12, 22, 41, 47, 53] have gained more popularity due to the excellent representation capability of data-driven implicit priors. Trained on a suitable dataset, these methods can acquire the capability of high-quality reconstruction. Moreover, reconstruction (inference) on a pre-trained network does not require much computation time. Hybrid approaches have also been investigated. Algorithm unrolling methods [6, 21] unroll procedures of iterative algorithms into trainable networks, whereas plug-and-play methods [56, 57] use pre-trained network models as building blocks of iterative algorithms. + +We take a deep-learning-based approach and jointly optimize the entire process (coded-image acquisition and lightfield reconstruction) in the spirit of deep optics. For the reconstruction part, we use a rather plain network architecture to balance the reconstruction quality and the computational efficiency. Further improvement would be expected with more sophisticated and light-field specific network architectures [6, 53]. We leave this as future work, because the main focus of this paper is the design of the image acquisition process rather than the reconstruction network. + +In recent years, view synthesis from a single image [10, 27, 33, 35, 40, 50] has attracted much attention. In principle, 3-D reconstruction/ rendering from an ordinary monocular image (without coding) is an ill-posed problem; the results are hallucinated by using the implicit scene priors learned from the training dataset rather than the physical cues. In contrast, our method aims to recover the 3D and motion information that is embedded into a single image through the camera-side coding process. + +# 3. Proposed Method + +# 3.1. Notations and Problem Formulation + +A schematic diagram of the camera we assume is shown in Fig. 2. Each light ray coming into the camera is parameterized with five variables, $(u,v,x,y,t)$ , where $(u,v)$ and $(x,y)$ denote the intersections with the aperture and imaging planes, respectively, and $t$ denotes the time within a sin + +![](images/cc255d2a5ef66ded6b5db0cfd37ddd6d486e2980d62c8c286e88ffe4ca664e0f.jpg) +Figure 2. Example of dynamic light field (left) and schematic diagram of camera (right). + +gle exposure time of the camera. We discretize the variable space into a 5-D integer grid, where the range of each variable is described as $S_{\xi} = [0,N_{\xi})$ ( $\xi \in \{x,y,u,v,t\}$ ). By using these variables, the intensity of a light ray is described as $L_{x,y}(u,v,t)^2$ . Since $(u,v)$ is associated with the viewpoint (angle), $L_{x,y}(u,v,t)$ is equivalent to a set of multiview videos, i.e., a dynamic light field. + +Our aim is to acquire the latent dynamic light field $L_{x,y}(u,v,t)$ : a 5-D volume with $N_xN_yN_uN_vN_t$ unknowns, from a single coded image $I_{x,y}$ : a 2-D measurement with $N_{x}N_{y}$ observables. Hereafter, we assume $N_{u} = N_{v} = 5$ and $N_{t} = 4$ unless mentioned otherwise. + +# 3.2. Image Acquisition Model + +If the camera has no coding functionalities (in the case of an ordinary camera), the observed image is given by + +$$ +I _ {x, y} = \sum_ {(u, v, t) \in S _ {u} \times S _ {v} \times S _ {t}} L _ {x, y} (u, v, t). \tag {1} +$$ + +Each pixel value, $I_{x,y}$ , is the sum of light rays over the viewpoint $(u,v)$ and temporal $(t)$ dimensions. Therefore, the variation along $u,v,t$ dimensions is simply blurred out, making it difficult to recover. + +Meanwhile, we design an imaging method that can effectively preserve the original 5-D information. We exploit the combination of aperture coding and pixel-wise exposure coding that are synchronously varied within a single exposure time. The observed image is given as + +$$ +I _ {x, y} = \sum_ {(u, v, t) \in S _ {u} \times S _ {v} \times S _ {t}} a (u, v, t) p _ {x, y} (t) L _ {x, y} (u, v, t). \tag {2} +$$ + +where $a(u,v,t)\in [0,1]$ (semi-transparency) and $p_{x,y}(t)\in$ $\{0,1\}$ (on/off) are coding patterns applied on the aperture and pixel planes, respectively. This imaging process can be regarded as two-step coding as follows. First, a series of aperture coding patterns, $a(u,v,t)$ , is applied to + +![](images/d4df4c0cd2cfc4e8bf529382e6881833048d15a8f6cdc8a283be459e0f4ffd86.jpg) +Figure 3. Coding patterns applied on aperture and pixel planes. + +$L_{x,y}(u,v,t)$ over time, which reduces the original 5-D volume into a 3-D spatio-temporal tensor, $J_{x,y}(t)$ , as + +$$ +J _ {x, y} (t) = \sum_ {(u, v) \in S _ {u} \times S _ {v}} a (u, v, t) L _ {x, y} (u, v, t). \tag {3} +$$ + +Next, the 3-D tensor, $J_{x,y}(t)$ , is further reduced into a 2-D measurement, $I_{x,y}$ , through the pixel-wise exposure coding over time using $p_{x,y}(t)$ , as + +$$ +I _ {x, y} = \sum_ {t \in S _ {t}} p _ {x, y} (t) J _ {x, y} (t). \tag {4} +$$ + +By combining these two steps, we encode both the viewpoint $(u,v)$ and temporal $(t)$ dimensions and embed them into a single 2-D image. + +An example of the coding patterns is shown in Fig. 3. As mentioned later, these patterns are directly linked with the parameters of a CNN (AcqNet), which is jointly trained with another CNN for light-field reconstruction (RecNet). Therefore, these coding patterns are optimized for the training dataset so as to preserve as much of the light-field information as possible in the observed image. + +Figure 4 shows two images (close-ups of the same portion) obtained from a test scene through two imaging models: the ordinary camera (Eq. (1)) and ours (Eq. (2)). The ordinary camera obtains a simply blurred observation, while ours obtains a dappled image due to the coding patterns. To further analyze the effect of coding, we also used a primitive scene with a fronto-parallel plane (a primitive plane scene). As shown in Fig. 5, we prepared an image $G(x,y)$ with nine bright points as the texture for the plane. We then synthesized a dynamic light field using the parameters for the 2-D lateral velocity $(\alpha_{x},\alpha_{y})$ [pixels per unit time] and disparity $d$ [pixels per viewpoint] (corresponding to the depth) as + +$$ +L _ {x, y} (u, v, t) = G (x - d u - \alpha_ {x} t, y - d v - \alpha_ {y} t) \tag {5} +$$ + +from which we computed an observed image by using Eq. (2). Some resulting images obtained with different parameters are shown in Fig. 5 (the brightness is corrected for visualization). These images can be interpreted as point spreading functions (PSFs) for various motion and disparity values. Notably, these PSFs are distinct from each other. Moreover, even in a single image, the PSFs for the nine + +![](images/3ec1ba4ed2e5a6c26261399331e342de92df4e8cb596afcc939134f44356f973.jpg) + +![](images/5c91f53f4f97bd87ce9bce2207b5792c395b01d72ed160cf2b2c42430cd7a518.jpg) + +![](images/7934679940ae8e54e48a1a4f0acc2c805e23468a183bf4bddf1cb1a7a0b9fa9c.jpg) +Figure 4. Example images acquired by ordinary camera Eq. (1) (left) and our imaging model of Eq. (2) (right). +Figure 5. Our imaging model yields distinct PSFs for different motion and disparity values (coding patterns in Fig. 3 were used). + +points differ from each other. These results show that both motions and disparities, which are associated with changes along the temporal $(t)$ and viewpoint $(u,v)$ dimensions, respectively, are encoded by the various shapes of PSFs depending on the spatial coordinate $(x,y)$ . The encoded information is not human readable, but can be deciphered by the RecNet that is jointly trained with the coding patterns. + +# 3.3. Hardware Implementation + +We developed a prototype camera shown in Fig. 6 that can apply aperture coding and pixel-wise exposure coding within a single exposure time. + +We used a Nikon Rayfact (25 mm F1.4 SF2514MC) as the primary lens. The aperture coding was implemented using a liquid crystal on silicon (LCoS) display (Forth Dimension Displays, SXGA-3DM), which had $1280 \times 1024$ pixels. We divided the central area of the LCoS display into $5 \times 5$ regions, each with $150 \times 150$ pixels. Accordingly, the angular resolution of the light field was set to $5 \times 5$ . The pixel-wise exposure coding was implemented using a row-column-wise exposure sensor [54] that had $656 \times 512$ pixels. We synchronized the LCoS display with the image sensor via an external circuit, so that four sets of coding patterns were synchronously applied within a single exposure time. The timing chart is shown in Fig. 7. The time duration assigned for each coding pattern was set to $17~\mathrm{ms}$ . + +![](images/74dca1a33cd9d851e9a3b8d304997538952ac6e46b111934e127d3cc26b28ca6.jpg) +Figure 6. Our camera prototype (left) and optical diagram (right). + +![](images/18f942858ab4a1b8f8eb068a2d452cb538913a39cdae91bd5dabaa02a07b1138.jpg) + +![](images/88d8d6470342add100ea9ab99e402cd3b0a89e93fabe15096e8de4869ec6a9a1.jpg) +Figure 7. Time chart of our camera. Exposure timing is different for four vertically divided regions on image sensor. + +Accordingly, the unit time for the target light field was also 17 ms (58.8 fps). Meanwhile, a single exposure time of the camera ranged over the 4 time units (temporal sub-frames), and thus, the interval between the two exposed images was 68 ms (14.7 fps in terms of the camera's frame rate). + +We mention several restrictions resulting from the image sensor's hardware. First, the sensor was not equipped with RGB filters and was thus incapable of obtaining color information. Second, the coding patterns were not freely designable, because they were generated by the column-wise and row-wise control signals repeating for every $8 \times 8$ pixels. Therefore, the applicable coding patterns were limited to binary, $8 \times 8$ -pixels periodic, and row-column separable ones. This restriction was considered in our network design as mentioned later. Finally, due to the timing of the vertical scan, the time duration covered by a single exposed image depended on the vertical position. More precisely, as shown in Fig. 7, the image sensor was vertically divided into 4 regions, each of which had a distinctive exposure timing with $17~\mathrm{ms}$ differences from the neighbors. Accordingly, these regions were modulated by the same four sets of coding patterns but in different orders. To accommodate these differences, we used a single instance for AcqNet, but permuted the order of time units in the input light field for the 4 regions, respectively. We prepared 4 instances of RecNet corresponding to the 4 regions and jointly trained them with the coding patterns. This extension required four regionwise reconstruction processes conducted in parallel, but still maintained $\times 4$ finer temporal resolution than the camera. + +![](images/bae79460aa28238fb9f05d936008d45f734bc4021777bfe62999b377f14f85ed.jpg) +Figure 8. Our network architecture consists of AcqNet and RecNet, which correspond to coded image acquisition and light-field reconstruction processes, respectively. Dynamic light-field ranging over four temporal units is processed at once. + +# 3.4. Network Design and Training + +As shown in Fig. 8, our method was implemented as a fully convolutional network, consisting of AcqNet and RecNet. AcqNet is a differentiable representation of the image formation model with trainable coding patterns, where a target light field is compressed into a single observed image. RecNet was designed to receive the observed image as input and reconstruct the original light field. The entire network was trained end-to-end using the squared error against the ground-truth light field as the loss function. By doing so, the image acquisition and light-field reconstruction processes were jointly optimized. When a real camera was used, the coding patterns for the camera were tuned in accordance with the trained parameters of AcqNet. Then, image acquisition was conducted physically on the imaging hardware, and only the reconstruction (inference on RecNet) was performed on the computer. + +AcqNet takes as input a dynamic light field over 4 consecutive time units, which has $N_{x} \times N_{y}$ pixels and $5 \times 5$ viewpoints over 4 time units. The viewpoint dimensions are unfolded into a single channel, resulting in 4 input tensors with the shape of $25 \times N_{x} \times N_{y}$ . The first block of AcqNet corresponds to the aperture coding (Eq. (3)). To implement this process, we followed Inagaki et al. [12]; we used 2-D convolutional layers with $1 \times 1$ kernels and no biases, where each kernel weight corresponds to the apertures' transmittance for each viewpoint. We prepared 4 separate convolutional layers for the 4 time units, in each of which 25 channels were reduced into a single channel. The outputs from these layers are stacked along the channel dimension, resulting in a tensor of $4 \times N_{x} \times N_{y}$ . The second block corresponds to the pixel-wise exposure coding (Eq. (4)), where $8 \times 8$ repetitive patterns are applied. For this process, we prepared 64 separate convolutional layers $(1 \times 1$ kernels without biases), each of which takes a tensor of $4 \times N_{x} / 8 \times N_{y} / 8$ as input (every $8 \times 8$ pixels extracted + +from the tensor of $4 \times N_x \times N_y$ and reduces 4 channels into a single channel. To constrain the coding patterns to be hardware implementable (binary and row-column separable), we used the same training technique as Yoshida et al. [55] (see section 4.1 in [55]). The outputs from these layers are stacked along the channel dimension, resulting in a tensor of $64 \times N_x / 8 \times N_y / 8$ , which is equivalent to a single observed image with $N_x \times N_y$ pixels. Finally, to account for noise during the acquisition process, Gaussian noise (zero-mean and $\sigma = 0.005$ w.r.t. the range of pixel values [0, 1]) is added to the observed image. + +RecNet accepts an output from AcqNet (or an image acquired from a real camera) as a tensor of $64 \times N_x / 8 \times N_y / 8$ . The first 5 convolutional layers gradually increase the number of channels to 256, while keeping the spatial size unchanged. Then, the tensor is reshaped into $4 \times N_x \times N_y$ using a pixel shuffling operation [32]. The subsequent two convolutional layers increase the number of channels to 100, followed by 19 convolutional layers and a residual connection for refinement. The output from RecNet is the latent dynamic light field represented as a tensor of $100 \times N_x \times N_y$ , where 100 channels correspond to $5 \times 5$ views over 4 time units (temporal sub-frames). As mentioned in 3.3, four instances of RecNet should be used in parallel to handle the time differences among the four vertical regions. + +We finally mention the training dataset. We first collected 223,020 light-field patches from 51 static light fields with intensity augmentation. Next, following Sakai et al. [31], we gave 2-D lateral motions (in-plane translations) to the collected patches to synthesize virtually-moving lightfield samples. We used linear motions with constant velocities: $(\alpha_{x},\alpha_{y})$ [pixels per unit time], where $\alpha_{x},\alpha_{y}\in \{-2,1,0,1,2\}$ ; this is equivalent to at most $\pm 8$ pixel translation per frame in terms of the camera's frame rate. This motion model was simple and limited, but it would be sufficient for the motions within a single exposure time, which is short enough. We had 25 motion patterns in total, all + +of which were applied to each light-field patch. To sum up, we had 5,575,500 samples of dynamic light fields, each with $64 \times 64$ pixels at $5 \times 5$ viewpoints over 4 time units. Note that even a single training sample had a significant size (409,600 elements), which necessitated the network to be lightweight. + +We implemented our software using PyTorch. The network was trained over five epochs using the Adam optimizer. The training took approximately seven days on a PC equipped with NVIDIA Geforce RTX 3090. We also trained our model with $8 \times 8$ views and different ranges for the assumed motions $(\alpha_{x}, \alpha_{y})$ . Please refer to the supplementary material for details. + +# 4. Experiments + +We conducted several quantitative evaluations using a computer generated scene and experiments using our prototype camera. To summarize, we succeeded in acquiring a dynamic light field with $4 \times$ finer temporal resolution than the camera itself. Note that there is no baseline to compete against, because to our knowledge, no prior works have ever achieved the same goal as ours. Please refer to the supplementary video for better visualization of our results. + +# 4.1.Quantitative Evaluation + +Ablation study for the coding method. To validate our image acquisition model in Eq. (2), we need to analyze the effect of coding on the aperture $(a(u,v,t))$ and pixel $(p_{x,y}(t))$ planes. In addition to our original method (denoted as $\mathbf{A} + \mathbf{P}$ ), we trained three variants of our methods as follows. Ordinary: no coding was applied $(a(u,v,t) = \mathrm{const}, p_{x,y}(t) = \mathrm{const})$ , which corresponded to light-field reconstruction from a single uncoded image. A-only: only the aperture coding was enabled $(p_{x,y}(t) = \mathrm{const})$ . P-only: only the pixel-wise exposure coding was enabled $(a(u,v,t) = \mathrm{const})$ . Furthermore, to evaluate the theoretical upper-bound, we also prepared a free-form coding over the 5-D space (denoted as Free5D), given by: + +$$ +I _ {x, y} = \sum_ {(u, v, t) \in S _ {u} \times S _ {v} \times S _ {t}} m (x, y, u, v, t) L _ {x, y} (u, v, t) \tag {6} +$$ + +where $m(x,y,u,v,t) \in [0,1]$ was a fully trainable modulating pattern periodic over $8 \times 8$ pixels. Note that this is only a software simulation; no hardware realization is available. The five methods mentioned so far were different in the imaging models but aimed for the same goal: reconstructing a dynamic light field (5×5 views over 4 time units) from a single observed image. For all the methods, RecNets with the same network structure were jointly trained with the respective coding patterns on the same training dataset for the same number of epochs. + +For quantitative evaluation, we used a computer generated light field with $5 \times 5$ viewpoints over 200 temporal + +frames, which was rendered from Planets scene provided by Sakai et al. [31].3 Figure 9 visualizes several reconstructed views (at the top-left viewpoint), horizontal epipolar plane images (EPIs) along the green lines, and the differences from the ground truth ( $\times$ 3 pixel values). The average peak signal-to-noise ratio (PSNR) values over the 25 viewpoints are plotted along the temporal frames in Fig. 10. + +As observed from these results, our method clearly outperformed the other variants and even achieved quality close to the ideal Free5D case. Meanwhile, A-only and P-only resulted in poor reconstruction quality, showing their insufficiency as coding methods. Moreover, the poor result from Ordinary case indicated that although implicit scene priors were learned from the training dataset, they alone were insufficient for high-quality reconstruction. In contrast, the success of our method can be attributed to the elaborated coding method that was simultaneously applied on the aperture and imaging planes, which helped effectively embed the original 5-D information into a single observed image. However, the reconstruction quality of our method exhibited small fluctuations over time. This was closely related to the fact that four time units (temporal frames) were processed as a group. Moreover, our method did not include mechanisms that could explicitly encourage the temporal consistency, which will be addressed in the future work. + +Working range analysis. We also evaluated the effective working range against motion and disparity using a primitive plane scene. Following Eq. (5), we synthesized a dynamic light field over four time units by using a natural image in Fig. 11 (left) as the texture. The average PSNR values obtained with our method $(\mathrm{A} + \mathrm{P})$ and the three variants (A-only, P-only, and Ordinary) are shown in Fig. 11 (right). Obviously, our method $(\mathrm{A} + \mathrm{P})$ can cover a wider range of motion/disparity values than the others; P-only performed poorly for $d \neq 0$ ; A-only and Ordinary did not work well except for $d = \alpha_{x} = 0$ . + +In our method (A+P), the reconstruction quality degraded gradually as the velocity and disparity values increased. This means that large motions/disparities are challenging for our method. The working range for the disparity was mainly determined by the 3-D scene structures contained in the original light-field dataset, while the working range for the velocity was related to the virtual motions we assumed when synthesizing the dynamic dataset from static light fields. Note that our imaging system has densely-located viewpoints (bounded by the aperture) and a high temporal resolution ( $4 \times$ the frame-rate of the camera); therefore, both the motion and disparity are usually limited within a small range. + +Comparison with other methods. We finally compared our method against three other methods. The first two methods [6, 31] were based on coded-aperture imaging. From + +![](images/df8745ff8d663a3dedcf5b3bb45d217d866d9ced76404bb7290648d18ffce193.jpg) +Ground truth (50-th frame) + +![](images/4ed143c46cb8d6db30c0f75d97f5660357be37c11e87de5faef0ff4db28a375f.jpg) + +![](images/9ab8d782fbec12f61798b575c95f84384c4d6c5402ceee12caf9d1fd9bcb7ae3.jpg) +A+P (ours) + +![](images/595938322433f919009babf5f4cfbb667f7a7d1631d102d4b07fa7e707c825ad.jpg) + +![](images/f9d25f0df1db1d5818618bae8df639e5feebeaf0ae2a8394315b7a483c6f641c.jpg) +Free5D + +![](images/cba13365c8890557a270de3d57cda4871d4dae4c594b58132c3f616a977f2381.jpg) + +![](images/2849223f20caf4794472d6a9aca7ce0128accb5ebbe8bc22b015b866132597d9.jpg) + +![](images/c41ebc81fcb3e5b6ce9112f19f19c7f3fefe7d8baeee747bf49dcdb0af5406f4.jpg) + +![](images/0a9888b3a215a48136c3e18f48696a8415b8a93c93180bba18c55e30772d4858.jpg) +P-only + +![](images/3dfce96e5c9008ab92d3b0c6595b7ed94250d1e278790b0f26a9dd9dfc504dd7.jpg) + +![](images/743c0e54b0ebc8ed507b3c62edb166a10f7fcebdb74386b6b9c17b5b616e2559.jpg) +Ordinary + +![](images/166d5c66617354237607ae66f976bc82533e3e855fe5c62ae6e77fe510d11820.jpg) +Ground truth (100-th frame) + +![](images/3261e7df008490248bbd669574f9276244a1b144bb032bf12a70cee46537f19b.jpg) + +![](images/960abdcce90a15ca4d9acf67c82698074033c2e6bcacf4389fd2a35de33de73d.jpg) +A+P (ours) + +![](images/e7bcd96ee7ae0780c0c87ac54bd466d92101feb2aa0930e818467f2ccafef9bb.jpg) + +![](images/1335a292f2ce8dac4868bd46298c05a89c6db70c37e0ff1718b61bb1f3e3c1ea.jpg) +Free5D + +![](images/5054cf0af6aa7c22d6e55cc4990199a127f64d325a6964ab079de20ad8aa96b4.jpg) +A-only + +![](images/9e2987b8066bb899141d8495fae1833c7fefff8d4921e474310dcc2401aa1a87.jpg) +A-only + +![](images/1aa3f089fe646947bc4e8e6a99b063fc253667bf74b9521260f3e68ca4f4eb7b.jpg) + +![](images/94b4ad983ac525495b616375c3cfd31d6359594f602eb2e3d05c4735e70be89d.jpg) +P-only + +![](images/704e655df40814218e2ff2bb9193a8c163dab331262edab33a0378f2fc07ec19.jpg) + +![](images/4a2fffcf88d6d9a0065fbb987c81b7d483a2a66b399f2ba291856c92d1ac9e43.jpg) +Ordinary + +![](images/0ef1213b4c11656c4cf285a281ca7f472cad052f780cf8df1e1e346a1e332a65.jpg) +Figure 9. Visual results of our method (A+P), Free5D (ideal case), and three ablation cases (A-only, P-only, and Ordinary). Reconstructed top-left views are accompanied with horizontal EPIs along green lines and differences from ground truth ( $\times$ 3 brightness). +Figure 10. Quantitative reconstruction quality over time for our method (A+P), Free5D (ideal case), and three ablation cases (A-only, P-only, and Ordinary). + +Guo et al. [6], we adopted a model where a light field for each time unit was reconstructed from a single observed image, which resulted in frame-by-frame observation and light-field reconstruction at the same frame rate as the camera. The method of Sakai et al. [31] observed three consecutive images over time, and reconstructed a light field for the central time. The light field was reconstructed for every two + +frames (at $0.5 \times$ the frame rate) of the camera. We retrained Guo et al.'s and Sakai et al.'s on the same dataset as ours until convergence. In addition, we simulated a Lytro-like camera, where each of the $5 \times 5$ views was captured with the $1/5 \times 1/5$ spatial resolution at the same frame rate as the camera. The acquired $5 \times 5$ views were upsampled to the original resolution using bicubic interpolation and compared against the ground truth. + +For quantitative evaluation, we used Planets assuming the camera's frame rate to be the same as ours; accordingly, in these three methods, image acquisition was conducted only at every four temporal frames. Note that only our method can obtain the light field at $4\times$ the frame rate of the camera, and thus, this comparison only serves as a reference. The average PSNR values over time are shown in Fig. 12. The method of Sakai et al. [31] failed to follow the fast scene motions, resulting in poor reconstruction quality. The method of Guo et al. [6] reconstructed a finely textured but geometrically inconsistent result, whereas the Lytro-like camera produced a geometrically consistent but blurred result. Our method achieved the best reconstruction quality with $\times 4$ finer temporal resolution than the camera. + +Please refer to the supplementary material for more detailed analysis with different training conditions. + +![](images/c847d051d203d93aaea4106f02fe14bb934a305eb45e8ae47f083756607d998f.jpg) +Figure 11. Performance evaluation against various motion and disparity values on primitive plane scene. + +![](images/8b837d9b3534175dabb8ef881aa3f188a7a7f2c017765343c5d9ff4b4804217a.jpg) +Figure 12. Quantitative quality over time compared against other methods (Guo et al. [6], Sakai et al. [31], and Lytro-like camera). + +![](images/3a099aab62ff644942fd869171beaa34e4131625ef42eda40d3981b20a2c862d.jpg) +Experimental setup + +![](images/e1f0b30d1a56090e50b89dd6d6287d378ee20a0cb038d3f84a178addec889a4d.jpg) +Reconstructed light field +Figure 13. Experiment using our prototype camera: experimental setup (left) and reconstructed top-left view accompanied by two EPIs along green and blue lines (center), and reconstructed light field with $5 \times 5$ views (right). + +# 4.2. Experiment Using Camera Prototype + +We prepared a target scene by using several objects (miniature animals) placed on an electronic turntable, which produced motions in various directions. Our prototype camera was used to capture the scene at 14.7 fps, from which we reconstructed the dynamic light field at 58.8 fps (4 temporal frames from each exposed image). The reconstructed light field had $5 \times 5$ views, each with the full-sensor resolution $(656 \times 512$ pixels) for each time unit. Our experimental setup and a part of the results are shown in Fig. 13. The reconstructed light field exhibited natural motions over time and consistent parallaxes among the viewpoints (refer to the supplementary video). + +# 5. Conclusions + +We proposed a method for compressively acquiring a dynamic light field (a 5-D volume) through a single-shot coded image (a 2-D measurement). Our method was embodied as a camera that synchronously applied aperture + +coding and pixel-wise exposure coding within a single exposure time, combined with a deep-learning-based algorithm for light-field reconstruction. The coding patterns were jointly optimized with the reconstruction algorithm, so as to embed as much of the original information as possible in a single observed image. Experimental results showed that by using a single camera alone, our method can successfully acquire a dynamic light field with $5 \times 5$ views at $4 \times$ the frame rate of the camera. We believe this is a significant advance in the context of compressive light-field acquisition, which will motivate the computational photography community to investigate further. Our future work will include improvement on the network design for better reconstruction quality and generalization to different configurations concerning the number of views and the number of time units included in a single exposure time. + +Acknowledgement: Special thanks go to Yukinobu Sugiyama and Kenta Endo at Hamamatsu Photonics K.K. for providing the image sensor. + +# References + +[1] Edward H Adelson and John YA Wang. Single lens stereo with a plenoptic camera. IEEE transactions on pattern analysis and machine intelligence, 14(2):99-106, 1992. 1 +[2] Jun Arai, Fumio Okano, Haruo Hoshino, and Ichiro Yuyama. Gradient-index lens-array method based on real-time integral photography for three-dimensional images. Applied optics, 37(11):2034-2045, 1998. 1 +[3] S. Derin Babacan, Reto Ansorge, Martin Luessi, Pablo Ruiz Mataran, Rafael Molina, and Aggelos K Katsaggelos. Compressive light field sensing. IEEE Transactions on image processing, 21(12):4746-4757, 2012. 1, 2 +[4] Ayan Chakrabarti. Learning sensor multiplexing design through back-propagation. In International Conference on Neural Information Processing Systems, pages 3089-3097, 2016. 2 +[5] Toshiaki Fujii, Kensaku Mori, Kazuya Takeda, Kenji Mase, Masayuki Tanimoto, and Yasuhito Suenaga. Multipoint measuring system for video and sound - 100-camera and microphone system. In IEEE International Conference on Multimedia and Expo, pages 437-440, 2006. 1 +[6] Mantang Guo, Junhui Hou, Jing Jin, Jie Chen, and Lap-Pui Chau. Deep spatial-angular regularization for compressive light field reconstruction over coded apertures. In European Conference on Computer Vision, pages 278-294, 2020. 1, 2, 6, 7, 8 +[7] Mayank Gupta, Arjun Jauhari, Kuldeep Kulkarni, Suren Jayasuriya, Alyosha Molnar, and Pavan Turaga. Compressive light field reconstructions using deep learning. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 1277-1286, 2017. 1, 2 +[8] Saghi Hajisharif, Ehsan Miandji, Christine Guillemot, and Jonas Unger. Single sensor compressive light field video camera. Computer Graphics Forum, 39(2):463-474, 2020. 1 +[9] Yasunobu Hitomi, Jinwei Gu, Mohit Gupta, Tomoo Mitsunaga, and Shree K. Nayar. Video from a single coded exposure photograph using a learned over-complete dictionary. In International Conference on Computer Vision, pages 287-294, 2011. 2 +[10] Ronghang Hu, Nikhila Ravi, Alexander C. Berg, and Deepak Pathak. Worldsheet: Wrapping the world in a 3D sheet for view synthesis from a single image. In International Conference on Computer Vision, 2021. 2 +[11] Michael Iliadis, Leonidas Spinoulas, and Aggelos K. Katsaggelos. Deepbinarymask: Learning a binary mask for video compressive sensing, 2016. 2 +[12] Yasutaka Inagaki, Yuto Kobayashi, Keita Takahashi, Toshiaki Fujii, and Hajime Nagahara. Learning to capture light fields through a coded aperture camera. In European Conference on Computer Vision, pages 418-434, 2018. 1, 2, 5 +[13] Aaron Isaksen, Leonard McMillan, and Steven J. Gortler. Dynamically reparameterized light fields. In ACM SIGGRAPH, pages 297-306, 2000. 1 +[14] Seungjae Lee, Changwon Jang, Seokil Moon, Jaebum Cho, and Byoungho Lee. Additive light field displays: realiza + +tion of augmented reality with holographic optical elements. ACM Transactions on Graphics, 35(4):1-13, 2016. 1 +[15] Yuqi Li, Miao Qi, Rahul Gulve, Mian Wei, Roman Genov, Kiriakos N. Kutulakos, and Wolfgang Heidrich. End-to-end video compressive sensing using anderson-accelerated unrolled networks. In International Conference on Computational Photography, pages 137-148, 2020. 2 +[16] Chia-Kai Liang, Tai-Hsu Lin, Bing-Yi Wong, Chi Liu, and Homer H Chen. Programmable aperture photography: multiplexed light field acquisition. ACM Transactions on Graphics, 27(3):1-10, 2008. 1, 2 +[17] Kazuki Maeno, Hajime Nagahara, Atsushi Shimada, and Rin-Ichiro Taniguchi. Light field distortion feature for transparent object recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2786-2793, 2013. 1 +[18] Kshitij Marwah, Gordon Wetzstein, Yosuke Bando, and Ramesh Raskar. Compressive light field photography using overcomplete dictionaries and optimized projections. ACM Transactions on Graphics, 32(4):1-12, 2013. 1, 2 +[19] Ehsan Miandji, Saghi Hajisharif, and Jonas Unger. A unified framework for compression and compressed sensing of light fields and light field videos. ACM Transactions on Graphics, 38(3):1-18, 2019. 2 +[20] Ben Mildenhall, Pratul P. Srinivasan, Rodrigo Ortiz-Cayon, Nima Khademi Kalantari, Ravi Ramamoorthi, Ren Ng, and Abhishek Kar. Local light field fusion: Practical view synthesis with prescriptive sampling guidelines. ACM Transactions on Graphics, 38:1-14, 2019. 1 +[21] Vishal Monga, Yuelong Li, and Yonina C. Eldar. Algorithm unrolling: Interpretable, efficient deep learning for signal and image processing. IEEE Signal Processing Magazine, 38(2):18-44, 2021. 2 +[22] Ofir Nabati, David Mendlovic, and Raja Giryes. Fast and accurate reconstruction of compressed color light field. In International Conference on Computational Photography, pages 1-11, 2018. 1, 2 +[23] Hajime Nagahara, Changyin Zhou, Takuya Watanabe, Hiroshi Ishiguro, and Shree K Nayar. Programmable aperture camera using LCoS. In European Conference on Computer Vision, pages 337-350, 2010. 1, 2 +[24] Ren Ng. Digital light field photography. PhD thesis, Stanford University, 2006. 1 +[25] Ren Ng, Marc Levoy, Mathieu Brédif, Gene Duval, Mark Horowitz, and Pat Hanrahan. Light field photography with a hand-held plenoptic camera. Computer Science Technical Report CSTR, 2(11):1-11, 2005. 1 +[26] Shijie Nie, Lin Gu, Yinqiang Zheng, Antony Lam, Nobutaka Ono, and Imari Sato. Deeply learned filter response functions for hyperspectral reconstruction. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4767-4776, 2018. 2 +[27] Simon Niklaus, Long Mai, Jimei Yang, and Feng Liu. 3D ken burns effect from a single image. ACM Transactions on Graphics, 38(6):1-15, 2019. 2 +[28] Ramesh Raskar, Amit Agrawal, and Jack Tumblin. Coded exposure photography: Motion deblurring using fluttered shutter. ACM Transactions on Graphics, 25(3):795-804, 2006. 2 + +[29] Raytrix:. 3D light field camera technology, 2021. https://www.raytrix.de/.1 +[30] Dikpal Reddy, Ashok Veeraraghavan, and Rama Chellappa. P2C2: Programmable pixel compressive camera for high speed imaging. In IEEE Conference on Computer Vision and Pattern Recognition, pages 329-336, 2011. 2 +[31] Kohei Sakai, Keita Takahashi, Toshiaki Fujii, and Hajime Nagahara. Acquiring dynamic light fields through coded aperture camera. In European Conference on Computer Vision, pages 368-385, 2020. 1, 2, 5, 6, 7, 8 +[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 IEEE Conference on Computer Vision and Pattern Recognition, pages 1874-1883, 2016. 5 +[33] Meng-Li Shih, Shih-Yang Su, Johannes Kopf, and Jia-Bin Huang. 3D photography using context-aware layered depth inpainting. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. 2 +[34] Changha Shin, Hae-Gon Jeon, Youngjin Yoon, In So Kweon, and Seon Joo Kim. EPINET: A fully-convolutional neural network using epipolar geometry for depth from light field images. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4748–4757, 2018. 1 +[35] Pratul P. Srinivasan, Tongzhou Wang, Ashwin Sreelal, Ravi Ramamoorthi, and Ren Ng. Learning to synthesize a 4D RGBD light field from a single image. In IEEE International Conference on Computer Vision, pages 2262-2270, 2017. 2 +[36] He Sun, Adrian V. Dalca, and Katherine L. Bouman. Learning a probabilistic strategy for computational imaging sensor selection. In International Conference on Computational Photography, pages 81–92, 2020. 2 +[37] Yuichi Taguchi, Takafumi Koike, Keita Takahashi, and Takeshi Naemura. TransCAIP: A live 3D TV system using a camera array and an integral photography display with interactive control of viewing parameters. IEEE Transactions on Visualization and Computer Graphics, 15(5):841-852, 2009. 1 +[38] Keita Takahashi, Yuto Kobayashi, and Toshiaki Fujii. From focal stack to tensor light-field display. IEEE Transactions on Image Processing, 27(9):4571-4584, 2018. 1 +[39] Salil Tambe, Ashok Veeraraghavan, and Amit Agrawal. Towards motion aware light field video for dynamic scenes. In IEEE International Conference on Computer Vision, pages 1009-1016, 2013. 1 +[40] Richard Tucker and Noah Snavely. Single-view view synthesis with multiplane images. In IEEE Conference on Computer Vision and Pattern Recognition, 2020. 2 +[41] Anil Kumar Vadathya, Sharath Girish, and Kaushik Mitra. A unified learning based framework for light field reconstruction from coded projections. IEEE Transactions on Computational Imaging, 6:304-316, 2019. 1, 2 +[42] Edwin Vargas, Julien N. P. Martel, Gordon Wetzstein, and Henry Arguello. Time-multiplexed coded aperture imaging: Learned coded aperture and pixel exposures for compressive imaging systems. In International Conference on Computer Vision, 2021. 2 + +[43] Ashok Veeraraghavan, Ramesh Raskar, Amit Agrawal, Ankit Mohan, and Jack Tumblin. Dappled photography: Mask enhanced cameras for heterodyned light fields and coded aperture refocusing. ACM Transactions on Graphics, 26(3):69, 2007. 1 +[44] Ashwin Wagadarikar, Renu John, Rebecca Willett, and David Brady. Single disperser design for coded aperture snapshot spectral imaging. Appl. Opt., 47(10):B44-B51, 2008. 2 +[45] Ting-Chun Wang, Jun-Yan Zhu, Ebi Hiroaki, Manmohan Chandraker, Alexei Efros, and Ravi Ramamoorthi. A 4D light-field dataset and cnn architectures for material recognition. In European Conference on Computer Vision, volume 9907, pages 121-138, 2016. 1 +[46] Ting-Chun Wang, Jun-Yan Zhu, Nima Khademi Kalantari, Alexei A. Efros, and Ravi Ramamoorthi. Light field video capture using a learning-based hybrid imaging system. ACM Transactions on Graphics, 36(4):133:1-133:13, 2017. 1 +[47] Yunlong Wang, Fei Liu, Zilei Wang, Guangqi Hou, Zhenan Sun, and Tieniu Tan. End-to-end view synthesis for light field imaging with pseudo 4DCNN. In European Conference on Computer Vision, 2018. 2 +[48] Mian Wei, Navid Sarhangnejad, Zhengfan Xia, Nikita Gusev, Nikola Katic, Roman Genov, and Kiriakos N. Kutulakos. Coded two-bucket cameras for computer vision. In European Conference on Computer Vision, pages 55-73, 2018. 2 +[49] Bennett Wilburn, Neel Joshi, Vaibhav Vaish, Eino-Ville Talvala, Emilio Antunez, Adam Barth, Andrew Adams, Mark Horowitz, and Marc Levoy. High performance imaging using large camera arrays. ACM Transactions on Graphics, 24(3):765-776, 2005. 1 +[50] Olivia Wiles, Georgia Gkioxari, Richard Szeliski, and Justin Johnson. Synsin: End-to-end view synthesis from a single image. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. 2 +[51] W. Williem, In Kyu Park, and Kyoung Mu Lee. Robust light field depth estimation using occlusion-noise aware data costs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(10):2484-2497, 2018. 1 +[52] Yicheng Wu, Vivek Boominathan, Huaijin Chen, Aswin Sankaranarayanan, and Ashok Veeraraghavan. Phasecam3D — learning phase masks for passive single view depth estimation. In International Conference on Computational Photography, pages 1–12, 2019. 2 +[53] Henry Wing Fung Yeung, Junhui Hou, Xiaoming Chen, Jie Chen, Zhibo Chen, and Yuk Ying Chung. Light field spatial super-resolution using deep efficient spatial-angular separable convolution. IEEE Transactions on Image Processing, 28(5):2319-2330, 2019. 2 +[54] Michitaka Yoshida, Toshiki Sonoda, Hajime Nagahara, Kenta Endo, Yukinobu Sugiyama, and Rin-ichiro Taniguchi. High-speed imaging using CMOS image sensor with quasi pixel-wise exposure. IEEE Transactions on Computational Imaging, 6:463–476, 2020. 1, 2, 4 +[55] Michitaka Yoshida, Akihiko Torii, Masatoshi Okutomi, Kenta Endo, Yukinobu Sugiyama, Rin-ichiro Taniguchi, and Hajime Nagahara. Joint optimization for compressive video + +sensing and reconstruction under hardware constraints. In European Conference on Computer Vision, 2018. 5 +[56] Xin Yuan, David J. Brady, and Aggelos K. Katsaggelos. Snapshot compressive imaging: Theory, algorithms, and applications. IEEE Signal Processing Magazine, 38(2):65-88, 2021. 2 +[57] Xin Yuan, Yang Liu, Jinli Suo, and Qionghai Dai. Plug-and-play algorithms for large-scale snapshot compressive imaging. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1444-1454, 2020. 2 +[58] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. ACM Transactions on Graphics, 37:1-12, 2018. 1 \ No newline at end of file diff --git a/acquiringadynamiclightfieldthroughasingleshotcodedimage/images.zip b/acquiringadynamiclightfieldthroughasingleshotcodedimage/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6caa78c42b7cd375653510cd220e140c4f22f28d --- /dev/null +++ b/acquiringadynamiclightfieldthroughasingleshotcodedimage/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c13767cbab2350287f3a8695040e973bbb7044e853826bebca4caf87f6cdbc9 +size 644747 diff --git a/acquiringadynamiclightfieldthroughasingleshotcodedimage/layout.json b/acquiringadynamiclightfieldthroughasingleshotcodedimage/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ae565c177faf7c8e842756da507d0e44ab9a84ca --- /dev/null +++ b/acquiringadynamiclightfieldthroughasingleshotcodedimage/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88b827570d971d0022099fc6ddffeaba9ac934bded24e9406a3a1b0fd32ce1b3 +size 436843 diff --git a/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_content_list.json b/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6fb2334fff9c468bc67399482d2ee23ab7ed9187 --- /dev/null +++ b/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7f7bb8fe0493df1d3e9bfb26c20e707801f1c0da9e6df015b66a824845d7c04 +size 78484 diff --git a/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_model.json b/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bba3a66d2c28b24f9a3079252db52063216a6984 --- /dev/null +++ b/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d42d4c0f640296066877d2887ee8a177d0d0e5037ed5fd84213a6b9044e0420d +size 98590 diff --git a/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_origin.pdf b/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..534ef878b2d20fd8eaecd61157622d51f920de3e --- /dev/null +++ b/activelearningbyfeaturemixing/eca455da-15ce-41de-885d-779d788a4780_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d10628ca5e65d2cbb6b725e90b13b3bad508eaaeb9e467030255bf3d6edd4255 +size 3214801 diff --git a/activelearningbyfeaturemixing/full.md b/activelearningbyfeaturemixing/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1aeea6a1629e459d8d248d650e0ef162b7e2d3d4 --- /dev/null +++ b/activelearningbyfeaturemixing/full.md @@ -0,0 +1,306 @@ +# Active Learning by Feature Mixing + +Amin Parvaneh $^{1}$ Ehsan Abbasnejad $^{1}$ Damien Teney $^{1,2}$ Reza Haffari $^{3}$ Anton van den Hengel $^{1,4}$ Javen Qinfeng Shi $^{1}$ + +$^{1}$ Australian Institute for Machine Learning, University of Adelaide $^{2}$ Idiap Research Institute $^{3}$ Monash University $^{4}$ Amazon + +{amin.parvaneh, ehsan.abbasnejad, javen.shi, anton.vandenhengel}@adelaide.edu.au damien.teney@idiap.ch gholamreza.haffari@monash.edu + +# Abstract + +The promise of active learning (AL) is to reduce labelling costs by selecting the most valuable examples to annotate from a pool of unlabelled data. Identifying these examples is especially challenging with high-dimensional data (e.g. images, videos) and in low-data regimes. In this paper, we propose a novel method for batch AL called ALFA-Mix. We identify unlabelled instances with sufficiently-distinct features by seeking inconsistencies in predictions resulting from interventions on their representations. We construct interpolations between representations of labelled and unlabelled instances then examine the predicted labels. We show that inconsistencies in these predictions help discovering features that the model is unable to recognise in the unlabelled instances. We derive an efficient implementation based on a closed-form solution to the optimal interpolation causing changes in predictions. Our method outperforms all recent AL approaches in 30 different settings on 12 benchmarks of images, videos, and non-visual data. The improvements are especially significant in low-data regimes and on self-trained vision transformers, where ALFA-Mix outperforms the state-of-the-art in $59\%$ and $43\%$ of the experiments respectively1. + +# 1. Introduction + +The success of machine learning applications depends on the quality and volume of the annotated datasets. High quality data annotations can be slow and expensive. Active learning (AL) aims to actively select the most valuable samples to be labelled in the training process iteratively, to boost the predictive performance. A popular setting called batch AL [34] fixes a budget on the size of the batch of instances to be sent to an oracle for labelling. The process is repeated over multiple rounds, allowing the model to be updated iteratively. The core challenge is therefore to identify the most valuable instances to be included in this batch at each round, depending on the current model. + +![](images/0766f66037b2571244fc6f5ec24531f6eee66451bbaa8c8833529f4a2d34030e.jpg) +Figure 1. We propose to form linear combinations (i.e. interpolations or mixing) of the features of an unlabelled instance (middle image) and of labelled ones (top and bottom images). The interpolated features are passed through the current classifier. We show that inconsistencies in the predicted labels indicate that the unlabelled instance may have novel features to learn from. + +Various AL strategies have been proposed differing in predicting (1) how informative a particular unlabelled instance will be (i.e. uncertainty estimation [12, 15, 31, 38]) or (2) how varied a set of instances will be (i.e. diversity estimation [33, 39]), or both [2, 17, 19]. Recent deep learning based AL techniques include, for example, the use of an auxiliary network to estimate the loss of unlabelled instances [40], the use of generative models like VAEs to capture distributional differences [20, 35], and the use of graph convolutional networks to relate unlabelled and labelled instances [5]. + +Despite much progress made, current AL methods still struggle when applied to deep neural networks, with high-dimensional data, and in a low-data regime. We hypothesised that the representations learned within deep neural networks may be leveraged to reason about the model's uncertainty while alleviating the challenges associated with high-dimensional data. Some existing methods only consider the model's output, but we believe that this cannot convey a complete picture of the model's current state. Assessing the uncertainty in the model is particularly important in a low-data regime since the number of available training + +![](images/db77cf12d8e0deacdb46bbcfac13b6ab5024499f5c3804612deff6af59e34d19.jpg) +(a) ALFA-Mix (ours) + +![](images/c3ba565c9abfcb4162eb49a3cedb51b8d7b476e7d36274528b3c13aff5c10226.jpg) +(b) CDAL (ECCV 2020) [2] + +![](images/23200e96d6d3aaa007c3858c085022c18c84c075658a49d7b2421d1a1b8800b6.jpg) +(c) BADGE (ICLR 2020) [3] + +![](images/539c616a9acd912619915e5a358b1162d28f45760fd0e38aa5dd5b8412d540d6.jpg) +(d) GCNAL (CVPR 2021) [5] + +![](images/8954ce63fb9daa09addd6ae27176c0bcc5a97d02bffa5e68411c75d45430ba88.jpg) +(e) CoreSet (ICLR 2018) [33] +Figure 2. Visualization of sample selection behaviours of various AL methods in the latent space (see the Appendix for additional methods). The larger dots represent the selected samples to label; smaller dots represent unlabelled ones. Our approach finds a candidate set (demonstrated by stars in 2a) of unlabelled instances with inconsistencies in their label prediction when interpolated with labelled representations. It selects a diverse set of samples lying close to the all four borders for the labelling (with three zoom-in windows). The demonstration problem is that of identifying 4 classes from MNIST (illustrated above by 4 colours) using a MLP. An initial training set of 200 randomly selected points and their labels was provided, with each method given a budget of 200 additional labels. The features are projected to two-dimensions for visualization. + +![](images/69c583b504b34da62ee4036b4f039069f5f69083a7ef73f6682ccdfd66914c6f.jpg) +(f) BALD (ICML 2017) [15] + +examples is small. This motivation has led to methods like BADGE [3] which uses gradients through the classifier layer of the network. Besides its relatively poor performance in IoT data regimes [3], the drawback is a high computational cost due to the high dimensionality of the gradient embeddings, making the method impractical for deep models with latent representations of high dimensions, large datasets, and large numbers of classes. + +In this paper, we present a novel and efficient AL method, named Active Learning by FeAture Mixing (ALFA-Mix), based on the manipulation of latent representations of the data. We identify informative unlabelled instances by evaluating the variability of the labels predicted for perturbed versions of these instances. These perturbed versions are instantiated in feature space as convex combinations of unlabelled and labelled instances (see Figure 1). This approach effectively explores the neighbourhood surrounding an unlabelled instance by interpolating its features with those of previously-labelled ones. Convex combinations of features have been already used in other contexts such as data augmentation, using random interpolations [36, 37, 41, 42] or actual solutions to an optimisation problem [1, 29]. + +We provide a theoretical support for the method. In particular, under a norm-constraint on the interpolation ratio, we show that the interpolation is equivalent to considering (1) the difference between the features of the unlabelled + +instance and the labelled ones and (2) the gradient of the model w.r.t the features at the unlabelled point. Discovering new features considering (1) and (2) leads us to finding an optimal interpolated point deterministically, at a minimal computing cost. Rather than using all the labelled data for these interpolations, we choose a subset we call anchors to capture the common features for each class. Subsequently, we construct a candidate set by choosing the instances from the unlabelled set that when mixed with these anchors lead to a change in the model's prediction for those instances. Then, to ensure selected instances are diverse, we perform a simple clustering in the candidate set and choose their centroids as the points to be queried. + +The contributions of this paper are as follows. + +- Instead of interrogating an unlabelled instance directly, we interpolate its representation features from the labelled instances to uncover its hidden traits. To the best of our knowledge, it is the first of its kind in AL. Unlike existing methods that reply solely on the predicted output, we harness useful information from the feature representations as an indication of which features are novel for the model. +- We show that optimal interpolation/mixing for each instance that underscores the novel features with which the model could change prediction, has a closed-form solution making our approach efficient and scalable. +- We show that our approach outperforms its counterparts + +over 9 image, 2 OpenGL, and one video datasets in various settings of architecture, network initialisation, and budget choice. Our approach consistently achieves higher accuracy than existing methods, with particularly significant gains in a low-data regime. + +- We provide the first investigation into using AL in vision transformers: we demonstrate the effectiveness of ALFA-Mix on a self-trained vision transformer [6], performing better than random selection in all tests, and $43\%$ better than the state-of-the-art. In addition, our approach performs significantly better that its counterparts for video classification using transformers [14]. + +# 2. Related Work + +Active learning strategies can be broadly categorised into three types: diversity-based, uncertainty-based, and hybrid sampling, according to the nature of their acquisition function. Diversity-based approaches aim to select samples that best represent the whole of the available unlabelled set. A variety of approaches have been proposed that cluster the unlabelled samples based on feature representations [39], or construct a core-set over the latent features to identify a suitably diverse set of samples [33]. + +Uncertainty-based methods seek to identify the unlabelled samples that are most ambiguous to the current model that has been trained over the present labelled set based on the target objective function. The assumption here is that having these uncertain samples labelled will add the most value to the next model training round. Entropy and the confidence of the predictions [38], the margin between the confidence of the highest and second highest predicted classes [31], the information gain in the model parameters in a Bayesian framework [15], and the variance between the predicted probabilities within the ensemble [4] have all been proposed as measures of uncertainty. These methods favour points that lie close to the decision boundary, but as they rely entirely on the predicted class likelihoods they ignore the value of the feature representation itself. The closest method to that which we propose here is the deep fool attack learning (DFAL) approach [12] where the distance to the decision boundary is approximated by perturbation, using techniques originally developed for adversarial attacks [28]. Adversarial examples may expose vulnerability of the network architecture to particular patterns in the input rather than the distribution of the labels over latent space. That may lead to incorrect selection of instances that have patterns that are easily manipulated rather than helping to shape a more consistent decision boundary. Random perturbations are unlikely to lie within the true data distribution, and thus risk wasting labelling cost on feature values that can never arise in practice. Rather than repeatedly adding random noise in the input space, the method we propose here (ALFA-Mix) interpolates in latent space. ALFA-Mix is not only faster, it + +also significantly outperforms the DFAL approach. + +Recently, a series of model-based active learning have been developed whereby a separate model is trained for active instance selection. Various objectives, either task-agnostic (e.g. variational adversarial active learning [35], graph convolutional active learning [5]) or task-aware (e.g. target loss prediction [40]), have been proposed as for training these models. Additionally, [8] has married model-based algorithms with conventional ones by combining a variational Bayes network with feature representations from the target model. In addition to sensitivity to hyper-parameters and additional computational cost, these AL methods do not consider the diversity of the selected samples and are prone to selecting samples with repetitive patterns. Moreover, our experiments show their poor performances in low-data regime. + +Hybrid AL methods exploit both diversity and uncertainty in their sample selection methodologies. A mini-max strategy was proposed in [19], for example, that maximises both the informativeness and representativeness of the samples. Interestingly, a method that learns to combine different AL strategies was presented in [17]. Additionally, [2] exploits the predicted probabilities in images to select samples from diverse contexts (i.e. images of objects with varied backgrounds). Recently, [3] proposed to cluster the gradients of the final output layer of the target model as the features of the unlabelled samples that implicitly encompass the uncertainty information. Despite their state-of-the-art results on some image and non-image datasets, their approach is not scalable to larger tasks with numerous number of classes. Our approach not only consistently outperforms their method by a large margin in different settings, but it also is extremely efficient and scalable to large tasks. + +# 3. Methodology + +# 3.1. Problem Definition + +Without loss of generality, we consider our learning objective to be training a supervised multiclass classification problem with $K$ classes. A learner is actively trained in iterations of interactions with an oracle. At each iteration, this active learner has access to a small set of labelled data $\mathcal{D}^l = \{(x_i,y_i)\}_{i=0}^M$ where $x_i \in \mathcal{X}$ represents the input (e.g. an image or a video clip) and $y_i \in \{1,\dots,K\}$ stands for the associated class label. The learner also has access to a set of unlabelled data $\mathcal{D}^u$ from which $B$ number of instances are chosen to be labelled by the oracle. The labelled samples are then added to $\mathcal{D}^l$ to update the model. The performance of the model is evaluated on an unseen test dataset. + +The learner is a deep neural network $f = f_{c} \odot f_{e}$ parameterised by $\pmb{\theta} = \{\pmb{\theta}_{e}, \pmb{\theta}_{c}\}$ . Here, $f_{e}: \mathcal{X} \to \mathbb{R}^{D}$ is the backbone which encodes the input to a $D$ -dimensional representation in a latent space, i.e. $z = f_{e}(x; \pmb{\theta}_{e})$ . Further, $f_{c}: \mathbb{R}^{D} \to \mathbb{R}^{K}$ is a classifier e.g. multi-layer perceptron (MLP) + +that maps the instances from their representations to their corresponding logits which can be converted to class likelihoods by $p(y \mid z; \boldsymbol{\theta}) = \text{softmax}(f_c(z; \boldsymbol{\theta}_c))$ . We optimise the parameters end-to-end by minimising the cross-entropy loss over the labelled set: $\mathbb{E}_{(x, y) \sim \mathcal{D}^l}[\ell(f_c \odot f_e(x; \boldsymbol{\theta}), y)]$ . The prediction of the label (i.e. pseudo-label) for an unseen instance is $y_{z}^{*} = \arg \max_y f_c^y(z; \boldsymbol{\theta}_c)$ where $z = f_e(x; \boldsymbol{\theta}_e)$ and $f_c^y$ is the logit output for class $y$ . Additionally, the logit of the predicted label is denoted as $f_c^*(z) := f_c^{y_z^*(z)^2}$ . We also denote $Z^u = \{f_e(x), \forall x \in \mathcal{D}^u\}$ the set for representations of the unlabelled data and $Z^l$ its labelled counterpart. We compute the average representation $z^*$ of the labelled samples per class, and call it anchor. The anchors for all classes form the anchor set $Z^*$ , and serve as representatives of the labelled instances. + +# 3.2. Feature Mixing + +The characteristics of the latent space plays a crucial role in identifying the most valuable samples to be labelled. Our intuition is that the model's incorrect prediction is mainly due to novel "features" in the input that are not recognisable. Thus, we approach the AL problem by first probing the features learned by the model. To that end, we use a convex combination (i.e. interpolation) of the features as a way to explore novel features in the vicinity of each unlabelled point. Formally, we consider our interpolation between the representations of the unlabelled and labelled instances, $z^u$ and $z^{\star}$ respectively (we use the labelled anchor here for efficiency) as $\tilde{z}_{\alpha} = \alpha z^{\star} + (1 - \alpha)z^{u}$ using an interpolation ratio $\alpha \in [0,1)^D$ . This process can be seen as a way of sampling a new instance without explicitly modelling the joint probability of the labelled and unlabelled instances [1,24,29,41], i.e. + +$$ +z \sim p \left(z \mid z ^ {u}, Z ^ {\star}, \alpha\right) \equiv \alpha z ^ {\star} + (1 - \alpha) z ^ {u}, \quad z ^ {\star} \sim Z ^ {\star}. \tag {1} +$$ + +We consider interpolating an unlabelled instance with all the anchors representing different classes to uncover the sufficiently distinct features by considering how the model's prediction changes. For that, we investigate the change in the pseudo-label (i.e. $y^{*}$ ) for the unlabelled instance and the loss incurred with the interpolation. We expect that a small enough interpolation with the labelled data should not have a consequential effect on the predicted label for each unlabelled point. + +Using a first-order Taylor expansion w.r.t. $z^u$ , the model's loss for predicting the pseudo-label of an unlabelled instance at its interpolation with a labelled one can be re-written as3: + +$$ +\begin{array}{l} \ell \left(f _ {c} \left(\tilde {z} _ {\boldsymbol {\alpha}}\right), y ^ {*}\right) \approx \ell \left(f _ {c} \left(z ^ {u}\right), y ^ {*}\right) + \tag {2} \\ \left(\boldsymbol {\alpha} \left(\boldsymbol {z} ^ {\star} - \boldsymbol {z} ^ {u}\right)\right) ^ {\intercal}. \nabla_ {\boldsymbol {z} ^ {u}} \ell \left(f _ {c} \left(\boldsymbol {z} ^ {u}\right), \boldsymbol {y} ^ {*}\right), \\ \end{array} +$$ + +which for a sufficiently small $\alpha$ , e.g. $\| \alpha \| \leq \epsilon$ is almost exact. Consequently, for the full labelled set, by choosing the max loss from both sides we have: + +$$ +\begin{array}{l} \max _ {\boldsymbol {z} ^ {*} \sim \boldsymbol {Z} ^ {*}} \left[ \ell \left(f _ {c} \left(\tilde {\boldsymbol {z}} _ {\boldsymbol {\alpha}}\right), y ^ {*}\right) \right] - \ell \left(f _ {c} \left(\boldsymbol {z} ^ {u}\right), y ^ {*}\right) \approx \tag {3} \\ \max _ {\boldsymbol {z} ^ {\star} \sim \boldsymbol {Z} ^ {\star}} \left[ (\boldsymbol {\alpha} (\boldsymbol {z} ^ {\star} - \boldsymbol {z} ^ {u})) ^ {\intercal}. \nabla_ {\boldsymbol {z} ^ {u}} \ell (f _ {c} (\boldsymbol {z} ^ {u}), \boldsymbol {y} ^ {*}) \right]. \\ \end{array} +$$ + +Intuitively, when performing interpolation, the change in the loss is proportionate to two terms: (a) the difference of features of $z^{\star}$ and $z^{u}$ proportionate to their interpolation $\alpha$ , and (b) the gradient of the loss w.r.t the unlabelled instance. The former determines which features are novel and how their value could be different between the labelled and unlabelled instance. On the other hand, the later determines the sensitivity of the model to those features. That is, if the features of the labelled and unlabelled instances are completely different but the model is reasonably consistent, there is ultimately no change in the loss, and hence those features are not considered novel to the model. + +The choice of $\alpha$ is input specific and determines the features to be selected. As such, in Sec 3.3 we introduce a closed form solution for finding a suitable value for $\alpha$ . Finally, we note that the interpolations utilised here have some interesting properties that are further discussed in the supplements. + +# 3.3. Optimising the Interpolation Parameter $\alpha$ + +Since manually choosing a value for $\alpha$ is non-trivial, we devise a simple optimisation approach to choose the appropriate value for a given unlabelled instance. To that end, we note that, as observed from Eq. (3), the worst case of maximum change in the loss is when we choose $\alpha$ that maximises the loss at the interpolation point (details are in the supplement). However, using the r.h.s of the Eq. (3), we devise the objective for choosing $\alpha$ as: + +$$ +\boldsymbol {\alpha} ^ {*} = \underset {\| \boldsymbol {\alpha} \| \leq \epsilon} {\arg \max } \left(\boldsymbol {\alpha} \left(\boldsymbol {z} ^ {\star} - \boldsymbol {z} ^ {u}\right)\right) ^ {\intercal}. \nabla_ {\boldsymbol {z} ^ {u}} \ell \left(f _ {c} \left(\boldsymbol {z} ^ {u}\right), \boldsymbol {y} ^ {*}\right), \tag {4} +$$ + +where $\epsilon$ is a hyper-parameter governing the magnitude of the mixing. Intuitively, this optimisation chooses the hardest case of $\alpha$ for each unlabelled instance and anchor. We approximate the solution to this optimisation using dual norm formulation, which in the case of using 2-norm yields: + +$$ +\boldsymbol {\alpha} ^ {*} \approx \epsilon \frac {\left\| \left(\boldsymbol {z} ^ {\star} - \boldsymbol {z} ^ {u}\right) \right\| _ {2} \nabla_ {\boldsymbol {z} ^ {u}} \ell \left(f _ {c} \left(\boldsymbol {z} ^ {u}\right) , y ^ {*}\right)}{\left\| \nabla_ {\boldsymbol {z} ^ {u}} \ell \left(f _ {c} \left(\boldsymbol {z} ^ {u}\right) , y ^ {*}\right) \right\| _ {2}} \otimes \left(\boldsymbol {z} ^ {\star} - \boldsymbol {z} ^ {u}\right), \tag {5} +$$ + +where $\varnothing$ represents element-wise division (further details in the Supplement). This approximation makes the optimisation of the interpolation parameter efficient and our experiments show that it will not have significant detrimental effects on the final results compared to directly optimising for $\alpha$ to maximise the loss. + +Algorithm 1: Our active learning algorithm. +Inputs: initial labelled set $\mathcal{D}^l$ ; unlabelled pool $\mathcal{D}^u$ ; labelling budget at each round $B$ ; mixing parameter $\epsilon$ ; for $i = 1$ to max_rounds do +Train the model $f$ using the labelled data $\mathcal{D}^l$ . Initialise $\mathbf{Z}^{\star}$ based on the representations of $\mathcal{D}^l$ . $\mathcal{I} = \{\}$ . +for $\boldsymbol{x}^u \in \mathcal{D}^u$ do + $\boldsymbol{z}^u = f_e(\boldsymbol{x}^u)$ . +for $\boldsymbol{z}^{\star} \in \mathbf{Z}^{\star}$ do +Calculate $\alpha^*$ using $\epsilon$ and Eq. 5. + $\tilde{\boldsymbol{z}} = \alpha^* \boldsymbol{z}^* + (1 - \alpha^*) \boldsymbol{z}^u$ . +if $\arg \max_y (f_c^y (\boldsymbol{z}_u)) \neq \arg \max_y (f_c^y (\tilde{\boldsymbol{z}}))$ then + $\mathcal{I} = \mathcal{I} \cup (\boldsymbol{x}^u, \boldsymbol{z}^u)$ . +Break +Cluster the samples in $\mathcal{I}$ into $B$ clusters. +Select samples at the centre of each cluster $(\mathcal{C})$ . + $Y^{new} = \text{Query}(\mathcal{C})$ . + $\mathcal{D}^l = \mathcal{D}^l \cup (\mathcal{C}, Y^{new})$ , $\mathcal{D}^u = \mathcal{D}^u \backslash \mathcal{C}$ . + +# 3.4. Candidate Selection + +For AL it is reasonable to choose instances to be queried whose loss substantially change with interpolation according to Eq. (3). This corresponds to those instances for which the model's prediction change and have novel features. Intuitively, as depicted in Figure. 2a, these samples are placed close to the decision boundary in the latent space. Alternatively, we expect a small interpolation should not affect the model's loss when it is reasonably confident in its recognition of the features of the input. We, then, create our candidate set as: + +$$ +\mathcal {I} = \left\{\boldsymbol {z} ^ {u} \in \boldsymbol {Z} ^ {u} \mid \exists \boldsymbol {z} ^ {\star} \in \boldsymbol {Z} ^ {\star}, f _ {c} ^ {*} (\tilde {\boldsymbol {z}} _ {\alpha}) \neq y _ {\boldsymbol {z} ^ {u}} ^ {*} \right\}. \tag {6} +$$ + +The size of the selected set $\mathcal{I}$ could potentially be larger than the budget $B$ . In addition, ideally we seek diverse samples since most instances in $\mathcal{I}$ could be chosen from the same region (i.e. they might share the same novel features). To that end, we propose to cluster the instances in $\mathcal{I}$ into $B$ groups based on their feature similarities and further choose the closest samples to the centre of each cluster to be labelled by oracle. This ensures the density of the space represented by $\mathcal{I}$ samples, is reasonably approximated using $B$ instances. We simply use $k$ -MEANS which is widely accessible. Similar strategy is also used by [3] to encourage diversity. Our approach is summarised in Algorithm 1. + +# 4. Experiments and Results + +# 4.1. Baselines + +We compare ALFA-Mix with the following AL baselines: -Random: a simple baseline that randomly selects $B$ samples from the unlabelled pool at each round. +- Entropy [38]: A conventional AL approach that picks unlabelled instances with highest entropy. + +- BALD [15]: An uncertainty model relying on Bayesian approaches that selects a set of samples with the highest mutual information between label predictions and posterior of the model approximated using dropout (Figure 2f). +- Coreset [33]: An approach based on the core-set technique that chooses a batch of diverse representative samples of the whole unlabelled set (Figure. 2e). +- Adversarial Deep Fool [12]: An uncertainty method that utilises deep fool attacks to select a batch of unlabelled samples whose predictions flip with small perturbations. +- GCNAL [5]: A model-based approach that learns a graph convolutional network to measures the relation between labelled and unlabelled instances (Figure. 2d) $^4$ . +-BADGE [3]: A hybrid approach that queries the centroids obtained from the clustering of the gradient embeddings (Figure. 2c). +- CDAL [2]: A hybrid approach that exploits the contextual information in the predicted probabilities to choose samples with varied contexts (Figure. 2b) + +# 4.2. Experiment Settings + +Setting and Datasets: We conducted a comprehensive set of experiments in 30 different settings on multiple datasets to evaluate how ALFA-Mix compares to its counterparts. We define an AL setting as a combination of a specific dataset, a limited set of initial labelled samples, a particular type of deep neural network, a limited number of AL rounds, and a fixed labelling budget (batch) for each round. + +Specifically, we experimented on MNIST [23], EMNIST [9], CIFAR10 [21], CIFAR100 [21], MiniImageNet [32], DomianNet-Real [30] as well as two subsets of DomainNet-Real for image datasets. Additionally, we extended our experiments to two more non-visual datasets from the OpenML repository. Furthermore, to reveal the effectiveness of each AL method in different data regimes, we utilised both small $(10\times K)$ and large $(100\times K)$ budget sizes. More importantly, the network architecture and its initial parameters are two more factors that we considered in our experiments. As for the choice of the architecture, we employed different common deep neural networks; including Multi-Layer Perceptron (MLP) [3], ResNet-18 [16], DenseNet-121 [18], as well as Vision Transformers [11]. Regarding the network initialisation, we considered three scenarios where at the start of each AL round6, the parameters are initialised randomly, from the model trained in the previous round (denoted as "Continue" in Figure. 3), or using pre-trained models (either from supervised or self-supervised [6] pre-training on ImageNet [10]). Please find for more details in the Appendix. + +![](images/5b924fcf5d8947b53ad0a3d5a64b972aa242b2a98779b1d56962028efbea1d69.jpg) +Figure 3. A summary of the performance of our proposed AL method (ALFA-Mix) compared with state-of-the-art across all the 30 settings considered. Each bar represents the percentage of AL rounds in which our approach outperforms others (lower indicates stronger baseline). It is worth noting that our approach (ALFA-Mix) under-performs others in close to zero cases. + +We followed the supervised training setting proposed in [3] and optimised the network using all the labelled set (without any validation set) based on a cross-entropy loss and an Adam optimiser with a learning rate of $1e - 3$ and $1e - 4$ for image and non-image datasets, respectively. Similarly, we continued the training using a batch size of 64 until the model reaches a certain early stopping condition (i.e. reaching a training accuracy above $99\%$ [3]). + +We set the number of rounds for each setting to 10, except for DomainNet-Real where we continue for 5 rounds. Additionally, to eliminate the effect of randomness in the results, we repeated each experiment 5 times with different random seeds. To have a better understanding about the performance of each method, in addition to the quantitative results, we provided the penalty matrix [3] that facilitates the pairwise comparisons between different approaches across all the settings. + +Video classification: Since video classification is a more challenging task with higher annotation cost, we compare the AL performance on video classification tasks. All the experiments are conducted on HMDB [22], a widely used dataset consisting of 5,412 training videos belonging to 51 classes representing different actions. For each video, we randomly sampled a video clip with 32 frames of size $224 \times 224$ using a temporal stride of 2. Regarding the network architecture, we employed the state-of-the-art Multi-Scale Vision Transformer (MViT) backbone pre-trained on Kinetics-600 [7]. Starting with a labelled set consisting of two labelled instances from each class (a total of 102 video clips), we provide each AL method with budget of the varied sizes $(2 \times K, 4 \times K, 7 \times K$ and $15 \times K)$ in the next AL rounds. At each AL round, we train the network for 50 epochs with a batch size of 8 using AdamW [27] optimiser with a base learning rate of $1e - 4$ that warms up linearly for the first 30 epochs and then decays to $5e - 5$ for the rest of the iterations using a cosine scheduler [26]. We repeated each experiment twice to cancel out the effect of random selection of the initial labelled set. + +# 4.3. Overall Results + +Image and non-image results. In Figure. 4 we summarise all the results across various datasets, budget sizes and ar- + +![](images/6a911c1dccdac4f0beb50364776f6e79cc7bea311a14293e9c05d382af0e900e.jpg) +Figure 4. Pairwise comparison [3] of different approaches. Lower values shown at each column reveal the better performances of that AL method across all the experiments. Maximum value of each cell is 30, which represents the number of experimental settings. + +chitectures (30 different settings in total) for image and non-image tasks into a matrix $C$ . While each element $C_{i,j}$ in the matrix reveals in how many experiments the method shown in row $i$ outperforms the one in column $j$ in terms of accuracy of an unseen test set (higher is better for the approach shown in the row). The last row indicates the average number of experiments in which the method in the column has been outperformed by others (lower is better). The maximum value for each cell in the matrix is 30. This matrix clearly shows the superior performance of our approach compared to the baselines. In particular, we outperform CDAL [2] and BADGE [3] in a significant number of experiments (12.3 and 10.6 out of 30, respectively) but ours under-performed in only 0.3 of the times. Generally as shown in the last column, our approach is rarely outperformed (lower than 0.3). In other words, except in 3 AL rounds, for the rest of 282 ones (around $99\%$ of the rounds), our approach is capable of matching or outperforming the best-performing baselines (BADGE and CDAL). + +Video Classification results. Table. 1 summarises the results for applying various AL methods for the activity recog + +![](images/4de1d45d1f3d71470dfc04a604dca8bb542ea437cd096dd2750af371410282c3.jpg) +(a) MNIST (MLP) + +![](images/eca5c0cea9b0102244b7460696681776a41d50bb0e4999a5c85d78519765647d.jpg) +(b) MiniImageNet (ViT-Small) + +![](images/8b1a0a56e51c76f392c8a3328db598e771768f528b1ecd85fd55caf9e0abdf3b.jpg) +(c) DomainNet-Real (ViT-Base) +Figure 5. Test accuracy plots across some of the employed settings. Each experiment has been repeated 5 times. + +
MethodAL Rounds
204*4087651530
\( MViT \) (initial accuracy with 102 instances: 50.9±1.2)
Random56.7±1.464.1±1.272.0±1.175.3±0.4
Entropy [38]55.5±0.665.5±0.370.2±2.076.5±0.7
BALD [15]56.7±0.465.5±0.672.4±1.376.6±1.8
CoreSet [33]59.3±1.365.8±1.272.8±1.678.5±0.7
GCNAL [5]54.9±1.463.3±2.270.8±1.477.0±1.3
CDAL [2]60.9±0.167.2±0.474.6±0.278.4±0.5
BADGE [3]60.6±1.367.3±0.273.2±1.178.7±0.2
Ours62.5±0.669.4±0.775.1±0.378.3±0.1
+ +Table 1. Top-1 test accuracy of various AL methods on HMDB [22]. * Values on top of each column reveal the size of the labelled set at the end of each round. + +nition in videos where our approach outperforms the baselines. Interestingly, compared to the Random sampling, we are able to improve the Top-1 test accuracy by more than $5\%$ in the first two AL rounds and $3\%$ in the last ones. This signifies the effectiveness of our proposed approach in reducing the labelling cost which is particularly an obstacle for video classification tasks. Moreover, ALFA-Mix outperforms all other strong baselines with a large margin (more than $2\%$ ) in the first three AL rounds. Interestingly, this is similar to what we observe from our experiments on other data types and show the effectiveness of our approach when applied to pre-trained transformers and/or in low-data regimes. + +# 4.4. Ablation Study + +Learning Ablations. Figure. 3 demonstrates the percentage of AL rounds where ALFA-Mix performs better than the baselines considering input data type, network architecture, network parameter initialisation and the budget size. The results indicate our approach, irrespective of other factors, consistently outperforms other AL baselines. Interestingly, when employing pre-trained networks, which is a common practice for transferring learnt representations to new tasks, ALFA-Mix $99\%$ of occasions assists the model to generalise better than random sampling. Additionally, in these settings, our approach surpasses the strongest baselines (CDAL and BADGE) in more than $40\%$ of the rounds. Above all, using Vision Transformer networks pre-trained in a self-supervised manner, ALFA-Mix not only outperforms Random, BALD, + +CoreSet and GCNAL in all the AL settings, it also significantly improves on BADGE and CDAL in $60\%$ and $43\%$ of the rounds respectively. + +Interestingly, we observe a significant advantage from our proposed AL method when it is applied on small budget setting (Figure. 3). In fact, the test performance of our approach exceeds BADGE (the best performing baseline) in $46\%$ of the small budget experiments. Moreover, we observe a more evident gap between our approach and others when it comes to AL in low-data regime. For that, we consider the performance in the first 5 rounds of AL using a small budget; i.e. starting from $10 \times K$ randomly selected labelled samples, each method queries for the maximum of $50 \times K$ unlabelled samples overall during 5 AL iterations. Figure. 3 demonstrates the dominance of our approach in this setting as it eclipses all other approaches in at least $60\%$ of the experiments. When using a large budget, our approach is able to slightly surpass BADGE which previously has shown great success in this setting. + +Diversification. Figure. 6a illustrates the effectiveness of the batch diversification on selecting final instances from the set of samples whose predictions have been changed $(\mathcal{I})$ during the interpolation process. In addition to uniformly sampling instances from the candidate set, we consider two heuristics: (1) the norm of the interpolation parameter $\| \alpha \| _2$ in which a lower norm indicates with smaller intervention the model changed prediction; and, (2) the symmetric KL-Divergence between the predicted label distributions from the unlabelled instance $p(y|\boldsymbol {z}^u;\boldsymbol {\theta}_c)$ and that of the interpolated variant $p(y|\tilde{z}_{\alpha};\boldsymbol{\theta}_{c})$ . The latter evaluates the distributions change in the output (i.e. prefers samples with highest values of symmetric KL-Divergence). Interestingly, both heuristics show poor performances even in comparison with the uniform selection from the candidate set. While this highlights how hard the candidate selection could be, one explanation is that these approaches might use a considerable proportion of the budget on samples that reside in a small region of the space. Consequently, the selected batch does not carry the whole information obtained through the interpolation process. + +In addition to the heuristic measures, we considered $k$ - + +(a) Diversity impact of the sample selection from the candidate set $(\mathcal{I})$ +![](images/0585c655c65422adacbf0c98bbe942d2106f348e879c183ec7c2abe343ed9003.jpg) +* $k$ -MEANS is our proposed full model. + +![](images/5e689ee109345cdb522473b0e8a099c180aa434e7a818e08dc69aae82b45f6d8.jpg) +(b) Number of unlabelled samples whose predictions flip with and without learning the interpolation parameter $\alpha$ . + +![](images/4e4d250580db1459c75ec25d6989d1fcda2c451b5acab10fd62051d49879604f.jpg) +(c) The impact of anchors on identifying samples whose labels flip during the interpolation. +Figure 6. Ablations of our AL approach. Experiments are conducted on MNIST datasets using an MLP model and a small AL budget. + +MEANS++, a simpler variation of $k$ -MEANS that has shown better performance in [3], as another contender. In contrast to what found in [3], in our experiments, $k$ -MEANS outperforms $k$ -MEANS++ considerably as it better representations found using interpolation. + +Learning the Interpolation Parameter. As it is evident in Figure. 6b, skipping the learning process for the interpolation parameter $\alpha$ (see section 3.3) significantly reduces the number of samples chosen in the candidate set. This can have detrimental consequence on the diversity of samples that are selected during the clustering. + +Anchors. Figure. 6c shows the impact of using different anchors $Z^{\star}$ . Evidently, the proposed method based on anchors outperforms other plausible alternatives including picking random samples from the labelled set and removing $z^{\star}$ during the interpolation. The latter resembles adding noise to the sample and is similar to applying adversarial attack in the latent space. + +Acquisition Time. We measured the time required to choose instances for labelling during each AL round. As demonstrated in Table 2, using a simple MLP network or a deep DenseNet-121, our approach performs competitive with the fastest baselines. This is mainly because of the fact that we only back-propagates to a latent representation layer (not the whole network). Additionally, our + +approaches reduces the time required for BADGE (the best performing baseline) by a factor of more than 2 when applied to datasets with a small number of classes. We should note that running BADGE on large-scale datasets with numerous classes requires a considerable time and computing + +
MethodTime (seconds)
MNIST (MLP)SVHN (DenseNet)
Entropy [38]1±0169±44
BALD [15]16±41723±445
Coreset [33]7±2185±49
DFAL [12]242±69-
GCNAL [5]12±4187±65
CDAL [2]5±2179±52
BADGE [3]50±13523±135
Ours5±7210±50
+ +Table 2. Label acquisition run times of different methods. Our approach is significantly faster than BADGE and about ${50}\mathrm{x}$ quicker than its Adversarial counterpart. + +resources. The main reason is the large dimensionality of the gradient embedding in tasks with large number of classes and instances. More importantly, Table 2 shows the time needed for DFAL method for MNIST dataset, which makes it impossible to apply to deep models and large datasets in a reasonable time. + +# 5. Conclusions and Limitations + +In this paper, we proposed a simple AL method based on the interpolation between labelled and unlabelled samples. We effectively applied ALFA-Mix to a wide variety of image, non-image and video datasets and demonstrate its state-of-the-art results across various settings. Attractively, when the labelled set is small and the budget is limited, our approach is able to gain the most performance boost—it surpassed all other baselines in around $60\%$ of all evaluated rounds. + +Further, the feature representations are not generally disentangled [13,25] and interpolation in the high dimensional space may yield representations for unexpected inputs. Nevertheless, our approach indicates such interpolations highlight reasonable variations in the input that may otherwise remain unexplored. For future, we consider using disentangled representations to explore novel factors of variations. + +Limitations: AL consciously selects a small subset of a large pool of unlabelled samples to be labelled and used to train a model. AL will be essential in catastrophes, like pandemics, where the time to reach a model at a particular level of accuracy becomes vital and would directly impact the lives of people. In spite of that, its a common practice to evaluate AL in a simulated environment mainly due to financial constraints. However, AL community at large and our approach in particular could heavily benefit from real-world evaluations. + +# Acknowledgements + +This material is based on research sponsored by Air Force Research Laboratory and DARPA under agreement number FA8750-19-2-0501. The U.S. Government is authorised to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. + +# References + +[1] Ehsan Abbasnejad, Damien Teney, Amin Parvaneh, Javen Shi, and Anton van den Hengel. Counterfactual vision and language learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2, 4 +[2] Sharat Agarwal, Himanshu Arora, Saket Anand, and Chetan Arora. Contextual diversity for active learning. In European Conference on Computer Vision, pages 137-153. Springer, 2020. 1, 2, 3, 5, 6, 7, 8 +[3] Jordan T. Ash, Chicheng Zhang, Akshay Krishnamurthy, John Langford, and Alekh Agarwal. Deep batch active learning by diverse, uncertain gradient lower bounds. In International Conference on Learning Representations, 2020. 2, 3, 5, 6, 7, 8 +[4] William H. Beluch, Tim Genewein, Andreas Nurnberger, and Jan M. Kohler. The power of ensembles for active learning in image classification. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9368-9377, 2018. 3 +[5] Razvan Caramalau, Binod Bhattacharai, and Tae-Kyun Kim. Sequential graph convolutional network for active learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9583-9592, June 2021. 1, 2, 3, 5, 7, 8 +[6] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the International Conference on Computer Vision (ICCV), 2021. 3, 5 +[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 (CVPR), July 2017. 6 +[8] Jongwon Choi, Kwang Moo Yi, Jihoon Kim, Jinho Choo, Byoungjip Kim, Jinyeop Chang, Youngjune Gwon, and Hyung Jin Chang. Vab-al: Incorporating class imbalance and difficulty with variational bayes for active learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6749-6758, June 2021. 3 +[9] Gregory Cohen, Saeed Afshar, Jonathan Tapson, and André van Schaik. Emmist: Extending mnist to handwritten letters. In 2017 International Joint Conference on Neural Networks (IJCNN), pages 2921-2926, 2017. 5 +[10] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. 5 +[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. 5 + +[12] Melanie Ducoffe and Frederic Precioso. Adversarial active learning for deep networks: a margin based approach. In arXiv:1802.09841, 2018. 1, 3, 5, 8 +[13] Martin Engelcke, Adam R. Kosiorek, Oiwi Parker Jones, and Ingmar Posner. Genesis: Generative scene inference and sampling with object-centric latent representations. In International Conference on Learning Representations, 2020. 8 +[14] Haoqi Fan, Bo Xiong, Karttikeya Mangalam, Yanghao Li, Zhicheng Yan, Jitendra Malik, and Christoph Feichtenhofer. Multiscale vision transformers. CoRR, abs/2104.11227, 2021. 3 +[15] Yarin Gal, Riashat Islam, and Zoubin Ghahramani. Deep Bayesian active learning with image data. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1183-1192. PMLR, 06-11 Aug 2017. 1, 2, 3, 5, 7, 8 +[16] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. 5 +[17] Wei-Ning Hsu and Hsuan-Tien Lin. Active learning by learning. In AAAI Conference on Artificial Intelligence, 2015. 1, 3 +[18] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2261-2269, 2017. 5 +[19] Sheng-jun Huang, Rong Jin, and Zhi-Hua Zhou. Active learning by querying informative and representative examples. In J. Lafferty, C. Williams, J. Shawe-Taylor, R. Zemel, and A. Culotta, editors, Advances in Neural Information Processing Systems, volume 23, pages 892-900. Curran Associates, Inc., 2010. 1, 3 +[20] Kwanyoung Kim, Dongwon Park, Kwang In Kim, and Se Young Chun. Task-aware variational adversarial active learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8166-8175, June 2021. 1 +[21] Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. 5 +[22] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, and T. Serre. HMDB: a large video database for human motion recognition. In Proceedings of the International Conference on Computer Vision (ICCV), 2011. 6, 7 +[23] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. 5 +[24] Damian Lesniak, Igor Sieradzki, and Igor T. Podolak. Distribution-interpolation trade off in generative models. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019. 4 +[25] Francesco Locatello, Ben Poole, Gunnar Raetsch, Bernhard Schölkopf, Olivier Bachem, and Michael Tschannen. Weakly-supervised disentanglement without compromises. In Proceedings of the 37th International Conference on Machine + +Learning, volume 119 of Proceedings of Machine Learning Research, pages 6348-6359. PMLR, 13-18 Jul 2020. 8 +[26] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations, 2017. 6 +[27] Ilya Loshchilov and Frank Hutter. Fixing weight decay regularization in adam, 2018. 6 +[28] Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: A simple and accurate method to fool deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 3 +[29] Amin Parvaneh, Ehsan Abbasnejad, Damien Teney, Javen Shi, and Anton van den Hengel. Counterfactual vision-and-language navigation: Unravelling the unseen. In Advances in Neural Information Processing Systems, volume 33, 2020. 2, 4 +[30] Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the IEEE International Conference on Computer Vision, pages 1406-1415, 2019. 5 +[31] Dan Roth and Kevin Small. Margin-based active learning for structured output spaces. In Johannes Fornkranz, Tobias Scheffer, and Myra Spiliopoulou, editors, Machine Learning: ECML 2006, pages 413-424, Berlin, Heidelberg, 2006. Springer Berlin Heidelberg. 1, 3 +[32] Hugo Larochelle Sachin Ravi. Optimization as a model for few-shot learning. In International Conference on Learning Representations, 2017. 5 +[33] Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. In International Conference on Learning Representations, 2018. 1, 2, 3, 5, 7, 8 +[34] Burr Settles. Active learning literature survey. 2009. 1 +[35] Samarth Sinha, Sayna Ebrahimi, and Trevor Darrell. Variational adversarial active learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 1, 3 +[36] Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, International Conference on Machine Learning (ICML), 2019. 2 +[37] Vikas Verma, Alex Lamb, Juho Kannala, Yoshua Bengio, and David Lopez-Paz. Interpolation consistency training for semi-supervised learning. In International Joint Conference on Artificial Intelligence (IJCAI), 2019. 2 +[38] D. Wang and Y. Shang. A new active labeling method for deep learning. In 2014 International Joint Conference on Neural Networks (IJCNN), pages 112-119, 2014. 1, 3, 5, 7, 8 +[39] Yi Yang, Zhigang Ma, Feiping Nie, Xiaojun Chang, and Alexander G. Hauptmann. Multi-class active learning by uncertainty sampling with diversity maximization. In International Journal of Computer Vision, 2015. 1, 3 +[40] Donggeun Yoo and In So Kweon. Learning loss for active learning. In Proceedings of the IEEE/CVF Conference on + +Computer Vision and Pattern Recognition (CVPR), June 2019. 1, 3 +[41] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. Mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018. 2, 4 +[42] Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. In International Conference on Learning Representations (ICLR), 2021. 2 \ No newline at end of file diff --git a/activelearningbyfeaturemixing/images.zip b/activelearningbyfeaturemixing/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8e47e1b7424d0fe08bf530f0cb5ae61d16b9cae8 --- /dev/null +++ b/activelearningbyfeaturemixing/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:715590763857a3696ce5ad62c604c8e01a2ac49439ddbee1681c2014e517b98e +size 486295 diff --git a/activelearningbyfeaturemixing/layout.json b/activelearningbyfeaturemixing/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cc42c96e75d809432196ea399292bd153d49c1c1 --- /dev/null +++ b/activelearningbyfeaturemixing/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23ac8e016c0979057b4376164f8f48bcdda36556184263162d3bf5366f45a9f1 +size 429587 diff --git a/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_content_list.json b/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0db4a4dd48e5ecfa2ec972586b72fe3bcf923382 --- /dev/null +++ b/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5711639d738f5127871e81d57715c9f08e0d412af2670f912cfb6a3eb171b09 +size 68182 diff --git a/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_model.json b/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c19c34e15bed92eab8ec5e600d6a98200ca360ea --- /dev/null +++ b/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeb420eec0642bc64828b9a97611287de58832678eee7b1c4b2467126dd70c01 +size 79795 diff --git a/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_origin.pdf b/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4cb3ab5f64cd57b5858b989f6d48311292aa931e --- /dev/null +++ b/activelearningforopensetannotation/f8eb867c-f168-45b8-9d17-b2a858675320_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:189d7c6ccc1375f59d3de06da542479a34fbed95f903d89f126c781c87002cc3 +size 5843093 diff --git a/activelearningforopensetannotation/full.md b/activelearningforopensetannotation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..609e69cc6d9c1a4efd07626634f06908b3483604 --- /dev/null +++ b/activelearningforopensetannotation/full.md @@ -0,0 +1,347 @@ +# Active Learning for Open-set Annotation + +Kun-Peng Ning $^{1*}$ + +Xun Zhao $^{2\dagger}$ + +Yu Li $^{3*}$ + +Sheng-Jun Huang $^{1\dagger}$ + +$^{1}$ Nanjing University of Aeronautics and Astronautics + +$^{2}$ Applied Research Center, Tencent PCG + +$^{3}$ International Digital Economy Academy (IDEA) + +{ningkp,huangsj}@nuaa.edu.cn + +emmaxunzhao@tencent.com liyu@idea.edu.cn + +# Abstract + +Existing active learning studies typically work in the closed-set setting by assuming that all data examples to be labeled are drawn from known classes. However, in real annotation tasks, the unlabeled data usually contains a large amount of examples from unknown classes, resulting in the failure of most active learning methods. To tackle this open-set annotation (OSA) problem, we propose a new active learning framework called LfOSA, which boosts the classification performance with an effective sampling strategy to precisely detect examples from known classes for annotation. The LfOSA framework introduces an auxiliary network to model the per-example max activation value (MAV) distribution with a Gaussian Mixture Model, which can dynamically select the examples with highest probability from known classes in the unlabeled set. Moreover, by reducing the temperature $T$ of the loss function, the detection model will be further optimized by exploiting both known and unknown supervision. The experimental results show that the proposed method can significantly improve the selection quality of known classes, and achieve higher classification accuracy with lower annotation cost than state-of-the-art active learning methods. To the best of our knowledge, this is the first work of active learning for open-set annotation. + +# 1. Introduction + +The remarkable success of deep learning is largely attributed to the collection of large datasets with human annotated labels [12, 15]. Nevertheless, it is extremely expensive and time-consuming to label large scale data with high-quality annotations [26, 29]. It is thus a significant challenge to learn with limited labeled data. + +Active learning (AL) is a primary approach to tackle this problem. It iteratively selects the most useful examples from the unlabeled data to query their labels from the oracle, + +![](images/4603f171f99fc6a4c18a4acd2b6b906e941c1d16e856ba60ef53045778472b89.jpg) +Unlabeled Open-set +Figure 1. The illustration of open-set annotation (OSA) problem. The unlabeled open-set contains $K$ known classes (color images with border) and $L$ unknown classes (gray-scale images without border). The goal is to find and annotate the examples from known classes for training the classifier. + +achieving competitive performance while reducing annotation costs [10, 26, 28]. Existing AL methods typically work in a closed-set setting where the labeled and unlabeled data are both drawn from the same class distribution. + +However, in some real world scenarios, the unlabeled data are usually uncontrolled and large amounts of data examples are from unknown classes. Figure 1 displays an example of training a new sports image classification model for an image-sharing social platform, in which the database contains trillions of images from unconstrained categories uploaded by users. A large proportion of images in the unlabeled open-set are actually from irrelevant classes (e.g., cats, pianos, etc.). As these irrelevant images are not necessary for training the desired classifier, labelling these images would lead to a waste of annotation budget. On the other hand, existing closed-set AL system cannot precisely distinguish these irrelevant images from unknown classes but tends to choose them for annotation as they contain more uncertainty or information. Hence, in the real-world open-set scenario, an effective and practical AL system is highly desired, which can precisely identify the examples of un- + +wanted classes while querying the most useful cases from the wanted classes to train the classifier. + +In this paper, we formulate this problem as an open-set annotation (OSA) task. As shown in Figure 1, the unlabeled set contains $K$ known classes and $L$ unknown classes, where $L > K$ . The goal is to precisely filter out examples from unknown classes, while actively select a query set that contains examples from known classes as pure as possible. To overcome this challenge, we propose a new active learning framework called LfOSA (Learning from Open-Set Annotation), which includes two networks for detection and classification respectively. Specifically, the detector models the per-example max activation value (MAV) distribution with a Gaussian Mixture Model [21] to dynamically divide the unlabeled open-set into known and unknown set, then examples from the known set with larger certainty will be selected to construct a query set for annotation. After labeling, the classification model will be updated with the new examples from known classes. Meanwhile, as the query set will inevitably include a few invalid examples from unknown classes, these invalid examples will be utilized as negative training examples to update the detector, such that the detector can maintain a higher recall to identify known-class examples from the unlabeled open-set. Moreover, by reducing the temperature $T$ of the cross-entropy (CE) loss, the distinguishability of the detector is further enhanced. + +Experiments are conducted on multiple datasets with different mismatch ratios of known and unknown classes. The experimental results demonstrate that the proposed approach can significantly improve the selection quality of known classes, and achieve higher classification accuracy with lower annotation cost than state-of-the-art active learning methods. + +The rest of this paper is organized as follows. We review the related work in Section 2 and introduce the proposed method in Section 3. Section 4 reports the experiments, followed by the conclusion in Section 5. + +# 2. Related Work + +Active learning. Active learning as a large-scale annotation tool has achieved a great success for learning with limited labeled data [8, 20]. It reduces the labeling cost by selecting the most useful examples to query their labels. Most researches focus on designing effective sampling strategies to make sure that the selected examples can improve the model performance most [3]. During the past decades, many criteria have been proposed for selecting examples [3,5,9,16,19,22,27,32]. Among of these approaches, some of them prefer to select the most informative examples to reduce the model uncertainty [16,27,32], while some others prefer to select the most representative examples to match the data distribution [5, 22]. Moreover, some studies try to combine informativeness and representativeness to achieve better performance [9, 11]. These standard active learning + +methods are usually based on the closed-set assumption that the unlabeled data are drawn from known classes, which leads to failure on the open-set annotation (OSA) task. + +Open-set recognition. Open-set recognition (OSR) attempts to address the classification setting where inference can face examples from unseen classes during training [13,23,24]. Its goal is to learn an open-set classifier with a mechanism to reject such unknown examples [6]. A representative approach called OpenMax has achieved remarkable results on the OSR problem, which employs deep neural networks to OSR by combining Extreme Value Theory with neural networks [1]. Another follow-up work proposed G-OpenMax by adopting GAN [2,7] for generating examples which are highly similar to training examples yet do not belong any of the training classes [4]. Moreover, [17] has been some efforts to use active learning in the open-set recognition. However, these OSR methods usually fail on the OSA problem for the following two essential differences between both. First, the training process of OSR has abundant labeled data and is based on the closed-set assumption, while the OSA problem has limited labeled data and its unlabeled data are open set. Second, the OSR focuses on rejecting unknown examples in testing phase after training, while the OSA aims to find more known examples from the unlabeled open-set for target model optimizing in training phase. + +# 3. The Proposed Approach + +In this section, we first formalize the open-set annotation (OSA) problem, and then introduce the proposed LfOSA approach in detail. + +# 3.1. The OSA Problem Setting + +In the OSA problem, we consider a large-scale annotation scenario with a limited labeled set $D_{L}$ and an enormous unlabeled open-set $D_{U}$ , where $D_{L} = \{(x_{i}^{L},y_{i}^{L})\}_{i = 1}^{n^{L}}$ and $D_{U} = \{x_{j}^{U}\}_{j = 1}^{n^{U}}$ . Let $D_{U} = X_{kno} \cup X_{unk}$ and $X_{kno} \cap X_{unk} = \emptyset$ , where $X_{kno}$ and $X_{unk}$ denote the examples from known and unknown classes respectively. Each labeled example $x_{i}^{L}$ belongs to one of $K$ known classes $Y = \{y_{k}\}_{k = 1}^{K}$ , while an unlabeled example $x_{j}^{U}$ may belong to an unknown class not belonging to $Y$ . Let $X^{query}$ denotes the query set during each iteration, which consists of unknown query set $X_{unk}^{query}$ and known query set $X_{kno}^{query}$ , i.e., $X^{query} = X_{kno}^{query} \cup X_{unk}^{query}$ . The goal is to selectively construct the query set that contains known examples as many as possible. + +Active learning (AL) iteratively selects the most useful examples from the unlabeled dataset to query their labels from the oracle [26]. After annotating the newly selected data, the model can be updated to achieve better performance. Specifically, in the $i$ -th iteration, we train a classifier $f_{\theta_C}$ with parameters $\theta_C$ on labeled set $D_L$ . Then, a batch of $b$ examples $X^{query}$ are selected with a specific criterion based + +![](images/6caa79486270018ec65f2a4305c19c1410a694baf1d74825be12eb8820ea2a4b.jpg) +Figure 2. The framework of LfOSA. It includes two networks for detection and classification. The detector attempts to construct a query set for annotation by GMM modeling. After labeling, two networks will be updated for next iteration. + +on the current trained model. After querying their labels, $k_{i}$ known examples $X_{kno}^{query}$ are annotated and the labeled set is updated to $D_{L} = D_{L} \cup X_{kno}^{query}$ , while $l_{i}$ examples $X_{unk}^{query}$ with unknown classes are added to the invalid set $D_{I}$ , where $b = k_{i} + l_{i}$ . Thus, the recall and precision of known classes in the $i$ -th selection can be defined as follow, + +$$ +\operatorname {r e c a l l} _ {i} = \frac {\sum_ {j = 0} ^ {i} k ^ {i}}{n _ {k n o}}, \tag {1} +$$ + +$$ +p r e c i s i o n _ {i} = \frac {k _ {i}}{k _ {i} + l _ {i}}, \tag {2} +$$ + +where $n_{kno}$ denotes the number of examples from known classes in the unlabeled set. $recall_i$ calculates how many known examples are queried after $i$ queries, and $precision_i$ denotes the proportion of the target examples in the $i$ -th query. Obviously, if we maintain a high precision and recall to accurately select known examples, the trained target classifier will be more effective. + +As discussed in the Introduction, most of the traditional AL methods are less effective in OSA problem, because their selection strategies tend to select open-set (unknown) examples with larger uncertainty. These examples from unknown classes are useless for training the target model, and thus traditional AL methods will probably fail with serious waste of the annotation budget. Fortunately, we should be aware that although these examples are useless for the target model, they could be exploited to improve the detector model for filtering out unknown classes from the open-set data. Moreover, we find that the activation (penultimate) layer of network has strong ability to distinguish unknown classes based on the observation that the maximum activation value (MAV) of open set examples are often far away from the average MAV of closed set examples. By decoupling detection and classification, we propose to exploit examples of both known and unknown classes to train a detector with strong distinguishability meanwhile train a more effective classifier for the target task. + +# 3.2. Algorithm Detail + +The framework of LfOSA is demonstrated in Figure 2, which mainly composed of three components: detector training, active sampling and classifier training. Specifically, we first train a network for detecting unknown examples by exploiting both known and unknown supervision while using a low-temperature mechanism. Then, by modeling per-example max activation value (MAV) distribution with a Gaussian Mixture Model (GMM), the most certain known examples can be actively selected for annotation. Finally, the classification model will be updated with the new examples from known classes. In the following part of this section, we will introduce these three components in detail. + +Detector training. In addition to classifying $K$ known classes, the detector has been extended with an additional $(K + 1)$ -th output to predict unknown class. For a given example $x$ from labeled or invalid set, we encode its label $c$ with one-hot $p$ , i.e., the value of $p_c$ is set to 1 and the others to 0. Then, we train the detector with the following cross-entropy loss: + +$$ +\mathcal {L} _ {D} (x, c) = - \sum_ {c = 1} ^ {K + 1} p _ {c} * \log \left(q _ {c} ^ {T}\right), \tag {3} +$$ + +where + +$$ +q _ {c} ^ {T} = \frac {e x p (a _ {c} / T)}{\sum_ {j} e x p (a _ {j} / T)}, +$$ + +where $a_{c}$ is the $c$ -th activation value of the last fully-connected layer, $T$ is a temperature, which is set with a lower value $(T = 0.5)$ to produce a sharper probability distribution $q_{c}^{T}$ over classes. Obviously, by minimizing the loss function, examples of known classes will have larger activation values on the first $K$ dimensions and smaller activation values on the $(K + 1)$ -th dimension, while examples of unknown classes have the opposite phenomenon. Moreover, we find that the distinguishability of the activation layer can be further enhanced by reducing the temperature $T$ of the + +loss function. A brief analysis is as follows: + +$$ +\frac {\partial \mathcal {L} _ {D}}{\partial a _ {c}} = \frac {1}{T} \left(q _ {c} ^ {T} - p _ {c}\right) = \frac {1}{T} \left(\frac {\exp \left(a _ {c} / T\right)}{\sum_ {j} \exp \left(a _ {j} / T\right)} - p _ {c}\right). \tag {4} +$$ + +When we reduce the temperature $(T\downarrow)$ of the loss function $\mathcal{L}_R$ , the probability distribution $q_{c}^{T}$ will be more sharper, thus we have: + +$$ +T \downarrow \Rightarrow \frac {1}{T} \uparrow , \frac {\exp (a _ {c} / T)}{\sum_ {j} \exp (a _ {j} / T)} - p _ {c} \uparrow \Rightarrow \frac {\partial \mathcal {L} _ {D}}{\partial a _ {c}} \uparrow . +$$ + +As $\frac{\partial\mathcal{L}_R}{\partial a_c}$ becomes larger, the examples of known and unknown classes will be more distinguishable for the activation value $a_{c}$ . + +Active sampling. As mentioned earlier, the goal of OSA task is to precisely select as many known-class examples as possible from the unlabeled open-set. After training the detector as shown above, we find that the activation (penultimate) layer of network has the ability to distinguish unknown examples, that is, the maximum activation value (MAV) of unknown-class examples are often significantly different from the average MAV of known-class examples. Formally, for each unlabeled example $x_{i}$ with predicted class $c$ , its maximum activation value $mav_{i}^{c}$ can be defined as follow: + +$$ +m a v _ {i} ^ {c} = \max _ {c} a _ {c} ^ {i}. \tag {5} +$$ + +All unlabeled examples will be classified into $K + 1$ classes according to the prediction of the current detector. We can select the examples predicted as the first $K$ known classes for the next process while filtering out the examples predicted as "unknown". Then, for each known class $c$ , we fit a two-component GMM (one for known classes and the other for unknown classes) to $mav^c$ using the Expectation-Maximization algorithm, where $mav^c$ is a set of activation values with prediction class $c$ . + +$$ +\mathcal {W} ^ {c} = G M M (m a v ^ {c}, \theta_ {D}), \tag {6} +$$ + +where $\mathcal{W}^c$ is the probabilities of class $c$ . For each unlabeled example $x_{i}$ from class $c$ , its known probability $w_{i}\in \mathcal{W}^{c}$ is the posterior probability $p(g|mav_i)$ , where $g$ is the Gaussian component with larger mean (larger activation value). Then we merge and sort the probabilities of all categories, + +$$ +\mathcal {W} = \operatorname {s o r t} \left(\mathcal {W} ^ {1} \cup \mathcal {W} ^ {2} \cup \dots \cup \mathcal {W} ^ {K}\right). \tag {7} +$$ + +Next, we select the first $b$ examples with highest probability as the query set to ask for annotation. In other words, we can obtain the query set $X^{query}$ by setting a threshold $\tau$ on $w_{i}$ , where $\tau$ is equal to the $b$ -th largest known probability: + +$$ +X ^ {q u e r y} = \left\{\left(x _ {i}, w _ {i}\right) | w _ {i} \geq \tau , \forall \left(x _ {i}, w _ {i}\right) \in \left(D _ {U}, \mathcal {W}\right) \right\}. \tag {8} +$$ + +After querying their labels, the labeled and unknown sets will be updated by adding $X_{kno}^{query}$ and $X_{unk}^{query}$ , respectively. + +Algorithm 1 The LfOSA algorithm +1: Input: +2: Current detector $f_{\theta_D}$ and classifier $f_{\theta_C}$ +3: Current labeled set $D_L$ and invalid set $D_I$ +4: Query batch size $b$ and temperature $T$ +5: Process: +6: # Recognizer training +7: Update $\theta_D$ by minimizing $\mathcal{L}_D$ in Eq. 3 from $D_L$ and $D_I$ +8: # Examples sampling +9: Inference $mav_i^c$ from detector $\theta_D$ for each unlabeled example $x_i$ as Eq. 5 +10: while $c = 1, 2, \dots, K$ do +11: # Collect the MAV set for each prediction class $c$ +12: $mav^c = \{mav_i^c | f_{\theta_D}(x_i) = c, \forall x_i \in D_U\}$ +13: # Obtain known probability by GMM +14: $W^c = GMM(mav^c, \theta_D)$ +15: end +16: # Merge and sort the probability sets of all classes +17: $W = sort(\mathcal{W}^1 \cup \mathcal{W}^2 \cup \dots \cup \mathcal{W}^K)$ +18: # Obtain the query set +19: $X^{query} = \{(x_i, w_i) | w_i \geq \tau, \forall (x_i, w_i) \in (D_U, W)\}$ +20: # Ask for annotation from Oracle +21: Query their labels and obtain $X_{kn}^{query}$ and $X_{unk}^{query}$ +22: # Update labeled and invalid sets +23: $D_L = D_L \cup X_{kn}^{query}, D_I = D_I \cup X_{unk}^{query}$ +24: # Classifier training +25: Update $\theta_C$ by minimizing $\mathcal{L}_C$ in Eq. 9 from $D_L$ +26: Output: $\theta_D, \theta_C, D_L$ and $D_I$ for next iteration. + +Classifier training. Based on the current labeled data $D_{L}$ , we train the $K$ -class classifier by minimizing the standard cross-entropy loss: + +$$ +\mathcal {L} _ {C} \left(x _ {i}, y _ {i}\right) = - \sum_ {i = 1} ^ {n ^ {L}} y _ {i} * \log \left(f \left(x _ {i}; \theta_ {C}\right)\right), \tag {9} +$$ + +where $(x_{i},y_{i})\in D_{L}$ , and $n^L$ is the size of current $D_{L}$ . + +The process of the approach is summarized in Algorithm 1. Firstly, a small set of labeled data $D_{L}$ , query batch size $b$ and temperature $T$ are given. Then the detector $\theta_{D}$ and classifier $\theta_{C}$ are randomly initialized, and the invalid set $D_{I}$ is initialized as an empty set. At each iteration, we train the detector by minimizing Eq. 3 to inference $mav_{i}^{c}$ for all unlabeled examples. Next, for each class, we collect the MAV set by the predictions of the detector and model per-example MAV to obtain known probabilities. After that, by merging and sorting these probabilities, the first $b$ examples with highest probability are selected as the query set to ask for annotation. As a result, the classifier $\theta_{C}$ , labeled and invalid sets can be updated and output for the next iteration. + +![](images/ab384c6d3cf1c90732e74a09552a77a80059ce99b39f27cd378f122e9ce9a86a.jpg) + +![](images/e735847400932035170a94d2c03973f84fee929681c84f72a0083f2ff057d06b.jpg) + +![](images/0d55de76654fbb8a0b138cf313449007dc98563abfc1397e140fc683f818dc05.jpg) + +![](images/c34c1050438efde4b03cd8431e662fdc4cf773fdcf98ed6c9e6bd2bdaa224a17.jpg) + +![](images/bde4287fab67a78b5095341006476dc21c7447314b213fc2aff646bf8e08b3ee.jpg) + +![](images/88369b7ce9b3dd19adf6b62eb800819cd53ca9c3ed88ff5a80610dd081197953.jpg) + +![](images/3e77cfd39a6e7e7ec0fc7a25ca148685d9b006b6bf0bd703e244f44fceafbe00.jpg) +Figure 3. Selection recall comparison on CIFAR10 (first row), CIFAR100 (second row) and Tiny-Imagenet (third row) with $20\%$ (first column), $30\%$ (second column) and $40\%$ (third column) mismatch ratio. + +![](images/52f7f39fa0580b9611891519284a6b379421944dac61c21f35930bb29a0695be.jpg) + +![](images/cad47e53c70d08c8e7da5d2dc1672b977979021710df1bd2b9f40b102dc7bf82.jpg) + +# 4. Experiments + +To validate the effectiveness of the proposed approach, we perform experiments on CIFAR10, CIFAR100 [14] and Tiny-Imagenet [31] datasets, which contains 10, 100, 200 categories respectively. To construct open-set datasets, we set mismatch ratio as $20\%$ , $30\%$ and $40\%$ for all our experiments, where the mismatch ratio denotes the proportion of the number of known classes in the total number of classes. For example, when the mismatch ratio is set as $20\%$ , on CIFAR10, CIFAR100 and Tiny-Imagenet, the first 2, 20, 40 classes are known classes for classifier training, and the last 8, 80, 160 classes are seen as unknown classes respectively. + +Baselines. To validate the effectiveness of the proposed LfOSA approach, we compare the following methods in the experiments. i) Random: it randomly selects examples from unlabeled pool for labeling. ii) Uncertainty [16, 18]: it selects the examples with largest uncertainty of predictions for annotation. iii) Certainty [16, 18]: it selects the examples with largest certainty of predictions for annotation. iv) Coreset [25]: it selects the representative examples by diver + +sity. v) BALD [30]: it uses dropout as an approximation to Bayesian inference for active sampling. vi) OpenMax [1]: a representative open-set recognition approach. vii) LfOSA (ours): the proposed approach. + +Active learning setting. For all AL methods, we randomly sampling $1\%$ , $8\%$ and $8\%$ examples as initialization labeled set on CIFAR10, CIFAR100 and Tiny-Imagenet datasets, that is, each category contains only 50, 40 and 40 examples respectively. It is worth to note that the labeled sets only contain known classes. In each AL cycle, we train a ResNet18 model for 100 epochs, SGD is adopted as the optimizer with momentum 0.9, weight decay 5e-4, initialization learning rate 0.01, and batch size of 128, while a batch of 1500 examples is selected to query their labels for the next AL round. + +Performance measurement. We compare the proposed LfOSA approach with other compared methods in the performance of selection recall (as Eq. 1), precision (as Eq. 2) and classification accuracy. Moreover, we perform the experiments for 4 runs and record the average results over 4 seeds $(\text{seed} = 1, 2, 3, 4)$ . + +![](images/0805d95a4794ad4e31433392350cb32e1894f81b26f4b28f6c5debbc45509377.jpg) + +![](images/1a1fa6baa28bfdf1589a301281e81bb6bab0a11568221e415368b8e93acc8306.jpg) + +![](images/36efee0d5ae2f6c44435479f6aa88fd6b364bd1e49b4c18070b7ee8a6da97910.jpg) + +![](images/2b47ac38f09203f3184c136f0bf026ceecedd5c911de753a4bedc25464e62cf9.jpg) + +![](images/c4d8c12cf9da3ffd242e8cbfbb54ba819db90472421802af129d8d556055e018.jpg) + +![](images/df4f9874a7f979e6f3756a67bef10eb94eee65a68f3d1c075678478f8d42ef49.jpg) + +![](images/30eaa5fb144b31cfd11acf3deda79a52fda1d42c9f3ea19ef0e5cf5803f16674.jpg) +Figure 4. Selection precision comparison on CIFAR10 (first row), CIFAR100 (second row) and Tiny-Imagenet (third row) with $20\%$ (first column), $30\%$ (second column) and $40\%$ (third column) mismatch ratio. + +![](images/4470a244400f14f51d102e3fbe4864e903c5adfdd9f0f9337d79198dd6d0b291.jpg) + +![](images/df975f68a5c681684eba8a02901da8cae70b8fdf0881509c760678cfd0c26dcc.jpg) + +# 4.1. Performance Comparison + +We evaluate the performance of the proposed LfOSA and compared methods by plotting curves with the number of queries increasing. The average results of recall, precision, accuracy are demonstrated in Figure 3, 4 and 5 respectively. The first, second and third rows represent the results on CIFAR10, CIFAR100 and TinyImagenet respectively. The first, second and third columns represent the results with $20\%$ , $30\%$ and $40\%$ mismatch ratio. + +It can be observed that no matter which dataset or mismatch ratio is used, the proposed LfOSA approach always outperforms other methods in all cases. LfOSA can achieve higher selection recall and precision during the AL process, while achieving better classification performance. i) For the performance of recall, the proposed LfOSA approach consistently outperforms other compared methods by a significant margin. Especially on CIFAR10 and CIFAR100, when the mismatch ratio is set to $20\%$ , $30\%$ and $40\%$ , the average margins between the LfOSA and Random methods are $68.8\%$ , $53.4\%$ and $35.7\%$ in the former and $34.3\%$ , $26.7\%$ and $20.5\%$ in the later. ii) For the performance of precision, the pro + +posed LfOSA approach always maintain a higher selection precision than other baselines with a clear gap. It worth to note that adding invalid examples can significantly improve the detection ability (the precision of the first three queries is improving). Besides, as the number of known examples decreases, the precision is forced to decrease (the precision of the 10-th query is only $20\%$ on "CIFAR10 with $20\%$ mismatch ratio" because its recall has reached $96.7\%$ ). iii) For the performance of classification, LfOSA consistently exhibits the best performance in all cases. Especially on CIFAR100, compared to other AL methods, LfOSA achieves about $20\%$ , $15\%$ and $12\%$ performance improvement under the $20\%$ , $30\%$ , $40\%$ mismatch ratios respectively. Moreover, with the increase of unknown ratio, the superiority of LfOSA over the other methods becomes more significant. These results indicate that the proposed LfOSA method can effectively solve the open-set annotation (OSA) problem. + +Compared methods analysis. It is interesting to observe that two popular AL methods, Uncertainty and BALD, perform worse even than the random method in most cases. One possible reason is that these informativeness-based AL + +![](images/9fbbc2f0a89efd1b845cbe8550f9803e76a3a79662b37cae67032f52317ed41b.jpg) + +![](images/71b08129848d9bbd99ec3ae0c799d1cedd16441a2d8995d8a7be75a5a161797c.jpg) + +![](images/39149a67f2c2e42ac6a0528064972b69e77540eb08464927025fe54895623ce6.jpg) + +![](images/5476614b0db3497ae252ba85be78e3995d8e6e47475ef9c9fb4d0a454b00e12a.jpg) + +![](images/8bef42be78fa33626fa7c8f0da068e63c52a5c01f46441dbb01c5b892afde07f.jpg) + +![](images/1d656a75eb7d776afa6988bbd0f137408f8d47a08b7dfa38597a131f376e474f.jpg) + +![](images/4fac0be2be95f653cacb8b984e9cdb5a6b3d6a0b08acbb93f2fdc9242121e9eb.jpg) +Figure 5. Classification performance comparison on CIFAR10 (first row), CIFAR100 (second row) and Tiny-Imagenet (third row) with $20\%$ (first column), $30\%$ (second column) and $40\%$ (third column) mismatch ratio. + +![](images/8a5b6d4ee7ebc3b0f4058757f50072101d3e74dc7b543e2daba58843b61cd01e.jpg) + +![](images/2af3c247960572d7100cb7c99e4262ad5ba147f62ce82ae2b82dfce09607042e.jpg) + +![](images/8139806adc7cd248f3ddbd0017772172606da901922baeb4d1e61f5f10cc59c5.jpg) +Figure 6. Classification recall (first column), precision (second column), F1 (third column) performance comparison on CIFAR100 with $20\%$ mismatch ratio. + +![](images/0445ae6e2e3500bb4773efdcbece6471a41fc975fc17810c1ceff100b34e941e.jpg) + +![](images/a5494ebaeb0fdf215354536d039445a94bfb2c0b51f3bee912d7d1aec9b061d1.jpg) + +methods tend to select unknown classes, because these unknown examples are more likely to be the most informative ones. On the other hand, the Certainty method also fails in the OSA problem, which means it may not be accurate to measure the certainty of examples by using the model's prediction entropy. The diversity-based Coreset method and the open-set recognition method OpenMax show limited effectiveness in the OSA tasks. The former has no recognition + +ability for unknown classes, and the latter lacks sufficient supervision information. + +# 4.2. Results Using More Metrics + +The comparisons of classification recall, precision, and F1. To further validate the effectiveness of the proposed LfOSA approach, we compare with other methods in terms of classification recall, precision, and F1 on CIFAR100 with + +![](images/5b6d8d09913115f42b8d44ac70cbf0b5141c950d99bee5acd6298c78c05c2081.jpg) +Figure 7. Accuracy / Recall (after 10 queries) $\nu$ s. openness on CIFAR100. + +![](images/3ccc1dab1b3160121e31fe0f2a116a392d6595ceaa7773c3e3ea56cab81add3e.jpg) +Figure 8. Accuracy / Recall (after 10 queries) v.s. different $b$ on CIFAR100 with $20\%$ mismatch ratio. + +$20\%$ mismatch ratio. The experimental results are demonstrated in Figure 6. It can be observed that the proposed LfOSA approach always significantly outperforms other methods in all cases. LfOSA can achieve higher classification recall, precision, and F1 score. + +The comparison of time complexity. The time complexity of LfOSA is $o(kn)$ , where $n$ denotes the number of unlabeled data, and $k$ denotes the number of known classes. We have measured the time costs of different methods for one query on CIFAR100. As shown in Table 1, LfOSA is one of the most efficient methods. + +Table 1. The comparison of time complexity. + +
RandomCertaintyOpenmaxCoresetBALDLfOSA
~ 0s23s29s165s182s26s
+ +# 4.3. Ablation Study + +To further analyze the proposed LfOSA approach, we conduct following ablation study on CIFAR100 with $20\%$ mismatch ratio. + +The effect of openness. We study the effect of openness for all compared methods, where the openness denotes how many open-set examples in the unlabeled pool. By increasing the openness from $0\%$ (closed-set) to $90\%$ on CIFAR100, we record the results of final accuracy and recall after 10 queries. The experimental results are plotted in Fig 7. When openness is $0\%$ or very small, LfOSA performs worse than most closed-set methods. With larger openness, the advantage of LfOSA in terms of both accuracy and recall becomes more noticeable. + +The effect of batch size. The results on the effect of batch size $b$ is in Fig 8. Our method consistently achieve the best performance when $b = 500, 1000, 1500, 2000, 2500$ . + +The effect of each component for LfOSA. The experimental results on the effect of each component for LfOSA are demonstrated in Figure 9. Where w/o temperature and high temperature denote the temperature $T$ is set to 1 and 2 respectively. w/o Detector denotes the detector is not used, which means it employs for both detection and classification tasks. Similarly, w/o Classifier denote the classifier is not used. Dichotomies refers to using a binary classification to replace the detector. w/o invalid set denotes the detector + +![](images/aeb9a6032f027cf94721249b43ff65954c484d4eb5a9e44e007c198c82ad70a4.jpg) + +![](images/4edfa70dde49a7ac61c3ecdd6425db5c2bed07428aef24517c00fe22b523a9d8.jpg) + +training without using the invalid set. Removing or replacing a component of LfOSA will damage its performance. + +![](images/8246e594c8ab56e6e8b25d199abfdd03f7fc0a5aabfb54b5fa3fc7b8a7295d39.jpg) +Figure 9. The effect of each component for LfOSA on CIFAR100 with $20\%$ mismatch ratio. + +# 5. Conclusion + +In this paper, we formulate a new open-set annotation (OSA) problem for real-world large-scale annotation tasks. It introduces a practical challenge on how to maintain a high recall in identifying the examples of known classes for target model training from a massive unlabeled open-set. To overcome this challenge, we propose an active learning framework called LfOSA to precisely select examples of known classes by decoupling detection and classification. By minimizing low-temperature cross-entropy loss, it exploits both known and unknown supervision to train a detector, whose activation values will be fed into a mixture Gaussian model to estimate the per-example max activation value (MAV) distribution. Based on MAV distribution, we can distinguish examples of known classes against unknown classes in unlabeled data to build a query set for annotation. The classifier is then updated with labeled data. Experimental results on various tasks show the superiority of the LfOSA approach. In the future, we will extend the OSA problem to other computer vision tasks, e.g., object detection. + +# 6. Acknowledgments + +This research was supported by the National Key R&D Program of China (2020AAA0107000), NSFC (61732006, 62076128), and Natural Science Foundation of Jiangsu Province of China (BK20211517). + +# References + +[1] Abhijit Bendale and Terrance E Boult. Towards open set deep networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1563-1572, 2016. 2, 5 +[2] Antonia Creswell, Tom White, Vincent Dumoulin, Kai Arulkumaran, Biswa Sengupta, and Anil A Bharath. Generative adversarial networks: An overview. IEEE Signal Processing Magazine, 35(1):53-65, 2018. 2 +[3] Yifan Fu, Xingquan Zhu, and Bin Li. A survey on instance selection for active learning. Knowledge and information systems, 35(2):249-283, 2013. 2 +[4] ZongYuan Ge, Sergey Demyanov, Zetao Chen, and Rahul Garnavi. Generative openmax for multi-class open set classification. arXiv preprint arXiv:1707.07418, 2017. 2 +[5] Stuart Geman, Elie Bienenstock, and René Doursat. Neural networks and the bias/variance dilemma. Neural computation, 4(1):1-58, 1992. 2 +[6] Chuanxing Geng, Sheng-jun Huang, and Songcan Chen. Recent advances in open set recognition: A survey. IEEE transactions on pattern analysis and machine intelligence, 2020. 2 +[7] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 27, 2014. 2 +[8] Xian-Sheng Hua and Guo-Jun Qi. Online multi-label active annotation: towards large-scale content-based video search. In Proceedings of the 16th ACM international conference on Multimedia, pages 141-150, 2008. 2 +[9] Sheng-Jun Huang, Rong Jin, and Zhi-Hua Zhou. Active learning by querying informative and representative examples. In Advances in neural information processing systems, pages 892-900, 2010. 2 +[10] Sheng-Jun Huang, Jia-Wei Zhao, and Zhao-Yang Liu. Cost-effective training of deep cnns with active model adaptation. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1580–1588, 2018. 1 +[11] Sheng-Jun Huang and Zhi-Hua Zhou. Active query driven by uncertainty and diversity for incremental multi-label learning. In 2013 IEEE 13th International Conference on Data Mining, pages 1079-1084, 2013. 2 +[12] Sheng-Jun Huang, Chen-Chen Zong, Kun-Peng Ning, and Hai-Bo Ye. Asynchronous active learning with distributed label querying. 1 +[13] Lalit P Jain, Walter J Scheirer, and Terrance E Boult. Multiclass open set recognition using probability of inclusion. In European Conference on Computer Vision, pages 393-409, 2014. 2 +[14] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 5 +[15] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436-444, 2015. 1 +[16] David D Lewis and William A Gale. A sequential algorithm for training text classifiers. In SIGIR '94, pages 3-12, 1994. 2, 5 + +[17] Zhao-Yang Liu and Sheng-Jun Huang. Active sampling for open-set classification without initial annotation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4416-4423, 2019. 2 +[18] Wenjie Luo, Alex Schwing, and Raquel Urtasun. Latent structured active learning. Advances in Neural Information Processing Systems, 26:728-736, 2013. 5 +[19] Kun-Peng Ning, Lue Tao, Songcan Chen, and Sheng-Jun Huang. Improving model robustness by adaptively correcting perturbation levels with active queries. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 9161-9169, 2021. 2 +[20] Buyue Qian, Xiang Wang, Jun Wang, Hongfei Li, Nan Cao, Weifeng Zhi, and Ian Davidson. Fast pairwise query selection for large-scale active learning to rank. In 2013 IEEE 13th International Conference on Data Mining, pages 607-616, 2013. 2 +[21] Douglas A Reynolds. Gaussian mixture models. Encyclopedia of biometrics, 741:659-663, 2009. 2 +[22] N Roy and A McCallum. Toward optimal active learning through sampling estimation of error reduction. int. conf. on machine learning, 2001. 2 +[23] Walter J Scheirer, Anderson de Rezende Rocha, Archana Sapkota, and Terrance E Boult. Toward open set recognition. IEEE transactions on pattern analysis and machine intelligence, 35(7):1757-1772, 2012. 2 +[24] Walter J Scheirer, Lalit P Jain, and Terrance E Boult. Probability models for open set recognition. IEEE transactions on pattern analysis and machine intelligence, 36(11):2317-2324, 2014. 2 +[25] Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint arXiv:1708.00489, 2017. 5 +[26] Burr Settles. Active learning literature survey. Technical report, University of Wisconsin-Madison Department of Computer Sciences, 2009. 1, 2 +[27] H Sebastian Seung, Manfred Opper, and Haim Sompolinsky. Query by committee. In Proceedings of the fifth annual workshop on Computational learning theory, pages 287-294, 1992. 2 +[28] Li-Li Sun and Xi-Zhao Wang. A survey on active learning strategy. In 2010 International Conference on Machine Learning and Cybernetics, volume 1, pages 161-166, 2010. 1 +[29] Ying-Peng Tang, Xiu-Shen Wei, Borui Zhao, and Sheng-Jun Huang. Qbox: Partial transfer learning with active querying for object detection. IEEE Transactions on Neural Networks and Learning Systems, 2021. 1 +[30] Toan Tran, Thanh-Toan Do, Ian Reid, and Gustavo Carneiro. Bayesian generative active deep learning. In International Conference on Machine Learning, pages 6295-6304, 2019. 5 +[31] Leon Yao and John Miller. Tiny imagenet classification with convolutional neural networks. CS 231N, 2(5):8, 2015. 5 +[32] Xinge You, Ruxin Wang, and Dacheng Tao. Diverse expected gradient active learning for relative attributes. IEEE transactions on image processing, 23(7):3203-3217, 2014. 2 \ No newline at end of file diff --git a/activelearningforopensetannotation/images.zip b/activelearningforopensetannotation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0e951a6312a1bfe8c45ae864de9acbd8f411356b --- /dev/null +++ b/activelearningforopensetannotation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e72fb442b6a601f04a659f274607f9643b4b7803bad1b50a0aee30c6db7ede17 +size 779168 diff --git a/activelearningforopensetannotation/layout.json b/activelearningforopensetannotation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..56c9e0e5fbaf4243d086d36fcc0791773938296e --- /dev/null +++ b/activelearningforopensetannotation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63b1068e3ef4dcff98ecd83004da80a44ecb43a411f8f3946d3b7b998e41a438 +size 454286 diff --git a/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_content_list.json b/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8091a90dcd0de6d44dc8a2ff87a6196aed936012 --- /dev/null +++ b/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86a656fb7c714091f68ad81888d64798a96ead3953cec8dab429b885efa0b681 +size 80207 diff --git a/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_model.json b/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ac2263607981dfd4cf0f383b0b9a95534a5f20a7 --- /dev/null +++ b/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d13115a90262286654e994ebd94e4473025d12a0420daf9c79c3a49ce8713b33 +size 98553 diff --git a/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_origin.pdf b/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..542a592b84fc82f0052d47a4b7684b29312b0d56 --- /dev/null +++ b/activeteacherforsemisupervisedobjectdetection/0caecd26-d9a6-44b5-a998-5fef3ce83a02_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:494fc9d352e582f8b5d488a5fb08edcf1a5470a6a5f20f1eda62ecf783cc46f2 +size 2229497 diff --git a/activeteacherforsemisupervisedobjectdetection/full.md b/activeteacherforsemisupervisedobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..403a4147d70756b6be7688a48f2d6c49648575a0 --- /dev/null +++ b/activeteacherforsemisupervisedobjectdetection/full.md @@ -0,0 +1,365 @@ +# Active Teacher for Semi-Supervised Object Detection + +Peng Mi $^{1*}$ ; Jianghang Lin $^{1*}$ ; Yiyi Zhou $^{1*}$ ; Yunhang Shen $^{1}$ , Gen Luo $^{1}$ , Xiaoshuai Sun $^{1}$ , Liujuan Cao $^{1\dagger}$ , Rongrong Fu $^{2}$ , Qiang Xu $^{2}$ , Rongrong Ji $^{1}$ + +1Media Analytics and Computing Lab, School of Informatics, Xiamen University, 361005, China. + +$^{2}$ Ascend Enabling Laboratory, Huawei Technologies, China. + +{mipeng,hunterjlin007,luogen}@stu.xmu.edu.cn,{zhouyiyi,xssun,caoliujuan,rrji}@xmu.edu.cn, + +shenyunhang01@gmail.com,{furongrong, xuqiang40}@huawei.com + +# Abstract + +In this paper, we study teacher-student learning from the perspective of data initialization and propose a novel algorithm called Active Teacher for semi-supervised object detection (SSOD). Active Teacher extends the teacher-student framework to an iterative version, where the label set is partially initialized and gradually augmented by evaluating three key factors of unlabeled examples, including difficulty, information and diversity. With this design, Active Teacher can maximize the effect of limited label information while improving the quality of pseudo-labels. To validate our approach, we conduct extensive experiments on the MS-COCO benchmark and compare Active Teacher with a set of recently proposed SSOD methods. The experimental results not only validate the superior performance gain of Active Teacher over the compared methods, but also show that it enables the baseline network, i.e., Faster-RCNN, to achieve $100\%$ supervised performance with much less label expenditure, i.e. $40\%$ labeled examples on MS-COCO. More importantly, we believe that the experimental analyses in this paper can provide useful empirical knowledge for data annotation in practical applications. + +# 1. Introduction + +Recent years have witnessed the rapid development of object detection supported by a flurry of benchmark datasets [9, 11, 22, 32] and methods [13-15, 23, 26, 28, 29]. Despite great success, the expensive instance-level annotation has long plagued the advancement and application of existing detection models. To this end, how to save labeling expenditure has become a research focus in object detection [4, 5, 17, 17, 24, 25, 33, 35, 36, 38, 40, 41]. + +![](images/06a9b39adca0cfca3083c7d37316b906c93d43109ff734eedf9c4a58cbb73fdd.jpg) +Figure 1. The performance comparison between Active Teacher and the state-of-the-art (SOTA) method [24] with different proportions of labeled data in MS-COCO. Active Teacher exceeds $100\%$ fully supervised performance with only $40\%$ label information. + +Inspired by recent success in image classification [2, 3, 19, 34, 39], some practitioners resort to teacher-student learning for semi-supervised object detection (SSOD) [24, 35, 37]. Specifically, this methodology uses a teacher network with weakly augmented labeled data to generate high-quality pseudo-labels for the student network with strong data augmentation [8, 10, 44]. This self-training process helps the model explore large amounts of unlabeled data based on a very limited number of annotations. Following this methodology, Sohn et al. [35] proposed the first teacher-student framework called STAC for SSOD. This simple framework outperforms the existing semi-supervised methods [4, 33, 36, 38] by a large margin, showing the great potential of teacher-student learning in object detection. + +Some very recent SSOD works [24, 37, 50] are proposed to improve this methodology. For instances, Liu et al. [24] apply exponential moving average (EMA) [39] to train a gradually progressing teacher to alleviate the class + +imbalance and over-fitting issues. Zhou et al. [50] propose an instant pseudo labeling strategy to reduce the impact of the confirmation bias and improve the quality of pseudo labeling. In [37], Tang et al. adopt a detection-specific data ensemble to produce more reliable pseudo-labels. Conclusively, these methods mainly focus on the framework optimization or the negative impact of noisy pseudo-labels, of which contributions are orthogonal to ours. + +In this paper, we study this semi-supervised methodology from the perspective of data initialization. More specifically, we investigate how to select the optimal labeled examples for teacher-student learning in SSOD. To explain, although a plenty of pseudo-labels are generated for self-training, ground-truth label information still plays a key role in the infant training phase, which determines the quality of pseudo-labels and the performance lower-bound of the teacher networks [24, 35, 50]. Meanwhile, in some teacher-student methods [24, 31], the pseudo-labels are only used to optimize the predictions of object categories and foreground-background proposals, while the optimization of bounding boxes regression still relies on the ground-truth annotations. In this case, we observe that ground-truth label information plays an important role in SSOD, which, however, is still left unexplored. + +To this end, we propose a new teacher-student method, coined as Active Teacher, for semi-supervised object detection. As shown in Fig. 2, Active Teacher extends the conventional teacher-student framework to an iterative one, where the label set is partially initialized and gradually augmented via a novel active sampling strategy. With this modification, Active Teacher can maximize the effect of limited label information by active sampling, which can also improve the quality of pseudo-labels. We further investigate the selection of labeled examples from the aspects of difficulty, information and diversity, and the values of these metrics are automatically combined without hyper-parameter tuning. Through these metrics, we can explore what kind of data are optimal for SSOD. + +To validate the proposed method, we conduct extensive experiments on the benchmark dataset, namely MS COCO $[22]^2$ . The experimental results not only confirm the significant performance gains of Active Teacher against a set of state-of-the-art SSOD methods, e.g., $+6.3\%$ and $+23.3\%$ compared with Unbiased Teacher [24] and STAC [35] on $5\%$ MS-COCO, respectively. It also shows that Active Teacher enables the baseline detection network, i.e., Faster-RCNN [29], to achieve $100\%$ supervised performance with much less labeling expenditure, e.g., with $40\%$ labeled examples on MS-COCO, as shown in Fig. 1. More importantly, we also provide the in-depth analyses for active sampling, which can give useful hints for data annotation in practical applications of object detection. + +In summary, our contribution is two-fold: + +- We present the first attempt of studying data initialization in teacher-student based semi-supervised object detection (SSOD), and conduct extensive experiments for different sampling strategies. These quantitative and qualitative analyses can provide useful references for data annotation in practical applications. +- We propose a new teacher-student framework for SSOD called Active Teacher, which not only outperforms a set of SSOD methods on the benchmark dataset, but also enables the baseline detection network achieve $100\%$ fully supervised performance with much less label expenditure. + +# 2. Related Work + +Object Detection. With the rapid development of deep neural networks, object detection has achieved great progress both academically and industrially [13-16, 20, 23, 26-29]. Object detection is roughly divided into two genres: one-stage and two-stage detectors. The representative work of one-stage methods includes YOLO [13, 26-28], SSD [23], etc., and the ones of two-stage models include RCNN series [14, 15, 29] and its variants [16, 20]. The main difference between these two methodologies is that the one-stage method directly predicts the coordinates and probability distribution of the object based on the feature map, while the two-stage methods use region proposal networks [29] to sample potential objects, and further predict the probability distribution and coordinate information of the object, respectively. Following the prior works [24, 35, 50], we focus the semi-supervised learning of two-stage models and use Faster-RCNN [29] as our baseline network. + +Semi-Supervised Object Detection. In the field of computer vision, most existing researches on semi-supervised learning mainly focus on image classification [1, 7, 19, 45], which can be roughly divided into consistency-based and pseudo labeling based methods, respectively. Consistency-based approaches [2, 3, 12, 17, 34] constrain the model to make it robust to noise via producing consistent prediction results. Pseudo labeling [1, 24, 34, 35, 37, 50] methods firstly train the classifiers with ground-truth annotations and generate pseudo-labels for unlabeled data, and finally retrain models with all data. Recently, some works [17, 18, 24, 35, 50] apply semi-supervised learning to object detection. CSD [17] randomly flips images multiple times, driving the model to produce consistent predictions for these flipped images. ISD [18] uses mixup [49] to constrain model training. Following the popular teacher-student framework [39], STAC [35] proposes the first teacher-student based framework for SSOD. Due to the static annotating strategy, the pseudo-labels in STAC are fixed, which limits the final detection performance. In Instant-Teaching [50], both teacher + +![](images/841e7059a51246b77c89df86b473e015c0e2eb8700b71d1f69a914b89620f0aa.jpg) +Figure 2. The overall framework of the proposed Active Teacher. In Active Teacher, the label set is partially initialized and gradually augmented after each semi-supervised training. Active Teacher includes two detection networks, i.e., Faster-RCNN [29], with the same configurations, namely Teacher and Student. Teacher is used to generate pseudo-labels for training Student, and its parameters are gradually updated from Student via EMA [39]. Student is trained with both ground-truth and pseudo-labels, denoted as $\mathcal{L}_{sup}$ and $\mathcal{L}_{unsup}$ , respectively. Teacher also serves to estimate the unlabeled examples for active sampling. + +and student share the same parameters to deal with above problem. However, they still suffer from extreme instability in the initial training phase and require a high confidence score threshold for generating pseudo-labels. Unbiased teacher [24] exploits EMA [39] to optimize teacher from student gradually. In addition, Unbiased teacher apply EMA [39] and focal loss [21] to address the pseudo-label over-fitting problem in teacher-student learning. + +Active Learning. There are also some active-learning based methods proposed to reduce the labeling expenditure of object detection [42, 47, 48]. For instance, Wang et al. [42] use different active sampling metrics for different stages in object detection. CALD [47] measures information by calculating the data consistency of bounding boxes before and after augmentation. MI-AOD [48] applies multi-instance learning to suppress the pseudo-label noises. + +In this paper, we focus on the teacher-student based semi-supervised learning for object detection. + +# 3. Active Teacher + +The overall framework of the proposed Active Teacher is illustrated in Fig. 2. As shown in this figure, Active Teacher consists of an iterative teacher-student structure, where the limited label set is partially initialized and gradually augmented. After each iteration, the well-trained teacher network is used to evaluate the importance of unlabeled examples in terms of the proposed metrics, i.e., information, diversity and difficulty, based on which active data augmentation is performed. The detailed procedure is depicted in Algorithm 1. In the following section, we introduce Active + +Algorithm 1 Pseudo Code of Active Teacher +Input: Labeled Dataset $\{\mathcal{X}_L^0,\mathcal{Y}_L^0\}$ ,Unlabeled Dataset $\{\mathcal{X}_U^0\}$ , Maximum Iteration $K$ +Output: Teacher Model $M^{t}$ +1: for all $x_{l}\in \mathcal{X}_{L}^{0}$ and $x_{u}\in \mathcal{X}_{U}^{0}$ do +2: Update the parameters of Student $M_0^s$ by Eq. (1) +3: Update the parameters of Teacher $M_0^t$ by Eq. (6) +4: end for +5: for all i=1,...,K do +6: for all $x_{u}\in \{\mathcal{X}_{U}^{i - 1}\}$ do +7: Calculate sampling score of unlabeled data using Teacher network $M_{i - 1}^{t}$ by Eq. (11); +8: end for +9: Rank the data based on score. +10: Select the top-N data $\{\mathcal{X}_P^i\}$ and annotate them with label $\{\mathcal{Y}_P^i\}$ . +11: Update labeled set $\{\mathcal{X}_L^i,\mathcal{Y}_L^i\} = \{\mathcal{X}_L^{i - 1},\mathcal{Y}_L^{i - 1}\} \cup$ $\{\mathcal{X}_P,\mathcal{Y}_P\}$ . +12: Update unlabeled set $\{\mathcal{X}_U^i\} = \{\mathcal{X}_U^{i - 1}\} -\{\mathcal{X}_P\}$ +13: for all $x_{l}\in \mathcal{X}_{L}^{i}$ and $x_{u}\in \mathcal{X}_{U}^{i}$ do +14: Update the parameters of Student $M_i^s$ by Eq. (1) +15: Update the parameters of Teacher $M_i^t$ by Eq. (6) +16: end for +17: end for +18: return $M_K^t$ + +Teacher from the aspects of semi-supervised learning and active sampling, respectively. + +# 3.1. Semi-Supervised Learning + +Given a set of labeled data $\mathcal{D}_L = \{\mathcal{X}_L, \mathcal{Y}_L\}$ and a set of unlabeled data $\mathcal{D}_U = \{\mathcal{X}_U\}$ , where $\mathcal{X}$ denotes the examples and $\mathcal{Y}$ is the label set, the target of semi-supervised learning is to maximize model performance based on both labeled and unlabeled data. + +Similar to prior works [24, 37], our semi-supervised learning paradigm also includes two detection networks with the same configurations, namely Teacher and Student, as shown in Fig. 2. In this paper, we use Faster-RCNN [29] as our baseline detection network. The teacher network is in charged of pseudo-label generation, while the student one is optimized with both ground-truth and pseudo-labels. Specifically, the optimization loss for the student network can be defined as: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {s u p}} + \lambda \cdot \mathcal {L} _ {\text {u n s u p}}, \tag {1} +$$ + +where $\mathcal{L}_{sup}$ and $\mathcal{L}_{unsup}$ denote the losses for supervised and unsupervised learning, respectively, and $\lambda$ is the hyperparameter to trade-off between $\mathcal{L}_{sup}$ and $\mathcal{L}_{unsup}$ . + +For object detection, $\mathcal{L}_{sup}$ consists of the classification loss $\mathcal{L}_{cls}$ of RPN and ROI head, and the one for bounding box regression $\mathcal{L}_{loc}$ . Then, $\mathcal{L}_{sup}$ is defined as + +$$ +\mathcal {L} _ {s u p} = \frac {1}{N _ {l}} \sum_ {i = 1} ^ {N _ {l}} \left(\mathcal {L} _ {c l s} \left(x _ {l} ^ {i}, y _ {c l s} ^ {i}\right) + \mathcal {L} _ {l o c} \left(x _ {l} ^ {i}, y _ {l o c} ^ {i}\right)\right), \tag {2} +$$ + +where $\mathcal{L}_{cls}$ and $\mathcal{L}_{loc}$ are calculated by + +$$ +\mathcal {L} _ {c l s} \left(x _ {l} ^ {i}, y _ {c l s} ^ {i}\right) = \mathcal {L} _ {c l s} ^ {r p n} \left(x _ {l} ^ {i}, y _ {c l s} ^ {i}\right) + \mathcal {L} _ {c l s} ^ {r o i} \left(x _ {l} ^ {i}, y _ {c l s} ^ {i}\right), +$$ + +$$ +\mathcal {L} _ {l o c} \left(x _ {l} ^ {i}, y _ {l o c} ^ {i}\right) = \sum_ {c \in \{x, y, h, w \}} \operatorname {S m o o t h} _ {L 1} \left(t _ {c} ^ {i} - y _ {c} ^ {i}\right). \tag {3} +$$ + +Here, $x_{l}$ refers to the labeled example, $y_{cls}$ and $y_{loc}$ are its labels, and $N_{l}$ denotes the number of $x_{l}$ . $t_{c}$ is the c-th coordinate of the output image $x_{i}$ . In terms of $L_{loc}$ , we use the smooth $L$ -1 loss for the bounding box regression: + +$$ +\operatorname {S m o o t h} _ {L 1} (x) = \left\{ \begin{array}{l l} 0. 5 x ^ {2} & \text {i f} | x | < 1, \\ | x | - 0. 5 & \text {o t h e r w i s e .} \end{array} \right. \tag {4} +$$ + +For $\mathcal{L}_{unsup}$ , we only use the pseudo-labels of RPN and ROI head predictions, similar to that in [24]. It is formulated as + +$$ +\mathcal {L} _ {u n s u p} = \frac {1}{N _ {u}} \sum_ {i = 1} ^ {N _ {u}} \mathcal {L} _ {c l s} \left(x _ {u} ^ {i}, \hat {y} _ {c l s} ^ {i}\right), \tag {5} +$$ + +where $\mathcal{L}_{cls}$ is the same as Eq. (2), and $\hat{y}_{cls}^{i}$ is the pseudolabels generated by the teacher network. + +To avoid the class-imbalance and over-fitting issues, we follow [24, 37] to freeze the optimization of the teacher network during semi-supervised training, and update its parameters from the student network via Exponential Moving + +Average (EMA) [39]: + +$$ +\theta_ {t} ^ {i} \leftarrow \alpha \theta_ {t} ^ {i - 1} + (1 - \alpha) \theta_ {s} ^ {i}, \tag {6} +$$ + +where $\theta_{t}$ and $\theta_{s}$ are the parameters of the teacher and student networks, respectively, and $i$ denotes the $i$ -th training step. $\alpha$ is the hyper-parameter to determine the speed of parameter transmission, which is normally close to 1. To improve the quality of pseudo-labels, we also apply nonmaximum suppression (NMS) [15] and confidence threshold to filter repetitive and uncertain pseudo-labels. + +# 3.2. Active Sampling + +In Active Teacher, the label set is partially initialized and augmented through the teacher network after each semi-supervised training. We explore what kind of examples (or images) are critical for semi-supervised object detection, and introduce three active sampling metrics, namely difficulty, information and diversity. + +Difficulty is the widely-used metric for active learning [6, 51], and is normally measured based on the entropy of the probability distribution predicted by the model. A higher entropy shows that the model is more uncertain about its prediction, suggesting that the example is more difficult. + +In SSOD, we measure the difficulty score $s_i^{\mathrm{diff}}$ of an unlabeled example based on the category prediction of the teacher network, which is defined as + +$$ +s _ {i} ^ {\text {d i f f}} = - \frac {1}{n _ {b} ^ {i}} \sum_ {j = 1} ^ {n _ {b} ^ {i}} \sum_ {k = 1} ^ {N _ {c}} p \left(c _ {k}; b _ {j}, \theta_ {t}\right) \log p \left(c _ {k}; b _ {j}, \theta_ {t}\right), \tag {7} +$$ + +where $n_b^i$ is the number of the predicted bounding box after NMS and confidence filtering, $N_{c}$ is the number of object categories and $p(c_k; b_j, \theta_t)$ is the prediction probability of the $k$ -th category by the teacher network. With Eq. (7), we can judge whether the image is difficult for SSOD based on the prediction uncertainty of the teacher network. + +Information is a metric to measure the amount of information of the unlabeled image for SSOD. In some classification tasks [6, 51], it is often calculated by prediction entropies, similar to difficulty. However, in object detection, richer information means that more visual concepts appear in the image, so the model can learn more detection patterns. To this end, we use the prediction confidence to measure this metric: + +$$ +s _ {i} ^ {\text {i n f o}} = \sum_ {j = 1} ^ {n _ {b} ^ {i}} \operatorname {c o n f i d e n c e} \left(b _ {j}, \theta\right), \tag {8} +$$ + +where the confidence $(b_{j},\theta_{t})$ is the highest confidence score in $j$ -th bounding box predicted by the teacher network. From Eq. (8), we can see that the larger $s^{\mathrm{info}}$ , the more visual concepts recognized by the teacher network, suggesting that the image has richer information. + +Diversity is a metric to measure the distribution of object categories in an image. The diversity score $s^{\mathrm{dive}}$ is calculated by + +$$ +s _ {i} ^ {\text {d i v e}} = \left| \left\{c _ {j} \right\} _ {j = 1} ^ {n _ {b} ^ {i}} \right| \tag {9} +$$ + +where $c_{j}$ is the predicted category of the $j$ -th bounding box, and $|\cdot|$ is the cardinality. The difference between information and diversity is that the former will sample images of more visual instances that might belong to only one or a few categories, while the later will favor those involving more different concepts. + +Metrics Combination. The introduced metrics may be able to answer which type of examples are suitable for SSOD. However, a practical problem is that the models in different states may have different requirements for label information. Besides, how to maximize the benefits of these metrics without extensive trials remains a challenge. To this end, we propose a simple yet efficient solution to automatically combine these metrics, termed AutoNorm. + +Before combining these metrics, we notice that the value ranges of these metrics differ greatly. For instance, the difficulty scores is usually between 0.3 and 0.8 with a theoretical maximum of $\log N_{c}$ , while the information score often ranges from 4.0 to 6.0. In this case, the first step of combination is to normalize their values: + +$$ +\hat {s _ {i} ^ {m}} = \frac {s _ {i} ^ {m}}{s _ {\max} ^ {m}} \tag {10} +$$ + +where $m \in \{\text{difficulty}, \text{information}, \text{diversity}\}$ represent the metrics, the $s_{\max}^{m}$ is the maximum value of this metric. + +Since these metrics represent image information from different aspects, we further build a three-dimensional sampling space to represent each example as $\vec{s_i} = (s_i^{\mathrm{diff}}, s_i^{\mathrm{info}}, s_i^{\mathrm{div}})$ . The evaluation result of each unlabeled example can be regarded as a point in this space. Afterwards, we use $L$ - $p$ normalize the data points into a single scalar $s_{L_p}$ , which is obtained by + +$$ +s _ {L _ {p}} = L _ {p} (\vec {s}) = | | \mathbf {s} | | _ {p} = \sqrt [ p ]{\sum_ {i = 1} ^ {3} s _ {i} ^ {p}} \tag {11} +$$ + +where $\vec{s} = (s_1, s_2, s_3) = (s_i^{\mathrm{diff}}, s_i^{\mathrm{info}}, s_i^{\mathrm{dive}})$ . Empirically, we use $L_1$ norm to combine these three metrics. When using $L-p$ ( $p > 1$ ) norm, the metrics with higher values will receive more sampling weights, e.g., difficulty, which is found to be suboptimal in our experiments. + +# 4. Experiment + +# 4.1. Dataset and Metric + +We evaluate our approach on the main benchmark for object detection, namely MS-COCO [22]. Specifically, MS-COCO divides the examples into two splits, namely + +train2017 and val2017. The train2017 has 118k labeled images. During our experiments, this split is further divided into the labeled set and the unlabeled one, similar to the prior works in SSOD [24, 35]. In practice, we adopt the settings of $1\%$ , $2\%$ , $5\%$ , $10\%$ and $20\%$ labeled data of train2017 for experiments and the comparisons with the other SSOD methods [24, 35, 37, 46, 50]. The rest examples are regarded as unlabeled data. In terms of model evaluation, we follow the previous works [17, 24, 35, 37, 46, 50] adopt mAP (50:95) [22] as the metric of our experiments. And val2017, which has 5k images, is used for evaluation. + +# 4.2. Experimental Settings + +Following the most work in SSOD [17,24,35,37,46,50], we use Faster-RCNN with ResNet-50 as our baseline detection network. The implementation and hyper-parameter setting are the same as those in Detector2 [43]. In terms of semi-supervised learning, we also follow the works in [24] to pre-train the teacher network with the supervised objectives defined in Eq. (2). The numbers of pre-training steps is set to $2k$ for all experimental settings. Afterwards, the student network is initialized with the parameters of the teacher one. The total training steps for each semi-supervised learning are $180k$ . The optimizer used is SGD [30], and the learning rate linearly increases from 0.001 to 0.01 at the first $1k$ iterations, and is divided by 10 at 179,990 iteration and 179,995 iteration, respectively. Similar to [24], we apply random horizontal flip as weak augmentation for the teacher, and the strong augmentations for the student include horizontal flip, color jittering, grey scale, gaussian blur and CutOut [10]. We use a threshold $\tau = 0.7$ to filter the pseudo-labels of low quality. We use $\alpha = 0.9996$ for EMA and $\lambda = 4$ for the unsupervised loss on all experiments. In terms of active sampling, we set the iteration number in Algorithm 1 as 2 in this paper. For all experiments, half of the label set are randomly selected, and the other half are actively selected after semi-supervised learning. The batch size is set to 64, which consists 32 labeled and 32 unlabeled images via random sampling. + +# 4.3. Experimental Result + +# 4.3.1 Quantitative Comparisons + +Comparisons with the state-of-the-arts. We first compare Active Teacher with a set of teacher-student based SSOD methods, of which results are given in Table 1. From this table, we can first observe that all teacher-student based methods greatly outperform the traditional supervised learning. Besides, we can also notice that with the careful designs in framework, those recently proposed teacher-student methods, e.g. Unbiased Teacher [24], improve the pioneer obviously, i.e. STAC, suggesting the notable progresses made in teacher-student based SSOD. However, their competition also becomes more fierce. Even so, we still observe that + +Table 1. Comparison between the proposed Active Teacher and other SSOD methods on MS-COCO val2017. The metric we used is mAP (50:95). "Supervised" refers to the performance of the model trained with labeled data only. * is our re-implementation. Δ: AP gain to the supervised performance. Our method consistently outperforms the compared methods. + +
COCO-Standard
1%Δ2%Δ5%Δ10%Δ20%Δ
Supervised [29]9.05+0.0012.70+0.0018.47+0.0023.86+0.0026.88*+0.00*
STAC [35]arXiv202013.97+4.9218.25+5.5524.38+5.9128.64+4.78//
ISMT [46]CVPR202118.88+9.8322.43+9.7326.37+7.9030.53+6.67//
Instant-Teaching [50]CVPR202118.05+9.0022.45+9.7526.75+8.2830.40+6.54//
Humble-Teacher [37]CVPR202116.96+7.9121.72+9.0227.70+9.2331.61+7.75//
Unbiased-Teacher [24]ICLR202120.75+11.7024.30+11.6028.27+9.8031.50+7.6434.88*+8.00*
Active-Teacher(Ours)22.20+13.1524.99+12.2930.07+11.6032.58+8.7235.49+8.61
+ +Table 2. Experiment of how much labeled data is for achieve $100\%$ supervised performance(37.63 [24]) by Unbiased-Teacher [24] and our Active-Teacher on MS-COCO. + +
COCO-Standard
5%10%20%40%
Unbiased-Teacher28.2731.5034.8837.29
Active-Teacher30.0732.5835.4937.92
+ +Table 3. The result of Active Teacher on STAC [35]. We just replace the initial data while keep the rest settings the same. + +
COCO-Standard
1%5%10%
STAC13.9724.3828.64
STAC+Ours14.7926.1929.77
+ +the proposed Active Teacher can achieve obvious performance gains on all experimental settings, e.g., $+6.3\%$ than Unbiased-Teacher with $5\%$ label information. These results greatly confirm the effectiveness of our method. + +Requirement of labeled data to achieve supervision. In practical applications, the minimum amount of labeled data required to achieve supervised performance is more concerned. For this purpose, we conduct a comparison between Unbiased-Teacher [24] and our Active Teacher. As shown in Table 2, with $40\%$ labeled data our method could achieve supervised performance easily. + +Effect of Active Teacher on different AP metrics. Fig. 4 shows the detailed performance gains of Active Teacher against Unbiased Teacher on more metrics. On $5\%$ labeled data, Active Teacher can greatly improve the performance on the detection of medium and small objects, i.e., APs and APm, suggesting that Active Teacher can sample images with more small objects. On $20\%$ labeled data, all AP metrics can obtain obvious improvements by Active Teacher, which also suggests its change in data sampling. + +Generalization capability of active sampling. Active Teacher is also highly generalized. Table 3 illustrates the performance changes of STAC after using the selected label information by Active Teacher. Without bells and whistles, + +![](images/933c4ec39b849a64f0823514b3dac599f5499499dd0d37148b0615c5fe2f911b.jpg) +Figure 3. Training curves of active sampling with different sampling metrics on $5\%$ and $20\%$ labeled data. The proposed AutoNorm can well combine the advantages of three metrics. + +![](images/fc7d270313f42d4485f096ef6b9e7f1e9074a5b61a731678d895c702a3eae09e.jpg) + +![](images/6666540e23c862ed81706a516143f91e7037f4678f7ce5353b4236a68c60292d.jpg) +Figure 4. Changes of specific AP indicators of Active Teacher compared with Unbiased Teacher on $5\%$ and $20\%$ labeled data. Active Teacher is more sensitive to small and medium sized object. + +![](images/148fee9462785664b3bfe1d4e7e78d6d3b753606636f8cb2aab31716ffd50839.jpg) + +this simple modification can lead to obvious performance gains of STAC on all experimental settings, strongly suggesting the generalization ability of our method. + +Ablation. We also ablate the proposed metrics with different proportions of labeled data, as shown in Table 4. From this table, we can see that three metrics, i.e., difficulty, information and diversity, are all beneficial for SSOD. However, under different settings of label proportions, their performance is also different, which verifies the assumption we made in Sec 3.2. For instance, with more label examples, the metric of information will perform better, and vice versa. In addition, as shown in Fig. 3, AutoNorm is superior than the other metrics during the training and obtains the overall better performance finally, which well confirms its effectiveness. + +Sampling distributions and performance changes. To obtain deep insight into these metrics, we further com + +Table 4. Ablation study of different sampling strategies in Active Teacher. Note that these results are experimented with a smaller batch size, i.e. 32, which are slightly inferior than those in Table 1. + +
StrategyMetricCOCO-Standard
DifficultyInformationDiversity5%(2.5%+2.5%)10%(5%+5%)20%(10%+10%)
Baseline---27.8431.3934.26*
Difficulty--29.0332.1334.68
Information--28.9231.9835.04
Diversity--29.4032.2635.05
AutoNorm29.4832.0835.13
+ +![](images/eeadeffd04515faebca1ffe0bafd73abaf54dfb41a1bdd93fb93f8c6ab6338cc.jpg) + +![](images/b8a3fdcf1e676476b6e72520e97f451d319c99d32b31675b74e6afd62d8b625a.jpg) +(a) Results on $5\%$ labeled data. + +![](images/7f948b59e779ec3633b6fa33e3ef3ac6eb62a30455dd04790f586bbba8462aeb.jpg) + +![](images/07d17bf20d1bb46ce79a4a524a46de63323dfe1053706cff44c746328ac60a51.jpg) + +![](images/d9c0d45f792560c037ad0b0675801c7e83ba6cb526c63883125c0c38a60b164f.jpg) +Figure 5. The relative changes of sample distribution (blue) and performance (red) of Activate Teacher with and without active sampling on different metrics. The results are obtained on $5\%$ and $20\%$ labeled data. + +![](images/8fa8e02176ca3e74520a2b05aad108532f57809a96b6bcaba77aefbd06785c9e.jpg) +(b) Results on $20\%$ labeled data. + +![](images/c29dcfe19548356840e0a77a43fe609b349cb672495a9399fa85c8a5a7d262ee.jpg) + +![](images/9891dd9e7d55a00f0416be1b73254980643554f04b3bf9a6705731836207bba7.jpg) + +pare their detailed sampling distributions and performance changes on all categories, of which results are depicted in Fig. 5. From these results, we can first observe that information is easy to suffer from inverse compensation effect. Specifically, the categories that already take a large proportion of data will receive more samplings from this metric. As a result, the biased distribution and unbalanced performance will become more prominent under this metric. Notably, diversity is the opposite of information, which can also address diminishing marginal effect. From Fig. 5, we can find that the performance gains of the major categories will not keep increasing with more examples. In contrast, some small categories will obtain more improvements via data augmentation, which can be achieved by diversity. However, due to the obvious difference between its sampling distribution and the real one, the advantage of diversity will be weaken as the number of labeled examples increases. The distribution of difficulty matches the real one. Due to the preference of outliers, its overall performance is not significant. Instead, the proposed AutoNorm can make good use of three metrics, while maintaining the amount of information and the diversity of examples. Besides, it is also closer to the real data distribution. + +# 4.3.2 Qualitative analysis + +What examples are selected by these metrics? In Fig. 6, we visualize the examples selected by these metrics based on $5\%$ and $20\%$ labeled data. From Fig. 6, we can first observe that the selected examples well correspond to the def + +initions of these metrics. For instance, difficulty will sample examples with objects that are difficult to detect, e.g., small objects, and information prefers the ones with more instances, e.g. street views. Diversity will select the images containing more categories, e.g. dining room. In addition, we can also notice some slightly difference between the samplings with $5\%$ and $20\%$ labeled data. Specifically, under $5\%$ , the teacher is not sufficiently trained, so it can only estimate the examples of the common categories. For instance, information will sample a picture of only people, which also explains why its sampling is less effective on $5\%$ . In contrast, under $20\%$ , the example estimation becomes more comprehensive. Besides, we can find that the proposed AutoNorm is the optimal strategy on both settings. The images sampled by AutoNorm are full of information, rich in categories and different in object sizes. We believe that this is also the proper criteria of data sampling for SSOD from an overall perspective. + +Effects on pseudo-labels. We further visualize the pseudo-labels of Active Teacher with and without active sampling on different training steps. Firstly, we can find that there is still an obvious gap between the qualities of the pseudo-labels and the ground-truth ones. Even so, with the help of active sampling, Active Teacher can still generate more pseudo-labels with better qualities in different training steps. As shown in Fig. 7, Active Teacher can also detect more small objects in image. This result greatly confirms our argument that data initialization also affects the qualities of pseudo-labels. + +![](images/ef1f09b2c85c0690b349c12676b2e8c13a35af5aebe5704d9e7365aaf296b6ab.jpg) + +![](images/35f619029a11f1b5ccb7507b8469338c43979c8791c2d12445918eb6eb0f0869.jpg) +(a) Images selected by different metrics with $5\%$ labeled data. + +![](images/1f4204109785c94b8097800c695f4ad165429c0213f46784160c9a94c5b5bbc3.jpg) + +![](images/cc902e8298d6902eef2c150e3f2e3c6e713e84f1e1bb50a2e0b7adcf9fbe338f.jpg) + +![](images/c98d239f8512c68c4bd03eba8ec805bb6cb28d0b5f38fb493fb08568577305e2.jpg) + +![](images/82f2327d1bbee2fdd35848ae3674616c9610c18254eb34205da5a90da90f5af9.jpg) +Figure 6. Visualization of the images with top ranks with $5\%$ and $20\%$ labeled proportions and different sampling metrics. The bounding boxes in red are predicted by the teacher network. + +![](images/8e49080c92caca09cbf4a44e201dbf130a9e5302a5f5a518d90670e1eaba4551.jpg) +(b) Images selected by different metrics with $20\%$ labeled data. + +![](images/d4465d6e371aa56f21b2dbe022edbda1492addc84f9e6799d31dc4967e7137c2.jpg) + +![](images/75f5654ca0251837b07d4584900927a63d9f4554df8be9bf660b7e1b8c8de361.jpg) + +![](images/0442a58eaadfe2150f84af2833e55337ffb3155d3d1f817df139f59024bd4cc5.jpg) + +![](images/5706788e23c754606dc78768c1c2caa49d511556af5855a91b213aa6f86893b7.jpg) +Figure 7. Visualization of the pseudo-labels predicted by Active Teacher with and without active sampling at different training steps. The green bounding boxes are the ground-truths, while the red ones are pseudo-labels predicted by the teacher network. + +# 5. Conclusion + +In this paper, we propose a novel teacher-student based method for semi-supervised object detection (SSOD), termed Active Teacher. Different from prior works, Active Teacher studies SSOD from the perspective of data initialization, which is supported with a novel active sampling strategy. Meanwhile, we also investigate the selection of examples from the aspects of information, diversity and difficulty. The experimental results not only show the superior performance gains of Active Teacher over the existing methods, but also show that it can help the baseline network achieve $100\%$ supervised performance with much less label expenditure. Meanwhile, the quantitative and qualitative analyses provide useful hints for the data annotation in practical applications. + +Limitation. A potential issue of Active Teacher is that it theoretically takes $k - 1$ times more training steps than the + +other teacher-student methods, where $k$ is the number of training iterations in Algorithm 1. In our experiments, we find that $k = 2$ can already help the model obtain obvious performance gains. Considering the fact that data annotation is much more expensive than model training in some practical applications of SSOD, e.g., security surveillance and industrial inspection, we believe that the doubled training time is still acceptable. + +Acknowledgements. This work was supported by the National Science Fund for Distinguished Young Scholars (No.62025603), the National Natural Science Foundation of China (No.U21B2037, No.62176222, No.62176223, No.62176226, No.62072386, No.62072387, No.62072389, and No.62002305), Guangdong Basic and Applied Basic Research Foundation (No.2019B1515120049), and the Natural Science Foundation of Fujian Province of China (No.2021J01002). We also thank Huawei Ascend Enabling Laboratory for the continuous support in this work. + +# References + +[1] Philip Bachman, Ouais Alsharif, and Doina Precup. Learning with pseudo-ensembles. Advances in neural information processing systems, 27:3365-3373, 2014. 2 +[2] David Berthelot, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, and Colin Raffel. Remixmatch: Semi-supervised learning with distribution alignment and augmentation anchoring. arXiv preprint arXiv:1911.09785, 2019. 1, 2 +[3] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249, 2019. 1, 2 +[4] H. Bilen and A. Vedaldi. Weakly supervised deep detection networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. 1 +[5] Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020. 1 +[6] Jae Won Cho, Dong-Jin Kim, Yunjae Jung, and In So Kweon. Mcdal: Maximum classifier discrepancy for active learning. arXiv preprint arXiv:2107.11049, 2021. 4 +[7] Mirsad Cosovic, Achilleas Tsitsimelis, Dejan Vukobratovic, Javier Matamoros, and Carles Anton-Haro. 5g mobile cellular networks: Enabling distributed state estimation for smart grids. IEEE Communications Magazine, 55(10):62-69, 2017. 2 +[8] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 113-123, 2019. 1 +[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. 1 +[10] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 1, 5 +[11] 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. 1 +[12] Mingfei Gao, Zizhao Zhang, Guo Yu, Sercan Ö Arik, Larry S Davis, and Tomas Pfister. Consistency-based semi-supervised active learning: Towards minimizing labeling cost. In European Conference on Computer Vision, pages 510-526. Springer, 2020. 2 +[13] Zheng Ge, Songtao Liu, Feng Wang, Zeming Li, and Jian Sun. Yolox: Exceeding yolo series in 2021. arXiv preprint arXiv:2107.08430, 2021. 1, 2 +[14] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440-1448, 2015. 1, 2 +[15] 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, 2, 4 +[16] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961-2969, 2017. 2 +[17] Jisoo Jeong, Seungeui Lee, Jeesoo Kim, and Nojun Kwak. Consistency-based semi-supervised learning for object detection. Advances in neural information processing systems, 32:10759-10768, 2019. 1, 2, 5 +[18] Jisoo Jeong, Vikas Verma, Minsung Hyun, Juho Kannala, and Nojun Kwak. Interpolation-based semi-supervised learning for object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11602-11611, 2021. 2 +[19] Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016. 1, 2 +[20] 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. 2 +[21] 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. 3 +[22] 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. 1, 2, 5 +[23] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pages 21-37. Springer, 2016. 1, 2 +[24] Yen-Cheng Liu, Chih-Yao Ma, Zijian He, Chia-Wen Kuo, Kan Chen, Peizhao Zhang, Bichen Wu, Zsolt Kira, and Peter Vajda. Unbiased teacher for semi-supervised object detection. arXiv preprint arXiv:2102.09480, 2021. 1, 2, 3, 4, 5, 6 +[25] Ishan Misra, Abhinav Shrivastava, and Martial Hebert. Watch and learn: Semi-supervised learning for object detectors from video. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3593-3602, 2015. 1 +[26] 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. 1, 2 +[27] 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 +[28] Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018. 1, 2 +[29] 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:91-99, 2015. 1, 2, 3, 4, 6 +[30] Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pages 400-407, 1951. 5 +[31] Aruni RoyChowdhury, Prithvijit Chakrabarty, Ashish Singh, SouYoung Jin, Huaizu Jiang, Liangliang Cao, and Erik Learned-Miller. Automatic adaptation of object detectors to new domains using self-training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 780-790, 2019. 2 +[32] Shuai Shao, Zeming Li, Tianyuan Zhang, Chao Peng, Gang Yu, Xiangyu Zhang, Jing Li, and Jian Sun. Objects365: A large-scale, high-quality dataset for object detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 1 +[33] Yunhang Shen, Rongrong Ji, Zhiwei Chen, Yongjian Wu, and Feiyue Huang. Uwsod: Toward fully-supervised-level capacity weakly supervised object detection. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 7005-7019. Curran Associates, Inc., 2020. 1 +[34] Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685, 2020. 1, 2 +[35] Kihyuk Sohn, Zizhao Zhang, Chun-Liang Li, Han Zhang, Chen-Yu Lee, and Tomas Pfister. A simple semi-supervised learning framework for object detection. arXiv preprint arXiv:2005.04757, 2020. 1, 2, 5, 6 +[36] Peng Tang, Xinggang Wang, Xiang Bai, and Wenyu Liu. Multiple instance detection network with online instance classifier refinement. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 1 +[37] Yihe Tang, Weifeng Chen, Yijun Luo, and Yuting Zhang. Humble teachers teach better students for semi-supervised object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3132-3141, 2021. 1, 2, 4, 5, 6 +[38] Yuxing Tang, Josiah Wang, Boyang Gao, Emmanuel Deldlandrea, Robert Gaizauskas, and Liming Chen. Large scale semi-supervised object detection using visual and semantic knowledge transfer. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2119-2128, 2016. 1 +[39] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. arXiv preprint arXiv:1703.01780, 2017. 1, 2, 3, 4 +[40] Jiajie Wang, Jiangchao Yao, Ya Zhang, and Rui Zhang. Collaborative learning for weakly supervised object detection. arXiv preprint arXiv:1802.03531, 2018. 1 +[41] Keze Wang, Xiaopeng Yan, Dongyu Zhang, Lei Zhang, and Liang Lin. Towards human-machine cooperation: Self + +supervised sample mining for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[42] Zhenyu Wang, Yali Li, Ye Guo, Lu Fang, and Shengjin Wang. Data-uncertainty guided multi-phase learning for semi-supervised object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4568–4577, 2021. 3 +[43] Yuxin Wu, Alexander Kirillov, Francisco Massa, Wan-Yen Lo, and Ross Girshick. Detector2. https://github.com/facebookresearch/detectron2, 2019.5 +[44] Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. Unsupervised data augmentation for consistency training. arXiv preprint arXiv:1904.12848, 2019. 1 +[45] Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves imagenet classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10687-10698, 2020. 2 +[46] Qize Yang, Xihan Wei, Biao Wang, Xian-Sheng Hua, and Lei Zhang. Interactive self-training with mean teachers for semi-supervised object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5941-5950, 2021. 5, 6 +[47] Weiping Yu, Sijie Zhu, Taojiannan Yang, Chen Chen, and Mengyuan Liu. Consistency-based active learning for object detection. arXiv preprint arXiv:2103.10374, 2021. 3 +[48] Tianning Yuan, Fang Wan, Mengying Fu, Jianzhuang Liu, Songcen Xu, Xiangyang Ji, and Qixiang Ye. Multiple instance active learning for object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5330-5339, 2021. 3 +[49] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 2 +[50] Qiang Zhou, Chaohui Yu, Zhibin Wang, Qi Qian, and Hao Li. Instant-teaching: An end-to-end semi-supervised object detection framework. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4081-4090, 2021. 1, 2, 5, 6 +[51] Zongwei Zhou, Jae Shin, Lei Zhang, Suryakanth Gurudu, Michael Gotway, and Jianming Liang. Fine-tuning convolutional neural networks for biomedical image analysis: actively and incrementally. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7340-7351, 2017. 4 \ No newline at end of file diff --git a/activeteacherforsemisupervisedobjectdetection/images.zip b/activeteacherforsemisupervisedobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a8f03de8f9de79d1def13befec3991f504eb515e --- /dev/null +++ b/activeteacherforsemisupervisedobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d9aa98900ba342c12999605afa378af94691decbb44f72586836f9aa487bafc +size 794226 diff --git a/activeteacherforsemisupervisedobjectdetection/layout.json b/activeteacherforsemisupervisedobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8cae6f55cd6b76bcf64843b10f2071d5f3526993 --- /dev/null +++ b/activeteacherforsemisupervisedobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:891d9a3bd77655fb8067142e4e4c28d3beda3e56da76df05579e851a9946149b +size 456082 diff --git a/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_content_list.json b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f7f914b2ed6b85601319dd7d79877a495307bdf3 --- /dev/null +++ b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be10874c6109aea32d54adc2a494c6a67cdbce623eb842efaa83380a691973dd +size 75162 diff --git a/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_model.json b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e028cc2c88292965dd81495891b575f0ae7dcd34 --- /dev/null +++ b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11c1130665267b4fb24c9e301dfba7c3a4c38956339e5d4a54656fa3656bd137 +size 89707 diff --git a/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_origin.pdf b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..10cbedc0ade25509be6875a2e9fd2ddd9f091057 --- /dev/null +++ b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/ea428a9e-f3ad-4cd5-b17e-83d8e7ffcbf4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04490980dc539c22b38b540ac486d2fc689d56d3959e64944c2c016faf5195f1 +size 7546199 diff --git a/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/full.md b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1f278977d81dd3a5ef31469e3fa024abc682bc27 --- /dev/null +++ b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/full.md @@ -0,0 +1,318 @@ +# ActiveZero: Mixed Domain Learning for Active Stereovision with Zero Annotation + +Isabella Liu + +Edward Yang + +Jianyu Tao + +Rui Chen + +Xiaoshuai Zhang + +Qing Ran3 + +Hao Su + +1University of California, San Diego + +$^{2}$ Tsinghua University + +3Alibaba DAMO Academy + +# Abstract + +Traditional depth sensors generate accurate real world depth estimates that surpass even the most advanced learning approaches trained only on simulation domains. Since ground truth depth is readily available in the simulation domain but quite difficult to obtain in the real domain, we propose a method that leverages the best of both worlds. In this paper we present a new framework, ActiveZero, which is a mixed domain learning solution for active stereovision systems that requires no real world depth annotation. First, we demonstrate the transferability of our method to out-of-distribution real data by using a mixed domain learning strategy. In the simulation domain, we use a combination of supervised disparity loss and self-supervised losses on a shape primitives dataset. By contrast, in the real domain, we only use self-supervised losses on a dataset that is out-of-distribution from either training simulation data or test real data. Second, our method introduces a novel self-supervised loss called temporal IR reprojection to increase the robustness and accuracy of our reprojections in hard-to-perceive regions. Finally, we show how the method can be trained end-to-end and that each module is important for attaining the end result. Extensive qualitative and quantitative evaluations on real data demonstrate state of the art results that can even beat a commercial depth sensor. The codes of ActiveZero are available at: https://github.com/haosulab/active_zero. + +# 1. Introduction + +Depth sensors can provide 3D geometry information about a target scene, which is critical in various robotic applications, including mapping, navigation, and object manipulation [6,17,26]. Among the different types of depth sensors available, active stereovision depth sensors (eg. Intel RealSense™D series) are the most widely adopted in both industry and academic settings due to their high spatial + +![](images/ab0fca93a24f4cfb4a405cdec119b43c3f8835f207601383812e48180ec288ea.jpg) +Figure 1. ActiveZero produces more accurate and complete disparity estimates on real IR stereo images for objects with complex optical characteristics (specular, transparent) than commercial depth sensors with zero real depth annotation using mixed domain learning by leveraging self-supervised reprojection loss on temporal IR patterns in the real domain and direct disparity supervision in the simulation domain. + +resolution, high accuracy, and low cost [19]. These sensors are composed of an infrared (IR) pattern emitter and two IR cameras with the IR pattern projected onto the target scene to facilitate stereo matching. However, since these sensors use classical stereo algorithms, they suffer from common stereo matching issues such as over smoothing, edge fattening and holes for specular and transparent objects so they are non-ideal for robotic applications which require high precision and completeness [5]. + +Learning based methods can solve the aforementioned issues by generating more accurate and complete depth maps through the utilization of prior samples to understand how to correctly handle edges and uncertain pixels [2-4, 35]. However, a large scale stereo dataset with ground truth depth is required to train these learning based methods, which is costly and time-consuming to collect in the real world. Therefore, one way to alleviate this problem is to use + +self-supervised learning. Self-supervised stereo methods [38, 39] use reprojection or other related losses between binocular images as supervision, but the fluctuation of these losses prohibit the network from reaching a meaningful optima. Another approach is to use simulation data where ground truth depth is readily available. However due to the domain gap between the simulation and real world, networks trained on only simulation data cannot be reliably transferred to the real domain. Domain adaptation methods have been proposed to overcome the Sim2Real problem [23], but the introduction of GANs makes the training process unstable [20] and the performance suboptimal. + +This paper proposes an end-to-end learning stereo method that combines the advantages of self-supervised learning in the real domain and supervised learning in the simulation domain which we call mixed domain learning (Fig. 1). This strategy significantly boosts the stereo network performance while also stabilizing and speeding up the optimization process. Specifically, by only needing to train on shape primitives in the simulation domain with ground truth depth as supervision and an unrelated set of scenes in the real domain with reprojection as self-supervision, we are able to achieve comparable performance on completely out-of-distribution objects in the real domain as though we were directly training on those objects. + +In addition, we observed that there are fundamental issues with performing direct image reprojection as previous works had done so we propose the use of temporal IR by periodically adjusting the brightness of the emitted IR pattern and extracting the binary pattern from the temporal image sequences. The reprojection loss on the temporal binary pattern eliminates the influence of scene texture and also the effect of illumination strength decaying with increased distance. Experimental results demonstrate that our method is able to outperform state-of-the-art learning-based stereo methods and commercial depth sensors, and ablation studies verify the effectiveness of each module in our work. + +# 2. Related Work + +Depth sensors can be classified into four categories according to their underlying sensing principle [5]: passive stereo-vision, active stereo-vision, structured light, and time-of-flight. Each depth sensing technique has its own advantages and drawbacks. Giancola et al. [13] introduces the principles of different depth sensors and evaluated their metrological performance independently. Chen et al. [5] compared the short-range depth sensing performance of 8 commercially available depth sensors for different illumination settings and objects and found that active stereovision sensors and structured light sensors have similar performance to each other and better performance + +than the other two kinds of sensors. Furthermore, depth sensor performance varies among different objects with these sensors performing especially poorly on objects with complex optical characteristics [29]. In this paper, we focus on improving the visual and numerical performance of active stereovision depth sensors, but the framework can also be applied for structured light sensors. + +Learning Based Stereo has become much more prevalent with large-scale benchmarks and higher computational ability [12, 16, 21]. Stereo matching for depth estimation is typically done in four steps: matching cost computation, cost aggregation, optimization, and disparity refinement [31]. Zbontar and LeCun were the first to design a network for computing matching costs by utilizing a deep Siamese architecture [37]. Building on this, DispNet introduced the first end-to-end framework for predicting entire disparity maps from stereo image pairs [25]. Works such as GWCNet followed and improved on this framework by using 3D convolutions to compute better cost volumes [18]. Recent works have improved performance even further by utilizing multi-scale context aggregation to estimate depth at different resolutions in order to leverage global image-level information [2, 15]. However, the requirement of ground truth depth as supervision has limited the application of learning based stereo. + +Self-supervised Stereo is a popular approach for stereo matching when ground truth depth is unavailable. Godard et al. [14] explored the use of left-right consistency in a rectified stereo image pair for self-supervision. They reconstruct the right view based on the given left view and its predicted disparity map and then use the reconstruction loss as a supervision for training. PDANet [11] introduced the idea of perceptual consistency to improve reconstruction quality on regions with low texture and high color fluctuations. ActiveStereoNet [38] used local-contrast-normalized (LCN) reprojection loss on IR images as self-supervision to train a stereo network. However, this reprojection loss fluctuates along the epipolar line and is heavily influenced by occlusion and viewpoint variance. Not only that, LCN loss also suffers in areas where camera noise and environmental illumination dominate the projected IR pattern since it only uses the IR image with projected pattern. Our method addresses these concerns using temporal IR reprojection loss by way of actively adjusting the brightness of the emitted IR pattern which is more robust to camera noise and environmental illumination. + +Domain Adaptation techniques have shown great promise in closing the gap between the simulation and real domains. Tobin et al. [33] proposed using domain randomization through randomizing rendering in the simulator to train a robust model that would interpret the real domain as just another variation of the simulation domain. Previous works have also tried aligning the source and target domains by + +![](images/a96709e2755d4a09945e0eaec9c01a9263cfecf2fb8e594619098c3b357dbaef.jpg) +Figure 2. Architecture overview. The simulated and real stereo IR images are fed to a shared weight stereo network consisting of a CNN for noise reduction and a cost-volume-based 3D CNN for disparity prediction. The network is trained with reprojection loss on temporal binary IR pattern in the real domain, reprojection loss and disparity loss in the simulation domain as mixed domain learning. + +matching their input distributions or their feature statistics [24, 32]. Other works have attempted to learn domain-invariant representations by augmenting the input based on certain criterion set forth in the task and approach itself [10]. Moreover, unsupervised losses have seen increased use for domain adaptation in tasks such as semantic segmentation and object detection [7, 30, 34]. + +Our work is most related to StereoGAN [23], which uses ground truth depth maps in the simulated domain and reprojection loss in the real domain along with unsupervised GAN losses in order to close the domain gap between simulation and real images. Our work differs from theirs in three key ways: (1) we utilize IR images with actively projected patterns for stereo matching instead of passive RGB images, which leads to a smaller sim2real gap and better transferability; (2) we use the proposed temporal IR reprojection loss as self-supervision which is more effective in correlating local matching features; (3) we train using only shape primitives and random real objects that are out-of-distribution from test time data. + +# 3. Method + +In this section, we introduce mixed domain learning for active stereovision. We first define the task setup: in real domain $\mathcal{X}$ , we have a target set of real IR stereo images with projected pattern $\mathbb{X}^t = \{(x_l^t,x_r^t)_i\}_{i = 1}^N$ , and our goal is to learn an accurate disparity estimation network $F$ to estimate the disparity $\hat{x}_d^t = F(x_l^t,x_r^t)$ . We utilize mixed domain data + +to train the network: in real domain $\mathcal{X}$ we collect another set of real IR stereo images $\mathbb{X} = \{(x_{l},x_{r})_{i}\}_{i = 1}^{M}$ without disparity annotation. To be clear, the objects appearing in $\mathbb{X}$ are different from the ones in $\mathbb{X}^t$ . In simulation domain $\mathcal{V}$ , we generate a set of synthetic IR stereo images with ground truth disparity annotation $\mathbb{Y} = \{(y_l,y_r,y_d)_i\}_{i = 1}^K$ . In order to guarantee the generalizability of the trained network to unseen objects, we only use shape primitives (sphere, cube, capsule) with different scales, textures and materials to generate $\mathbb{Y}$ . + +Figure 2 shows the framework of our proposed method. In the real domain, we propose the use of temporal binary IR reprojection loss as self-supervision (Sec. 3.1). In the simulation domain, we use the loss between predicted disparity and the ground truth disparity $y_{d}$ as supervision (Sec. 3.2). The network is trained jointly using the self-supervision in real domain and supervision in simulation domain (Sec. 3.3). The stereo network architecture and other implementation details are introduced in Sec. 3.4. + +# 3.1. Real Domain: Self-supervised Learning on IR Images + +The prerequisite for computing reprojection loss of grayscale stereo images in conventional self-supervised learning methods [14, 38] is that the object surface is Lambertian diffused where the reflection intensity is invariant to the viewpoint, which is usually not satisfied in real world. Therefore, we propose to extract the binary projected + +![](images/0d03ed4cd12b1cca6cf3153076718c7489e50bce3b4f96c0d15ac42754cda7cc.jpg) +Figure 3. Temporal binary pattern extraction + +active pattern from temporal IR stereo image sequences, which eliminates the adverse effect of surface reflection while maintaining the most important components of active pattern. Then, we construct the reprojection loss on this new binary pattern. + +Binary Pattern Extraction From Temporal IR Images. For the real captured IR images $x_{l}$ or $x_{r}$ , the grayscale at pixel $(u, v)$ is: + +$$ +x _ {l} (u, v) = I _ {l} (u, v) + \alpha * e * K _ {l} (u, v) + \epsilon \tag {1} +$$ + +where $I_{l}(u,v)$ represents the environmental illumination intensity, $K_{l}(u,v)$ represents the binary pattern captured by the camera, $\alpha$ represents the reflection coefficient determined by the object surface material, texture, angle and distance, $e$ represents the pattern emittance, and $\epsilon$ represents the camera sensor noise. For active depth sensors, we manually adjust the pattern emittance $e$ by changing the emitter power. Therefore, as shown in Fig. 3, our pattern extraction procedure is as follows: we set $e$ to $\{e_0,e_1,\dots,e_n\}$ , capture a temporal sequence of corresponding IR images $\{x^{(0)},x^{(1)},\dots,x^{(n)}\}$ , and fit $x^{(0)},\ldots,x^{(n)}$ to the linear model regressed and obtain $\hat{x}^{(0)},\ldots,\hat{x}^{(n)}$ . We extract the binary IR pattern $K(u,v)$ from the temporal image sequence through local window normalization and binarization: + +$$ +K (u, v) = \left\{ \begin{array}{l l} 1 & | | \hat {x} ^ {(n)} (u, v) - \hat {x} ^ {(0)} (u, v) | | > \delta (u, v) + c \\ 0 & o t h e r w i s e \end{array} \right. +$$ + +$$ +\delta (u, v) = \frac {1}{w ^ {2}} \sum \left| \left| W \left(\hat {x} ^ {(n)}, u, v\right) - W \left(\hat {x} ^ {(0)}, u, v\right) \right| \right| \tag {2} +$$ + +where $W(x, u, v)$ is a local window centered at pixel $(u, v)$ in $x$ with window size $w$ , $c$ is a threshold to filter out noise + +and areas where the reflection coefficient is extremely small such as pure specular reflection regions. In our work, we use $n = 6$ . + +In Fig. 4, we compare the pattern extracted by different methods. By utilizing the temporal image sequence, our method is able to extract the pattern accurately and completely even in distant areas where the SNR (signal noise ratio) is low. The local normalization and binarization window filters out camera sensor noise and environmental illumination while retaining the projected active pattern, which is beneficial for further reprojection loss computation. + +Binary Pattern Reprojection Loss. As demonstrated in traditional stereo matching and active stereo methods [1, 8, 9, 38], patch-wise reprojection losses are smoother and more accurate than pixel-wise losses and are beneficial for matching. Therefore, we construct the patch-wise reprojection loss on the extracted binary IR pattern $(K_{l}, K_{r})$ : + +$$ +\mathcal {L} _ {\text {r e p r o j}} \left(K _ {l}, K _ {r}, \hat {x} _ {d}\right) = \sum_ {u v} \frac {1}{(2 p + 1) ^ {2}} C (u, v) +$$ + +$$ +C (u, v) = \sum_ {(u _ {p}, v _ {p}) \in P (u, v)} | | K _ {l} (u _ {p}, v _ {p}) - \hat {K} _ {l} (u _ {p}, v _ {p}) | | ^ {2} +$$ + +where $P(u,v)$ represents the patch centered at pixel $(u,v)$ with patch size $(2p + 1)\times (2p + 1)$ , $\hat{K}_l$ represents the warped right image using the predicted disparity $\hat{x}_d$ . + +As shown in Fig. 4, since the temporal binary IR pattern eliminates the influence of object texture and environmental illumination and only retains the projected pattern, the reprojection loss computed on the binary IR pattern reaches global minima at the ground truth disparity while the losses computed on the other two patterns could be misleading for the stereo network. + +# 3.2. Simulation Domain: Supervised Learning on Shape Primitives + +Although the proposed temporal IR reprojection loss can be used as the sole loss for stereo network training, it still has some limitations: the binary IR pattern cannot be extracted accurately for translucent and transparent objects and there are local minima in the loss with respect to the disparity hypotheses. On the other hand, traditional supervised learning with ground truth depth does not suffer from the aforementioned issues. However, it is costly and time-consuming to acquire ground truth depth in real world settings. Thus, we perform supervised learning only in the simulation domain. + +Dataset Generation based on Ray-tracing. In the last decade, there has been significant progress in ray-tracing + +![](images/e4804062f09effdbc17b883a1c3a5dfa6945270a860cf22d6ed94faf5318d649.jpg) + +![](images/423028d41087de67c38ea88879553ffbe9a19e28698c5563d36d260fde4238fb.jpg) + +![](images/3b472d99cb0af13c68d4be4757fde8360f80a6d5d7f71903ee8287592ab4ac1b.jpg) + +![](images/e1c65b4b61f4ba0799bf02143aa5f6f35a8adb2c0c3695d0f889a0a14929a0ad.jpg) + +![](images/134ebac9e4e5a8e88f4d169cbdd37da5f2b6aa913504ed1a0039681bdb398c5a.jpg) + +![](images/691126bf062c9dc034174f3469de6eed2bcf1e316aea75b9e19a4376e46131cb.jpg) +LCN Pattern + +![](images/f6bb4c0131014bbe5133b294965999f2b232901534dc6b940d815f17029fdccc.jpg) +2-Step IR Pattern + +![](images/f9cb6915f4ee2af834ac5ec67c96c3085b09261ff131f449a34913cc8734029b.jpg) +Temporal IR Pattern + +![](images/ccdb5bd5b891a7cf96cee917d8940b8ace7bb90221580115b949f11948634d2c.jpg) +Figure 4. Comparison of extracted pattern and reprojection loss along the epipolar line. LCN pattern represents local contrast normalization [38] which consists of continuous values; 2-step IR pattern and temporal IR pattern represent the extracted binarized pattern from temporal IR image sequence using $n = 1$ and $n = 6$ , respectively. + +rendering techniques in terms of speed and quality. Compared with rasterization, ray-tracing rendering can accurately simulate the light transmission process on translucent and transparent objects [28]. Therefore, we use ray-tracing rendering to generate the simulated training dataset: we first build a cone lighting with mask to imitate the pattern emitter in the real active stereovision depth sensor, and then construct two cameras similar to stereo cameras in the real setting. The relative position between cameras and lighting are set using parameters from real sensors. We also add dim ambient light in the simulation environment to imitate the filtered environmental light in the real setting. + +Shape Primitives. The semantic-specific biases in CAD model datasets may mitigate the generalizability of the learned stereo network. Thus we only use base shape primitives for simulated dataset generation. We use images from tiny ImageNet [22] as object textures. The number of primitives is randomly sampled from 5 to 15. The sizes, layouts and materials are also randomly generated. + +Disparity loss. Given the synthetic stereo image pair with ground-truth disparity $(y_{l}, y_{r}, y_{d})$ , we follow [2] and adopt smooth $L_{1}$ loss between $y_{d}$ and the predicted disparity on synthetic stereo images: + +$$ +\mathcal {L} _ {\text {d i s p}} = L _ {1 \text {s m o o t h}} \left(F \left(y _ {l}, y _ {r}\right), y _ {d}\right) \tag {3} +$$ + +# 3.3. Mixed Domain Learning + +Given the real stereo IR image $(x_{l},x_{r})$ , and the simulated stereo IR image with ground truth disparity $(y_{l},y_{r},y_{d})$ , we train the stereo network $F(\cdot ,\cdot)$ by combining the reprojection loss in the real domain and the disparity loss along with + +reprojection loss in the simulation domain: + +$$ +\begin{array}{l} \mathcal {L} \left(x _ {l}, x _ {r}, y _ {l}, y _ {r}, y _ {d}\right) = \lambda_ {r} \cdot \mathcal {L} _ {\text {r e a l - r e p r o j}} \left(x _ {l}, x _ {r}, F \left(x _ {l}, x _ {r}\right)\right) + \\ \lambda_ {s} \cdot \left[ \mathcal {L} _ {\text {d i s p}} \left(F \left(y _ {l}, y _ {r}\right), y _ {d}\right) + \right. \\ \left. \mathcal {L} _ {\text {s i m - r e p r o j}} \left(y _ {l}, y _ {r}, F \left(y _ {l}, y _ {r}\right)\right) \right] \\ \end{array} +$$ + +where $\lambda_r$ and $\lambda_s$ represent the weights of the real domain and the simulation domain respectively. + +The loss terms on real domain guarantee transferrability to unseen real data. However, we find that it is quite hard to train the network using these terms alone, due to noise in the self-supervision signals. Interestingly enough, after adding the supervised loss terms in simulation domain on primitive shapes, the behavior of loss minimization is much more tame: not only does the network converge faster, but also the final solution has better quality (see Sec. A.1 in supplementary material and Sec. 4.3 for empirical evidences). + +# 3.4. Implementation Details + +In the stereo matching network, we adopt PSMNet [2] as the backbone, which aggregates image features at different scales, constructs a cost volume and uses 3D CNNs to regress the disparity. The max disparity of PSMNet is set to be 192. We also use a 6-layer CNN to filter out irrelevant noise before feeding the stereo images into PSMNet. To make the model more robust, we apply color jitter and gaussian blur to the input images. + +# 4. Experiments + +# 4.1. Experiment details + +Datasets. Figure 5 shows example images from the three datasets in our work. For the testing dataset, we used + +an Intel RealSense D415 as the active stereovision depth sensor. All the real RGB and IR images are captured using the RealSense camera. In order to quantitatively evaluate the performance of the camera, the complete and accurate ground depth is required. To do so, we constructed a set of simulated scenes which are pixel-wise aligned with the real ones by precisely aligning the shapes and poses of objects and the intrinsic and extrinsic parameters of the RealSense camera. To evaluate the influence of object material on depth estimation performance, we include two categories of objects: 3D-printed objects and real objects. The 3D-printed objects are printed using color plaster powder, and are considered Lambertian diffused, while the real objects' material are complex (specular, translucent, transparent) and difficult for active stereovision depth sensors. Overall, the testing dataset consists of 504 stereo images of 24 different scenes. + +For the training dataset in the simulation domain, we rendered 20,000 stereo IR images with ground-truth disparity annotation using random shape primitives, including spheres, cubes and capsules. $10\%$ of the primitives are set to be transparent, $50\%$ are textured by images from tiny imogenet [22], and the rest are set to random colors. For the raytracing rendering, the number of samples per pixel is 128 and the max bounces is set to 8. The rendered IR images are post-processed by the NVIDIA OptiX denoiser [27]. + +For the training dataset in the real domain, we collected 1,047 real stereo IR images of random objects which are different from the testing dataset. The objects are randomly placed on the table, and captured by the same RealSense from different viewpoints. Note that we only use the real IR stereo images to construct the temporal IR reprojection loss, and the depth images are not collected. + +Training. We train the network using the Adam optimizer with the initial learning rate set to 2e-4, decaying by half every 10k iterations for a total of 40k iterations. The network is trained on 2 GPUs each with 11GB GPU memory and a batch size of 4. We use $\lambda_{s} = 0.01$ and $\lambda_{r} = 2$ for the loss weight to set the two losses to similar scales. + +For fair comparison, data augmentation is applied to both our method and baseline methods. Specifically, brightness and contrast is uniformly scaled by a value between 0.4 to 1.4, and 0.8 to 1.2 respectively. For gaussian blur, kernel size is fixed to $9 \times 9$ and the standard deviation is selected uniformly between 0.1 to 2. + +Evaluation metrics. Several common stereo estimation metrics are used to evaluate the proposed method. Endpoint-error (EPE) is the mean absolute disparity error. Bad $l$ is the percentage of pixels with disparity errors larger than 1 pixel. By converting disparity to depth, we also measure the average absolute depth error (abs depth err) + +![](images/57617cc086b75ed14d02e90300049dd0f986e159b99bf2182f6ddce071c0f543.jpg) +RGB + +![](images/468748939e3f1383702f3e31a29115c94abecb3a10adf7f81551d361d001eb64.jpg) +IR + +![](images/c4c28518b090da5190a0232ffa85699928f0c19c4f182e22edccba8ec00a7373.jpg) +Disparity + +![](images/f9a58a65b2ba2d18a8dace864c71cdcc401e8ce0ccd4153e2548044a4feddde5.jpg) + +![](images/a80707b3243939bf95cee729892430cc771e0960c820cea41a05900d4186358e.jpg) +(a) + +![](images/280e1bc4511b4bf940991b1a1bcb385de3e70007ca9d162ab9f37e7d8673644b.jpg) + +![](images/c74877691aabb29033a39d0c97c0cbe4255e6cd916f25c619ed00e3cd73fa6f2.jpg) +Figure 5. Example images from our dataset. (a) the simulation training dataset of random shape primitives; (b) the real training dataset of random objects different from testing; (c) the sim2real aligned testing dataset, including specular surfaces such as metals and translucent bodies such as liquids. Note: we don't rely on any annotation for real scenes which is why we have no disparity annotation in (b). + +![](images/b5f12a9af68f3957242e58d76e00c9591e944a2e999e32881dcb58dcdc4f8ded.jpg) +(b) +(c) + +![](images/7e7920baacfca35a0dce42f75f4510b226fe97da0cfe995a3fd6b692f8336155.jpg) + +and the percentage of depth outliers with absolute error larger than $4\mathrm{mm}$ , which is denoted as $>4\mathrm{mm}$ . To evaluate the performance of our model on objects of different materials, these depth metrics are measured separately on two kinds of objects in the testing dataset using object masks. Since the RealSense camera outputs a value of zero at areas with high depth uncertainty, metrics are computed in terms of excluding and including uncertain pixels so that the evaluation is in the same completeness level. + +# 4.2. Comparison with other Methods + +For evaluation, our method is compared with other learning based methods and a decent commercial depth sensor - the RealSense D415. As shown in Tab. 1, our method outperforms other methods in all metrics. + +Learning-based methods. Our method is best compared with PSMNet [2] and StereoGAN [23] and we use them as our baselines. To test vanilla PSMNet, we train it on input stereo images with and without active pattern using only the training dataset in the simulation domain and then test it directly in the real testing dataset. As shown in Tab. 1, using active pattern can improve the stereo matching accuracy across all metrics and is beneficial for eliminating the simreal domain gap. This intuitively makes sense since active light adds pattern to textureless areas which are the most difficult to match. + +![](images/161d8549bf1632c6d495ee54203eaf0603f13e7f2e9eea694924c1a36c061598.jpg) +Figure 6. Comparison of the disparity error map of our method with StereoGAN and RealSense D415. Our method improves disparity accuracy on both 3D-printed objects and real objects. + +![](images/53b556e1597aa73f60149b036ed0be6e64181fb82d5302eb102006e10ea5617b.jpg) + +![](images/121e673bc9a6248528469887947f475bd4a15f316f326974f2cb5ce5e8b88ac2.jpg) + +![](images/129dbd5be0d35d068e6cb0abebc8c8e75a125a06c5144228fbe9ec1f47bdf6af.jpg) + +
Excluding uncertain pixels
MethodEPE (px) ↓Bad 1 ↓Abs depth err (mm) ↓>4mm↓
AllAllAllPrintedRealAllPrintedReal
PSMNet [2] w/o active pattern0.6640.1879.21812.60016.4670.4780.6860.836
PSMNet [2] w/ active pattern0.4760.0777.1359.17415.5700.5040.5910.800
StereoGAN [23]5.6030.74144.28436.89242.1050.9250.9150.931
StereoGAN [23] + PSMNet [2]2.2960.17613.76222.48937.0310.6410.7620.899
RealSense D4150.3920.0325.8177.85115.8260.5650.6120.817
Ours0.3340.0294.6076.94215.6750.3580.4720.734
± .022± .001± .242± .376± .789± .036± .04± .028
Including uncertain pixels
MethodEPE (px) ↓Bad 1 ↓Abs depth err (mm) ↓>4mm ↓
AllAllAllPrintedRealAllPrintedReal
PSMNet [2] w/o active pattern0.6980.1949.53012.98716.9600.4850.6890.840
PSMNet [2] w/ active pattern0.5130.0847.4449.58016.7450.5100.5950.804
StereoGAN [23]5.7650.74444.74736.70342.2200.9260.9150.932
StereoGAN [23] + PSMNet [2]2.4720.18514.31822.81837.7530.6450.7640.902
RealSense D4151.7930.0568.1599.89122.4920.5760.6210.835
Ours0.4200.0375.0277.45017.4300.3660.4790.748
± .024± .001± .245± .39± .853± .034± .039± .027
+ +Table 1. Performance of different state of the art learning-based stereo, commercial depth sensor and our method on the real testing dataset + +Furthermore, besides the original StereoGAN [23], we extend the StereoGAN architecture by using PSMNet as the disparity prediction backbone, which is denoted as StereoGAN+PSMNet. This improved StereoGAN uses cost volume aggregation in its stereo matching module, which makes it more powerful and comparable with our method. The results show that StereoGAN+PSMNet performs better than StereoGAN in all metrics. Although, when compared with our method, StereoGAN+PSMNet performs considerably worse as the absolute depth error increases from $4.377\mathrm{mm}$ to $13.762\mathrm{mm}$ . This is further corroborated by Fig. 6, where StereoGAN+PSMNet struggles to predict depth on real objects such as the metal can, which is a specular surface. On the other hand, our mixed domain learning method has improved accuracy on these + +types of objects. This large performance improvement can be attributed to direct supervision in the simulation domain of primitives with random shapes and materials, a well-shaped temporal IR reprojection which accurately locates the correct correspondences, and a more robust pipeline overall since it doesn't use the GAN module. + +Intel RealSense D415. To the best of our knowledge, we are the first work to be quantitatively compared with commercial products. The Intel RealSense D415 uses a traditional CENSUS-based stereo matching method [19, 36], which has high computation efficiency but will leave uncertain pixels without depth values. Therefore, we report our results on the same completeness levels as RealSense and demonstrate that our method outperforms RealSense in + +
PatternAbs depth err (mm) ↓>4mm ↓
Raw IR32.1660.638
LCN IR [38]10.5980.512
2-Step IR4.6970.373
Temporal IR4.3770.335
+ +every metric. In Fig. 6, RealSense is unable to accurately predict pixels in specular areas, while our method is able to match those pixels well. In addition, for 3D-printed objects, our model also demonstrates lower depth error. + +# 4.3. Ablation Study + +In this section, we validate the effectiveness of each component and design choice through ablation experiments. + +Reprojection Loss. We compare the network's performance when doing reprojection on different patterns which is shown Tab. 2. Raw IR simply computes the patch-wise Mean Squared Error (MSE) of the warped images. LCN IR is from ActiveStereoNet [38], which uses an LCN module to alleviate the condition where two matched pixels have large residuals due to the distance from the camera and the physical properties of the surface. + +For the sake of fairness, we add synthetic ground truth depth supervision to all of the experiments above. The Raw IR reprojection has the worst result because it doesn't take into account the different intensities of IR light of two matched pixels. While LCN IR helps address this issue, it employs reprojection on the continuous local normalized grayscale IR image, which is still affected by environmental illumination and object texture. To tackle this issue, we proposed a reprojection loss on 2-Step IR patterns which shows better performance since the binary pattern eliminates the small residual of two matched pixels. Lastly, since the SNR is low for pixels that are far away from the camera, 2-Step IR cannot properly extract the active light pattern in distant areas. This issue is addressed by our temporal IR patterns. By tracking the intensity difference in the temporal IR image sequence, our approach extracts a more accurate and complete IR pattern. The results prove that our reprojection on temporal IR images is superior to all other reprojection methods. + +Simulation Supervision. In order to investigate the effect of simulation supervision, we implement the experiments listed on Tab. 3. Specifically, we observe a significant performance drop in the trained model after removing supervision on simulation disparity. Therefore, we can conclude that supervision on simulation domain helps the network achieve better performance. + +Table 2. Comparison of self-supervised reprojection loss on different patterns + +
Without sim ground-truth
ReprojectionAbs depth err (mm) ↓>4mm ↓
Raw IR43.3260.716
Temporal IR4.7290.367
With sim ground-truth
ReprojectionAbs depth err (mm) ↓>4mm ↓
Raw IR32.1660.638
Temporal IR4.3770.335
+ +Table 3. Comparison of disparity supervision in the simulation domain with different self-supervised reprojection loss + +
Simulation DatasetAbs depth err (mm) ↓>4mm ↓
Testing objects4.3880.347
Shape primitives4.3770.335
+ +Table 4. Performance of network trained on different simulation datasets, 'Testing objects' consists of only objects in the testing dataset, 'Shape primitives' consists of shape primitives of different size, texture and material + +As mentioned before, the simulation domain can help temporal IR reprojection converge closer and faster to a global minima. Then, temporal IR reprojection serves to further converge to the ground truth disparity. The results in Tab. 3 are consistent with the fact that synthetic supervision can further improve the performance. + +Generalization. In order to evaluate the generalizability of the learned stereo network trained on the simulated dataset consisting of shape primitives, we construct another simulated dataset using the same objects as in the testing dataset. Table 4 shows the model trained on the random shape primitives dataset outperforms the model trained on the dataset that contains only shapes and textures that appear in the testing dataset, which validates the claim that greater variation of geometry, texture, and material introduced in our shape primitives dataset leads to superior generalizability of the learned stereo network. + +# 5. Conclusion and Future Work + +In this paper, we propose a novel end-to-end training framework, mixed domain learning, for learning-based active stereo that surpasses commercial depth sensors and state-of-the-art methods in the real world without any real depth annotation. One limitation of our work is that we only evaluate its effectiveness on one type of active stereovision sensor. Further study is needed to understand the extent to which our learned stereo network transfers to other out-of-distribution real datasets and types of sensors. Additionally, in order for this framework to be useable in real applications, we would need to investigate how to accelerate network inference to achieve real-time depth predictions. + +# References + +[1] Michael Bleyer, Christoph Rhemann, and Carsten Rother. Patchmatch stereo-stereo matching with slanted support windows. In *Bmvc*, volume 11, pages 1-11, 2011. 4 +[2] Jia-Ren Chang and Yong-Sheng Chen. Pyramid stereo matching network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5410-5418, 2018. 1, 2, 5, 6, 7 +[3] Rui Chen, Songfang Han, Jing Xu, and Hao Su. Point-based multi-view stereo network. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1538-1547, 2019. 1 +[4] Rui Chen, Songfang Han, Jing Xu, and Hao Su. Visibility-aware point-based multi-view stereo network. IEEE transactions on pattern analysis and machine intelligence, 43(10):3695-3708, 2020. 1 +[5] Rui Chen, Jing Xu, and Song Zhang. Comparative study on 3d optical sensors for short range applications. Optics and Lasers in Engineering, 149:106763, 2022. 1, 2 +[6] Joao Cunha, Eurico Pedrosa, Cristóvao Cruz, Antonio JR Neves, and Nuno Lau. Using a depth camera for indoor robot localization and navigation. DETI/IEETA-University of Aveiro, Portugal, page 6, 2011. 1 +[7] Weijian Deng, Liang Zheng, Qixiang Ye, Guoliang Kang, Yi Yang, and Jianbin Jiao. Image-image domain adaptation with preserved self-similarity and domain-dissimilarity for person re-identification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 994–1003, 2018. 3 +[8] Sean Ryan Fanello, Julien Valentin, Christoph Rhemann, Adarsh Kowdle, Vladimir Tankovich, Philip Davidson, and Shahram Izadi. Ultrastereo: Efficient learning-based matching for active stereo systems. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6535-6544. IEEE, 2017. 4 +[9] Yasutaka Furukawa and Carlos Hernández. Multi-view stereo: A tutorial. Found. Trends. Comput. Graph. Vis., 9(1-2):1-148, jun 2015. 4 +[10] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In International conference on machine learning, pages 1180-1189. PMLR, 2015. 3 +[11] Huachen Gao, Xiaoyu Liu, Meixia Qu, and Shijie Huang. Pdonet: Self-supervised monocular depth estimation using perceptual and data augmentation consistency. Applied Sciences, 11(12), 2021. 2 +[12] Andreas Geiger, P Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: the kitti dataset. The International Journal of Robotics Research, 32:1231-1237, 09 2013. 2 +[13] Silvio Giancola, Matteo Valenti, and Remo Sala. A survey on 3D cameras: Metrological comparison of time-of-flight, structured-light and active stereoscopy technologies. Springer, 2018. 2 +[14] 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, 3 +[15] Xiaodong Gu, Zhiwen Fan, Siyu Zhu, Zuozhuo Dai, Feitong Tan, and Ping Tan. Cascade cost volume for high-resolution multi-view stereo and stereo matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2 +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 2 +[17] Minho Hwang, Daniel Seita, Brijen Thananjeyan, Jeffrey Ichnowski, Samuel Paradis, Danyal Fer, Thomas Low, and Ken Goldberg. Applying depth-sensing to automated surgical manipulation with a da Vinci robot. In 2020 International Symposium on Medical Robotics (ISMR), pages 22-29. IEEE, 2020. 1 +[18] Alex Kendall, Hayk Martirosyan, Saumitro Dasgupta, Peter Henry, Ryan Kennedy, Abraham Bachrach, and Adam Bry. End-to-end learning of geometry and context for deep stereo regression. In Proceedings of the IEEE International Conference on Computer Vision, pages 66-75, 2017. 2 +[19] Leonid Keselman, John Iselin Woodfill, Anders Grunnet-Jepsen, and Achintya Bhowmik. Intel realsense stereoscopic depth cameras. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 1-10, 2017. 1, 7 +[20] Naveen Kodali, Jacob Abernethy, James Hays, and Zsolt Kira. On convergence and stability of gans. arXiv preprint arXiv:1705.07215, 2017. 2 +[21] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 25. Curran Associates, Inc., 2012. 2 +[22] Ya Le and Xuan Yang. Tiny imagenet visual recognition challenge. CS 231N, 7(7):3, 2015. 5, 6 +[23] Rui Liu, Chengxi Yang, Wenxiu Sun, Xiaogang Wang, and Hongsheng Li. Stereogan: Bridging synthetic-to-real domain gap by joint optimization of domain translation and stereo matching. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 12757-12766, 2020. 2, 3, 6, 7 +[24] Mingsheng Long, Guiguang Ding, Jianmin Wang, Jia-Guang Sun, Yuchen Guo, and Philip S. Yu. Transfer sparse coding for robust image representation. 2013 IEEE Conference on Computer Vision and Pattern Recognition, pages 407-414, 2013. 3 +[25] Nikolaus Mayer, Eddy Ig, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4040-4048, 2016. 2 +[26] Akhilesh Kumar Mishra and Oscar Meruvia-Pastor. Robot arm manipulation using depth-sensing cameras and inverse kinematics. 2014 Oceans - St. John's, pages 1-6, 2014. 1 + +[27] Steven G. Parker, James Bigler, Andreas Dietrich, Heiko Friedrich, Jared Hoberock, David Luebke, David McAllister, Morgan McGuire, Keith Morley, Austin Robison, and Martin Stich. Optix: A general purpose ray tracing engine. ACM Trans. Graph., 29(4), jul 2010. 6 +[28] Matt Pharr, Wenzel Jakob, and Greg Humphreys. Physically based rendering: From theory to implementation. Morgan Kaufmann, 2016. 5 +[29] Shreeyak Sajjan, Matthew Moore, Mike Pan, Ganesh Nagaraja, Johnny Lee, Andy Zeng, and Shuran Song. Clear grasp: 3d shape estimation of transparent objects for manipulation. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 3634-3642. IEEE, 2020. 2 +[30] Swami Sankaranarayanan, Yogesh Balaji, Arpit Jain, Ser-Nam Lim, and Rama Chellappa. Learning from synthetic data: Addressing domain shift for semantic segmentation. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3752-3761, 2018. 3 +[31] DANIEL SCHARSTEIN. A taxonomy and evaluation of dense two-frame stereo correspondence. Proceedings of the IEEE Workshop on Stereo and Multi-Baseline Vision, Kauai, HI, Dec, 2001, 2001. 2 +[32] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In Gang Hua and Hervé Jégou, editors, Computer Vision - ECCV 2016 Workshops, pages 443-450, Cham, 2016. Springer International Publishing. 3 +[33] Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In 2017 IEEE/RSJ international conference on intelligent robots and systems (IROS), pages 23-30. IEEE, 2017. 2 +[34] Yi-Hsuan Tsai, Wei-Chih Hung, Samuel Schulter, Kiyuk Sohn, Ming-Hsuan Yang, and Manmohan Chandraker. Learning to adapt structured output space for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 3 +[35] Yao Yao, Zixin Luo, Shiwei Li, Tian Fang, and Long Quan. Mvsnet: Depth inference for unstructured multi-view stereo. In Proceedings of the European Conference on Computer Vision (ECCV), pages 767-783, 2018. 1 +[36] Ramin Zabih and John Woodfill. Non-parametric local transforms for computing visual correspondence. In European conference on computer vision, pages 151-158. Springer, 1994. 7 +[37] Jure Zbontar and Yann LeCun. Computing the stereo matching cost with a convolutional neural network. 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2015. 2 +[38] Yinda Zhang, Sameh Khamis, Christoph Rhemann, Julien Valentin, Adarsh Kowdle, Vladimir Tankovich, Michael Schoenberg, Shahram Izadi, Thomas Funkhouser, and Sean Fanello. Activestereonet: End-to-end self-supervised learning for active stereo systems. In Proceedings of the European Conference on Computer Vision (ECCV), pages 784-801, 2018. 2, 3, 4, 5, 8 + +[39] Yiran Zhong, Yuchao Dai, and Hongdong Li. Self-supervised learning for stereo matching with self-improving ability. arXiv preprint arXiv:1709.00930, 2017. 2 \ No newline at end of file diff --git a/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/images.zip b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ee11dc1670b2a84dea2a294c9b29f69aaf104e08 --- /dev/null +++ b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b74230652c837738c6368678659ba541acdaf6e4b0783e4f814c637e8298c8f3 +size 708462 diff --git a/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/layout.json b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ea6e76b379fe47293692f12b58dd4e64c968f502 --- /dev/null +++ b/activezeromixeddomainlearningforactivestereovisionwithzeroannotation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1717004f3c98851d58d4fb53100222ebda74fb33f2f22258d8aa4778f298c826 +size 351170 diff --git a/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_content_list.json b/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bb2db92e45a81e7bb8cbd2d1dc1cf42cd30f93ca --- /dev/null +++ b/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e64d4aaa451052c53ef762201bcf1027175242082d58902dc6e6b13c937e7081 +size 88558 diff --git a/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_model.json b/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dea77030925980892e4de720766333a971588000 --- /dev/null +++ b/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb22a278d432cbd45a8b79894aa918c1308229f5102bbf04d556a906a918be1b +size 108922 diff --git a/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_origin.pdf b/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..86c37e9c4bcf0c3256d33516c5a32beb56e3af62 --- /dev/null +++ b/adafacequalityadaptivemarginforfacerecognition/dc7d1c23-44a7-4262-af2b-c1ca91b337cd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:527bc52baeb5af4d816d299015852bf3d300e29fd2eec2507ebc593a778ece38 +size 3185265 diff --git a/adafacequalityadaptivemarginforfacerecognition/full.md b/adafacequalityadaptivemarginforfacerecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0dd92318895478f9211bf1034b6d14b7223beec7 --- /dev/null +++ b/adafacequalityadaptivemarginforfacerecognition/full.md @@ -0,0 +1,367 @@ +# AdaFace: Quality Adaptive Margin for Face Recognition + +Minchul Kim, Anil K. Jain, Xiaoming Liu +Department of Computer Science and Engineering, +Michigan State University, East Lansing, MI, 48824 + +{kimminc2, jain, liuxm}@cse.msu.edu + +# Abstract + +Recognition in low quality face datasets is challenging because facial attributes are obscured and degraded. Advances in margin-based loss functions have resulted in enhanced discriminability of faces in the embedding space. Further, previous studies have studied the effect of adaptive losses to assign more importance to misclassified (hard) examples. In this work, we introduce another aspect of adaptiveness in the loss function, namely the image quality. We argue that the strategy to emphasize misclassified samples should be adjusted according to their image quality. Specifically, the relative importance of easy or hard samples should be based on the sample's image quality. We propose a new loss function that emphasizes samples of different difficulties based on their image quality. Our method achieves this in the form of an adaptive margin function by approximating the image quality with feature norms. Extensive experiments show that our method, AdaFace, improves the face recognition performance over the state-of-the-art (SoTA) on four datasets (IJB-B, IJB-C, IJB-S and TinyFace). Code and models are released in Supp. + +# 1. Introduction + +Image quality is a combination of attributes that indicates how faithfully an image captures the original scene [28]. Factors that affect the image quality include brightness, contrast, sharpness, noise, color constancy, resolution, tone reproduction, etc. Face images, the focus of this paper, can be captured under a variety of settings for lighting, pose and facial expression, and sometimes under extreme visual changes such as a subject's age or make-up. These parameter settings make the recognition task difficult for learned face recognition (FR) models. Still, the task is achievable in the sense that humans or models can often recognize faces under these difficult settings [33]. However, when a face image is of low quality, depending on the degree, the recognition task becomes infeasible. Fig. 1 shows examples of both high quality and low quality face images. It is not possible to recognize the subjects in the last column of Fig. 1. + +Figure 1. Examples of face images with different qualities and recognizabilities. Both high and low quality images contain variations in pose, occlusion and resolution that sometimes make the recognition task difficult, yet achievable. Depending on the degree of degradation, some images may become impossible to recognize. By studying the different impacts these images have in training, this work aims to design a novel loss function that is adaptive to a sample's recognizability, driven by its image quality. +![](images/7a3aad6985b17258215e917f7e5b43c86b217684263da58e1b91fa908583b999.jpg) +: Images contain enough clues to identify the subject +Images do not have enough clues to identify the subject + +Low quality images like the bottom row of Fig. 1 are increasingly becoming an important part of face recognition datasets because they are encountered in surveillance videos and drone footage. Given that SoTA FR methods [4, 5, 13, 17] are able to obtain over $98\%$ verification accuracy in relatively high quality datasets such as LFW or CFP-FP [11,27], recent FR challenges have moved to lower quality datasets such as IJB-B, IJB-C and IJB-S [14,22,37]. Although the challenge is to attain high accuracy on low quality datasets, most popular training datasets still remain comprised of high quality images [4,8]. Since only a small portion of training data is low quality, it is important to properly leverage it during training. + +One problem with low quality face images is that they tend to be unrecognizable. When the image degradation is too large, the relevant identity information vanishes from the image, resulting in unidentifiable images. These unidentifiable images are detrimental to the training procedure since a model will try to exploit other visual characteristics, such as clothing color or image resolution, to lower the training loss. If these images are dominant in the distribution of low quality images, the model is likely to perform poorly on low quality datasets during testing. + +![](images/076ec8aaf00a687bb2d7cb5d09bff396a811071c3ada33bb3fc802e2e6d5d049.jpg) +(a) Margin based Softmax + +![](images/cb1ee2533d3e2b9e030142cac005d9c733ccc75497ece4b0381fc9f7103d1bb9.jpg) +(b) Proposed approach (AdaFace) +Figure 2. Conventional margin based softmax loss vs our AdaFace. (a) A FR training pipeline with a margin based softmax loss. The loss function takes the margin function to induce smaller intra-class variations. Some examples are SphereFace, CosFace and ArcFace [4,20,35]. (b) Proposed adaptive margin function (AdaFace) that is adjusted based on the image quality indicator. If the image quality is indicated to be low, the loss function emphasizes easy samples (thereby avoiding unidentifiable images). Otherwise, the loss emphasizes hard samples. + +Motivated by the presence of unidentifiable facial images, we would like to design a loss function which assigns different importance to samples of different difficulties according to the image quality. We aim to emphasize hard samples for the high quality images and easy samples for low quality images. Typically, assigning different importance to different difficulties of samples is done by looking at the training progression (curriculum learning) [1, 13]. Yet, we show that the sample importance should be adjusted by looking at both the difficulty and the image quality. + +The reason why importance should be set differently according to the image quality is that naively emphasizing hard samples always puts a strong emphasis on unidentifiable images. This is because one can only make a random guess about unidentifiable images and thus, they are always in the hard sample group. There are challenges in introducing image quality into the objective. This is because image quality is a term that is hard to quantify due to its broad definition and scaling samples based on the difficulty often introduces ad-hoc procedures that are heuristic in nature. + +In this work, we present a loss function to achieve the above goal in a seamless way. We find that 1) feature norm can be a good proxy for the image quality, and 2) various margin functions amount to assigning different importance to different difficulties of samples. These two findings are combined in a unified loss function, AdaFace, that adaptively changes the margin function to assign different importance to different difficulties of samples, based on the image quality (see Fig. 2). + +In summary, the contributions of this paper include: + +- We propose a loss function, AdaFace, that assigns different importance to different difficulties of samples according to their image quality. By incorporating image quality, we avoid emphasizing unidentifiable images while focusing on hard yet recognizable samples. +- We show that the angular margin scales the learning signal (gradient) based on the training sample's difficulty. This observation motivates us to change margin function adaptively to emphasize hard samples if the image quality is high, and ignore very hard samples (unidentifiable + +images) if the image quality is low. + +- We demonstrate that feature norms can serve as the proxy of image quality. It bypasses the need for an additional module to estimate image quality. Thus, adaptive margin function is achieved without additional complexity. +- We verify the efficacy of the proposed method by extensive evaluations on 9 datasets (LFW, CFP-FP, CPLFW, AgeDB, CALFW, IJB-B, IJB-C, IJB-S and TinyFace) of various qualities. We show that the recognition performance on low quality datasets can be hugely increased while maintaining performance on high quality datasets. + +# 2. Related Work + +Margin Based Loss Function. The margin based softmax loss function is widely used for training face recognition (FR) models [4, 13, 20, 35]. Margin is added to the softmax loss because without the margin, learned features are not sufficiently discriminative. SphereFace [20], CosFace [35] and ArcFace [4] introduce different forms of margin functions. Specifically, it can be written as, + +$$ +\mathcal {L} = - \log \frac {\exp \left(f \left(\theta_ {y _ {i}} , m\right)\right)}{\exp \left(f \left(\theta_ {y _ {i}} , m\right)\right) + \sum_ {j \neq y _ {i}} ^ {n} \exp (s \cos \theta_ {j})}, \tag {1} +$$ + +where $\theta_{j}$ is the angle between the feature vector and the $j^{th}$ classifier weight vector, $y_{i}$ is the index of the ground truth (GT) label, and $m$ is the margin, which is a scalar hyperparameter. $f$ is a margin function, where + +$$ +f \left(\theta_ {j}, m\right) _ {\text {S p h e r e F a c e}} = \left\{ \begin{array}{l l} s \cos \left(m \theta_ {j}\right) & j = y _ {i} \\ s \cos \theta_ {j} & j \neq y _ {i} \end{array} , \right. \tag {2} +$$ + +$$ +f \left(\theta_ {j}, m\right) _ {\text {C o s F a c e}} = \left\{ \begin{array}{l l} s \left(\cos \theta_ {j} - m\right) & j = y _ {i} \\ s \cos \theta_ {j} & j \neq y _ {i} \end{array} , \right. \tag {3} +$$ + +$$ +f \left(\theta_ {j}, m\right) _ {\text {A r c F a c e}} = \left\{ \begin{array}{l l} s \cos \left(\theta_ {j} + m\right) & j = y _ {i} \\ s \cos \theta_ {j} & j \neq y _ {i} \end{array} . \right. \tag {4} +$$ + +Sometimes, ArcFace is referred to as an angular margin and CosFace is referred to as an additive margin. Here, $s$ is a + +hyper-parameter for scaling. P2SGrad [42] notes that $m$ and $s$ are sensitive hyper-parameters and proposes to directly modify the gradient to be free of $m$ and $s$ . + +Our approach aims to model the margin $m$ as a function of the image quality because $f(\theta_{y_i},m)$ has an impact on which samples contribute more gradient (i.e. learning signal) during training. + +Adaptive Loss Functions. Many studies have introduced an element of adaptiveness in the training objective for either hard sample mining [18, 36], scheduling difficulty during training [13, 31], or finding optimal hyperparameters [41]. For example, CurricularFace [13] brings the idea of curriculum learning into the loss function. During the initial stages of training, the margin for $\cos \theta_{j}$ (negative cosine similarity) is set to be small so that easy samples can be learned and in the later stages, the margin is increased so that hard samples are learned. Specifically, it is written as + +$$ +f \left(\theta_ {j}, m\right) _ {\text {C u r r i c u l a r}} = \left\{ \begin{array}{l l} s \cos \left(\theta_ {j} + m\right) & j = y _ {i} \\ N (t, \cos \theta_ {j}) & j \neq y _ {i} \end{array} , \right. \tag {5} +$$ + +where + +$$ +N (t, \cos \theta_ {j}) = \left\{ \begin{array}{l l} \cos (\theta_ {j}) & s \cos (\theta_ {y _ {i}} + m) \geq \cos \theta_ {j} \\ \cos (\theta_ {j}) (t + \cos \theta_ {j}) & s \cos (\theta_ {y _ {i}} + m) < \cos \theta_ {j} \end{array} , \right. \tag {6} +$$ + +and $t$ is a parameter that increases as the training progresses. Therefore, in CurricularFace, the adaptiveness in the margin is based on the training progression (curriculum). + +On the contrary, we argue that the adaptiveness in the margin should be based on the image quality. We believe that among high quality images, if a sample is hard (with respect to a model), the network should learn to exploit the information in the image, but in low quality images, if a sample is hard, it is more likely to be devoid of proper identity clues and the network should not try hard to fit on it. + +MagFace [23] explores the idea of applying different margins based on recognizability. It applies large angular margins to high norm features on the premise that high norm features are easily recognizable. Large margin pushes features of high norm closer to class centers. Yet, it fails to emphasize hard training samples, which is important for learning discriminative features. A detailed contrast with MagFace can be found in the supplementary B.1. It is also worth mentioning that DDL [12] uses the distillation loss to minimize the gap between easy and hard sample features. + +Face Recognition with Low Quality Images. Recent FR models have achieved high performance on datasets where facial attributes are discernable, e.g., LFW [11], CFP-FP [27], CPLFW [43], AgeDB [25] and CALFW [44]. Good performance on these datasets can be achieved when the FR model learns discriminative features invariant to lighting, age or pose variations. However, FR in unconstrained scenarios such as in surveillance or low quality videos [38] brings more problems to the table. Examples of datasets + +in this setting are IJB-B [37], IJB-C [22] and IJB-S [14], where most of the images are of low quality, and some do not contain sufficient identity information, even for human examiners. The key to good performance involves both 1) learning discriminative features for low quality images and 2) learning to discard images that contain few identity cues. The latter is sometimes referred to as quality aware fusion. + +To perform quality aware fusion, probabilistic approaches have been proposed to predict uncertainty in FR representation [2, 17, 26, 29]. It is assumed that the features are distributions where the variance can be used to calculate the certainty in prediction. However, due to the instability in the training objective, probabilistic approaches resort to learning mean and variance separately, which is not simple during training and suboptimal as the variance is optimized with a fixed mean. Our work, however, is a modification to the conventional softmax loss, making the framework easy to use. Further, we use the feature norm as a proxy for the predicted quality during quality aware fusion. + +Synthetic data or data augmentations can be used to mimic low quality data. [30] adopts 3D face reconstruction [7] to rotate faces and trains a facial attribute labeler to generate pseudo labels of training data. These auxiliary steps complicate the training procedure and make it hard to generalize to other datasets or domains. Our approach only involves simple crop, blur and photometric augmentations, which are also applicable to other datasets and domains. + +# 3. Proposed Approach + +The cross entropy softmax loss of a sample $\pmb{x}_i$ can be formulated as follows, + +$$ +\mathcal {L} _ {C E} \left(\boldsymbol {x} _ {i}\right) = - \log \frac {\exp \left(\boldsymbol {W} _ {y _ {i}} \boldsymbol {z} _ {i} + b _ {y _ {i}}\right)}{\sum_ {j = 1} ^ {C} \exp \left(\boldsymbol {W} _ {j} \boldsymbol {z} _ {j} + b _ {j}\right)}, \tag {7} +$$ + +where $\mathbf{z}_i \in \mathbb{R}^d$ is the $\mathbf{x}_i$ 's feature embedding, and $\mathbf{x}_i$ belongs to the $y_i$ th class. $\mathbf{W}_j$ refers to the $j$ th column of the last FC layer weight matrix, $\mathbf{W} \in \mathbb{R}^{d \times C}$ , and $b_j$ refers to the corresponding bias term. $C$ refers to the number of classes. + +During test time, for an arbitrary pair of images, $\pmb{x}_p$ and $\pmb{x}_q$ , the cosine similarity metric, $\frac{\pmb{z}_p\cdot\pmb{z}_q}{\|\pmb{z}_p\| \|\pmb{z}_q\|}$ is used to find the closest matching identities. To make the training objective directly optimize the cosine distance, [20, 34] use normalized softmax where the bias term is set to zero and the feature $z_{i}$ is normalized and rescaled with $s$ during training. This modification results in + +$$ +\mathcal {L} _ {C E} \left(\boldsymbol {x} _ {i}\right) = - \log \frac {\exp \left(s \cdot \cos \theta_ {y _ {i}}\right)}{\sum_ {j = 1} ^ {C} \exp \left(s \cos \theta_ {j}\right)}, \tag {8} +$$ + +where $\theta_{j}$ corresponds to the angle between $z_{i}$ and $W_{j}$ . Follow-up works [4, 35] take this formulation and introduces a margin to reduce the intra-class variations. Generally, it can be written as Eq. 1 where margin functions are defined in Eqs. 2, 3 and 4 correspondingly. + +![](images/3ae4a48af1621fadff12a3760a93f9b8df4ffbf3543f1af057ec437c21fce76f.jpg) +Figure 3. Illustration of different margin functions and their gradient scaling terms on the feature space. $B_{0}$ and $B_{1}$ show the decision boundary with and without margin $m$ , respectively. The yellow arrow indicates the shift in the boundary due to margin $m$ . In the arc, a well-classified sample will be close to (in angle) the ground truth class weight vector, $W_{y_i}$ . A misclassified sample will be close to $W_{j}$ , the negative class weight vector. The color within the arc indicates the magnitude of the gradient scaling term $g$ (Eq. 12). Samples in the dark red region will contribute more to learning. Note that additive margin shifts the boundary toward $W_{y_i}$ , without changing the gradient scaling term. However, positive angular margin not only shifts the boundary, but also makes the gradient scale high near the boundary and low away from the boundary. This behavior de-emphasizes very hard samples, and likewise MagFace has similar behavior. On the other hand, negative angular margin induces an opposite behavior. CurricularFace adapts the boundary based on the training stage. Our work adaptively changes the margin functions based on the norm. With high norm, we emphasize samples away from the boundary and with low norm we emphasize samples near the boundary. Circles and triangles in the arc show example scenarios in the right most plot (AdaFace). + +# 3.1. Margin Form and the Gradient + +Previous works on margin based softmax focused on how the margin shifts the decision boundaries and what their geometric interpretations are [4, 35]. In this section, we show that during backpropagation, the gradient change due to the margin has the effect of scaling the importance of a sample relative to the others. In other words, angular margin can introduce an additional term in the gradient equation that scales the signal according to the sample's difficulty. To show this, we will look at how the gradient equation changes with the margin function $f(\theta_{y_i}, m)$ . + +Let $P_{j}^{(i)}$ be the probability output at class $j$ after softmax operation on an input $x_{i}$ . By deriving the gradient equations for $\mathcal{L}_{CE}$ w.r.t. $W_{j}$ and $x_{i}$ , we obtain the following, + +$$ +P _ {j} ^ {(i)} = \frac {\exp (f (\cos \theta_ {y _ {i}}))}{\exp (f (\cos \theta_ {y _ {i}})) + \sum_ {j \neq y _ {i}} ^ {n} \exp (s \cos \theta_ {j})}, \tag {9} +$$ + +$$ +\frac {\partial \mathcal {L} _ {\mathrm {C E}}}{\partial \boldsymbol {W} _ {j}} = \left(P _ {j} ^ {(i)} - \mathbb {1} \left(y _ {i} = j\right)\right) \frac {\partial f (\cos \theta_ {j})}{\partial \cos \theta_ {j}} \frac {\partial \cos \theta_ {j}}{\partial \boldsymbol {W} _ {j}}, \tag {10} +$$ + +$$ +\frac {\partial \mathcal {L} _ {\mathrm {C E}}}{\partial \boldsymbol {x} _ {i}} = \sum_ {k = 1} ^ {C} \left(P _ {k} ^ {(i)} - \mathbb {1} (y _ {i} = k)\right) \frac {\partial f (\cos \theta_ {k})}{\partial \cos \theta_ {k}} \frac {\partial \cos \theta_ {k}}{\partial \boldsymbol {x} _ {i}}. \tag {11} +$$ + +In Eqs. 10 and 11, the first two terms, $\left(P_j^{(i)} - \mathbb{1}(y_i = j)\right)$ and $\frac{\partial f(\cos\theta_j)}{\partial\cos\theta_j}$ are scalars. Also, these two are the only terms affected by parameter $m$ through $f(\cos \theta_{y_i})$ . As the direction term, $\frac{\partial\cos\theta_j}{\partial W_j}$ is free of $m$ , we can think of the first two scalar terms as a gradient scaling term (GST) and denote, + +$$ +g := \left(P _ {j} ^ {(i)} - \mathbb {1} \left(y _ {i} = j\right)\right) \frac {\partial f (\cos \theta_ {j})}{\partial \cos \theta_ {j}}. \tag {12} +$$ + +For the purpose of the GST analysis, we will consider the class index $j = y_{i}$ , since all negative class indices $j \neq y_{i}$ do not have a margin in Eqs. 2, 3, and 4. The GST for the normalized softmax loss is + +$$ +g _ {\text {s o f t m a x}} = \left(P _ {y _ {i}} ^ {(i)} - 1\right) s, \tag {13} +$$ + +since $f(\cos \theta_{y_i}) = s \cdot \cos \theta_{y_i}$ and $\frac{\partial f(\cos \theta_{y_i})}{\partial \cos \theta_{y_i}} = s$ . The GST for the CosFace [35] is also + +$$ +g _ {\text {C o s F a c e}} = \left(P _ {y _ {i}} ^ {(i)} - 1\right) s, \tag {14} +$$ + +as $f(\cos \theta_{y_i}) = s(\cos \theta_{y_i} - m)$ and $\frac{\partial f(\cos\theta_{y_i})}{\partial\cos\theta_{y_i}} = s$ . Yet, the GST for ArcFace [4] turns out to be + +$$ +g _ {\text {A r c F a c e}} = \left(P _ {j} ^ {(i)} - 1\right) s \left(\cos (m) + \frac {\cos \theta_ {y _ {i}} \sin (m)}{\sqrt {1 - \cos^ {2} \theta_ {y _ {i}}}}\right). \tag {15} +$$ + +The derivation can be found in the supplementary. Since the GST is a function of $\theta_{y_i}$ and $m$ as in Eq. 15, it is possible to use it to control the emphasis on samples based on the difficulty, i.e., $\theta_{y_i}$ during training. + +To understand the effect of GST, we visualize GST w.r.t. the features. Fig. 3 shows the GST as the color in the feature space. Note that for the angular margin, the GST peaks at the decision boundary but slowly decreases as it moves away towards $W_{j}$ and harder samples receive less emphasis. If we change the sign of the angular margin, we see an opposite effect. Note that, in the 6th column, MagFace [23] is an extension of ArcFace (positive angular margin) with larger margin assigned to high norm feature. Both ArcFace and MagFace fail to put high emphasis on hard samples (green area near $W_{j}$ ). We combine all margin functions (positive and negative angular margins and additive margins) to emphasize hard samples when necessary. + +Note that this adaptiveness is also different from approaches that use the training stage to change the relative importance of different difficulties of samples [13]. Fig. 3 shows CurricularFace where the decision boundary and the GST $g$ change depending on the training stage. + +# 3.2. Norm and Image quality + +Image quality is a comprehensive term that covers characteristics such as brightness, contrast and sharpness. Image quality assessment (IQA) is widely studied in computer vision [39]. SER-FIQ [32] is an unsupervised DL method for face IQA. BRISQUE [24] is a popular algorithm for blind/no-reference IQA. However, such methods are computationally expensive to use during training. In this work, we refrain from introducing an additional module that calculates the image quality. Instead, we use the feature norm as a proxy for the image quality. We observe that, in models trained with a margin-based softmax loss, the feature norm exhibits a trend that is correlated with the image quality. + +In Fig. 4 (a) we show a correlation plot between the feature norm and the image quality (IQ) score calculated with (1-BRISQUE) as a green curve. We randomly sampled 1, 534 images from the training dataset (MS1MV2 [4] with augmentations described in Sec. 4.1) and calculate the feature norm using a pretrained model. At the final epoch, the correlation score between the feature norm and IQ score reaches 0.5235 (out of $-1$ and $1$ ). The corresponding scatter plot is shown in Fig. 4 (b). This high correlation between the feature norm and the IQ score supports our use of feature norm as the proxy of image quality. + +In Fig. 4 (a) we also show a correlation plot between the probability output $P_{y_i}$ and the IQ score as an orange curve. Note that the correlation is always higher for the feature norm than for $P_{y_i}$ . Furthermore, the correlation between the feature norm and IQ score is visible from an early stage of training. This is a useful property for using the feature norm as the proxy of image quality because we can rely on the proxy from the early stage of training. Also, in Fig. 4 (c), we show a scatter plot between $P_{y_i}$ and IQ score. Notice that there is a non-linear relationship between $P_{y_i}$ and the image quality. One way to describe a sample's difficulty is with $1 - P_{y_i}$ , and the plot shows that the distribution of the difficulty of samples is different based on image quality. Therefore, it makes sense to consider the image quality when adjusting the sample importance according to the difficulty. + +# 3.3. AdaFace: Adaptive Margin based on Norm + +To address the problem caused by the unidentifiable images, we propose to adapt the margin function based on the feature norm. In Sec. 3.1, we have shown that using different margin functions can emphasize different difficulties of samples. Also, in Sec. 3.2, we have observed that the feature norm can be a good way to find low quality images. We + +![](images/f5c30b5be2af040a31ea10c3d2675b798310af88cbb2ea74a88ced8abf7c5eb1.jpg) +a) Correlation for all epochs +Figure 4. (a) A plot of Pearson correlation with image quality score (1-BRISQUE) over training epochs. The green and orange curves correspond to the correlation plot using the feature norm $\| \mathbf{z}_i\|$ and the probability output for the ground truth index $P_{y_i}$ , respectively. (b) and (c) Corresponding scatter plots for the last epoch. The blue line on the scatter plot and the corresponding equation shows the least square line fitted to the data points. + +![](images/7e1abddd526eca69f280ffdb554cc56f09c4c785bfe05727530c1741185f12fd.jpg) +b) Feature norm vs img. qual. + +![](images/ace223b82fd6dd621b3520f611af9f47873e1cdedebbf59568c63af61b73212a.jpg) +c) Prob. output vs img. qual. + +will merge the two findings and propose a new loss for FR. + +Image Quality Indicator. As the feature norm, $\| \pmb{z}_i\|$ is a model dependent quantity, we normalize it using batch statistics $\mu_z$ and $\sigma_z$ . Specifically, we let + +$$ +\widehat {\left\| \boldsymbol {z} _ {i} \right\|} = \left. \left\lfloor \frac {\left\| \boldsymbol {z} _ {i} \right\| - \mu_ {z}}{\sigma_ {z} / h} \right] _ {- 1} ^ {1}, \right. \tag {16} +$$ + +where $\mu_z$ and $\sigma_z$ are the mean and standard deviation of all $\| z_i\|$ within a batch. And $\lfloor \cdot \rfloor$ refers to clipping the value between $-1$ and 1 and stopping the gradient from flowing. Since $\frac{\|\pmb{z}_i\| - \mu_z}{\sigma_z / h}$ makes the batch distribution of $\| \pmb {z}_i\|$ as approximately unit Gaussian, we clip the value to be within $-1$ and 1 for better handling. It is known that approximately $68\%$ of the unit Gaussian distribution falls between $-1$ and 1, so we introduce the term $h$ to control the concentration. We set $h$ such that most of the values $\frac{\|\pmb{z}_i\| - \mu_z}{\sigma_z / h}$ fall between $-1$ and 1. A good value to achieve this would be $h = 0.33$ . Later in Sec. 4.2, we ablate and validate this claim. We stop the gradient from flowing during backpropagation because we do not want features to be optimized to have low norms. + +If the batch size is small, the batch statistics $\mu_z$ and $\sigma_z$ can be unstable. Thus we use the exponential moving average (EMA) of $\mu_z$ and $\sigma_z$ across multiple steps to stabilize the batch statistics. Specifically, let $\mu^{(k)}$ and $\sigma^{(k)}$ be the $k$ -th step batch statistics of $\|z_i\|$ . Then + +$$ +\mu_ {z} = \alpha \mu_ {z} ^ {(k)} + (1 - \alpha) \mu_ {z} ^ {(k - 1)}, \tag {17} +$$ + +and $\alpha$ is a momentum set to 0.99. The same is true for $\sigma_z$ . + +Adaptive Margin Function. We design a margin function such that 1) if image quality is high, we emphasize hard samples, and 2) if image quality is low, we de-emphasize hard samples. We achieve this with two adaptive terms $g_{\text{angle}}$ and $g_{\text{add}}$ , referring to angular and additive margins, respectively. Specifically, we let + +$$ +f \left(\theta_ {j}, m\right) _ {\text {A d a F a c e}} = \left\{ \begin{array}{l l} s \cos \left(\theta_ {j} + g _ {\text {a n g l e}}\right) - g _ {\text {a d d}} & j = y _ {i} \\ s \cos \theta_ {j} & j \neq y _ {i} \end{array} , \right. \tag {18} +$$ + +![](images/5bde2197a0930685f47c74cecc441e156bab76880e33f56f828cdd0afad56ef0.jpg) +(a) High Quality +Figure 5. Examples of three categories of test datasets in our study. + +![](images/6bb5b791fb2b5f672d446150b8ac1612df09da03d503afb3ba2637e6bf799098.jpg) +(b) Mixed Quality + +![](images/b187755c6b523d95babf704c2ed16fbc6b81707b924cde6d35304195e01ff31d.jpg) +(c) Low Quality + +where $g_{\mathrm{angle}}$ and $g_{\mathrm{add}}$ are the functions of $\widehat{\|\pmb{z}_i\|}$ . We define + +$$ +g _ {\text {a n g l e}} = - m \cdot \widehat {\left\| \boldsymbol {z} _ {i} \right\|}, \quad g _ {\text {a d d}} = m \cdot \widehat {\left\| \boldsymbol {z} _ {i} \right\|} + m. \tag {19} +$$ + +Note that when $\widehat{\|z_i\|} = -1$ , the proposed function becomes ArcFace. When $\widehat{\|z_i\|} = 0$ , it becomes CosFace. When $\widehat{\|z_i\|} = 1$ , it becomes a negative angular margin with a shift. Fig. 3 shows the effect of the adaptive function on the gradient. The high norm features will receive a higher gradient scale, far away from the decision boundary, whereas the low norm features will receive higher gradient scale near the decision boundary. For low norm features, the harder samples away from the boundary are de-emphasized. + +# 4. Experiments + +# 4.1. Datasets and Implementation Details + +Datasets. We use MS1MV2 [4], MS1MV3 [6] and WebFace4M [45] as our training datasets. Each dataset contains 5.8M, 5.1M and 4.2M facial images, respectively. We test on 9 datasets of varying qualities. Following the protocol of [30], we categorize the test datasets into 3 types according to the visual quality (examples shown in Fig. 5). + +- High Quality: LFW [11], CFP-FP [27], CPLFW [43] AgeDB [25] and CALFW [44] are popular benchmarks for FR in the well controlled setting. While the images show variations in lighting, pose, or age, they are of sufficiently good quality for face recognition. +- Mixed Quality: IJB-B and IJB-C [22, 37] are datasets collected for the purpose of introducing low quality images in the validation protocol. They contain both high quality images and low quality videos of celebrities. +- Low Quality: IJB-S [14] and TinyFace [3] are datasets with low quality images and/or videos. IJB-S is a surveillance video dataset, with test protocols such as Surveillance-to-Single, Surveillance-to-Booking and Surveillance-to-Surveillance. The first/second word in the protocol refers to the probe/gallery image source. Surveillance refers to the surveillance video, Single refers to a high quality enrollment image and Booking refers to multiple enrollment images taken from different viewpoints. TinyFace consists only of low quality images. + +Training Settings. We preprocess the dataset by cropping and aligning faces with five landmarks, as in [4, 40], resulting in $112 \times 112$ images. For the backbone, we adopt ResNet [9] as modified in [4]. We use the same optimizer + +and a learning rate schedule as in [13], and train for 24 epochs. The model is trained with SGD with the initial learning rate of 0.1 and step scheduling at 10, 18 and 22 epochs. If the dataset contains augmentations, we add 2 more epochs for convergence. For the scale parameter $s$ , we set it to 64, following the suggestion of [4, 35]. + +Augmentations. Since our proposed method is designed to train better in the presence of unidentifiable images in the training data, we introduce three on-the-fly augmentations that are widely used in image classification tasks [10], i.e., cropping, rescaling and photometric jittering. These augmentations will create more data but also introduce more unidentifiable images. It is a trade-off that has to be balanced. In FR, these augmentations are not used because they generally do not bring benefit to the performance (as shown in Sec. 4.2). We show that our loss function is capable of reaping the benefit of augmentations because it can adapt to ignore unidentifiable images. + +Cropping defines a random rectangular area (patch) and makes the region outside the area to be 0. We do not cut and resize the image as the alignment of the face is important. Photometric augmentation randomly scales hue, saturation and brightness. Rescaling involves resizing an image to a smaller scale and back, resulting in blurriness. These operations are applied randomly with a probability of 0.2. + +# 4.2. Ablation and Analysis + +For hyperparameter $m$ and $h$ ablation, we adopt a ResNet18 backbone and use 1/6th of the randomly sampled MS1MV2. We use two performance metrics. For High Quality Datasets (HQ), we use an average of 1:1 verification accuracy in LFW, CFP-FP, CPLFW, AgeDB and CALFW. For Low Quality Datasets (LQ), we use an average of the closed-set rank-1 retrieval and the open-set TPIR@FIPR=1% for all 3 protocols of IJB-S. Unless otherwise stated, we augment the data as described in Sec. 4.1. + +Effect of Image Quality Indicator Concentration $h$ . In Sec. 3.3, we claim that $h = 0.33$ is a good value. To validate this claim, we show in Tab. 1 the performance when varying $h$ . When $h = 0.33$ , the model performs the best. For $h = 0.22$ or $h = 0.66$ , the performance is still higher than CurricularFace. As long as $h$ is set such that $\| \pmb{z}_i \|$ has some variation, $h$ is not very sensitive. We set $h = 0.33$ . + +Effect of Hyperparameter $m$ . The margin $m$ corresponds to both the maximum range of the angular margin and the magnitude of the additive margin. Tab. 1 shows that the performance is best for HQ datasets when $m = 0.4$ and for LQ datasets when $m = 0.75$ . Large $m$ results in large angular margin variation based on the image quality, resulting in more adaptivity. In subsequent experiments, we choose $m = 0.4$ since it achieves good performance for LQ datasets without sacrificing performance on HQ datasets. + +
MethodhmProxyHQ DatasetsLQ Datasets
CurricularFace [13]-0.5093.4332.92
AdaFace0.2293.6734.92
AdaFace0.330.40Norm93.7435.40
AdaFace0.6693.7035.29
AdaFace0.330.40Norm93.7435.40
AdaFace0.5093.5635.23
AdaFace0.7593.3735.69
AdaFace0.330.40Norm93.7435.40
-1-BRISQUE93.4334.55
-Py_i93.4635.17
+ +Table 1. Ablation of our margin function parameters $h$ and $m$ , and the image quality proxy choice on the ResNet18 backbone. The performance metrics are as described in Sec. 4.2. + +
MethodpHQ DatasetsLQ Datasets
CurricularFace [13]0.096.8541.00
CurricularFace [13]0.296.7540.84
CurricularFace [13]0.396.5940.58
AdaFace0.096.7240.95
AdaFace0.296.8841.82
AdaFace0.396.7841.93
+ +Table 2. Ablation of augmentation probability $p$ , on the ResNet50 backbone. The metrics are the same as Tab. 1. + +Effect of Proxy Choice. In Tab. 1, to show the effectiveness of using the feature norm as a proxy for image quality, we switch the feature norm with other quantities such as (1-BRISQUE) or $P_{y_i}$ . The performance using the feature norm is superior to using others. The BRISQUE score is precomputed for the training dataset, so it is not as effective in capturing the image quality when training with augmentation. We include $P_{y_i}$ to show that the adaptiveness in feature norm is different from adaptiveness in difficulty. + +Effect of Augmentation. We introduce on-the-fly augmentations in our training data. Our proposed loss can effectively handle the unidentifiable images, which are generated occasionally during augmentations. We experiment with a larger model ResNet50 on the full MS1MV2 dataset. + +Tab. 2 shows that indeed the augmentation brings performance gains for AdaFace. The performance on HQ datasets stays the same, whereas LQ datasets enjoy a significant performance gain. Note that the augmentation hurts the performance of CurricularFace, which is in line with our assumption that augmentation is a tradeoff between a positive effect from getting more data and a negative effect from unidentifiable images. Prior works on margin-based softmax do not include on-the-fly augmentations as the performance could be worse. AdaFace avoids overfitting on unidentifiable images, therefore it can exploit the augmentation better. + +Analysis. To show how the feature norm $\| z_i\|$ and the difficulty of training samples change during training, we plot the sample trajectory in Fig. 6. A total of 1,536 samples are randomly sampled from the training data. Each column in the heatmap represents a sample, and the x-axis is sorted according to the norm of the last epoch. Sample #600 is + +![](images/5485afbef2605d8b1f6e48fc2526dcc96d1eee619c64b407c6db941c941c5aa1.jpg) +Figure 6. A plot of training samples' trajectories of feature norm $\| \pmb{z}_i\|$ and the probability output for the ground truth index $P_{y_i}$ . We randomly select 1,536 samples from the training data with augmentations, and show 8 images evenly sampled from them. The features with low norm have a different probability trajectory than others and the corresponding images are hard to identify. + +approximately a middle point of the transition from low to high norm samples. The bottom plot shows that many of the probability trajectories of low norm samples never get high probability till the end. It is in line with our claim that low norm features are more likely to be unidentifiable images. It justifies our motivation to put less emphasis on these cases, although they are "hard" cases. The percentage of samples with augmentations is higher for the low norm features than for the high norm features. For samples number #0 to #600, about $62.0\%$ are with at least one type of augmentation. For the samples #600 or higher, the percentage is about $38.5\%$ . + +Time Complexity. Compared to classic margin-based loss functions, our method adds a negligible amount of computation in training. With the same setting, AdaFace [4] takes 0.3193s per iteration while AdaFace takes 0.3229s (+1%). + +# 4.3. Comparison with SoTA methods + +To compare with SoTA methods, we evaluate ResNet100 trained with AdaFace loss on 9 datasets as listed in Sec. 4.1. For the high quality datasets, Tab. 3 (a) shows that AdaFace performs on par with competitive methods such as BroadFace [16], SCF-ArcFace [17] and VPL-ArcFace [5]. This strong performance in high quality datasets is due to the hard sample emphasis on high quality cases during training. Note that some performances in high quality datasets are saturated, making the gain less pronounced. Thus, choosing one model over the others is somewhat difficult based solely on the numbers. Unlike SCF-ArcFace, our method does not use additional learnable layers, nor requires 2-stage training. It is a revamp of the loss function, which makes it easier to apply our method to new tasks or backbones. + +For mixed quality datasets, Tab. 3 (a) clearly shows the improvement of AdaFace. On IJB-B and IJB-C, AdaFace reduces the errors of the second best relatively by $11\%$ and $9\%$ respectively. This shows the efficacy of using feature norms as an image quality proxy to treat samples differently. + +For low quality datasets, Tab. 3 (b) shows that AdaFace substantially outperforms all baselines. Compared to the second best, our averaged performance gain over 4 Rank- + +
MethodVenueTrain DataHigh QualityMixed Quality
LFW [11]CFP-FP [27]CPLFW [43]AgeDB [25]CALFW [44]AVGIJB-B [37]IJB-C [22]
CosFace (m = 0.35) [35]CVPR18MS1MV299.8198.1292.2898.1195.7696.8294.8096.37
ArcFace (m = 0.50) [4]CVPR19MS1MV299.8398.2792.0898.2895.4596.7894.2596.03
AFRN [15]ICCV19MS1MV299.8595.5693.4895.3596.3096.1188.5093.00
MV-Softmax [36]AAAI20MS1MV299.8098.2892.8397.9596.1096.9993.6095.20
CurricularFace [13]CVPR20MS1MV299.8098.3793.1398.3296.2097.1694.8096.10
URL [30]CVPR20MS1MV299.7898.64-----96.60
BroadFace [16]ECCV20MS1MV299.8598.6393.1798.3896.2097.2594.9796.38
MagFace [23]CVPR21MS1MV299.8398.4692.8798.1796.1597.1094.5195.97
SCF-ArcFace [17]CVPR21MS1MV299.8298.4093.1698.3096.1297.1694.7496.09
DAM-CurricularFace [19]ICCV21MS1MV2------95.1296.20
AdaFace (m = 0.4)CVPR22MS1MV299.8298.4993.5398.0596.0897.1995.6796.89
VPL-ArcFace [5]CVPR21MS1MV399.8399.1193.4598.6096.1297.4295.5696.76
AdaFace (m = 0.4)CVPR22MS1MV399.8399.0393.9398.1796.0297.4095.8497.09
ArcFace* [4]CVPR19WebFace4M99.8399.1994.3597.9596.0097.4695.7597.16
AdaFace (m = 0.4)CVPR22WebFace4M99.8099.1794.6397.9096.0597.5196.0397.39
+ +(a) A performance comparison of recent methods on high and mixed quality datasets. + +
MethodTrain DataLow Quality (IJB-S [14] and TinyFace [3])
Surveillance-to-Single [14]Surveillance-to-Booking [14]Surveillance-to-Surveillance [14]TinyFace [3]
Rank-1Rank-51%Rank-1Rank-51%Rank-1Rank-51%Rank-1Rank-5
PFE [29]MS1MV2 [4]50.1658.3331.8853.6061.7535.999.2020.820.84--
ArcFace [4]MS1MV2 [4]57.3564.4241.8557.3664.9541.23-----
URL [30]MS1MV2 [4]59.7965.7841.0661.9867.1242.73---63.8968.67
CurricularFace* [13]MS1MV2 [4]62.4368.6847.6863.8169.7447.5719.5432.802.5363.6867.65
AdaFace (m=0.4)MS1MV2 [4]65.2670.5351.6666.2771.6150.8723.7437.472.5068.2171.54
AdaFace (m=0.4)MS1MV3 [6]67.1272.6753.6767.8372.8852.0326.2340.603.2867.8170.98
ArcFace* [4]WebFace4M [45]69.2674.3157.0670.3175.1556.8932.1346.675.3271.1174.38
AdaFace (m=0.4)WebFace4M [45]70.4275.2958.2770.9376.1158.0235.0548.224.9672.0274.52
+ +(b) A performance comparison of recent methods on low quality datasets. + +Table 3. Comparison on benchmark datasets, with the ResNet100 backbone. For high quality and mixed quality datasets, 1:1 verification accuracy and TAR@FAR=0.01% are reported respectively. For IJB-S, open-set TPIR@FPIR=1% and closed-set rank retrieval (Rank-1 and Rank-5) are reported. Rank retrieval is also used for TinyFace. [KEYS: Best, Second best, *=our evaluation of the released model] + +1 metrics is $3.5\%$ , and over 3 TPIR@=FPIR=1% metrics is $2.4\%$ . These results show that AdaFace is effective in learning a good representation for the low quality settings as it prevents the model from fitting on unidentifiable images. + +We further train on a refined dataset, MS1MV3 [6] for a fair comparison with a recent work VPL-ArcFace [5]. The performance using MS1MV3 is higher than MS1MV2 due to less noise in MS1MV3. We also train on newly released WebFace4M [45] dataset. While one method might shine on one type of data, it is remarkable to see that collectively Adaface achieves SOTA performance on test data with a wide range of image quality, and on various training sets. + +# 5. Conclusion + +In this work, we address the problem arising from unidentifiable face images in the training dataset. Data collection processes or data augmentations introduce these images in the training data. Motivated by the difference in recognizability based on image quality, we tackle the problem by 1) using a feature norm as a proxy for the image quality and 2) changing the margin function adaptively based on the feature norm to control the gradient scale assigned to different quality of images. We evaluate the efficacy of the proposed adaptive loss on various qualities of datasets and achieve SoTA for mixed and low quality face datasets. + +Limitations. This work addresses the existence of unidentifiable images in the training data. However, a noisy label is also one of the prominent characteristics of large-scale facial training datasets. Our loss function does not give special treatment to mislabeled samples. Since our adaptive loss assigns large importance to difficult samples of high quality, high quality mislabeled images can be wrongly emphasized. We believe future works may adaptively handle both unidentifiability and label noise at the same time. + +Potential Societal Impacts. We believe that the Computer Vision community as a whole should strive to minimize the negative societal impact. Our experiments use the training dataset MS1MV*, which is a by-product of MS-Celeb [21], a dataset withdrawn by its creator. Our usage of MS1MV* is necessary to compare our result with SoTA methods on a fair basis. However, we believe the community should move to new datasets, so we include results on newly released WebFace4M [45], to facilitate future research. In the scientific community, collecting human data requires IRB approval to ensure informed consent. While IRB status is typically not provided by dataset creators, we assume that most FR datasets (with the exceptions of IJB-S) do not have IRB, due to the nature of collection procedures. One direction of the FR community is to collect large datasets with informed consent, fostering R&D without societal concerns. + +# References + +[1] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 41-48, 2009. 2 +[2] Jie Chang, Zhonghao Lan, Changmao Cheng, and Yichen Wei. Data uncertainty learning in face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5710-5719, 2020. 3 +[3] Zhiyi Cheng, Xiatian Zhu, and Shaogang Gong. Low-resolution face recognition. In Asian Conference on Computer Vision, pages 605-621, 2018. 6, 8 +[4] Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. ArcFace: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4690-4699, 2019. 1, 2, 3, 4, 5, 6, 7, 8 +[5] Jiankang Deng, Jia Guo, Jing Yang, Alexandros Lattas, and Stefanos Zafeiriou. Variational prototype learning for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11906-11915, 2021. 1, 7, 8 +[6] Jiankang Deng, Jia Guo, Debing Zhang, Yafeng Deng, Xiangju Lu, and Song Shi. Lightweight face recognition challenge. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019. 6, 8 +[7] Yao Feng, Fan Wu, Xiaohu Shao, Yanfeng Wang, and Xi Zhou. Joint 3d face reconstruction and dense alignment with position map regression network. In European Conference on Computer Vision, pages 534-551, 2018. 3 +[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 European Conference on Computer Vision, pages 87–102, 2016. 1 +[9] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770-778, 2016. 6 +[10] Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Jun-yuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 558-567, 2019. 6 +[11] 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. In Workshop on Faces in Real-Life Images: Detection, Alignment, and Recognition, 2008. 1, 3, 6, 8 +[12] Yuge Huang, Pengcheng Shen, Ying Tai, Shaoxin Li, Xiaoming Liu, Jilin Li, Feiyue Huang, and Rongrong Ji. Improving face recognition from hard samples via distribution distillation loss. In European Conference on Computer Vision, pages 138-154, 2020. 3 +[13] Yuge Huang, Yuhan Wang, Ying Tai, Xiaoming Liu, Pengcheng Shen, Shaoxin Li, Jilin Li, and Feiyue Huang. CurricularFace: adaptive curriculum learning loss for deep + +face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5901-5910, 2020. 1, 2, 3, 5, 6, 7, 8 +[14] Nathan D Kalka, Brianna Maze, James A Duncan, Kevin O'Connor, Stephen Elliott, Kaleb Hebert, Julia Bryan, and Anil K Jain. IJB-S: IARPA Janus Surveillance Video Benchmark. In 2018 IEEE 9th International Conference on Biometrics Theory, Applications and Systems (BTAS), pages 1-9, 2018. 1, 3, 6, 8 +[15] Bong-Nam Kang, Yonghyun Kim, Bongjin Jun, and Daijin Kim. Attentional feature-pair relation networks for accurate face recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5472-5481, 2019. 8 +[16] Yonghyun Kim, Wonpyo Park, and Jongju Shin. BroadFace: Looking at tens of thousands of people at once for face recognition. In European Conference on Computer Vision, pages 536-552, 2020. 7, 8 +[17] Shen Li, Jianqing Xu, Xiaqing Xu, Pengcheng Shen, Shaoxin Li, and Bryan Hooi. Spherical confidence learning for face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15629-15637, 2021. 1, 3, 7, 8 +[18] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 2980-2988, 2017. 3 +[19] Jiaheng Liu, Yudong Wu, Yichao Wu, Chuming Li, Xiaolin Hu, Ding Liang, and Mengyu Wang. DAM: Discrepancy alignment metric for face recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3814-3823, 2021. 8 +[20] Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. SphereFace: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 212-220, 2017. 2, 3 +[21] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pages 3730-3738, 2015. 8 +[22] Brianna Maze, Jocelyn Adams, James A Duncan, Nathan Kalka, Tim Miller, Charles Otto, Anil K Jain, W Tyler Niggel, Janet Anderson, Jordan Cheney, and Patrick Grother. IARPA Janus Benchmark-C: Face dataset and protocol. In 2018 International Conference on Biometrics (ICB), pages 158-165, 2018. 1, 3, 6, 8 +[23] Qiang Meng, Shichao Zhao, Zhida Huang, and Feng Zhou. MagFace: A universal representation for face recognition and quality assessment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14225-14234, 2021. 3, 4, 8 +[24] Anish Mittal, Anush Krishna Moorthy, and Alan Conrad Bovik. No-reference image quality assessment in the spatial domain. IEEE Transactions on Image Processing, 21(12):4695-4708, 2012. 5 +[25] Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos + +Zafeiriou. AGEDB: the first manually collected, in-the-wild age database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 51-59, 2017. 3, 6, 8 +[26] Necmiye Ozay, Yan Tong, Frederick W. Wheeler, and Xiaoming Liu. Improving face recognition with a quality-based probabilistic framework. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 134-141, 2009. 3 +[27] Soumyadip Sengupta, Jun-Cheng Chen, Carlos Castillo, Vishal M Patel, Rama Chellappa, and David W Jacobs. Frontal to profile face verification in the wild. In 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1-9, 2016. 1, 3, 6, 8 +[28] Hamid R Sheikh and Alan C Bovik. Image information and visual quality. IEEE Transactions on Image Processing, 15(2):430-444, 2006. 1 +[29] Yichun Shi and Anil K Jain. Probabilistic face embeddings. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6902-6911, 2019. 3, 8 +[30] Yichun Shi, Xiang Yu, Kihyuk Sohn, Manmohan Chandraker, and Anil K Jain. Towards universal representation learning for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6817-6826, 2020. 3, 6, 8 +[31] Abhinav Shrivastava, Abhinav Gupta, and Ross Girshick. Training region-based object detectors with online hard example mining. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 761-769, 2016. 3 +[32] Philipp Terhörst, Jan Niklas Kolf, Naser Damer, Florian Kirchbuchner, and Arjan Kuijper. Ser-fiq: unsupervised estimation of face image quality based on stochastic embedding robustness. in 2020 IEEE. In CVF Conference on Computer Vision and Pattern Recognition, CVPR, pages 13-19, 2020. 5 +[33] Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning GAN for pose-invariant face recognition. In Proceeding of IEEE Computer Vision and Pattern Recognition, pages 1415-1424, 2017. 1 +[34] Feng Wang, Xiang Xiang, Jian Cheng, and Alan Loddon Yuille. NormFace: L2 hypersphere embedding for face verification. In Proceedings of the 25th ACM International Conference on Multimedia, pages 1041-1049, 2017. 3 +[35] 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. 2, 3, 4, 6, 8 +[36] Xiaobo Wang, Shifeng Zhang, Shuo Wang, Tianyu Fu, Hailin Shi, and Tao Mei. Mis-classified vector guided softmax loss for face recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 12241-12248, 2020. 3, 8 +[37] Cameron Whitelam, Emma Taborsky, Austin Blanton, Brianna Maze, Jocelyn Adams, Tim Miller, Nathan Kalka, Anil K Jain, James A Duncan, Kristen Allen, et al. IARPA + +Janus Benchmark-B face dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 90-98, 2017. 1, 3, 6, 8 +[38] Xi Yin, Ying Tai, Yuge Huang, and Xiaoming Liu. FAN: Feature adaptation network for surveillance face recognition and normalization. In Proceedings of the Asian Conference on Computer Vision, pages 301-319, 2020. 3 +[39] Guangtao Zhai and Xiongkuo Min. Perceptual image quality assessment: a survey. Science China Information Sciences, 63(11):211301, 2020. 5 +[40] Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499-1503, 2016. 6 +[41] 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/CVF Conference on Computer Vision and Pattern Recognition, pages 10823–10832, 2019. 3 +[42] Xiao Zhang, Rui Zhao, Junjie Yan, Mengya Gao, Yu Qiao, Xiaogang Wang, and Hongsheng Li. P2sGrad: Refined gradients for optimizing deep face models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9906-9914, 2019. 3 +[43] Tianyue Zheng and Weihong Deng. Cross-Pose LFW: A database for studying cross-posed face recognition in unconstrained environments. Beijing University of Posts and Telecommunications, Tech. Rep, 5:7, 2018. 3, 6, 8 +[44] Tianyue Zheng, Weihong Deng, and Jiani Hu. Cross-Age LFW: A database for studying cross-age face recognition in unconstrained environments. CoRR, abs/1708.08197, 2017. 3, 6, 8 +[45] Zheng Zhu, Guan Huang, Jiankang Deng, Yun Ye, Junjie Huang, Xinze Chen, Jiagang Zhu, Tian Yang, Jiwen Lu, Dalong Du, and Jie Zhou. WebFace260M: A benchmark unveiling the power of million-scale deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10492-10502, 2021. 6, 8 \ No newline at end of file diff --git a/adafacequalityadaptivemarginforfacerecognition/images.zip b/adafacequalityadaptivemarginforfacerecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1d08c1513774e2c94fa19ed21a00d98997552d56 --- /dev/null +++ b/adafacequalityadaptivemarginforfacerecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db63c48269d952f0fbd4d937225ed8b098948ec1eeb0640d7d39783f4bba7fc7 +size 617370 diff --git a/adafacequalityadaptivemarginforfacerecognition/layout.json b/adafacequalityadaptivemarginforfacerecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7529e9c085e51769500c56dd7a0d4a89033900ac --- /dev/null +++ b/adafacequalityadaptivemarginforfacerecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af791b2df6a29a64612c09915310b72c638b72514f09775d871b95dc6b227944 +size 460431 diff --git a/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_content_list.json b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a1c786a8a42550829c00450a0ad7c32b573c937d --- /dev/null +++ b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eac3588428b50cc667612028a7a6c22161ef8b1c447c673477d6e7376bf4152 +size 93826 diff --git a/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_model.json b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ca8b7a55e1d75b8ce167524a175329e032e4bf63 --- /dev/null +++ b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a50e934afd56d30426a5c37b54c0dfef6575a16bb1d8f2978edf7965d9632f45 +size 117843 diff --git a/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_origin.pdf b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..191a2e1a5c25316970d4b649cc9b6318e792f09d --- /dev/null +++ b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/e017a7eb-1ffa-4aa2-887a-35972aefa148_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:371ec17db2c345b899eff3a550363145e7d66dec65608015e87e18e6a3555e96 +size 1465017 diff --git a/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/full.md b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..722e0753b21aa95e777b611c41173a20731b4659 --- /dev/null +++ b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/full.md @@ -0,0 +1,363 @@ +# AdaFocus V2: End-to-End Training of Spatial Dynamic Networks for Video Recognition + +Yulin Wang $^{1*}$ Yang Yue $^{1*}$ Yuanze Lin $^{2}$ Haojun Jiang $^{1}$ Zihang Lai $^{3}$ +Victor Kulikov $^{4}$ Nikita Orlov $^{4}$ Humphrey Shi $^{4,5\boxtimes}$ Gao Huang $^{1\boxtimes}$ $^{1}$ BNRist, Tsinghua University $^{2}$ U of Washington $^{3}$ CMU $^{4}$ Picsart AI Research (PAIR) $^{5}$ U of Oregon + +# Abstract + +Recent works have shown that the computational efficiency of video recognition can be significantly improved by reducing the spatial redundancy. As a representative work, the adaptive focus method (AdaFocus) has achieved a favorable trade-off between accuracy and inference speed by dynamically identifying and attending to the informative regions in each video frame. However, AdaFocus requires a complicated three-stage training pipeline (involving reinforcement learning), leading to slow convergence and is unfriendly to practitioners. This work reformulates the training of AdaFocus as a simple one-stage algorithm by introducing a differentiable interpolation-based patch selection operation, enabling efficient end-to-end optimization. We further present an improved training scheme to address the issues introduced by the one-stage formulation, including the lack of supervision, input diversity and training stability. Moreover, a conditional-exit technique is proposed to perform temporal adaptive computation on top of AdaFocus without additional training. Extensive experiments on six benchmark datasets (i.e., ActivityNet, FCVID, Mini-Kinetics, Something-Something V1&V2, and Jester) demonstrate that our model significantly outperforms the original AdaFocus and other competitive baselines, while being considerably more simple and efficient to train. Code is available at https://github.com/LeapLabTHU/AdaFocusV2. + +# 1. Introduction + +Deep networks have achieved remarkable success in large-scale video recognition tasks [3, 14, 16, 25, 58]. Their high accuracy has fueled the desire to deploy them for automatically recognizing the actions, events, or other contents within the explosively growing online videos in recent years (e.g., on YouTube). However, the models with state-of-the + +Table 1. A comparison of training the original AdaFocus model (AdaFocusV1, from ① to ⑤) and AdaFocusV2 (end-to-end) on Something-Something (Sth-Sth) V1 dataset. Both procedures start from the same initial backbone networks. Herein, $f_{\mathrm{G}}$ , $f_{\mathrm{L}}$ , $f_{\mathrm{C}}$ and $\pi$ are the model components (see Section 3.1 for details). + +
AdaFocusV1AdaFocusV2
Pre-training① Pre-train fG on Sth-Sth V1. +② Pre-train fL on Sth-Sth V1.End-to-End Training +(fG, fL, fC, π)
Stage-1③ Train fL and fC using random patches.
Stage-2④ Train π using reinforcement learning.
Stage-3⑤ Fine-tune fL and fC.
+ +![](images/f0e0949189e74e6c6f5035f9b9cb74be16581614ec696881176d7c3abf898fd5.jpg) +Figure 1. Comparisons of AdaFocusV1 and AdaFocusV2 on Sth-Sth V1 in terms of accuracy v.s. training cost. The training time is measured based on 4 NVIDIA 3090 GPUs. The two sides of grey arrows correspond to the same network architecture (i.e., the same inference cost). Our AdaFocusV2 accelerates the training by $2.2 - 2.4 \times$ , while boosting the accuracy by $1.0 - 1.5\%$ . + +art performance [1, 13, 20, 42, 51, 59] tend to be computationally intensive during inference. In real-world applications such as recommendation [8, 9, 18], surveillance [4, 7] and content-based searching [30], computation translates into power consumption and latency, both of which should be minimized for environmental, safety or economic reasons. + +Several algorithms have been proposed to reduce the temporal redundancy of videos [19, 21, 35, 36, 47, 57, 67, 68, 73] by allocating the majority of computation to the + +most task-relevant video frames rather than all. Orthogonal to these approaches, the recently proposed adaptive focus network (AdaFocus) [64] reveals that reducing the spatial redundancy in video analysis yields promising results for efficient video recognition. The AdaFocus framework is also compatible with the aforementioned temporal-adaptive methods to realize highly efficient spatial-temporal computation. Specifically, AdaFocus reduces the computational cost by applying the expensive high-capacity network only on some relatively small patches. These patches are strategically selected to capture the most informative regions of each video frame. In particular, the patch localization task is formulated as a non-differentiable discrete decision task, which is further solved with reinforcement learning. As a consequence, AdaFocus needs to be trained with a complicated three-stage training pipeline (see Table 1), resulting in long training time and being unfriendly to users. + +This paper seeks to simplify the training process of AdaFocus. We first introduce a differentiable interpolation-based formulation for patch selecting, allowing gradient back-propagation throughout the whole model. We note that a straightforward implementation of end-to-end training leads to optimization issues, including the lack of supervision, input diversity and training stability, which severely degrade the performance. Therefore, we further propose three tailored training techniques: auxiliary supervision, diversity augmentation and stopping gradient, to address the aforementioned issues. These simple but effective techniques enable the simple one-stage formulation of our AdaFocus algorithm to be trained effectively, and eventually outperform the three-stage counterparts in terms of both test accuracy and training cost. The experimental comparisons are presented in Figure 1. Our proposed method is referred to as AdaFocusV2. + +An additional advantage of AdaFocus is that it can be easily improved by further considering temporal redundancy. The original paper implements this idea by dynamically skipping less valuable frames with reinforcement learning. In contrast, this work proposes a simplified early-exit algorithm that removes the requirement of introducing additional training, but achieves competitive performance. + +The effectiveness of AdaFocusV2 is extensively evaluated on six video recognition benchmarks (i.e., ActivityNet, FCVID, Mini-Kinetics, Sth-Sth V1&V2, and Jester). Experimental results show that the training of AdaFocusV2 is $2 \times$ faster (measured in wall-time) than the original counterpart, while achieving consistently higher accuracy. + +# 2. Related Works + +Video recognition. In recent years, convolutional networks (ConvNets) have achieved remarkable performance for video recognition. One of the prominent approaches is to capture the spatial/temporal information jointly us + +ing 3D ConvNets. Representative works include C3D [58], I3D [3], ResNet3D [25], X3D [13], etc. Some other works focus on first extracting frame-wise features, and then aggregating temporal information with specialized architectures, such as temporal averaging [63], deploying recurrent networks [10, 38, 74], and temporal channel shift [12, 40, 48, 56]. Another line of works leverage two-stream architectures to model short-term and long-term temporal relationships respectively [14-16, 22]. In addition, as processing videos with ConvNets, especially 3D ConvNets, tends to be computationally intensive, recent research starts to pay attention to designing efficient video recognition models [41, 43, 44, 59, 60, 77]. + +Temporal redundancy. A popular approach for facilitating efficient video recognition is to reduce the temporal redundancy in videos [19, 21, 35, 36, 47, 57, 67, 68, 73]. Since not all frames are equally important for a given task, the model should ideally allocate less computation on less informative frames [24]. Several effective algorithms have been proposed in this direction. For example, VideoIQ [57] processes video frames using different precision according to their relative importance. FrameExit [21] learns to terminate the inference process after seeing a few sufficiently informative frames. The AdaFocusV2+ algorithm, which we propose to model temporal redundancy on top of AdaFocusV2, is related to FrameExit on the spirit of early-exit. However, our method is easier to implement since it does not need to learn an additional conditional-exit policy. + +Spatial-wise dynamic networks perform computation adaptively on top of different spatial locations of the inputs [24]. The AdaFocusV2 network studied in this paper can be classified into this category as well. Many of the spatially adaptive networks are designed from the lens of inference efficiency [5,24,52,62,72]. For example, recent works have revealed that 2D images can be efficiently processed via attending to the task-relevant or more informative image regions [17, 61, 66, 70, 71]. In the context of video recognition, how to exploit this spatial redundancy for reducing the computational cost is still an under-explored topic. It has been shown by the attention-based methods [46] that the contributions of different frame regions to the recognition task are not equivalent. Preliminary works like AdaFocus [64] have demonstrated the potentials of this direction. + +The spatial transformer networks [31] are trained based on a similar interpolation-based mechanism to us. However, they focus on actively transforming the feature maps for learning spatially invariant representations, while we aim to localize and attend to the task-relevant regions of the video frames for improving the inference efficiency. Moreover, we show that a straightforward implementation of this mechanism fails to yield competitive results in our problem. Special designs need to be introduced by our algorithm to solve the optimization difficulties. + +![](images/859c1f0f22dda76dfeb910231897a13eb160f6b73e2f5b7f7beb69bbda15142f.jpg) +Figure 2. An overview of adaptive focus networks (AdaFocus). The global and local encoders $f_{\mathrm{G}}$ and $f_{\mathrm{L}}$ are two deep networks (e.g., ConvNets). The former catches a glimpse of each frame, enabling the recurrent policy network $\pi$ to localize an informative image patch $\tilde{\boldsymbol{v}}_t$ . The latter is designed to extract discriminative representations by processing $\tilde{\boldsymbol{v}}_t$ with its large and high-capacity architecture. A classifier $f_{\mathrm{C}}$ aggregates the information from all the processed frames to obtain the prediction. + +# 3. Method + +The AdaFocus network [64] facilitates efficient video recognition via reducing the spatial-wise redundant computation. However, it suffers from a complicated three-stage training procedure. This section introduces the details of our end-to-end trainable AdaFocusV2 approach, which consistently outperforms the original AdaFocus with a simpler and more efficient training procedure. + +# 3.1. Preliminaries of AdaFocusV1 [64] + +We start by giving an overview of AdaFocus (see Figure 2), laying the basis for the discussions on training efficiency. Assume that a stream of video frames $\{v_{1}, v_{2}, \ldots\}$ comes in sequentially. AdaFocus first takes a quick glance at each frame with a light-weighted global encoder $f_{\mathrm{G}}$ , aiming to extract cheap and coarse global features + +$$ +\boldsymbol {e} _ {t} ^ {\mathrm {G}} = f _ {\mathrm {G}} (\boldsymbol {v} _ {t}), \quad t = 1, 2, \dots , \tag {1} +$$ + +where $e_t^{\mathrm{G}}$ denotes the feature maps of the $t^{\mathrm{th}}$ frame. Then a recurrent policy network $\pi$ is learned to aggregate the features of all previous frames $\{e_1^{\mathrm{G}},\dots ,e_t^{\mathrm{G}}\}$ , and accordingly determine the location of a small image patch $\tilde{\pmb{v}}_t$ to capture the most informative region in $\pmb{v}_t$ for a given task. + +The selected patch $\tilde{\boldsymbol{v}}_t$ will be fed into a high-capacity, accurate but computationally more expensive local encoder $f_{\mathrm{L}}$ to extract the local feature maps $e_t^{\mathrm{L}}$ : + +$$ +\boldsymbol {e} _ {t} ^ {\mathrm {L}} = f _ {\mathrm {L}} \left(\tilde {\boldsymbol {v}} _ {t}\right), \quad t = 1, 2, \dots . \tag {2} +$$ + +Importantly, the computational cost introduced by Eq.(2) is considerably smaller than activating $f_{\mathrm{L}}$ for processing the whole frame due to the reduced size of $\tilde{\boldsymbol{v}}_t$ . AdaFocus is designed to unevenly allocate the computation across the spatial dimension to improve inference efficiency. + +Finally, a classifier $f_{\mathrm{C}}$ integrates the information from all the processed frames, and produces the softmax prediction $\pmb{p}_t$ at $t^{\mathrm{th}}$ step, i.e., + +$$ +\boldsymbol {p} _ {t} = f _ {\mathrm {C}} \left(\operatorname {c a t} \left(e _ {1} ^ {\mathrm {G}}, e _ {1} ^ {\mathrm {L}}\right), \dots , \operatorname {c a t} \left(e _ {t} ^ {\mathrm {G}}, e _ {t} ^ {\mathrm {L}}\right)\right), \tag {3} +$$ + +where $\mathrm{cat}(\cdot)$ is the concatenation operation1. Note that $e_t^{\mathrm{G}}$ is leveraged for both localizing the informative patches and classification, under the goal of facilitating efficient feature reuse. This design is natural since it has been observed that deep networks (e.g., ConvNets and Vision Transformers) excel at learning representations for both recognition and localization simultaneously [11, 55, 76]. In addition, the architecture of $f_{\mathrm{C}}$ may have different choices, such as recurrent networks [6, 27], averaging the frame-wise predictions [40, 47, 48], and accumulated feature pooling [21]. + +Training algorithm. In the original AdaFocus [64] (referred to as AdaFocusV1), the task of selecting task-relevant patches is modeled as a non-differentiable decision problem on several pre-defined patch candidates. Hence, the training of AdaFocusV1 includes both continuous (i.e., video recognition) and discrete (i.e., patch localization) optimization, resulting in a 3-stage algorithm to solve it alternatively. They first train the classification components (i.e., $f_{\mathrm{G}}$ , $f_{\mathrm{L}}$ and $f_{\mathrm{C}}$ ) with random patches, and then fix them to learn a patch selection strategy (i.e., $\pi$ ) using reinforcement learning. The final stage further fine-tunes the model with the learned policy. + +Limitations of AdaFocusV1. The underlying logic of the 3-stage training is straightforward. However, this procedure is unfriendly for practitioners. First, effectively deploying the reinforcement learning algorithm is nontrivial. It requires considerable efforts for properly designing the key components (e.g., the action space and the reward function), and implementing specialized optimization techniques (e.g., deep Q-Network [49] or proximal policy optimization [54]). Second, the 3-stage alternative algorithm is an indirect formulation for optimizing the recognition objective, which tends to be time-consuming, and may result in sub-optimal solutions. Third, the performance of AdaFocusV1 largely depends on a number of implementation configurations (e.g., performing pre-training, freezing some components in different stages, and stage-wise hyperparameter searching) that need to be carefully tuned on a per-dataset or per-backbone basis. + +In the following, we present an end-to-end trainable formulation for AdaFocus to address the issue of inefficient + +![](images/b200a8ae1450f156ea63c96085cd8a0c807a1cf26e3ead5f2cbd4e864a91b135.jpg) +Figure 3. Illustration of interpolation-based patch selection. This operation is differentiable, i.e., the gradients can be directly back-propagated into the policy network $\pi$ through the selected image patch $\tilde{\boldsymbol{v}}_t$ . Consequently, integrating the learning of $\pi$ into a unified end-to-end training paradigm turns out to be feasible. + +training. The proposed network, AdaFocusV2, can be conveniently implemented to achieve consistently better performance than AdaFocusV1 with reduced training cost. + +# 3.2. Interpolation-based Patch Selection + +To enable end-to-end training, we propose a differentiable solution to obtain $\tilde{\boldsymbol{v}}_t$ . Suppose that the size of the original frame $\boldsymbol{v}_t$ and the patch $\tilde{\boldsymbol{v}}_t$ is $H\times W$ and $P\times P$ ( $P < H, W$ ), respectively2. We assume that $\pi$ outputs the continuous centre coordinates $(\tilde{x}_{\mathrm{c}}^{t}, \tilde{y}_{\mathrm{c}}^{t})$ of $\tilde{\boldsymbol{v}}_t$ , namely + +$$ +\begin{array}{l} \left(\tilde {x} _ {\mathrm {c}} ^ {t}, \tilde {y} _ {\mathrm {c}} ^ {t}\right) = \pi \left(e _ {1} ^ {\mathrm {G}}, \dots , e _ {t} ^ {\mathrm {G}}\right), \\ \tilde {x} _ {\mathrm {c}} ^ {t} \in [ \frac {P}{2}, W - \frac {P}{2} ], \quad \tilde {y} _ {\mathrm {c}} ^ {t} \in [ \frac {P}{2}, H - \frac {P}{2} ], \tag {4} \\ \end{array} +$$ + +where $e_1^{\mathrm{G}}, \ldots, e_t^{\mathrm{G}}$ are the global features of $1^{\mathrm{st}} - t^{\mathrm{th}}$ frames extracted by the global encoder $f_{\mathrm{G}}$ . Notably, we refer to the coordinates of the top-left corner of the frame as $(0,0)$ , and Eq. (4) ensures that $\tilde{\boldsymbol{v}}_t$ will never go outside of $\boldsymbol{v}_t$ . Our aim is to calculate the values of all pixels in $\tilde{\boldsymbol{v}}_t$ , while allowing the gradients to be back-propagated through $(\tilde{x}_{\mathrm{c}}^{t}, \tilde{y}_{\mathrm{c}}^{t})$ . + +Feed-forward. We first introduce the feed-forward process of our method. Formally, the coordinates of a pixel in the patch $\tilde{\boldsymbol{v}}_t$ can be expressed as the addition of $(\tilde{x}_{\mathrm{c}}^{t},\tilde{y}_{\mathrm{c}}^{t})$ and a fixed offset: + +$$ +\begin{array}{l} \left(\tilde {x} _ {i j} ^ {t}, \tilde {y} _ {i j} ^ {t}\right) = \left(\tilde {x} _ {\mathrm {c}} ^ {t}, \tilde {y} _ {\mathrm {c}} ^ {t}\right) + \boldsymbol {o} _ {i j}, \\ \boldsymbol {o} _ {i j} \in \left\{- \frac {P}{2}, - \frac {P}{2} + 1, \dots , \frac {P}{2} \right\} ^ {2}. \tag {5} \\ \end{array} +$$ + +Herein, $(\tilde{x}_{ij}^t,\tilde{y}_{ij}^t)$ denotes the horizontal and vertical coordinates in the original frame $\pmb{v}_t$ corresponding to the pixel in the $i^{\mathrm{th}}$ row and $j^{\mathrm{th}}$ column of $\tilde{\pmb{v}}_t$ , while $\pmb{o}_{ij}$ represents the + +vector from the patch centre $(\tilde{x}_{\mathrm{c}}^{t},\tilde{y}_{\mathrm{c}}^{t})$ to this pixel. Given a fixed patch size, $o_{ij}$ is a constant conditioned only on $i,j$ regardless of $t$ or the inputs of $\pi$ . + +Since the values of $(\tilde{x}_{\mathrm{c}}^{t},\tilde{y}_{\mathrm{c}}^{t})$ are continuous, there does not exist a pixel of $\pmb{v}_t$ exactly located at $(\tilde{x}_{ij}^{t},\tilde{y}_{ij}^{t})$ to directly get the pixel value. Alternatively, as illustrated in Figure 3, we can always find that the location $(\tilde{x}_{ij}^{t},\tilde{y}_{ij}^{t})$ is surrounded by four adjacent pixels of $\pmb{v}_t$ , forming a grid. The coordinates are $(\lfloor \tilde{x}_{ij}^{t}\rfloor ,\lfloor \tilde{y}_{ij}^{t}\rfloor)$ , $(\lfloor \tilde{x}_{ij}^{t}\rfloor +1,\lfloor \tilde{y}_{ij}^{t}\rfloor)$ , $(\lfloor \tilde{x}_{ij}^{t}\rfloor ,\lfloor \tilde{y}_{ij}^{t}\rfloor +1)$ and $(\lfloor \tilde{x}_{ij}^{t}\rfloor +1,\lfloor \tilde{y}_{ij}^{t}\rfloor +1)$ , respectively, where $\lfloor \cdot \rfloor$ denotes the rounding-down operation. By assuming that the corresponding pixel values of these four pixels are $(m_{ij}^{t})_{00}$ , $(m_{ij}^{t})_{01}$ , $(m_{ij}^{t})_{10}$ , and $(m_{ij}^{t})_{11}$ , the pixel value at $(\tilde{x}_{ij}^{t},\tilde{y}_{ij}^{t})$ (referred to as $\tilde{m}_{ij}^{t}$ ) can be obtained via interpolation algorithms. In this paper, we simply adopt the differentiable bilinear interpolation: + +$$ +\begin{array}{l} \tilde {m} _ {i j} ^ {t} = \left(m _ {i j} ^ {t}\right) _ {0 0} \left(\left\lfloor \tilde {x} _ {i j} ^ {t} \right\rfloor - \tilde {x} _ {i j} ^ {t} + 1\right) \left(\left\lfloor \tilde {y} _ {i j} ^ {t} \right\rfloor - \tilde {y} _ {i j} ^ {t} + 1\right) \\ + (m _ {i j} ^ {t}) _ {0 1} (\tilde {x} _ {i j} ^ {t} - \lfloor \tilde {x} _ {i j} ^ {t} \rfloor) (\lfloor \tilde {y} _ {i j} ^ {t} \rfloor - \tilde {y} _ {i j} ^ {t} + 1) \\ + \left(m _ {i j} ^ {t}\right) _ {1 0} \left(\left\lfloor \tilde {x} _ {i j} ^ {t} \right\rfloor - \tilde {x} _ {i j} ^ {t} + 1\right) \left(\tilde {y} _ {i j} ^ {t} - \left\lfloor \tilde {y} _ {i j} ^ {t} \right\rfloor\right) \\ + \left(m _ {i j} ^ {t}\right) _ {1 1} \left(\tilde {x} _ {i j} ^ {t} - \left\lfloor \tilde {x} _ {i j} ^ {t} \right\rfloor\right) \left(\tilde {y} _ {i j} ^ {t} - \left\lfloor \tilde {y} _ {i j} ^ {t} \right\rfloor\right). \\ \end{array} +$$ + +Consequently, we can obtain the image patch $\tilde{\pmb{v}}_t$ by traversing all possible $i,j$ in Eq. (6). + +Back-propagation. Give the training loss $\mathcal{L}$ , it is easy to compute the gradient $\partial \mathcal{L} / \partial \tilde{m}_{ij}^t$ with standard backpropagation. Then, following on the chain rule, we have + +$$ +\frac {\partial \mathcal {L}}{\partial \tilde {x} _ {\mathrm {c}} ^ {t}} = \sum_ {i, j} \frac {\partial \mathcal {L}}{\partial \tilde {m} _ {i j} ^ {t}} \frac {\partial \tilde {m} _ {i j} ^ {t}}{\partial \tilde {x} _ {\mathrm {c}} ^ {t}}, \quad \frac {\partial \mathcal {L}}{\partial \tilde {y} _ {\mathrm {c}} ^ {t}} = \sum_ {i, j} \frac {\partial \mathcal {L}}{\partial \tilde {m} _ {i j} ^ {t}} \frac {\partial \tilde {m} _ {i j} ^ {t}}{\partial \tilde {y} _ {\mathrm {c}} ^ {t}}. \tag {7} +$$ + +Combining Eq. (5) and Eq. (7), we can further derive + +$$ +\frac {\partial \tilde {m} _ {i j} ^ {t}}{\partial \tilde {x} _ {\mathrm {c}} ^ {t}} = \frac {\partial \tilde {m} _ {i j} ^ {t}}{\partial \tilde {x} _ {i j} ^ {t}}, \quad \frac {\partial \tilde {m} _ {i j} ^ {t}}{\partial \tilde {y} _ {\mathrm {c}} ^ {t}} = \frac {\partial \tilde {m} _ {i j} ^ {t}}{\partial \tilde {y} _ {i j} ^ {t}}. \tag {8} +$$ + +Eq. (8) can be solved by leveraging Eq. (6), such that we can obtain the gradients $\partial \mathcal{L} / \partial \tilde{x}_{\mathrm{c}}^{t}$ and $\partial \mathcal{L} / \partial \tilde{y}_{\mathrm{c}}^{t}$ . Given that $\tilde{x}_{\mathrm{c}}^{t}$ and $\tilde{y}_{\mathrm{c}}^{t}$ are the outputs of the policy network $\pi$ , the backpropagation process is able to proceed in an ordinary way. + +# 3.3. Training Techniques + +Naive implementation. Thus far, we have enabled the gradients to be back-propagated throughout the whole AdaFocus network for updating all trainable parameters simultaneously. Consequently, end-to-end training has been feasible. For example, one can minimize the frame-wise cross-entropy loss $L_{\mathrm{CE}}(\cdot)$ in AdaFocusV1 [64]: + +$$ +\underset {f _ {\mathrm {G}}, f _ {\mathrm {L}}, f _ {\mathrm {C}}, \pi} {\text {m i n i m i z e}} \mathcal {L} = \underset {\left\{\boldsymbol {v} _ {1}, \boldsymbol {v} _ {2}, \dots \right\}} {\mathbb {E}} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} L _ {\mathrm {C E}} (\boldsymbol {p} _ {t}, y) \right], \tag {9} +$$ + +where $T$ and $y$ denote the length and the label of the video $\{\pmb{v}_1, \pmb{v}_2, \dots\}$ , and $\pmb{p}_t$ is the softmax prediction at $t^{\text{th}}$ frame, as stated in Section 3.1. + +However, importantly, such a straightforward implementation leads to the severely degraded performance (see Table 6 for experimental evidence). We attribute this issue to the absence of some appealing optimization properties introduced by 3-stage training, namely the lack of supervision, input diversity and training stability. To solve these problems, we develop three simple but effective training techniques, with which end-to-end training can significantly outperform the 3-stage counterpart. These techniques do not introduce additional tunable hyper-parameters, while achieving consistent improvements across varying datasets, backbone architectures, and model configurations. + +Lack of supervision: auxiliary supervision. AdaFocusV1 first pre-trains the two encoders (i.e., $f_{\mathrm{G}}, f_{\mathrm{L}}$ ) separately using a direct frame-wise recognition loss (by simply appending a fully-connected layer), aiming to obtain a proper initialization. In contrast, when solving problem (9), $f_{\mathrm{G}}$ and $f_{\mathrm{L}}$ are trained from scratch, while they are only indirectly supervised by the gradients from the classifier $f_{\mathrm{C}}$ . We find that explicitly introducing auxiliary supervision on $f_{\mathrm{G}}$ and $f_{\mathrm{L}}$ effectively facilitates the efficient end-to-end training of AdaFocusV2. In specific, we attach two linear classifiers, $\mathrm{FC}_{\mathrm{G}}(\cdot)$ and $\mathrm{FC}_{\mathrm{L}}(\cdot)$ , to the outputs of $f_{\mathrm{G}}$ and $f_{\mathrm{L}}$ , and replace the loss function $\mathcal{L}$ in (9) by $\mathcal{L}'$ : + +$$ +\begin{array}{l} \mathcal {L} ^ {\prime} = \underset {\left\{\boldsymbol {v} _ {1}, \boldsymbol {v} _ {2}, \dots \right\}} {\mathbb {E}} \left\{\frac {1}{T} \sum_ {t = 1} ^ {T} \left[ L _ {\mathrm {C E}} \left(\boldsymbol {p} _ {t}, y\right) \right. \right. \\ + L _ {\mathrm {C E}} \left(\operatorname {S o f t M a x} \left(\mathrm {F C} _ {\mathrm {G}} \left(\bar {e} _ {t} ^ {\mathrm {G}}\right)\right), y\right) \tag {10} \\ \left. \left. + L _ {\mathrm {C E}} \left(\operatorname {S o f t M a x} \left(\operatorname {F C} _ {\mathrm {L}} \left(\overline {{e}} _ {t} ^ {\mathrm {L}}\right)\right), y\right) \right] \right\}, \\ \end{array} +$$ + +where $\overline{e}_t^{\mathrm{G}}$ and $\overline{e}_t^{\mathrm{L}}$ are the feature vectors after performing global average pooling on the feature maps $e_t^{\mathrm{G}}$ and $e_t^{\mathrm{L}}$ output by $f_{\mathrm{G}}$ and $f_{\mathrm{L}}$ . Intuitively, minimizing $\mathcal{L}'$ enforces the two encoders to learn linearized deep representations, which has been widely verified as an efficient approach for training deep networks [11, 26, 29]. This paradigm benefits the learning of $f_{\mathrm{C}}$ as well, since its inputs are explicitly regularized to be linearly separable. + +Lack of input diversity: diversity augmentation. In the stage-1 for training AdaFocusV1, image patches are randomly cropped, yielding highly diversified inputs for learning well-generalized local encoder $f_{\mathrm{L}}$ . However, the patch selection process presented in Section 3.2 is deterministic. In Eq. (10), given a video frame, the local encoder $f_{\mathrm{L}}$ only has access to the patch specified by the policy network $\pi$ . This procedure leads to the limited diversity of training data for the inputs of $f_{\mathrm{L}}$ . Empirically, we observe that it results in the inferior performance of $f_{\mathrm{L}}$ . We address this issue by proposing a straightforward diversity augmentation approach. For each video, we first compute $\mathcal{L}'$ by activating $\pi$ as aforementioned. Then we infer $f_{\mathrm{L}}$ and the classifier $f_{\mathrm{C}}$ for a second time using randomly cropped patches, obtaining an additional loss $\mathcal{L}_{\mathrm{random}}'$ , which follows Eq. (10) + +![](images/dc377217e6c8c8913adb3e6aebedc6f190740acc67d5abb418b8277ffd579317.jpg) +Figure 4. Illustration of AdaFocusV2+. + +as well. Our final optimization objective is to minimize the combination of $\mathcal{L}'$ and $\mathcal{L}_{\mathrm{random}}'$ : + +$$ +\underset {f _ {\mathrm {G}}, f _ {\mathrm {L}}, f _ {\mathrm {C}}, \pi} {\text {m i n i m i z e}} \frac {1}{2} \left(\mathcal {L} ^ {\prime} + \mathcal {L} _ {\text {r a n d o m}} ^ {\prime}\right). \tag {11} +$$ + +Lack of training stability: stop-gradient. In AdaFocusV1, the policy network $\pi$ is learned on top of the fixed and completely trained global encoder $f_{\mathrm{G}}$ . When it comes to end-to-end training, $\pi$ and $f_{\mathrm{G}}$ are simultaneously updated. In this case, we observe that the gradients back-propagated from $\pi$ interfere with the learning of $f_{\mathrm{G}}$ , leading to an unstable training process with slow convergence speed. We find that this problem can be solved by simply stopping the gradients before the inputs of $\pi$ . In other words, we propose to train $f_{\mathrm{G}}$ using the pure classification objective without any effect from $\pi$ , as done in AdaFocusV1. This design is rational since previous works have revealed that the representations extracted by deep recognition networks can naturally be leveraged for localizing task-relevant regions [11,55,76]. + +# 3.4. Reducing Temporal Redundancy + +The basic formulation of AdaFocus processes each frame using the same amount of computation, and hence it can be improved by further reducing temporal redundancy. AdaFocusV1 achieves this via skipping less informative frames with reinforcement learning. In contrast, we propose a simple confidence-based early-exit algorithm that achieves competitive performance. Our approach can be directly deployed on AdaFocusV2 trained following the aforementioned paradigm, without any additional training process. We refer to this extension of AdaFocusV2 as AdaFocusV2+, as shown in Figure 4. + +It has been widely observed that there exist a considerable number of "easier" samples in datasets [21, 28, 37, 65, 66, 72], which can be accurately recognized with smaller computational cost than others. In the context of videos, we assume that processing a subset of frames (from the beginning) rather than all may be sufficient for these "easier" samples. To implement this idea, at test time, we propose to compare the largest entry of the softmax prediction $\pmb{p}_t$ (defined as confidence in previous works [28, 65, 66, 72]) at $t^{\mathrm{th}}$ frame with a pre-defined threshold $\eta_t$ . Once $\max_j p_{tj} \geq \eta_t$ , the prediction will be postulated to be reliable enough, and the inference will be terminated by outputting $\pmb{p}_t$ . We always adopt a zero-threshold for at final frame. + +The values of $\{\eta_1,\eta_2,\ldots \}$ are solved on the validation set. Suppose that the model needs to classify a set of + +Table 2. Comparisons of AdaFocusV1 and AdaFocusV2 on training efficiency. ActivityNet mAP and wall-clock training time are reported. The latter is obtained using 4 NVIDIA 3090 GPUs. The better results are bold-faced (E2E: End-to-End). + +
Methods3-stage TrainingmAP on ActivityNetTraining Wall-time
9621282160296212821602
AdaFocusV1-MN2/RN71.9%75.0%76.0%6.4h7.2h8.6h
AdaFocusV2-MN2/RNX77.4%79.0%79.9%3.4h3.7h4.3h
+ +Table 3. AdaFocusV1+ v.s. AdaFocusV2+. The two methods are deployed on the same AdaFocusV1 base model to reduce temporal redundancy. ActivityNet mAP on varying inference cost (GFLOPs/video) is reported. The better results are bold-faced (RL: reinforcement learning). + +
MethodsAdditional TrainingOn AdaFocusV1 (1282)On AdaFocusV1 (1602)
19.6G/video24.4G/video27.2G/video34.6G/video
AdaFocusV1-MN2/RN+✓(RL)74.2%74.8%75.5%75.9%
AdaFocusV2-MN2/RN+X74.6%75.0%75.5%75.9%
+ +Table 4. Comparisons of AdaFocusV2 and state-of-the-art baselines on ActivityNet, FCVID and Mini-Kinetics. GFLOPs refers to the average computational cost for processing a single video. The best two results are bold-faced and underlined, respectively. + +
MethodsPublished onBackbonesActivityNetFCVIDMini-Kinetics
mAPGFLOPsmAPGFLOPsTop-1 Acc.GFLOPs
AdaFuse [48]ICLR'21ResNet73.1%61.481.6%45.072.3%23.0
Dynamic-STE [35]ICCV'21ResNet75.9%30.5--72.7%18.3
FrameExit [21]CVPR'21ResNet76.1%26.1--72.8%19.7
AdaFocusV2-RN (1282)-ResNet78.9%34.184.5%34.174.0%34.1
AdaFocusV2-RN+ (1282)-ResNet76.1%15.381.6%12.072.8%13.4
LiteEval [69]NeurIPS'19MobileNet-V2 + ResNet72.7%95.180.0%94.361.0%99.0
SCSampler [36]ICCV'19MobileNet-V2 + ResNet72.9%42.081.0%42.070.8%42.0
ListenToLook [19]CVPR'20MobileNet-V2 + ResNet72.3%81.4----
AR-Net [47]ECCV'20MobileNet-V2 + ResNet73.8%33.581.3%35.171.7%32.0
AdaFrame [68]T-PAMI'21MobileNet-V2 + ResNet71.5%79.080.2%75.1--
VideoIQ [57]ICCV'21MobileNet-V2 + ResNet74.8%28.182.7%27.072.3%20.4
AdaFocusV2-MN2/RN (1282)-MobileNet-V2 + ResNet79.0%27.085.0%27.075.4%27.0
AdaFocusV2-MN2/RN+ (1282)-MobileNet-V2 + ResNet74.8%9.982.7%10.172.3%6.3
+ +samples $\mathcal{D}_{\mathrm{val}}$ within a given computational budget $B > 0$ [28,65]. One can obtain the thresholds through + +$$ +\underset {\eta_ {1}, \eta_ {2}, \dots} {\text {m a x i m i z e}} \operatorname {A c c} \left(\eta_ {1}, \eta_ {2}, \dots \mid \mathcal {D} _ {\text {v a l}}\right) \tag {12} +$$ + +$$ +\text {s u b j e c t} \quad \operatorname {F L O P s} \left(\eta_ {1}, \eta_ {2}, \dots \mid \mathcal {D} _ {\text {v a l}}\right) \leq B. +$$ + +Here $\mathrm{Acc}(\eta_1,\eta_2,\ldots |\mathcal{D}_{\mathrm{val}})$ and FLOPs $(\eta_{1},\eta_{2},\dots|\mathcal{D}_{\mathrm{val}})$ refer to the accuracy and computational cost on $\mathcal{D}_{\mathrm{val}}$ using the thresholds $\{\eta_1,\eta_2,\ldots \}$ . Notably, by changing $B$ , one can obtain varying values of $\{\eta_1,\eta_2,\ldots \}$ . The computational cost of AdaFocusV2+ can be flexibly adjusted without additional training by simply adjusting these thresholds. In our implementation, we solve problem (12) following the method proposed in [28] on training set, which we find performs on par with using cross-validation. + +# 4. Experiment + +In this section, we empirically compare AdaFocusV2 with both AdaFocusV1 and state-of-the-art efficient video recognition frameworks. We also demonstrate that AdaFocusV2 is able to effectively reduce the inference cost on top of recent representative light-weighted deep networks. In addition, ablation studies and visualization results are provided for more insights. Code and pre-trained models are available at https://github.com/LeapLabTHU/AdaFocusV2. + +Datasets. Six large-scale video recognition datasets are used, i.e., ActivityNet [2], FCVID [33], Mini-Kinetics [34, 47], Something-Something (Sth-Sth) V1&V2 [23] and Jester [45]. The official training-validation split is adopted. Given the limited space, we introduce them in Appendix A. + +Following the common practice [19, 40, 47, 48, 64, 68, 69], we evaluate the performance of different methods via mean average precision (mAP) and Top-1 accuracy (Top-1 Acc.) on ActivityNet/FCVID and other datasets, respectively. + +Setup. Unless otherwise specified, we uniformly sample 16 frames from each video on ActivityNet, FCVID and Mini-Kinetics, while sampling 8/12 frames on Sth-Sth. Offline recognition is considered, where we obtain a single prediction for each video. We adopt the final prediction $p_T$ after processing all frames for AdaFocusV2, and use the early-exited prediction for AdaFocusV2+. We follow the data pre-processing pipeline in [40, 47, 64]. For inference, we resize all frames to $256^2$ and perform $224^2$ centre-crop. + +# 4.1. Comparisons with State-of-the-art Baselines + +Baselines. In this subsection, we compare AdaFocusV2 with a number of competitive baselines on ActivityNet, FCVID and Mini-Kinetics. AdaFocusV1 and several state-of-the-art frameworks for efficient video recognition are considered, including MultiAgent [67], LiteEval [69], SC-Sampler [36], ListenToLook [19], AR-Net [47], AdaFrame [68], AdaFuse [48], VideoIQ [57], Dynamic-STE [35] and FrameExit [21]. An introduction is given in Appendix A. + +Implementation details. The comparisons are presented on top of the same backbone networks. Following AdaFocusV1, in most cases, we adopt MobileNet-V2 (MN2) [53] and ResNet-50 (RN) [26] as the global encoder $f_{\mathrm{G}}$ and local encoder $f_{\mathrm{L}}$ of AdaFocusV2. When comparing with the methods that only leverage ResNet (i.e., FrameExit [21], Dynamic-STE [35] and AdaFuse [48]), we replace the MobileNet-V2 with a ResNet-50 with down-sampled inputs (96²). The two variants are referred to as AdaFocusV2- + +![](images/e4db485900e395db13c87a500f3cf8d5e14b18d1581cf5ec778f4ab9fb6f5a38.jpg) +Figure 5. Comparisons of AdaFocusV2, AdaFocusV1 and state-of-the-art baselines on ActivityNet in terms of inference efficiency. MobileNetV2 (MN2) and ResNet (RN) are deployed as backbones in all methods. AdaFocusV2 adopts $96^{2}$ , $128^{2}$ , and $160^{2}$ patches. Notably, AdaFocusV2+ can switch within each black curve without additional training. + +![](images/45b1b87e57cebe4125040944dd2b7c93a352dbc6077763c967923c4284d3ea41.jpg) +Figure 6. AdaFocusV2 $(96^{2},128^{2},160^{2})$ v.s. state-of-the-art efficient video recognition frameworks on top of ResNet (RN). Results on ActivityNet are reported. + +![](images/b4f60129a789c1667f773d2c23ce113a06c5199c8c49072c4e98274b7ab8d4ed.jpg) + +![](images/745d267be7cdab45ee8371a0bb2533d0ed80296a44c05ce1517a75a3212cf167.jpg) +Figure 7. Comparisons of training efficiency of AdaFocusV1 and AdaFocusV2 on SthSth V2. The wall-clock training time is obtained based on 4 NVIDIA 3090 GPUs. + +![](images/76fd6228f13720440af38b9226aff10987c62dea95150a44b7bf5c22b1119f81.jpg) +Figure 8. AdaFocusV1 v.s. AdaFocusV2 on Sth-Sth V1 (left) and Sth-Sth V2 (right) in terms of inference efficiency. The two algorithms are implemented on top of TSM [40] with the patch size of $\{144^2, 160^2, 176^2\}$ and $\{128^2, 144^2, 160^2, 176^2\}$ , respectively. AdaFocusV2 outperforms AdaFocusV1 significantly with the same network architecture. + +![](images/4090f49125e5e31889e3241556328ef2f77523a3eb9f080844fa94ebd9c787f1.jpg) + +MN2/RN and AdaFocusV2-RN, respectively. A one-layer gated recurrent unit (GRU) [6] with a hidden size of 2048 is used as the main body of the policy network $\pi$ , while the accumulated max-pooling module [21] is deployed as the classifier $f_{\mathrm{C}}$ . The input frames are re-ordered following the sampling policy in [21] (see Table 6 for ablation). Due to spatial limitations, more details on network architecture and training hyper-parameters are deferred to Appendix B. + +AdaFocusV2 vs. AdaFocusV1. The comparisons of AdaFocusV2 and AdaFocusV1 in terms of mean average precision (mAP) vs. training/inference cost are presented in Table 2 and Figure 5, respectively. Our method is implemented with the patch size of $96^{2}$ , $128^{2}$ , and $160^{2}$ . One can observe that AdaFocusV2 reduces the time consumption for training by $\sim 2\times$ , while dramatically improving the mAP using the same parch size (by $4 - 5\%$ ). + +Performance of AdaFocusV2+ is depicted in Figures 5, 6. The curves correspond to reducing temporal redundancy on top of AdaFocusV2 $(96^{2}, 128^{2}, 160^{2})$ , i.e., the three black dots. As stated in Section 3.4, we vary the average computational budget, solve the confidence thresholds, and evaluate the corresponding validation accuracy. One can observe that AdaFocusV2+ effectively improves the inference efficiency of AdaFocusV2. In Table 3, we compare + +AdaFocusV2+ with AdaFocusV1+ by deploying them on top of the same AdaFocusV1 base model. AdaFocusV2+ achieves slightly better performance, and removes the requirement of additional reinforcement learning. + +Comparisons with state-of-the-art baselines on ActivityNet, FCVID and Mini-Kinetics are shown in Table 4. It is clear that AdaFocusV2 $(128^{2})$ outperforms all the competitive efficient video recognition methods by large margins. For example, it achieves $4.2\%$ higher mAP $(79.0\%)$ v.s. $74.8\%$ than VideoIQ [57] on ActivityNet with similar GFLOPs. We further present the variants of the baselines with varying computational costs in Figure 5 for a comprehensive comparison. It can be observed that our method leads to a considerably better efficiency-accuracy trade-off. With the same mAP, the number of the required GFLOPs per video for AdaFocusV2+ is $1.9 - 3.6\times$ less than the strongest baselines. + +# 4.2. Deploying on Top of Light-weighted Models + +Setup. In this subsection, we implement AdaFocusV2 on top of a representative efficient network architecture, CNNs with temporal shift module (TSM) [40]. We adopt the same network architectures and experimental protocols as AdaFocusV1. The MobileNet-V2 and ResNet-50 with + +Table 5. Performance of AdaFocusV2-TSM and representative efficient video recognition models. MN2, R18/R34/R50 and BN-Inc. denote MobileNet-V2, ResNet-18/34/50 and BN-Inception, respectively. TSM+ refers to the augmented TSM baseline with the same network architecture as our method except for the policy network $\pi$ . We uniformly sample 8/12 frames for the MobileNetV2/ResNet-50 in our models. The throughput is tested on an NVIDIA GeForce RTX 3090 GPU with a batch size of 128. The best results are bold-faced. + +
MethodBackbones#FramesSth-Sth V1Sth-Sth V2JesterThroughput(NVIDIA 3090, bs=128)
Top-1 Acc.GFLOPsTop-1 Acc.GFLOPsTop-1 Acc.GFLOPs
TSN [63]R50819.7%33.227.8%33.282.6%33.2-
AR-Net [47]MN2 + R18/34/50818.9%41.4--87.8%21.2-
TRNRGB/Flow [75]BN-Inc.8/842.0%32.055.5%32.0---
ECO [77]BN-Inc. + 3DR18839.6%32.0-----
TANet [43]R50847.3%33.060.5%33.0---
STM [32]R50847.5%33.3-----
TEA [39]R50848.9%35.060.9%35.0---
TSM [40]R50846.1%32.759.1%32.796.0%32.7162.7 Videos/s
AdaFuse-TSM [48]R50846.8%31.559.8%31.3---
TSM+ [40]MN2 + R508+847.0%35.159.6%35.196.2%35.1123.0 Videos/s
AdaFocusV2-TSM (1282)MN2 + R508+1247.0%18.5 (↓1.90x)59.6%18.5 (↓1.90x)96.6%18.5 (↓1.90x)197.0 Videos/s (↑1.60x)
AdaFocusV2-TSM (1442)MN2 + R508+1248.2%23.560.5%23.5--159.6 Videos/s
AdaFocusV2-TSM (1602)MN2 + R508+1248.6%27.560.8%27.5--143.6 Videos/s
AdaFocusV2-TSM (1762)MN2 + R508+1249.6% (↑2.6%)33.761.3% (↑1.7%)33.796.9% (↑0.7%)33.7123.5 Videos/s
+ +Table 6. Ablation study of the training techniques. Three representative conditions with different backbones, datasets and varying patch sizes are considered. We report the results of AdaFocusV2-MN2/RN and AdaFocusV2-TSM on ActivityNet and Sth-Sth V1. + +
Auxiliary supervisionDiversity augmentationStop-gradientFrame sampling policy from [21]ActivityNet (mAP)Sth-Sth V1 (Top-1 Acc.)
1282Δ1282Δ1442
69.4%-38.2%-40.7%
72.5%+3.1%42.9%+4.7%44.6%
74.8%+2.3%46.1%+3.2%47.6%
78.7%+3.9%47.0%+0.9%48.2%
79.0%+0.3%---
+ +![](images/24079c9fa27902e6b089517f63e8c9352ba394948f7d6869c93176a5a8a0834f.jpg) +Figure 9. Ablation study of AdaFocusV2+. + +TSM are used as $f_{\mathrm{G}}$ and $f_{\mathrm{L}}$ . A fully-connected layer is deployed as $f_{\mathrm{C}}$ to average the frame-wise predictions as outputs. The policy network $\pi$ generates a single patch location for the whole video after aggregating the information of all frames, which is found important for high generalization performance [64]. Training details can be found in Appendix B. Besides, for fair comparisons, the vanilla TSM is augmented by exploiting the same two backbone networks as ours (named as TSM+). TSM+ differentiates itself from AdaFocusV2 only in that it feeds the whole frames into ResNet-50, while we feed the selected image patches. + +Comparisons of AdaFocusV2 and AdaFocusV1 on Sth-Sth in terms of training/inference efficiency are shown in Figures 1, 7 and Figure 8. The end-to-end trainable AdaFocusV2 accelerates the training by $2.2 - 2.4 \times$ , and improves the accuracy by $1 - 1.5\% / 0.6 - 0.8\%$ on Sth-Sth V1/V2. + +Main results on Sth-Sth and Jester are presented in Table 5. With the reduced input size, AdaFocusV2 enables TSM to process more frames in the task-relevant region of each video, and effectively improves the inference efficiency. For example, AdaFocusV2-TSM reduces the computational cost of TSM+ by $1.9 \times$ without sacrificing accuracy. Notably, the practical speedup is significant as well. + +# 4.3. Analytical Results + +Effectiveness of the proposed training techniques are validated in Table 6. One can observe that all of the three techniques significantly improve the performance of + +AdaFocusV2 across different experimental settings. + +Ablation study of AdaFocusV2+ is presented in Figure 9. Two variants are considered: (1) random early-exit with the same exit proportion as AdaFocusV2+; (2) early-exit with fixed frame length. Our confidence-based adaptive early-exit mechanism outperforms both of them. + +Ablation study and the visualization results of the learned patch selection policy are deferred to Appendix C due to the limited space. + +# 5. Conclusion + +In this paper, we enabled the end-to-end training of adaptive focus video recognition networks (AdaFocus). We first proposed a differentiable interpolation-based operation for selecting patches, allowing the gradient back-propagation throughout the whole model. Then we present three tailored training techniques to address the optimization issues introduced by end-to-end training. Experimental results on six benchmarks demonstrated that our AdaFocusV2 network is considerably more efficient to train than the original AdaFocus model, while achieving state-of-the-art performance. + +# Acknowledgements + +This work is supported in part by the National Science and Technology Major Project of the Ministry of Science and Technology of China (2018AAA0100701), the National Natural Science Foundation of China (61906106, 62022048), Picsart AI Research and Beijing Academy of Artificial Intelligence. + +# References + +[1] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Lučić, and Cordelia Schmid. Vivit: A video vision transformer. arXiv preprint arXiv:2103.15691, 2021. 1 +[2] Fabian Caba Heilbron, Victor Escorcia, Bernard Ghanem, and Juan Carlos Niebles. Activitynet: A large-scale video benchmark for human activity understanding. In CVPR, pages 961-970, 2015. 6, 12 +[3] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, pages 6299-6308, 2017. 1, 2 +[4] Jianguo Chen, Kenli Li, Qingying Deng, Keqin Li, and S Yu Philip. Distributed deep learning model for intelligent video surveillance systems with edge computing. IEEE Transactions on Industrial Informatics, 2019. 1 +[5] Jin Chen, Xijun Wang, Zichao Guo, Xiangyu Zhang, and Jian Sun. Dynamic region-aware convolution. In CVPR, pages 8064-8073, 2021. 2 +[6] Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP, pages 1724-1734, Doha, Qatar, Oct. 2014. Association for Computational Linguistics. 3, 7, 12 +[7] Robert T Collins, Alan J Lipton, Takeo Kanade, Hironobu Fujiyoshi, David Duggins, Yanghai Tsin, David Tolliver, Nobuyoshi Enomoto, Osamu Hasegawa, Peter Burt, et al. A system for video surveillance and monitoring. VSAM final report, 2000(1-68):1, 2000. 1 +[8] James Davidson, Benjamin Liebald, Junning Liu, Palash Nandy, Taylor Van Vleet, Ullas Gargi, Sujoy Gupta, Yu He, Mike Lambert, Blake Livingston, et al. The youtube video recommendation system. In Proceedings of the fourth ACM conference on Recommender systems, pages 293-296, 2010. 1 +[9] Yashar Deldjoo, Mehdi Elahi, Paolo Cremonesi, Franca Garzotto, Pietro Piazzolla, and Massimo Quadrana. Content-based video recommendation system based on stylistic visual features. Journal on Data Semantics, 5(2):99-113, 2016. 1 +[10] Jeffrey Donahue, Lisa Anne Hendricks, Sergio Guadarrama, Marcus Rohrbach, Subhashini Venugopalan, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. In CVPR, pages 2625-2634, 2015. 2 +[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. 3, 5 +[12] Linxi Fan, Shyamal Buch, Guanzhi Wang, Ryan Cao, Yuke Zhu, Juan Carlos Niebles, and Li Fei-Fei. Rubiksnet: Learnable 3d-shift for efficient video action recognition. In ECCV, pages 505–521. Springer, 2020. 2 +[13] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In CVPR, pages 203-213, 2020. 1, 2 + +[14] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In ICCV, pages 6202-6211, 2019. 1, 2 +[15] Christoph Feichtenhofer, Axel Pinz, and Richard P Wildes. Spatiotemporal multiplier networks for video action recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4768-4777, 2017. 2 +[16] Christoph Feichtenhofer, Axel Pinz, and Andrew Zisserman. Convolutional two-stream network fusion for video action recognition. In CVPR, pages 1933-1941, 2016. 1, 2 +[17] Michael Figurnov, Maxwell D Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially adaptive computation time for residual networks. In CVPR, pages 1039-1048, 2017. 2 +[18] Junyu Gao, Tianzhu Zhang, and Changsheng Xu. A unified personalized video recommendation via dynamic recurrent neural networks. In ACM MM, pages 127-135, 2017. 1 +[19] Ruohan Gao, Tae-Hyun Oh, Kristen Grauman, and Lorenzo Torresani. Listen to look: Action recognition by previewing audio. In CVPR, pages 10457-10467, 2020. 1, 2, 6, 12 +[20] Deepti Ghadiyaram, Du Tran, and Dhruv Mahajan. Large-scale weakly-supervised pre-training for video action recognition. In CVPR, pages 12046-12055, 2019. 1 +[21] Amir Ghodrati, Babak Ehteshami Bejnordi, and Amirhossein Habibian. Frameexit: Conditional early exiting for efficient video recognition. In CVPR, pages 15608-15618, 2021. 1, 2, 3, 5, 6, 7, 8, 12 +[22] Xinyu Gong, Heng Wang, Mike Zheng Shou, Matt Feiszli, Zhangyang Wang, and Zhicheng Yan. Searching for two-stream models in multivariate space for video recognition. In ICCV, pages 8033-8042, 2021. 2 +[23] 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, pages 5842-5850, 2017. 6, 12 +[24] Yizeng Han, Gao Huang, Shiji Song, Le Yang, Honghui Wang, and Yulin Wang. Dynamic neural networks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2021. 2 +[25] Kensho Hara, Hirokatsu Kataoka, and Yutaka Satoh. Can spatiotemporal 3d cnns retrace the history of 2d cnns and imagenet? In CVPR, pages 6546-6555, 2018. 1, 2 +[26] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 5, 6 +[27] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. 3 +[28] Gao Huang, Danlu Chen, Tianhong Li, Felix Wu, Laurens van der Maaten, and Kilian Q Weinberger. Multi-scale dense networks for resource efficient image classification. In ICLR, 2018. 5, 6 +[29] Gao Huang, Zhuang Liu, Geoff Pleiss, Laurens Van Der Maaten, and Kilian Weinberger. Convolutional networks with dense connectivity. IEEE transactions on pattern analysis and machine intelligence, 2019. 5 + +[30] Nazli Ikizler and David Forsyth. Searching video for complex activities with finite state models. In CVPR, pages 1-8. IEEE, 2007. 1 +[31] Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. NeurIPS, 28:2017-2025, 2015. 2 +[32] Boyuan Jiang, MengMeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In ICCV, pages 2000–2009, 2019. 8 +[33] Y.-G. Jiang, Z. Wu, J. Wang, X. Xue, and S.-F. Chang. Exploiting feature and class relationships in video categorization with regularized deep neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(2):352-364, 2018. 6, 12 +[34] 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. 6, 12 +[35] Hanul Kim, Mihir Jain, Jun-Tae Lee, Sungrack Yun, and Fatih Porikli. Efficient action recognition via dynamic knowledge propagation. In ICCV, pages 13719-13728, 2021. 1, 2, 6, 12 +[36] Bruno Korbar, Du Tran, and Lorenzo Torresani. Scsampler: Sampling salient clips from video for efficient action recognition. In ICCV, pages 6232-6242, 2019. 1, 2, 6, 12 +[37] Changlin Li, Guangrun Wang, Bing Wang, Xiaodan Liang, Zhihui Li, and Xiaojun Chang. Ds-net++: Dynamic weight slicing for efficient inference in cnns and transformers. arXiv preprint arXiv:2109.10060, 2021.5 +[38] Dong Li, Zhaofan Qiu, Qi Dai, Ting Yao, and Tao Mei. Recurrent tubelet proposal and recognition networks for action detection. In ECCV, pages 303-318, 2018. 2 +[39] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for action recognition. In CVPR, pages 909–918, 2020. 8 +[40] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In ICCV, pages 7083-7093, 2019. 2, 3, 6, 7, 8, 12, 13 +[41] Zhaoyang Liu, Donghao Luo, Yabiao Wang, Limin Wang, Ying Tai, Chengjie Wang, Jilin Li, Feiyue Huang, and Tong Lu. Teinet: Towards an efficient architecture for video recognition. In AAAI, volume 34, pages 11669-11676, 2020. 2 +[42] Ze Liu, Jia Ning, Yue Cao, Yixuan Wei, Zheng Zhang, Stephen Lin, and Han Hu. Video swim transformer. arXiv preprint arXiv:2106.13230, 2021. 1 +[43] Zhaoyang Liu, Limin Wang, Wayne Wu, Chen Qian, and Tong Lu. Tam: Temporal adaptive module for video recognition. In ICCV, pages 13708-13718, 2021. 2, 8 +[44] Chenxu Luo and Alan L Yuille. Grouped spatial-temporal aggregation for efficient action recognition. In ICCV, pages 5512-5521, 2019. 2 +[45] Joanna Materzynska, Guillaume Berger, Ingo Bax, and Roland Memisevic. The jester dataset: A large-scale video dataset of human gestures. In ICCVW, 2019. 6, 12 +[46] Lili Meng, Bo Zhao, Bo Chang, Gao Huang, Wei Sun, Frederick Tung, and Leonid Sigal. Interpretable spatio-temporal + +attention for video action recognition. In ICCV Workshops, pages 0-0, 2019. 2 +[47] Yue Meng, Chung-Ching Lin, Rameswar Panda, Prasanna Sattigeri, Leonid Karlinsky, Aude Oliva, Kate Saenko, and Rogerio Feris. Ar-net: Adaptive frame resolution for efficient action recognition. In ECCV, pages 86-104. Springer, 2020. 1, 2, 3, 6, 8, 12 +[48] Yue Meng, Rameswar Panda, Chung-Ching Lin, Prasanna Sattigeri, Leonid Karlinsky, Kate Saenko, Aude Oliva, and Rogerio Feris. Adafuse: Adaptive temporal fusion network for efficient action recognition. In ICLR, 2021. 2, 3, 6, 8, 12 +[49] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. 3 +[50] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. NeurIPS, 32:8026-8037, 2019. 13 +[51] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In CVPR, pages 12056-12065, 2019. 1 +[52] Mengye Ren, Andrei Pokrovsky, Bin Yang, and Raquel Urtasun. Sbnet: Sparse blocks network for fast inference. In CVPR, pages 8711-8720, 2018. 2 +[53] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zh-moginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In CVPR, pages 4510-4520, 2018. 6 +[54] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. 3 +[55] 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. 3, 5 +[56] Swathikiran Sudhakaran, Sergio Escalera, and Oswald Lanz. Gate-shift networks for video action recognition. In CVPR, pages 1102-1111, 2020. 2 +[57] Ximeng Sun, Rameswar Panda, Chun-Fu Richard Chen, Aude Oliva, Rogerio Feris, and Kate Saenko. Dynamic network quantization for efficient video inference. In ICCV, pages 7375-7385, 2021. 1, 2, 6, 7, 12 +[58] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In ICCV, pages 4489-4497, 2015. 1, 2 +[59] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channel-separated convolutional networks. In ICCV, pages 5552-5561, 2019. 1, 2 +[60] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In CVPR, pages 6450-6459, 2018. 2 + +[61] Thomas Verelst and Tinne Tuytelaars. Dynamic convolutions: Exploiting spatial sparsity for faster inference. In CVPR, pages 2320-2329, 2020. 2 +[62] Guangrun Wang, Keze Wang, and Liang Lin. Adaptively connected neural networks. In CVPR, pages 1781-1790, 2019. 2 +[63] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In ECCV, pages 20-36. Springer, 2016. 2, 8 +[64] Yulin Wang, Zhaoxi Chen, Haojun Jiang, Shiji Song, Yizeng Han, and Gao Huang. Adaptive focus for efficient video recognition. In ICCV, October 2021. 2, 3, 4, 6, 8, 12, 13 +[65] Yulin Wang, Rui Huang, Shiji Song, Zeyi Huang, and Gao Huang. Not all images are worth 16x16 words: Dynamic transformers for efficient image recognition. In NeurIPS, 2021. 5, 6 +[66] Yulin Wang, Kangchen Lv, Rui Huang, Shiji Song, Le Yang, and Gao Huang. Glance and focus: a dynamic approach to reducing spatial redundancy in image classification. In NeurIPS, 2020. 2, 5, 13 +[67] Wenhao Wu, Dongliang He, Xiao Tan, Shifeng Chen, and Shilei Wen. Multi-agent reinforcement learning based frame sampling for effective untrimmed video recognition. In ICCV, pages 6222-6231, 2019a. 1, 2, 6, 12 +[68] Zuxuan Wu, Hengduo Li, Caiming Xiong, Yu-Gang Jiang, and Larry Steven Davis. A dynamic frame selection framework for fast video recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020b. 1, 2, 6, 12 +[69] Zuxuan Wu, Caiming Xiong, Yu-Gang Jiang, and Larry S Davis. Liteeval: A coarse-to-fine framework for resource efficient video recognition. In NeurIPS, 2019b. 6, 12 +[70] Zhuofan Xia, Xuran Pan, Shiji Song, Li Erran Li, and Gao Huang. Vision transformer with deformable attention. In CVPR, 2022. 2 +[71] Zhenda Xie, Zheng Zhang, Xizhou Zhu, Gao Huang, and Stephen Lin. Spatially adaptive inference with stochastic feature sampling and interpolation. In ECCV, pages 531-548. Springer, 2020. 2 +[72] Le Yang, Yizeng Han, Xi Chen, Shiji Song, Jifeng Dai, and Gao Huang. Resolution adaptive networks for efficient inference. In CVPR, pages 2369-2378, 2020. 2, 5 +[73] Serena Yeung, Olga Russakovsky, Greg Mori, and Li Fei-Fei. End-to-end learning of action detection from frame glimpses in videos. In CVPR, pages 2678–2687, 2016. 1, 2 +[74] Joe Yue-Hei Ng, Matthew Hausknecht, Sudheendra Vijayanarasimhan, Oriol Vinyals, Rajat Monga, and George Toderici. Beyond short snippets: Deep networks for video classification. In CVPR, pages 4694–4702, 2015. 2 +[75] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In ECCV, pages 803-818, 2018. 8 +[76] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, pages 2921-2929, 2016. 3, 5 + +[77] Mohammadreza Zolfaghari, Kamaljeet Singh, and Thomas Brox. Eco: Efficient convolutional network for online video understanding. In ECCV, pages 695-712, 2018. 2, 8 \ No newline at end of file diff --git a/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/images.zip b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f5f6452e1177bad3706200e51184d86308f9af25 --- /dev/null +++ b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5fd142a6e1df9763d357cb2b17212ee72d1b1aeffe8e8d53d3d2c78603e3ad6 +size 631858 diff --git a/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/layout.json b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2b6aed17469691008446297a2b29fb0fcc6a31d2 --- /dev/null +++ b/adafocusv2endtoendtrainingofspatialdynamicnetworksforvideorecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df0f148e951946fd06a46c02f8d9b7163e79d69bc775a9713949bcc6e0ea75b9 +size 543630 diff --git a/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_content_list.json b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ef93e29124c0265af4d420f607cfb1b6599f0f63 --- /dev/null +++ b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e946727276a87c06b20d405a87c2ea412e5d23650c7563067354aff42d9bf54 +size 85294 diff --git a/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_model.json b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..43519bd7a84cecf4480408b1c71c23eee15b7e88 --- /dev/null +++ b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7b5b0e3e8dd95ff941db20e565ec8d2773b93de0cda487b56c638f32b12ee31 +size 104098 diff --git a/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_origin.pdf b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2a9b951f921c8f9983c6f7e88440f294c75c5e5c --- /dev/null +++ b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/d1d30c10-76f6-4f66-be74-8769a4a906e4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10df1cc2d831e32c8bb33051825a64839c070d8d29f54397e7c58e1400a97bb4 +size 5895325 diff --git a/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/full.md b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5fdff6d5a596748a1354b61b2f262d4afb9e944f --- /dev/null +++ b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/full.md @@ -0,0 +1,365 @@ +# AdaInt: Learning Adaptive Intervals for 3D Lookup Tables on Real-time Image Enhancement + +Canqian Yang $^{1,4*}$ , Meiguang Jin $^{2*}$ , Xu Jia $^{3}$ , Yi Xu $^{1,4\dagger}$ , Ying Chen $^{2}$ + +$^{1}$ MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University $^{2}$ Alibaba Group $^{3}$ Dalian University of Technology $^{4}$ Chongqing Research Institute, Shanghai Jiao Tong University + +{charlesyoung,xuyi}@sjtu.edu.cn + +xjia@dlut.edu.cn {meiguang.jmg, chenying.ailab}@alibaba-inc.com + +# Abstract + +The 3D Lookup Table (3D LUT) is a highly-efficient tool for real-time image enhancement tasks, which models a non-linear 3D color transform by sparsely sampling it into a discretized 3D lattice. Previous works have made efforts to learn image-adaptive output color values of LUTs for flexible enhancement but neglect the importance of sampling strategy. They adopt a sub-optimal uniform sampling point allocation, limiting the expressiveness of the learned LUTs since the (tri-)linear interpolation between uniform sampling points in the LUT transform might fail to model local non-linearities of the color transform. Focusing on this problem, we present AdaInt (Adaptive Intervals Learning), a novel mechanism to achieve a more flexible sampling point allocation by adaptively learning the non-uniform sampling intervals in the 3D color space. In this way, a 3D LUT can increase its capability by conducting dense sampling in color ranges requiring highly non-linear transforms and sparse sampling for near-linear transforms. The proposed AdaInt could be implemented as a compact and efficient plug-and-play module for a 3D LUT-based method. To enable the end-to-end learning of AdaInt, we design a novel differentiable operator called AiLUT-Transform (Adaptive Interval LUT Transform) to locate input colors in the non-uniform 3D LUT and provide gradients to the sampling intervals. Experiments demonstrate that methods equipped with AdaInt can achieve state-of-the-art performance on two public benchmark datasets with a negligible overhead increase. Our source code is available at https://github.com/ImCharlesY/AdaInt. + +# 1. Introduction + +Recent advances in machine learning techniques remarkably boosted the performance of automatic photo enhance- + +![](images/429dc16fb25625f02d78da9c2eb7c5fd275036da3aa32824c8ebb6163f362b43.jpg) +Figure 1. Comparison between uniform and non-uniform sampling on curve approximation and space partitioning. The illustration is given in 1D but can be easily extended to 3D. + +ment methods [5, 6, 9, 19, 21, 48], aiming to replace a sequence of meticulously-designed operations [2, 24, 25, 33, 43, 50] in the camera imaging pipeline [20] for enhanced visual quality. However, these methods suffer from heavy computational burdens due to complicated optimization processes [10, 13, 19, 21, 49] or neural architecture designs [5, 6, 9, 47]. In fact, most of the commonly-used enhancement operations are pixel-independent, as revisited in [17]. Their total effect is approximately equivalent to a 3D color transform function $(\mathbb{R}^3 \to \mathbb{R}^3)$ that maps an input color point to another one in or across the color spaces. One can adopt a multi-layer perceptron (MLP) to design such a transform [17] but requires a cascade of several linear and nonlinear sub-operations to increase the model capability. To overcome the computational complexity of a series of sub-operations in the transform, the 3D lookup table (LUT) is a promising data structure to conduct efficient mapping + +by sparsely sampling a range of input values and storing the corresponding output values in a 3D lattice. The nonlinearities in the transform are typically approximated by a set of (tri-)linear interpolation functions distributed in the lattice cells. Since a LUT can transform images using only memory access and interpolation operations, it shows an advantage of high efficiency and practicality. + +Previous works [45, 51] have made efforts to learn an image-adaptive LUT, mimicking the underlying optimal color transform with adaption to extensively varied image content. These methods embody the image-adaptiveness of the 3D LUTs only in the output color values, which are automatically learned by neural networks [45, 51]. However, they conduct sampling with equal intervals, not considering the adaption of sampling point density to image contents. It results in a sub-optimal sampling point allocation, limiting the expressiveness of the LUTs to model local non-linearities. Specifically, input pixels with similar color values but requiring highly non-linear contrast stretching (e.g., enhancement on low-light texture regions) are possibly compressed into the same lattice cell, which ends up producing linear-scaling results. The reasons lie in limited sampling points and (tri-)linear interpolation in the LUT transform. As depicted in the left part of Figure 1, for example, a uniform spacing undersamples a color range where the transform exhibits high curvature, resulting in distortion of the non-linearities in the transform. Ideally, increasing the number of sampling points might mitigate the issues but will significantly increase the overhead of the 3D LUT. Besides, it would also aggravate the oversampling in color space where few pixels fall into, causing waste in the LUT capacity, as shown in the right part of Figure 1. + +To achieve a better tradeoff between effectiveness and efficiency when given limited sampling points, we develop a novel deep learning-based approach to adjust the layout of the 3D lattice by dynamically learning the non-uniform sampling intervals. This idea is encapsulated into a compact network module called AdaInt, that can adaptively allocate more sampling points to color ranges requiring highly non-linear transforms and reduce redundant sampling point quota for strongly linear ranges. As illustrated in Figure 2, with the incorporation of AdaInt, a lightweight convolutional neural network (CNN) takes a down-sampled image as input to simultaneously predict two components of a dedicated 3D LUT – the non-uniform sampling coordinates and the corresponding output color values. These two components are combined to compose an image-adaptive 3D LUT that transforms the original image via a novel differentiable operator called AiLUT-Transform, which can provide gradients to AdaInt for end-to-end learning. This operator is essential for locating input colors in a non-uniform 3D lattice by introducing a low-complexity binary search into the lookup procedure of a LUT transform. Therefore, our + +method could be a plug-and-play module for 3D LUTs and still presents high efficiency. + +The main contributions of this paper are three-fold: (1) We view the learning of 3D LUTs from the viewpoint of sampling and point out the importance of the sampling strategy for modeling color transforms with higher non-linear capability. (2) We present a novel AdaInt module and the corresponding AiLUT-Transform operator to enable the adaptive learning of a 3D LUT with a non-uniform layout. (3) We demonstrate the effectiveness and efficiency of our method on two large-scale publicly available datasets. + +# 2. Related Works + +# 2.1. Photo Enhancement Methods + +Recent advances in learning-based image enhancement methods can be roughly divided into two categories. The first paradigm [5, 6, 9, 37, 47, 52] directly learns the dense end-to-end mapping via fully convolutional networks [32]. While this line of works can achieve promising results, they usually suffer from heavy computational and memory burdens, limiting their practicalities. The second paradigm simultaneously leverages the strong fitting abilities of deep learning and the high efficiency of traditional physical models. This line of studies commonly transfers the heavy CNN dense inference into light physical model parameter prediction. The physical models are then used to enhance original images efficiently. The frequently used physical models include affine color transforms [3, 14, 31, 44], mapping curves (which can be viewed as 1D LUTs) [16, 22, 23, 28, 38, 39, 42], multi-layer perceptrons (MLPs) [17] and 3D color LUTs [45, 51]. Among them, 3D LUT is the most promising one due to its faster speed than MLPs, along with the stronger capability than affine transforms and mapping curves. The works most related to ours are [45, 51], which also learn image-adaptive 3D LUTs for enhancing images in real-time. However, they learn 3D LUTs in a uniform layout without considering the image-adaptiveness of the sampling strategy, which restricts their ability to model nonlinear color transform. + +# 2.2. Non-uniform Sampling + +Non-uniform sampling strategies have been extensively investigated in 3D shape recognition such as meshes [15], point clouds [41], and implicit function fields [35] due to their higher efficiency and expressiveness compared to regular grids. For 2D image analysis, while the dominant paradigm is computation on regular 2D grids, recent works have made attempts to the non-uniform sampling of the input images [34], output images [27], feature maps [7], and convolution filters [11]. These works showed that an adaptive sampling strategy enables a high-quality representation using fewer sampling points. Non-uniform layouts have + +![](images/1f04df406ff5dd5b569d59f7b5967193558efb6438783673dcf066de21d3088a.jpg) +Figure 2. Framework of the proposed method. Our method employs a CNN model on the down-sampled version of the input image to simultaneously predict two fundamental components of an image-adaptive 3D LUT – the sampling coordinates and output values. These two components construct a dedicated 3D LUT in a non-uniform layout via the lattice creation and rendering processes. The input image of the original resolution can be afterward transformed by the predicted 3D LUT efficiently via a designed novel AiLUT-Transform. The overall framework can be trained under the supervision of the groundtruth images in an end-to-end manner. Best viewed in color. + +also emerged in traditional LUT implementation [4, 30, 36]. However, these works focus on another task, lattice regression [12], aiming to fit a known color transform into a static 3D LUT and repeat the transform during inference. The non-uniform layouts are introduced as an alternative way to reduce estimation errors. However, these methods are not flexible and intelligent as the estimated LUT is fixed and cannot adapt to new samples. Instead, our work learns the non-uniform 3D LUTs based on the content of every single image for more intelligent enhancement. + +# 3. Method + +# 3.1. Preliminary: 3D Lookup Tables + +In this paper, we view a 3D LUT as a discrete sampling of a complete 3D color transform function. The sampled results are stored in a 3D lattice of output color values $T = \{(T_{r,(i,j,k)},T_{g,(i,j,k)},T_{b,(i,j,k)})\}_{i,j,k\in \mathbb{I}_0^{N_s - 1}}$ that can be queried by sets of input color coordinates $P = \{(P_{r,(i,j,k)},P_{g,(i,j,k)},P_{b,(i,j,k)}\}_{i,j,k\in \mathbb{I}_0^{N_s - 1}}$ , where $N_{s}$ is the number of sampling coordinates along each of three dimensions and $\mathbb{I}_0^{N_s - 1}$ denotes the set of $\{0,1,\dots ,N_s - 1\}$ . Such a lattice defines a total of $N_{s}^{3}$ sampling points on the complete 3D color transform function. Once a 3D lattice is sampled, an input pixel looks up its nearest sampling points according to its color and computes its transformed output via interpolation (typically trilinear interpolation). + +Due to the high efficiency and stability of 3D LUTs, previous methods [45, 51] have tried creating automatic + +image enhancement tools by learning image-adaptive 3D LUTs. They predict image-adaptive output values $T \in [0,1]^{3 \times N_s \times N_s \times N_s}$ by learning several basis 3D LUTs and fusing them using image-dependent weights. These weights are predicted by a CNN model from the down-sampled input image, which significantly saves the computational cost (see the left part of Figure 2). However, these methods uniformly discretize the 3D color space, not considering the image-adaptiveness of sampling coordinates $P \in [0,1]^{3 \times N_s \times N_s \times N_s}$ , making them suffer from sub-optimal sampling point allocation and limited LUT capability. + +In this paper, we address the above issues by simultaneously learning the sampling coordinates and the corresponding output color values in an image-adaptive fashion. Figure 2 shows an overview of the proposed framework. We directly follow the practice in [51] to predict a set of candidate output color values $T$ due to its proven effectiveness. Suppose that $N_{s}$ sampling coordinates along each dimension and an input image $X \in [0,1]^{3 \times H \times W}$ are given. The output color values of a LUT can be formulated as + +$$ +T = h (f (X)), \tag {1} +$$ + +where $f$ is a function mapping an input image into a compact vector representation $E \in \mathbb{R}^{F}$ . The function $h$ takes $E$ as input and predicts all output color values in $T$ . Note that we encapsulate the idea of learning $M$ image-independent basis 3D LUTs and $M$ image-adaptive weights [51] into a cascade of two mappings, denoted as $h: \mathbb{R}^{F} \xrightarrow{h_{0}} \mathbb{R}^{M} \xrightarrow{h_{1}} [0,1]^{3 \times N_{s} \times N_{s} \times N_{s}}$ , with the insight of using rank factoriza + +tion to save parameters. The basis 3D LUTs are encoded as the parameters of $h_1$ . Please refer to the supplementary materials for more details. In the following section, we focus more on the learning of the sampling coordinates $P$ . + +# 3.2. Adaptive Intervals Learning (AdaInt) + +Predicting the sampling color coordinates is equivalent to learning the placement of the sampling points in the 3D color space. Although the totally free sampling points placement provides high flexibility, it complicates the lookup procedure and increases the overhead significantly. To this end, we present a simple yet effective way to achieve the so-called constrained sampling point placement. First, we assume that the three lattice dimensions are independent of each other during the lookup procedure. In this way, we can predict the sampling coordinates along each lattice dimension separately. Second, we reparameterize the sampling coordinates by the intervals between each adjacent pair of them. Therefore, by converting the learning goal from sampling coordinates to sampling intervals, we propose a novel image-adaptive constrained sampling point placement method, termed AdaInt, which we illustrate in the following four steps. + +Unnormalized Intervals Prediction Our method first predicts different sets of $N_{s} - 1$ unnormalized sampling intervals for three lattice dimensions, thus producing a total of $3 \times (N_{s} - 1)$ values of intervals: + +$$ +\hat {Q} \in \mathbb {R} ^ {3 \times \left(N _ {s} - 1\right)} = g (f (X)). \tag {2} +$$ + +In this work, we share the mapping $f$ between sampling points prediction and output values prediction. $g$ denotes a mapping of $\mathbb{R}^F \to \mathbb{R}^{3 \times (N_s - 1)}$ . Please refer to Section 4.2 for more implementation details. + +Intervals Normalization Since the input and output spaces are normalized, the intervals for a given dimension should also spread out in the range of $[0,1]$ . In this work, we choose the softmax function to get the normalized intervals $Q\in [0,1]^{3\times (N_s - 1)} = \mathrm{softmax}(\hat{Q},\mathrm{axis} = 1)$ for convenience. The term "axis $= 1$ " indicates the normalization is performed on each of three color dimensions separately. + +Intervals to Coordinates Conversion The sampling coordinates $\hat{P} \in [0,1]^{3 \times N_s}$ are obtained by applying cumulative summation to $Q$ and prepending an origin to each lattice dimension, which can be formulated as: $\hat{P} = [0_3^T; \text{cumsum}(Q, \text{axis} = 1)]$ , where $0_3$ is a 3-dimension zero vector, and the $[\cdot; \cdot]$ symbol denotes the concatenation operation. The above operations guarantee the bounded $(0 \leq \hat{P}_{c,i} \leq 1$ , for $\forall c = r, g, b$ and $\forall i \in \mathbb{I}_0^{N_s - 1})$ and the monotone increasing properties ( $\hat{P}_{c,i} \leq \hat{P}_{c,j}$ , for $\forall c = r, g, b$ ) + +![](images/1b2ac2fcd9282f46e3f483258de27b101c813a0f9164a65c258982454b008326.jpg) +Query 8 Adjacent Points in the LUT + +![](images/b2697601b8c7986e89f9caa4239580ecaf274b98131feaaf7107940e3920b3c9.jpg) +Figure 3. Procedure of the proposed AiLUT-Transform, which is achieved by two operations: lookup and interpolation. Best viewed in color. + +and $\forall i, j \in \mathbb{I}_0^{N_s - 1}, i \leq j)$ of the predicted sampling coordinates along each dimension, which significantly simplifies the lookup procedure to be presented in Section 3.3. + +Non-uniform 3D Lattice Construction The above $\hat{P}$ matrix indeed provides three $N_{s}$ -dimension coordinate vectors for each lattice dimension, respectively. We can derive the 3D coordinates $P\in [0,1]^{3\times N_s\times N_s\times N_s}$ of the $N_{s}^{3}$ sampling points by calculating the n-ary Cartesian product $(\otimes)$ over these 3 coordinate vectors, i.e., $P = \hat{P}_r\otimes \hat{P}_g\otimes \hat{P}_b = \{(\hat{P}_{r,i},\hat{P}_{g,j},\hat{P}_{b,k})|i,j,k\in \mathbb{I}_0^{N_s - 1}\}$ . These coordinates determine the vertex locations of a non-uniform 3D lattice. The final 3D LUT is easily constructed by assigning each output color value in $T$ to the corresponding vertex defined in $P$ . Such a procedure can be vividly analogized to a rendering process, as illustrated in Figure 2. + +# 3.3. Differentiable Adaptive Interval Lookup Table Transform (AiLUT-Transform) + +With the involvement of AdaInt, the LUT transform should take both the output values $T$ and the sampling coordinates $P$ of the LUT, along with the input image $X$ to produce the transformed output image $\hat{Y}$ . In the standard LUT transform, $P$ is usually omitted since the sampling coordinates are assumed uniform. Therefore, the gradient with respect to $P$ has not yet been explored, which hinders the end-to-end learning of AdaInt. To this end, we introduce a novel transform operation called AiLUT-Transform: + +$$ +\hat {Y} = \operatorname {A i L U T - T r a n s f o r m} (X, T, P). \tag {3} +$$ + +The AiLUT-Transform is (sub-)differential with respect to not only $X$ and $T$ , but also $P$ . This enables the end-to-end learning of the AdaInt module. Given an input query pixel $x$ consisting of three color components $\{x_r, x_g, x_b\}$ , AiLUT-Transform computes its transformed color via two + +basic steps: lookup and interpolation. Please also see Figure 3 for a graphic illustration. + +The Lookup Step Our AiLUT-Transform first performs a lookup operation to locate the query pixel in the 3D LUT. As shown in the top part of Figure 3, this operation aims to find both the left and right neighbors $x_{c}^{0}, x_{c}^{1} \in P$ ( $c = r, g, b$ ) along each dimension for the query pixel. It can be easily achieved by a binary search thanks to the bounded and the monotone increasing properties of our learned sampling coordinates (see Section 3.2). Accordingly, the 8 adjacent points in the LUT can be queried using the indices of the located neighbors in $P$ . For a sampling point corresponding to $x_{r}^{i}, x_{g}^{j}, x_{b}^{k}$ , where $i, j, k \in \{0,1\}$ , we abbreviate the output color values of these 8 neighbors as $\tilde{T}_{:,i,j,k}$ . + +The Interpolation Step After querying 8 adjacent points, trilinear interpolation is conducted to compute the transformed output color of the query pixel. As shown in the bottom part of Figure 3, the transformed output $\hat{y}$ is the sum of the values at 8 corners weighted by the normalized partial volume diagonally opposite the corners, which can be formulated as: + +$$ +\hat {y} = \sum_ {i, j, k \in \{0, 1 \}} V _ {i, j, k} \cdot \tilde {T} _ {:, i, j, k}, \tag {4} +$$ + +where $V_{i,j,k} = (x_r^d)^i (1 - x_r^d)^{1 - i}(x_g^d)^j (1 - x_g^d)^{1 - j}(x_b^d)^k (1 - x_b^d)^{1 - k}$ , and $x_c^d = (x_c - x_c^0) / (x_c^1 - x_c^0)$ ( $c = r, g, b$ ). + +Backpropagation To allow the learning of AdaInt via backpropagation, we derive the gradients with respect to $x_{c}^{0}, x_{c}^{1}$ , and therefore to $P$ . The partial derivative of $x_{c}^{0}$ is: + +$$ +\frac {\partial \hat {y}}{\partial x _ {c} ^ {0}} = \sum_ {i, j, k \in \{0, 1 \}} \tilde {T} _ {:, i, j, k} \frac {\partial V _ {i , j , k}}{\partial x _ {c} ^ {d}} \frac {\partial x _ {c} ^ {d}}{\partial x _ {c} ^ {0}} \tag {5} +$$ + +and similarly to Equation (5) for $x_c^1$ . Please refer to the supplementary material for detailed derivation. Besides, the gradient with respect to $\tilde{T}_{:,i,j,k}$ is more concise: $\partial \hat{y} / \partial \tilde{T}_{:,i,j,k} = V_{i,j,k}$ . + +As the proposed AiLUT-Transform is applied to each pixel independently, it can be implemented efficiently via CUDA. We merge the lookup and interpolation operations into a single CUDA kernel to maximize parallelism. Since our lookup operation is achieved by the binary search algorithm of logarithmic time complexity $(\mathcal{O}(\log_2N_s))$ , its computational cost is negligible in our case, where $N_{s}$ has a relatively small value (typically, 33). + +# 3.4. Loss Function + +The overall framework can be trained in an end-to-end manner. Our loss function consists of the MSE loss as the reconstruction loss $(\mathcal{L}_r)$ and some regularization terms + +![](images/cd3da018a06d77ce4718f00f0e46fc7ec34fc291d6e7b88fac61e88b0597fd5c.jpg) +Figure 4. Ablation study on AdaInt under different numbers $(N_{s})$ of sampling coordinates. The results on the FiveK dataset (480p) [1] for tone mapping are plotted. + +
Sampling StrategyPSNR↑SSIM↑
Shared-AdaInt25.130.921
AdaInt25.280.925
+ +Table 1. Ablation study on different sampling strategies in AdaInt. The results on the FiveK dataset (480p) [1] for tone mapping are listed. "↑" indicates the larger is better. + +adopted from [51] to constrain the output values $T$ of the LUT, including smoothness term $(\mathcal{L}_s)$ and monotonicity term $(\mathcal{L}_m)$ . We do not introduce any other constraint or loss function to the learning of AdaInt, willing that it can be image-adaptive for the network. Following [51], our final loss is written as: + +$$ +\mathcal {L} = \mathcal {L} _ {r} + 0. 0 0 0 1 \times \mathcal {L} _ {s} + 1 0 \times \mathcal {L} _ {m}. \tag {6} +$$ + +# 4. Experiments + +# 4.1. Datasets and Application Settings + +We evaluate our method on two publicly available datasets: MIT-Adobe FiveK [1] and PPR10K [29]. The MIT-Adobe FiveK is a commonly used photo retouching dataset with 5,000 RAW images. We follow the common practice in recent works [17, 22, 51] to adopt only the version retouched by expert C as the groundtruth and split the dataset into 4,500 image pairs for training and 500 image pairs for testing. To speed up the training stage, images are downsampled to $480\mathrm{p}$ resolution (with the short side resized to 480 pixels), whereas images of both $480\mathrm{p}$ and original 4K resolutions are used during testing. The PPR10K is a newly released portrait photo retouching dataset with a larger scale of 11,161 high-quality RAW portrait photos. All three retouched versions are used as the groundtruth in three separable experiments. Following the official split [29], we divide the dataset into 8,875 pairs for training and 2,286 pairs for testing. Experiments are conducted on the $360\mathrm{p}$ version of the dataset due to insufficient disk space. Please refer to the supplementary materials for more details. + +
Method#Parameters480pFull Resolution (4K)
PSNRSSIMΔEabRuntimePSNRSSIMΔEabRuntime
UPE [44]927.1K21.880.85310.804.2721.650.85911.0956.88
DPE [6]3.4M23.750.9089.347.21----
HDRNet [14]483.1K24.660.9158.063.4924.520.9218.2056.07
DeepLPF [37]1.7M24.730.9167.9932.12----
CSRNet [17]36.4K25.170.9247.753.0924.820.9267.9477.10
SA-3DLUT [45]*4.5M25.50//2.27///4.39
3D-LUT [51]593.5K25.290.9237.551.1725.250.9327.591.49
3D-LUT + AdaInt619.7K25.490.9267.471.2925.480.9347.451.59
+ +Table 2. Quantitative comparisons on the FiveK dataset [1] for photo retouching. Runtime is measured in milliseconds. "-" means the result is not available due to insufficient GPU memory. The "+" symbol indicates that the results are adopted from the original paper (some are absent ("/")) due to the unavailable source code. The best and second results are highlighted in red and blue, respectively. + +
Method480p
PSNRSSIMΔEab
UPE [44]21.560.83712.29
DPE [6]22.930.89411.09
HDRNet [14]24.520.9158.14
CSRNet [17]25.190.9217.63
3D-LUT [51]25.070.9207.55
3D-LUT + AdaInt25.280.9257.48
+ +We follow [51] to conduct our experiments on two typical applications: photo retouching and tone mapping. The target images in both applications share the same 8-bit sRGB format. The difference between the two tasks lies in the input formats. In the photo retouching task, the input images are also in sRGB format (8-bit on FiveK and 16-bit on PPR10K), while for the tone mapping task, the input images are in 16-bit CIE XYZ format. Therefore, the tone mapping task requires the ability of color space conversion. We conduct both tasks on the FiveK dataset, but only the retouching task on PPR10K as done in [29]. + +# 4.2. Implementation Details + +Since the focus of our work is to present the idea of learning image-adaptive sampling intervals for a 3D LUT, we do not dive into complicated architectural engineering. Instead, to instantiate the mapping $f$ in our method, we directly follow Zeng's [29, 51] practices to adopt the 5-layer backbone in [51] on the FiveK dataset and the ResNet-18 [18] (initialized with ImageNet-pretrained [8] weights) on the PPR10K dataset. The mapping $h$ in Equation (1) is implemented with two cascade fully-connected layers, which in practice reformulates the implementation in [51]. For the instantiation of AdaInt (mapping $g$ in Equation (2)), + +Table 3. Quantitative comparisons on the FiveK dataset (480p) [1] for the tone mapping application. The best and second results are highlighted in red and blue, respectively. + +
MethodEPSNRΔEabPSNRHCΔEa,b
HDRNet [14]a23.938.7027.215.65
CSRNet [17]a22.729.7525.906.33
3D-LUT [51]a25.646.9728.894.53
3D-LUT + HRP [29]a25.996.7628.294.38
3D-LUT + AdaInta26.336.5629.574.26
HDRNet [14]b23.968.8427.215.74
CSRNet [17]b23.768.7727.015.68
3D-LUT [51]b24.707.7127.994.99
3D-LUT + HRP [29]b25.067.5128.364.85
3D-LUT + AdaIntb25.407.3328.654.75
HDRNet [14]c24.088.8727.325.76
CSRNet [17]c23.179.4526.476.12
3D-LUT [51]c25.187.5828.494.92
3D-LUT + HRP [29]c25.467.4328.804.82
3D-LUT + AdaIntc25.687.3128.934.76
+ +Table 4. Quantitative comparisons on the PPR10K dataset [29] for portrait photo retouching, where "E" denotes "Expert", and a, b, c indicate the groundtruths retouched by three experts. + +a single fully-connected layer is employed. The weights and bias of $g$ are initialized to 0s and 1s, which makes the predicted sampling intervals start from a uniform state. Please refer to the supplementary materials for more details. + +We use the standard Adam optimizer [26] to minimize the loss function in Equation (6). The mini-batch size is set to 1 and 16 on FiveK and PPR10K, respectively. All our models are trained for 400 epochs with a fixed learning rate of $1 \times 10^{-4}$ . We decay the learning rate of $g$ by a factor of 0.1 and freeze its parameters in the first 5 training epochs to make the AdaInt learning more stable. Our method is implemented based on PyTorch [40]. All experiments are conducted on an NVIDIA Tesla V100 GPU. The settings of $N_{s}$ and $M$ are according to the datasets and the experimental purposes. We provide them in the following sections. + +![](images/f275ee0d0a919712a16c1d61aa4a7ef1b12510f1ea4de863e5710567320befac.jpg) +(a) + +![](images/97ad41506db6ace9551203a7ddb4db8e3e1638a4eb0641aa25b312cada8ad67d.jpg) + +![](images/57409a466ad84e54aa42837e3579d530f180f65c060e03a8beb344f1959e34f1.jpg) + +![](images/3de6fffe99dc8e5246fe269121d36c7d4ba0e9ca7eae3ea0f98881526a717d2a.jpg) +(b) + +![](images/e24dade380102655c31271e4cb822750c3e2f2cba4fbcea474d7aecd9986a76a.jpg) + +![](images/c283a1d55e0f1f3500163f7e22ba0acf0c4c136e38d4cb96c6d5c192a46fc56b.jpg) + +![](images/ac9c8db13514142deb5e4750453ff6a92495369517765afd66eb8a103d98491f.jpg) + +![](images/9d11e6ca50d32c68e712be40f7708897cb6b7efd18dbdc1eb4616e9be2f01083.jpg) +Figure 5. Illustration of the learned sampling coordinates and the corresponding 3D LUTs for photo retouching on the PPR10K dataset (360p) [29]. The bottom row visualizes the learned sampling coordinates on the so-called per-color-channel Accumulative Error Histogram (AEH) [30]. The regions in the AEH exhibiting high curvature indicate wherein more sampling points are needed. Best viewed on screen. + +![](images/823b5ffd09470730cfe07c0313d9ef3e94990e48f62cf5cc2eaf4ae918f0eed5.jpg) + +![](images/5321c85b3bb5863579dd2e24904fd104576fd9073c65853b8fc86f92291edc1a.jpg) + +![](images/bca484ea85eeab5e57a9e4fc3f87349bbfc33e63fca0ef1d3509f297a3e0d7cd.jpg) + +![](images/bc613329207afccf41d4b9fd388e125780981a3f89405172be922df237fed2b0.jpg) + +![](images/c329c7a15729c2429f309126a7cbf5fca44c18150db20d2aee3f42705c6a6e42.jpg) + +![](images/2c92a1985304607617141b377661793acbc94fe3bf683056e03e38fb5a8ac44a.jpg) + +![](images/3f724a86e536ac55967566cef687d2d3cc51530fdf38119c03bb04e646e6c88f.jpg) + +![](images/1b19115694294a4d91a8fedff792c066530bb097a04feafd87ef1488b58d6ed1.jpg) + +![](images/c4d2a448a513e810a682cf337b97c454fa4b61f23ba5a0b172a25826ef647bda.jpg) + +![](images/d5c3bbea808f71f8dc0c5e450c2cb1f02b9ffd88ff79ce2807f2913291a5045b.jpg) + +![](images/15b3c3f1c83603a08b226b5ab70c6dcd5c351deeeb0f43ed5b2c507aef1b5c48.jpg) + +![](images/24994528eb98d565d49c1a659a57729bf64b932fcd1f6567d3c462d47635213b.jpg) + +# 4.3. Ablation Studies + +In this section, the tone mapping task with images from the FiveK dataset (480p) is chosen to conduct several ablation studies for verifying the proposed AdaInt. We expect the higher dynamic range (16-bit) of the input images in the tone mapping task can better examine the ability of our AdaInt to learn image-adaptive sampling points. In all ablation studies, the hyper-parameter $M$ is set to 3. + +Number of Coordinates along Each Dimension We assess the baseline 3D-LUT [51] and our method under different settings of $N_{s}$ (the number of sampling coordinates along each color dimension) to verify the efficacy of the proposed AdaInt. As shown in Figure 4, the performance of the baseline and our method decrease as a smaller $N_{s}$ is adopted. Our AdaInt consistently improves the baseline under all settings $N_{s}$ . Further increasing $N_{s}$ (from 33 to 65) can only bring marginal improvement (0.05dB) on the baseline compared with that introduced by our AdaInt. It is worth noting that our method achieves comparable or even better performance with a relatively small LUT size $(N_{s})$ compared to the baseline. It is because AdaInt enables the ability of 3D LUTs to take full advantage of the limited sampling points for better modeling on the underlying optimal color transform. + +Sampling Strategy Our AdaInt generates an individual set of sampling intervals for each color dimension separately, making our method adopts different sampling strategies along different color dimensions. It divides the entire 3D color space into various cuboids. Here, we compare such a default setting with another one that adopts the same strategy over three color dimensions, which divides the 3D space into cubes. We achieve it by letting AdaInt generate only a set of sampling intervals and replicate it to three + +color dimensions, abbreviated as Shared-AdaInt. As shown in Table 1, the Shared-AdaInt strategy performs inferior to the default setting, which is in line with our expectation as the sharing mechanism limits the flexibility of AdaInt to allocate sampling points in the 3D space. + +# 4.4. Property of the Adaptive Sampling Intervals + +The top part of Figure 5 shows two different photos on the PPR10K dataset, their color histograms, and the corresponding learned 3D LUTs from our model. It can be observed that both the color and layout of the 3D lattices vary with the different image content, indicating the image-adaptive property of our learned 3D LUTs. To better analyze the behavior of our AdaInt, we introduce the percolor-channel Accumulative Error Histogram (AEH) [30] between the input and groundtruth images. The regions with high curvature in the AEH, to some extent, indicate the complexity/local-nonlinearity of the underlying 3D color transform and hence require more sampling points. As shown in the bottom part of Figure 5, the sampling coordinates predicted by our AdaInt non-uniformly and adaptively distribute to different regions according to the transform complexity on various images and color channels. A detailed description of AEH and more visualization of learned intervals can be found in the supplementary materials. + +# 4.5. Comparison with State-of-the-Arts + +We also compare state-of-the-art real-time photo enhancement methods. $N_{s}$ is set to 33 as done in other 3D LUT-based approaches [45, 51] for fair comparisons. $M$ is set to 3 and 5 for the FiveK and PPR10K datasets, respectively, as done in [29]. + +Quantitative Comparisons We compare the selected methods on PSNR, SSIM [46], the $L_{2}$ -distance in CIE LAB + +![](images/e84c4042da261735ff3f246ab78ed2052022d69eb1cc6e292df3ca046e4680bd.jpg) +Input + +![](images/e3d1f1b8252b8dc69d0324549bf69f4ebd7470ec9e9b5735b56a0950ac78ebd8.jpg) +CSRNet + +![](images/51687872adfb02e8d4a32178c68d29f2c52a460d60d9fc63e26b45c44ad5b6a3.jpg) +HDRNet + +![](images/cacc5cd3689ab8803622fb9e1d0b30a40e68c860d5102e6dc50cead9078dce6a.jpg) +3D-LUT + +![](images/e4f9e6f2baef517bb2974f20afaea900d1408915bd001c3f1fa68927fe30d09a.jpg) +3D-LUT + AdaInt + +![](images/c6ab370bd64a66b33a0458fa108d602b5e1b729c70a0135a1dd9ab30310fdc95.jpg) +GroundTruth + +![](images/ce2e1aed7f2bf2694f7e539a369aba789f78cc8171cc16ab2b176d46a2c31bd5.jpg) +Input + +![](images/0b22535aeb5ff9617b137e7740d3d141a4635131ec35f56b0964db8b4a15e4ee.jpg) +CSRNet + +![](images/eb643a42ba77aea1796d9813775e2f280bedfd42e43a8d5c5b8369cc620dcdec.jpg) +HDRNet + +![](images/ba9799630fd5d11efdc7eeff8f730ca90aa5871b7341beb636cb5e767d0f9446.jpg) +3D-LUT + +![](images/867db95e2a02be2c54640df523bdcc91daaa9a1a660c061db6c0570358dd7204.jpg) +3D-LUT + AdaInt + +![](images/d3a011e357b65dfe5cb47c6b6f5858703745552afd1abc3372c38680d526eb65.jpg) +GroundTruth + +![](images/5c71bba460947a258378b31e226b9fbd0ea77b521a342743d93364cfc80e3a4f.jpg) +Input +Figure 6. Qualitative comparisons with corresponding error maps on the FiveK dataset [1] for photo retouching. Best viewed on screen. + +![](images/0702a67ae6ce279b0f4c1c1c0e293775eb35c5c21567309ab2ccf2c059958906.jpg) +CSRNet + +![](images/1ee23a70f99d56c08871be5cb34c32f7f74473b8381875731d0e977c9e595ecd.jpg) +HDRNet + +![](images/c18efb6272850075c53671e1e1659f1c531b4f6084e6998ad6e660cc49a52b8a.jpg) +3D-LUT + +![](images/add67f6b9b04e28f9a6f3e4be6aa4392b298684eced59e4532ce4e56bbf352de.jpg) +3D-LUT + AdaInt + +![](images/ad36589d2e7f11ccbd352aeb0979a51da9a3f9dda195682c18360520ea4efecc.jpg) +GroundTruth + +color space $(\Delta E_{ab})$ , and the inference speed. On PPR10K, we also include the human-centered measures [29] (denoted by the "HC" superscript). We obtain the results of existing methods using their published codes and default configurations. All approaches are executed on an NVIDIA Tesla V100 GPU. For speed comparison, we measure the GPU inference time on 100 images and report the average. Table 2 lists the comparison on the FiveK for photo retouching. Our method outperforms others with relatively fewer parameters on both resolutions. Similar conclusions apply to Tables 3 and 4 on the FiveK for tone mapping and the PPR10K for portrait photo retouching, respectively. Especially, our AdaInt brings consistent improvement over 3DLUT [51] on all datasets with a negligible computational cost increase, demonstrating its efficiency and effectiveness. It is worth noting that the concurrent study SA-3DLUT [45] promotes 3D LUTs by constructing pixel-wise LUTs at the cost of a significant model size increase (about 7 times) and a speed decrease (about 3 times). We believe SA-3DLUT equipped with our AdaInt can be further improved, though the source code is not yet publicly available. + +Qualitative Comparisons Figure 6 shows that our method produces more visually pleasing results than other methods. For example, our method better handles the overexposure of the image in the first row. In the second row, other methods suffer from poor saturation in the blue sky, resulting in hazy photos. Our AdaInt instead successfully produces the correct blue color and thus provides a cleaner result. Besides, when enhancing the brightness in the third row, our method preserves more rock texture. Please refer to the supplementary materials for more comparisons. + +# 5. Limitation and Conclusion + +While our AdaInt promotes the expressiveness of 3D LUTs by providing image-adaptive sampling strategies, it + +still lacks spatial modeling and noise robustness. The 3D LUTs assume that each pixel is transformed independently according to its color without considering the locality. Hence, it is more suited for global enhancement and may produce less satisfactory results in areas requiring local tone mapping. [45] provided a possible solution by constructing pixel-wise LUTs. Our method is orthogonal to and may also bring improvement over it. Besides, as our approach is based on pixel-wise mapping, heavy noise may also influence our results. Please refer to the supplementary materials for some visual examples. + +In this paper, we present AdaInt, a novel learning mechanism to promote learnable 3D LUTs for real-time image enhancement. The central idea is to introduce image-adaptive sampling intervals for learning a non-uniform 3D LUT layout. We develop AdaInt as a plug-and-play neural network module and propose a differentiable AiLUT-Transform operator encapsulating binary search and trilinear interpolation. Experimental results on two datasets demonstrate the superiority of our method over other state-of-the-art methods in terms of both performance and efficiency. In addition, we believe the viewpoint of non-uniform sampling on a complicated underlying transform function or representation is not limited to 3D LUTs and can also facilitate other applications, which we leave as our future work. + +# Acknowledgement + +Yi Xu is supported in part by the National Natural Science Foundation of China (62171282, 111 project BP0719010, STCSM 18DZ2270700), the Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102), and the Key Research and Development Program of Chongqing (cstc2021jscx-gksbX0032). Canqian Yang is supported in part by Alibaba Group through Alibaba Research Intern Program. + +# References + +[1] Vladimir Bychkovsky, Sylvain Paris, Eric Chan, and Frédo Durand. Learning photographic global tonal adjustment with a database of input / output image pairs. In The Twenty-Fourth IEEE Conference on Computer Vision and Pattern Recognition, 2011. 5, 6, 8 +[2] Jianrui Cai, Shuhang Gu, and Lei Zhang. Learning a deep single image contrast enhancer from multi-exposure images. IEEE Transactions on Image Processing, 27(4):2049-2062, 2018. 1 +[3] Yoav Chai, Raja Giryes, and Lior Wolf. Supervised and unsupervised learning of parameterized color enhancement. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 992-1000, 2020. 2 +[4] JZ Chan, Jan P Allebach, and Charles A Bouman. Sequential linear interpolation of multidimensional functions. IEEE Transactions on Image Processing, 6(9):1231-1245, 1997. 3 +[5] Chen Chen, Qifeng Chen, Jia Xu, and Vladlen Koltun. Learning to see in the dark. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3291-3300, 2018. 1, 2 +[6] Yu-Sheng Chen, Yu-Ching Wang, Man-Hsin Kao, and Yung-Yu Chuang. Deep photo enhancer: Unpaired learning for image enhancement from photographs with gans. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6306-6314, 2018. 1, 2, 6 +[7] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 764-773, 2017. 2 +[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248-255. IEEE, 2009. 6 +[9] Yubin Deng, Chen Change Loy, and Xiaou Tang. Aesthetic-driven image enhancement by adversarial learning. In Proceedings of the 26th ACM international conference on Multimedia, pages 870-878, 2018. 1, 2 +[10] Xueyang Fu, Delu Zeng, Yue Huang, Xiao-Ping Zhang, and Xinghao Ding. A weighted variational model for simultaneous reflectance and illumination estimation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2782-2790, 2016. 1 +[11] Hang Gao, Xizhou Zhu, Stephen Lin, and Jifeng Dai. Deformable kernels: Adapting effective receptive fields for object deformation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. 2 +[12] Eric Garcia and Maya Gupta. Lattice regression. Advances in Neural Information Processing Systems, 22:594-602, 2009. 3 +[13] Peter Vincent Gehler, Carsten Rother, Andrew Blake, Tom Minka, and Toby Sharp. Bayesian color constancy revisited. In 2008 IEEE Conference on Computer Vision and Pattern Recognition, pages 1-8. IEEE, 2008. 1 +[14] Michael Gharbi, Jiawen Chen, Jonathan T Barron, Samuel W Hasinoff, and Fredo Durand. Deep bilateral learning for real- + +time image enhancement. ACM Transactions on Graphics (TOG), 36(4):1-12, 2017. 2, 6 +[15] Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9785-9795, 2019. 2 +[16] Chunle Guo, Chongyi Li, Jichang Guo, Chen Change Loy, Junhui Hou, Sam Kwong, and Runmin Cong. Zero-reference deep curve estimation for low-light image enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1780-1789, 2020. 2 +[17] Jingwen He, Yihao Liu, Yu Qiao, and Chao Dong. Conditional sequential modulation for efficient global image retouching. arXiv preprint arXiv:2009.10390, 2020. 1, 2, 5, 6 +[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 6 +[19] Sung Ju Hwang, Ashish Kapoor, and Sing Bing Kang. Context-based automatic local image enhancement. In European conference on computer vision, pages 569-582. Springer, 2012. 1 +[20] Hakki Can Karaimer and Michael S Brown. A software platform for manipulating the camera imaging pipeline. In European Conference on Computer Vision, pages 429-444. Springer, 2016. 1 +[21] Liad Kaufman, Dani Lischinski, and Michael Werman. Content-aware automatic photo enhancement. In Computer Graphics Forum, volume 31, pages 2528-2540. Wiley Online Library, 2012. 1 +[22] Hanul Kim, Su-Min Choi, Chang-Su Kim, and Yeong Jun Koh. Representative color transform for image enhancement. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4459-4468, 2021. 2, 5 +[23] Han-Ul Kim, Young Jun Koh, and Chang-Su Kim. Global and local enhancement networks for paired and unpaired image enhancement. In European Conference on Computer Vision, pages 339-354. Springer, 2020. 2 +[24] Seon Joo Kim, Hai Ting Lin, Zheng Lu, Sabine Süssstrunk, Stephen Lin, and Michael S Brown. A new in-camera imaging model for color computer vision and its application. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(12):2289-2302, 2012. 1 +[25] Yeong-Taeg Kim. Contrast enhancement using brightness preserving bi-histogram equalization. IEEE transactions on Consumer Electronics, 43(1):1-8, 1997. 1 +[26] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. 6 +[27] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9799-9808, 2020. 2 +[28] Chongyi Li, Chunle Guo, Qiming Ai, Shangchen Zhou, and Chen Change Loy. Flexible piecewise curves estimation for + +photo enhancement. arXiv preprint arXiv:2010.13412, 2020. 2 +[29] Jie Liang, Hui Zeng, Miaomiao Cui, Xuansong Xie, and Lei Zhang. Ppr10k: A large-scale portrait photo retouching dataset with human-region mask and group-level consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021. 5, 6, 7, 8 +[30] Hai Ting Lin, Zheng Lu, Seon Joo Kim, and Michael S Brown. Nonuniform lattice regression for modeling the camera imaging pipeline. In European Conference on Computer Vision, pages 556-568. Springer, 2012. 3, 7 +[31] Enyu Liu, Songnan Li, and Shan Liu. Color enhancement using global parameters and local features learning. In Proceedings of the Asian Conference on Computer Vision, 2020. 2 +[32] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431-3440, 2015. 2 +[33] Rafal Mantiuk, Scott Daly, and Louis Kerofsky. Display adaptive tone mapping. ACM Trans. Graph., 27(3):1-10, Aug. 2008. 1 +[34] Dmitrii Marin, Zijian He, Peter Vajda, Priyam Chatterjee, Sam Tsai, Fei Yang, and Yuri Boykov. Efficient segmentation: Learning downsampling near semantic boundaries. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2131-2141, 2019. 2 +[35] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4460-4470, 2019. 2 +[36] Vishal Monga and Raja Bala. Sort-select-damp: An efficient strategy for color look-up table lattice design. In Color and Imaging Conference, volume 2008, pages 247-253. Society for Imaging Science and Technology, 2008. 3 +[37] Sean Moran, Pierre Marza, Steven McDonagh, Sarah Parisot, and Gregory Slabaugh. Deeplpf: Deep local parametric filters for image enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2, 6 +[38] Sean Moran, Steven McDonagh, and Gregory Slabaugh. Curl: Neural curve layers for global image enhancement. In 2020 25th International Conference on Pattern Recognition (ICPR), pages 9796-9803. IEEE, 2021. 2 +[39] Jongchan Park, Joon-Young Lee, Donggeun Yoo, and In So Kweon. Distort-and-recover: Color enhancement using deep reinforcement learning. In Proceedings of the IEEE Conference on computer vision and pattern recognition, pages 5928-5936, 2018. 2 +[40] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. + +Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019. 6 +[41] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652-660, 2017. 2 +[42] Yuda Song, Hui Qian, and Xin Du. Starenhancer: Learning real-time and style-aware image enhancement. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4126-4135, 2021. 2 +[43] Yoshiharu Takahashi, Yasutoshi Fujii, Keiichi Kawazu, Seiichi Isoguchi, Kohichi Yamaguchi, and Katsuya Nagaishi. Photographic film reproducing apparatus using object brightness and exposure correction amount to develop photographed images, May 5 1998. US Patent 5,748,287. 1 +[44] Ruixing Wang, Qing Zhang, Chi-Wing Fu, Xiaoyong Shen, Wei-Shi Zheng, and Jiaya Jia. Underexposed photo enhancement using deep illumination estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6849-6857, 2019. 2, 6 +[45] Tao Wang, Yong Li, Jingyang Peng, Yipeng Ma, Xian Wang, Fenglong Song, and Youliang Yan. Real-time image enhancer via learnable spatial-aware 3d lookup tables. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2471-2480, 2021. 2, 3, 6, 7, 8 +[46] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600-612, 2004. 7 +[47] Chen Wei, Wenjing Wang, Wenhan Yang, and Jiaying Liu. Deep retinax decomposition for low-light enhancement. In British Machine Vision Conference 2018, BMVC 2018, Newcastle, UK, September 3-6, 2018, page 155. BMVA Press, 2018. 1, 2 +[48] Zhicheng Yan, Hao Zhang, Baoyuan Wang, Sylvain Paris, and Yizhou Yu. Automatic photo adjustment using deep neural networks. ACM Transactions on Graphics (TOG), 35(2):1-15, 2016. 1 +[49] Zhenqiang Ying, Ge Li, Yurui Ren, Ronggang Wang, and Wenmin Wang. A new low-light image enhancement algorithm using camera response model. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 3015-3022, 2017. 1 +[50] Lu Yuan and Jian Sun. Automatic exposure correction of consumer photographs. In European Conference on Computer Vision, pages 771-785. Springer, 2012. 1 +[51] Hui Zeng, Jianrui Cai, Lida Li, Zisheng Cao, and Lei Zhang. Learning image-adaptive 3d lookup tables for high performance photo enhancement in real-time. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. 2, 3, 5, 6, 7, 8 +[52] Yonghua Zhang, Jiawan Zhang, and Xiaojie Guo. Kindling the darkness: A practical low-light image enhancer. In Proceedings of the 27th ACM international conference on multimedia, pages 1632-1640, 2019. 2 \ No newline at end of file diff --git a/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/images.zip b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3f5c7dff7428f1fc9f86a88d996e00d2ccfc3488 --- /dev/null +++ b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad3e241e79e0169c9f93089e13e4baeb6652789768ac558f62387e2f56ac2354 +size 711826 diff --git a/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/layout.json b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..22cdda2cbb64c1a9fa7fef234db8a99b60ea63ca --- /dev/null +++ b/adaintlearningadaptiveintervalsfor3dlookuptablesonrealtimeimageenhancement/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06046b16364c3b9d386baddf22ce9cd956b86b2f24d3763042f164d36fad9653 +size 465793 diff --git a/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_content_list.json b/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..043e9a75b1d9d0c2fd5893c3fba8c736f5821ed1 --- /dev/null +++ b/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2be91534af653e1a697193ebbbab4b78be6aaec8ecc34965005e4f7f81da6bf +size 83792 diff --git a/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_model.json b/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_model.json new file mode 100644 index 0000000000000000000000000000000000000000..943bc35458e3dc907a13a3906f9fb51d6199473d --- /dev/null +++ b/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d77cdefa983f6cab0545ce16e5acf4d538f4406c985e926400f81ef60c9f16fb +size 101502 diff --git a/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_origin.pdf b/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bd1471aa0cc3e570b8a02c4cd35e18566ad27a20 --- /dev/null +++ b/adamixerafastconvergingquerybasedobjectdetector/ee1466ad-3451-4b3c-90d8-4222d96eb546_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86ce84d72a31e9e6c3f13acfc50325d105cce4c4e1478a0ab6b0bc07830bfbd3 +size 2846861 diff --git a/adamixerafastconvergingquerybasedobjectdetector/full.md b/adamixerafastconvergingquerybasedobjectdetector/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b2a7eb2e1db4607f7e725a28c3158e903e2fb420 --- /dev/null +++ b/adamixerafastconvergingquerybasedobjectdetector/full.md @@ -0,0 +1,333 @@ +# AdaMixer: A Fast-Converging Query-Based Object Detector + +Ziteng Gao $^{1}$ Limin Wang $^{1}$ Bing Han $^{2}$ Sheng Guo $^{2}$ + +$^{1}$ State Key Laboratory for Novel Software Technology, Nanjing University, China $^{2}$ MYbank, Ant Group, China + +# Abstract + +Traditional object detectors employ the dense paradigm of scanning over locations and scales in an image. The recent query-based object detectors break this convention by decoding image features with a set of learnable queries. However, this paradigm still suffers from slow convergence, limited performance, and design complexity of extra networks between backbone and decoder. In this paper, we find that the key to these issues is the adaptability of decoders for casting queries to varying objects. Accordingly, we propose a fast-converging query-based detector, named AdaMixer, by improving the adaptability of query-based decoding processes in two aspects. First, each query adaptively samples features over space and scales based on estimated offsets, which allows AdaMixer to efficiently attend to the coherent regions of objects. Then, we dynamically decode these sampled features with an adaptive MLP-Mixer under the guidance of each query. Thanks to these two critical designs, AdaMixer enjoys architectural simplicity without requiring dense attentional encoders or explicit pyramid networks. On the challenging MS COCO benchmark, AdaMixer with ResNet-50 as the backbone, with 12 training epochs, reaches up to 45.0 AP on the validation set along with 27.9 APs in detecting small objects. With the longer training scheme, AdaMixer with ResNeXt-101-DCN and Swin-S reaches 49.5 and 51.3 AP. Our work sheds light on a simple, accurate, and fast converging architecture for query-based object detectors. The code is made available at https://github.com/MCG-NJU/AdaMixer. + +# 1. Introduction + +Object detection has been a fundamental task in the computer vision area for decades, as it aims to locate varying objects in a single image and categorize them. For a long time, researchers have used spatial dense prior on grids in an image to cover potential objects with great variations. + +![](images/7bf7156ed32b8abaee2f0e0514353febfe5873db28d75efe7bab4e75b66cca51.jpg) +Figure 1. Convergence curves of our AdaMixer, DETR, Deformable DETR and Sparse R-CNN with ResNet-50 as the backbone on MS COCO minimal set. + +This dense paradigm dates back from sliding window methods [11, 36, 41] and still remains prevalent in anchor-based or point-based detectors [15, 23, 26, 32, 34, 38, 50] at the age of convolutional neural networks. Although dense priors has been a dominant role in object detection for its remarkable performance to cover potential objects, they are criticized for several shortcomings in various aspects, including anchor designs [33, 42, 45], training sample selection [13, 14, 48, 49], and post-processing operators on potential redundant detections [2, 18]. + +Though sorts of remedies on these issues are proposed every year, the underlying detection scheme with dense grid-like prior had remained almost untouched for a long time. Recently, query-based object detectors [4, 37, 53] bring a new perspective on object detection, that is, to use learnable embeddings, also termed queries, to directly represent potential objects by using attention-like operators [40]. This scheme, on the other hand, requires a strong representation power of the network to cast limited queries to potential objects to cope with great variations of objects across images. However, the adaptability of currently employed query decoders to the image content is limited on both how to spatially sample features and how to process + +sampled features. For instance, attention-based decoder in DETR-like detectors [4, 53] are adaptive on which feature to sample but remain static on how to decode it, whereas dynamic interaction head in Sparse R-CNN [37] goes vice versa. The insufficiency in the adaptability to different images leaves the current decoder in a dilemma between limited query representation power and great variations of objects. Also, as compensation for this, query-based object detectors usually bring extra attentional encoders or explicit pyramid necks after the backbone and before the query decoder, in order to involve more semantic or multiscale modeling, such as TransformerEncoder [40], MultiScaleDeformableTransformerEncoder [53] and FPN [22]. These extra components result in the higher complexity of built detection pipelines in both design and computational aspects. In addition, detectors with them are hungry for more training time and rich data augmentation due to the introduced modules. + +In this paper, we present a fast-converging and accurate query-based object detector with a simplified architecture, named AdaMixer, to mitigate issues above. Specifically, to effectively use queries to represent objects, AdaMixer introduces the adaptive 3D feature sampler and the adaptive mixing of channel semantics and spatial structures holistically. First, by regarding multi-scale feature maps from the backbone as a 3D feature space, our proposed decoder can flexibly sample features over space and scales to adaptively handle both of location and scale variations of objects based on queries. Then, the adaptive mixing applies the channel and spatial mixing to the sampled features with dynamic kernels under the guidance of queries. The adaptive location sampling and holistic content decoding notably enhances the adaptability of queries to varying images in detecting varying objects. As a result, AdaMixer is simply made up of a backbone network and our proposed decoder without extra attentional encoders or explicit pyramid networks. + +Experimental results show that in a standard 12 epochs training $(1\times$ training scheme) with the random flipping as the only augmentation, our AdaMixer with ResNet-50 [17] as the backbone achieves 42.7, 44.1, and $45.0\mathrm{AP}$ on MS COCO validation set under the settings of 100, 300, and 500 queries, with 24.7, 27.0, and $27.9\mathrm{AP}_s$ in small object detection. With longer $3\times$ training time and stronger data augmentation aligned to other query-based detectors, our AdaMixer with ResNet-101, ResNeXt-101-DCN [44, 52], and Swin-S [27] achieves 48.0, 49.5, and 51.3 AP with the single scale and single model testing, significantly outperforming the previous state-of-the-art query-based detectors. We hope AdaMixer, as a simply-designed, fast-converging, relatively efficient, and more accurate object detector, will serve as a strong baseline in the future research for the query-based object detection. + +# 2. Related Work + +Dense object detectors. The dense paradigm of object detectors dates back to sliding window-based approaches [10, 11, 41], which involve exhaustive classification over space and scales due to the assumption of potential objects emerging uniformly and densely w.r.t. spatial locations in an image. This assumption about natural images remains effective in the deep learning era for its power to cover potential objects [36]. Prevalent object detectors in the past few years, e.g., one-stage detectors [26, 32, 33, 38, 47, 50], multiple-stage detectors [3, 5, 16, 30, 34] or point-based methods [9, 20, 50, 51], are also rooted in this dense assumption in either region proposal networks or entire object detector architectures. They apply dense priors, such as anchors or anchor points, upon the feature map to exhaustively find foreground objects or directly classify them. + +Query-based object detectors. Recently transformer-based detector, DETR [4], formulates object detection as a direct set prediction task and achieves promising performance. DETR predicts a set of objects by attending queries to the feature map with the transformer decoder. The original architecture of DETR is simply based on the Transformer [40], which contains the multi-layer attentional encoder and decoder. The training for set prediction in DETR is based on the bipartite matching between the predictions and ground-truth objects. While DETR outperforms competitive Faster R-CNN baselines, it still suffers from limited spatial resolution, poor small object detection performance, and slow training convergence. There have been several work to tackle these issues. Deformable DETR [53] considers the shift-equivalence in natural images and introduces the multi-scale deformable family of attention operators in both encoders and decoders of DETR. SMCA [12], Conditional DETR [29], and Anchor DETR [43] explicitly model the positional attention for foreground objects to fasten the convergence. Efficient DETR [46] bridges the dense prior to queries in DETR to improve the performance. Sparse R-CNN [37] brings the query-based paradigm of DETR to Cascade R-CNN [3] and introduces the dynamic instance interaction head and its query-adaptive point-wise convolution, to effectively cast queries to potential objects. + +Our AdaMixer generally follows this research line of using queries to attend features for object detection. However, we improve the query-based object detection paradigm from a new perspective: the adaptability of decoding queries across images. Specifically, we focus on how to make decoding scheme on queries more adaptive to the content of images from both semantic and spatial aspects. We present adaptive 3D feature sampling and adaptive content decoding to improve its flexibility to relate queries with each image. This makes AdaMixer a fast-converging query-based object detector without the introduction of extra feature encoders or explicit pyramid networks. + +
adaptive to decode locations?adaptive to decode content?extra networks before the query decoder1?
DETR [4]yes, multi-head attention aggregationno, linear projectionTransformerEncoder
Deformable DETR [53]yes, multi-scale multi-head adaptive samplingno, linear projection2Multi-scale DeformTransEncoder
Sparse R-CNN [37]restricted, RoIAlign [16]partially yes, adaptive point-wise conv.FPN
AdaMixer (ours)yes, adaptive 3D samplingyes, adaptive channel and spatial mixinglinear projection to form 3D feature space
+ +Table 1. Comparisons of the adaptability of decoders across different query-based object detectors. We specify trainable networks introduced after pre-trained backbones before the query decoder. We regard the softmax aggregation in deformable attention as one step in decoding locations as the softmax weights normalize to one. + +# 3. Approach + +In this paper, we focus on the query decoder in query-based object detectors since the decoder design is essential to casting learned queries to potential objects in each image. We first revisit decoders in popular query-based object detectors from the perspective of semantic and positional adaptability, and then elaborate on our proposed adaptive query decoder. + +# 3.1. Object Query Decoder Revisited + +Plain attention decoders. DETR [4] applies plain multihead cross attention between queries and features to cast object queries to potential objects. As depicted in Table 1, the cross attention decoder is adaptive to decode sampling locations in the sense that it exploits the relation of object queries and features to aggregate features. However, the linear transformation of features after aggregation fails to adaptively decode them based on the query. + +Deformable multi-scale attention decoders. Deformable DETR [53] improves the ability of decoding sampling locations in plain cross attention in terms of shift equivalence and scale invariance by introducing explicit reference points and multi-scale features. But like DETR, the content decoding of sampled features still remains static by the linear transformation. Overall, decoders in DETR and Deformable DETR lack the reasoning of aggregated features conditionally on the query and thus limit the semantic adaptability of queries to features. As a result, both of them require stacks of extra attentional encoders to enrich feature semantics. + +RoIAlign and dynamic interactive head as decoders. Sparse R-CNN [37], as the intersection between region-based and query-based detectors, uses the RoIAlign operator and dynamic interactive head as the query decoder. The dynamic interactive head uses point-wise convolutions, whose kernel is adaptive based on the query, to process RoI features. This enables the adaptability of queries to RoI features but only partially, in the sense that the adaptive pointwise convolution can not infer adaptive spatial structures from those features to build queries. Moreover, the sampling locations by RoIAlign operator [16] are restricted inside of the box indicated by a query and a specific level in FPN [22], which limits positional adaptability and requires explicit pyramid networks for multi-scale modeling. + +Summary. Given a limited number of queries and varying potential objects across images, an ideal decoder should consider both the semantic and positional adaptability of such queries to the content of images, that is, how to adaptively decode sampling locations and sampled content. This naturally motivates our design of AdaMixer. + +# 3.2. Our Object Query Definition + +Starting from the object query definition, we associate two vectors with a query following our semantic and positional view of decoders: one is the content vector $\mathbf{q}$ and the other is the positional vector $(x,y,z,r)$ . This is also in line with [37, 43, 53] to disentangle the location or the represented bounding box of a query from its content. The content vector $\mathbf{q}$ is a vector in $\mathbb{R}^{d_q}$ and $d_{q}$ is the channel dimension. The vector $(x,y,z,r)$ describes scaled geometric properties of the bounding box indicated by a query, that is, the x- and y-axis coordinates of its center point and the logarithm of its scale and aspect ratio. The $x,y,z$ components also directly represent coordinates of a query in the 3D feature space, which will be introduced below. + +Decoding the bounding box from a query. We can simply decode the bounding box from the positional vector. The center $(x_{B},y_{B})$ and the width and height $w_{B}$ and $h_B$ of the indicated bounding box can be decoded: + +$$ +x _ {B} = s _ {\text {b a s e}} \cdot x, \quad y _ {B} = s _ {\text {b a s e}} \cdot y, \tag {1} +$$ + +$$ +w _ {B} = s _ {\text {b a s e}} \cdot 2 ^ {z - r}, h _ {B} = s _ {\text {b a s e}} \cdot 2 ^ {z + r}, \tag {2} +$$ + +where $s_{\mathrm{base}}$ is the base downsampling stride offset and we set $s_{\mathrm{base}} = 4$ according to the stride of the largest feature map we use in the experiments. + +# 3.3. Adaptive Location Sampling + +As discussed in Section 3.1, the decoder should adaptively decide which feature to sample regarding the query. That is, the decoder should decode sampling locations with the consideration of both the positional vector $(x,y,z,r)$ and content vector $\mathbf{q}$ . Also, we argue that the decoder must be adaptive not only over $(x,y)$ space but also be flexible in scales of potential objects. Specifically, we can accomplish these goals by regarding multi-scale features as a 3D feature space and adaptively sampling features from it. + +Multi-scale features as the 3D feature space. Given a feature map, indexed $j$ , with the downsampling stride $s_j^{\mathrm{feat}}$ + +![](images/dc37408348e010477069498dfde8086106934e998effe346e89aacbda9feccf7.jpg) +Figure 2. 3D feature sampling process. A query first obtains sampling points in the 3D feature space and then perform 3D interpolation on these sampling points. + +![](images/30426ef3af3265d1dccee482fbe2d453fd5c6e5072c42e38f593d9217ce59ccf.jpg) +Figure 3. Adaptive mixing procedure between an object query and sampled features. The object query first generates adaptive mixing weights and then apply these weights to mix sampled features in the channel and spatial dimension. Note that for clarity, we demonstrate adaptive mixing for one sampling group. + +from the backbone, we first transform them by a linear layer to the same channel $d_{\mathrm{feat}}$ and compute its z-axis coordinate: + +$$ +z _ {j} ^ {\text {f e a t}} = \log_ {2} \left(s _ {j} ^ {\text {f e a t}} / s _ {\text {b a s e}}\right). \tag {3} +$$ + +Then we virtually rescale the height and width of feature maps of different strides to the same ones $H / s_{\mathrm{base}}$ and $W / s_{\mathrm{base}}$ , where $H$ and $W$ is the height and width of the input image, and put them aligned on x- and y-axis in the 3D space as depicted in Figure 2. These feature maps are supporting planes for the 3D feature space, whose interpolation is described below. + +Adaptive 3D feature sampling process. A query first generate $P_{\mathrm{in}}$ sets of offset vectors to $P_{\mathrm{in}}$ points, $\{(\Delta x_i, \Delta y_i, \Delta z_i)\}_{P_{\mathrm{in}}}$ , where each offset vector is indexed by $i$ , and depends on its content vector $\mathbf{q}$ by a linear layer: + +$$ +\left\{\left(\Delta x _ {i}, \Delta y _ {i}, \Delta z _ {i}\right) \right\} _ {P _ {\text {i n}}} = \operatorname {L i n e a r} (\mathbf {q}). \tag {4} +$$ + +Then, these offsets are transformed to sampling locations according to the positional vector of the query for every $i$ : + +$$ +\left\{ \begin{array}{l} \tilde {x} _ {i} = x + \Delta x _ {i} \cdot 2 ^ {z - r}, \\ \tilde {y} _ {i} = y + \Delta y _ {i} \cdot 2 ^ {z + r}, \\ \tilde {z} _ {i} = z + \Delta z _ {i}, \end{array} \right. \tag {5} +$$ + +It is worth noting that the area $\{\Delta x_i, \Delta y_i \in [-0.5, 0.5]\}$ describes the bounding box decoded from the query. Our offsets are not restricted to this range, meaning that a query can sample features "out of the box". Having obtained $\{(\tilde{x}_i, \tilde{y}_i, \tilde{z}_i)\}_{P_{\mathrm{in}}}$ , our sampler samples values given these points in the 3D space. In the current implementation, the interpolation over the 3D space is in the compositional manner: it first samples values given points by bilinear interpolation in the $(x,y)$ space and then interpolates over the z-axis by gaussian weighting given a sampling $\tilde{z}$ , where the weight for the $j$ -th feature map is: + +$$ +\tilde {w} _ {j} = \frac {\exp \left(- \left(\tilde {z} - z _ {j} ^ {\text {f e a t}}\right) ^ {2} / \tau_ {z}\right)}{\sum_ {j} \exp \left(- \left(\tilde {z} - z _ {j} ^ {\text {f e a t}}\right) ^ {2} / \tau_ {z}\right)}, \tag {6} +$$ + +where $\tau_z$ is the softing coefficient for interpolating values over the z-axis and we keep $\tau_z = 2$ in this work. With the feature map of the channel $d_{\mathrm{feat}}$ , the shape of sampled feature matrix $\mathbf{x}$ is $\mathbb{R}^{P_{\mathrm{in}} \times d_{\mathrm{feat}}}$ . The adaptive 3D feature sampling process eases the decoder learning by sampling features with explicit, adaptive and coherent locations and scales regarding a query. + +Group sampling. To sample as many points as possible, we introduce the group sampling mechanism, analogous to multiple heads in attentional operators [40] or groups in group convolution [44]. The group sampling first splits the channel $d_{\mathrm{feat}}$ of the 3D feature space into $g$ groups, each with the channel $d_{\mathrm{feat}} / g$ , and performs 3D sampling individually for each group. With the group sampling mechanism, the decoder can generate $g \cdot P_{\mathrm{in}}$ offset vectors for a query to enrich the diversity of sampling points and exploit richer spatial structure of these points. Sampled feature matrix $\mathbf{x}$ now are of the shape $\mathbb{R}^{g \times P_{\mathrm{in}} \times (d_{\mathrm{feat}} / g)}$ . The grouping mechanism is also applied to the adaptive mixing for efficiency as described below, and we term the group sampling and mixing unified as the grouping mechanism. + +# 3.4. Adaptive Content Decoding + +With features sampled, how to adaptively decode them is another key design in our AdaMixer decoder. To capture correlation in spatial and channel dimension of $\mathbf{x}$ , we propose to efficiently decode the content in each dimension separately. Specifically, we design a simplified and adaptive variant of MLP-mixer [39], termed as adaptive mixing, with dynamic mixing weights similar to dynamic filters in convolutions [19]. As shown in Figure 3, the procedure contains sequentially the adaptive channel mixing and adaptive spatial mixing to involve both adaptive channel semantics and spatial structures under the guidance of a query. + +Adaptive channel mixing. Given sampled feature matrix $\mathbf{x} \in \mathbb{R}^{P_{\mathrm{in}} \times C}$ for a query in a group, where $C = d_{\mathrm{feat}} / g$ , the adaptive channel mixing (ACM) is to use the dynamic weight based on $\mathbf{q}$ to transform features $\mathbf{x}$ on the channel + +![](images/03f821080fa7b5180f43ebc872189543cb76d6f54f9ea8649f0893a456906fcb.jpg) +Figure 4. Our decoder structure of the AdaMixer. There are two operator streams on a query: one on its content vector $\mathbf{q}$ (the solid horizontal line) and one on its positional vector $(x,y,z,r)$ (the dashed horizontal line). Each operator on the content vector in the decoder is followed by a residual addition and LayerNorm. + +dimension to adaptively enhance channel semantics: + +$$ +M _ {c} = \operatorname {L i n e a r} (\mathbf {q}) \in \mathbb {R} ^ {C \times C} \tag {7} +$$ + +$$ +\operatorname {A C M} (\mathbf {x}) = \operatorname {R e L U} \left(\operatorname {L a y e r N o r m} \left(\mathbf {x} M _ {c}\right)\right), \tag {8} +$$ + +where $\mathrm{ACM}(\mathbf{x})\in \mathbb{R}^{P_{\mathrm{in}}\times C}$ is the channel mixed feature output and the linear layer is individual for each group. The layer normalization [1] is applied to both dimensions of the mixed output. Note that in this step, the dynamic weight is shared across different sampling points in 3D space, analogous to adaptive $1\times 1$ convolution in [37] on RoI features. Adaptive spatial mixing. To enable the adaptability of a query to spatial structures of sampled features, we introduce the adaptive spatial mixing (ASM) process. As depicted in Figure 3, ASM can be described as firstly transposing channel mixed feature matrix and applying the dynamic kernel to the spatial dimension of it: + +$$ +M _ {s} = \operatorname {L i n e a r} (\mathbf {q}) \in \mathbb {R} ^ {P _ {\mathrm {i n}} \times P _ {\mathrm {o u t}}} \tag {9} +$$ + +$$ +\operatorname {A S M} (\mathbf {x}) = \operatorname {R e L U} \left(\operatorname {L a y e r N o r m} \left(\mathbf {x} ^ {T} M _ {s}\right)\right), \tag {10} +$$ + +where $\mathrm{ASM}(\mathbf{x})\in \mathbb{R}^{C\times P_{\mathrm{out}}}$ is the spatial mixed output and $P_{\mathrm{out}}$ is the number of spatial mixing out patterns. Note that the dynamic weight is shared across different channels. As sampling points may be from different feature scales, ASM naturally involves multi-scale interaction modeling, which is necessary for high performance object detection. + +The adaptive mixing procedure overall is depicted in Figure 3, where the adaptive spatial mixing follows the adaptive channel mixing, both applied in a sampling group. The final output of the shape $\mathbb{R}^{g\times C\times P_{\mathrm{out}}}$ across group is flattened and transformed to the $d_{q}$ dimension by a linear layer to add back to the content vector. + +# 3.5. Overall AdaMixer Detector + +Like the decoder architecture in [4, 53], we place the self-attention between queries, our proposed adaptive mixing, and feedforward-feed network (FFN) sequentially in a + +stage of the decoder regarding the query content vector $\mathbf{q}$ , as shown in Figure 4. The query positional vector is updated by another FFN at the end of each stage: + +$$ +x ^ {\prime} = x + \Delta x \cdot 2 ^ {z}, y ^ {\prime} = y + \Delta y \cdot 2 ^ {z}, \tag {11} +$$ + +$$ +z ^ {\prime} = z + \Delta z, \quad r ^ {\prime} = r + \Delta r, \tag {12} +$$ + +where $(\Delta x, \Delta y, \Delta z, \Delta r)$ is produced by the lower small FFN block in Figure 4. + +Position-aware multi-head self-attention. Since we disentangle the content and position for a query, the naive multi-head self-attention between the content vectors of queries is not aware of what geometric relation between a query and another query is, which is proven beneficial to suppress redundant detections [4]. To achieve this, we embed positional information into the self-attention. Our positional embedding for the content vector in the sinusoidal form and every component of $(x,y,z,r)$ takes up a quarter of channels. We also embed the intersection over foreground (IoF) as a bias to the attention weight between queries to explicitly incorporate the relation of being contained between queries. The attention for each head is + +$$ +\operatorname {A t t n} (Q, K, V) = \operatorname {S o f t m a x} \left(Q K ^ {T} / \sqrt {d _ {q}} + \alpha B\right) V, \tag {13} +$$ + +where $B_{ij} = \log (|\mathrm{box}_i\cap \mathrm{box}_j| / |\mathrm{box}_i| + \epsilon)$ , $\epsilon = 10^{-7}$ , $Q, K, V\in \mathbb{R}^{N\times d_q}$ , standing for the query, key and value matrix in the self-attention procedure, and $\alpha$ is a learnable scalar for each head. The $B_{ij} = 0$ stands for the box $i$ being totally contained in the box $j$ and $B_{ij} = \log \epsilon \ll 0$ indicates that there is no overlapping between $i$ and $j$ . + +Overall AdaMixer detector. The detection pipeline of AdaMixer is only composed of a backbone and a AdaMixer decoder. It avoids adding explicit feature pyramid networks or attentional encoders between backbone and decoder. The AdaMixer directly gathers predictions of decoded queries as final object detection results. + +# 4. Experiments + +In this section, we first elaborate on the implementation and training details. Then we compare our models with other competitive detectors with limited training epochs. Next, we perform ablation studies on the design of our detector. We also align the training recipe to other query-based detectors and compare our AdaMixer to them fairly. + +# 4.1. Implementation Details + +Dataset. We conduct extensive experiments on MS COCO 2017 dataset [24] in mmdetection codebase [6]. Following the common practice, we use trainval35k subset consisting up of 118K images to train our models and use minival subset of 5K images as the validation set. + +
query dim dqfeat. maps usedfeat. dim dfeat#stages in decoder#groups gCPinPout
256C2 ~ C5256646432128
+ +Configurations. The default hyper-parameters in our AdaMixer detector is elaborated in Table 2. We configure the dimension of the query content vector $d_{q}$ to 256 following previous query-based work [4, 37, 53]. We use feature maps $C_2 \sim C_5$ from the backbone network. Multiscale features are processed by the linear transformation to the channel $d_{\mathrm{feat}} = 256$ as supporting planes for the 3D feature space. The number of decoder stages is set to 6 also following the common practice of query-based detectors. The mixer grouping number is set to 4 as default. Accordingly, the channel of sampled features per group is $C = d_{\mathrm{feat}} / g = 64$ . Also, the number of sampling points $P_{\mathrm{in}}$ and mixing out patterns $P_{\mathrm{out}}$ per group is set to 32 and 128. The hidden dimension of FFN on the content vector in the decoder is set to 2048. The FFN dimension for classification and updating positional vectors is set to 256. + +Initializations. For training stability in early iterations, we initialize the parameters of linear layers to produce dynamic parameters or sampling offsets as follows: zeroing weights of these layers and initializing biases as expected. This helps stable training by enforcing models to learn the adaptability from zeros. The biases for the linear layer producing sampling offest vectors is initialized in the way that $\Delta x_{i},\Delta y_{i}$ are uniformly drawn in $[-0.5,0.5]$ and $\Delta z_{i} = -1$ for all $i$ to align with the RoIAlign [16] level strategy. The bias in the linear layer to produce mixing weights follows the default initialization in the PyTorch. We also initialize all the query positional vectors into decoders such that the their boxes and sampling points cover the whole image in the initial decoder stage like [37]. Backbones are initialized from pre-trained models on the ImageNet 1K dataset [8]. + +Losses and optimizers. Following [37, 53], the training loss is the matching loss consisting of the focal loss [23] with coefficient $\lambda_{\mathrm{cls}} = 2$ , L1 bounding box loss with + +Table 2. Default configuration of our AdaMixer detector. + +
detectorepochsAP\( AP_{50} \)\( AP_{75} \)\( AP_s \)\( AP_m \)\( AP_l \)
FCOS [38]1238.757.441.822.942.550.1
Cascade R-CNN [3]1240.458.944.122.843.754.0
GFocalV2 [21]1241.158.844.923.544.953.3
BorderDet [31]1241.459.444.523.645.154.6
Dynamic Head [7]1242.660.146.426.146.856.0
DETR [4]1220.036.219.36.020.532.2
Deformable DETR [53]1235.153.637.718.238.548.7
Sparse R-CNN [37]1237.956.040.520.740.053.5
AdaMixer (N=100)1242.761.545.924.745.459.2
AdaMixer (N=300)1244.163.447.427.046.959.5
AdaMixer (N=500)1245.064.248.627.947.861.1
+ +Table 3. $1 \times$ training scheme performance on COCO minimal set with different detectors and ResNet-50 as backbone. + +$\lambda_{L_1} = 5$ and GIoU loss [35] with $\lambda_{\mathrm{giou}} = 2$ . We use AdamW [28] as our optimizer with weight decay 0.0001. The initial learning rate is $2.5 \times 10^{-5}$ . + +Training recipes. We adopt two versions of training recipes for a fair comparison with different detectors. The first one adopts the classic $1 \times$ training scheme, which includes a budget of 12 training epochs with training images of shorter side resized to 800. This recipe includes the random horizontal flipping as only the standard data augmentation and allocates 100 learnable object queries to our AdaMixer detector, to compare with popular and competitive detectors like FCOS [38] and Cascade R-CNN [3] fairly. The second training recipe is to align with other query-based detectors, which leverages more training epochs and performs crop and multi-scale augmentation in [4,37,53]. Our second training recipe adopts the same data augmentation and has a budget of 36 training epochs, namely $3 \times$ training scheme. It uses 300 object queries to compare fairly with [37, 53]. The learning rate is divided by a factor of 10 at epoch 8 and 11 in $1 \times$ training scheme or at epoch 24 and 33 in $3 \times$ training scheme, scaled proportionally. + +The $1 \times$ and $3 \times$ training scheme for AdaMixer with ResNet-50 typically take about 9 and 29 hours on 8 V100 cards. During the inference stage, we input images of the shorter size resized to 800 without data augmentation. We leave more details about model training and inference and visualizations in the supplementary material. + +# 4.2. Fast Convergence with Limited Budgets + +We first investigate our proposed AdaMixer with limited training epochs and limited data augmentation, namely $1 \times$ training scheme. For a fair comparison, we disable the commonly-used crop and multi-scale data augmentation in query-based detectors and allocate only 100 queries or learnable proposals for these detectors. Experimental results are shown in Table 3. AdaMixer with $N = 100$ queries achieves 42.7 AP, outperforming state-of-the-art traditional and query-based detectors with a limited training budget. Moreover, if we increase the number of queries $N$ to 300 and 500, the performance of the AdaMixer detector reaches 44.1 and 45.0 AP, especially with 27.0 and $27.9\mathrm{AP}_s$ in de + +adaptive AP $\mathrm{AP}_{50}\mathrm{AP}_{75}\mathrm{AP}_s\mathrm{AP}_m\mathrm{AP}_l$ loc.cont. + +
35.755.237.820.138.148.8
37.355.839.720.740.150.9
40.460.543.423.042.556.7
42.761.545.924.745.459.2
+ +(a) Adaptability of decoding sampling locations and sampled content. + +
PinAPAP50AP75APsAPmAPl
841.260.344.124.043.957.2
1641.860.944.524.544.658.4
3242.761.545.924.745.459.2
6442.761.546.124.945.559.3
+ +(d) Sampling points $P_{\mathrm{in}}$ per group. + +
mixingAPAP50AP75APsAPmAPl
ACMACM41.560.544.323.544.157.4
ASMAM39.858.842.622.842.456.1
ACMACM42.761.545.924.745.459.2
ASMACM41.560.444.523.944.457.1
+ +(b) Design in our adaptive mixing procedure. + +
PoutAPAP50AP75APsAPmAPl
3241.160.044.024.543.657.2
6442.161.245.024.044.857.8
12842.761.545.924.745.459.2
25642.461.445.524.445.058.7
+ +(e) Spatial mixing out patterns $P_{\mathrm{out}}$ per group. + +
pyramidAP\( AP_{50} \)\( AP_{75} \)\( AP_s \)\( AP_m \)\( AP_l \)
FPN [22]42.161.045.024.144.858.7
PAFPN [25]41.760.544.723.544.658.7
-42.761.545.924.745.459.2
+ +(c) Extra pyramid networks after the backbone? + +
pos. inf. +sinus. IoFAPAP50AP75APsAPmAPl
41.259.644.223.643.557.9
41.559.944.323.644.057.8
42.261.245.024.845.158.8
42.761.545.924.745.459.2
+ +(f) Position information in self-attention between queries. + +Table 4. AdaMixer ablation experiments with ResNet-50 on MS COCO minival set. Default choice for our model is colored gray + +tecting small objects. It is worth noting that these results are achieved with random flipping as the only data augmentation and within 12 training epochs, showing that AdaMixer can be supervised efficiently with training samples. + +# 4.3. Ablation Studies + +Due to the limited computational resource, we use ResNet-50 as the backbone network and $1 \times$ training scheme to perform ablation studies. + +Decoding adaptability. We begin our ablations with the key component, the adaptability design, in our AdaMixer detector. The adaptability in AdaMixer is in two aspects: adaptive sampling for decoding locations and adaptive mixing for decoding content. Table 4a investigates the performance under the condition of whether or not we enable the adaptability in decoding sampling locations and decoding content. The cancellation for adaptability on locations or content stands for enforcing weights of linear layers producing sampling offsets or mixing weights all to zeros during the training and inference. Only biases of these layers can be learned during the training procedure, which are eventually not adaptive based on the query content $\mathbf{q}$ . In other words, all sampling offsets or mixing weights are the same across different queries and different images with the cancellation. As shown in Table 4a, the adaptability in both decoding sampling locations and sampled content is essential to a good query-based object detector, which outperforms a non-adaptive counterpart by 7.0 AP. + +Adaptive mixing design. Moving forward, we compare different designs of our adaptive mixing in Table 4b. As shown in Figure 3, our default design for adaptive mixing is to mix features first on the channel dimension and then on the spatial dimension. We perform ablations by placing only channel mixing, only spatial mixing, and the reversed order of our design as three variants. The first adaptive + +channel mixing and then spatial one lead to the best performance. This indicates that channel semantics and spatial structures are both important to the mixing design. For the reversed mixing variant, we suspect that the inferior result is due to the insufficient channel semantics into spatial mixing as features are directly from the backbone. + +Extra pyramid networks. AdaMixer enjoys the simplicity for circumventing extra attentional encoders or explicit pyramid networks. Instead, AdaMixer improves the semantic and multi-scale modeling in the decoder. The adaptive 3D sampling and following spatial mixing naturally enable multi-scale feature modeling and enable queries to handle scale variations of objects. In Table 4c, we investigate the performance of the AdaMixer detector with introduction of extra pyramid networks. Models with these extra networks might require a longer training time and more training samples to perform well. These results are in favor of our AdaMixer design as a simplified query-based detector. + +Sampling points and spatial mixing out patterns. Table 4d and 4e shows the ablation on the sampling points $P_{\mathrm{in}}$ and spatial mixing out patterns $P_{\mathrm{out}}$ per group. The performance is generally related to the number of sampling points $P_{\mathrm{in}}$ and spatial mixing out patterns $P_{\mathrm{out}}$ . A good balance between the complexity and performance is $P_{\mathrm{in}} = 32$ and $P_{\mathrm{out}} = 128$ , where the performance saturates for $P_{\mathrm{in}}$ and decreases for $P_{\mathrm{out}}$ beyond this point. + +Positional information in attention between queries. In Section 3.5, we propose to embed the positional information into the self-attention between the content vectors of queries. In addition to the regular sinusoidal positional embedding, we also hardwire the intersection over foreground (IoF) into the attention weight between boxes indicated by queries. We investigate these two ingredients in Table 4f. Results show that combining these two ingredients notably increases the performance. The individual effect of the IoF + +
detectorbackboneencoder/pyramid net#epochsGFLOPsAP\( AP_{50} \)\( AP_{75} \)\( AP_s \)\( AP_m \)\( AP_l \)
DETR [4]ResNet-50-DC5TransformerEnc50018743.363.145.922.547.361.1
SMCA [12]ResNet-50TransformerEnc5015243.763.647.224.247.060.4
Deformable DETR [53]ResNet-50DeformTransEnc5017343.862.647.726.447.158.0
Sparse R-CNN [37]ResNet-50FPN3617445.063.448.226.947.259.5
Efficient DETR [46]ResNet-50DeformTransEnc3621045.163.149.128.348.459.0
Conditional DETR [29]ResNet-50-DC5TransformerEnc10819545.165.448.525.349.062.2
Anchor DETR [43]ResNet-50-DC5DecoupTransEnc5015144.264.747.524.748.260.6
AdaMixer (ours)ResNet-50-1213244.163.147.829.547.058.8
AdaMixer (ours)ResNet-50-2413246.765.950.529.749.761.5
AdaMixer (ours)ResNet-50-3613247.066.051.130.150.261.8
DETR [4]ResNet-101-DC5TransformerEnc50025344.964.747.723.749.562.3
SMCA [12]ResNet-101TransformerEnc5021844.465.248.024.348.561.0
Sparse R-CNN [37]ResNet-101FPN3625046.464.649.528.348.361.6
Efficient DETR [46]ResNet-101DeformTransEnc3628945.764.149.528.249.160.2
Conditional DETR [29]ResNet-101-DC5TransformerEnc10826245.966.849.527.250.363.3
AdaMixer (ours)ResNet-101-3620848.067.052.430.051.263.7
AdaMixer (ours)ResNeXt-101-DCN-3621449.568.953.931.352.366.3
AdaMixer (ours)Swin-S-3623451.371.255.734.254.667.3
+ +is also compelling. We argue that the IoF between boxes, which describes the geometric relation of being contained directly for corresponding queries, is important for the self-attention to imitate the NMS procedure [4]. + +Table 5. Different query-based detector performance on COCO minival set with longer training scheme and single scale testing. + +
g1248
AP42.542.842.741.9
FLOPs111G106G104G106G
Params191M148M135M149M
+ +Table 6. Grouping sampling and mixing with $g$ groups. + +Mixer group number. The mixer grouping encourages the decoder sampler to sample more diverse points. This also reduces total parameters and computational costs by mixing divided groups of features. We here evaluate the effect of the grouping mechanism with various $g$ in Table 6. The model reaches the least FLOPs and number of parameters with 4 mixer groups with promising performance. + +# 4.4. Comparison with Other Query-based Detectors + +We present the final results of our AdaMixer and perform the comparison between our AdaMixer and other state-of-the-art query-based detectors in Table 5. We use the $3\times$ training scheme to train our AdaMixer, which allocates 300 queries and includes the stronger data augmentation to align with the common practice of other query-based methods. Specifically, we train our AdaMixer with ResNet-50, ResNet-101, ResNeXt-101 [44] with deformable convolution layers [52] and Swin-S [27] backbones. We also proportionally stretch the training schedule for AdaMixer with ResNet-50 to investigate the faster convergence speed, as depicted in Figure 1. AdaMixer with assorted backbones significantly outperforms competitive query-based object detectors with less computational cost. With bounding boxes as only supervising signals, AdaMixer with Swin-S + +reaches 51.3 AP and $34.2\mathrm{AP}_s$ with the single scale testing. Moreover, among these query-based detectors, only AdaMixer does not require the extra attentional encoders and explicit pyramid networks. These results demonstrate our AdaMixer is a simply-architected, effective, and fast-converging query-based object detector. + +# 5. Conclusion and Limitation + +In this paper, we have presented a fast-converging query-based object detection architecture, termed AdaMixer, to efficiently and effectively decode objects from images. Our proposed AdaMixer improves the decoder of query-based detectors with adaptive 3D sampling and adaptive channel and spatial mixing. By improving query decoders, AdaMixer circumvents the requirement of extra network modeling between backbone and decoder. Our AdaMixer achieves superior performance, especially on small object detection, with less computational cost compared to other query-based detectors. Moreover, it enables the fast convergence speed with limited training budgets. We hope that AdaMixer can serve as a strong baseline for future research. + +The limitation in our AdaMixer is that though we have applied the grouping mechanism, the total parameter number remains a little bit large. This is mainly due to a large number of parameters in the linear layer to produce dynamic mixing weights. We leave the question of how to further reduce the number of parameters to the future work. + +Acknowledgements. This work is supported by National Natural Science Foundation of China (No.62076119, No.61921006), Program for Innovative Talents and Entrepreneur in Jiangsu Province, and Collaborative Innovation Center of Novel Software Technology and Industrialization. Part of the work is done during the internship of Ziteng at MYbank. + +# References + +[1] Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv, 2016. 5 +[2] Navaneeth Bodla, Bharat Singh, Rama Chellappa, and Larry S. Davis. Soft-nms - improving object detection with one line of code. In ICCV, 2017. 1 +[3] Zhaowei Cai and Nuno Vasconcelos. Cascade R-CNN: delving into high quality object detection. In CVPR, 2018. 2, 6 +[4] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 1, 2, 3, 5, 6, 8 +[5] Kai Chen, Jiangmiao Pang, Jiaqi Wang, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jianping Shi, Wanli Ouyang, Chen Change Loy, and Dahua Lin. Hybrid task cascade for instance segmentation. In CVPR, 2019. 2 +[6] Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, Zheng Zhang, Dazhi Cheng, Chenchen Zhu, Tianheng Cheng, Qijie Zhao, Buyu Li, Xin Lu, Rui Zhu, Yue Wu, Jifeng Dai, Jingdong Wang, Jianping Shi, Wanli Ouyang, Chen Change Loy, and Dahua Lin. Mmdetection: Open mmlab detection toolbox and benchmark. In arXiv, 2019. 6 +[7] Xiyang Dai, Yinpeng Chen, Bin Xiao, Dongdong Chen, Mengchen Liu, Lu Yuan, and Lei Zhang. Dynamic head: Unifying object detection heads with attentions. In CVPR, 2021. 6 +[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. 6 +[9] Kaiwen Duan, Song Bai, Lingxi Xie, Honggang Qi, Qingming Huang, and Qi Tian. Centernet: Keypoint triplets for object detection. In ICCV, 2019. 2 +[10] Pedro F. Felzenszwalb, Ross B. Girshick, and David A. McAllester. Cascade object detection with deformable part models. In CVPR, 2010. 2 +[11] Pedro F. Felzenszwalb, Ross B. Girshick, David A. McAllester, and Deva Ramanan. Object detection with discriminatively trained part-based models. IEEE Trans. Pattern Anal. Mach. Intell., 32(9):1627-1645, 2010. 1, 2 +[12] Peng Gao, Minghang Zheng, Xiaogang Wang, Jifeng Dai, and Hongsheng Li. Fast convergence of DETR with spatially modulated co-attention. In ICCV, 2021. 2, 8 +[13] Ziteng Gao, Limin Wang, and Gangshan Wu. Mutual supervision for dense object detection. In ICCV, 2021. 1 +[14] Zheng Ge, Songtao Liu, Zeming Li, Osamu Yoshie, and Jian Sun. OTA: optimal transport assignment for object detection. In CVPR, 2021. 1 +[15] Ross B. Girshick. Fast R-CNN. In ICCV, 2015. 1 +[16] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross B. Girshick. Mask R-CNN. In ICCV, 2017. 2, 3, 6 +[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 2 + +[18] Yihui He, Chenchen Zhu, Jianren Wang, Marios Savvides, and Xiangyu Zhang. Bounding box regression with uncertainty for accurate object detection. In CVPR, 2019. 1 +[19] Xu Jia, Bert De Brabandere, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. In NIPS, 2016. 4 +[20] Hei Law and Jia Deng. Cornernet: Detecting objects as paired keypoints. In ECCV, 2018. 2 +[21] Xiang Li, Wenhai Wang, Xiaolin Hu, Jun Li, Jinhui Tang, and Jian Yang. Generalized focal loss V2: learning reliable localization quality estimation for dense object detection. In CVPR, 2021. 6 +[22] 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, 2017. 2, 3, 7 +[23] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. In ICCV, 2017. 1, 6 +[24] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C. Lawrence Zitnick. Microsoft COCO: common objects in context. In ECCV, 2014. 6 +[25] Shu Liu, Lu Qi, Haifang Qin, Jianping Shi, and Jiaya Jia. Path aggregation network for instance segmentation. In CVPR, 2018. 7 +[26] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott E. Reed, Cheng-Yang Fu, and Alexander C. Berg. SSD: single shot multibox detector. In ECCV, 2016. 1, 2 +[27] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, 2021. 2, 8 +[28] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2019. 6 +[29] Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, and Jingdong Wang. Conditional DETR for fast training convergence. In ICCV, 2021. 2, 8 +[30] Jiangmiao Pang, Kai Chen, Jianping Shi, Huajun Feng, Wanli Ouyang, and Dahua Lin. Libra R-CNN: towards balanced learning for object detection. In CVPR, 2019. 2 +[31] Han Qiu, Yuchen Ma, Zeming Li, Songtao Liu, and Jian Sun. Borderdet: Border feature for dense object detection. In ECCV, 2020. 6 +[32] Joseph Redmon, Santosh Kumar Divvala, Ross B. Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In CVPR, 2016. 1, 2 +[33] Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv, 2018. 1, 2 +[34] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In NIPS, 2015. 1, 2 +[35] Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian D. Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In CVPR, 2019. 6 + +[36] Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, and Yann LeCun. Overfeat: Integrated recognition, localization and detection using convolutional networks. In ICLR, 2014. 1, 2 +[37] Peize Sun, Rufeng Zhang, Yi Jiang, Tao Kong, Chenfeng Xu, Wei Zhan, Masayoshi Tomizuka, Lei Li, Zehuan Yuan, Changhu Wang, and Ping Luo. Sparse R-CNN: end-to-end object detection with learnable proposals. In CVPR, 2021. 1, 2, 3, 5, 6, 8 +[38] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. FCOS: fully convolutional one-stage object detection. In ICCV, 2019. 1, 2, 6 +[39] Ilya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, and Alexey Dosovitskiy. Mlp-mixer: An all-mlp architecture for vision. In NeurIPS, 2021. 4 +[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, 2017. 1, 2, 4 +[41] Paul A. Viola and Michael J. Jones. Rapid object detection using a boosted cascade of simple features. In CVPR, 2001. 1, 2 +[42] Jiaqi Wang, Kai Chen, Shuo Yang, Chen Change Loy, and Dahua Lin. Region proposal by guided anchoring. In CVPR, 2019. 1 +[43] Yingming Wang, Xiangyu Zhang, Tong Yang, and Jian Sun. Anchor DETR: query design for transformer-based detector. arXiv, 2021. 2, 3, 8 +[44] Saining Xie, Ross B. Girshick, Piotr Dólár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017. 2, 4, 8 +[45] Tong Yang, Xiangyu Zhang, Zeming Li, Wenqiang Zhang, and Jian Sun. Metaanchor: Learning to detect objects with customized anchors. In NeurIPS, 2018. 1 +[46] Zhuyu Yao, Jiangbo Ai, Boxun Li, and Chi Zhang. Efficient DETR: improving end-to-end object detector with dense prior. ArXiv, 2021. 2, 8 +[47] Jiahui Yu, Yuning Jiang, Zhangyang Wang, Zhimin Cao, and Thomas S. Huang. Unitbox: An advanced object detection network. In ACM Multimedia, 2016. 2 +[48] Shifeng Zhang, Cheng Chi, Yongqiang Yao, Zhen Lei, and Stan Z. Li. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In CVPR, 2020. 1 +[49] Xiaosong Zhang, Fang Wan, Chang Liu, Rongrong Ji, and Qixiang Ye. Freeanchor: Learning to match anchors for visual object detection. In NeurIPS, 2019. 1 +[50] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. ArXiv, 2019. 1, 2 +[51] Xingyi Zhou, Jiacheng Zhuo, and Philipp Kähenbuhl. Bottom-up object detection by grouping extreme and center points. In CVPR, 2019. 2 +[52] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In CVPR, 2019. 2, 8 + +[53] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable DETR: deformable transformers for end-to-end object detection. In ICLR, 2020. 1, 2, 3, 5, 6, 8 \ No newline at end of file diff --git a/adamixerafastconvergingquerybasedobjectdetector/images.zip b/adamixerafastconvergingquerybasedobjectdetector/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2d1a90e01c1bf85b4be6247a5f7fa79fb5df7d6e --- /dev/null +++ b/adamixerafastconvergingquerybasedobjectdetector/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a8ed9d9e15bd577a3381239e91d36a2ed71ca5321a1943e7c9a30e035bd7d9b +size 580205 diff --git a/adamixerafastconvergingquerybasedobjectdetector/layout.json b/adamixerafastconvergingquerybasedobjectdetector/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c4b1e6b5a2e02e6f9e5224a94775147d2527ff0b --- /dev/null +++ b/adamixerafastconvergingquerybasedobjectdetector/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:910dc05cc13c9564d2f2b9bc9d94d46156afb02c8c841775fee83263c71ae9d6 +size 413398 diff --git a/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_content_list.json b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a89c00838e88b62431eeaee88333a3ddd8feb448 --- /dev/null +++ b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08a149db4982f3baf725f63cce7ff1b8bbca593789aabdd203be9af31b0b5f6c +size 77427 diff --git a/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_model.json b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2a1b6be9351108ecada7143e641fee97162f3142 --- /dev/null +++ b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2726f2793a702c69d3321d211e633c3cbbb58c1c3fec9b235f5e18bb483500a +size 99486 diff --git a/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_origin.pdf b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ecd13bca47c0d34aa97164acd67c6faed6e31e6 --- /dev/null +++ b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/6bd7fb2a-ae21-4412-ab0e-2f0bd62dd6fd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73e3f702847826532adfccae95bea07e2571611a7a9ac7de878dc04d8e64920b +size 6941932 diff --git a/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/full.md b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0e2bcabb1aab3e05691134dfb28f5258c5292e7d --- /dev/null +++ b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/full.md @@ -0,0 +1,293 @@ +# Adaptive Early-Learning Correction for Segmentation from Noisy Annotations + +Sheng Liu\*1 Kangning Liu\*1 Weicheng Zhu\* Yiqiu Shen\* Carlos Fernandez-Granda\*2 + +$^{1}$ NYU Center for Data Science $^{2}$ NYU Courant Institute of Mathematical Sciences + +# Abstract + +Deep learning in the presence of noisy annotations has been studied extensively in classification, but much less in segmentation tasks. In this work, we study the learning dynamics of deep segmentation networks trained on inaccurately annotated data. We observe a phenomenon that has been previously reported in the context of classification: the networks tend to first fit the clean pixel-level labels during an "early-learning" phase, before eventually memorizing the false annotations. However, in contrast to classification, memorization in segmentation does not arise simultaneously for all semantic categories. Inspired by these findings, we propose a new method for segmentation from noisy annotations with two key elements. First, we detect the beginning of the memorization phase separately for each category during training. This allows us to adaptively correct the noisy annotations in order to exploit early learning. Second, we incorporate a regularization term that enforces consistency across scales to boost robustness against annotation noise. Our method outperforms standard approaches on a medical-imaging segmentation task where noises are synthesized to mimic human annotation errors. It also provides robustness to realistic noisy annotations present in weakly-supervised semantic segmentation, achieving state-of-the-art results on PASCAL VOC 2012. + +# 1. Introduction + +Semantic segmentation is a fundamental problem in computer vision. The goal is to assign a label to each pixel in an image, indicating its semantic category. Deep learning models based on convolutional neural networks (CNNs) achieve state-of-the-art performance [9, 39, 51, 65]. These models are typically trained in a supervised fashion, which requires pixel-level annotations. Unfortunately, gathering pixel-level annotations is very costly, and may require significant domain expertise in some applications [17, 32, 40, 48]. Furthermore, annotation noise is inevitable in some appli + +![](images/85c65b84a220c67a576214f11618d7cbc17f1bf4aa75cc67885d18ec467f379e.jpg) +Input +Figure 1. Visualization of the segmentation results of the baseline method SEAM [52] and the baseline combined with the proposed ADaptive Early-Learning corrEction (ADELE). Our proposed ADELE improves segmentation quality. More examples can be found in Appendix A.1. + +![](images/ca7f142121bd5e258db8fda90bca73e415feb6fdac68faaf34799464fae4c1e1.jpg) +Ground Truth + +![](images/ec6f8df2a194547c2f0135cee2e1339cf9440170506ecee27e6e81461fe353d8.jpg) +Baseline + +![](images/8065d9eecd00529a9e80f9b8dc998d6283215641e4ba9d2421a2912c843ac2ba.jpg) +Baseline+ADELE + +cations. For example, in medical imaging, segmentation annotation may suffer from inter-reader annotation variations [22, 63]. Learning to perform semantic segmentation from noisy annotations is thus an important topic in practice. + +Prior works on learning from noisy labels focus on classification tasks [33, 46, 57]. There are comparatively fewer works on segmentation, where existing works focus on designing noise-robust network architecture [50] or incorporating domain specific prior knowledge [42]. We instead focus on improving the performance in a more general perspective by studying the learning dynamics. We observe that the networks tend to first fit the clean annotations during an "early-learning" phase, before eventually memorizing the false annotations, thus jeopardizing generalization performance. This phenomenon has been reported in the context of classification [33]. However, this phenomenon in semantic segmentation differs significantly from its counterpart in classification in the following ways: + +- The noise in segmentation labels is often spatially dependent. Therefore, it is beneficial to leverage spatial information during training. +- In semantic segmentation, early learning and memorization do not occur simultaneously for all semantic categories due to pixel-wise imbalanced labels. Previous methods [28, 33] in noisy label classification often assume class + +![](images/320cd3e3dc84868b7f0195a2b9e260ee1962f01b73b394d92c873f37c8bb9002.jpg) +Figure 2. A prevailing pipeline for training WSSS. We aim to improve the segmentation model from noisy annotations. + +balanced data and thus either detecting or handling wrong labels for different classes at the same time. + +- The annotation noise in semantic segmentation can be ubiquitous (all examples have some errors) while the state-of-the-art methods in classification [28,33,67] assume that some samples are completely clean. + +Inspired by these observations, we propose a new method, ADELE (ADaptive Early-Learning corrEction), that is designed for segmentation from noisy annotations. Our method detects the beginning of the memorization phase by monitoring the Intersection over Union (IoU) curve for each category during training. This allows it to adaptively correct the noisy annotations in order to exploit early-learning for individual classes. We also incorporate a regularization term to promote spatial consistency, which further improves the robustness of segmentation networks to annotation noise. + +To verify the effectiveness of our method, we consider a setting where noisy annotations are synthesized and controllable. We also consider a practical setting – Weakly-Supervised Semantic Segmentation (WSSS), which aims to perform segmentation based on weak supervision signals, such as image-level labels [24, 54], bounding box [11, 44], or scribbles [30]. We focus on a popular pipeline in WSSS. This pipeline consists of two steps (See Figure 2). First, a classification model is used to generate pixel-level annotations. This is often achieved by applying variations of Class Activation Maps (CAM) [66] combined with post-processing techniques [3, 25]. Second, these pixel-level annotations are used to train a segmentation model (such as deeplabv1 [8]). Generated by a classification model, the pixel-wise annotations supplied to the segmentation model are inevitably noisy, thus the second step is indeed a noisy segmentation problem. We therefore apply ADELE to the second step. In summary, our main contributions are: + +- We analyze the behavior of segmentation networks when trained with noisy pixel-level annotations. We show that the training dynamics can be separated into an early-learning and a memorization stage in segmentation with annotation noise. Crucially, we discover that these dynamics differ across each semantic category. + +- We propose a novel approach (ADELE) to perform semantic segmentation with noisy pixel-level annotations, which exploits early learning by adaptively correcting the annotations using the model output. +- We evaluate ADELE on the thoracic organ segmentation task where annotations are corrupted to resemble human errors. ADELE is able to avoid memorization, outperforming standard baselines. We also perform extensive experiments to study ADELE on various types and levels of noises. +- ADELE achieves the state of the art on PASCAL VOC 2012 for WSSS. We show that ADELE can be combined with several different existing methods for extracting pixel-level annotations [3,14,52] in WSSS, consistently improving the segmentation performance by a substantial margin. + +# 2. Methodology + +# 2.1. Early learning and memorization in segmentation from noisy annotations + +In a typical classification setting with label noise, a subset of the images are incorrectly labeled. It has been observed in prior works that deep neural networks tend to first fit the training data with clean labels during an early-learning phase, before eventually memorizing the examples with incorrect labels [4, 33]. Here, we show that this phenomenon also occurs in segmentation when the available pixel-wise annotations are noisy (i.e. some of the pixels are incorrect). We consider two different problems. First, segmentation in medical imaging, where annotation noise is mainly due to human error. Second, the annotation noise in weakly-supervised semantic segmentation due to the bias of classification models, as they mostly focus on discriminative regions, and the post-processing errors may result in systematic over or under segmentation. + +Given noisy annotations for which we know the ground truth, we can quantify the early-learning and memorization phenomena by analyzing the model output on the pixels that are incorrectly labeled: + +- early learning $\mathbf{IoU}_{el}$ : We quantify early learning using the overlap (measured in terms of the Intersection over Union (IoU) metric) between the outputs and the corresponding ground truth label on the pixels that are incorrectly labeled, denoted by $\mathbf{IoU}_{el}$ . +- **memorization** $\mathbf{IoU}_m$ : We quantify memorization using the overlap (measured in IoU) between the CNN outputs and the incorrect labels, denoted by $\mathrm{IoU}_m$ . + +Figure 3 demonstrates the phenomena of early-learning and memorization on a randomly corrupted CT-scan segmentation dataset (SegTHOR [27]). We analyze the learning + +![](images/25be2621da8ab4a2ce53806a2585655259c4bd2b37418a768bae9155a2a8b93c.jpg) +Figure 3. We visualize the effect of early learning $(\mathrm{IoU}_{el}$ , green curves) and memorization $(\mathrm{IoU}_m$ , red curves) on incorrectly annotated pixels with (solid lines) and without (dashed lines) ADELE for each foreground category of a medical dataset SegThor [27]. The model is a UNet trained with noisy annotations that mimic human errors. $\mathrm{IoU}_{el}$ is the IOU between the model output and the ground truth computed over the incorrectly-labeled pixels. $\mathrm{IoU}_m$ is the IOU between the model output and the incorrect annotations. For all classes, $\mathrm{IoU}_m$ increases substantially as training proceeds because the model gradually memorizes the incorrect annotations. This occurs at different speeds for different categories. In contrast, $\mathrm{IoU}_{el}$ first increases during an early-learning stage where the model learns to correctly segment the incorrectly-labeled pixels, but eventually decreases as memorization occurs. Like memorization, early-learning also happens at varying speeds for the different semantic categories. See Figure 10 in Appendix for the plot on PASCAL VOC. + +![](images/84037a778e7c13eb206fd7946f3f627ba0bb7d3dce83e385d3a13c916b39448a.jpg) + +![](images/99e7de9267c735176964fa05f4fd7853830a011dc478884c8aace5b3e95f4433.jpg) + +![](images/2e229f9772b7bd37c711b507ff9632b6d2ef6964190227e93c496e63b32a3024.jpg) + +![](images/7cf2d8897de95327d7e31efd7ccedd67cdedb8719986634f4e89a98965e5fd7e.jpg) + +curve on the incorrectly-annotated pixels during the training process. The plots show the $\mathrm{IoU}_m$ (dashed red line) and $\mathrm{IoU}_{el}$ (dashed green line) at different training epochs. For all classes, the IoU between the output and the incorrect labels $(\mathrm{IoU}_m)$ increases substantially as training proceeds because the model gradually memorizes the incorrect annotations. This memorization process occurs at varying speeds for different semantic categories (compare heart and Aorts with Traches or Esophagus in the SegThor dataset). The IoU between the output and the correct labels $(\mathrm{IoU}_{el})$ follows a completely different trajectory: it first increases during an early-learning stage where the model learns to correctly segment the incorrectly-labeled pixels, but eventually decreases as memorization occurs (for the WSSS dataset, we observe a very similar phenomenon shown in Figure 11 in the Appendix). Like memorization, early-learning also happens at varying speeds for the different semantic categories. + +Figure 4 illustrates the effect of early learning and memorization on the model output. In the medical-imaging application, the noisy annotations (third column) are synthesized to resemble human annotation errors which either miss or encompass the ground truth regions (compare to second column). Right after early learning, these regions are identified by the segmentation model (fourth column), but after memorization the model overfits to the incorrect annotations and forgets how to segment these regions correctly (fifth column). Similar effects are observed in WSSS, in which the noisy annotations generated by the classification model are missing some object regions, perhaps because they are not particularly discriminative (e.g. the body of the dog, cat and people in the first, second, and fourth row respectively, or the upper half of the bus in the third row). The segmentation model first identify these regions but eventually overfits to the incorrect annotations. Our goal in this work is to modify the + +training of segmentation models on noisy annotations in order to prevent memorization. This is achieved by combining two strategies described in the next two sections. Figure 3 and Figure 4 shows that the resulting method substantially mitigates memorization (solid red lines) and promotes continued learning beyond the early-learning stage (solid green lines). + +# 2.2. Adaptive label correction based on early-learning + +The early-learning phenomenon described in the previous section suggests a strategy to enhance segmentation models: correcting the annotations using the model output. Similar ideas have inspired works in classification with noisy labels [33, 37, 46, 60]. However, different from the classification task where the noise is mainly sample-wise, the annotation noise is ubiquitous across examples and distributed in a pixel-wise manner. There is a key consideration for this approach to succeed: the annotations cannot be corrected too soon, because this degrades their quality. Determining when to correct the pixel-level annotations using the model output is challenging for two reasons: + +- Correcting all classes at the same time can be sub-optimal. +- During training, we do not have access to the performance of the model on ground-truth annotations (otherwise we would just use them to train the model in the first place!). + +To overcome these challenges we propose to update the annotations corresponding to different categories at different times by detecting when early learning has occurred and memorization is about to begin using the training performance of the model. + +In our experiments, we observe that the segmentation performance on the training set (measured by the IoU be + +![](images/fc87af09e9669c38bddc847a13bb5b6be63cd12c63cb85e17454d7dfd0affa82.jpg) +Figure 4. Visual examples illustrating the early-learning and memorization phenomena. For several images in a medical dataset Segthor [27] (top row) and the WSSS dataset VOC 2012 [13] (bottom four rows), we show the ground-truth annotations (second column), noisy annotations (third column) obtained by a synthetic corruption process for the medical data and by the classification-based SEAM [52] model for WSSS, the output of a model segmentation model trained on the noisy annotations after early learning (fourth column), and the output of the same model after memorization (fifth column). The model for the medical dataset is a UNet. The WSSS model is a standard DeepLab-v1 network trained with the SEAM annotations. As suggested by the graphs in Figure 3 after early learning the model corrects some of the annotation errors, but these appear again after memorization. ADELE is able to correct the labels leveraging the early learning output, thereby avoiding memorization (sixth column). We set the background color to light gray for ease of visualization. + +tween the model output and the noisy annotations) improves rapidly during early learning, and then much more slowly during memorization (see the rightmost graph in Figure 5). We propose to use this deceleration to decide when to update the noisy annotations. To estimate the deceleration we first fit the following exponential parametric model to the training IoU using least squares: + +$$ +f (t) = a \left(1 - e ^ {- b \cdot t ^ {c}}\right), \tag {1} +$$ + +where $t$ represents training time and $0 < a \leq 1$ , $b \geq 0$ , + +and $c \geq 0$ are fitting parameters. Then we compute the derivative $f'(t)$ of the parametric model with respect to $t$ at $t = 1$ and at the current iteration. For each semantic category, the annotations are corrected when the relative change in derivative is above a certain threshold $r$ , i.e. when + +$$ +\frac {\left| f ^ {\prime} (1) - f ^ {\prime} (t) \right|}{\left| f ^ {\prime} (1) \right|} > r, \tag {2} +$$ + +![](images/f689eb5889f5fc939e763e7cdeea1b309abd719f311d3830a4607320aa3a6607.jpg) + +![](images/af9642c33ec569861cbb6ce37ed05e2dc4000fb1a9eb467113fc2e6b2a0e38ee.jpg) + +![](images/7a49f242137156ae69eb69169be9204ea2eefb4936f80f68a9cd6d2946f48f40.jpg) + +![](images/05ce3265ee036457b3b8f34edd05a4b18302dbe565fc2cd25b9554173c9fbee6.jpg) +Figure 5. Illustration of the proposed curve fitting method to decide when to begin label correction in ADELE (Results on SegThor). First column: On the top, we plot the IoU between the model predictions and the initial noisy annotations for the same model used in Figures 3 and 4 and the corresponding fit with the parametric model in Equation 1. The label correction beginning iteration is based on the relative slope change of the fitted curve. The bottom image shows the label correction times for different semantic categories, showing that they are quite different. Second and third columns: the green lines show the IoUel for different categories Esophagus, Heart, Trachea and Aorta. The IoUel equals the IoU between the model output and the ground truth computed over the incorrectly-labeled pixels, and therefore quantifies early-learning. The label correction begins close to the end of the early-learning phase, as desired. More result in section A.1 in Appendix shows that this also occurs for VOC 2012. + +![](images/9ffaeb935f25a76305c0298df07c556ab91fb5377491ac8dc0a7e42212135a02.jpg) + +![](images/aa35486e9bb67edde1c31876294cd994484e3fc75c4fbe035855df1e412ecb81.jpg) + +which we set to 0.9, and at every subsequent epoch. We only correct annotations for which the model output has confidence above a certain threshold $\tau$ , which we set to 0.8. A detailed description about the label correction is attached in the Appendix B. As shown in Table 2, adaptive label correction based on early learning improves segmentation models in the medical-imaging applications and WSSS, both on its own and in combination with multiscale-consistency regularization. Figure 4 shows some examples of annotation corrections (rightmost column). + +# 2.3. Multiscale consistency + +As we previously mentioned, model outputs after early-learning are used to correct noisy annotations. Therefore, the quality of model outputs is crucial for the effectiveness of the proposed method. Following a common procedure that has shown to result in more accurate segmentation from the outputs [31,58], we average model outputs corresponding to multiple rescaled copies of inputs to form the final segmentation, and use them to correct labels. Furthermore, we incorporate a regularization that imposes consistency of the outputs across multi-scales and is able to make averaged outputs more accurate (See the right graph of Figure 6). This idea is inspired by consistency regularizations, a popular concept in the semi-supervised learning literature [6, 15, 23, 26, 36, 43, 47] that encourages the model to produce predictions that are robust to arbitrary semantic-preserving spatial perturbations. In segmentation with noisy + +annotation, we introduce the consistency loss to provide an extra supervision signal to the network, preventing the network from only training on the noisy segmentation annotations, and overfitting to them. This regularization effect is also observed in the literature of classification with label noise [10, 28]. Since our method uses the network predictions to correct labels, it is crucial to avoid overfitting to the noisy segmentation. + +To be more specific, let $s$ be the number of scaling operations. In our experiments we set $s = 3$ (downscaling $\times 0.7$ , no scaling, and upscaling $\times 1.5$ ). We denote by $p_k(x)$ , $1 \leq k \leq s$ , the model predictions for an input $x$ rescaled according to these operations (see Figure 6). We propose to use a regularization term $\mathcal{L}_{\mathrm{Multiscale}}$ to promote consistency between $p_k(x)$ , $1 \leq k \leq s$ , and the average $q(x) = \frac{1}{s} \sum_{k=1}^{s} p_k(x)$ : + +$$ +\mathcal {L} _ {\text {M u l t i s c a l e}} (x) = - \frac {1}{s} \sum_ {k = 1} ^ {s} \mathrm {K L} \left(p _ {k} (x) \| q (x)\right), \tag {3} +$$ + +where KL denotes the Kullback-Leibler divergence. The term is only applied to the input $x$ where the maximum entry of $q(x)$ is above a threshold $\rho$ (equal to 0.8 for all experiments). The regularization is weighted by a parameter $\lambda$ (set to one in all experiments) and then combined with a cross-entropy loss based on the available annotations. As shown in Tables 2, with multiscale consistency regularization, adaptive label correction further improves segmentation performance in both medical-imaging applications and the + +![](images/f942dc3bd4cd3a4019ba2de83dab2443f7a06fa54f73d5875b2976cd7d80d531.jpg) + +![](images/30ac7d92823e31898c3a8870c29e85419b38a182bb277d5d3992284501b266d2.jpg) +Figure 6. Left: In the proposed multiscale-consistency regularization, rescaled copies of the same input (here upscaled $\times 1.5$ and downscaled $\times 0.7$ ) are fed into the segmentation model. The outputs $(\tilde{p}_1, p_2$ and $\tilde{p}_3)$ are rescaled to have the same dimensionality $(p_1, p_2$ and $p_3)$ . Regularization promotes consistency between these rescaled outputs and their elementwise average $q$ . Right: Multi-scale consistency regularization leads to more accurate corrected annotations (results on SegThor, results for VOC 2012 can be found in Figure 12). + +WSSS. + +# 3. Related work + +Classification from noisy labels. Early learning and memorization were first discovered in image classification from noisy labels [33]. Several methods exploit early learning to improve classification models by correcting the labels or adding regularization [33, 37, 46, 57, 60]. Here we show that segmentation from noisy labels also exhibits early learning and memorization. However, these dynamics are different for different semantic categories. ADELE exploits this to perform correction in a class-adaptive fashion. + +Segmentation from noisy annotations. Segmentation from noisy annotations is an important problem, especially in the medical domain [5]. Some recent works address this problem by explicitly taking into account systematic human labeling errors [63], and by modifying the segmentation loss to increase robustness [42, 50]. [35] propose to discover noisy gradient by collecting information from two networks connected with mutual attention. [34] shows that the network learns high-level spatial structures for fluorescence microscopy images. These structures are then leveraged as supervision signals to alleviate influence from wrong annotations. These methods mainly focus on improving the robustness by exploiting some setting-specific information (e.g. network architecture, dataset, requiring some samples with completely clean annotation). In contrast, we propose to study the learning dynamics of noisy segmentation and propose ADELE, which performs label correction by exploiting early learning. + +Weakly supervised semantic segmentation (WSSS). Recent methods for WSSS [3, 14, 61] are mostly based on the approach introduced by Ref. [24, 54], where a classification model is first used to produce pixel-level annotations [66], which are then used to train a segmentation model. These techniques mostly focus on improving the initial pixel-level annotations, by modifying the classifica + +tion model itself [29, 52, 53, 55], or by post-processing these annotations [2, 3, 49]. However, the resulting annotations are still noisy [62] (see Figure 4). Our goal is to improve the segmentation model by adaptively accounting for this noise. Similar approach to our method has been observed in object detection where network outputs are dynamically used for training [21]. In semantic segmentation, the work that is most similar to our label-correction strategy is [18], which is inspired by traditional seeded region-growing techniques [1]. This method estimates the foreground using an additional model [19], and initializes the foreground segmentation estimate with classification-based annotations. This estimate is used to train a segmentation model, which is then used to iteratively update the estimate. ADELE seeks to correct the initial annotations, as opposed to growing them, and does not need to identify the foreground estimate or an initial subset of highly-accurate annotations. + +# 4. Segmentation on Medical Images with Annotation Noise + +Segmentation from noisy annotations is a fundamental challenge in the medical domain, where available annotations are often hampered by human error [63]. Here, we evaluate ADELE on a segmentation task where the goal is to identify organs from computed tomography images. + +Settings. The dataset consists of 3D CT scans from the SegTHOR dataset [27]. Each pixel is assigned to the esophagus, heart, trachea, aorta, or background. We treat each 2D slice of the 3D scan as an example, resizing to $256 \times 256$ pixels. We randomly split the slices into a training set of 3638 slices, a validation set of 570 slices, and a test set of 580 slices. Each patient only appears in one of these subsets. We generate annotation noise by applying random degrees of dilation and erosion to the ground-truth segmentation labels, mimicking common human errors [63] (see Figure 4). In the main experiment, the noisy annotation is with a mIoU of 0.6 w.r.t the ground truth annotation. We further control the + +![](images/671b35722cb7f0b709fae8e3173b6c03021a8fd734a024494ea116a9a2d3b5d7.jpg) +Figure 7. The performance comparison of the baseline and ADELE on the test set of SegTHOR [27]. The model is trained on noisy annotations with various levels of corruption (measured in mIoU with the clean ground truth annotations). ADELE is able to improve the model performance across a wide range of corruption levels. + +degree of dilation and erosion to simulate noisy annotation sets with different noise levels for testing the model robustness. We corrupt all annotations in the training set, but not in the validation and test sets. Our evaluation metric is Mean Intersection over Union (mIoU). + +
BaselineADELE w/o class adaptiveADELE
Best val62.6±2.340.7±2.571.1±0.7
Max test63.3±2.040.7±2.471.2±0.6
Last Epoch59.1±1.340.5±2.370.8±0.7
+ +Table 1. The mIoU (%) comparison of the baseline and ADELE with or without class-adaptively correcting labels, on the test set of SegTHOR [27]. We report the test mIoU of the model that performs best on the validation set (Best Val), the test mIoU at the last epoch (Last Epoch), and the highest test performance during training (Max Test). We report mean and standard deviation after training the model with five realizations of noisy annotations. + +Results. For a fair comparison, we choose a UNet trained with multi-scale inputs as our baseline. We report the mIoU of the baseline and ADELE on the test set of SegTHOR dataset in Table 1. ADELE outperforms the baseline method at all three evaluation epochs. Moreover, correcting labels at the same time for all classes will have a detrimental effect on the performance. + +Impacts of noise levels. Figure 7 provides empirical evidence that ADELE is robust to a wide range of noises. The mIoU of noisy annotations (x-axis) indicates the correctness of the noisy annotations. Thus the smaller the mIoU shows the higher noise levels. The improvements achieved by ADELE are substantial when the noise levels are moderate. + +Ablation study for each part of ADELE. We perform an ablation study to understand how different parts of ADELE contribute to the final performance. From Table 2, we observe that the model trained with multiple rescaled versions of the input (illustrated in left graph of Figure 6) performs better than the model trained only with the original scale of the input. The proposed spatial consistency regularization further improves the performance. Most importantly, combining + +any of these methods with label correction would substantially improve the performance. ADELE, which combines label correction with the proposed regularization, achieves the best performance. We also include ablation studies for the hyperparameters $r$ , $\tau$ and $\rho$ in Appendix C. Additional segmentation results are provided in Appendix A.1. + +# 5. Noisy Annotations in Weakly-supervised Semantic Segmentation + +We adopt a prevailing pipeline for training WSSS (described in detail in Section 1), in which some pixel-wise annotations are generated using image level labels to supervise a segmentation network. These pixel-wise annotations are noisy. Therefore, we apply ADELE to this WSSS pipeline. + +We evaluate ADELE on a standard WSSS dataset – PASCAL VOC 2012 [13], which has 21 annotation classes (including background), and contains 1464, 1449 and 1456 images in the training, validation (val) and test sets respectively. Following [41,45,52,59,61,62], we use an augmented training set with 10582 images with annotations from [16]. + +Baseline Models. To demonstrate the broad applicability of our approach, we apply ADELE using pixel-level annotations generated by three popular WSSS models: AffinityNet [3], SEAM [52] and ICD [14], which do not rely on external datasets or external saliency maps. The annotations are produced by a classification model combined with the post-processing specified in [3, 14, 52]. We provide details on the training procedure in Section B in the Appendix. We use the same inference pipeline as SEAM [52], which includes multi-scale inference [3, 14, 52, 64] and CRF [25]. + +Comparison with the state-of-the-art. Table 3 compares the performance of the proposed method ADELE to state-of-the-art WSSS methods on PASCAL VOC 2012. ADELE improves the performance of AffinityNet [3], SEAM [52] and ICD [14] substantially on the validation and test sets. Moreover, ADELE combined with SEAM [52] and ICD [14] achieves state-of-the-art performance on both sets. Although it uses only image-level labels, ADELE outperforms state-of-the-art methods [20, 45, 59, 64] that rely on external saliency models [19]. To show that our method is complementary with other more advanced WSSS methods, we have conducted an experiment with a recent WSSS method NSROM [59], which uses external saliency models. ADELE+NSROM achieves mIoU of 71.6 and 72.0 on the validation and test set respectively, which is the SoTA for WSSS with ResNet segmentation backbone (see Appendix A.2). + +Figure 8 compares the performance of SEAM and the performance of ADELE combined with SEAM on the validation set separately for each semantic category. ADELE improves performance for most categories, with the exception of a few categories where the baseline model does not perform well (e.g. chair, bike). On Figure 1 and 9, we show some qualitative segmentation results from the validation + +
SegTHORPASCAL VOC 2012
Label correctionSingle scaleMultiscale input augmentationMultiscale consistency regularizationSingle scaleMultiscale input augmentationMultiscale consistency regularization
X58.860.762.564.565.566.7
65.269.872.265.667.369.3
+ +Table 2. Ablation study for ADELE on SegTHOR [27] and PASCAL VOC 2012 [13]. We report the mIoU achieved at the last epoch on the validation set for both dataset. Class-adaptive label correction mechanism achieves the best performance when combined with multi-scale consistency regularization. + +
Previous methodsADELE +
DSRG [18]ICD [14]SCE [7]AffinityNet [3]SSDD [41]SEAM [52]CONTA [62]AffinityNet [3]SEAM [52]ICD [14]
ResNet-101ResNet-38
Val61.464.166.161.764.964.566.164.869.368.6
Test63.264.365.963.765.565.766.765.568.868.9
+ +Table 3. Comparison with state-of-the-art methods on the Pascal VOC 2012 dataset using mIoU (%). The best and the best previous method performance under each set are highlighted in red and blue respectively. The version of CONTA [62] reported here is deployed combined with SEAM [52]. The results clearly show that ADELE outperforms other approaches. + +![](images/3edb77807532dcef64f6439bce7552b8d5aa8e5cf459caded93290b198a7fbe4.jpg) +Figure 8. Category-wise comparison of the IoU (\%) of SEAM [52] and SEAM combined with the proposed method ADELE on the validation set of PASCAL VOC 2012. We separate the categories based on IoUs for better visualization. + +![](images/e04cb74883ad4599c8fa8a7a010145d9254a4376d47a5a540f1dc49636d12565.jpg) + +![](images/ec4c5fd742c5b45fc92ba4ade7f022f6de682f23bf06741e22705ad67dc3831a.jpg) +Figure 9. Visualization of the segmentation results of both methods for several examples. ADELE fails to improve segmentation for the bicycle and chair due to highly structured segmentation errors. We set the background color to gray for ease of visualization. + +set. Figure 1 shows examples where ADELE successfully improves the SEAM segmentation. Figure 9 shows examples where it does not. In both the output of SEAM has highly structured segmentation errors: the prediction encompasses the bike but completely fails to capture its inner structure, and the chair is missclassified as a sofa. This supports the conclusion that ADELE provides less improvement when the baseline method performs poorly. + +# 6. Limitations + +The success of ADELE seems to rely to some extent on the quality of the initial annotations. When these annotations are of poor quality, ADELE may only produce a marginal improvement or even have negative impact (see Figure 8 and 9). An related limitation is that when the annotation noise is highly structured, early-learning may not occur, because there may not be sufficient information in the noisy annotations to correct the errors. In that case label correction based on early-learning will be unsuccessful. Illustrative examples are provided in the fifth and sixth rows of Figure 1), where the initial annotations completely encompass the bicycle, and completely missclassify the chair as a sofa. + +# 7. Conclusion + +In this work, we introduce a novel method to improve the robustness of segmentation models trained on noisy annotations. Inspired from the early-learning phenomenon, we proposed ADELE to boost the performance on the segmentation of thoracic organ, where noise is incorporated to resemble human annotation errors. Moreover, standard segmentation networks, equipped with ADELE, achieve the state-of-the-art results for WSSS on PASCAL VOC 2012. We hope that this work will trigger interest in the design of new forms of segmentation methods that provide robustness to annotation noise, as this is a crucial challenge in applications such as medicine. We also hope that the work will motivate further study of the early-learning and memorization phenomena in settings beyond classification. + +Acknowledgments SL, KL, WZ, and YS were partially supported by NSF NRT grant HDR-1922658. SL was partially supported by NSF grant DMS 2009752 and Alzheimer's Association grant AARG-NTF-21-848627. KL was partially supported by NIH grant (R01LM013316). YS was partially supported by NIH grant (P41EB017183, R21CA225175). CFG acknowledges support from NSF OAC 2103936. + +# References + +[1] Rolf Adams and Leanne Bischof. Seeded region growing. IEEE Transactions on Pattern Analysis and Machine Intelligence, 16(6):641-647, 1994. +[2] Jiwoon Ahn, Sunghyun Cho, and Suha Kwak. Weakly supervised learning of instance segmentation with inter-pixel relations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. +[3] Jiwoon Ahn and Suha Kwak. Learning pixel-level semantic affinity with image-level supervision for weakly supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. +[4] Devansh Arpit, Stanisław Jastrzebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien. A closer look at memorization in deep networks. In International Conference on Machine Learning, 2017. +[5] Andrew J Asman and Bennett A Landman. Formulating spatially varying performance in the statistical fusion framework. IEEE Transactions on Medical Imaging, 31(6):1326-1336, 2012. +[6] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, 2019. +[7] Yu-Ting Chang, Qiaosong Wang, Wei-Chih Hung, Robinson Piramuthu, Yi-Hsuan Tsai, and Ming-Hsuan Yang. Weakly-supervised semantic segmentation via sub-category exploration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. +[8] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Semantic image segmentation with deep convolutional nets and fully connected crfs. arXiv preprint arXiv:1412.7062, 2014. +[9] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4):834-848, 2017. +[10] Hao Cheng, Zhaowei Zhu, Xingyu Li, Yifei Gong, Xing Sun, and Yang Liu. Learning with instance-dependent label noise: A sample sieve approach. arXiv preprint arXiv:2010.02347, 2020. +[11] Jifeng Dai, Kaiming He, and Jian Sun. Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, 2015. +[12] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. IEEE, 2009. +[13] 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. + +[14] Junsong Fan, Zhaoxiang Zhang, Chunfeng Song, and Tieniu Tan. Learning integral objects with intra-class discriminator for weakly-supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. +[15] Geoff French, Timo Aila, Samuli Laine, Michal Mackiewicz, and Graham Finlayson. Semi-supervised semantic segmentation needs strong, high-dimensional perturbations. arXiv preprint arXiv:1906.01916, 2019. +[16] Bharath Hariharan, Pablo Arbeláez, Lubomir Bourdev, Subhransu Maji, and Jitendra Malik. Semantic contours from inverse detectors. In Proceedings of the IEEE International Conference on Computer Vision, 2011. +[17] Mohammad Havaei, Axel Davy, David Warde-Farley, Antoine Biard, Aaron Courville, Yoshua Bengio, Chris Pal, Pierre-Marc Jodoin, and Hugo Larochelle. Brain tumor segmentation with deep neural networks. Medical Image Analysis, 35:18-31, 2017. +[18] Zilong Huang, Xinggang Wang, Jiasi Wang, Wenyu Liu, and Jingdong Wang. Weakly-supervised semantic segmentation network with deep seeded region growing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. +[19] Huaizu Jiang, Jingdong Wang, Zejian Yuan, Yang Wu, Nanning Zheng, and Shipeng Li. Salient object detection: A discriminative regional feature integration approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2013. +[20] Peng-Tao Jiang, Qibin Hou, Yang Cao, Ming-Ming Cheng, Yunchao Wei, and Hong-Kai Xiong. Integral object mining via online attention accumulation. In Proceedings of the IEEE International Conference on Computer Vision, 2019. +[21] Zequn Jie, Yunchao Wei, Xiaojie Jin, Jiashi Feng, and Wei Liu. Deep self-taught learning for weakly supervised object localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. +[22] Eytan Kats, Jacob Goldberger, and Hayit Greenspan. A soft staple algorithm combined with anatomical knowledge. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 510-517. Springer, 2019. +[23] Jongmok Kim, Jooyoung Jang, and Hyunwoo Park. Structured consistency loss for semi-supervised semantic segmentation. arXiv preprint arXiv:2001.04647, 2020. +[24] Alexander Kolesnikov and Christoph H Lampert. Seed, expand and constrain: Three principles for weakly-supervised image segmentation. In Proceedings of the European Conference on Computer Vision. Springer, 2016. +[25] Philipp Krahenbuhl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge potentials. Advances in Neural Information Processing Systems, 24, 2011. +[26] Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In International Conference on Learning Representations, 2018. +[27] Zoé Lambert, Caroline Petitjean, Bernard Dubray, and Su Kuan. Segthor: Segmentation of thoracic organs at risk in ct images. In 2020 Tenth International Conference on Image + +Processing Theory, Tools and Applications (IPTA). IEEE, 2020. +[28] Junnan Li, Richard Socher, and Steven C.H. Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In International Conference on Learning Representations, 2020. +[29] Qizhu Li, Anurag Arnab, and Philip HS Torr. Weakly-and semi-supervised panoptic segmentation. In Proceedings of the European Conference on Computer Vision, 2018. +[30] Di Lin, Jifeng Dai, Jiaya Jia, Kaiming He, and Jian Sun. Scribblesup: Scribble-supervised convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. +[31] Di Lin, Yuanfeng Ji, Dani Lischinski, Daniel Cohen-Or, and Hui Huang. Multi-scale context intertwining for semantic segmentation. In Proceedings of the European Conference on Computer Vision, 2018. +[32] Kangning Liu, Yiqiu Shen, Nan Wu, Jakub Chledowski, Carlos Fernandez-Granda, and Krzysztof J Geras. Weakly-supervised high-resolution segmentation of mammography images for breast cancer diagnosis. In Medical Imaging with Deep Learning, 2021. +[33] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. Advances in Neural Information Processing Systems, 2020. +[34] Yaoru Luo, Guole Liu, Wenjing Li, Yuanhao Guo, and Ge Yang. Deep neural networks learn meta-structures to segment fluorescence microscopy images. arXiv preprint arXiv:2103.11594, 2021. +[35] Shaobo Min, Xuejin Chen, Zheng-Jun Zha, Feng Wu, and Yongdong Zhang. A two-stream mutual attention network for semi-supervised biomedical segmentation with noisy labels. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4578-4585, 2019. +[36] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(8):1979–1993, 2018. +[37] Scott E. Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. CoRR, abs/1412.6596, 2015. +[38] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2015. +[39] 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*, 2018. +[40] Jo Schlemper, Ozan Oktay, Liang Chen, Jacqueline Matthew, Caroline Knight, Bernhard Kainz, Ben Glocker, and Daniel Rueckert. Attention-gated networks for improving ultrasound scan plane detection. arXiv preprint arXiv:1804.05338, 2018. +[41] Wataru Shimoda and Keiji Yanai. Self-supervised difference detection for weakly-supervised semantic segmentation. In + +Proceedings of the IEEE International Conference on Computer Vision, 2019. +[42] Yucheng Shu, Xiao Wu, and Weisheng Li. Lvc-net: Medical image segmentation with noisy label based on local visual cues. In International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2019. +[43] Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685, 2020. +[44] Chunfeng Song, Yan Huang, Wanli Ouyang, and Liang Wang. Box-driven class-wise region masking and filling rate guided loss for weakly supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. +[45] Guolei Sun, Wenguan Wang, Jifeng Dai, and Luc Van Gool. Mining cross-image semantics for weakly supervised semantic segmentation. In Proceedings of the European Conference on Computer Vision. Springer, 2020. +[46] Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. +[47] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in Neural Information Processing Systems, 2017. +[48] Michael Treml, José Arjona-Medina, Thomas Unterthiner, Rupesh Durgesh, Felix Friedmann, Peter Schuberth, Andreas Mayr, Martin Heusel, Markus Hofmarcher, Michael Widrich, et al. Speeding up semantic segmentation for autonomous driving. In MLITS, NIPS Workshop, 2016. +[49] Paul Vernaza and Manmohan Chandraker. Learning random-walk label propagation for weakly-supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. +[50] Guotai Wang, Xinglong Liu, Chaoping Li, Zhiyong Xu, Ji- ugen Ruan, Haifeng Zhu, Tao Meng, Kang Li, Ning Huang, and Shaoting Zhang. A noise-robust framework for automatic segmentation of coid-19 pneumonia lesions from ct images. IEEE Transactions on Medical Imaging, 39(8):2653-2663, 2020. +[51] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. +[52] Yude Wang, Jie Zhang, Meina Kan, Shiguang Shan, and Xin Chen. Self-supervised equivariant attention mechanism for weakly supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. +[53] Yunchao Wei, Jiashi Feng, Xiaodan Liang, Ming-Ming Cheng, Yao Zhao, and Shuicheng Yan. Object region mining with adversarial erasing: A simple classification to semantic segmentation approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, July 2017. + +[54] Yunchao Wei, Xiaodan Liang, Yunpeng Chen, Xiaohui Shen, Ming-Ming Cheng, Jiashi Feng, Yao Zhao, and Shuicheng Yan. Stc: A simple to complex framework for weakly-supervised semantic segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(11):2314-2320, 2016. +[55] Yunchao Wei, Huaxin Xiao, Honghui Shi, Zequn Jie, Jiashi Feng, and Thomas S Huang. Revisiting dilated convolution: A simple approach for weakly-and semi-supervised semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. +[56] Zifeng Wu, Chunhua Shen, and Anton Van Den Hengel. Wider or deeper: Revisiting the resnet model for visual recognition. Pattern Recognition, 90:119-133, 2019. +[57] Xiaobo Xia, Tongliang Liu, Bo Han, Chen Gong, Nannan Wang, Zongyuan Ge, and Yi Chang. Robust early-learning: Hindering the memorization of noisy labels. In ICLR, 2021. +[58] Maoke Yang, Kun Yu, Chi Zhang, Zhiwei Li, and Kuiyuan Yang. Denseaspp for semantic segmentation in street scenes. In CVPR, 2018. +[59] Yazhou Yao, Tao Chen, Guosen Xie, Chuanyi Zhang, Fumin Shen, Qi Wu, Zhenmin Tang, and Jian Zhang. Non-salient region object mining for weakly supervised semantic segmentation. arXiv preprint arXiv:2103.14581, 2021. +[60] Kun Yi and Jianxin Wu. Probabilistic end-to-end noise correction for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019. +[61] Bingfeng Zhang, Jimin Xiao, Yunchao Wei, Mingjie Sun, and Kaizhu Huang. Reliability does matter: An end-to-end weakly supervised semantic segmentation approach. In Proceedings of the AAAI Conference on Artificial Intelligence, 2020. +[62] Dong Zhang, Hanwang Zhang, Jinhui Tang, Xiansheng Hua, and Qianru Sun. Causal intervention for weakly-supervised semantic segmentation. arXiv preprint arXiv:2009.12547, 2020. +[63] Le Zhang, Ryutaro Tanno, Mou-Cheng Xu, Chen Jin, Joseph Jacob, Olga Ciccarelli, Frederik Barkhof, and Daniel C Alexander. Disentangling human error from the ground truth in segmentation of medical images. arXiv preprint arXiv:2007.15963, 2020. +[64] Tianyi Zhang, Guosheng Lin, Weide Liu, Jianfei Cai, and Alex Kot. Splitting vs. merging: Mining object regions with discrepancy and intersection loss for weakly supervised semantic segmentation. In Proceedings of the European Conference on Computer Vision, 2020. +[65] 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, 2017. +[66] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. +[67] Tianyi Zhou, Shengjie Wang, and Jeff Bilmes. Robust curriculum learning: From clean label detection to noisy label self-correction. In International Conference on Learning Representations, 2020. \ No newline at end of file diff --git a/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/images.zip b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..67c3778091de37611fe258194607200dd42ab69c --- /dev/null +++ b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8b0a20de7be3ddc38e026e46433f0e98f07101a4b43223577202004af73707d +size 461182 diff --git a/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/layout.json b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4f7b6126311739ead5324080a7fe6cea6808e187 --- /dev/null +++ b/adaptiveearlylearningcorrectionforsegmentationfromnoisyannotations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc04306d802ccc94a0d3226411a5cab26cf732d4a8e5413c55f84bb3e043b1b1 +size 376840 diff --git a/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_content_list.json b/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1ba541f3d7fc8c3b879aa0085ebc3b4fe1a102e0 --- /dev/null +++ b/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:678eacf7936f9d787f903a4e360035b630f067b423e34f6ac52fd86915d5852d +size 88306 diff --git a/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_model.json b/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8b42bc3b0c24f02ca76b719890da1062db14af00 --- /dev/null +++ b/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c08b616a207de54f4f3433f32a94f5a33c5ecb3ba78f5c6bd718bbe578e01ec1 +size 113206 diff --git a/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_origin.pdf b/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ff1906e0649082575592589da8100f557b293d7f --- /dev/null +++ b/adaptivegatingforsinglephoton3dimaging/5413addd-46db-4b18-bc99-662abcf136f1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:236197dbad63cc0cdfaa55acbd8f7e7630f1b3a06df964bd6f6a8d5c5bf19404 +size 3941988 diff --git a/adaptivegatingforsinglephoton3dimaging/full.md b/adaptivegatingforsinglephoton3dimaging/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a5dfed1f74d99f10176230bd5d084f10ea31f348 --- /dev/null +++ b/adaptivegatingforsinglephoton3dimaging/full.md @@ -0,0 +1,405 @@ +# Adaptive Gating for Single-Photon 3D Imaging + +Ryan Po, Adithya Pediredla, Ioannis Gkioulekas + +Robotics Institute, Carnegie Mellon University + +# Abstract + +Single-photon avalanche diodes (SPADs) are growing in popularity for depth sensing tasks. However, SPADs still struggle in the presence of high ambient light due to the effects of pile-up. Conventional techniques leverage fixed or asynchronous gating to minimize pile-up effects, but these gating schemes are all non-adaptive, as they are unable to incorporate factors such as scene priors and previous photon detections into their gating strategy. We propose an adaptive gating scheme built upon Thompson sampling. Adaptive gating periodically updates the gate position based on prior photon observations in order to minimize depth errors. Our experiments show that our gating strategy results in significantly reduced depth reconstruction error and acquisition time, even when operating outdoors under strong sunlight conditions. + +# 1. Introduction + +Single-photon avalanche diodes (SPADs) are an emerging type of sensor [40] that possess single photon sensitivity. Combined with ultrafast pulsed lasers and picosecond-accurate timing electronics, SPADs are becoming increasingly popular in LiDAR systems for 3D sensing applications [15-17, 26]. SPAD-based LiDAR is used, e.g., on autonomous vehicles [2, 39] and consumer devices [1]. + +Unfortunately, SPAD-based LiDAR faces a fundamental challenge when operating under strong ambient light: background photons due to ambient light can block the detection of signal photons due to the LiDAR laser, an effect known as pile-up [6,12,15,16,31,33]. This effect becomes more pronounced as scene depth increases, and results in potentially very inaccurate depth estimation. + +A popular technique for mitigating pile-up is to use gating mechanisms that can selectively activate and deactivate the SPAD at specific time intervals relative to laser pulse emissions. Gating can help prevent the detection of early-arriving background photons, and thus favor the detection of late-arriving signal photons. Prior work has proposed different schemes for selecting gating times. A common such scheme is fixed gating, which uses for all laser pulses the same gating time (Figure 2(a)). If this gating time is close to the time-of-flight corresponding to scene depth, then fixed gating greatly increases the detection probability of signal photons, and thus depth estimation accuracy. Unfortunately, it is not always possible to know or approximate the time-of-flight of true depth ahead of time. + +More recently, Gupta et al. [15] proposed a uniform gating scheme, which uniformly distributes gate times for successive laser pulses across the entire depth range (Figure 2(b)). This helps "average-out" the effect of pile-up across all possible depths. Unfortunately, uniform gating does not take into account information about the true scene depth available from either prior knowledge, or from photon + +![](images/5ffda377edb12910af6b873538a71da8685b8b564e2144f8e0d02d0ef75aa87c.jpg) +Free-running mode (conventional) + +![](images/8e0b49fc4de12490efc3a8688546a3fe7630ae3461ccacd4a4b727b92ca3e034.jpg) +Our method (adaptive gating) +$\mathrm{RMSE} = 0.47\mathrm{cm}$ exposure $= 100\mu \mathrm{s}$ +Figure 1. Adaptive gating and adaptive exposure for depth imaging under sunlight. Adaptive gating reduces depth RMSE $\approx 3\times$ compared to conventional methods for the same acquisition time. When used in conjunction with adaptive exposure, our methods improves frame rate $3\times$ while still achieving lower RMSE. + +![](images/aaf9274f31b849c31ced736542287956a99d5e823ce38f35ab0bef12b23bd1ad.jpg) +$\mathrm{RMSE} = 0.16\mathrm{cm}$ exposure $= 100\mu \mathrm{s}$ + +![](images/09263cb5ffbc22152f2d998f592111b44bdc4d477a78ac94f52d5b6616c9742a.jpg) +Our method (adaptive exposure) +RMSE $= 0.37\mathrm{cm}$ exposure $= 33\mu \mathrm{s}$ + +detections during previous laser pulses. + +We propose a new gating scheme for SPAD-based LiDAR that we term adaptive gating. Two main building blocks underlie our gating scheme: First, a probabilistic model for the detection times recorded by SPAD-based LiDAR. Second, the classical Thompson sampling algorithm for sequential experimental design. By combining these two components, our proposed adaptive gating scheme is able to select gating sequences that, at any time during LiDAR acquisition, optimally take advantage of depth information available at that time, either from previous photon detections or from some depth prior. As a useful by-product of our framework, we introduce a variant of our adaptive gating scheme that additionally adapts exposure time, as necessary to achieve some target depth accuracy. We build a SPAD-based LiDAR prototype, and perform experiments both indoors, and outdoors under strong sunlight. Our experiments show that, compared to previous gating schemes, our adaptive gating scheme can reduce either depth estimation error or acquisition time (or both) by more than $50\%$ (Figure 1), and can take advantage of prior depth information from spatial regularization or RGB images. To ensure reproducibility and facilitate follow-up research, we provide our code and data on the project website [36]. + +# 2. Related work + +Post-processing for pile-up compensation. There is extensive prior work on post-processing techniques for compensating the effects of pile-up. Perhaps the best known is Coates' technique [12], and its generalizations [15, 16, 19, 33, 37, 38]. Coates' technique uses a probabilistic model for photon arrivals to estimate the true incident scene transient, from which we can estimate depth. Alternatively, Heide et al. [17] use the same probabilistic model to perform maximum likelihood estimation directly for depth. We discuss how these approaches relate to our work in Section 3. + +Gating schemes. Gating refers to the process of desynchronizing laser pulse emission and SPAD acquisition, and is commonly used to mitigate the effects of pile-up. The most common gating technique, known as fixed gating, uses a fixed delay between laser pulse emission and the start of SPAD acquisition, suppressing the detection of early-arriving photons. If the gating delay approximately matches the scene depth, fixed gating significantly reduces pile-up; otherwise, fixed gating will either have no significant effect, or may even suppress signal photons if the gating delay is after the scene depth. Gupta et al. [15] introduced a gating technique that uses uniformly-distributed delays spanning the entire depth range of the SPAD. This uniform gating technique helps mitigate pile-up, without requiring approximate knowledge of scene depth. Lastly, Gupta et al. [15] showed that it is possible to achieve uniformly-distributed delays between pulse emission and the start of SPAD acquisition by operating the SPAD without gating, at free-running mode [3, 13, 20, 37, 38]. We discuss fixed gating, uniform gating, and free-running mode in Section 4. + +Spatially-adaptive LiDAR. SPAD-based LiDAR typically uses beam steering to raster-scan individual pixel locations. Recent work has introduced several techniques that, instead of performing a full raster scan, adaptively select spatial locations to be scanned, in order to accelerate acquisition [8, 35, 49]. These techniques are complementary to ours: Whereas they adaptively sample spatial scan locations, our technique adaptively samples temporal gates. + +Other LiDAR technologies. There are several commercially-available technologies for light detection and ranging (LiDAR), besides SPAD-based LiDAR [39]. A common alternative in autonomous vehicles uses avalanche photodiodes (APDs) [25]. Compared to SPAD-based LiDAR, APD-based LiDAR does not suffer from pile-up, but has reduced sensitivity. Other LiDAR systems use continuous-wave time-of-flight (CWToF) cameras [14, 22, 46]. CWToF-based LiDAR is common in indoor 3D applications [4, 42, 45]. Unlike SPAD-based and APD-based LiDAR, CWToF-based LiDAR is sensitive to global illumination (multi-path interference). + +Other SPAD applications. SPADs find use in biophotonics applications [10], including fluorescence-l lifetime + +![](images/06c75aaec8b767fd2a7dd34ba029c7fa034499dfd6b4c27ef8e0ca22241d729f.jpg) +Figure 2. Previous and proposed gating schemes SPAD-based LiDAR. (a) Under strong ambient light, fixed gating leads to significant pile-up. (b) Uniform gating introduces uniformly-distributed gates and "averages out" the effect of pile-up. (c) Adaptive gating introduces a gating scheme that converges to the optimal gate, leading to a large number of detected signal photons. + +imaging microscopy [5,9,23,24,44], super-resolution microscopy [28], time-resolved Raman spectroscopy [28], and time-domain diffuse optical tomography [34,50]. Other applications include non-line-of-sight imaging [11,27,30,48], and high-dynamic-range imaging [18, 19]. + +# 3. Background on SPAD-based LiDAR + +We discuss necessary background on 3D imaging with single-photon avalanche diodes (SPADs). We consider single-pixel SPAD-based LiDAR systems with controllable gating. Such a system comprises: a) an ultrafast pulsed laser that can emit short-duration light pulses at a pulse-to-pulse frequency (or repetition rate) $f_{\mathrm{ptp}}$ ; b) a single-pixel SPAD that can detect individual incident photons; c) gating electronics that can activate the SPAD at some controllable time after pulse emissions; and d) time-correlation electronics that time photon detections relative to pulse emissions. We assume that both the gating and time-correlation electronics have the same temporal resolution $\Delta$ . Typical orders of magnitude are a few ps for pulse duration, hundreds of ps for $\Delta$ , and tens of MHz for $f_{\mathrm{ptp}}$ . The laser and SPAD are commonly coaxial, and rely on beam steering (e.g., through a galvo or MEMS mirror) to produce 2D depth estimates. Figure 1 shows a schematic of such a setup. + +At each scan point, the LiDAR uses time-correlated single photon counting (TCSPC) to estimate depth. This process comprises $P$ cycles, where at each cycle a sequence of steps takes place: At the start of the $p$ -th cycle, the laser emits a pulse. Gating activates the SPAD at gate time $g_{p}$ after the start of the cycle. The SPAD remains active until it detects the first incident photon (originating from either the laser pulse or ambient light) at detection time $s_p$ after the start of the cycle. It then enters a dead time, during which it cannot detect any photons. Once the dead time ends, the SPAD remains inactive until the next pulse emission, at which point the next cycle begins. We note that there can be multiple pulse emissions during a single cycle. + +After $P$ cycles, the LiDAR system returns the sequence of detection times $\bar{s} \equiv \{s_1, \dots, s_P\}$ , measured using the sequence of gate times $\bar{g} \equiv \{g_1, \dots, g_P\}$ .1 We discretize the time between pulse emissions into $\mathrm{T} \equiv \left\lfloor 1 / \Delta f_{\mathrm{pip}} \right\rfloor$ temporal bins, where the $\tau$ -th bin corresponds to the time interval $t \in [\tau \cdot \Delta, (\tau + 1) \cdot \Delta)$ since pulse emission. Then, the range of gate times is $g_p \in \{0, \dots, T - 1\}$ , and the range of detection times is $s_p \in \{g_p, \dots, g_p + T - 1\}$ .2 We describe a probabilistic model for $\bar{s}$ (Section 3.1), then see how to estimate depth from it (Section 3.2). + +# 3.1. Probabilistic model + +Our model closely follows the asynchronous image formation model of Gupta et al. [15].3 We first consider the incident photon histogram $I_{d}[\tau]$ , $\tau \in \{0, \dots, T - 1\}$ : for each bin $\tau$ , $I_{d}[\tau]$ is the number of photons incident on the SPAD during the time interval $t \in [\tau \cdot \Delta, (\tau + 1) \cdot \Delta)$ since the last pulse emission. The subscript $d$ indicates that the histogram depends on scene depth, as we explain shortly. We model each $I_{d}[\tau]$ as a Poisson random variable, + +$$ +I _ {d} [ \tau ] \sim \text {P o i s s o n} (\lambda_ {d} [ \tau ]), \tag {1} +$$ + +with rate equal to, + +$$ +\lambda_ {d} [ \tau ] = \Phi_ {\mathrm {b k g}} + \delta_ {\tau , d} \Phi_ {\mathrm {s i g}}. \tag {2} +$$ + +The function $\lambda_{d}[\tau], \tau \in \{0, \dots, T - 1\}$ is the scene transient [21, 32]. In Equation (2), the ambient flux $\Phi_{\mathrm{bkg}}$ is the average number of incident background photons (i.e., photons due to ambient light) at the SPAD during time $\Delta$ , which we assume to be time-independent. The signal flux $\Phi_{\mathrm{sig}}$ is the average number of incident signal photons (i.e., photons due to the laser). $\Phi_{\mathrm{bkg}}$ and $\Phi_{\mathrm{sig}}$ depend on scene reflectivity and distance, and the flux of ambient light (for $\Phi_{\mathrm{bkg}}$ ) and laser pulses (for $\Phi_{\mathrm{sig}}$ ). We refer to their ratio as the signal-to-background ratio $\mathrm{SBR} \equiv \frac{\Phi_{\mathrm{sig}}}{\Phi_{\mathrm{bkg}}}$ . $^4\delta_{i,j}$ is the Kronecker delta, and $d \equiv \left\lfloor \frac{2z}{c\Delta} \right\rfloor$ , where $z$ is the scene distance and $c$ is the speed of light. We use $d$ as a proxy for depth. + +We now consider the $p$ -th cycle of the LiDAR operation. Given that, the SPAD can only detect the first incident photon after activation, a detection time of $s_p$ means that: i) there were no incident photons during the time bins $\{g_p, s_p - 1\}$ ; and ii) there was at least one incident photon at time bin $s_p$ . The probability of this event occurring is: + +$$ +\begin{array}{l} \operatorname * {P r} \left\{S _ {p} = s _ {p} \mid G _ {p} = g _ {p}, D = d \right\} = \\ \Pr \left\{I _ {d} [ s _ {p} \bmod T ] \geq 1 \right\} \prod_ {s = g _ {P}} ^ {s _ {p} - 1} \Pr \left\{I _ {d} [ s \bmod T ] = 0 \right\}. \tag {3} \\ \end{array} +$$ + +To simplify notation, in the rest of the paper we use: + +$$ +p _ {d} ^ {g} (s) \equiv \Pr \left\{S = s \mid G = g, D = d \right\}. \tag {4} +$$ + +Using Equation (1), we can rewrite this probability as: + +$$ +p _ {d} ^ {g _ {p}} \left(s _ {p}\right) = \left(1 - e ^ {- \lambda_ {d} \left[ s _ {p} \bmod T \right]}\right) \prod_ {s = g _ {p}} ^ {s _ {p} - 1} e ^ {- \lambda_ {d} \left[ s \bmod T \right]}. \tag {5} +$$ + +Lastly, we define the detection sequence likelihood: + +$$ +\begin{array}{l} p _ {d} ^ {\bar {g}} (\bar {s}) \equiv \Pr \{S _ {1} = s _ {1}, \dots , S _ {P} = s _ {P} \mid \\ G _ {1} = g _ {1}, \dots , G _ {P} = g _ {P}, D = d \}. \tag {6} \\ \end{array} +$$ + +Given that the detection times are conditionally independent of each other given the gate times, we have + +$$ +p _ {d} ^ {\bar {g}} (\bar {s}) = \prod_ {p = 1} ^ {P} p _ {d} ^ {g _ {p}} \left(s _ {p}\right). \tag {7} +$$ + +Equations (2), (5), and (7) fully determine the probability of a sequence of detection times $\bar{s}$ , measured using a sequence of gate times $\bar{g}$ , assuming scene depth $d$ . + +Pile-up. We consider the case where we fix $g_{p} = 0$ for all cycles $p = 1, \ldots, P$ ; that is, gating always activates the SPAD at the start of a cycle. Then, Equation (5) becomes + +$$ +p _ {d} ^ {0} (\tau) = \left(1 - e ^ {- \lambda_ {d} [ \tau ]}\right) \prod_ {s = 0} ^ {\tau - 1} e ^ {- \lambda_ {d} [ s ]}, \tau \in 0, \dots , T. \tag {8} +$$ + +Equations (8) and (2) show that, when the ambient flux $\Phi_{\mathrm{bkg}}$ is large (e.g., outdoors operation), the probability of detecting a photon at a later time bin $\tau$ is small. This effect, termed pile-up [12, 16], can result in inaccurate depth estimates as scene depth increases. As we discuss in Section 4, carefully selected gate sequences $\bar{g}$ can mitigate pile-up. + +# 3.2. Depth estimation + +We now describe how to use the probabilistic model of Section 3.1 to estimate the scene depth $d$ from $\bar{s}$ and $\bar{g}$ . + +Coates' depth estimator. Gupta et al. [15, 16] adopt a two-step procedure for estimating depth. First, they form the maximum likelihood (ML) estimate of the scene transient given the detection and gate sequences: + +$$ +\left\{\hat {\lambda} [ \tau ] \right\} _ {\tau = 0} ^ {\mathrm {T} - 1} \equiv \underset {\{\lambda [ \tau ] \} _ {\tau = 0} ^ {\mathrm {T} - 1}} {\operatorname {a r g m a x}} \Pr \left\{\bar {s} \mid \bar {g}, \{\lambda [ \tau ] \} _ {\tau = 0} ^ {\mathrm {T} - 1} \right\}. \tag {9} +$$ + +The likelihood function in Equation (9) is analogous to that in Equations (5) and (7), with an important difference: Whereas Equation (5) assumes that the scene transient has the form of Equation (2), the ML problem of Equation (9) makes no such assumption and estimates an arbitrarily-shaped scene transient $\lambda[\tau]$ , $\tau \in \{0, \dots, T-1\}$ . Gupta et al. [15] derive a closed-form expression for the solution of Equation (9), which generalizes the Coates' estimate of the scene transient [12] for arbitrary gate sequences $\bar{g}$ . + +Second, they estimate depth as: + +$$ +\hat {d} _ {\text {C o a t e s}}, (\bar {s}, \bar {g}) \equiv \underset {\tau \in 0, \dots , \mathrm {T} - 1} {\operatorname {a r g m a x}} \hat {\lambda} [ \tau ]. \tag {10} +$$ + +This estimate assumes that the true underlying scene transient is well-approximated by the $\lambda_{d}$ model of Equation (2). We refer to $\hat{d}_{\mathrm{Coates}}\cdot (\bar{s},\bar{g})$ as the Coates' depth estimator. + +MAP depth estimator. If we assume that the scene transient has the form $\lambda_{d}$ of Equation (2), then Equations (5) and (7) directly connect the detection times $\bar{s}$ and depth $d$ , eschewing the scene transient. If we have available some prior probability $p_{\mathrm{prior}}(d)$ , $d \in \{0, \dots, T - 1\}$ on depth, we can use Bayes' rule to compute the depth posterior: + +$$ +p _ {\bar {s}} ^ {\bar {g}} (d) \equiv \frac {p _ {d} ^ {\bar {g}} (\bar {s}) p _ {\text {p r i o r}} (d)}{\sum_ {d ^ {\prime} = 0} ^ {\mathrm {T} - 1} p _ {d ^ {\prime}} ^ {\bar {g}} (\bar {s}) p _ {\text {p r i o r}} \left(d ^ {\prime}\right)}. \tag {11} +$$ + +We adopt maximum a-posteriori (MAP) estimation: + +$$ +\hat {d} _ {\mathrm {M A P}} (\bar {s}, \bar {g}) \equiv \underset {d \in \{0, \dots , \mathrm {T} - 1 \}} {\operatorname {a r g m a x}} p _ {\bar {s}} ^ {\bar {g}} (d). \tag {12} +$$ + +When using a uniform prior, the depth posterior $p_{\bar{s}}^{\bar{g}}(d)$ and the detection sequence likelihood $p_d^{\bar{g}}(\bar{s})$ are equal, and the MAP depth estimator $\hat{d}_{\mathrm{MAP}}(\bar{s},\bar{g})$ is also the ML depth estimator. We note that Heide et al. [17] proposed a similar MAP estimation approach, using a total variation prior that jointly constrains depth at nearby scan points. + +It is worth comparing the MAP $\hat{d}_{\mathrm{MAP}}(\bar{s},\bar{g})$ and Coates' $\hat{d}_{\mathrm{Coates}}(\bar{s},\bar{g})$ depth estimators. First, the two estimators have similar computational complexity. This is unsurprising, as the expressions for the depth posterior of Equation (11) and the Coates' estimate of Equation (9) are similar, both using the likelihood functions of Equations (5) and (7). A downside of the MAP estimator is that it requires knowing $\Phi_{\mathrm{bkg}}$ and $\Phi_{\mathrm{sig}}$ in Equation (2). In practice, we found it sufficient to estimate the background flux $\Phi_{\mathrm{bkg}}$ using a small percentage $(\approx 2\%)$ of the total SPAD cycles, and to marginalize the signal flux $\Phi_{\mathrm{sig}}$ using a uniform prior. + +Second, when using a uniform prior, the MAP estimator can provide more accurate estimates than the Coates' estimator, in situations where the scene transient model of Equation (2) is accurate. To quantify this advantage, we applied both estimators on measurements we simulated for different values of background and signal flux, assuming a uniform gating scheme [15]: As we see in Figure 3, the MAP estimator outperforms the Coates' estimator, especially when ambient flux is significantly higher than signal flux. By contrast, the Coates' estimator can be more accurate than the MAP estimator when the scene transient deviates significantly from Equation (2). This can happen due to multiple peaks (e.g., due to transparent or partial occluders) or indirect illumination (e.g., subsurface scattering, interreflections). In the supplement, we show that, when we combine the MAP estimator with our adaptive gating scheme of Section 4, we obtain correct depth estimates even in cases of such model mismatch. + +![](images/25e5d40463e2e43b49f80bfb24613bae0d2d4ef1add8b235ed030c564f985562.jpg) +(a) comparison of depth estimates + +![](images/cc9898d75f2ce117b50cb1baccd220551096cc94239ff5ff6d3a5a917f0babc3.jpg) +Figure 3. Relative performance of MAP estimator and Coates' estimator for depth recovery. (a) Bayesian estimator consistently outperforms Coates' estimator across different ambient and signal flux levels. (b) Example recovered transient using Coates' estimator illustrates case where bins with high variance estimates may be mistaken for true depth. (c) Depth posterior formed using the same photon observations as (b) shows a distinct peak at true depth. + +Third, the MAP estimator allows incorporating, through the prior, available side information about depth (e.g., from scans at nearby pixels, or from an RGB image [47]). Before we conclude this section, we mention that the MAP estimator is the Bayesian estimator with respect to the $\mathcal{L}_0$ loss [7]: + +$$ +\hat {d} _ {\mathrm {M A P}} (\bar {s}, \bar {g}) = \underset {d \in \{0, \dots , \mathrm {T} - 1 \}} {\operatorname {a r g m i n}} \mathbb {E} _ {d ^ {\prime} \sim p _ {\bar {s}} ^ {\bar {g}} \left(d ^ {\prime}\right)} \left[ \mathcal {L} _ {0} (d, d ^ {\prime}) \right], \tag {13} +$$ + +where + +$$ +\mathcal {L} _ {0} (x, y) \equiv \left\{ \begin{array}{l l} 0, & \text {i f} x = y. \\ 1, & \text {o t h e r w i s e .} \end{array} \right. \tag {14} +$$ + +We will use this fact in the next section, as we use the depth posterior and MAP estimator to develop adaptive gating. + +# 4. Adaptive Gating + +We now turn our attention to the selection of the gate sequence $\bar{g}$ . As we mentioned in Section 3, we aim to use gating to mitigate pile-up. We briefly review two prior gating schemes, then introduce our adaptive gating. + +Fixed gating. A fixed gating scheme uses the same gate for all $P$ TCSPC cycles, $g_{p} = g_{\mathrm{fixed}}$ , $p \in \{1, \dots, P\}$ . So long as this fixed gate is before the scene depth, $g_{\mathrm{fixed}} < d$ , it will prevent the detection of early-arriving photons due to ambient light, and thus increase the probability of detection of signal photons. For fixed gating to be effective, $g_{\mathrm{fixed}}$ should be close, and ideally equal to the true depth $d$ , as setting $\mathrm{s} g_{\mathrm{fixed}} = d$ maximizes the detection probability $p_{d}^{g_{\mathrm{fixed}}} (d)$ in Equation (5). Unfortunately, this requires knowing the true depth $d$ , or at least a reliable estimate thereof; such an estimate is generally available only after several cycles. + +Uniform gating. Gupta et al. [15] introduced a uniform gating scheme, which distributes gates uniformly across the entire depth range. If, for simplicity, we assume that the numbers of cycles and temporal bins are equal, $P = \mathrm{T}$ , then uniform gating sets $g_{p} = p$ , $p \in \{1, \dots, P\}$ . This maximizes the detection probability of each bin for a few cycles, and "averages out" pile-up effects. Compared to fixed gating, uniform gating does not require an estimate of the true depth $d$ . Conversely, uniform gating cannot take advantage of increasing information about $d$ as more cycles finish. + +![](images/677847b0fab7cbaa2bd8081ebbd53ce75ef94a4720d3759a70e5486a7b708755.jpg) +Figure 4. Evolution of gate selection using adaptive gating. Adaptive gating samples gate location based on the depth posterior formed using previous photon arrivals. Initial gates are approximately uniformly distributed, since depth posterior formed under lower number of photon observations have high variance. As more photons are observed, the depth posterior begins to form a sharper peak around true depth, causing gates selected through Thompson sampling to converge. + +Gupta et al. [15] propose using the SPAD in free-running mode without gating—the SPAD becomes active immediately after dead time ends—as an alternative to uniform gating. As they explain, using free-running mode also ensures that all bins have high probability of detection for a few cycles, similar to uniform gating; and provides additional advantages (e.g., maximizes SPAD active time, simplifies hardware). Therefore, we often compare against free-running mode instead of uniform gating. + +Desired behavior for adaptive gating. Before formally describing our adaptive gating scheme, we describe at a high-level the desired behavior for such a scheme. Intuitively, an ideal gating scheme should behave as a hybrid between fixed and uniform gating. During the early stages of Li-DAR operation (first few cycles) we have little to no information about scene depth—all temporal bins have approximately equal probability of being the true depth. Thus, a hybrid scheme should mimic uniform gating to explore the entire depth range. During the later stages of LiDAR operation (last few cycles), we have rich information about scene depth from the detection times recorded during preceding cycles—only one or few temporal bins have high probability of being the true depth. Thus, a hybrid scheme should mimic (near-fixed) gating, to maximize the detection probability of the few remaining candidate temporal bins. At intermediate stages of LiDAR operation, the hybrid scheme should progressively transition from uniform towards fixed gating, with this progression adapting from cycle to cycle to the information about scene depth available from previously-recorded detection times. + +Thompson sampling. To turn the above high-level specification into a formal algorithm, we use two building blocks. First, we use the probabilistic model of Section 3 to quantify the information we have about scene depth $d$ at each cycle. At the start of cycle $p$ , the LiDAR has recorded de + +tection times $\bar{s}_{p - 1}\equiv \{s_q,q = 1,\dots ,p\}$ using gate times $\bar{g}_{p - 1}\equiv \{g_q,q = 1,\ldots ,p\}$ . Then, the depth posterior $p_{\overline{s}_{p - 1}}^{\overline{g}_{p - 1}}(d)$ of Equation (11) represents all the information we have available about scene depth, from both recorded detection times and any prior information $(p_{\mathrm{prior}}(d))$ + +Second, we use Thompson sampling [43] to select the gate times $g_{p}$ . Thompson sampling is a classical algorithm for online experimental design: This is the problem setting of deciding on the fly parameters of a sequence of experiments, using at any given time available information from all experiments up to that time, in a way that maximizes some utility function [41]. Translating this into the context of SPAD-based LiDAR, the sequence of experiments is the $P$ TCSPC cycles; at the $p$ -th experiment, the parameter to be decided is the gate time $g_{p}$ . and the available information is the depth posterior $p_{\tilde{s}_{p - 1}}^{\bar{g}_{p - 1}}(d)$ ; lastly the utility function is the accuracy of the final depth estimate. Thompson sampling selects each gate $g_{p}$ by first sampling a depth hypothesis $\tilde{d}$ from the depth posterior $p_{\tilde{s}_{p - 1}}^{\bar{g}_{p - 1}}(d)$ , and then finding the gate time that maximizes a reward function $R(\tilde{d},g)$ . Algorithm 1 shows the resulting adaptive gating scheme (blue lines correspond to modifications we describe in Section 5). + +Reward function. We motivate our choice of reward function as follows: At cycle $p$ , Thompson sampling assumes that the true depth equals the depth hypothesis $\tilde{d}$ sampled from the depth posterior. Equivalently, Thompson sampling assumes that the detection time we will measure after cycle $p$ concludes is distributed as $s_p \sim p_{\tilde{d}}^{g_p}(s)$ (Equation (5)). As we aim to infer depth, we should select a gate $g_p$ such that, if we estimated depth from only the next detection $s_p$ , the resulting estimate would be in expectation close to the depth hypothesis $\tilde{d}$ we assume to be true. Formally, + +$$ +R (\tilde {d}, g) \equiv - \mathbb {E} _ {s \sim p _ {\tilde {d}} ^ {g} (s)} \left[ \mathcal {L} _ {0} (\hat {d} _ {\mathrm {M A P}} (s, g), \tilde {d}) \right]. \tag {15} +$$ + +Algorithm 1: Adaptive gating with adaptive exposure. +Input: max number of cycles $P$ , depth prior $p_{\mathrm{prior}}(d)$ . Output: depth estimate $\hat{d}_{\mathrm{MAP}}(\bar{s}_p,\bar{g}_p)$ +/* Initialization */ +1 $p\gets 0$ // initialize cycle counter +2 $p_{\bar{s}_0}^{\bar{g}_0}(d)\gets p_{\mathrm{prior}}(d)$ ; // initialize depth posterior +/* Acquisition */ +3 while $p\leq P$ do +4 $p\gets p + 1$ // start next cycle +5 $\tilde{d}\sim p_{\bar{s}_p - 1}^{\bar{g}_{p - 1}}(d)$ ; // sample depth hypothesis +6 $g_p\gets \tilde{d}$ ; // select gate (Proposition 1) +7 $s_p\gets \mathrm{TCSPC}(g_p)$ ; // record detection time +8 $p_{\bar{s}_p}^{\bar{g}_p}(d)\propto p_d^{g_p}(s_p)p_{\bar{s}_p - 1}^{\bar{g}_{p - 1}}(d)$ ; // update depth posterior +9 $\hat{d}_{\mathrm{MAP}}(\bar{s}_p,\bar{g}_p)\gets \mathrm{argmax}_d p_{\bar{s}_p}^{\bar{g}_p}(d)$ ; // update depth estimate +10 $L(\bar{s}_p,\bar{g}_p)\gets 1 - p_{\bar{s}_p}^{\bar{g}_p}\left(\hat{d}_{\mathrm{MAP}}(\bar{s}_p,\bar{g}_p)\right)$ ; // compute termination function (Equation (17)) +11 if $L(\bar{s}_p,\bar{g}_p) < \epsilon$ then +12 | break; // terminate acquisition +13 end +14 end +/* Final depth estimation */ +15 $\hat{d}_{\mathrm{MAP}}(\bar{s}_p,\bar{g}_p)\gets \mathrm{argmax}_d p_{\bar{s}_p}^{\bar{g}_p}(d)$ ; + +In Equation (15), to estimate depth from the expected detection time $s$ , we use the same MAP depth estimator of Equation (12) as for the final depth estimate $\hat{d}_{\mathrm{MAP}}(\bar{s},\bar{g})$ . The MAP depth estimator is optimal with respect to the $\mathcal{L}_0$ loss (Equation (13)), thus we use the same loss for the reward function. Selecting the gate $g_{p}$ requires maximizing the reward function $R(\tilde{d},g)$ , which we can do analytically. + +Proposition 1. The solution to the optimization problem + +$$ +\tilde {g} \equiv \underset {g \in \{0, \dots , \mathrm {T} - 1 \}} {\operatorname {a r g m a x}} R (\tilde {d}, g) \tag {16} +$$ + +for the reward function of Equation (15) equals $\tilde{g} = \tilde{d}$ . + +We provide the proof in the supplement. Intuitively, minimizing the expected $\mathcal{L}_0$ loss between the estimate $\hat{d}_{\mathrm{MAP}}(s,g)$ and the depth hypothesis $\tilde{d}$ is equivalent to maximizing the probability that $s \bmod T = \tilde{d}$ ; that is, we want to maximize the probability that a photon detection occurs at the same temporal bin as the depth hypothesis. We do this by setting the gate equal to the depth hypothesis, $g_{p} = \tilde{d}$ . + +Intuition behind Thompson sampling. Before concluding this section, we provide some intuition about how Thompson sampling works, and why it is suitable for adaptive + +gating. We can consider adaptive gating with Thompson sampling as a procedure for balancing the exploration-exploitation trade-off. Revisiting the discussion at the start of this section, fixed gating maximizes exploitation, by only gating at one temporal bin (or a small number thereof); conversely, uniform gating maximizes exploration, by gating uniformly across the entire depth range. During the first few cycles, adaptive gating maximizes exploration: as only few measurements are available, the depth posterior is flat, and depth hypotheses (and thus gate times) are sampled approximately uniformly as with uniform gating. As the number of cycles progresses, adaptive gating shifts from exploration to exploitation: additional measurements make the depth posterior concentrated around a few depth values, and gate times are sampled mostly among those. After a sufficiently large number of cycles, adaptive gating maximizes exploitation: the depth posterior peaks at a single depth, and gate times are almost always set to that depth, as in fixed gating. Figure 4 uses simulations to visualize this transition from exploration to exploitation. This behavior matches the one we set out to achieve at the start of this section. Lastly, we mention that Thompson sampling has strong theoretical guarantees for asymptotic optimality [41]; this suggests that our adaptive gating scheme balances the exploration-exploitation trade-off in a way that, asymptotically (given enough cycles), maximizes depth accuracy. + +# 5. Adaptive Exposure + +The accuracy of a depth estimate from SPAD measurements depends on three main factors: the exposure time (i.e., number of laser pulses, which also affects the number of cycles $P$ ), ambient flux $\Phi_{\mathrm{bkg}}$ , and signal-to-background ratio SBR. For a fixed exposure time, increasing ambient flux or lowering SBR will result in higher depth estimation uncertainty. Even under conditions of identical ambient flux and SBR, the required exposure time to reach some uncertainty threshold can vary significantly, because of the random nature of photon arrivals and detections. + +In a generic scene, different pixels can have very different ambient flux or SBR (e.g., due to cast shadows, varying reflectance, and varying depth). Therefore, using a fixed exposure time will result in either a lot of wasted exposure time on pixels for which shorter exposure times are sufficient, or high estimation uncertainty in pixels that require a longer exposure time. Ideally, we want to adaptively extend or shorten the per-pixel exposure time, depending on how many TCSPC cycles are needed to reach some desired depth estimation uncertainty threshold. + +Adaptive gating with adaptive exposure. The adaptive gating scheme of Section 4 lends itself to a modification that also adapts the number of cycles $P$ , and thus exposure time. In Algorithm 1, we can terminate the while loop early at a cycle $p \leq P$ , if the depth posterior $p^{\bar{g}_p}(\bar{d})$ becomes concentrated enough that we expect depth estimation to have + +![](images/61ae2e80d092d87407b967b96738c9e3e992b0c98b6a0d9742aa30d5abb90cec.jpg) +Figure 5. Effect of SBR. The "Stairs" scene has regions with significant variations in SBR. Far stairs have lower SBR than nearby stairs due to inverse square falloff. Our adaptive gating scheme achieves lower RMSE than the free-running mode at all the SBRs. low error. Formally, we define a termination function as the expected error with respect to the depth posterior: + +$$ +\begin{array}{l} L \left(\bar {s} _ {p}, \bar {g} _ {p}\right) \equiv \mathbb {E} _ {d \sim p _ {\bar {s} _ {p}} ^ {\bar {g} _ {p}} (d)} \left[ \mathcal {L} _ {0} \left(\hat {d} _ {\mathrm {M A P}} \left(\bar {s} _ {p}, \bar {g} _ {p}\right), d\right) \right] (17) \\ = 1 - p _ {\bar {s} _ {p}} ^ {\bar {g} _ {p}} \left(\hat {d} _ {\mathrm {M A P}} \left(\bar {s} _ {p}, \bar {g} _ {p}\right)\right). (18) \\ \end{array} +$$ + +In Equation (17), we use the same MAP depth estimator as for the final depth estimate $\hat{d}_{\mathrm{MAP}}(\bar{s},\bar{g})$ , and the $\mathcal{L}_0$ loss for which the MAP estimator is optimal (Equation (13)). These choices are analogous to our choices for the definition of the reward function $R(\tilde{d},g)$ in Equation (15). At the end of each cycle $p$ , we check whether the termination function $L(\bar{s}_p,\bar{g}_p)$ is smaller than some threshold, and terminate acquisition if it is true. In Algorithm 1, we show in blue how we modify our original adaptive gating algorithm to include this adaptive exposure procedure. + +# 6. Experimental Results + +We show comparisons using real data from an experimental prototype in the paper, and additional comparisons on real and simulated data in the supplement. Throughout the paper, we use root mean square error (RMSE) as the performance metric, as is common in prior work. In the supplement, we additionally report loss error metrics; this makes performance improvements more pronounced, as our technique optimizes loss error (Section 4). Our code and data are available on the project website [36]. + +Prototype. Our SPAD-based LiDAR prototype comprises a fast-gated SPAD (Micro-photon Devices), a $532\mathrm{nm}$ picosecond pulsed laser (NKT Photonics NP100-201-010), a TCSPC module (PicoHarp 300), and a programmable picosecond delayer (Micro-photon Devices). We operated the SPAD in triggered mode (adaptive gating) or free-running mode, with the programmable dead time set to $81~\mathrm{ns}$ . We set the laser pulse frequency to $10\mathrm{MHz}$ , with measurements discretized to 500 bins (100 ps resolution). The raster scan resolution is $128\times 128$ , and acquisition time per scan point is $100\mu \mathrm{s}$ , for a total acquisition time of $1.6\mathrm{s}$ . We note that, if gate selection happens during dead time—easily achievable with optimized compute hardware—our procedure does not introduce additional acquisition latency. + +Outdoor scenes. Outdoor experiments (Figures 1 and 5) + +were under direct sunlight (no shadows or clouds) around noon (11 am to 2 pm in the United States), with an estimated background strength of 0.016 photons per pulse per bin. Figure 1 shows a set of 3D reconstructions for the "Leaf" scene, captured at noon with a clear sky and under direct sunlight. Figures 1(a)-(b) show depth reconstructions using free-running mode and adaptive gating under fixed exposure times: our method reduces RMSE by around $3 \times$ . Figure 1(c) shows the depth reconstruction using adaptive gating combined with adaptive exposure. This combination reduces both RMSE and exposure time (by around $3 \times$ ) compared to free-running mode. Figure 5 shows depth reconstructions for the "Stairs" scene, captured under the same sunlight conditions. This scene has significant SBR variations, and we observe that adaptive gating outperforms free-running mode in all SBR regimes. + +Indoor scenes. Figure 6 shows reconstructions of the "Horse" scene, an indoor scene of a horse bust placed in a light booth. Under fixed exposure time, our method achieves $35\%$ lower RMSE compared to free-running mode. We note that RMSE improvement is less pronounced than in outdoor scenes. As the indoor scene has significantly higher SBR, this suggests that adaptive gating offers a bigger advantage over free-running mode at low SBRs. + +We next examine the effectiveness of employing external priors. In Figure 6(c)-(d), we use a "flatness" prior: at each pixel we use a Gaussian prior centered at the depth measured at the previous scanned pixel. Leveraging this simple prior leads to a $70\%$ decrease in exposure time, and a $60\%$ decrease in RMSE compared to adaptive gating without the use of a depth prior. We note, however, that this prior is not effective at pixels corresponding to large depth discontinuities. We can see this in Figure 6(e), which visualizes relative exposure time reduction at different pixels. + +In Figure 7, we use a monocular depth estimation algorithm [47] to obtain depth estimates and uncertainty values from an RGB image of the "Office" scene. We incorporate the monocular prior in our adaptive gating method, and notice a $50\%$ reduction in RMSE for fixed exposure times, and $45\%$ lower total acquisition time using adaptive exposure. + +# 7. Limitations and Conclusion + +Active time. As Gupta et al. [15] explain, using free-running mode provides similar advantages as uniform gating, and at the same time maximizes the time during which the SPAD is active—and thus maximizes photon detections. Adaptive gating, likewise, also results in reduced active time compared to free-running mode. However, experimentally we found that, despite the reduced photon detections, our adaptive gating scheme still results in improved depth accuracy for all practical dead time values (see Section 6 and additional experiments evaluating the effect of active and dead time in the supplement). + +Hardware considerations. Our adaptive gating scheme re + +![](images/2419c4ad3fe271b0d5842f988a33406b5a6212b761d7205f58b1ba969ae822e8.jpg) +Figure 6. 3D scanning under indoor illumination. A horse bust under ambient light of $\phi_{\mathrm{bkg}} \approx 0.01$ . The scene does not result in a substantial pile-up like the outdoor scenes. Adaptive gating still shows better depth reconstruction than the free-running mode. + +![](images/f1a61433f34051efaa7d9fb6b7187f5ead5fbba8242373fc84d60a7c3e7bfda5.jpg) +RMSE $= 0.32\mathrm{cm}$ +Exposure $= 400\mu \mathrm{s}$ + +![](images/28b2707a206a683f84d2117e93614607693386861f79be89209c7fc693b84399.jpg) +(b) Adaptive gating with fixed exposure +RMSE $= 0.21\mathrm{cm}$ +Exposure $= 400\mu \mathrm{s}$ + +![](images/9f0f020b77995eae014bdd1a65960c03572a0149808bfc549ecb04e321b653f4.jpg) +(c) Adaptive exposure +RMSE $= 1.92\mathrm{cm}$ +Exposure $= 49\mu \mathrm{s}$ + +![](images/52a2c920af91af24df52f86c395e38b03ac7fa83e6ae877a19ad5508b3a92c93.jpg) +(d) Adaptive exposure with prior +$\mathrm{RMSE} = 0.78\mathrm{cm}$ +Exposure $= 14\mu \mathrm{s}$ + +![](images/613a9ed2ac93d5d1d58706aaf58db2fcd97a40228f1edcf336bbf065d49cb915.jpg) +(e) Relative +exposure times + +![](images/c9fb64ca9b2816c3a10c1b277b3ef4ccbf30fadec1f250878abbc96cad5ab11f.jpg) + +![](images/53887dcb8732c65235a0a5b28136ebfc6cd92f89085be5a4e06c5e2aa5ebf31a.jpg) +(a) RGB image + +![](images/99cfb6c5bf9e7cf28538ef9089e79e0cbdcef26a79f9b93a533312c836505b7b.jpg) +(b) Fixed exposure without prior +RMSE $= 61\mathrm{cm}$ +Exposure $= 100\mathrm{ns}$ + +![](images/2cc9d0088857042ebd9811da100b2dd27b5758144036807ed9f98396d39ba21b.jpg) +(c) Fixed exposure +with prior +RMSE $= 28\mathrm{cm}$ +Exposure $= 100\mathrm{ns}$ + +![](images/ea32cbf7c8dbe5b6f24fe4447603e3efb612359511db24b8ced4c2a22fa6bf92.jpg) +(d) Adaptive exposure +without prior +RMSE $= 41\mathrm{cm}$ +Exposure $= 62\mathrm{ns}$ + +![](images/823ff7f8408193037d308a75d584d72e6d1b63ee6d9961ba928c5735abc82788.jpg) +(e) Adaptive exposure +with prior +RMSE $= 20\mathrm{cm}$ +Exposure $= 34\mathrm{ns}$ + +![](images/362e88e6c1eb2dad97578622fb0da34485f257018214435527329f6f5113a1cf.jpg) +Figure 7. Adaptive gating can incorporate external depth priors. We compute a depth prior using neural-network based monocular depth estimation technique [47]. Incorporating the prior improves both the fixed exposure and adaptive exposure schemes. + +requires using a SPAD with a controllable gate that can be reprogrammed from pulse to pulse. We implemented this using the same gated SPAD hardware as Gupta et al. [15] did for their uniform gating scheme. The main additional hardware requirements are electronics that can produce the gate control signals at $f_{\mathrm{ptp}}$ frequency and $\Delta$ resolution. Both gating schemes require considerably more expensive hardware compared to free-running mode operation, which only requires an ungated SPAD. Whether the improved depth accuracy performance justifies the increased hardware cost and complexity is an application-dependent consideration. + +Our adaptive exposure scheme additionally requires beam steering hardware that can on the fly change the scan time for any given pixel. Unfortunately, currently this is only possible at the cost of significantly slower overall scanning: Current beam steering solutions for LiDAR must operate in resonant mode to enable kHz scanning rates, which in turn means that the per-pixel scan times are predetermined by the resonant scan pattern [35]. Thus, using adaptive exposure requires operating beam steering at nonresonant mode. This introduces scanning delays that likely outweigh the gains from reduced per-pixel scan times, resulting in an overall slower scanning rate. + +Lastly, recent years have seen the emergence of two-dimensional SPAD arrays [29]. Current prototypes support a shared programmable gate among all pixels. Adaptive + +gating would require independent per-pixel programmable gates, which can be implemented at increased fabrication cost, and likely decreased sensitive area. As SPAD arrays time-multiplex acquisition across pixels, adaptive exposure does not offer an obvious advantage in this context. + +Conclusion. We introduced an adaptive gating scheme for SPAD-based LiDAR that mitigates the effects of pile-up under strong ambient light conditions. Our scheme uses a Thompson sampling procedure to select a gating sequence that takes advantage of information available from previously-measured laser pulses, to maximize depth estimation accuracy. Our scheme can also adaptively adjust exposure time per-pixel, as necessary to achieve a desired expected depth error. We showed that our scheme can reduce both depth error and exposure time by more than $100\%$ compared to previous SPAD-based LiDAR techniques, including when operating outdoors under strong sunlight. + +Acknowledgments. We thank Akshit Dave, Ankit Raghuram, and Ashok Veeraraghavan for providing the high-power laser for experiments and invaluable assistance in its use; as well as Matthew O'Toole, David Lindell, and Dorian Chan for help with the SPAD sensor. This work was supported by NSF Expeditions award 1730147, NSF CAREER award 2047341, DARPA REVEAL contract HR0011-16-C0025, and ONR DURIP award N00014-16-1-2906. Ioannis Gkioulekas is supported by a Sloan Research Fellowship. + +# References + +[1] The iPhone 12 - LiDAR At Your Fingertips. Forbes (12 November 2020). https://www.forbes.com/sites/sabbirrangwala/2020/11/12/theiphone-12lidar-at-your-fingertips/. Accessed: 2021-11-17. 1 +[2] Lidar drives forwards. Nature Photonics, 12:441, 2018. 1 +[3] Giulia Acconcia, A Cominelli, Massimo Ghioni, and Ivan Rech. Fast fully-integrated front-end circuit to overcome pile-up limits in time-correlated single photon counting with single photon avalanche diodes. Optics express, 26 12:15398-15410, 2018. 2 +[4] Dean Anderson, Herman Herman, and Alonzo Kelly. Experimental characterization of commercial flash laradar devices. In International Conference of Sensing and Technology, volume 2, pages 17-23. CiteSeer, 2005. 2 +[5] Christopher Barsi, Refael Whyte, Ayush Bhandari, Anshuman Das, Achuta Kadambi, Adrian A Dorrington, and Ramesh Raskar. Multi-frequency reference-free fluorescence lifetime imaging using a time-of-flight camera. In Biomedical Optics, pages BM3A-53. Optical Society of America, 2014. 2 +[6] Wolfgang Becker. Advanced time-correlated single photon counting applications. Advanced Time-Correlated Single Photon Counting Applications, 2015. 1 +[7] James O Berger. Statistical decision theory and Bayesian analysis. Springer Science & Business Media, 2013. 4 +[8] Alexander W Bergman, David B Lindell, and Gordon Wetzstein. Deep adaptive lidar: End-to-end optimization of sampling and depth completion at low sampling rates. In 2020 IEEE International Conference on Computational Photography (ICCP), pages 1-11. IEEE, 2020. 2 +[9] Ayush Bhandari, Christopher Barsi, and Ramesh Raskar. Blind and reference-free fluorescence lifetime estimation via consumer time-of-flight sensors. Optica, 2(11):965-973, 2015. 2 +[10] Claudio Bruschini, Harald Homulle, Ivan Michel Antolovic, Samuel Burri, and Edoardo Charbon. Single-photon avalanche diode imagers in biophotonics: review and outlook. Light: Science & Applications, 8(1):1-28, 2019. 2 +[11] Mauro Buttafava, Jessica Zeman, Alberto Tosi, Kevin W. Eliceiri, and Andreas Velten. Non-line-of-sight imaging using a time-gated single photon avalanche diode. Optics express, 23 16:20997-1011, 2015. 2 +[12] P. B. Coates. The correction for photon 'pile-up' in the measurement of radiative lifetimes. Journal of Physics E: Scientific Instruments, 1:878-879, 1968. 1, 2, 3 +[13] A Cominelli, Giulia Acconcia, P. Peronio, Massimo Ghioni, and Ivan Rech. High-speed and low-distortion solution for time-correlated single photon counting measurements: A theoretical analysis. The Review of scientific instruments, 88 12:123701, 2017. 2 +[14] S Burak Gokturk, Hakan Yalcin, and Cyrus Bamji. A time-of-flight depth sensor-system description, issues and solutions. In 2004 conference on computer vision and pattern recognition workshop, pages 35-35. IEEE, 2004. 2 + +[15] Anant Gupta, Atul Ingle, and Mohit Gupta. Asynchronous single-photon 3d imaging. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 7908-7917, 2019. 1, 2, 3, 4, 5, 7, 8 +[16] Anant Gupta, Atul Ingle, Andreas Velten, and Mohit Gupta. Photon-flooded single-photon 3d cameras. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6763-6772, 2019. 1, 2, 3 +[17] Felix Heide, Steven Diamond, David B. Lindell, and Gordon Wetzstein. Sub-picosecond photon-efficient 3d imaging using single-photon sensors. Scientific Reports, 8, 2018. 1, 2, 3, 4 +[18] Atul Ingle, Trevor Seets, Mauro Buttafava, Shantanu Gupta, Alberto Tosi, Mohit Gupta, and Andreas Velten. Passive inter-photon imaging. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8585-8595, 2021. 2 +[19] Atul Ingle, Andreas Velten, and Mohit Gupta. High flux passive imaging with single-photon sensors. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6753-6762, 2019. 2 +[20] Sebastian Isbaner, Narain Karedla, Daja Ruhlandt, Simon Christoph Stein, Anna M. Chizhik, Ingo Gregor, and Jörg Enderlein. Dead-time correction of fluorescence lifetime measurements and fluorescence lifetime imaging. Optics express, 24 9:9429-45, 2016. 2 +[21] Adrian Jarabo, Julio Marco, Adolfo Munoz, Raul Buisan, Wojciech Jarosz, and Diego Gutierrez. A framework for transient rendering. ACM Transactions on Graphics (ToG), 33(6):1-10, 2014. 3 +[22] Achuta Kadambi, Jamie Schiel, and Ramesh Raskar. Macroscopic interferometry: Rethinking depth estimation with frequency-domain time-of-flight. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 893-902, 2016. 2 +[23] Joseph R. Lakowicz, Henryk Szmacinski, Kazimierz Nowaczyk, Klaus W. Berndt, and Michael Johnson. Fluorescence lifetime imaging. Analytical biochemistry, 202(2):316-330, 1992. 2 +[24] Jongho Lee, Jenu Varghese Chacko, Bing Dai, Syed Azer Reza, Abdul Kader Sagar, Kevin W Eliceiri, Andreas Velten, and Mohit Gupta. Coding scheme optimization for fast fluorescence lifetime imaging. ACM Transactions on Graphics (TOG), 38(3):1-16, 2019. 2 +[25] You Li and Javier Ibanez-Guzman. Lidar for autonomous driving: The principles, challenges, and trends for automotive lidar and perception systems. IEEE Signal Processing Magazine, 37(4):50-61, 2020. 2 +[26] David B. Lindell, Matthew O'Toole, and Gordon Wetzstein. Single-photon 3d imaging with deep sensor fusion. ACM Transactions on Graphics (TOG), 37:1-12, 2018. 1 +[27] Xiaochun Liu, Ibón Guillén, Marco La Manna, Ji Hyun Nam, Syed Azer Reza, Toan Huu Le, Adrian Jarabo, Diego Gutierrez, and Andreas Velten. Non-line-of-sight imaging using phasor-field virtual wave optics. Nature, 572(7771):620-623, 2019. 2 + +[28] Francesca Madonini and Federica Villa. Single photon avalanche diode arrays for time-resolved raman spectroscopy. Sensors, 21(13):4287, 2021. 2 +[29] Kazuhiro Morimoto, Andrei Ardelean, Ming-Lo Wu, Arin Can Ulku, Ivan Michel Antolovic, Claudio Bruschini, and Edoardo Charbon. Megapixel time-gated spad image sensor for 2d and 3d imaging applications. Optica, 7(4):346–354, 2020. 8 +[30] Matthew O'Toole, David B. Lindell, and Gordon Wetzstein. Confocal non-line-of-sight imaging based on the light-cone transform. Nature, 555:338-341, 2018. 2 +[31] Agata M. Pawlikowska, Abderrahim Halimi, Robert A. Lamb, and Gerald S. Buller. Single-photon three-dimensional imaging at up to 10 kilometers range. Optics express, 25 10:11919-11931, 2017. 1 +[32] Adithya Pediredla, Ashok Veeraraghavan, and Ioannis Gkioulekas. Ellipsoidal path connections for time-gated rendering. ACM Transactions on Graphics (TOG), 38(4):1-12, 2019. 3 +[33] Adithya Kumar Pediredla, Aswin C. Sankaranarayanan, Mauro Buttafava, Alberto Tosi, and Ashok Veeraraghavan. Signal processing based pile-up compensation for gated single-photon avalanche diodes. arXiv: Instrumentation and Detectors, 2018. 1, 2 +[34] Antonio Pifferi, Davide Contini, Alberto Dalla Mora, Andrea Farina, Lorenzo Spinelli, and Alessandro Torricelli. New frontiers in time-domain diffuse optics, a review. Journal of biomedical optics, 21(9):091310, 2016. 2 +[35] Francesco Pittaluga, Zaid Tasneem, Justin Folden, Brevin Tilmon, Ayan Chakrabarti, and Sanjeev J Koppal. Towards a mems-based adaptive lidar. In 2020 International Conference on 3D Vision (3DV), pages 1216-1226. IEEE, 2020. 2, 8 +[36] Ryan Po, Adithya Pediredla, and Ioannis Gkioulekas. Project website, 2022. https://imaging.cs.cmu.edu/adaptive_gating.1,7 +[37] Joshua Rapp, Yanting Ma, Robin M. A. Dawson, and Vivek K Goyal. Dead time compensation for high-flux ranging. IEEE Transactions on Signal Processing, 67:3471-3486, 2019. 2, 3 +[38] Joshua Rapp, Yanting Ma, Robin M. A. Dawson, and Vivek K Goyal. High-flux single-photon lidar. Optica, 8(1):30-39, Jan 2021. 2, 3 +[39] Joshua Rapp, Julian Tachella, Yoann Altmann, Stephen McLaughlin, and Vivek K Goyal. Advances in single-photon lidar for autonomous vehicles: Working principles, challenges, and recent advances. IEEE Signal Processing Magazine, 37(4):62-71, 2020. 1, 2 +[40] Alexis Rochas. Single photon avalanche diodes in cmos technology. 2003. 1 +[41] Daniel Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, and Zheng Wen. A tutorial on Thompson sampling. arXiv preprint arXiv:1707.02038, 2017. 5, 6 +[42] Ryuichi Tadano, Adithya Kumar Pediredla, and Ashok Veeraraghavan. Depth selective camera: A direct, on-chip, programmable technique for depth selectivity in photography. In Proceedings of the IEEE International Conference on Computer Vision, pages 3595-3603, 2015. 2 + +[43] William R Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285-294, 1933. 5 +[44] Erik B van Munster and Theodorus WJ Gadella. Fluorescence lifetime imaging microscopy (flim). Microscopy techniques, pages 143-175, 2005. 2 +[45] Jarrett Webb and James Ashley. Beginning kinect programming with the microsoft kinect SDK. Apress, 2012. 2 +[46] Refael Whyte, Lee Streeter, Michael J Cree, and Adrian A Dorrington. Application of lidar techniques to time-of-flight range imaging. Applied optics, 54(33):9654-9664, 2015. 2 +[47] Zhihao Xia, Patrick Sullivan, and Ayan Chakrabarti. Generating and exploiting probabilistic monocular depth estimates. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 62-71, 2020. 4, 7, 8 +[48] Shumian Xin, Sotiris Nousias, Kiriakos N. Kutulakos, Aswin C. Sankaranarayanan, Srinivasa G. Narasimhan, and Ioannis Gkioulekas. A theory of fermat paths for non-line-of-sight shape reconstruction. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6793-6802, 2019. 2 +[49] Taiki Yamamoto, Yasutomo Kawanishi, Ichiro Ide, Hiroshi Murase, Fumito Shinmura, and Daisuke Deguchi. Efficient pedestrian scanning by active scan lidar. In 2018 International Workshop on Advanced Image Technology (IWAIT), pages 1-4. IEEE, 2018. 2 +[50] Yongyi Zhao, Ankit Raghuram, Hyun Kim, Andreas Hielscher, Jacob T Robinson, and Ashok Narayanan Veeraraghavan. High resolution, deep imaging using confocal time-of-flight diffuse optical tomography. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. 2 \ No newline at end of file diff --git a/adaptivegatingforsinglephoton3dimaging/images.zip b/adaptivegatingforsinglephoton3dimaging/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7bc57ce29504a762b8e1e7e21260e36a017d13e8 --- /dev/null +++ b/adaptivegatingforsinglephoton3dimaging/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15f9770e4a16f4574c1fb0f8f7af08f6602f9f4caf6283da741a2bcb67e4ce5d +size 480988 diff --git a/adaptivegatingforsinglephoton3dimaging/layout.json b/adaptivegatingforsinglephoton3dimaging/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..631c0ba44b8cb1ab42590fcfa113a60d45e97cf1 --- /dev/null +++ b/adaptivegatingforsinglephoton3dimaging/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ab2b91b8e1f5ab78e113c42e2483d02f8011d8994cc92d3ca71e8092922af9d +size 544728 diff --git a/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_content_list.json b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0fe4d4f00629d548518f1de70a47682a25ff31f0 --- /dev/null +++ b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8f5654ef94b131493b0d31c353d9c8dfbc3c2944a846fd116b7813e37f82cb9 +size 74908 diff --git a/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_model.json b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f65858cbed2e965cbb695906d27b4a8ab2f0c2d2 --- /dev/null +++ b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6948b2a04da6f06320ba6b9236e82e7c3a8dd1b67a2ee3d6df43dcd4a0d1ab54 +size 90767 diff --git a/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_origin.pdf b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..422e33e4867ca309986b4a343f54f24bdc8e0f0c --- /dev/null +++ b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/71dfec28-8e02-41bc-9145-d9c662b423fc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb0bb7ca7d561a0c55d80588ad61ae9eb9eeca10c2cfe88ad6fe1d5d3ceba9c4 +size 670812 diff --git a/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/full.md b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..57cdc86056cee6dfd2073b1f6ea73b7d1a45ace6 --- /dev/null +++ b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/full.md @@ -0,0 +1,313 @@ +# Adaptive Hierarchical Representation Learning for Long-Tailed Object Detection + +Banghuai Li MEGVII Technology libanghuai@gmail.com + +# Abstract + +General object detectors are always evaluated on hand-designed datasets, e.g., MS COCO and Pascal VOC, which tend to maintain balanced data distribution over different classes. However, it goes against the practical applications in the real world which suffer from a heavy class imbalance problem, known as the long-tailed object detection. In this paper, we propose a novel method, named Adaptive Hierarchical Representation Learning (AHRL), from a metric learning perspective to address long-tailed object detection. We visualize each learned class representation in the feature space, and observe that some classes, especially under-represented scarce classes, are prone to cluster with analogous ones due to the lack of discriminative representation. Inspired by this, we propose to split the whole feature space into a hierarchical structure and eliminate the problem in a coarse-to-fine way. AHRL contains a two-stage training paradigm. First, we train a normal baseline model and construct the hierarchical structure under the unsupervised clustering method. Then, we design an AHR loss that consists of two optimization objectives. On the one hand, AHR loss retains the hierarchical structure and keeps representation clusters away from each other. On the other hand, AHR loss adopts adaptive margins according to specific class pairs in the same cluster to further optimize locally. We conduct extensive experiments on the challenging LVIS dataset and AHRL outperforms all the existing state-of-the-art methods, with $29.1\%$ segmentation AP and $29.3\%$ box AP on LVIS v0.5 and $27.6\%$ segmentation AP and $28.7\%$ box AP on LVIS v1.0 based on ResNet-101. We hope our simple yet effective approach will serve as a solid baseline to help stimulate future research in long-tailed object detection. Code will be released soon. + +# 1. Introduction + +The emerging of convolutional neural networks (CNNs) leads to prosperity in object detection. With effort of re + +![](images/9017452cd39d54549c641fc843483ad35b6cbc1adcca601fbffeff659d4d2857.jpg) +Figure 1. Comparisons between the state-of-the-art methods and our AHRL on LVIS v0.5 [8]. We report different task results (object detection and instance segmentation) on both ResNet-50(red) and ResNet-101(blue) backbones. $AP^s$ stands for the segmentation AP, while $AP^b$ means the box AP. Our proposed AHRL outperforms all the existing methods. + +searchers, recent advances in object detection achieve encouraging results in manually balanced datasets, like Pascal VOC [5] and MS COCO [18]. However, in reality, we always need to face long-tailed distributed data [25], where head classes (classes with plenty of instances) and tailed/scarce classes (classes with few instances) significantly differ in the number of instances. Nevertheless, many traditional detection models are hard to take care of head classes and tailed classes in the same time, resulting in the desire for an adaptive solution. + +Different from long-tailed object recognition, an additional localization sub-task makes long-tailed object detection more challenging. Extreme imbalance of the instance number for each class still restricts its performance. Almost all the past works [3, 12, 15, 31, 35, 37] on long-tailed object detection reach a consensus that classifier is the major bottleneck for further improvements. As shown in Figure + +![](images/f60ccecfc0a5eec23ab1e1b569cc52a2b4c6a69c5a3aad19476d04854c25d9e1.jpg) +(a) Variance of weights + +![](images/8b9cdf37d18e5912c245376369ead357c9d985f5c8f2cbf255146306869810cc.jpg) +(b) t-SNE visualization of class weights + +![](images/fd5f1a0050d1cc3bfa243119bdccfb7598902d9acd8fe55d81879cc9bedcdd26.jpg) +(c) Results of coarse and fine classification +Figure 2. (a) The average variance for different frequent groups. (b) t-SNE visualization of classifier weights in Mask R-CNN. Red, green and blue points stand for the class weight/center of rare, common and frequent classes, respectively. And dotted ellipses mark some obvious clusters. (c) Results of coarse and fine classification. The blue bar represents the standard result of Mask R-CNN on LVIS v0.5, while orange bar represents the coarse result by ignoring misclassification in the same cluster. + +2a, we calculate the variance of the classification weight for each class during the model training and take average according to their frequency groups, i.e., rare, common, and frequent in LVIS v0.5 [8]. Head classes dominate the model optimization due to the more diverse samples, while tailed classes are seldom tackled because of the heavy data imbalance. Thus, it always leads to unsatisfactory performance. Following long-tailed object recognition, early attempts in long-tailed object detection exploit data re-sampling [3, 8] and loss re-weighting [7, 14, 23, 29, 31, 35] strategies to solve this problem. By data re-sampling, a more balanced dataset is given to the model, preventing the bias to head classes to some extent. Compared with directly balancing dataset, loss re-weighting approaches elaborately modify the weight to adapt to the long-tailed scene. However, these methods suffer from overfitting to the limited data, and the overall performance is always sensitive to the re-weighting or resampling hyperparameters. + +In this work, we present a simple yet effective method, named Adaptive Hierarchical Representation Learning (AHRL), from a metric learning perspective to address the long-tailed object detection problem. As shown in Figure 2b, we take Mask R-CNN [10] as an example model to train on LVIS v0.5 [8] dataset and utilize t-SNE [33] to visualize each class weight. Each dot in Figure 2b stands for a specific class center, and we select 247 out of 1230 classes for better illustration. Moreover, rare, common, and frequent classes are marked in red, green, and blue, respectively (detailed class information for those dots can be found in our supplementary materials). We can find an interesting phenomenon that some classes, especially under-represented scarce classes, are prone to cluster with analogous ones due to the lack of discriminative representation. Thus, these classes tend to be misclassified and result in poor performance. Go a step further. We adopt K-Means to group all the class centers into 50 clusters and ignore the misclassification in the same cluster to re-evaluate the performance. As depicted in Figure 2c, we distinguish this evalu + +ation method and the standard one as coarse and fine classification results, respectively, and we observe that coarse results are much better than fine results, especially for scarce classes, which also verifies our assumption above. This discovery opens up room to optimize the long-tailed object detection performance and inspires us to handle this tough problem in a coarse-to-fine way. + +Motivated by the observation above, we resort to a coarse-to-fine strategy to tackle this problem and design a two-stage training procedure AHRL from a hierarchical representation learning perspective. In the first stage, we follow standard settings in [8, 10, 31] to train a typical baseline model, i.e., Mask R-CNN. Then, we adopt unsupervised clustering algorithms, i.e., K-Means, to build the hierarchical feature space based on the classification weights of the pre-trained model. In the second stage, we propose a novel loss function, named Adaptive Hierarchical Representation loss (or AHR loss), to implement our coarse-to-fine design. AHR loss involves two optimization objectives, one for coarse-grained classification and the other one for fine-grained classification. On the one hand, AHR loss retains the constructed hierarchical structure and prompts all clusters to repel each other. On the other hand, AHR loss adopts dynamic and adaptive margins according to the specific relationship between each class pair in the same cluster, the more similar pairs they are and the larger margins between them are performed during the whole training process, to make indistinguishable classes more discriminative. We conduct extensive experiments on LVIS dataset and achieve new state-of-the-art results with both ResNet-50 [11] and ResNet-101 [11] backbones, as shown in Figure 1. + +To sum up, the contributions of this work are as follow: + +- We delve deep into the long-tailed object detection problem and present a strong baseline to help ease future research, which already beats the most state-of-the-art methods. + +![](images/ef6a5b80ad2680c3a4fc419b3557f017e4eabeb569d35620b4f0a27f81982bcc.jpg) +(a) Objectness score + +![](images/b3923a3cc8c2b1d04ece2d7a0b6d204fec70f9885674e7fdbaacbf01e4cbb523.jpg) +(b) Proposals per instance +Figure 3. (a) Average objectness score per instance in RPN during training. All boxes are filtered by IOU threshold and matched with corresponding ground-truth to get their labels and frequency. Different frequency groups are marked by different colors. (b) Proposals per instance. We monitor the average proposals per instance for different frequency groups during the model training. (c) Magnitude of weight vectors for different classes. Different background colors stand for different frequency groups. The norms of weights are sorted in descending order in every frequency group. + +![](images/67897a612a7f13b88068257a2d64c0774a96a673a5aa6f6409ee372d4d11a77d.jpg) +(c) Norm of class weights + +- We present a simple and effective approach, named Adaptive Hierarchical Representation Learning(AHRL), from a metric learning perspective to eliminate long-tailed object detection in a coarse-to-fine way. A novel AHR loss is also proposed to make AHRL work better. +- Compared with other existing state-of-the-art methods, our proposed method outperforms them and achieves a new state-of-the-art performance on LVIS benchmarks with various backbones. + +# 2. Related Work + +General Object Detection and Instance Segmentation. The rise of deep learning improves the performance of object detection in recent years. These deep learning-based frameworks can be divided into two categories. One-stage approaches [17, 20, 24] chase faster inference speed, while two-stage frameworks [6, 27] prefer a higher accuracy. With the appearance of Mask R-CNN [10], the gap between object detection and instance segmentation disappeared by adding an extra segmentation branch upon Faster R-CNN [27]. + +Long-tailed Recognition. Common methods towards long-tailed recognition can be summarized as follows. 1) Data re-sampling. It is the most intuitive way by duplicating tailed samples [8,9] or under-sampling head samples [4] to deal with the long-tailed distribution. [38] goes a step further by changing the ratio of head and tailed classes over time. But all of them cannot avoid under-fitting in head classes or over-fitting in tailed classes. 2) Data augmentation. Generating or synthesizing new samples is always used to enlarge the limited dataset. Recent studies [1,2,19] manage to create fake samples for tailed classes to address long-tailed distribution. However, these methods are limited to the diversity of tailed classes. 3) Loss re-weighting. + +Instead of modifying input, modifying loss function directly is also a popular way to settle down this problem. Recently, several works [30, 31, 35] seek many ways to adapt the loss weight for both head and tailed classes to prevent severe and frequent punishment to tailed classes. + +Long-tailed Object Detection. As long-tailed recognition becomes mature, researchers start to pay attention to long-tailed detection. Meanwhile, Facebook start a long-tailed detection challenge with dataset LVIS [8]. EQL loss [31] easily decreases the times to suppress punishment to tailed classes to conquer this problem. Following EQL, ACSL [35] prevents tailed classes from suppressing of head classes and preserves the discrimination between similar classes. Besides focusing on loss function, some methods deliberately design the last layer in the classifier. Forest R-CNN [37] constructs a classification forest with different prior knowledge to incorporates relations. BAGS [15] uses a cascade-like softmax layer to alleviate the difference between head classes and tailed classes in quantity. These structures avoid the imbalance between reward and punishment in a specific part of the model. Moreover, some adaptive methods [26, 32] provide in long-tailed classification still have an fantastic result in long-tailed object detection. + +In this paper, we tackle the long-tailed object detection problem from the metric learning perspective. By splitting the whole feature space into the hierarchical structure, AHRL can handle the tough problem in a divide-and-conquer way and achieves superior results. It should be noted that Forest R-CNN [37] adopts an analogous hierarchical split method. However, it achieves this by adding a separate classification branch to distinguish parent classes, which results in a severe inconsistency between parent and fine-grained classification as these two branches are projected to different feature spaces. On the contrary, our proposed AHRL adopts unsupervised clustering algorithms based on fine-grained classes to construct the hierarchical + +structure and optimize both coarse-grained and fine-grained classes at the same time. + +# 3. Proposed Method + +In this section, we first introduce a strong baseline model to help ease future research in long-tailed object detection and further verify the effectiveness of our proposed method. Then, we discuss our proposed method AHRL, followed by the details of the AHR loss. + +# 3.1. Preliminary and A Strong Baseline + +In the past works, the naive Mask R-CNN [10] is invariably adopted as the baseline model to conduct experiments and verify the superiority of their proposed methods. However, with the development of modern deep learning methods, some intuitive and mature techniques can boost naive baseline performance to a certain extent. This section delves deep into the long-tailed object detection problem and presents a strong baseline based on naive Mask R-CNN, named baseline++ for simplicity. Baseline++ serves as the baseline model to further verify the effectiveness of our proposed method. Its details are described as follows. + +Proposal Oversampling. As shown in Figure 3a and Figure 3b, we observe a clear gap between tailed classes and head classes on the average objectness score during the model training. The proposals of tailed classes tend to achieve lower objectness score and be filtered out before the ROI head in Mask R-CNN. Figure 3b can well illustrate the phenomenon, average proposals per instance for tailed classes are much smaller than head classes, which results in less optimization for tailed classes. According to these findings, we directly double the maximum number of tailed class proposals allowed to keep after non-max suppression(NMS), bringing more foreground proposals for tailed classes. + +Cosine Similarity Classifier. Generally speaking, the fully-connected (FC) layer is the default choice to implement classifiers in most object detectors. However, the fully-connected layer will result in an obvious bias towards head classes, when it comes to the long-tailed object detection problem. Supposing $\mathcal{F}$ is the feature extractor, $W^{c} \in \mathbb{R}^{d \times k}$ is the final classification weight matrix, $k$ is the number of whole classes, and $W^{c} = [w_{1}^{c}, w_{2}^{c}, \dots, w_{k}^{c}]$ , where $w_{i}^{c} \in \mathbb{R}^{d}$ is the corresponding classification weight vector for $i$ -th class. When given an input sample vector $x$ , we can get the raw classification score $s_{i}^{c}$ by dot-product operation: + +$$ +\begin{array}{l} s _ {i} ^ {c} = \mathcal {F} (x) ^ {T} \cdot w _ {i} ^ {c} \quad \left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left.\right.\left. 0\right)\left. \right.\left. \right.\left. \right. \tag {1} \\ = \| \mathcal {F} (x) \| \| w _ {i} ^ {c} \| \cos (\theta) \\ \end{array} +$$ + +We can find that all things being equal, weight vectors with larger magnitude tend to yield higher scores. As shown in Figure 3c, we take Mask R-CNN [10] as an example and + +observe that weight vectors of head classes have a much larger magnitude comparing with tailed classes, which results in prediction preference towards head classes. Inspired by [36], we adopt a cosine similarity classifier to replace the original linear classifier to reduce the intra-class variance, which is defined as follows: + +$$ +s _ {i} ^ {c} = \lambda_ {c} \cdot \frac {\mathcal {F} (x) ^ {T} \cdot w _ {i} ^ {c}}{\| \mathcal {F} (x) \| \| w _ {i} ^ {c} \|} \tag {2} +$$ + +where $\mathcal{F}(x)$ is the feature of a given proposal, $w_{i}^{c}$ is the weights for class $i$ and $\lambda_{c}$ is the scaling factor. + +Moreover, compared with weights in a fully-connected classifier, weights from a cosine classifier, without preference and bias, can respond to the relationship among classes better, which can lay the foundation for subsequent excellent clustering results. + +Other Effective Attempts. According to our discussion in the related work section, we adopt EQL [31] as the loss re-weighting method and GIoU [28] is utilized to replace the default Smooth L1 loss for more accurate bounding box regression. Besides, we also try several simple data augmentation methods to increase the data diversity. Due to the space limit, please refer to our Appendix for more detailed description about these attempts. + +# 3.2. Adaptive Hierarchical Representation Learning + +Motivated by our findings in Section 1, we design a simple yet effective method, named Adaptive Hierarchical Representation Learning (AHRL), from a metric learning perspective. An overview of AHRL's pipeline can be found in Figure 4. AHRL contains a two-stage training paradigm. In the first stage, we follow standard settings in [10] to train a normal baseline $++$ model, illustrated in Section 3.1. Then, we construct the hierarchical feature space based on the classification nodes of pre-trained baseline $++$ . An intuitive way to achieve this is with the help of modern clustering algorithms. In this section, without loss of generality, we only cluster these classification nodes for once and divide the whole classification feature space into two levels for better illustration. Assuming we get $n$ clusters finally, e.g., $\mathbb{P} = \{\mathcal{P}_1, \mathcal{P}_2, \dots, \mathcal{P}_n\}$ , and the cluster representation $w_i^p$ is defined as the mean of each classification node $w_j^c$ in cluster $\mathcal{P}_i$ : + +$$ +w _ {i} ^ {p} = \frac {\sum_ {j \in \mathcal {P} _ {i}} w _ {j} ^ {c}}{\| \mathcal {P} _ {i} \|} \tag {3} +$$ + +where $\| \mathcal{P}_i\|$ equals to the number of nodes in set $\mathcal{P}_i$ + +When it comes to clustering algorithms, there are two typical choices we can take. One is based on unsupervised clustering methods like K-Means to aggregate similar classification nodes, which is deemed to utilize visual information to some extent. The other one is based on lexical infor + +![](images/558142ff157b6759210b748e9912912750a1895228691f158530354d099f0f41.jpg) +Figure 4. Overview of our adaptive hierarchical representation learning. In the first stage, we train a simple baseline model and each blue dot in the first circle represents a specific class center. Next, clustering algorithms, i.e., K-Means, are adopted to construct the hierarchical structure and each cluster representation (triangle in the second circle) is defined as the mean of each node in the same cluster. Finally, we fine-tune the model and optimize it with our AHR loss. $M_{ij}$ is the adaptive margin between each class pair. + +![](images/f16a25e42fbfafa1ba75deb7f818788e69ce8d759df98579d5bf55b703e87ee3.jpg) + +![](images/f18f236b69857cc0f369b7134db97d25d39def14f6a713af6e2d7be9bf93242f.jpg) + +Table 1. Ablation for each component in our proposed strong baseline. $AP_r$ , $AP_c$ and $AP_f$ denote segmentation average precision for rare, common and frequent classes, respectively. * indicates that the reported result is based on our own implementation. + +
MethodEQL*GIoUProposal OversampleData AugmentationCosine Similarity HeadAPbAPsAPrAPcAPf
Mask R-CNN* [8]XXXXX23.624.214.024.228.3
Baseline++ (ours)XXXX25.525.917.127.128.0
XXX25.826.217.827.128.5
XX26.126.417.727.628.4
X26.526.717.828.028.6
26.726.817.928.228.7
+ +mation, e.g., WordNet [21], to provide an intuitive hierarchical structure. However, lexical information is not always consistent with visual characteristics. For example, seagull and plane are totally different classes in WordNet [21], but they look pretty similar from visual perspectives. We make a detailed comparison between these two methods in Section 4.2. + +Finally, in the second stage, we keep the hierarchical structure and eliminate long-tailed object detection in a coarse-to-fine way through the AHR loss, which is described in the next section. + +# 3.3. Adaptive Hierarchical Representation Loss + +Adaptive Hierarchical Representation (AHR) loss consists of two optimization objectives, $\mathcal{L}_{\text {coarse }}$ and $\mathcal{L}_{\text {fine }}$ . On the one hand, $\mathcal{L}_{\text {coarse }}$ retains the hierarchical structure and prompts all clusters to repel each other. On the other hand, $\mathcal{L}_{\text {fine }}$ adopts adaptive margins according to the specific relationship between each class pair in the same cluster to further optimize locally. Thus, the overall formulation of AHR + +loss can be defined as follows: + +$$ +\mathcal {L} _ {A H R} = \mathcal {L} _ {\text {f i n e}} + \lambda \mathcal {L} _ {\text {c o a r s e}} \tag {4} +$$ + +where $\lambda$ is the hyperparameters to balance the scale of $\mathcal{L}_{\text{coarse}}$ . + +More specifically, $\mathcal{L}_{\text {coarse }}$ serves as a coarse-grained classification loss to distinguish each cluster clearly, and we adopt a simple cross-entropy loss to achieve this goal: + +$$ +L _ {\text {c o a r s e}} = - \sum_ {i} p _ {i} \log \sigma \left(s _ {i} ^ {p}\right) + \left(1 - p _ {i}\right) \log \left(1 - \sigma \left(s _ {i} ^ {p}\right)\right) \tag {5} +$$ + +where: + +$$ +s _ {i} ^ {p} = \lambda_ {p} \cdot \frac {\mathcal {F} (x) ^ {T} \cdot w _ {i} ^ {p}}{\| \mathcal {F} (x) \| \| w _ {i} ^ {p} \|} \tag {6} +$$ + +$$ +p _ {i} = \left\{ \begin{array}{l l} 1, & x \in \mathcal {P} _ {\pi_ {i}} \\ 0, & x \notin \mathcal {P} _ {\pi_ {i}} \end{array} \right. \tag {7} +$$ + +where $w_{i}^{p}$ is the weight for cluster $i$ , which is defined in Eq. (3), $\pi_{i}$ is the cluster index corresponding to class $i$ , $\sigma$ is + +the Sigmoid operation, $\lambda_{p}$ is the scaling factor for cluster predictions. + +$\mathcal{L}_{\text {coarse }}$ only focuses on coarse-grained cluster classification. Thus $\mathcal{L}_{\text {fine }}$ is necessary for further fine-grained classification in the single cluster. It is worth mentioning that our proposed $\mathcal{L}_{\text {fine }}$ adopts adaptive margin mechanism to make each class more discriminative: + +$$ +\mathcal {L} _ {\text {f i n e}} = - \sum_ {i} \left(y _ {i} \log \sigma_ {a d} \left(s _ {i, y _ {i}} ^ {c}\right) + \left(1 - y _ {i}\right) \sum_ {j} \log \left(1 - \sigma_ {a d} \left(s _ {i, j} ^ {c}\right)\right)\right) \tag {8} +$$ + +where: + +$$ +\sigma_ {a d} \left(s _ {i, j} ^ {c}\right) = \frac {1}{1 + e ^ {- \left(s _ {i , j} ^ {c} + M _ {y _ {i , j}}\right)}} \tag {9} +$$ + +where $y_{i}$ is the ground-truth label of $i$ -th proposal, $s_{i,j}^{c}$ is the raw score of $j$ -th class for proposal $i$ and $M$ is a matrix measuring the specific margin values between each class pair. This paper adopts the cosine similarity between each class pair to reflect the margin between them. As we have discussed in Section 3.1, the classifier weights of our proposed method are all normalized. Thus the $M$ can be directly defined as follows: + +$$ +M _ {i, j} = \left\{ \begin{array}{l l} 0, & i = j \\ \lambda_ {m} \max \left(0, \left(w _ {i} ^ {c} \cdot \left(w _ {j} ^ {c}\right) ^ {T}\right)\right) & i \neq j \end{array} \right. \tag {10} +$$ + +where $\lambda_{m}$ is a hyperparameter to control the degree of mutual exclusion, which is set as 2 by default. Moreover, because the purpose of $\mathcal{L}_{fine}$ is to optimize classification performance locally in the single cluster, $M$ is restricted to kick in for those classes in the same cluster: + +$$ +I _ {i, j} = \left\{ \begin{array}{l l} 1, & \pi_ {i} = \pi_ {j} \\ 0, & \pi_ {i} \neq \pi_ {j} \end{array} \right. \tag {11} +$$ + +$$ +M = M \cdot I \tag {12} +$$ + +It is noteworthy that $M$ is calculated dynamically during the model training until all the class nodes achieve an optimal status. + +Consequently, $\mathcal{L}_{AHR}$ , the combination of $\mathcal{L}_{coarse}$ and $\mathcal{L}_{fine}$ , works in a coarse-to-fine way to effectively address the long-tailed object detection problem. Besides, $\mathcal{L}_{AHR}$ is easy to extend to Softmax version, and we implement $\mathcal{L}_{AHR}$ in this paper based on Sigmoid for simplicity. + +# 3.4. Training Objective + +In the first stage, the base detector is trained with a standard Mask R-CNN [10] i.e., a typical loss $\mathcal{L}_{rpn}$ to improve the qualification of foreground proposals, a EQL [31] loss and GIoU loss for box classification and box regression respectively in ROI head. In the second stage, $\mathcal{L}_{fine}$ is + +adopted to our proposed baseline++, and it can be reformulated based on [31] and Eq. (8): + +$$ +\begin{array}{l} \mathcal {L} _ {\text {f i n e}} = - \sum_ {i} \left(y _ {i} \log \sigma_ {a d} \left(s _ {i, y _ {i}} ^ {c}\right) + \right. \\ \sum_ {j} E (r) T _ {\lambda_ {r}} \left(f _ {i}\right) \left(1 - y _ {i}\right) \log \left(1 - \sigma_ {a d} \left(s _ {i, j} ^ {c}\right)\right) \tag {13} \\ \end{array} +$$ + +Finally, the overall objective function in the second stage is as follow, and $\lambda$ is set as 1 by default: + +$$ +\begin{array}{l} \mathbb {L} = \mathcal {L} _ {r p n} + \mathcal {L} _ {r e g} + \mathcal {L} _ {A H R} \tag {14} \\ = \mathcal {L} _ {r p n} + \mathcal {L} _ {G I o U} + \mathcal {L} _ {f i n e} + \lambda \mathcal {L} _ {\text {c o a r s e}} \\ \end{array} +$$ + +# 4. Experiments + +# 4.1. Experiment Setup + +Datasets. Large Vocabulary Instance Segmentation(LVIS) dataset, a large long-tailed vocabulary dataset in long-tailed detection, consists of 1230 categories in v0.5 and 1203 categories in v1.0. Since LVIS is a federated dataset [8], a few annotations are missing and few annotations are ambiguous. All categories are officially divided into three groups: frequent (more than 100 images), common (10 to 100 images), and rare (less than 10 images). Following the official guideline, we train our model on the train set and evaluate the result on the val set. Besides widely-used $AP$ across IoU threshold from 0.5 to 0.95, AP for frequent $(AP_{f})$ , common $(AP_{c})$ , rare $(AP_{r})$ groups will be reported respectively for both object detection and instance segmentation results. + +Implementation Details. We use Mask R-CNN [10] as our base detector and ResNet-50 [11] with a Feature Pyramid Network [16] as the backbone. We use 8 GPUs with a batch size 16 for training. Our model is trained using stochastic gradient descent(SGD) with momentum 0.9 and weight decay 0.0001 for 90k steps, with an initial learning rate of 0.02, which is decay to 0.002 and 0.0002 at 60k and 80k respectively. We adopt a class-specific branch for both mask and bounding box regression. The threshold of the prediction score is set to be 0.05. We follow [36] to set $\lambda_{c}$ and $\lambda_{p}$ as 20 in our experiments, respectively. We set $\lambda$ to 1 to balance the scale of the losses. Following [31], $\lambda_{r}$ is set to be $1.76\times 10^{-3}$ . + +# 4.2. Ablation Studies + +In this section, we take Mask R-CNN [10] based on ResNet-50 [11] as the baseline model to perform ablation studies on LVIS v0.5 [8] unless otherwise specified. + +Ablation for each component in Baseline++. We follow standard settings in [8, 15, 31, 37] and adopt [8] equipped with the Repeat Factor Sampling (RFS) method + +Table 2. Performance comparisons with the state-of-the-art methods on LVIS v0.5 [8]. ResNet-50 and ResNet-101 are adopted as the backbones respectively for fair comparisons. * indicates the reported result is based on its official implementation under Pytorch [22] framework. + +
MethodConferenceBackbone\(AP^b\)\(AP^s\)\(AP_r\)\(AP_c\)\(AP_f\)
Class-balanced Loss [3]CVPR 2019ResNet-50-FPN21.020.98.221.225.7
Focal Loss [17]ICCV 2017ResNet-50-FPN21.921.09.321.025.8
EQL [31]CVPR 2020ResNet-50-FPN23.322.811.324.725.1
RFS [8]CVPR 2019ResNet-50-FPN-24.414.524.328.4
LST [13]CVPR 2020ResNet-50-FPN-23.0---
SimCal [34]ECCV 2020ResNet-50-FPN-23.416.422.527.2
Forest R-CNN [37]ACMMM 2020ResNet-50-FPN25.925.618.326.427.6
BAGS [15]CVPR 2020ResNet-50-FPN25.826.318.026.928.7
BALMS* [26]NeurIPS 2020ResNet-50-FPN26.427.017.328.129.5
DropLoss [12]AAAI 2021ResNet-50-FPN25.125.513.227.927.3
ACSL [35]CVPR 2021ResNet-50-FPN-26.418.626.429.4
EQL [31]CVPR 2020ResNet-101-FPN25.224.814.626.726.4
Forest R-CNN [37]ACMMM 2020ResNet-101-FPN27.526.920.127.928.3
DropLoss [12]AAAI 2021ResNet-101-FPN26.826.914.829.728.3
ACSL [35]CVPR 2021ResNet-101-FPN-27.519.327.630.7
AHRL(ours)N/AResNet-50-FPN27.427.317.529.029.1
AHRL(ours)N/AResNet-101-FPN29.329.121.330.730.3
+ +Table 3. Comparisons between various clustering strategies. + +
MethodClusters\(AP^b\)\(AP^s\)\(AP_r\)\(AP_c\)\(AP_f\)
WordNet10826.726.916.728.329.2
K-Means10826.927.016.928.628.9
K-Means20027.427.317.529.029.1
K-Means40027.126.816.128.529.3
+ +Table 4. Comparisons between our proposed method and the baseline Mask R-CNN based on various backbones. + +
MethodBackbone\(AP^b\)\(AP^s\)\(AP_r\)\(AP_c\)\(AP_f\)
Mask R-CNN [10]ResNet-50-FPN23.624.214.024.228.3
AHRL(ours)ResNet-50-FPN27.427.317.529.029.1
Mask R-CNN [10]ResNet-101-FPN26.026.218.026.329.4
AHRL(ours)ResNet-101-FPN29.329.221.330.730.3
+ +as our baseline model. In Section 3.1, we propose an effective strong baseline baseline++ and Table 1 shows that each component of baseline++ can effectively promote the overall performance. + +General object detectors always suffer from heavy class imbalance in long-tailed object detection problem, and EQL [31] alleviates this by ignoring the suppression to tails when they act as the negative samples. Finally, it can achieve around $1.9\%$ segmentation Average Precision (AP) and $2.0\%$ box AP gains in our implementation. GIoU [28], a more advanced IoU-based regression loss, achieves about + +$0.3\%$ segmentation AP and $0.3\%$ box AP gains against the default Smooth L1 loss in our settings. Unlike the common data sampling methods [3,8], our proposed proposal oversampling for rare classes can eliminate the class imbalance problem more intrinsically, and it achieves $0.2\%$ segmentation AP and $0.3\%$ box AP improvements, respectively. + +As we all know, it is almost common sense to perform data augmentation on scarce classes to ease class imbalance. In this paper, we try several simple data augmentation methods and find random cropping and color jitter can contribute to the performance, which achieves $0.3\%$ segmentation AP and $0.4\%$ box AP improvements, respectively. In addition, we replace the final fully-connected layer with the cosine similarity head for the classification and it achieves about $0.2\%$ box AP and $0.1\%$ segmentation gains, which keeps consistent with our discussion about the magnitude of weight vectors in Section 3.1. In summary, our proposed strong baseline achieves about $2.8\%$ segmentation AP and $2.2\%$ box AP improvements comparing with the original baseline in [8]. + +Effectiveness of our proposed method. We adopt two typical backbones, i.e., ResNet-50 [11] and ResNet-101 [11], to implement AHRL based on Mask-RCNN [10] to verify the effectiveness of our method. Table 4 shows the detailed comparisons. We can find that AHRL outperforms the baseline model by a large margin, whether it is based on ResNet-50 or ResNet-101. Concretely, AHRL achieves about $3.1\%$ segmentation AP and $3.8\%$ box AP gains with + +Table 5. Comparisons between different training strategies. + +
MethodBackboneAPbAPsAPrAPcAPf
Baseline++ResNet-50-FPN26.726.817.928.228.7
Baseline++†ResNet-50-FPN26.827.015.429.029.2
+ +ResNet-50, while it also achieves about $3.0\%$ segmentation AP and $3.3\%$ box AP gains with ResNet-101. This experiment proves that AHRL can work very well with various backbones and achieve promising results. We randomly sample several images from LVIS v0.5 to intuitively depict the effect of our AHRL, visualization results can be found in our appendix. + +Different clustering strategies. Clustering algorithms play an important role in our proposed AHRL. In this section, we conduct extensive experiments on unsupervised K-Means and WordNet [21]. As shown in Table 3, we follow WordNet settings in [37] and group all the classification nodes into 108 clusters. We can find that the overall performance of K-Means is slightly better than WordNet under the same settings, which keeps consistent with our discussion in Section 3.2. Moreover, AHRL achieves optimal results when we group all the classes into 200 clusters. We have to emphasize that we do not pay much attention to fine-tuning the cluster hyperparameter otherwise we believe AHRL can achieve further improvements. + +Discussion about our training paradigm. As we have described in Section 3.2, our proposed AHRL involves a two-stage training paradigm. To eliminate the doubt that whether the gain is brought by the $2\mathrm{x}$ training time, in the second stage, we follow the same settings in AHRL to fine-tune the pre-trained model without any extra modifications, and we mark the result in Table 5 as baseline $+ + ^{\dagger}$ . We observe that baseline $+ + ^{\dagger}$ achieves comparable performance with the pre-trained model. $2\mathrm{x}$ training time leads to even worse prediction bias towards head classes. It is noteworthy that we strictly share the same settings between the two-stage training paradigm, e.g., learning rate, batch size, etc. Thus, we attribute it to the influence of different initial statuses. So far, we can conclude that the improvements brought by AHRL benefit from our novel design instead of the training time. + +# 4.3. Comparisons with State-of-the-art Methods + +As shown in Table 2 and Table 6, we compare our proposed method with all the published state-of-the-art methods. It is obvious that AHRL achieves superior performance and sets up a new state-of-the-art record on both LVIS v0.5 [8] and LVIS v1.0 [8] dataset. Moreover, it is worth mentioning that our proposed AHRL is free to boost long-tailed object detection performance without any extra inference cost. Due to the space limit, detailed results of + +Table 6. Performance comparisons with the state-of-the-art methods on LVIS v1.0 [8]. + +
MethodBackboneAPbAPs
Mask R-CNN [10]ResNet-50-FPN20.019.2
EQL [31]ResNet-50-FPN22.521.6
BAGS [15]ResNet-50-FPN23.723.1
DropLoss [12]ResNet-50-FPN22.922.3
Mask R-CNN [10]ResNet-101-FPN21.720.8
EQL [31]ResNet-101-FPN24.222.9
BAGS [15]ResNet-101-FPN26.525.8
AHRL(ours)ResNet-50-FPN26.425.7
AHRL(ours)ResNet-101-FPN28.727.6
+ +LVIS v1.0 for each sub-category are reported in our supplementary materials. + +# 5. Conclusions + +In this paper, we propose a novel yet effective method from a metric learning perspective to address the long-tailed object detection problem. Our proposed AHRL splits the whole classification feature space into a hierarchical structure and eliminates this tough problem in a coarse-to-fine way. More specifically, AHRL builds the hierarchical structure based on the classification weights of the pre-trained model in the first stage, then AHR loss retains the hierarchical structure and prompts all clusters to repel each other. In addition, according to the relationship between each class pair, an adaptive and dynamic margin mechanism is designed to make similar classes more discriminative. We conduct extensive experiments to verify the effectiveness of our proposed method, and we achieve a new state-of-the-art result on the challenging LVIS dataset based on various backbones without bells and whistles. + +# 6. Broad Impact + +Our contributions focus on the hierarchical representation learning for long-tailed object detection, which can be extended to other computer vision tasks. Also, it may provide new ideas for follow-up research. It therefore has the potential to advance both the beneficial and harmful applications of object detectors, such as autonomous vehicles, intelligent video surveillance, robotics and so on. As for ethical aspects and future societal consequences, this technology can bring harmful or beneficial effects to the society, which depends on the citizens who have evil or pure motivation and who can make good use of this technological progress. + +# References + +[1] Hsin-Ping Chou, Shih-Chieh Chang, Jia-Yu Pan, Wei Wei, and Da-Cheng Juan. *Remix: Rebalanced mixup.* arXiv preprint arXiv:2007.03943, 2020. +[2] Peng Chu, Xiao Bian, Shaopeng Liu, and Haibin Ling. Feature space augmentation for long-tailed data. In European Conf. on Computer Vision (ECCV), 2020. +[3] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9268-9277, 2019. +[4] Chris Drummond, Robert C Holte, et al. C4.5, class imbalance, and cost sensitivity: why under-sampling beats over-sampling. In Workshop on learning from imbalanced datasets II, volume 11, pages 1-8. CiteSeer, 2003. +[5] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision, 88(2):303-338, 2010. +[6] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440-1448, 2015. +[7] Samantha Guerriero, Barbara Caputo, and Thomas Mensink. Deepncm: Deep nearest class mean classifiers, 2018. +[8] Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5356-5364, 2019. +[9] Hui Han, Wen-Yuan Wang, and Bing-Huan Mao. Borderline-smote: a new over-sampling method in imbalanced data sets learning. In International conference on intelligent computing, pages 878-887. Springer, 2005. +[10] 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. +[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +[12] Ting-I Hsieh, Esther Robb, Hwann-Tzong Chen, and Jia-Bin Huang. Droploss for long-tail instance segmentation. In Proceedings of the Workshop on Artificial Intelligence Safety 2021 (SafeAI 2021) co-located with the Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI 2021), Virtual, February 8, 2021, 2021. +[13] Xinting Hu, Yi Jiang, Kaihua Tang, Jingyuan Chen, Chunyan Miao, and Hanwang Zhang. Learning to segment the tail. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14045-14054, 2020. +[14] Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. +[15] Yu Li, Tao Wang, Bingyi Kang, Sheng Tang, Chunfeng Wang, Jintao Li, and Jiashi Feng. Overcoming classifier imbalance for long-tail object detection with balanced group + +softmax. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10991-11000, 2020. +[16] Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117-2125, 2017. +[17] 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. +[18] 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. +[19] Jialun Liu, Yifan Sun, Chuchu Han, Zhaopeng Dou, and Wenhui Li. Deep representation learning on long-tailed data: A learnable embedding augmentation perspective. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2970-2979, 2020. +[20] 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. +[21] George A. Miller. Wordnet: A lexical database for english. Commun. ACM, 38(11):39-41, Nov. 1995. +[22] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019. +[23] S. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert. icarl: Incremental classifier and representation learning. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5533-5542, 2017. +[24] 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. +[25] William J Reed. The pareto, zipf and other power laws. Economics Letters, 74(1):15-19, 2001. +[26] Jiawei Ren, Cunjun Yu, Shunan Sheng, Xiao Ma, Haiyu Zhao, Shuai Yi, and Hongsheng Li. Balanced meta-softmax for long-tailed visual recognition. arXiv preprint arXiv:2007.10740, 2020. +[27] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. arXiv preprint arXiv:1506.01497, 2015. +[28] Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +[29] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In I. Guyon, U. V. Luxburg, + +S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. +[30] Jingru Tan, Xin Lu, Gang Zhang, Changqing Yin, and Quanquan Li. Equalization loss v2: A new gradient balance approach for long-tailed object detection. arXiv e-prints, pages arXiv-2012, 2020. +[31] Jingru Tan, Changbao Wang, Buyu Li, Quanquan Li, Wanli Ouyang, Changqing Yin, and Junjie Yan. Equalization loss for long-tailed object recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +[32] Kaihua Tang, Jianqiang Huang, and Hanwang Zhang. Long-tailed classification by keeping the good and removing the bad momentum causal effect. In NeurIPS, 2020. +[33] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. +[34] Tao Wang, Yu Li, Bingyi Kang, Junnan Li, Junhao Liew, Sheng Tang, Steven Hoi, and Jiashi Feng. The devil is in classification: A simple framework for long-tail instance segmentation. In European conference on computer vision, pages 728-744. Springer, 2020. +[35] Tong Wang, Yousong Zhu, Chaoyang Zhao, Wei Zeng, Jinqiao Wang, and Ming Tang. Adaptive class suppression loss for long-tail object detection, 2021. +[36] Xin Wang, Thomas E Huang, Trevor Darrell, Joseph E Gonzalez, and Fisher Yu. Frustratingly simple few-shot object detection. arXiv preprint arXiv:2003.06957, 2020. +[37] Jialian Wu, Liangchen Song, Tiancai Wang, Qian Zhang, and Junsong Yuan. Forest r-cnn: Large-vocabulary long-tailed object detection and instance segmentation. In Proceedings of the 28th ACM International Conference on Multimedia, pages 1570-1578, 2020. +[38] Boyan Zhou, Quan Cui, Xiu-Shen Wei, and Zhao-Min Chen. Bbn: Bilateral-branch network with cumulative learning for long-tailed visual recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9719–9728, 2020. \ No newline at end of file diff --git a/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/images.zip b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1f636518f9c280bfbc7c9b361b9409e4943dd2dd --- /dev/null +++ b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7b999f083afc1dce4ebe0a7a06c58cb5d31e174a76ab1a143723fae3337a28f +size 558959 diff --git a/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/layout.json b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ca86aebd055364127f06e2478d3308f9b320cb8d --- /dev/null +++ b/adaptivehierarchicalrepresentationlearningforlongtailedobjectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ed94c9213129ac3db5f2a59f3187640680a3b784d4023dc66bfd08d2eb4706d +size 365746 diff --git a/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_content_list.json b/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ca19cf6355b10d78b9f6d57cfe702944dea90c9f --- /dev/null +++ b/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d355412a1a923c608ec5321cb9b809216d96e62862c365ae71c38b4dc1062f32 +size 100088 diff --git a/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_model.json b/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a78d466036d45d9d20d0b270893338dba0ae1eae --- /dev/null +++ b/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c087dcb97d18fbe00f1d164190298060e403266f37e682fcc2ab8dfff5c367b9 +size 127614 diff --git a/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_origin.pdf b/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..988e24eb45f19bd43e0db8abfe76f7e1487ceccd --- /dev/null +++ b/adaptivetrajectorypredictionviatransferablegnn/992f4f33-4813-4a3d-a37e-33e1d68dbede_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89263908bd890687d3ab25d6dc10ded9cd0057a7b9399e6cb491f5645eb586d8 +size 719837 diff --git a/adaptivetrajectorypredictionviatransferablegnn/full.md b/adaptivetrajectorypredictionviatransferablegnn/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a6bca1a6ebdb489f15ff0f8662b6bc65175a7313 --- /dev/null +++ b/adaptivetrajectorypredictionviatransferablegnn/full.md @@ -0,0 +1,412 @@ +# Adaptive Trajectory Prediction via Transferable GNN + +Yi Xu $^{1}$ , Lichen Wang $^{1}$ , Yizhou Wang $^{1}$ , Yun Fu $^{1,2}$ + +$^{1}$ Department of Electrical and Computer Engineering, Northeastern University, USA $^{2}$ Khoury College of Computer Science, Northeastern University, USA + +xu.yi@northeastern.edu, {wanglichenxj,wyzjack990122}@gmail.com, yunfu@ece.neu.edu + +# Abstract + +Pedestrian trajectory prediction is an essential component in a wide range of AI applications such as autonomous driving and robotics. Existing methods usually assume the training and testing motions follow the same pattern while ignoring the potential distribution differences (e.g., shopping mall and street). This issue results in inevitable performance decrease. To address this issue, we propose a novel Transferable Graph Neural Network (T-GNN) framework, which jointly conducts trajectory prediction as well as domain alignment in a unified framework. Specifically, a domain-invariant GNN is proposed to explore the structural motion knowledge where the domain-specific knowledge is reduced. Moreover, an attention-based adaptive knowledge learning module is further proposed to explore fine-grained individual-level feature representations for knowledge transfer. By this way, disparities across different trajectory domains will be better alleviated. More challenging while practical trajectory prediction experiments are designed, and the experimental results verify the superior performance of our proposed model. To the best of our knowledge, our work is the pioneer which fills the gap in benchmarks and techniques for practical pedestrian trajectory prediction across different domains. + +# 1. Introduction + +Trajectory prediction aims to predict the future trajectory seconds to even a minute prior from a given trajectory history. It plays an indispensable role in a large number of real world applications such as autonomous driving, robotics, navigation, video surveillance, and so on. In self-driving scenario, accurate pedestrian trajectory prediction is essential for planning [3, 42], decision making [81], environmental perception [52, 64], person identification [40], and anomaly detection [50, 78]. Trajectory prediction is a challenging task. For instance, strangers tend to walk alone trying to avoid collisions but friends tend to walk as a group [49]. In addition, pedestrians can interact with sur + +![](images/6a55343bdb8180dd7a1af036fd4141b5637c5c44f6d09afc530a96f6f2a1a155.jpg) +Source Trajectory + +![](images/c09476da33808409bfb1acfe555a5852d076690d5aed249c4c1de390490892b9.jpg) +Target Trajectory +Figure 1. An example that reveals the limitation of original learning strategy. These two frames are extracted from two different scenes and there is a huge difference between these trajectories. + +
MetricTrajectory DomainsE-DS-D
ETHHOTELUNIVZARA1ZARA2
NoS70301947602921877383.63
NoP181105324334225358332415310073.07
AN2.5863.49825.6963.7436.33323.119.78
AV (m/s)0.4370.1780.2050.3690.2060.2590.11
AA (m/s2)0.1310.060.0350.0390.0260.1050.04
+ +Table 1. Statistics of five different scenes, ETH, HOTEL, UNIV, ZARA1, and ZARA2. NoS denotes the number of sequences to be predicted, NoP denotes the number of pedestrians, AN denotes the average number of pedestrians in each sequence, AV denotes the average velocity of pedestrians in each sequence, and AA denotes the average acceleration of pedestrians in each sequence. $E-D$ represents Extreme Deviation and $S-D$ represents Standard Deviation. + +rounding objects or other pedestrians, while such interaction is too complex and subtle to quantify. To consider such interactions, a pooling layer is designed in work SocialLSTM [1] to pass the interaction information among pedestrians, and then a long short-term memory (LSTM) network is applied to predict future trajectories. Following this pattern, many methods [24, 38, 75, 82, 86] have been proposed for sharing information via different mechanisms, i.e., attention mechanism or similarity measure. Instead of predicting one determined future trajectory, some generative adversarial network-based (GAN) [11, 16, 21, 35, 56] and encoder-decoder-based methods [7-9, 47, 58, 59, 74] have been proposed to generate multiple feasible trajectories. + +However, these existing methods usually focus on learn + +ing a generic motion pattern while ignoring the potential distribution differences between the training and testing samples. We argue that this learning strategy has some limitations. Fig. 1 illustrates one basic concept. It is obvious that the trajectories of walking pedestrians in different trajectory domains are different, the trajectory in the left figure is stable but the trajectory in the right figure is much more tortuous. The original strategy is to learn these two samples together without considering distribution differences, which introduces domain-bias and disparities into the model. + +In order to quantitatively and objectively evaluate the potential domain gaps, Tab. 1 gives five numerical statistics of five commonly used trajectory domains. We can observe that the number of pedestrians in UNIV is much larger than that in ETH, and the differences among five trajectory domains are significant. As for pedestrian moving pattern, pedestrians in ETH have the largest average moving velocity, which is nearly three times larger than that in HOTEL. In addition, pedestrians in ETH also have the largest average moving acceleration, which is nearly five times larger than that in ZARA2. The E-D value and S-D value also reveal the huge differences among five different trajectory domains. This situation is general and always exists in practical applications. For example, in vision applications, cameras located in different cities/corners could lead to significant distribution gap. Similar situations are also common in robot navigation or autonomous driving-related applications since the environments are constantly changing. + +To further demonstrate this challenge, we apply three state-of-the-art methods, Social-STGCNN [48], SGCN [60], Tra2Tra [74] to demonstrate the performance drop when it comes to different trajectory domains. We take ETH as the example, these models are trained on the validation set of ETH and evaluated on the standard testing set of ETH. Note that there is no overlap trajectory sample between the training and testing set, but the distributions of them can be regarded as consistent. We refer to this evaluation setting as "consistent setting" and the performance under this new protocol as "updated ADE" and "updated FDE". Fig. 2 shows the updated ADE/FDE as well as the original ADE/FDE reported in their papers. The performance drops are significant which further reveal the domain-bias problem in the original leave-one-out setting. + +Domain adaptation (DA) is a subcategory of transfer learning which aims to address the domain shift issue. The basic idea is to minimize the distance of distributions of source and target domains via some distance measures, such as maximum mean discrepancy (MMD) [39, 51], correlation alignment distance (CORAL) [61, 87], and adversarial loss [17, 71]. Among these methods, the feature dimension of one sample is fixed in both source and target domain. On the contrary, a "sample" in our task is a combination of multiple trajectories with different pedestrians, which has + +![](images/5771f8c57a6fa990e1e3499fd058ad2bb8cfcc1c5dabdaed6546fe25692f59c0.jpg) +Figure 2. Performance comparison of three state-of-the-art methods under the original leave-one-out setting and the consistent setting. The performance drops of all three models are significant. + +not only global domain shift but also internal correlations. Therefore, directly utilizing the general feature representation of one "sample" results in the lack of crucial individual-level fine-grained features. Consequently, the most popular domain adaptation approaches are not applicable here. + +In this work, we delve into the trajectory domain shift problem and propose a transferable graph neural network via adaptive knowledge learning. Specifically, we propose a novel attention-based adaptive knowledge learning module for trajectory-to-trajectory domain adaptation. In addition, a novel trajectory graph neural network is presented. It is able to extract comprehensive spatial-temporal features of pedestrians that enhance the domain-invariant knowledge learning. The contributions of our work are summarized as, + +- We delve into the domain shift problem across different trajectory domains and propose a unified T-GNN method for jointly predicting future trajectories and adaptively learning domain-invariant knowledge. +- We propose a specifically designed graph neural network for extracting comprehensive spatial-temporal feature representations. We also develop an effective attention-based adaptive knowledge learning module to explore fine-grained individual-level transferable feature representations for domain adaptation. +- We introduce a brand new setting for pedestrian trajectory prediction problem, which is meaningful in real practice. We set up strong baselines for pedestrian trajectory prediction under this domain-shift setting. +- Experiments on five trajectory domains verify the consistent and superior performance of our method. + +As it is natural to use a graph-based model to represent the topology of social networks, recent methods [26, 36, 48, 60, 62, 69] employ graph neural networks as their backbones. Different from these methods, the graph neural network we employed is simple yet specifically designed not only to extract effective spatial-temporal features but also to be suitable for domain-invariant knowledge learning. + +# 2. Related Works + +# 2.1. Forecasting Pedestrian Trajectory + +Forecasting pedestrian trajectory aims to predict future locations of the target person based on his/her past locations and surroundings. Early researches attempt to use mathematical models [43] to make predictions such as Gaussian Process [15, 29], and Markov Decision Process [31, 45]. Recently, a large number of deep learning methods have been proposed to solve this prediction problem. In the work Social-LSTM [1], pedestrians are modeled with Recurrent Neural Networks (RNNs), and the hidden states of pedestrians are integrated via a designed pooling layer, where human-human interaction features are shared. To improve the quality of extracted interaction features, many recent works [5, 24, 38, 68, 82, 84] follow this idea to pass information among pedestrians, and different effective message passing approaches are proposed. Taking into account the uncertainty of pedestrians walking, some studies [2, 11, 16, 32, 35, 56, 66] utilize Generative Adversarial Networks (GAN) to make multiple plausible predictions of each person. In addition, different Encoder-Decoder structures [9, 47, 63] are also applied in this task, which are more flexible to encode different useful context features. + +Transformer structure [66] has achieved remarkable performance in Natural Language Processing field [12]. Motivated by this design, some studies [19, 79, 80] adopt it to the trajectory prediction task and improve the overall prediction precision. For the past two years, some works [46, 65, 83] have been proposed to explore the goal-driven trajectory prediction. The main idea is to estimate the end points of trajectories for prediction guidance. In addition, some interesting perspectives have been introduced into this task, i.e., long-tail situation [44], energy-based model [53], interpretable forecasting model [33], active-learning [73], and counterfactual analysis [7]. Different from recent work [37] that studies the problem of predicting future trajectories in unseen cameras with only 3D simulation data, our work is carried out under a more general and practical trajectory prediction setting, which has more profound influences. + +# 2.2. Graph-Involved Forecasting Models + +Thanks to the powerful representation ability in non-Euclidean space, Graph Neural Networks (GNNs) are widely applied in the trajectory prediction task [27,67,70, 72,76] recently. The basic idea is to treat the pedestrians as the nodes in a graph while measuring their interactions via graph edges. Recent works have utilized different variants of graph neural networks, e.g., edge-feature aggregation [55, 62], spatial-temporal feature extraction [26, 48], adapted graph structure [18,48,60,85], and graph attention method [32]. Our work also applies the graph model for feature representations extraction. Different from the above + +methods, our model is specifically designed for effective spatial-temporal feature representation learning as well as trajectory domain-invariant knowledge learning. + +# 2.3. Domain Adaptation + +Recently, domain adaptation (DA) problem has attracted considerable attention, motivating a large number of approaches [14, 77] to resolve the domain shift problem. Generally speaking, it can be divided into two main categories, one is semi-supervised DA problem, and the other is unsupervised DA problem. The difference between these two categories lies in the accessibility of target labels in the training phase. In semi-supervised DA [22, 25, 57], only a small number labeled target samples is accessible. + +In unsupervised DA [6,20,28,41], the target domain is totally unlabeled, which is much more challenging. In our work, we are dealing with the unsupervised DA problem. The majority of existing unsupervised DA methods usually project the source and target samples into a shared feature space, and then align their feature distributions via minimizing some distance measures, such as MMD [39, 51], CORAL [61, 87], or Adversarial Loss [17, 71] to force their distributions indistinguishable. As discussed above, these methods cannot be directly applied in our work. We address this problem by introducing an attention-based adaptive knowledge learning module for knowledge transfer. + +# 3. Our Method + +The overall framework of T-GNN model is illustrated in Fig. 3. It consists of three main components: 1) a graph neural network to extract effective spatial-temporal features of pedestrians from both source and target trajectory domains, 2) an attention-based adaptive knowledge learning module to explore domain-invariant individual-level representations for transfer learning, 3) a temporal prediction module for future pedestrian trajectory predictions. + +# 3.1. Problem Definition + +Given one pedestrian $i$ observed trajectory $\Gamma^i = \{o_1^i,\dots,o_{obs}^i\}$ from time step $T_{1}$ to $T_{obs}$ , aim to predict the future trajectory $\overline{\Gamma^i} = \{o_{obs + 1}^i,\dots,o_{pred}^i\}$ from time step $T_{obs + 1}$ to $T_{pred}$ , where $o_t^i = (x_t^i,y_t^i)\in \mathbb{R}^2$ denote the coordinates. Considering all the pedestrians in the scene, the goal is to predict trajectories of all the pedestrians simultaneously by a model $f(\cdot)$ with parameter $W^{*}$ . Formally, + +$$ +\bar {\Gamma} = f \left(\Gamma^ {1}, \Gamma^ {2}, \dots , \Gamma^ {N}; W ^ {*}\right), \tag {1} +$$ + +where $\overline{\Gamma}$ is the set of future trajectories of all the pedestrians, $N$ denotes the number of pedestrians, and $W^{*}$ represents the collection of learnable parameters in the model. + +![](images/62b9a5f726d1a2084f376f1d71bf865d0ed8a31a825c04dacdcfa2cca7b0fc58.jpg) +Figure 3. Flowchart of our T-GNN model. Given the source and target trajectories, we first construct corresponding successive graphs $G_{(s)}$ and $G_{(t)}$ , and then GCN layers are applied to extract feature representations $F_{(s)}$ and $F_{(t)}$ from these graphs. Following this, $F_{(s)}$ and $F_{(t)}$ are forwarded through the Attention-Based Adaptive Knowledge Module to learn transferable features $\mathbf{c}_{(s)}$ and $\mathbf{c}_{(t)}$ for aligning the source and target trajectory domain. Afterwards, only $F_{(s)}$ from source trajectory domain is utilized for future trajectory prediction via Temporal Prediction Module. Finally, our T-GNN model jointly minimizes the prediction loss and alignment loss. + +# 3.2. Spatial-Temporal Feature Representations + +Different from traditional time series forecasting, it is more challenging to predict pedestrian future trajectories because of the implicit human-human interactions and their strong temporal correlations. Therefore, extracting comprehensive spatial-temporal feature representations of observed pedestrian trajectories becomes a key point to accurately predict trajectories. In our work, considering the data structure of trajectories, a graph neural network is first employed to extract spatial-temporal feature representations. + +Before constructing the graph, coordinates of all pedestrians are firstly passed through one layer as, + +$$ +o _ {t} ^ {\prime i} = o _ {t} ^ {i} - \frac {1}{N} \sum_ {i = 1} ^ {N} o _ {o b s} ^ {i}, \tag {2} +$$ + +where $N$ is the number of pedestrians in the scene, $o_{obs}^{i}$ represents the coordinates of pedestrian $i$ at the last observed frame $T_{obs}$ . This decentralization operation is able to eliminate the effects of scene size differences and is also applied in recent works [74, 85]. We refer to $o_{t}^{\prime i} = (x_{t}^{\prime i}, y_{t}^{\prime i})$ as the "relative coordinates" for the following graph construction. + +We define the graph $G_{t} = (V_{t},E_{t},F_{t})$ , where $V_{t} = \{v_{t;i}|i = 1,\dots,N\}$ is the vertex set of pedestrians in the graph, $E_{t} = \{e_{t;i,j}|i,j = 1,\dots,N\}$ is the edge set that indicates the relationship between two pedestrians, and $F_{t} = \{f_{t;i}|i = 1,\dots,N\} \in \mathbb{R}^{N\times D_{f}}$ is the feature matrix associated with each pedestrian $v_{t;i}$ ( $D_{f}$ is the feature dimension). The topological structure of graph $G_{t}$ is represented by the adjacency matrix $A_{t} = \{a_{t;i,j}|i,j = 1,\dots,N\} \in \mathbb{R}^{N\times N}$ . In our case, the value of $a_{t;i,j}$ in adjacency matrix $A_{t}$ is + +initialized as the distance between pedestrian $i$ and $j$ as, + +$$ +a _ {t; i, j} = \left\| o ^ {\prime} _ {t} ^ {i} - o ^ {\prime} _ {t} ^ {j} \right\| _ {2}, \tag {3} +$$ + +where $\| * \|_2$ is the $L_2$ distance, and $o'_t^i$ denotes the "relative coordinates" $o'_t^i = (x'_t^i, y'_t^i)$ of pedestrian $i$ at time step $t$ . As it should be other possible definitions of $a_{t;i,j}$ , we additionally investigate and analysis other three different definitions of $a_{t;i,j}$ , and results indicate that using $L_2$ distance is more appropriate in this situation. + +The value of $f_{t;i}$ in feature matrix $F_{t}$ is defined as, + +$$ +f _ {t; i} = \sigma \left(\left(x _ {t} ^ {\prime}, y _ {t} ^ {\prime}\right); \mathbf {W} _ {o}\right), \tag {4} +$$ + +where $\mathbf{W}_o\in \mathbb{R}^{2\times D_f}$ are projection learnable parameters, $\sigma (\cdot)$ is ReLU non-linearity activation function. + +To measure the relative importance of dynamic spatial relations between pedestrians, the graph attention layer from [67] is adopted here to update the adjacency matrix $A_{t}$ . The graph attention coefficients are calculated as, + +$$ +\alpha_ {t; i, j} = \frac {\exp (\phi (\mathbf {W} _ {l} [ \mathbf {a} _ {t ; i} \oplus \mathbf {a} _ {t ; j} ]))}{\sum_ {j = 1} ^ {N} \exp (\phi (\mathbf {W} _ {l} [ \mathbf {a} _ {t ; i} \oplus \mathbf {a} _ {t ; j} ]))}, \tag {5} +$$ + +where $\mathbf{a}_{t;i} \in \mathbb{R}^{N \times 1}$ is $i^{th}$ column vector in $A_{t}$ , $\mathbf{W}_{l} \in \mathbb{R}^{1 \times 2N}$ are learnable parameters, $\oplus$ represents the concatenation that operates in the dimension of row, $\phi$ is LeakyReLU non-linearity activation function with $\theta = 0.2$ . The same parameters are used here, see [67] for details. + +The linear combination $\mathbf{p}_{t;i}$ is thus computed according to the obtained attention coefficients. Formally, we have, + +$$ +\mathbf {p} _ {t; i} = \sigma \left(\sum_ {j = 1} ^ {N} \alpha_ {t; i, j} \mathbf {a} _ {t; j}\right). \tag {6} +$$ + +With each column vector $\mathbf{p}_{t;i}$ concatenated together, we obtain the new updated adjacency matrix $A_{t}^{\prime}\in \mathbb{R}^{N\times N}$ , which contains the information of global spatial features of pedestrians at time step $t$ . Then, the GCN layers [30] are applied here to further extract spatial-temporal features. Similar with [48], we first add identity matrix to $\hat{A}_t$ as, + +$$ +\hat {A} _ {t} = A _ {t} ^ {\prime} + I. \tag {7} +$$ + +Then, we stack $\hat{A}_t$ from time step $T_1$ to $T_{obs}$ as $\hat{A} = \{\hat{A}_1,\hat{A}_2,\dots,\hat{A}_{obs}\} \in \mathbb{R}^{N\times N\times L_{obs}}$ and also stack vertex feature matrices of the $l^{th}$ layer from time step $T_1$ to $T_{obs}$ as $F_t^{(l)} = \{F_1^{(l)},F_2^{(l)},\dots,F_{obs}^{(l)}\} \in \mathbb{R}^{N\times D_f\times L_{obs}}$ , where $L_{obs}$ represents the observation length. In addition, the stack of node degree matrices $D = \{D_{1},D_{2},\dots,D_{obs}\}$ are correspondingly calculated from $\{\hat{A}_1,\hat{A}_2,\dots,\hat{A}_{obs}\}$ . + +Finally, the output $F^{(l + 1)} \in \mathbb{R}^{N \times D_f \times L_{obs}}$ of the $(l + 1)^{th}$ layer is calculated as, + +$$ +F ^ {(l + 1)} = \sigma \left(D ^ {- \frac {1}{2}} \hat {A} D ^ {\frac {1}{2}} F ^ {(l)} \mathbf {W} ^ {(l)}\right), \tag {8} +$$ + +where $\mathbf{W}^{(l)}$ are learnable parameters of the $l^{th}$ layer. + +In our case, three cascaded GCN layers ( $l = 3$ ) are employed to extract spatial-temporal feature representations of observed trajectories. Both source and target trajectories are constructed as graphs accordingly and then fed into the parameter-shared GCN layers for feature representation extraction. For simplicity, we denote the final feature representations of source trajectory domain as $F_{(s)} \in \mathbb{R}^{N^s \times D_f \times L_{obs}}$ , and target trajectory domain as $F_{(t)} \in \mathbb{R}^{N^t \times D_f \times L_{obs}}$ , where $N^s$ and $N^t$ are two different numbers of pedestrians from source and target domains. + +# 3.3. Attention-Based Adaptive Learning + +Given the misalignment of feature representations between source and target trajectory domains, we introduce an individual-wise attention-based adaptive knowledge learning module for transfer learning. Different from conventional domain adaptation situations, where each sample has determined category and fixed feature space. The feature space of trajectory sample is not fixed as the numbers of pedestrians are different in source and target trajectory domains. In order to address this misalignment problem, we propose a novel attention-based adaptive knowledge learning module to refine and effectively concentrate on the most relevant feature space for misalignment alleviation. + +For individual-wise attention, we first reformat the final feature representations $F_{(s)}$ and $F_{(t)}$ as, + +$$ +F _ {(s)} = \left[ \begin{array}{l} \mathbf {f} _ {(s)} ^ {1}, \mathbf {f} _ {(s)} ^ {2}, \dots , \mathbf {f} _ {(s)} ^ {N ^ {s}} \\ \vdots \end{array} \right], \quad \mathbf {f} _ {(s)} ^ {i} \in \mathbb {R} ^ {D _ {f} \times L _ {o b s}}, \tag {9} +$$ + +$$ +F _ {(t)} = \left[ \mathbf {f} _ {(t)} ^ {1}, \mathbf {f} _ {(t)} ^ {2}, \dots , \mathbf {f} _ {(t)} ^ {N ^ {t}} \right], \quad \mathbf {f} _ {(t)} ^ {i} \in \mathbb {R} ^ {D _ {f} \times L _ {o b s}}, +$$ + +where $\mathbf{f}_{(s)}^i$ and $\mathbf{f}_{(t)}^i$ correspond to the feature maps of one pedestrian from source and target trajectory domain. Then we reshape the feature maps $\mathbf{f}_{(s)}^i$ and $\mathbf{f}_{(t)}^i$ to the feature vector with the size of $\mathbb{R}^{D_v}$ , where $D_{v} = D_{f}\times L_{obs}$ . + +Although the feature vector keeps the spatial-temporal information of one pedestrian, we cannot decide how representative of one pedestrian's feature vector is in one trajectory domain. Therefore, an attention module is introduced to learn the relative relevance between feature vectors and trajectory domain. The attention scores are calculated as, + +$$ +\begin{array}{l} \beta_ {(s)} ^ {i} = \frac {\exp \left(\mathbf {h} ^ {\top} \tanh \left(\mathbf {W} _ {f} \mathbf {f} _ {(s)} ^ {i}\right)\right)}{\sum_ {j = 1} ^ {N ^ {s}} \exp \left(\mathbf {h} ^ {\top} \tanh \left(\mathbf {W} _ {f} \mathbf {f} _ {(s)} ^ {j}\right)\right)}, \tag {10} \\ \beta_ {(t)} ^ {i} = \frac {\exp (\mathbf {h} ^ {\top} \tanh (\mathbf {W} _ {f} \mathbf {f} _ {(t)} ^ {i}))}{\sum_ {j = 1} ^ {N ^ {t}} \exp (\mathbf {h} ^ {\top} \tanh (\mathbf {W} _ {f} \mathbf {f} _ {(t)} ^ {j}))}, \\ \end{array} +$$ + +where $\mathbf{h}^{\top}$ and $\mathbf{W}_f$ are learnable parameters. Then the final feature representations of source and target trajectory domains $\mathbf{c}_{(s)}\in \mathbb{R}^{D_v}$ and $\mathbf{c}_{(t)}\in \mathbb{R}^{D_v}$ are calculated as, + +$$ +\begin{array}{l} \mathbf {c} _ {(s)} = \sum_ {i = 1} ^ {N ^ {s}} \left(\beta_ {(s)} ^ {i} \mathbf {f} _ {(s)} ^ {i}\right), \tag {11} \\ \mathbf {c} _ {(t)} = \sum_ {i = 1} ^ {N ^ {t}} (\beta_ {(t)} ^ {i} \mathbf {f} _ {(t)} ^ {i}). \\ \end{array} +$$ + +These two context vectors $\mathbf{c}_{(s)}$ and $\mathbf{c}_{(t)}$ correspond to the refined individual-level representations of source and target trajectory domains. A similarity loss $\mathcal{L}_{\text{align}}$ for distribution alignment is accordingly introduced as, + +$$ +\mathcal {L} _ {\text {a l i g n}} = E _ {[ \mathbf {c} _ {(s)} \in \text {s o u r c e}, \mathbf {c} _ {(t)} \in \text {t a r g e t} ]} \left\{\operatorname {d i s t} \left(\mathbf {c} _ {(s)}, \mathbf {c} _ {(t)}\right) \right\}. \tag {12} +$$ + +There are multiple choices for the distance function $dist$ such as $L_{2}$ distance, MMD loss [39, 51], CORAL loss [61, 87], and adversarial loss [17, 71]. We explore these four alignment measures in Sec. 4, and results indicate that $L_{2}$ distance is more appropriate. Thus, we have, + +$$ +\mathcal {L} _ {\text {a l i g n}} = \frac {1}{D _ {f}} \left| \left| \mathbf {c} _ {(s)} - \mathbf {c} _ {(t)} \right| \right| _ {2} ^ {2}. \tag {13} +$$ + +# 3.4. Temporal Prediction Module + +Instead of making predictions frame by frame, TCN [4] layers are employed to make future trajectory predictions based on the spatial-temporal feature representations $F_{(s)}$ from source trajectory domain. This prediction strategy is able to alleviate the error accumulating problem in sequential predictions caused by RNNs. It can also avoid gradient vanishing or reduce high computational costs [10, 23]. Recent works [48, 60] also utilized this strategy for prediction. + +Given the feature representation $F_{(s)}\in \mathbb{R}^{N^s\times D_f\times L_{obs}}$ we pass $F_{(s)}$ through TCN layers in time dimension to obtain their corresponding future trajectories. Formally, for the $l^{th}$ TCN layer, we have, + +$$ +F _ {(s)} ^ {(l + 1)} = \operatorname {T C N} \left(F _ {(s)} ^ {(l)}; \mathbf {W} _ {t} ^ {(l)}\right), \tag {14} +$$ + +where $\mathbf{W}_t^{(l)}$ are leeanable parameters of the $l^{th}$ TCN layer, $F^{(l + 1)}\in \mathbb{R}^{N^s\times D_f\times L_{pred}}$ represents the prediction output $(L_{pred}$ represents the length to be predicted). In our case, three three cascaded TCN layers $(l = 3)$ are employed to obtain the final output which we refer to as $F_{(s),pred}$ + +Similar assumption is made that pedestrian coordinates $(x_{t}^{i},y_{t}^{i})$ follow a bi-variate Gaussian distribution as $(x_{t}^{i},y_{t}^{i})\sim \mathcal{N}(\hat{\mu}_{t}^{i},\hat{\sigma}_{t}^{i},\hat{\rho}_{t}^{i})$ , where $\hat{\mu}_t^i = (\hat{\mu}_x,\hat{\mu}_y)_t^i$ is the mean, $\hat{\sigma}_t^i = (\hat{\sigma}_x,\hat{\sigma}_y)_t^i$ is the standard deviation, and $\hat{\rho}_t^i$ is the correlation coefficient. These parameters are determined by passing $F_{(s),pred}$ through one linear layer as, + +$$ +\left(\hat {\mu} _ {t} ^ {i}, \hat {\sigma} _ {t} ^ {i}, \hat {\rho} _ {t} ^ {i}\right) = \operatorname {L i n e a r} \left(F _ {(s), p r e d}; \mathbf {W} _ {p}\right), \tag {15} +$$ + +where $\mathbf{W}_p$ are learnable parameters of this linear layer. + +# 3.5. Objective Function + +The overall objective function consists of two terms, the prediction loss $\mathcal{L}_{pre}$ for predicting future trajectory prediction and the alignment loss $\mathcal{L}_{align}$ for aligning the distributions of source and target trajectory domains. The prediction loss $\mathcal{L}_{pre}$ is the negative log-likelihood as, + +$$ +\mathcal {L} _ {p r e} = - \sum_ {t = T _ {o b s} + 1} ^ {T _ {p r e d}} \log \left(\mathbb {P} \left((x _ {t} ^ {i}, y _ {t} ^ {i}) | \hat {\mu} _ {t} ^ {i}, \hat {\sigma} _ {t} ^ {i}, \hat {\rho} _ {t} ^ {i}\right)\right). \tag {16} +$$ + +Note that only samples from source trajectory domain participate in the prediction phase. The whole model is trained by jointly minimizing the prediction loss $\mathcal{L}_{pre}$ and the alignment loss $\mathcal{L}_{\text{align}}$ , thus we have, + +$$ +\mathcal {L} = \mathcal {L} _ {p r e} + \lambda \mathcal {L} _ {\text {a l i g n}}, \tag {17} +$$ + +where $\lambda$ is a hyper-parameter for balancing these two terms. + +# 4. Experiments + +In this section, we first present the definition of our proposed new setting as well as the evaluation protocol, then we carry out extensive evaluations on our proposed T-GNN model under this new setting, in comparison with previous existing methods and different domain adaptation strategies. Additional evaluation results and feature visualizations are provided in the supplementary material. + +Datasets. Experiments are conducted on two real-world datasets: ETH [54] and UCY [34] as these two public datasets are widely used in this task. ETH consists of two + +scenes named ETH and HOTEL, and UCY consists of three scenes named UNIV, ZARA1, and ZARA2. + +Experimental Setting. We introduce a more general and practical setting that treats each scene as one trajectory domain. The model is trained on only one domain and tested on other four domains, respectively. Given five trajectory domains, we have total 20 trajectory prediction tasks: A $\rightarrow$ B/C/D/E, B $\rightarrow$ A/C/D/E, C $\rightarrow$ A/B/D/E, D $\rightarrow$ A/B/C/E, and E $\rightarrow$ A/B/C/D, where A, B, C, D, and E represents ETH, HOTEL, UNIV, ZARA1, and ZARA2, respectively. This setting is challenging because of the domain gap issue. + +Evaluation Protocol. To ensure the fair comparison under the new setting, existing baselines are trained with one source trajectory domain as well as the validation set of the target trajectory domain. Specifically, take $\mathrm{A} \rightarrow \mathrm{B}$ as the example, existing baselines are trained with the training set of A and the validation set of B, then evaluated on the testing set of B. Our proposed model considers the training set of A as the source trajectory domain and the validation set of B as the target trajectory domain, then evaluated on the testing set of B. Note that the validation set and the testing set are independent of each other and there is no overlap sample between the validation set and the testing set. In the training phase, our proposed model only has access to the observed trajectory from the validation set. + +Baselines. Five state-of-the-art methods are compared with our proposed method under the new setting and the evaluation protocol. Social-STGCNN [48], PECNet [47], RSBG [62], SGCN [60], and Tra2Tra [74]. We also use following four widely-used DA approaches for comparison. T-GNN+MMD: using the multi kernel-maximum mean discrepancies loss [39] as $\mathcal{L}_{\text{align}}$ , T-GNN+CORAL: using the CORAL loss [61] as $\mathcal{L}_{\text{align}}$ ; T-GNN+GFK: using the kernel-based domain adaptation strategy [20], and T-GNN+UDA: unsupervised domain adaptive graph convolutional network using the adversarial loss [71]. + +Evaluation Metrics. Following two metrics are used to for performance evaluation. In these two metrics, $N^t$ is the total number of pedestrians in target trajectory domain, $\overline{o}_t^i$ are predictions, and $o_t^i$ are ground-truth coordinates. + +- Average Displacement Error (ADE): + +$$ +A D E = \frac {\sum_ {i = 1} ^ {N ^ {t}} \sum_ {t = T _ {o b s + 1}} ^ {T _ {p r e d}} \| o _ {t} ^ {i} - \bar {o} _ {t} ^ {i} \| _ {2}}{N ^ {t} \left(T _ {p r e d} - T _ {o b s}\right)}. \tag {18} +$$ + +- Final Displacement Error (FDE): + +$$ +F D E = \frac {\sum_ {i = 1} ^ {N ^ {t}} \| o _ {p r e d} ^ {i} - \bar {o} _ {p r e d} ^ {i} \| _ {2}}{N ^ {t}}. \tag {19} +$$ + +Implementation Details. Similar with previous baselines, 8 frames are observed and the next 12 frames are predicted. The number of GCN layers is set as 3, the number of TCN + +
MethodYearPerformance (ADE) (Source2Target)Ave
A2BA2CA2DA2EB2AB2CB2DB2EC2AC2BC2DC2ED2AD2BD2CD2EE2AE2BE2CE2D
Social-STGCNN [48]20201.831.581.301.313.021.382.631.581.160.700.820.541.041.050.730.470.981.090.740.501.22
PECNet [47]20201.971.681.241.353.111.352.691.621.390.820.930.571.101.170.920.521.011.250.830.611.31
RSBG [62]20202.211.591.481.423.181.492.721.731.230.871.040.601.191.210.800.491.091.371.030.781.38
Tra2Tra [74]20211.721.581.271.373.321.362.671.581.160.700.850.601.091.070.810.521.031.100.750.521.25
SGCN [60]20211.681.541.261.283.221.382.621.581.140.700.820.521.050.970.800.480.971.080.750.511.22
T-GNN (Ours)-1.131.250.941.032.541.082.251.410.970.540.610.230.880.780.590.320.870.720.650.340.96
+ +Table 2. ADE results of our T-GNN model in comparison with existing state-of-the-art baselines on 20 tasks. “2” represents from source domain to target domain. A, B, C, D, and E denote ETH, HOTEL, UNIV, ZARA1, and ZARA2, respectively. + +
MethodYearPerformance (FDE) (Source2Target)
A2BA2CA2DA2EB2AB2CB2DB2EC2AC2BC2DC2ED2AD2BD2CD2DD2ED2CD2ED2AD2BD2CD2DD2ED2CD2ED2CD2ED2CD2ED2AD2BE2AE2BE2CE2D
Social-STGCNN [48]20203.242.862.532.435.162.514.862.882.301.341.741.102.211.991.410.882.102.051.471.01
+ +Table 3. FDE results of our T-GNN model in comparison with existing state-of-the-art baselines on 20 tasks. “2” represents from source domain to target domain. A, B, C, D, and E denote ETH, HOTEL, UNIV, ZARA1, and ZARA2, respectively. + +
MethodAverage Performance
ADE/FDE
T-GNN+MMD [39]1.11/2.11
T-GNN+CORAL [87]1.07/2.01
T-GNN+GFK [20]1.15/2.08
T-GNN+UDA [71]1.07/2.09
T-GNN (Ours)0.96/1.82
+ +Table 4. Average performance on 20 tasks of our T-GNN model in comparison with other four commonly used DA approaches. + +
Valueλ = 0.01λ = 0.1λ = 1λ = 5λ = 10
ADE1.191.050.961.161.31
FDE2.162.021.822.072.45
+ +Table 5. Average performance on 20 tasks of our T-GNN model with 5 different values of $\lambda$ . + +layers is set as 3, and the feature dimension is set as 64. In the training phase, the batch size is set as 16 and $\lambda$ is set as 1. The whole model is trained for 200 epochs and Adam [13] is applied as the optimizer. We set the initial learning rate as 0.001 and change to 0.0005 after 100 epochs. In the inference phase, 20 predicted trajectories are sampled and the best amongst 20 predictions is used for evaluation. + +# 4.1. Quantitative Analysis + +Tabs. 2 and 3 show the evaluation results of 20 tasks in comparison with five existing baselines. Tab. 4 shows the average performance of total 20 tasks in comparison with four existing domain adaptation approaches. + +T-GNN vs Other Baselines. In general, our proposed T- + +GNN model, no matter on which task, consistently outperforms the other five baselines. Overall, our T-GNN model improves by $21.31\%$ comparing with Social-STGCNN and SGCN models on the ADE metric, and improves by $20.52\%$ comparing with PCENet and SGCN models on the FDE metric. It validates that our T-GNN model has the ability to learn transferable knowledge from source to target trajectory domain and alleviate the domain gap. As mentioned in Sec. 4, these baselines have access to the whole validation set of the target domain while our model only has access to the observed trajectories from the validation set. Results indicate that directly training with mixed data from different trajectory domains is worse than with our domain-invariant knowledge learning approach. In addition, for tasks D2E and E2D, all the models have relatively smaller ADE and FDE. One possible reason is that domain D (ZARA1) and E (ZARA2) have similar background and surroundings, in which pedestrians may have similar moving pattern. This phenomenon further illustrates the importance of considering the domain-shift problem in trajectory prediction task. + +T-GNN vs Other DA Approaches1. Generally speaking, our T-GNN model using $L_{2}$ distance as the alignment loss achieves the best average performance. It indicates that $L_{2}$ distance is more appropriate for similarity measure in trajectory prediction task. One intuitive reason is that in trajectory prediction task, high-dimensional feature representations may still reserve the spatial-level information. + +# 4.2. Ablation Study + +We first study the performance of different values of $\lambda$ in the objective function, and then study the contributions of + +
VariantsIDPerformance (ADE/FDE)
A2BB2CC2DD2EE2A
T-GNN w/o GAL11.51/2.341.17/1.900.69/1.420.39/0.710.90/1.98
T-GNN w/o AAL w/ AP21.78/2.851.23/2.020.77/1.530.42/0.790.96/2.03
T-GNN w/o AAL w/ LL31.81/2.911.25/2.030.76/1.480.43/0.790.94/2.01
Social-STGCNN-V1 [48]42.18/3.682.30/3.211.59/2.541.23/1.721.73/2.98
SGCN-V1 [60]52.03/3.532.35/3.221.68/2.711.12/1.591.81/3.02
T-GNN-V162.12/3.582.28/3.211.73/2.761.19/1.581.74/2.95
Social-STGCNN [48]71.83/3.241.38/2.510.82/1.740.47/0.880.98/2.10
SGCN [60]81.68/3.241.38/2.470.82/1.710.48/0.970.97/2.10
T-GNN-V291.89/3.251.35/2.480.88/1.930.53/0.970.98/2.16
T-GNN (Ours)101.13/2.181.08/1.820.61/1.300.32/0.650.87/1.86
+ +Table 6. Performance of different variants of T-GNN on 5 selected tasks. + +each proposed component. In addition, we investigate the functionality of our proposed adaptive learning module. + +Performance Study of $\lambda$ . The hyper-parameter $\lambda$ is used to balance the two terms in Eq. (17). Setting $\lambda$ too small results in the failure of alignment, on the contrary, setting $\lambda$ too large results in too heavy alignment. We set different values to find the most suitable $\lambda$ . Tab. 5 shows the average performance on 20 tasks of our T-GNN model with five different values $\lambda = \{0.01, 0.1, 1, 5, 10\}$ . When we set $\lambda = 1$ , our T-GNN model can achieve the best performance. + +Contributions of Each Component. We evaluate following 3 different variants of our T-GNN model on 5 selected tasks A2B, B2C, C2D, D2E, and E2A. (1) T-GNN w/o GAL denotes that the graph attention component defined in Eqs. (5) and (6) is removed, thus $\alpha_{t;i,j}$ will not be updated during training. (2) T-GNN w/o AAL w/ AP denotes that the attention-based adaptive learning module is replaced with one average pooling layer, in which features $F_{s}$ and $F_{t}$ are reshaped and passed through one average pooling layer that operates in the "sample" dimension to obtain $\mathbf{c}_{(s)}$ and $\mathbf{c}_{(t)}$ . (3) T-GNN w/o AAL w/ LL denotes that the attention-based adaptive learning module is replaced with one trainable linear layer. The results are illustrated in Tab. 6. + +It can be observed from Tab. 6 that removing the graph attention component results in the performance reduction, which indicates the graph attention component is effective to extract relation features. Replacing our proposed attention-based adaptive learning module with either one average pooling layer or one trainable linear layer also results in the performance reduction, which indicates the effectiveness of our proposed adaptive learning module for exploring the individual-level domain-invariant knowledge. + +Effectiveness of Adaptive Learning. Experiments are carried out to further study the effectiveness of adaptive learning module in our T-GNN model. We remove the attention-based adaptive learning module presented in Sec. 3.3 and disregard the alignment loss defined in Eq. (13). Thus, our + +model is trained only on the source trajectory domain and evaluated on one novel target trajectory domain, which we refer to as T-GNN- $V_{1}$ . For further comparison, two graph-based baselines Social-STGCNN [48] and SGCN [60] are also trained without using the validation set, which we refer to as Social-STGCNN- $V_{1}$ and SGCN- $V_{1}$ . In addition, we directly train our model with mixed samples without domain-invariant adaptive learning module, which we refer to as T-GNN- $V_{2}$ . The results are illustrated in Tab. 6. + +In comparison with variants 4, 5, and 6, the results indicate that the backbone of our T-GNN model is competitive with these two graph-based backbones, which validates that our T-GNN can extract effective spatial-temporal features of observed trajectories. In comparison with variants 7, 8, and 9, all three variants can achieve competitive performance since the training data is exactly the same. In addition, these three variants all outperform variants 4, 5, and 6 correspondingly, because variants 7, 8, and 9 all have access to the validation set of target trajectory domain. Results of variants 7, 8, 9 and 10 validate that our proposed domain-invariant transfer learning approach is superior to directly training with mixed data from different trajectory domains. + +# 5. Conclusion + +In this paper, we delve into the domain shift challenge in the pedestrian trajectory prediction task. Specifically, a more real, practical yet challenging trajectory prediction setting is proposed. Then we propose a unified model which contains a Transferable Graph Neural Network for future trajectory prediction as well as a domain-invariant knowledge learning approach simultaneously. Extensive experiments prove the superiority of our T-GNN model in both future trajectory prediction and trajectory domain-shift alleviation. Our work is the first that studies this problem and fills the gap in benchmarks and techniques for practical pedestrian trajectory prediction across different domains. + +# References + +[1] Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social LSTM: Human trajectory prediction in crowded spaces. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 961-971, 2016. 1, 3 +[2] Javad Amirian, Jean-Bernard Hayet, and Julien Pettré. Social ways: Learning multi-modal distributions of pedestrian trajectories with GANs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 2964-2972, 2019. 3 +[3] Haoyu Bai, Shaojun Cai, Nan Ye, David Hsu, and Wee Sun Lee. Intention-aware online POMDP planning for autonomous driving in a crowd. In Proceedings of the IEEE International Conference on Robotics and Automation, pages 454-460, 2015. 1 +[4] Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv:1803.01271, 2018. 5 +[5] Niccolò Bisagno, Bo Zhang, and Nicola Concì. Group LSTM: Group trajectory prediction in crowded scenarios. In Proceedings of the European Conference on Computer Vision, pages 213-225, 2018. 3 +[6] Ruichu Cai, Fengzhu Wu, Zijian Li, Pengfei Wei, Lingling Yi, and Kun Zhang. Graph domain adaptation: A generative view. arXiv preprint arXiv:2106.07482, 2021. 3 +[7] Guangyi Chen, Junlong Li, Jiwen Lu, and Jie Zhou. Human trajectory prediction via counterfactual analysis. In Proceedings of the IEEE International Conference on Computer Vision, pages 9824-9833, 2021. 1, 3 +[8] Guangyi Chen, Junlong Li, Nuoxing Zhou, Liangliang Ren, and Jiwen Lu. Personalized trajectory prediction via distribution discrimination. In Proceedings of the IEEE International Conference on Computer Vision, pages 15580-15589, 2021. 1 +[9] Hao Cheng, Wentong Liao, Xuejiao Tang, Michael Ying Yang, Monika Sester, and Bodo Rosenhahn. Exploring dynamic context for multi-path trajectory prediction. arXiv preprint arXiv:2010.16267, 2020. 1, 3 +[10] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014. 5 +[11] Patrick Dendorfer, Sven Elflein, and Laura Leal-Taixe. Møgan: A multi-generator model preventing out-of-distribution samples in pedestrian trajectory prediction. In Proceedings of the IEEE International Conference on Computer Vision, pages 13158-13167, 2021. 1, 3 +[12] Jacob Devlin, Ming Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.3 +[13] P. Kingma Diederik and Ba Jimmy. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations, 2015. 7 +[14] Zhengming Ding, Sheng Li, Ming Shao, and Yun Fu. Graph adaptive knowledge transfer for unsupervised domain adap + +tation. In Proceedings of the European Conference on Computer Vision, pages 37-52, 2018. 3 +[15] David Ellis, Eric Sommerlade, and Ian Reid. Modelling pedestrian trajectory patterns with gaussian processes. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 1229-1234, 2009. 3 +[16] Tharindu Fernando, Simon Denman, Sridha Sridharan, and Clinton Fookes. GD-GAN: Generative adversarial networks for trajectory prediction and group detection in crowds. In Proceedings of the Asian Conference on Computer Vision, pages 314-330, 2018. 1, 3 +[17] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In Proceedings of the International Conference on Machine Learning, pages 1180-1189, 2015. 2, 3, 5 +[18] Jiyang Gao, Chen Sun, Hang Zhao, Yi Shen, Dragomir Anguelov, Congcong Li, and Cordelia Schmid. VectorNet: Encoding HD maps and agent dynamics from vectorized representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 11522-11530, 2020. 3 +[19] Francesco Giuliani, Irtiza Hasan, Marco Cristani, and Fabio Galasso. Transformer networks for trajectory forecasting. In Proceedings of the IEEE International Conference on Pattern Recognition, pages 10335–10342, 2020. 3 +[20] Boqing Gong, Yuan Shi, Fei Sha, and K. Grauman. Geodesic flow kernel for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2066-2073, 2015. 3, 6, 7 +[21] Agrim Gupta, Justin Johnson, Li Fei-Fei, Silvio Savarese, and Alexandre Alahi. Social GAN: Socially acceptable trajectories with generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2255–2264, 2018. 1 +[22] Gewen He, Xiaofeng Liu, Fangfang Fan, and Jane You. Classification-aware semi-supervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 4147-4156, 2020. 3 +[23] Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735-1780, 1997. 5 +[24] Yue Hu, Siheng Chen, Ya Zhang, and Xiao Gu. Collaborative motion prediction via neural motion message passing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6319-6328, 2020. 1, 3 +[25] Hal Daumé III, Abhishek Kumar, and Avishek Saha. Coregularization based semi-supervised domain adaptation. In Proceedings of the Advances in Neural Information Processing Systems, 2010. 3 +[26] Boris Ivanovic and Marco Pavone. The trajectory: Probabilistic multi-agent trajectory modeling with dynamic spatiotemporal graphs. In Proceedings of the IEEE International Conference on Computer Vision, pages 2375-2384, 2019. 2, 3 +[27] Ashesh Jain, Amir R Zamir, Silvio Savarese, and Ashutosh Saxena. Structural-RNN: Deep learning on spatio-temporal graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5308-5317, 2016. 3 + +[28] Magdiel Jiménez-Guarneros and Pilar Gómez-Gil. A study of the effects of negative transfer on deep unsupervised domain adaptation methods. Expert Systems with Applications, 167:114088, 2020. 3 +[29] Christopher Keat and Christian Laugier. Modelling smooth paths using gaussian processes. In Proceedings of the International Conference on Field and Service Robotics, pages 381-390, 2007. 3 +[30] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In Proceedings of the International Conference on Learning Representations, 2017. 5 +[31] Kris M. Kitani, Brian D. Ziebart, James Andrew Bagnell, and Martial Hebert. Activity forecasting. In Proceedings of the European Conference on Computer Vision, pages 201-214, 2012. 3 +[32] Vineet Kosaraju, Amir Sadeghian, Roberto Martin-Martin, Ian Reid, Hamid Rezatofighi, and Silvio Savarese. Socialbigat: Multimodal trajectory forecasting using bicycle-gan and graph attention networks. In Proceedings of the Advances in Neural Information Processing Systems, pages 137-146, 2019. 3 +[33] Parth Kothari, Brian Sifringer, and Alexandre Alahi. Interpretable social anchors for human trajectory forecasting in crowds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 15556-15566, 2021. 3 +[34] Alon Lerner, Yiorgos Chrysanthou, and Dani Lischinski. Crowds by example. Computer Graphics Forum, 26(3):655-664, 2010. 6 +[35] Jiachen Li, Hengbo Ma, and Masayoshi Tomizuka. Conditional generative neural system for probabilistic trajectory prediction. arXiv preprint arXiv:1905.01631, 2019. 1, 3 +[36] Shijie Li, Yanying Zhou, Jinhui Yi, and Juergen Gall. Spatial-temporal consistency network for low-latency trajectory forecasting. In Proceedings of the IEEE International Conference on Computer Vision, pages 1940-1949, 2021. 2 +[37] Junwei Liang, Lu Jiang, and Alexander Hauptmann. Simaug: Learning robust representations from simulation for trajectory prediction. In Proceedings of the European Conference on Computer Vision, pages 275-292, 2020. 3 +[38] Junwei Liang, Lu Jiang, Juan Carlos Niebles, Alexander G Hauptmann, and Li Fei-Fei. Peeking into the future: Predicting future person activities and locations in videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5725–5734, 2019. 1, 3 +[39] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In Proceedings of the International Conference on Machine Learning, pages 97-105, 2015. 2, 3, 5, 6, 7 +[40] Matthias Luber, Johannes A Stork, Gian Diego Tipaldi, and Kai O Arras. People tracking with human motion predictions from social forces. In Proceedings of the IEEE International Conference on Robotics and Automation, pages 464-469, 2010. 1 +[41] Zimeng Luo, Jiani Hu, Weihong Deng, and Haifeng Shen. Deep unsupervised domain adaptation for face recognition. + +In Proceedings of the IEEE International Conference on Automatic Face & Gesture Recognition, pages 453-457, 2018. 3 +[42] Qianqian Ma, Yang-Yu Liu, and Alex Olshevsky. Optimal lockdown for pandemic control. arXiv preprint arXiv:2010.12923, 2020. 1 +[43] Qianqian Ma and Alex Olshovsky. Adversarial crowdsourcing through robust rank-one matrix completion. In Proceedings of the Advances in Neural Information Processing Systems, pages 21841-21852, 2020. 3 +[44] Osama Makansi, Özgün Cicek, Yassine Marrakchi, and Thomas Brox. On exposing the challenging long tail in future prediction of traffic actors. In Proceedings of the IEEE International Conference on Computer Vision, pages 13127-13137, 2021. 3 +[45] Dimitrios Makris and Tim Ellis. Spatial and probabilistic modelling of pedestrian behaviour. In Proceedings of the British Machine Vision Conference, pages 54.1-54.10, 2002. 3 +[46] Karttikeya Mangalam, Yang An, Harshayu Girase, and Jitendra Malik. From goals, waypoints & paths to long term human trajectory forecasting. In Proceedings of the IEEE International Conference on Computer Vision, pages 15233-15242, 2021. 3 +[47] Karttikeya Mangalam, Harshayu Girase, Shreyas Agarwal, Kuan Hui Lee, Ehsan Adeli, Jitendra Malik, and Adrien Gaidon. It is not the journey but the destination: Endpoint conditioned trajectory prediction. In Proceedings of the European Conference on Computer Vision, pages 759-776, 2020. 1, 3, 6, 7 +[48] Abduallah Mohamed, Kun Qian, Mohamed Elhoseiny, and Christian Claudel. Social-STGCNN: A social spatiotemporal graph convolutional neural network for human trajectory prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 14424-14432, 2020. 2, 3, 5, 6, 7, 8 +[49] Mehdi Moussaïd, Niriaska Perozo, Simon Garnier, Dirk Helbing, and Guy Theraulaz. The walking behaviour of pedestrian social groups and its impact on crowd dynamics. *PloS one*, 5(4):e10047, 2010. 1 +[50] Basam Musleh, Fernando García, Javier Otamendi, José Ma Armingol, and De La Escalera Arturo. Identifying and tracking pedestrians based on sensor fusion and motion stability predictions. Sensors, 10(9):8028-8053, 2010. 1 +[51] Jie Ni, Qiang Qiu, and Rama Chellappa. Subspace interpolation via dictionary learning for unsupervised domain adaptation. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 692-699, 2013. 2, 3, 5 +[52] Takenori Obo and Yuto Nakamura. Intelligent robot navigation based on human emotional model in human-aware environment. In Proceedings of the International Conference on Machine Learning and Cybernetics, pages 1-6, 2020. 1 +[53] Bo Pang, Tianyang Zhao, Xu Xie, and Ying Nian Wu. Trajectory prediction with latent belief energy-based model. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 11814-11824, 2021. 3 + +[54] Stefano Pellegrini, Andreas Ess, Konrad Schindler, and Luc J. Van Gool. You'll never walk alone: Modeling social behavior for multi-target tracking. In Proceedings of the IEEE International Conference on Computer Vision, pages 261-268, 2009. 6 +[55] Christoph Rosmann, Malte Oeljeklaus, Frank Hoffmann, and Torsten Bertram. Online trajectory prediction and planning for social robot navigation. In Proceedings of the IEEE International Conference on Advanced Intelligent Mechatronics, pages 1255–1260, 2017. 3 +[56] Amir Sadeghian, Vineet Kosaraju, Ali Sadeghian, Noriaki Hirose, Hamid Rezatofighi, and Silvio Savarese. SoPhie: An attentive GAN for predicting paths compliant to social and physical constraints. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1349-1358, 2019. 1, 3 +[57] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In Proceedings of the European Conference on Computer Vision, pages 213-226, 2010. 3 +[58] Tim Salzmann, Boris Ivanovic, Punarjay Chakravarty, and Marco Pavone. Trajectory++: Dynamically-feasible trajectory forecasting with heterogeneous data. In Proceedings of the European Conference on Computer Vision, pages 683-700, 2020. 1 +[59] Nasim Shafiee, Taskin Padir, and Ehsan Elhamifar. Introvert: Human trajectory prediction via conditional 3d attention. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 16815-16825, 2021. 1 +[60] Liushuai Shi, Le Wang, Chengjiang Long, Sanping Zhou, Mo Zhou, Zhenxing Niu, and Gang Hua. Sgcn: Sparse graph convolution network for pedestrian trajectory prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8994-9003, 2021. 2, 3, 5, 6, 7, 8 +[61] Baochen Sun and Kate Saenko. Deep CORAL: Correlation alignment for deep domain adaptation. In Proceedings of the European Conference on Computer Vision, pages 443-450. Springer, 2016. 2, 3, 5, 6 +[62] Jianhua Sun, Qinhong Jiang, and Cewu Lu. Recursive social behavior graph for trajectory prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 660-669, 2020. 2, 3, 6, 7 +[63] Jianhua Sun, Yuxuan Li, Hao-Shu Fang, and Cewu Lu. Three steps to multimodal trajectory prediction: Modality clustering, classification and synthesis. In Proceedings of the IEEE International Conference on Computer Vision, 2021. 3 +[64] Ben Talbot, Feras Dayoub, Peter Corke, and Gordon Wyeth. Robot navigation in unseen spaces using an abstract map. IEEE Transactions on Cognitive and Developmental Systems, 13(4):791-805, 2021. 1 +[65] Hung Tran, Vuong Le, and Truyen Tran. Goal-driven long-term trajectory prediction. In Proceedings of the IEEE Winter Conference on Applications of Computer Vision, pages 796-805, 2021. 3 +[66] 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 the Advances in Neural Information Processing Systems, pages 5998-6008, 2017. 3 +[67] Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. 3, 4 +[68] Anirudh Vemula, Katharina Muelling, and Jean Oh. Social attention: Modeling attention in human crowds. In Proceedings of the IEEE International Conference on Robotics and Automation, pages 1-7, 2018. 3 +[69] Chengxin Wang, Shaofeng Cai, and Gary Tan. Graphcnn: Spatio-temporal interaction modeling for human trajectory prediction. In Proceedings of the IEEE Winter Conference on Applications of Computer Vision, pages 3450-3459, 2021. 2 +[70] Lichen Wang, Bo Zong, Qianqian Ma, Wei Cheng, Jingchao Ni, Wenchao Yu, Yanchi Liu, Dongjin Song, Haifeng Chen, and Yun Fu. Inductive and unsupervised representation learning on graph structured objects. In Proceedings of the International Conference on Learning Representations, 2019. 3 +[71] Man Wu, Shirui Pan, Chuan Zhou, Xiaojun Chang, and Xingquan Zhu. Unsupervised domain adaptive graph convolutional networks. In Proceedings of the Web Conference, pages 1457-1467, 2020. 2, 3, 5, 6, 7 +[72] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 32(1):4-24, 2021. 3 +[73] Yi Xu, Dongchun Ren, Mingxia Li, Yuehai Chen, Mingyu Fan, and Huaxia Xia. Robust trajectory prediction of multiple interacting pedestrians via incremental active learning. In Proceedings of the International Conference on Neural Information Processing, pages 141-150, 2021. 3 +[74] Yi Xu, Dongchun Ren, Mingxia Li, Yuehai Chen, Mingyu Fan, and Huaxia Xia. Tra2tra: Trajectory-to-trajectory prediction with a global social spatial-temporal attentive neural network. IEEE Robotics and Automation Letters, 6(2):1574-1581, 2021. 1, 2, 4, 6, 7 +[75] Yi Xu, Jing Yang, and Shaoyi Du. CF-LSTM: Cascaded feature-based long short-term networks for predicting pedestrian trajectory. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 12541-12548, 2020. 1 +[76] Sijie Yan, Yuanjun Xiong, and Dahua Lin. Spatial temporal graph convolutional networks for skeleton-based action recognition. arXiv preprint arXiv:1801.07455, 2018. 3 +[77] Baoyao Yang, Andy J. Ma, and Pong C. Yuen. Learning domain-shared group-sparse representation for unsupervised domain adaptation. Pattern Recognition, 81:615-632, 2018. 3 +[78] M. Yasuno, N. Yasuda, and M. Aoki. Pedestrian detection and tracking in far infrared images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 125-125, 2004. 1 +[79] Cunjun Yu, Xiao Ma, Jiawei Ren, Haiyu Zhao, and Shuai Yi. Spatio-temporal graph transformer networks for pedestrian trajectory prediction. arXiv preprint arXiv:2005.08514, 2020.3 + +[80] Ye Yuan, Xinshuo Weng, Yanglan Ou, and Kris Kitani. Agentformer: Agent-aware transformers for socio-temporal multi-agent forecasting. In Proceedings of the IEEE International Conference on Computer Vision, pages 9793-9803, 2021. 3 +[81] Luo Yuanfu, Cai Panpan, Bera Aniket, Hsu David, Lee Wee Sun, and Manocha Dinesh. PORCA: Modeling and planning for autonomous driving among many pedestrians. IEEE Robotics and Automation Letters, 3:3418-3425, 2018. 1 +[82] Pu Zhang, Wanli Ouyang, Pengfei Zhang, Jianru Xue, and Nanning Zheng. SR-LSTM: State refinement for LSTM towards pedestrian trajectory prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 12085-12094, 2019. 1, 3 +[83] He Zhao and Richard P Wildes. Where are you heading? Dynamic trajectory prediction with expert goal examples. In Proceedings of the IEEE International Conference on Computer Vision, pages 7629-7638, 2021. 3 +[84] Fang Zheng, Le Wang, Sanping Zhou, Wei Tang, Zhenxing + +Niu, Nanning Zheng, and Gang Hua. Unlimited neighborhood interaction for heterogeneous trajectory prediction. In Proceedings of the IEEE International Conference on Computer Vision, pages 13168-13177, 2021. 3 +[85] Yanliang Zhu, Deheng Qian, Dongchun Ren, and Huaxia Xia. Starnet: Pedestrian trajectory prediction using deep neural network in star topology. In Proceedings of the IEEE International Conference on Intelligent Robots and Systems, pages 8075-8080, 2019. 3, 4 +[86] Yanliang Zhu, Dongchun Ren, Yi Xu, Deheng Qian, Mingyu Fan, Xin Li, and Huaxia Xia. Simultaneous past and current social interaction-aware trajectory prediction for multiple intelligent agents in dynamic scenes. ACM Transactions on Intelligent Systems and Technology, 13:1-16, 2021. 1 +[87] Junbao Zhuo, Shuhui Wang, and Weigang Zhang. Deep unsupervised convolutional domain adaptation. In Proceedings of the ACM International Conference on Multimedia, pages 261-269, 2017. 2, 3, 5, 7 \ No newline at end of file diff --git a/adaptivetrajectorypredictionviatransferablegnn/images.zip b/adaptivetrajectorypredictionviatransferablegnn/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc8a08b748dbf5f4be1af10bbf9645e37dd5a369 --- /dev/null +++ b/adaptivetrajectorypredictionviatransferablegnn/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aece25f756d4f905098b1f6ff118b5a33c7e3b163e13ae77348e3d8d7549fd9 +size 468341 diff --git a/adaptivetrajectorypredictionviatransferablegnn/layout.json b/adaptivetrajectorypredictionviatransferablegnn/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d3bad9a3feba31639751b8454ba5a6ec4f2758aa --- /dev/null +++ b/adaptivetrajectorypredictionviatransferablegnn/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43478aeac54a5e7250f675dbda011e9fe782011f9471ad1ed583c4a479bfdf0d +size 538263 diff --git a/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_content_list.json b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9e288b2216edf9b0cc229cab2664f32c84ec5f9d --- /dev/null +++ b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdbc684acf5bfe5944b7e937c0ad9328bf03778906fd0dbc0817f03fbc11f397 +size 90205 diff --git a/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_model.json b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0ff9f83e987467376eb161b5260daf5180b9a51c --- /dev/null +++ b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e514a3c8596a59e0f1e49c1c6aceec2b4b946c4b7faf496d0cc5585cfc8efe35 +size 107152 diff --git a/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_origin.pdf b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5d2b9849bd7d999d7a5f893055b923dfdf1983e9 --- /dev/null +++ b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/809ce82b-350a-4f23-9a71-700962240a20_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:287227ac0e0a152be2657111b49b9ce0f2b8abe6dad39abbd1cce0f11da11018 +size 2406130 diff --git a/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/full.md b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6f77db54bedd9bc6be1ba0169b67d6cb4f687118 --- /dev/null +++ b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/full.md @@ -0,0 +1,409 @@ +# AdaptPose: Cross-Dataset Adaptation for 3D Human Pose Estimation by Learnable Motion Generation + +Mohsen Gholami, Bastian Wandt, Helge Rhodin, Rabab Ward, and Z. Jane Wang +University of British Columbia + +{mgholami, rababw, zjanew}@ece.ubc.ca {wandt, rhodin}@cs.ubc.ca + +# Abstract + +This paper addresses the problem of cross-dataset generalization of 3D human pose estimation models. Testing a pre-trained 3D pose estimator on a new dataset results in a major performance drop. Previous methods have mainly addressed this problem by improving the diversity of the training data. We argue that diversity alone is not sufficient and that the characteristics of the training data need to be adapted to those of the new dataset such as camera viewpoint, position, human actions, and body size. To this end, we propose AdaptPose, an end-to-end framework that generates synthetic 3D human motions from a source dataset and uses them to fine-tune a 3D pose estimator. AdaptPose follows an adversarial training scheme. From a source 3D pose the generator generates a sequence of 3D poses and a camera orientation that is used to project the generated poses to a novel view. Without any 3D labels or camera information AdaptPose successfully learns to create synthetic 3D poses from the target dataset while only being trained on 2D poses. In experiments on the Human3.6M, MPI-INF-3DHP, 3DPW, and Ski-Pose datasets our method outperforms previous work in cross-dataset evaluations by $14\%$ and previous semi-supervised learning methods that use partial 3D annotations by $16\%$ . + +# 1. Introduction + +Monocular 3D human pose estimation aims to reconstruct the 3D skeleton of the human body from 2D images. Due to pose and depth ambiguities, it is well known to be an inherently ill-posed problem. However, deep learning models are able to learn 2D to 3D correspondences and achieve impressively accurate results when trained and tested on similar datasets [1, 3, 6, 14, 27, 31, 32]. + +An often disregarded aspect is that the distribution of features in a dataset e.g. camera orientation and body poses differ from one dataset to another. Therefore, a pre-trained network underperforms when applied to images captured + +![](images/5d92154b70f7ad17d81693cbe5c97f1765a1ab316c06e3e8e313474d195d22db.jpg) +Figure 1. AdaptPose generates synthetic motions to improve the cross-dataset generalization. The source dataset has 3D labels and camera information, while the target dataset has only sample videos. The synthetic motions are generated to belong to the target dataset. Therefore fine-tuning the 3D pose estimator with synthetic motions improves the generalization of the model. + +from a different viewpoint or when they contain an activity that is not present in the training dataset [42, 45]. As an example, Figure 1 shows images from the Human3.6M [15] dataset on the left and images from the Ski-Pose [33, 35] dataset on the right which we define as source domain and target domain, respectively. Camera viewpoint, position, human action, speed of motion, and body size significantly differ between the source and target domain. This large domain gap causes 3D pose estimation models trained on the source domain to make unreliable predictions for the target domain [42, 45, 46]. We address this problem by generating synthetic 3D data that lies within the distribution of the target domain and fine-tuning the pose estimation network by the generated synthetic data. Our method does not require 3D labels or camera information from the target domain and is only trained on sample videos from the target domain. + +To the best of our knowledge, there are only two approaches that generate synthetic 2D-3D human poses for cross-dataset generalization of 3D human pose estimators [13, 23]. Li et al. [23] randomly generate new 2D-3D pairs of the source dataset by substituting parts of the human body in 3D space and projecting the new 3D pose to + +2D. PoseAug [11] proposes a differential data augmentation framework that is trained along with a pose estimator. Both, [23] and [11], merely improve the diversity of the source domain without considering the distribution of the target domain. Moreover, these methods are based on single images and do not consider temporal information. + +We formulate the data augmentation process as a domain adaptation problem. Figure 2 shows our training pipeline. Our goal is to generate plausible synthetic 2D-3D pairs that lie within the distribution of the target domain. Our framework, AdaptPose, introduces a human motion generator network that takes 3D samples from the source dataset and modifies them by a learned deformation to generate a sequence of new 3D samples. We project the generated 3D samples to 2D and feed them to a domain discriminator network. The domain discriminator is trained with real 2D samples from the target dataset and fake samples from the generator. We use the generated samples to fine-tune a pose estimation network. Therefore, our network adapts to any target using only images from the target dataset. 3D annotation from the target domain is not required. Unlike [13,23], this enables our network to generate plausible 3D poses from the target domain. Another contribution is the extension of the camera viewpoint generation from a deterministic approach to a probabilistic approach. We assume that the camera viewpoint of the target domain comes from a specific well-defined, but unknown distribution. Therefore, we propose to learn a distribution of camera viewpoints instead of learning to generate a deterministic rotation matrix. Our network rotates the generated 3D poses into a random camera coordinate system within the learned distribution. The generated sample is a sequence of 2D-3D pose pairs that entails plausibility in the temporal domain. We believe that the application of the proposed motion generator is not limited to improving only cross-dataset performance of 3D pose estimation, but it could also be used in other tasks such as human action recognition. + +Contributions. 1) we propose to close the domain gap between the training and test datasets by a kinematics-aware domain discriminator. The domain discriminator is trained along with a human motion generator (HMG) that uses a source training dataset to generate human motions close to those in the target dataset. 2) We show that learning the distribution of the camera viewpoint is more effective than learning to generate a deterministic camera matrix. 3) To the best of our knowledge, this is the first approach that proposes generating human motions specifically for cross-dataset generalization for 3D human pose estimation, unlike previous work that focuses on single-frame data augmentation. + +# 2. Related Work + +In the following, we discuss the related work with a focus on cross-dataset adaptation. + +Weakly-supervised Learning. Weakly supervised learning has been proposed to diminish the dependency of networks on 3D annotations. These methods rely on unpaired 3D annotation [21, 39, 43], multi-view images [10, 16, 19, 33, 40], or cycle-consistency [4, 9]. Most related to our work is the adaptation of a network to the target domain via weakly supervised learning. Zhang et al. [46] propose an online adaptation to target test data based on the weakly supervised learning method of [4]. Yang et al. [43] use unpaired 3D annotation to further fine-tune a network on in-the-wild images. Kundu et al. [22] use a self-supervised learning method to improve the generalization of a pre-trained network on images with occlusion. + +Cross-dataset Generalization. Cross-dataset adaptation of 3D pose estimators has recently gained attention. Guan et al. and Zhang et al. [13,46] propose an online adaptation of the pose estimator during the inference stage over test data. Guan et al. [13] use a temporal consistency loss and a 2D projection loss on the streaming test data to adapt the network to the target test dataset. Zhang et al. [46] use a cycle consistency approach to optimize the network on every single test frame. Although the online-adaptation approach improves cross-dataset generalizability, it also increases the inference time, especially if the networks exploit temporal information. Wang et al. [42] argues that estimating the camera viewpoint beside the 3D keypoints improves cross-dataset generalization of the 3D pose estimator. However, the camera viewpoint is not the only criterion that differs between datasets. Split-and-Recombine [45] proposes to split the human skeleton into different body parts so that different body parts of a rare pose from the target dataset could have been seen in the source dataset. + +Data Augmentation. Data augmentation is another way to diminish cross-dataset errors. Previous methods perform data augmentation on images [34], 3D mesh models [5, 36, 47], or 2D-3D pairs [7, 13, 23]. Most related to our work is augmenting 2D-3D pairs. Li et al. [23] generate synthetic 3D human samples by substituting body parts from a source training set. The evolutionary process of [23] is successful in generating new poses, however, the generation of natural camera viewpoints is overlooked. Instead, it randomly perturbs source camera poses. PoseAug [11] proposes an end-to-end data augmentation framework that trains along with a pose estimator network. Although it improves the diversity of the training data, there is no guarantee that the generated samples are in the distribution of the target dataset. Moreover, according to the ablation studies of PoseAug, the main improvement comes from generating camera viewpoints instead of generating new poses. This means that PoseAug has limited abilities to effectively im + +![](images/9a095753e7f97c6767f6dceb4e28542b2d53e88e792dc79ac27ae8e54ce6e4fd.jpg) +Figure 2. Overview of the proposed network. The input is a vector of 3D keypoints from the source dataset concatenated with Gaussian noise. The motion generator learns to generate a sequence of 3D keypoints $X_{3D}^{b}$ and the mean and standard deviation of a normal distribution $\mathcal{N}$ . A random rotation matrix is sampled from the learned normal distribution and $X_{3D}^{b}$ is transformed to $X_{3D}^{r}$ and projected to 2D. The domain discriminator is trained with $X_{2D}^{r}$ and 2D keypoints from the target domain. The lifting network is a pretrained pose estimator that estimates 3D from 2D. It is used to evaluate $X_{2D}^{r}$ , $X_{3D}^{r}$ , provide feedback to the motion generator, and to select a subset of samples for fine-tuning the lifting network. The pipeline is trained end-to-end. + +prove pose diversities in the training set. In contrast, we enforce the generated synthetic data to be in the distribution of the target data. Unlike PoseAug, we show that our motion generation network significantly improves cross-dataset results even without augmenting the camera-viewpoints. + +# 3. Problem Formulation + +Let $\mathbf{X}^{\mathrm{src}} = (X_{2D}^{\mathrm{src}}, X_{3D}^{\mathrm{src}})$ be a pair of 2D and 3D poses from the source dataset and $\mathbf{X}^{\mathrm{tar}} = X_{2D}^{\mathrm{tar}}$ a 2D pose from the target dataset. The input to our model are sequences of frames with length $n$ , $X_{2D}^{\mathrm{src}}: [x_{2D}]_{t=0}^{n}$ , $X_{3D}^{\mathrm{src}}: [x_{3D}]_{t=0}^{n}$ , and $X_{2D}^{\mathrm{tar}}: [y_{2D}]_{t=0}^{n}$ where $x_{2D}, y_{2D} \in \mathbf{R}^{J \times 3}$ . AdaptPose consists of a generator function + +$$ +G \left(\mathbf {X} ^ {\text {s r c}}, \mathbf {z}; \boldsymbol {\theta} _ {G}\right)\rightarrow \mathbf {X} ^ {\text {f a k e}}, \tag {1} +$$ + +with parameters $\theta_{G}$ , that maps source samples $\mathbf{X}^{\mathrm{src}}$ and a noise vector $\mathbf{z} \sim p_{z}$ to a fake 2D-3D pair $\mathbf{X}^{\mathrm{fake}} = (X_{2D}^{\mathrm{fake}}, X_{3D}^{\mathrm{fake}})$ . The fake samples $(X_{2D}^{\mathrm{fake}}, X_{3D}^{\mathrm{fake}})$ are a sequence of 2D-3D keypoints $X_{2D}^{\mathrm{fake}}: [x_{2D}^{\mathrm{fake}}]_{t=0}^{n}$ , $X_{3D}^{\mathrm{fake}}: [x_{3D}^{\mathrm{fake}}]_{t=0}^{n}$ . The generator $\mathbf{G}$ generates an adapted dataset $\mathbf{X}^{\mathrm{fake}} = G(\mathbf{X}^{\mathrm{src}}, \mathbf{z})$ of any desired size. In order to adapt the source to the target domain in the absence of 3D target poses we introduce a domain discriminator $D_{D}$ and a 3D discriminator $D_{3D}$ . The domain discriminator $D_{D}(\mathbf{x}; \boldsymbol{\theta}_{D})$ gives the likelihood $d$ that the 2D input $\mathbf{x}$ is sampled from the target domain $X_{2D}^{\mathrm{tar}}$ . The generator tries to generate fake samples $X_{2D}^{\mathrm{fake}}$ as close as possible to target samples $X_{2D}^{\mathrm{tar}}$ while the discriminator tries to distinguish between them. Unlike a standard GAN network [12] where generator is conditioned only on a noise vector, our generator is conditioned on both a noise vector and a sample from the source dataset which was shown to be effective in generating synthetic images [2]. Additionally, the model is conditioned + +on a 3D discriminator $D_{3D}(\mathbf{x};\theta_D)$ that outputs the likelihood $d'$ that the generated 3D, $X_{3D}^{\mathrm{fake}}$ , is sampled from the real 3D distribution. Ideally, we would like to condition on the target 3D dataset. Since 3D data from the target domain is not available we condition it on the source 3D dataset. However, conditioning the 3D discriminator $D_{3D}$ directly on the source 3D poses restrains the motion generator to the source distribution. Instead, we condition the 3D discriminator $D_{3D}$ on a perturbed version of data $X_{3D}^{\mathrm{psrc}} = \mathbf{y} + X_{3D}^{\mathrm{src}}$ where $\mathbf{y}\sim p_y$ is a small noise vector. The noise vector $\mathbf{y}$ is selected such that $X_{3D}^{\mathrm{psrc}}$ is a valid pose from the source distribution. The goal of AdaptPose is to optimize the following objective function + +$$ +\mathcal {L} = \min _ {\boldsymbol {\theta} _ {G}} \max _ {\left(\boldsymbol {\theta} _ {D _ {D}}, \boldsymbol {\theta} _ {D _ {3 D}}\right)} \alpha L (G, D _ {D}) + \beta \mathcal {L} (G, D _ {3 D}), \tag {2} +$$ + +where $\alpha$ and $\beta$ are the weights of the losses. + +# 4. Human Motion Generator + +We name the generator of our GAN network Human Motion Generator (HMG). The HMG consists of two main components. 1) A bone generator that rotates the bone vectors and changes the bone length ratios. The bone generation operation produces new 3D keypoints $X_{3D}^{b}$ . 2) A camera generator that generates a new camera viewpoint $\{\mathbf{R},\mathbf{T}\}$ , where $\mathbf{R} \in \mathbb{R}^{3\times 3}$ is a rotation matrix and $\mathbf{T}$ is a translation vector. $X_{3D}^{b}$ is transformed to the generated camera viewpoint by + +$$ +X _ {3 D} ^ {\mathrm {f a k e}} = \mathbf {R} X _ {3 D} ^ {b} + \mathbf {T}, \tag {3} +$$ + +with the corresponding 2D keypoints + +$$ +X _ {2 D} ^ {\text {f a k e}} = \Pi \left(X _ {3 D} ^ {\text {f a k e}}\right), \tag {4} +$$ + +where $\Pi$ is the perspective projection that uses the intrinsic parameters from the source dataset. + +# 4.1. Bone Generation + +In this section, we analyze different methods of bone vector generation in the temporal domain. The main challenge is to keep the bone changes plausible for every single frame and temporally consistent in the time domain. We propose and analyze the three different methods BG1, BG2, and BG3 shown in Figure 3. + +BG1. The bone generation network accepts a sequence of 3D keypoints from the source dataset. The sequence of 3D keypoints is transformed into a bone vector representation $[\vec{B}_t^{\mathrm{src}}]_{t = t0}^{t0 + n}$ where $\vec{B}_t^{\mathrm{src}}\in \mathbb{R}^{(J - 1)\times 3}$ and $J$ is the number of keypoints. BG1 generates a displacement vector $\Delta \vec{B}\in \mathbb{R}^{(J - 1)\times 3}$ and a bone ratio $\lambda \in \mathbb{R}^{(J - 1)\times 1}$ . The new bone vector is $[\vec{B}_t^{\mathrm{fake}}]_{t = t0}^{t0 + n}$ where + +$$ +\vec {B} _ {t} ^ {\mathrm {f a k e}} = \frac {\vec {B} _ {t} ^ {\mathrm {s r c}} + \Delta \vec {B}}{\| \vec {B} _ {t} ^ {\mathrm {s r c}} + \Delta \vec {B} \|} \| \vec {B} _ {t} ^ {\mathrm {s r c}} \| (1 + \lambda). \tag {5} +$$ + +$\Delta \vec{B}$ may change the bone length instead of rotating to a new configuration as shown in Figure 3. To avoid this, we divide the generated bones by $\| \vec{B}_t^{\mathrm{src}} + \Delta \vec{B} \|$ in Eq. 5. + +BG2. The bone generation network accepts a single sample of 3D keypoints from the source dataset and converts it to a bone representation $\vec{B}_{t0}^{\mathrm{src}}$ . BG2 generates $\Delta \vec{B}$ and $\lambda$ . The new bone vector is $[\vec{B}_t^{\mathrm{fake}}]_{t = t0}^{t0 + n}$ where + +$$ +\vec {B} _ {t + j} ^ {\mathrm {f a k e}} = \frac {\vec {B} _ {t 0} ^ {\mathrm {s r c}} + j \Delta \vec {B} / n}{\| \vec {B} _ {t 0} ^ {\mathrm {s r c}} + j \Delta \vec {B} / n \|} \| \vec {B} _ {t 0} ^ {\mathrm {s r c}} \| (1 + \lambda). \tag {6} +$$ + +BG3. The bone generation network generates the vector $\vec{r} \in \mathbb{R}^{(J - 1) \times 3}$ and the angle $\theta \in \mathbb{R}^{(J - 1) \times 1}$ . A sequence of rotation matrices $[R_t]_{t = 0}^n$ is calculated by + +$$ +R _ {t + j} = \mathcal {H} \left(\frac {\vec {r}}{\| \vec {r} \|} \frac {j \theta}{n}\right), \tag {7} +$$ + +where $\mathcal{H}$ transforms axis-angle rotation of $(\theta, \vec{r})$ to rotation matrix representation via quaternions $q = q_{r} + q_{x}\mathbf{i} + q_{y}\mathbf{j} + q_{z}\mathbf{k}$ by + +$$ +q = \cos (\frac {\theta}{2}) + \frac {\vec {r}}{\| \vec {r} \|} \sin (\frac {\theta}{2}), \tag {8} +$$ + +$$ +R = v \otimes v + q _ {r} ^ {2} \mathbf {I} + 2 q _ {r} [ v ] _ {\times} + [ v ] _ {\times} ^ {2}, \tag {9} +$$ + +where $\otimes$ is the outer product, $\mathbf{I}$ is the identity matrix, and + +$$ +[ v ] _ {\times} = \left[ \begin{array}{c c c} 0 & - v _ {3} & v _ {2} \\ v _ {3} & 0 & - v _ {1} \\ - v _ {2} & v _ {1} & 0 \end{array} \right]. \tag {10} +$$ + +![](images/b59ea90d0e158646136a1fa074c559054c478d8beee6bdd60b121a3b3219dcc0.jpg) +Figure 3. Bone generation methods. Blue vectors indicate bone vectors before rotation and green vectors are bone vectors after rotation. $\Delta \vec{B}$ is rotating bone direction produced by the network. $\vec{r}$ and $\theta$ are the axis and angle of the rotation, respectively. + +![](images/5195d1716595f7c656bc0627c5ad4e81a68a32886b0fb117559cee53859596f8.jpg) + +![](images/bdf0853d82e7c4522b308300c3c6cd2f6bdcb8bc8d4bd80e67ea5777affdaab2.jpg) + +# 4.2. Camera Generation + +In this section, we introduce two different methods of camera generation: 1) Deterministic, which generates a single camera rotation matrix and translation and 2) probabilistic. The network learns a distribution of rotation matrices. A random rotation matrix is sampled from the learned distribution. Additionally, we explore three different rotation representations: axis-angle, Euler-angles, and quaternions. In the following, we will discuss each of the procedures for each of the rotation representations. + +Deterministic Axis-angle. The network generates an axis $\vec{r}$ and a translation $T$ where the angle of rotation is $\|\vec{r}\|$ . The rotation matrix $R \in \mathbb{R}^{3 \times 3}$ is produced by $R = \mathcal{H}(\vec{r})$ where $\mathcal{H}$ is explained in the equation 8. + +Probabilistic Axis-angle. The network learns three separate normal distributions $\mathcal{N}_1(\mu_1,\sigma_1),\mathcal{N}_2(\mu_2,\sigma_2)$ , and $\mathcal{N}_3(\mu_3,\sigma_3)$ , an angle $\theta$ , and a translation $T$ . The axis $r = \{r_1,r_2,r_3\}$ is sampled from the learned normal distributions and converted to a rotation matrix by + +$$ +R = \mathcal {H} \left(\frac {\vec {r}}{\| \vec {r} \|} \theta\right). \tag {11} +$$ + +Probabilistic Euler-angles. The network learns three Gaussian distributions $\mathcal{N}_1, \mathcal{N}_2$ , and $\mathcal{N}_3$ to sample the Euler-angles $(\alpha, \beta, \gamma)$ from the specified distributions. The rotation matrix is obtained as follows: + +$$ +R = R _ {z} (\alpha) R _ {y} (\beta) R _ {x} (\lambda), \tag {12} +$$ + +where $R_{z}(\alpha), R_{y}(\beta)$ , and $R_{x}(\lambda)$ are rotations of $(\alpha, \beta,$ and $\gamma$ ) degrees around $z, y, x$ axis, respectively. + +Probabilistic Quaternion. A quaternion represents a rotation around axis $\vec{u} = (u_x, u_y, u_z)$ with angle $\theta$ as + +$$ +q = \cos (\frac {\theta}{2}) + \vec {u} \sin (\frac {\theta}{2}). \tag {13} +$$ + +Therefore, $q$ can be represented by four elements. Our network learns four distributions $\mathcal{N}_{1,\dots,4}$ and randomly samples elements of $q$ from the distributions. The quaternion $q$ + +is then converted to a rotation matrix representation as explained in section 4.1. + +# 4.3. Domain and 3D Discriminators + +We adopt the kinematic chain space (KCS) [38, 39] in 2D space to generate a matrix of joint angles and limb lengths in the image plane. The domain discriminator has two branches that accept 2D keypoints and the KCS matrix, respectively. The diagonal of the KCS matrix contains the limb lengths in the image space. Other components of the KCS matrix represent angular relationships of the 2D pose. It is important to mention that we do not normalize input 2D keypoints relative to the root joint as it causes perspective ambiguities [44]. Therefore, $\text{diag}(KCS)$ is a function of position and body scale. On the contrary $KCS - \text{diag}(KCS)$ is a function of the camera viewpoint and scale of the person. Thus, the KCS matrix disentangles different parameters that the motion generator requires to learn. For the 3D discriminator, in order not to condition the 3D discriminator on the source domain, we first apply a random perturbation of $\beta$ degrees to the input bone vectors $\beta < 10^{\circ}$ and then feed the perturbed 3D to a part-wise KCS branch [11] and the original 3D to a KCS branch. Further details about the 3D discriminator are provided in the supplementary material. + +# 4.4. Selection + +In order to stabilize the training of the lifting network we introduce a selection step by evaluating samples via the lifting network $N$ . In this step, the lifting network receives $(X_{2D}^{\mathrm{src}}, X_{3D}^{\mathrm{src}})$ and $(X_{2D}^{\mathrm{fake}}, X_{3D}^{\mathrm{fake}})$ which are source and generated samples, respectively. We exclude samples that are either too simple or too hard using the following rule + +$$ +\text {s e l e c t i o n} = \left\{ \begin{array}{l l} \text {y e s} & \text {i f} \left(\frac {\mathcal {L} \left(N \left(X _ {2 D} ^ {\mathrm {f a k e}}\right)\right)}{\mathcal {L} \left(N \left(X _ {2 D} ^ {\mathrm {s r c}}\right)\right)} - a\right) ^ {2} < b ^ {2} \\ \text {n o} & \text {o t h e r w i s e} \end{array} , \right. \tag {14} +$$ + +where $\mathcal{L}$ is an $L_{2}$ loss. + +# 5. Training + +In each epoch we generate 1.5 million synthetic samples followed by fine-tuning the lifting network. + +Motion Generator. Our adversarial framework is trained using three losses for the motion generator and for the discriminators which are defined as + +$$ +\mathcal {L} _ {\mathcal {D} _ {3 D}} = \frac {1}{2} \mathbb {E} \left[ \left(\mathcal {D} \left(X _ {3 D} ^ {\mathrm {s r c}}\right) - 1\right) ^ {2} \right] + \frac {1}{2} \mathbb {E} \left[ \mathcal {D} \left(X _ {3 D} ^ {\mathrm {f a k e}}\right) ^ {2} \right], \tag {15} +$$ + +$$ +\mathcal {L} _ {\mathcal {D} _ {D}} = \frac {1}{2} \mathbb {E} \left[ \left(\mathcal {D} \left(X _ {2 D} ^ {\text {t a r}}\right) - 1\right) ^ {2} \right] + \frac {1}{2} \mathbb {E} \left[ \mathcal {D} \left(X _ {2 D} ^ {\text {f a k e}}\right) ^ {2} \right], \tag {16} +$$ + +$$ +\mathcal {L} _ {G _ {a d v}} = \frac {1}{2} \mathbb {E} \left[ \left(\mathcal {D} \left(X _ {2 D} ^ {\text {f a k e}}\right) - 1\right) ^ {2} \right], \tag {17} +$$ + +where $(X_{3D}^{\mathrm{src}}, X_{3D}^{\mathrm{fake}})$ are 3D samples from the source dataset and synthetic generated samples, respectively. + +$(X_{2D}^{\mathrm{tar}}, X_{2D}^{\mathrm{fake}})$ are 2D keypoints from the target dataset and the generated synthetic data, respectively. The generator also receives a feedback loss from the lifting network. The feedback loss has two components: 1) reprojection loss of the estimated 3D keypoints of the target domain 2) fixed hard ratio feedback loss adapted from [11]. The lifting network $N$ accepts $X_{2D}^{\mathrm{tar}}$ from the target dataset and predicts $X_{3D}^{\mathrm{tar}}$ . We define the reprojection loss as + +$$ +\mathcal {L} _ {p r o j} = \left\| \frac {X _ {p r o j} ^ {\mathrm {f a k e}}}{\| X _ {p r o j} ^ {\mathrm {f a k e}} \|} - \frac {X _ {2 D} ^ {\mathrm {f a k e}}}{\| X _ {2 D} ^ {\mathrm {f a k e}} \|} \right\| _ {1}, \tag {18} +$$ + +where $\| \cdot \| _1$ is the $L_{1}$ norm and + +$$ +X _ {p r o j} ^ {\text {f a k e}} = \left[ \begin{array}{c c c} 1 & 0 & 0 \\ 0 & 1 & 0 \end{array} \right] N \left(X _ {2 D} ^ {\operatorname {t a r}}\right). \tag {19} +$$ + +The fixed hard ratio loss provides feedback depending on the difficulty of generated sample relative to the source samples as follows: + +$$ +f = \left(\frac {\mathcal {L} \left(N \left(X _ {2 D} ^ {\text {f a k e}}\right)\right)}{\mathcal {L} \left(N \left(X _ {2 D} ^ {\text {s r c}}\right)\right)} - c\right) ^ {2}, \tag {20} +$$ + +$$ +\mathcal {L} _ {h r} = \left\{ \begin{array}{l l} f & \text {i f} f < d ^ {2} \\ 0 & \text {o t h e r w i s e} \end{array} , \right. \tag {21} +$$ + +where $\mathcal{L}$ is $L_{2}$ loss. The summation of the above mentioned losses is our generator loss + +$$ +\mathcal {L} _ {G} = \mathcal {L} _ {G _ {a d v}} + \mathcal {L} _ {p r o j} + \mathcal {L} _ {h r}. \tag {22} +$$ + +Lifting Network. The lifting network $N$ is trained using $(X_{2D}^{\mathrm{src}}, X_{3D}^{\mathrm{src}})$ and $(X_{2D}^{\mathrm{fake}}, X_{3D}^{\mathrm{fake}})$ which gives the lifting loss + +$$ +\mathcal {L} _ {N} = \left\| X _ {3 D} ^ {\mathrm {s r c}} - N \left(X _ {2 D} ^ {\mathrm {s r c}}\right) \right\| _ {2} + \left\| X _ {3 D} ^ {\mathrm {f a k e}} - N \left(X _ {2 D} ^ {\mathrm {f a k e}}\right) \right\| _ {2}. \tag {23} +$$ + +# 6. Experiments + +We perform extensive experiments to evaluate the performance of AdaptPose for cross-dataset generalization. We further conduct ablation studies on the different elements of our network. In the following, we discuss different datasets and subsequently baselines and metrics. + +- Human3.6M (H3.6M) contains 3D and 2D data from seven subjects captured in 50 fps. We use the training set of H3.6M (S1, S5, S6, S7, S8) as our source dataset for cross-dataset evaluations. While performing experiments on the H3.6M dataset itself we will use S1 as the source dataset and S5, S6, S7, and S8 as the target. +- MPI-INF-3DHP (3DHP) contains 3D and 2D data from 8 subjects and covers 8 different activities. We will use the 2D data from the training set of 3DHP [28] + +as our target dataset when evaluating 3DHP. The test set of 3DHP includes more than 24K frames. However, some of the previous work use a subset of test data which includes 2,929 frames for evaluation [11, 20]. The 2,929 version has temporal inconsistency which is fine for the single-frame networks. We use the official test set of 3DHP and compare our results against the previous work's results on the official test set of 3DHP for a fair comparison. + +- 3DPW contains 3D and 2D data captured in an outdoor environment. The camera is moving in some of the trials. 3DPW [37] is captured in 25fps and has more variability than 3DHP and H3.6M in terms of camera poses. We use the training set of 3DPW as our target dataset when experimenting on this dataset. +- Ski-Pose PTZ-Camera (Ski) includes 3D and 2D labels from 5 professional ski athletes in a ski resort. The dataset is captured in 30 fps and frames are cropped in $256 \times 256$ . The cameras are moving and there is a major domain gap between Ski and previous datasets in terms of the camera pose/position. + +Evaluation Metrics. We use mean per joint position error (MPJPE) and Procrustes aligned MPJPE (P-MPJPE) as our main evaluation metrics. P-MPJPE measures MPJPE after performing Procrustes alignment of the predicted pose and the target pose. We also report the percentage of correct keypoint (PCK) with a threshold of $150~\mathrm{mm}$ and area under the curve (AUC) for evaluation on 3DHP following previous arts. + +Baseline (Lifting Network). We use VideoPose3D [32] (VPose3D) as the baseline pose estimator model. VPose3D is a lifting network that regresses 3D keypoints from input 2D keypoints. We use 27 frames as the input in our experiments. As preprocessing for H3.6M, 3DHP, and 3DPW datasets we normalize image coordinate such that $[0, w]$ is mapped to $[-1, 1]$ . Note that the 3DPW dataset has some portrait frames with a height greater than width. In these cases, we pad the width so that height is equal to width to avoid the 2D keypoints coordinates being larger than the image frame after normalization. Our experiments show that this preprocessing has lower cross-dataset error compared with root centering and Frobenius normalization of 2D keypoints. While performing experiments on the Ski dataset we use root centering and Frobenius normalization of 2D keypoints since the image frames are already cropped to $256 \times 256$ with the person in the center of the image. Since there is an fps difference and also motion speed difference between our source dataset and target datasets, we also perform random downsampling in our data loader for training the baseline network. Specifically, our data loader samples $\{x_{r(t - n)}, \dots, x_{r(t + n)}\}$ from the source dataset and + +$r$ is a random number sampled from a uniform distribution of [2, 5]. Table 5 shows that the baseline model has a cross-dataset MPJPE of $96.4\mathrm{mm}$ using 3DHP as the target dataset. + +# 6.1.Quantitative Evaluation + +H3.6M. We compare our results with previous semi-supervised learning methods that only use 3D labels from S1 and 2D annotations from the remaining subjects for training [32] as well as data augmentation methods. Our results improve upon the previous state-of-the-art by $16\%$ . We use ground truth 2D keypoints and therefore compare with previous work with the same setting. Since the camera pose does not change much between subjects, we hypothesize that the comparison in the current setting compares our bone generation method against previous work. + +3DHP. Table 2 gives MPJPE, AUC, and PCK on test set of 3DHP. We report the results of PoseAug's released pre-trained model on the complete test set of 3DHP. Our results have a $14\%$ margin in terms of MPJPE compared with previous methods that report cross-dataset evaluation results [11, 13, 23, 42, 45]. This includes the comparison to [46] that uses information from the target test data to perform test-time optimization. + +3DPW. Table 3 provides MPJPE and PA-MPJPE on the test set of 3DPW. Our method outperforms previous methods by $12\mathrm{mm}$ in PA-MPJPE. This includes previous methods that particularly were designed for cross-dataset generalization [8, 11, 13] and those that use temporal information [13, 19]. In comparison with test-time optimization methods [13, 46], ours also has an advantage of fast inference. + +SKI. Table 4 gives the cross-dataset results on the Ski dataset. Skiing is fast and sequences of the Ski dataset are as short as 5s. This provides little training data for temporal models and, therefore, we use a single-frame input model. We report the performance of VPose3D with single-frame input in a cross-dataset scenario to compare as a baseline model. Moreover, our results compared with Rhodin et al. [33] and CanonPose [40] that use multi-view data from the training set of Ski show $28\mathrm{mm}$ improvement in MPJPE and $2\mathrm{mm}$ in PA-MPJPE. + +# 6.2. Qualitative Evaluation + +Figure 4 shows qualitative evaluation on Ski, 3DHP, and 3DPW datasets. The predictions of the baseline and AdaptPose are depicted vs. the ground truth. We observe that AdaptPose successfully enhances the baseline predictions. Figure 5 provides some examples of the generated motion and the input 3D keypoints. Generated motions are smooth and realistic. We provide further qualitative examples in the supplementary material. + +Table 1. Cross-scenario learning on H3.6M. Source: S1. Target: S5, S6, S7, S8 + +
Method3DPA-MPJPEMPJPE
Martinez et al. [27]Full-45.5
Pavillo [32]Full27.237.2
Lui et al [25]Full-34.7
Wang [41]Full-25.6
PoseAug [11]S1-56.7
Pavillo [32]S1-51.7
Li et al. [23]S1-50.5
OursS134.042.5
+ +Table 2. Cross-dataset (CD) evaluation on 3DHP dataset. Source: H3.6M-target:3DHP + +
MethodCDPCKAUCMPJPE
Mehta et al. [28]76.540.8117.6
VNet [30]76.640.4124.7
MultiPerson [29]75.237.8122.2
OriNet [26]81.845.289.4
BOA [13]90.3-117.6
Wang et al. [42]76.1-109.5
SRNET [45]77.643.8-
Li et al. [23]81.246.199.7
PoseAug [11]82.946.592.6
Zhang et al. [46]83.648.292.2
Ours88.454.277.2
+ +Table 3. Cross-dataset (CD) evaluation on 3DPW dataset. Source: H3.6M-target:3DPW + +
MethodCDPA-MPJPEMPJPE
EFT [17]55.7-
Vibe [18]51.982.9
Lin et al. [24]45.674.7
Sim2real [8]74.7-
Zhang et al. [46]70.8-
Wang et al. [42]68.3109.5
SPIN [20]59.296.9
PoseAug [11]58.594.1
VIBE [18]56.593.5
BOA [13]49.577.2
Ours46.581.2
+ +Table 4. Cross-dataset (CD) evaluation on Ski dataset. Source: H3.6M-target: Ski + +
MethodCDPA-MPJPEMPJPE
Rhodin et al. [33]85-
CanonPose [40]89.6128.1
Pavllo et al. [32]88.1106.0
PoseAug [11]83.5105.4
Ours83.099.4
+ +# 6.3. Ablation Studies + +Ablation on Components of AdaptPose. We ablate components of our framework including bone generation, camera generation, domain discriminator, and selection. + +Table 5 provides the performance improvements by adding any of the components starting from the baseline. All of the components have a major contribution to the results. Comparing bone generation and camera generation, the latter has larger effects on the performance. However, in contrast to PoseAug [11], our bone generation method is significantly contributing to the results (10 mm vs 1 mm). A3 shows that a combination of bone and camera generation is as good as camera generation alone. Therefore, A4 excludes bone generation from the pipeline that causes a 9 mm performance drop in MPJPE. A3 and A5 give the role of domain adaptation that is 10 mm improvements. + +Table 5. Ablation study on supervision elements of the proposed model. Source: H3.6M-target:3DHP + +
IndexBGCamDDSelectPMPJPEMPJPE
Baseline66.596.4
A161.790.1
A262.088.2
A361.888.1
A459.386.5
A554.078.6
AdaptPose53.677.2
+ +Ablation on bone generation methods. In this section we compare the performance of three different bone generation methods that were explained in Section 4.1. Table 6 gives performance of BG1, BG2, and BG3 while performing cross-dataset evaluation on 3DHP. We observe that using an axis-angle representation for rotating bone vectors is superior to generating bone directions. We hypothesize that learning $\Delta \vec{B}$ is a harder task since there are infinitely many $\Delta \vec{B}$ that can generate $[\vec{B}^{\prime}]_{t=0}^{N}$ from $\vec{B}_t$ . On the contrary, there are only two axis-angles that map $\vec{B}_t$ to $[\vec{B}^{\prime}]_{t=0}^{N}$ . + +Table 6. Ablation study on bone generation strategies + +
MethodPMPJPEMPJPE
BG159.385.1
BG256.280.0
BG353.677.2
+ +Ablation on camera generation methods. In this section we perform analysis on three different camera generation methods that were introduced in Section 4.2. In terms of rotation representation, axis-angle outperforms quaternions and Euler-angles. Euler-angles are sensitive to the order of rotations and can lead to degenerate solutions. Comparing probabilistic and deterministic methods, the former obtains $5\mathrm{mm}$ more accurate results. + +Ablation on temporal information. Table 8 shows the performance of the network while excluding temporal information from the input and generating single 2D-3D pairs. Our cross-dataset MPJPE is $86.4\mathrm{mm}$ which still improves over previous methods (86.4 mm vs. 92.2). Therefore, although using temporal information is highly contributing + +Table 7. Ablation study on camera generation strategies + +
MethodRepresentationPMPJPEMPJPE
DeterministicAxis-Angle58.082.8
ProbabilisticAxis-Angle53.677.2
ProbabilisticQuaternion58.783.5
ProbabilisticEuler-Angle60.985.3
+ +Table 8. Ablation study on temporal information + +
InputPCKAUCMPJPE
1 frame84.650.386.4
27 frames88.454.277.2
+ +![](images/e7f0eda92726cfe751e4ce6314ba85e661f60190535e5a93bfededcb3e8200e6.jpg) + +![](images/28a1fbd11fe9461330d95cc1a2cc5c989b0e705b83937d48643b376eef3be756.jpg) + +![](images/ac2e7421df041e9e01e6bf75172f48e3845cec81c84fb22dbdbd40d27dba494e.jpg) + +![](images/901b3c7fbd618ebc66068259012b5c9bcb67506e6a661e02e9616fdc26ca1e2d.jpg) +Figure 6. Sample of input images from the source dataset and the generated 3D keypoints. For visualization purposes, we only plot the middle frame from the sequence of generated frames. We manually select the images on the right from the target that matched the generated. + +![](images/6b6208ce6dbf2bfe2436e51e55e5de2555ec684d136f9639fe38ed97c57c214f.jpg) +Figure 4. 3D human pose predictions (red) vs. ground truth (blue) for samples of Ski and 3DPW. + +![](images/85eef28a8922fec9cb14a8d8ddec2306ba96aa1ccf874c6f3904db43878f7d2b.jpg) + +![](images/ae7a971fe27d58f2bfa629cc42a349c935dd3359aa456de800194da8213d28f0.jpg) + +![](images/6aba186a4c9c66b1dbb0acbc83e82208a367db499ed51b2b9489f87b79d3b1a8.jpg) + +![](images/efe9e3c5dec706a1ba235534d4998d19bb094fde2f42b5b2dafe07d4de0fe5a5.jpg) + +![](images/d1235d9734264ed806aedb9edacb12db5f4da56842130771cf86b3ebeacd476c.jpg) + +![](images/13603e4382e4cb16869e5db0d829765b6c409d1aa27516d55fd19c289cc48f9b.jpg) + +![](images/d9dc2d14158699839cc9af0ba739e27be40148f85eff745816ba1207e6da2453.jpg) +Figure 5. Samples of generated motions and the corresponding input 3D keypoints. Motions are smooth and realistic. + +![](images/e7160fd50f044c887101af13c84af57b9a8c8c48df1814c8e60fff69f61e7651.jpg) + +![](images/21512927ee1a9eea8f1fd4df1a8811d6b387e3a285c6358ed42d4f1aacc5b547.jpg) + +to our framework, our network still excels in non-temporal settings. + +# 6.4. Are we really adapting to new datasets? + +To evaluate our claim that we are adapting poses and camera views to the target dataset we visualize some samples of generated motions for 3DHP and 3DPW datasets in Figure 6. The ceiling viewpoint in the first row is from 3DHP that is out of the distribution of our source dataset. While the 2D input is from a chest view camera the generated sample is from a ceiling view, similar to the target samples. We observe that our approach generates qualitatively similar camera poses. The second and third rows also provide examples of new poses that are out of the distribution of source poses and similar to samples in the target dataset. + +![](images/ce5d61ee0c2a0b2ac368930358b4062adb1eeae446e161426007bc2569a35fe5.jpg) +sample from target + +![](images/396c127670f9317b8ec647ce52fa3dbdc863dd94a80aa28ae320f987ee9d865f.jpg) + +![](images/64266933b5842294704d3e93c4278ff1807a3bd3d76b421e02809e57fffe629b.jpg) + +![](images/ef597ca0b554677414adf8317790fc320e575685a62ff82c440a6503bcb9995a.jpg) + +![](images/bb45902a2e8f3b4b0431137c9cca83363e3274b999c0ad8c2e30db061e2d8cd4.jpg) + +![](images/d54c56e5be13ec2dfb445660f2d521d08bdbc9fc2b03aa1ee40c81b799a5b4a1.jpg) + +We provide further qualitative examples in the supplementary material. Table 5 also provides numbers regarding the importance of domain discriminators in our framework (A5 vs A3). It is important to mention that we substitute the domain discriminator with a 2D discriminator from the source dataset when excluding the domain discriminator in Table 5. Thus, the performance drop while excluding the domain discriminator is essentially attributed to the lack of adaptation to the target space and not because of excluding the 2D discriminator. The supplementary material provides further experiments on the domain adaption. + +# 7. Conclusion + +We proposed an end-to-end framework that adapts a pre-trained 3D human pose estimation model to any target dataset by generating synthetic motions by only looking at 2D target poses. AdaptPose outperforms previous work on four public datasets by a large margin $(>10\%)$ . Our proposed solution can be applied to applications where limited motion data is available. Moreover, our method is able to generate synthetic human motion for other tasks such as human action recognition. The major limitation of our work is that it underperforms when there is a large body scale difference between source and train set. Although we have defined a parameter that learns to adjust the body bone lengths we observe a $10\mathrm{mm}$ difference between normalized MPJPE and actual MPJPE when there is a large scale difference between source and target body scales (cross-dataset on 3DPW). Future work should address the scale ambiguity between source and target domains. + +# References + +[1] Anurag Arnab, Carl Doersch, and Andrew Zisserman. Exploiting temporal context for 3d human pose estimation in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 1 +[2] Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 3 +[3] Yujun Cai, Liuhao Ge, Jun Liu, Jianfei Cai, Tat-Jen Cham, Junsong Yuan, and Nadia Magnenat Thalmann. Exploiting spatial-temporal relationships for 3d pose estimation via graph convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 1 +[4] Ching-Hang Chen, Ambrish Tyagi, Amit Agrawal, Dylan Drover, Rohith MV, Stefan Stojanov, and James M. Rehg. Unsupervised 3d pose estimation with geometric self-supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 2 +[5] Wenzheng Chen, Huan Wang, Yangyan Li, Hao Su, Zhenhua Wang, Changhe Tu, Dani Lischinski, Daniel Cohen-Or, and Baoquan Chen. Synthesizing training images for boosting human 3d pose estimation. In 3D Vision (3DV), 2015. 2 +[6] Yu Cheng, Bo Yang, Bo Wang, and Robby T. Tan. 3d human pose estimation using spatio-temporal networks with explicit occlusion training. Proceedings of the AAAI Conference on Artificial Intelligence, 34(07):10631-10638, Apr. 2020. 1 +[7] Yu Cheng, Bo Yang, Bo Wang, Wending Yan, and Robby T. Tan. Occlusion-aware networks for 3d human pose estimation in video. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 2 +[8] Carl Doersch and Andrew Zisserman. Sim2real transfer learning for 3d human pose estimation: motion to the rescue. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. 6, 7 +[9] Dylan Drover, Rohith MV, Ching-Hang Chen, Amit Agrawal, Ambrish Tyagi, and Cong Phuoc Huynh. Can 3d pose be learned from 2d projections alone? In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, September 2018. 2 +[10] Mohsen Gholami, Ahmad Rezaei, Helge Rhodin, Rabab Ward, and Z. Jane Wang. Self-supervised 3d human pose estimation from video. Neurocomputing, 488:97-106, 2022. 2 +[11] Kehong Gong, Jianfeng Zhang, and Jiashi Feng. Poseaug: A differentiable pose augmentation framework for 3d human pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 8575-8584, June 2021. 2, 5, 6, 7 +[12] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and + +Yoshua Bengio. Generative adversarial networks. Commun. ACM, 63(11):139-144, Oct. 2020. 3 +[13] Shanyan Guan, Jingwei Xu, Yunbo Wang, Bingbing Ni, and Xiaokang Yang. Bilevel online adaptation for out-of-domain human mesh reconstruction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10472-10481, June 2021. 1, 2, 6, 7 +[14] Mir Rayat Imtiaz Hossain and James J. Little. Exploiting temporal information for 3d human pose estimation. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. 1 +[15] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3.6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(7):1325-1339, jul 2014. 1 +[16] Umar Iqbal, Pavlo Molchanov, and Jan Kautz. Weakly-supervised 3d human pose learning via multi-view images in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2 +[17] Hanbyul Joo, Natalia Neverova, and Andrea Vedaldi. Exemplar fine-tuning for 3d human model fitting towards in-the-wild 3d human pose estimation, 2021. 7 +[18] Muhammed Kocabas, Nikos Athanasiou, and Michael J. Black. Vibe: Video inference for human body pose and shape estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 7 +[19] Muhammed Kocabas, Salih Karagoz, and Emre Akbas. Self-supervised learning of 3d human pose using multi-view geometry. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 2, 6 +[20] Nikos Kolotouros, Georgios Pavlakos, Michael J. Black, and Kostas Daniilidis. Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In Proceedings of the IEEE International Conference on Computer Vision, 2019. 6, 7 +[21] Jogendra Nath Kundu, Siddharth Seth, Varun Jampani, Mugalodi Rakesh, R. Venkatesh Babu, and Anirban Chakraborty. Self-supervised 3d human pose estimation via part guided novel image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2 +[22] Jogendra Nath Kundu, Rahul M V, Jay Patravali, and Venkatesh Babu RADHAKRISHNAN. Unsupervised cross-dataset adaptation via probabilistic amodal 3d human pose completion. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), March 2020. 2 +[23] Shichao Li, Lei Ke, Kevin Pratama, Yu-Wing Tai, Chi-Keung Tang, and Kwang-Ting Cheng. Cascaded deep monocular 3d human pose estimation with evolutionary training data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1, 2, 6, 7 + +[24] Kevin Lin, Lijuan Wang, and Zicheng Liu. Mesh graphormer. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 12939-12948, October 2021. 7 +[25] Ruixu Liu, Ju Shen, He Wang, Chen Chen, Sen-ching Cheung, and Vijayan Asari. Attention mechanism exploits temporal contexts: Real-time 3d human pose reconstruction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 7 +[26] Chenxu Luo, Xiao Chu, and Alan Loddon Yuille. Orinet: A fully convolutional network for 3d human pose estimation. In BMVC, 2018. 7 +[27] Julieta Martinez, Rayat Hossain, Javier Romero, and James J. Little. A simple yet effective baseline for 3d human pose estimation. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct 2017. 1, 7 +[28] Dushyant Mehta, Helge Rhodin, Dan Casas, Pascal Fua, Oleksandr Sotnychenko, Weipeng Xu, and Christian Theobalt. Monocular 3d human pose estimation in the wild using improved cnn supervision. In 3D Vision (3DV), 2017 Fifth International Conference on. IEEE, 2017. 5, 7 +[29] Dushyant Mehta, Oleksandr Sotnychenko, Franziska Mueller, Weipeng Xu, Srinath Sridhar, Gerard Pons-Moll, and Christian Theobalt. Single-shot multi-person 3d pose estimation from monocular rgb. In 2018 International Conference on 3D Vision (3DV), pages 120-130, 2018. 7 +[30] Dushyant Mehta, Srinath Sridhar, Oleksandr Sotnychenko, Helge Rhodin, Mohammad Shafiei, Hans-Peter Seidel, Weipeng Xu, Dan Casas, and Christian Theobalt. Vnect: Real-time 3d human pose estimation with a single rgb camera. volume 36, 2017. 7 +[31] Georgios Pavlakos, Luyang Zhu, Xiaowei Zhou, and Kostas Daniilidis. Learning to estimate 3d human pose and shape from a single color image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 459-468, 2018. 1 +[32] Dario Pavllo, Christoph Feichtenhofer, David Grangier, and Michael Auli. 3d human pose estimation in video with temporal convolutions and semi-supervised training. In _Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 6, 7_ +[33] Helge Rhodin, Jörg Spörri, Isinsu Katircioglu, Victor Constantin, Frédéric Meyer, Erich Müller, Mathieu Salzmann, and Pascal Fua. Learning monocular 3d human pose estimation from multi-view images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1, 2, 6, 7 +[34] Grégory Rogez and Cordelia Schmid. Mocap-guided data augmentation for 3d pose estimation in the wild. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, page 3116-3124, 2016. 2 +[35] Jörg Spörri. Research dedicated to sports injury prevention – the ‘sequence of prevention’ on the example of alpine skiing. Habilitation with Venia Docendi in “Biomechanics”. Department of Sport Science and Kinesiology, University of Salzburg., 2016. 1 + +[36] Gul Varol, Javier Romero, Xavier Martin, Naureen Mahmood, Michael J. Black, Ivan Laptev, and Cordelia Schmid. Learning from synthetic humans. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. 2 +[37] Timo von Marcard, Roberto Henschel, Michael Black, Bodo Rosenhahn, and Gerard Pons-Moll. Recovering accurate 3d human pose in the wild using imus and a moving camera. In European Conference on Computer Vision (ECCV), sep 2018. 6 +[38] Bastian Wandt, Hanno Ackermann, and Bodo Rosenhahn. A kinematic chain space for monocular motion capture. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, September 2018. 5 +[39] Bastian Wandt and Bodo Rosenhahn. Repnet: Weakly supervised training of an adversarial reprojection network for 3d human pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 2, 5 +[40] Bastian Wandt, Marco Rudolph, Petrissa Zell, Helge Rhodin, and Bodo Rosenhahn. Canonpose: Self-supervised monocular 3d human pose estimation in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 13294-13304, June 2021. 2, 6, 7 +[41] Jingbo Wang, Sijie Yan, Yuanjun Xiong, and Dahua Lin. Motion guided 3d pose estimation from videos. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision – ECCV 2020, pages 764–780, Cham, 2020. Springer International Publishing. 7 +[42] Zhe Wang, Daeyun Shin, and Charless C. Fowlkes. Predicting camera viewpoint improves cross-dataset generalization for 3d human pose estimation. In Adrien Bartoli and Andrea Fusiello, editors, Computer Vision - ECCV 2020 Workshops, pages 523-540, Cham, 2020. Springer International Publishing. 1, 2, 6, 7 +[43] Wei Yang, Wanli Ouyang, Xiaolong Wang, Jimmy Ren, Hongsheng Li, and Xiaogang Wang. 3d human pose estimation in the wild by adversarial learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 2 +[44] Frank Yu, Mathieu Salzmann, Pascal Fua, and Helge Rhodin. Pcls: Geometry-aware neural reconstruction of 3d pose with perspective crop layers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9064-9073, June 2021. 5 +[45] Ailing Zeng, Xiao Sun, Fuyang Huang, Minhao Liu, Qiang Xu, and Stephen Lin. Srnet: Improving generalization in 3d human pose estimation with a split-and-recombine approach. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision – ECCV 2020, pages 507–523, Cham, 2020. Springer International Publishing. 1, 2, 6, 7 +[46] Jianfeng Zhang, Xuecheng Nie, and Jiashi Feng. Inference stage optimization for cross-scenario 3d human pose estimation. In NeurIPS, 2020. 1, 2, 6, 7 +[47] Jianfeng Zhang, Dongdong Yu, Jun Hao Liew, Xuecheng Nie, and Jiashi Feng. Body meshes as points. In Proceed- \ No newline at end of file diff --git a/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/images.zip b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..44a166d9261dfa3f85f808d3311ee74177470853 --- /dev/null +++ b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38b7dd11aeae83ea34288a0a8562901e6e6b136011d77e2597d0162d9bac67be +size 549676 diff --git a/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/layout.json b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..90d58d84ae0a4ce38dacff0fbc0ba92356bbf8a1 --- /dev/null +++ b/adaptposecrossdatasetadaptationfor3dhumanposeestimationbylearnablemotiongeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be4bdc88d16def5dff2311525e41f4187539ee232c3cd360da60179185897a21 +size 477953 diff --git a/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_content_list.json b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6926ecf424f5fc51a141698d701a88199afb7fc7 --- /dev/null +++ b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17c0cde7ca7179a4de877c49034f419539711b8056eea056b7444ce29ca3dd05 +size 83830 diff --git a/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_model.json b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5ccec5513034898b5196137458bf4c8fcba50ebd --- /dev/null +++ b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0944696d13145d8a39540f203bd48cfc4212976f4b80b7e8360c85e50fb44d6c +size 103008 diff --git a/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_origin.pdf b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..785220704f8e0ea82830777346a35285991f755c --- /dev/null +++ b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/a3856296-0f5c-410c-a015-80c3d66ff744_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d6244be013c9be2719abd70579acd5dae2bbaf6574f95c554245c3db8fdae93 +size 4662212 diff --git a/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/full.md b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4e104ec715eb5e3b0f18a801ec04f5c4c6c64362 --- /dev/null +++ b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/full.md @@ -0,0 +1,335 @@ +# ADAPT: Vision-Language Navigation with Modality-Aligned Action Prompts + +Bingqian Lin $^{1*}$ , Yi Zhu $^{2}$ , Zicong Chen $^{1}$ , Xiwen Liang $^{1}$ , Jianzhuang Liu $^{2}$ , Xiaodan Liang $^{1\dagger}$ $^{1}$ Shenzhen Campus of Sun Yat-sen University $^{2}$ Huawei Noah's Ark Lab + +{linbq6@mail2,chenzc7@mail2,liangxw29@mail2, liangxd9@mail}.sysu.edu.cn, {zhuyi36, liu.jianzhuang}@huawei.com + +# Abstract + +Vision-Language Navigation (VLN) is a challenging task that requires an embodied agent to perform action-level modality alignment, i.e., make instruction-asked actions sequentially in complex visual environments. Most existing VLN agents learn the instruction-path data directly and cannot sufficiently explore action-level alignment knowledge inside the multi-modal inputs. In this paper, we propose modality-align $\pmb{D}$ Action Prompt $\pmb{Ts}$ (ADAPT), which provides the VLN agent with action prompts to enable the explicit learning of action-level modality alignment to pursue successful navigation. Specifically, an action prompt is defined as a modality-aligned pair of an image sub-prompt and a text sub-prompt, where the former is a single-view observation and the latter is a phrase like "walk past the chair". When starting navigation, the instruction-related action prompt set is retrieved from a pre-built action prompt base and passed through a prompt encoder to obtain the prompt feature. Then the prompt feature is concatenated with the original instruction feature and fed to a multi-layer transformer for action prediction. To collect high-quality action prompts into the prompt base, we use the Contrastive Language-Image Pretraining (CLIP) model which has powerful cross-modality alignment ability. A modality alignment loss and a sequential consistency loss are further introduced to enhance the alignment of the action prompt and enforce the agent to focus on the related prompt sequentially. Experimental results on both R2R and RxR show the superiority of ADAPT over state-of-the-art methods. + +# 1. Introduction + +In the Vision-Language Navigation (VLN) task [1,4], an embodied agent is required to navigate through complex scenes following a given language instruction. To accomplish successful navigation, the agent needs to implement + +![](images/631eab100a88d3693d4e5f65afa9fc67781bba0607f58ddacb1ea53cdf7ccd1b.jpg) +Figure 1. The action decision comparison between a baseline [14] and our ADAPT. With the help of action prompts related to "walk to the staircase" in the instruction, our ADAPT successfully makes correct action from the current observation. + +both object-level and action-level modality alignment accurately given the instruction and visual observations. For example, given an instruction of "exit the bedroom", the agent should not only locate the "bedroom" in its observation but also find the door of the bedroom to make the action of "exit". With great potential in the applications such as in-home robots and personal assistants, VLN has received wide spread attention in the robotic visual applications. + +Early VLN approaches explore diverse data augmentation strategies [8,9,27,38], efficient learning paradigms [15, 24, 40, 46, 47] and useful model architecture [7, 13, 29, 40] to improve the agent performance. Motivated by the significant progress made by large-scale cross-modal pre-trained models in vision-language tasks [6, 21, 23, 25, 37], more and more works attempt to introduce the pretraining paradigms and models into the VLN task. PREVALENT [11] pretrains the model on a large amount of image-text-action triplets in a self-supervised learning manner. VLN $\text{©}$ BERT [14] introduces a recurrent function into the pretrained models to make the VLN agent time-aware. Although the object-level alignment ability may be significantly enhanced through the + +pretraining process, these VLN agents still learn the action-level modality alignment in an implicit way, which largely limits the robust action decision under different scenes. + +Recently, the prompt engineering paradigm has shown great potential in endowing pretrained models with diverse capabilities through simply providing prompts designed by experts or optimized with task-specific objectives [20,28,39,43,45]. Inspired by this, we propose to introduce the prompt into the VLN task to improve the action-level modality alignment ability of the pretrained VLN agents. To this end, we propose modality-aligneD Action PromptTs (ADAPT), where the agent is provided with explicit action prompts to make action decision. An action prompt contains a pair of multi-modal sub-prompts, where the image sub-prompt is a single-view observation indicating a salient visual object or location, and the paired text sub-prompt is an object-related action phrase like "go to the staircase". + +Before navigating, the instruction-related action prompts are retrieved from a pre-constructed action prompt base. Then the action prompts are passed through a prompt encoder and the output feature is concatenated with the original instruction feature. The prompt-based instruction feature, together with the visual feature are fed to a multi-layer transformer for making action decision. Note that different from the common prompt engineering methods which change the output prediction form of a downstream task by introducing the prompt [28], in this work, we keep the same form of the action prediction as the baseline model and focus on the design of the prompts. Through these provided action prompts, the agent can learn the action-level modality alignment explicitly and make robust actions in different scenes. To enhance the discriminative power of the action prompts and enforce the agent to attend to related action prompts at each timestep, a modality alignment loss and a sequential consistency loss are further introduced into the training. Fig. 1 presents an action decision comparison between the baseline agent [14] and our ADAPT. As shown in Fig. 1, with the help of the action prompts related to "walk to the staircase", our ADAPT can choose the correct action in the given observations to navigate successfully. + +To collect high-quality action prompts into the action prompt base, we resort to the recently developed Contrastive Language-Image Pretraining (CLIP) [32] model which has powerful cross-modal object/location-level alignment ability. Concretely, the image sub-prompt is obtained by retrieving object/location-related images using CLIP from the action image sequence where each image contains the action information itself. The text sub-prompt is derived through a simple nearest-verb-search scheme. + +Experimental results on both Room-to-Room (R2R) [1] and Room-across-Room (RxR) [19] benchmarks show the superiority of our proposed ADAPT over the state-of-the-art methods, demonstrating that introducing explicit action + +prompts is promising for improving the agent navigation performance. Our ablation study indicates the effectiveness of each method component and the good generalization ability of ADAPT. The visualization analysis also shows its good interpretability. + +To summarize, the main contributions of this paper are: 1) We propose modality-aligned action prompts (ADAPT) to enforce the VLN agent to learn cross-modal action knowledge explicitly for improving action decision during navigation. To the best of our knowledge, this is the first attempt to develop prompt-based agents in the VLN task. 2) We develop a modality alignment loss and a sequential consistency loss for enabling efficient learning of action prompts. The Contrastive Language-Image Pretraining (CLIP) model is employed to ensure the quality of the action prompts. 3) ADAPT establishes new state-of-the-art results on both R2R and RxR. It also shows good interpretability and generalization ability. + +# 2. Related Work + +Vision-Language Navigation. Given the language instruction, a VLN agent is required to follow it to reach a predefined goal position. Early methods usually employ a sequence-to-sequence model architecture [8, 38, 46]. Speaker-follower [8] introduces synthetic instructions to alleviate the annotation burden of instructions. EnvDrop [38] develops an environmental dropout strategy to generate augmented data by mimicking unseen environments. + +Recently, large-scale vision-language pretraining models [6,21,23,25,37] have shown significant superiority on multiple vision-language understanding tasks like Visual Commonsense Reasoning [42] and Visual Question Answering [2]. Inspired by this, more and more works have introduced vision-language pretrained models into the VLN area [11, 14, 31]. PREVALENT [11] collects plenty of image-text-action triplets to pretrain the agent with self-supervised tasks such as attended masked language modeling and action prediction. VLN $\circ$ BERT [14] adds a recurrent function to help the agent recognize time-dependent input. However, in these pretrained VLN methods, the agent learns the relationship between the action decision and multi-modal information implicitly, leading to inefficient training and limited generalization abilities. In this paper, we take the first step to develop a prompt-based VLN agent, which receives explicit action prompts indicating cross-modal action knowledge for assisting the action decision during navigation. + +Prompt Engineering. Recent studies have shown that prompts play a vital role in improving pretrained language models in many downstream NLP tasks [3,20,26,28,33,43]. Jiang et al. [18] apply the text mining and paraphrasing techniques to generate the candidate prompts and choose the one with the highest accuracy. For facilitating prompt learning, Shin et al. [36] propose to generate prompts auto + +![](images/35af1b1d17e5626fe049e0c2250012e76e1a57da0d362fd85fe48604799a1526.jpg) +Figure 2. Overview of our ADAPT. At timestep $t$ , the agent receives the instruction, visual observation, and retrieved action prompts. The action prompts are passed through the prompt encoder and the output feature is concatenated with the instruction encoding $\mathbf{X}$ to obtain prompt-based instruction feature $\mathbf{X}^p$ . The action decision is made based on $\mathbf{X}^p$ and the visual encoding $\mathbf{V}_t$ . The navigation loss $\mathcal{L}_n$ , the sequential consistency loss $\mathcal{L}_c$ and the modality alignment loss $\mathcal{L}_a$ are applied to optimize ADAPT. (Best viewed in color.) + +matically through the gradient-based search. Lately, some works [20, 26, 43] propose to generate continuous prompts instead of hand-crafted text prompts. + +Inspired by the progress that prompt learning has made in NLP, some works attempt to introduce it into the pretrained vision-language models recently [39,41,45]. CoOp [45] models the context in prompts using continuous representations and keeps the pretrained model parameters fixed to conduct end-to-end learning. CPT [41] reformulates the visual grounding task into a fill-in-the-blank problem with color-based cross-modal prompts. Frozen [39] encodes the image as a sequence of continuous embeddings to serve as the prefix to implement multi-modal few-shot learning. In the light of the prompt engineering paradigm, we introduce the modality-aligned action prompts during navigation for enabling VLN agents to learn cross-modal action knowledge explicitly. Through these action prompts, the agent can effectively learn action-level modality alignment for implementing successful navigation. + +Contrastive Language-Image Pretraining (CLIP). CLIP [32] is a large-scale pre-trained model that relies on natural language supervision to learn visual representations. For an image-text pair, a visual encoder and a text encoder are used to encode the input representations independently. And the dot product between the two encoder's output serves as the alignment score of the image-text pair. Through training on 400M noisy image-text pairs, CLIP has shown strong zero-shot capabilities on benchmarks such as ImageNet classification. Recently, some works propose + +to resort to the knowledge learned in CLIP to improve the generalization ability of downstream models, including object detection [10], image manipulation [30], and vision-language tasks [35]. In this paper, we employ CLIP to retrieve the image containing instruction-referred visual object/location in a specific action image sequence for building action prompts. With the powerful cross-modal alignment ability of CLIP, the instruction-referred visual object/location images can be effectively retrieved for ensuring the quality of the action prompts. + +# 3. Method + +The overview of our ADAPT is given in Fig. 2. Before navigation, the agent retrieves the instruction-related action prompts from the action prompt base. Then the agent makes the action decision at each timestep based on the given instruction, the visual observation, and retrieved action prompts. The navigation is optimized by the navigation loss $\mathcal{L}_n$ , the sequential consistency loss $\mathcal{L}_c$ , and the modality alignment loss $\mathcal{L}_a$ . + +# 3.1. VLN Problem Setup + +Given a language instruction $\mathbf{I} = \{w_0,\dots,w_L\}$ with $L$ words, a VLN agent is required to find a route from a start viewpoint $c_{0}$ to the target viewpoint $c_{T}$ . At each timestep $t$ , the agent observes a panoramic view, which contains 36 image views $\{o_{t,i}\}_{i = 1}^{36}$ . Each image view $o_{t,i}$ includes an RGB image $b_{t,i}$ accompanied with its orientation $(\theta_{t,i}^{1},\theta_{t,i}^{2})$ , where $\theta_{t,i}^{1}$ and $\theta_{t,i}^{2}$ are the angles of heading and elevation, respec + +tively. With the instructions and current visual observations, the agent infers the action for each step $t$ from the candidate actions list, which consists of $J$ neighbors of the current node in the navigation connectivity graph $\mathcal{G} = (V,E)$ and a stop action. $V$ and $E$ represent the nodes and edges in the navigation connectivity graph, respectively. + +# 3.2. VLN Agent with Action Prompts + +# 3.2.1 Baseline Agent + +Our baseline agent follows the architecture of VLN $\mathcal{O}$ BERT [14], which is a multi-layer transformer model consisting of the self-attention module and cross-modal attention module. At each timestep, the model receives the cross-modal inputs for the action prediction. + +Visual Input. For each image view $o_{t,i}$ in the candidate views at timestep $t$ , a pretrained Convolutional Neural Network (CNN) [14] or a transformer [35] is applied in advance to extract image feature $\mathbf{v}_{t,i}$ . Then $\mathbf{v}_{t,i}$ is projected by a visual encoder $\mathbf{F}_v$ [14] to get the visual encoding $\mathbf{V}_{t,i}$ : + +$$ +\mathbf {V} _ {t, i} = \mathbf {F} _ {v} \left(\mathbf {v} _ {t, i}; \theta_ {v}\right), \tag {1} +$$ + +where $\theta_v$ denotes the parameters of $\mathbf{F}_v$ . The set $\mathbf{V}_t = \{\mathbf{V}_{t,i}\}_{i=1}^{36}$ denotes the candidate visual encodings at timestep $t$ . + +Language Input. When initialization, the instruction encoding $\mathbf{X}$ and the initialized state feature $\mathbf{s}_0$ are obtained by feeding the instruction sequence $\mathbf{I}$ together with [CLS] and [SEP] tokens to the self-attention module in the transformer: + +$$ +\mathbf {s} _ {0}, \mathbf {X} = \operatorname {S e l f A t t n} (\operatorname {C o n c a t} ([ \mathrm {C L S} ], \mathbf {I}, [ \mathrm {S E P} ]); \theta_ {s} ^ {1}), \tag {2} +$$ + +where $\operatorname{Concat}(\cdot)$ represents the concatenation operation, and $\theta_s^1$ denotes the parameters of the self-attention module. $\mathbf{s}_0$ will be updated to obtain $\mathbf{s}_t$ at each timestep $t$ . + +Action Decision. During the action decision at timestep $t$ , the state feature $\mathbf{s}_t$ is concatenated with the visual feature $\mathbf{V}_t$ to obtain the state-visual feature $\mathbf{K}_t$ . Then the cross-modal attention $\alpha_t$ between $\mathbf{K}_t$ and the instruction feature $\mathbf{X}$ is calculated to update $\mathbf{K}_t$ : + +$$ +\tilde {\mathbf {K}} _ {t}, \alpha_ {t} = \operatorname {C r o s s A t t n} \left(\mathbf {K} _ {t}, \mathbf {X}; \theta_ {c}\right), \tag {3} +$$ + +where $\theta_{c}$ represents the parameters of the cross-modal attention module. The attended instruction feature $\tilde{\mathbf{X}}_t$ is derived by weighting the instruction feature $\mathbf{X}$ by $\alpha_{t}$ . The updated state-visual feature $\tilde{\mathbf{K}}_t$ is further fed to another self-attention module SelfAttn(·) to obtain the attention scores $\beta_{t}$ of the state feature $\mathbf{s}_t$ over the visual feature $\mathbf{V}_t$ , which is also treated as the action prediction probability: + +$$ +\beta_ {t} = \operatorname {S e l f A t t n} \left(\tilde {\mathbf {K}} _ {t}; \theta_ {s} ^ {2}\right), \tag {4} +$$ + +where $\theta_s^2$ represents the module parameters. The attended visual feature $\tilde{\mathbf{V}}_t$ is obtained through weighting the visual + +![](images/f84973f58c0dda9d75922305fdce8df7d2f29847611e8c7582f13571112e9799.jpg) +walk out of bedroom +Figure 3. Examples of action prompts. + +![](images/6fc02785771aa3c6e253edf2da366cc5fb019cf2d6dd56cadc7d7bcbf711d292.jpg) +go into the kitchen + +![](images/2b00e8e9b9cf9728e4e3330d06bd2e62288925f5f3c486c3e489908c199b5c55.jpg) +pass the fireplace + +![](images/12d483acbc6994e0b36795014c0d548475c690ed60e47c714d651b5b82d98ba0.jpg) +go to the right of the table + +feature $\mathbf{V}_t$ by $\beta_{t}$ . Then $\tilde{\mathbf{X}}_t$ and $\tilde{\mathbf{V}}_t$ are used for updating the state feature $\mathbf{s}_t$ which is used for the next timestep action prediction. For more model details, refer to [14]. + +# 3.2.2 Action Prompts + +Before describing our prompt-based VLN agent, we first define the action prompts. An action prompt is a modality-aligned pair of an image sub-prompt and a text sub-prompt, where the former is a single-view observation and the latter is an action phrase. The observation indicates a salient visual object or a location. The action phrase contains two main elements, i.e., a word/phrase representing the action such as "exit" or "walk into", and a object/location word such as "chair" or "bedroom". Fig. 3 shows some examples of the action prompts. From Fig. 3 we can find that an action prompt not only contains an aligned visual object or location in both modalities but also indicates the modality-aligned action knowledge. For example, the paired image sub-prompt of the text sub-prompt "walk out of bedroom" contains the appearance of the bedroom and its door, through which the agent can complete the action of "walk out of" the bedroom. Therefore, by explicitly providing the action prompts into the training, the agent is able to better explore the cross-modal action knowledge which is important for guiding correct action decision. The construction of the action prompt base is described in Sec. 3.3. + +# 3.2.3 Action Decision with Action Prompts + +At the beginning of the navigation, the agent retrieves instruction-correlated action prompts from the action prompt base. Specifically, the object/location-related action phrases in the given instruction are derived following the strategy for obtaining text sub-prompts (see Sec. 3.3). Then the sentence similarity between each object/location-related action phrase and the text sub-prompts in the prompt base is calculated to retrieve the instruction-related action prompt set $\{p_n\}_{n=1}^N$ , where $N$ is the size of the set. + +With $\{p_n\}_{n = 1}^N$ we obtain the prompt encoding $\{\mathbf{P}_n^{i,u}\}_{n = 1}^N$ through the prompt encoder (see Fig. 2). The prompt encoder consists of two single-modal sub-prompt encoders and a multi-modal prompt encoder. Denote the image and text sub-prompts in the action prompt $p_n$ as $p_n^i$ and $p_n^u$ , respectively, i.e., $p_n = \{p_n^i,p_n^u\}$ . $p_n^i$ and $p_n^u$ are firstly passed through the single-modal sub-prompt en + +![](images/f4b1e9d42ca9169256f7749d9fc6973d60ada6b3507e893a9480cda56bbce8c1.jpg) +Figure 4. Illustration of action prompt collection for building the action prompt base. Given a training instruction-path instance, the image and text sub-prompts are firstly obtained via CLIP and nearest verb search, respectively. Then the multi-modal sub-prompts related to the same visual object/location and action are aligned to form an action prompt. Here the word "kitchen" is taken as an example. + +coders to obtain the sub-prompt features $\mathbf{P}_n^i$ and $\mathbf{P}_n^u$ : + +$$ +\mathbf {P} _ {n} ^ {i} = \operatorname {E} ^ {i} \left(p _ {n} ^ {i}; \theta^ {i}\right), \tag {5} +$$ + +$$ +\mathbf {P} _ {n} ^ {u} = \mathrm {E} ^ {u} \left(p _ {n} ^ {u}; \theta^ {u}\right), \tag {6} +$$ + +where $\operatorname{E}^i(\cdot)$ with parameters $\theta^i$ and $\operatorname{E}^u(\cdot)$ with parameters $\theta^u$ represent the image sub-prompt encoder and text sub-prompt encoder, respectively. Then $\mathbf{P}_n^i$ and $\mathbf{P}_n^u$ are fed to the multi-modal prompt encoder $\operatorname{E}^p(\cdot)$ to obtain the prompt encoding $\mathbf{P}_n^{i,u}$ : + +$$ +\mathbf {P} _ {n} ^ {i, u} = \mathrm {E} ^ {p} \left(\operatorname {C o n c a t} \left(\mathbf {P} _ {n} ^ {i}, \mathbf {P} _ {n} ^ {u}\right); \theta^ {p}\right), \tag {7} +$$ + +where $\theta^p$ denotes the parameters of $\mathrm{E}^p (\cdot)$ , and $\mathrm{Concat}(\cdot)$ is the concatenation operation. In our ADAPT, the encoders $\mathrm{E}^i (\cdot),\mathrm{E}^u (\cdot)$ and $\mathrm{E}^p (\cdot)$ consists of one linear layer followed by the dropout operation to reduce the over-fitting. + +With the prompt encoding $\{\mathbf{P}_n^{i,u}\}$ and the instruction encoding $\mathbf{X}$ , we obtain the prompt-based instruction feature $\mathbf{X}^p$ by simply concatenating $\mathbf{X}$ and $\{\mathbf{P}_n^{i,u}\}$ . Then the state-visual feature $\mathbf{K}_t$ is updated based on the cross-modal attention $\alpha_t^p$ between $\mathbf{K}_t$ and $\mathbf{X}^p$ : + +$$ +\tilde {\mathbf {K}} _ {t} ^ {p}, \alpha_ {t} ^ {p} = \mathrm {C r o s s A t t n} (\mathbf {K} _ {t}, \mathbf {X} ^ {p}; \theta_ {c}). \qquad (8) +$$ + +$\alpha_{t}^{p}$ is then split to $\alpha_{t}^{p_{1}}$ and $\alpha_{t}^{p_{2}}$ for obtaining different attended features. Concretely, the attended instruction feature $\tilde{\mathbf{X}}_t$ is derived via weighting $\mathbf{X}$ by $\alpha_{t}^{p_{1}}$ . The attended image sub-prompt feature $\tilde{\mathbf{P}}_t^i$ and the attended text sub-prompt feature $\tilde{\mathbf{P}}_t^u$ are obtained through weighting $\mathbf{P}_n^i$ and $\mathbf{P}_n^u$ by $\alpha_{t}^{p_{2}}$ . $\tilde{\mathbf{P}}_t^i$ and $\tilde{\mathbf{P}}_t^u$ are used for calculating the sequential consistency loss $\mathcal{L}_c$ . $\tilde{\mathbf{X}}_t$ is used for updating the state feature like the baseline agent. Finally, the prompt-based action prediction probability $\beta_t^p$ is obtained by feeding $\tilde{\mathbf{K}}_t^p$ into the self-attention module like that in Eq. 4. + +# 3.3. Construction of the Action Prompt Base + +Although it is easy to assign an object category label to an image through object recognition, associating an image with an action phrase is not straightforward. To better align the image and the action phrase to form the action prompt, we design a two-branch scheme to collect the image and text sub-prompts, as shown in Fig. 4. At first, for an instruction-path instance in the training dataset, we use a pre-constructed visual object/location vocabulary to find the referred visual objects/locations in the instruction. Then for each visual object/location, we obtain the related image and text sub-prompts separately as described below. + +Note that the ground-truth path sequence contains a set of single-view images, each of which indicates an action needed to make at the specific timestep. Therefore, for deriving the image sub-prompt in an action prompt, we only need to retrieve the object/location-related image from the ground-truth path sequence, which itself contains the action information. Instead of resorting to existing object classifiers or detectors trained on a fixed set of class categories [12, 34], we use CLIP [32] which shows excellent zero-shot cross-modal alignment ability to locate the object/location-related image. To adapt to the inference process of CLIP, we replace the {CLASS} token in the phrase "a photo of {CLASS}" with the visual object/location whose category label is $c$ . The probability that an image $B$ in the action sequence belongs to the class $c$ is calculated by: + +$$ +p (y = c | \boldsymbol {B}) = \frac {\exp \left(\sin \left(\boldsymbol {b} , \boldsymbol {w} _ {c}\right) / \tau_ {1}\right)}{\sum_ {i = 1} ^ {M} \left(\exp \left(\sin \left(\boldsymbol {b} , \boldsymbol {w} _ {i}\right)\right) / \tau_ {1}\right)}, \tag {9} +$$ + +where $\tau_{1}$ is the temperature parameter, sim represents the cosine similarity, $b$ and $w_{c}$ are the image and phrase features generated by CLIP, respectively, and $M$ is the size of the vocabulary. Then the image having the maximum similarity with the phrase is selected as the image sub-prompt. + +For obtaining the text sub-prompt, we use a simple nearest-verb-search scheme, that is, finding the nearest verb (which is in a pre-built verb vocabulary) just before a specific object/location word. As shown in Fig. 4, for the word "kitchen", the verb "walk" is located and then the phrase "walk through the kitchen" is extracted as the text sub-prompt. Finally, the image and text sub-prompts with the same visual object/location and action are formed as an aligned action prompt. + +# 3.4. Training and Inference + +Modality Alignment Loss. While an action prompt has the matched image and text sub-prompts, they may not be aligned in the feature space. To address this problem, following the contrastive learning paradigm used in CLIP [32] that enforces paired image and text features to be similar and non-paired ones to be distant, we use the infoNCE loss [5] to encourage the feature alignment of the image and text sub-prompts in each action prompt: + +$$ +\mathcal {L} _ {a} = - \log \left(\frac {\mathrm {e} ^ {\operatorname {s i m} \left(\mathbf {P} _ {n} ^ {i} , \mathbf {P} _ {n} ^ {u}\right) / \tau_ {2}}}{\mathrm {e} ^ {\operatorname {s i m} \left(\mathbf {P} _ {n} ^ {i} , \mathbf {P} _ {n} ^ {u}\right) / \tau_ {2}} + \sum_ {\overline {{\mathbf {P}}} _ {n} ^ {u}} \mathrm {e} ^ {\operatorname {s i m} \left(\mathbf {P} _ {n} ^ {i} , \overline {{\mathbf {P}}} _ {n} ^ {u}\right) / \tau_ {2}}}\right), \tag {10} +$$ + +where $\tau_{2}$ is the temperature parameter, $\mathbf{P}_n^i$ and $\mathbf{P}_n^u$ represent the features of the paired image and text sub-prompts of action prompt $p_n$ , and $\mathbf{P}_n^i$ and $\overline{\mathbf{P}}_n^u$ denote the non-paired sub-prompts. Through the modality alignment loss, the action prompts can become more discriminative for guiding the learning of action-level modality alignment. + +Sequential Consistency Loss. Since an instruction usually refers to different visual landmarks sequentially, the action prompts in the retrieved action prompt set $\{p_n\}$ are also related to different objects/locations. To encourage the agent to focus on related action prompts in the retrieved prompt set sequentially according to its visual observations, we develop a sequential consistency loss which is the sum of two single-modal consistency losses. Take the text modality as an example, at each timestep $t$ , the attended text sub-prompt feature $\tilde{\mathbf{P}}_t^u$ and the attended instruction feature $\tilde{\mathbf{X}}_t$ are enforced to be close: + +$$ +\mathcal {L} _ {c} ^ {u} = \left\| \hat {\mathbf {P}} _ {t} ^ {u} - \tilde {\mathbf {X}} _ {t} \right\| ^ {2}. \tag {11} +$$ + +Similarly, define $\mathcal{L}_c^i = ||\tilde{\mathbf{P}}_t^i -\tilde{\mathbf{V}}_t||^2$ , which is used to promote the similarity between the attended image sub-prompt feature $\tilde{\mathbf{P}}_t^i$ and the attended visual feature $\tilde{\mathbf{V}}_t$ . Then the sequential consistency loss $\mathcal{L}_c$ is obtained by: + +$$ +\mathcal {L} _ {c} = \mathcal {L} _ {c} ^ {i} + \mathcal {L} _ {c} ^ {u}. \tag {12} +$$ + +Total Objective. Following most of existing works [13, 14, 38], we also use the navigation loss $\mathcal{L}_n$ , which is the sum of an imitation loss $\mathcal{L}_{IL}$ and a reinforcement learning loss $\mathcal{L}_{RL}$ . Thus, the total training objective of our ADAPT is: + +$$ +\mathcal {L} = \mathcal {L} _ {R L} + \lambda_ {1} \mathcal {L} _ {I L} + \lambda_ {2} \mathcal {L} _ {c} + \lambda_ {3} \mathcal {L} _ {a}, \tag {13} +$$ + +where $\lambda_1, \lambda_2$ , and $\lambda_3$ are the loss weights to balance the loss items. + +Inference. During inference, the agent retrieves instruction-related action prompts from the action prompt base built in the training stage. + +# 4. Experiments + +# 4.1. Experimental Setup + +Datasets. We evaluate ADAPT on two public benchmarks, i.e., R2R [1] and RxR [19]. R2R [1] includes 10,800 panoramic views and 7,189 trajectories. Since the baseline [14] is pretrained on English language data, we test our ADAPT on the English subset of RxR (both en-IN and en-US), which includes 26,464 path-instruction pairs for training and 4,551 pairs in the val-unseen split. + +Evaluation Metrics. We use four popular metrics [1] for the performance evaluation on R2R: 1) Trajectory Length (TL) calculates the average length of the trajectory, 2) Navigation Error (NE) is the distance between target viewpoint and agent stopping position, 3) Success Rate (SR) calculates the success rate of reaching the goal, and 4) Success rate weighted by Path Length (SPL) makes the tradeoff between SR and TL. Three more metrics are used for RxR following other works [19, 22]: Coverage weighted by Length Score (CLS) [17], Normalized Dynamic Time Warping (nDTW) [16], and Success rate weighted normalized Dynamic Time Warping (SDTW) [16]. + +Implementation Details. All experiments are conducted on an NVIDIA V100 GPU. Two kinds of image features are used, i.e., the features extracted from a ResNet-152 [12] pretrained on Places365 [44] and the features extracted through the visual encoder of CLIP [35]. The model is trained for 300K and 100K iterations for R2R and RxR, respectively. The max sizes of the action prompt set are 60 and 100 for R2R and RxR, respectively. The instance whose number of retrieved action prompts less than the max size is padded. The values of $\lambda_{1}$ , $\lambda_{2}$ , and $\lambda_{3}$ are 0.2, 0.01, and 0.0001, respectively. The same augmented data in [14] is used for R2R for fair comparison. + +# 4.2. Quantitative Results + +Comparison with the State-of-the-Arts (SOTAs). Table 1 and Table 2 give the comparison between existing methods and our ADAPT. Table 1 shows that ADAPT with ResNet-152 feature outperforms previous SOTA methods on RxR. Moreover, ADAPT significantly improves the performance of the baseline [14] with different visual features in both Val Seen and Val Unseen settings on RxR, showing that introducing explicit action prompts can effectively promote the agent navigation capability. From Table 2 we can + +Table 1. Comparison with the SOTA methods on RxR. * indicates that the results are obtained by our re-implementation of the model. + +
MethodModelRxR Val SeenRxR Val Unseen
SR↑SPL↑CLS↑nDTW↑SDTW↑SR↑SPL↑CLS↑nDTW↑SDTW↑
EnvDrop [38]ResNet-15248.14461574038.534545132
Syntax [22]48.14461584039.235565232
VLN◎BERT* [14]50.945.460.356.941.345.539.356.652.936.3
ADAPT (ours)52.747.061.358.542.946.740.356.653.637.3
VLN◎BERT* [14]CLIP48.643.458.855.739.845.739.556.052.836.7
ADAPT (ours)50.344.659.656.340.646.940.257.254.137.7
+ +Table 2. Comparison with the SOTA methods on R2R. * indicates that the results are obtained by our re-implementation of the model. + +
MethodVal SeenVal UnseenTest Unseen
TLNE ↓SR ↑SPL ↑TLNE ↓SR ↑SPL ↑TLNE ↓SR ↑SPL ↑
Seq2Seq [1]11.336.0139-8.397.8122-8.137.852018
Speaker-Follower [8]-3.3666--6.6235-14.826.623528
EnvDropout [38]11.003.99625910.705.22524811.665.235147
PREVALENT [11]10.323.67696510.194.71585310.515.305451
VLN◎BERT [14]11.132.90726812.013.93635712.354.096357
ADAPT (ResNet-152)10.972.54767212.213.77645812.993.796559
VLN◎BERT* (CLIP)11.373.17706612.033.81655812.734.266155
ADAPT (CLIP)11.392.70746912.333.66665913.164.116357
+ +Table 3. Ablation study of ADAPT on R2R Val Unseen. ResNet-152 and CLIP represent using different visual features. ADAPT-1: using action prompts only; ADAPT-2: using action prompts with the modality alignment loss; ADAPT-3: using action prompts with the sequential consistency loss; ADAPT-Full: our full model. All models are trained for 100K iterations. + +
MethodResNet-152CLIP
NE ↓SR ↑SPLNE ↓SR ↑SPL ↑
Baseline4.1760.454.74.1161.555.3
ADAPT-14.1960.555.23.9061.656.0
ADAPT-24.1661.755.43.7862.856.3
ADAPT-34.0760.756.14.0561.956.6
ADAPT-Full4.0762.556.14.1063.157.2
+ +see that ADAPT (ResNet-152) establishes new SOTA results on R2R. Moreover, from the results of VLN $\circ$ BERT* (CLIP) and ADAPT (CLIP) we can find that by introducing the CLIP visual feature, both models show a performance enhancement in Val Unseen while a performance drop in both Val Seen and Test Unseen. However, ADAPT (CLIP) outperforms VLN $\circ$ BERT* (CLIP) on all the metrics, showing the effectiveness of the proposed method. + +Ablation Study. Table 3 presents the ablation study results of ADAPT. As shown in Table 3, explicitly introducing the action prompts can effectively improve the performance of the strong baseline model [14]. By comparing the results between "ADAPT-1" and "ADAPT-2" we can find that introducing the modality alignment loss can effectively enhance the navigation performance, demonstrating that the action prompts with good discriminative power are useful for learning better action-level modality alignment. Comparing the results between "ADAPT-2" and "ADAPT-Full", we can see that the introduction of the sequential consistency loss further improves the navigation performance, which shows that attending to related action prompts sequentially is helpful for making correct action decision. + +To verify the generalization ability of ADAPT when a small amount of training data is available, we set up two training settings: "Scan" and "Instance". "Scan" means that extracting part of the training scans with all the instances for training. "Instance" means that extracting all the training scans but with part of the instances for training. From the evaluation results given in Table 4, we can find that in both "Scan" and "Instance" settings, our ADAPT is superior over the strong baseline method, showing that by learning explicit action knowledge, the agent can have better generalization ability in different scenes. + +# 4.3. Visualization + +We present some visualization results in this subsection to further analyze how introducing the explicit action prompts can contribute to correct navigation action decision. From Fig. 5 we can see that by introducing the action prompts related to "walk around the bed" and "walk into the hallway" in the instruction, our ADAPT can successful enforce the agent to choose the correct actions of walking around the bed and walking into the hallway in different visual observations. The baseline agent, however, leaves the original room and makes the wrong navigation trajectory. + +We further validate the action-level modality alignment ability of ADAPT by comparing the action prompt alignment between the CLIP features and the sub-prompt features of ADAPT. For the action phrase feature, the top 5 similar image features are retrieved from the object-related image set. From Fig. 6 we can find that compared with CLIP, ADAPT can perform better action-level modality alignment. Given the action phrase of "walk up the stairs", the top 5 results retrieved by CLIP from a set of stairs images all indicate the action of "walk down" the stairs. Our ADAPT, however, can obtain 3 images indicating the action of "walk up" the stairs in the top 5 results. + +Table 4. Results of the baseline [14] and our ADAPT on R2R Val Unseen with fewer training data. * indicates that the results are obtained by our re-implementation of the model. + +
ModelScanInstance
20%40%60%80%20%40%60%80%
SR↑SPL↑SR↑SPL↑SR↑SPL↑SR↑SPL↑SR↑SPL↑SR↑SPL↑SR↑SPL↑SR↑SPL↑
VLN◎BERT* [14]50.844.053.748.157.751.757.453.151.347.055.849.757.152.157.952.7
ADAPT (ours)52.546.455.148.857.251.859.153.352.547.356.649.858.853.559.454.6
+ +![](images/38fcd2588abfa1fc80e041b2cc866ca6e08794ae9b860c089875f6672400ced6.jpg) +Panoramic view + +![](images/180588c8dc166ad0d943b2d26251c7822f0fd3cd1eb6b0aaff7d8668bb36b057.jpg) +Baseline + +![](images/678f7623d856964c330c39ac125599042ef86747ad60e16e29a9a919c2a1e8ab.jpg) +ADAPT + +![](images/c0845b182939c212b97330f0604db7559bf8038bd3d7cbf578954b414ce77ad9.jpg) +Instruction +"Walk around the bed to the right and into the hallway. Wait at the end of the hallway." +Action prompt +walk around the bed + +![](images/bea48a74350f0504ed4e5bec56aad417ed1faba9bc385329a4ad4d1ec1d52724.jpg) + +![](images/e0c36c62c53b30e540c35d99d2ea705992e8a4830b9ba50df0511146e0e8f6ad.jpg) + +![](images/db7285fe2b234afe693c8e72ec17d0c2899086f61d79900a26af4a4c80f4b6fb.jpg) + +![](images/db05e231d7190c03b7e09754295c9677f9e97613b7afc058598cc946f3b7541a.jpg) +Figure 5. Visualization of panoramic views and action comparison in a trajectory example between the baseline [14] and our ADAPT. +action phrase: walk up the stairs +Figure 6. Action prompt alignment comparison between the CLIP features and the sub-prompt features of our ADAPT. + +# 5. Conclusion and Limitation + +In this work, we propose modality-aligned action prompts (ADAPT), which prompts the VLN agent with explicit cross-modal action knowledge for enhancing the navigation performance. During navigation, the agent retrieves the action prompts from a pre-built action prompt base. Then the prompt-based instruction features are obtained for improving action decision. The CLIP model is used to collect high-quality action prompts into the prompt base. We also propose a modality alignment loss and a sequential consistency loss for training. Experiments on the public VLN benchmarks show the effectiveness of our ADAPT, which establishes new SOTA results. We hope this work can + +offer new directions for prompt-based navigation research. + +With regards to the limitation of our work, our constructed action prompt base in ADAPT contains more or less noise due to the ability of CLIP, the scene complexity and instruction diversity in the VLN task. The future work includes finding action prompts of better quality. + +# Acknowledgement + +This work was supported in part by National Key R&D Program of China under Grant No. 2020AAA0109700, National Natural Science Foundation of China (NSFC) No.61976233, Guangdong Province Basic and Applied Basic Research (Regional Joint Fund-Key) Grant No.2019B1515120039, Guangdong Outstanding Youth Fund (Grant No. 2021B1515020061), Shenzhen Fundamental Research Program (Project No. RCYX20200714114642083, No. JCYJ20190807154211365), National Natural Science Foundation of China under Grant No.62006255. We thank MindSpore for the partial support of this work, which is a new deep learning computing framework1. + +# References + +[1] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sunderhauf, Ian Reid, Stephen Gould, and Anton van den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3674-3683, 2018. 1, 2, 6, 7 +[2] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 2425-2433, 2015. 2 +[3] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Proceedings of the Conference on Neural Information Processing Systems (NeurIPS), volume 33, pages 1877-1901, 2020. 2 +[4] Howard Chen, Alane Suhr, Dipendra Misra, Noah Snavely, and Yoav Artzi. Touchdown: Natural language navigation and spatial reasoning in visual street environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 12538-12547, 2019. 1 +[5] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Proceedings of the International Conference on Machine Learning (ICML), 2020. 6 +[6] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In Proceedings of the European Conference on Computer Vision (ECCV), pages 104-120, 2020. 1, 2 +[7] Zhiwei Deng, Karthik Narasimhan, and Olga Russakovsky. Evolving graphical planner: Contextual global planning for vision-and-language navigation. In Proceedings of the Conference on Neural Information Processing Systems (NeurIPS), volume 33, pages 20660-20672, 2020. 1 +[8] 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 Proceedings of the Conference on Neural Information Processing Systems (NeurIPS), pages 3314–3325, 2018. 1, 2, 7 +[9] Tsu-Jui Fu, Xin Eric Wang, Matthew F. Peterson, Scott T. Grafton, Miguel P. Eckstein, and William Yang Wang. Counterfactual vision-and-language navigation via adversarial path sampler. In Proceedings of the European Conference on Computer Vision (ECCV), pages 71-86, 2020. 1 + +[10] Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. Open-vocabulary object detection via vision and language knowledge distillation. arXiv preprint arXiv:2104.13921, 2021. 3 +[11] Weituo Hao, Chunyuan Li, Xiujun Li, Lawrence Carin, and Jianfeng Gao. Towards learning a generic agent for vision-and-language navigation via pre-training. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 13137-13146, 2020. 1, 2, 7 +[12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. 5, 6 +[13] Yicong Hong, Cristian Rodriguez, Yuankai Qi, Qi Wu, and Stephen Gould. Language and visual entity relationship graph for agent navigation. In Proceedings of the Conference on Neural Information Processing Systems (NeurIPS), volume 33, 2020. 1, 6 +[14] Yicong Hong, Qi Wu, Yuankai Qi, Cristian Rodriguez-Opazo, and Stephen Gould. Vln bert: A recurrent vision-and-language bert for navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1643–1653, 2021. 1, 2, 4, 6, 7, 8 +[15] Haoshuo Huang, Vihan Jain, Harsh Mehta, Alexander Ku, Gabriel Magalhaes, Jason Baldridge, and Eugene Ie. Transferable representation learning in vision-and-language navigation. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 7404-7413, 2019. 1 +[16] Gabriel Ilharco, Vihan Jain, Alexander Ku, Eugene Ie, and Jason Baldridge. General evaluation for instruction conditioned navigation using dynamic time warping. ViGIL@NeurIPS, 2019. 6 +[17] Vihan Jain, Gabriel Magalhaes, Alexander Ku, Ashish Vaswani, Eugene Ie, and Jason Baldridge. Stay on the path: Instruction fidelity in vision-and-language navigation. In Proceedings of the Association for Computational Linguistics (ACL), pages 1862-1872, 2019. 6 +[18] Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. How can we know what language models know. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020. 2 +[19] Alexander Ku, Peter Anderson, Roma Patel, Eugene Ie, and Jason Baldridge. Room-across-room: Multilingual vision-and-language navigation with dense spatiotemporal grounding. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4392-4412, 2020. 2, 6 +[20] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021. 2, 3 +[21] Gen Li, Nan Duan, Yuejian Fang, Ming Gong, and Daxin Jiang. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In Proceedings of the Association for the Advance of Artificial Intelligence (AAAI), volume 34, pages 11336-11344, 2020. 1, 2 +[22] Jialu Li, Hao Tan, and Mohit Bansal. Improving cross-modal alignment in vision language navigation via syntactic infer + +mation. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 1041-1050, 2021. 6, 7 +[23] Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. Visualbert: A simple and perform-. mant baseline for vision and language. arXiv preprint arXiv:1908.03557, 2019. 1, 2 +[24] Xiujun Li, Chunyuan Li, Qiaolin Xia, Yonatan Bisk, Asli Celikyilmaz, Jianfeng Gao, Noah A. Smith, and Yejin Choi. Robust navigation with language pretraining and stochastic sampling. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1494-1499, 2019. 1 +[25] Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, Yejin Choi, and Jianfeng Gao. Oscar: Object-semantics aligned pre-training for vision-language tasks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 121-137, 2020. 1, 2 +[26] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the Association for Computational Linguistics (ACL), pages 4582-4597, 2021. 2, 3 +[27] Chong Liu, Fengda Zhu, Xiaojun Chang, Xiaodan Liang, Zongyuan Ge, and Yi-Dong Shen. Vision-language navigation with random environmental mixup. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1644-1654, 2021. 1 +[28] Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021. 2 +[29] 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 Proceedings of the International Conference on Learning Representations (ICLR), 2019. 1 +[30] Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. Styleclip: Text-driven manipulation of stylegan imagery. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 2085–2094, 2021. 3 +[31] Yuankai Qi, Zizheng Pan, Yicong Hong, Ming-Hsuan Yang, Anton van den Hengel, and Qi Wu. The road to know- where: An object-and-room informed sequential bert for indoor vision-language navigation. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1655–1664, 2021. 2 +[32] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the International Conference on Machine Learning (ICML), pages 8748-8763, 2021. 2, 3, 5, 6 + +[33] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67, 2020. 2 +[34] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1137-1149, 2017. 5 +[35] Sheng Shen, Liunian Harold Li, Hao Tan, Mohit Bansal, Anna Rohrbach, Kai-Wei Chang, Zhewei Yao, and Kurt Keutzer. How much can clip benefit vision-and-language tasks? arXiv preprint arXiv:2107.06383, 2021. 3, 4, 6 +[36] Taylor Shin, Yasaman Razeghi, Robert L. Logan, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4222-4235, 2020. 2 +[37] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. Vl-bert: Pre-training of generic visual-linguistic representations. In Proceedings of the International Conference on Learning Representations (ICLR), 2020. 1, 2 +[38] Hao Tan, Licheng Yu, and Mohit Bansal. Learning to navigate unseen environments: Back translation with environmental dropout. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 2610-2621, 2019. 1, 2, 6, 7 +[39] Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, S. M. Ali Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. arXiv preprint arXiv:2106.13884, 2021. 2, 3 +[40] Xin Wang, Qiuyuan Huang, Asli Celikyilmaz, Jianfeng Gao, Dinghan Shen, Yuan-Fang Wang, William Yang Wang, and Lei Zhang. Reinforced cross-modal matching and self-supervised imitation learning for vision-language navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6629-6638, 2019. 1 +[41] Yuan Yao, Ao Zhang, Zhengyan Zhang, Zhiyuan Liu, TatSeng Chua, and Maosong Sun. Cpt: Colorful prompt tuning for pre-trained vision-language models. arXiv preprint arXiv:2109.11797, 2021. 3 +[42] Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. From recognition to cognition: Visual commonsense reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6720-6731, 2019. 2 +[43] Zexuan Zhong, Dan Friedman, and Danqi Chen. Factual probing is [mask]: Learning vs. learning to recall. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 5017-5033, 2021. 2, 3 +[44] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database + +for scene recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(6):1452-1464, 2018. 6 +[45] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. arXiv preprint arXiv:2109.01134, 2021. 2, 3 +[46] Fengda Zhu, Yi Zhu, Xiaojun Chang, and Xiaodan Liang. Vision-language navigation with self-supervised auxiliary reasoning tasks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 10012-10022, 2020. 1, 2 +[47] Wang Zhu, Hexiang Hu, Jiacheng Chen, Zhiwei Deng, Vihan Jain, Eugene Ie, and Fei Sha. Babywalk: Going farther in vision-and-language navigation by taking baby steps. In ACL, 2020. 1 \ No newline at end of file diff --git a/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/images.zip b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e8f873a6d32a62905b7535439d9951069bf10bd6 --- /dev/null +++ b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:025778905a1dd5911307166dcd9bd798f00f639b2d1f250aae907a8e6a47eef5 +size 648370 diff --git a/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/layout.json b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..17c6d438705446974270f93af578c59c7704f033 --- /dev/null +++ b/adaptvisionlanguagenavigationwithmodalityalignedactionprompts/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8a232af4dffdc0516af64344227c83024c5269c486c1a237818908ae81e0c84 +size 464208 diff --git a/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_content_list.json b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d514185f73bda5aa26caf82a5681148a64490de0 --- /dev/null +++ b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15e3f6d7703b966f82c07af16055c94ed42e8f8023dece5a4bf8479aae145638 +size 85623 diff --git a/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_model.json b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0a5e744f6a68341a80807e449f6e903ee2b2b8c8 --- /dev/null +++ b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52335e0d10fcdbd4bad58b22d62c9ff59961e4eccc1cde8d2f586776cc729a44 +size 109184 diff --git a/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_origin.pdf b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..45e15d963a28f92c9feb59d79a62a2eb26f9c236 --- /dev/null +++ b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/818b1d22-978e-43f3-9ee8-884501f03557_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b3e1acc7e87e4c2bdb30d50d9a069c3d7727383fd3d453d54cb9424625142a3 +size 4885111 diff --git a/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/full.md b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ea15760d0978b401cf181959eeaddcbefec89e01 --- /dev/null +++ b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/full.md @@ -0,0 +1,383 @@ +# ADAS: A Direct Adaptation Strategy for Multi-Target Domain Adaptive Semantic Segmentation + +Seunghun Lee, Wonhyeok Choi, Changjae Kim, Minwoo Choi, and Sunghoon Im Department of Electrical Engineering & Computer Science, DGIST, Daegu, Korea + +{1sh5688, smu06117, chang5434, subminu, sunghoonim}@dgist.ac.kr + +![](images/0e286cc3d332b7821b29840d2f99da10740e2c278c56531b02a76f060b8e4c0d.jpg) +Figure 1. Multi-target domain transfer results of our single MTDT-Net in the driving scenes. The top row and leftmost column represent source domain images and multiple target domain images, respectively. The other images are the domain transferred images generated by passing the source image at each column through our MTDT-Net. + +# Abstract + +In this paper, we present a direct adaptation strategy (ADAS), which aims to directly adapt a single model to multiple target domains in a semantic segmentation task without pretrained domain-specific models. To do so, we design a multi-target domain transfer network (MTDT-Net) that aligns visual attributes across domains by transferring the domain distinctive features through a new target adaptive denormalization (TAD) module. Moreover, we propose a bidirectional adaptive region selection (BARS) that reduces the attribute ambiguity among the class labels by adaptively selecting the regions with consistent feature statistics. We show that our single MTDT-Net can synthesize visually pleasing domain transferred images with complex driving datasets, and BARS effectively filters out the unnecessary region of training images for each target domain. With the collaboration of MTDT-Net and BARS, our ADAS achieves state-of-the-art performance for multi-target domain adaptation (MTDA). To the best of our knowledge, our method is the first MTDA method that directly adapts to multiple domains in semantic segmentation. + +# 1. Introduction + +Unsupervised domain adaptation (UDA) [14, 20, 26, 27, 49] aims to alleviate the performance drop caused by the distribution discrepancy between domains. It is widely utilized in synthetic-to-real adaptation for various computer vision applications that require a large number of labeled data. Most of the works are designed for single-target domain adaptation (STDA), which allows a single network to adapt to a specific target domain. It rarely addresses the variability in the real-world, particularly changes in driving region, illumination, and weather conditions in autonomous driving scenarios. This issue can be tackled by adopting multiple target-specific adaptation models, but this limits the memory efficiency, scalability, and practical utility of embedded autonomous systems. + +Recently, multi-target domain adaptation (MTDA) methods [11,18,40,43,48,58] have been proposed, which enables a single model to adapt a labeled source domain to multiple unlabeled target domains. Most of works train multiple STDA models and then distill the knowledge into a single multi-target domain adaptation network. Recent approaches [18,40,48] transfer the knowledge from label pre + +![](images/d2f8125b5ba3ced96cf8bc26e5a75d9a965f2f4a53d9a6818728f18f917119e1.jpg) +(a) Existing MTDA method + +![](images/70eaf944e0e5c76b9581e3180a2f891280d8068c7e17183e9a19b635ee5dc523.jpg) +(b) Ours +Figure 2. Illustration of the existing MTDA and our method. (a) Conventional MTDA methods pretrain each STDA model then distill the knowledge into a single MTDA model. (b) Our ADAS directly adapts multiple target domains. + +dictors as shown in Fig. 2-(a). These methods show impressive results, but their performance can be restricted by the performance of the pretrained models. Moreover, inaccurate label predictions in the teacher network can degrade model performance, but none of works have deeply investigated them. To address this problem, we propose A Direct Adaptation Strategy (ADAS) that directly adapts a single model to multiple target domains without pretrained STDA models, as shown in Fig. 2-(b). Our approach achieves robust multi-domain adaptation by exploiting the feature statistics of training data on multiple domains. The followings provide a detailed introduction of our sub-modules: Multi-Target Domain Transfer Networks (MTDT-Net) and a Bidirectional Adaptive Region Selection (BARS). + +MTDT-Net We present a Multi-Target Domain Transfer Network (MTDT-Net) that transfers the distinctive attribute of target domains to a source domain rather than learning all of the target domain distributions. Our network consists of a novel Target Adaptive Denormalization (TAD) that helps to adapt the statistics of source feature to that of the target feature. While the existing works on UDA [3,6,7,14,31,34,37] require domain-specific encoders and generators for multi-target domain adaptation, the TAD module enables our single network to adapt to multiple domains. Fig. 1 shows how a single MTDT-Net can efficiently synthesize visually pleasing domain transferred images. + +BARS Although the visual attributes across domains are well-aligned, there are still some attribute ambiguities among the class labels in semantic segmentation. The ambiguity is usually observed on the regions with similar attributes but different label, such as the sidewalks in GTA5 and the roads in Cityscapes as shown in Fig. 3-(a),(c). This confuses the model finding the accurate decision boundary. Moreover, the predictions from target domains usually have noisy labels leading to inaccurate training of the task network, as shown in Fig. 3-(b),(d). To solve these issues, we propose a Bi-directional Adaptive Region Selection (BARS), which alleviates the confusion. It adaptively selects the regions with consistent feature statistics as shown in Fig. 3-(e). It can also select the pseudo label + +![](images/556f325c4d97ec0ab440f0d4d02d5ba078167e6173c2612bc2b81f63c66f742a.jpg) +(a) Domain transferred image + +![](images/4fa95483aeb2bb25d9ec8a5fb79fd133988b9bdf143ae4c29d657e83580bb0db.jpg) +(b) Target image + +![](images/4610d63086b661260f96e51224dfb08aa60c5f0c2ab872cd5945bc346548e266.jpg) +(c) Ground-truth label of (a) + +![](images/436f870272ca9111cdd5c56cfab7ea6d228cf82f53a233ccc09a27e9ed9f3a30.jpg) +(d) Pseudo label of (b) + +![](images/3ca80c2ce7633558310c2c13578e367c8df33870bd17477d6f32ecc8d56ab17f.jpg) +(e) Selected region of (c) +Figure 3. Examples of the regions with similar attributes but different labels (c) (purple: road, pink: sidewalk), and the noisy prediction (d). The black regions in (e) and (f) are regions filtered by BARS. + +![](images/ce00ab232d41a436124cd074ce083792b26a6fb2f21069becae2bad6b6bac7d3.jpg) +(f) Selected region of (d) + +of the target images for our self-training scheme, as shown in Fig. 3-(f). We show that BARS allows the task network to perform robust training and achieve the improved performance. + +To the best of our knowledge, our multi-target domain adaptation method is the first approach that directly adapts the task network to multiple target domains without pretrained STDA models in semantic segmentation. The extensive experiments show that the proposed method achieves state-of-the-art performance on semantic segmentation task. At the end, we demonstrate the effectiveness of the proposed MTDT-Net and BARS. + +# 2. Related Work + +# 2.1. Domain Transfer + +With the advent of generative adversarial networks (GANs) [12], the adversarial learning has shown promising results not only in photorealistic image synthesis [1, 4, 22-24, 35, 36, 44] but also in domain transfer [14, 17, 19, 20, 26, 27, 29, 30, 49, 51, 61]. The traditional domain transfer methods rely on adversarial learning [19, 29, 51, 61] or the typical style transfer method [9, 10, 16, 38, 53]. Afterwards, the studies on feature disentanglement [17, 26, 27, 30, 42] present a model that can apply various styles by appropriately utilizing disentangled features that are separately encoded as content and style. Recent works [46, 62] have tackled more in-depth domain transfer problems. Richter et al. [46] propose a rendering-aware denormalization (RAD) that constructs style tensors by using the abundant condition + +information from G-buffers, and show high fidelity domain transfer in a driving scene. Zhu et al. [62] propose a semantic region-wise domain transfer model by extracting a style vector for each semantic region. + +# 2.2. Unsupervised Domain Adaptation for Semantic Segmentation + +Traditional feature-level adaptation methods [15, 32, 33, 52, 55] aim to align the source and target distribution in feature space. Most of them [15, 32, 33] adopt adversarial learning with the intermediate features of the segmentation network, and the others [52, 55] directly apply adversarial loss to output prediction. Pixel-level adaptation methods [3, 27, 31, 37] reduce the domain gap in the image-level by synthesizing target-styled images. Several works [6, 7, 14] adopt both feature-level and pixel-level methods. Another direction of UDA [28, 34, 59, 60, 63] is to take a self-supervised learning approach for dense prediction tasks, such as semantic segmentation. Some works [28, 60, 63] obtain high confidence labels measured by the uncertainty of target prediction, and use them as pseudo ground-truth. The others [34, 59] use proxy features by extracting the centroid of the intermediate features of each class to remove uncertain regions in the pseudo-label. + +# 2.3. Multi-Target Domain Adaptation + +Early studies on MTDA have tackled classification tasks using adaptive learning of a common model parameter dictionary [58], domain-invariant feature extraction [43], or knowledge distillation [40]. Recently, using MTDA on more high-level vision tasks such as semantic segmentation [18, 48] has become an interesting and challenging research topic. These works employ knowledge distillation to transfer the knowledge of domain specific teacher models to a domain-agnostic student model. For more robust adaptation, Isobe et al. [18] enforce the weight regularization to the student network and Saporta et al. [48] use a shared feature extractor that constructs a common feature space for all domains. In this work, we present a more efficient and simpler method that handles multiple domains using a unified architecture without teacher networks or weight regularization. + +# 3. A Direct Adaptation Strategy (ADAS) + +In this section, we describe our direct adaptation strategy for multi-target domain adaptive semantic segmentation. We have a labeled source dataset $\mathcal{S} = \{I_{\mathcal{S}}, Y_{\mathcal{S}}\}$ and $N$ unlabeled target datasets $\mathcal{T}_k = \{I_{\mathcal{T}_k}\}, k \in \{1, \dots, N\}$ , where $I$ and $Y$ are the image and the ground-truth label, respectively. The goal of our approach is to directly adapt a segmentation network $T$ to multiple target domains without training STDA models. Our strategy contains two submodules: a multi-target domain transfer network (MTDT- + +Net), and a bi-directional adaptive region selection (BARS). We describe the details of MTDT-Net and BARS in Sec. 3.1 and Sec. 3.2, respectively. + +# 3.1. Multi-Target Domain Transfer Network (MTDT-Net) + +The overall pipeline of MTDT-Net is illustrated in Fig. 4-(a). The network consists of an encoder $E$ , a generator $G$ , a style extractor $SE$ , a domain style transfer network $DST$ . To build an image feature space, we adopt a typical autoencoder structure with the encoder $E$ and the generator $G$ . Given the source and target images $I_S, I_{T_1}, \ldots, I_{T_N}$ , the encoder $E$ extracts the individual features $\mathcal{F}_S, \mathcal{F}_{T_1}, \ldots, \mathcal{F}_{T_N}$ that are later passed through the generator $G$ to reconstruct the original input images $I_S', I_{T_1}', \ldots, I_{T_N}'$ as follows: + +$$ +\begin{array}{l} \begin{array}{l} \mathcal {F} _ {\mathcal {S}} = E (I _ {\mathcal {S}}), \quad \mathcal {F} _ {\mathcal {T} _ {k}} = E (I _ {\mathcal {T} _ {k}}), \\ I _ {1} ^ {\prime} = C (\mathcal {F} _ {1}), \quad I _ {2} ^ {\prime} = C (\mathcal {F} _ {2}). \end{array} \tag {1} \\ I _ {\mathcal {S}} ^ {\prime} = G (\mathcal {F} _ {\mathcal {S}}), I _ {\mathcal {T} _ {k}} ^ {\prime} = G (\mathcal {F} _ {\mathcal {T} _ {k}}). \\ \end{array} +$$ + +We extract the style tensors $\gamma_{\mathcal{S}}$ , $\beta_{\mathcal{S}}$ of the source image through the style encoder $SE$ , and the content tensor $\mathcal{C}_{\mathcal{S}}$ from the segmentation label only in the source domain through an $1 \times 1$ convolutional layer $\phi(\cdot)$ as follows: + +$$ +\{\gamma_ {\mathcal {S}}, \beta_ {\mathcal {S}} \} = S E (I _ {\mathcal {S}}), \mathcal {C} _ {\mathcal {S}} = \phi (Y _ {\mathcal {S}}). \tag {2} +$$ + +We assume that the image features are composed of the scene structure and detail representation, which we call the content feature $\mathcal{C}_S$ and style feature $\gamma_{S}$ , $\beta_{S}$ as follows: + +$$ +I _ {\mathcal {S}} ^ {\prime \prime} = G \left(\mathcal {F} _ {\mathcal {S}} ^ {\prime}\right), \mathcal {F} _ {\mathcal {S}} ^ {\prime} = \gamma_ {\mathcal {S}} \mathcal {C} _ {\mathcal {S}} + \beta_ {\mathcal {S}}, \tag {3} +$$ + +where the source image feature $\mathcal{F}_S^\prime$ is passed through generator $G$ to obtain the reconstructed input image $I_{\mathcal{S}}^{\prime \prime}$ . The synthesized images $I_{\mathcal{S}}^{\prime}, I_{\mathcal{T}_{k}}^{\prime}, I_{\mathcal{S}}^{\prime \prime}$ are auxiliary outputs to be utilized for network training. The goal of our network is to generate a domain transferred image $I_{\mathcal{S} \to \mathcal{T}_k}$ using the same generator $G$ as follows: + +$$ +I _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} = G \left(\mathcal {F} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}}\right), \mathcal {F} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} = \gamma_ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} \mathcal {C} _ {\mathcal {S}} + \beta_ {\mathcal {S} \rightarrow \mathcal {T} _ {k}}, \tag {4} +$$ + +where $\mathcal{F}_{\mathcal{S}\to \mathcal{T}_k}$ is the domain transferred features, which is composed of the source content $\mathcal{C}_S$ and the $k$ -th target domain style features $\gamma_{\mathcal{S}\rightarrow \mathcal{T}_k},\beta_{\mathcal{S}\rightarrow \mathcal{T}_k}$ . + +To obtain the target domain style tensors, we design a domain style transfer network $(DST)$ which transfers the source style tensors $\gamma_{\mathcal{S}},\beta_{\mathcal{S}}$ to the target style tensors $\gamma_{\mathcal{S}\to \mathcal{T}_k},\beta_{\mathcal{S}\to \mathcal{T}_k}$ as follows: + +$$ +\gamma_ {\mathcal {S} \rightarrow \mathcal {T} _ {k}}, \beta_ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} = D S T (\gamma_ {\mathcal {S}}, \beta_ {\mathcal {S}}, \mu_ {\mathcal {T} _ {k}}, \sigma_ {\mathcal {T} _ {k}}), \tag {5} +$$ + +where the channel-wise mean $\mu_{\mathcal{T}_k}$ and variance $(\sigma_{\mathcal{T}_k})^2$ vectors encode the $k$ -th target domain feature statistics computed by the cumulative moving average (CMA) algorithm + +![](images/fb01c71f950c4aecbf5670662d9b2c1047a61a1ec3b5d67c076f79ee0e85b835.jpg) +(a) Multi-Target Domain Transfer Networks (MTDT-Net) + +![](images/10397a4bc669aa6f3ede840a527d88b60861a2e79681e5b498e4ba91841dc3d0.jpg) +(b) Domain Style Transfer (DST) +Figure 4. Overview of the proposed MTDT-Net. (a) MTDT-Net consists of an encoder $E$ , a style encoder $SE$ , a domain style transfer network $DST$ and a generator $G$ . Given a source image, label map $I_{S}, Y_{S}$ , and target images $I_{\mathcal{T}_k}$ , MTDT-Net aims to produce domain transferred image $I_{S \rightarrow \mathcal{T}_k}$ . The other reconstructed images $I_S', I_{\mathcal{T}_k}', I_S''$ are auxiliary outputs generated only during the training process. (b) $DST$ consists of two TAD residual blocks (ResBlock). The TAD module is followed by each convolutional layer, given the channel-wise statistics of target domains $\mu_{\mathcal{T}_k}, \sigma_{\mathcal{T}_k}$ . (c) TAD transfers the target domain with $\mu_{\mathcal{T}_k}, \sigma_{\mathcal{T}_k}$ by statistics modulation. (d) The multi-head discriminator predicts which domain the image is from, as well as determines whether the image is real or fake. Note that, for the sake of brevity, we illustrate a single target domain setting, but our model deals with multi-target domain adaptation. + +![](images/8b3038527cf51d592a931268c062f68eca7edd0555f80cb80e33514b4b620685.jpg) +(d) Multi-head Discriminator + +$\phi$ Embedding function + +Element-wise multiplication + +$\oplus$ Element-wise addition + +$\mathbb{Q}$ Channel-wise multiplication + +$\boxplus$ Channel-wise addition + +and Welford's online algorithm [56] described in Alg. 1. The $DST$ in Fig. 4-(b) consists of two TAD ResBlock built with a series of convolutional layer, our new Target-Adaptive Denormalization (TAD), and ReLU. TAD is a conditional normalization module that modulates the normalized input with learned scale and bias similar to SPADE [41] and RAD [46] as shown in Fig. 4-(c). We pass the standard deviation $\sigma_{\mathcal{T}_k}$ and the target mean $\mu_{\mathcal{T}_k}$ through each fully connected (FC) layer and use them as scale and bias as follows: + +$$ +\mathrm {T A D} \left(\hat {f} _ {\mathcal {S}}, \mu_ {\mathcal {T} _ {k}}, \sigma_ {\mathcal {T} _ {k}}\right) = F C \left(\sigma_ {\mathcal {T} _ {k}}\right) \hat {f} _ {\mathcal {S}} + F C \left(\mu_ {\mathcal {T} _ {k}}\right), \tag {6} +$$ + +where $\hat{f}_{\mathcal{S}}$ is the instance-normalized [53] input to TAD. For adversarial learning with multiple target domains, we adopt a multi-head discriminator composed of an adversarial discriminator $D_{adv} = D_{adv}^{\prime}\circ D_{shared}$ and a domain classifier $D_{cls} = D_{cls}^{\prime}\circ D_{shared}$ as shown in Fig. 4-(d). + +Each group of networks $\mathcal{G} = \{E,SE,DST,G,\phi \}$ and $\mathcal{D} = \{D_{adv},D_{cls}\}$ is trained by minimizing the following losses, $\mathcal{L}^{\mathcal{G}}$ and $\mathcal{L}^{\mathcal{D}}$ , respectively: + +$$ +\begin{array}{l} \mathcal {L} ^ {\mathcal {D}} = - \mathcal {L} _ {a d v} + \mathcal {L} _ {c l s} ^ {\mathcal {D}}, \\ \mathcal {L} ^ {\mathcal {G}} = \mathcal {L} _ {r e c} + \mathcal {L} _ {p e r} + \mathcal {L} _ {a d v} + \mathcal {L} _ {c l s} ^ {\mathcal {G}}. \\ \end{array} +$$ + +Reconstruction Loss We impose L1 loss on the recon + +structured images $I_{\mathcal{S}}^{\prime}, I_{\mathcal{T}_k}^{\prime}, I_{\mathcal{S}}^{\prime \prime}$ to build an image feature space: + +$$ +\mathcal {L} _ {r e c} = \mathcal {L} _ {1} \left(I _ {\mathcal {S}}, I _ {\mathcal {S}} ^ {\prime}\right) + \mathcal {L} _ {1} \left(I _ {\mathcal {S}}, I _ {\mathcal {S}} ^ {\prime \prime}\right) + \sum_ {k = 1} ^ {N} \mathcal {L} _ {1} \left(I _ {\mathcal {T} _ {k}}, I _ {\mathcal {T} _ {k}} ^ {\prime}\right). \tag {8} +$$ + +Adversarial Loss We apply the patchGAN [19] discriminator $D_{adv}$ to impose an adversarial loss on the domain transferred images and the corresponding target images: + +$$ +\begin{array}{l} \mathcal {L} _ {a d v} = \sum_ {k = 1} ^ {N} \left(\mathbb {E} _ {I _ {\mathcal {T} _ {k}}} \left[ \log D _ {a d v} \left(I _ {\mathcal {T} _ {k}}\right) \right] \right. \tag {9} \\ \left. + \mathbb {E} _ {I _ {\mathcal {S} \rightarrow \tau_ {k}}} \left[ 1 - \log D _ {a d v} \left(I _ {\mathcal {S} \rightarrow \tau_ {k}}\right)\right]\right). \\ \end{array} +$$ + +Domain Classification Loss We build the domain classifier $D_{cls}$ to classify the domain of the input images. We impose the cross-entropy loss with the target images for $\mathcal{D}$ and with the domain transferred images for $\mathcal{G}$ : + +$$ +\mathcal {L} _ {c l s} ^ {\mathcal {D}} = - \sum_ {k = 1} ^ {N} t _ {k} \log D _ {c l s} \left(I _ {\mathcal {T} _ {k}}\right), \tag {10} +$$ + +$$ +\mathcal {L} _ {c l s} ^ {\mathcal {G}} = - \sum_ {k = 1} ^ {N} t _ {k} \log D _ {c l s} \left(I _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}}\right), +$$ + +where $t_k \in \mathbb{R}^N$ is the one-hot encoded class label of the target domain $\mathcal{T}_k$ . + +Algorithm 1 Domain feature statistics extraction +Input: $\mathcal{F}_{\mathcal{T}_k} \in \mathbb{R}^{H \times W \times C}, k \in \{1, \dots, N\}$ +Update: $\mu_{\mathcal{T}_k}, (\sigma_{\mathcal{T}_k})^2 \in \mathbb{R}^C$ $\% 1.$ Initialization +1: for $k = 1$ to $N$ do +2: $M_{\mathcal{T}_k} = 0, S_{\mathcal{T}_k} = 0$ // $M_{\mathcal{T}_k}, S_{\mathcal{T}_k} \in \mathbb{R}^{H \times W \times C}$ +3: end for + $\% 2.$ Online update // $N_{update}$ is # of update iterations +4: for $n = 0$ to $N_{update}$ do +5: for $k = 1$ to $N$ do +6: $\mu_n^{\mathcal{T}_k} \leftarrow \frac{1}{HW} \sum_{i=0}^{H-1} \sum_{j=0}^{W-1} M_{\mathcal{T}_k}(i,j)$ +7: $M_{\mathcal{T}_k} \leftarrow M_{\mathcal{T}_k} + (\mathcal{F}_{\mathcal{T}_k} - M_{\mathcal{T}_k})/(n+1)$ +8: $\mu_{n+1}^{\mathcal{T}_k} \leftarrow \frac{1}{HW} \sum_{i=0}^{H-1} \sum_{j=0}^{W-1} M_{\mathcal{T}_k}(i,j)$ +9: $\tilde{\mu}_n^{\mathcal{T}_k}, \tilde{\mu}_{n+1}^{\mathcal{T}_k} \leftarrow \text{expand } \mu_n^{\mathcal{T}_k}, \mu_{n+1}^{\mathcal{T}_k}$ to $\mathbb{R}^{H \times W \times C}$ +10: if $n = 0$ then +11: $S_{\mathcal{T}_k} \leftarrow (\mathcal{F}_{\mathcal{T}_k} - \tilde{\mu}_{n+1}^{\mathcal{T}_k})^2$ +12: else +13: $S_{\mathcal{T}_k} \leftarrow S_{\mathcal{T}_k} + (\mathcal{F}_{\mathcal{T}_k} - \tilde{\mu}_n^{\mathcal{T}_k})(\mathcal{F}_{\mathcal{T}_k} - \tilde{\mu}_{n+1}^{\mathcal{T}_k})$ +14: $\mu_{\mathcal{T}_k} \leftarrow \mu_{n+1}^{\mathcal{T}_k}$ +15: $(\sigma_{\mathcal{T}_k})^2 \leftarrow \frac{1}{nHW} \sum_{i=0}^{H-1} \sum_{j=0}^{W-1} S_{\mathcal{T}_k}(i,j)$ +16: end if +17: end for +18: end for + +Perceptual Loss We impose a perceptual loss [21] widely used for domain transfer as well as style transfer [9, 16]: + +$$ +\mathcal {L} _ {p e r} = \sum_ {k = 1} ^ {N} \sum_ {l \in L} | | P _ {l} (I _ {\mathcal {S}}) - P _ {l} (I _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}}) | | _ {2} ^ {2}, \tag {11} +$$ + +where the set of layers $L$ is the subset of the perceptual network $P$ . + +# 3.2. Bi-directional Adaptive Region Selection (BARS) + +The key idea of BARS is to select the pixels where the feature statistics are consistent, then train a task network $T$ by imposing loss on the selected region as illustrated in Fig. 5. We apply it in both the domain transferred image and the target image. We first extract each centroid feature $\dot{\mathcal{C}}$ of class $c$ as follows: + +$$ +\begin{array}{c}\dot {\mathcal {C}} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} ^ {c} = \frac {1}{N _ {c}} \sum_ {i} \sum_ {j} \mathbb {1} (Y _ {\mathcal {S}} (i, j) = c) \dot {\mathcal {F}} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} (i, j),\\\dot {\mathcal {C}} _ {\mathcal {T} _ {k}} ^ {c} = \frac {1}{N _ {c}} \sum_ {i} \sum_ {j} \mathbb {1} (\hat {Y} _ {\mathcal {T} _ {k}} (i, j) = c) \dot {\mathcal {F}} _ {\mathcal {T} _ {k}} (i, j),\end{array}\tag {12} +$$ + +where $\mathbb{1}$ is an indicator function, $N_{c}$ is the number of pixels of class $c$ , and $i,j$ are the indices of the spatial coordinates. The feature map $\dot{\mathcal{F}}$ is from the second last layer of the task network $T$ . To extract the centroids, we use the ground-truth + +![](images/6cd52066fe2d44bf26c11f0040282f8085391bef26fb384d6914c07a96528a66.jpg) +Figure 5. Overview of BARS. For each class $c \in \{1, \dots, N_{cls}\}$ , BARS extracts the centroids $\dot{\mathcal{C}}_{\mathcal{S} \to \mathcal{T}_k}^c, \dot{\mathcal{C}}_{\mathcal{T}_k}^c$ from the intermediate features $\dot{\mathcal{F}}_{\mathcal{S} \to \mathcal{T}_k}, \dot{\mathcal{F}}_{\mathcal{T}_k}$ of the segmentation network $T$ with RoI pooling and update them with CMA algorithm. Then, BARS measures the similarity of two cases, “ $\dot{\mathcal{F}}_{\mathcal{S} \to \mathcal{T}_k} \leftrightarrow \dot{\mathcal{C}}_{\mathcal{T}_k}^c$ ” and “ $\dot{\mathcal{F}}_{\mathcal{T}_k} \leftrightarrow \dot{\mathcal{C}}_{\mathcal{S} \to \mathcal{T}_k}^c$ ”, and selects the adaptive region. $\widehat{\mathbb{m}}$ is a switch that selects the labels for centroid update in Equ. (12), either $Y_S$ , $\hat{Y}_{\mathcal{T}_k}$ for the first $m$ iterations or $Y_{\mathcal{S} \to \mathcal{T}_k}^{BARS}$ , $\hat{Y}_{\mathcal{T}_k}^{BARS}$ after the $m$ iterations. We set $m$ as 300 iterations for our experiments. + +label $Y_{S}$ of the domain transferred image and the pseudo label $\hat{Y}_{\mathcal{T}_k}$ of the target image. For the online learning with the centroids, we also apply the CMA algorithm in Alg. 1 to the above centroids. Then, we design the selection mechanism using the following two assumptions: + +- The region with features $\dot{\mathcal{F}}_{\mathcal{S} \to \mathcal{T}_k}$ far from the target centroid $\dot{\mathcal{C}}_{\mathcal{T}_k}$ would disturb the adaptation process. +- The region with target features $\dot{\mathcal{F}}_{\mathcal{T}_k}$ far from the centroids $\dot{\mathcal{C}}_{S\rightarrow \mathcal{T}_k}$ is likely to be a noisy prediction region. + +Based on these assumptions, we find the nearest class $\dot{c}$ for each pixel in the feature map using the L2 distance between features on each pixels and centroid features as follows: + +$$ +\begin{array}{c}\dot {c} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} (i, j) = \underset {c} {\operatorname {a r g m i n}} \left|\left| \dot {\mathcal {F}} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} (i, j) - \dot {\mathcal {C}} _ {\mathcal {T} _ {k}} ^ {c} \right|\right| _ {2},\\\dot {c} _ {\mathcal {T} _ {k}} (i, j) = \underset {c} {\operatorname {a r g m i n}} \left|\left| \dot {\mathcal {F}} _ {\mathcal {T} _ {k}} (i, j) - \dot {\mathcal {C}} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} ^ {c} \right|\right| _ {2}.\end{array}\tag {13} +$$ + +We obtain the filtered labels $Y_{\mathcal{S} \to \mathcal{T}_k}^{BARS}$ , $\hat{Y}_{\mathcal{T}_k}^{BARS}$ using the nearest class $\dot{c}$ : + +$$ +\begin{array}{l}Y _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} ^ {B A R S} (i, j) = \left\{\begin{array}{l l}Y _ {\mathcal {S}} (i, j)&\text {i f} \dot {c} _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} (i, j) = Y _ {\mathcal {S}} (i, j),\\\emptyset&\text {o t h e r w i s e}\end{array}, \right.\\\hat {Y} _ {\mathcal {T} _ {k}} ^ {B A R S} (i, j) = \left\{\begin{array}{l l}\hat {Y} _ {\mathcal {T} _ {k}} (i, j)&\text {i f} \dot {c} _ {\mathcal {T} _ {k}} (i, j) = \hat {Y} _ {\mathcal {T} _ {k}} (i, j),\\\emptyset&\text {o t h e r w i s e}\end{array}. \right.\end{array}\tag {14} +$$ + +
MethodTargetflatconstr.objectnatureskyhumanvehiclemIoUAvg.
G→C,IADVENT [55]C93.980.226.279.080.552.578.070.067.4
I91.854.514.476.890.347.578.364.8
MTKT [48]C94.582.023.780.184.051.077.670.468.2
I91.456.613.277.391.451.479.965.9
OursC95.182.639.884.681.263.680.775.471.2
I90.563.022.273.787.954.376.966.9
G→C,MADVENT [55]C93.180.524.077.981.052.575.069.168.9
M90.071.331.173.092.646.676.668.7
MTKT [48]C95.081.623.680.183.653.779.871.170.9
M90.673.331.075.394.552.279.870.8
OursC96.483.535.183.884.962.381.375.373.9
M88.673.741.075.493.458.577.272.6
G→C,I,MADVENT [55]C93.680.626.478.181.551.976.469.867.8
I92.054.615.777.290.550.878.665.6
M89.272.432.473.092.741.674.968.0
MTKT [48]C94.680.723.879.084.551.079.270.469.1
I91.755.614.578.092.649.879.465.9
M90.573.732.575.594.351.280.271.1
OursC95.882.438.382.485.060.580.274.971.3
I89.952.725.078.192.151.077.966.7
M89.271.545.275.892.356.175.472.2
+ +Finally, we train the task network $T$ with the labels using a typical cross-entropy loss $\mathcal{L}_{Task}$ : + +$$ +\min _ {T} \left(\mathcal {L} _ {\text {T a s k}} \left(I _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}}, Y _ {\mathcal {S} \rightarrow \mathcal {T} _ {k}} ^ {\text {B A R S}}\right) + \mathcal {L} _ {\text {T a s k}} \left(I _ {\mathcal {T} _ {k}}, \hat {Y} _ {\mathcal {T} _ {k}} ^ {\text {B A R S}}\right)\right). \tag {15} +$$ + +# 4. Experiments + +In this section, we describe the implementation details and experimental results of the proposed ADAS. We evaluate our method on a semantic segmentation task in both the synthetic-to-real adaptation in Sec. 4.2 and the real-to-real adaptation in Sec. 4.3 with multiple target domain datasets. We also conduct an extensive study to validate each submodule, MTDT-Net and BARS, in Sec. 4.4. + +# 4.1. Training Details + +Datasets We use four different driving datasets containing one synthetic and three real-world datasets, each of which has a unique scene structure and visual appearance. + +- GTA5 [47] is a synthetic dataset of 24,966 labeled images captured from a video game. +- Cityscapes [8] is an urban dataset collected from European cities, and includes 2,975 images in the training set and 500 in the validation set. + +Table 1. Quantitative comparison between our method and state-of-the-art methods on GTA5 (G) to Cityscapes (C), IDD (I), and Mapillary (M) with 7 classes setting. Bold: Best score among all the methods. + +
MethodmIoUmIoU Avg.
CIM
G→C, ICCL [18]45.046.0-45.5
Ours45.846.3-46.1
G→C, MCCL [18]45.1-48.846.8
Ours45.8-49.247.5
G→I, MCCL [18]-44.546.445.5
Ours-46.147.646.9
G→C, I, MCCL [18]46.747.049.947.9
Ours46.947.751.148.6
+ +Table 2. Results of adapting GTA5 to Cityscapes (C), IDD (I), and Mapillary (M) with 19 classes setting. + +- IDD [54] has total 10,003 Indian urban driving scenes, which contains 6,993 images for training, 981 for validation and 2,029 for test. +- Mapillary Vista [39] is a large-scale dataset that contains multiple city scenes from around the world with 18,000 images for training and 2,000 for validation. + +For a fair comparison with the recent MTDA methods [18, 48, 55], we follow the segmentation label mapping protocol of 19 classes and super classes (7 classes) proposed in the papers. We use mIoU (\%) as evaluation metric for all domain adaptation experiments. + +![](images/8ad7f952d0b88312101474b2ca2a54495b0066037f5417257311097ee2eb56f3.jpg) +Figure 6. Qualitative comparison between source only and our method on GTA5 (G) to Cityscapes (C), IDD (I), and Mapillary (M) with 7 classes and 19 classes setting. + +![](images/873e34536eeedc3e233004fb11879b1a8a2ea37cb85edd8144d7886fd02558be.jpg) +Figure 7. Real-to-real domain transfer results with Cityscapes (C), IDD (I), and Mapillary (M). Red boxed images are the input. + +Implementation Details We use the Deeplabv2+ResNet-101 [5, 13] architecture for our segmentation network, as used in other conventional works [18, 48]. We use the same encoder and generator structure of DRANet [27] with group normalization [57]. For our multi-head discriminator, we use the patchGAN discriminator [19] and two fully connected layers as the domain classifier. We use ImageNet-pretrained VGG19 networks [50] as the perceptual network and compute the perceptual loss at layer relu_4_2. We use a stochastic gradient descent optimizer [2] with a learning rate of $2.5 \times 10^{-4}$ , a momentum of 0.9 and a weight decay of $5 \times 10^{-4}$ for training the segmentation network. We use Adam [25] optimizer with a learning rate of $1 \times 10^{-3}$ , momentum of 0.9 and 0.999 and a weight decay of $1 \times 10^{-5}$ for training all the networks in MTDT-Net. + +# 4.2. Synthetic-to-Real Adaptation + +We conduct the experiments on synthetic-to-real adaptation with the same settings as competitive methods [18, 48]. We use GTA5 as the source dataset and a combination of Cityscapes, IDD and Mapillary as multiple target datasets. We show the qualitative results of the multi-target domain transfer in Fig. 1. This demonstrates that our single MTDT-Net can synthesize high quality images even in multi-target domain scenarios. We report the quantitative results for semantic segmentation with 7 common classes in Tab. 1, and 19 classes in Tab. 2, respectively. The results show that our method, composed of both MTDT-Net and BARS outperforms state-of-the-art methods by a large margin. Compared to ADVENT [55] calculating selection criterion value from incorrect target prediction, our BARS derives the criterion robustly from accurate source GT without class ambiguity. Moreover, MTDT-Net aims to transfer visual attributes of domains rather than adapting color information using a color transfer algorithm [45] proposed in CCL [18]. The new attribute alignment method improves the task performance over state-of-the-art methods. Lastly, the qualitative results in Fig. 6 demonstrates that our method produces reliable label prediction maps on both label mapping protocols. + +# 4.3. Real-to-Real Adaptation + +To show the scalability of our model, we also conduct an experiment with real-to-real adaptation scenarios. We set one of the real-world datasets, Cityscapes, IDD, and Map- + +
# of classesMethodmIoUmIoU Avg.
CIM
C→I, M19CCL [18]-53.651.452.5
Ours-48.353.650.5
7MTKT [48]-68.369.368.8
Ours-70.475.172.7
I→C, M19CCL [18]46.8-49.848.3
Ours49.1-50.850.0
7MTKT [48]----
Ours79.5-77.978.7
M→C, I19CCL [18]58.554.1-56.3
Ours58.754.1-56.4
7MTKT [48]----
Ours75.881.1-78.5
+ +illary, as the source domain and the other two as the target domains. We conduct the experiments with all possible combinations of source and target. The results in Fig. 7 show that our MTDT-Net also produces high fidelity images even across real-world datasets. As shown in Tab. 3, our method outperforms the competitive methods in the overall results. The experiments demonstrate that our method achieves realistic image synthesis not only on synthetic-to-real but also on real-to-real adaptation, which validates the scalability and reliability of our model. + +# 4.4. Further Study on MTDT-Net and BARS + +In this section, we conduct additional experiments to validate each sub-module, MTDT-Net and BARS. + +MTDT-Net We compare our MTDT-Net with a color transfer algorithm [45] used in CCL [18] and DRANet [27] which are the most recent multi-domain transfer methods. We conduct the experiment on a synthetic-to-real adaptation using GTA5, Cityscapes, IDD and Mapillary as in Sec. 4.2. We train the task network using synthesized images from each method with corresponding source labels. Tab. 4 shows the results for semantic segmentation with 19 classes setting. Among the competitive methods, MTDT-Net shows the best performance. We believe the other two methods hardly transfer the domain-specific attribute of each target dataset. The color transfer algorithm just shifts the distribution of the source image to that of the target image in color space, rather than aligning domain properties. DRANet tries to cover the feature space of each domain using just one parameter, called the domain-specific scale parameter, resulting in unstable learning with multiple complex datasets. On the other hand, MTDT-Net robustly synthesizes the domain transferred images by exploiting the target feature statistics, which facilitate better domain transfer. + +BARS To validate the effectiveness of the two filtered labels $Y_{\mathcal{S} \to \mathcal{T}_k}^{BARS}$ and $\hat{Y}_{\mathcal{T}_k}^{BARS}$ , we conduct a set of experiments with/without each component. We train the segmentation network with the output images of MTDT-Net using a full + +Table 3. Results of real-to-real MTDA on all possible combinations among Cityscape (C), IDD (I), and Mapillary (M). + +
MethodmIoUmIoU Avg.
CIM
Color Transfer [45]33.837.442.137.8
DRAMet [27]37.339.343.239.9
MTDT-Net41.440.644.142.0
+ +Table 4. Comparison of MTDA-Net with competitive methods on synthetic-to-real adaptation with 19 classes setting. + +
YBArsS→TKYBArsCmIoUmIoU Avg.
CIM
41.440.644.142.0
43.144.046.944.7
45.044.947.545.8
46.947.751.148.6
+ +Table 5. Ablation study of BARS on synthetic-to-real adaptation with 19 classes setting. + +source label in the experiments without $Y_{\mathcal{S} \to \mathcal{T}_k}^{BARS}$ . With just the $Y_{\mathcal{S} \to \mathcal{T}_k}^{BARS}$ or $\hat{Y}_{\mathcal{T}_k}^{BARS}$ , the model achieves large improvements in Tab. 5, respectively. However, the region with ambiguous or noisy labels limits the model performance, so the network trained with both filtered labels achieves the best performance. + +# 5. Conclusion + +In this paper, we present ADAS, a new approach for multi-target domain adaptation, which directly adapts a single model to multiple target domains without relying on the STDA models. For the direct adaptation, we introduce two key components: MTDT-Net and BARS. MTDT-Net enables a single model to directly transfer the distinctive properties of multiple target domains to the source domain by introducing the novel TAD ResBlock. BARS helps to remove the outliers in the segmentation labels of both the domain transferred images and the corresponding target images. Extensive experiments show that MTDT-Net synthesizes visually pleasing images transferred across domains, and BARS effectively filters out the inconsistent region in segmentation labels, which leads to robust training and boosts the performance of semantic segmentation. The experiments on benchmark datasets demonstrate that our method designed with MTDT-net and BARS outperforms the current state-of-the-art MTDA methods. + +Acknowledgement This work was supported by Institute of Information & Communications Technology Planning & Evaluation(IITP) grant funded by the Korea government(MSIT) (No.2014-3-00123, Development of High Performance Visual BigData Discovery Platform for Large-Scale Realtime Data Analysis), and the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2020R1C1C1013210). + +# References + +[1] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. 2 +[2] Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT'2010, pages 177-186. Springer, 2010. 7 +[3] Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3722-3731, 2017. 2, 3 +[4] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. International Conference on Learning Representations (ICLR), 2019. 2 +[5] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4):834-848, 2017. 7 +[6] Yuhua Chen, Wen Li, Xiaoran Chen, and Luc Van Gool. Learning semantic segmentation from synthetic data: A geometrically guided input-output adaptation approach. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1841-1850, 2019. 2, 3 +[7] Yun-Chun Chen, Yen-Yu Lin, Ming-Hsuan Yang, and Jia-Bin Huang. Crdoco: Pixel-level domain transfer with cross-domain consistency. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1791-1800, 2019. 2, 3 +[8] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3213-3223, 2016. 6 +[9] Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudur. A learned representation for artistic style. arXiv preprint arXiv:1610.07629, 2016. 2, 5 +[10] Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2414-2423, 2016. 2 +[11] Behnam Gholami, Pritish Sahu, Ognjen Rudovic, Konstantinos Bousmalis, and Vladimir Pavlovic. Unsupervised multi-target domain adaptation: An information theoretic approach. IEEE Transactions on Image Processing, 29:3993-4002, 2020. 1 +[12] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems (NeurIPS), pages 2672–2680, 2014. 2 +[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceed- + +ings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 7 +[14] Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darryll. Cycada: Cycle-consistent adversarial domain adaptation. In International Conference on Machine Learning (ICML), pages 1989-1998. PMLR, 2018. 1, 2, 3 +[15] Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcts in the wild: Pixel-level adversarial and constraint-based adaptation. arXiv preprint arXiv:1612.02649, 2016. 3 +[16] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 1501-1510, 2017. 2, 5 +[17] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 172-189, 2018. 2 +[18] Takashi Isobe, Xu Jia, Shuaijun Chen, Jianzhong He, Yongjie Shi, Jianzhuang Liu, Huchuan Lu, and Shengjin Wang. Multi-target domain adaptation with collaborative consistency learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8187-8196, 2021. 1, 3, 6, 7, 8 +[19] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1125-1134, 2017. 2, 4, 7 +[20] Somi Jeong, Youngjung Kim, Eungbean Lee, and Kwanghoon Sohn. Memory-guided unsupervised imaged-to-image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6558-6567, 2021. 1, 2 +[21] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In Proceedings of European Conference on Computer Vision (ECCV), pages 694–711. Springer, 2016. 5 +[22] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. International Conference on Learning Representations (ICLR), 2018. 2 +[23] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4401-4410, 2019. 2 +[24] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8110-8119, 2020. 2 +[25] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.7 +[26] Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In Proceed- + +ings of the European conference on computer vision (ECCV), pages 35-51, 2018. 1, 2 +[27] Seunghun Lee, Sunghyun Cho, and Sunghoon Im. Dranet: Disentangling representation and adaptation networks for unsupervised cross-domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15252-15261, 2021. 1, 2, 3, 7, 8 +[28] Yunsheng Li, Lu Yuan, and Nuno Vasconcelos. Bidirectional learning for domain adaptation of semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6936-6945, 2019. 3 +[29] 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. 2 +[30] Ming-Yu Liu, Xun Huang, Arun Mallya, Tero Karras, Timo Aila, Jaakko Lehtinen, and Jan Kautz. Few-shot unsupervised image-to-image translation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10551-10560, 2019. 2 +[31] Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 469-477, 2016. 2, 3 +[32] Yawei Luo, Ping Liu, Tao Guan, Junqing Yu, and Yi Yang. Significance-aware information bottleneck for domain adaptive semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6778-6787, 2019. 3 +[33] Yawei Luo, Liang Zheng, Tao Guan, Junqing Yu, and Yi Yang. Taking a closer look at domain shift: Category-level adversaries for semantics consistent domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2507-2516, 2019. 3 +[34] Haoyu Ma, Xiangru Lin, Zifeng Wu, and Yizhou Yu. Coarse-to-fine domain adaptive semantic segmentation with photometric alignment and category-center regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4051-4060, 2021. 2, 3 +[35] 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. 2 +[36] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. International Conference on Learning Representations (ICLR), 2018. 2 +[37] Zak Murez, Soheil Kolouri, David Kriegman, Ravi Ramamoorthi, and Kyungnam Kim. Image to image translation for domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4500-4509, 2018. 2, 3 +[38] Hyeonseob Nam and Hyo-Eun Kim. Batch-instance normalization for adaptively style-invariant neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 2558-2567, 2018. 2 +[39] Gerhard Neuhold, Tobias Ollmann, Samuel Rota Bulo, and Peter Kontschieder. The mapillary vistas dataset for semantic + +understanding of street scenes. In Proceedings of the IEEE international conference on computer vision, pages 4990-4999, 2017. 6 +[40] Le Thanh Nguyen-Meidine, Atif Belal, Madhu Kiran, Jose Dolz, Louis-Antoine Blais-Morin, and Eric Granger. Unsupervised multi-target domain adaptation through knowledge distillation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 1339-1347, 2021. 1, 3 +[41] Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2337-2346, 2019. 4 +[42] Taesung Park, Jun-Yan Zhu, Oliver Wang, Jingwan Lu, Eli Shechtman, Alexei A Efros, and Richard Zhang. Swapping autoencoder for deep image manipulation. Advances in Neural Information Processing Systems (NeurIPS), 2020. 2 +[43] Xingchao Peng, Zijun Huang, Xineng Sun, and Kate Saenko. Domain agnostic learning with disentangled representations. In International Conference on Machine Learning, pages 5102-5112. PMLR, 2019. 1, 3 +[44] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. International Conference on Learning Representations (ICLR), 2016. 2 +[45] Erik Reinhard, Michael Adhikhmin, Bruce Gooch, and Peter Shirley. Color transfer between images. IEEE Computer graphics and applications, 21(5):34-41, 2001. 7, 8 +[46] Stephan R Richter, Hassan Abu AlHaija, and Vladlen Koltun. Enhancing photorealism enhancement. arXiv preprint arXiv:2105.04619, 2021. 2, 4 +[47] Stephan R Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun. Playing for data: Ground truth from computer games. In Proceedings of European Conference on Computer Vision (ECCV), pages 102-118. Springer, 2016. 6 +[48] Antoine Saporta, Tuan-Hung Vu, Matthieu Cord, and Patrick Pérez. Multi-target adversarial frameworks for domain adaptation in semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9072-9081, 2021. 1, 3, 6, 7, 8 +[49] Zhiqiang Shen, Mingyang Huang, Jianping Shi, Xiangyang Xue, and Thomas S Huang. Towards instance-level imaged-to-image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3683-3692, 2019. 1, 2 +[50] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations (ICLR), 2015. 7 +[51] Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. International Conference on Learning Representations (ICLR), 2017. 2 +[52] Yi-Hsuan Tsai, Wei-Chih Hung, Samuel Schulter, Kiyuk Sohn, Ming-Hsuan Yang, and Manmohan Chandraker. Learning to adapt structured output space for semantic segmentation. In Proceedings of the IEEE conference on + +computer vision and pattern recognition, pages 7472-7481, 2018.3 +[53] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016. 2, 4 +[54] Girish Varma, Anbumani Subramanian, Anoop Namboodiri, Manmohan Chandraker, and CV Jawahar. Idd: A dataset for exploring problems of autonomous navigation in unconstrained environments. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1743-1751. IEEE, 2019. 6 +[55] Tuan-Hung Vu, Himalaya Jain, Maxime Bucher, Matthieu Cord, and Patrick Pérez. Advent: Adversarial entropy minimization for domain adaptation in semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2517-2526, 2019. 3, 6, 7 +[56] BP Welford. Note on a method for calculating corrected sums of squares and products. Technometrics, 4(3):419-420, 1962. 4 +[57] Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European conference on computer vision (ECCV), pages 3-19, 2018. 7 +[58] Huanhuan Yu, Mengei Hu, and Songcan Chen. Multi-target unsupervised domain adaptation without exactly shared categories. arXiv preprint arXiv:1809.00852, 2018. 1, 3 +[59] Pan Zhang, Bo Zhang, Ting Zhang, Dong Chen, Yong Wang, and Fang Wen. Prototypical pseudo label denoising and target structure learning for domain adaptive semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12414-12424, 2021. 3 +[60] Zhedong Zheng and Yi Yang. Rectifying pseudo label learning via uncertainty estimation for domain adaptive semantic segmentation. International Journal of Computer Vision, 129(4):1106-1120, 2021. 3 +[61] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 2223-2232, 2017. 2 +[62] Peihao Zhu, Rameen Abdal, Yipeng Qin, and Peter Wonka. Sean: Image synthesis with semantic region-adaptive normalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5104-5113, 2020. 2, 3 +[63] Yang Zou, Zhiding Yu, BVK Kumar, and Jinsong Wang. Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In Proceedings of the European conference on computer vision (ECCV), pages 289-305, 2018. 3 \ No newline at end of file diff --git a/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/images.zip b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e1946fcfc473e337041f84518016c617a2e74c9a --- /dev/null +++ b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5956239337dc7d9bc1a33efeffccb460c9de5a3847ad9a11f8c944685b90fa9a +size 859257 diff --git a/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/layout.json b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce66ad248da204b55dc12757b359fcf0f4d2877 --- /dev/null +++ b/adasadirectadaptationstrategyformultitargetdomainadaptivesemanticsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a0e44aa6cefe5da8a885eaaf22f6e464058fa86345275e2880e4047f8171dd9 +size 484513 diff --git a/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_content_list.json b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cfd65e2638def48daa252d922d1a80f6cc3118fd --- /dev/null +++ b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:947728b0ce164bf6ff4ceca780f0b847b99fb4515c29d5719056af96979908a0 +size 89385 diff --git a/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_model.json b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c464ceb4ad98d8bd0ae3043130fa7af02ac7e5df --- /dev/null +++ b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d95f0dc80ce4bb29c29fe427800029f3379dead7c233548f4179c551c92a4fa +size 109383 diff --git a/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_origin.pdf b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..65fee996203ba0615ad1184331fe4d3c95a9acbd --- /dev/null +++ b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/54c5b8e5-8e51-441e-9bd7-500b1c18236e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b27ebfdd1e877bd794cdbf2736e67b2dd2c4386429d45863dcc2edf88458e90a +size 487566 diff --git a/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/full.md b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..06c52d39f7bdca33d994ee506a3525fc013fe6a6 --- /dev/null +++ b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/full.md @@ -0,0 +1,445 @@ +# AdaSTE: An Adaptive Straight-Through Estimator to Train Binary Neural Networks + +Huu Le + +Rasmus Kjaer Hoier + +Che-Tsung Lin + +Christopher Zach + +Chalmers University of Technology, Gothenburg, Sweden + +huul, hier, chetsung, zach@chalmers.se + +# Abstract + +We propose a new algorithm for training deep neural networks (DNNs) with binary weights. In particular, we first cast the problem of training binary neural networks (BiNNs) as a bilevel optimization instance and subsequently construct flexible relaxations of this bilevel program. The resulting training method shares its algorithmic simplicity with several existing approaches to train BiNNs, in particular with the straight-through gradient estimator successfully employed in BinaryConnect and subsequent methods. In fact, our proposed method can be interpreted as an adaptive variant of the original straight-through estimator that conditionally (but not always) acts like a linear mapping in the backward pass of error propagation. Experimental results demonstrate that our new algorithm offers favorable performance compared to existing approaches. + +# 1. Introduction + +Deploying deep neural networks (DNNs) to computing hardware such as mobile and IoT devices with limited computational and storage resources is becoming increasingly relevant in practice, and hence training methods especially dedicated to quantized DNNs have emerged as important research topics in recent years [9]. In this work, we are particularly interested in the special case of DNNs with binary weights limited to $\{+1, -1\}$ , since in this setting the computations at inference time largely reduce to sole additions and subtractions. Very abstractly, the task of learning in such binary weight neural networks (BiNNs) can be formulated as an optimization program with binary constraints on the network parameters, i.e., + +$$ +\begin{array}{l} \min _ {w} \ell (w) \quad \text {s . t .} w \in \{- 1, 1 \} ^ {d}, \tag {1} \\ = \min _ {w \in \{- 1, 1 \} ^ {d}} \mathbb {E} _ {(x, y) \sim p _ {\mathrm {d a t a}}} [ \psi (f (x, w), y) ], \quad (2) \\ \end{array} +$$ + +where $d$ is the dimensionality of the underlying parameters (i.e. all network weights), $p_{\mathrm{data}}$ is the training distribution and $\psi$ is the training loss (such as the cross-entropy or squared Euclidean error loss). $f(x;w)$ is the prediction of the DNN with weights $w$ for input $x$ . + +In practice, one needs to address problem settings where the parameter dimension $d$ is very large (such as deep neural networks with many layers). However, addressing the binary constraints in the above program is a challenging task, which is due to the combinatorial and non-differentiable nature of the underlying optimization problem. In view of large training datasets, (stochastic) gradient-based methods to obtain minimizers of (1) are highly preferable. Various techniques have been proposed to address the above difficulties and convert (1) into a differentiable surrogate. The general approach is to introduce real-valued "latent" weights $\theta \in \mathbb{R}^d$ , from which the effective weights $w = \mathrm{sgn}(\theta)$ are generated via the sign function (or a differentiable surrogate thereof). One of the simplest and nevertheless highly successful algorithms to train BiNNs termed BinaryConnect [10] is based on straight-through estimators (STE), which ignore the sign mapping entirely when forming the gradient w.r.t. the latent weights $\theta$ (and therefore the update of $\theta$ is based on $\nabla_w\ell(w)$ instead of $\nabla_\theta\ell(\mathrm{sgn}(\theta))$ ). Although this appears initially not justified, BinaryConnect works surprisingly well and is still a valid baseline method for comparison. More recently, the flexibility in choosing the distance-like mapping leveraged in the mirror descent method [30] (and in particular the entropic descent algorithm [7]) provides some justification of BinaryConnect-like methods [3] (see also Sec. 3.2). + +In this work, we propose a new framework for training binary neural networks. In particular, we first formulate the training problem shown in (1) as a bilevel optimization task, which is subsequently relaxed using an optimal value reformulation. Further, we propose a novel scheme to calculate meaningful gradient surrogates in order to update the network parameters. The resulting method strongly resembles BinaryConnect but leverages an adaptive variant of the straight-through gradient estimator: the sign func + +![](images/cf302bccb6c221ccb43ed09e8215893bbf58115cf4d69d887d3d9d012d158ac7.jpg) +Figure 1. Adaptive straight-through estimation illustrated when $s = \tanh$ . $\ell'$ is the incoming back-propagated error signal. Left: $\theta \approx 0$ . The finite difference slope $(\hat{w} - w^{*}) / \beta$ matches the derivative of tanh very well. Middle: $\theta \ll 0 \land \ell' < 0$ . A nearly vanishing derivative of tanh is boosted and tanh becomes "leaky." Right: $\theta \ll 0 \land \ell' > 0$ . No gradient "boosting" in this case. The case $\theta \gg 0$ is symmetrical. + +![](images/3b72c8833cff776c4d7acdc1541ea4bc28848a522ac4331a7e67296201634002.jpg) + +![](images/cac2efd78aa17633bba806e6214104cba63ffc2dbc43e46114f518398e51a234.jpg) + +tion is conditionally replaced by a suitable linear but data-dependent mapping. Fig. 1 illustrates the underlying principle for the tanh mapping: depending on the incoming error signal, vanishing gradients induced by tanh are conditionally replaced by non-vanishing finite-difference surrogates. We finally point out that our proposed method can be cast as a mirror descent method using a data-dependent and varying distance-like mapping. + +# 2. Related Work + +The practical motivation for exploring weight quantization is to reduce the computational costs of deploying (and in some cases training) neural networks. This can be particularly attractive in the case of edge computing and IoT devices [9]. Even when retaining floating point precision for activations $z$ , using binarized weights matrices $W$ means that the omnipresent product $Wz$ reduces to cheaper additions and subtractions of floating point values. + +Already in the early 1990s, [14,43] trained BiNNs using fully local learning rules with layerwise targets computed via node perturbations. In order to avoid the limited scalability of node perturbations, [37] instead employed a differentiable surrogate of the sign function for gradient computation. Recently the use of differentiable surrogates in the backwards pass has been coined the Backward Pass Differentiable Approximation (BPDA) in the context of adversarial attacks [5]. However, the same principle is at the core of many network quantization approaches, most notably the STE for gradient estimation. + +Recent approaches have mainly focused on variations of the STE. A set of real valued (latent) weights are binarized when computing the forward pass, but during the backwards pass the identity mapping is used as its differentiable surrogate (which essentially makes the STE a special case of BPDA). The computed gradients are then used to update the latent weights. The STE was presented by Hinton (and accredited to Krizhevsky) in a video lecture in 2012 [19]. Subsequently it was employed for training networks with binary activations in [8], and to train networks with binary weights (and floating point activations) in the BinaryConnect (BC) model [10]. BinaryConnect also used + +heuristics such as clipping the latent weights and employing Batch Normalization [22] (including its use at the output layer) to improve the performance of STE based training. Further and recent analysis of the straight-through estimator is provided in [47], where its origin is traced back to early work on perceptrons Rosenblatt [35,36]. The STE has also been applied to training fully binarized neural networks (e.g. [21]). Moreover, Rastegari et al. [34] employ the STE for training fully binarized as well as mixed precision networks, and achieve improved performance by introducing layer and channel-wise scaling factors. An interesting line of research [13, 42] has explored adapting the STE to learn parameters of the quantization mapping (such as quantization steps and bit-width subjected to a memory budget). + +Subsequent approaches have focused on deriving similar but less heuristic learning algorithms for networks with binary weights. ProxQuant (PQ) [6], Proximal Mean-Field (PMF) [2], Mirror Descent (MD) [3] and Rotated Binary Neural Networks (RBNN) [26] formulate the task of training DNNs with binary weights as a constrained optimization problem and propose different conversion functions used for moving between real-valued latent weights and binarized weights. A common feature among these methods is that they belong to the class of homotopy methods by gradually annealing the conversion mapping. Qin et al [33] introduce a novel technique for minimizing the information loss (caused by binarization) in the forward pass, and also aims to address gradient error by employing a gradually annealed tanh function as a differentiable surrogate during the backwards pass along with a carefully chosen gradient clipping schedule. Similar to early research, [18] does not introduce latent real-valued weights, but rather updates the binary weights directly using a momentum based optimizer designed specifically for BiNNs. Several authors have approached the training of quantized neural networks via a variational approach [1, 27, 29, 40]. Among those, Bayes-BiNN [29] is particularly competitive: instead of optimizing over binary weights, the parameters of Bernoulli distributions are learned by employing both a Bayesian learning rule [24] and the Gumbel-softmax trick [23, 28] (therefore requiring an inverse temperature parameter to convert the concrete distribution to a Bernoulli one). + +For additional surveys of weight quantization we refer to the review papers [16, 32] as well as section III of [11]. For a review of the efficacy of various ad-hoc techniques commonly employed for training BiNNs we refer to [4]. + +# 3. Background + +After clarifying some mathematical notations we summarize the mirror descent method (and its use to train BiNNs) and the Prox-Quant approach in order to better establish similarities and differences with our proposed method later. + +# 3.1. Notation + +A constraint such as $w \in C$ is written as $\iota_C(w)$ in functional form. We use $\odot$ to denote element-wise multiplication and $\varnothing$ for element-wise division. The derivative of a function $\ell$ at $w$ is written as $\ell'(w)$ . Many mappings will be piece-wise differentiable but continuous. Therefore, in those cases $\ell'(w)$ is a suitable element in the sub- or superderivative. We use an arrow over some variable names (especially $\vec{\beta}$ ) to emphasize that this is a vector and not a scalar. For the same reason we use e.g. $\vec{s}$ and $\vec{\mathrm{sgn}}$ to indicate the vectorized form of a scalar mapping $s$ (or $\mathrm{sgn}$ ) that is applied element-wise. + +# 3.2. Mirror Descent + +In short, mirror descent [7, 30] successively generates new iterates by minimizing a regularized first-order surrogate of the target objective. The most common quadratic regularizer (which leads to the gradient descent method) is replaced by a more general Bregman divergence penalizing large deviations from the previous iterate. The main motivation is to accelerate convergence of first-order methods, but it can also yield very elegant methods such as the entropic descent algorithm, where the utilized Bregman divergence based on the (negated) Shannon entropy is identical to the KL divergence. Entropic descent is very natural when optimizing unknowns constrained to remain in the probability simplex $\Delta$ . The algorithm repeats updates of the form + +$$ +w ^ {(t + 1)} \leftarrow \arg \min _ {w \in \Delta} w ^ {\top} \ell^ {\prime} (w ^ {(t)}) + \frac {1}{\eta} D _ {K L} (w \| w ^ {(t)}) \tag {3} +$$ + +with the associated first-order optimality condition + +$$ +w _ {j} ^ {(t + 1)} \propto w _ {j} ^ {(t)} e ^ {- \eta \ell^ {\prime} (w ^ {(t)}) _ {j}}. \tag {4} +$$ + +Reparametrizing $w$ as $w = \sigma(\theta)$ , where $\sigma$ is the soft-arg-max function, $\sigma(u)_j = e^{u_j} / \sum_{j'} e^{u_{j'}}$ , yields + +$$ +\theta^ {(t + 1)} \leftarrow \theta^ {(t)} - \eta \ell^ {\prime} (w ^ {(t)}) = \theta^ {(t)} - \eta \ell^ {\prime} (\sigma (\theta^ {(t)})). \tag {5} +$$ + +Interestingly, mirror descent modifies the chain rule by bypassing the inner derivative, since the update is based on + +$\ell^{\prime}(\sigma (\theta^{(t)}))$ and not on $\frac{d}{d\theta}\ell (\sigma (\theta^{(t)}))$ as in regular gradient descent. Hence, mirror descent is one way to justify the straight-through estimator. The entropic descent algorithm is leveraged in [3] to train networks with binary (and also generally quantized) weights. The soft-arg-max function $\sigma$ is slowly modified towards a hard arg-max mapping in order to ultimately obtain strictly quantized weights. + +# 3.3. ProxQuant + +ProxQuant [6] is based on the observation that the straight-through gradient estimator is linked to proximal operators via the dual averaging method [44]. The proximal operator for a function $\phi$ is the solution of the following least-squares regularized optimization problem, + +$$ +\operatorname {p r o x} _ {\lambda \phi} (\theta) = \arg \min _ {\theta^ {\prime}} \lambda \phi \left(\theta^ {\prime}\right) + \frac {1}{2} \left\| \theta^ {\prime} - \theta \right\| ^ {2}, \tag {6} +$$ + +where $\lambda > 0$ controls the regularization strength. If $\phi$ is a convex and lower semi-continuous mapping, the minimizer of the r.h.s. is always unique and $\mathrm{prox}_{\lambda \phi}$ is a proper function (and plays an crucial role in many convex optimization methods). ProxQuant uses a non-convex mappings for $\phi$ , which is far more uncommon for proximal steps than the convex case (see e.g. [41] for another example). In order to train DNNs with binary weights, $\phi$ is chosen as W-shaped function, + +$$ +\phi (\theta) = \sum_ {j = 1} ^ {d} \min \left\{\left| \theta_ {j} - 1 \right|, \left| \theta_ {j} + 1 \right| \right\}. \tag {7} +$$ + +$\phi$ has $2^{d}$ isolated global minima and is therefore not convex. Note that $\mathrm{prox}_{\lambda \phi}(\theta)$ is uniquely defined as long as all elements in $\theta$ are non-zero. The network weights are updated according to + +$$ +\theta^ {(t + 1)} \leftarrow \operatorname {p r o x} _ {\lambda^ {(t)} \phi} \left(\theta^ {(t)} - \eta \ell^ {\prime} \left(\theta^ {(t)}\right)\right), \tag {8} +$$ + +and the regularization weight $\lambda^{(t)}$ is increased via an annealing schedule, which makes ProxQuant an instance of homotopy methods: strictly quantized weights are only obtained for a sufficiently large value of $\lambda^{(t)}$ . + +# 4. Adaptive Straight-Through Estimator + +In this section, we propose a new approach to tackle the optimization problem given in (1). Reformulating and relaxing an underlying bilevel minimization problem was initially inspired by contrastive Hebbian learning for DNNs [38,45,49] and is at the core of the proposed method. + +# 4.1. Bilevel Optimization Formulation + +We start by rewriting the original problem (1) as the following bilevel minimization program, + +$$ +\min _ {\theta} \ell \left(w ^ {*}\right) \quad \text {s . t .} w ^ {*} = \arg \min _ {w} \mathcal {E} (w; \theta) \tag {9} +$$ + +where $\mathcal{E}(w;\theta)$ can be any function that favors $w^{*}$ to be binary. Two classical choices for $\mathcal{E}$ are given by + +$$ +\mathcal {E} _ {\tanh } (w; \theta) = - \frac {1}{\tau} \sum_ {j} H \left(\frac {1}{2} (1 - w _ {j})\right) - w ^ {\top} \theta \tag {10} +$$ + +$$ +\mathcal {E} _ {\text {h a r d - t a n h}} (w; \theta) = \frac {1}{2 \tau} \| w \| ^ {2} - w ^ {\top} \theta + \iota_ {[ - 1, 1 ] ^ {d}} (w), \tag {11} +$$ + +where $H$ is the Shannon entropy of a Bernoulli random variable, $H(u) = -u\log u - (1 - u)\log (1 - u)$ . The minimizer $w^{*}$ for given $\theta$ is the tanh mapping in the case of $\mathcal{E}_{\mathrm{tanh}}$ , $w_{j}^{*} = \tanh (\theta_{j} / \tau)$ , and the second option yields the hard-tanh mapping, $w_{j}^{*} = \Pi_{[-1,1]}(\theta_{j} / \tau)$ . $\tau > 0$ is a parameter steering how well these mappings approximate the sign function $\vec{\mathrm{sgn}} (\theta)$ . + +In order to apply a gradient-based learning method we require that $\mathcal{E}$ is differentiable w.r.t. $\theta$ for all $w$ . In the above examples we have $\frac{\partial}{\partial\theta}\mathcal{E}(w;\theta) = -w$ . It will be sufficient for our purposes to assume that $\mathcal{E}$ is of the form + +$$ +\mathcal {E} (w; \theta) = - w ^ {\top} \theta + \mathcal {G} (w) \tag {12} +$$ + +for a coercive function $\mathcal{G}$ bounded from below. That is, $w$ and $\theta$ only interact via their (separable) inner product. Further, it is sufficient to assume that $\mathcal{G}$ is fully separable, $\mathcal{G}(w) = \sum_{j} G(w_{j})$ , since each latent weight $\theta_{j}$ can be mapped to its binarized surrogate $w_{j}$ independently (an underlying assumption in the majority of works but explicitly deviated from in [17]). Thus, the general form for $\mathcal{E}$ assumed in the following is given by + +$$ +\mathcal {E} (w; \theta) = \sum_ {j} \left(G \left(w _ {j}\right) - w _ {j} \theta_ {j}\right). \tag {13} +$$ + +Therefore in this setting the solution $w^{*} = (w_{1}^{*},\dots ,w_{d}^{*})^{\top}$ is given element-wise, + +$$ +w _ {j} ^ {*} = \arg \min _ {w _ {j}} G (w _ {j}) - w _ {j} \theta_ {j}. \tag {14} +$$ + +# 4.2. Relaxing by Optimal Value Reformulation + +The optimal value reformulation (e.g. [31, 48]), which is a commonly used reformulation approach in bilevel optimization, allows us to rewrite the bilevel problem (9) as follows, + +$$ +\min _ {\theta , w} \ell (w) \quad \text {s . t .} \mathcal {E} (w; \theta) \leq \min _ {w ^ {\prime}} \mathcal {E} \left(w ^ {\prime}; \theta\right). \tag {15} +$$ + +Observe that the $w^{*}$ in the outer objective of (9) was replaced by a new unknown $w$ , while the difficult equality constraint in (9) has been replaced by a somewhat easier inequality constraint. Due to the separable nature of $\mathcal{E}$ in (13), it is advantageous to introduce an inequality constraint for each element $w_{j}$ . Thus, we obtain + +$$ +\min _ {\theta , w} \ell (w) \quad \text {s . t .} E \left(w _ {j}; \theta_ {j}\right) \leq \min _ {w _ {j} ^ {\prime}} E \left(w _ {j} ^ {\prime}; \theta_ {j}\right), \tag {16} +$$ + +where $E$ (independent of $j$ ) is given as + +$$ +E \left(w _ {j}; \theta_ {j}\right) := G \left(w _ {j}\right) - w _ {j} \theta_ {j}. \tag {17} +$$ + +This first step enables us to straightforwardly relax (16) by fixing positive Lagrange multipliers for the inequality constraints: + +$$ +\min _ {\theta , w} \ell (w) + \sum_ {j} \frac {1}{\beta_ {j}} \left(E \left(w _ {j}; \theta_ {j}\right) - \min _ {w _ {j} ^ {\prime}} E \left(w _ {j} ^ {\prime}; \theta_ {j}\right)\right). \tag {18} +$$ + +We parametrize the non-negative multipliers via $\beta_j^{-1}$ for $\beta_j > 0$ , which will be convenient in the following. Since we are interested in gradient-based methods, we replace the typically highly non-convex "loss" $\ell$ (which subsumes the target loss and the mapping induced by the network) by its linearization at $w^*$ , $\ell(w^*) + (w - w^*)^\top \ell'(w^*)$ . Recall that $w^* = \arg \min_w \mathcal{E}(w; \theta)$ is the effective weight used in the DNN and is ideally close to $\vec{\mathrm{sgn}}(\theta)$ . Overall, we arrive at the following relaxed objective to train a network with binary weights: + +$$ +\begin{array}{l} \mathcal {L} (\theta) = \ell (w ^ {*}) - \left(w ^ {*}\right) ^ {\top} \ell^ {\prime} (w ^ {*}) \\ + \sum_ {j} \min _ {w _ {j}} \left\{w _ {j} \ell_ {j} ^ {\prime} \left(w ^ {*}\right) + \frac {1}{\beta_ {j}} E \left(w _ {j}; \theta_ {j}\right) \right\} \\ - \sum_ {j} \min _ {w _ {j}} \left\{\frac {1}{\beta_ {j}} E \left(w _ {j}; \theta_ {j}\right) \right\}, \tag {19} \\ \end{array} +$$ + +Using a linearized target loss above will be connected to a perturbed chain rule in Section 4.3. The inner minimization problems have the solutions + +$$ +w _ {j} ^ {*} = \arg \min _ {w _ {j}} E (w _ {j}; \theta_ {j}) \quad \text {a n d} +$$ + +$$ +\hat {w} _ {j} := \arg \min _ {w _ {j}} \beta_ {j} \ell_ {j} ^ {\prime} \left(w ^ {*}\right) w _ {j} + E \left(w _ {j}; \theta_ {j}\right). \tag {20} +$$ + +$\hat{w} = (\hat{w}_1, \dots, \hat{w}_d)^\top$ is based on a perturbed objective that incorporates the local (first-order) behavior of the outer loss $\ell$ . Both $w^*$ and $\hat{w}$ implicitly depend on the current value of $\theta$ , and $\hat{w}$ depends on a chosen "step size" vector $\vec{\beta} := (\beta_j)_{j=1}^d$ with each $\beta_j > 0$ . If $\mathcal{E}(\cdot; \theta)$ is continuous at $w = w^*$ , then $\lim_{\beta_j \to 0^+} \hat{w}_j = w_j^*$ . Further, if $\mathcal{E}$ is of the form given in (12), then $\hat{w}$ is as easy to compute as $w^*$ (proof in the supplementary material): + +Proposition 1. Let $\mathcal{E}(w;\theta) = G(w) - w^{\top}\theta$ and $w^{*} = \arg \min_{w}\mathcal{E}(w;\theta)$ be explicitly given as $w^{*} = \vec{s} (\theta)$ . Then + +$$ +\hat {w} = \vec {s} \left(\theta - \vec {\beta} \odot \ell^ {\prime} \left(w ^ {*}\right)\right). \tag {21} +$$ + +All of the interesting choices $\mathcal{E}$ lead to efficient forward mappings $s$ (like the choices $\mathcal{E}_{\mathrm{tanh}}$ and $\mathcal{E}_{\mathrm{hard - tanh}}$ given earlier that resulted in tanh and hard tanh functions). + +# 4.3. Updating the latent weights $\theta$ + +For a fixed choice of $\vec{\beta} = (\beta_{1},\dots ,\beta_{d})^{\top}$ with $\beta_{j} > 0$ the relaxed objective $\mathcal{L}(\theta)$ in (19) is a nested minimization instance with a "min-min-max" structure. In some cases it is possible to obtain a pure "min-min-min" instance via + +duality [49], but in practice this is not necessary. Let $\theta^{(t)}$ be the current solution at iteration $t$ , then our employed local model to determine the new iterate $\theta^{(t + 1)}$ is given by + +$$ +\begin{array}{l} Q (\theta ; \theta^ {(t)}) = \sum_ {j} \frac {1}{\beta_ {j}} \left(E \left(\hat {w} _ {j}; \theta_ {j}\right) - E \left(w _ {j} ^ {*}; \theta_ {j}\right)\right) \\ + \frac {1}{2 \eta} \| \theta - \theta^ {(t)} \| ^ {2}, \tag {22} \\ \end{array} +$$ + +where $w^{*} = \vec{s} (\theta^{(t)})$ and $\hat{w} = \vec{s} (\theta^{(t)} - \vec{\beta}\odot \ell^{\prime}(w^{*}))$ are the effective weights and its perturbed instance, respectively, evaluated at $\theta^{(t)}$ . The last term in $Q$ regularizes deviations from $\theta^{(t)}$ , and $\eta$ plays the role of the learning rate. Minimizing $Q(\theta ;\theta^{(t)})$ w.r.t. $\theta$ yields a gradient descent-like update, + +$$ +\theta^ {(t + 1)} = \arg \min _ {\theta} Q (\theta ; \theta^ {(t)}) = \theta^ {(t)} - \eta (w ^ {*} - \hat {w}) \otimes \vec {\beta} \tag {23} +$$ + +for the assumed form of $\mathcal{E}$ in (12). Each element of $(w^{*} - \hat{w})\oslash \vec{\beta}$ , i.e. $(w_{j}^{*} - \hat{w}_{j}) / \beta_{j}$ , corresponds to a finite difference approximation (using backward differences) of + +$$ +\left. - \frac {d}{d \beta_ {j}} s \left(\theta_ {j} ^ {(t)} - \beta_ {j} \ell_ {j} ^ {\prime} \left(w ^ {*}\right)\right) \right| _ {\beta_ {j} = 0 ^ {+}} \tag {24} +$$ + +with spacing parameter $h_j = \beta_j \ell_j'(w^*)$ . If $s$ is at least one-sided differentiable, then it can be shown that these finite differences converge to a derivative given by the chain rule when $\beta_j \to 0^+$ [48], + +$$ +\begin{array}{l} \left. \frac {1}{\beta_ {j}} \left(w _ {j} ^ {*} - \hat {w} _ {j}\right) ^ {\beta_ {j} \rightarrow 0 ^ {+}} - \frac {d}{d \beta} s \left(\theta_ {j} ^ {(t)} - \beta_ {j} \ell_ {j} ^ {\prime} \left(w ^ {*}\right)\right)\right| _ {\beta_ {j} = 0 ^ {+}} \\ = \ell_ {j} ^ {\prime} \left(s \left(\theta_ {j} ^ {(t)}\right)\right) s ^ {\prime} \left(\theta_ {j} ^ {(t)}\right) = \frac {d}{d \theta_ {j}} \ell \left(s \left(\theta^ {(t)}\right)\right). \tag {25} \\ \end{array} +$$ + +For non-infintesimal $\beta_{j} > 0$ the finite difference slope $(w_{j}^{*} - \hat{w}_{j}) / \beta_{j}$ corresponds to a perturbed chain rule, + +$$ +\frac {1}{\beta_ {j}} \left(w _ {j} ^ {*} - \hat {w} _ {j}\right) = \ell_ {j} ^ {\prime} \left(w ^ {*}\right) s ^ {\prime} \left(\theta_ {j} ^ {(t)} - \gamma_ {j} \ell_ {j} ^ {\prime} \left(w ^ {*}\right)\right) \tag {26} +$$ + +(recall that $w^{*} = s(\theta^{(t)}))$ , where the inner derivative is evaluated at a perturbed argument $\theta^{(t)} - \vec{\gamma}\odot \ell^{\prime}(w^{*})$ for a $\vec{\gamma}\in [0,\vec{\beta} ]$ . This is a consequence of the mean value theorem. Moreover, if each $\beta_{j}$ is a critical point of the mapping + +$$ +\beta \mapsto \frac {1}{\beta} \left(w _ {j} ^ {*} - \hat {w} _ {j}\right) = \frac {1}{\beta} \left(w _ {j} ^ {*} - s \left(\theta_ {j} ^ {(t)} - \beta \ell_ {j} ^ {\prime} \left(w ^ {*}\right)\right)\right), \tag {27} +$$ + +then by using the quotient rule it is easy to see that $\vec{\gamma} = \vec{\beta}$ and therefore + +$$ +\frac {1}{\beta_ {j}} \left(w _ {j} ^ {*} - \hat {w} _ {j}\right) = \ell_ {j} ^ {\prime} \left(w ^ {*}\right) s ^ {\prime} \left(\theta_ {j} ^ {(t)} - \beta_ {j} \ell_ {j} ^ {\prime} \left(w ^ {*}\right)\right). \tag {28} +$$ + +Additionally, the relation in (26) can be interpreted as a particular instance of mirror descent (recall Sec. 3.2) as shown in the supplementary material. Overall, the above means that we can relatively freely select where $s'$ is actually evaluated. Since $s$ is naturally a "squashing" function mapping + +$\mathbb{R}$ to the bounded interval $[-1, 1]$ , gradient-based training using $s'$ usually suffers from the vanishing gradient problem. Using the relaxed reformulation for bilevel programs allows us to select $\beta_{j}$ to obtain a desired descent direction as it will be described in Section 4.5. + +The resulting gradient-based training method is summarized in Alg. 1. The algorithm is stated as full batch method, but the extension to stochastic variants working with minibatches drawn from $p_{\mathrm{data}}$ is straightforward. In the following section we discuss our choice of $\mathcal{E}$ and how to select suitable spacing parameters $\vec{\beta}^{(t)} > 0$ in each iteration. Since $\vec{\beta}^{(t)}$ is chosen adaptively based on the values of $\theta^{(t)}$ and $\ell'(w^*)$ and used to perturb the chain rule, we call the resulting algorithm the adaptive straight-through estimator (AdaSTE) training method. In the supplementary material we highlight its relations with ProxQuant and mirror descent training (and also discuss convergence properties). + +# Algorithm 1 AdaSTE training method. + +1: Initialize $\theta^{(0)}$ , choose learning rates $\eta^{(t)}, t = 1, \ldots$ +2: for $t = 1, \ldots$ do +3: $w^{*}\gets \vec{s} (\theta^{(t)})$ +4: Run regular back-propagation to determine $\ell'(w^*)$ +5: Determine $\tilde{\beta}^{(t)}$ using (38) +6: $\hat{w} \gets \vec{s}\big(\theta^{(t)} - \vec{\beta}^{(t)} \odot \ell'(w^*)\big)$ +7: $\theta^{(t + 1)}\gets \theta^{(t)} - \eta^{(t)}(w^{*} - \hat{w})\oslash \vec{\beta}^{(t)}$ +8: end for + +# 4.4. Our choice for the inner objective $\mathcal{E}$ + +In this section we will specify our choice for $\mathcal{E}$ (and thus the mapping $\vec{s}:\theta \mapsto \arg \min_w\mathcal{E}(w;\theta)$ ). The straightforward options of $\mathcal{E}_{\mathrm{tanh}}$ and $\mathcal{E}_{\mathrm{hard - tanh}}$ (Section 4.1) suffer from the fact that the induced arg-min mappings coincide exactly with the sign function only when the hyper-parameter $\tau^{-1}\rightarrow \infty$ . We are interested in an inner objective $\mathcal{E}$ that yields perfect quantized mappings for finite-valued choices of hyper-parameters. Inspired by the double-well cost used in ProxQuant [6], we design $\mathcal{E}$ as follows, + +$$ +\mathcal {E} (w; \theta) = \frac {1 + \mu}{2} \| w \| ^ {2} - w ^ {\top} \theta - \mu (1 + \alpha) \| w \| _ {1} + \iota_ {[ - 1, 1 ] ^ {d}} (w), \tag {29} +$$ + +where $\mu > 0$ and $\alpha \in (0,1)$ are free parameters. Note that $\mathcal{E}$ is only piecewise convex in $w$ for fixed $\theta$ , but it is fully separable in $w_{j}$ with + +$$ +E \left(w _ {j}; \theta_ {j}\right) = \frac {1 + \mu}{2} w _ {j} ^ {2} - w _ {j} \theta_ {j} - \mu (1 + \alpha) \left| w _ {j} \right| + v _ {[ - 1, 1 ]} \left(w _ {j}\right). \tag {30} +$$ + +Via algebraic manipulations we find the following closed-form expression for $\hat{w}_j$ (where we abbreviate $\ell^\prime$ for $\ell^{\prime}(w^{*})$ ), + +![](images/0f2d6847701d569d6a81ef5af78d74b864742b81b024d8ba0a676f6f527fa74c.jpg) +Figure 2. The graph of the mapping $w^{*} = s(\theta)$ given in (31) for $\alpha = 1 / 100$ and three different values of $\mu$ . + +$$ +\begin{array}{l} \hat {w} _ {j} = \arg \min _ {w _ {j}} \beta_ {j} \ell_ {j} ^ {\prime} w _ {j} + E (w _ {j}; \theta_ {j}) \\ = \Pi_ {[ - 1, 1 ]} \left(\frac {\tilde {\theta} _ {j} + \mu (1 + \alpha) \operatorname {s g n} (\tilde {\theta} _ {j})}{1 + \mu}\right), \tag {31} \\ \end{array} +$$ + +with $\tilde{\theta}_j\coloneqq \theta_j - \beta_j\ell_j'$ . In other words, the forward mapping $\vec{s}:\theta \mapsto w^{*} = s(\theta)$ for our choice of $\mathcal{E}$ is given by + +$$ +\vec {s} (\theta) = \Pi_ {[ - 1, 1 ] ^ {d}} \left(\frac {\theta + \mu (1 + \alpha) \mathrm {s g n} (\theta)}{1 + \mu}\right). \tag {32} +$$ + +The piece-wise linear graph of this mapping is illustrated in Fig. 2 for $\alpha = 1 / 100$ and three different choices of $\mu$ . Let $\alpha \in (0,1)$ be given, then $\vec{s} (\theta)$ attains only values in $\{-1,1\}^d$ even for finite $\mu$ , since + +$$ +\begin{array}{l} \frac {\left| \theta_ {j} \right| + \mu (1 + \alpha)}{1 + \mu} \geq 1 \iff \left| \theta_ {j} \right| + \mu (1 + \alpha) \geq 1 + \mu \\ \Longleftrightarrow | \theta_ {j} | + \alpha \mu \geq 1, \tag {33} \\ \end{array} +$$ + +which implies that any $\theta_{j}$ is always mapped to $+1$ or $-1$ when $\mu \geq 1 / \alpha$ (and the exact values of $\mu$ and $\alpha$ do not matter in this case). Consequently we have both the option to train with strictly binary weights from the beginning, or to train via a homotopy method by adjusting $\alpha$ or $\mu$ . Both choices lead to competitive results with the homotopy-based method having a small advantage in some cases as demonstrated in Section 5. + +# 4.5. Adaptive choice for $\beta$ + +As indicated in Section 4.3, we can steer the modified chain rule by selecting $\beta_{j} > 0$ appropriately in order to determine a suitable descent direction. Note that each element $\theta_{j}$ in the vector of parameters $\theta$ has its own value for $\beta_{j}$ . Below we describe how $\beta_{j}$ is chosen when $\alpha$ and $\mu$ satisfy $\mu \alpha \geq 1$ . In this setting we always have $w_{j}^{*} = \mathrm{sgn}(\theta_{j}) \in \{-1,1\}$ and $\hat{w}_{j} = \vec{\mathrm{sgn}} (\theta_{j} - \beta_{j}\ell_{j}^{\prime}(w^{*})) \in \{-1,1\}$ (we ignore the theoretical possibility of $\theta_{j} = 0$ or $\theta_{j} - \beta_{j}\ell_{j}^{\prime}(w^{*}) = 0$ ). Our aim is to select $\beta_{j} > 0$ such that the slope induced by backward differences, $\frac{1}{\beta_j} (w_j^* -\hat{w}_j)$ , + +is as close to $\ell_j'(w^*)$ as possible. In the following we abbreviate $\ell'(w^*)$ to $\ell'$ . Since sgn is an increasing step-function with derivative being zero almost everywhere, its finite difference approximation + +$$ +\frac {1}{\beta_ {j}} \left(w _ {j} ^ {*} - \hat {w} _ {j}\right) = \frac {1}{\beta_ {j}} \left(\operatorname {s g n} \left(\theta_ {j}\right) - \operatorname {s g n} \left(\theta_ {j} - \beta_ {j} \ell_ {j} ^ {\prime}\right)\right) \tag {34} +$$ + +lies either in the interval $[0, s_{\max}]$ or in $[-s_{\max}, 0]$ for a suitable $s_{\max} \geq 0$ (which is dependent on $\theta_j$ and $\ell_j'$ ). In particular, if $\theta_j \ell_j' \leq 0$ , then $\operatorname{sgn}(\theta_j) = \operatorname{sgn}(\theta_j - \beta_j \ell_j')$ for all $\beta_j \geq 0$ and $s_{\max} = 0$ . On the other hand, if $\theta_j \ell_j' > 0$ , then $\operatorname{sgn}(\theta_j - \beta_j \ell_j') \neq \operatorname{sgn}(\theta_j)$ for $\beta_j > \theta_j / \ell_j'$ and therefore + +$$ +\sup _ {\beta_ {j} > \theta_ {j} / \ell_ {j} ^ {\prime}} \frac {1}{\beta_ {j}} \left| w _ {j} ^ {*} - \hat {w} _ {j} \right| = \frac {2 \ell_ {j} ^ {\prime}}{\theta_ {j}}. \tag {35} +$$ + +If $\theta_{j}$ is close to 0, then the r.h.s. may grow arbitrarily large (reflecting the non-existence of the derivative of sgn at 0). Assuming that $(w_{j}^{*} - \hat{w}_{j}) / \beta_{j}$ should maximally behave like a straight-through estimator (i.e. $|w_j^* -\hat{w}_j| / \beta_j\leq |\ell_j^{\prime}|$ , which also can be seen as a form of gradient clipping), we choose + +$$ +\beta_ {j} = \frac {1}{| \ell_ {j} ^ {\prime} |} \max \{2, | \theta_ {j} | \} \tag {36} +$$ + +in order to guarantee that + +$$ +\frac {1}{\beta_ {j}} \left| w _ {j} ^ {*} - \hat {w} _ {j} \right| \leq \frac {2}{\beta_ {j}} \leq \frac {2 \left| \ell_ {j} ^ {\prime} \right|}{2} = \left| \ell_ {j} ^ {\prime} \right|. \tag {37} +$$ + +Overall, we obtain the following simple rule to assign each $\beta_{j}$ for given $\theta$ and $\ell^{\prime}$ : + +$$ +\beta_ {j} \leftarrow \left\{ \begin{array}{l l} \frac {1}{| \ell_ {j} ^ {\prime} |} \max \{2, | \theta_ {j} | \} & \text {i f} \theta_ {j} \ell_ {j} ^ {\prime} > 0 \\ 1 & \text {o t h e r w i s e .} \end{array} \right. \tag {38} +$$ + +The choice of $\beta_{j} = 1$ in the alternative case is arbitrary, since $(w_{j}^{*} - \hat{w}_{j}) / \beta = 0$ for all values $\beta > 0$ . Observe that the assignment of $\beta_{j}$ in (38) selectively converts $(w_{j}^{*} - \hat{w}_{j}) / \beta_{j}$ into a scaled straight-through estimator whenever $\theta_{j}\ell_{j}^{\prime} > 0$ , otherwise the effective gradient used to update $\theta_{j}$ is zero (in agreement with the chain rule). + +In the supplementary material we discuss the setting $\mu \alpha < 1$ , which yields in certain cases different expressions for $\beta_{j}$ . Nevertheless, we use (38) in all our experiments. + +# 5. Experimental Results + +In this section, we show several experimental results to validate the performance of our proposed method and compare it against existing algorithms that achieve state-of-the-art performance for our particular problem settings. As mentioned above, we only consider the training of networks with fully binarized weights and real-valued activations. + +
ImplementationCIFAR-10CIFAR-100TinyImageNet
VGG-16ResNet-18VGG-16ResNet-18ResNet-18
Full-precision (†)93.3394.8471.5076.3158.35
BinaryConnect (*)89.75±0.2691.92±0.2354.61±2.3768.67±0.7-
BinaryConnect (†)89.0491.6459.1372.1449.65
ProxQuant(†)90.1192.3255.1068.3549.97
PMF(†)91.4093.2464.7171.5651.52
MD-softmax (†)90.4791.2856.2568.4946.52
MD-softmax-s (†)91.3093.2863.9772.1851.81
MD-softmax-s (*)91.39±0.3093.10±0.1764.42±0.3771.87±0.25-
MD-tanh (†)91.6492.2761.3172.1354.62
MD-tanh-s (†)91.5393.1861.6972.1852.32
MD-tanh-s (*)91.40±0.3093.23±0.1562.93±0.6071.96±0.18-
BayesBiNN (*)90.68±0.0792.28±0.0965.92±0.1870.33±0.2554.22
AdaSTE (w/o annealing) (*)92.16±0.1693.96±0.1468.46±0.1873.90±0.2053.49
AdaSTE (with annealing) (*)92.37±0.0994.11±0.0869.28±0.1775.03±0.3554.92
+ +Table 1. Classification (test) accuracy for different methods. (*) indicates that experiments have been run 5 times using different random seeds (except for TinyImageNet). $(\dagger)$ indicates that results are obtained from the numbers reported by [3]. + +Following previous works [3,6,29], we use classification as the main task throughout our experiments. In particular, we evaluate the performance of the algorithms on the two network architectures: ResNet-18 and VGG16. The networks are trained and evaluated on the CIFAR10, CIFAR100 and TinyImageNet200 [25] datasets. We compare our algorithm against state-of-the-art approaches, including BinaryConnect (BC) [10], ProxQuant (PQ) [6], Proximal Mean-Field (PMF) [2], BayesBiNN [29], and several variants of Mirror Descent (MD) [3]. We employ the same standard data augmentations and normalization as employed by the methods we compare against (please refer to our supplemental material for more details about the experimental setup). Our method $^2$ is implemented in Pytorch and is developed based on the software framework released by BayesBiNN's authors $^3$ (more details regarding our implementation and additional Imagenette [20] results can be found in the supplemental material). + +# 5.1. Classification Accuracy + +In Table 1, we report the testing accuracy obtained by the considered methods. For PQ, PMF, the unstable versions of MD as well as for full-precision reference networks, we use the test accuracy reported in [3]. For BC, the stable variants of MD (i.e. MD-softmax-s and MD-tanh-s), we reproduce the results by running the source code released by the authors $^4$ (using the default recommended hyper-parameters) for 5 different random initializations, and reporting the mean and standard deviation ob + +tained from these runs. The same strategy is also applied to BayesBiNN (hyper-parameters for BayesBiNN can be found in the supplemental material), except for the TinyImageNet dataset where we only report results for a single run (due to longer training time). We report the results for our method using two settings: + +- Without annealing: we fix $\alpha = 0.01$ and $\mu = \frac{1}{\alpha}$ . +- With annealing: we also use $\alpha = 0.01$ and set the initial value $\mu$ to $\mu^{(0)} = 1.0$ , then increase $\mu$ after each epoch by a factor of $\gamma$ , i.e. $\mu^{(t)} \gets \gamma \mu^{(t - 1)}$ . $\gamma$ is chosen such that $\mu$ reaches $1 / \alpha$ after $\approx 200$ epochs. + +The impact of the choice of $\mu$ on the shape of $\vec{s}(\theta)$ is illustrated in Fig. 2. Table 1 demonstrates that our proposed algorithm achieves state-of-the-art results. Note that we achieve highly competitive results even without annealing $\mu$ (although annealing improves the test accuracy slightly but consistently). Hence, we conclude that AdaSTE without annealing (and therefore no additional hyper-parameters) can be used as a direct replacement for BinaryConnect. Note that we report all results after training for 500 epochs. In the supplementary material, we will show that both Bayes-BiNN and AdaSTE yield even higher accuracy if the models are trained for higher number of epochs. + +# 5.2. Evolution of Loss and Accuracy + +We further investigate the behavior of the algorithms during training. In particular, the evolution of training losses and testing accuracies are of interest, since these quantities are of practical interest. + +In Fig. 3, we plot the testing accuracy obtained by our method in comparison with BC, MD (using the tanh map + +![](images/b0e8ad5f6c091cda4c42b204b5f10d4fec02f0b1a68e0853ba21aa2cad3bc9e9.jpg) +Figure 3. Testing accuracy achieved by the methods for the first 200 epochs with ResNet-18 (left) VGG16 (right) for CIFAR10 dataset (plots for CIFAR100 can be found in the supplemental material). + +![](images/e5b8dc59c73b50757fa4728c2b3505bdf0c84d2f4acec6d81a074b6ca72c3c1f.jpg) + +![](images/62436df0fddb3994798f7a8e58bf5ba6b575fbb45d3a9926d861c94032e779ce.jpg) +Figure 4. Training loss of the methods for the first 200 epochs with ResNet-18 (left) and VGG16 (right) on the CIFAR10 dataset (see supplementary material for plots of the CIFAR100 dataset). + +![](images/b4abbd56816080b5795282772bc3dea0bb326ccdd2aaa38422716d4b91ad0251.jpg) + +ping), and BayesBiNN for the first 200 epochs. For our method, we show the performance for both settings with and without annealing (as described earlier). To obtain the plots for MD and BayesBiNN, we use the code provided by the authors with the default recommended hyper parameters. For BC, we use the implementation provided by the MD authors. As can be observed, AdaSTE quickly reaches very high test accuracy compared to other approaches. The MD-tanh approach (using the recommended annealing schedule from the authors [3]) only reaches satisfactory accuracy after approximately 100 epochs. We also try starting MD-tanh with a larger annealing parameter (i.e. the $\beta$ hyper-parameter in [3]), but that yields very poor results (see supplemental material for more details). AdaSTE, on the other hand, is quite insensitive to the annealing details, and yields competitive results even without annealing. + +Fig. 4 depicts the training loss of our methods compared to BayesBiNN. We choose to compare AdaSTE against our main competitor, BayesBiNN, as we have full control of the source code to assure that both methods are initialized with the same starting points. As can be seen, our method quickly reduces the training loss, while BayesBiNN takes longer for the training loss to converge. Note that BayesBiNN leverages the reparametrization trick and relies therefore on weights sampled from respective distributions at training time. In that sense AdaSTE is a purely deterministic algorithm, and the only source of stochasticity is the sampled mini-batches. This might be a factor explaining + +AdaSTE's faster reduction of the training loss. + +# 6. Discussion and Conclusion + +In this work we propose AdaSTE, an easy-to-implement replacement for the straight-through gradient estimator, and we demonstrate its benefits for training DNNs with strictly binary weights. One clear limitation in this work is, that we focus on the binary weight but real-valued activations scenario, which is a highly useful setting, but still prevents low-level implementations using only xor and bit count operations. Extending AdaSTE to binary activations seems straightforward, but will be more difficult to justify theoretically, and we expect training to be more challenging in practice. One obvious further shortcoming is our restriction to purely binary quantization levels, in particular to the set $\{+1, -1\}$ . Generalizing the approach to arbitrary quantization levels can be done in several ways, e.g. by extending the W-shaped cost $E$ in (30) to more minima or by moving to higher dimensions (e.g. by modeling parameters in the probability simplex). + +Since weight quantization is one option to regulate the Lipschitz property of a DNNs' forward mapping (and also its expressive power), the impact of weight quantization [12, 39] (and more generally DNN model compression [15, 46]) on adversarial robustness has been recently explored. Hence, combining our adaptive straight-through gradient estimator with adversarial training is one direction of future work. + +# References + +[1] Jan Achterhold, Jan Mathias Koehler, Anke Schmeink, and Tim Genewein. Variational network quantization. In International Conference on Learning Representations, 2018. +[2] Thalaiyasingam Ajanthan, Puneet K. Dokania, Richard Hartley, and Philip H. S. Torr. Proximal mean-field for neural network quantization. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. +[3] Thalaiyasingam Ajanthan, Kartik Gupta, Philip Torr, Richard Hartley, and Puneet Dokania. Mirror descent view for neural network quantization. In Arindam Banerjee and Kenji Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 2809-2817. PMLR, 13-15 Apr 2021. +[4] Milad Alizadeh, Javier Fernández-Marqués, Nicholas D. Lane, and Yarin Gal. A systematic study of binary neural networks' optimisation. In International Conference on Learning Representations, 2019. +[5] Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 274-283. PMLR, 10-15 Jul 2018. +[6] Yu Bai, Yu-Xiang Wang, and Edo Liberty. Proxquant: Quantized neural networks via proximal operators. In International Conference on Learning Representations, 2019. +[7] Amir Beck and Marc Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters, 31(3):167-175, 2003. +[8] Yoshua Bengio, Nicholas Léonard, and Aaron C. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. CoRR, abs/1308.3432, 2013. +[9] Jiasi Chen and Xukan Ran. Deep learning with edge computing: A review. Proceedings of the IEEE, 107(8):1655-1674, 2019. +[10] Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. BinaryConnect: Training Deep Neural Networks with binary weights during propagations. In C Cortes, N Lawrence, D Lee, M Sugiyama, and R Garnett, editors, Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015. +[11] Lei Deng, Guoqi Li, Song Han, Luping Shi, and Yuan Xie. Model compression and hardware acceleration for neural networks: A comprehensive survey. Proceedings of the IEEE, 108(4):485-532, 2020. +[12] Kirsty Duncan, Ekaterina Komendantskaya, Robert Stewart, and Michael Lones. Relative robustness of quantized neural networks against adversarial attacks. In 2020 International Joint Conference on Neural Networks (IJCNN), pages 1-8. IEEE, 2020. +[13] Steven K. Esser, Jeffrey L. McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S. Modha. + +Learned step size quantization. In International Conference on Learning Representations, 2020. +[14] Tal Grossman. The CHIR Algorithm for Feed Forward Networks with Binary Weights. In D Touretzky, editor, Advances in Neural Information Processing Systems, volume 2. Morgan-Kaufmann, 1990. +[15] Shupeng Gui, Haotao N Wang, Haichuan Yang, Chen Yu, Zhangyang Wang, and Ji Liu. Model compression with adversarial robustness: A unified optimization framework. Advances in Neural Information Processing Systems, 32:1285-1296, 2019. +[16] Yunhui Guo. A survey on methods and theories of quantized neural networks. CoRR, abs/1808.04752, 2018. +[17] Kai Han, Yunhe Wang, Yixing Xu, Chunjing Xu, Enhua Wu, and Chang Xu. Training binary neural networks through learning with noisy supervision. In International Conference on Machine Learning, pages 4017-4026. PMLR, 2020. +[18] Koen Helwegen, James Widdicombe, Lukas Geiger, Zechun Liu, Kwang-Ting Cheng, and Roeland Nusselder. Latent Weights Do Not Exist: Rethinking Binarized Neural Network Optimization. In H Wallach, H Larochelle, A Beygelzimer, F d' Alché-Buc, E Fox, and R Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. +[19] G Hinton. Neural networks for machine learning, cousera video lectures, 2012. +[20] Jeremy Howard and Sylvain Gugger. Fastai: a layered api for deep learning. Information, 11(2):108, 2020. +[21] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran ElYaniv, and Yoshua Bengio. Binarized Neural Networks. In D Lee, M Sugiyama, U Luxburg, I Guyon, and R Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. +[22] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 448-456, Lille, France, 07-09 Jul 2015. PMLR. +[23] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016. +[24] Mohammad Emtiyaz Khan and Håvard Rue. The bayesian learning rule, 2021. +[25] Ya Le and Xuan Yang. Tiny imagenet visual recognition challenge. CS 231N, 7(7):3, 2015. +[26] Mingbao Lin, Rongrong Ji, Zihan Xu, Baochang Zhang, Yan Wang, Yongjian Wu, Feiyue Huang, and Chia-Wen Lin. Rotated Binary Neural Network. In H Larochelle, M Ranzato, R Hadsell, M F Balcan, and H Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 7474-7485. Curran Associates, Inc., 2020. +[27] Christos Louizos, Matthias Reisser, Tijmen Blankevoort, Efstratos Gavves, and Max Welling. Relaxed quantization for discretized neural networks. In International Conference on Learning Representations, 2019. + +[28] C Maddison, A Mnih, and Y Teh. The concrete distribution: A continuous relaxation of discrete random variables. In Proceedings of the international conference on learning Representations. International Conference on Learning Representations, 2017. +[29] Xiangming Meng, Roman Bachmann, and Mohammad Emtiyaz Khan. Training binary neural networks using the Bayesian learning rule. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 6852-6861. PMLR, 13-18 Jul 2020. +[30] Arkadj Semenovic Nemirovskij and David Borisovich Yudin. Problem complexity and method efficiency in optimization. Wiley-Interscience, 1983. +[31] Jiri V Outrata. A note on the usage of nondifferentiable exact penalties in some special optimization problems. Kybernetika, 24(4):251-258, 1988. +[32] Haotong Qin, Ruihao Gong, Xianglong Liu, Xiao Bai, Jingkuan Song, and Nicu Sebe. Binary neural networks: A survey. Pattern Recognition, 105:107281, Sep 2020. +[33] Haotong Qin, Ruihao Gong, Xianglong Liu, Mingzhu Shen, Ziran Wei, Fengwei Yu, and Jingkuan Song. Forward and backward information retention for accurate binary neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +[34] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: ImageNet Classification Using Binary Convolutional Neural Networks. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, Computer Vision – ECCV 2016, pages 525–542, Cham, 2016. Springer International Publishing. +[35] F. Rosenblatt. The Perceptron, a Perceiving and Recognizing Automaton Project Para. Report: Cornell Aeronautical Laboratory. Cornell Aeronautical Laboratory, 1957. +[36] F. Rosenblatt. Principles of Neurodynamics: Perceptrons and the Theory of Brain Mechanisms. Cornell Aeronautical Laboratory. Report no. VG-1196-G-8. Spartan Books, 1962. +[37] D Saad and E Marom. Training Feed Forward Nets with Binary Weights Via a Modified CHIR Algorithm. Complex Systems, 4:573-586, 1990. +[38] Benjamin Scellier and Yoshua Bengio. Equilibrium Propagation: Bridging the Gap between Energy-Based Models and Backpropagation. Frontiers in Computational Neuroscience, 11, 2017. +[39] Chang Song, Elias Fallon, and Hai Li. Improving adversarial robustness in weight-quantized neural networks. arXiv preprint arXiv:2012.14965, 2020. +[40] Daniel Soudry, Itay Hubara, and Ron Meir. Expectation backpropagation: Parameter-free training of multilayer neural networks with continuous or discrete weights. Advances in Neural Information Processing Systems, 2(January):963-971, 2014. +[41] Evgeny Strekalovskiy and Daniel Cremers. Real-time minimization of the piecewise smooth mumford-shah functional. In European conference on computer vision, pages 127-141. Springer, 2014. + +[42] Stefan Uhlich, Lukas Mauch, Fabien Cardinaux, Kazuki Yoshiyama, Javier Alonso Garcia, Stephen Tiedemann, Thomas Kemp, and Akira Nakamura. Mixed precision dnns: All you need is a good parametrization. In International Conference on Learning Representations, 2020. +[43] Santosh S. Venkatesh. Directed drift: A new linear threshold algorithm for learning binary weights on-line. Journal of Computer and System Sciences, 46(2):198-217, 1993. +[44] Lin Xiao. Dual averaging methods for regularized stochastic learning and online optimization. Journal of Machine Learning Research, 11(88):2543-2596, 2010. +[45] Xiaohui Xie and H. Sebastian Seung. Equivalence of backpropagation and contrastive Hebbian learning in a layered network. Neural Computation, 15(2):441-454, 2003. +[46] Shaokai Ye, Kaidi Xu, Sijia Liu, Hao Cheng, Jan-Henrik Lambrechts, Huan Zhang, Aojun Zhou, Kaisheng Ma, Yanzhi Wang, and Xue Lin. Adversarial robustness vs. model compression, or both? In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 111-120, 2019. +[47] Penghang Yin, Jiancheng Lyu, Shuai Zhang, Stanley J. Osher, Yingyong Qi, and Jack Xin. Understanding straight-through estimator in training activation quantized neural nets. In International Conference on Learning Representations, 2019. +[48] Christopher Zach. Bilevel programming and deep learning: A unifying view on inference learning methods. CoRR, abs/2105.07231, 2021. +[49] Christopher Zach and Virginia Estellers. Contrastive learning for lifted networks. In British Machine Vision Conference, 2019. \ No newline at end of file diff --git a/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/images.zip b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4794da15a45008a6a193fb6ea80f82e613fc4313 --- /dev/null +++ b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4188186e8be52feba9f23040349a7e0471d2ce164a4c985c02dec00273596af0 +size 472938 diff --git a/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/layout.json b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..79fbfed171c065feede8e53e9e973a3a840cf50c --- /dev/null +++ b/adasteanadaptivestraightthroughestimatortotrainbinaryneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29533a8778ad6bf8429f37137e2d42359e473794e667aa1be422266b6d710077 +size 582552 diff --git a/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_content_list.json b/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6f85d129a06d33ec656ecc688a5e329d37b60143 --- /dev/null +++ b/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07ded303fd74bf1d57f2d18a8afced249749241a09509ff58ffd2982dde8efbe +size 80093 diff --git a/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_model.json b/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d233691a0e7b88ee661aa49bfd3172c210d83921 --- /dev/null +++ b/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aff786fccd1dab27a60a32f45a1c1a7784a08d5e063c337a24bcba222a48d15c +size 101152 diff --git a/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_origin.pdf b/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..83f7d9ea86afadfb6a924355765027e3282e74cd --- /dev/null +++ b/adavitadaptivevisiontransformersforefficientimagerecognition/12e5ce97-6b51-451e-99b8-fe099b90f82d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:132a88443c93e1871cbd15270474b95c48f583696334a24156df2673e2e94736 +size 4163977 diff --git a/adavitadaptivevisiontransformersforefficientimagerecognition/full.md b/adavitadaptivevisiontransformersforefficientimagerecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2d63d623c8fe83c3e4ccffda886bd60dd7917d55 --- /dev/null +++ b/adavitadaptivevisiontransformersforefficientimagerecognition/full.md @@ -0,0 +1,363 @@ +# AdaViT: Adaptive Vision Transformers for Efficient Image Recognition + +Lingchen Meng $^{1,2,3*}$ Hengduo Li $^{4*}$ Bor-Chun Chen $^{5}$ Shiyi Lan $^{4}$ + +Zuxuan $\mathbf{W}\mathbf{u}^{1,2\dagger}$ Yu-Gang Jiang $^{1,2}$ Ser-Nam Lim + +1Shanghai Key Lab of Intelligent Info. Processing, School of Computer Science, Fudan University + +$^{2}$ Shanghai Collaborative Innovation Center on Intelligent Visual Computing + +$^{3}$ Biren Technology $^{4}$ University of Maryland $^{5}$ Meta AI + +# Abstract + +Built on top of self-attention mechanisms, vision transformers have demonstrated remarkable performance on a variety of tasks recently. While achieving excellent performance, they still require relatively intensive computational cost that scales up drastically as the numbers of patches, self-attention heads and transformer blocks increase. In this paper, we argue that due to the large variations among images, their need for modeling long-range dependencies between patches differ. To this end, we introduce AdaViT, an adaptive computation framework that learns to derive usage policies on which patches, self-attention heads and transformer blocks to use throughout the backbone on a per-input basis, aiming to improve inference efficiency of vision transformers with a minimal drop of accuracy for image recognition. Optimized jointly with a transformer backbone in an end-to-end manner, a light-weight decision network is attached to the backbone to produce decisions on-the-fly. Extensive experiments on ImageNet demonstrate that our method obtains more than $2 \times$ improvement on efficiency compared to state-of-the-art vision transformers with only $0.8\%$ drop of accuracy, achieving good efficiency/accuracy trade-offs conditioned on different computational budgets. We further conduct quantitative and qualitative analysis on learned usage polices and provide more insights on the redundancy in vision transformers. Code is available at https://github.com/MengLcool/AdaViT. + +# 1. Introduction + +Transformers [40], the dominant architectures for a variety of natural language processing tasks, have been attracting an ever-increasing research interest in the computer vision community since the success of the Vision Transformer (ViT) [7]. Built on top of self-attention mechanisms, + +![](images/2b9dd14e63168f50555757bd5d810ae17e08e2b3b6a81e2dd090235f45d0c710.jpg) +"White Stork" + +![](images/66761094edfe096b8a63402aec5ae93c22bbc13cb68b50bac331f9fc5c75d868.jpg) + +![](images/8b8b79bdf64a2d0de7dd6511f406b044b8dd81a0ebb18323266af5712a07ac8b.jpg) +MSAFFN + +![](images/962a6fadf9352a07538933a7f73d5a5327731d1ee81c6128229a85060da38933.jpg) + +![](images/1ac443498809d627f9cab3438b3de76d48d01b9eaa0062d9a1fb48639c334fc0.jpg) +"Barbershop" + +![](images/ef04dd70f915ca60d6cf733ac6079e8249c32cba0408482fcd6d09ce9eed24ac.jpg) + +![](images/76e3cbc2a4c01151032c25773f4fb665a2d83868168bbb7302a0a6c765db98ad.jpg) +MSAFFN +Figure 1. A conceptual overview of our method. Exploiting the redundancy in vision transformers, AdaViT learns to produce instance-specific usage policies on which patches, self-attention heads and transformer blocks to keep/activate throughout the network for efficient image recognition. Fewer computational resources are allocated for easy samples (top) while more are used for hard samples (bottom), reducing the overall computational cost with a minimal drop of classification accuracy. Green patches are activated in both figures. + +![](images/dd4ed800c65834aac621f3cf3e9bfe6ef1aa384016f009b391e984c1ff7d6315.jpg) + +transformers are capable of capturing long-range dependencies among pixels/patches from input images effectively, which is arguably one of the main reasons that they outperform standard CNNs in vision tasks spanning from image classification [4, 12, 20, 22, 38, 49, 56] to object detection [3, 5, 43, 44], action recognition [9, 23, 58] and so forth. + +Recent studies on vision transformers [4,7,38,56] typically adopt the Transformer [40] architecture from NLP + +with minimal surgery. Taking a sequence of sliced image patches analogous to tokens/words as inputs, the transformer backbone consists of stacked building blocks with two sublayers, i.e. a self-attention layer and a feed-forward network. To ensure that the model can attend to information from different representation subspaces jointly, multi-head attention is used in each block instead of a single attention function [40]. While these self-attention-based vision transformers have outperformed CNNs on a multitude of benchmarks like ImageNet [6], the competitive performance does not come for free—the computational cost of the stacked attention blocks with multiple heads is large, which further grows quadratically with the number of patches. + +But are all patches needed to be attended to throughout the network for correctly classifying images? Do we need all the self-attention blocks with multiple heads to look for where to attend to and model the underlying dependencies for all different images? After all, large variations exist in images such as object shape, object size, occlusion and background complexity. Intuitively, more patches and self-attention blocks are required for complex images containing cluttered background or occluded objects, which require sufficient contextual information and understanding of the whole image so as to infer their ground-truth classes (e.g. the barber shop in Figure 1), while only a small number of informative patches and attention heads/blocks are enough to classify easy images correctly. + +With this in mind, we seek to develop an adaptive computation framework that learns which patches to use and which self-attention heads/blocks to activate on a per-input basis. By doing so, the computational cost of vision transformers can be saved through discarding redundant input patches and backbone network layers for easy samples, and only using full model with all patches for hard and complex samples. This is an orthogonal and complementary direction to recent approaches on efficient vision transformers that focus on designing static network architectures [4, 11, 22, 56]. + +To this end, we introduce Adaptive Vision Transformer (AdaViT), an end-to-end framework that adaptively determines the usage of patches, heads and layers of vision transformers conditioned on input images for efficient image classification. Our framework learns to derive instance-specific inference strategies on: 1) which patches to keep; 2) which self-attention heads to activate; and 3) which transformer blocks to skip for each image, to improve the inference efficiency with a minimal drop of classification accuracy. In particular, we insert a light-weight multi-head subnetwork (i.e. a decision network) to each transformer block of the backbone network, which learns to predict binary decisions on the usage of patch embeddings, self-attention heads and blocks throughout the network. Since binary decisions are non-differentiable, we resort to + +Gumbel-Softmax [26] during training to make the whole framework end-to-end trainable. The decision network is jointly optimized with the transformer backbone with a usage loss that measures the computational cost of the produced usage policies and a normal cross-entropy loss, which incentivizes the network to produce policies that reduce the computational cost while maintaining classification accuracy. The overall target computational cost can be controlled by hyperparameter $\gamma \in (0,1]$ corresponding to the percentage of computational cost of the full model with all patches as input during training, making the framework flexible to suit the need of different computational budgets. + +We conduct extensive experiments on ImageNet [6] to validate the effectiveness of AdaViT and show that our method is able to improve the inference efficiency of vision transformers by more than $2 \times$ with only $0.8\%$ drop of classification accuracy, achieving good trade-offs between efficiency and accuracy when compared with other standard vision transformers and CNNs. In addition, we conduct quantitative and qualitative analyses on the learned usage policies, providing more intuitions and insights on the redundancy in vision transformers. We further show visualizations and demonstrate that AdaViT learns to use more computation for relatively hard samples with complex scenes, and less for easy object-centric samples. + +# 2. Related Work + +Vision Transformers. Inspired by its great success in NLP tasks, many recent studies have explored adapting the Transformer [40] architecture to multiple computer vision tasks [7-9, 14, 22, 27, 31, 32, 42, 46, 48, 54, 59]. Following ViT [7], a variety of vision transformer variants have been proposed to improve the recognition performance as well as training and inference efficiency. DeiT [38] incorporates distillation strategies to improve training efficiency of vision transformers, outperforming standard CNNs without pretraining on large-scale dataset like JFT [35]. Other approaches like T2T-ViT [56], Swin Transformer [22], PVT [44] and CrossViT [4] seek to improve the network architecture of vision transformers. Efforts have also been made to introduce the advantages of 2D CNNs to transformers through using convolutional layers [20, 53], hierarchical network structures [22, 23, 44], multi-scale feature aggregation [4,9] and so on. While obtaining superior performance, the computational cost of vision transformers is still intensive and scales up quickly as the numbers of patches, self-attention heads and transformer blocks increase. + +Efficient Networks. Extensive studies have been conducted to improve the efficiency of CNNs for vision tasks through designing effective light-weight network architectures [15, 16, 25, 34, 37, 57]. To match the inference efficiency of standard CNNs, recent work has also explored + +developing efficient vision transformer architectures. T2T-ViT [56] proposes to use a deep-narrow structure and a token-to-token module, achieving better accuracy and less computational cost than ViT [7]. LeViT [11] and Swin Transformer [22] develop multi-stage network architectures with down-sampling and obtain better inference efficiency. These methods, however, use a fixed network architecture for all input samples regardless of the redundancy in patches and network architecture for easy samples. Our work is orthogonal to this direction and focuses on learning input-specific strategies that adaptively allocate computational resources for saved computation and a minimal drop in accuracy at the same time. + +Adaptive Computation. Adaptive computation methods exploit the large variations within network inputs as well as the redundancy in network architectures to improve efficiency with instance-specific inference strategies. In particular, existing methods for CNNs have explored altering input samples [28, 29, 39, 50, 51, 55], skipping network layers [10, 18, 41, 45, 52] and channels [1, 21], early exiting with a multi-classifier structure [2, 17, 19], to name a few. A few attempts have also been made recently to accelerate vision transformers with adaptive inference policies exploiting the redundancy in patches, i.e. producing policies on what patch size [47] and which patches [30, 33] to use conditioned on input image. In contrast, we exploit the redundancy in the attention mechanism of vision transformer and propose to improve efficiency by adaptively choosing which self-attention heads, transformer blocks and patch embeddings to keep/drop conditioned on the input samples. + +# 3. Approach + +We propose AdaViT, an end-to-end adaptive computation framework to reduce the computational cost of vision transformers. Given an input image, AdaViT learns to adaptively derive policies on which patches, self-attention heads and transformer blocks to use or activate in the transformer backbone conditioned on the input image, encouraging using less computation while maintaining the classification accuracy. An overview of our method is shown in Figure 2. + +# 3.1. Preliminaries + +Vision transformers [7, 38, 56] for image classification take a sequence of sliced patches from image as input, and model their long-range dependencies with stacked multihead self-attention layers and feed-forward networks*. Formally, for an input image $\mathcal{I}$ , it is first split into a sequence of fixed-size 2D patches $\mathbf{X} = [\mathbf{x}_1, \mathbf{x}_2, \dots, \mathbf{x}_N]$ where $N$ is the number of patches (e.g. $N = 14 \times 14$ ). These raw patches are then mapped into $D$ -dimensional patch embed + +dings $\mathbf{Z} = [\mathbf{z}_1, \mathbf{z}_2, \dots, \mathbf{z}_N]$ with a linear layer. A learnable embedding $\mathbf{z}_{cls}$ termed class token is appended to the sequence of patch embeddings, which serves as the representation of image. Positional embeddings $\mathbf{E}_{pos}$ are also optionally added to patch embeddings to augment them with positional information. To summarize, the input to the first transformer block is: + +$$ +\mathbf {Z} = \left[ \mathbf {z} _ {c l s}; \mathbf {z} _ {1}; \mathbf {z} _ {2}; \dots ; \mathbf {z} _ {N} \right] + \mathbf {E} _ {p o s} \tag {1} +$$ + +where $\mathbf{z} \in \mathbb{R}^D$ and $\mathbf{E}_{pos} \in \mathbb{R}^{(N + 1) \times D}$ respectively. + +Similar to Transformers [40] in NLP, the backbone network of vision transformers consists of $L$ blocks, each of which consists of a multi-head self-attention layer (MSA) and a feed-forward network (FFN). In particular, a single-head attention is computed as below: + +$$ +\operatorname {A t t n} (Q, K, V) = \operatorname {s o f t m a x} \left(\frac {Q K ^ {T}}{\sqrt {d _ {k}}}\right) V \tag {2} +$$ + +where $Q, K, V$ are—in a broad sense—query, key and value matrices respectively, and $d_k$ is a scaling factor. For vision transformers, $Q, K, V$ are projected from the same input, i.e. patch embeddings. For more effective attention on different representation subspaces, multi-head self-attention concatenates the output from several single-head attentions and projects it with another parameter matrix: + +$$ +\operatorname {h e a d} _ {i, l} = \operatorname {A t t n} \left(\mathbf {Z} _ {l} \mathbf {W} _ {i, l} ^ {Q}, \mathbf {Z} _ {l} \mathbf {W} _ {i, l} ^ {K}, \mathbf {Z} _ {l} \mathbf {W} _ {i, l} ^ {V}\right) \tag {3} +$$ + +$$ +\operatorname {M S A} \left(\mathbf {Z} _ {l}\right) = \operatorname {C o n c a t} \left(\text {h e a d} _ {1, l}, \dots , \text {h e a d} _ {H, l}\right) \mathbf {W} _ {l} ^ {O}, \tag {4} +$$ + +where $\mathbf{W}_{i,l}^{Q},\mathbf{W}_{i,l}^{K},\mathbf{W}_{i,l}^{V},\mathbf{W}_{l}^{O}$ are the parameter matrices in the $i$ -th attention head of the $l$ -th transformer block, and $\mathbf{Z}_l$ denotes the input at the $l$ -th block. The output from MSA is then fed into FFN, a two-layer MLP, and produce the output of the transformer block $\mathbf{Z}_{l + 1}$ . Residual connections are also applied on both MSA and FFN as follows: + +$$ +\mathbf {Z} _ {l} ^ {\prime} = \operatorname {M S A} \left(\mathbf {Z} _ {l}\right) + \mathbf {Z} _ {l}, \quad \mathbf {Z} _ {l + 1} = \operatorname {F F N} \left(\mathbf {Z} _ {l} ^ {\prime}\right) + \mathbf {Z} _ {l} ^ {\prime} \tag {5} +$$ + +The final prediction is produced by a linear layer taking the class token from last transformer block $(\mathbf{Z}_L^0)$ as inputs. + +# 3.2. Adaptive Vision Transformer + +While large vision transformer models have achieved superior image classification performance, the computational cost grows quickly as we increase the numbers of patches, attention heads and transformer blocks to obtain higher accuracies. In addition, a computationally expensive one-size-fit-all network is often an overkill for many easy samples. To remedy this, AdaViT learns to adaptively choose 1) which patch embeddings to use; 2) which self-attention heads in MSA to activate; and 3) which transformer block to skip—on a per-input basis—to improve the inference efficiency of vision transformers. We achieve this by inserting + +![](images/330d71b806c88bda344ca4fddd8489b8cac965714e6d1210565198158ca0ec85.jpg) +Figure 2. An overview of our approach. We insert a light-weight decision network before each block of the vision transformer backbone. Given an input image, the decision networks produce usage policies on which patches, self-attention heads and transformer blocks to keep/activate throughout the backbone. These instance-specific usage policies are incentivized to reduce the overall computational cost of vision transformers with minimal drop of accuracy. See texts for more details. + +a light-weight decision network before each of the transformer blocks, and it is trained to produce the three sets of usage policies for this block. + +Decision Network. The decision network at $l$ -th block consists of three linear layers with parameters $\mathbf{W}_l = \{\mathbf{W}_l^p, \mathbf{W}_l^h, \mathbf{W}_l^b\}$ to produce computation usage policies for patch selection, attention head selection and transformer block selection respectively. Formally, given the input to $l$ -th block $\mathbf{Z}_l$ , the usage policy matrices for this block is computed as follows: + +$$ +\begin{array}{l} \left(\mathbf {m} _ {l} ^ {p}, \mathbf {m} _ {l} ^ {h}, \mathbf {m} _ {l} ^ {b}\right) = \left(\mathbf {W} _ {l} ^ {p}, \mathbf {W} _ {l} ^ {h}, \mathbf {W} _ {l} ^ {b}\right) \mathbf {Z} _ {l} \\ s. t. \mathbf {m} _ {l} ^ {p} \in \mathbb {R} ^ {N}, \mathbf {m} _ {l} ^ {h} \in \mathbb {R} ^ {H}, \mathbf {m} _ {l} ^ {b} \in \mathbb {R} \tag {6} \\ \end{array} +$$ + +where $N$ and $H$ denote the numbers of patches and self-attention heads in a transformer block, and $l \in [1, L]$ . Each entry of $\mathbf{m}_l^p$ , $\mathbf{m}_l^h$ and $\mathbf{m}_l^b$ is further passed to a sigmoid function, indicating the probability of keeping the corresponding patch, attention head and transformer block respectively. The $l$ -th decision network shares the output from previous $l - 1$ transformer blocks, making the framework more efficient than using a standalone decision network. + +As the decisions are binary, the action of keeping/discarding can be selected by simply applying a threshold on the entries during inference. However, deriving the optimal thresholds for different samples is challenging. To this end, we define random variables $\mathbf{M}_l^p$ , $\mathbf{M}_l^h$ , $\mathbf{M}_l^b$ to make decisions by sampling from $\mathbf{m}_l^p$ , $\mathbf{m}_l^h$ and $\mathbf{m}_l^b$ . For example, the $j$ -th patch embedding in $l$ -th block is kept when $\mathbf{M}_{l,j}^p = 1$ , and dropped when $\mathbf{M}_{l,j}^p = 0$ . We relax the sampling process with Gumbel-Softmax trick [26] to make it differentiable during training (see Sec. 3.3.) + +Patch Selection. For the input to each transformer block, we aim at keeping only the most informative patch embeddings and discard the rest to speedup inference. More formally, for $l$ -th block, the patches are removed from the input to this block if the corresponding entries in $\mathbf{M}_i^p$ equal to 0: + +$$ +\mathbf {Z} _ {l} = \left[ \mathbf {z} _ {l, c l s}; \mathbf {M} _ {l, 1} ^ {p} \mathbf {z} _ {1}; \dots ; \mathbf {M} _ {l, N} ^ {p} \mathbf {z} _ {N} \right] \tag {7} +$$ + +The class token $\mathbf{z}_{l,cls}$ is always kept since it is used as representation of the whole image. + +Head Selection. Multi-head self attention enables the model to attend to different subspaces of the representation jointly [40] and is adopted in most, if not all, vision transformer variants [4,7,22,38,56]. Such a multi-head design is crucial to model the underlying long-range dependencies in images especially those with complex scenes and cluttered background, but fewer attention heads could arguably suffice to look for where to attend to in easy images. With this in mind, we explore dropping attention heads adaptively conditioned on input image for faster inference. Similar to patch selection, the decision of activating or deactivating certain attention head is determined by the corresponding entry in $\mathbf{M}_l^h$ . The "deactivation" of an attention head can be instantiated in different ways. In our framework, we explore two methods for head selection, namely partial deactivation and full deactivation. For partial deactivation, the softmax output in attention as in Eqn. 2 is replaced with predefined ones like an $(N + 1,N + 1)$ identity matrix $\mathbb{1}$ , such that the cost of computing attention map is saved. The attention in $i$ -th head of $l$ -th block is then computed as: + +$$ +\mathsf {A t t n} (Q, K, V) _ {l, i} = \left\{ \begin{array}{l l} \mathsf {s o f t m a x} (\frac {Q K ^ {T}}{\sqrt {d _ {k}}}) \cdot V & \text {i f} \mathbf {M} _ {l, i} ^ {h} = 1 \\ \mathbb {1} \cdot V & \text {i f} \mathbf {M} _ {l, i} ^ {h} = 0 \end{array} \right. +$$ + +For full deactivation, the entire head is removed from the multi-head self attention layer, and the embedding size of the output from MSA is reduced correspondingly: + +$$ +\operatorname {M S A} (\mathbf {Z} _ {l}) _ {l, i} = \operatorname {C o n c a t} ([ \mathbf {h e a d} _ {l, i: 1 \rightarrow H} \mathrm {i f} \mathbf {M} _ {l, i} ^ {h} = 1 ]) \mathbf {W} _ {l} ^ {O ^ {\prime}} +$$ + +In practice, full deactivation saves more computation compared with partial deactivation when same percentage of heads are deactivated, yet is likely to incur more classification errors as the embedding size is manipulated on-the-fly. + +Block Selection. In addition to patch selection and head selection, a transformer block can also be favourably skipped entirely when it is redundant, by virtue of the residual connections throughout the network. To increase the flexibility of layer skipping, we increase the dimension of block usage policy matrix $\mathbf{m}_l^b$ from 1 to 2, enabling the two sublayers (MSA and FFN) in each transformer block to be controlled individually. Eqn. 5 then becomes: + +$$ +\mathbf {Z} _ {l} ^ {\prime} = \mathbf {M} _ {l, 0} ^ {b} \cdot \operatorname {M S A} (\mathbf {Z} _ {l}) + \mathbf {Z} _ {l} +$$ + +$$ +\mathbf {Z} _ {l + 1} = \mathbf {M} _ {l, 1} ^ {b} \cdot \operatorname {F F N} \left(\mathbf {Z} _ {l} ^ {\prime}\right) + \mathbf {Z} _ {l} ^ {\prime} \tag {8} +$$ + +In summary, given the input of each transformer block, the decision network produces the usage policies for this block, and then the input is forwarded through the block with the decisions applied. Finally, the classification prediction from the last layer and the decisions for all blocks $\mathbf{M} = \{\mathbf{M}_l^p,\mathbf{M}_l^h,\mathbf{M}_l^b\}$ for $l:1\to L\}$ are obtained. + +# 3.3. Objective Function + +Since our goal is to reduce the overall computational cost of vision transformers with a minimal drop in accuracy, the objective function of AdaViT is designed to incentivize correct classification and less computation at the same time. In particular, a usage loss and a cross-entropy loss are used to jointly optimize the framework. Given an input image $I$ with a label $\mathbf{y}$ , the final prediction is produced by the transformer $\mathbf{F}$ with parameters $\theta$ , and the cross-entropy loss is computed as follows: + +$$ +L _ {c e} = - \mathbf {y} \log (\mathbf {F} (I; \boldsymbol {\theta})) \tag {9} +$$ + +While the binary decisions on whether to keep/discard a patch/head/block can be readily obtained through applying a threshold during inference, determining the optimal thresholds is challenging. In addition, such an operation is not differentiable during training and thus makes the optimization of decision network challenging. A common solution is to resort to reinforcement learning and optimize the network with policy gradient methods [36], yet it can be slow to converge due to the large variance that scales with the dimension of discrete variables [26, 36]. To this end, we use the Gumbel-Softmax trick [26] to relax the sampling + +process and make it differentiable. Formally, the decision at $i$ -th entry of $\mathbf{m}$ is derived in the following way: + +$$ +\mathbf {M} _ {i, k} = \frac {\exp (\log (\mathbf {m} _ {i , k} + G _ {i , k}) / \tau)}{\sum_ {j = 1} ^ {K} \exp (\log (\mathbf {m} _ {i , j} + G _ {i , j}) / \tau)} +$$ + +$$ +\text {f o r} k = 1, 2, \dots , K \tag {10} +$$ + +where $K$ is the total number of categories ( $K = 2$ for binary decision in our case), and $G_{i} = -\log (-\log (U_{i}))$ is the Gumbel distribution in which $U_{i}$ is sampled from $\mathrm{Uniform}(0,1)$ , an i.i.d uniform distribution. Temperature $\tau$ is used to control the smoothness of $\mathbf{M}_i$ . + +To encourage reducing the overall computational cost, we devise the usage loss as follows: + +$$ +\begin{array}{l} L _ {u s a g e} = (\frac {1}{D _ {p}} \sum_ {d = 1} ^ {D _ {p}} {\bf M} _ {d} ^ {p} - \gamma_ {p}) ^ {2} + (\frac {1}{D _ {h}} \sum_ {d = 1} ^ {D _ {h}} {\bf M} _ {d} ^ {h} - \gamma_ {h}) ^ {2} \\ + \left(\frac {1}{D _ {b}} \sum_ {d = 1} ^ {D _ {b}} \mathbf {M} _ {d} ^ {b} - \gamma_ {b}\right) ^ {2} \\ \end{array} +$$ + +where $D_{p} = L\times N$ $D_{h} = L\times H$ $D_{b} = L\times 2$ (11) + +Here $D_{p}, D_{h}, D_{b}$ denote the sizes of flattened probability vectors from the decision network for patch/head/block selection, i.e. the total numbers of patches, heads and blocks of the entire transformer respectively. The hyperparameters $\gamma_{p}, \gamma_{h}, \gamma_{b} \in (0,1]$ indicate target computation budgets in terms of the percentage of patches/heads/blocks to keep. + +$$ +\min _ {\boldsymbol {\theta}, \mathbf {W}} L = L _ {c e} + L _ {u s a g e} \tag {12} +$$ + +Finally, the two loss functions are combined and minimized in an end-to-end manner as in Eqn. 12. + +# 4. Experiment + +# 4.1. Experimental Setup + +Dataset and evaluation metrics. We conduct experiments on ImageNet [6] with $\sim 1.2\mathrm{M}$ images for training and $50\mathrm{K}$ images for validation, and report the Top-1 classification accuracy. To evaluate model efficiency, we report the number of giga floating-point operations (GFLOPs) per image. + +Implementation details. We use T2T-ViT [56] as the transformer backbone due to its superior performance on ImageNet with a moderate computational cost. The backbone consists of $L = 19$ blocks and $H = 7$ heads in each MSA layer, and the number of tokens $N = 196$ . The decision network is attached to each transformer block starting from 2-nd block. For head selection, we use the full deactivation method if not mentioned otherwise. We initialize the transformer backbone of AdaViT with the pretrained weights released in the official implementation of [56]. We will release the code. + +
MethodTop-1 Acc (%)FLOPs (G)Image Size#Patch#Head#Block
ResNet-50* [13,56]79.14.1224×224---
ResNet-101* [13,56]79.97.9224×224---
ViT-S/16 [7]78.110.1224×224196128
DeiT-S [38]79.94.6224×224196612
PVT-Small [44]79.83.8224×224--15
Swin-T [22]81.34.5224×224--12
T2T-ViT-19 [56]81.98.5224×224196719
CrossViT-15 [4]81.55.8224×224196615
LocalViT-S [20]80.84.6224×224196612
Baseline Upperbound81.98.5224×224196719
Baseline Random33.04.0224×224~118~5.6~16.2
Baseline Random+71.53.9224×224~121~5.6~16.2
AdaViT (Ours)81.13.9224×224~95~4.5~15.5
+ +Table 1. Main Results. We compare AdaViT with various standard CNNs and vision transformers, as well as baselines including Upper-bound, Random and Random+. * denotes training ResNets with our recipe following [56]. + +We use 8 GPUs with a batch size 512 for training. The model is trained with a learning rate 0.0005, a weight decay 0.065 and a cosine learning rate schedule for 150 epochs following [56]. AdamW [24] is used as the optimizer. For all the experiments, we set the input size to $224 \times 224$ . Temperature $\tau$ in Gumbel-Softmax is set to 5.0. The choices of $\gamma_p, \gamma_h, \gamma_b$ vary flexibly for different desired trade-offs between classification accuracy and computational cost. + +# 4.2. Main Results + +We first evaluate the overall performance of AdaViT in terms of classification accuracy and efficiency, and report the results in Table 1. Besides standard CNN and transformer architectures such as ResNets [13], ViT [7], DeiT [38], T2T-ViT [56] and so on, we also compare our method with the following baseline methods: + +- Upperbound: The original pretrained vision transformer model, with all patch embeddings kept as input and all self-attention heads and transformer blocks activated. This serves as an "upperbound" of our method regarding classification accuracy. +- Random: Given the usage policies produced by AdaVit, we generate random policies on patch selection, head selection and block selection that use similar computational cost and apply them to the pretrained models to validate the effectiveness of learned policies. +- Random+: The pretrained models are further finetuned with the random policies applied, in order to adapt to the varied input distribution and network architecture incurred by the random policies. + +As shown in Table 1, AdaViT is able to obtain good efficiency improvement with only a small drop on classification accuracy. Specifically, AdaViT obtains $81.1\%$ Top-1 accuracy requiring 3.9 GFLOPs per image during in + +ference, achieving more than $2 \times$ efficiency than the original T2T-ViT model with only $\sim 0.8\%$ drop of accuracy. Compared with standard ResNets [13] and vision transformers that use a similar backbone architecture of ours [4,7,38,56], AdaViT obtains better classification performance with less computational cost, achieving a good efficiency/accuracy trade-off as further shown in Figure 3. It is also worth pointing out that compared with vision transformer variants [22, 44] which resort to advanced design choices like multi-scale feature pyramid and hierarchical downsampling, our method still obtains comparable or better accuracy under similar computational cost. + +When using a similar computation budget, AdaViT outperforms random and random+ baselines by clear margins. Specifically, Ada-ViT with T2T-ViT as the backbone network obtains $48.1\%$ and $9.6\%$ higher accuracy than random and random+ respectively at a similar cost of 3.9 GFLOPs per image, demonstrating that the usage policies learned by AdaViT can effectively maintain classification accuracy and + +![](images/a2cb06a867297df6b552e0f2d96c3e11103c6bafc36d19487ce3439ea8d00bcf.jpg) +Figure 3. Tradeoff between efficiency and accuracy. AdaViT obtains good efficiency/accuracy tradeoffs compared with other static vision transformers. + +![](images/e9bbf9d1d751be7dce75f0221d9c28a1943f1053b02f47d9d33151302c2ad105.jpg) +(a) Overall + +![](images/980b83a3f9df6e912b9be17355e3d6a8a0ff20210819c02dce6cf82f48de1efe.jpg) +(b) Patch Only +Figure 4. Effectiveness of each component. Efficiency/Accuracy tradeoffs of AdaViT with (a) all three selection methods; (b) patch selection; (c) head selection; (d) block selection and their Random+ counterparts. + +![](images/397ed8c2a7cd7f3c0961063f3e1d200e936ebcc7188605a1424654ea8a8e4fd8.jpg) +(c) Head Only + +![](images/a6d887e266eabe0719fc0d74c100976294e94d9064350ead4a943d539620723a.jpg) +(d) Block Only + +reduce computational cost at the same time. + +AdaViT with different computational budgets. AdaViT is designed to accommodate the need of different computational budgets flexibly by varying the hyperparameters $\gamma_{p}, \gamma_{h}$ and $\gamma_{b}$ as discussed in Section 3.2. As demonstrated in Figure 4(a), AdaViT is able to cover a wide range of tradeoffs between efficiency and accuracy, and outperforms Random+ baselines by a large margin. + +# 4.3. Ablation Study + +Effectiveness of learned usage policies. Here we validate that each of the three sets of learned usage policies is able to effectively maintain the classification accuracy while reducing the computational cost of vision transformers. For this purpose, we replace the learned usage policies with randomly generated policies that cost similar computational resources and report the results in Table 2. As shown in Table 2, changing any set of learned policies to a random one results in a drop of accuracy by a clear margin. Compared + +
Random PatchRandom HeadRandom BlockTop-1 Accuracy
49.2
57.4
64.7
Full AdaViT81.1
+ +Table 2. Effectiveness of learned usage policies. We replace each set of policies with randomly generated policies and compare with our method in its entirety. + +
MethodTop-1 Acc% HeadGFLOPs
Upperbound81.9100%8.5
Partial81.750%6.9
Full80.350%5.1
Full80.860%5.8
Full81.170%6.6
+ +Table 3. Partial vs. Full deactivation for head selection. + +with random patch/head/block selection, AdaViT obtains $31.9\% / 23.7\% / 16.4\%$ higher accuracy under similar computational budget. This confirms the effectiveness of each learned usage policy. + +Ablation of individual components. Having demonstrated the effectiveness of the jointly learned usage policies for patch, head and block selection, we now evaluate the performance when only one of the three selection methods is used. It is arguable that part of the performance gap in Table 2 results from the change of input/feature distribution when random policies are applied, and thus we compare each component with its further finetuned Random+ counterparts. For faster training and evaluation, we train these models for 100 epochs. As shown in Figure 4(b-d), our method with only patch/head/block selection is also able to cover a wide range of accuracy/efficiency tradeoffs and outperforms Random+ baselines by a clear margin, confirming the effectiveness of each component. + +Partial vs. Full deactivation for head selection. As discussed in Sec. 3.2, we propose two methods to deactivate a head in the multi-head self-attention layer, namely partial deactivation and full deactivation. We now analyze their effectiveness on improving the efficiency of vision transformers. As demonstrated in Table 3, when deactivating the same percentage (i.e. $50\%$ ) of self-attention heads within the backbone, partial deactivation is able to obtain much higher accuracy than full deactivation ( $81.7\%$ vs. $80.3\%$ ), but also incurs higher computational cost (6.9 vs. 5.1 GFLOPs). This is intuitive since partial deactivation only skips the computation of attention maps before Softmax, while full deactivation removes the entire head and its output to the FFN. As the number of heads increases, full deactivation obtains better accuracy gradually. In practice these different head selection methods provide more flexible options to suit different computational budgets. + +# 4.4. Analysis + +Computational saving throughout the network. AdaViT exploits the redundancy of computation to improve the efficiency of vision transformers. To better understand such re + +![](images/9e0789f2344b6e467bea1eda44a6751a3335c0adbc5b03f51eef675d21484052.jpg) +Figure 5. Computational cost throughout the network. The percentages of kept/activated patches (top), heads (middle) and blocks (bottom) throughout the backbone are reported. + +![](images/acb4d4359aacbd344c581e92af3d5d25a2978fc37a39148c0f877e9fa110ddab.jpg) +Figure 6. Qualitative results. Images allocated with the least and the most computational resources by AdaViT are shown. + +dundancy, we collect the usage policies on patch/head/block selection predicted by our method on the validation set and show the distribution of computational cost (i.e. percentage of patches/heads/blocks kept) throughout the backbone network. As shown in Figure 5, AdaViT tends to allocate more computation in earlier stages of the network. In particular, for patch selection, the average number of kept patches in each transformer block gradually decrease until the final output layer. This is intuitive since the patches keep aggregating information from all other patches in the stacked self-attention layers, and a few informative patches near the output layer would suffice to represent the whole input image for correct classification. As visualized in Figure 7, the number of selected patches gradually decreases with a focus on the discriminative part of the images. + +For head selection and block selection, the patterns are a bit different from token selection, where relatively more computation is kept in the last few blocks. We hypothesize that the last few layers in the backbone are more responsible for the final prediction and thus are kept more often. + +Learned usage policies for different classes. We further analyze the distribution of learned usage policies for different classes. In Figure 8, we show the box plot of several classes that are allocated the most/least computational resources. As can be seen, our method learns to allocate more computation for difficult classes with complex scenes such as "shoe shop", "barber shop", "toyshop" but uses less computation for relatively easy and object-centric classes like "parachute" and "kite". + +Qualitative Results. Images allocated with the least and the most computation by our method are shown in Fig- + +![](images/32e0addca78973602fd9a05d24c6af6b43ebe911fa420f85fb3769c6ea37edfd.jpg) +Figure 7. Selected patches at different blocks. Green color denotes that the patches are kept. + +![](images/61c9fc720a5ebf1d681f68c780a5c97e1cd2e0ef0178ef5758a11b41516ee57e.jpg) +Figure 8. Distribution of allocated computational resources for classes using the least (top) and the most (bottom) computation. + +ure 6. It can be seen that object-centric images with simple background (like the parachute and the tennis ball) tend to use less computation, while hard samples with clutter background (e.g. the drum and the toy shop) are allocated more. + +Limitation. One potential limitation is that there is still a small drop of accuracy when comparing our method with the Upperbound baseline, which we believe would be further addressed in future work. + +# 5. Conclusion + +In this paper we presented AdaViT, an adaptive computation framework that learns which patches, self-attention heads and blocks to keep throughout the transformer backbone on a per-input basis for an improved efficiency for image recognition. To achieve this, a light-weight decision network is attached to each transformer block and optimized with the backbone jointly in an end-to-end manner. Extensive experiments demonstrated that our method obtains more than $2 \times$ improvement on efficiency with only a small drop of accuracy compared with state-of-the-art vision transformers, and covers a wide range of efficiency/accuracy trade-offs. We further analyzed the learned usage policies quantitatively and qualitatively, providing more insights on the redundancy in vision transformers. + +Acknowledgement This project was supported by National Key R&D Program of China (No. 2021ZD0112805). Y.-G. Jiang was sponsored in part by "Shuguang Program" supported by Shanghai Education Development Foundation and Shanghai Municipal Education Commission (No. 20SG01). Z. Wu was supported in part by NSFC (No. 62102092). + +# References + +[1] Babak Ehteshami Bejnordi, Tijmen Blankevoort, and Max Welling. Batch-shaping for learning conditional channel gated networks. In ICLR, 2020. 3 +[2] Tolga Bolukbasi, Joseph Wang, Ofer Dekel, and Venkatesh Saligrama. Adaptive neural networks for fast test-time prediction. In ICML, 2017. 3 +[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 1 +[4] Chun-Fu Chen, Quanfu Fan, and Rameswar Panda. Crossvit: Cross-attention multi-scale vision transformer for image classification. In ICCV, 2021. 1, 2, 4, 6 +[5] Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Twins: Revisiting the design of spatial attention in vision transformers. In NeurIPS, 2021. 1 +[6] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. 2, 5 +[7] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. 1, 2, 3, 4, 6 +[8] Alaaeldin El-Nouby, Natalia Neverova, Ivan Laptev, and Hervé Jégou. Training vision transformers for image retrieval. arXiv preprint arXiv:2102.05644, 2021. 2 +[9] Haoqi Fan, Bo Xiong, Karttikeya Mangalam, Yanghao Li, Zhicheng Yan, Jitendra Malik, and Christoph Feichtenhofer. Multiscale vision transformers. arXiv preprint arXiv:2104.11227, 2021. 1, 2 +[10] Michael Figurnov, Maxwell D Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially adaptive computation time for residual networks. In CVPR, 2017. 3 +[11] Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. Levit: a vision transformer in convnet's clothing for faster inference. In ICCV, 2021. 2, 3 +[12] Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. In NeurIPS, 2021. 1 +[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 6 +[14] Shuting He, Hao Luo, Pichao Wang, Fan Wang, Hao Li, and Wei Jiang. Transreid: Transformer-based object re-identification. In ICCV, 2021. 2 +[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. In ICCV, 2019. 2 +[16] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco An + +dreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. 2 +[17] Gao Huang, Danlu Chen, Tianhong Li, Felix Wu, Laurens van der Maaten, and Kilian Q Weinberger. Multi-scale dense networks for resource efficient image classification. In ICLR, 2018. 3 +[18] Hengduo Li, Zuxuan Wu, Abhinav Shrivastava, and Larry S Davis. 2d or not 2d? adaptive 3d convolution selection for efficient video recognition. In CVPR, 2021. 3 +[19] Hao Li, Hong Zhang, Xiaojuan Qi, Ruigang Yang, and Gao Huang. Improved techniques for training adaptive deep networks. In ICCV, 2019. 3 +[20] Yawei Li, Kai Zhang, Jiezhang Cao, Radu Timofte, and Luc Van Gool. Localvit: Bringing locality to vision transformers. arXiv preprint arXiv:2104.05707, 2021. 1, 2, 6 +[21] Ji Lin, Yongming Rao, Jiwen Lu, and Jie Zhou. Runtime neural pruning. In NIPS, 2017. 3 +[22] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, 2021. 1, 2, 3, 4, 6 +[23] Ze Liu, Jia Ning, Yue Cao, Yixuan Wei, Zheng Zhang, Stephen Lin, and Han Hu. Video swim transformer. arXiv preprint arXiv:2106.13230, 2021. 1, 2 +[24] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In *ICLR*, 2019. 6 +[25] Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In ECCV, 2018. 2 +[26] Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In ICLR, 2017. 2, 4, 5 +[27] Jiageng Mao, Yujing Xue, Minzhe Niu, Haoyue Bai, Jiashi Feng, Xiaodan Liang, Hang Xu, and Chunjing Xu. Voxel transformer for 3d object detection. In ICCV, 2021. 2 +[28] Yue Meng, Chung-Ching Lin, Rameswar Panda, Prasanna Sattigeri, Leonid Karlinsky, Aude Oliva, Kate Saenko, and Rogerio Feris. Ar-net: Adaptive frame resolution for efficient action recognition. In ECCV, 2020. 3 +[29] Mahyar Najibi, Bharat Singh, and Larry S Davis. Autofocus: Efficient multi-scale inference. In ICCV, 2019. 3 +[30] Bowen Pan, Rameswar Panda, Yifan Jiang, Zhangyang Wang, Rogerio Feris, and Aude Oliva. Ia-red2: Interpretability-aware redundancy reduction for vision transformers. In NeurIPS, 2021. 3 +[31] Xuran Pan, Zhuofan Xia, Shiji Song, Li Erran Li, and Gao Huang. 3d object detection with pointformer. In CVPR, 2021. 2 +[32] René Ranftl, Alexey Bochkovskiy, and Vladlen Koltun. Vision transformers for dense prediction. In ICCV, 2021. 2 +[33] Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Dynamicvit: Efficient vision transformers with dynamic token sparsification. In NeurIPS, 2021. 3 +[34] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zh-moginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In CVPR, 2018. 2 + +[35] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In ICCV, 2017. 2 +[36] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press Cambridge, 1998. 5 +[37] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In ICML, 2019. 2 +[38] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021. 1, 2, 3, 4, 6 +[39] Burak Uzkent and Stefano Ermon. Learning when and where to zoom with deep reinforcement learning. In CVPR, 2020. 3 +[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 NeurIPS, 2017. 1, 2, 3, 4 +[41] Andreas Veit and Serge Belongie. Convolutional networks with adaptive inference graphs. In ECCV, 2018. 3 +[42] Junke Wang, Zuxuan Wu, Jingjing Chen, Xintong Han, Abhinav Shrivastava, Yu-Gang Jiang, and Ser-Nam Lim. Objectformer for image manipulation detection and localization. In CVPR, 2022. 2 +[43] Rui Wang, Dongdong Chen, Zuxuan Wu, Yinpeng Chen, Xiyang Dai, Mengchen Liu, Yu-Gang Jiang, Luowei Zhou, and Lu Yuan. Bevt: Bert pretraining of video transformers. In CVPR, 2022. 1 +[44] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In ICCV, 2021. 1, 2, 6 +[45] Xin Wang, Fisher Yu, Zi-Yi Dou, Trevor Darrell, and Joseph E Gonzalez. Skipnet: Learning dynamic routing in convolutional networks. In ECCV, 2018. 3 +[46] Xiaohan Wang, Linchao Zhu, Yu Wu, and Yi Yang. Symbiotic attention for egocentric action recognition with object-centric alignment. IEEE TPAMI, 2020. 2 +[47] Yulin Wang, Rui Huang, Shiji Song, Zeyi Huang, and Gao Huang. Not all images are worth 16x16 words: Dynamic vision transformers with adaptive sequence length. In NeurIPS, 2021. 3 +[48] Yuqing Wang, Zhaoliang Xu, Xinlong Wang, Chunhua Shen, Baoshan Cheng, Hao Shen, and Huaxia Xia. End-to-end video instance segmentation with transformers. In CVPR, 2021. 2 +[49] Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, and Lei Zhang. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021. 1 +[50] Zuxuan Wu, Hengduo Li, Caiming Xiong, Yu-Gang Jiang, and Larry Steven Davis. A dynamic frame selection framework for fast video recognition. IEEE TPAMI, 2022. 3 +[51] Zuxuan Wu, Hengduo Li, Yingbin Zheng, Caiming Xiong, Yu-Gang Jiang, and Larry S. Davis. A coarse-to-fine framework for resource efficient video recognition. IJCV, 2021. 3 + +[52] Zuxuan Wu, Tushar Nagarajan, Abhishek Kumar, Steven Rennie, Larry S Davis, Kristen Grauman, and Rogerio Feris. Blockdrop: Dynamic inference paths in residual networks. In CVPR, 2018. 3 +[53] Tete Xiao, Mannat Singh, Eric Mintun, Trevor Darrell, Piotr Dollár, and Ross Girshick. Early convolutions help transformers see better. In NeurIPS, 2021. 2 +[54] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. In NeurIPS, 2021. 2 +[55] Le Yang, Yizeng Han, Xi Chen, Shiji Song, Jifeng Dai, and Gao Huang. Resolution adaptive networks for efficient inference. In CVPR, 2020. 3 +[56] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Zihang Jiang, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch onImagenet. In ICCV, 2021. 1, 2, 3, 4, 5, 6 +[57] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR, 2018. 2 +[58] Yanyi Zhang, Xinyu Li, Chunhui Liu, Bing Shuai, Yi Zhu, Biagio Brattoli, Hao Chen, Ivan Marsic, and Joseph Tighe. Vidtr: Video transformer without convolutions. In ICCV, 2021. 1 +[59] Linchao Zhu and Yi Yang. Label independent memory for semi-supervised few-shot video classification. IEEE TPAMI, 2020. 2 \ No newline at end of file diff --git a/adavitadaptivevisiontransformersforefficientimagerecognition/images.zip b/adavitadaptivevisiontransformersforefficientimagerecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cb9e2e40c6a4acade338955326f79f6449d6100e --- /dev/null +++ b/adavitadaptivevisiontransformersforefficientimagerecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:284b83d4dab62c1543adcbe49391dd7faaed83fb74140e520c4862bbbeb0beb4 +size 502204 diff --git a/adavitadaptivevisiontransformersforefficientimagerecognition/layout.json b/adavitadaptivevisiontransformersforefficientimagerecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..affa779c8537105b4b37c6b892ff0d672f5df2f3 --- /dev/null +++ b/adavitadaptivevisiontransformersforefficientimagerecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:323dbc3f1cd4d462d1c4a45fa2232636138c1e1be33a95419d92aeee81e8e6a2 +size 429226 diff --git a/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_content_list.json b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..30a22eed06a60dd50b4cc14b787333e0eab97fb7 --- /dev/null +++ b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6faa871a3746f6635af7ae3dd39985624c7edffac551b4cd97904f95e8adc12 +size 93334 diff --git a/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_model.json b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..850e7dd1544f7b3a9de1cde9465a9296102a0618 --- /dev/null +++ b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7758031bbda51973d0a55b2f14bb3c10518f56fdcc67f1e71b5d26b5c60db75c +size 118002 diff --git a/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_origin.pdf b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..12a447ab030eb155f10639618a42b46127e7456b --- /dev/null +++ b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/acf8d16f-ae93-4f86-a047-66218f75e87a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21c8927fbbee40df26b14ee68f32aa1ff37290178ac4906c889e3e18eac899b1 +size 9699703 diff --git a/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/full.md b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d1f421cd47a1d908052d05ffeedeb3285dd07077 --- /dev/null +++ b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/full.md @@ -0,0 +1,366 @@ +# ADeLA: Automatic Dense Labeling with Attention for Viewpoint Shift in Semantic Segmentation + +Hanxiang Ren $^{1*}$ Yanchao Yang $^{2\dagger*}$ He Wang $^{3\ddagger}$ Bokui Shen $^{2}$ + +Qingnan Fan $^{4\ddagger}$ Youyi Zheng $^{1\dagger}$ C. Karen Liu $^{2}$ Leonidas Guibas $^{2}$ + +$^{1}$ Zhejiang University $^{2}$ Stanford University $^{3}$ Peking University $^{4}$ Tencent AI Lab + +{hanxiang. ren, youyizheng} @zju.edu.cn {yanchaoy, karenliu, guibas} @cs.stanford.edu + +hewang@pku.edu.cn bshen88@stanford.edu fqnchina@gmail.com + +# Abstract + +We describe a method to deal with performance drop in semantic segmentation caused by viewpoint changes within multi-camera systems, where temporally paired images are readily available, but the annotations may only be abundant for a few typical views. Existing methods alleviate performance drop via domain alignment in a shared space and assume that the mapping from the aligned space to the output is transferable. However, the novel content induced by viewpoint changes may nullify such a space for effective alignments, thus resulting in negative adaptation. Our method works without aligning any statistics of the images between the two domains. Instead, it utilizes a novel attention-based view transformation network trained only on color images to hallucinate the semantic images for the target. Despite the lack of supervision, the view transformation network can still generalize to semantic images thanks to the induced "information transport" bias. Furthermore, to resolve ambiguities in converting the semantic images to semantic labels, we treat the view transformation network as a functional representation of an unknown mapping implied by the color images and propose functional label hallucination to generate pseudo-labels with uncertainties in the target domains. Our method surpasses baselines built on state-of-the-art correspondence estimation and view synthesis methods. Moreover, it outperforms the state-of-the-art unsupervised domain adaptation methods that utilize self-training and adversarial domain alignments. Our code and dataset will be made publicly available. + +# 1. Introduction + +Parsing the environment from multiple viewing angles to arrive at a comprehensive understanding of the surroundings is critical for autonomous agents, assistive robots, and + +![](images/cee0f33a34ed38bdf5401408b543409fd9c7ca53d7891d67461e812c577c1f04.jpg) + +![](images/97175a98e16a6d1c3285744f7ebdc66d371663431a9cf4d50b1917a920f32717.jpg) + +![](images/efdaee693d739af8c1807870a89da8fe6ddc6ef36bb016d1a2f8c6d0fdb84bf2.jpg) + +![](images/2c18f70c12139330eafe364cfb40d8cf77b2de43949bed433087951ceb21a19d.jpg) +(a) +(b) +Figure 1. (a): Multiple cameras towards different viewpoints can help autonomous or assistive agents to better understand the scene. However, the performance of the semantic segmentation network trained on the forward view (typical view of existing datasets) drops sharply when tested with viewpoint shifts (Tab. 5). (b): Adaptation gain obtained by state-of-the-art methods across different viewpoints. Our method consistently shows positive gains and works robustly towards substantial viewpoint change, + +AR/VR equipment (Fig. 1a). These multi-camera systems can capture temporally paired data in practice from different viewpoints, and the need to train a scene parsing network that performs well at multiple viewpoints is key to estimating traversable surfaces and preventing accidents. However, viewpoint changes across cameras induce significant domain gaps – a scene parsing network trained with annotations in one view often encounters a large performance drop on another (Tab. 5). We aim to reduce this performance drop by transporting semantic information from the + +views with rich annotations (source) to views with no available annotation (target) utilizing temporally paired images readily available from multi-camera systems. + +Most methods dealing with domain gaps build on the idea that an alignment in a shared latent space helps the task-specific network trained in the source domain generalize to the target. Despite its effectiveness, domain alignment generally assumes (sufficient) invariance exists for the task, which can be computed through the alignment so that the mapping from the aligned space to the output is transferable across domains (Fig. 2a & 2b). However, the domain discrepancy we consider here is mainly the content shift caused by the viewpoint change (Fig. 2c). As dense scene parsing (semantic segmentation) is viewpoint elevation-dependent, any alignment that learns away viewpoint will result in (insufficient) invariances which are not adequate or suitable for the task, thus inducing negative adaptation (Fig. 1b). + +We break this conundrum by hallucinating the target semantic images using their source counterparts. Our method employs a view transformation network that outputs the target semantic image, conditioned on a source semantic image and a pair of temporally aligned regular color images. The hallucinated semantic images are then converted to semantic labels to adapt the task network. + +However, without a proper inductive bias, the view transformation network would completely fail on semantic images due to their different structures. We propose that the right inductive bias is to encourage learning spatial transportation instead of transformation in color space. Further, we introduce a novel architecture for view transformation where the desired inductive bias is injected via an attention mechanism. To combat noise in the hallucination and better decode the semantic labels, we treat the view transformation network as a functional representation of an unknown mapping signified by the color images. Accordingly, we propose a functional label hallucination strategy that generates the soft target labels by taking in the indicator functions of each class. The proposed decoding strategy improves the label accuracy by a large margin and makes the labels more suitable for adaptation by incorporating uncertainties. + +Due to the lack of datasets in semantic segmentation whose domain gaps are mainly from viewpoint change, we also propose a new dataset where the viewpoint is varied to simulate different levels of content shift (Fig. 7). To our best knowledge, the problem we study here is largely underexplored. To validate, we perform a comprehensive study of various state-of-the-art methods, including dense correspondence estimation, novel view synthesis, and unsupervised domain adaptation (UDA) methods. We demonstrate the effectiveness of our method by showing the best adaptation gains across different target domains, even for perpendicular viewing angles. Our contributions are: + +- A benchmarking of state-of-the-art UDA methods for + +semantic segmentation on viewpoint shifts. + +- A novel architecture for semantic information hallucination trained with only RGB images and an uncertainty-aware functional decoding scheme. +- A state-of-the-art method that deals with performance drops in semantic segmentation caused by viewpoint shifts for multi-camera systems. + +# 2. Related work + +We focus on unsupervised domain adaptation (UDA) methods for the pixel-level prediction task of semantic segmentation. The core ingredient of UDA is to reduce the domain gap between the source and the target data [2,9,14,18,34,55], where the domain gap can be measured by the maximum mean discrepancy [17,28] or central moment discrepancy [61]. Deep learning based methods resort to adversarial measurements, where discriminator networks are used to confuse the two domains [24,31,40,43,44,51] in a shared feature space. In contrast to classification, feature space alignment is much less effective for pixel-level prediction tasks like semantic segmentation [29,41], due to the difficulties in keeping the aligned features informative about the spatial structure of the output. + +The recent success of unsupervised domain adaptation for semantic segmentation mainly relies on image-to-image translation [27, 60, 71] where the goal is to reduce the style difference between domains while preserving the underlying semantics [20, 26, 66]. Multi-level feature alignment is proposed [58] and [19] introduces intermediate styles that gradually close the gap. A disentanglement of texture and structure is also beneficial [4], and [23] performs style randomization to learn style invariance. To ease the difficulty in adversarial training, [59] proposes a style transfer via Fourier Transform while enforcing semantic consistency. On the other hand, [12, 13, 30, 56, 65] propose class-wise alignments, given that each of the semantic classes may possess a different domain gap. Similarly, [49] proposes patchwise alignment, and [21] utilizes local contextual-relations for a consistent adaptation. [22] also performs alignment on consistently matched pixels among source and target images. The alignment can also be done in the output space [53], or in a curriculum manner. For example, [33] employs inter and intra domain adaptation with an easy-to-hard split, and [25] pre-selects source images with similar content to the target. With aligned domains, self-training using pseudo labels can be utilized to further close the gap [26, 59, 64]. + +Our method tackles the domain gap caused by different camera views, which renders the image space alignment ineffective as the domain gap is mainly content shift but not the style difference. Unlike cross-view image classification [1, 10, 16, 37, 63], aligning domains of different viewpoints for pixel-level prediction tasks is ill-posed, since the task is indeed view dependent [7]. The most relevant are [8, 11], + +![](images/be5d3ecfddd2e5a6ce06098a5e2e4dc93a7033d27e90690c7c81ede374874567.jpg) +(a) + +![](images/da037a4372054eb918d22837da3ffa0a214f5d0eef455d2fb7afa2d98d6fb29e.jpg) +(b) +Figure 2. (a): image classification where image style and viewpoint are nuisances [36, 39]; (b): semantic segmentation at similar views where image style is the major nuisance for domain gaps [20, 35]; (c): semantic segmentation with changing view (e.g., forward to downward), a nuisance that should not be aligned away. We focus on viewpoint shifts in semantic segmentation. + +![](images/8bcaf89dde38af62683a35a6b8ece6e4b5157d508103df52b17b79b725980118.jpg) +(c) + +![](images/6fa8651d8f4bf70347517b6ba62fe6acf1326e4958d5b8241a958f3d2f117300.jpg) +Figure 3. Left: a network $\psi$ is trained to hallucinate color images from the source to the target and is never exposed to semantic images; Right: $\psi$ is directly applied on the corresponding source semantic image to hallucinate the target semantic image to provide training labels for the target domain. + +which again resort to adversarial domain alignment. Additionally, [8] requires known camera intrinsics and extrinsic. Note, both assume the viewpoint change is small or there is a large overlap between the two views, therefore the applicability to a broader setting is limited, whereas our method is not constrained by any of these assumptions. Also related is novel view synthesis [6, 15, 46, 69], particularly, single view synthesis [50, 57, 70], where multiple posed images of the same scene are needed during training. Hence, if the goal is to synthesize semantic images of a different view, the target domain's semantic images are needed, which, however, are not available in our problem setting. Another related topic is dense correspondence estimation [48, 54, 67], which can be used to warp labels to help adaptation between domains. + +# 3. Method + +Let $\mathcal{D}^s = \{(x_i^s,y_i^s)\}_{i = 1}^n$ be the source dataset collected at the source viewpoint $s$ , where $x_{i}^{s}\in \mathbb{R}^{h\times w\times 3}$ is an RGB image, and $y_{i}^{s}\in \mathbb{R}^{h\times w\times 3}$ is the corresponding semantic image (Fig. 3) that is usually used for visualizing the semantic labels $\bar{y}_i^s\in \mathbb{R}^{h\times w\times k}$ (we use the semantic image $y_{i}^{s}$ or labels $\bar{y}_i^s$ interchangeably depending on the context). Further, let $\mathcal{D}^{\tau} = \{x_i^\tau \}_{i = 1}^n$ be the target dataset collected at the target viewpoint $\tau$ , whose semantic label/image $y_{i}^{\tau}$ is missing. In order to make our method generally applicable, we assume no knowledge about the viewpoints $s,\tau$ except that $x_{i}^{s}$ and $x_{i}^{\tau}$ are captured simultaneously. Note, this is the only assumption we make since synchronization in multi-camera systems is default. Therefore, the domain gap between $\mathcal{D}^s$ and $\mathcal{D}^{\tau}$ comes from viewpoint shifts. However, the synchronized source and target view images may or may not share co-visible regions, which is unknown and + +determined by the actual difference between the two views. Please see Fig. 7 for examples of the source and target domains with various viewpoint shifts. + +Similar to unsupervised domain adaptation, our ultimate goal is to train a semantic segmentation network $\phi : \mathbf{x} \rightarrow \mathbf{y}$ given only the annotations from the source dataset $\mathcal{D}^s$ so that $\phi$ can perform well on the target dataset $\mathcal{D}^\tau$ with the presence of viewpoint shifts. So the domain gap we are considering here is mainly the content shift induced by different viewing angles, i.e., the discrepancy in the output, which violates the assumptions made by most unsupervised domain adaptation methods that rely on either image space or feature space alignment, or both [23,25,30,53,59,64,65]. Instead of aligning distributions of any kind between the two domains, which may result in negative adaptation gains (Fig. 1b), we resort to a network that can hallucinate the target view semantic images $(y^{\tau})$ from the source $(y^{s})$ guided by the color images $(x^{s}, x^{\tau})$ . Specifically, we want to have a network $\psi : \mathbf{y} \times \mathbf{x} \times \mathbf{x} \rightarrow \mathbf{y}$ , whose output $\psi(y_{i}^{s}; x_{i}^{s}, x_{i}^{\tau})$ can be used as pseudo ground-truth for improving $\phi$ to make better predictions on $\mathcal{D}^\tau$ . + +The whole pipeline can be summarized as 1) train the view transformation network $\psi$ using temporally aligned source and target view color images to learn information transport between the two domains; 2) once $\psi$ is trained, we use it to hallucinate target view semantic images/labels; 3) the hallucinated target labels are then used to train the semantic segmentation network $\phi$ to adapt to the target views. During testing, i.e., semantic inference, $\psi$ is not in operation since we can apply the adapted semantic segmentation network $\phi$ directly on the test images from the target domain to make predictions. Thus the source images are not required. Please refer to Fig. 4 for an overview. + +# 3.1. Auto-labeling with attention + +Looking at a pair of color images $x_{i}^{s}, x_{i}^{\tau}$ shown in Fig. 3, one could hallucinate to some extent the target semantic image $y_{i}^{\tau}$ associated with $x_{i}^{\tau}$ given the source semantic image $y_{i}^{s}$ . On the other hand, if a network learns how to hallucinate the target image $x_{i}^{\tau}$ from the source image $x_{i}^{s}$ , we would expect it to make a reasonable hallucination of the target semantic image $y_{i}^{\tau}$ from the source semantic image $y_{i}^{s}$ , since $x_{i}^{s}$ and $y_{i}^{s}$ are simply two different appearances of the same geometry. However, without a proper inductive bias, a network trained to hallucinate color images between + +![](images/b9b90fc4240780528758a9bab0d3b80d4930b8893fc9c9c6f32e52b1df9256ce.jpg) +Figure 4. The proposed architecture for hallucinating arbitrary target views together with the whole pipeline for adapting the semantic segmentation network to target domains where labeling is missing. In stage 1, the view transformation network $\psi$ is only trained on color images, and is used for generating pseudo labels in the target domain in stage 2. The semantic segmentation network $\phi$ is then adapted to the target view in stage 3 using the target pseudo labels. + +![](images/e40eacd1c793382d5f6fa24553b271d00e8a917a9f26faf3ae3ddd2c22e380a1.jpg) + +different views may fail completely when tested on semantic images due to their statistical difference. + +To validate, we train a UNet [38] $\psi^{unet}$ to hallucinate $x_{i}^{\tau}$ from $x_{i}^{s}$ using an L1 reconstruction objective at fixed $\tau$ . After training, we check if $\psi^{unet}(y_i^s)$ is similar to $y_{i}^{\tau}$ . As shown in Fig. 5b (2nd column), the UNet trained on color images does not generalize well on semantic images, which confirms the difficulties of hallucinating the novel appearance of a seen view, even if the geometry is unchanged. + +We propose that the key to generalizing to novel appearance is to bias the view transformation network towards learning spatial transportation instead of color transformation. For example, the network needs incentives to learn where the color should be copied to in the target view instead of how the color should change to form the target view. If so, the view hallucination should generalize to any novel appearance since the color transformation may depend on domains while the transport conditioned on the same views and geometry is invariant. + +Biasing towards information transport with attention. The self-attention mechanism proposed in [52] represents a layer that processes the input by first predicting a set of keys $(K)$ and a set of queries $(Q)$ , whose dot-products are then used to update a set of values $(V)$ to get the output (updated values): + +$$ +\mathrm {A T T N} (Q, K, V) = \mathrm {s o f t m a x} (\frac {Q K ^ {T}}{\sqrt {d _ {k}}}) V +$$ + +By examining how a single output value $v_{i}^{\prime}$ is computed, we can see why attention helps to bias towards transport that facilitates the generalization of the hallucination. Let $q_{i}$ be the corresponding query for $v_{i}^{\prime}$ , and $[k_{1}, k_{2}, \dots, k_{m}]$ be the keys, then $v_{i}^{\prime} = \sum_{j=1}^{m} \alpha_{j} \cdot v_{j}$ , with $\alpha_{j}$ 's the elements + +of $\mathrm{softmax}([k_1q_i^T,k_2q_i^T,\dots,k_mq_i^T])$ (scaling factor omitted for simplicity). Note if $q_{i}$ is extremely similar to a certain key, e.g., $k_{j*}$ , but dis-similar to the other keys, we may write $v_{i}^{\prime}\approx v_{j*}$ . This signals that the attention is transporting values from different locations to $i$ through the weighted summation. In the extreme case, it can even stimulate pointwise transportation of the values. + +To verify the effectiveness of attention in hallucinating labels (novel appearance), we simply reorganize the tunable parameters in the UNet $\psi^{unet}$ such that the convolutional layers near the bottleneck are now replaced by attention layers of the same capacity. We term it $\psi^{attn}$ and train it to hallucinate the target color images from the source color images, i.e., $\hat{x}_i^\tau = \psi^{attn}(x_i^s)$ , and test it on the semantic images. As shown in Fig. 5b (3rd column), $\psi^{attn}$ can hallucinate reasonable target semantic images even it is only trained on color images. Given the effectiveness of the inductive bias introduced by the attention mechanism in semantic information hallucination for a single target view, we now detail our view hallucination network for multiple target views and the technique that we propose to generate soft labels for adaptation to different target domains. + +# 3.2. Labeling multiple target domains + +Here we specify the proposed network architecture that can seamlessly work for different target views, e.g., the target domain is a mixture of views, which eliminates the need to train separate networks. Again, the view transformation network $\psi(x_{V}; x_{K}, x_{Q})$ takes in a pair of color images, which guide $\psi$ to predict the target view from the source whose appearance is determined by either the source color image or the source semantic image, i.e., $\hat{x}_{i}^{\tau} =$ + +![](images/4bcc06dc642617e503caa297625df57b57edc8a59a28d5403130b66272bef377.jpg) +source image +(a) +Figure 5. (a): source and target color images for training the view transformation network $\psi$ ; (b): applying $\psi$ on source semantic images. The hallucinated semantic images by the network without attention ("w/o attention") are inaccurate and not consistent with the target images; however, the hallucinations from the network with attention ("with attention") are sharp and more precise. + +![](images/075a1abd9a26f16f7d6d02fce683ff9936808e50d78ca6e72630f68589839b98.jpg) +source semantics + +![](images/4455547741cadee20fab29fd42a5c90977e0a5d81cc572c00ed6c4480a6c76a5.jpg) +w/o attention +(b) + +![](images/072d43952a0d7547e1a41dd2b0de86ac9a5b74b5711fd238a1e8f2c52b2753b0.jpg) +with attention + +![](images/9c7dd2620ceb589ee492e22f0470f42a1b7e35a369f133edc8a10638739e0e8b.jpg) +ground-truth + +$\psi(x_i^s; x_i^s, x_i^\tau)$ (stage 1) or $\hat{y}_i^\tau = \psi(y_i^s; x_i^s, x_i^\tau)$ (stage 2). As illustrated in Fig. 4 (stage 1), we let $x_Q = x_i^\tau$ , $x_K = x_i^s$ and $x_V = x_i^s$ , which are lifted to query, key and value features through the following procedure: + +$$ +Q ^ {0} = \xi_ {Q} (x _ {Q}) [ \mathbf {1}; u _ {p o s}; v _ {p o s} ] +$$ + +$$ +K ^ {0} = \xi_ {K} (x _ {K}) [ {\bf 1}; u _ {p o s}; v _ {p o s} ] +$$ + +$$ +V ^ {0} = \xi_ {V} (x _ {V}) +$$ + +here $\xi_{Q},\xi_{K},\xi_{V}$ are separate encoders with strided convolutions to reduce the spatial dimensions of the features, and $u_{pos},v_{pos}$ are fixed positional encodings that represent the normalized image grids (horizontal and vertical), i.e., for coordinate $(m,n)$ we have $u_{pos}(m,n) = n / w,v_{pos}(m,n) = m / h$ , with $h$ and $w$ the height and width of the image. These lifted features are processed by $L$ of the proposed information transport layer: + +$$ +Q ^ {l} = \operatorname {F F N} _ {Q} ^ {l} \left(Q ^ {l - 1}\right) \tag {1} +$$ + +$$ +K ^ {l} = \operatorname {F F N} _ {K} ^ {l} \left(K ^ {l - 1}\right) \tag {2} +$$ + +$$ +\hat {V} ^ {l} = \operatorname {A T T N} \left(Q ^ {l - 1}, K ^ {l - 1}, V ^ {l - 1} W ^ {l}\right) \tag {3} +$$ + +$$ +\bar {V} ^ {l} = \mathrm {F F N} _ {V 1} ^ {l} (\hat {V} ^ {l}) + V ^ {l - 1} \tag {4} +$$ + +$$ +V ^ {l} = \operatorname {F F N} _ {V ^ {2}} ^ {l} (\bar {V} ^ {l}) + \bar {V} ^ {l} \tag {5} +$$ + +$$ +x _ {Q} ^ {l} = \xi_ {D} (V ^ {l}) \tag {6} +$$ + +where $\mathrm{FFN}_Q^l,\mathrm{FFN}_K^l$ are two feed-forward networks of downsampling and upsampling convolutional layers with. +layernorm to maintain the size of the updated keys and queries. And the feed-forward networks $\mathrm{FFN}_{V1}^{l},\mathrm{FFN}_{V2}^{l}$ are simply convolutional layers whose stride is equal to one. Using two $\mathrm{FFN}_V$ with skip connections can improve the convergence speed with a light network capacity increase. We ablate on update schemes of $K,Q$ in the experiments. Note, for each $V^l$ , we apply the shared decoder $\xi_{D}$ to map it to the image space, and $x_{Q}^{L}$ will be the final output of the proposed view transformation network $\psi$ + +Training loss and data augmentation. For training the network $\psi(x_V; x_K, x_Q)$ in Fig. 4 (stage 1), we apply color + +jittering to the input images. Specifically, the hue of $x_{i}^{s}, x_{i}^{\tau}$ are perturbed by a random factor to get $x_{Q}$ and $x_{K}$ , and by a different factor to get $\bar{x}_{Q}$ and $x_{V}$ , where $\bar{x}_{Q}$ is the expected output of $\psi(x_{V}; x_{K}, x_{Q})$ . Different hue perturbations can help prevent information leakage, since now $x_{Q}$ (input) and $\bar{x}_{Q}$ (expected output) are not identical, yet the consistency between $x_{V}$ and $\bar{x}_{Q}$ is preserved to enable meaningful hallucination. In addition, we apply the same color permutation to $x_{V}$ and $\bar{x}_{Q}$ , to further prevent information leakage from $x_{Q}$ to the output. More details can be found in the appendix. The training loss for $\psi$ is: + +$$ +\mathcal {L} ^ {\psi} = \sum_ {x _ {Q} \in \left\{\mathcal {D} ^ {\tau} \right\}} \sum_ {l = 1} ^ {L} \lambda_ {l} \left\| x _ {Q} ^ {l} - \bar {x} _ {Q} \right\| _ {1} \tag {7} +$$ + +with $\lambda_{l}$ the weighting coefficient for the $l$ -th layer's output $x_{Q}^{l}$ , which is decoded from $V^{l}$ , and we set $\lambda_{l} = 2^{-(L - l)}$ so that early predictions are weighted less. + +# 3.3. Functional label hallucination + +Given the trained $\psi$ , we can hallucinate the target semantic images for $x_{i}^{\tau}$ 's, i.e., $\hat{y}_{i}^{\tau} = \psi(x_{V}; x_{K}, x_{Q})$ , by setting $x_{Q} = x_{i}^{\tau}$ , $x_{K} = x_{i}^{s}$ and $x_{V} = y_{i}^{s}$ . We can then convert the hallucinated semantic images into semantic labels (integers) via nearest neighbor search in the color space to adapt the semantic segmentation network $(\phi)$ to the target domains. However, the converted labels sometimes could be wrong due to noise in the predicted color (Fig. 6 (3rd, 4th columns)). + +To resolve the ambiguities, we propose the following functional label hallucination by treating $\psi (\cdot ;x_i^s,x_i^\tau)$ as the functional representation of an unknown mapping $T(x_{i}^{s},x_{i}^{\tau}):\Omega_{s}\to \Omega_{\tau}$ conditioned on the color images $x_{i}^{s},x_{i}^{\tau}$ . Here $\Omega_s,\Omega_\tau$ represent the source and target image domains/grids. According to [32], if $T$ is a bijective mapping between $\Omega_s$ and $\Omega_{\tau}$ , the actual mapping $T$ can then be recovered from $\psi (\cdot ;x_i^s,x_i^\tau)$ by checking its output of indicator functions of the elements in $\Omega_s$ . However, recovering the underlying unknown mapping $T$ is unnecessary in our scenario, and, indeed, we do not have any constraints that $T$ is bijective. Instead, we utilize the functional representation $\psi (\cdot ;x_i^s,x_i^\tau)$ to find regions in $\Omega_{\tau}$ that share the same label with those in $\Omega_s$ . Let $\mathbf{1}_{y_i^s = c}$ be the indicator function of the regions that are classified as class $c$ , then $\hat{y}_{ic}^{\tau} = \psi (\mathbf{1}_{y_i^s = c};x_i^s,x_i^\tau)$ indicates the regions of class $c$ in $\Omega_{\tau}$ . And the hallucinated labels can be written as: + +$$ +\hat {y} _ {i} ^ {\tau} = \operatorname {s o f t m a x} \left(\psi \left(\mathbf {1} _ {y _ {i} ^ {s} = 1}; x _ {i} ^ {s}, x _ {i} ^ {\tau}\right), \dots , \psi \left(\mathbf {1} _ {y _ {i} ^ {s} = C}; x _ {i} ^ {s}, x _ {i} ^ {\tau}\right)\right) \tag {8} +$$ + +with $C$ the number of semantic classes, and now the hallucinated target view labels $\hat{y}_i^\tau$ represent the probabilistic distributions over the $C$ classes for each pixel. + +Adapting to target domains. With the functional hallucination strategy, we can avoid performing a nearest neighbor search in the color space, which improves the accuracy + +![](images/ecac8302202c042b4d733693d782ebd6204d3461b62fe09a891b8f261449a790.jpg) +Figure 6. Effectiveness of the proposed functional hallucination strategy. The target semantic images (3rd) are hallucinated from the source counterparts (2nd), which are decoded into semantic labels using nearest neighbor search (4th) or the proposed functional strategy (5th) with uncertainties (6th). + +![](images/4211224e3851a686e627c9c38b684bb5663e3fa751e0f8d3c1737f1b4cc2e8d1.jpg) + +of the generated labels even when the hallucinated color is noisy (Fig. 6 (5th column)). Moreover, the soft probabilistic labels (Fig. 6 (6th column)) are more suitable for adapting the semantic segmentation network $\phi$ to the target domains, avoiding errors of hard labels when the hallucination is of low confidence. We then finetune $\phi$ for each target domain using the target dataset $\mathcal{D}^{\tau} = \{(x_{i}^{\tau},\hat{y}_{i}^{\tau})\}$ augmented with the soft labels: + +$$ +\mathcal {L} ^ {\phi} = \sum_ {i} \mathbb {H} \left(\hat {y} _ {i} ^ {\tau}, \phi \left(x _ {i} ^ {\tau}\right)\right) \tag {9} +$$ + +where $\mathbb{H}$ is the cross-entropy between the network prediction and target pseudo labels. + +# 4. Experiments + +# 4.1. Data generation + +Due to the lack of benchmarks for evaluating UDA methods under viewpoint shifts, we propose a new dataset whose source and target domains are generated by varying camera elevation and viewing angles. Moreover, we explicitly control the viewpoint shifts, such that we can quantitatively assess the adaptation performance with respect to the degree of domain gaps. We resort to simulation for data collection since 1) it is much easier to obtain semantic segmentation ground-truth in simulation; 2) the degree of the domain gap caused by viewpoint change is more controllable; and 3) it is more friendly to the personnel who is in charge of the data collection given the pandemic. + +Furthermore, we maximize the realism of the generated data by employing the Matterport3D dataset [3], which contains 90 building-scale real-world scenes with pixel-wise semantic annotations2. The scenes from Matterport3D are then imported into the Habitat simulation platform [42] for our data generation. Specifically, we first randomly sample two states in the scene, with one state (the position and yaw angle of a virtual camera) representing the starting state, + +and the other the end state. We then perform collision-free path planning between these two states. The resulted path is accepted if it has a length larger than 15 path points, and images at each point along the path are collected. To synthesize the domain gaps, we set the pitch angle of the virtual camera to $0^{\circ}$ for collecting the source domain videos (annotations), which resembles the working viewpoint for semantic segmentation networks trained on existing scene parsing datasets [45, 47, 68]. Moreover, we increase the pitch angle of the virtual camera by $10^{\circ}$ (up to $90^{\circ}$ ) for collecting target domain videos (no annotations), which results in 9 different target domains. For each domain, we collect 13,500 training images and 2,700 test images with resolution $384 \times 512$ . Please see Fig. 7 for samples from the collected datasets. + +# 4.2. Implementation details + +We adapt the UNet structure [38] with reduced capacity and layernorm activation to construct the feed-forward networks $\mathrm{FFN}_Q$ and $\mathrm{FFN}_K$ . Similar to [62], $W$ is a convolutional layer with kernel size $1\times 1$ , $\mathrm{FFN}_{V1}$ , $\mathrm{FFN}_{V2}$ consist of one and two convolutional layers respectively. Both $\mathrm{FFN}_{V1}$ and $\mathrm{FFN}_{V2}$ use leakyrelu activation function. Network $\psi$ contains $L = 8$ attention modules. Training of $\psi$ is carried out on eight Nvidia V100 GPUs, with batch size 16. We use the Adam optimizer with an initial learning rate of 1e-4 and momentum of 0.9 and 0.999. The training converges after 10 epochs. We use the DeepLabv2 [5] with the ResNet101 backbone as the semantic segmentation network $\phi$ , which is initialized with the pre-trained weights on ImageNet [25,30,53,59,65]. Soft labels for each target view $\tau$ are hallucinated using Eq. (8). The semantic segmentation networks $\phi^{\tau}$ for each target domain are trained using Eq. (9) with the Adam optimizer, a batch size of 6 and an initial learning rate of 7.5e-5. The learning rate is then halved after 10 and 15 epochs. The training converges at 25 epochs. To have a fair comparison with the state-of-the-art domain adaptation methods that adapt from a single source domain to a single target domain, we also train the segmentation network for each target domain separately. We use mean intersection-over-union (mIoU) as the metric. + +# 4.3. Ablation study + +Effectiveness of the proposed inductive bias. Qualitative comparisons in Fig. 5 show that the proposed spatial transport inductive bias and the architecture facilitate zero-shot semantic image hallucination. In Tab. 1 we quantitatively confirm its effectiveness and check how it extends across different levels of viewpoint shift. Besides the color transformation bias ("UNet"), we also test the inductive biases introduced by explicitly modeling the dense 2D correspondence ("Flow") and by explicitly modeling the image + +![](images/94fa3a37d27321dde531217ff006923482c7af29f0ea306c24ed5fa0881b09a3.jpg) +Figure 7. Samples from the proposed dataset (one source and nine target domains) for benchmarking unsupervised domain adaptation methods under viewpoint shifts in semantic segmentation. + +
MethodTarget Domains
10°20°30°40°50°60°70°80°90°
UNet [38]49.7628.1913.699.266.564.712.591.631.28
Flow [48]33.0427.5922.7219.3617.0214.2111.559.678.34
RAFT [48]70.6261.2553.9242.5418.179.367.576.245.58
3D [57]28.1622.1218.3515.8013.1411.229.206.612.86
ADeLA(S)54.8546.2942.6637.7527.7121.3314.188.694.17
ADeLA(M)48.4241.8735.7330.3924.1117.4011.798.827.34
UNet+F [38]73.6249.0727.1220.0816.4813.6811.619.798.53
ADeLA(S)+F70.0767.6358.6254.3347.4537.8128.3919.7815.17
ADeLA(M)+F75.7566.2957.4549.5740.3830.0020.9615.4412.60
+ +Table 1. Ablation study on different inductive biases for zero-shot semantic image hallucination. Numbers are the mIoUs of the hallucinated semantic labels on the training set of each target domain. + +formation process in 3D ("3D"). For "Flow," we adapt the architecture of RAFT [48] and train it to estimate the flow that reconstructs the target color image from the source, and use the flow for warping the semantic labels. For "3D", we adapt the state-of-the-art single view synthesis framework [57], and supply it with ground-truth camera poses for semantic image synthesis. We report the performance of our method under two settings: the single source to single target setting ("ADeLA(S)"), and the the single source to multiple targets setting ("ADeLA(M)"). The labels for "ADeLA(S)" and "ADeLA(M)" are generated using the nearest neighbor search. We also report the score of the warped labels using the fully supervised RAFT model for reference. + +We can make the following observations: 1) "UNet" (color transformation) does not work at large viewpoint shifts. 2) the 2D dense correspondence inductive bias ("Flow") works better for large viewpoint shifts, which verifies our proposal for biasing towards transportation. However, the comparison between "Flow" and "RAFT" shows that the spatial correspondence learned from color images can be erroneous, so "Flow" is much worse than "RAFT" at small viewpoint changes. Moreover, "RAFT" is worse than "Flow" at large viewpoint shifts, which indicates that the exact dense correspondence may not be suitable for semantic label hallucination. 3) The 3D inductive bias ("3D") + +does not perform well since the learned 3D representation from color images does not generalize to semantic images. 4) Our model performs well across all target domains, due to the proposed spatial transportation bias, and the capability to hallucinate beyond exact correspondence. + +Moreover, we show the quality of the semantic labels hallucinated using the proposed functional label hallucination strategy ("UNet+F," "ADeLA(S)+F," "ADeLA(M)+F"). As seen in Tab. 1 (bottom), functional hallucination significantly improves the performance of UNet and our models, demonstrating its effectiveness in resolving the ambiguities in the hallucinated semantic images. Note, "Flow" and RAFT warp labels with explicit dense correspondence, thus they are unable to take advantage of the functional strategy. The same observation holds for "3D", whose 3D representation learned with color images does not generalize even with ground-truth camera poses. + +Effectiveness of the update scheme for $K, Q$ . We conduct experiments to investigate different $K, Q$ update schemes. The information transport layer uses UNet structures $\mathrm{FFN}_K$ and $\mathrm{FFN}_Q$ to update $K, Q$ . To check the effectiveness of the UNet structure, which performs spatial downsampling and upsampling (feature resolution preserved), we replace them with several 1x1 convolutions with the same capacity to maintain the spatial resolution and update $K, Q$ . Also, to confirm the need for updates in $K, Q$ , we remove all $\mathrm{FFN}_K$ and $\mathrm{FFN}_Q$ modules in our model so that $K, Q$ do not change across different layers. As shown in Tab. 2, there is a significant performance drop if we replace the proposed UNet structure with other options. These experiments confirm that updating $K, Q$ is necessary, and introducing spatial downsampling and upsampling while updating $K, Q$ is not only more computationally efficient but can also improve the accuracy. + +Number of information transport layers. We experiment with the number $L$ of information transport layers in the view transformation network on source domain $0^{\circ}$ and target domain $30^{\circ}$ . The results are reported in Tab. 3. Users + +![](images/181d917296aaf3d86de5378c4bf8232ab46bd390feb31f71e0ec1e0fbfc784e6.jpg) +Figure 8. Qualitative comparison with competing methods on different target domains. RAFT [48], FDA [59], and CAG [65]. + +
K, Q update schemeUNet1x1 convsno update
mIoU42.738.433.4
+ +Table 2. Comparison between different $K$ , $Q$ update schemes with source domain $0^{\circ}$ and target domain $30^{\circ}$ . + +
L13578
mIoU35.2439.7340.2741.9342.66
#Params15.8M34.8M53.8M72.8M82.3M
FPS20.7116.8813.0510.649.68
+ +Table 3. Effects of the number of information transport layers. + +
TypeTarget Domains
10°20°30°40°50°60°70°80°90°
Soft31.9128.4924.3121.3416.4212.929.747.925.37
Hard30.3426.6323.4520.2316.1912.749.697.685.99
+ +can adjust $L$ for a trade-off between the label quality and label hallucination speed based on their actual budget. + +Effectiveness of soft labels for training $\phi$ . We experiment with both soft and hard labels for training the segmentation network $\phi$ . The results are shown in Tab. 4. Soft labels outperform hard labels across different viewpoint shifts, which demonstrates the effectiveness of the estimated uncertainties as analyzed in Sec.3.3. + +# 4.4. Benchmarking + +We carry out an extensive study of state-of-the-art methods in reducing performance drops caused by viewpoint shifts on semantic segmentation [22, 23, 25, 30, 33, 53, 59, 64, 65]. The benchmarking is reported in Tab. 5. Among those methods, [25, 64] focus on self-training, [30, 33, 65] perform class-wise and curriculum domain alignment, and [23, 53, 59] align domains in the image/output space. We also experiment with three best performing dense correspondence estimation methods [48, 54, 67], and two single view synthesis methods [57, 70] to generate target view labels to help adapt the segmentation networks. All methods are re-trained on the training sets of the proposed benchmark, and tested on the test sets of the nine target domains. Our method consistently achieves positive adaptation gain and performs much better than the other methods at large viewpoint shifts. Note that FDA [59] performs better on the target domain of $10^{\circ}$ (small gap) due to its strong style randomization mechanism. However, our method surpasses + +Table 4. Effects of using soft and hard labels for training $\phi$ . + +
TypeMethodTarget Domains
10°20°30°40°50°60°70°80°90°
BaselineTarget Only33.2231.3430.3529.4527.1825.7025.8524.9324.12
Source Only27.9020.2412.227.634.412.531.801.531.53
UNet [38]30.5122.3612.268.446.584.803.812.982.22
Dense Corresp. Est.RAFT [48]29.4626.7424.1516.928.664.543.352.822.41
MFNet [67]29.2024.5313.166.654.763.953.002.812.48
DICL [54]29.6226.4522.0117.756.254.443.402.752.49
UDA (unpaired)ProDA [64]25.2619.3512.037.464.391.741.120.830.77
CLAN [30]28.2221.2113.177.534.372.662.021.741.73
CAG [65]27.1722.2215.058.575.242.431.831.501.54
FDA [59]37.8023.3412.336.693.582.151.561.671.32
PLCA [22]26.8319.0412.427.795.373.382.492.211.93
LTIR [23]26.2220.5013.436.163.902.091.821.651.66
CCM [25]28.2619.4810.564.922.781.501.140.950.90
Advent [53]11.387.934.983.282.542.161.601.521.49
Intrada [33]10.167.846.134.082.671.981.581.670.93
UDA (paired)ProDA [64]20.6117.8210.386.714.111.851.110.910.90
CLAN [30]25.4118.3310.615.913.372.191.711.571.58
CAG [65]23.4818.5512.348.064.331.831.591.471.57
FDA [59]30.8316.4611.396.93.692.171.741.841.69
PLCA [22]24.8619.4912.368.635.523.702.842.262.04
Novel View Syn.AppFlow [70]14.7312.9110.468.437.305.684.663.873.39
Synsin [57]14.4311.449.158.296.245.434.673.361.88
Info. Trans. ADeLA31.9128.4924.3121.3416.4212.929.747.925.37
+ +Table 5. Quantitative comparison to state-of-the-art methods on the proposed benchmark. Numbers are mIoU scores on the test set of each target domain. + +FDA on the remaining target domains without any data augmentation in adapting the segmentation network. In order to verify if the temporally aligned data is beneficial for other methods, we select the top UDA methods and train them also on paired source and target images. The results in Tab. 5 show that the performance of these UDA methods even degrades compared to their unpaired counterparts. This concludes that the comparison is fair and comprehensive. Please see Fig. 8 for visual results. + +# 5. Discussion + +We tackle the performance drop caused by viewpoint shifts in semantic segmentation. Experiments verify that aligning statistics between domains in a shared space could be detrimental due to the content shift across different viewing angles. Our method achieves higher adaptation gains, especially at large viewpoint shifts. However, the adaptation gain of our method also decreases towards the extreme case. In our code release, we will specify allowable uses of our system with appropriate licenses to address potential ethical and societal concerns. In the future, we would like to explore the use of temporal information to further reduce the performance drop caused by extreme viewpoint shifts. + +# 6. Acknowledgement + +This work was supported by the National Key R&D Program of China (No. 2018YFE0100900), a grant from the Stanford HAI Institute, a Vannevar Bush faculty fellowship, and a gift from the Adobe Corporation. + +# References + +[1] Slawomir Bak, Peter Carr, and Jean-Francois Lalonde. Domain adaptation through synthesis for unsupervised person re-identification. In Proceedings of the European Conference on Computer Vision (ECCV), pages 189–205, 2018. 2 +[2] Mahsa Baktashmotlagh, Mehrtash T Harandi, Brian C Lovell, and Mathieu Salzmann. Unsupervised domain adaptation by domain invariant projection. In Proceedings of the IEEE International Conference on Computer Vision, pages 769-776, 2013. 2 +[3] 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. arXiv preprint arXiv:1709.06158, 2017. 6 +[4] Wei-Lun Chang, Hui-Po Wang, Wen-Hsiao Peng, and Wei-Chen Chiu. All about structure: Adapting structural information across domains for boosting semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1900-1909, 2019. 2 +[5] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4):834-848, 2017. 6 +[6] Inchang Choi, Orazio Gallo, Alejandro Troccoli, Min H Kim, and Jan Kautz. Extreme view synthesis. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7781-7790, 2019. 3 +[7] Remi Tachet des Combes, Han Zhao, Yu-Xiang Wang, and Geoff Gordon. Domain adaptation with conditional distribution matching and generalized label shift. arXiv preprint arXiv:2003.04475, 2020. 2 +[8] Benjamin Coors, Alexandru Paul Condurache, and Andreas Geiger. Nova: Learning to see in novel viewpoints and domains. In 2019 International Conference on 3D Vision (3DV), pages 116-125. IEEE, 2019. 2, 3 +[9] Gabriela Csurka. A comprehensive survey on domain adaptation for visual applications. In Domain adaptation in computer vision applications, pages 1-35. Springer, 2017. 2 +[10] Weijian Deng, Liang Zheng, Qixiang Ye, Guoliang Kang, Yi Yang, and Jianbin Jiao. Image-image domain adaptation with preserved self-similarity and domain-dissimilarity for person re-identification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 994–1003, 2018. 2 +[11] Daniele Di Mauro, Antonino Furnari, Giuseppe Patanè, Sebastiano Battiato, and Giovanni Maria Farinella. Sceneadapt: Scene-based domain adaptation for semantic segmentation using adversarial learning. Pattern Recognition Letters, 2020. 2 +[12] Jiahua Dong, Yang Cong, Gan Sun, Yuyang Liu, and Xiaowei Xu. Cscl: Critical semantic-consistent learning for unsupervised domain adaptation. In European Conference on Computer Vision, pages 745-762. Springer, 2020. 2 +[13] Liang Du, Jingang Tan, Hongye Yang, Jianfeng Feng, Xi-angyang Xue, Qibao Zheng, Xiaqing Ye, and Xiaolin + +Zhang. Ssf-dan: Separated semantic feature based domain adaptation network for semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 982-991, 2019. 2 +[14] Basura Fernando, Amaury Habrard, Marc Sebban, and Tinne Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In Proceedings of the IEEE international conference on computer vision, pages 2960-2967, 2013. 2 +[15] John Flynn, Michael Broxton, Paul Debevec, Matthew DuVall, Graham Fyffe, Ryan Overbeck, Noah Snavely, and Richard Tucker. Deepview: View synthesis with learned gradient descent. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2367-2376, 2019. 3 +[16] Yang Fu, Yunchao Wei, Guanshuo Wang, Yuqian Zhou, Honghui Shi, and Thomas S Huang. Self-similarity grouping: A simple unsupervised cross domain adaptation approach for person re-identification. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6112–6121, 2019. 2 +[17] Bo Geng, Dacheng Tao, and Chao Xu. Daml: Domain adaptation metric learning. IEEE Transactions on Image Processing, 20(10):2980-2989, 2011. 2 +[18] Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th international conference on machine learning (ICML-11), pages 513–520, 2011. 2 +[19] Rui Gong, Wen Li, Yuhua Chen, and Luc Van Gool. Dlow: Domain flow for adaptation and generalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2477-2486, 2019. 2 +[20] 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 Proceedings of the 35th International Conference on Machine Learning, 2018. 2, 3 +[21] Jiaxing Huang, Shijian Lu, Dayan Guan, and Xiaobing Zhang. Contextual-relation consistent domain adaptation for semantic segmentation. In European Conference on Computer Vision, pages 705-722. Springer, 2020. 2 +[22] Guoliang Kang, Yunchao Wei, Yi Yang, Yueting Zhuang, and Alexander G. Hauptmann. Pixel-level cycle association: A new perspective for domain adaptive semantic segmentation. In Advances in neural information processing systems, 2020. 2, 8 +[23] Myeongjin Kim and Hyeran Byun. Learning texture invariant representation for domain adaptation of semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12975-12984, 2020. 2, 3, 8 +[24] Abhishek Kumar, Prasanna Sattigeri, Kahini Wadhawan, Leonid Karlinsky, Rogerio Feris, Bill Freeman, and Gregory Wornell. Co-regularized alignment for unsupervised domain adaptation. In Advances in Neural Information Processing Systems, pages 9345–9356, 2018. 2 + +[25] Guangrui Li, Guoliang Kang, Wu Liu, Yunchao Wei, and Yi Yang. Content-consistent matching for domain adaptive semantic segmentation. In European Conference on Computer Vision, pages 440-456. Springer, 2020. 2, 3, 6, 8 +[26] Yunsheng Li, Lu Yuan, and Nuno Vasconcelos. Bidirectional learning for domain adaptation of semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6936-6945, 2019. 2 +[27] 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. 2 +[28] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In International Conference on Machine Learning, pages 97-105, 2015. 2 +[29] Yawei Luo, Ping Liu, Tao Guan, Junqing Yu, and Yi Yang. Significance-aware information bottleneck for domain adaptive semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pages 6778-6787, 2019. 2 +[30] Yawei Luo, Liang Zheng, Tao Guan, Junqing Yu, and Yi Yang. Taking a closer look at domain shift: Category-level adversaries for semantics consistent domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2507-2516, 2019. 2, 3, 6, 8 +[31] Saeid Motiian, Marco Piccirilli, Donald A Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In Proceedings of the IEEE International Conference on Computer Vision, pages 5715-5725, 2017. 2 +[32] Maks Ovsjanikov, Mirela Ben-Chen, Justin Solomon, Adrian Butscher, and Leonidas Guibas. Functional maps: a flexible representation of maps between shapes. ACM Transactions on Graphics (TOG), 31(4):1-11, 2012. 5 +[33] Fei Pan, Inkyu Shin, Francois Rameau, Seokju Lee, and In So Kweon. Unsupervised intra-domain adaptation for semantic segmentation through self-supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3764-3773, 2020. 2, 8 +[34] Vishal M Patel, Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Visual domain adaptation: A survey of recent advances. IEEE signal processing magazine, 32(3):53-69, 2015. 2 +[35] Xingchao Peng, Ben Usman, Neela Kaushik, Judy Hoffman, Dequan Wang, and Kate Saenko. Visda: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924, 2017. 3 +[36] Xingchao Peng, Ben Usman, Kuniaki Saito, Neela Kaushik, Judy Hoffman, and Kate Saenko. Syn2real: A new benchmark for synthetic-to-real visual domain adaptation. arXiv preprint arXiv: 1806.09755, 2018. 3 +[37] Hossein Rahmani, Ajmal Mian, and Mubarak Shah. Learning a deep model for human action recognition from novel viewpoints. IEEE transactions on pattern analysis and machine intelligence, 40(3):667-681, 2017. 2 + +[38] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234-241. Springer, 2015. 4, 6, 7, 8 +[39] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In European conference on computer vision, pages 213-226. Springer, 2010. 3 +[40] Kuniaki Saito, Yoshitaka Ushiku, and Tatsuya Harada. Asymmetric tri-training for unsupervised domain adaptation. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 2988-2997. JMLR.org, 2017. 2 +[41] Swami Sankaranarayanan, Yogesh Balaji, Arpit Jain, Ser Nam Lim, and Rama Chellappa. Learning from synthetic data: Addressing domain shift for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3752-3761, 2018. 2 +[42] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9339-9347, 2019. 6 +[43] Ozan Sener, Hyun Oh Song, Ashutosh Saxena, and Silvio Savarese. Learning transferrable representations for unsupervised domain adaptation. In Advances in Neural Information Processing Systems, pages 2110-2118, 2016. 2 +[44] Rui Shu, Hung H Bui, Hirokazu Narui, and Stefano Ermon. A dirt-t approach to unsupervised domain adaptation. In Proc. 6th International Conference on Learning Representations, 2018. 2 +[45] N. Silberman and R. Fergus. Indoor scene segmentation using a structured light sensor. In Proceedings of the International Conference on Computer Vision - Workshop on 3D Representation and Recognition, 2011. 6 +[46] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. arXiv preprint arXiv:1906.01618, 2019. 3 +[47] Shuran Song, Samuel P Lichtenberg, and Jianxiong Xiao. Sun rgb-d: A rgb-d scene understanding benchmark suite. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 567-576, 2015. 6 +[48] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In European Conference on Computer Vision, pages 402-419. Springer, 2020. 3, 7, 8 +[49] Yi-Hsuan Tsai, Kihyuk Sohn, Samuel Schulter, and Manmohan Chandraker. Domain adaptation for structured output via discriminative patch representations. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1456-1465, 2019. 2 +[50] Richard Tucker and Noah Snively. Single-view view synthesis with multiplane images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 551-560, 2020. 3 + +[51] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7167-7176, 2017. 2 +[52] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Ilia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. 4 +[53] Tuan-Hung Vu, Himalaya Jain, Maxime Bucher, Matthieu Cord, and Patrick Pérez. Advent: Adversarial entropy minimization for domain adaptation in semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2517-2526, 2019. 2, 3, 6, 8 +[54] Jianyuan Wang, Yiran Zhong, Yuchao Dai, Kaihao Zhang, Pan Ji, and Hongdong Li. Displacement-invariant matching cost learning for accurate optical flow estimation. arXiv preprint arXiv:2010.14851, 2020. 3, 8 +[55] Mei Wang and Weihong Deng. Deep visual domain adaptation: A survey. Neurocomputing, 312:135-153, 2018. 2 +[56] Zhonghao Wang, Mo Yu, Yunchao Wei, Rogerio Feris, Jinjun Xiong, Wen-mei Hwu, Thomas S Huang, and Honghui Shi. Differential treatment for stuff and things: A simple unsupervised domain adaptation method for semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12635-12644, 2020. 2 +[57] Olivia Wiles, Georgia Gkioxari, Richard Szeliski, and Justin Johnson. Synsin: End-to-end view synthesis from a single image. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7467-7477, 2020. 3, 7, 8 +[58] Zuxuan Wu, Xintong Han, Yen-Liang Lin, Mustafa Gokhan Uzunbas, Tom Goldstein, Ser Nam Lim, and Larry S Davis. Dcan: Dual channel-wise alignment networks for unsupervised scene adaptation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 518-534, 2018. 2 +[59] Yanchao Yang and Stefano Soatto. Fda: Fourier domain adaptation for semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4085-4095, 2020. 2, 3, 6, 8 +[60] 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. 2 +[61] Werner Zellinger, Thomas Grubinger, Edwin Lughofer, Thomas Natschlager, and Susanne Saminger-Platz. Central moment discrepancy (cmd) for domain-invariant representation learning. arXiv preprint arXiv:1702.08811, 2017. 2 +[62] Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In The Proceedings of the European Conference on Computer Vision (ECCV), 2020. 6 +[63] Pengfei Zhang, Cuiling Lan, Junliang Xing, Wenjun Zeng, Jianru Xue, and Nanning Zheng. View adaptive recurrent neural networks for high performance human action recognition from skeleton data. In Proceedings of the IEEE Inter- + +national Conference on Computer Vision, pages 2117-2126, 2017. 2 +[64] Pan Zhang, Bo Zhang, Ting Zhang, Dong Chen, Yong Wang, and Fang Wen. Prototypical pseudo label denoising and target structure learning for domain adaptive semantic segmentation. arXiv preprint arXiv:2101.10979, 2, 2021. 2, 3, 8 +[65] Qiming Zhang, Jing Zhang, Wei Liu, and Dacheng Tao. Category anchor-guided unsupervised domain adaptation for semantic segmentation. arXiv preprint arXiv:1910.13049, 2019. 2, 3, 6, 8 +[66] Yang Zhang, Philip David, and Boqing Gong. Curriculum domain adaptation for semantic segmentation of urban scenes. In Proceedings of the IEEE International Conference on Computer Vision, pages 2020-2030, 2017. 2 +[67] Shengyu Zhao, Yilun Sheng, Yue Dong, Eric I Chang, Yan Xu, et al. Maskflownet: Asymmetric feature matching with learnable occlusion mask. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6278-6287, 2020. 3, 8 +[68] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. 6 +[69] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. arXiv preprint arXiv:1805.09817, 2018. 3 +[70] Tinghui Zhou, Shubham Tulsiani, Weilun Sun, Jitendra Malik, and Alexei A Efros. View synthesis by appearance flow. In European conference on computer vision, pages 286-301. Springer, 2016. 3, 8 +[71] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223-2232, 2017. 2 \ No newline at end of file diff --git a/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/images.zip b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..79b262b1550dbcf366e7ced28618e2fe5c56da8a --- /dev/null +++ b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69f1f31f66a6926c23aeb6874d76b39c7bb2efe475c7302c0edf7e7ae4235b82 +size 673008 diff --git a/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/layout.json b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3ef6d5ace7598c567588bccbda69d38f595271b5 --- /dev/null +++ b/adelaautomaticdenselabelingwithattentionforviewpointshiftinsemanticsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c46a830c4c7b82083f31897bc2ed157cff40f7fff8ce1b23718a6e155b766ec9 +size 551642 diff --git a/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_content_list.json b/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..479cd27cbd625764023b9b0bca3f3ecabe37a327 --- /dev/null +++ b/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e7791108b277ce81707b58d5a43fca51658dafadbeb3b3aae19b46ab3234567 +size 87437 diff --git a/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_model.json b/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8e5a7cfe3ede73e08d868b4fd6f64d2a4703850b --- /dev/null +++ b/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2574d528ef5147467febec8909e4c7077498b7256e93fa54df6f6220b4d5b464 +size 108710 diff --git a/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_origin.pdf b/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a566b5c6dfcad4f7d18aa6081b976c50e01fdcf4 --- /dev/null +++ b/adiabaticquantumcomputingformultiobjecttracking/227ee47d-37de-4a4b-88cf-846edabde9f4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dc18f00afe99a6b8bd16db5d2689993a12253ad7d23922749404465cb517d4b +size 637965 diff --git a/adiabaticquantumcomputingformultiobjecttracking/full.md b/adiabaticquantumcomputingformultiobjecttracking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..08a1d5d32bff6e935e382fb524b86d11e5c3d411 --- /dev/null +++ b/adiabaticquantumcomputingformultiobjecttracking/full.md @@ -0,0 +1,387 @@ +# Adiabatic Quantum Computing for Multi Object Tracking + +Jan-Nico Zaech1 Alexander Liniger1 Martin Danelljan1 Dengxin Dai1,2 Luc Van Gool1,3 +1Computer Vision Laboratory, ETH Zurich, Switzerland, +2MPI for Informatics, Saarbrucken, Germany, 3KU Leuven, Belgium +{zaechj,alex.liniger,martin.denelljan,dai,vangool}@vision.ee.ethz.ch + +# Abstract + +Multi-Object Tracking (MOT) is most often approached in the tracking-by-detection paradigm, where object detections are associated through time. The association step naturally leads to discrete optimization problems. As these optimization problems are often NP-hard, they can only be solved exactly for small instances on current hardware. Adiabatic quantum computing (AQC) offers a solution for this, as it has the potential to provide a considerable speedup on a range of NP-hard optimization problems in the near future. However, current MOT formulations are unsuitable for quantum computing due to their scaling properties. In this work, we therefore propose the first MOT formulation designed to be solved with AQC. We employ an Ising model that represents the quantum mechanical system implemented on the AQC. We show that our approach is competitive compared with state-of-the-art optimization-based approaches, even when using of-the-shelf integer programming solvers. Finally, we demonstrate that our MOT problem is already solvable on the current generation of real quantum computers for small examples, and analyze the properties of the measured solutions. + +# 1. Introduction + +Multi-Object Tracking (MOT) is a task in computer vision that requires solving NP-hard assignment problems [29,30,50]. To make this feasible, the community proposed a range of different approaches: work on the problem formulation using domain knowledge helps to make it an easier to solve problem [29,50], approximate solvers extend the feasible problem size [30], and the combination of deep learning with simple heuristics can be seen as a data-driven approach to the problem [8, 12]. Nevertheless, integer assignment problems remain hard optimization tasks for any available solver. With the recent progress in quantum computing, a new way of solving such optimization problems becomes feasible in the near future [1, 36, 51]. + +Instead of iteratively exploring possible solutions, e.g. + +![](images/7cebdb02f64619d573f1ccbfd01a39d25eb7427a401b66f4b5574d30ab08b1a7.jpg) +Figure 1. The proposed approach to MOT states the assignment problem between detections and a set of tracks as a quadratic unconstrained binary optimization task. We then represent the optimization problem as a quantum mechanical system that can be implemented on an AQC. Via quantum annealing, a minimum energy state is found that represents the best assignment. + +via branch and bound, the problem is mapped to a quantum mechanical system, whose energy is equivalent to the cost of the optimization problem. Therefore, if it is possible to measure the lowest energy state of the system, a solution to the corresponding optimization problem is found. This is done with an adiabatic quantum computer (AQC), which implements a quantum mechanical system made from qubits and can be described by the Ising model [31]. Using this approach, a quantum speedup, which further + +scales with system size and temperature, has already been shown for applications in physics [35, 36]. + +While there is a range of advantages that quantum computing can provide in the future, mapping a problem to an AQC is not trivial and often requires reformulating the problem from scratch, even for well investigated tasks [4,6]. On the one hand, the problem needs to be matched to the Ising model, on the other hand, real quantum computers have a very limited number of qubits and are still prone to noise, which requires tuning of the model to handle the limitations. + +In this work we present the first quantum computing approach to MOT. The number of required qubits in our formulation grows linearly in the number of detections, tracks and timesteps and only requires entanglement between qubits to model long-term relations. Our overall contributions are the following: + +- A quantum computing formulation of MOT that is competitive with state-of-the-art methods. +- A method using few problem measurements to find Lagrange multipliers that considerably improve solution probability. +- Extensive MOT experiments on synthetic as well as real data using a D-wave AQC. + +The remaining paper is structured as follows: After presenting related work, the basics of quantum computing are introduced. This is followed by our MOT formulation that is optimized to run on an AQC. We then show the changes required to make the problem solvable also with the classical computing paradigm. Finally, experiments on a D-wave quantum computer are presented together with results on larger problem instances. + +# 2. Related Work + +Quantum computing applications have recently started to emerge across a range of fields that rely on discrete optimization, as adiabatic quantum computers have become accessible. The applications include examples such as gene engineering [21], interaction reconstruction in particle physics [13], traffic flow optimization [44], or route selection in robotics [45]. In computer vision, discrete optimization is a ubiquitous part of many applications. While these applications frequently rely on heuristics today, quantum computing has the potential to provide an efficient way of directly solving them. In the area of 3D vision, quantum computing has been used by Feld et al. [19] for optimizing geometry compression. Benkner et al. [3] use adiabatic quantum computing to match 3D shapes and images with permutation matrices and investigate different constraint formulations to optimize the probability of finding a correct solution. By using an iterative approach, the same authors are able to scale the approach up to larger problem instances [4]. Closest to our work is the contribution of + +Birdal et al. [6]. They map the permutation synchronization task to an optimization problem solvable on a quantum computer and show results on small problem instances. + +Multi-object tracking describes the problem of tracking all objects belonging to a predefined set of object types in 2D [14, 38, 41, 43] or 3D [10, 11, 23]. Most competitive trackers follow a tracking by detection approach, where a set of detections is given in every frame and the trackers perform association between frames, interpolation of occlusions, and rejection of false-positive detections. While most approaches use deep learning to generate appearance features [47, 52, 56, 57], two major groups of data assignment approaches exist. The first one maps the matching step to a deep learning task [8, 12, 55, 59] and uses simple heuristics to resolve the remaining inconsistencies. This allows for training the complete pipeline end-to-end, without the direct requirement to define a cost for data association. The second group directly performs data association using discrete optimization algorithms [29, 30, 39, 46, 48, 50], which is stated as a network flow optimization problem in most cases. These formulations allow to include long-term relations [29], and prior information about the nature of tracks in an intuitive and transparent way. Nevertheless, these properties come at a high computational cost. As most of the proposed optimization problems are NP-hard [22], a considerable effort was invested in finding heuristics and approximate solvers for them [30]. + +# 3. Preliminaries on Quantum Computing + +Quantum computers are systems operating in a state that is described by its quantum properties, such as superposition and entanglement. By exploiting these properties, a range of problems that quickly grow in complexity on classical computers and thus, cannot be solved in any reasonable timeframe, could be solved considerably faster [20] by a quantum computer. Reaching such a point is widely referred to as quantum primacy. Even though implementations of quantum computers are still heavily experimental, some problems have already been shown to profit from them, including the sampling of pseudo-random quantum circuits [2, 53] and Gaussian boson sampling [58]. + +Qubits are two-state quantum-mechanical systems that form the basis of quantum computers. Like a bit, a qubit has two basis states $|0\rangle = [10]^T$ and $|1\rangle = [01]^T$ that in a superposition form the qubit's state. Qubits can be realized with a wide range of approaches, including superconducting circuits, ions trapped in an electromagnetic field, or photons. + +Quantum Superposition refers to the property of a quantum system that it is not required to be in one of the basis states, but rather can be described by a linear combination of possible basis states. A qubit in a pure state $|\psi \rangle$ can be + +described with its two basis states $\{|0\rangle, |1\rangle\}$ as + +$$ +| \psi \rangle = c _ {1} | 0 \rangle + c _ {2} | 1 \rangle \tag {1} +$$ + +where $c_{1}$ and $c_{2}$ are complex numbers, called probability amplitudes, with $|c_1|^2 +|c_2|^2 = 1$ + +Measurement of a qubit state results in one of the basis states $\{|0\rangle, |1\rangle\}$ . The probability of measuring $|0\rangle$ and $|1\rangle$ evaluates to $|c_1|^2$ and $|c_2|^2$ , respectively [28]. As a measurement corresponds to an observation of the qubit it leads to wave function collapse, which means that the qubit state is changed irreversibly [24]. + +Entanglement of qubits is at the very heart of quantum computing [32]. A system of entangled qubits is represented by a system state where each qubit cannot be described only with its own state but depends on the state of the remaining system [17,27,37,40,49]. Thus, measuring a single qubit can collapse the wave function of other entangled qubits, which alters their state and therefore, also their measurement outcome [24]. + +# 3.1. Adiabatic Quantum Computing + +Adiabatic quantum computing [18, 51] is an approach that, instead of using gates as unitary operations on subsets of the available qubits [15], uses a problem Hamiltonian $\hat{H}_P$ that describes the operation applied on all qubits simultaneously. The problem Hamiltonian is designed such that its ground-state, which is the lowest energy configuration of the system, represents the result for a computational task [1]. In general, a Hamiltonian $\hat{H}(t)$ is an operator that represents the energy of a quantum system and can be used in the Schrödinger equation to describe the system's evolution over time as + +$$ +i \hbar \frac {\partial}{\partial t} | \psi (t) \rangle = \hat {H} (t) | \psi (t) \rangle , \tag {2} +$$ + +where $i$ is the imaginary unit, and $\hbar$ the reduced Planck constant. + +As the ground-state of the problem Hamiltonian is hard to find, the complete system is initialized with an initial Hamiltonian $\hat{H}_B$ that has an easy to prepare groundstate [18]. The system's Hamiltonian is then slowly evolved over an annealing time $T$ to the problem Hamiltonian in an adiabatic transition [7,34] + +$$ +\hat {H} (t) = \left(1 - t / T\right) \hat {H} _ {B} + t / T \hat {H} _ {P}, \tag {3} +$$ + +which is a transition where the system stays in its basis state. This process is called quantum annealing and needs to be repeated for multiple measurements, as in a noisy system, not all solutions have the lowest energy. The condition for a sufficiently slow evolution depends mostly on two factors, the temperature of the environment and the spectral gap of the Hamiltonian, i.e. the difference between lowest + +and second-lowest energy level or eigenvalue. While the first is a system property, the second can be influenced by choosing a suitable Hamiltonian [3]. + +The Hamiltonian describing current adiabatic quantum computers such as the $D$ -wave advantage, is based on the Ising model [33]. The Ising model uses the Hamiltonian + +$$ +\hat {H} _ {i s i n g} = \sum_ {i, j} J _ {i, j} \sigma_ {i} \sigma_ {j} + \sum_ {i} h _ {i} \sigma_ {i}, \tag {4} +$$ + +where $\sigma \in \{-1, + 1\}$ corresponds to the spin of a particle, $J_{i,j}$ represent the interaction between two particles and $h_i$ is an external magnetic field. In an adiabatic quantum computer, the particles' spins are represented by the qubit states and the interactions and external field correspond to the couplings. The lowest energy of the Ising model is equivalent to solving the associated quadratic unconstrained binary optimization (QUBO) + +$$ +\underset {\mathbf {z}} {\arg \min } \mathbf {z} ^ {T} \mathbf {Q} \mathbf {z} + b ^ {T} \mathbf {z}, \tag {5} +$$ + +which is NP-hard and known to be very challenging for classical solver. As this task can directly be implemented on an adiabatic quantum computer, a considerable speedup for large problem instances is expected in the future. + +# 4. Quantum MOT + +Most existing optimization-based approaches to MOT aim at finding feasible relaxations [30], implement efficient heuristics in the solution approach [29] or use deep learning together with post-processing [8] to solve the assignment problem. With the considerable amount of work invested into them, the problem became solvable for growing instances by now. Nevertheless, the assignment problem stays an NP-hard task to solve and growth is thus limited. Quantum computing with the associated speedup on hard problems can provide a solution to this challenge, even if the corresponding optimization problem is much harder to solve with classical approaches at the moment. However, representing tasks in a form suitable for quantum computing often requires a completely new formulation of the problem and MOT is not different in this aspect. + +While widely used flow formulations [29,30,39] are suitable for exploiting sparsity, they come with a large set of inequality constraints, which makes them intractable on near-future quantum computers that are limited in the number of qubits. In this context, permutation matrices were shown to be a powerful tool for synchronization or shape matching [3,4,6]. In the following, we therefore propose a formulation based on assignment matrices that grows linearly in the number of required qubits for detections, tracks and frames. Furthermore, it allows to model long-term connections with terms in the cost-matrix that do not require additional qubits. + +MOT Formulation. We approach the MOT problem following the tracking by detection paradigm and use a fixed set of available tracks. Given a set of detections in each frame of a video, appearance features are extracted for each detection. By using a multi-layer Perceptron, pairwise appearance similarities between detections at different timesteps are computed [30]. Starting with this, the goal of the tracking algorithm is to assign each detection to a track, such that the sum of the similarities of detections assigned to a single track is maximized. In this context, a track is defined by its track ID $t$ and each detection in a frame $f$ by its detection ID $d$ . + +We formulate the given task of assigning detections to a joint set of tracks using assignment matrices, which relax the assumptions of permutation matrices. The binary assignment matrix $\mathbf{X}_f$ for a frame $f$ maps a vector of detection indices to a vector of tracks at every frame of a video. The elements $x_{dt} \in \{0,1\}$ of the assignment matrix represent the connections between detections $d$ and tracks $t$ . Given $D - 1$ detections and $T - 1$ tracks, the assignment matrix assigns a detection to a track if $x_{dt} = 1$ . The requirement that a single detection is assigned to a track at one timestep, leads to the constraint + +$$ +\sum_ {d = 1} ^ {D} x _ {d t} = 1 \quad \forall t \in \{1, \dots , T - 1 \}. \tag {6} +$$ + +And reversely, Equation 7 asserts that every detection is assigned to a single track + +$$ +\sum_ {t = 1} ^ {T} x _ {d t} = 1 \quad \forall d \in \{1, \dots , D - 1 \}. \tag {7} +$$ + +To allow for false-positive detections as well as to handle the case of fewer detections than available tracks, one dummy-detection and one dummy-track, with the respective indices $D$ and $T$ , are introduced. A detection assigned to the dummy-track is treated as a false positive and a track that got the dummy-detection assigned to it is inactive or occluded. As the dummy-track and dummy-detection may be assigned multiple times, constraints 6 and 7 do not apply to them. To model tracks in a sequence consisting of $F$ frames, a single assignment matrix $\mathbf{X}_f$ is required for each frame $f$ , mapping the detections to tracks. + +Quadratic Form. The basis for optimization-based trackers are costs between pairs of detections, where the cost is accounted for if two detections are connected by a common track. The goal of the tracker is to find a solution that minimizes the total cost associated with the assignment. Our approach using assignment matrices leads to a quadratic cost for a pair of frames $i,j$ that reads + +$$ +c _ {i j} = \sum_ {t} \sum_ {d _ {i}} \sum_ {d _ {j}} x _ {i d _ {i} t} q _ {d _ {i} d _ {j}} x _ {j d _ {j} t}, \tag {8} +$$ + +with $x_{id_i t}$ and $x_{jd_j t}$ being entries from the assignment matrices $\mathbf{X}_i$ and $\mathbf{X}_j$ respectively and $q_{d_i d_j}$ as the corresponding similarity score. It is important to note that only detection pairs assigned to the same track incur a cost, which results in a single sum over the tracks $t$ . + +Equation 8 can be written in matrix form as + +$$ +c _ {i j} = \operatorname {v e c} \left(\mathbf {X} _ {i}\right) ^ {T} \mathbf {Q} _ {i j} \operatorname {v e c} \left(\mathbf {X} _ {j}\right), \tag {9} +$$ + +with $\operatorname{vec}(\mathbf{X})$ as a row-major vectorization of the corresponding assignment matrices and $\mathbf{Q}_{ij}$ as the cost matrix of the frame-pair. The maximum frame gap $\Delta f_{\mathrm{max}}$ that is modeled in our approach depends only on the density of the cost matrix. To include a connection between frames $i$ and $j$ , the matrix $\mathbf{Q}_{ij}$ needs to be filled with the corresponding similarity scores. The cost matrix $\mathbf{Q}_{ij}$ is sparse, as it also represents all terms that correspond to detection pairs matched to different tracks, which add no cost. Furthermore, no cost is associated with the mapping of a frame to itself, which includes the main diagonal of $\mathbf{Q}$ . + +A complete sequence consisting of $F$ frames, can be represented with the stacked assignment matrix + +$$ +\mathbf {z} = \left[ \operatorname {v e c} \left(\mathbf {X} _ {1}\right) ^ {T}, \dots , \operatorname {v e c} \left(\mathbf {X} _ {F}\right) ^ {T} \right] ^ {T}. \tag {10} +$$ + +And the corresponding cost + +$$ +c = \sum_ {i = 1} ^ {F} \sum_ {j = 1} ^ {F} c _ {i j} = \mathbf {z} ^ {T} \mathbf {Q} \mathbf {z}, \tag {11} +$$ + +where $\mathbf{Q}$ is a block-matrix made from all $\mathbf{Q}_{ij}$ . + +QUBO form. To solve the proposed MOT assignment problem with an adiabatic quantum computer it further needs to be represented as a QUBO task with $\{-1, + 1\}$ spin states. This consists of two steps, firstly eliminating the constraints and secondly substituting the variables. + +1) Constraints are represented using a Lagrangian multiplier $\lambda$ . As our formulation does not include inequalities, no additional slack variables with corresponding qubits are required. Given the original quadratic program with constraints + +$$ +\underset {\mathbf {z}} {\arg \min } \mathbf {z} ^ {T} \mathbf {Q} \mathbf {z} + \mathbf {b} ^ {T} \mathbf {z} \quad \text {s . t .} \quad \mathbf {G} \mathbf {z} = \mathbf {d}, \tag {12} +$$ + +a QUBO can be formulated as + +$$ +\underset {\mathbf {z}} {\arg \min } \mathbf {z} ^ {T} \mathbf {Q} ^ {\prime} \mathbf {z} + \mathbf {b} ^ {\prime T} \mathbf {z} \tag {13} +$$ + +with + +$$ +\mathbf {Q} ^ {\prime} = \mathbf {Q} + \lambda \mathbf {G} ^ {T} \mathbf {G} \tag {14} +$$ + +$$ +\mathbf {b} ^ {\prime} = - 2 \lambda \mathbf {G} ^ {T} \mathbf {b}. \tag {15} +$$ + +2) Variables are substituted by replacing the optimization variables $z \in \{0,1\}$ with $s \in \{-1,1\}$ by using $z = 1/2(s + 1)$ the resulting optimization problem reads + +$$ +\underset {\mathbf {s}} {\arg \min } \mathbf {s} ^ {T} \mathbf {Q} \mathbf {s} + \mathbf {b} ^ {\prime T} \mathbf {s} \quad \text {w i t h} \quad \mathbf {b} ^ {\prime T} = 2 \left(\mathbf {b} ^ {T} + \mathbf {1} ^ {T} \mathbf {Q}\right). \tag {16} +$$ + +Lagrangian Optimization. Solving the Lagrangian would require solving a problem in both discrete and continuous optimization variables (assignment, and Lagrangian multipliers, respectively). To solve the problem using AQC, we presented a constant penalty reformulation in the previous paragraph, which fixes the Lagrangian multipliers $\lambda$ . In such an approach, if $\lambda$ is large enough, constraint satisfaction is guaranteed. More precisely, a quadratic equality constraint reformulation of the form + +$$ +\lambda \left| \left| \mathbf {G} \mathbf {z} - \mathbf {d} \right| \right| _ {2} ^ {2}, \tag {17} +$$ + +is used in Equations 14 and 15, which allows to only consider positive Lagrangian multipliers $\lambda$ . Even though $\lambda$ needs to be just large enough from a theoretical perspective, in practice it should be as small as possible. This is especially relevant for AQC, as with a high $\lambda$ the conditioning of the corresponding Hamiltonian in the AQC gets worse. This should be avoided as it results in a lower probability of finding the correct solution in each measurement. + +Thus, in practice a problem dependent bound for the minimum penalty term $\lambda_{\mathrm{min}}$ should be used. One approach to reduce the spectral gap is to estimate an individual $\lambda_{i}$ for each constraint $\mathbf{G}_i\mathbf{x} = \mathbf{d}_i$ using upper bounds. While such bounds can be computed, they are not tight in many cases. We, therefore, propose a heuristic to estimate the Lagrangian multipliers $\lambda_{i}$ that closely match their minimal value $\lambda_{i,\mathrm{min}}$ . Each multiplier is modeled by + +$$ +\lambda_ {i} = \lambda_ {\mathrm {b}} + \lambda_ {i} ^ {\prime} + \lambda_ {\text {o f f}}, \tag {18} +$$ + +where $\lambda_{\mathrm{b}}$ is a small base value that resolves the easy to fulfill constraints, $\lambda_i^\prime$ is estimated during the optimization procedure and $\lambda_{\mathrm{off}}$ is an offset to increase the spectral gap. + +Starting with $\lambda_i' = 0$ and $\lambda_{\mathrm{off}} = 0$ for all constraints, the QUBO is solved using annealing. In general, this will result in a solution $\mathbf{z}_{\lambda}$ that does not fulfill the constraints. As in our formulation, only positive violations result in a cost improvement, i.e. $\mathbf{G}\mathbf{z} \geq \mathbf{d}$ , the cost reduction of a constraint violation can be estimated as + +$$ +a _ {i} (\mathbf {z} _ {\lambda}) = 2 \left(\mathbf {z} _ {G} ^ {T} \mathbf {Q} \mathbf {z} _ {\lambda} - \min _ {\hat {j}} \mathbf {z} _ {G j} ^ {T} \mathbf {Q} \mathbf {z} _ {\lambda}\right) / v _ {i} ^ {2}, \tag {19} +$$ + +$$ +\mathbf {z} _ {G} ^ {T} = \left(\mathbf {G} _ {i} \circ \mathbf {z} _ {\lambda} ^ {T}\right) \tag {20} +$$ + +$$ +v _ {i} \left(\mathbf {z} _ {\lambda} ^ {0}\right) = \mathbf {G} _ {i} \mathbf {z} _ {\lambda} - \mathbf {d} _ {i}, \tag {21} +$$ + +where $\mathbf{z}_G$ are the variables masked with $\mathbf{G}_i$ and $v_{i}$ is the degree of violation. To fulfill the corresponding constraint, we set + +$$ +\lambda_ {i} ^ {\prime} \left(\mathbf {z} _ {\lambda}\right) = - a _ {i} \left(\mathbf {z} _ {\lambda}\right) - \lambda_ {\mathrm {b}} + \epsilon , \tag {22} +$$ + +with a small $\epsilon$ to assert that constraint $i$ is fulfilled in the current setting. While this can be evaluated for all constraints simultaneously, the full procedure needs to be performed iteratively, as not all constraints may be violated in the optimal solution. Nevertheless, the set of measurements returned by the AQC can be used to reduce the number of required iterations. Instead of taking a single best solution, all solutions $\mathbf{z}_j$ that are close to the optimal solution are evaluated and merged as $\lambda_i' = \max_j \lambda_i'(\mathbf{z}_j)$ . In our formulation, these can be solutions where the track order is permuted. + +After estimating the Lagrangian multipliers, the total cost matrix scale is small, nevertheless, the same also holds for the spectral gap, as the cost of not fulfilling constraints is small. Therefore, the additional offset $\lambda_{\mathrm{off}}$ is added to the Lagrangian multipliers. + +Similarity Cost. We use the same approach for cost generation as AP-lift [30], where multi-layer Perceptrons are used to regress the similarity score between pairs of detections. Features used to compute this score are the intersection over union (IoU) of aligned boxes and the dot-product between DG-Net [57] appearance features. DG-Net features are generated with the network trained on the MOT15 dataset [38] together with [47,52,56]. To generate the MLP input vector, the features are normalized with a global context [29], which results in a total of 22 features [30]. Furthermore, assigning the dummy-detection to a track incurs no cost and assigning a detection to the dummy-track, i.e. labeling it as a false-positive, corresponds to a small negative value $\beta$ . This is required to prevent the assignment of single detections to tracks. + +Post Processing. Even in an offline setting, long sequences cannot be represented as a single optimization problem and need to be split into a set of overlapping subproblems. We set the overlap to the modeled frame gap, and match tracks using the common frames. Matching is stated as a linear sum problem that maximizes the number of detections that are jointly assigned to tracks in both subproblems. As multiple subsequent tracks can be modeled by a single track ID, tracks that are interrupted longer than the maximum modeled frame gap $\Delta f_{\mathrm{max}}$ are separated. + +Problem Scaling. One important aspect when designing algorithms for current and near-future quantum computers is the required number of qubits. Many current formulations of MOT grow quickly in size w.r.t. the number of detections, tracks, frames and the length of the modeled frame gap. In contrast to this, the number of qubits in our approach only grows linearly in the number of detections, tracks and frames. Furthermore, by using a quadratic optimization problem, longer frame gaps can be modeled by + +additional entries in the cost matrix, which correspond to additional couplings between qubits. + +While on short sequences the number of possible tracks needs to be at least as high as the total number of tracks, long sequences can profit from a saturation of the required number of tracks. After a track has terminated, there is no cost associated with assigning new detections if they have a distance of more than the maximal frame gap $\Delta f_{\mathrm{max}}$ from the previous track. Therefore, multiple subsequent real tracks can be modeled by a single track ID and easily be separated in post-processing. + +# 5. Traditional Solvers + +While our formulation is advantageous when solved on an adiabatic quantum computer, publicly available real systems have not yet reached a scale where large experiments can be performed. We, therefore, use classical solvers to show the results of our approach on real-world tasks, even though a quadratic problem formulation is known to be hard in this context. A common requirement of solvers to perform quadratic binary optimization via branch and bound is the convexity of the continuous relaxation of the problem. This corresponds to a positive-definite cost matrix $\mathbf{Q}$ , i.e., a matrix with only positive eigenvalues, which is not fulfilled for the given cost matrix in most cases. + +# 5.1. Hessian Regularization + +A common approach to enforce positive eigenvalues is adding an identity matrix scaled by $\epsilon$ . As this changes the cost function and thus the optimal solution, small values need to be used for $\epsilon$ , making this approach only suitable for compensating small negative eigenvalues. Nevertheless, investigating the constraints of our formulation leads to a sparse diagonal matrix $\mathbf{E}$ that can be added to the cost matrix $\mathbf{Q}$ without changing the optimal solution. With the same approach of grouping the total cost matrix into blocks between frames as in Equation (11), the following definition of $\mathbf{E}$ is provided in blocks between frames. As only diagonal elements are relevant, blocks between different frames are zero matrices $\mathbf{E}_{ij} = \mathbf{0}|i\neq j$ . The blocks on the diagonal, which represent the mapping of a frame $i$ to itself $\mathbf{E}_{ii}$ are diagonal matrices defined by the diagonal elements + +$$ +e _ {i d t} = \left\{ \begin{array}{l l} e & d \in \{1, \dots , D \}, t \in \{1, \dots , T - 1 \} \\ 0 & t = T \end{array} \right.. \tag {23} +$$ + +The indices refer to the position on the diagonal that correspond to detection $d$ and track $t$ . Given a block's assignment matrix $\mathbf{X}_i$ , the total cost of the block after adding the diagonal term is + +$$ +c _ {i i} = \operatorname {v e c} \left(\mathbf {X} _ {i}\right) ^ {T} \left(\mathbf {Q} _ {i i} + \mathbf {E} _ {i i}\right) \operatorname {v e c} \left(\mathbf {X} _ {i}\right) = e (T - 1), \tag {24} +$$ + +with $\mathbf{Q}_{ii} = \mathbf{0}$ and $T$ tracks in total. The intuition behind the definition is given in the following and the full proof is provided in the supplementary material. + +Given a binary problem, any diagonal entry adds cost if a variable is active. In the detection track assignment problem, this corresponds to adding a constant if a detection is assigned to a track. As constraint 6 asserts that exactly one detection (real- or dummy-detection) is assigned to every real track each time-step, having a cost $e$ for the assignment adds this cost for each of the $T - 1$ real tracks. As the constraint does not apply for the dummy-track with index $T$ and an arbitrary number of detections may be assigned to it. Therefore, the same argument would not hold and we can not add an additional cost to these entries $(e_{ikl} = 0|t = T)$ , without influencing the total cost function. + +# 6. Experiments and Results + +AQC experiments are performed on a D-wave Advantage 4.1 [42]. The system contains at least 5000 qubits and 35,000 couplers implemented as superconducting qubits [9] and Josephson-junctions [26] respectively. Every qubit of the D-wave Advantage is connected to 15 other qubits, which needs to be reflected in the sparsity pattern of the cost matrix. If a denser matrix is required, chains of qubits are formed that represent a single state. The actual parameters can vary due to defective qubits and couplers. All experiments are performed using an annealing time of $1600\mu s$ and an additional delay between measurements to reduce the inter-sample correlation. In the following, a single measurement refers to the combination of an annealing cycle and the subsequent measurement. + +Simulated annealing is used to evaluate our approach in a noise-free setting. We use the simulation provided by D-wave for this purpose. + +Classical solvers are used to demonstrate the performance of the proposed algorithm on the full MOT15 dataset. All experiments using classical solvers are performed using Gurobi [25] with CVXPY [16] as a modeling language. + +# 6.1. Lagrangian Multiplier + +Fixed Lagrangian multipliers represent the basic approach to include constraints in the QUBO. We run experiments with synthetic tracking sequences where object detections are in random order. The scenarios are defined by their similarity scores, which we set to 0.8 for a match and -0.8 for different objects. Furthermore, we add Gaussian noise with variance $\sigma^2$ to the similarity scores and subsequently truncate them to $[-1,1]$ . In the experiments 3 detections over 5 frames and a noise level between $\sigma = 0.2$ to $\sigma = 1.0$ is used. The tracking parameters are set to 4 tracks and a maximal frame-gap of $\Delta f_{\mathrm{max}} = 3$ frames. + +Results generated with simulated annealing are shown in Figure 2, where the top plot shows the solution probabil- + +![](images/b0c09a56eb9a67725c93e4c215b2a5a43a744eb151d27e2c73352cd2dd947984.jpg) +Figure 2. Solution probability and energy levels using simulated annealing for different noise levels and changing $\lambda$ . + +ity for different noise levels over an increasing Lagrangian multiplier. For each $\lambda$ , 4096 measurements are performed. The lower plot shows the histogram over the energy of the returned solutions for a noise level of $\sigma = 0.6$ . The correct solution can be seen at an energy level of $-38.6$ . + +With increasing noise level, the solution probability for the best value of $\lambda$ reduces considerably, which can be explained by the energy histogram. As described in Section 3.1, a low spectral gap, i.e. the difference between the lowest and second-lowest energy level, reduces the probability of the AQC staying in its ground state and thus, the probability of finding the correct solution. In the energy plot, the spectral gap is visible as the distance between the energy band of the correct solution and the next higher energy band, given a sufficiently high $\lambda$ , such that the correct solution has the lowest energy. + +Tracking with the D-wave advantage is performed on a problem with 3 detections over 4 frames and noise levels $\sigma \in \{0.0, 0.1, 0.2\}$ . Results using 4000 measurements for each setting are shown in Figure 3. Solution probabilities are lower compared to simulated annealing and high energy solutions are returned more often. This can be explained by the high noise of current AQCs. + +Optimized Lagrangian multipliers are introduced to improve the spectral gap of the normalized cost matrix. We perform the same tracking tasks as for fixed Lagrangian multipliers, but evaluate the results w.r.t. the offset term $\lambda_{\mathrm{off}}$ . Results generated with simulated annealing are shown in Figure 4. Optimization of the Lagrangian multipliers is initialized with a base value of $\lambda_{b} = 0.5$ . The probability of finding the right solution is increased and stays high over a large range of $\lambda_{\mathrm{off}}$ compared to only using a single $\lambda$ . Furthermore, the best solution probability for each of the noise levels is better than the optimum for a fixed La + +![](images/0c8118ad8949aed69803f5c42e69c24834fad348a48dcf940515dc028bee212b.jpg) +Figure 3. Solution probability and energy levels using quantum annealing for different noise levels and changing $\lambda$ . + +![](images/e19fd2824c15a1781c03bb899bc408ad75f18203189e92b9e1891f1dd96cea8a.jpg) +Figure 4. Solution probability and energy levels using simulated annealing and optimized $\lambda_{i}$ for different noise levels over $\lambda_{\mathrm{off}}$ + +grangian multiplier. This has two advantages: first, fewer measurements are needed to find the correct solution and secondly, less effort needs to be invested to find a good setting for $\lambda$ . Results for the problem with an optimized Lagrangian multiplier with $\lambda_{b} = 1.0$ solved on the AQC are shown in Figure 5. When optimally tuned for $\sigma = 0$ , our method returns the best solution in $4.8\%$ of the measurements, compared to $3.5\%$ when using a fixed multiplier. Furthermore, even without an additional offset $\lambda_{\mathrm{off}} = 0$ , the best solution is returned in $0.8\%$ of the measurements. + +# 6.2.MOT15 + +We use the MOT15 dataset [38] to show that our method performs on par with state-of-the-art tracking methods. For this dataset, GUROBI [25] is used to find a solution for the optimization problem. The sequence is evaluated in segments of 20 frames using a maximum frame gap of $\Delta f_{\mathrm{max}} = 10$ . As binary quadratic problems are very hard to + +![](images/2f9378dd9db4e50cc5379f8ac0df3141e5cff9a8d4dd07cd43f00565a1a6c445.jpg) +Figure 5. Solution probability and energy levels using quantum annealing and optimized $\lambda_{i}$ for different noise levels over $\lambda_{\mathrm{off}}$ + +
MethodMOTAIDF1MTMLFPFNIDs
TestLif.T [29]52.560.0244186683721610730
MPNTrack [8]51.558.6225187726021780375
ApLift [30]51.159.02841631007019288677
MFLTST [54]49.252.4210176870721594912
Tracktor [5]44.146.71301896477265771318
Ours49.953.51871795924240321689
X-valAP lift59.667.8237133889710150283
Ours59.767.6234134872010214370
+ +Table 1. Results on MOT15 [38]. X-val refers to results on the training set using leave-one-out cross validation. + +solve with classical approaches, it is not possible to find an optimum solution for segments that contain a high number of tracks. In these cases, we terminate the optimization after 900 s on a single segment and use the best solution found. + +For comparisons, ApLift [30] is closest to our method, as it uses the same set of similarity features. On the test set, we achieve a MOTA-score of $49.9\%$ and perform only $1.2\%$ below ApLift, even though it models gaps up to 50 frames. + +For a comparison under similar settings, we evaluate our method and ApLift [30] with the same frame gap of $\Delta f_{\mathrm{max}} = 10$ . As MOT15 does not contain a validation set, we use leave one out cross-validation on all samples of the training set for a fair comparison. In this scenario, our method improves by $0.2\%$ over ApLift in MOTA score. An explanation for this is that the MOT15 test set contains more detections in each frame on average (10.6 vs. 7.3) than the training set. In this case, there are more sequences where the classical solver does not find a solution and thus, generates a non-optimal result. + +MOT15 with AQC. To show that tracking with an AQC already scales to small real-world examples, a part of the PETS09-S2L1 sequence is used. As the problem size has to be limited, three tracks that contain two occlusions, are extracted between frames 121 to 155. We execute our pipeline + +![](images/4253e8586363a0f7760724c813be2d8f7e5802ce1424690fca2fcdad389cd215.jpg) +Figure 6. Frames from the extracted sequence tracked on the AQC. + +![](images/c51245010dbb0d66c49edb16a8474a72034b5c65f8ace0303444c839981cee50.jpg) +Figure 7. Energy of measurements returned by performing tracking of the PETS09-S2L1 sequence on the D-wave Advantage. The bar-plot shows the probability of measuring the optimal solution. + +on segments of 5 frames with 3 tracks, a maximum frame-gap of 3, and optimized Lagrangian multipliers. The subproblems are solved on the D-wave Advantage with $1600\mu s$ annealing time and 500 measurements per segment. The most relevant frames that highlight occlusions are shown in Figure 6. The normalized energy $E - E_0$ levels of the measurements for each subproblem are shown at the top of Figure 7 and the corresponding probabilities $p$ of measuring the right solutions are plotted in the lower one. The subproblems 5 and 10 correspond to the two occlusions highlighted in Figure 6. These are harder to solve problems, as multiple solutions with small differences in their energy exist and thus, they have a lower solution probability. + +# 7. Conclusion + +In this work, we proposed the first quantum computing formulation of MOT. We demonstrated that current AQCs can solve small real-world tracking problems, and that our approach closely matches state-of-the-art MOT methods. Current limitations stem from the proposed formulation being optimized to run on an AQC. As QUBO is known to be hard using classical approaches and as current AQCs are still at an experimental stage, problems are limited to a small scale. Nevertheless, quantum computing has the potential to make much larger problems feasible in the future. + +Acknowledgements: This work was funded by Toyota Motor Europe via the research project TRACE Zurich. + +# References + +[1] B. Apolloni, C. Carvalho, and D. de Falco. Quantum stochastic optimization. Stochastic Processes and their Applications, 33(2):233-244, Dec. 1989. +[2] Frank Arute, Kunal Arya, Ryan Babbush, Dave Bacon, Joseph C. Bardin, Rami Barends, Rupak Biswas, Sergio Boixo, Fernando G. S. L. Brandao, David A. Buell, Brian Burkett, Yu Chen, Zijun Chen, Ben Chiaro, Roberto Collins, William Courtney, Andrew Dunsworth, Edward Farhi, Brooks Foxen, Austin Fowler, Craig Gidney, Marissa Giustina, Rob Graff, Keith Guerin, Steve Habegger, Matthew P. Harrigan, Michael J. Hartmann, Alan Ho, Markus Hoffmann, Trent Huang, Travis S. Humble, Sergei V. Isakov, Evan Jeffrey, Zhang Jiang, Dvir Kafri, Kostyantyn Kechedzhi, Julian Kelly, Paul V. Klimov, Sergey Knysh, Alexander Korotkov, Fedor Kostritsa, David Landhuis, Mike Lindmark, Erik Lucero, Dmitry Lyakh, Salvatore Mandra, Jarrod R. McClean, Matthew McEwen, Anthony Megrant, Xiao Mi, Kristel Michielsen, Masoud Mohseni, Josh Mutus, Ofer Naaman, Matthew Neeley, Charles Neill, Murphy Yuezhen Niu, Eric Ostby, Andre Petukhov, John C. Platt, Chris Quintana, Eleanor G. Rieffel, Pedram Roushan, Nicholas C. Rubin, Daniel Sank, Kevin J. Satzinger, Vadim Smelyanskiy, Kevin J. Sung, Matthew D. Trevithick, Amit Vainsencher, Benjamin Villalonga, Theodore White, Z. Jamie Yao, Ping Yeh, Adam Zalcman, Hartmut Neven, and John M. Martinis. Quantum supremacy using a programmable superconducting processor. Nature, 574(7779):505-510, Oct. 2019. +[3] Marcel Seelbach Benkner, Vladislav Golyanik, Christian Theobalt, and Michael Moeller. Adiabatic Quantum Graph Matching with Permutation Matrix Constraints. In 2020 International Conference on 3D Vision (3DV), pages 583-592, Fukuoka, Japan, Nov. 2020. IEEE. +[4] Marcel Seelbach Benkner, Zorah Lahner, Vladislav Golyanik, Christof Wunderlich, Christian Theobalt, and Michael Moeller. Q-Match: Iterative Shape Matching via Quantum Annealing. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), page 11, 2021. +[5] Philipp Bergmann, Tim Meinhardt, and Laura Leal-Taixe. Tracking Without Bells and Whistles. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 941-951, Seoul, Korea (South), Oct. 2019. IEEE. +[6] Tolga Birdal, Vladislav Golyanik, Christian Theobalt, and Leonidas Guibas. Quantum Permutation Synchronization. In 2021 IEEE/CVF Conference on Com + +puter Vision and Pattern Recognition (CVPR), pages 13117-13128, Nashville, TN, USA, June 2021. IEEE. +[7] M. Born and V. Fock. Beweis des Adiabatensatzes. Zeitschrift für Physik, 51(3):165-180, Mar. 1928. +[8] Guillem Braso and Laura Leal-Taixe. Learning a Neural Solver for Multiple Object Tracking. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6246-6256, Seattle, WA, USA, June 2020. IEEE. +[9] P. I. Bunyk, E. Hoskinson, M. W. Johnson, E. Tolkacheva, F. Altomare, A. J. Berkley, R. Harris, J. P. Hilton, T. Lanting, and J. Whittaker. Architectural considerations in the design of a superconducting quantum annealing processor. IEEE Transactions on Applied Superconductivity, 24(4):1-10, Aug. 2014. +[10] Holger Caesar, Varun Bankiti, Alex H. Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuScenes: A multimodal dataset for autonomous driving. arXiv preprint arXiv:1903.11027, 2019. +[11] Ming-Fang Chang, John W Lambert, Patsorn Sangkloy, Jagjeet Singh, Slawomir Bak, Andrew Hartnett, De Wang, Peter Carr, Simon Lucey, Deva Ramanan, and James Hays. Argoverse: 3D tracking and forecasting with rich maps. In Conference on computer vision and pattern recognition (CVPR), 2019. +[12] Peng Dai, Renliang Weng, Wongun Choi, Changshui Zhang, Zhangping He, and Wei Ding. Learning a Proposal Classifier for Multiple Object Tracking. In 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2443-2452, Nashville, TN, USA, June 2021. IEEE. +[13] Souvik Das, Andrew J. Wildridge, Sachin B. Vaidya, and Andreas Jung. Track clustering with a quantum annealer for primary vertex reconstruction at hadron colliders. arXiv:1903.08879 [hep-ex, physics:quant-ph], Aug. 2020. arXiv: 1903.08879. +[14] Patrick Dendorfer, Hamid Rezatofighi, Anton Milan, Javen Shi, Daniel Cremers, Ian Reid, Stefan Roth, Konrad Schindler, and Laura Leal-Taixe. MOT20: A benchmark for multi object tracking in crowded scenes. arXiv:2003.09003 [cs], Mar. 2020. arXiv: 2003.09003. +[15] David Elieser Deutsch and Roger Penrose. Quantum computational networks. Proceedings of the Royal Society of London. A. Mathematical and Physical Sciences, 425(1868):73-90, Sept. 1989. Publisher: Royal Society. +[16] Steven Diamond and Stephen Boyd. CVXPY: a python-embedded modeling language for convex opti + +mization. The Journal of Machine Learning Research, 17(1):2909-2913, Jan. 2016. +[17] A. Einstein, B. Podolsky, and N. Rosen. Can Quantum-Mechanical Description of Physical Reality Be Considered Complete? Physical Review, 47(10):777-780, May 1935. Publisher: American Physical Society. +[18] Edward Farhi, Jeffrey Goldstone, Sam Gutmann, and Michael Sipser. Quantum Computation by Adiabatic Evolution. arXiv:quant-ph/0001106, Jan. 2000. arXiv:quant-ph/0001106. +[19] Sebastian Feld, Markus Friedrich, and Claudia Linnhoff-Popien. Optimizing Geometry Compression Using Quantum Annealing. In 2018 IEEE Globecom Workshops (GC Wkshps), pages 1-6, Dec. 2018. +[20] Richard P. Feynman. Simulating physics with computers. International Journal of Theoretical Physics, 21(6):467-488, June 1982. +[21] Dillion M. Fox, Kim M. Branson, and Ross C. Walker. mRNA codon optimization with quantum computers. PLOS ONE, 16(10):e0259101, Oct. 2021. Publisher: Public Library of Science. +[22] Robert Ganian, Thekla Hamm, and Sebastian Ordyniak. The Complexity of Object Association in Multiple Object Tracking. Proceedings of the AAAI Conference on Artificial Intelligence, 35(2):1388-1396, May 2021. Number: 2. +[23] A Geiger, P Lenz, C Stiller, and R Urtasun. Vision meets robotics: The KITTI dataset. The International Journal of Robotics Research, 32(11):1231-1237, Sept. 2013. +[24] David J. Griffiths and Darrell F. Schroeter. Introduction to quantum mechanics. Cambridge University Press, Cambridge, 3 edition, 2018. +[25] Gurobi Optimization, LLC. Gurobi optimizer reference manual, 2021. +[26] R. Harris, T. Lanting, A. J. Berkley, J. Johansson, M. W. Johnson, P. Bunyk, E. Ladizinsky, N. Ladizinsky, T. Oh, and S. Han. Compound Josephson-junction coupler for flux qubits with minimal crosstalk. Physical Review B, 80(5):052506, Aug. 2009. Publisher: American Physical Society. +[27] B. Hensen, H. Bernien, A. E. Dreau, A. Reiserer, N. Kalb, M. S. Blok, J. Ruitenberg, R. F. L. Vermeulen, R. N. Schouten, C. Abellán, W. Amaya, V. Pruneri, M. W. Mitchell, M. Markham, D. J. Twitchen, D. Elkouss, S. Wehner, T. H. Taminiau, and R. Hanson. Loophole-free Bell inequality violation using electron spins separated by 1.3 kilometres. Nature, 526(7575):682-686, Oct. 2015. + +[28] Alexander S. Holevo. Repeated and Continuous Measurement Processes. In Alexander S. Holevo, editor, Statistical Structure of Quantum Theory, Lecture Notes in Physics Monographs, pages 97-118. Springer, Berlin, Heidelberg, 2001. +[29] Andrea Hornakova, Roberto Henschel, Bodo Rosenhahn, and Paul Swoboda. Lifted Disjoint Paths with Application in Multiple Object Tracking. In Proceedings of the 37th International Conference on Machine Learning, pages 4364-4375. PMLR, Nov. 2020. ISSN: 2640-3498. +[30] Andrea Hornakova, Timo Kaiser, Paul Swoboda, Michal Rolinek, Bodo Rosenhahn, and Roberto Henschel. Making Higher Order MOT Scalable: An Efficient Approximate Solver for Lifted Disjoint Paths. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), page 11, 2021. +[31] Ernst Ising. Beitrag zur Theorie des Ferromagnetismus. Zeitschrift für Physik, 31(1):253-258, Feb. 1925. +[32] Richard Jozsa and Noah Linden. On the role of entanglement in quantum-computational speed-up. Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 459(2036):2011-2032, Aug. 2003. Publisher: Royal Society. +[33] Tadashi Kadowaki and Hidetoshi Nishimori. Quantum annealing in the transverse Ising model. Physical Review E, 58(5):5355-5363, Nov. 1998. +[34] Tosio Kato. On the Adiabatic Theorem of Quantum Mechanics. Journal of the Physical Society of Japan, 5(6):435-439, Nov. 1950. Publisher: The Physical Society of Japan. +[35] Andrew D. King, Juan Carrasquilla, Jack Raymond, Isil Ozfidan, Evgeny Andriyash, Andrew Berkley, Mauricio Reis, Trevor Lanting, Richard Harris, Fabio Altomare, Kelly Boothby, Paul I. Bunyk, Colin Enderud, Alexandre Fréchette, Emile Hoskinson, Nicolas Ladizinsky, Travis Oh, Gabriel Poulin-Lamarre, Christopher Rich, Yuki Sato, Anatoly Yu Smirnov, Loren J. Swenson, Mark H. Volkmann, Jed Whittaker, Jason Yao, Eric Ladizinsky, Mark W. Johnson, Jeremy Hilton, and Mohammad H. Amin. Observation of topological phenomena in a programmable lattice of 1,800 qubits. Nature, 560(7719):456-460, Aug. 2018. +[36] Andrew D. King, Jack Raymond, Trevor Lanting, Sergei V. Isakov, Masoud Mohseni, Gabriel Poulin-Lamarre, Sara Ejtemaee, William Bernoudy, Isil Ozfidan, Anatoly Yu Smirnov, Mauricio Reis, Fabio Altomare, Michael Babcock, Catia Baron, Andrew J. Berkley, Kelly Boothby, Paul I. Bunyk, Holly Chris + +tiani, Colin Enderud, Bram Evert, Richard Harris, Emile Hoskinson, Shuiyuan Huang, Kais Jooya, Ali Khodabandelou, Nicolas Ladizinsky, Ryan Li, P. Aaron Lott, Allison J. R. MacDonald, Danica Marsden, Gaeelen Marsden, Teresa Medina, Reza Molavi, Richard Neufeld, Mana Norouzpour, Travis Oh, Igor Pavlov, Ilya Perminov, Thomas Prescott, Chris Rich, Yuki Sato, Benjamin Sheldan, George Sterling, Loren J. Swenson, Nicholas Tsai, Mark H. Volkmann, Jed D. Whittaker, Warren Wilkinson, Jason Yao, Hartmut Neven, Jeremy P. Hilton, Eric Ladizinsky, Mark W. Johnson, and Mohammad H. Amin. Scaling advantage over path-integral Monte Carlo in quantum simulation of geometrically frustrated magnets. Nature Communications, 12(1):1113, Feb. 2021. +[37] Carl A. Kocher and Eugene D. Commins. Polarization Correlation of Photons Emitted in an Atomic Cascade. Physical Review Letters, 18(15):575-577, Apr. 1967. Publisher: American Physical Society. +[38] Laura Leal-Taixe, Anton Milan, Ian Reid, Stefan Roth, and Konrad Schindler. MOTChallenge 2015: Towards a Benchmark for Multi-Target Tracking. arXiv:1504.01942 [cs], Apr. 2015. arXiv: 1504.01942. +[39] Zhang Li, Li Yuan, and R. Nevatia. Global data association for multi-object tracking using network flows. In 2008 IEEE Conference on Computer Vision and Pattern Recognition, pages 1-8, June 2008. ISSN: 1063-6919. +[40] Xiao-Song Ma, Thomas Herbst, Thomas Scheidl, Daqing Wang, Sebastian Kropatschek, William Naylor, Bernhard Wittmann, Alexandra Mech, Johannes Kofler, Elena Anisimova, Vadim Makarov, Thomas Jennewein, Rupert Ursin, and Anton Zeilinger. Quantum teleportation over 143 kilometres using active feed-forward. Nature, 489(7415):269-273, Sept. 2012. +[41] Santiago Manen, Michael Gygli, Dengxin Dai, and Luc Van Gool. PathTrack: Fast Trajectory Annotation with Path Supervision. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 290-299, Venice, Oct. 2017. IEEE. +[42] Catherine McGeoch and Pau Farré. The Advantage System: Performance Update. page 31, Oct. 2021. +[43] Anton Milan, Laura Leal-Taixe, Ian Reid, Stefan Roth, and Konrad Schindler. MOT16: A Benchmark for Multi-Object Tracking. arXiv:1603.00831 [cs], May 2016. arXiv: 1603.00831. +[44] Florian Neukart, Gabriele Compostella, Christian Seidel, David von Dollen, Their Yarkoni, and Bob Parney. Traffic Flow Optimization Using a Quantum Annealer. Frontiers in ICT, 4:29, 2017. + +[45] Masayuki Ohzeki, Akira Miki, Masamichi J. Miyama, and Masayoshi Terabe. Control of Automated Guided Vehicles Without Collision by Quantum Annealer and Digital Devices. Frontiers in Computer Science, 1:9, 2019. +[46] Weihong Ren, Xinchao Wang, Jiandong Tian, Yandong Tang, and Antoni B. Chan. Tracking-by-Counting: Using Network Flows on Crowd Density Maps for Tracking Multiple Targets. IEEE Transactions on Image Processing, 30:1439-1452, 2021. Conference Name: IEEE Transactions on Image Processing. +[47] Ergys Ristani, Francesco Solera, Roger S. Zou, Rita Cucchiara, and Carlo Tomasi. Performance Measures and a Data Set for Multi-Target, Multi-Camera Tracking. arXiv:1609.01775 [cs], Sept. 2016. arXiv: 1609.01775. +[48] Amir Roshan Zamir, Afshin Dehghan, and Mubarak Shah. GMCP-Tracker: Global Multi-object Tracking Using Generalized Minimum Clique Graphs. In Andrew Fitzgibbon, Svetlana Lazebnik, Pietro Perona, Yoichi Sato, and Cordelia Schmid, editors, Computer Vision - ECCV 2012, Lecture Notes in Computer Science, pages 343-356, Berlin, Heidelberg, 2012. Springer. +[49] E. Schrödinger. Discussion of Probability Relations between Separated Systems. Mathematical Proceedings of the Cambridge Philosophical Society, 31(4):555-563, Oct. 1935. Publisher: Cambridge University Press. +[50] Siyu Tang, Mykhaylo Andriluka, Bjoern Andres, and Bernt Schiele. Multiple People Tracking by Lifted Multicut and Person Re-identification. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3701–3710, Honolulu, HI, July 2017. IEEE. +[51] W. van Dam, M. Mosca, and U. Vazirani. How powerful is adiabatic quantum computation? In Proceedings 42nd IEEE Symposium on Foundations of Computer Science, pages 279–287, Oct. 2001. ISSN: 1552-5244. +[52] Longhui Wei, Shiliang Zhang, Wen Gao, and Qi Tian. Person Transfer GAN to Bridge Domain Gap for Person Re-identification. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 79–88, Salt Lake City, UT, USA, June 2018. IEEE. +[53] Yulin Wu, Wan-Su Bao, Sirui Cao, Fusheng Chen, Ming-Cheng Chen, Xiawei Chen, Tung-Hsun Chung, Hui Deng, Yajie Du, Daojin Fan, Ming Gong, Cheng Guo, Chu Guo, Shaojun Guo, Lianchen Han, Linyin Hong, He-Liang Huang, Yong-Heng Huo, Liping Li, Na Li, Shaowei Li, Yuan Li, Futian Liang, Chun + +Lin, Jin Lin, Haoran Qian, Dan Qiao, Hao Rong, Hong Su, Lihua Sun, Liangyuan Wang, Shiyu Wang, Dachao Wu, Yu Xu, Kai Yan, Weifeng Yang, Yang Yang, Yangsen Ye, Jianghan Yin, Chong Ying, Jiale Yu, Chen Zha, Cha Zhang, Haibin Zhang, Kaili Zhang, Yiming Zhang, Han Zhao, Youwei Zhao, Liang Zhou, Qingling Zhu, Chao-Yang Lu, ChengZhi Peng, Xiaobo Zhu, and Jian-Wei Pan. Strong Quantum Computational Advantage Using a Superconducting Quantum Processor. Physical Review Letters, 127(18):180501, Oct. 2021. Publisher: American Physical Society. +[54] Jieming Yang, Hongwei Ge, Jinlong Yang, Yubing Tong, and Shuzhi Su. Online multi-object tracking using multi-function integration and tracking simulation training. Applied Intelligence, May 2021. +[55] Jan-Nico Zaech, Dengxin Dai, Alexander Liniger, Martin Danelljan, and Luc Van Gool. Learnable Online Graph Representations for 3D Multi-Object Tracking. arXiv:2104.11747 [cs], Apr. 2021. arXiv: 2104.11747. +[56] Liang Zheng, Liyue Shen, Lu Tian, Shengjin Wang, Jingdong Wang, and Qi Tian. Scalable Person Re-identification: A Benchmark. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 1116–1124, Santiago, Chile, Dec. 2015. IEEE. +[57] Zhedong Zheng, Xiaodong Yang, Zhiding Yu, Liang Zheng, Yi Yang, and Jan Kautz. Joint Discriminative and Generative Learning for Person Re-Identification. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2133–2142, Long Beach, CA, USA, June 2019. IEEE. +[58] Han-Sen Zhong, Yu-Hao Deng, Jian Qin, Hui Wang, Ming-Cheng Chen, Li-Chao Peng, Yi-Han Luo, Dian Wu, Si-Qiu Gong, Hao Su, Yi Hu, Peng Hu, Xiao-Yan Yang, Wei-Jun Zhang, Hao Li, Yuxuan Li, Xiao Jiang, Lin Gan, Guangwen Yang, Lixing You, Zhen Wang, Li Li, Nai-Le Liu, Jelmer J. Renema, Chao-Yang Lu, and Jian-Wei Pan. Phase-Programmable Gaussian Boson Sampling Using Stimulated Squeezed Light. Physical Review Letters, 127(18):180502, Oct. 2021. Publisher: American Physical Society. +[59] Xingyi Zhou, Vladlen Koltun, and Philipp Krahenbuhl. Tracking Objects as Points. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision - ECCV 2020, Lecture Notes in Computer Science, pages 474-490, Cham, 2020. Springer International Publishing. \ No newline at end of file diff --git a/adiabaticquantumcomputingformultiobjecttracking/images.zip b/adiabaticquantumcomputingformultiobjecttracking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..aaf0ca8b4f8b6982d36bcae9833154c566e8a2bf --- /dev/null +++ b/adiabaticquantumcomputingformultiobjecttracking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1c9b49607bda6c68dd3e41c37ac97ef1827b7d848c717c5a96d36f315510e1b +size 364922 diff --git a/adiabaticquantumcomputingformultiobjecttracking/layout.json b/adiabaticquantumcomputingformultiobjecttracking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..689033012ea61cc617f9d66d31c7628dcb4fbdf3 --- /dev/null +++ b/adiabaticquantumcomputingformultiobjecttracking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13c2421a45352029104720c1b8eee94aca5e2c41caaafb5d4d0a94875007a496 +size 459575 diff --git a/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_content_list.json b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..666ecd8fa3a885e4913bb2fb98391ae5bedf3ca0 --- /dev/null +++ b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08577b6fe5663862e565827a95c806982dfc6bfa224bb4d757817cbf32db8d20 +size 92222 diff --git a/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_model.json b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..871f112aed3672ad4d7e1e28c8241c9939bfe111 --- /dev/null +++ b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7db95edf825fdec9ee30f646365e8f3fcad6e6a2a87bfbb93de2f74201008b5 +size 113665 diff --git a/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_origin.pdf b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..87e109e2ad7cf13f0d5cbe52a552ac6f1c2518d5 --- /dev/null +++ b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/d2ad32f0-d59a-4a36-8650-c1de1d01b0fa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6b534aab215e8af3d99bda613a5e32522bd79f70180173fbf61ca88080f218f +size 3449920 diff --git a/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/full.md b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b5ab47971a5060098e2d9e503c3b5c502846125c --- /dev/null +++ b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/full.md @@ -0,0 +1,404 @@ +# Advancing High-Resolution Video-Language Representation with Large-Scale Video Transcriptions + +Hongwei Xue\*, Tiankai Hang\*, Yanhong Zeng\*, Yuchong Sun\*, Bei Liu, Huan Yang, Jianlong Fu, Baining Guo +Microsoft Research Asia + +{v-honxue,v-tiahang,t-yazen,v-yuchongsun,bei.liu,huayan,jianf,bainguo}@microsoft.com + +# Abstract + +We study joint video and language (VL) pre-training to enable cross-modality learning and benefit plentiful downstream VL tasks. Existing works either extract low-quality video features or learn limited text embedding, while neglecting that high-resolution videos and diversified semantics can significantly improve cross-modality learning. In this paper, we propose a novel High-resolution and Diversified Video-Language pre-training model (HD-VILA) for many visual tasks. In particular, we collect a large dataset with two distinct properties: 1) the first high-resolution dataset including 371.5k hours of 720p videos, and 2) the most diversified dataset covering 15 popular YouTube categories. To enable VL pre-training, we jointly optimize the HD-VILA model by a hybrid Transformer that learns rich spatiotemporal features, and a multimodal Transformer that enforces interactions of the learned video features with diversified texts. Our pre-training model achieves new state-of-the-art results in 10 VL understanding tasks and 2 more novel text-to-visual generation tasks. For example, we outperform SOTA models with relative increases of $40.4\%$ R@1 in zero-shot MSR-VTT text-to-video retrieval task, and $55.4\%$ in high-resolution dataset LSMDC. The learned VL embedding is also effective in generating visually pleasing and semantically relevant results in text-to-visual editing and super-resolution tasks. + +# 1. Introduction + +Recent years we have witnessed an increasing number of videos with the popularity of appealing video websites and mobile apps (e.g., YouTube, TikTok). As the rapid development of smartphone cameras, device storage, and 5G + +networks, high-quality video creation, and diverse content sharing like travel, sports, and music become a new fashion. Therefore, the capability of video analytic and joint high-level understanding with language play a key role in many video tasks, such as video search [3,39], video recommendation [6], and video editing [38,48]. To facilitate video understanding, we study joint video and language (VL) pretraining, which is a new paradigm in both natural language processing [8] and computer vision [19, 52]. + +Existing video-language understanding models are highly limited in either scale or scope of video-language datasets. Early datasets (e.g., MSR-VTT [53], DiDeMo [2]) consist of videos and descriptions that are manually annotated by humans. The heavy and expensive annotation cost limits the scale of data. Moreover, datasets with only descriptive sentences are limited in complexity and variability that largely hinders generalization power. Recently, several datasets [3, 37] are proposed by transcriptions along with videos using ASR (automatic speech recognition), so that the data scale can be greatly enlarged. One most representative work is HowTo100M [37] which consists of million-scale instructional videos. However, there are still large gaps between these video datasets and real-scenario videos in terms of video quality and semantic diversity. + +To tackle the above limitations, we propose the HDVILA-100M dataset (i.e., High-resolution and Diversified Video and Language) which covers a wide range of video categories and benefits a plenty of VL tasks, such as text-to-video retrieval [39] and video QA [27]. This dataset has the following key properties: (1) Large: we have collected one of the largest video-language datasets, which consists of 100M video clip and sentence pairs from 3.3 million videos with 371.5K hours in total $(2.8\times$ video hour and $8\times$ average sentence length than HowTo100M [37]). (2) High resolution: all the videos are 720p which is much higher quality than existing datasets that are mostly 240p or 360p. (3) Diverse and balanced: we cover a wide range of topics from the YouTube, with 15 popular categories (e.g., sports, music, autos). Meanwhile, we ensure a balanced video clip + +![](images/48463ab6f4bc0a1fb0222243956b9a4597f22fa0a6f9d0a64a7e4b4d9c556e76.jpg) +Keep half an inch allowance with filler draw a smaller heart on the pattern fabric. Cut it out to make the heart sides identical. Fold it in half and trim. + +![](images/682dde5c82c4beb71483749dc946209060dce538d83a12d59fcf7705552b8f5a.jpg) +Mexican food is all around us. In Los Angeles, there are Taco stands on every corner. +Figure 1. Examples of video clips and ASR generated transcriptions in the proposed HD-VILA-100M dataset. We present six samples (four frames for each), with diverse video categories covering HowTo & Style, People & Blog, Sports, Travel & Event, Pets & Animals, Film & Animation. Relevant words from auto-generated video transcriptions are manually highlighted in red. [Best viewed in Color] + +![](images/810d163a8c69ff78ed305c79c5ab5015db1483d750f16b9d322121e2da17678b.jpg) +Applying the powder with a stippling motion instead of a sweeping motion, because I do not want to disturb my foundation brushes. + +![](images/58d3e7efea87dcab76cb593f9928437403dfd733642019a685e7bd7fd2e25251.jpg) +Some of you guys have seen the things I have in here are my husky collection and my stuffed animals. + +![](images/e2c95037e910ecf1825a8e2393378c4959f219d38e67a2315348e435434c3479.jpg) +A little slapstick comedy watch. Josh Donaldson hits a foul ball to the first base side and AJ Read knocks over a police officer. + +![](images/aadaa36b201085ea423e9a9e2898fca3f470c28cb07e2f315e748b38d45f0e42.jpg) +The gauntlet allows the wearer to wield all of the stones powers at once with one snap of his fingers. + +![](images/1753241bea8edb0f3c42db6d029a76b0bffb3bf23a4b971eaf65087c76f76aff.jpg) + +tch. Josh Donaldson hits ate and AJ Read knocks over + +![](images/4412edc1f08546a1d61cf64d740b93023b17f1d3d5aac308a9ce2eea2b137690.jpg) + +number in each category to ease underfit problem. + +To enable video-language pre-training, effective video representation is essential. Due to computational limitations (e.g., memory), previous works either 1) adopt simple frame-based encoders and turn to end-to-end visual encoding and multimodal fusion [27], or 2) choose advanced spatiotemporal encoders [5, 49], while having to do visual encoding and multimodal fusion step-by-step. Few works can learn joint spatiotemporal video representation with end-to-end video-language pre-training. + +In this paper, we propose to utilize hybrid image sequence that consists of few high-resolution (HR) frames and more low-resolution (LR) neighbor frames for multiple video learning tasks. Such a design enables end-to-end training with high-resolution spatiotemporal video representation. To achieve this goal, we tackle two questions: (1) Which HR and LR frames should be sampled? (2) How to learn spatiotemporal features with the hybrid image sequences? For the first problem, we randomly sample HR frames from a video clip to ensure the robustness of learned video features. LR frames are uniformly sampled from its surroundings considering that neighboring frames contain similar spatial information and are critical to temporal feature learning. Second, we propose to encode HR and LR frames separately while mapping HR feature to a joint embedding space with LR features by a hybrid Transformer. Such design ensures the spatiotemporal representation of videos to cover both HR and LR frames in a learnable way. The learned spatiotemporal feature is further combined with detailed spatial features, followed by a multimodal Transformer that learns to optimize video and language embedding in an end-to-end manner. + +Our contributions are summarized as follows: 1) We use automatic video transcriptions to build to-date the largest high-resolution and diversified video-language dataset; 2) We propose a novel pre-training framework to learn spatiotemporal information for video representation from hybrid image sequences that consist of HR and LR frames; 3) Extensive experiments verify the effectiveness of the learned cross-modality embedding in 10 video understanding and 2 text-to-visual generation tasks. The dataset, model and code are released1. + +# 2. Related Work + +Video Representation Video representation are typically designed with 2D/3D CNNs [5,46,49] or Transformers [4]. Pioneering works of VL pre-training [39,44,63] adopt pre-extracted video features (e.g., S3D [60], I3D [5]) for video representation. While in image-language pre-training, researchers find that end-to-end training will decrease the domain gap of visual representation and improve the generalization for image-text tasks [19]. While for video representation, it is too heavy to make the video-based encoder (e.g., S3D, I3D, ResNet [17], SlowFast [11]) trainable. Thus, some works [27,57] utilize the image-based encoder (e.g., ResNet [17], ViT [9]) with a sparse sampling mechanism to make the visual encoder trainable. In this paper, we explore how to make a video encoder trainable in consideration of both spatial and temporal features. + +Video-Language Pre-Training Vision and language pretraining has attracted extensive attention in very recent + +
DatasetDomain#Video clips#SentenceAvg len(sec)Sent lenDuration(h)Resolution
MSR-VTT [53]open10K200K15.09.340240p
DideMo [2]Flickr27K41K6.98.087-
LSMDC [41]movie118K118K4.87.01581080p
YouCook II [62]cooking14K14K19.68.8176-
How2 [43]instructional80K80K90.020.02K-
ActivityNet Caption [25]action100K100K36.013.5849-
WebVid-2M [3]open2.5M2.5M18.012.013K360p
HowTo100M [37]instructional136M136M3.64.0134.5K240p
HD-VILA-100M (Ours)open103M103M13.432.5371.5K720p
+ +Table 1. Statistics of HD-VILA-100M and its comparison with existing video-language datasets. + +years. Aligned with the success of image-language pretraining [19, 20, 54] and applications [7, 12-14, 18, 30], video-language pre-training is showing more and more promising potentials [27, 29, 39, 44, 45, 63]. Among them, some works concentrate on specific type of downstream tasks such as video-text retrieval [3, 52] and video question answering [57]. In this paper, we explore to pre-train a generalized model on diversified and large-scale data to adapt to different video-language tasks. Video-language pre-training tasks can be mainly categorized into two types: reconstructive, contrastive. Reconstructive methods [29, 44, 45, 63] usually adopt an early fusion architecture and aim to reconstruct a masked part in the visual or textual domain. Typical pre-training tasks are masked language modeling (MLM), masked frame modeling (FM), frame order modeling (FOM). Contrastive methods [35, 57] are inspired by contrastive learning and target to learn video-text matching. In this paper, we combine these two types of objectives for the final target. + +# 3. Dataset + +To facilitate the multimodal representation learning, we collect HD-VILA-100M, a large-scale, high-resolution, and diversified video-language dataset. + +# 3.1. Video Collection + +We choose YouTube as the video resource since it covers diverse categories of videos uploaded by different users, ranging from documentary films by professional TV channels to everyday vlogs by ordinary users. To cover more topics, we start from several official topics of YouTube videos. To ensure the high quality of videos as well as better alignment of video and transcription, we search on the YouTube website and a video analysis website ${}^{2}$ to find popular YouTube channels, such as BBC Earth, National Geography, etc. Videos in these channels and videos appeared in YouTube-8M [1] and YT-Temporal-180M [57] make up a list of 14 million videos. We only keep videos with subtitles and 720p resolution. We then limit the time length of each category to ${30}\mathrm{\;K}$ hours to avoid long tail. We only download videos with English transcripts. Finally, we obtain 3.3 mil + +![](images/1bdcc7bac7e2b7054ba7c12d371a5fb4f51b0ae0ff7523181407eb938379c43e.jpg) +Figure 2. The distribution of categories in HD-VILA-100M dataset: (a) video, (b) video clip. [Best viewed in Color] + +lion videos in total with high-quality and distributed in 15 categories in balance (as in Figure 2). + +# 3.2. Video Clip Selection and Text Processing + +To effectively generate video-text pairs, we use transcriptions along with the videos as the language in HD-VILA-100M. Different from traditional video-language datasets [2, 53] that use manual annotated descriptions for videos, transcriptions are available in large quantities and involve richer information. However, many subtitles in YouTube videos are generated by ASR and are usually fragmentary and lacking punctuation. To split the subtitles for complete sentences, we utilize an off-the-shelf tool which shows $75.7\%$ accuracy on its test set. Then we make video clips by aligning the sentences to corresponding clips via Dynamic Time Warping using the timestamp of the original subtitles. After processing, each pair in the HD-VILA-100M consists of a video clip about 13.4 seconds on average and a sentence with 32.5 words on average. + +# 3.3. Data Statistics + +The detailed data statistics of HD-VILA-100M are listed in Table 1. Compared with other video-language datasets, HD-VILA-100M is the largest video-language dataset in terms of duration and word number. More videos indicate richer visual information contained in HD-VILA-100M and longer sentences mean that the language includes more de + +![](images/b18d9d25ef59782f99f02bfed599fb431792192755246896fda4f7eb491fde82.jpg) +Figure 3. The framework of HD-VILA. Yellow and green colors indicate HR- and LR-related input, operation and output, respectively. Hybrid Transformer learns spatiotemporal representation from HR and LR features. [Best viewed in Color] + +tailed and richer semantics. Compared with HowTo100M [37] which only includes instructional videos, HD-VILA-100M is derived from a wide range of domains and videos of each category is relatively balanced as shown in Figure 2. This merit can improve the generalization power of the pretrained model. Moreover, all the videos in HD-VILA-100M are in 720p and the high quality ensures detailed information for video representation learning. In summary, HD-VILA-100M represents the largest, high-resolution, and diversified dataset for video and language learning. + +# 4. Approach + +Figure 3 shows the overall framework of High-resolution and Diversified Vldeo-LA language (HD-VILA) model that consists of three parts: (a) hybrid video encoder, (b) language encoder, and (c) multi-modal joint learning. + +# 4.1. Hybrid Video Encoder + +Since the video clips in our dataset are long-range with 13.4 seconds on average, we adopt the strategy of sparsely sampling a sequence of segments from a video clip and then aggregating their predictions similar to ClipBERT [27]. As explained in Section 1, for each segment $s_i$ , we randomly takes one HR frame at $t$ -th timestep $X_{t}^{s_i} \in \mathbb{R}^{3 \times H \times W}$ and $2N$ surrounding LR frames $\{X_{t + kr}^{s_i} \in \mathbb{R}^{3 \times \frac{H}{4} \times \frac{W}{4}}, k \in (-N, -1, 1, \dots, N)\}$ to build a hybrid image sequence, where $r$ is LR frame sampling rate. + +In Figure 3, the hybrid video encoder includes three parts: an HR encoder for HR frame, an LR encoder for LR + +neighbor frames and a Hybrid Transformer $T_{\mathrm{hy}}$ that learns spatiotemporal features by self-attention. HR encoder consists of a 4-stage ResNet $F_{\mathrm{hr}}$ and an adapter $D_{\mathrm{hr}}$ . LR encoder is a 3-stage ResNet $F_{\mathrm{lr}}$ to encode LR frames. Note that $F_{\mathrm{hr}}$ and $F_{\mathrm{lr}}$ are learnable to ensure both HR and LR frames can be encoded in the same space before feeding into Hybrid Transformer. We extract hybrid spatiotemporal feature $\mathcal{V}_{\mathrm{hy}}$ of segment $s_i$ as the output of $T_{\mathrm{hy}}$ . In addition, we use the HR frame feature extracted by stage 3 of $F_{\mathrm{hr}}$ (denoting as $F_{\mathrm{hr}}^3$ ) as HR input of $T_{\mathrm{hy}}$ : + +$$ +\mathcal {V} _ {\mathrm {h y}} = T _ {\mathrm {h y}} \left(F _ {\mathrm {l r}} \left(\boldsymbol {X} _ {t - N r} ^ {s _ {i}}\right), \dots , \phi \left(F _ {\mathrm {h r}} ^ {3} \left(\boldsymbol {X} _ {t} ^ {s _ {i}}\right)\right), \dots\right), \tag {1} +$$ + +where $\phi$ is an interpolate operation to align feature size. In $T_{\mathrm{hy}}$ , we adopt Divided Space-Time Attention to encode spatiotemporal information similar to [4]. We extract detailed spatial feature $\nu_{\mathrm{hr}}$ of segment $s_i$ as the output of $E_{\mathrm{hr}}$ by: + +$$ +\mathcal {V} _ {\mathrm {h r}} = D _ {\mathrm {h r}} \left(F _ {\mathrm {h r}} \left(\boldsymbol {X} _ {t} ^ {s _ {i}}\right)\right), \tag {2} +$$ + +To adapt the output of the HR encoder to the hybrid spatiotemporal feature $\mathcal{V}_{\mathrm{hy}}$ , $D_{\mathrm{hr}}$ consists of a convolution layer to adjust the output feature channel, as well as a $2\times 2$ max-pooling layer for down-sampling. The segment features is the fusion of $\mathcal{V}_{\mathrm{hr}}$ and $\mathcal{V}_{\mathrm{hy}}$ by a linear layer: + +$$ +\mathcal {V} = \operatorname {L i n e a r} \left(\left[ \mathcal {V} _ {\mathrm {h r}}, \mathcal {V} _ {\mathrm {h y}} \right]\right). \tag {3} +$$ + +# 4.2. Language Encoder and Multi-Modality Joint Embedding Learning + +For both language encoder and multi-modality joint embedding learning, we use self-attention to model the relationship of both uni-modality and multi-modality. More specifically, we adopt a 24-layer, 1024-dimensional Transformer, mirroring the BERT-large and initialize it with pretrained BERT-large parameters. We use the first 12 layers as language-only Transformer and the last 12 layers as multimodal Transformer. Language-only Transformer extracts language representation which is concatenated with video features of a segment as the input of multi-modal Transformer. We add learnable 1D and 2D position embedding to language and vision tokens, respectively. Such a modal-independent design has two advantages. Firstly, it enables to provide powerful embedding for a single-modal input in downstream tasks. For example, the vision-aware language-only embedding could be used for language-guided video generation tasks. Secondly, the two-stream architecture improves the calculation efficiency of similarity between video and language to linear complexity in some specific downstream tasks, such as video-language retrieval. + +# 4.3. Pre-Training Tasks + +We adopt two pre-training tasks in HD-VILA: video-language matching to enhance cross-modal matching and masked language modeling (MLM) to encourage the mapping between visual and language tokens in fine-grained + +
MethodAcc
ST-VQA [21]30.9
Co-Memory [16]32.0
AMU [50]32.5
Heterogeneous Mem [10]33.0
HCRN [26]35.6
ClipBERT PT [27]37.4
Ours40.0
+ +(a) MRSVTT-QA test set. + +
MethodAcc
CT-SAN [56]66.4
MLB [24]76.1
JSFusion [55]83.4
ActBERT PT [63]85.7
ClipBERT PT [27]88.2
VideoClip PT [52]92.1
Ours97.1
+ +(b) MRSVTT multiple-choice test. + +
MethodActionTransFrame
ST-VQA [21]60.867.149.3
Co-Memory [16]68.274.351.5
PSAC [31]70.476.955.7
HCRN [26]75.081.455.9
QueST [22]75.981.059.7
ClipBERT PT [27]82.887.860.3
Ours84.390.060.5
+ +(c) TGIF-QA test set. + +Table 2. Comparison of HD-VILA with state-of-the-art methods on video question answering tasks. (a) Results of ST-VQA and CoMemory are implemented by [10]. (b) Results of CT-SAN and MLB are implemented by [55]. + +level. In particular, since the matching between video and language is somewhat weak compared with the video description dataset, we apply contrastive video-language matching to take advantage of large data. + +Contrastive Video-Language Matching To align the feature space of video and language, we use a contrastive loss to maximize the similarity of a video clip and a sentence. Specifically, we treat matched pairs in a batch as positives, and all other pairwise combinations as negatives: + +$$ +\mathcal {L} _ {v 2 t} = - \frac {1}{B} \sum_ {i = 1} ^ {B} \log \frac {\exp \left(v _ {i} ^ {\top} t _ {i} / \tau\right)}{\sum_ {j = 1} ^ {B} \exp \left(v _ {i} ^ {\top} t _ {j} / \tau\right)} \tag {4} +$$ + +$$ +\mathcal {L} _ {t 2 v} = - \frac {1}{B} \sum_ {i = 1} ^ {B} \log \frac {\exp (t _ {i} ^ {\top} v _ {i} / \tau)}{\sum_ {j = 1} ^ {B} \exp (t _ {i} ^ {\top} v _ {j} / \tau)}, +$$ + +where $v_{i}$ and $t_j$ are the normalized embeddings of $i$ -th video and $j$ -th sentence in a batch of size $B$ and $\tau$ is the temperature. Video and sentence features are computed by our hybrid video encoder and language encoder. The mean of segment embeddings is used as the video-level embedding. + +Masked Language Modeling We adopt Masked Language Modeling (MLM) to better build the mapping between visual and language domain. MLM aims to predict the ground-truth labels of masked text tokens from the contextualized tokens: + +$$ +\mathcal {L} _ {\mathrm {M L M}} = - \mathbb {E} _ {(\mathcal {W}, \mathcal {V})} \log p (w _ {i} \mid \mathcal {W} _ {i}, \mathcal {V}), \tag {5} +$$ + +where $\mathcal{W}$ denotes the text embedding token set, $\nu$ denotes the visual token set, and $w_{i}$ denotes the masked token. $(\mathcal{W},\mathcal{V})$ is sampled from the distribution of text-video pairs. We adopt the same masking strategy as in BERT and use an MLP as the MLM head to output logits over vocabulary, which is then computed as the negative log-likelihood loss for the masked token. We aggregate the logits of different segments to derive a consensus, so that MLM is able to be calculated in video-level as we adopt in the approach. + +# 5. Experiments + +In this section, we conduct extensive experiments to evaluate the proposed HD-VILA pre-training model. + +# 5.1. Pre-training Details + +Inspired by the idea of "align before fuse" [28], we adopt a two-stage fashion for pre-training on HD-VILA100M dataset. In the first stage, we perform the contrastive video-language matching task to learn cross-modality alignment. In the second stage, MLM task is performed to facilitate cross-modal understanding. For video encoder, we use ResNet-50 for $F_{hr}$ and $F_{lr}$ , and a 4-layer Transformer with 16 heads and 1024 hidden size for $T_{hy}$ . We empirically divide a video clip into two segments and sample seven frames for each segment. In this setting, the two segments can cover about 6s video content, which are adequate to model the video clips in our dataset. Besides, we randomly crop $640 \times 1024$ areas for the middle HR frames, and select aligned $160 \times 256$ areas for LR neighboring frames. The size of resultant feature map before feeding into the multimodal Transformer is $10 \times 16$ . For language, we follow BERT [8] to adopt the WordPiece tokenizer to split a sentence into word tokens with a max length of 50. + +In pre-training, we use AdamW optimizer [34] with an initial learning rate of 5e-5 and a fixed weight decay of 1e-3. We also employ a linear decay learning rate schedule with a warm-up strategy. We train our model with 128 NVIDIA Tesla V100 GPUs for stage one and 32 for stage two. The batch size is set to 1024 and the contrastive similarity is calculated on gathered features from all GPUs. We train 7 epochs for stage one and 4 epochs for stage two empirically. We freeze the encoders during the second stage and keep the same batch size for both stages. In downstream tasks, we keep the same model configuration if not otherwise specified. We exclude the YouTube Ids in the downstream tasks from our collected HD-VILA-100M during pre-training. + +# 5.2. Video Question and Answering + +Datasets (a) MSRVTT-QA [50] is created based on video and captions in MSR-VTT [53]. Given a question in a complete sentence, the model selects an answer from a pre-defined set. (b) MSRVTT multiple-choice test [55] is a multiple-choice task with videos as queries, and captions as answers. Each video contains five candidate captions, with only one positive match. (c) TGIF-QA [21] is build on GIF videos. We experiment with three TGIF-QA tasks: + +
MethodR@1 ↑R@5 ↑R@10 ↑MedR ↓
HowTo100M [37]14.940.252.89.0
CE [32]20.948.862.46.0
DECEMBERT [45]17.544.358.69.0
HERO [29]16.843.457.7-
ClipBERT [27]22.046.859.96.0
VLM [51]28.155.567.44.0
MMT [15]26.657.169.64.0
Support Set [39]30.158.569.33.0
VideoCLIP [52]32.262.675.0-
Ours35.665.378.03.0
Zero-shot
HT MIL-NCE [35]9.924.032.429.5
Support Set [39]8.723.031.131.0
VideoCLIP [52]10.422.230.0-
Ours14.634.444.115.0
+ +Table 3. Comparison of text-to-video retrieval in MSR-VTT [53]. We gray out some lines to highlight fair comparisons with traditional retrieval models and general pre-training models. This mark is also applicable to Table 5, 6. + +Action is defined as a multiple-choice task to identify an action that has been repeated in a video. Transition aims to identify the state before or after another state. FrameQA is about open-ended questions about the given video. The task objective is identical to MSRVTT-QA. More details are in the supplementary materials. + +Implementation Details For TGIF Action and Transition, we respectively concatenate five candidate answers with the question into five sequences. On top of the [CLS] token of the question, we train a two-layer MLP to predict the confidence of the five candidates with cross-entropy loss. For MSRVTT-QA and TGIF Frame, we encode the answers in a one-hot fashion, and train 2-layer MLP classifier over all answer candidates with a cross-entropy loss on-top of the [CLS] token of the question. For MSRVTT Multiple-choice, we directly choose the answer with the highest similarity. We set the max batch size to fine-tune on 8 V100 32G GPUs. More details are in the supplementary materials. + +Results In Table 2, the results of HD-VILA on video QA show that our model outperforms existing methods on five tasks in all the three datasets. On MSRVTT-QA and MSRVTT multiple-choice tests, we achieve 2.6 and 5.0 absolute improvement over SOTA methods. On TGIF-QA dataset, we have 1.5, 2.2 and 0.2 absolute improvements on Action, Trans and Frame tasks. The limited gain of Frame is due to that Frame focuses on single frame while hindering the advantage of our hybrid image sequence. Among all the compared methods, ClipBERT [27] and ActBERT [63] are pre-training models. We can see that pre-training with more data will marginally improve the performance. Compared with ClipBERT which is pre-trained on image-language dataset, videos provide richer information. Note that the language used in ClipBERT pre-training is more closer to downstream tasks in both content and length while the lan + +
MethodR@1 ↑R@5 ↑R@10 ↑MedR ↓
HERO [29]2.1-11.4-
S2VT [47]11.933.6-13.0
FSE [59]13.936.0-11.0
CE [32]16.141.1-8.3
ClipBERT [27]20.448.060.86.0
Ours28.857.469.14.0
+ +Table 4. Comparison of text-to-video retrieval on DiDeMo [2]. + +
MethodR@1 ↑R@5 ↑R@10 ↑MedR ↓
JSFusion [55]9.121.234.136.0
MEE [36]9.325.133.427.0
CE [32]11.226.934.825.3
MMT [15]12.929.940.119.3
Ours17.434.144.115.0
+ +Table 5. Comparison of text-to-video retrieval on LSMDC [41]. + +
MethodR@1↑R@5↑R@50↑MedR ↓
FSE [59]18.244.889.17.0
CE [32]18.247.791.46.0
HSE [59]20.549.3--
ClipBERT [27]21.349.0-6.0
MMT [15]28.761.494.53.3
Support Set [39]29.261.694.73.0
Ours28.557.494.04.0
+ +Table 6. Comparison of text-to-video retrieval on ActivityNet [25]. + +guage in HD-VILA-100M has domain gap with TGIF and MSR-VTT languages. This further indicates the generalization of the video representation learned by our HD-VILA. + +# 5.3. Video-Text Retrieval + +Datasets We conduct video-text retrieval experiments on four datasets. (a) MSR-VTT [53] contains 10K YouTube videos with 200K descriptions. We follow previous works [32, 55], training models on 9K videos, and reporting results on the 1K-A test set. (b) DiDeMo [2] consists of 10K Flickr videos annotated with 40K sentences. We follow [32, 59] to evaluate paragraph-to-video retrieval, where all descriptions for a video are concatenated to form a single query. (c) LSMDC [41] consists of 118,081 video clips sourced from 202 movies. Each video has a caption. Evaluation is conducted on a test set of 1,000 videos from movies disjoint from the train and validation sets. (d) ActivityNet Captions [25] contains 20K YouTube videos annotated with 100K sentences. We follow the paragraph-to-video retrieval protocols [32, 59] training on 10K videos and reporting results on the val1 set with 4.9K videos. + +Implementation Details We adjust the number of sampled segments and frames according to the average time of videos for each dataset. We adopt stage one model and the same training methods and objective for fine-tuning. We resize HR frame of each segment to 720p and LR frames to 180p. More details are in the supplementary materials. + +Results Table 3, 4, 5, 6 show the text-to-video retrieval results of HD-VILA on four datasets. For MSR-VTT, we + +![](images/071c8fb4c7c8786e87db653621a762d704cb838305c34f772ce42fd20dd40736.jpg) +She has wavy hair and wears red lipstick. + +![](images/e663cbe0f5e016cd61a61a4779a99c6b66e922742199b522fea1b6958eadf91b.jpg) + +![](images/c3f2d721712a7b540d4e30df3128a22e63d55d0398bc8e5a19755435e096a8be.jpg) + +![](images/958234b3ca5b2ec807f9f0fa95e0c3a77cfcb2d70dacc6fac03c73141e2ee65f.jpg) + +![](images/00b49a62045c3d697eb9480266428259e5869e27c2cd2482b6b38db245d365dc.jpg) +This man has goatee and he is smiling. + +![](images/59775db5246969750bd11b1bb0fc80d40d3d2098669a93fb878090aff059c06d.jpg) + +![](images/dfad21c9664a780e32ca70f3b10b6208a039039232deee3140a72d8305e6b60b.jpg) + +![](images/1500939b8c49fd7ffda6d2b6b66dccb32a0802c79d0a5fba5216e9cf39fb5cb8.jpg) + +![](images/ae7304c15a0bb29652dd7c115c58ca0eb29782a3c00974a1f59511b3bf52dd26.jpg) +This person is chubby and has rosy cheeks. + +![](images/a0706ee50e45569f7ecf64d2ab8bd8630b5da522dcf5add7b9b13fe2df5ae997.jpg) + +![](images/239c643a3af3339c7941b12ab881b03edf4ae9fe91368f8818fd463b008f35fb.jpg) + +![](images/4ae243cdcbe07bb1471305dee043135fbe4a3dc9d858ac98a2cbf2afdeb4e6ac.jpg) + +![](images/0ff0a77659c824ece9b1cfb15361782d9ce83ea9e8671c5da565971315594f15.jpg) +This man has black bushy eyebrows and bangs. +Input +Figure 4. Text-guided manipulation compared with StyleCLIP [38] and TediGAN [48]. Our model is able to handle complex descriptions and edit the inputs according to the target attributes (highlighted in red) better. All the inputs are of $1024 \times 1024$ size. + +![](images/3c7a866a72634d9aab57e8eb949926a52907e6c4773fad488a6584b969eea152.jpg) +Ours + +![](images/80821c3b0a16f71837a67bcfbec681e15964271b80d2523c8165652bdc4e3a82.jpg) +StyleCLIP + +![](images/7b91919efe73c06398a8c0c089191e180c277f1f92cb8a207de372914817ae43.jpg) +TediGAN + +outperform the previous works by large margins in both zero-shot and fine-tuning settings. In particular, compared with VideoCLIP [52], we have $40.4\%$ relatively gains of R@1 in zero-shot setting, which shows the generalization ability of our pre-trained feature. In LSMDC, we further obtain much larger relative gains with $55.4\%$ under fair comparison. This comes from smaller domain gap between movie videos in LSMDC and our HD-VILA-100M compared with HowTo100M in two aspects: semantic (both open domains) and resolution (both high-resolution). On DiDeMo and ActivityNet, our model also achieves better performance. The videos in these two datasets are diversified in both scale and category, and are much longer. The results show that our model pre-trained on HD-VILA-100M with longer videos and richer semantics shows better capacity for temporal understanding. Note that there are also pre-training models that are specifically designed for videotext retrieval task by improving noise contrastive learning like SupportSet [39], or use more features other than vision and motion like MMT [15]. To make fair comparison, we gray them out in tables. + +# 5.4. Text-to-Visual Generation + +Recent studies like StyleCLIP [38] and TediGAN [48] propose to leverage cross-modal pre-training power to facilitate language-guided generation tasks, and have obtained + +![](images/e92de6e4065dbac0145d17982233e392354fa866be0b367fd04b578564473160.jpg) +This person has blond hair, arched eyebrows, oval face, and rosy cheeks. + +![](images/e81bbb8abaf55246d1a7bba19e8bb7a2d5533808d3ade9b30bfd7706d0ae9e67.jpg) + +![](images/5525e1a6ff0562da55b90d6526c0365e0b0d0d1b0f5752976c07877b136c0137.jpg) + +![](images/b3b8c2a98d0ac3492e07f9f1cdd406236390dc17fe579552d1e1fed2a0315e8c.jpg) + +![](images/c9a4252c24aabfe508f5510c8ce2783ab56332635c5f427da2e2b75767f667d0.jpg) +She wears lipstick. She has arched eyebrows, and straight hair. + +![](images/e50cd2b59190514693587a3f18171059028e712e0dbda059e1f285e439ab14bd.jpg) + +![](images/4a7ff4f37cbb51ff5523f5b3dfff21a984d119c787f8e0b2192594616ce693fe.jpg) + +![](images/76019894ab9e4aecc3155a468e3f4ae028267108b156cdba343156f428add847.jpg) + +![](images/5085d5ee2b608260ba13acfb91dd67a7eaf5bbba8667dfc6441ddef90ddd3876.jpg) +The man has high cheekbones, big nose, and eyeglasses. +The man has black hair and short beard. + +![](images/2cdede387e9616825a5a12a1f435002db3bcd11b21b15bde1c1bdcd1daecbb98.jpg) + +![](images/c61b52d883a27cf7be4995d100d5860ba9be54fb605512086d347d4965402ac7.jpg) + +![](images/356224c10f7c0aa1d9d985640bfa12db2399b9ab55b875cfb8467284cd3ffc3f.jpg) + +![](images/9e248f22bf375380eba6f0ff103f2e188fdcdcf96df9cd04798beb902b91eb6b.jpg) +Input + +![](images/26578a4a4857c01d34799b5ae62f2f3efc46d605ee4e628a73016c938495c305.jpg) +Ours +Figure 5. Text-guided super-resolution compared with pSp [40] and SR3 [42]. Our model is able to reconstruct more accurate target attributes with descriptions (e.g., eyeglasses in the third case). All inputs are upsampled from $16 \times 16$ to $1024 \times 1024$ . + +![](images/91d0bdcccbe6445217ede582320956f97efe3c27499cfe731b5d807cf2700f59.jpg) +pSp + +![](images/38902e2f692ee5322eb2f586bacde47b185793586388cdafd93201a174a65374.jpg) +SR3 + +some promising results. As shown in their work, the quality of visual generation results can reflect the quality of cross-modality embedding. Hence, in this section, we will specify how our pre-trained model can achieve this task, and verify our learned embedding by showing higher-quality visualized results compared with SOTA models. + +Datasets To conduct this research, we introduce the first Face-Description-Video Dataset (FDVD). The dataset consists of 613 high-resolution $(1024\times 1024)$ videos, resulting in 74,803 frames of human faces. The videos are collected from Ryerson audio-visual dataset [33]. We generate ten different text descriptions for each video following previous works [48]. To increase the diversity of human faces, we also leverage Multi-modal CelebA-HQ [48] for training. + +Implementation Details We follow previous works [38, 48] to leverage a well-pre-trained StyleGAN [23, 58, 61] as our generator, due to its superior performance. In practice, we learn several linear layers to map the vision and text embedding in HD-VILA to the latent codes $w^{+}$ used in StyleGAN. Then, images can be generated by the latent codes. To ensure the visual quality, identity preservation, and matching with descriptions of the generated results, we carefully choose a set of losses for optimization. More details are in the supplementary materials. + +Text-to-Visual Editing We compare our model with the recent state-of-the-art text-guided editing models, StyleCLIP [38] and TediGAN [48] in Figure 4. The results show that our model is able to edit the target attributes of inputs according to text descriptions. For example, in the first case in Figure 4, our model turns the hair to wavy hair and also wears lipstick on the lips, where StyleCLIP and TediGAN fail to wear lipstick on the face. Some video cases will be presented in supplementary materials. + +Text-to-Visual Super-Resolution We further compare our model with SOTA super-resolution methods SR3 [42] and pSp [40]. We generate $1024 \times 1024$ images from their $16 \times 16$ LR counterparts. Note that this task is extremely challenging due to such low-resolution inputs. As shown in the second case of Figure 5, SR3 [42] and pSp [40] can not reconstruct high-quality faces by only using visual information. Compared with them, our model is able to accurately reconstruct the lipstick and the straight hair with the help of text description, thanks to the pre-trained models. + +# 5.5. Ablation Studies + +In this section, we conduct ablation studies to further verify the effectiveness of the new HD-VILA-100M dataset, and the proposed hybrid video encoder. + +(1) Diversity of HD-VILA-100M. We sample two video subsets from HD-VILA-100M with two million clip-text pairs for each. One subset only includes "HowTo" type, while the other consists of diversified and balanced categories sampled from the full dataset. As shown in Table 7, compared with the "HowTo" dataset with limited semantics, our diversified pre-training dataset (indicated as "Ours-720p") helps to achieve higher performance in the MSR-VTT retrieval task, with relative $66.7\%$ R@1 gains. We choose MSR-VTT zero-shot retrieval task for this ablation study, as it is the most widely-used evaluation task in video-language pre-training. We also make fair comparison with HowTo100M [37]. we have tried our best to collect HowTo100M at 720p, in which $69\%$ videos are originally at 720p, and $31\%$ are at 240p (w/o HR source) and upsampled to 720p by applying the most commonly used bicubic interpolation. We select MSR-VTT retrieval which is the most widely-used benchmark for pre-training evaluation. We report the comparison in Table 8. We compare pre-training on two datasets for the same steps (145K) and fine-tuning with the same setting. HD-VILA-100M pre-trained model surpasses HowTo100M by a large margin. This shows the advantage of HD-VILA-100M. + +(2) High-resolution of HD-VILA-100M. We downsample "Ours-720p" subset into lower resolutions ("Ours-360p"), and observed a significant drop with $29.1\%$ relative decreases of R@1. Such evaluations demonstrate the superiority of the diversified categories and higher resolution of the proposed dataset. + +
TypeSizeR@1↑R@5↑R@10↑MedR↓
HowTo720p3.38.213.5113.0
Ours360p3.911.018.367.0
Ours720p*4.513.020.262.0
Ours720p5.513.120.558.0
+ +Table 7. Ablation study on two subsets of pre-training data. We report results of zero-shot MSR-VTT retrieval. $720\mathrm{p}^*$ indicates bi-cubic upsampled frames (360p to 720p). + +
DatasetR@1↑R@5↑R@10↑MedR↓
HowTo100M19.649.061.96.0
Ours30.058.172.34.0
+ +Table 8. Comparison of pre-training datasets on MSR-VTT retrieval with the same steps. + +
#HR#LRR@1↑R@5↑R@10↑MedR ↓
1016.340.053.39.0
01026.757.069.54.0
1633.064.476.23.0
11035.665.378.03.0
11433.764.176.23.0
+ +Table 9. Ablation study on frame selection. We report results of MSR-VTT retrieval, where #HR/#LR are the numbers of high/low-resolution frames. + +(3) Numbers of HR/LR frames. As the number of high/low-resolution frames used for video modeling often plays a key role in video pre-training, we adjust frame numbers and fine-tune the pre-training model in different settings. As shown in Table 9, high-resolution frames lead to significant increases compared with the setting only using low-resolution inputs. In particular, the setting of 1-HR & 10-LR achieves the best performance, compared with 0-HR & 10-LR ("0" indicates that one branch is removed), and 1-HR & 0-LR, which demonstrates the rationality of jointly modeling spatial and temporal features in our approach. + +# 6. Conclusion + +In this paper, we propose to learn high-resolution and diversified video-language multi-modal representation by pre-training on large-scale video-language pairs. To empower pre-training, we introduce a new dataset HD-VILA-100M which is the largest high-resolution and diversified video-language dataset. To more efficiently employ the richer information in videos, we propose a novel pretraining model HD-VILA that learns spatiotemporal information using HR and LR frames as a hybrid image sequence with a hybrid Transformer. Experiments on 12 video-language understanding and text-to-visual generation tasks show the capability of HD-VILA-100M dataset and the effectiveness of our model. + +Acknowledgement We would like to thank the insightful discussion, valuable suggestions and kind help from Prof. Jiebo Luo, Prof. Ruihua Song, Prof. Limin Wang, Houwen Peng, and Dongdong Chen. + +# References + +[1] Sami Abu-El-Haija, Nisarg Kothari, Joonseok Lee, Paul Natsev, George Toderici, Balakrishnan Varadarajan, and Sudheendra Vijayanarasimhan. Youtube-8m: A large-scale video classification benchmark. arXiv preprint arXiv:1609.08675, 2016.3 +[2] Lisa Anne Hendricks, Oliver Wang, Eli Shechtman, Josef Sivic, Trevor Darrell, and Bryan Russell. Localizing moments in video with natural language. In ICCV, pages 5803-5812, 2017. 1, 3, 6 +[3] Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. Frozen in time: A joint video and image encoder for end-to-end retrieval. In ICCV, 2021. 1, 3 +[4] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? In ICML, July 2021. 2, 4 +[5] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, pages 6299-6308, 2017. 2 +[6] Bisheng Chen, Jingdong Wang, Qinghua Huang, and Tao Mei. Personalized video recommendation through tripartite graph propagation. In ACM MM, pages 1133-1136, 2012. 1 +[7] Shizhe Chen, Bei Liu, Jianlong Fu, Ruihua Song, Qin Jin, Pingping Lin, Xiaoyu Qi, Chunting Wang, and Jin Zhou. Neural storyboard artist: Visualizing stories with coherent image sequences. In ACM MM, pages 2236-2244, 2019. 3 +[8] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In *NAACL*, pages 4171–4186, 2019. 1, 5 +[9] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2020. 2 +[10] Chenyou Fan, Xiaofan Zhang, Shu Zhang, Wensheng Wang, Chi Zhang, and Heng Huang. Heterogeneous memory enhanced multimodal attention model for video question answering. In CVPR, pages 1999-2007, 2019. 5 +[11] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In CVPR, pages 6202-6211, 2019. 2 +[12] Jianlong Fu, Tao Mei, Kuiyuan Yang, Hanqing Lu, and Yong Rui. Tagging personal photos with transfer deep learning. In WWW, pages 344-354, 2015. 3 +[13] Jianlong Fu and Yong Rui. Advances in deep learning approaches for image tagging. APSIPA, 6, 2017. 3 +[14] Jianlong Fu, Jinqiao Wang, Yong Rui, Xin-Jing Wang, Tao Mei, and Hanqing Lu. Image tag refinement with view-dependent concept representations. T-CSVT, 25(8):1409-1422, 2014. 3 +[15] Valentin Gabeur, Chen Sun, Karteek Alahari, and Cordelia Schmid. Multi-modal transformer for video retrieval. In ECCV, pages 214-229, 2020. 6, 7 +[16] Jiyang Gao, Runzhou Ge, Kan Chen, and Ram Nevatia. Motion-appearance co-memory networks for video question answering. In CVPR, pages 6576–6585, 2018. 5 + +[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770-778, 2016. 2 +[18] Yupan Huang, Hongwei Xue, Bei Liu, and Yutong Lu. Unifying multimodal transformer for bi-directional image and text generation. In ACM MM, pages 1138-1147, 2021. 3 +[19] Zhicheng Huang, Zhaoyang Zeng, Yupan Huang, Bei Liu, Dongmei Fu, and Jianlong Fu. Seeing out of the box: End-to-end pre-training for vision-language representation learning. In CVPR, pages 12976-12985, 2021. 1, 2, 3 +[20] Zhicheng Huang, Zhaoyang Zeng, Bei Liu, Dongmei Fu, and Jianlong Fu. Pixel-bert: Aligning image pixels with text by deep multi-modal transformers. arXiv preprint arXiv:2004.00849, 2020.3 +[21] Yunseok Jang, Yale Song, Youngjae Yu, Youngjin Kim, and Gunhee Kim. Tgif-qa: Toward spatio-temporal reasoning in visual question answering. In CVPR, pages 2758–2766, 2017. 5 +[22] Jianwen Jiang, Ziqiang Chen, Haojie Lin, Xibin Zhao, and Yue Gao. Divide and conquer: Question-guided spatiotemporal contextual attention for video question answering. In AAAI, pages 11101-11108, 2020. 5 +[23] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, pages 4401-4410, 2019. 7 +[24] Jin-Hwa Kim, Kyoung-Woon On, Woosang Lim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard product for low-rank bilinear pooling. In ICLR, 2016. 5 +[25] Ranjay Krishna, Kenji Hata, Frederic Ren, Li Fei-Fei, and Juan Carlos Niebles. Dense-captioning events in videos. In ICCV, pages 706–715, 2017. 3, 6 +[26] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Hierarchical conditional relation networks for video question answering. In CVPR, pages 9972-9981, 2020. 5 +[27] Jie Lei, Linjie Li, Luowei Zhou, Zhe Gan, Tamara L Berg, Mohit Bansal, and Jingjing Liu. Less is more: Clipbert for video-and-language learning via sparse sampling. In CVPR, pages 7331-7341, 2021. 1, 2, 3, 4, 5, 6 +[28] Junnan Li, Ramprasaath R. Selvaraju, Akhilesh Deepak Gotmare, Shafiq R. Joty, Caiming Xiong, and Steven C. H. Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, 2021. 5 +[29] Linjie Li, Yen-Chun Chen, Yu Cheng, Zhe Gan, Licheng Yu, and Jingjing Liu. Hero: Hierarchical encoder for video+ language omni-representation pre-training. In EMNLP, pages 2046-2065, 2020. 3, 6 +[30] Nanxing Li, Bei Liu, Zhizhong Han, Yu-Shen Liu, and Jianlong Fu. Emotion reinforced visual storytelling. In ICMR, pages 297-305, 2019. 3 +[31] Xiangpeng Li, Jingkuan Song, Lianli Gao, Xianglong Liu, Wenbing Huang, Xiangnan He, and Chuang Gan. Beyond rnns: Positional self-attention with co-attention for video question answering. In AAAI, pages 8658–8665, 2019. 5 +[32] Yang Liu, Samuel Albania, Arsha Nagrani, and Andrew Zisserman. Use what you have: Video retrieval using representations from collaborative experts. In BMVC, 2019. 6 + +[33] Steven R Livingstone and Frank A Russo. The ryerson audio-visual database of emotional speech and song (ravdess): A dynamic, multimodal set of facial and vocal expressions in north american english. PloS one, page e0196391, 2018. 7 +[34] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In *ICLR*, 2019. 5 +[35] Antoine Miech, Jean-Baptiste Alayrac, Lucas Smaira, Ivan Laptev, Josef Sivic, and Andrew Zisserman. End-to-end learning of visual representations from uncurated instructional videos. In CVPR, pages 9879-9889, 2020. 3, 6 +[36] Antoine Miech, Ivan Laptev, and Josef Sivic. Learning a text-video embedding from incomplete and heterogeneous data. arXiv preprint arXiv:1804.02516, 2018. 6 +[37] Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, and Josef Sivic. Howto100m: Learning a text-video embedding by watching hundred million narrated video clips. In ICCV, pages 2630-2640, 2019. 1, 3, 4, 6, 8 +[38] Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. Styleclip: Text-driven manipulation of stylegan imagery. In ICCV, pages 2085–2094, 2021. 1, 7, 8 +[39] Mandela Patrick, Po-Yao Huang, Yuki Asano, Florian Metze, Alexander G Hauptmann, Joao F. Henriques, and Andrea Vedaldi. Support-set bottlenecks for video-text representation learning. In ICLR, 2021. 1, 2, 3, 6, 7 +[40] Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or. Encoding in style: a stylegan encoder for image-to-image translation. In CVPR, pages 2287–2296, 2021. 7, 8 +[41] Anna Rohrbach, Atousa Torabi, Marcus Rohrbach, Niket Tandon, Christopher Joseph Pal, H. Larochelle, Aaron C. Courville, and Bernt Schiele. Movie description. *IJCV*, pages 94–120, 2016. 3, 6 +[42] Chitwan Sahara, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv preprint arXiv:2104.07636, 2021. 7, 8 +[43] Ramon Sanabria, Ozan Caglayan, Shruti Palaskar, Desmond Elliott, Loic Barrault, Lucia Specia, and Florian Metze. How2: A large-scale dataset for multimodal language understanding. In NeurIPS, 2018. 3 +[44] Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. Videobert: A joint model for video and language representation learning. In ICCV, pages 7464-7473, 2019. 2, 3 +[45] Zineng Tang, Jie Lei, and Mohit Bansal. December: Learning from noisy instructional videos via dense captions and entropy minimization. In NAACL, pages 2415-2426, 2021. 3, 6 +[46] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In ICCV, pages 4489-4497, 2015. 2 +[47] Subhashini Venugopalan, Huijuan Xu, Jeff Donahue, Marcus Rohrbach, Raymond J Mooney, and Kate Saenko. Translating videos to natural language using deep recurrent neural networks. In HLT-NAACL, 2015. 6 + +[48] Weihao Xia, Yujiu Yang, Jing-Hao Xue, and Baoyuan Wu. Tedigan: Text-guided diverse face image generation and manipulation. In CVPR, pages 2256-2265, 2021. 1, 7, 8 +[49] Saining Xie, Chen Sun, Jonathan Huang, Zhuowen Tu, and Kevin Murphy. Rethinking spatiotemporal feature learning: Speed-accuracy trade-offs in video classification. In ECCV, pages 305–321, 2018. 2 +[50] Dejing Xu, Zhou Zhao, Jun Xiao, Fei Wu, Hanwang Zhang, Xiangnan He, and Yueting Zhuang. Video question answering via gradually refined attention over appearance and motion. In ACM MM, page 1645-1653, 2017. 5 +[51] Hu Xu, Gargi Ghosh, Po-Yao Huang, Prahal Arora, Masoumeh Aminzadeh, Christoph Feichtenhofer, Florian Metze, and Luke Zettlemoyer. Vlm: Task-agnostic videolanguage model pre-training for video understanding. arXiv preprint arXiv:2105.09996, 2021. 6 +[52] Hu Xu, Gargi Ghosh, Po-Yao Huang, Dmytro Okhonko, Armen Aghajanyan, Florian Metze, Luke Zettlemoyer, and Christoph Feichtenhofer. Videoclip: Contrastive pre-training for zero-shot video-text understanding. In EMNLP, pages 6787-6800, 2021. 1, 3, 5, 6, 7 +[53] Jun Xu, Tao Mei, Ting Yao, and Yong Rui. Msr-vtt: A large video description dataset for bridging video and language. In CVPR, pages 5288-5296, 2016. 1, 3, 5, 6 +[54] Hongwei Xue, Yupan Huang, Bei Liu, Houwen Peng, Jianlong Fu, Houqiang Li, and Jiebo Luo. Probing intermodality: Visual parsing with self-attention for vision-and-language pre-training. 34, 2021. 3 +[55] Youngjae Yu, Jongseok Kim, and Gunhee Kim. A joint sequence fusion model for video question answering and retrieval. In ECCV, pages 471-487, 2018. 5, 6 +[56] Youngjae Yu, Hyungjin Ko, Jongwook Choi, and Gunhee Kim. End-to-end concept word detection for video captioning, retrieval, and question answering. In CVPR, pages 3261-3269, 2017. 5 +[57] Rowan Zellers, Ximing Lu, Jack Hessel, Youngjae Yu, Jae Sung Park, Jize Cao, Ali Farhadi, and Yejin Choi. Merlot: Multimodal neural script knowledge models. In NeurIPS, 2021. 2, 3 +[58] Yanhong Zeng, Huan Yang, Hongyang Chao, Jianbo Wang, and Jianlong Fu. Improving visual quality of image synthesis by a token-based generator with transformers. In NeurIPS, volume 34, 2021. 7 +[59] Bowen Zhang, Hexiang Hu, and Fei Sha. Cross-modal and hierarchical modeling of video and text. In ECCV, pages 374-390, 2018. 6 +[60] Da Zhang, Xiyang Dai, Xin Wang, and Yuan-Fang Wang. S3d: Single shot multi-span detector via fully 3d convolutional network. In BMVC, 2018. 2 +[61] Heliang Zheng, Jianlong Fu, Yanhong Zeng, Jiebo Luo, and Zheng-Jun Zha. Learning semantic-aware normalization for generative adversarial networks. In NeurIPS, 2020. 7 +[62] Luowei Zhou, Chenliang Xu, and Jason J. Corso. Towards automatic learning of procedures from web instructional videos. In AAAI, 2018. 3 +[63] Linchao Zhu and Yi Yang. Actbert: Learning global-local video-text representations. In CVPR, pages 8746-8755, 2020. 2, 3, 5, 6 \ No newline at end of file diff --git a/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/images.zip b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9f4c02b33e9f01397a731222d189dc9b85c5f072 --- /dev/null +++ b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c27576399504aea0f497b5a042e2f53b4e6671ceb90ac53b72e05a89a4ab053 +size 729805 diff --git a/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/layout.json b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d7aa342646430080f322ecafadc868e2a0dcaee4 --- /dev/null +++ b/advancinghighresolutionvideolanguagerepresentationwithlargescalevideotranscriptions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca0e31f203fdf22eae72c536fc4bc2ef34b3bf34e136235ae03bd06bffeca8ab +size 466646 diff --git a/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_content_list.json b/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3839d23174f042bacc6ba9171252aaf107d7560d --- /dev/null +++ b/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8774840de864b6a92575538e7e2c2e5b3b841c8e86020ebd3158644fbc9775c1 +size 70981 diff --git a/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_model.json b/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c1f91df4beeb0b24a213c4e0d1dd1e3dbf0e807e --- /dev/null +++ b/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b17862d691434c039216e2a9fe7d1c72ad004e2500dc73bf42c74c3cfdeb7ca +size 88083 diff --git a/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_origin.pdf b/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9f9bef23a7c8fcfa51d3a9e6ddf418a71707cf93 --- /dev/null +++ b/adversarialeigenattackonblackboxmodels/abec8e4c-7a9f-4d89-98f9-bf354843b599_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80ac2305eb35b76d19673157333e87b2f38a5973c15f55abdd03c3af0c1d4711 +size 361901 diff --git a/adversarialeigenattackonblackboxmodels/full.md b/adversarialeigenattackonblackboxmodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b93953e1339ce0c27a4ee3d4c1944ad9885be038 --- /dev/null +++ b/adversarialeigenattackonblackboxmodels/full.md @@ -0,0 +1,291 @@ +# Adversarial Eigen Attack on Black-Box Models + +Linjun Zhou $^{1}$ Peng Cui $^{1}$ Xingxuan Zhang $^{1}$ Yinan Jiang $^{2}$ Shiqiang Yang $^{1}$ \ + $^{1}$ Tsinghua University\ + $^{2}$ China Academy of Electronics and Information Technology\ +zhoulj16@mails.tsinghua.edu.cn, cuip@tsinghua.edu.cn\ +xingxuanzhang@hotmail.com, jiang-yinan@126.com, yangshq@mail.tsinghua.edu.cn + +# Abstract + +Black-box adversarial attack has aroused much research attention for its difficulty on nearly no available information of the attacked model and the additional constraint on the query budget. A common way to improve attack efficiency is to transfer the gradient information of a white-box substitute model trained on an extra dataset. In this paper, we deal with a more practical setting where a pre-trained white-box model with network parameters is provided without extra training data. To solve the model mismatch problem between the white-box and black-box models, we propose a novel algorithm EigenBA by systematically integrating gradient-based white-box method and zeroth-order optimization in black-box methods. We theoretically show the optimal directions of perturbations for each step are closely related to the right singular vectors of the Jacobian matrix of the pretrained white-box model. Extensive experiments on ImageNet, CIFAR-10 and WebVision show that EigenBA can consistently and significantly outperform state-of-the-art baselines in terms of success rate and attack efficiency. + +# 1. Introduction + +Despite the fast development of deep learning, its security problem has aroused much attention. It has been demonstrated that a deep learning model can be successfully attacked at a small query cost without knowing the specific implementation of the model. Such techniques are called black-box attack [6, 11, 19], which is intensively studied in recent years with the aim of promoting the development of machine learning towards robustness. + +In previous studies, there are two kinds of settings related to black-box attack. One is pure black-box attack, where nothing is available but the input and output of the black-box model. A common technique used in this setting is the zeroth-order optimization [11], where the gradient information is estimated by sampling different directions of perturbation and aggregating the relative changes of a certain loss function related to the output. The other setting is transfer-based + +attack [10], where a substitute white-box model is trained on an extra training dataset, and the gradient information of the white-box model is exploited to help improve the efficiency of attacking the black-box model. Usually, by leveraging extra information, transfer-based attack is more efficient and effective than pure black-box attack. But completely re-training a complex model is time-consuming and even infeasible if sufficient training data is unavailable. + +In this paper, we aim for a new setting of transfer-based attack. Considering the easy availability of pre-trained models, we assume a pre-trained white-box model (i.e. its network structure and parameters) is given, but there is no additional training dataset available. In other words, the pre-trained model cannot be modified or fine-tuned before being used for black-box attack. Then in this setting, the critical challenge that we need to tackle is the model mismatch between the pre-trained white-box model and the black-box model, which is presented in two cases. One is that the conditional probability of $P(y|x)$ for two models is different. This will lead to disagreement on gradient direction of the two models. The other, a even more challenging case, is that the category label set is different in white-box and black-box models. In literature, the first case is partially tackled by [2, 7, 25]. However, they ask the label set of the two models to be the same and utilize the information of the output class probability given by the pre-trained model when attacking. This limits the practical use, as in real applications, cases of totally same label set for two models are rare and even in more extreme scenarios the pre-trained model is trained in an unsupervised manner [8], where no label information is available from the pre-trained model. + +To solve this model mismatch problem in broader scenarios, we combine the ideas of white-box attack and black-box attack and utilize the representation layer of the pre-trained model. We regard the mapping function from the intermediate representation of the white-box model to the output of the black-box model as a black-box function, and exploit common practices of black-box attack on this black-box function. Meanwhile, the mapping from the original input to the intermediate representation layer is a part of the pre-trained + +model, which could be processed as in a white-box setting. It is noteworthy that the rationality of the idea depends on the generalization ability of the intermediate representation layer in the pre-trained white-box model. This can be underpinned by the findings in previous works that the lower layers of deep neural networks, i.e. the representation learning layers, are transferrable across different datasets or data distributions [26]. + +More specifically, we propose a novel Eigen Black-box Attack (EigenBA) method by systematically integrating the gradient-based white-box method and zeroth order optimization in black-box methods. We theoretically prove that the most efficient attack is to conduct singular value decomposition to the Jacobian matrix of the intermediate representation layer to the original inputs in the white-box model, and perturb the input sample with the right singular vectors corresponding to the $k$ largest singular values iteratively. + +We conduct extensive experiments to evaluate the effectiveness of EigenBA in multiple settings. The results demonstrate that EigenBA can consistently and significantly outperform state-of-the-art baselines in terms of success rate and attack efficiency. Also, the ablation studies show that EigenBA's advantage can be exerted as long as the representation layer of the white-box model has moderate generalization ability, implying its wide applicability in practice. + +# 2. Related Works + +White-Box Attack White-box attack requires knowing all the information of the attacked model. As the earliest research field among adversarial attacks, there has been a vast literature on the white-box attack, and we will only cover methods with first-order gradient attack in this part, which is closely related to our topic. The adversarial examples are first proposed by [23]. They found that adding some specific small perturbations to the original samples may lead to classification errors of the neural network and [4] further explains this phenomenon as the linear behavior in high-dimensional space of neural networks. Later on, several algorithms are proposed to find adversarial examples with a high success rate and efficiency. Classical first-order attack algorithms include FGSM [4], JSMA [21], C&W attacks [1], PGD [16]. The common principle for these methods is to iteratively utilize the first-order gradient information of a particular loss function with respect to the input of the neural networks. Specifically, the direction of the perturbation for each iteration is determined by a certain transformation of the gradient. + +Black-Box Attack Black-box attack deals with the case when the attacked model is unknown, and the only way to obtain the information of the black-box model is to iteratively query the output of the model with an input. Hence, the efficiency evaluation of the black-box model includes + +three aspects: success rate, query numbers and the $l_{2}$ or $l_{\infty}$ norm of the perturbation to original sample. Black-box attack could be divided into two categories: black-box attacks with gradient estimation and black-box attacks with substitute networks [19]. The former uses a technique called zeroth-order optimization. Typical work includes NES [11], Bandits-TD [12], LF-BA [5], SimBA [6]. The idea of these papers is to estimate gradient with sampling. More recently, some works view the problem as black-box optimization and propose several algorithms to find the optimal perturbation, for example, [19] uses a submodular optimization method, [22] uses a bayesian optimization method and [18] uses an evolutionary algorithm. The latter utilizes a white-box substitute networks to help attack the black models. The substitute network either could be trained on additional samples or from a pre-trained model, the former includes Substitute Training [20], AutoZOOM [24], TREMBA [10], NAttack [15], and the latter includes P-RGF [2], Subspace Attack [7], TIMI [3] and LeBA [25]. The efficiency of these transfer-based methods is largely depended on the quality of the substitute networks. If the model mismatch is severe between two networks, the transfer-based method may underperform the methods with gradient estimation. Our work follows the latter setting, but with broader application scenarios, we could even deal with cases when only representation layer information is available from the white-box pre-trained model. + +# 3. Models + +# 3.1. Problem Formulation + +Assume we have an input sample $x \in \mathbb{R}^n$ and a black model $F: \mathbb{R}^n \to [0,1]^{c_b}$ , classifies $c_b$ classes with output probability $p_F(y|x)$ with unknown parameters. The general goal for black-box attack is to find a small perturbation $\delta$ such that the prediction $\arg \max F(x + \delta) \neq y_{true}$ , where $y_{true}$ is the true label of corresponding $x$ . A common practice for score-based black-box attack is to iteratively query the output probability vector given an input adding an evolutionary perturbation. Three indicators are used to reflect the efficiency of the attack algorithm: the average query number for attacking one sample, the success rate and average $l_2$ -norm or $l_\infty$ -norm of the perturbation (i.e. $||\delta||_2$ or $||\delta||_\infty$ ). + +We propose a novel setting of transfer-based black-box attack. We further assume there is a white-box model $G(x) = g \circ h(x)$ , where $h: \mathbb{R}^n \to \mathbb{R}^m$ maps the original input to a low-dimensional representation space, and $g: \mathbb{R}^m \to [0,1]^{c_w}$ maps the representation space to output classification probabilities, $c_w$ is the number of classes with respect to $G$ . The original classes for classifier $F$ and $G$ may or may not be the same. The parameters of $g$ and $h$ are known, but are not permitted to be further tuned by additional training samples. Our goal is to utilize $G$ to enhance + +the efficiency of attacking the black-model $F$ given an input $x$ . i.e. to decrease the query number for black-box model under the same level of perturbation norm. + +# 3.2. The EigenBA Algorithm + +# 3.2.1 General Framework + +One of the main challenges is that the white-box pre-trained model $G$ may show model mismatch to the actual attacked model $F$ . Even with the same output classes, the probability $p_{G}(y|x)$ may be different from $p_{F}(y|x)$ . Hence, directly attacking $p_{G}(y|x)$ based on white-box methods may not work well on $F$ , not to mention a different output classes case. However, benefited from the generalization ability of deep neural networks, if the classification tasks of the two models are related, the representation layer of $G$ has a certain predictive power to the output classes of $F$ . Formally, following notations $G = g \circ h$ in Section 3.1, the black-box model $F$ could be approximated as $\tilde{g} \circ h$ , where $h$ is the encoder of the white-box model $G$ , and $\tilde{g}: \mathbb{R}^m \to [0,1]^{cb}$ is a new mapping function from the representation space of $G$ to the output of the attacked model $F$ . As there exists an optimal $\tilde{g}$ but we do not know its realization, the function $\tilde{g}$ could be seen as a new black-box target. For convenience of expression, we keep $F = \tilde{g} \circ h$ as a hypothesis in the following analysis. + +Hence, the black-box attack could be reformulated as: + +$$ +\min _ {\delta} p _ {F} (y | x + \delta) \Rightarrow \min _ {\delta} p _ {\tilde {g} \circ h} (y | x + \delta) \quad s. t. \quad | | \delta | | _ {2} \leq \rho \tag {1} +$$ + +Here in this paper, we only consider the $l_{2}$ -attack. Using a gradient-descent method to iteratively find an optimal perturbation is given by $x_{t + 1} = x_t - \epsilon \cdot \nabla_x[F(x;\theta)_y]$ . As $\nabla_x[F(x;\theta)_y]$ is unknown in black-box model, we need to estimate it by sampling some perturbations and aggregating the relative change of the output. Noticing that the query number is also important in black-box attack, we measure the attack efficiency as the number of samples used under the same $dp / ||\delta ||_2$ for each iteration, where $dp = |p_F(y|x + \delta) - p_F(y|x)|$ . + +Specifically, define $z = h(x)$ , the gradient could be decomposed as: + +$$ +\nabla_ {x} [ F (x; \theta) _ {y} ] = J _ {h} (x) ^ {T} \nabla_ {z} [ \tilde {g} (z; \tilde {\theta}) _ {y} ] \qquad (2) +$$ + +where $J_{h}(x)$ is the $m\times n$ Jacobian matrix $\frac{\partial(z_1,z_2,\cdots,z_m)}{\partial(x_1,x_2,\cdots,x_n)}$ with respect to $h$ , and the subscript $y$ represents the $y$ -th component of the output of $\tilde{g}$ . As $h$ is a white-box function, we could obtain the exact value of $J_{h}(x)$ . In contrast, $\tilde{g}$ is a black-box function, we need to estimate the gradient $\nabla_z[\tilde{g} (z;\tilde{\theta})]_y$ by sampling. As the equation below holds + +given by the definition of directional derivatives: + +$$ +\nabla_ {z} \left[ \tilde {g} (z; \tilde {\theta}) _ {y} \right] = \sum_ {i = 1} ^ {m} \left(\left. \frac {\partial \tilde {g} (z ; \tilde {\theta}) _ {y}}{\partial \vec {l _ {i}}} \right| _ {z} \cdot \vec {l _ {i}}\right), \tag {3} +$$ + +$$ +\vec {l _ {1}}, \vec {l _ {2}}, \dots , \vec {l _ {m}} a r e o r t h o g o n a l. +$$ + +To completely recover the gradient of $\tilde{g}$ , we could iteratively set the direction of the perturbations of $z$ to any group of orthogonal basis $\vec{l}_1, \vec{l}_2, \dots, \vec{l}_m$ , which totally uses $m$ samples for each iteration. However, there is an optimal group of basis with respect to the black-box attack efficiency, which will be introduced in next section. + +# 3.2.2 Globally Optimal Perturbation Basis for Transferred Black-box Attack + +In this section we will introduce our EigenBA algorithm to maximize the attack efficiency. The core problem is to maximize change of the output probability $dp$ under the same perturbation norm $||\delta||_2$ and decrease the query numbers per iteration. + +We first consider finding the orthogonal basis on the representation space by greedily exploring directions of perturbation on the original input space to maximize relative change of representation. Specifically, considering the first-order approximation of the change in representation space given by: + +$$ +\vec {l} _ {i} = J _ {h} (x) \delta_ {i} \tag {4} +$$ + +where $\delta_{i}$ is the perturbation on original input space resulting the change of the representation space to be $\vec{l}_i$ , the optimal perturbation could be seen as solving the following iterative problem: + +$$ +\begin{array}{l} (P 1) \quad \max _ {\delta_ {1}} | | J \delta_ {1} | | _ {2} \quad s. t. \quad | | \delta_ {1} | | _ {2} \leq \epsilon \\ (P 2) \quad \max _ {\delta_ {i}} | | J \delta_ {i} | | _ {2} \quad s. t. \quad | | \delta_ {i} | | _ {2} \leq \epsilon , \\ \delta_ {j} ^ {T} J ^ {T} J \delta_ {i} = 0 f o r a l l j < i, i > 1 \tag {5} \\ \end{array} +$$ + +where $J_{h}(x)$ is simplified as $J$ . We iteratively solve $\delta_1, \delta_2, \dots, \delta_m$ of problem given by 5. In this way, the first constraint assures that the relative $l_2$ -norm change from the original space to the representation space, i.e. $||\vec{l}_i||_2 / ||\delta_i||_2$ reaches a maximum and the second constraint assures the changes on the representation space are orthogonal. + +Theorem 1 The optimal solutions for problem given by (P1) and (P2) are that $\delta_1, \delta_2, \dots, \delta_m$ are just the eigenvectors corresponding to the top- $m$ eigenvalues of $J^T J$ . + +The proof is shown in Appendix 1.1. Hence, if we iteratively sample the perturbation to $\delta_1, \delta_2, \dots, \delta_m$ in order, the one-step actual perturbation $\nabla_x[F(x; \theta)_y]$ could be approximated by Equation 2 and Equation 3. + +As the tail part of the eigenvalues may be small, i.e. the norm of perturbation for representation space may not be sensitive to the perturbation on the original input space with the corresponding eigenvector direction. To decrease the query number without sacrificing much attack efficiency, we only keep the top-K perturbations for exploration, $\delta_1,\delta_2,\dots ,\delta_K$ . The eigenvectors of $J^{T}J$ could be fast calculated by processing a truncated singular value decomposition (SVD) to Jacobian matrix $J$ , only keeping top K components. + +From the discussion above, we demonstrate that the group of basis we found maximizes the change on representation space under the same perturbation norm of input. Next, we generalize our conclusion to the change on output space. The following theorem guarantees that by greedily exploring the optimal perturbations given by (P1) and (P2), the attack efficiency defined in Section 3.1 will be globally optimal for any composition of K orthogonal perturbation vectors on representation space, which forms the foundation of our EigenBA algorithm. The proof is shown in Appendix 1.2. + +Theorem 2 (Property of Eigen Perturbations) Assume there is no prior information about the gradient of $\tilde{g}$ (the direction of the actual gradient is uniformly distributed on the surface of an $m$ -dimensional ball with unit radius). Given a query budget $K$ for each iteration, the perturbations $\vec{l_1}, \vec{l_2}, \dots, \vec{l_K}$ on representation space and the corresponding perturbations $\delta_1, \delta_2, \dots, \delta_K$ on input space solved by Problem (P1) and (P2) is most efficient among any choice of exploring $K$ orthogonal perturbation vectors on the representation space. Specifically, the final one-step gradient for $\nabla_z[\tilde{g}(z; \tilde{\theta})_y]$ is estimated by: + +$$ +\nabla_ {z} [ \tilde {g} (z; \tilde {\theta}) _ {y} ] \simeq \sum_ {i = 1} ^ {K} \left(\left. \frac {\partial \tilde {g} (z ; \tilde {\theta}) _ {y}}{\partial \vec {l _ {i}}} \right| _ {z} \cdot \vec {l _ {i}}\right) +$$ + +and the expected change of the output probability $dp_F(y|x)$ reaches the largest with the same $l_2$ -norm of perturbation on input space for all cases. + +# 3.2.3 Further Improvements on Query Numbers + +Another important improvement is inspired by SimBA [6] (See Algorithm 2 in Appendix 5). Instead of estimating the gradient by exploring a series of directional derivatives before processing one-step gradient descent, SimBA iteratively updates the perturbation by picking random orthogonal directions and either adding or subtracting to the current perturbation, depending on which operation could decrease the output probability. The main difference is that, SimBA pursues fewer queries by using a relatively fuzzy gradient estimation. SimBA does not concern about the absolute value of the directional derivatives, but only positive or negative. In such a way, the perturbations of the orthogonal basis + +Algorithm 1 The EigenBA Algorithm for untargeted attack + +Input: Target black-box model $F$ , the substitute model $G = g \circ h$ , the input $x$ and its label $y$ , stepsize $\alpha$ , number of singular values $K$ . + +Output: Perturbation on the input $\delta$ + +1: Let $\delta = 0, \mathbf{p} = p_F(y_1, y_2, \dots, y_{c_b}|x)$ , $succ = 0$ . +2: while $s u c c = 0$ do +3: Calculate Jacobian matrix w.r.t. $h$ : $J = J_{h}(x + \delta)$ . +4: Process truncated-SVD as trunc-svd $(J,K) = U, \Sigma, V^T$ . +5:Normalize each column of $V$ .. $q_{i} =$ normalize $(V[:,i])$ +6: for $i = 1\cdots K$ do +7: $\mathbf{p}_{neg} = p_F(y_1, \dots, y_{c_b}) \text{clip}(x + \delta - \alpha \cdot q_i)$ +//clip(·) for validity of the input. +8: if $\mathbf{p}_{neg,y} < \mathbf{p}_y$ then +9: $\delta = \operatorname{clip}(x + \delta - \alpha \cdot q_i) - x$ +10: $\mathbf{p} = \mathbf{p}_{\text{neg}}$ +//negative direction decreases the probability. +11: else +12: $\mathbf{p}_{pos} = p_F(y_1,\dots ,y_{c_b}|clip(x + \delta +\alpha \cdot q_i))$ +13: if $\mathbf{p}_{pos,y} < \mathbf{p}_y$ then +14: $\delta = \operatorname{clip}(x + \delta + \alpha \cdot q_i) - x$ +15: $\mathbf{p} = \mathbf{p}_{pos}$ +//positive direction decreases the probability. +16: end if +17: end if +18: if $\mathbf{p}_y \neq \max_{y'} \mathbf{p}_{y'}$ then +19: $s u c c = 1$ +break; +20: end if +21: end for +22: end while +23: Return $\delta$ + +used to explore the real gradient could also contribute to the decrease of the output probability. Inspired by SimBA, we substitute their randomly picked basis or DCT basis to our orthogonal basis $\delta_1,\delta_2,\dots ,\delta_K$ given by solving Problem 5. The whole process for our EigenBA algorithm is shown in Algorithm 1. Considering time efficiency, for each loop, we calculate SVD once with respect to the initial state of input of this loop and process K steps directional derivatives exploration with the corresponding K eigenvectors as perturbations. The idea of SimBA significantly reduces the number of queries, as shown in [6]. + +Moreover, for complexity analysis of our EigenBA algorithm and some tricks to decrease the time complexity, we refer the readers to Appendix 2. + +# 4. Experiments + +# 4.1. Setup + +In practical scenarios of the transfer-based black-box attack, there are two main sources of model mismatches: the attacked model is different from the pre-trained model in the model architecture, or the output classes (or both). Hence, we will evaluate our EigenBA algorithm from two aspects in the experiment part. + +For the first group of experiments, we use a ResNet-18 [9] trained on ImageNet as the fixed white-box pre-trained model, and the attacked model is a ResNet-50 or Inception-v3 trained on the same training dataset of ImageNet. The attacked images are randomly sampled from the ImageNet validation set that are initially classified correctly to avoid artificial inflation of the success rate. For all baselines, we use the same group of attacked images. For the second group of experiments we show two different cases. A rather simple case is to use a ResNet-18 trained on CIFAR-100 [13] as white-box model, and the attacked model is a ResNet-18 trained on CIFAR-10 [13]. The more complex one is to use a ResNet-18 trained on ImageNet to attack a ResNet-50 trained on WebVision2.0 [14]. WebVision2.0 contains 16 million training images from 5,000 different visual concepts. Among them 1,000 concepts are overlapped with ImageNet, but the images are selected from a different source from ImageNet, and the other 4,000 concepts are newly added. To show difference on output classes, we randomly pick a subset containing 1,000 classes from the non-overlapped 4,000 classes for simplicity. The attacked model is limited on classifying the picked 1,000 classes. The reason we choose to attack model trained on WebVision dataset is that the categories of the two datasets are sufficiently different to show the superiority of our algorithm and the attacked model is more like a real scene model. Similarly, the attacked images are also randomly sampled from the correctly classified images from the validation set of CIFAR-10 or WebVision2.0. We summarize the settings of all experiments in Table 1. The top two settings and the bottom two settings illustrate the two types of model mismatch described above separately, with a more detailed description of the differences on models. + +We also process the untargeted attack case and the targeted attack case in some settings, same as the previous literature of black-box attack. The main difference is that the targeted attack requires the model misclassifies the adversarial sample to the assigned class, while the untargeted attack just makes the model misclassified. Compared with untargeted attack, the goal for targeted attack is to increase $p_F(c|x)$ instead of decreasing $p_F(y|x)$ , where $c$ is the assigned class. Hence, we only need to make a small change to Algorithm 1 by substituting $p_F(y|x)$ by $-p_F(c|x)$ . + +For all experiments, we limit the attack algorithm to 10,000 queries for ImageNet, 2,000 for CIFAR-10 and 5,000 + +for WebVision. Exceeding the query limit is considered as an unsuccessful attack. There are 1,000 images to be attacked for each setting. We evaluate our algorithm and all baselines from 4 indicators: The average query number for success samples only, the average query number for all attacked images, the success rate and the average $l_{2}$ -norm of the perturbation for success samples. + +We compare EigenBA to several baselines. Despite our $l_{2}$ attack setting, we also test some state-of-the-art baselines for $l_{\infty}$ attack, as the $l_{2}$ norm $\| \delta \| _2$ is bounded by $\sqrt{dim(\delta)}\cdot \| \delta \|_{\infty}$ and algorithms for $l_{\infty}$ attack could also be adapted to $l_{2}$ attack. Baseline algorithms could be divided into two branches. One of the branches is the common blackbox attack with no additional information, we compare several state-of-the-art algorithms including SimBA [6], SimBA-DCT [6] and Parsimonious Black-box Attack (ParsiBA) [19]. The main concern to be explained by comparing with these methods is to show exploring the representation space provided by a pre-trained model with a slight distribution shift is more efficient than the primitive input space or low-level image space (e.g. DCT space). The other branch is some extensible first-order white-box attack methods that could be adapted to this setting. We design two baselines: TransFGSM and Trans-FGM. The two baselines are based on the Fast Gradient Sign Method and the Fast Gradient Method [4]. While conducting them, we use the same pre-trained white-box model as our algorithm. The two baselines iteratively run SimBA algorithm by randomly selecting from the Cartesian basis on the representation space. And the updating rule for the perturbation on input space is given by: + +$$ +\text {T r a n s - F G S M :} \quad \delta_ {t + 1} = \delta_ {t} \pm \alpha \cdot \operatorname {s i g n} \left(\nabla_ {x} h \left(x _ {t}; e _ {i}\right)\right) +$$ + +$$ +\mathrm {T r a n s - F G M :} \delta_ {t + 1} = \delta_ {t} \pm \alpha \cdot \frac {\nabla_ {x} h (x _ {t} ; e _ {i})}{| | \nabla_ {x} h (x _ {t} ; e _ {i}) | | _ {2}} +$$ + +where $e_i$ is the selected $i_{th}$ basis and $\nabla_x J_h(x_t; e_i)$ is the gradient of the $i_{th}$ output representation value $z_i$ with respect to the input $x_t$ . By comparing these two methods, we will show afterward that exploring the eigenvector orthogonal subspace on representation space is more efficient than other subspace, which is consistent with Theorem 2. It is noteworthy that ParsiBA and Trans-FGSM are originally for $l_\infty$ attack. More details of the experimental setting is shown in Appendix 2.3. + +Moreover, it is noteworthy that P-RGF [2], Subspace Attack [7] and LeBA [25] could also deal with the first setting, i.e. the change of the model architecture. However, they utilize more information from the output classification probability of the pre-trained model than ours, leading to more efficient attack but narrower usage scenarios. Their methods could not deal with pre-trained models without classification layer (e.g. training in an unsupervised manner) or different label set between pre-trained model and attacked model (i.e. the second setting in our experiment). Hence + +Table 1. Summary of our experiments: the differences of the pre-trained model and the black-box model on 4 aspects. The check mark indicates the two models are different on the corresponding aspect. Content in brackets shows the training dataset of the model. + +
Pre-trained ModelAttacked Black-box ModelModel VariantModel TypeTraining DataLabels
ResNet-18 (ImageNet)ResNet-50 (ImageNet)
ResNet-18 (ImageNet)Inception-v3 (ImageNet)
ResNet-18 (CIFAR-100)ResNet-18 (CIFAR-10)
ResNet-18 (ImageNet)ResNet-50 (WebVision)
+ +Table 2. Results for untargeted and targeted attack on attacking ResNet-50 (trained on ImageNet). Max queries = 10000 + +
MethodTransferUntargetedTargeted
Avg. queries (success)Avg. queries (all)Success RateAvg. l2Avg. queries (success)Avg. queries (all)Success RateAvg. l2
SimBANo132214170.9893.989576267190.7748.424
SimBA-DCTNo8049330.9863.096438754370.8136.612
ParsiBANo99713120.9653.957507568780.6348.422
Trans-FGSMYes5106140.9894.634357348070.8089.484
Trans-FGMYes6758430.9823.650356258670.6428.200
EigenBA (Ours)Yes3835180.9863.622273041400.8067.926
+ +in this paper, we only adopt the baselines with the same applicability as our method for fair comparison. + +# 4.2. Results on Change of Architectures + +In this section we show the main results of attacking ImageNet in Table 2 and Table 3, i.e. the top two settings shown in Table 1. We adjust the hyper-parameter stepsize $\alpha$ for our method and all baselines to make sure the average $l_{2}$ -norm of perturbation is close and compare average queries and success rate for easier comparison. + +Table 2 shows the results of untargeted attack and targeted attack under the pre-trained model ResNet-18 and the attacked model ResNet-50. Comparing our EigenBA to those algorithms without transferred pre-trained model, our method uses at most $56\%$ query numbers for untargeted attack and about $76\%$ for targeted attack and reaches a comparable success rate, which demonstrates that utilizing the representation space of a smaller model could attack more efficiently than the original pixel space or manually designed low-level DCT space. Moreover, some state-of-the-art methods, e.g. SimBA-DCT, take advantage of the general properties of images and could not be generalized to other fields. In contrast, our method is applicable to any black-box attack scenario with a pre-trained model. + +Comparing EigenBA to Trans-FGM, which is more suitable for $l_{2}$ -attack than Trans-FGSM, our method uses about $61\%$ query numbers for untargeted attack and $71\%$ for targeted attack. The results demonstrate that exploring the eigenvector subspace generated by solving problem given + +Table 3. Results for untargeted attack on attacking Inception-v3 (trained onImagenet). Max queries = 10000 + +
MethodsAvg. queries (success)Avg. queries (all)Success RateAvg. l2
SimBA254135330.8675.906
SimBA-DCT162521690.9354.245
ParsiBA171028290.8656.916
Trans-FGSM96714820.9435.571
Trans-FGM95517330.9144.759
EigenBA (Ours)96813560.9574.629
+ +by 5 on the representation space is more efficient than the subspace generated by randomly chosen orthogonal basis, which is consistent to our theoretic reflection in Section 3. It is noteworthy that Trans-FGM performs similar or even worse to SimBA-DCT, which shows transfer-based method is not necessarily better than pure black-box attack methods, depending on whether the representation space provided by the transferred model is strong enough and the efficiency of the algorithm itself. + +Figure 1 further shows the change of success rate with the change of query number limit for EigenBA, SimBA-DCT and Trans-FGM. We can conclude the distribution of the query number for 1000 attacked images for each attack method. Our EigenBA algorithm performs especially better when the limit of query number is relatively small, which + +![](images/dfcf86f1382ad8a84c17371c64d5147bbb8672019a96761b0efffcab1d9efdce.jpg) +Figure 1. The change of success rate with fixed query limit on attacking ResNet-50 (trained on ImageNet). + +![](images/7d149abaa93520285e292648940deb28c83f020e2a2b6e515d4d1de1f2c9f899.jpg) + +will significantly reduce the query cost. + +Table 3 shows the result of untargeted attack under the pretrained model ResNet-18 and the attacked model Inception-v3. Our EigenBA algorithm still performs the best among all baselines, with the smallest average query number for all attacked images, highest success rate and nearly smallest perturbation, which shows that even the pre-trained model is totally different from the attacked model, our EigenBA algorithm still works well. + +# 4.3. Results on Change of Output Classes + +A more difficult setting is that the training dataset and the output classes of the attacked model are totally different from the pre-trained model, referring to the bottom two settings in Table 1. However, similar to the experiments on ImageNet, our EigenBA method still performs the best of all on attacking CIFAR-10, with a pretrained model trained on CIFAR-100, as shown in Table 4, and attacking WebVision with a pretrained model on ImageNet shown in Table 6. For attacking CIFAR-10, compared with SimBA-DCT, our algorithm uses $23\%$ and $29\%$ query numbers on untargeted attack and targeted attack while reaching a higher success rate. Compared with Trans-FGM, the proportion is $73\%$ and $58\%$ . Moreover, on the more difficult setting of WebVision dataset, even the training dataset, output classes and the model architecture are all changed, our EigenBA algorithm still saves about $19\%$ query numbers compared with SimBA-DCT, while reaching a higher success rate. In contrastive, the other two transferred algorithms perform worse than pure black-box attack. It further shows that our algorithm can more effectively use the information of the pre-trained model. In conclusion, even the classes of the transferred model are different from the attacked model, depending on the strong generalization ability of neural network, the representation space of the transferred network can still improve + +the efficiency of black-box attack. + +It is also noteworthy that the performance of our EigenBA algorithm highly depends on the generalization ability of the pre-trained model to the categories related to the attacked model, which is largely attributed to the similarity of the two training datasets for the pre-trained model and the attacked model. As CIFAR-100 and CIFAR-10 have a closer relationship than ImageNet and WebVision, our algorithm performs much better on attacking CIFAR-10. In next section, we will show more experimental evidences for the relationship between generalization ability and the efficiency of the attack. + +# 4.4. Ablation Study: How the generalization ability affects the efficiency of attack? + +From the results of Section 4.2 and 4.3, one interesting problem is how strong the generalization ability of the pretrained white-box model can help improve the efficiency of black-box attack. In this section, we conduct an ablation study on this problem. In this experiment, we set the pretrained model and the attacked model to be the same ResNet-18 trained on CIFAR-10, but randomly setting a certain proportion of parameters to be zero for the pre-trained model. If the reserve rate of parameters is 1.0, the pre-trained model will be totally the same with the attacked model, and with the decrease of the reserve rate, the generalization ability of the pre-trained model will become weaker. Setting a random part of parameters to zero could also be seen as a change to the structure of the pre-trained network. We test the attack efficiency of EigenBA under different reserve rate ratios and compare the result with the pure black-box method SimBA-DCT in Table 5. We also report the pretrained model accuracy in different settings by fixing network parameters below the final representation layer and only retraining the top classifier with the training dataset of CIFAR-10, which reflects the generalization ability of the pre-trained + +Table 4. Results for untargeted and targeted attack on attacking ResNet-18 (trained on CIFAR-10). Max queries = 2000 + +
MethodsTransferUntargetedTargeted
Avg. queries (success)Avg. queries (all)Success RateAvg. l2Avg. queries (success)Avg. queries (all)Success RateAvg. l2
SimBANo4604670.9950.5748178830.9440.782
SimBA-DCTNo4264360.9940.5737728300.9530.777
Trans-FGSMYes1111150.9980.6383053100.9970.918
Trans-FGMYes1291350.9970.5243694190.9690.747
EigenBA (Ours)Yes95990.9980.4722412440.9980.692
+ +Table 5. Set a certain proportion of the parameters of the pre-trained model in EigenBA to zero, for attack on CIFAR-10. + +
MethodsParameters +Reserved RateAvg. queries +(all)Success RateAvg. l2Pre-trained Model +Accuracy
EigenBA1.0881.0000.45389.19%
0.9851.0000.44686.17%
0.81300.9970.45977.78%
0.71950.9990.56069.36%
0.63820.9910.76035.36%
0.57000.9210.95127.57%
SimBA-DCT-4400.9980.575-
+ +Table 6. Results for untargeted attack on attacking ResNet-50 (trained on WebVision). Max queries = 5000 + +
MethodsAvg. queries (success)Avg. queries (all)Success RateAvg. l2
SimBA142916720.9324.306
SimBA-DCT89110680.9574.354
Trans-FGSM97317130.8165.125
Trans-FGM85313750.8744.402
EigenBA (Ours)6798610.9584.406
+ +# model. + +The results show that when the reserve rate is larger than 0.7, the pre-trained model is helpful to the efficiency of the black-box attack (both query number and average $l_{2}$ are lower.). And when the reserve rate is smaller than 0.5, the model will degrade the attack efficiency. The breakeven point may appear around 0.6. It shows that even the pretrained model cannot achieve the classification accuracy of the attacked model, it can still improve the efficiency of the black-box attack, e.g. in this experiment, a pre-trained model with reserve rate of 0.7 just reaches $69.36\%$ of classification on CIFAR-10, roughly equivalent to a shallow convolutional network [17], which is largely below the attacked model with $89.19\%$ . Hence, as the representation layer of the modern + +neural networks generally has a strong transferability [26], our EigenBA algorithm has strong applicability in practice. + +# 5. Conclusions + +In this paper, we dealt with a novel setting for transfer-based black-box attack. Attackers may take advantage of a fixed white-box pre-trained model without additional training data, to improve the efficiency of the black-box attack. To solve this problem, we proposed EigenBA, which iteratively adds or subtracts perturbation to the input sample such that the expected change on the representation space of the transferred model to be the direction of right singular vectors corresponding to the first $K$ singular values of the Jacobian matrix of the pre-trained model. Our experiments showed that EigenBA is more query efficient in both untargeted and targeted attack compared with state-of-the-art transfer-based and gradient estimation-based attack methods. We believe that the applicability in the real world of our algorithm will promote more research on robust deep learning and the generalization ability between deep learning models. + +# 6. Acknowledgement + +This work was supported in part by National Key R&D Program of China (No. 2018AAA0102004), National Natural Science Foundation of China (No. U1936219, 62141607), and Beijing Academy of Artificial Intelligence (BAAI). + +# References + +[1] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE symposium on security and privacy (sp), pages 39-57. IEEE, 2017. 2 +[2] Shuyu Cheng, Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Improving black-box adversarial attacks with a transfer-based prior. In Advances in Neural Information Processing Systems, pages 10932-10942, 2019. 1, 2, 5 +[3] Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4312-4321, 2019. 2 +[4] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. 2, 5 +[5] Chuan Guo, Jared S Frank, and Kilian Q Weinberger. Low frequency adversarial perturbation. arXiv preprint arXiv:1809.08758, 2018. 2 +[6] Chuan Guo, Jacob Gardner, Yurong You, Andrew Gordon Wilson, and Kilian Weinberger. Simple black-box adversarial attacks. In International Conference on Machine Learning, pages 2484-2493, 2019. 1, 2, 4, 5 +[7] Yiwen Guo, Ziang Yan, and Changshui Zhang. Subspace attack: Exploiting promising subspaces for query-efficient black-box attacks. In Advances in Neural Information Processing Systems, pages 3825-3834, 2019. 1, 2, 5 +[8] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729-9738, 2020. 1 +[9] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 5 +[10] Zhichao Huang and Tong Zhang. Black-box adversarial attack with transferable model-based embedding. arXiv preprint arXiv:1911.07140, 2019. 1, 2 +[11] Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In International Conference on Machine Learning, pages 2137-2146, 2018. 1, 2 +[12] Andrew Ilyas, Logan Engstrom, and Aleksander Madry. Prior convictions: Black-box adversarial attacks with bandits and priors. arXiv preprint arXiv:1807.07978, 2018. 2 +[13] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 5 +[14] Wen Li, Limin Wang, Wei Li, Eirikur Agustsson, and Luc Van Gool. Webvision database: Visual learning and understanding from web data. arXiv preprint arXiv:1708.02862, 2017.5 +[15] Yandong Li, Lijun Li, Liqiang Wang, Tong Zhang, and Boqing Gong. Nattack: Learning the distributions of adversarial examples for an improved black-box attack on deep neural networks. In International Conference on Machine Learning, pages 3866-3876, 2019. 2 + +[16] 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. 2 +[17] Mark D McDonnell and Tony Vladusich. Enhanced image classification with a fast-learning shallow convolutional neural network. In 2015 International Joint Conference on Neural Networks (IJCNN), pages 1-7. IEEE, 2015. 8 +[18] Laurent Meunier, Jamal Atif, and Olivier Teytaud. Yet another but more efficient black-box adversarial attack: tiling and evolution strategies. arXiv preprint arXiv:1910.02244, 2019. 2 +[19] Seungyong Moon, Gaon An, and Hyun Oh Song. Parsimonious black-box adversarial attacks via efficient combinatorial optimization. In International Conference on Machine Learning, pages 4636-4645, 2019. 1, 2, 5 +[20] Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pages 506-519, 2017. 2 +[21] 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. 2 +[22] Binxin Ru, Adam Cobb, Arno Blaas, and Yarin Gal. Bayesopt adversarial attack. In International Conference on Learning Representations, 2020. 2 +[23] 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. 2 +[24] Chun-Chen Tu, Paishun Ting, Pin-Yu Chen, Sijia Liu, Huan Zhang, Jinfeng Yi, Cho-Jui Hsieh, and Shin-Ming Cheng. Autozoom: Autoencoder-based zeroth order optimization method for attacking black-box neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 742-749, 2019. 2 +[25] Jiancheng Yang, Yangzhou Jiang, Xiaoyang Huang, Bingbing Ni, and Chenglong Zhao. Learning black-box attackers with transferable priors and query feedback. Advances in Neural Information Processing Systems, 33, 2020. 1, 2, 5 +[26] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in neural information processing systems, pages 3320-3328, 2014. 2, 8 \ No newline at end of file diff --git a/adversarialeigenattackonblackboxmodels/images.zip b/adversarialeigenattackonblackboxmodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..865e84be1ecdbcd2e2402e89a3089d565e56c995 --- /dev/null +++ b/adversarialeigenattackonblackboxmodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc9db83b14c947947f19584d000ac679a1acfdbd5d3c3248c7563327632fefc2 +size 398512 diff --git a/adversarialeigenattackonblackboxmodels/layout.json b/adversarialeigenattackonblackboxmodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8a3bbfbbb3209d07a87c86c92c21d3c08e03663c --- /dev/null +++ b/adversarialeigenattackonblackboxmodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5595739a1d2c5a59ac8f8ea38e6149c47bf8a9ef482e9d33312bd2871e09c44 +size 409661 diff --git a/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_content_list.json b/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1391d9cf6240ea18a8b05ee53b9c3f3ff16d69ef --- /dev/null +++ b/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:180dd7f279f48f004316f4dc9d0260666aa6808fdab88ffbf4aba7caad984eab +size 68067 diff --git a/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_model.json b/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f5595157ab15d2ee158135ac7239d40b286924e2 --- /dev/null +++ b/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93c52ca76c828db2369729fca38cb6af30217b0cde1dcc79dde2a2f99a722619 +size 81070 diff --git a/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_origin.pdf b/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0daae5524abaab3ebc5e088b1ae9407c9075b413 --- /dev/null +++ b/adversarialparametricposeprior/6602b17b-063a-48bc-ba93-b53590549d47_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28047369fe8a3ae742aceefef0d8d57139bcb643b8c26bf1b02bed481876677b +size 6848832 diff --git a/adversarialparametricposeprior/full.md b/adversarialparametricposeprior/full.md new file mode 100644 index 0000000000000000000000000000000000000000..30d5362fa96e00b44e10b0d0d22a75ec0cd69a5c --- /dev/null +++ b/adversarialparametricposeprior/full.md @@ -0,0 +1,299 @@ +# Adversarial Parametric Pose Prior + +Andrey Davydov * + +andrey.davydov@epfl.ch + +Sina Honari + +sina.honari@epfl.ch + +Anastasia Remizova + +anastasia.remizova@epfl.ch + +Mathieu Salzmann + +mathieu.salzmann@epfl.ch + +Victor Constantin + +victor.constantin@epfl.ch + +Pascal Fua + +pascal.fua@epfl.ch + +CVLab, EPFL + +# Abstract + +The Skinned Multi-Person Linear (SMPL) model represents human bodies by mapping pose and shape parameters to body meshes. However, not all pose and shape parameter values yield physically-plausible or even realistic body meshes. In other words, SMPL is under-constrained and may yield invalid results. + +We propose learning a prior that restricts the SMPL parameters to values that produce realistic poses via adversarial training. We show that our learned prior covers the diversity of the real-data distribution, facilitates optimization for 3D reconstruction from 2D keypoints, and yields better pose estimates when used for regression from images. For all these tasks, it outperforms the state-of-the-art VAE-based approach to constraining the SMPL parameters. The code will be made available at https://github.com/cvlab-epfl/adv-param・pose_prior. + +# 1. Introduction + +The SMPL model [17] is now widely used to parameterize body poses and shapes [15, 21]. However, it offers no guarantee to produce realistic human bodies when random values are passed as its inputs. This complicates its usage within an optimization, regression, or generative frameworks, where it is desirable that any sample drawn be plausible. + +To mitigate this issue, several approaches have been used. In [2], this is addressed by introducing a Gaussian Mixture Model (GMM) learned on the SMPL pose. Unfortunately, due to its unbounded nature, it still allows poses far away from any training example and potentially unrealistic. In SMPL-X [22], a Variational Autoencoder + +(VAE) is used instead to learn a low-dimensional representation of the SMPL parameters. This choice was motivated by the ability of VAEs to model the distribution of valid data samples in the latent space as a multivariate Gaussian, which was shown to better approximate the data distribution than classical models, such as GMMs, while also facilitating sampling at test time. In both approaches, the learned prior is then used together with other losses in an optimization-based framework that aims at finding plausible human meshes. Unfortunately, VAEs have drawbacks. First, their learned prior tends to be mean-centered and to discard part of the original data distribution that are far away from it. Furthermore, its Gaussian prior is unbounded, like that of GMMs. Hence, one can also sample latent values far away from any in the training set and produce unrealistic bodies. Adversarial training has been used to bound the parameter prediction of SMPL in regression-based frameworks [5, 11]. However, this requires balancing the adversarial loss with other losses. More importantly, no explicit prior has been learned in such cases, as this training needs to be repeated for each new task. + +In short, these approaches make it necessary to balance different losses and do not bound the inputs of the SMPL model. In contrast, we aim at learning a prior, that once learned can be used in an optimization or learning-based frameworks, without the requirement of enforcing constraints on it. In other words, the learned prior should be integrated as part of the SMPL model and the model can be optimized only on the target loss, where the learned prior is not added as an extra constraint. To this end, we learn an explicit prior, that constrains the input of the SMPL model to be realistic poses via adversarial training. This has to be done only once and independently of the target application so that no further adversarial training is needed. Hence, it does not require balancing multiple losses in the downstream tasks. + +Furthermore, one can use a bounded distribution, such as + +![](images/07fdadab2691aa2bd7b729bb74b9e0494692fcb800cc13a4bafda9e191d87801.jpg) + +![](images/f58f683338547b92c4422cbab4e73af2dbf650b2300b0466027000cd4198c5c1.jpg) + +![](images/79a9d3a7a54a5f66d74dbcb3b87905398c2e27ae4a730a6db1cde31a2c7cb556.jpg) + +![](images/0b4d817344774a23485f701e50480885140f36f954b2d0366bce0a21efe044c7.jpg) +Figure 1. Multiple uses of the proposed approach. (A) The adversarial game between generator $\mathcal{G}$ and discriminator $\mathcal{D}$ guarantees that the former provides realistic body poses. (B) Given "start" and "end" latent vectors, one can render the whole sequences of plausible and smooth body interpolations. (C) To optimize for corresponding poses given target keypoints $\mathcal{V}$ , akin to VPoser [22], the pretrained generator $\mathcal{G}$ can be used as an implicit pose prior. (D) The pretrained $\mathcal{G}$ can be dropped in as a pose prior in a pretrained off-the-shelf human mesh regressor. It improves the prediction quality of the regressor. + +uniform or spherical ones, in the input space of the learned prior, which facilitates plausible sample generation and also its integration in regression frameworks, as by limiting the output of the preceding component that is passed as input to the learned prior, one is always guaranteed to have a plausible human representation. Once trained, our model can be used in many different settings without further retraining as shown in Fig. 1. We introduce GAN-based pose prior learning technique that consistently outperforms the VAE-based state-of-the-art approach for both optimization- and regression-based approaches to human body pose recovery [22]. Also, we make a comparison between different choices of latent spaces, out of which the spherical one brings the most benefit. + +# 2. Related Work + +# 2.1. Body Representation + +There have been many attempts at modeling the human body. The earliest ones split the body into several simpler shapes and combine them into a unified model. The introduction of several datasets consisting of diverse body scans [25] has ushered the age of learnable body models. The SMPL body model [17] constitutes one of the most successful and easy-to-use models. It uses a combination of PCA coefficients to model the shape and a regressor that poses the body from the joints angles. Several extensions have since then been proposed. SMPL-H [26] includes a more detailed hand model, thus removing one of the limitations of the original model. More recently, SMPL-X [22], + +adds facial expressions to the previous models. Instead of using a mesh representation, NASA [4] encodes the human body as a signed distance function. Instead of learning an explicit prior, [24] first predicts the 3D pose and then constrains it using physics-based optimization. This must be done for every video, rather than being a part of a prior integrated into a model. The "LIMP" model [3] has been proposed and evaluated directly on meshes, while we learn a prior for SMPL input parameters. In this paper we focus only on SMPL as it is widely used in the community. Here, we focus on the SMPL model as we are interested in modeling the human body itself, and favor a mesh representation, which inherently provides correspondences across, e.g., video frames. + +# 2.2. SMPL Parameter Estimation + +Since the introduction of the SMPL body model, many approaches have aimed to estimate the SMPL parameters given either an image [5,9,11,23], some labels, such as 2D or 3D pose [1,2,22], or body silhouettes [14]. Depending on whether they are optimization- or regression-based, they can be divided into three categories. + +Optimization Models. The first category consists of optimizing the SMPL parameters so as to minimize an objective function defined in terms of different pose or image descriptors. Such descriptors can be 2D and/or 3D joint locations [1, 2, 22], silhouettes [14], or dense correspondences [7]. SMPLify [2] constitutes one of the first such methods. It uses a GMM to model the pose space and optimizes the SMPL parameters so as to match 2D joint loca + +tions. The unboundedness of the GMM prior may result in the optimization producing unrealistic poses. In [22], the GMM is replaced by a VAE to model the pose space distribution. While a VAE can model more complicated distributions than a GMM, it remains unbounded. Furthermore, the mean-centered nature of VAEs makes it cover the original data distribution only partially, because it poorly represents data samples away from its distribution's means. As we will show later, our approach learns a better and smoother coverage of the data while addressing the unbounded nature of these approaches. In [28], a normalizing flow (NF) is used to model a body prior. The mapping from the latent distribution to the SMPL pose is invertible by construction, which makes it suitable for weakly- or self-supervised optimization. On the other hand, our generative model does not have any constraints on the architecture and the training procedure is less demanding. Moreover, this NF model [28] explores only a Gaussian distribution in the latent space, while our approach is distribution-agnostic, as we show in the experiments. + +Regression Models. The second category consists of directly regressing the SMPL parameters given an input image. Human Mesh Recovery (HMR) [11] is one of the initial methods that applies such a technique using deep neural networks. Since then it has been used in several other works, such as [5, 9, 23]. These methods minimize an adversarial prior together with other target losses. Therefore, the resulting representation is only usable within the learned model, since no explicit prior is learned. By contrast, we learn an explicit bounded prior, which needs to be trained only once. Then, the weights of this learned prior can be frozen and it can be used in any regression approach by mapping a feature space to the learned prior latent space. + +Combined Models. The two previous categories are compatible with each other and can be used together. SPIN [13] mixes the two by fine-tuning the regression estimate with an optimization procedure. EFT [10] takes the pretrained regression network of [13] and uses its weights as an implicit body prior. It fine-tunes the weights of the network for every sample in a weakly-annotated dataset to obtain the body parameters. Although we demonstrate our method separately on optimization and regression-based tasks, it can be used in the combined approach, as these models merge the individual components from optimization and regression-based approaches. + +# 3. Method + +To constrain the SMPL poses we rely on a GAN approach [6]. It involves two competing networks, a generator $\mathcal{G}$ and a discriminator $\mathcal{D}$ . The generator samples vectors $\mathbf{z}$ , known as latent vectors, from a set $\mathbb{P}_z\subseteq \mathbb{R}^d$ and generates a SMPL pose vector $\hat{\Theta} = \mathcal{G}(\mathbf{z})$ , which can be passed to the + +SMPL decoder $\phi$ to generate a body mesh $\mathcal{B} = \phi((\mathbf{z}), \beta)$ , where $\beta$ denotes the SMPL body shape parameters. The task of the discriminator is to distinguish poses generated in this manner from those of a large dataset of poses known to be realistic. By contrast, the generator is trained to produce poses that fool the discriminator. This process is shown in Fig. 1 (A). + +Constraining shape and pose. Training our models, we leave the SMPL shape parameters $\beta$ untouched to be able to compare with other models, i.e. VPoser [22], as they only learn a prior for pose. Moreover, the shape part of the model is already data-driven (with PCA). However, the PCA weights for the shape are also unbounded by the model and eliminating this problem is also worth further research. We trained a model in such combined fashion, more information on this can be found in the supplementary material. + +# 3.1. Distribution over Latent Vectors + +GAN-based approaches [12, 20, 27] have used several types of distributions from which to draw their latent vectors, including Gaussian, Uniform, and Spherical distributions. To test all three, we learn three different sets of latent vectors: + +$$ +\begin{array}{l} \bullet \operatorname {G A N - N}: \mathbf {z} _ {N} \sim \mathbb {P} _ {z} = \mathcal {N} (0, \mathcal {I} _ {d}) \subset \mathbb {R} ^ {d} (\text {N o r m a l}) \\ \bullet \quad \operatorname {G A N - U} \colon \mathbf {z} _ {U} \sim \mathbb {P} _ {z} = \mathcal {U} _ {[ - 1, 1 ] ^ {d}} \subset \mathbb {R} ^ {d} (U n i f o r m) \\ \bullet \operatorname {G A N - S} \colon \mathbf {z} _ {S} \sim \mathbb {P} _ {z} = \mathcal {S} \subset \mathbb {R} ^ {d} (\text {S p h e r i c a l}) \\ \end{array} +$$ + +where the spherical vectors are sampled by drawing vectors $\mathbf{z}_N$ from a normal distribution and computing $\mathbf{z}_S\coloneqq \frac{\mathbf{z}_N}{\|\mathbf{z}_N\|_2}$ . + +The unbounded nature of the Gaussian distribution $\mathcal{N}(0,\mathcal{I})$ prevents sampling from rare modes and may make the resulting prior suffer from the same drawbacks as GMMs and VAEs when used in regression tasks. While the Uniform distribution does not have such a limitation, it imposes artificial bounds $[-1,1]^d$ that do not have a clear meaning in the output pose space. Intuitively, because one can smoothly move from one pose to another, we would rather expect a latent pose space to be continuous, without strict boundaries as the uniform space. The desirable properties of the latent space, such as continuity and boundedness are all inherent to the Spherical distribution. Our experiments show that, in practice, it does indeed tend to perform better than the others. + +# 3.2. Training + +We define the generator $\mathcal{G}$ in our GAN architecture to have the same structure as the decoder of the VAE in VPoser [22]. As for our discriminator $\mathcal{D}$ , we base our structure on that of the HMR approach [11], using $K + 1$ discriminators, one for each joint angle and one for the whole set of pose parameters. + +As can be seen in Fig. 1 $(A)$ , we draw samples from the latent space $\mathbb{P}_{\mathbf{z}}$ and train the generator to map them to the SMPL pose space. The discriminators are trained to distinguish the SMPL pose vectors $\Theta$ , obtained by a real pose dataset, from the ones produced by the generator $\hat{\Theta}$ . The training loss function, aiming to balance the two opposing goals of the generator and discriminator, can thus be expressed as + +$$ +\begin{array}{l} \min _ {\mathcal {G}} \max _ {\mathcal {D}} \mathcal {L} (\mathcal {G}, \mathcal {D}) = \mathbb {E} _ {\Theta} [ \log \mathcal {D} (\Theta) ] + \tag {1} \\ + \mathbb {E} _ {z \sim \mathbb {P} _ {z}} [ \log (1 - \mathcal {D} (\mathcal {G} (z)) ]. \\ \end{array} +$$ + +When training image-generating GANs, the usual practice is to take the ratio of training steps for $\mathcal{G}$ and $\mathcal{D}$ to be 10:1 because the former requires more updates to produce realistic "fake" samples. In our setting the competing models have similar capacities. Hence, using that ratio yields a severe mode collapse. Thus, we update the discriminator weights 10 times for every update of the generator. + +We train the model using the common splits of the AMASS dataset [19], following the procedure for VPoser in SMPL-X [22]. As AMASS provides SMPL-H parameters [26], the body pose is a bit different from the original SMPL [2, 17] one; it only contains $K = 21$ joint angles, with 2 angles from SMPL having been moved to SMPL-H "hands" articulations. + +# 3.3. Using the Generator as a Universal Prior + +Being trained once, our generative model can be used in many applications. We introduce some of them here and present the results in the following section. + +Interpolation in Latent Space. One way to gauge the quality of a latent representation is to check how smooth the interpolation from one latent vector to another is. Ideally, the transition should vary equally in each step from the source to the target samples, rather than most of the transformation occurring in only a few steps. To check this, we randomly select $N$ samples $\{\mathcal{B}_1^t,\dots ,\mathcal{B}_N^t\}$ from the test set and optimize (similar to the paragraph below) for every body $\mathcal{B}_i^t$ the corresponding latent vector $\mathbf{z}_i^r$ that yields the closest mesh $\mathcal{B}_i^r = \phi (G(\mathbf{z}_i^r),\beta)$ . For each pair of such latent vectors, we construct an interpolation sequence $\{\mathbf{z}_0^r,\mathbf{z}_1^r,\dots ,\mathbf{z}_T^r\}$ and $\{\mathcal{B}_0,\mathcal{B}_1,\dots ,\mathcal{B}_T\}$ using either linear interpolation + +$$ +\mathbf {z} _ {t} ^ {r} = \left(1 - \frac {t}{T}\right) \mathbf {z} _ {0} ^ {r} + \frac {t}{T} \mathbf {z} _ {T} ^ {r} \tag {2} +$$ + +for GAN-N and GAN-U, or spherical interpolation + +$$ +\mathbf {z} _ {t} ^ {r} = \frac {\sin \left((1 - \frac {t}{T}) \theta\right)}{\sin \theta} \mathbf {z} _ {0} ^ {r} + \frac {\sin \left(\frac {t}{T} \theta\right)}{\sin \theta} \mathbf {z} _ {T} ^ {r} \tag {3} +$$ + +for GAN-S, with $\mathcal{B}_t^r = \phi (G(\mathbf{z}_t^r),\beta)$ , and $\theta$ representing the angular distance between two points $\mathbf{z}_0^r$ and $\mathbf{z}_T^r$ on a sphere. + +We discuss spherical interpolation (SLERP) in more detail, including the proof of Eq. 3 for high dimensions, in the supplementary material. Ideally, the samples $\mathcal{B}_{t-1}$ and $\mathcal{B}_{t+1}$ should be roughly equidistant from $\mathcal{B}_t$ , indicating smooth transitions. The per-vertex mesh distance is computed as follows: + +$$ +d \left(\mathcal {B} ^ {r}, \mathcal {B} ^ {t}\right) = \frac {1}{N _ {\text {v e r t s}}} \sum_ {v = 1} ^ {N _ {\text {v e r t s}}} \| \mathcal {B} _ {v} ^ {r} - \mathcal {B} _ {v} ^ {t} \| _ {2}, \tag {4} +$$ + +where $v$ sums over the vertices. The sampling process is depicted in Fig. 1 $(B)$ . + +Optimization from Keypoints. Given the 2D joint targets $\mathcal{V}$ obtained from a monocular observation and assuming neutral SMPL shape parameters $\beta = 0$ , our goal is to find the SMPL pose parameters $\hat{\Theta}$ that produce the target $\mathcal{V}$ using the SMPL model $\phi$ , which translates from SMPL space $(\hat{\Theta}, \beta)$ to the space of body meshes $\mathcal{B}$ . Fig. 1 ( $C$ ) describes the idea. The recovered mesh can be projected to 2D joints using camera parameters, i.e., $\Pi(\phi(\hat{\Theta}, \beta)) = \mathcal{V}$ , where $\Pi$ is the camera projection function. To find the optimal SMPL parameters, one can minimize $L(\Pi(\phi(\hat{\Theta}, \beta)), \mathcal{V})$ , where $L$ is a loss function such as the $L2$ distance between the 2D mesh joints and the corresponding target joints. + +To better constrain the pose output by SMPL, we make use of our pose prior. That is, instead of directly optimizing $\hat{\Theta}$ , we optimize a vector $\mathbf{z}$ in the GAN's latent space and obtain the corresponding $\hat{\Theta}$ by feeding $\mathbf{z}$ to the generator $\mathcal{G}$ . Altogether, we therefore solve the optimization problem + +$$ +\min _ {\mathbf {z}} \left\| \Pi \left(\phi (\mathcal {G} (\mathbf {z}), \beta) - \mathcal {Y} \right\| _ {2} ^ {2} \right.. \tag {5} +$$ + +Image-to-Mesh Regression. Our GAN models can also be used as drop-in priors to improve existing pretrained image-to-mesh algorithms [10, 11, 13]. To demonstrate this, we start from the model of [10], whose architecture is a Resnet50 model based on the one of [11]. It is pretrained on pseudo ground-truth COCO [16] dataset obtained by [10]. We then inject our model into it as shown in Fig. 1 (D). More specifically, we introduce an additional MLP $\mathcal{F}$ that maps intermediate features of Resnet50 to a latent vector $\mathbf{z}$ of the pre-trained SMPL prior, which then can be mapped by $\mathcal{G}(\mathbf{z})$ into the pose vector $\Theta$ of SMPL. One can then decode pose parameters $\Theta$ into a human mesh $\mathcal{B}$ using the SMPL model $\phi$ . In turn, $\mathcal{F}$ can be used in conjunction with the pre-trained SMPL prior $\mathcal{G}$ and the SMPL decoder $\phi$ to reconstruct a complete body mesh, which can then be compared to the ground-truth targets. We used this process to train only the $\mathcal{F}$ in an end-to-end setup and obtain the corresponding body mesh $\mathcal{B}$ . + +# 4. Experiments + +We now compare the three versions of our approach to sampling the latent vectors, GAN-N, GAN-U, and GAN-S, + +Table 1. Statistics for Recall experiment on Train/Test splits of AMASS dataset [19]. The values are the mean, variance and medians of distances between real samples and closest neighbors among generated samples for every model (in mm). GAN models demonstrate indistinguishable behaviour, while VPoser [22] provides consistently larger discrepancy with real set. + +
Train setTest set
μ ± σ (↓)median (↓)μ ± σmedian
GAN-S (Ours)4.0±1.95.56.3±2.65.5
GAN-U (Ours)3.9±1.95.46.2±2.55.4
GAN-N (Ours)4.0±1.93.66.2±2.55.6
VPoser [22]5.2±3.24.36.3±4.07.3
+ +with the VPoser VAE-based approach of SMPL-X [22] and the NF model of [28]. + +# 4.1. Dataset Coverage + +![](images/48504c4a758bbd94c5f1a10ed0e524330879ec5a2890e31fba0022365b80f92e.jpg) +(a) Recall. "Do real samples live in latent spaces?" + +![](images/ea58a7bd3c2fa47a9f19e1cedca959ef98df973fed17097a0dfca9ae5db5b9dd.jpg) +(b) Precision. "How close are fake samples to real?" +Figure 2. Empirical estimation of data coverage of generative models for both Recall (a) and Precision (b). Experiments with data from the Train set are drawn with solid lines, and from the Test set with dashed lines. Higher means better in all charts. + +An ideal latent representation should cover the whole space of realistic human poses and nothing else. In other words, it should have good Recall and Precision. By recall, we mean that all samples in the training set should be well approximated by poses our model generates. By precision, we mean that these generated poses should never deviate too far from the training set. While recall indicates how well the generated samples cover the dataset distribution, precision indicates how realistic the generated samples are. We define these metrics as follows. + +Recall. To evaluate recall, we use our pose generator to produce SMPL poses and take the shape parameters to be a zero vector, which yields a neutral body shape. Hence, for all models we produce a body mesh $\mathcal{B} = \phi(\mathcal{G}(\mathbf{z}), \beta)$ given a sampled latent vector $\mathbf{z}$ and a fixed $\beta$ . We first generate $6M$ samples from the pose generator of each model. Then, given a ground-truth body $\mathcal{B}^t$ from either the training or test set, we select the generated body $\mathcal{B}^r = \phi(\mathcal{G}(\mathbf{z}^r), \beta)$ with minimum vertex-to-vertex distance Eq. 4. + +We then repeat this operation for $10k$ bodies randomly sampled from either the training or test set. We report the mean, variance and median of the resulting distances in Table 1. In Fig. 2a, we plot the cumulative distribution $\mathbb{P}(d < \epsilon)$ given the values $d(\mathcal{B}^r,\mathcal{B}^t)$ for each training sample. Note that all versions of our approach deliver consistently higher values than the VPoser [22], indicating that our models better cover the entire distribution. + +In Fig. 3, we show the t-SNE projection [18] of the resulting SMPL $\Theta^r$ pose vectors superposed on the $\Theta^t$ vectors that were used to generate the training examples. All GANs cover the space spanned by the training examples more completely than VPoser, which is consistent with the previous result. In other words, our learned prior can represent more diverse poses than the other ones. + +We provide more Recall experiments for various sampling strategies in the supplementary material. + +**Precision.** Our approach to computing precision mirrors the one we used for recall. We randomly generate $10k$ latent points $\mathbf{z}^r$ from every model, and for each sample $\mathcal{B}^r = \phi(G(\mathbf{z}), \beta)$ , with a fixed $\beta$ , look in the training or test datasets for the nearest neighbor in terms of the distance given in Eq 4. If the latent representation only produces poses similar to those seen in training, this distance should be consistently small. + +As shown in Fig. 2b, GAN models tend to produce meshes that are further away from the training distribution than the VAE model. This could be interpreted as a failure to produce realistic poses. However, these unseen samples correspond to plausible bodies. They are nothing but the result of semantic interpolation that GANs implicitly learn from the data. In Fig. 4, we show the worst 10 samples based on the distance metric of Eq. 4 and their nearest neighbors from the training set. Note that all of these samples look realistic even though they are far from the closest neighbor in the dataset. This indicates that our generators are able to produce novel samples that were not observed in the training set, however, this is more observed in GAN-S and GAN-U compared to GAN-N, as GAN-N generates samples closer to its mean, hence deviating less to more diverse poses. + +# 4.2. Interpolation in Latent Space + +To evaluate our model on the first application described in Section 3.3 and in Fig. 1 $(B)$ , we randomly select $N = 128$ samples $\{\mathcal{B}_1^t,\ldots ,\mathcal{B}_N^t\}$ from the test set, and, for each pair, we construct the corresponding interpolation sequence $\{\mathbf{z}_0^r,\mathbf{z}_1^r,\dots ,\mathbf{z}_T^r\}$ and $\{\mathcal{B}_0,\mathcal{B}_1,\dots ,\mathcal{B}_T\}$ . We use the mean per-vertex position error (Eq. 4) between body meshes $\mathcal{B}_i$ and $\mathcal{B}_j$ and compute pairwise distances between their body meshes by $\Delta (\mathcal{B}_i,\mathcal{B}_j)$ , which we represent by $\Delta_{ij}$ . + +The minimal transformation $\Delta_{ij}$ between every consec + +![](images/be0b06fb019a85c5e61e5f43e6189bec6b280121ce3a594b996976522ed7cf77.jpg) +(a) t-SNE on GAN-S samples + +![](images/d3865c9d5aef2b7dd82a305b42bd5748261a71c9ea53db4d1cdddcb8a1182eb6.jpg) +(b) t-SNE on GAN-U samples + +![](images/3bf51d4b75a4c8243315019a7e8a96271efe7b1da4d3ea37453e17ebd7f8cf41.jpg) +(c) t-SNE on GAN-N samples + +![](images/9be0beab0b7ffc38ba898500148c0614b6cb64617af91f8e301b2cd524c494a1.jpg) +(d) t-SNE on VPoser [22] samples + +![](images/b53f48e1a4fad839719dcf4f2797fae567cf8f9d5462de0e693449832541a797.jpg) +Figure 3. t-SNE projections of "real" samples from the training set and of "fakes" generated by GAN-S (a), GAN-U (b), GAN-N (c) and VPoser [22] (d) models. + +![](images/cfba6ae6457cd1aa0d7b7fbe4d99457e777e144465a959868fb2b31d9f3c7470.jpg) + +![](images/b2d27d63e1931d869aab55f1d097cf843ac54987cc74b2da78d8adfd996a54df.jpg) +Figure 4. "Worst" samples according to the precision metric In Figure 2b. For each GAN model we show 10 samples with the largest distance to the first nearest neighbor (1NN) in the training set, ordered from the worst sample on the right. Generated samples themselves are absolutely plausible human bodies, despite being away from training samples. Note that in GAN-S and GAN-U these samples are further away from 1NN compared to GAN-N. + +utive bodies is equal to $\Delta_{0T} = \frac{\Delta(\mathcal{B}_0^i,\mathcal{B}_T^i)}{T}$ . For different initial pairs, this value can be drastically different, as the corresponding bodies might be very close to or very far from each other. Hence, we normalize the transformation $\Delta_{ij}$ + +of every sequence by the expected average transformation $\Delta_{0T}$ , yielding $\bar{\Delta}_{ij}$ , which should be 1 in the minimal case. Note, however, that such an ideal case can typically only be achieved by going through physically-impossible poses, for + +![](images/f2084056c7c28aa1cb62e06ca5309c1a0806f1d2da546cd68bd9a9ef42721cc6.jpg) +Figure 5. Average normalized mesh transformation of consecutive generated samples in interpolations between source and target examples. $x$ axis depicts the number of iterations and the $y$ axis shows the normalized mesh deviation in log-scale. The ideal transformation should be represented as a flat line. VPoser applies most of transformations at the beginning or at the end of the interpolations. GAN-N reduced this affect, while GAN-S obtains the smoothest transitions. + +Table 2. Comparison of interpolation smoothness between different models. max-to-min ratios of consecutive deformations for every pair of interpolation is measured according to Eq. 6. Mean, median, and standard deviation of $R_{ij}$ over a set of interpolations is then reported for each model. + +
μ ± σ (↓)median (↓)
GAN-S (Ours)4.3±3.03.5
GAN-U (Ours)7.1±7.75.1
GAN-N (Ours)5.7×102±5.3×1028.6
VPoser [22]1.8×105±6.9×1059.1
+ +instance by shrinking the arms to go from a body with arms up to one with arms down. Hence, actual transformations will typically obtain values higher than 1, but a good latent space should nonetheless yield values as constant as possible throughout the entire interpolation steps, indicating a smooth gradual transition. + +We illustrate the behavior of different models in Fig. 5, where we average the consecutive interpolation distances $\bar{\Delta}_{ij}$ across all pairs. The closer the curve is to being horizontal, the smoother is the interpolation. The VPoser [22] curve indicates that interpolation with this model is subject to jumping from $\mathcal{B}_0^i$ to $\mathcal{B}_T^i$ in very few steps, either at the beginning or the end of the sequence, and the remaining steps are spent performing small pose adjustments. This effect can also be seen in GAN-N but to a lesser degree. In contrast, GAN-S and GAN-U both produce smooth interpolations, with a slight advantage to the spherical distribution. More plots with interpolation distances for particular pairs can be found in the supplementary material. + +To measure the smoothness of an interpolation, we compute the ratio between the maximal and minimal transitions in a sequence $\Delta_{ij}$ , i.e., + +$$ +R _ {i j} = \frac {\operatorname* {m a x} \left(\Delta_ {i j}\right)}{\operatorname* {m i n} \left(\Delta_ {i j}\right)}. \tag {6} +$$ + +Table 3. Reporting 3D pose error (in mm) for the bodies recovered through optimization from 2D joint targets. + +
P-MPJPE (↓)
GAN-S (Ours)84.3
GAN-U (Ours)90.7
GAN-N (Ours)85.4
NF [28]89.6
VPoser [22]90.1
GMM [2]92.3
+ +Table 4. Reporting 3D pose error (in mm) for the bodies recovered through regression from input images. + +
MPJPE (↓)P-MPJPE (↓)
HMR[COCO EFT] [10]75.9168.02
GAN-S (Ours)63.2456.32
GAN-U (Ours)64.2857.30
GAN-N (Ours)67.1959.92
VPoser [22]69.1861.71
+ +We report the mean, variance and median of the ratios $R_{ij}$ in Table 2. These results confirm our previous conclusions: GAN-S yields the smoothest interpolations, closely followed by GAN-U. In Fig. 6 we show interpolation between two pairs of samples for different models. + +We provide more ablation on interpolation experiments in the supplementary material. + +# 4.3. Mesh Optimization from 2D Joints + +We now turn to the optimization application discussed in Section 3.3 and in Fig. 1 $(C)$ . Given the 2D joint locations, the optimal latent vector can be found using an iterative optimization algorithms. In our experiments, we use L-BFGS-B for all models. For GAN-S and GAN-U, we renormalize the estimated $\mathbf{z}$ given their input bound at each optimization step. Projecting the 3D body joints to the observed 2D joints on the image via the camera project $\Pi$ requires access to the camera parameters and the body orientations. We obtain them in the same way as in [2]. + +In Table 3, we report the 3D pose errors (after rigid alignment) obtained by recovering the SMPL parameters $\hat{\Theta}$ from 2D joints for the H3.6M dataset [8], following Protocol 2. Note that GAN-S again yields the best results for this application, this time closely followed by GAN-N. By contrast, GAN-U yields a higher error, indicating its input bounds makes it less suitable for the optimization-based tasks. To compare against the the NF model [28], we trained a RealNVP version of it ourselves because we did not have access to the code or the weights. + +# 4.4. Image to Mesh Regression + +We train the approach to body regression from an image introduced in Section 3.3 and in Fig. 1 $(D)$ for the three versions of our approach and for VPoser [22]. We report accuracy results on test data in Table 4 in terms of 3D pose error of the recovered bodies after Procrustes alignment (P- + +![](images/0f1717be4e0d10a08207561fffd0a49b53d86599a89fa6e6eb1cf8cd2a5d94ac.jpg) + +![](images/f8ef3159e72c17d06d4de8077a38bdd1731487ef5ce7649f74ffeff717d91420.jpg) +Figure 6. Examples of interpolations for different generative models. All GAN models provide smooth (yet semantically very different) interpolations, while VPoser [22] sticks at one pose for most of the path and "jumps" into the ending pose. More examples can be found in the supplementary material. + +MPJPE), according to Protocol 2 of [8]. Once again GAN-S performs the best, with GAN-U and GAN-N outperforming VPoser. Our models deliver better accuracy than [10], even though its accuracy is reported for pre-trained models. + +# 4.5. Limitations + +Using our GAN priors, the diversity of their learned distributions is limited by their training sets, which might not be diverse enough for downstream tasks. This is, however, similar to any other model that learns a distribution such as VPoser or HMR, which is also limited by its training distribution. + +# 5. Conclusion + +In this paper we proposed a simple yet effective prior for SMPL model to bound it to realistic human poses. We show + +that the learned prior can cover the diversity of the training distribution, while also being capable of generating novel unseen samples. Further, we demonstrate the advantage of learning such a prior in generation, optimization, and regression based frameworks, where the learned prior can be trained once and for all, then used in any downstream task without requiring to balance different losses. Our results show that using a spherical distribution for the learned prior leads to smoother transition in the generated samples from the latent space, while also yielding more accurate results for optimization- and regression-based tasks, indicating this prior is better suited for learning human poses. + +# References + +[1] Anurag Arnab, Carl Doersch, and Andrew Zisserman. Exploiting temporal context for 3d human pose estimation in + +the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3395-3404, 2019. 2 +[2] F. Bogo, A. Kanazawa, C. Lassner, P. Gehler, J. Romero, and M. J. Black. Keep It SMPL: Automatic Estimation of 3D Human Pose and Shape from a Single Image. In European Conference on Computer Vision, 2016. 1, 2, 4, 7 +[3] Luca Cosmo, Antonio Norelli, Oshri Halimi, Ron Kimmel, and Emanuele Rodola. LIMP: Learning Latent Shape Representations with Metric Preservation Priors. European Conference on Computer Vision, 2020. 2 +[4] Boyang Deng, J. P. Lewis, Timothy Jeruzalski, Gerard Pons-Moll, Geoffrey Hinton, Mohammad Norouzi, and AndreaTagliasacchi. NASA: Neural Articulated Shape Approximation. In European Conference on Computer Vision, 2020. 2 +[5] Georgios Georgakis, Ren Li, Srikrishna Karanam, Terrence Chen, Jana Košecka, and Ziyan Wu. Hierarchical Kinematic Human Mesh Recovery. In European Conference on Computer Vision, pages 768-784. Springer, 2020. 1, 2, 3 +[6] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative Adversarial Nets. In Advances in Neural Information Processing Systems, pages 2672-2680, 2014. 3 +[7] Riza Alp Guler and Iasonas Kokkinos. Holopose: Holistic 3d human reconstruction in-the-wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10884-10894, 2019. 2 +[8] C. Ionescu, I. Papava, V. Olaru, and C. Sminchisescu. Human3.6M: Large Scale Datasets and Predictive Methods for 3D Human Sensing in Natural Environments. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2014, 7, 8 +[9] W. Jiang, N. Kolotouros, G. Pavlakos, X. Zhou, and K. Dani-ilidis. Coherent Reconstruction of Multiple Humans from a Single Image. In Conference on Computer Vision and Pattern Recognition, 2020. 2, 3 +[10] Hanbyul Joo, Natalia Neverova, and Andrea Vedaldi. Exemplar fine-tuning for 3d human pose fitting towards in-the-wild 3d human pose estimation. arXiv preprint arXiv:2004.03686, 2020. 3, 4, 7, 8 +[11] A. Kanazawa, M. J. Black, D. W. Jacobs, and J. Malik. End-To-End Recovery of Human Shape and Pose. In Conference on Computer Vision and Pattern Recognition, 2018. 1, 2, 3, 4 +[12] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4401-4410, 2019. 3 +[13] N. Kolotouros, G. Pavlakos, M. J. Black, and K. Daniilidis. Learning to Reconstruct 3D Human Pose and Shape via Model-Fitting in the Loop. In Conference on Computer Vision and Pattern Recognition, 2019. 3, 4 +[14] C. Lassner, J. Romero, M. Kiefel, F. Bogo, M.J. Black, and P.V. Gehler. Unite the People: Closing the Loop Between 3D and 2D Human Representations. In *Conference on Computer Vision and Pattern Recognition*, 2017. 2 + +[15] Ren Li, Meng Zheng, Srikrishna Karanam, Terrence Chen, and Ziyan Wu. Everybody Is Unique: Towards Unbiased Human Mesh Recovery. arXiv Preprint, 2021. 1 +[16] 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, pages 740-755, 2014. 4 +[17] M. Loper, N. Mahmood, J. Romero, G. Pons-Moll, and M.J. Black. SMPL: A Skinned Multi-Person Linear Model. ACM SIGGRAPH Asia, 34(6), 2015. 1, 2, 4 +[18] L.J.P.v.d. Maaten and G.E. Hinton. Visualizing High Dimensional Data Using t-SNE. Journal of Machine Learning Research, 2008. 5 +[19] Naureen Mahmood, Nima Ghorbani, Nikolaus F. Troje, Gerard Pons-Moll, and Michael J. Black. AMASS: Archive of motion capture as surface shapes. In International Conference on Computer Vision, pages 5442-5451, Oct. 2019. 4, 5 +[20] Michael Niemeyer and Andreas Geiger. Campari: Camera-aware decomposed generative neural radiance fields. arXiv preprint arXiv:2103.17269, 2021. 3 +[21] 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, 2018. 1 +[22] Georgios Pavlakos, Vasileios Choutas, Nima Ghorbani, Timo Bolkart, Ahmed A. A. Osman, Dimitrios Tzionas, and Michael J. Black. Expressive body capture: 3D hands, face, and body from a single image. In Conference on Computer Vision and Pattern Recognition, pages 10975-10985, 2019. 1, 2, 3, 4, 5, 6, 7, 8 +[23] Georgios Pavlakos, Nikos Kolotouros, and Kostas Daniilidis. Texturepose: Supervising human mesh estimation with texture consistency. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 803-812, 2019. 2, 3 +[24] Davis Rempe, Leonidas J. Guibas, Aaron Hertzmann, Bryan Russell, Ruben Villegas, and Jimei Yang. Contact and human dynamics from monocular video. In Proceedings of the European Conference on Computer Vision (ECCV), 2020. 2 +[25] Kathleen M Robinette, Sherri Blackwell, Hein Daanen, Mark Boehmer, and Scott Fleming. Civilian american and european surface anthropometry resource (caesar), final report. volume 1. summary. Technical report, Sytronics Inc Dayton Oh, 2002. 2 +[26] J. Romero, D. Tzionas, and M. Black. Embodied Hands: Modeling and Capturing Hands and Bodies Together. ACM Transactions on Graphics, 36(6):245, 2017. 2, 4 +[27] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Conference on Computer Vision and Pattern Recognition, pages 9446-9454, 2018. 3 +[28] Andrei Zanfir, Eduard Gabriel Bazavan, Hongyi Xu, Bill Freeman, Rahul Sukthankar, and Cristian Sminchisescu. Weakly supervised 3d human pose and shape reconstruction with normalizing flows. In European Conference on Computer Vision (ECCV), pages 465-481, 2020. 3, 5, 7 \ No newline at end of file diff --git a/adversarialparametricposeprior/images.zip b/adversarialparametricposeprior/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7b7dc24d5bbb9e11979a7b75a8895304f6439002 --- /dev/null +++ b/adversarialparametricposeprior/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e81df5663931cc555ebc3c638fba37f17f8bda0ef82f0340418f377940f20e8 +size 566672 diff --git a/adversarialparametricposeprior/layout.json b/adversarialparametricposeprior/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9b697b7baa62a3ae9ae86d2f30a4269e8e467e12 --- /dev/null +++ b/adversarialparametricposeprior/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9398c5e9685a34941a76f27bb1904a70921ad0f2fabc7fa9b7b2e8d0219930c +size 368524 diff --git a/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_content_list.json b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d45b31957720cb94632727920dd01dcdd395ace8 --- /dev/null +++ b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf0dea695b0cc41193e11fae8d437ccbf512785ed495740023504b65c99b4d5d +size 77558 diff --git a/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_model.json b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a0ae3024738160f937c63b3a3ca6d9fdd3b6c85d --- /dev/null +++ b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ad6f9b6e736a74bd8563fd14a6c44662f7fc19346a3877fae4d1b1ac72f6231 +size 95182 diff --git a/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_origin.pdf b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c8655e2fc5f57b5557e53f29ed0a9d13bf85a4c7 --- /dev/null +++ b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/373575be-7585-4684-be79-31104caf344d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94b03801ce50a2a51d4940d42e1b78a82304d6e4997683707113f6a8ce803abb +size 4616183 diff --git a/adversarialtextureforfoolingpersondetectorsinthephysicalworld/full.md b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a1d5c829090c623d04ffc372299d19b098a439db --- /dev/null +++ b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/full.md @@ -0,0 +1,356 @@ +# Adversarial Texture for Fooling Person Detectors in the Physical World + +Zhanhao Hu $^{1}$ Siyuan Huang $^{1}$ Xiaopei Zhu $^{2,1}$ Fuchun Sun $^{1}$ Bo Zhang $^{1}$ Xiaolin Hu $^{1,3,4*}$ + +$^{1}$ Department of Computer Science and Technology, Institute for Artificial Intelligence, State Key Laboratory of Intelligent Technology and Systems, BNRist, Tsinghua University, Beijing, China + +$^{2}$ School of Integrated Circuits, Tsinghua University, Beijing, China + +3IDG/McGovern Institute for Brain Research, Tsinghua University, Beijing, China + +$^{4}$ Chinese Institute for Brain Research (CIBR), Beijing, China + +{huzhanhal7, zxp18}@mails.tsinghua.edu.cn + +{siyuanhuang, fcsun, dcszb, xlhu}@mail.tsinghua.edu.cn + +# Abstract + +Nowadays, cameras equipped with AI systems can capture and analyze images to detect people automatically. However, the AI system can make mistakes when receiving deliberately designed patterns in the real world, i.e., physical adversarial examples. Prior works have shown that it is possible to print adversarial patches on clothes to evade DNN-based person detectors. However, these adversarial examples could have catastrophic drops in the attack success rate when the viewing angle (i.e., the camera's angle towards the object) changes. To perform a multi-angle attack, we propose Adversarial Texture (AdvTexture). AdvTexture can cover clothes with arbitrary shapes so that people wearing such clothes can hide from person detectors from different viewing angles. We propose a generative method, named Toroidal-Cropping-based Expandable Generative Attack (TC-EGA), to craft AdvTexture with repetitive structures. We printed several pieces of cloth with AdvTexture and then made T-shirts, skirts, and dresses in the physical world. Experiments showed that these clothes could fool person detectors in the physical world. + +# 1. Introduction + +Recent works have shown that Deep Neural Networks (DNNs) are vulnerable to the adversarial examples crafted by adding subtle noise to the original images in the digital world [5, 8, 10, 18, 22-24, 31], and that the DNNs can be attacked by manufactured objects in the physical world [1, 4, 9, 29]. These manufactured objects are called physical adversarial examples. Recently, some methods based on patch attacks [29] have been proposed to evade person detectors [14, 15, 32, 34, 35, 37]. Specifically, Thys et + +![](images/26a0acfc7f7cb181ec43d4752ee473a98149197fcad918591082c27cae40004c.jpg) +(a) + +![](images/d0580e667c934cc681bd06ad814d3d65e83780c238bc80854fb06d82e6b31cee.jpg) +(b) + +![](images/a1502fbb058b4536ec60e17fd439006b69166d2d5dc863cb9acee41c251ccf6b.jpg) +(c) +Figure 1. Illustration of the attacks at different viewing angles. (a) The camera captures different parts (P1, P2, P3) of the clothes when set to different viewing angles (C1, C2, C3). (b-d) The boxes are the possible areas that the camera may capture. The blue ones indicate the most effective areas for attack, while the red ones are less effective. + +![](images/21e5b7afe3964d4c7fd7185b0471a91119801ff45a56afb9afa31a491298d4b7.jpg) +(d) + +al. [32] proposed to attach a patch to a cardboard. By holding the cardboard in front of the camera, the person cannot be detected by the person detectors. Xu et al. [35] proposed an adversarial T-shirt printed with adversarial patches. The person wearing the T-shirt can also evade person detectors. These works impose considerable threats to the widely deployed deep learning-based security systems. It urges researchers to re-evaluate the safety and reliability of these systems. + +However, the person detector attack methods mentioned above are effective only when the adversarial patches face the camera. Apparently, a single adversarial patch on a piece of clothing is hard to attack detectors at multiple viewing angles, as the camera may only capture a segment of the heavily deformed patch (Fig. 1a and Fig. 1b). We call this the segment-missing problem. A naive extension is to cover the clothing with multiple patches (e.g., tiling the patches tightly on the clothing; see Fig. 1c). However, it cannot totally solve the segment-missing problem, because the camera will capture several segments belonging to different patch units, making the attack inefficient. Another straightforward solution is to build a 3D model of a human + +![](images/575246d27afc47d9657691af3332420117806201c3e5299bd6b0e37728ed30cc.jpg) +Figure 2. Visualization of the adversarial effectiveness of AdvTexture when attacking YOLOv2. A dress, a T-shirt, and a skirt are tailored from a large polyester cloth material covered with the AdvTexture. The persons wearing the clothes failed to be detected by the detector. + +body and a specific piece of clothing to render in different viewing angles as previous work [1] did. However, the clothes are non-rigid, and current 3D rendering techniques have difficulties in modeling the natural deformation of clothes in the real world. For example, Wang et al. [33] rendered 3D logos on flat areas (front and back) of 3D human meshes, but the Attack Success Rate (ASR) decreased when applying to unseen meshes. + +To solve the problem, we propose the idea of using Adversarial Texture (AdvTexture). Unlike the patch-based attacks, AdvTexture can be generated in arbitrary size, thus can cover any cloth in any size. We require that any local part of the texture has adversarial effectiveness (Fig. 1d). Then, when the clothes are covered with AdvTexture, every local area caught by the camera can attack the detectors, which solves the segment-missing problem. + +Towards this goal, we propose a two-stage generative method, Toroidal-Cropping-based Expandable Generative Attack (TC-EGA), to craft AdvTexture. In the first stage, we train a fully convolutional network (FCN) [21, 30] as the generator to produce textures by sampling random latent variables as input. Unlike the conventional architecture of the generator in GAN [16, 25], we use convolutional operation in every layer, including the latent variable. Therefore, the latent variable is a tensor with spatial dimensions, which enables the generator to generate texture in multiple sizes as long as we expand the latent variable along the spatial dimensions. In the second stage, we search the best local pattern of the latent variable with a cropping technique—Toroidal Cropping (TC). After optimization, we can generate a large enough latent variable by tiling the local pattern. We input it to the FCN and finally get AdvTexture. + +We implemented TC-EGA to attack various person detectors, and realized AdvTextures in the physical world. Fig. 2 shows some example attacks targeting YOLOv2. Our experiments showed that the clothes made from such textures significantly lowered the detection performance of different detectors. + +# 2. Related Work + +Earlier works about adversarial examples [10, 18, 31] focused on digital attacks. Small adversarial noises can be added to the original images and make DNNs output wrong predictions, posing significant safety concerns to DNNs. + +Compared to digital adversarial attacks, physical adversarial attacks pose more risks in specific scenarios. Several methods [1, 4, 9, 29] have been proposed to attack image classification models physically. Sharif et al. [29] designed a pair of glasses to attack face-recognition systems. Athalye et al. [1] generated robust 3D adversarial objects by introducing the Expectation over Transformation (EoT) [1] method. Brown et al. [4] deceived image classifiers by placing adversarial patches in the neighborhood of the objects. Evtimov et al. [9] misled road-sign classification by adhering black and white stickers to signs. + +Recently, several methods [14, 15, 32, 32-35] were proposed to attack the DNN-based person detection systems. Thys et al. [32] optimized an adversarial patch that can be attached to cardboard and held by a person. Huang et al. [15] propose Universal Physical Camouflage Attack (UPC) to fool the detectors by simulating 3D objects in virtual environments. Xu et al. [35] designed an adversarial T-shirt by introducing Thin Plate Spline (TPS) [2, 7] to simulate the deformation of clothes (e.g., wrinkles). Wu et al. [34] presented a systematic study of the attack on a range of detection models, different datasets, and objects. Wang et al. [33] masked the adversarial patch with preset logos and mapped it into 3D models. Hu et al. [14] used generative adversarial networks (GAN) [3, 16] to craft more natural-looking adversarial patches. + +Some works [15,33,35] reported drops in the attack success rate when the viewing angles increased. According to Wang et al. [33], part of the patches will not be captured when the camera rotates drastically. It can lead to underestimating the threat, whereas the cameras can be placed anywhere in real-world scenarios. + +# 3. Methods + +We aim to generate textures in arbitrary size, and when the textures are printed on cloth, any patch extracted from the cloth are effective in adversarial attack. We first introduce an adversarial patch generator and then describe TC-EGA based on the patch generator. + +# 3.1. Adversarial Patch Generator + +Let $\tau$ denote the whole cloth that is covered with Ad-vTexture, and $\tilde{\tau}$ denote an extracted patch. We assume that $\tilde{\tau}$ follows a distribution $p_{adv}$ , such that the probability $p_{adv}(\tilde{\tau})$ is higher when its adversarial effectiveness is more significant. We use an energy function $U(\tilde{\tau})$ to model + +![](images/f9fa0d5722d7fbb0809c054e21c0a6654bf0f1d51e517bce37eecffcbde0f0a2.jpg) +Figure 3. The pipeline of the adversary objective function. + +such a distribution: + +$$ +p _ {a d v} (\tilde {\tau}) = \frac {e ^ {- U (\tilde {\tau})}}{Z _ {U}}, \tag {1} +$$ + +where $Z_U = \int_{\tilde{\tau}} e^{-U(\tilde{\tau})} \, \mathrm{d}\tilde{\tau}$ is called partition function. However, it is hard to sample from $p_{adv}(\tilde{\tau})$ directly due to the partition function. Therefore, we use a parameterized generator $G_\varphi: z \to \tilde{\tau}$ to approximate $p_{adv}(\tilde{\tau})$ , where $z \sim \mathcal{N}(0, I)$ . We define $q_\varphi(\tilde{\tau})$ as the distribution of $\tilde{\tau} = G_\varphi(z)$ , which can be written as + +$$ +q _ {\varphi} (\tilde {\tau}) = \int \delta (\tilde {\tau} - G _ {\varphi} (z)) p _ {z} (z) \mathrm {d} z, \tag {2} +$$ + +where $p_{z}$ is the probability density function (PDF) of the standard normal distribution $\mathcal{N}(0,I)$ and $\delta(\cdot)$ is the Dirac delta function. In order to represent $p_{adv}(\tilde{\tau})$ more accurately, we tune $G_{\varphi}$ to minimize the KL divergence $\mathrm{KL}(q_{\varphi}(\tilde{\tau})||p_{adv}(\tilde{\tau}))$ . With the aid of Deep InfoMax (DIM) [13] we have the following theorem: + +Theorem 1 Minizing $\mathrm{KL}(q_{\varphi}(\tilde{\tau})||p_{adv}(\tilde{\tau}))$ is equivalent to + +$$ +\min _ {\varphi , \omega} \mathbb {E} _ {\tilde {\tau} \sim q _ {\varphi} (\tilde {\tau})} [ U (\tilde {\tau}) ] - I _ {\varphi , \omega} ^ {\mathrm {J S D}} (\tilde {\tau}, z), \tag {3} +$$ + +where + +$$ +\begin{array}{l} \mathcal {I} _ {\varphi , \omega} ^ {\mathrm {J S D}} (\tilde {\tau}, z) = \mathbb {E} _ {(\tilde {\tau}, z) \sim q _ {\varphi} ^ {\tilde {\tau}, z} (\tilde {\tau}, z)} [ - \operatorname {s p} (- T _ {\omega} (\tilde {\tau}, z)) ] \\ - \mathbb {E} _ {\tilde {\tau} \sim q _ {\varphi} (\tilde {\tau}), z ^ {\prime} \sim p _ {z} (z ^ {\prime})} [ \mathrm {s p} (T _ {\omega} (\tilde {\tau}, z ^ {\prime})) ], \quad (4) \\ \end{array} +$$ + +$q_{\varphi}^{\tilde{\tau},z}$ denotes the joint distribution of $\tilde{\tau}$ and $z$ , and $\mathrm{sp}(t) = \log (1 + e^{t})$ is the softplus function. $T_{\omega}$ is a scalar function modeled by a neural network whose parameter $\omega$ must be optimized together with the parameter $\varphi$ . + +See Supplementary Materials for the proof. + +The objective function in Eq. (3) consists of two terms. The first term $\mathbb{E}_{\tilde{\tau} \sim q_{\varphi}(\tilde{\tau})}[U(\tilde{\tau})]$ is called Adversary Objective Function because minimizing it improves the adversarial effectiveness of the generated patches. The second term + +$-\mathcal{I}_{\varphi, \omega}^{\mathrm{JSD}}(\tilde{\tau}, z)$ is called Information Objective Function because minimizing it is equivalent to maximizing the mutual information of $z$ and $\tilde{\tau}$ [13], which requires different latent variables to generate different patches. + +# 3.1.1 The Adversary Objective Function + +The adversary objective function $\mathbb{E}_{\tilde{\tau} \sim q_{\varphi}(\tilde{\tau})}[U(\tilde{\tau})]$ can be estimated by sampling $z$ and generating $\tilde{\tau}$ : + +$$ +\frac {1}{N} \sum_ {i = 1} ^ {N} [ U (G _ {\varphi} (z _ {i})) ], \tag {5} +$$ + +where $\{z_i\}$ are the latent variables sampled from $\mathcal{N}(0,I)$ , and $N$ denotes the total number of the samples. + +Now we need to set an appropriate energy function such that lowering the energy leads to detection failure of a person detector. We notice that detectors output multiple bounding boxes with a confidence score for each box when receiving an image. The boxes whose confidence scores are lower than a pre-specified threshold will then be filtered out. Therefore we choose the expectation of the confidence scores over boxes as a part of the energy function $U(\tilde{\tau})$ . Then minimizing the adv object function will lower the confidence scores of the boxes, which makes the boxes easily to be filtered out. + +Specifically, we randomly generate patches in every step, and apply a set of physical transformations such as randomizing the scales, contrast, brightness and additional noise according to Expectation over Transformation (EoT) [29, 32]. We also incorporate random Thin Plate Spin (TPS) [7, 35] deformation as an additional random transformation. We then attach the patches randomly to the persons according to the predicted boxes on the images $x$ from the training set. We use $M(x, \tilde{\tau})$ to denote the above process, and obtain the modified images which are then sent into the target detector. This part of the energy function is thus defined as + +$$ +U _ {\mathrm {o b j}} = \mathbb {E} _ {x, M} [ f (M (x, \tilde {\tau})) ], \tag {6} +$$ + +![](images/25e2480d701996b50ad73494e269fbe991654d8e11a1afaf45a445ffae170983.jpg) +Figure 4. The architecture of the auxiliary network $T_{\omega}$ . It has two inputs, $\tilde{\tau}$ and $z$ , and outputs a scalar value $T_{\omega}(\tilde{\tau},z)$ . The operation $c$ in the figure stands for concatenation. + +where $f$ denotes confidence scores of the boxes predicted by the target detector. + +We use a differentiable variation of total variance (TV) loss [29] as another part of the energy function to encourage the patches to be smoother: + +$$ +U _ {\mathrm {T V}} = \sum_ {i, j} \left| \tau_ {i, j} - \tau_ {i + 1, j} \right| + \left| \tau_ {i, j} - \tau_ {i, j + 1} \right| \tag {7} +$$ + +Together, we form the energy function as + +$$ +U (\tilde {\tau}) = \frac {1}{\beta} \left(U _ {\mathrm {o b j}} + \alpha U _ {\mathrm {T V}}\right), \tag {8} +$$ + +where $\alpha$ and $\beta$ are coefficients. See Fig. 3 for the illustration. When minimizing the adversary objective function, each part of the energy function will be minimized together. + +# 3.1.2 The Information Objective function + +As described in Eq. (4), we use an auxiliary network $T_{\omega}$ to increase the mutual information of $z$ and $\tilde{\tau}$ . We illustrate the architecture of $T_{\omega}$ in Fig. 4. Eq. (4) has two terms, and estimating each of them needs random sampling. Following the previous work [13], to estimate the first term, we first sample $z$ from $\mathcal{N}(0, I)$ , and then generated $\tilde{\tau}$ by $G_{\varphi}(z)$ in each training step. To estimate the second term, we keep $\tilde{\tau}$ and resample $z$ . + +During training, we minimize the adversarial objective function and the information objective function simultaneously. Therefore, the distribution $q_{\varphi}$ can approximate to $p_{\mathrm{adv}}$ which means the generated patches $\tilde{\tau}$ can be adversarial to the target detector. + +# 3.2. Toroidal-Cropping-based Expandable Generative Attack + +In Sec. 3.1, we have described the method to train a generator for adversarial patches $\tilde{\tau}$ . In this section, we used TC-EGA to generate AdvTextures $\tau$ based on the adversarial patch generator. We leverage a specific network architecture and a sample technique to extend adversarial patches to adversarial textures. TC-EGA has two stages. In the first stage, we train a fully convolutional network (FCN) [21,30] + +![](images/bf40f28bccb6d39db7ffdffdafa8723f7a0d249324256724ffbf47acf8144361.jpg) +(a) + +![](images/8e9eb003af3b5564a29946cca1e2a59e51b949b4830bb1b6ceac27bc2776fd55.jpg) +(b) +Figure 5. (a) Illustration of the FCN generator. All layers of the generator network are convolutional layers with zero padding, including the first layer. (b) Each patch $\tau_{i,j,w,h}$ extracted from position $i,j$ can be regarded as the output of a sub-generator $G_{i,j,w,h}$ when the input is $z_{i,j,w,h}$ . + +to help sample from the distribution of adversarial textures. In the second stage, we search the best latent representation to yield the most effective adversarial texture. + +# 3.2.1 Stage One: Train an Expandable Generator + +We aim to train a generator so that it can generate patches in arbitrary size easily by taking a random $z$ as input. The critical point is to endow the generator with translation invariant property by constructing an FCN, where all layers are convolutional layers with zero padding, including the first layer that inputs the latent variable (See Fig. 5a). The latent variable is a $B \times C \times H \times W$ tensor where $B$ is the batch size, $C$ is the number of channels, and $H$ , $W$ are height and width, respectively. + +Here we show the reason for using FCN. We assume that the overall texture $\tau$ is generated by a global generator $G: z \to \tau$ with hidden variable $z \sim \mathcal{N}(0, I)$ . We denote the extracted patch by $\tau_{i,j,w,h}$ whose center is located at the position $(i,j)$ of the overall texture and has a shape of $(w,h)$ . Moreover, the patch $\tau_{i,j,w,h}$ can be regarded as the output of a sub-generator $G_{i,j,w,h}: z_{i_z, j_z, w_z, h_z} \to \tau_{i,j,w,h}$ , where $z_{i_z, j_z, w_z, h_z}$ is the component of $z$ that consists of all the elements dependent to $\tau_{i,j,w,h}$ (see Fig. 5b). Assuming that $\tau_{i,j,w,h}$ follows a distribution $\mathcal{T}_{i,j,w,h}$ . We have the following theorem and corollary. + +Theorem 2 Let $\tau_{1} = G_{1}(z_{1})$ , $\tau_{2} = G_{2}(z_{2})$ , $z_{1} \sim \mathcal{Z}_{1}$ , $z_{2} \sim \mathcal{Z}_{2}$ , $\tau_{1} \sim \mathcal{T}_{1}$ , $\tau_{2} \sim \mathcal{T}_{2}$ . If $\mathcal{Z}_{1}$ is identical to $\mathcal{Z}_{2}$ and $G_{1}$ is equivalent to $G_{2}$ , then $\mathcal{T}_{1}$ is identical to $\mathcal{T}_{2}$ . + +Corollary 2.1 $G_{i,j,w,h}$ and $\mathcal{T}_{i,j,w,h}$ are irrelevant to $i,j$ , i.e., $G_{i,j,w,h} = G_{w,h}$ and $\mathcal{T}_{i,j,w,h} = \mathcal{T}_{w,h}$ , if $G$ is an FCN and the input $z \sim \mathcal{N}(0,I)$ . + +See Supplementary Materials for the proofs. Therefore, as long as the sub-generator $G_{w,h}$ is trained to approximate the distribution of $\mathcal{T}_{w,h}$ to $p_{\mathrm{adv}}$ , any patch extracted from the overall texture with shape $(w,h)$ also approximately follows $p_{\mathrm{adv}}$ , i.e., it has adversarial effectiveness. Moreover, due to the translation invariant property of the convolutional operation, the sub-generator $G_{w,h}$ and the global generator can share the same architecture and parameters except for the different spatial shape $H$ and $W$ of the latent variable $z$ . As a result, we only need to train a small generator. + +Note that the height $H$ and width $W$ of the hidden variable $z$ can not be too small, otherwise the output will be too small to crop a patch in spatial shape $(w, h)$ . We denote the minimum spatial sizes by $H_{\mathrm{min}}$ and $W_{\mathrm{min}}$ . During training, we sampled a small $z$ in shape $B \times C \times H_{\mathrm{min}} \times W_{\mathrm{min}}$ and generated the corresponding patches in each training step. After that, we can produce different textures of arbitrary sizes by randomizing $z$ with any $H \geq H_{\mathrm{min}}$ and $W \geq W_{\mathrm{min}}$ . + +# 3.2.2 Stage Two: Find the Best Latent Pattern + +After training, the generator can generate different textures by sampling latent variables. In order to find the best texture for adversarial attacks, we propose to go one step further, that is, to optimize the latent variable with the parameters of the generator frozen. However, since the texture has no specific shape and the size of the latent variable needs to be large enough to produce a large textured cloth, directly optimizing the latent variable is difficult. + +Inspired by the unfolding of torus in topology which supports up-down and left-right continuation [11] (Fig. 6a), we introduce the Toroidal Cropping (TC) technique, which aims to optimize a local pattern $z_{\mathrm{local}}$ as a unit such that the final latent variable $z$ can be produced by tiling multiple identical units. In detail, $z_{\mathrm{local}}$ can be parameterized as a tensor in shape $B \times C \times L \times L$ with a shape hyper-parameter $L$ , which can be regarded as the unfolded plane of a two-dimensional torus $\mathbb{T}^2$ in topology (Fig. 6a). Therefore the latent variable in arbitrary shape can be cropped from $z_{\mathrm{local}}$ in a recursive manner (Fig. 6b), which can be regarded as cropping on the torus. We denote such crop operation by $\mathrm{Crop}_{\mathrm{torus}}$ . + +During optimization, we randomly sample the latent variables $z_{\mathrm{sample}}$ in shape $B \times C \times H_{\min} \times W_{\min}$ by such + +![](images/0c77b3e25fc37cdda9aa99f5a2b8990f19ea8f8183d4e492e8ca91a0cbdeb8eb.jpg) + +![](images/b03179654bd99bd7c65344340434b3c7231f827dea15f84674822caafa72876d.jpg) +(a) +Figure 6. Illustration of Toroidal Cropping. (a) By first concatenating its horizontal edges (red arrow) and then concatenating the vertical edges (blue arrow), the local pattern can be folded to a torus. (b) The latent variable in arbitrary shape can be created by tiling the local pattern side by side, thus the variable cropped at the junctions is equivalent to that cropped on the torus, meaning the pattern is still continuous. (c) This cropping technique also applies to the pixel space. See Sec. 4.3 for this variant. + +cropping technique. Since we only consider the adversarial effectiveness in this stage, we generated patches by $z_{\mathrm{sample}}$ and minimized the adversary loss (Eq. (5)). After optimization, one can produce a latent variable with arbitrary size by tiling $z_{\mathrm{local}}$ . + +# 4. Experiment settings + +# 4.1. Subjects + +We recruited three subjects (mean age: 24.0; range: 21 - 26; two males and one female) to collect physical test set. The recruitment and study procedures were approved by the Department of Psychology Ethics Committee, Tsinghua University, Beijing, China. + +# 4.2. Dataset + +We employed the Inria Person dataset [6] as our training set. It is a dataset for pedestrian detection, which consists of 614 images for training and 288 for testing. We evaluated the patch-based attack on the Inria test set. For physical evaluation, we produced clothes covered with different adversarial textures. Three subjects wore different adversarial clothes and turned a circle slowly in front of a camera which was fixed at 1.38 meters above the ground. The distance between the camera and person is fixed to $2\mathrm{m}$ unless otherwise specified. We recorded two videos for each subject and each adversarial piece of clothing. One of the video was recorded indoor (lab room), and the other was recorded + +in outdoor (brick walkway). We then extracted 32 frames from each video. We recorded $3 \times 2 = 6$ videos and collected $6 \times 32 = 192$ frames for each adversarial piece of clothing. we labeled them manually to construct a test set. + +# 4.3. Baseline Methods + +We evaluated the adversarial patches produced by Thys et al. [32] and Xu et al. [35], and named them by AdvPatch and AdvTshirt, respectively. We copied the patterns from their original papers. We also tiled AdvPatch and AdvTshirt to form textures with repeated patterns. These two variants are called AdvPatchTile and AdvTshirtTile. In addition, we evaluated a texture with repetitive random colors, which is denoted by Random + +Moreover, TC-EGA has multiple components and some of them could be applied separately to craft adversarial textures. To investigate the performance of each component, we designed three variants of TC-EGA, as described below. + +Expandable Generative Attack (EGA) We trained an FCN as the first stage of TC-EGA without optimizing the best latent variable. During evaluation, the final texture can be generated by a latent variable in arbitrary size and sampled from a standard normal distribution. + +Toroidal Cropping Attack (TCA) We directly optimized the texture instead of training an FCN to generate texture. Specifically, we initialized a local texture pattern of $300 \times 300$ pixels, and randomly extracted a patch by size $150 \times 150$ from the texture by Toroidal Cropping in each optimization step. + +Random Cropping Attack (RCA) We directly optimized a large patch whose size is fixed. We initialized the large patch and randomly cropped a small patch by size $150 \times 150$ during optimization. This method is named Random Cropping Attack (RCA). We implemented two attacks, RCA2× and RCA6×, where the sizes of the large patches are $300 \times 300$ and $900 \times 900$ , respectively. + +# 4.4. Implementation Details + +We crafted AdvTexture to mainly fool YOLOv2 [26], YOLOv3 [27], Faster R-CNN [28] and Mask R-CNN [12]. The detectors were pre-trained on MS COCO dataset [20]. Their outputs were filtered to output the person class only. + +For each target detector, we first extracted the predicted bounding boxes on the images from the training set with a Non-Maximum Suppression (NMS) threshold 0.4. We chose the boxes whose confidence was larger than a certain threshold (0.5 for YOLOv2 and YOLOv3, and 0.75 for Faster and Mask R-CNN). We additionally filtered out boxes with areas smaller than $0.16\%$ of the entire images + +![](images/bd5bb32f1e2914ad4c2e525aabfb0d36529e6f846fbfb4d59bc4c78194efaf74.jpg) +(a) Random + +![](images/0355d68d9b5172a48a8b700c32f87d642ae930647b33086c65d9c48a3197ef18.jpg) +Figure 7. Visualization of different textures. (a) The texture with repetitive random colors. (b) The texture formed by tiling an adversarial patch [32] repeatedly. (c) The texture produced by TC-EGA to attack YOLOv2. + +![](images/d789c645bceba28148c6a619c238107dcf65d56a51c8fe4ab006cc4bf046d9ee.jpg) +(b) AdvPatchTile +(c) TC-EGA + +for Faster and Mask R-CNN. Then, as we described in Sec. 3.1.1, we attached the extracted patches to the persons and input the modified images to the detector during optimization. + +Moreover, we applied the Adam [17] optimizer to optimize parameters in both stages. The hyper-parameters are listed as follows. (1) Stage one: The initial learning rate to train the generator was 0.001. The generator was a 7-layer FCN whose input was the latent variable $z$ with size $B \times 128 \times 9 \times 9$ . The size of the corresponding output was $B \times 3 \times 324 \times 324$ , where the second dimension stands for the RGB channels. (2) Stage two: We optimized a local latent variable $z_{\mathrm{local}}$ with size $1 \times 128 \times 4 \times 4$ , followed by the Toroidal Cropping technique to produce samples of $z$ with size $B \times 128 \times 9 \times 9$ . The learning rate of the optimization was 0.03. + +To physically implement AdvTexture, we printed the texture on a polyester cloth material by digital textile printing. Afterwards, we hired a professional tailor to produce adversarial clothes including T-shirts, skirts and dresses. + +# 5. Results + +Fig. 7 shows some textures obtained by different methods, and more can be found in Supplementary Materials. + +# 5.1. Patch-Based Attack in the Digital World + +We first evaluated the attacks in the form of the patch-based attack in the digital world. Specifically, we randomly extracted patches from the textures when evaluating most methods except for AdvPatch and AdvTexture. We denote such patches by resampled patches. We then attached the patches to the images from the Inria test set the same way as crafting the adversarial patches. We used the bounding boxes proposed by the target detectors on the original test images with a confidence threshold of 0.5 as the ground truth. We computed the average precision (AP) of the proposed bounding boxes on the modified test images to measure the adversarial effectiveness. Note that lower AP indicates stronger attack. + +Tab. 1 presents the AP of YOLOv2 in different conditions. clean denotes the AP on the original test set. Since + +
MethodAPExpandableResampled
Clean1.000
Random0.963
AdvPatch [32]0.352XX
AdvPatchTile0.827
AdvTshirt [35]0.744*XX
AdvTshirtTile0.844
TC-EGA0.362
EGA0.470
TCA0.664
RCA2×0.606X
RCA6×0.855X
+ +Table 1. The APs of YOLOv2 under different attacks on Inria test set. Expandable denotes whether the methods can produce textures in arbitrary size. Resampled denotes whether the patches are randomly extracted. + +![](images/2f1ce48b65dc0a66b908eb5915115352758e69a85dd4360ec341f567f2e3d947.jpg) +Figure 8. Numerical study of the segment-missing problem. The patches are cropped near the original patches with a shifting ratio. For AdvPatch as an example, the shifting ratio is 0.0 when the cropped patch is precisely the original patch. The shifting ratio is 1.0 when the original patch is shifted totally outside the cropping range. + +we used the detector's prediction on the original images as the ground truth, the AP is 1.000. The AdvPatch lowered the AP of YOLOv2 to $0.352^{1}$ . + +Compared to AdvPatch, the expandable variant AdvPatchTile increases the AP from 0.352 to 0.827. Since AdvTshirt was trained on a different dataset (its authors' private dataset), it only got an AP of 0.744. Similarly, AdvTshirtTile increases the AP to 0.844. We attribute the increase to the segment-missing problem. Compared to its + +![](images/64b4ecafa606151927ae92589e6d48958d6da946cfe4ae17b2bf926f395a2a0a.jpg) +Figure 9. Real-world adversarial clothes. + +variants, TC-EGA got the lowest AP 0.362, which was also the lowest among all the resampled patches. AdvPatch made the AP slightly lower than TC-EGA. However, it is not expandable and thus unsuitable for the attack at multiple viewing angles. Moreover, EGA decreased the AP to 0.470, TCA created expandable patches with AP 0.664. It was lower than AdvPatchTile, which indicates the effectiveness of the Toroidal Cropping technique. Moreover, $\mathrm{RCA6} \times$ was much worse than $\mathrm{RCA2} \times$ , which indicates difficulties in optimizing a large patch. + +We further investigated the segment-missing problem by evaluating the adversarial effectiveness of the patches which is cropped at shifted positions (See Fig. 8). The patch-based attack, AdvPatch, became less effective when the shifting ratio increased. Tiling the patches alleviated the problem, but was still problematic. The texture generated by TC-EGA was robust during shifting. + +The results of other detectors attacked by TC-EGA in the digital world are shown in Supplementary Materials. + +# 5.2. Attack in the Physical World + +Fig. 9 shows the produced clothes by different methods, and more can be found in Supplementary Materials. + +We first compared different methods on YOLOv2. Since the boxes predicted by the detectors can be filtered by a particular confidence threshold, we plotted the recall-confidence curve in Fig. 10 and showed their APs in the legend. Remember that recall denotes the fraction of the boxes that are successfully retrieved. These boxes are filtered by a confidence threshold. Therefore, for each particular confidence threshold, lower recall denotes better adversarial effectiveness. From Fig. 10, the tiled variants of both AdvPatch and AdvTshirt were more effective than the original method. TC-EGA outperformed among all the methods by the lowest recall-confidence curve and the lowest AP. + +Moreover, we used another metric to evaluate the effectiveness of the attacks. Specifically, for each input image we collected the target detector's predicted bounding boxes whose confidence score is larger than a certain confidence threshold. As long as one of these boxes has an Intersection over Union (IoU) with the ground-truth box greater than 0.5, the detector is considered to have correctly detected. We defined Attack Success Rate (ASR) as the fraction of the test images that are not correctly predicted. Since the + +![](images/269bc9b73d8bfbece1867258c1661092fd53820b7a4295c00f23d01535743feb.jpg) +Figure 10. The recall v.s confidence curves and APs on the physical adversarial test set. The target network is YOLOv2. + +
ClothingRandomTshirtSkirtDress
mASR0.0920.7710.2870.893
+ +ASR is relevant to the confidence threshold, we calculated the mean value of the ASR, namely mASR, under multiple thresholds. The thresholds were 0.1, 0.2, ..., 0.9 in our experiment. + +Fig. 11 presents the mASRs in multiple viewing angles. Compared to the random texture, AdvPatch and AdvTshirt was effective when the persons faced the camera (the viewing angle is $0^{\circ}$ or $360^{\circ}$ in the figure). However, the mASRs of these two methods decreased when the viewing angle increased, which manifests the segment-missing problem. The tiled variants of both methods had some adversarial effectiveness in multiple viewing angles, while the mASRs were lower than 0.5 in almost every viewing angles. TC-EGA outperformed the other methods at almost every viewing angle. The mASR is approximately 1.0 at viewing angle $0^{\circ}$ and $180^{\circ}$ , indicating that the person can always evade the detector when confidence threshold is larger than 0.1. It was less effective when the viewing angle is close to $90^{\circ}$ or $270^{\circ}$ because the area captured by the camera were small at such viewing angles. + +We investigated influence of the type of clothes and the distance between person and camera. From Tab. 2, the adversarial effectiveness varied when the texture was applied to different kinds of clothes. The attack was more effective when applying to larger clothes (e.g., dress), for more area of the texture was captured by the camera. Moreover, the adversarial clothes had comparable mASRs in both indoor and outdoor scenes (See Supplementary Materials). Their effectiveness dropped when far from the camera (See Supplementary Materials). + +Tab. 3 presents the mASRs of the adversarial clothes to attack various detectors. From the table, TC-EGA obtained much higher mASR than Random. Moreover, the adversarial effectiveness remained when the adversarial clothes are transferred across different detectors. See Supplementary Materials for the details of the transfer study. In addition, + +![](images/62e2f0bd5936f5700d51c0e3b8162ff90ae75d2fcb37656e4f4856c8bdf305a5.jpg) +Figure 11. The mASRs of the attacks at multiple viewing angles. + +Table 2. The mASRs of different adversarial clothes. + +
DetectorYOLOv2YOLOv3FasterRCNNMaskRCNN
Random0.0870.00010.0000.000
TC-EGA0.7430.70110.9300.855
+ +1 We scaled the size of the inputs by 50% before sending them to YOLOv3. See Supplementary Materials for the reason. + +Table 3. The mASR of different detectors in the physical world. + +we provide a video demo in Supplementary Video. + +# 6. Conclusions + +We propose a method to craft AdvTextures to realize physical adversarial attacks on person detection systems. The main idea is to first train a expandable generator to generate AdvTexture by taking random input in a latent space, and then search the best local patterns of the latent variable for attack. The effectiveness of the AdvTexture is improved by optimizing the latent input. We physically implemented AdvTexture by printing it on a large cloth and making different T-shirts, skirts, and dresses. Those clothes, evaluated by our experiment in the physical world, were effective when the person wearing them turns around or changes postures. + +Limitations Though the crafted texture targeting one detector can also attack another detector to some extent, the transferability is not very good. Model ensemble could be used to improve transferability. + +Potential negative impact Adversarial research may cause potentially unwanted applications in the real-world community, such as camera security issues. Many defense methods based on previously exposed vulnerabilities have been proposed [10, 19, 36], which have improved the security level of our community and beneficially illustrated the value of research about attack. + +# Acknowledgement + +This work was supported in part by the National Natural Science Foundation of China (Nos. U19B2034, 62061136001, 61836014) and the Tsinghua-Toyota Joint Research Fund. + +# References + +[1] Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples. In International conference on machine learning, pages 284-293. PMLR, 2018. 1, 2 +[2] Fred L. Bookstein. Principal warps: Thin-plate splines and the decomposition of deformations. IEEE Transactions on pattern analysis and machine intelligence, 11(6):567-585, 1989. 2 +[3] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. 2 +[4] Tom B Brown, Dandelion Mane, Aurko Roy, Martin Abadi, and Justin Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017. 1, 2 +[5] 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. 1 +[6] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In 2005 IEEE computer society conference on computer vision and pattern recognition (CVPR'05), volume 1, pages 886-893. IEEE, 2005. 5 +[7] Gianluca Donato and Serge Belongie. Approximate thin plate spline mappings. In European conference on computer vision, pages 21-31. Springer, 2002. 2, 3 +[8] Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9185-9193, 2018. 1 +[9] Kevin Eykholt, Ivan Evtimov, Earlence Fernandes, Bo Li, Amir Rahmati, Chaowei Xiao, Atul Prakash, Tadayoshi Kohno, and Dawn Song. Robust physical-world attacks on deep learning visual classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1625-1634, 2018. 1, 2 +[10] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. 1, 2, 8 +[11] Allen Hatcher. Algebraic Topology. Cambridge University Press, 2002. 5 +[12] 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 +[13] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In International Conference on Learning Representations, 2019. 3, 4 +[14] Yu-Chih-Tuan Hu, Bo-Han Kung, Daniel Stanley Tan, Jun-Cheng Chen, Kai-Lung Hua, and Wen-Huang Cheng. Naturalistic physical adversarial patch for object detectors. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7848-7857, 2021. 1, 2 + +[15] Lifeng Huang, Chengying Gao, Yuyin Zhou, Cihang Xie, Alan L Yuille, Changqing Zou, and Ning Liu. Universal physical camouflage attacks on object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 720-729, 2020. 1, 2 +[16] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4401-4410, 2019. 2 +[17] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 +[18] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In International Conference on Learning Representations, 2017. 1, 2 +[19] Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1778-1787, 2018. 8 +[20] 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. 6 +[21] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431-3440, 2015. 2, 4 +[22] Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2574–2582, 2016. 1 +[23] Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 427-436, 2015. 1 +[24] 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. 1 +[25] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. 2 +[26] 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. 6 +[27] Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018. 6 +[28] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: towards real-time object detection with region proposal networks. IEEE transactions on pattern analysis and machine intelligence, 39(6):1137-1149, 2016. 6 + +[29] Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In Proceedings of the 2016 acm sigsac conference on computer and communications security, pages 1528-1540, 2016. 1, 2, 3, 4 +[30] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. 2, 4 +[31] 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. 1, 2 +[32] Simen Thys, Wiebe Van Ranst, and Toon Goedemé. Fooling automated surveillance cameras: adversarial patches to attack person detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 0–0, 2019. 1, 2, 3, 6, 7 +[33] Yi Wang, Jingyang Zhou, Tianlong Chen, Sijia Liu, Shiyu Chang, Chandrajit Bajaj, and Zhangyang Wang. Can 3d adversarial logos cloak humans? arXiv preprint arXiv:2006.14655, 2020. 2 +[34] Zuxuan Wu, Ser-Nam Lim, Larry S Davis, and Tom Goldstein. Making an invisibility cloak: Real world adversarial attacks on object detectors. In European Conference on Computer Vision, pages 1-17. Springer, 2020. 1, 2 +[35] Kaidi Xu, Gaoyuan Zhang, Sijia Liu, Quanfu Fan, Mengshu Sun, Hongge Chen, Pin-Yu Chen, Yanzhi Wang, and Xue Lin. Adversarial t-shirt! evading person detectors in a physical world. In European Conference on Computer Vision, pages 665-681. Springer, 2020. 1, 2, 3, 6, 7 +[36] Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017. 8 +[37] Xiaopei Zhu, Xiao Li, Jianmin Li, Zheyao Wang, and Xiaolin Hu. Fooling thermal infrared pedestrian detectors in real world using small bulbs. In The Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI, 2021. 1 \ No newline at end of file diff --git a/adversarialtextureforfoolingpersondetectorsinthephysicalworld/images.zip b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0b956fe90172619f80022eae79f3da62aaff8211 --- /dev/null +++ b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76f937037717bbf6322be89a070e69ef42f332b2ecf664f0a19bfadfd8a1ff98 +size 465123 diff --git a/adversarialtextureforfoolingpersondetectorsinthephysicalworld/layout.json b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1c78a0e129eba17fb206eaebe78925efc02724c9 --- /dev/null +++ b/adversarialtextureforfoolingpersondetectorsinthephysicalworld/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65449d3aad2180fd127268dd5f1721275f3e20704c542624e4627f86f28a9ea0 +size 468091 diff --git a/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_content_list.json b/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..afd9f8a52eae2c0f82ca0c28fa1c472544897ccf --- /dev/null +++ b/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:407c126bcd7fc024805b1064fbe095fb8a593e7fb072d9d9c74c0db20a412534 +size 79521 diff --git a/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_model.json b/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0dac09af2119444d6f60b8d4bda6d38fb360939e --- /dev/null +++ b/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7806f5cd4787e64a8b22b5f3114edf943ec18f4ca1edccd3c02050c6c80737a0 +size 100428 diff --git a/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_origin.pdf b/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..136f7fc9fc9de77a0b906ea95b6423d3797e0064 --- /dev/null +++ b/aegnnasynchronouseventbasedgraphneuralnetworks/6e80c41c-138b-4b50-8993-6257ff2415f1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9441d7322dc9bdd22a162ad02e57b4a2f1000a3bfbeb7187eef3627c73ccb05 +size 2540951 diff --git a/aegnnasynchronouseventbasedgraphneuralnetworks/full.md b/aegnnasynchronouseventbasedgraphneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2935dc0cfc2bb02592bf298db5fddc15ee33a87f --- /dev/null +++ b/aegnnasynchronouseventbasedgraphneuralnetworks/full.md @@ -0,0 +1,319 @@ +# AEGNN: Asynchronous Event-based Graph Neural Networks + +Simon Schaefer* + +Daniel Gehrig* + +Davide Scaramuzza + +Dept. Informatics, Univ. of Zurich and Dept. of Neuroinformatics, Univ. of Zurich and ETH Zurich + +![](images/fa440be525b3322abd8e65249311f1470efb426e867f6a964d551c407ca03539.jpg) +(a) Event Stream + +![](images/33491072bd68d12a455d2dbca9b1ee50ccc7966f39da7097f240f7175e885ccf.jpg) +(b) Sparse Event Graph + +![](images/680e82519bb3e1d1691418ac4870dea833943621fffbd5694404f7c140afecc7.jpg) +(c) GNN + +![](images/734d434e3efca9d00c3a71e2c3d88ef9453de50ae8ed35d3b53613c91c923c6b.jpg) +(d) Performance vs. Computation +Figure 1. Our method processes events (a) as spatio-temporal graphs (b), using a graph neural network (c). For each new event we only limit computation to a local subgraph of (b), corresponding to the receptive field of the network, thus significantly reducing per-event computation. Our method has a 200 times lower computational complexity than state-of-the-art asynchronous method [31], while achieving state-of-the-art results on object recognition and object detection (d). + +# Abstract + +The best performing learning algorithms devised for event cameras work by first converting events into dense representations that are then processed using standard CNNs. However, these steps discard both the sparsity and high temporal resolution of events, leading to high computational burden and latency. For this reason, recent works have adopted Graph Neural Networks (GNNs), which process events as "static" spatio-temporal graphs, which are inherently "sparse". We take this trend one step further by introducing Asynchronous, Event-based Graph Neural Networks (AEGNNs), a novel event-processing paradigm that generalizes standard GNNs to process events as "evolving" spatio-temporal graphs. AEGNNs follow efficient update rules that restrict recomputation of network activations only to the nodes affected by each new event, thereby significantly reducing both computation and latency for event-by-event processing. AEGNNs are easily trained on synchronous inputs and can be converted to efficient, "asynchronous" networks at test time. We thoroughly validate our method on object classification and detection tasks, + +where we show an up to a 200-fold reduction in computational complexity (FLOPs), with similar or even better performance than state-of-the-art asynchronous methods. This reduction in computation directly translates to an 8-fold reduction in computational latency when compared to standard GNNs, which opens the door to low-latency event-based processing. + +# Multimedia Material + +For videos, code and more, visit our project page https://uzh-rpg.github.io/aegnn/. + +# 1. Introduction + +Compared to standard frame-based cameras, which measure absolute intensity at a synchronous rate, event-cameras only measure changes in intensity, and do this independently for each pixel, resulting in an asynchronous and binary stream of events (Figure 1 (a)). These events measure a highly compressed representation of the visual signal and are characterized by microsecond-level latency and temporal resolution, a high dynamic range of up to 140 + +dB, low motion blur, and low power (milliwatts instead of watts). Due to these outstanding properties, event cameras are indispensable sensors in challenging application domains—such as robotics [9,21,47,52], autonomous driving [18, 51, 56], and computational photography [3, 44, 53, 54]—characterized by frequent high-speed motions, low-light and high-dynamic-range scenes, or in always-on applications, where low power is needed, such as IoT video surveillance [23, 36]. A survey about applications and research in event-based vision can be found in [14]. + +The output of event cameras is inherently sparse and asynchronous, making them incompatible with traditional computer-vision algorithms designed for standard images. This prompts the development of novel algorithms that optimally leverage the sparse and asynchronous nature of events. In doing so, existing algorithms designed for event cameras have traded off latency and prediction performance. Filtering-based [39] [28] approaches process events sequentially, and, thus, can provide low-latency predictions and a high temporal resolution. However, these approaches usually rely on handcrafted filter equations, which do not scale to more complex tasks, such as object detection or classification. Spiking Neural Networks (SNNs) are one instance of filtering-based models, which seek to learn these rules in a data-driven fashion, but are still in their infancy, lacking general and robust learning rules [19, 29, 49]. As a result, SNNs typically fail to solve more complex high-level tasks [2, 39, 41, 51]. Many of the challenges above can be avoided by processing events as batches. In fact, recent progress has been made by converting batches of events into dense, image-like representations and processing them using methods designed for images, such as convolutional neural networks (CNNs). By adopting this paradigm, learning-based methods using CNNs have made significant strides in solving computer vision tasks with events [17, 22, 34, 42, 44, 53, 57, 58]. + +However, while easy to process, treating events as image-like representations discards their sparse and asynchronous nature and leads to wasteful computation. This wasteful computation directly translates to higher power consumption and latency [1, 23, 37]. A recent line of work [16] showed on an FPGA that by reducing the computational complexity by a factor of 5, they could reduce the latency by a factor of 5 while reducing the power consumption by a factor of 4. Therefore, by eliminating wasteful computation, we can expect significant decreases in the power consumption and latency of learning systems. + +Currently, this wasteful computation is caused by two factors: On the one hand, due to the working principle of event cameras, they trigger predominantly at edges, while large texture-less or static regions remain without events. Image representations typically encode these regions as zeros, which are then unnecessarily processed by standard + +neural networks. On the other hand, for each new event, standard methods would need to recompute all network activations. However, events only measure single pixel changes and, thus, leave most of the activations unchanged, leading to unnecessary recomputation of activations. + +A recent line of work seeks to address both of these challenges by reducing the computational complexity of learning-based approaches while maintaining the high temporal resolution of events. A key ingredient to keeping high performance in this setting was the adoption of geometric learning methods, such as recursive point-cloud processing [48] or Asynchronous Sparse Convolutions [35]. In both works, standard neural networks were trained using batches of events, leveraging well-established learning techniques such as backpropagation, and then deploying them in an event-by-event fashion at test time, thus minimizing computation. However, both of these methods suffer from limitations: While [48] does not perform hierarchical learning, limiting scalability to complex tasks, [35], relies on a specific type of input representation, which discards the temporal information of events. + +In this work, we introduce Asynchronous, Event-based Graph Neural Networks (AEGNN), a neural network architecture geared toward processing events as graphs in a sequential manner (Fig. 1). For each new event, our method only performs local changes to the activations of the GNN, and propagates these asynchronously to lower layers. Similar to [35, 48], AEGNNs can be trained on batches of events—thus leveraging backpropagation—and can later be deployed in an asynchronous mode, generating the identical output. However, they address the key limitations of previous work: (i) They allow hierarchical learning using standard graph neural networks and (ii) model events as spatiotemporal graphs, thus retaining their temporal information, instead of discarding it. This leads to significant computational savings. We summarize our contributions as follows: + +- We introduce AEGNN, a novel paradigm for processing events sparsely and asynchronously as temporally evolving graphs. This allows us to process events efficiently, without sacrificing their sparsity and high temporal resolution. +- (ii) We derive efficient update rules, which allow us to simply train AEGNNs on synchronous event-data, and then deploy them in an asynchronous mode during test-time. These rules are general and can be applied to most existing graph neural network architectures. +(iii) We apply AEGNNs on object recognition and object detection benchmarks. For object detection, we show similar performance to state-of-the-art methods, while requiring up to 200 times less compute, while for object detection we show a 21-fold computation reduction with an up to $3.4\%$ increase in terms of mAP. + +# 2. Related Work + +Since the advent of deep learning, event-based vision has adopted many of its models. Early models, relied on shallow learning techniques such as SVMs [51] or filtering-based techniques [15, 25, 28, 39], and have gradually shifted to deeper architectures such as CNN's [17, 34, 44, 57]. While achieving state-of-the-art performance, these types of models do not take into account the sparse and asynchronous nature of events, leading to redundant computation. This prompted the development of sparse network architectures such as SNNs, point cloud methods [48], Submanifold Sparse Convolutions [35] and graph neural networks [4, 5, 31]. Which all seek to reduce computation. While SNNs are traditionally harder to train, due to a lack of efficient learning rules, geometric learning methods such as [4, 5, 31, 35, 48] have gained popularity in recent years, since they are more suited to the asynchronous and sparse nature of events, and are easily trained and implemented thanks to the existence of well-maintained toolboxes. + +In particular, graph-based methods such as [4, 5, 31, 46] show a significant reduction in computational complexity compared to dense methods that rely on standard CNNs. This is because, instead of processing events as dense image-like tensors, they only consider sparse connections between events, and confine message passing to these connections. Despite this sparsity, these methods still process events as batches and thus need to recompute all activations, whenever a new event arrives. However, each event only indicates a per-pixel change, and thus recomputing activations leads to the highly redundant computation. To counteract this, a recent line of work has focused on reusing network activations as much as possible between consecutive events, by applying efficient recursive update rules [48] and propagating these to lower layers [35]. + +These methods, however, do not allow for hierarchical learning [46, 48] or still rely on sparse but image-like input representations, which discard the temporal component of events. These factors either limit the scalability to more complex tasks in the case of [48], or degrade performance while incurring higher computation in the case of [35]. Most similar to our work, [46] learns on dynamic graphs, by performing learned updates each time node events are triggered. However, it also performs shallow learning, i.e. it only computes node embeddings, but does not use them for end-task learning. + +In this work, we combine the advantages of graph-based methods with efficient recursive update rules, thus addressing these limitations: Asynchronous Event-based Graph Neural Networks are multi-layered, and can thus learn more complex tasks than [48], and leverage the spatio-temporal sparsity of events better than [35], leading to significant computation reduction. + +# 3. Prerequisites + +In this work, we model events as spatio-temporal graphs $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ with vertices $\mathcal{V}$ and (directed) edges $\mathcal{E}$ . In this context, events are represented as nodes within the graph and connections are formed between neighboring events (Fig.2 (c)). We use a graph neural network to process this graph and generate a prediction $y$ . It can be represented as a function $f(\mathcal{G}) = y$ , which executes a set of operations on the graph level. Most common operations consist of graph convolutions and pooling steps, which operate on node features $\mathbf{x}_i$ attached to each node, and edge features $e_{ij}$ attached to each edge. + +Graph Convolutions: Graph convolutions generally consist of three distinct steps which are repeated for each node $i$ in the graph: First the function $\psi$ computes messages based on pairs of neighbors $(i,j)$ , where $i$ is fixed and $j \in \mathcal{N}(i)$ is in the neighborhood of $i$ . These messages depend on the node features at these nodes, the edge feature but also on the spatial arrangement of nodes $i$ and $j$ . Next, all messages are aggregated through summation1, and followed by a function $\gamma_{\Theta}$ , which computes the new value for node $i$ . These steps are summarized in the equations below: + +$$ +\mathbf {z} _ {i} = \sum_ {j \in \mathbb {N} (i)} \psi_ {\Theta} (\mathbf {x} _ {i}, \mathbf {x}, \mathbf {e} _ {i j}) \tag {1} +$$ + +$$ +\hat {\mathbf {x}} _ {i} = \gamma_ {\Theta} \left(\mathbf {x} _ {i}, \mathbf {z} _ {i}\right) \tag {2} +$$ + +Both $\psi$ and $\gamma$ denote differentiable functions such as a multi-layer perceptron, parametrized by $\Theta = \{\theta_{\gamma},\theta_{\psi}\}$ + +Graph Pooling Graph pooling operations transform a graph $\mathbb{G}$ to a more coarse graph $\mathbb{G}_c$ . For an overview of the different types of graph pooling, we refer to [55]. Within this work, we will focus on cluster-based pooling methods, which aggregate the graph nodes into clusters $\mathcal{C}_k$ with cluster centers $k \in \mathcal{V}_c$ which form a subset of $\mathcal{V}$ . The new features at these cluster centers are computed by aggregating features in each cluster: + +$$ +\mathbf {x} _ {k} = \max _ {i \in \mathcal {C} _ {k}} \mathbf {x} _ {i} \tag {3} +$$ + +Since clustering reduces the number of nodes, the original edges need to reconnected, and this is performed with the function $\pi$ : + +$$ +\mathbb {E} _ {c} = \pi (\mathbb {E}, \mathbb {C}) \tag {4} +$$ + +resulting in the final coarse graph. + +Stacking these operations as layers enables rich, and high-level feature computation, making these models more powerful than the point cloud method in [48] or shallow features computed in [51]. + +![](images/4e9ae9e5c1b2a33173df3b9e4bf87d4fac2c998b29a6fa40a8d67335e402eae6.jpg) +(a) Event Stream + +![](images/8537764a08acf9b782f112cbc751748183ba21272ef82d4e591f08943e0918a6.jpg) +(b) Subsampling + +![](images/543daecadfe2c7b5d3db4d0b4fa7a1ed10028281fb521a09a0508936c66ee9b5.jpg) +(c) Graph Generation + +![](images/44829b9787e292b58ff56992a137f0adee73af4a5d07db64d1715f41057baacb.jpg) +(d) GNN + +![](images/2aa23822b08289b91b30414ed0694cc463ab37a57825c7b78ce5f153bd41f148.jpg) +(e) Prediction + +![](images/3bba882e0c3a86c8160192acac90a0a42230cc7b9b1034d54e95e9a59a2f3669.jpg) +Figure 2. Overview of the processing steps in our method. The event stream (a) is first subsampled using uniform sampling (b). The subsampled events are used to generate a sparse spatio-temporal graph (c), which is processed by a graph neural network (GNN)(d), which generates a bounding-box prediction (d). Although our method works for any task, here we illustrate our method for the task of object detection. In the figure below, we show an overview of the used network architecture. It combines Graph Convolutions (here Spline Convolutions) with pooling layers, followed by a prediction head. Each graph convolution block consists of several graph convolutions followed by ELU and Batch Normalization. + +![](images/41ce2e981729c14ceeeb5704f36d114579373834b072b19b655239718935cccd.jpg) + +# 4. Approach + +Representing event data as spatio-temporal graphs allows us to efficiently process incoming events by performing sparse but complete graph updates. In the following, we show how a graph can be constructed from an event stream (Sec. 4.1), and we demonstrate how it can be used for efficient and asynchronous computations (Sec. 4.2). An overview of the full method is illustrated in Figure 2. + +# 4.1. Graph Construction + +Event cameras have independent pixels which each trigger events, whenever they perceive a brightness change. Each event encodes the pixel position $(x_{i},y_{i})$ , time $t_i$ with microsecond level resolution and polarity (sign) $p_i\in \{-1,1\}$ of the change. A group of event in a time window $\Delta T$ , can thus be represented as an ordered list of tuples + +$$ +\left\{e _ {i} \right\} _ {N} = \left\{e _ {i} \right\} _ {i = 1} ^ {N} \quad \text {w i t h} e _ {i} = \left(x _ {i}, y _ {i}, t _ {i}, p _ {i}\right) \tag {5} +$$ + +By embedding these events in a spatio-temporal space $\mathbb{R}^3$ we thus can see that they are inherently sparse and asynchronous (Fig.2 (a,b)). + +For the sake of computational efficiency, we first subsample the events uniformly by a factor $K$ (Fig. 2(b)). In this work, we select $K = 10$ . While this preprocessing step removes events, we found that it is critical to combat overfitting, since the network learns to consider larger contexts, + +focusing on more informative events. In contrast to other representations of event data such as event histograms [35] or event volumes [3, 42], the full temporal resolution of the event stream is preserved. This high temporal resolution is crucial in robotic applications like obstacle avoidance [9, 33, 47]. + +We use the remaining events to form an event graph $\mathcal{G}$ where each event is a node (Fig. 2 (c)). Inspired by [4] the event's temporal position is normalized by a factor $\beta$ to map it to a similar range as the spatial coordinates. The position of each vertex is then denoted as $\mathbf{X}_i = (x_i, y_i, t_i^*)$ with $t_i^* = \beta t_i$ . + +For each pair of nodes $i$ and $j$ , an edge $e_{ij}$ between them is generated if they are within spatio-temporal distance $R$ , i.e. $R \leq \| \mathbf{X}_i - \mathbf{X}_j\|$ from each other. To reduce computation and regularize the graph, we limit the maximal number of neighborhood nodes to $D_{max}$ , i.e. $|\mathcal{N}(i)| \leq D_{max}$ . Finally, we assign initial node features, $\mathbf{x}_i = p_i$ and edge features corresponding to the relative position between the connected vertices, normalized by $R$ . + +# 4.2. Asynchronous Processing + +As we slide the time window $\Delta T$ , new events enter this window, and old events leave the window. While traditional methods would need to recompute all activations once this happens, here we present a recursive formulation that incorporates new events with minimal computation. + +As a new event arrives, a new node is added to the graph, together with new edges connecting this node to existing vertices. The new connections are sparse, affecting only neighboring events. In fact, in the first layer, a new event only affects the state of its 1-hop subgraph (Fig.3, Layer 1), corresponding with the neighborhood of the new node $i'$ . Therefore, activations in the next layer need to only be recomputed for this subgraph via Eq. (2). + +$$ +\hat {\mathbf {z}} _ {i} = \sum_ {j \in \mathcal {N} (i)} \psi_ {\Theta} \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}, \mathbf {e} _ {i j}\right) \tag {6} +$$ + +$$ +\hat {\mathbf {x}} _ {i} = \gamma_ {\Theta} \left(\mathbf {x} _ {i}, \mathbf {z} _ {i}\right) \text {f o r a l l} i \in \mathcal {N} \left(i ^ {\prime}\right) \tag {7} +$$ + +As deeper layers are reached, this subgraph expands, hopping one node after each layer step, until at layer $N$ the nodes in $\mathcal{H}_N(i')$ need to be updated. $\mathcal{H}_N(i')$ denotes the N-hop subgraph which contains all nodes $j$ such that $j$ could be reached from $i'$ using $N$ hops or fewer. We visualize this hopping behavior in Fig. 3. Instead of processing the whole graph, only this subgraph has to be processed to obtain the same resulting graph activations as Eq. 2. By iteratively applying this concept to each graph-convolution layer of a graph neural network, its forward pass can be formulated sparsely, which significantly reduces the computational effort. At each layer, the necessary computation is proportional to the number of nodes in the respective subgraph. This number is known in the graph-theory literature as neighborhood function [6], and is influenced by the average and variance of the connectivity of the graph, which together forms the index of dispersion [6]. + +![](images/5dbf0eb18d2a1d47cf2538cc970fa4d3acd098da2c11c0b75b5e62cafd538bef.jpg) +Layer 0 + +![](images/f592ee0cc50df73c0a88794cb0d44647c7fb6510f155eaf52e81d1a4312da4d3.jpg) +Layer 1 + +![](images/ccd2e4db35435dd5e402bc90c544c7f424503459432b8e4cca8b317adab5562f.jpg) +Layer 2 +Figure 3. Message propagation in the event graph. A new event (red) is generated and added to the graph of precedent events (left). The added information is propagated to the $k$ -hop neighborhood of the new event vertex, with $k = 1$ (middle) and $k = 2$ (right). + +Graph Convolutions Our sparse update rules for graph convolutions are agnostic to the choice of functions $\psi$ and $\gamma$ (Eq. 2) and are therefore applicable to arbitrary types of graph convolution. It consists of two steps: During the initialization the convolution is applied to the full graph, while the resulting graph, i.e., the vertices and edges as well as their attributes, are stored. We perform this step at the beginning and whenever the camera is stationary and mostly + +noise events enter the sliding window. Thereafter, in the processing step, every time a new vertex is inserted into the graph, the graph only changes locally. Therefore, a full graph update is equivalent to updating the 1-hop subgraph starting from the new vertex, by applying Eq. 2 to its 1-hop subgraph only. Thereby, the subgraph can be efficiently obtained, as the graph's edges are known from the initialization and updated with every subsequent forward pass. + +The same procedure can be applied to every subsequent convolutional layer. Hence, the update of the kth layer is limited to the $k$ -hop subgraph of the new vertex. These steps lead to significant computational savings, as demonstrated in Sec. 5. + +Graph Pooling Similar to sparse graph convolutions, sparse graph pooling operations are composed of an initialization and a processing step. During initialization, the procedure described in Sec. 3 is applied to the dense input graph $\mathcal{G}$ , which results in the coarse output graph $\mathcal{G}_c$ . Subsequently, in the processing stage, we assign events to the respective voxels where they are triggered, connecting them with nodes in the input graph, and then perform the max operation again for that specific voxel. If a node attribute is changed, we similarly perform the max operation again at the respective voxel. Finally, the output graph $\mathcal{G}_c$ can be efficiently computed by applying Eqs. 3 and 4 on $\mathcal{G}_c^\prime$ . + +Other Layers Non-graph-based layers such as linear or batch normalization can be sparsely updated similarly, by storing the results of the dense update during initialization and only processing the subset of the input, which changes from the previous input, as described in [35]. However, since these layers are applied at the lowest level, most nodes need to be updated, leading to only small gains in computational efficiency. + +# 4.3. Network Details + +While the method described in Sec. 4 would allow to sparsely update any kind of graph convolution, we found that spline convolutions [13] find a balance between computational complexity and predictive accuracy. In contrast to the standard graph convolutions [27] used in [31], spline convolutions maintain spatial information in the encoding by using a B-spline-based kernel function in the positional vertex space. This means that spline convolutions also take the relative position of neighboring nodes into account, a feature which is ignored in standard GNN-based methods like [31]. We use voxel-grid-based max-pooling [50] due to its computational efficiency and simplicity. The method in [50] clusters the graph's vertices by mapping them to a uniformly spaced, spatio-temporal voxel grid, with all vertices in a voxel being assigned to one cluster. In this work we use voxels of size $12 \times 16 \times 16$ . For each voxel, a node is sampled, resulting in the nodes of the coarse graph. Evaluating the effect of the clustering method on the overall + +
MethodsRepresentationAsync.N-Caltech101N-Cars
Accuracy ↑MFLOP/ev ↓Accuracy ↑MFLOP/ev ↓
H-First [39]Spike0.054-0.561-
HOTS [28]Time-Surface0.21054.00.62414.0
HATS [51]Time-Surface0.6424.30.9020.03
DART [43]Time-Surface0.664---
YOLE [7]Event-Histogram0.70236590.927328.16
EST [17]Event-HistogramX0.81741500.9251050
SSC [20]Event-HistogramX0.76116210.945321
AsyNet [35]Event-Histogram0.7452020.94421.5
NVS-S [31]Graph0.6707.80.9155.2
EvS-S [31]Graph0.76111.50.9316.1
OursGraph0.6680.3690.9450.03
+ +Table 1. Comparison with several asynchronous and dense methods for object recognition. Our graph-based method has the lowest computational complexity overall while achieving state-of-the-art performance. Especially, it obtains the best accuracy on N-Cars [51] with 20 times lower computational complexity, compared to the second-best asynchronous method. + +network performance remains open for future work. Furthermore, we sub-sample the input event stream using uniform sampling to a fixed number of events. We found that other, more sophisticated sampling methods, such as nonuniform grid sampling [4], only marginally improved the performance, while being much more costly to compute. + +Our model architecture is shown in Figure 2. It consists of 7 graph convolution blocks (see Figure 2, bottom right) and 2 pooling layers. For detailed information about our model architecture, we refer to the supplementary material. + +# 5. Experiments + +All experiments within this work have been conducted using the PyG library [12] in the Torch framework [40]. For training, we use the Lightning framework [10]. + +Implementation Details: We used Adam [26] with batch size 16 and an initial learning rate $10^{-3}$ , which decreases by a factor of 10 after 20 epochs. We apply AEGNN to the tasks of object recognition and object detection. + +We have analytically deduced the computational complexity of a forward pass of our model by adding up the computational complexity of each layer. A detailed derivation can be found in the supplementary material. + +# 5.1. Object Recognition + +Event-based object recognition tackles the problem of predicting an object category from the event stream and is an important application of event cameras. Due to their high dynamic range and high temporal resolution, event cameras have the potential to detect objects, that would otherwise be undetectable by frame-based methods, especially in low-light conditions, or in conditions with severe motion blur. We demonstrate that our approach is capable of solving this task very efficiently while achieving state-of + +the-art recognition performance. The model is evaluated on two diverse datasets: The Neuromorphic N-Caltech101 dataset [38] contains event streams recorded with a real event camera representing 101 object categories in 8,246 event sequences. each $300~\mathrm{ms}$ long, mirroring the well-known Caltech101 dataset [11] for images. The N-Cars dataset [51] has real events, assigned to either a car or the background. It has 24,029 event sequences, each being 100 ms long. For training, we use the cross-entropy loss with batch-size 64 (N-Cars) and 16 (N-Caltech101). + +Recognition Performance We compare AEGNN against several state-of-the-art methods, both asynchronous and synchronous, with different event representations (Tab. 1). We term methods as synchronous, if they require recomputation at each new event, and asynchronous otherwise. For quantitative comparison, we state the recognition accuracy on the test set. To assess the computational efficiency of each method, we process windows with 25,000 events and measure the floating-point operations (FLOPs) required to update the prediction for each additional event. H-First [39], HOTS [28], HATS [51] and DART [43] propose hand-designed features for object recognition. Typically, they are computationally efficient, but widely outperformed by our data-driven method. EST [17] is a learnable and dense event representation that is jointly optimized with the downstream task. Although yielding very good recognition accuracy, it introduces additional data processing by using a learned representation and cannot be formulated asynchronously. Thus, our method is 3,000 times more efficient while achieving a similar predictive performance on N-Cars. AsyNet [35] proposes an asynchronous, sparse network based on event-histograms. Hence, it does not explicitly account for the event's temporal component. Lastly, NVS-S and EvS-B [31] also use a graph-based event representation. In contrast + +![](images/d51ae7e91f4b7a4f2c66b90939fd7aeef422ffca4f9319d96cac5e786aec018b.jpg) +(a) MFLOPS over events + +![](images/13faccc70728d2a682da80b971cc2b8205883d3f4d7cc54da083070714416e90.jpg) +(b) MFLOP savings per layer +Figure 4. Computational savings of our method compared to a dense CNN, GNN and the method in [35] on N-Cars [51]. We compare the cumulative FLOPS for processing events in sequence (a). Here it is visible that already using a GNN reduces the number of FLOPS by a factor of 10. By additionally using our asynchronous formulation, we further reduce this number by a factor of 30. Additionally, for our method, computation grows much more slowly than for other methods. We show in (b) the FLOPS saved per layer, compared to a dense GNN. We see that our method saves most of the computation in the early and middle layers, where high feature dimensions are used. Finally, we demonstrate the use of our method for early prediction (c). Although the model was trained with 10,000 events, merely 2,500 events are required to achieve over $90\%$ accuracy. + +![](images/19c1c19e921f58ecacc3d7e2fced44346a3fbfeabbc780e83d060e0a4244935a.jpg) +(c) Accuracy over events + +to the standard graph convolutions used in EvS-B, the spline convolutions AEGNN encode spatial information. Consequently, our method is 21 times more efficient while achieving a similar accuracy, in comparison to [31]. + +Scalability While previously assuming a constant number of input events, in the following, we analyze the impact the number of events has on both the computational complex and the recognition accuracy to determine the viability of our method for low-latency prediction. To do this, we compare our model's test set accuracy on N-Cars for different numbers of events, and plot the accuracy and required cumulative computation in Figs. 4 (a) and (c). To highlight the efficiency of our method, we also plot the required number of FLOPs for the dense GNN, the asynchronous method [35] and its dense, synchronous variant. Our proposed method outperforms [35] in terms of accuracy (Tab.1) and in terms of FLOPs (Fig. 4 (a)), showing a computation reduction by a factor of 300. The computational savings come from the comparably flat architecture and sparse graph representation. Notably, our model does not require the full event stream, that it was trained on, for a correct prediction. As demonstrated in Fig 4 (c), only 5,000 events are required to achieve state-of-the-art recognition accuracy, further improving the computational efficiency of our method. Moreover, our method takes $30 \pm 4.8$ kFLOPS/ev for 25'000 events, averaged over all sequences. The low variance indicates a high level of stability. + +
Model2000400060008000
Standard GNN3.816.699.3811.83
Ours0.110.100.230.32
+ +Figure 5. Computational effort in MFLOPs per event of our sparse method compared to its dense equivalent, evaluated on NCaltech101. With a higher number of events, and thus increasing complexity of the event graph, the computational gap becomes larger. + +# 5.2. Object Detection + +Event-based object detection seeks to classify and detect object bounding boxes from an event stream and is an emerging topic in event-based vision. Especially in nighttime scenarios or when objects travel at high speeds, frame-based object detection degrades due to image degradation, caused by underexposure or severe motion blur. Event cameras by contrast do not suffer from these issues and are thus viable alternatives in these cases. We apply our framework to this task and validate our approach on two challenging datasets: the N-Caltech101 dataset [38], see Sec. 5.1, and the Gen1 dataset [8]. While N-Caltech101 contains only one bounding box per sample, it contains 101 classes, making it a difficult classification task. By contrast, Gen1 targets an automotive scenario in an urban environment with annotated pedestrians and cars. With 228, 123 bounding boxes for cars and 27, 658 for pedestrians, the Gen1 dataset is much larger. To avoid the well-known over-smoothing problem of GNNs [30], we adopt the same backbone as for the recognition task but use a YOLO-based object detection head [45], as illustrated in Fig. 2. Similar to [45] we use a weighted sum of class, bounding box offset and shape as well as prediction confidence losses. + +Detection Performance To evaluate the performance of our model, we use the eleven-point mean average precision (mAP) [32] score as well as the computational complexity per event, as described in Sec. 5.1. We compare with synchronous and asynchronous state-of-the-art methods and present the results in Tab.2. Qualitative results of our object detector on N-Caltech101 and the Gen1 dataset are shown in Fig.6 We reimplement NVS-S [31], as opensource code is not available. + +Our method outperforms NVS-S [31] by $7.7\%$ , while using 21 times less computation. This is because NVSS uses standard graph convolutions, and thus have a re + +
MethodsRepresentationAsync.N-Caltech101Gen1
mAP ↑MFLOP/ev ↓mAP ↑MFLOP/ev ↓
YOLE [7]Event-Histogram0.3983682--
Asynet [35]Event-Histogram0.6432000.129205
RED [42]Event-VolumeX--0.404712
NVS-S [31]Graph0.346*7.80.086*7.8
OursGraph0.5950.370.1630.39
+ +Table 2. Comparison with several asynchronous and dense methods for object detection. The method in [31] was re-implemented and trained by us, as [31] only reports results for the object recognition task. + +![](images/b8f99d2b90abb2c6a78dd24b640295a2e8aaf4cbac562da25d844fa9105336e1.jpg) +Figure 6. Qualitative results of the object detection performed by our model on Gen1 [8] and N-Caltech101 [38] dataset. Our predictions are shown as a dashed line, the labels as solid line. + +![](images/ac1cfd381b679908e878e5d7c29776ad5e915ee3166b5eee045bdf432075924d.jpg) + +![](images/0bb1305ab180f7f692f62422c3e0143d93000c76922f7141a12e6a3b6c1984a7.jpg) + +ceptive field that is limited to their direct neighborhood, which deteriorates detection performance. Compared to RED [42], we achieve a lower accuracy but outperform the method by a significant margin: While our method uses 0.39 MFLOPs/ev, [42] uses 4712 MFLOPs/ev. This is because [42] uses a dense, synchronous recurrent network, and it is thus not capable of event-by-event processing. Finally, AsyNet [35] outperforms AEGNN on N-Caltech101 by $4.8\mathrm{mAP}$ , but we show a $3.4\mathrm{mAP}$ higher performance on Gen1. While performances are comparable, we achieve this with 520-540 times fewer MFLOPs per event. + +Timing Experiments We timed our method, implemented in Python and CUDA, on an Nvidia Quadro RTX. To construct the graph we implemented the radius search algorithm in [31] in CUDA, which takes $2\mathrm{ms}$ to generate a graph with 2,500 nodes. For processing one event in an event graph of 4,000 from N-Caltech101, the dense update requires $167ms$ , our sparse method $92ms$ . For 25,000 events, the dense GNN needs $1014ms$ , our sparse method $129ms$ , an improvement by a factor of 8. A dense CNN with the same input requires $202ms$ . While our method is only 1.5 times faster than a CNN, we point out here that CNNs have highly optimized implementations in the PyTorch Library [40]. However, we expect that if implemented on suitable hardware, such as FPGA or IPU [24] processors, the reported computation reduction will lead to significant reductions in latency and power consumption, as was already demonstrated in [16]. + +# 6. Conclusion + +While event-based vision has made significant strides by adopting standard learning-based methods based on CNNs, these discard the spatio-temporal sparsity of events, which leads to wasteful computation. For this reason, geometric-learning approaches for event-based vision have gained in popularity. In this work, we introduced AEGNNs, which model events as evolving spatio-temporal graphs and formulate efficient update rules for each new event that restrict recomputation of network activations only to a few nodes, which are propagated to lower layers. We applied AEGNNs to the tasks of object recognition and detection. While in object recognition we achieved an up to a 200-fold reduction in computational complexity (FLOPs), for object detection we achieved an up to 21-fold reduction, while outperforming asynchronous methods by $3.4\%$ mAP. We showed that this computation reduction speeds up processing latency by a factor of 8 compared to dense GNNs. We believe that, if our method is implemented on specialized hardware such as FPGA or IPUs [24], we will see additional reductions in latency and a significant reduction in power consumption. + +# 7. Acknowledgment + +This work was supported Huawei, and as a part of NCCR Robotics, a National Centre of Competence in Research, funded by the Swiss National Science Foundation (grant number 51NF40_185543). + +# References + +[1] Alessandro Aimar, Hesham Mostafa, Enrico Calabrese, Antonio Rios-Navarro, Ricardo Tapiador-Morales, Iulia-Alexandra Lungu, Moritz B. Milde, Federico Corradi, Alejandro Linares-Barranco, Shih-Chii Liu, and Tobi Delbrück. NullHop: A flexible convolutional neural network accelerator based on sparse representations of feature maps. IEEE Trans. Neural Netw. Learn. Syst., 30(3):644-656, Mar. 2019. 2 +[2] Arnon Amir, Brian Taba, David Berg, Timothy Melano, Jeffrey McKinstry, Carmelo Di Nolfo, Tapan Nayak, Alexander Andreopoulos, Guillaume Garreau, Marcela Mendoza, Jeff Kusnitz, Michael Debole, Steve Esser, Tobi Delbruck, Myron Flickner, and Dharmendra Modha. A low power, fully event-based gesture recognition system. In Conference of Computer Vision and Pattern Recognition (CVPR), pages 7388-7397, 2017. 2 +[3] Patrick Bardow, Andrew J. Davison, and Stefan Leutenegger. Simultaneous optical flow and intensity estimation from an event camera. In Conference of Computer Vision and Pattern Recognition (CVPR), pages 884-892, 2016. 2, 4 +[4] Yin Bi, Aaron Chadha, Alhabib Abbas, Eirina Bourtsovlatze, and Yiannis Andreopoulos. Graph-based object classification for neuromorphic vision sensing. IEEE Int. Conf. Comput. Vis. (ICCV), 2019. 3, 4, 6 +[5] Yin Bi, Aaron Chadha, Alhabib Abbas, Eirina Bourtsovatze, and Yiannis Andreopoulos. Graph-based spatio-temporal feature learning for neuromorphic vision sensing. IEEE Transactions on Image Processing, 29:9084–9098, 2020. 3 +[6] Paolo Boldi, Marco Rosa, and Sebastiano Vigna. Hyperanf: Approximating the neighbourhood function of very large graphs on a budget. In Proceedings of the 20th International Conference on World Wide Web, WWW '11, page 625-634, New York, NY, USA, 2011. Association for Computing Machinery. 5 +[7] Marco Cannici, Marco Ciccone, Andrea Romanoni, and Matteo Matteucci. Asynchronous convolutional networks for object detection in neuromorphic cameras. In CVPRW, 2019. 6, 8 +[8] Pierre de Tournemire, Davide Nitti, Etienne Perot, Davide Migliore, and Amos Sironi. A large scale event-based detection dataset for automotive. arXiv e-prints, abs/2001.08499, 2020. 7, 8 +[9] Davide Falanga, Kevin Kleber, and Davide Scaramuzza. Dynamic obstacle avoidance for quadrotors with event cameras. Science Robotics, 5(40):eaaz9712, 2020. 2, 4 +[10] William Falcon and The PyTorch Lightning team. PyTorch Lightning, 2019. 6 +[11] L. Fei-Fei, R. Fergus, and P. Perona. Learning generative visual models from few training examples: an incremental bayesian approach tested on 101 object categories. In CVPRW, 2004. 6 +[12] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019. 6 +[13] Matthias Fey, Jan Eric Lenssen, Frank Weichert, and Heinrich Müller. Splinecnn: Fast geometric deep learning with + +continuous b-spline kernels. Conference of Computer Vision and Pattern Recognition (CVPR), 2018. 5 +[14] Guillermo Gallego, Tobi Delbruck, Garrick Orchard, Chiara Bartolozzi, Brian Taba, Andrea Censi, Stefan Leutenegger, Andrew Davison, Jörg Conradt, Kostas Daniilidis, and Davide Scaramuzza. Event-based vision: A survey. IEEE T-PAMI., 2020. 2 +[15] Guillermo Gallego, Jon E. A. Lund, Elias Mueggler, Henri Rebecq, Tobi Delbruck, and Davide Scaramuzza. Event-based, 6-DOF camera tracking from photometric depth maps. IEEE T-PAMI., 40(10):2402-2412, Oct. 2018. 3 +[16] Chang Gao, Antonio Rios-Navarro, Xi Chen, Shih-Chii Liu, and Tobi Delbruck. Edgedrn: Recurrent neural network accelerator for edge inference. IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 10(4):419–432, 2020. 2, 8 +[17] Daniel Gehrig, Antonio Loquercio, Konstantinos G. Derpanis, and Davide Scaramuzza. End-to-end learning of representations for asynchronous event-based data. In IEEE Int. Conf. Comput. Vis. (ICCV), 2019. 2, 3, 6 +[18] Mathias Gehrig, Willem Aarents, Daniel Gehrig, and Davide Scaramuzza. Dsec: A stereo event camera dataset for driving scenarios. In IEEE RA-L, December 2021. 2 +[19] Mathias Gehrig, Sumit Bam Shrestha, Daniel Mouritzen, and Davide Scaramuzza. Event-based angular velocity regression with spiking networks. IEEE International Conference on Robotics and Automation (ICRA), 2020. 2 +[20] Benjamin Graham, Martin Engelcke, and Laurens van der Maaten. 3D semantic segmentation with submanifold sparse convolutional networks. In Conference of Computer Vision and Pattern Recognition (CVPR), pages 9224-9232, 2018. 6 +[21] Jesse J. Hagenaars, Federico Paredes-Vallés, Sander M. Bohté, and Guido C. H. E. de Croon. Evolved neuromorphic control for high speed divergence-based landings of mavs. IEEE Robotics and Automation Letters, 5(4):6239-6246, 2020. 2 +[22] Javier Hidalgo-Carrio, Daniel Gehrig, and Davide Scaramuzza. Learning monocular dense depth from events. IEEE Int. Conf. 3D Vis. (3DV), 2020. 2 +[23] Giacomo Indiveri, Bernabe Linares-Barranco, Tara Hamilton, André van Schaik, Ralph Etienne-Cummings, Tobi Delbruck, Shih-Chii Liu, Piotr Dudek, Philipp Häfliger, Sylvie Renaud, Johannes Schemmel, Gert Cauwenberghs, John Arthur, Kai Hynna, Fopefolu Folowosele, Sylvain SAIGHI, Teresa Serrano-Gotarredona, Jayawan Wijekoon, Yingxue Wang, and Kwabena Boahen. Neuromorphic silicon neuron circuits. Frontiers in Neuroscience, 5:73, 2011. 2 +[24] Zhe Jia, Blake Tillman, Marco Maggioni, and Daniele Paolo Scarpazza. Dissecting the graphcore ipu architecture via microbenchmarking. ArXiv, abs/1912.03413, 2019. 8 +[25] Hanme Kim, Stefan Leutenegger, and Andrew J. Davison. Real-time 3D reconstruction and 6-DoF tracking with an event camera. In European Conference of Computer Vision (ECCV), pages 349–364, 2016. 3 +[26] Diederik P. Kingma and Jimmy L. Ba. Adam: A method for stochastic optimization. (ICLR), 2015. 6 + +[27] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. (ICLR), 2017. 5 +[28] Xavier Lagorce, Garrick Orchard, Francesco Gallupi, Bertram E. Shi, and Ryad Benosman. HOTS: A hierarchy of event-based time-surfaces for pattern recognition. IEEE T-PAMI., 39(7):1346-1359, July 2017. 2, 3, 6 +[29] Jun Haeng Lee, Tobi Delbruck, and Michael Pfeiffer. Training deep spiking neural networks using backpropagation. Front. Neurosci., 10:508, 2016. 2 +[30] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. AAAI, abs/1801.07606, 2018. 7 +[31] Yijin Li, Han Zhou, Bangbang Yang, Ye Zhang, Zhaopeng Cui, Hujun Bao, and Guofeng Zhang. Graph-based asynchronous event processing for rapid object recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 934-943, October 2021. 1, 3, 5, 6, 7, 8 +[32] 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 of Computer Vision (ECCV), pages 740-755. 2014. 7 +[33] Antonio Loquercio, Elia Kaufmann, René Ranftl, Matthias Müller, Vladlen Koltun, and Davide Scaramuzza. Learning high-speed flight in the wild. In Science Robotics, October 2021. 4 +[34] 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 Conference of Computer Vision and Pattern Recognition (CVPR), pages 5419-5427, 2018. 2, 3 +[35] Nico A. Messikommer, Daniel Gehrig, Antonio Loquercio, and Davide Scaramuzza. Event-based asynchronous sparse convolutional networks. In European Conference of Computer Vision (ECCV), 2020. 2, 3, 4, 5, 6, 7, 8 +[36] Srinjoy Mitra, Stefano Fusi, and Giacomo Indiveri. Real-time classification of complex patterns using spike-based learning in neuromorphic vlsi. IEEE Transactions on Biomedical Circuits and Systems, 3(1):32-42, 2009. 2 +[37] Saber Moradi, Ning Qiao, Fabio Stefanini, and Giacomo Indiveri. A scalable multicore architecture with heterogeneous memory structures for dynamic neuromorphic asynchronous processors (dynaps). IEEE Transactions on Biomedical Circuits and Systems, 12(1):106-122, 2018. 2 +[38] Garrick Orchard, Ajinkya Jayawant, Gregory K. Cohen, and Nitish Thakor. Converting static image datasets to spiking neuromorphic datasets using saccades. Front. Neurosci., 9:437, 2015. 6, 7, 8 +[39] Garrick Orchard, Cedric Meyer, Ralph Etienne-Cummings, Christoph Posch, Nitish Thakor, and Ryad Benosman. HFirst: A temporal approach to object recognition. IEEE T-PAMI., 37(10):2028-2040, 2015. 2, 3, 6 +[40] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic + +differentiation in PyTorch. In NIPS Workshops, volume 8, 2017. 6, 8 +[41] José A. Perez-Carrasco, Bo Zhao, Carmen Serrano, Begoña Acha, Teresa Serrano-Gotarredona, Shouchun Chen, and Bernabe Linares-Barranco. Mapping from frame-driven to frame-free event-driven vision systems by low-rate rate coding and coincidence processing-application to feedforward ConvNets. IEEE T-PAMI., 35(11):2706-2719, Nov. 2013. 2 +[42] Etienne Perot, Pierre de Tournemire, Davide Nitti, Jonathan Masci, and Amos Sironi. Learning to detect objects with a 1 megapixel event camera. Adv. Neural Inf. Process. Syst., 2020. 2, 4, 8 +[43] Bharath Ramesh, Hong Yang, Garrick Orchard, Ngoc Anh Le Thi, and Cheng Xiang. DART: distribution aware retinal transform for event-based cameras. arXiv e-prints, Oct. 2017. 6 +[44] Henri Rebecq, René Ranftl, Vladlen Koltun, and Davide Scaramuzza. High speed and high dynamic range video with an event camera. IEEE T-PAMI., 2019. 2, 3 +[45] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Conference of Computer Vision and Pattern Recognition (CVPR), 2016. 7 +[46] Emanuele Rossi, Ben Chamberlain, Fabrizio Frasca, Davide Eynard, Federico Monti, and Michael Bronstein. Temporal graph networks for deep learning on dynamic graphs. In Proc. Int. Conf. Mach. Learning Workshops (ICMLW), 2020. 3 +[47] Nitin Sanket, Chethan M. Parameshwara, Chahat Singh, Ashwin Varghese Kuruttukulam, Cornelia Fermüller, Davide Scaramuzza, and Yiannis Aloimonos. 05 2020. 2, 4 +[48] Yusuke Sekikawa, Kosuke Hara, and Hideo Saito. EventNet: Asynchronous recursive event processing. In Conference of Computer Vision and Pattern Recognition (CVPR), 2019. 2, 3 +[49] Sumit Bam Shrestha and Garrick Orchard. SLAYER: Spike layer error reassignment in time. In Adv. Neural Inf. Process. Syst., 2018. 2 +[50] Martin Simonovsky and Nikos Komodakis. Dynamic edge-conditioned filters in convolutional neural networks on graphs. Conference of Computer Vision and Pattern Recognition (CVPR), 2017. 5 +[51] Amos Sironi, Manuele Brambilla, Nicolas Bourdis, Xavier Lagorce, and Ryad Benosman. HATS: Histograms of averaged time surfaces for robust event-based object classification. In Conference of Computer Vision and Pattern Recognition (CVPR), pages 1731-1740, 2018. 2, 3, 6, 7 +[52] S. Sun, G. Cioffi, C. de Visser, and D. Scaramuzza. Autonomous quadrotor flight despite rotor failure with onboard vision sensors: Frames vs. events. IEEE Robotics and Automation Letters, 6(2):580-587, 2021. 2 +[53] Stepan Tulyakov, Daniel Gehrig, Stamatios Georgoulis, Julius Erbach, Mathias Gehrig, Yuanyou Li, and Davide Scaramuzza. Time lens: Event-based video frame interpolation. In Conference of Computer Vision and Pattern Recognition (CVPR), pages 16155-16164, 2021. 2 +[54] Xiang Zhang, Wei Liao, Lei Yu, Wen Yang, and Gui-Song Xia. Event-based synthetic aperture imaging with a hybrid + +network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 14235-14244, June 2021. 2 +[55] Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. AI Open, 2020. 3 +[56] Alex Zihao Zhu, Dinesh Thakur, Tolga Ozaslan, Bernd Pfrommer, Vijay Kumar, and Kostas Daniilidis. The multi-vehicle stereo event camera dataset: An event camera dataset for 3D perception. IEEE RA-L, 3(3):2032–2039, July 2018. 2 +[57] Alex Zihao Zhu, Liangzhe Yuan, Kenneth Chaney, and Kostas Daniilidis. EV-FlowNet: Self-supervised optical flow estimation for event-based cameras. In Robotics: Science and Systems (RSS), 2018. 2, 3 +[58] Alex Zihao Zhu, Liangzhe Yuan, Kenneth Chaney, and Kostas Daniilidis. Unsupervised event-based learning of optical flow, depth, and egomotion. In Conference of Computer Vision and Pattern Recognition (CVPR), 2019. 2 \ No newline at end of file diff --git a/aegnnasynchronouseventbasedgraphneuralnetworks/images.zip b/aegnnasynchronouseventbasedgraphneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ff353f46b0a33bc74360155508da64cf10c28277 --- /dev/null +++ b/aegnnasynchronouseventbasedgraphneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e2fb28978ad9c69e11c4090d1d0b1fe2137050757065f5bfb00afbcad060404 +size 375811 diff --git a/aegnnasynchronouseventbasedgraphneuralnetworks/layout.json b/aegnnasynchronouseventbasedgraphneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5f098b64df70996439c8c2252d60cb4eb0280b0b --- /dev/null +++ b/aegnnasynchronouseventbasedgraphneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb8a5ae6d9213632bba487fb869cb4fe58eab07938938f37436a2a7d25243f2e +size 400565 diff --git a/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_content_list.json b/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d64cbb4f47415cce6eb9d7fd9a3440eee16435fb --- /dev/null +++ b/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a0340b35f0c717e034ce1600f63d5c6531100fba5246a80938a96fffb573d7a +size 77154 diff --git a/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_model.json b/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6af767cfd62899fe1ca65f1576eaa7a601b26a32 --- /dev/null +++ b/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44628aac24a92b973e1f6f00fcf041f94c1f0a1b0f7f4cc264be250e57a0bd18 +size 96802 diff --git a/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_origin.pdf b/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..269f1b37a06972b0e5f1d42cce9cec562b1be914 --- /dev/null +++ b/aimanautoaugmenterforimagesandmeshes/49f4f50f-3d9d-4d49-8df9-6bab06e5c075_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:255fa24f8aaca11a315ca04867932c5d74e39f49a6e0ac4e93d4c72e436e21e9 +size 5379727 diff --git a/aimanautoaugmenterforimagesandmeshes/full.md b/aimanautoaugmenterforimagesandmeshes/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cfc62516a5771e6c4b196e53ec2026ab1b6627a3 --- /dev/null +++ b/aimanautoaugmenterforimagesandmeshes/full.md @@ -0,0 +1,312 @@ +# AIM: an Auto-Augmenter for Images and Meshes + +Vinit Veerendraveer Singh and Chandra Kambhametu +Video/Image Modeling and Synthesis (VIMS) Lab, Department of Computer and Information Sciences, University of Delaware, Newark, Delaware, United States of America, 19716 + +{vinitvs,chandrak}@udel.edu + +# Abstract + +Data augmentations are commonly used to increase the robustness of deep neural networks. In most contemporary research, the networks do not decide the augmentations; they are task-agnostic, and grid search determines their magnitudes. Furthermore, augmentations applicable to lower-dimensional data do not easily extend to higher-dimensional data and vice versa. This paper presents an auto-augmenter for images and meshes (AIM) that easily incorporates into neural networks at training and inference times. It jointly optimizes with the network to produce constrained, non-rigid deformations in the data. AIM predicts sample-aware deformations suited for a task, and our experiments confirm its effectiveness with various networks. + +# 1. Introduction + +Deep neural networks are prevailing in various computer vision tasks. They are commonplace for the analysis of digital images [15, 16, 38] and 3D graphics [8, 14]. These networks try to emulate human cognition in a computerized environment. However, despite the success of deep learning in recent years, it is still not as robust as human vision. + +Learning methods for vision-based tasks need to disassociate between what an object looks like and where it lies in space. To this end, it is common to pre-process input data to neural networks with augmentation approaches. Some augmentations make neural networks more tolerant of geometric changes in data. For instance, augmentation techniques such as affine transformations, random horizontal flipping, and random cropping are standard for image processing. For mesh analysis, jittering of mesh elements is performed along with affine transformations. These augmentations also form the basis of other advanced data augmentation strategies [5, 11, 21, 32, 42, 55] and frameworks [2, 54]. The augmentations mentioned above do not directly participate in the learning process and are not dependent on a task's objective. Thus, they are non-learnable and task-agnostic. + +![](images/4cfea9a54bbc76ad0d3f9e29c9be45fc2bed44d429cd3f7128c75e6f6bf4b01e.jpg) +Figure 1. AIM performs non-rigid deformations on the input data to a task network during training and testing. AIM learns to detect critical regions in the samples to solve a task and increases their spatial coverage. As shown, it applies to both images and meshes. + +Conversely, task-aware augmentation approaches [5, 12, 20, 26, 37] jointly optimize with neural networks. A common theme to this set of approaches is to sequentially learn which transformations suit a task, where to employ them, and to what extent they should be applied. However, at present, many learnable augmentation methods are constrained to the dimensions of their underlying representations. Methods applicable to 2D images are either unsuitable or have no clear way to extend to 3D data and vice versa. In this work, we build upon these insights and shortcomings to propose an Auto-Augmenter for Images and Meshes (AIM). + +Eye movements in human beings are primarily categorized into four categories: fixation [39], saccades [10], stabilization [4], and smooth pursuit [24]. By fixating eyes at specific locations, the human visual system can enhance their resolution to process fine spatial details. AIM closely imitates human fixation. It is implemented as a data preprocessor to jointly optimize with existing neural networks for image and mesh analysis. First, AIM infers regions in the images and meshes that contain critical information to solve a task. Then, it increases the spatial resolution of these regions and simultaneously reduces spatial coverage of noncrucial areas. A visual illustration of this process is in Fig. 1. The main contributions of this paper are: + +- AIM's novel and differentiable spatial warper. +- An attention module for graph data. +- A novel directional consistency loss to constrain deformations produced by AIM. +- Experiments on multiple data sets for image classification, mesh classification, and mesh segmentation. + +# 2. Related Works + +We split existing data augmentation approaches for neural networks into two broad categories: non-learnable augmentations and learnable augmentations. Methods in both categories apply to digital images or 3D geometric data such as meshes and point clouds. The non-learnable augmentations have no trainable parameters, and their ideal magnitudes depend on an extensive grid search. On the other hand, the learnable approaches contain trainable parameters and employ augmentations suited for a task. + +# 2.1. Non-Learnable Augmentations + +Propagating randomly cropped image regions train a neural network in disentangling textural features from their positions. Image rotation and flipping increase neural networks' invariance to varying poses of objects. Random Erasing [56] and CutOut [6] replace continuous regions in images with random values to achieve tolerance to occluded views of objects. Color jitter randomly changes image brightness, contrast, or saturation during training. Dropout [18] regularizes a neural network by randomly dropping neuron activations while training. It can be considered as feature map augmentation. CutMix [55] replaces image regions with random patches from other images to retain the regularization effect of regional dropout strategies. Cut-Thumbail [52] is similar to CutMix. But unlike CutMix, it replaces image regions with thumbnails. GridMask [1] balances deletion and conservation of regions by dropping discontinuous areas in images. Like GridMask, MeshCut [21] overlays a square mesh grid upon images + +to drop non-continuous parts. AugMix [17] increases robustness to corruptions in data distributions. All these nonlearnable augmentation techniques improve the representational capacity of neural networks. However, most regularize the networks by dropping regions instead of focusing on the correct ones. Also, it is unclear how these techniques apply to 3D data. In particular, photometric augmentation techniques find no use in augmenting purely geometric data. + +Meshes and point clouds are commonly augmented by scaling, translating, and jittering the position of vertices [8, 35]. However, there are only a few advanced augmentation techniques for 3D data. PointMixup [3] takes inspiration from the image domain and interpolates point clouds and their corresponding labels. Mix3D [32] creates new scenes by combining two augmented scenes. Such a mixup allows generalization beyond contextual priors. PatchAugment [42] augments feature maps of neural networks [35, 50] operating on point clouds. MeshCNN [14] augments meshes by performing anisotropic scaling and random edge flips. + +# 2.2. Learnable Augmentations + +Spatial Transformer Networks (STN) [20] learn and perform various transformations (affine, projective, and thin plate spline) on images. However, extreme image transformations can occur for thin plate spline based STN. STN can also crop regions in images when the determinant of the left $2 \times 2$ sub-matrix in the affine transformation matrix has a magnitude less than one. However, no such constraint was explicitly imposed. Some methods augment input images to a network by increasing spatial coverage of certain image regions. Saliency Sampler (SS) [37] increases spatial coverage of task-aware salient regions in images. These salient regions are inferred with a pre-trained Convolutional Neural Network (CNN) [16]. Millions of trainable parameters in this CNN update during network backpropagation, making their approach computationally expensive. Also, it is unclear how SS extends to 3D data. The other works [7, 22, 44, 53] derived from SS also suffer from similar limitations. Marin et al. [29] formulated a content-adaptive downsampling method that favors locations near semantic boundaries of classes prior to image downsampling. However, this method is limited by selecting downsampling locations to a manually designed sampling objective. AutoAugment [5] does not provide any novel augmentation approaches. Instead, it uses a search algorithm to determine the best training policy. KeepAugment [12] learns to preserve important regions from regional dropout. For 3D point clouds, PointAugment [26] augments point clouds using an adversarial training strategy. Currently, no learnable augmenter exists for mesh data to the best of our knowledge. This work introduces an augmenter with very few trainable parameters, and it applies to images and meshes. + +# 3. Overview and Notations + +![](images/cede04292d24ca894cc551b142abc526111cd5343069664d020f401cef999890.jpg) +Figure 2. An overview of AIM. AIM's components jointly optimize with a task network to augment the input data. + +The setup of deep learning methodologies for supervised learning tasks is standard. We interchangeably refer to the neural network for a task as a task network. A task network $(\mathcal{T})$ first learns on samples in the set of training data. We denote the training set as $\mathcal{D}_{train} = \{(x_{train}^{(i)},y_{train}^{(i)})\}_{i = 1}^{m}$ where $x_{train}^{(i)}$ is an $i^{th}$ sample from the $m$ training samples. $y_{train}^{(i)}$ is the task label of $x_{train}^{(i)}$ . After training, $\mathcal{T}$ attempts to predict task labels on a testing set $\mathcal{D}_{test}$ . As illustrated in Fig. 2, incorporating AIM with $\mathcal{T}$ is straightforward. At the commencement of the training phase, AIM augments every sample in a single batch of $\mathcal{D}_{train}$ and propagates it to $\mathcal{T}$ . Based on the loss from the task network and the directional consistency loss, the trainable parameters in AIM and $\mathcal{T}$ are optimized together. Then, AIM refines the augmentations for the next mini-batch, and this process continues up until $\mathcal{T}$ reaches convergence. During the test phase, AIM augments all samples in $\mathcal{D}_{test}$ to produce an augmented testing set $\mathcal{D}'_{test}$ . Finally, $\mathcal{D}'_{test}$ is sent forth to $\mathcal{T}$ for evaluation. Note that AIM learns augmentations on a per-sample basis. + +In this paper, we apply AIM to supervised learning tasks. A key aspect of AIM is to jointly optimize with a task network for augmenting input images and meshes effectively. It consists of three major stand-alone components: a spatial warper, an attention module, and a directional consistency loss. The spatial warper performs non-rigid deformations on the input data. It adaptively increases or decreases the coverage of different regions within the input. The attention module decides the locations and magnitude of the deformations. Finally, the directional consistency loss constrains the locations from the attention module. We present details on each component in the next section. + +# 4. Method + +We first elucidate upon AIM's spatial warper in section 4.1 and demonstrates how to use it for image and mesh data. Then, section 4.2 presents AIM's attention module implemented as a graph convolutional network. Next, we formulate the directional consistency loss in section 4.3 and + +introduce our end-to-end strategy to incorporate AIM with a task network. Lastly, we provide implementations details in section 4.4. + +# 4.1. Spatial Warper + +Recent research [19, 20, 37, 51] shows that information in certain regions in the data contributes more to a neural network's decision-making ability than the information in the remaining areas. Thus, intuitively, it is reasonable to assume that fixating on the informative regions should improve a network's ability to make task-based decisions. The spatial warper $(SW)$ in AIM fixates on different regions in the data by increasing their spatial coverage. Note that the spatial warper does not detect the highly informative areas beneficial to the task by itself. + +The $SW$ operates on the graph data structure. The topology of a graph $(\mathcal{G})$ is given by its set of vertices $\mathcal{V} = \{v_{i}\}_{i=1}^{n_{v}}$ and its set of edges $\mathcal{E} = \{e_{i}\}_{i=1}^{n_{e}}$ . Here, $v_{i}$ and $e_{i}$ represent an $i^{th}$ instance of the vertices and edges, respectively. $n_{v}$ and $n_{e}$ represent the cardinality of $\mathcal{V}$ and $\mathcal{E}$ , respectively. Each $e_{i}$ connects to two vertices $(v_{i}^{0}$ and $v_{i}^{1}$ ). The $SW$ produces non-rigid deformations in $\mathcal{G}$ by adjusting the position of its vertices. This adjustment is achieved by changing the edge length of each $e_{i}$ . A simple brute-force approach to locally change edge lengths can be to multiply a unique coefficient by the length of each edge. However, vertices in a graph usually connect to multiple other vertices, and an unconstrained multiplication of coefficients can cause extreme deformations. Moreover, in the case of visual data such as images or meshes, deformations would appear unnatural and important regions would deform beyond recognition. Therefore, it is necessary to conserve the global shape of $\mathcal{G}$ to a certain extent. Thus, the $SW$ minimizes deformation in the overall shape of $\mathcal{G}$ while deforming each edge locally. Such a constrained deformation of $\mathcal{G}$ can be achieved by minimizing the energy function $E$ in equation 1: + +$$ +E = \sum_ {e _ {i} \in \mathcal {E}} \left| \frac {\left(x _ {i} ^ {0} - x _ {i} ^ {1}\right) - \gamma_ {i} \left(v _ {i} ^ {0} - v _ {i} ^ {1}\right)}{v _ {i} ^ {0} - v _ {i} ^ {1} + \epsilon^ {- 1}} \right| ^ {2}, \tag {1} +$$ + +where: + +$$ +\begin{array}{l} v _ {i} ^ {0}, v _ {i} ^ {1} = \begin{array}{l} \text {i n i t i a l l o c a t i o n o f e n d p o i n t s f o r a n e d g e} e _ {i} \\ \text {a l o n g a n i n s p e d e n t d i r e c t i o n i n s p a c e} \end{array} \\ \begin{array}{c} x _ {i} ^ {0}, x _ {i} ^ {1} = \text {p o s t - m i n i m i z a t i o n l o c a t i o n s f o r e d p o i n t s o f} \\ e _ {i} \text {a l o n g a n i n d e p e n d e n t d i r i c t i o n i n s p a c e} \end{array} \\ \gamma_ {i} \quad = \text {d e f o r m a t i o n c o e f f i c i e n t f o r e d g e} e _ {i} \\ \epsilon^ {- 1} = \text {a l a r g e n u m b e r} \\ \end{array} +$$ + +The deformation coefficient $(\gamma_{i})$ for an edge $e_i$ is computed as per equation 2. It is a linear combination of the deformation factor $(\Delta)$ and the sensitivity $(s_i)$ of $e_i$ to deformation. $\Delta$ is a scalar with constant magnitude. Both $\Delta$ and $s_i\in S$ are between zero and one. Note that a higher $s_i$ does + +not necessarily imply that an edge will expand more than another edge with a lower $s_i$ . The extent of the deformations is governed by $\alpha$ and $\beta$ . Thus, the $\mathcal{SW}$ can adaptively expand or shrink the spatial coverage of the edges independent of the magnitude of their sensitivity. In the remainder of this paper, we denote the set of deformation sensitivity of all edges in $\mathcal{G}$ as $S$ . + +$$ +\gamma_ {i} = \alpha s _ {i} + \beta (1 - s _ {i}) \left\{ \begin{array}{l l} \alpha = 1, & \text {i f} \beta = \Delta \\ \beta = 1, & \text {i f} \alpha = \Delta \end{array} \right. \tag {2} +$$ + +In equation 1, $x_{i}^{0}$ and $x_{i}^{1}$ are the updated positions of edge endpoints for an edge $e_{i}$ after minimization. Thus, prior to minimization, their locations are unknown. Since $\mathcal{V}$ constitutes the endpoints of all edges, the energy function $E$ can also be expressed in terms of vertices. The reformulation of $E$ is represented as $E'$ in equation 3. + +$$ +E ^ {\prime} = \sum_ {v _ {i} \in \mathcal {V}} \sum_ {\substack {v _ {j} \in \\ \mathcal {N} (v _ {i})}} \frac {x _ {i} ^ {2} - 2 x _ {i} x _ {j} - 2 \gamma_ {i} x _ {i} (v _ {i} - v _ {j}) + c}{(v _ {i} - v _ {j} + \epsilon^ {- 1}) ^ {2}} \tag{3} +$$ + +where: + +$v_{i}$ $=$ location of an $\mathbf{i}^{th}$ vertex along an independent direction in space + +$\mathcal{N}(v_i) =$ immediate vertex neighborhood of $v_{i}$ + +$v_{j}$ $=$ a vertex neighbor of $v_{i}$ + +$x_{i}$ $=$ location of $v_{i}$ after minimizing $E^{\prime}$ + +$x_{j}$ $=$ location of $v_{j}$ after minimizing $E^{\prime}$ + +$\gamma_{i}$ $=$ deformation coefficient for the edge $e_i$ between $v_{i}$ and $v_{j}$ + +$c$ =a constant + +$\epsilon^{-1}$ $=$ a large number + +The goal of the $SW$ is to minimize the overall movement of the vertices while resizing the edges. We can achieve this by taking partial derivatives of $E'$ with respect to each $x_{i}$ and equating it to zero, as shown in equation 4. + +$$ +\frac {\partial E ^ {\prime}}{\partial x _ {i}} = \sum_ {\substack {v _ {j} \in \\ \mathcal {N} (v _ {i})}} \frac {2 x _ {i} - 2 x _ {j} - 2 \gamma_ {i} (v _ {i} - v _ {j})}{(v _ {i} - v _ {j} + \epsilon^ {- 1}) ^ {2}} = 0 \tag{4} +$$ + +We obtain a linear equation in terms of an unknown vertex $x_{i}$ and its unknown vertex neighbors from equation 4. Once linear equations for all vertices are obtained, the minimization of $E^{\prime}$ can be expressed as a sparse linear system of the form $AX = B$ . The matrix $A \in \mathbb{R}^{\nu \times \nu}$ and a vector $B \in \mathbb{R}^{\nu \times 1}$ are known and computed as per equation 5. $A_{IJ}$ represents a row in matrix $A$ for a vertex $x_{i}$ and its vertex neighbors. The vector $X = \{x_{i}\}_{i=1}^{n_v}$ is unknown and can be approximated through a sparse linear solver. + +![](images/db00b779d16616a44673f7697d68e1a91c94219b346013df4761d5d6ada9fb78.jpg) +Figure 3. The spatial warper applies to images and meshes. Edges with higher sensitivity are highlighted in red. From the top row, we can observe that the spatial warper increases the spatial coverage of pixels in the original image by shrinking the edges with higher edge sensitivity. For meshes (bottom row), the spatial warper expands edges with higher sensitivity. [Best viewed in color] + +$$ +A _ {I J} = \left\{ \begin{array}{l l} \sum_ {v _ {j} \in \mathcal {N} \left(v _ {i}\right)} \frac {2}{\left(v _ {i} - v _ {j} + \epsilon^ {- 1}\right) ^ {2}}, & \text {i f} I = J \\ \frac {- 2}{\left(v _ {i} - v _ {j} + \epsilon^ {- 1}\right) ^ {2}}, & \text {i f} I \neq J \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {5} +$$ + +$$ +B_{I} = \sum_{\substack{v_{j}\in \\ \mathcal{N}(v_{i})}}\frac{2\gamma_{i}(v_{i} - v_{j})}{(v_{i} - v_{j} + \epsilon^{-1})^{2}} +$$ + +# 4.1.1 Spatial Warping of Images and Meshes + +To apply the spatial warper to images, we consider that the underlying representation of an image is a graph. The pixels of an image are considered nodes of the graph. The edges between these nodes are defined in an ad-hoc fashion. In AIM, edges only exist between the horizontal and vertical neighbors of a pixel. The $SW$ is thus applicable to images. For images, $\beta$ in equation 2 is one. Therefore, edges with higher sensitivity will shrink more than edges with a lower sensitivity. Interpolation on an original image with such a deformation grid will increase the spatial coverage of pixels connected to the edges with higher sensitivity. This phenomenon can be observed in the top row of Fig. 3. + +![](images/7f5ab9000a9c55b2941005959f0ef5304def2e38135e63ea86465c86040334d8.jpg) +Figure 4. Design of AIM's Attention Module. The attention module infers edge sensitivities from graph convolutional layers. Thus, the number of training parameters are low, and sensitivities can be inferred on Euclidean as well as non-Euclidean data. + +In the case of mesh data, $\alpha$ in equation 2 is one. Setting $\alpha$ to one allows the nodes connected to edges with higher deformation sensitivity to increase their spatial coverage. Note that post-deformation, the image deformation grid and meshes are normalized to fit a sphere of radius one and are centered at the origin. + +# 4.2. Attention Module + +As mentioned earlier, the spatial warper cannot determine informative regions in the input data by itself. Therefore, any attention mechanism that aids the spatial warper and a task network to identify the informative regions in the input data must follow three key criteria: + +- Since the spatial warper operates on graphs, the attention mechanism must also operate on graphs. +- The attention mechanism learns edge sensitivities in synergy with a task. +- The attention mechanism can learn edge sensitivities in independent directions in space. + +Convolutional Neural Networks (CNNs) are currently the de-facto choice for analyzing images and other Euclidean data. Numerous attention mechanisms [19, 51] also exist for CNNs. However, CNNs do not generalize well to non-Euclidean data such as meshes and graphs. Some recent methods [8, 14, 31, 45, 46] have designed specialized convolutional operators for meshes. However, they made strict assumptions about the mesh geometry (manifoldness, etc.). AIM's attention module is realized as a graph convolutional network to conform to the criteria mentioned above. The architecture of this attention module is shown in Fig. 4. The attention module infers edge sensitivities $(S)$ along each independent direction in the input data. For example, in the case of images, edge sensitivities are learned separately along the x-axis $(S_x)$ and the y-axis $(S_y)$ . $S$ is constrained between zero and one through min-max normalization. + +# 4.3. Directional Consistency Loss + +It is conducive for a task network reasoning about visual data to disambiguate between the appearance of regions in the data and where the regions lie in space. As the spatial warper applies along independent directions in space, deformations will vary along each direction. However, ideally, deformations should not vary in each direction. For example, the highly informative parts in an image should be deformed more than the non-informative areas in both the x-axis and the y-axis. AIM achieves this constraint through directional consistency loss $(\mathcal{L}_{dc})$ . It enforces the attention module's embeddings (edge sensitivities) to be consistent along each independent direction in space. It maximizes the cosine similarity between the embeddings in the different directions. For a mini-batch of $N$ images, with spatial attention $S_{x}$ and $S_{y}$ along the x-axes and y-axes, respectively, the directional consistency loss is computed according to equation 6. It is clear from equation 6 when $S_{x}$ and $S_{y}$ are completely dissimilar, $\mathcal{L}_{dc}$ will be two. When $S_{x}$ and $S_{y}$ are the same, $\mathcal{L}_{dc}$ will be zero. + +$$ +\mathcal {L} _ {d c} = \mathcal {L} _ {d c} ^ {x y} = 1 - \frac {1}{N} \sum \frac {\mathcal {S} _ {x} \cdot \mathcal {S} _ {y}}{\| S x \| \cdot \| S y \|} \tag {6} +$$ + +For a mini-batch of meshes, loss in the directional consistency is computed as per equation 7 below: + +$$ +\mathcal {L} _ {d c} = \mathcal {L} _ {d c} ^ {x y} + \mathcal {L} _ {d c} ^ {y z} + \mathcal {L} _ {d c} ^ {z x}, \tag {7} +$$ + +where $\mathcal{L}_{dc}^{xy}$ is the directional consistency loss between $S_{x}$ and $S_{y}$ . $\mathcal{L}_{dc}^{yz}$ is computed between $S_{y}$ and $S_{z}$ , and similarly $\mathcal{L}_{dc}^{zx}$ is the loss in the directional consistency between $S_{z}$ and $S_{x}$ . The directional consistency loss is task-agnostic. With the spatial warper, attention module, and directional consistency loss clearly defined, AIM is thus realized. We trained and evaluated various task networks with AIM in an end-to-end manner for different supervised learning tasks in section 5. + +# 4.4. Implementation Details + +We implemented AIM using PyTorch [34], PyTorch Geometric [9], Torch Sparse Solve [25], and PyTorch3D [36]. The graph convolutions in the attention module is the GraphSAGE [13] operator. The number of hidden layer channels $(C)$ is 64 for images and 32 for meshes. We perform bilinear interpolation of images by borrowing the grid sampler introduced in STN [20]. Edge sensitivity is inferred by averaging features of the vertices at their endpoints. When applying AIM to images, we set the edge sensitivity at the border of the images to the minimum value in $(S)$ . Thus, border pixels are reasonably conserved after warping. Our code is available at https://github.com/VimsLab/AIM. + +# 5. Experiments + +Fine-grain visual categorization of images is a fundamental task in computer vision. Likewise, classification and segmentation of meshes are fundamental in 3D shape analysis tasks. We applied AIM to classify images and meshes in multiple data sets. We also evaluated AIM for the segmentation of meshes. + +# 5.1. Experimental Setup + +We applied AIM for the fine-grain classification of images in the CUB-200 [49] and the Oxford-IIT Pets [33] data sets. The CUB-200 data set contains images of 200 bird species. The birds appear at different scales and poses and are not tightly cropped. The training set contains approximately 6k images, and the testing set contains about 5.8k images. The Oxford-IIT Pets only contains images of cats and dogs. There are 37 pet categories in this data set, and the images exhibit large variations in scale, pose, and lighting. It contains roughly 7.3k images, with about 200 images per class. The sizes of the training and testing sets are near-equal. We trained ResNet [16] and EfficientNet [48] with AIM to classify the images in these data sets. Both networks were trained with the Stochastic Gradient Descent optimizer with a momentum of 0.9 and weight decay set to 1e-4. For the ResNet models, the learning rate was 0.01, and the batch size was 128. For EfficientNet, the learning rate was 0.001, and the batch size was 48. The spatial warper sub-sampled $224 \times 224$ images from $700 \times 700$ images for CUB-200. For Oxford-IIT Pets, $224 \times 224$ images were subsampled from $448 \times 448$ images. $\Delta$ was set to 0.72. + +For mesh classification, AIM was employed with MeshNet [8] and MeshNet++ [46]. The attention module's input features for mesh data were the vertex normals, curvature, or one-ring neighborhood area around the vertices. Both networks were evaluated on the McGill 3D Shape Benchmark (MSB) [43] and the SHREC-11 [28] data sets. MSB consists of 458 meshes belonging to 19 classes. The number + +of vertices varies across this data set. The SHREC-11 data set consists of 600 mesh models from 30 classes. We follow a similar training strategy mentioned in MeshNet++, except that we set the learning rate to 0.001 instead of 0.0002 for MSB. $\Delta$ was set between 0.7 to 0.9. Finally, we trained DiffusionNet [41] with AIM to segment body parts in the human body data set [30]. $\Delta$ was set to 0.9. We obtained $\Delta$ for all models through a grid search. + +# 5.2. Quantitative Experimental Results + +# 5.2.1 Image Analysis + +We first evaluated AIM with the following three variants of ResNet: ResNet-18, ResNet-34, and ResNet-50. As shown in Table 1, training these networks with AIM gave higher accuracies than the baseline models. For the CUB-200 data set, the accuracies were significantly higher. We also evaluated AIM against other augmentation techniques such as Random Erasing [56] and Saliency Sampler [37]. We compared AIM against Random Erasing to check if eliminating regions in the images is conducive to fine-grain visual categorization. We also compared AIM against Saliency Sampler (SS) since it also enlarges the spatial coverage of regions beneficial to tasks like AIM. Both Random Erasing and Saliency Sampler are trained with the same experimental setup without bells and whistles. + +We observed that randomly erasing the regions within the input data was not conducive to the fine-grain classification of images. A possible explanation for low accuracies using Random Erasing could be that other objects do not heavily occlude the animals' images in both data sets. Thus, Random Erasing might have removed regions essential for a classifier to make correct decisions. Overall, Saliency Sampler gives slightly lower yet comparable accuracies to AIM. This difference in the accuracies can be attributed to Saliency Sampler's inability to constrain deformations within the border of an image. For example, if highly informative regions lie at image borders, SS will partially eliminate those regions. Another reason for lower accuracies in SS could be that its inferred saliency is only constrained by the loss function of the task network. Whereas in AIM, the edge sensitivities are also constrained through the directional consistency loss. We also compared the number of learnable parameters (#Params) in millions (M) between AIM and SS in Table 1. It can be observed that AIM has nearly the same number of parameters as the baseline models and has a significantly lower number of parameters than SS. We observed similar accuracies for the above-discussed methods for EfficientNet as well. + +# 5.2.2 Mesh Analysis + +We also evaluated MeshNet++ and MeshNet with AIM for classifying meshes in MSB and the split-16 of SHREC-11. + +
MethodCUB-200Acc(%)Oxford-IITPetsAcc(%)#Params in M
ResNet-1878.391.611.3
ResNet-1879.490.911.3
+ Random Erasing(↑ 1.1)(↓ 0.7)
ResNet-1878.791.922.9
+ SS(↑ 0.4)(↑ 0.3)
ResNet-1879.491.911.3
+ AIM (Ours)(↑ 1.1)(↑ 0.3)
ResNet-3479.892.521.4
ResNet-3480.691.521.4
+ Random Erasing(↑ 0.8)(↓ 1.0)
ResNet-3477.791.333.0
+ SS(↓ 1.1)(↓ 1.2)
ResNet-3480.493.021.4
+ AIM (Ours)(↑ 0.6)(↑ 0.5)
ResNet-5081.793.423.9
ResNet-5081.792.123.9
+ Random Erasing(↑ 0.0)(↓ 1.3)
ResNet-5082.493.635.3
+ SS(↑ 0.7)(↑ 0.2)
ResNet-5082.593.523.9
+ AIM (Ours)(↑ 0.8)(↑ 0.1)
EfficientNet-b082.092.74.3
EfficientNet-b082.292.44.3
+ Random Erasing(↑ 0.2)(↓ 0.3)
EfficientNet-b082.593.015.8
+ SS(↑ 0.5)(↑ 0.3)
EfficientNet-b082.893.44.3
+ AIM (Ours)(↑ 0.8)(↑ 0.7)
EfficientNet-b182.893.36.8
EfficientNet-b18393.36.8
+ Random Erasing(↑ 0.2)(↑ 0.0)
EfficientNet-b18292.818.3
+ SS(↓ 0.8)(↓ 0.5)
EfficientNet-b183.193.36.8
+ AIM (Ours)(↑ 0.3)(↑ 0.0)
EfficientNet-b283.593.78.0
EfficientNet-b282.893.68.0
+ Random Erasing(↓ 0.7)(↓ 0.1)
EfficientNet-b280.993.519.5
+ SS(↓ 2.6)(↓ 0.2)
EfficientNet-b284.093.78.0
+ AIM (Ours)(↑ 0.5)(↑ 0.0)
+ +The split-16 contains 16 models per class for training and 4 for testing. From Table 2, we observed that AIM significantly increased the classification accuracies of MeshNet on both data sets. However, the overall classification accuracies were still low because MeshNet is not robust in classifying unoriented meshes. For a stronger learner, such as MeshNet++, improvements were still observed. MeshNet++ achieved a $100\%$ classification accuracy on split-16. Thus, it is challenging to verify how much AIM contributed to MeshNet++'s decision-making ability. + +Table 1. Classification accuracies (Acc) of methods for the fine-grain visual categorization of images in multiple data sets. The size of images to the task networks was fixed to $224 \times 224$ . + +
MethodMSB Acc(%)SHREC-11 (split-16) Acc(%)
MeshNet56.555.6
MeshNet with AIM67.3 (↑ 10.8)63.1 (↑ 7.5)
MeshNet++94.5100
MeshNet++ with AIM95.6 (↑ 1.1)100 (↑ 0.0)
+ +Finally, DiffusionNet was evaluated with AIM to segment body parts in meshes of the human body. We observed that training and testing DiffusionNet with AIM increased the segmentation accuracies. We also trained and tested DiffusionNet by randomly jittering the position of vertices in the meshes. As seen in Table 3, the accuracies significantly dropped when vertices were randomly moved at test time without any learning. These experimental results support that learning by AIM is not random, but it is in synergy with the task network. + +Table 2. Comparison of classification accuracies (Acc) of mesh classification methods on multiple data sets. AIM significantly improved classification accuracies for the MeshNet model. + +
MethodAcc(%)
DiffusionNet90.9
DiffusionNet + jitter87.9 (↓3.0)
DiffusionNet + AIM91.3 (↑0.4)
+ +Table 3. Comparison of accuracies (Acc) for segmenting body parts in human body meshes. + +# 6. Qualitative Experimental Validation + +The directional consistency loss enforces edge sensitivities from AIM's attention module to be similar in all independent directions in space. Thus, in the case of images, the edge sensitivities highlighted on the deformation grid + +along each separate direction must appear similar. We qualitatively verify this in Fig. 5 below. + +![](images/414660a72875bbce6e26839a04cfd25d3a3a2cd7741c29d17fb99a9c5b6198c0.jpg) + +![](images/7a6e9933feeae616cca492c4b924a1b197d45fdbeac83b2909800da3b0c0c42f.jpg) +Images + +![](images/9e931bdb3fd08f3c6acc7aef0f1be7ad84fc0bc4297656efcf7314551c20c426.jpg) + +![](images/b9be9fc4da024e331f3a94eeb5322c0b08b8cf82c67df4c01606d15d11eab19e.jpg) +Edge sensitivities along the x-axis + +![](images/5e37241b056f3dc9937ab13152893db620b9095a071caa9a976e84e988c905ee.jpg) + +![](images/ab67795c77f49cd34e8c1dcba7fdec08020eb8974493b34147942f382f9cef94.jpg) +Edge sensitivities along the y-axis +Figure 5. The directional consistency loss enforces edge sensitivities (from the attention module) in independent directions in space to be similar. Higher edge sensitivities are highlighted in red. [Best viewed in color] + +# 7. Ablation Studies + +In our ablation study, we first verified the significance of AIM's directional consistency loss $(\mathcal{L}_{dc})$ . We trained all the models in Table 1 with and without the directional consistency loss and reported results in Table 4. Results suggest that using AIM with $\mathcal{L}_{dc}$ is beneficial to a downstream task. + +
MethodCUB-200Oxford-IIT Pets
- Ldc+ Ldc- Ldc+ Ldc
ResNet-1878.779.491.391.9
ResNet-3480.479.892.693
ResNet-5082.382.593.593.5
EfficientNet-b081.882.893.293.4
EfficientNet-b183.183.193.293.0
EfficientNet-b283.38493.293.7
+ +We also verify whether or not AIM is an augmentation strategy for only the training phase. By setting $\Delta$ to one, no deformations will be performed by AIM. Thus, we set $\Delta$ to one and report the results in Table 5. Comparing the results of Table 5 against the results of Table 1 (where $\Delta$ is 0.7), we observed that the classification accuracies decreased. + +Table 4. Comparison of image classification accuracies for methods utilizing AIM with and without directional consistency loss $(\mathcal{L}_{dc})$ . When a classifier was trained with $\mathcal{L}_{dc}$ , we denote it by $+ \mathcal{L}_{dc}$ , and when trained without $\mathcal{L}_{dc}$ , it is denoted as $-\mathcal{L}_{dc}$ . + +
MethodCUB-200 Acc(%)Oxford-IIT Pets Acc(%)
ResNet-1878.891.7
ResNet-3480.192.8
ResNet-5082.093.3
EfficientNet-b082.392.9
EfficientNet-b183.193.1
EfficientNet-b283.293.4
+ +Table 5. Comparison of classification accuracies (Acc) when AIM is only used for training image classifiers and not for testing. + +# 8. Discussion and Limitations + +AIM can reasonably conserve the border pixels in images after warping. However, for a low $\Delta$ value, the spatial coverage of task-critical pixels can be reduced. If $\Delta$ is low for very tightly cropped images, task-critical image pixels could even be eliminated. AIM can also find itself limited in tasks requiring conservation of the input data geometry. Stacking more graph convolutions in the attention module will not necessarily increase the task performance [23], but it will increase computational overhead. In addition, AIM's computational cost will further increase if applied to more than three or four-dimensional data. Semi-supervised learning approaches can be a viable option in such scenarios [27]. In our experiments, DiffusionNet trained on a large number of vertices, and this significantly increased the size of the matrix $A$ in equation 5. Moreover, AIM cannot solve for a very large number of vertices $(X)$ on most modern GPUs. Thus, incorporating AIM with DiffusionNet increases training and testing times significantly. AIM recomputes the locations of the vertices during training and testing. However, some methods [14, 31, 40, 47] pre-processed vertex-based features before training, and they cannot use AIM. + +# 9. Conclusion + +We introduced an auto-augmenter for deep neural networks called AIM. AIM can augment two-dimensional image data as well as three-dimensional mesh data. AIM augments the data by producing constrained, non-rigid deformations at locations learned by an attention module. A key characteristic of AIM is to jointly optimize with neural networks for varied tasks during training and inference times. Thus, it can estimate the deformations suited to achieve better performance on tasks. We evaluated AIM for classifying images and meshes in multiple data sets. Furthermore, as AIM can conserve the connectivity in the input data, we also evaluated it for segmenting meshes. Our experimental results demonstrated that AIM effectively increased the robustness of neural networks on multiple tasks. + +# References + +[1] Pengguang Chen, Shu Liu, Hengshuang Zhao, and Jiaya Jia. Gridmask data augmentation. arXiv preprint arXiv:2001.04086, 2020. 2 +[2] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR, 2020. 1 +[3] Yunlu Chen, Vincent Tao Hu, Efstratios Gavves, Thomas Mensink, Pascal Mettes, Pengwan Yang, and Cees GM Snoek. Pointmixup: Augmentation for point clouds. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part III 16, pages 330-345. Springer, 2020. 2 +[4] JD Crawford and T Vilis. Axes of eye rotation and listing's law during rotations of the head. Journal of neurophysiology, 65(3):407-423, 1991. 2 +[5] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 113-123, 2019. 1, 2 +[6] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 2 +[7] Yao Ding, Yanzhao Zhou, Yi Zhu, Qixiang Ye, and Jianbin Jiao. Selective sparse sampling for fine-grained image recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6599-6608, 2019. 2 +[8] Yutong Feng, Yifan Feng, Haoxuan You, Xibin Zhao, and Yue Gao. Meshnet: Mesh neural network for 3d shape representation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 8279-8286, 2019. 1, 2, 5, 6 +[9] Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019. 6 +[10] John M Findlay. Saccadic eye movement programming: Sensory and attentional factors. Psychological research, 73(2):127-135, 2009. 2 +[11] Golnaz Ghiasi, Yin Cui, Aravind Srinivas, Rui Qian, Tsung-Yi Lin, Ekin D Cubuk, Quoc V Le, and Barret Zoph. Simple copy-paste is a strong data augmentation method for instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2918-2928, 2021. 1 +[12] Chengyue Gong, Dilin Wang, Meng Li, Vikas Chandra, and Qiang Liu. Keepaugment: A simple information-preserving data augmentation approach. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1055-1064, 2021. 1, 2 +[13] William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 1025-1035, 2017. 6 +[14] Rana Hanocka, Amir Hertz, Noa Fish, Raja Giryes, Shachar Fleishman, and Daniel Cohen-Or. MeshCNN: a network with + +an edge. ACM Transactions on Graphics (TOG), 38(4):1-12, 2019. 1, 2, 5, 8 +[15] 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. 1 +[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 1, 2, 6 +[17] Dan Hendrycks, Norman Mu, Ekin D Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. arXiv preprint arXiv:1912.02781, 2019. 2 +[18] Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. 2 +[19] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018. 5 +[20] Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. Advances in neural information processing systems, 28:2017-2025, 2015. 1, 2, 3, 6 +[21] Wei Jiang, Kai Zhang, Nan Wang, and Miao Yu. Mesh-cut data augmentation for deep learning in computer vision. PLoS One, 15(12):e0243613, 2020. 1, 2 +[22] Chen Jin, Ryutaro Tanno, Thomy Mertzanidou, Eleftheria Panagiotaki, and Daniel C Alexander. Learning to downsample for segmentation of ultra-high resolution images. arXiv preprint arXiv:2109.11071, 2021. 2 +[23] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. 8 +[24] Richard J Krauzlis and Steve G Lisberger. Temporal properties of visual motion signals for the initiation of smooth pursuit eye movements in monkeys. Journal of Neurophysiology, 72(1):150-162, 1994. 2 +[25] Floris Laporte. Torch sparse solve. https://github.com/flaport/torch_sparse.solve.git, 2020.6 +[26] Ruihui Li, Xianzhi Li, Pheng-Ann Heng, and Chi-Wing Fu. Pointaugment: an auto-augmentation framework for point cloud classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6378–6387, 2020. 1, 2 +[27] Xianzhi Li, Lequan Yu, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Unsupervised detection of distinctive regions on 3d shapes. ACM Transactions on Graphics (TOG), 39(5):1-14, 2020. 8 +[28] Z Lian, A Godil, B Bustos, M Daoudi, J Hermans, S Kawamura, Y Kurita, G Lavoua, and P Dp Suetens. Shape retrieval on non-rigid 3d watertight meshes. In Eurographics workshop on 3d object retrieval (3DOR). CiteSeer, 2011. 6 +[29] Dmitrii Marin, Zijian He, Peter Vajda, Priyam Chatterjee, Sam Tsai, Fei Yang, and Yuri Boykov. Efficient segmentation: Learning downsampling near semantic boundaries. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2131-2141, 2019. 2 + +[30] Haggai Maron, Meirav Galun, Noam Aigerman, Miri Trope, Nadav Dym, Ersin Yumer, Vladimir G Kim, and Yaron Lipman. Convolutional neural networks on surfaces via seamless toric covers. ACM Trans. Graph., 36(4):71-1, 2017. 6 +[31] Francesco Milano, Antonio Loquercio, Antoni Rosinol, Davide Scaramuzza, and Luca Carlone. Primal-dual mesh convolutional neural networks. arXiv preprint arXiv:2010.12455, 2020. 5, 8 +[32] Alexey Nekrasov, Jonas Schult, Or Litany, Bastian Leibe, and Francis Engelmann. Mix3d: Out-of-context data augmentation for 3d scenes. arXiv preprint arXiv:2110.02210, 2021. 1, 2 +[33] Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pages 3498-3505. IEEE, 2012. 6 +[34] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017. 6 +[35] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. Advances in neural information processing systems, 30, 2017. 2 +[36] Nikhila Ravi, Jeremy Reizenstein, David Novotny, Taylor Gordon, Wan-Yen Lo, Justin Johnson, and Georgia Gkioxari. Accelerating 3d deep learning with pytorch3d. arXiv preprint arXiv:2007.08501, 2020. 6 +[37] Adria Recasens, Petr Kellnhofer, Simon Stent, Wojciech Matusik, and Antonio Torralba. Learning to zoom: a saliency-based sampling layer for neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 51-66, 2018. 1, 2, 3, 6 +[38] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234-241. Springer, 2015. 1 +[39] Michele Rucci and Martina Poletti. Control and functions of fixational eye movements. Annual review of vision science, 1:499-518, 2015. 2 +[40] Lisa Schneider, Annika Niemann, Oliver Beuing, Bernhard Preim, and Sylvia Saalfeld. Medmeshcnn-enabling meshcnn for medical surface models. Computer Methods and Programs in Biomedicine, 210:106372, 2021. 8 +[41] Nicholas Sharp, Souhaib Attaiki, Keenan Crane, and Maks Ovsjanikov. Diffusion is all you need for learning on surfaces. arXiv preprint arXiv:2012.00888, 2020. 6 +[42] Shivanand Venkanna Sheshappanavar, Vinit Veerendraveer Singh, and Chandra Kambhametty. Patchaugment: Local neighborhood augmentation in point cloud classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2118-2127, 2021. 1, 2 +[43] Kaleem Siddiqi, Juan Zhang, Diego Macrini, Ali Shokoufandeh, Sylvain Bouix, and Sven Dickinson. Retrieving articulated 3-d models using medial surfaces. Machine vision and applications, 19(4):261-275, 2008. 6 + +[44] Vinit Veerendraveer Singh and Chandra Kambhametty. Feature map retargeting to classify biomedical journal figures. In International Symposium on Visual Computing, pages 728-741. Springer, 2020. 2 +[45] Vinit Veerendraveer Singh, Shivanand Venkanna Sheshappanavar, and Chandra Kambhametu. Mesh classification with dilated mesh convolutions. In 2021 IEEE International Conference on Image Processing (ICIP), pages 3138-3142. IEEE, 2021. 5 +[46] Vinit Veerendraveer Singh, Shivanand Venkanna Sheshapanavar, and Chandra Kambhametu. Meshnet++: A network with a face. In Proceedings of the 29th ACM International Conference on Multimedia, pages 4883-4891, 2021. 5, 6 +[47] Dmitriy Smirnov and Justin Solomon. Hodgenet: Learning spectral geometry on triangle meshes. arXiv preprint arXiv:2104.12826, 2021. 8 +[48] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105-6114. PMLR, 2019. 6 +[49] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 6 +[50] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. Acm Transactions On Graphics (tog), 38(5):1-12, 2019. 2 +[51] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV), pages 3–19, 2018. 3, 5 +[52] Tianshu Xie, Xuan Cheng, Xiaomin Wang, Minghui Liu, Jiali Deng, Tao Zhou, and Ming Liu. Cut-thumbnail: A novel data augmentation for convolutional neural network. In Proceedings of the 29th ACM International Conference on Multimedia, pages 1627-1635, 2021. 2 +[53] Xiaohan Xing, Yixuan Yuan, and Max Q-H Meng. Zoom in lesions for better diagnosis: Attention guided deformation network for wce image classification. IEEE Transactions on Medical Imaging, 39(12):4047-4059, 2020. 2 +[54] Rong Yang, Robert Wang, Yunkai Deng, Xiaoxue Jia, and Heng Zhang. Rethinking the random cropping data augmentation method used in the training of cnn-based sar image ship detector. Remote Sensing, 13(1):34, 2021. 1 +[55] 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 Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6023-6032, 2019. 1, 2 +[56] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001-13008, 2020. 2, 6 \ No newline at end of file diff --git a/aimanautoaugmenterforimagesandmeshes/images.zip b/aimanautoaugmenterforimagesandmeshes/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..611ecba5b2a2661c43b601ab9eb2d3f20d80a7a8 --- /dev/null +++ b/aimanautoaugmenterforimagesandmeshes/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0587b6c18f4297dd9b8c382b0e4858181a3445c2edb0c2a5d2b59074a5f36f60 +size 552141 diff --git a/aimanautoaugmenterforimagesandmeshes/layout.json b/aimanautoaugmenterforimagesandmeshes/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..790281e280abbf92ba00e2dd85c01c585acdc857 --- /dev/null +++ b/aimanautoaugmenterforimagesandmeshes/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3c00a27086fa87de582aaba274919155136d534bd031dca94dc3a95c617b8f0 +size 430621 diff --git a/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_content_list.json b/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..153673780f46c28a75ef6fc7e439e6f1063aa16b --- /dev/null +++ b/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf34cc56f88480636b8e00745159ac5f0e72e45f984a2abbd7d388e68576599b +size 73199 diff --git a/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_model.json b/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_model.json new file mode 100644 index 0000000000000000000000000000000000000000..70ca304779ed7fb48eef094da65f8edff20afd40 --- /dev/null +++ b/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fd78fca48b7e473720dc6fb9a03866fa2191e8bdf0c89987d8c47a53fc3e11d +size 85993 diff --git a/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_origin.pdf b/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..09e7cd7da4a4f9311f1ae1416241a374bcc8ae4c --- /dev/null +++ b/akb48arealworldarticulatedobjectknowledgebase/d53d35d7-686c-411a-bb6f-91218ec7dbee_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79b08b9016de3dddda018045638a4e78dcad6f2792ec7474c38d5494e52deb30 +size 2681395 diff --git a/akb48arealworldarticulatedobjectknowledgebase/full.md b/akb48arealworldarticulatedobjectknowledgebase/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cf18b1e3375a469a545c2afaab59c95665d3228f --- /dev/null +++ b/akb48arealworldarticulatedobjectknowledgebase/full.md @@ -0,0 +1,290 @@ +# AKB-48: A Real-World Articulated Object Knowledge Base + +Liu Liu Wenqiang Xu Haoyuan Fu Sucheng Qian Qiaojun Yu Yang Han Cewu Lu $^{\dagger}$ Shanghai Jiao Tong University + +{liuliul993, vinjohn, simon-fuhaoyuan, qiansucheng, yqjllxs, lucewu}@sjtu.edu.cn tycoer@outlook.com + +![](images/873770fb809c6295698ba9c0130e2b5bf03e33645db6d2884611bf3619b202c2.jpg) +Figure 1. AKB-48 consists of 2,037 articulated object models of 48 categories scanned from the real world. The objects are annotated with ArtiKG, and can support a full task spectrum from computer vision to robotics manipulation. + +# Abstract + +Human life is populated with articulated objects. A comprehensive understanding of articulated objects, namely appearance, structure, physical property, and semantics, will benefit many research communities. As current articulated object understanding solutions are usually based on synthetic object dataset with CAD models without physics properties, which prevent satisfied generalization from simulation to real-world applications in visual and robotics tasks. To bridge the gap, we present AKB-48: a largescale Articulated object Knowledge Base which consists of 2,037 real-world 3D articulated object models of 48 categories. Each object is described by a knowledge graph ArtiKG. To build the AKB-48, we present a fast articulation knowledge modeling (FArM) pipeline, which can fulfill the ArtiKG for an articulated object within 10-15 minutes, and largely reduce the cost for object modeling in the real + +$^{\dagger}$ Cewu Lu is the corresponding author. He is the member of Qing Yuan Research Institute and MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University, and Shanghai Qi Zhi Institute, China. + +world. Using our dataset, we propose AKBNet, an integral pipeline for Category-level Visual Articulation Manipulation (C-VAM) task, in which we benchmark three sub-tasks, namely pose estimation, object reconstruction and manipulation. Dataset, codes, and models are publicly available at https://liuliu66.github.io/AKB-48. + +# 1. Introduction + +Articulated objects, composed of more than one rigid part connected by joints allowing rotational or translational movements in 3D space, are pervasive in our daily life. Knowledge about the articulated objects can be beneficial to many research communities, such as computer vision, robotics and embodied AI. Thus, many articulated object datasets have been proposed to facilitate the research, such as PartNet-Mobility [31], ReArt-48 [17], RBO [20]. However, these datasets generally focus more on the structural information (e.g. part segmentation, kinematic structure), but pay less attention to the appearance (e.g. texture, fine geometry), the physics properties (e.g. per-part mass, inter + +tial, material and friction) and semantics (e.g. category, affordance). While some important tasks heavily rely on these information such as object detection (texture) [2], 3D reconstruction (fine geometry) [19], object manipulation (physical property) [5], and so on, the lacking of such object knowledge in these datasets can prevent satisfied generalization for the learning models. + +To boost the research on articulated objects, in this paper, we present AKB-48: a large-scale real-world Articulated Knowledge Base which includes 48 categories, 2,037 instances. For each instance, the object model is scanned from the real counterpart and refined manually (Sec. 3.2), and the object knowledge is organized to a graph, named Articulation Knowledge Graph (ArtiKG), which contains the detailed annotations of different kinds of object attributes and properties (Sec. 3.1). To make the scanning and annotation process feasible for large datasets, we present a Fast Articulation Knowledge Modeling (FArM) pipeline (Sec. 3.3). In detail, we develop an object recording system with 3D sensors and turntables, a GUI that integrates structural and semantic annotations, and standard real-world experiments for physical property annotation (Fig. 3). In this way, we can save a large amount of money and time budget for modeling real-world articulated objects (\(\sim\)\\(3 to buy, 10-15min to annotate per object). A thorough comparison between the CAD modeling and reverse scanning can be referred to Sec. 3.2. To summarize, our pipeline can save 33 folds on the money budget and 5 folds on the time budget. + +To utilize the AKB-48 for research, we propose AKBNet, an integral pipeline for Category-level Visual Articulation Manipulation (C-VAM) task. To address C-VAM problem, the vision system AKBNet should be able to estimate the object pose, reconstruct the object geometry and learn the policy for manipulation at category level. Thus, it consists of three perception sub-modules: + +- Pose Module for Category-level Articulated Object Pose Estimation. This module aims to estimate the per-part 6D pose of an unseen articulated object in one category. However, prior researches generally study on kinematic category, that is objects of a category are defined to have the same kinematic structure. Our pose module extends the concept of "category" to semantic category, in which the category is defined by the semantics and different kinematic structures are allowed. (Sec. 4.1) +- Shape Module for Articulated Object Reconstruction. After the pose is obtained, along with the shape code encoding from input images, we can reconstruct the shape for each part [25]. Full geometry is critical for manipulation to determine where to interact with. (Sec. 4.2) + +- Manipulation Module for Articulated Object Manipulation. Once we obtain the articulation information (e.g. part segments, per-part pose, joint properties, full mesh, etc.) through perception, we can learn the interaction policy over the observations. We benchmark manipulation tasks with opening and pulling that are corresponding to revolute and prismatic joint respectively. (Sec. 4.3) + +To evaluate the AKBNet, we report the results individually and systematically. For individual evaluation of each module, we assume the input to the module is the ground truth of the last module, while for systematical evaluation, the input is the output of the last module. Apparently, we cannot benchmark all the tasks which can be supported by the proposed AKB-48. We hope it could serve as a good platform for future articulation research in computer vision and robotics community. + +Our contributions can be summarized in three folds: + +- We introduce AKB-48, containing 2,037 articulated models across 48 categories, in which we adopt a multi-modal knowledge graph ArtiKG to organize the rich annotations. It can contribute to close the gap between the current vision and embodied AI researches. To the best of our knowledge, it is the first large-scale articulation dataset with rich annotations collected from the real world. +- We propose a fast articulation knowledge object modeling pipeline, FArM, which makes it much easier to collect articulated objects from the real world. Our pipeline greatly eases the cost on time and money when building real-world 3D model datasets. +- We propose an integral pipeline AKBNet for the integral category-level visual articulation manipulation (C-VAM) task. Experiments show our approach is effective both individually and systematically in the real world. + +# 2. Related Work + +3D Model Repositories and Datasets. An unavoidable challenge for analyzing 3D objects, especially for articulated objects, is the lack of large-scale training data with sufficient 3D models and full annotations. To the best of our knowledge, current 3D model repositories prefer to collect CAD models by searching from the Internet such as Trimble 3D Warehouse and Onshape [14]. ShapeNet [4] collects approximately 3 million shapes from online model repositories and categorizes them based on WordNet [22] taxonomy. But although ShapeNet contains many articulated categories, the models of ShapeNet can only be considered as rigid shapes since they do not define parts within + +![](images/94d55b0632d0c5b2c3e40761054dcbe0a5e3ec5af842a6b2e12ecc113a96dde3.jpg) +Figure 2. The Articulation Knowledge Graph (ArtiKG) defined in AKB-48 dataset. In ArtiKG, we annotate four types of knowledge: Appearance, Structure, Semantics and Physical Property. The values are rounded up to percentile in this figure for presentation. + +![](images/f3d62a702cc3a633efa1eb497a72e31f97fa2e76102aef3729897ce53e36c851.jpg) +Figure 3. The task-specific model acquisition equipment. (a) 1 is a Rotating turntable for objects with multiple scales. 2 is a tracking marker. 3 is a light-absorbing item. 4 is a lift bracket. 5 is the Shining 3D scanner. 6-8 are the realsense L515 cameras for capturing multiviews of objects. + +them. To deal with this problem, Mo et al. [24] first present a large-scale dataset PartNet that annotates hierarchical part semantic segmentation based on a subset of ShapeNet [4]. One critical problem in PartNet is that it pays much attention to labeling each semantic part but ignores the kinematics structures. To solve this issue, PartNet-Mobility [31] and Shape2Motion [30] further annotate joint properties on the shapes, which target at articulation research. + +These datasets mostly follow the model construction paradigm from ShapeNet: collecting CAD models from the Internet and providing specific annotations for different tasks. This allows the early works (ShapeNet [4], ABC dataset [14], etc.) to quickly build large-scale object model bases. However, when the task is required to investigate new categories or kinematic structures, artists need to manually build proper CAD models from scratch, which is very time-consuming and laborious. On the other hand, current real-world researches focus on instance-level tasks so they + +tend to build small-scale model datasets such as YCB [3] and RBO [20]. Therefore, the data volume makes it hard to be adopted in our category-level articulation tasks, which requires generalization capacity among different instances. In this paper, we present AKB-48 as the first large-scale real-world base for articulation analysis. + +Articulation-related Tasks. Articulated objects have been investigated for decades in both vision and robotics communities but hold different emphases. In vision tasks, current works tend to solve category-level object recognition, segmentation or pose estimation that focus on generalization among objects. Yi et al. [32] take a pair of unsegmented shape representations as input to predict part segmentation and deformation. For tackling with unseen objects, Li et al. [16] follow the pose estimation setting and propose a normalized coordinate space to estimate 6D pose and joint state for articulated objects. In terms of joint-centered perception tasks, several works attempt to mine joint configurations of articulated objects [11, 18, 33]. To investigate manipulation points for articulated objects from visual input, Mo et al. attempt to define six types of action primitives and predict interactions [23]. In terms of robotics community, researchers usually solve interaction or manipulation tasks to achieve articulation inference such as robot interactive perception [12], feedback by visual observation [9] and task integration [21]. Besides, some works attempt to bridge the gap between vision and manipulation but still suffer from the small-scale issue. Therefore, we propose AKBNet to deal with category-level articulation tasks. + +# 3. Articulation Knowledge Base, AKB-48 + +When constructing the knowledge base, three instant questions should be answered: (1) What kinds of knowledge should we annotate on the object? (2) What objects should we annotate, those from the real or the simulated world? (3) How to annotate the object knowledge efficiently? To answer these questions, we describe the ArtiKG in Sec. 3.1, make a thorough discussion on the object selection in Sec. 3.2, and finally propose the FArM pipeline in Sec. 3.3 and provide analysis (diversity, difficulty) about the dataset in Sec. 3.4. + +# 3.1. Articulated Object Knowledge Graph, ArtiKG + +Different tasks require different kinds of object knowledge, to unify the annotation representation, we organize it into a multi-modal knowledge graph, named ArtiKG. The ArtiKG consists of four major parts, namely appearance, structure, physics, and semantics. The details are described in the following and visualized in Fig. 2. + +Appearance. For each instance, we store its shape with mesh data structure along with the textures. When scanning the object from the real world, we also collect the multi-view RGB-D snapshots of the object. + +Structure. The key difference between the articulated object and the rigid object is the kinematic structure. The articulated object has concepts like joint and part, which are not meaningful for the rigid object. For each joint, we annotate the joint type, parameters, and movement limits. For each part, we segment each kinematic part. + +Semantics. After the basic geometric and structural information is annotated, we begin to assign the semantic information to the object in a coarse-to-fine process. We give a uuid to each instance. Then we assign the category and the corresponding taxonomy to the object according to WordNet [22]. We also label the semantic part. Though we already annotate the kinematic part, it is not quite the same as the semantic part. Take a mug with a handle, for example, the handle is not attached to the mug body through a joint, thus it is not a kinematic part, but it is a semantic part as it indicates where the human normally grabs the mug. + +Physical property. Real objects exist in the physical world and typically have physical properties, which are important for accurate simulation and real-world manipulation & interaction on articulated objects. Thus, we store physical attribute annotations for our models, involving per-part mass, Per-part inertial, material and surface friction. + +Discussion. In this section, we only describe the object knowledge that should take human's effort to annotate, for those which can be calculated through algorithms or trivially inferred like surface normal, collision mesh/simplified + +mesh, intrinsic dimensions, are not discussed. Besides, as the annotation information is modular organized, it is convenient for new attributes to be added to the ArtiKG. Besides, though the ArtiKG is designed for articulated objects, it can also be trivially extended to rigid, and flexible objects. + +# 3.2. Object Selection: Real-world Scanning v.s CAD Modeling + +The choice between real-world scanning and CAD modeling are considered from two perspectives, namely annotation accuracy, cost on time and money. + +Annotation Accuracy. According to the content of the ArtiKG, we can see objects from the real world have multiple advantages over the CAD models, such as appearance and physical property. But admittedly, the CAD model can model inner structures such as the GUNdam or the transformer, while scanning techniques focus more on the surface. Since such objects with inner structures that cannot be easily disassembled posit challenges for both artists and the scanners, we would like to update these objects when techniques are more ready. Fortunately, most daily objects can be disassembled, so the scanning techniques can properly handle them. + +Cost on Time and Money. As discussed earlier, ShapeNet-like model collection paradigm is limited to large time and money cost of artists' manual CAD model building when investigating new categories or kinematic structures. On the other hand, many daily articulated objects are cheap in reality and can be scanned by a layman. We compare the average money and time budget in Table 1. For CAD modeling, it is estimated from outsourcing services in Taobao website1. From our survey, most artists spend more than 2 hours (over 120 minutes) to model an articulated object and the labor cost is averagely over 100 dollars for one. + +
CAD modelingReal-world Scanning
Time (min)>12020
Money ($)>1003
+ +Table 1. Budget comparison between our real-world scanning and CAD modeling for articulated objects. + +To note, we are aware that many important articulated objects in the real world are rather expensive like laptop, microwave oven, doors etc. In such cases, we either collect only the ones we can collect from the homes without rebuying, or buy one to measure the basic information and propagate to the existing simulated objects like in PartNet-Mobility [31]. For these objects, the ArtiKG is labeled as ArtiKG-sim. + +
DatasetAppearanceStructureSemanticsPhysics
NumAVATPartJointSTPSPMPIPF
Synthetic Model Dataset
ShapeNet [4]>50K<2K<5K------
PartNet [24]>20K<2K<5K-----
Shape2Motion [30]2K<0.5K<1K-----
PartNet-Mobility [31]2K<0.5K<1K---
Real-World Model Dataset
YCB [3]21~40K~90K-------
LineMod [10]15~19K~39K-------
RBO [20]14~5K~10K-----
AKB-48(Ours)2,037~56K~110K
+ +Table 2. Comparison with other popular model datasets. Our AKB-48 dataset provides four types of information for rich annotations in our ArtiKG: Appearance, Structure, Semantics and Physics. AV: Average number of vertices. AT: Average number of triangles. ST: Semantic Taxonomy. PS: Per-part Semantic label. PM: Per-part Mass. PI: Per-part Inertia Moment. PF: Per-part Friction. + +# 3.3. Fast Articulation Knowledge Modeling (FArM) Pipeline + +Once we determine what to annotate and what object to be annotated, the remaining problem is how to make the annotation process affordable. + +# 3.3.1 Model Acquisition Equipment. + +To efficiently collect real-world articulated models, we setup a recording system, whose configuration is illustrated in Fig. 3. This apparatus is developed with three components: EinScan Pro 2020 for scanning $^2$ , Intel RealSense D435 for RGB-D multi-view snapshot, multi-scale rotating turntables and lift bracket. In our setup, each object can be scanned within 5 minutes. + +# 3.3.2 Articulation Modeling + +After the model acquisition, we develop an articulated object modeling interface with 3D GUI for annotation guidance. Specifically, our modeling workflow split the whole process into three sub-processes: + +Object Alignment. This process requires the annotator to align the scanned articulated object from camera space into canonical space which is shared within a category. To assist the alignment, we define several primitive shapes such as cube, sphere and cylinder with predefined axis, which are used to fit the targeted object. + +Part Segmentation. Different from synthetic models from the Internet that often include original mesh subgroups and part information, real-world scanned models require manual segmentation for each rigid part. In our interface, we provide a mesh cutting method with multi-view observation. The annotators draw boundary polygons on the + +aligned watertight surface and the interface could automatically split the mesh into multiple smaller sub-components. To note, if the parts can be disassembled in the real world, we just scan each part and assemble them into an integral model. + +Joint Annotation. In contrast to other object modeling pipelines, articulated objects require joint annotation that links two rigid segmented parts and describes the kinematic structure as a tree. Our interface provides an inspector window that allows the annotator to reorganize the parts into a tree structure. Then, the annotators could add joint information to each link and annotate 6D vector (3 for joint location and 3 for joint axis) in a 3D view that contains parent and child parts. To ensure the correctness of joint annotation, we provide an animation that demonstrates the motion under current joint information and the annotators could further refine the annotation. + +# 3.3.3 Physics Annotation + +Real-world articulated objects exist in the physical world and have physical properties. To enable our AKB-48 in real-world robotic manipulation & interaction tasks, we also annotate physical attribute annotations for each part of the articulated object. + +Per-part Mass. We record each rigid part's weight in grams. For those objects that are inseparable on several parts, we adopt the drainage method [6] to measure volume for these parts and compute the weight by their densities according to the materials. + +Per-part Inertia Moment. It is hard to obtain per-part inertia moment in the real world since scanned articulated models might contain hundreds of thousands of triangles, which is in a very complicated structure. In our method, we simplify these models with finite primitive shapes, such as cuboid + +![](images/e0244734df961e6ffac3c2ce622b22f0b707f867dde3644c2544f39ef48463d6.jpg) +Figure 4. The overall pipeline of AKBNet. The input of AKBNet is a single RGB-D image with a detected box, and there are three components conducted: (1) Pose module for predicting per-part segmentation, 6D pose, joint type as well as joint properties. (2) Shape module for generating full mesh of the articulated object with current joint state. (3) Manipulation module for enabling the RL agent (UR5 Robot Arm with a Robotiq 85 gripper) to manipulate the object, and also predicting per-part physics information. + +and cone, and then compute the inertial moment in simulation based on the combination of these primitive shapes. + +Per-part Material and Friction. We also annotate the surface material and related parameters. For example, a transparent material will be annotated with the index of refraction, and normal materials will be annotated with friction coefficients. These are obtained by searching Machinery's Handbook [26]. + +# 3.4. Dataset Analysis + +Object Categories. To build AKB-48 dataset, we take the following requirements into consideration: (1) Commonality. We require our AKB-48 could cover most of the articulated object categories in the common daily scenes, such as kitchen, bedroom and office room. (2) Variety. We consider the objects with a wide variety of shapes, deformability, texture and kinematic structure for one category. (3) Usage. The chosen objects should contain various functionalities on usage. Besides, the ability to complete manipulation performance is prioritized. + +Statistics. We first compare AKB-48 with some other popular datasets in Table 2. As it is shown, our object models cover full features for real-world articulated object analysis. Specifically, compared to the synthetic model repository, we hold a much finer surface with average of around 126K triangles and real textures while synthetic models only contain thousands of triangles and synthetic textures. In terms of annotation, we provide part and joint annotations that are enough for visual articulation tasks. Furthermore, we also annotate physical information for each model that is never considered in both synthetic and real-world model repositories before. We believe the rich annotations could promote further development in articulation research. As for the model number, we have a comparable number of ob + +jects in comparison with the current largest articulated object datasets PartNet-Mobility [31], yet it comprises only CAD models. More statistics such as category specification and intra-category variety can be referred to supplementary materials. + +# 4. AKBNet + +In this section, we describe the AKBNet, an integral pipeline for C-VAM problem. In AKBNet, the input is a single RGB-D image with detected 2D bounding boxes. We build three sub-modules in AKBNet that aims to estimate per-part 6D pose (Sec. 4.1), reconstruct full geometry of articulated object (Sec. 4.2) and reason the interaction policy through the perception (Sec. 4.3). The overall pipeline of AKBNet is illustrated in Fig. 4. + +# 4.1. Pose Module + +Given an image with a detected 2D bounding box, we can obtain the partial point cloud $\mathcal{P} \in \mathbb{R}^{N \times 3}$ . Firstly, the input $\mathcal{P}$ is processed by a Pointnet++ [28] for feature extraction, and we build two branches at the end for predicting per-point segmentation $S$ and part-level Normalized Object Coordinate Space [16] (NOCS) map $\mathcal{P}' \in \mathbb{R}^{N \times 3}$ . To solve the unknown kinematic structure and joint type issues, we introduce three extra branches on the feature extractor to classify the joint type $\delta$ on its corresponding part $k$ , and also to predict joint property including joint location $\mathbf{q}_i$ and joint axis $\mathbf{u}_i$ . Finally, we apply the voting scheme to obtain the final joint property $\mathbf{q} \in \mathbb{R}^3$ and $\mathbf{u} \in \mathbb{R}^3$ . We use cross-entropy loss for part segmentation $\mathcal{L}_{seg}$ and joint type classification $\mathcal{L}_{type}$ , L2 loss for NOCS map $\mathcal{L}_{nocs}$ , joint location $\mathcal{L}_{loc}$ and joint axis $\mathcal{L}_{ax}$ prediction. Taking all the loss functions into consideration, the overall loss $\mathcal{L}_{pos}$ for pose + +module is: + +$$ +\begin{array}{l} \mathcal {L} _ {p o s} = \lambda_ {s e g} \mathcal {L} _ {s e g} + \lambda_ {n o c s} \mathcal {L} _ {n o c s} \tag {1} \\ = + \lambda_ {l o c} \mathcal {L} _ {l o c} + \lambda_ {a x} \mathcal {L} _ {a x} + \lambda_ {t y p e} \mathcal {L} _ {t y p e} \\ \end{array} +$$ + +Finally, we follow the pose optimization algorithm with kinematic constrains [16] to recover the 6D pose $\{R,\mathbf{t}\}$ for each rigid part. $R$ denotes rotation $R\in SO(3)$ and $\mathbf{t}$ denotes translation $\mathbf{t}\in \mathbb{R}^3$ + +# 4.2. Shape Module + +Given a partial point cloud $\mathcal{P}$ , the shape module aims to re-build the full geometry $\mathcal{M}_{\theta}$ with joint state $\theta$ . Followed by A-SDF [25], we build a feature extractor process the concatenated partial point cloud $\mathcal{P}$ and Gaussian initialized shape embedding $\phi$ as well as joint embedding $\psi$ , in which $\phi$ indicates the shape information of the full articulated object and $\psi$ indicates the joint state information that is shared across the same instance. We use SDF values [27] $d_{i}$ as supervision and L1 loss for training the shape module $F_{sha}$ : + +$$ +\mathcal {L} _ {s h a} = \lambda_ {s h a} \frac {1}{N} \sum_ {i = 1} ^ {N} \| F _ {s h a} (p _ {i}, \phi , \psi) - d _ {i} \| + \lambda_ {\phi} \| \phi \| _ {2} \tag {2} +$$ + +During inference, based on the predicted shape embedding $\phi$ and joint embedding $\psi$ , we follow Mu's algorithm [27] to reconstruct the full mesh $\mathcal{M}_{\theta}$ . + +# 4.3. Manipulation Module + +The manipulation module performs two tasks: opening and pulling that are corresponding to the revolute and prismatic joints in articulation respectively. To achieve these tasks, we train two Reinforcement Learning (RL) agents (UR5 Robot Arm with a Robotiq 85 gripper) these tasks. We provide two State Representations: (1) object state, consisting of 6D pose $\{R,\mathbf{t}\}$ , joint location $\mathbf{q}$ , axis $\mathbf{u}$ , full geometry $\mathcal{M}_{\theta}$ under current joint state $\theta$ . (2) agent state, consisting of the gripper's pose $\{R_g,\mathbf{t}_g\}$ and the gripper's width $w_{g}$ . We assume that the agent can access all the information about itself so the agent state is ground truth in our method. The Actions include the agent's end-effector's 3D translation and the opening width of the gripper. The Rewards are rotation angle along the joint axis of the target part for revolute joint and translation distance of that for prismatic joint. The RL agent is trained by two popular RL baselines: Truncated Quantile Critics (TQC) [15] and Soft Actor-Critic (SAC) [8] with Hindsight Experience Replay (HER) [1] algorithm. + +We also perform physics prediction in our AKBNet. Specifically, the input is a feature vector of point cloud $\mathcal{P}^k$ for $k$ th part. We train a 3-layer MLP and build three parallel + +branches to predict per-part mass $m^k$ , friction $\mu^k$ and inertia moment $I^k$ . We use L2 loss for training the physics prediction submodule. Please refer to supplementary materials for more details. + +# 5. Experiments + +# 5.1. Experimental Setup + +Dataset. For the pose module and shape module, we generate 100K RGB-D images with AKB-48 models for training AKBNet using SAMERT data generation scheme [17] with scenes from NOCS [29]. And we also capture 10K real-world images, in which 5K are used for fine-tuning the model and the other 5K is test set. For manipulation module, we select 68 and 32 instances for training and testing the RL agent, in which the former is used for opening task and the latter is for pulling task. During training, we use different instances at every episode. + +Implementation Details. When training pose module and shape module, we use Adam optimizer with initial learning rate 0.001. Batch size is 16. The total training epochs are 50 and 100 for training these two modules. The detailed hyper-parameters are: $\lambda_{seg} = 1$ , $\lambda_{nocs} = 10$ , $\lambda_{loc} = 1$ , $\lambda_{ax} = 0.5$ , $\lambda_{type} = 1$ , $\lambda_{sha} = 1$ , $\lambda_{\phi} = 0.0001$ . For the manipulation module, the hyper-parameters are: batch size is 512, learning rate is 0.001, replay buffer size is $100\mathrm{K}$ , soft update coefficient is 0.05, discount factor is 0.95. We use RF Universe [7] as the environment to train the RL agent. For more details, please refer to the supplementary materials. + +Metrics. We adopt the following metrics to measure the AKBNet performance. For the pose module, We report three part-based metrics: rotation error measured in degrees, translation error measured in meters and 3D IoU for each part. We also report the joint-based metrics: angle error of joint axis measured in degrees, location error in line-to-line distance measured in meters, joint type classification accuracy (\%). For the shape module, we report the average Chamfer-L1 distance [25] for reconstruction evaluation. For the manipulation module, we report success rate (\%) as the metric. If the agent can grip the target part and move it through $50\%$ of its motion range, it will be regarded as a success. + +# 5.2. Pose Module Performance + +We evaluate NPCS [16], A-NCSH [16] and AKBNet on real-world test set for category-level articulation pose estimation task. For A-NCSH baseline, we use direct regression and classification scheme to predict kinematic structure and joint type. The experimental results are illustrated in Table 3. For pose estimation, we achieve 10.0, 0.023 and 52.7 on rotation, translation errors and 3D IoU, which + +![](images/a815db47eb684d41b17c68011c7f67414a41730c5575360014a73531065957a9.jpg) + +![](images/7862007744a4f131f14feee133c5e715b33c58bb791d36e3f13b7739ec906146.jpg) + +![](images/6b2f40c35c59930b53dc6899657bcb5c8f444cae7953c4ce80068a22a55f77d6.jpg) + +![](images/f87e3caafc02c451fb499796563c74737ddaa559da907357ba13e8e088b655ab.jpg) + +![](images/c6adcc847852165bd5b90d6c9d8be9981d8902b849b1b4e9eef41c09219429a1.jpg) + +![](images/f811ae766b2ac33e8bb7672034b6c24775eb144adea740a0d1936ffa5b08bcdd.jpg) + +![](images/88f3eb3f49b3f90d9764bf9ae21f7ffbbafe1338d134b5a5ab42d6d689fc28c8.jpg) + +![](images/3a0e31ec1b7da900c5b0436571fd7f6fb635ccd9d1c0c9fcd381166ee7149e89.jpg) + +![](images/8753e1ddc3275c3c273f08f77d253ad1afe1fdcf683e2001dc0ba254d260a405.jpg) +Figure 5. Qualitative results. For one instance, from left to right: input RGB-D image, output of pose module, output of shape module, manipulation demonstration. + +![](images/b5846eea9ea29eb95a337962c223c313e01dab9a20107b6e26389070e72ff56f.jpg) + +![](images/408154a4380a2525bb5b3a4da0574002f100fd090c4f368abd436719fece1dd9.jpg) + +![](images/061a9649c87b0f7f61098dacf64d4d1ae5b6a28b9fb9b54b6d44d705f98d0773.jpg) + +![](images/bcaa41185484391714db76faaba60dcb02c2d3c2dca4dc9a02e5da38c3c8a38a.jpg) + +![](images/f31533dab724fd41d811930d1bc941486d62a4448b0bc4f85cd914ada9376f12.jpg) + +![](images/faaceadc42c3c2e085516965d07e10a15026ab68c516bb9f5f0ee234d01d6044.jpg) + +![](images/440a60be0f399babe323424b4ba6e049071d8ee5b16b20ec3c97bcea0b18b613.jpg) + +are higher than NPCS and A-NCSH. For joint-related evaluation, we can precisely predict joint type for unseen articulated objects with $94.2\%$ accuracy. Besides, AKBNet achieves 8.7 and 0.019 errors in joint axis and location prediction respectively. + +
MethodPart-based Metrics
rotation↓translation↓3D IoU↑
NPCS [16]12.60.03848.3
A-NCSH* [16]10.50.02650.8
AKBNet10.00.02352.7
MethodJoint-based Metrics
angle↓distance↓type↑
NPCS [16]---
A-NCSH* [16]9.20.02193.8
AKBNet8.70.01994.2
+ +# 5.3. Shape Module Performance + +The experimental results of the shape module are illustrated in Table 4. Within ground truth joint state input, the shape module could reconstruct the articulated object with 5.6 Chamfer-L1 distance. On the other hand, we systematically evaluate the shape module given the predicted joint state, which is deduced from predicted the linked two parts' poses from the pose module. The Chamfer-L1 distance is 3.3 higher than that with ground truth joint state, indicating that the predicated poses largely affect reconstruction performance. + +Table 3. Category-level articulation pose estimation results. $\downarrow$ means the lower the better. $\uparrow$ means the higher the better. * indicates that A-NCSH is re-implemented with the extra kinematic structure and joint type prediction modules. + +
ModeChamer-L1 Distance
Joint State GT5.6
Joint State Pre.8.9
+ +# 5.4. Manipulation Module Performance + +We evaluate opening and pulling tasks on the manipulation module of AKBNet using TQC+HER training algo + +rithm compared with that using SAC+HER. Experimental results are illustrated in Table 5. With ground truth object state, AKBNet could complete opening and pulling manipulation tasks, with $68.6\%$ and $92.4\%$ success rate. However, our method might not perform well when the object state is predicted, with only $26.4\%$ and $32.6\%$ success rates. Qualitative results of AKBNet are illustrated in Fig. 5. + +Our AKBNet can also predict physics information including per-part mass, friction and inertia moment. These predicted physics can enable force sensing for AKB-48 objects in simulation, which has the potential to realize force controlling. For more details, please refer to supplementary materials. + +Table 4. Articulated object reconstruction results. Pre. means that we use the predicted joint state from the pose module. + +
MethodModeOpeningPulling
AKBNet+SAC [8]+HER [1]Object State GT53.892.4
Object State Pre.22.828.5
AKBNet+TQC [15]+HER [1]Object State GT68.689.7
Object State Pre.26.432.6
+ +Table 5. Success rate (%) on articulated object manipulation task. Pre. means we use predicted object state from the pose and shape modules. + +# 6. Conclusion and Crowd-Sourcing DataCollection Invitation + +In this paper, we present AKB-48, a large-scale articulated object knowledge and benchmark C-VAM problem for dealing with articulation problems. Admittedly, there are a few articulated object categories that might not be collected in AKB-48, although we have covered large enough categories in daily life. In the future, we will release our FArM tool for collecting more articulated objects, and it could also support any scanned shapes such as mobile reconstructor [13]. In future work, we will publish an online articulation model platform and invite crowd-sourcing data-collection to contribute to the articulation research community. + +Acknowledgement This work was supported by the National Key R&D Program of China (No. 2021ZD0110700), Shanghai Municipal Science and Technology Major Project (2021SHZDZX0102), Shanghai Qi Zhi Institute, and SHEITC (2018-RGZN-02046). + +# References + +[1] Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 5055-5065, 2017. 7, 8 +[2] Joao Borrego, Atabak Dehban, Rui Figueiredo, Plinio Moreno, Alexandre Bernardino, and José Santos-Victor. Applying domain randomization to synthetic data for object category detection. arXiv preprint arXiv:1807.09834, 2018. 2 +[3] Berk Calli, Arjun Singh, Aaron Walsman, Siddhartha Srinivasa, Pieter Abbeel, and Aaron M Dollar. The ycb object and model set: Towards common benchmarks for manipulation research. In 2015 international conference on advanced robotics (ICAR), pages 510-517. IEEE, 2015. 3, 5 +[4] Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015. 2, 3, 5 +[5] Peng Chang and Taskin Padif. Sim2real2sim: Bridging the gap between simulation and real-world in flexible object manipulation. In 2020 Fourth IEEE International Conference on Robotic Computing (IRC), pages 56-62. IEEE, 2020. 2 +[6] John D Cutnell and Kenneth W Johnson. Physics, Volume One: Chapters 1-17, volume 1. John Wiley & Sons, 2014. 5 +[7] Haoyuan Fu, Xu Wenqiang, Xue Han, Yang Huinan, Ye Ruolin, Huang Yongxi, Xue Zhendong, Wang Yanfeng, and Cewu Lu. Rfuniverse. 7 +[8] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International conference on machine learning, pages 1861-1870. PMLR, 2018. 7, 8 +[9] Karol Hausman, Scott Niekum, Sarah Osentoski, and Gaurav S Sukhatme. Active articulation model estimation through interactive perception. In 2015 IEEE International Conference on Robotics and Automation (ICRA), pages 3305-3312. IEEE, 2015. 3 +[10] Stefan Hinterstoisser, Stefan Holzer, Cedric Cagniart, Slobodan Ilic, and Vincent Lepetit. Multimodal templates for real-time detection of texture-less objects in heavily cluttered scenes. In IEEE International Conference on Computer Vision, 2012. 5 +[11] Ajinkya Jain, Rudolf Lioutikov, and Scott Niekum. Screwnet: Category-independent articulation model estimation from depth images using screw theory. arXiv preprint arXiv:2008.10518, 2020. 3 +[12] Dov Katz and Oliver Brock. Manipulating articulated objects with interactive perception. In 2008 IEEE International Conference on Robotics and Automation, pages 272-277. IEEE, 2008. 3 +[13] Matthew Klingensmith, Ivan Dryanovski, Siddhartha S Srinivasa, and Jizhong Xiao. Chisel: Real time large scale 3d reconstruction onboard a mobile device using spatially + +hashed signed distance fields. In Robotics: science and systems, volume 4. CiteSeer, 2015. 8 +[14] Sebastian Koch, Albert Matveev, Zhongshi Jiang, Francis Williams, Alexey Artemov, Evgeny Burnaev, Marc Alexa, Denis Zorin, and Daniele Panozzo. Abc: A big cad model dataset for geometric deep learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9601-9611, 2019. 2, 3 +[15] Arsenii Kuznetsov, Pavel Shvechikov, Alexander Grishin, and Dmitry Vetrov. Controlling overestimation bias with truncated mixture of continuous distributional quantile critics. In International Conference on Machine Learning, pages 5556-5566. PMLR, 2020. 7, 8 +[16] Xiaolong Li, He Wang, Li Yi, Leonidas J Guibas, A Lynn Abbott, and Shuran Song. Category-level articulated object pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3706-3715, 2020. 3, 6, 7, 8 +[17] Liu Liu, Han Xue, Wenqiang Xu, Haoyuan Fu, and Cewu Lu. Towards real-world category-level articulation pose estimation. arXiv preprint arXiv:2105.03260, 2021. 1, 7 +[18] Qihao Liu, Weichao Qiu, Weiyao Wang, Gregory D Hager, and Alan L Yuille. Nothing but geometric constraints: A model-free method for articulated object pose estimation. arXiv preprint arXiv:2012.00088, 2020. 3 +[19] Robert Maier, Kihwan Kim, Daniel Cremers, Jan Kautz, and Matthias Nießner. Intrinsic3d: High-quality 3d reconstruction by joint appearance and geometry optimization with spatially-varying lighting. In Proceedings of the IEEE international conference on computer vision, pages 3114-3122, 2017. 2 +[20] Roberto Martín-Martín, Clemens Eppner, and Oliver Brock. The rbo dataset of articulated objects and interactions. The International Journal of Robotics Research, 38(9):1013-1019, 2019. 1, 3, 5 +[21] Roberto Martín-Martín, Sebastian Höfer, and Oliver Brock. An integrated approach to visual perception of articulated objects. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pages 5091-5097. IEEE, 2016. 3 +[22] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39-41, 1995. 2, 4 +[23] Kaichun Mo, Leonidas Guibas, Mustafa Mukadam, Abhinav Gupta, and Shubham Tulsiani. Where2act: From pixels to actions for articulated 3d objects. arXiv preprint arXiv:2101.02692, 2021. 3 +[24] Kaichun Mo, Shilin Zhu, Angel X Chang, Li Yi, Subarna Tripathi, Leonidas J Guibas, and Hao Su. Partnet: A largescale benchmark for fine-grained and hierarchical part-level 3d object understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 909-918, 2019. 3, 5 +[25] Jiteng Mu, Weichao Qiu, Adam Kortylewski, Alan Yuille, Nuno Vasconcelos, and Xiaolong Wang. A-sdf: Learning disentangled signed distance functions for articulated shape representation. arXiv preprint arXiv:2104.07645, 2021. 2, 7 +[26] Erik Oberg and Franklin Day Jones. Machinery's Handbook. Industrial Press, 1914. 6 + +[27] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 165–174, 2019. 7 +[28] Charles R Qi, Li Yi, Hao Su, and Leonidas J Guibas. Point-net++ deep hierarchical feature learning on point sets in a metric space. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 5105-5114, 2017. 6 +[29] He Wang, Srinath Sridhar, Jingwei Huang, Julien Valentin, Shuran Song, and Leonidas J Guibas. Normalized object coordinate space for category-level 6d object pose and size estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2642-2651, 2019. 7 +[30] Xiaogang Wang, Bin Zhou, Yahao Shi, Xiaowu Chen, Qinping Zhao, and Kai Xu. Shape2motion: Joint analysis of motion parts and attributes from 3d shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8876-8884, 2019. 3, 5 +[31] Fanbo Xiang, Yuzhe Qin, Kaichun Mo, Yikuan Xia, Hao Zhu, Fangchen Liu, Minghua Liu, Hanxiao Jiang, Yifu Yuan, He Wang, et al. Sapien: A simulated part-based interactive environment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11097-11107, 2020. 1, 3, 4, 5, 6 +[32] Li Yi, Haibin Huang, Difan Liu, Evangelos Kalogerakis, Hao Su, and Leonidas Guibas. Deep part induction from articulated object pairs. ACM Transactions on Graphics, 37(6), 2019. 3 +[33] Vicky Zeng, Timothy E Lee, Jacky Liang, and Oliver Kroemer. Visual identification of articulated object parts. arXiv preprint arXiv:2012.00284, 2020. 3 \ No newline at end of file diff --git a/akb48arealworldarticulatedobjectknowledgebase/images.zip b/akb48arealworldarticulatedobjectknowledgebase/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..26e8993c61689a4ca64a6e6a87754f6ddd238935 --- /dev/null +++ b/akb48arealworldarticulatedobjectknowledgebase/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a09adc9bd0f7f3aac6ae29ed90064f02a37bcdb13ced31d115fe34b05a4ad082 +size 459171 diff --git a/akb48arealworldarticulatedobjectknowledgebase/layout.json b/akb48arealworldarticulatedobjectknowledgebase/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0383836d4b488cb2bcae19c822d9fa03c118a1b9 --- /dev/null +++ b/akb48arealworldarticulatedobjectknowledgebase/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c778ac94733743ac8ecaf63c807969b4627e915a4dc0826bbdb6ea5130ea411e +size 334067 diff --git a/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_content_list.json b/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0159a647941e87c7b4bb27efa476b64d4aec791b --- /dev/null +++ b/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f4bb0cfa06073180626afc8092bfc0a37162a10528728dae357be624acdca7e +size 83224 diff --git a/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_model.json b/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7c6f6b1e27f9852035650e477dc3d7d8d4b4fbf5 --- /dev/null +++ b/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c4555fbc6ec4fee979231d24d80f1fb767321350f9ca67fa4f6e7c04a9fee90 +size 103650 diff --git a/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_origin.pdf b/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..584546f11b635fd55e2decdd31e726382771f140 --- /dev/null +++ b/ameattentionandmemoryenhancementinhyperparameteroptimization/597824f7-8c42-47fe-83fd-81871efef9d9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9523ed935efb541b7c0e1a316207f484ba0093580d2a85a4c08671bc442131af +size 757670 diff --git a/ameattentionandmemoryenhancementinhyperparameteroptimization/full.md b/ameattentionandmemoryenhancementinhyperparameteroptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..89e124e2f61a310b0c15bd8e31b026a14ae6f52f --- /dev/null +++ b/ameattentionandmemoryenhancementinhyperparameteroptimization/full.md @@ -0,0 +1,361 @@ +# AME: Attention and Memory Enhancement in Hyper-Parameter Optimization + +Nuo Xu $^{a,b}$ , Jianlong Chang $^{c}$ , Xing Nie $^{a,b}$ , Chunlei Huo $*^{a,b}$ , Shiming Xiang $^{a,b}$ and Chunhong Pan $^{a,b}$ + +$^{a}$ NLPR, Institute of Automation, Chinese Academy of Sciences, Beijing, China + $^{b}$ School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China + $^{c}$ Huawei Cloud & AI, Beijing, China + +nuo.xu@nlpr.ia.ac.cn, jianlong.chang@huawei.com, niexing2019@ia.ac.cn, {clhuo, smxiang, chpan}@nlpr.ia.ac.cn + +# Abstract + +Training Deep Neural Networks (DNNs) is inherently subject to sensitive hyper-parameters and untimely feedbacks of performance evaluation. To solve these two difficulties, an efficient parallel hyper-parameter optimization model is proposed under the framework of Deep Reinforcement Learning (DRL). Technically, we develop Attention and Memory Enhancement (AME), that includes multi-head attention and memory mechanism to enhance the ability to capture both the short-term and long-term relationships between different hyper-parameter configurations, yielding an attentive sampling mechanism for searching high-performance configurations embedded into a huge search space. During the optimization of transformer-structured configuration searcher, a conceptually intuitive yet powerful strategy is applied to solve the problem of insufficient number of samples due to the untimely feedback. Experiments on three visual tasks, including image classification, object detection, semantic segmentation, demonstrate the effectiveness of AME. + +# 1. Introduction + +Hyper-Parameter Optimization (HPO) [53] is a crucial subfield in Automatic Machine Learning (AutoML), which is formulated as a bi-level optimization problem. Recently, the rise of deep learning has promoted giant development of machine learning and computer vision, but it also places higher requirements on computing resources. The optimization of large-scale neural networks often takes days or even weeks and a large number of GPUs to train, thus manual tuning of hyper-parameters has gradually become expensive. At the same time, the networks are highly sensitive to + +![](images/2121a688c1fa467b25739661b62991b2d938cf00ca5fb84dd0e3e6a7bec5ab3b.jpg) + +![](images/da03feeb7a825397cfd681ce352d42b759de1113a7f5d6f13e25bd1b7dd34861.jpg) +Figure 1. Comparison of different configuration searchers. (a) Random Search. The selection of the new configuration is independent of other evaluated configurations. (b) Bayesian Optimization. Under the given distribution assumption, the new configuration is finally obtained by acquisition function which models the relationship between evaluated configurations. (c) Attention and Memory Enhancement (AME). The relationship is captured by attentive sampling without distribution assumptions, and is employed for the prediction of all types of new configurations. + +the choice of hyper-parameters. Improper hyper-parameters directly lead to the failure of training, e.g., gradient explosion. In addition, when training modern neural networks, a large number of hyper-parameters are required to be set, including architecture hyper-parameters (e.g., network depth and types), optimization hyper-parameters (e.g., learning rate, batch size), and regularization hyper-parameters (e.g., weight decay), which result in a huge search space. Moreover, the challenge of HPO varies greatly in various subfields of machine learning. In the field of computer vision, hyper-parameters in detection and segmentation are more sensitive than classification. Therefore, a practical modern HPO algorithm must be able to easily handle the selection of several to dozens of hyper-parameters for different tasks within an acceptable time. + +Mainstream HPO algorithms consist of two parts, trial scheduler and configuration searcher. Among them, the scheduler is responsible for the allocation of computing resources. Specifically, it is capable of judging when to start a new trial, and whether to suspend or terminate the trials according to the corresponding performance and running time. The searcher is in charge of the proposals of new hyper-parameter configuration. For instance, the simplest case is that the new configuration is in a position to be obtained by random search [3, 23, 25, 31, 32] (see Fig. 1(a)), but the trials are independent, i.e., the relationship between each other is not considered, so it is extremely unstable in the huge search space. Using Bayesian Optimization (see Fig. 1(b)) to build an acquisition function by the evaluated configurations is another type of searcher [2, 12, 20, 48, 49]. Although this type of searcher selects the new hyper-parameter to be evaluated in an informed manner, it is limited by strong assumptions, e.g., assuming that the distribution obeys the Gaussian Process. Also, the modeling is so complicated that is more suitable for the optimization with a low-dimensional search space. In addition, the searcher based on Evolutionary Algorithms [21, 22, 37, 43] is sometimes time-consuming and is not able to cope with hyper-parameters that can not be inherited, mutated or hybridized, such as network depth and types. + +In order to maximize the potential of machine learning models, and to select appropriate hyper-parameters more efficiently and stably in the search space, this paper proposes a new configuration searcher based on Deep Reinforcement Learning (DRL) [41,46] and Transformer [42,50] (see Fig. 1(c)). Our searcher enhances the ability to capture the relationship between different configurations through multi-head attention and memory mechanism. Combined our searcher with the parallel trial scheduler ASHA [32], Attention and Memory Enhancement (AME) is proposed. AME actively encourages searcher to generate high-performance configurations, and penalizes configurations that reduce performance. The main contributions are as follows: + +- A transformer-structured configuration searcher is designed under reinforcement learning. Based on the novel searcher, an efficient parallel HPO model AME is proposed, which is sufficient to optimize all types of hyperparameters, without distribution assumptions. +- AME is capable of learning both the short-term and long-term relationships to achieve attentive configuration sampling, and effectively locating high-performance configurations in a huge search space. +- Bootstrap is applied to solve the insufficient number of samples caused by the difficulty of sample acquisition. This makes the online training of searcher efficient. +- Experiments demonstrate the efficiency of AME on three vision tasks, including image classification, object detection, and semantic segmentation. + +# 2. Related Work + +# 2.1. Hyper-parameter Optimization + +There are two mainstream HPO methods, Multi-fidelity Optimization and Black-box Optimization, optimized for trial scheduler and configuration searcher respectively. + +Multi-fidelity Optimization. This is an optimization technique aimed at reducing evaluation costs for scheduler, by obtaining a large number of cheap low-fidelity evaluations and a small number of expensive high-fidelity evaluations. It mainly includes two methods: Bandit-based Algorithm (e.g., SHA [23, 25], Hyperband [31], ASHA [32], BOHB [12], BOSS [18]) and Early-stopping Algorithm (e.g., median stopping [14], modeling learning curve [9,26]). The former is a trade-off between exploration and exploitation, while the latter terminates the trials with poor performance in time. In addition, TSE [17] learns the low-fidelity correction predictor efficiently by linearly combining a set of base predictors. AABO [39] adopts BOSS in detection for adaptively searching for the optimal setting of anchor boxes. + +Black-box Optimization. This is a way to learn the mapping $f: x \to y$ between input $x$ and output $y$ , ignoring the internal mechanisms. The easiest way is Grid Search [51], i.e., exhaustive search, which is only suitable for a small search space. Overall, there are four methods suitable for modern neural networks: Model-free Methods (e.g., Grid Search, Random Search [3, 23, 25, 31, 32], OATM [57]), Bayesian Optimization (e.g., BO-GP [48, 49], SMAC [20], BO-TPE [2], BOHB [12], distBO [30], AHGP [35], Dragonfly [24]), Evolutionary Algorithms (e.g., PBT [22], P-B2 [43], GA [21], PSO [37]) and Gradient-based Methods [1, 38, 40, 44, 47]. The advantages and disadvantages of the first three have been discussed in Sec. 1. Recently, Gradient-based Methods have shown better efficiency. However, they only enable the differentiable hyperparameters to update, such as weight decay, and can not directly update non-differentiable ones, such as batch size. + +# 2.2. Deep Reinforcement Learning + +DRL emphasizes how the agent acts based on the environment to obtain the maximum cumulative reward. As a pioneering work, PPO [46] surpasses other existing algorithms in performance. Recently, GTrXL [42] employs the transformer-structured agent to capture long-term and short-term memory for the first time. Other DRL-based AutoML methods generally learn the configuration in their respective tasks, e.g., network architecture [61], compression rate [16], and augmentation strategies [7], directly from input images. Learning from the original images with sparse knowledge is expected to result in inefficiency. Our AME learns the relationship between evaluated configurations to select new ones. In addition, AME overcomes the problem of insufficient samples with the help of bootstrap. + +# 2.3. Vision Tasks + +In this paper, three vision tasks are set up for experiments: image classification, object detection, semantic segmentation. Currently popular networks for image classification mainly include ResNet [15], ResNeXt [52], ResNeSt [55], and so on. These networks serve the backbones of other visual tasks. The goal of object detection is to find all the objects of interest in the image and determine their location and size. Mainstream detectors include FasterRCNN [45], CascadeRCNN [4], RetinaNet [34], RepPoints [54], FoveaBox [27], FSAF [60], ATSS [56]. Semantic segmentation is pixel-level classification, which understands images from pixels. Popular segmentors include PSPNet [58], PSANet [59], CCNet [19], DANet [13], DeepLabv3+ [6], FCN [36], GCNet [5]. In both detection and segmentation, the choice of head is crucial. Different heads have varying sensitivity to hyper-parameters, e.g., learning rate, so it is challenging to comprehensively consider the full configurations to optimize. + +# 3. Attention & Memory Enhancement in HPO + +# 3.1. Hyper-Parameter Optimization + +Before introducing our approach, we first briefly review HPO. In HPO, both parameters $\omega$ and hyper-parameters $h$ need to be optimized, with the non-differentiable nested relationship between them. Therefore, HPO is formulated as a bi-level optimization problem: + +$$ +\min _ {h} \mathcal {L} (h, \omega^ {*}, \mathbb {D} _ {v a l}) \tag {1} +$$ + +$$ +\begin{array}{l} \text {s . t .} f _ {h} (\omega^ {*}) \leftarrow f _ {h} (\omega^ {0}, \mathbb {D} _ {t r a i n}), h \in \mathcal {H}. \end{array} +$$ + +where $\mathcal{L}$ is the objective function, $\omega^0$ and $\omega^{*}$ are the initial and final parameters of this network, $\mathbb{D}_{train}$ and $\mathbb{D}_{val}$ are the training and validation dataset, $h$ is one hyper-parameter configuration sampled from the search space $\mathcal{H}$ , and $f_{h}$ is the neural network with hyper-parameter set to $h$ . The simplest Grid Search is to train networks with the complete set of hyper-parameters to converge, and then select the optimal. Due to the low efficiency, how to accelerate the search process becomes the most significant issue in HPO. The mainstream research direction is to improve the two components of HPO, trial scheduler and configuration searcher. Trial Scheduler. Trial scheduler is in charge of the allocation of resources (see Fig. 2(a,b)). It is capable of judging whether to terminate or start trials according to the corresponding performance. For example, ASHA [32] divides the training process of each trial into multiple rungs $t$ , which is adopted by our AME: + +$$ +\{\omega^ {t} | t = 0, 1, \dots , \lfloor \log_ {\eta} (R / r) \rfloor \} \tag {2} +$$ + +where $R$ and $r$ are the maximum and minimum budget (e.g., epoch or iteration) for one trial, and $\eta$ is the reduction factor. + +As long as the evaluation indicator of one trial in a certain rung $t$ is greater than the dynamically updated threshold, this trial is promoted to the next rung for training. Besides, trials with poor performance are required to be terminated in time. Therefore, the total number of trials starts from $n$ and gradually declines in the ratio of $1 / \eta$ in each rung. + +Configuration Searcher. Configuration searcher chooses better hyper-parameter configurations for network training (see Fig. 2(a,c)) by building a sampling function $g(\cdot)$ : + +$$ +h _ {n e w} = g \left(\left\{\hat {h} _ {i} \mid i = 1, 2, \dots , k \right\}\right), \tag {3} +$$ + +$$ +\hat {h} _ {i} \in \mathcal {H} \times \mathbb {R} ^ {1}, h _ {\text {n e w}} \in \mathcal {H}. +$$ + +where $h_{new}$ is the new hyper-parameter configuration to be evaluated, $\hat{h}_i$ refers to the configuration with evaluation indicator, and $k$ is the number of input configurations. The suggestion of new configurations is a notoriously hard problem, mainly owing to the following two difficulties: + +- The search space $\mathcal{H}$ is huge, and relationships between the configurations $\{\hat{h}_i\}$ are difficult to be captured. +- The evaluation is time-consuming, i.e., the evaluated configurations $\{\hat{h}_i\}$ are difficult to be obtained. + +Although random search is fast, it is unstable because it ignores these difficulties. Bayesian-optimization-based algorithms require prior strong distribution assumptions. Evolutionary-algorithm-based and gradient-based methods are only able to deal with specific hyper-parameters. + +Reinforced HPO. The recommendations for selecting hyper-parameters are able to be modeled under the framework of reinforcement learning, since DRL is naturally suitable for decision-making without explicit annotations. Searcher is equivalent to the agent, whose task is to learn a series of state-to-action mappings (see Eq. (3)) based on the reward. State $(S)$ refers to the combination of evaluated configurations $\{\hat{h}_i\}$ , action $(A)$ refers to the new configuration $h_{new}$ that the agent picks from search space, and reward $(R)$ is the evaluation of action. However, Reinforced HPO is still subject to the two difficulties that HPO has. Our Attention and Memory Enhancement (AME) captures the relationships with the help of attentive sampling, and applies bootstrap to solve the problem of lack of samples. + +# 3.2. AME via Attentive Sampling + +Fully Connected network (FC) with weak learning ability is not able to generalize the relationship between configurations well. Therefore, multi-head attention and memory mechanism are introduced to enhance training through attentive sampling. Intuitively, there is uniform continuity in the mapping between the search space and the corresponding evaluation indicators, i.e., the configurations around the configuration with high performance tend to be high-performance. For example, PBT [22] applies small disturbances generated by random noise to find a better configuration. The application of multi-head attention predicts + +![](images/daa893f394ad29ec7332287f709313bd487202fd2de5f4ea36f4a65bdbfdac32.jpg) + +![](images/5c07954c19600acf4e6551cfba50eeacdeaf01a63303936611fe9b9dcc592ab5.jpg) +(a) Overall Structure +(b) Trial Scheduler + +![](images/4ac906cc0580d0fa2be82b62185ebb2a65ef33cd455260cbd7185aa0c6b45c4b.jpg) +(c) Configuration Searcher +Figure 2. Pipeline of our AME. (a) Overall Structure. Trial Scheduler is responsible for the start, termination and suspension of trials, and collects the evaluation results. Configuration Searcher is in charge of proposing new configurations (conf.). (b) Trial Scheduler. This is an example of vanilla ASHA. A total of $n$ trials are required to be run on limited hardware devices in turn. Every trial is evaluated in each rung, with the low-performance ones terminated. In the sequential mode, the selection of candidates in each rung does not start until the training and evaluation of all trials are completed; in the parallel mode, they are carried out simultaneously. (c) Configuration Searcher. Gated Transformer-XL (GTrXL) is employed to model the relationship between different configurations for attentive sampling. Multi-head attention and memory mechanism capture the short-term and long-term relationships between evaluated configurations, respectively. After each new configuration is evaluated, configuration searcher will be trained, i.e., it is a process of online training, which is parallel to the training of trials. With continuous training, searcher gives more and more reliable suggestions. + +the new configuration by weighting the evaluated configuration. The weighting of configurations is able to generate new configurations by assigning higher weights to high-performance configurations, and explore the search space through other configurations at the same time. The introduction of the memory mechanism allows current prediction to influence subsequent ones, so that getting the suggestion of new configuration not limited by current input. + +Network Structure. In order to capture the relationships between evaluated configurations and better choose new configurations, Gated Transformer-XL (GTrXL) [42] is chosen as the searcher. GTrXL stabilizes training with a reordering of the layer normalization coupled with the addition of a gating mechanism. Under this new architecture (Fig. 2(c)), the searcher is in a position to simultaneously capture both the long-term and short-term relationships $Y_{l}$ by memory mechanism and multi-head attention to achieve attentive sampling $h_{new} = g_{ag}(\{\hat{h}_i\})$ (Eq. (3)): + +$$ +X _ {0} = \operatorname {C o n c a t} (\{E m b e d d i n g (\hat {h} _ {i}) | i = 1, 2, \dots , k \}), +$$ + +$$ +X _ {l} ^ {c} = L N (X _ {l}), X _ {l} ^ {c m} = C o n c a t \left(X _ {l} ^ {c}, X _ {l} ^ {m}\right), +$$ + +$$ +Y _ {l} = M H A t t e n t i o n \left(X _ {l} ^ {c} W ^ {Q}, X _ {l} ^ {c m} W ^ {K}, X _ {l} ^ {c m} W ^ {V}\right), \tag {4} +$$ + +$$ +X _ {l + 1} = G R U G a t i n g \left(Y _ {l}, X _ {l}\right), l = 0, 1, \dots , N - 1, +$$ + +$$ +h _ {n e w} = \operatorname {A c t o r} \left(X _ {N}\right), A = \operatorname {C r i t i c} \left(X _ {N}\right). +$$ + +where $N$ refers to the total number of multi-head attention blocks, $W^{Q}$ , $W^{K}$ , $W^{V}$ are learnable matrixes, $X_{l}^{m}$ is the memory matrix, and $A$ is the advantage value administered to assist the training of actor. Transformer-XL [8] introduces the memory mechanism to give configuration encoder + +the ability to capture long-term dependence, which is similar to the hidden state in RNN. The initial value of the memory matrix $X_{l}^{m}$ is zero, and it is updated in the form of $X_{l}^{m} = X_{l + 1}$ . The adoption of gating layer is for stabilizing the training of DRL [42]. Actor-Critic architecture is performed for decision making. + +Feature Extraction. The features of discrete hyperparameters are extracted as one-hot vectors, while continuous hyper-parameters need to be discretized first, and then represented by one-hot vectors. The features extracted from different kinds of hyper-parameters are concatenated together to form hyper-parameter configurations $h$ . In addition, indicators to measure the performance of models (e.g., Accuracy, mIoU, mAP. Normalized to [0, 1]) need to be added to the features as the last dimension. Each time a fixed number of evaluated configurations $\hat{h}$ are input for decision making. After input to the Embedding layer, they are converted from discrete vectors to continuous ones. + +# 3.3. Optimization by Bootstrap + +Deep Reinforcement Learning requires a large number of training samples to drive. Since the training of each trial is time-consuming and the feedback of evaluation results is not timely, there is a lack of samples for training, which is the reason why DRL is rarely adopted in HPO. It is inefficient to learn one-to-one mapping between images and configurations by imitating NAS [61], which is limited by the efficiency of sampling. Learning the many-to-one mapping from modeling the relationship between different configurations to propose suggestions is another more efficient way + +(see Eq. (3)). The combination of multiple configurations makes the application of bootstrap natural and reasonable. + +Bootstrap and Random Strategy. Bootstrap is a uniform sampling with replacement from the given dataset, which generates enough configurations for training from a small number of evaluated configurations. Since training the agent is inseparable from a lot of trials-and-errors, bootstrap increases the number of attempts and better overcomes the high variance problem in DRL [46]. On the other hand, during the training, generating a new configuration by agent does not return the validation in time because the new configuration may not have been evaluated. Random strategy is used to solve this problem. As the name implies, the action is not given by the agent network, but is selected from the evaluated configurations randomly, just like any configuration in the state. The number of samples is increased by bootstrap and random strategy on another level. + +Reward Function. The design of reward is related to the evaluation results of each trial. Evaluation indicators of the same trial in different rungs are unequal, so it may not be appropriate to directly employ indicators as reward. The difference between evaluation indicators is performed to construct reward function: + +$$ +\mathcal {R} = \operatorname {c l i p} \left(P _ {\mathcal {A}} - \max \left\{P _ {s} \mid s \in \mathcal {S} \right\}, - M, M\right). \tag {5} +$$ + +where $P_{\mathcal{A}}$ is the evaluation indicator (Normalized to [0, 100]) to the new configuration in action, $\max \{P_s|s \in S\}$ is the maximum evaluation indicator to the configurations in state, and $M$ is a constant threshold to prevent reward from being too large or too small. Note that the configurations disseminated to combine $(\mathcal{S}, \mathcal{A})$ are sampled from the evaluated configurations set in the same rung. Reward function encourages the agent to actively generate new configurations that exceed all input configurations in performance, and inhibits generation of low-performance ones. + +Online Training. Analogous to Bayesian Optimization, Reinforced HPO can also be modeled as a process of online training. Once trial scheduler gets the evaluation results, configuration searcher updates its parameters based on the new evaluated configurations. It is worth mentioning that the suggestions of the new configuration are able to be carried out at the same time as the training of agent. In order to strike a balance between exploration and exploitation, the choice of configurations is random during inference and training. The way of taking the top-k to predict leads to insufficient exploration. During training, the loss function of the agent $\mathcal{L}_{ag}$ adopts the form of PPO [46]: + +$$ +\mathcal {L} _ {a g} = \frac {1}{N} \sum_ {i = 1} ^ {N} \left[ \min \left(r _ {i} A _ {i}, \operatorname {c l i p} \left(r _ {i}, 1 - \varepsilon , 1 + \varepsilon\right) A _ {i}\right) \right]. \tag {6} +$$ + +where $r_i = \frac{\pi(\mathcal{A}_i|S_i)}{\pi_{old}(\mathcal{A}_i|S_i)}$ and $A_{i} = A(S_{i},\mathcal{A}_{i}),\varepsilon$ is a constant, and $A_{i}$ is the advantage value, calculated by the critic. PPO + +Algorithm 1 Attention and Memory Enhancement (AME) +Input: Configuration Search Space $\mathcal{H}$ , Evaluated Configu +uration Set $\mathcal{H}_E$ ,Unevaluated Configuration Set $\mathcal{H}_U$ +Configuration with Evaluation Indicator $\hat{h}$ +Output: New Configuration h +1: function CONFSEARCHER(·) // Reward R, Action A, +State S, The number of input conf. k, A constant $\rho$ +2: if Need a new configuration then +3: if $|\mathcal{H}_E|\leq \rho k$ $(\rho \geq 1)$ then +4: Randomly sample $h$ from H. Add h to $\mathcal{H}_U$ +5: else +6: Randomly sample $\hat{h_1},\hat{h_2},\dots ,\hat{h_k}$ from $\mathcal{H}_E$ +7: $h = g_{ag}(\{\hat{h_1},\hat{h_2},\dots ,\hat{h_k}\})$ .Add h to $\mathcal{H}_U$ +8: end if +9: else if Get an evaluated conf. & $|\mathcal{H}_E| > \rho k$ then +10: Randomly sample $\hat{h_0},\hat{h_1},\dots ,\hat{h_k}$ from $\mathcal{H}_E$ +11: Calculate $\mathcal{R}$ with $h_0$ as $\mathcal{A},\hat{h_1},\hat{h_2},\dots ,\hat{h_k}$ as S. +12: Training Agent with loss $\mathcal{L}_{ag}$ +13: end if +14: end function + +hopes to ensure the monotonic improvement of strategy $\pi$ after the network parameters are updated with a few batches, while keeping the difference in the probability distribution of the old and new strategies within a certain range. + +# 3.4. Implementation Details + +AME is an asynchronous algorithm that combines Deep Reinforcement Learning with ASHA (see Alg. 1). For each trial, trial scheduler sends it to different trial queues according to its current stage. If the hardware device is idle, trial scheduler will select a configuration from the unevaluated configuration set $\mathcal{H}_U$ to run. When the trial has been evaluated, trial scheduler decides whether to terminate it according to evaluation result. There is no need to wait for all trials to end training and evaluation in the current rung to start training in the next rung, i.e., training and evaluation in different rungs are parallel. As for configuration searcher, generating a new configuration is the inference of agent, and the acquisition of each evaluated configuration promotes online model training. If the number of evaluated samples is insufficient, a random strategy will be adopted to generate a new configuration instead of model selection. During the training, bootstrap and random strategy are applied to solve the problem of insufficient training samples. Training samples are not limited to those in the first rung, as long as new configurations are still needed. Since reward function (see Eq. (5)) is based on the difference of two indicators, samples obtained in different rungs are enabled to be performed to train the same agent. Note that configurations in each combination must be sampled from the same rung. + +
Vision TaskHeadLearning RateBackboneBatch SizeOptimizerWeight Decay
Classification-{0.001, [0.005:0.005:0.1]}ResNet18, 34, 50[8:4:64]SGD, Adam, Adamax, Adagrad, Adadelta{1e-5, [0:5e-5:0.001]}
DetectionCascadeRCNN [4], FoveaBox [27], RetinaNet [34], FasterRCNN [45], RepPoints [54], ATSS [56], FSAF [60][0.001:0.001:0.025]ResNet50 [15], ResNeXt50 [52], ResNeSt50 [55][4:2:12]
SegmentationGCNet [5], DeepLabv3+ [6], DANet [13], CCNet [19], FCN [36], PSPNet [58], PSANet [59][0.001:0.001:0.020]
+ +Table 1. Search Space. The continuous hyper-parameters are discretized into the form of [start:step:end]. In the 100,000-level search space, finding the optimal hyper-parameter configuration under limited resources is an extremely difficult problem. + +
Task MethodCIFAR-10 (Cls.)CIFAR-100 (Cls.)Stanford Cars (Cls.)VOC (Det.)VOC (Seg.)
Search (Acc)Time (day)Retrain (Acc)Search (Acc)Time (day)Retrain (Acc)Search (Acc)Time (day)Retrain (Acc)Search (mAP)Time (day)Retrain (mAP)Search (mIoU)Time (day)Retrain (mIoU)
PBT [22]93.5 ± 0.61.894.375.1 ± 0.41.875.687.3 ± 0.52.988.179.1 ± 0.54.479.674.7 ± 0.43.175.3
PB2 [45]93.8 ± 0.42.194.375.6 ± 0.32.076.187.4 ± 0.43.287.879.4 ± 0.34.779.974.9 ± 0.33.275.2
BayesOpt [43]94.1 ± 0.51.094.875.5 ± 0.31.175.887.0 ± 0.41.687.679.3 ± 0.42.579.775.2 ± 0.51.575.9
Dragonfly [24]94.5 ± 0.41.495.176.8 ± 0.41.477.488.1 ± 0.42.688.580.1 ± 0.33.580.575.7 ± 0.32.176.2
ZOOpt [36]94.6 ± 0.31.195.176.5 ± 0.21.276.888.3 ± 0.31.888.780.5 ± 0.32.681.075.9 ± 0.31.776.3
BO-TPE [2]93.0 ± 0.71.193.675.4 ± 0.51.175.987.0 ± 0.62.187.679.6 ± 0.62.780.274.7 ± 0.51.775.2
SMAC [20]93.3 ± 0.61.294.075.8 ± 0.41.276.287.3 ± 0.52.288.079.8 ± 0.52.780.375.1 ± 0.41.875.8
Hyperband (HB) [31]93.2 ± 0.92.494.274.4 ± 1.02.475.386.4 ± 0.92.887.580.2 ± 0.84.081.275.0 ± 0.73.375.9
BOHB [12]93.1 ± 0.82.394.076.6 ± 0.52.377.387.1 ± 0.72.787.980.4 ± 0.74.280.975.2 ± 0.63.475.8
ASHA [32]93.8 ± 1.00.994.575.5 ± 0.81.076.387.7 ± 0.71.888.579.9 ± 1.02.480.875.5 ± 0.81.576.5
AME (Ours)95.5 ± 0.31.195.977.8 ± 0.21.178.189.5 ± 0.32.089.981.2 ± 0.32.681.876.7 ± 0.31.677.1
+ +Table 2. Performance comparison of different searchers. Since PBT, PB2, BayesOpt, Dragonfly, ZOOpt are not able to optimize discrete hyper-parameters (e.g., head, backbone, optimizer and batch size), only the continuous selections of learning rate and weight decay are considered under the default setting of other hyper-parameters (the best configuration given by AME). The average performance and time of search results are shown in Search and Time, respectively. The results after retraining with the optimal hyper-parameters are shown in Retrain. The experiments are set on three tasks: image classification (Cls.), object detection (Det.) and semantic segmentation (Seg.). + +# 4. Experiments + +# 4.1. Datasets and Settings + +Datasets. In order to verify the effectiveness of AME, the experiments of image classification are set up on CIFAR10/100 [29] and Standford Cars [28], with the average Accuracy (Acc Top-1) as the evaluation indicator. CIFAR10/100 consists of 50,000 training images and 10,000 test images in 10/100 classes, and Standford Cars contains 8,144 training images and 8,041 test images in 196 classes. The experiments of object detection and semantic segmentation are set up on PASCAL VOC [10, 11]. As for detection, VOC0712 consists of 16,551 training images, 4,952 test images in 20 classes, with the mean Average Precision (mAP) as the evaluation indicator. As for segmentation, VOC2012+Aug consists of 13,495 training images, 1,449 test images in 20 classes, with the mean Intersection over Union (mIoU) as the evaluation indicator. + +Settings. Our experiments are implemented based on Ray Tune [33], which is a python library for hyper-parameter tuning. Eight Nvidia Tesla V100 GPUs are used in experiments. All experimental results are averaged after repeating several times. For classification, the maximum number of configurations $n$ is set to 500, and the maximum budget $R$ is set to 200 epochs in Sec. 3.1 and Eq. (2). For detection, $n$ is set to 80 and $R$ is set to 20. For segmentation, $n$ is set to 80 and $R$ is set to 36. Besides, reduction factor $\eta$ is set to 2 in Eq. (2), the minimum budget $r$ is set to 1 epoch in Eq. (2), the number of input configurations $k$ is set to 10 in Eq. (3) and Alg. 1, the number of multi-head attention blocks + +$N$ is set to 2 in Fig. 2 and Eq. (4), $M$ is set to 5 in Eq. (5), $\varepsilon$ is set to 0.2 in Eq. (6), and $\rho$ is set to 1.5 in Alg. 1. As shown in Tab. 1, there are five kinds of hyper-parameters in the search space of classification: backbone, learning rate, optimizer type, weight decay and batch size. The hyperparameter that is required to be searched in detection and segmentation also includes the head of the network. + +# 4.2. Performance Analysis + +The foremost novelties of this paper are to propose a new type of configuration searcher and an efficient training strategy for it. For fair comparison, the performances of various types of searchers are shown in Tab. 2, Fig. 3 and Fig. 4. + +Adaptability to Diverse Tasks. As revealed by Tab. 2, AME shows better performance than other HPO algorithms in all three vision tasks. Specifically, the performances of AME reached $95.5\%$ , $77.8\%$ , $89.5\%$ in image classification, $81.2\%$ in object detection, $76.7\%$ in semantic segmentation, which are significantly higher than other HPO algorithms. Compared with object detection and semantic segmentation, gradient back-propagation in the training process of classification is more stable attributable to the simpler optimization goal. This also indicates that the performances of networks in detection and segmentation are more sensitive to the choice of hyper-parameters during the training process. The improvement brought by our algorithm in detection and segmentation does not exceed that in classification. The reason lies in that the value of $n$ in detection and segmentation is smaller, which will be analyzed in Sec. 4.3. In short, our algorithm is in a position to be effectively applied + +![](images/8944f9d905bce8ee9cf2e29d760475c2bac126cbc1edcfe67a4913ce8f6cf7d3.jpg) +Figure 3. Performance comparison of four algorithms in three vision tasks. The abscissa represents time-related round of performance reports, and the ordinate represents performance. Total number of rounds is simultaneously affected by the maximum number of configurations to be evaluated $n$ and the maximum number of rungs $\lfloor \log_{\eta}(R / r) \rfloor$ (see Eq. (2)). + +![](images/fc721a0d5a518dc96dc9058a7b2f9e11041cef185e01b71bc789ccfe7b36a784.jpg) + +![](images/8b18af07cec59d0cce5323cd2b87008b000a7a8255c4c804284aa4558d186a4a.jpg) + +![](images/6e891ee614455a829b092c5397d1dbd9710a31164857ab4e889d199dbb1713a5.jpg) + +to visual tasks with various sensitivity levels. + +Comparison to Other Algorithms. Although random-search-based methods, e.g., ASHA, are fast, they are unstable (Tab. 2). They have $2.3\%$ (Hyperband) and $1.7\%$ (ASHA) lower in accuracy than AME on classification tasks (CIFAR-10). The reason for the poor performance lies in the fact that the relationship between different configurations is not considered when suggestions of new configurations are given. As a representative of Bayesian Optimization, BOHB $(93.1\%, 76.6\%, 87.1\%, 80.4\%, 75.2\%)$ only achieves similar performance with random methods, such as Hyperband $(93.2\%, 74.4\%, 86.4\%, 80.2\%, 75.0\%)$ , even if the relationship between configurations is considered. This situation is because of the strong assumptions in Bayesian optimization that have restrictions on the search space. Evolutionary algorithms, including PBT and PB2, are $2.0\%$ and $1.7\%$ lower than AME in accuracy (CIFAR-10), even if the search space is limited, i.e., only learning rate and weight decay are required to be searched. + +Efficiency. The performance comparison curves of four methods are plotted in Fig. 3. In terms of speed, the parallel methods (ASHA, AME) are faster than the sequential ones (BOHB, Hyperband). It can be observed that random-search-based ASHA is the fastest in three tasks, followed by AME. This fact proves that the use of bootstrap and random strategy is able to effectively accelerate the training process of reinforcement learning. Moreover, the curve of ASHA fluctuates and the performance is unstable (see, Fig. 3(d)), so ASHA may not be able to search for the optimal configuration. In AME, the introduction of attentive sampling has brought a stable performance improvement. + +Average Quality of Configurations. The performance of the four algorithms at each rung is visualized in Fig. 4. In order to better focus on the performance difference, a relative form is adopted instead of an absolute form to visualize. It can be seen that the configurations selected by AME have the relatively highest average performance among all rungs. This shows that our proposed transformer-structure agent is capable of locating the high-performance hyper-parameter configurations in a huge search space, by learning the re + +![](images/fa9a22e6fef8cebea2878face9acb07bab9fbc94efce2441d97317e504e0946b.jpg) + +![](images/a134934e929026451e271d82c21cdcdcb64e775fa4638b150a0bbb6528596340.jpg) +Figure 4. Performance comparison of four algorithms in each rung. Each bar means the average performance of all trials of the corresponding algorithm in the current rung. The zero line refers to the average performance of the four algorithms. The bar charts represent the difference of each algorithm relative to the average. + +![](images/2a83b43cf6a04c15103853d7ad7b01c39ed57c3b28359b17e210fd7e772e5959.jpg) + +relationship between configurations. It is worth mentioning that the earlier rung during the training process, the greater the advantage of AME, which means that our AME is conducive to the rapid screening of high-performance configurations in the early stage. + +# 4.3. Ablation Study + +Several ablation experiments are set up on image classification for in-depth analysis of AME, as shown in Fig. 5. + +Components of Configuration Searcher. In order to verify the effectiveness of GTrXL in our AME, the components of the configuration searcher are disassembled for experiments, as can be seen in Tab. 3. Experiments prove that the attention module and the memory module improve the accuracy rate of $0.8\%$ and $0.7\%$ , respectively. The experimental results demonstrate that capturing long-term and short-term relationships together facilitates searcher to provide more high-performance configurations for trial scheduler. + +Different Configuration Searcher. As shown in Tab. 4, in order to remove the influence of the scheduler, the trained searchers (GTrXL in AME, TPE in BOHB) are taken out separately for comparative experiments with the same input. Although random search does not depend on the input, + +
Components of SearcherSchedulerC10C100Cars
Naive FCAttentionMemory
XXASHA94.176.387.9
XASHA95.176.988.7
ASHA95.577.889.5
HB95.477.489.3
+ +Table 3. Experiments on model structure of AME. C10: CIFAR-10. C100: CIFAR-100. Cars: Standford Cars. HB: Hyperband. + +
Different SearchersC10C100Cars
Input76.860.671.5
GTrXL (AME)87.270.581.4
TPE (BOHB)85.968.079.7
Random76.160.971.0
+ +Table 4. Experiments on different searchers with the same input. + +
ClipCalculationC10C100Cars
XMax95.277.789.3
Max95.577.889.5
Mean94.476.888.7
+ +Table 5. Experiments on reward function in AME. + +
Number of Input Conf.k=5k=10k=20
CIFAR-1095.395.594.9
CIFAR-10077.277.877.0
Standford Cars88.989.589.0
+ +it is also selected as a benchmark. In the average results of multiple experiments, it can be found that both AME and BOHB can effectively and stably select better new configurations, and AME is higher than BOHB in accuracy. + +Different Trial Scheduler. The new searcher proposed in this paper can not only be combined with ASHA, but also with other schedulers (see Tab. 3), e.g., Hyperband. Hyperband is a two-layer loop, one layer is to choose different combinations of $(n,r)$ , and the other is to perform SHA for each combination. As a sequential method, AME (Hyperband) also achieves comparable performance to AME (ASHA), but the speed is not as fast as AME (ASHA). + +Indicator Calculation in Reward Function. The design of the reward function in Eq. (5) is crucial. Therefore, an ablation experiment on the indicator calculation of $\{P_s|s\in S\}$ is set, revealed by Tab. 5. Experimental results show that using the maximum is better than the mean of $1.0\%$ accuracy, i.e., if the reward function is designed to be more demanding, it has more accurate guidance on capturing the relationship for attentive sampling. The strong restriction with the maximum as threshold on reward function suppresses the negative effects of poor initialization. + +Whether to Clip in Reward Function. Although the application of bootstrap and random strategy helps the agent train efficiently, it also makes the training samples noisy. The setting of $M$ in Eq. (5) is to prevent reward from being too large or too small from negatively affecting the training. The experimental results in Tab. 5 tell us that such truncation is useful. The clip operation in reward function brings performance improvement of $0.2\%$ . + +Number of Input Configurations $k$ . As shown in Tab. 6, experiments are set up to determine the optimal number of + +Table 6. Experiments on number of input configurations in AME. + +
Total Number of Conf.n = 500n = 200n = 80
Hyperband93.293.193.0
BOHB93.193.493.2
ASHA93.893.893.9
AME (Ours)95.595.494.3
+ +Table 7. Experiments on total number of configurations (C10). + +![](images/c9422b6f6232a1c03f0f0c5ef391ea61db710e582fae84c5376df4190ca44ad9.jpg) +Figure 5. Performance comparison in ablation studies of AME (C10). (a) Results in Tab. 3, Tab. 5. (b) Results in Tab. 6, Tab. 7. Base: AME algorithm with default settings, described in Sec. 4.1. + +![](images/abca4614b1d1c7fca889f15f855f5846cd51e08d38aa6c958ad5a5e3d376d3c1.jpg) + +input configurations for the agent. Experiments prove that the value of $k$ is set to 10 as the most appropriate. Both too few and too many input configurations result in a decrease in performance. The appropriate number of configurations allows the agent to accurately achieve attentive sampling. + +Total Number of Configurations $n$ . Since the training of searcher in AME is modeled as online learning, the total number of configurations $n$ has a huge impact on it and directly determines whether the training of searchers is sufficient. The results in Tab. 7 show that when $n$ is reduced, the performance of AME drops sharply, and they eventually degenerate into random search. BOHB, Hyperband and ASHA are much less sensitive to changes in $n$ than our algorithm. This also explains why the performance improvements on detection and segmentation of AME are lower than that on classification, revealed by Fig. 3 and Tab. 2. + +# 5. Conclusions + +In this paper, an innovative parallel and asynchronous HPO model AME is proposed under the framework of deep reinforcement learning, enhancing the ability to capture both the short-term and long-term relationships to achieve attentive sampling. Bootstrap and random strategy are applied to solve the problem of an insufficient number of samples, which enable the training of searcher to be carried out efficiently. Experiments prove the efficiency of AME on three vision tasks, including classification, detection, and segmentation. Future work will focus on extending AME to more visual and non-visual tasks. + +# Acknowledgments + +This research was supported by the National Key Research and Development Program of China under Grant No. 2018AAA0100400, and the National Natural Science Foundation of China under Grants 62071466, 62076242, and 61976208. + +# References + +[1] A.G. Baydin, R. Cornish, D.M. Rubio, M. Schmidt, and F. Wood. Online learning rate adaptation with hypergradient descent. *ICLR*, 2018. 2 +[2] J. Bergstra, R. Bardenet, Y. Bengio, and B. Kégl. Algorithms for hyper-parameter optimization. In NeurIPS, 2011. 2 +[3] J. Bergstra and Y. Bengio. Random search for hyperparameter optimization. JMLR, 13(2), 2012. 2 +[4] Z. Cai and N. Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR, 2018. 3, 6 +[5] Y. Cao, J. Xu, S. Lin, F. Wei, and H. Hu. Genet: Non-local networks meet squeeze-excitation networks and beyond. In ICCV, 2019. 3, 6 +[6] L.C. Chen, Y. Zhu, G. Papandreou, F. Schroff, and H. Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In ECCV, 2018. 3, 6 +[7] E.D. Cubuk, B. Zoph, D. Mane, V. Vasudevan, and Q.V. Le. Autoaugment: Learning augmentation strategies from data. In CVPR, 2019. 2 +[8] Z. Dai, Z. Yang, Y. Yang, J. Carbonell, Q.V. Le, and R. Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. In ACL, 2019. 4 +[9] T. Domhan, J.T. Springenberg, and F. Hutter. Speeding up automatic hyperparameter optimization of deep neural networks by extrapolation of learning curves. In *IJCAI*, 2015. +[10] M. Everingham, SM.A. Eslami, L. Van Gool, C.KI. Williams, J. Winn, and A. Zisserman. The pascal visual object classes challenge: A retrospective. *IJCV*, 111(1):98–136, 2015. 6 +[11] M. Everingham, L. Van Gool, C.KI. Williams, J. Winn, and A. Zisserman. The pascal visual object classes (voc) challenge. IJCV, 88(2):303-338, 2010. 6 +[12] S. Falkner, A. Klein, and F. Hutter. Bohb: Robust and efficient hyperparameter optimization at scale. In ICML, 2018. 2 +[13] J. Fu, J. Liu, H. Tian, Y. Li, Y. Bao, Z. Fang, and H. Lu. Dual attention network for scene segmentation. In CVPR, 2019. 3, 6 +[14] D. Golovin, B. Solnik, S. Moitra, G. Kochanski, J. Karro, and D. Sculley. Google vizier: A service for black-box optimization. In SIGKDD, 2017. 2 +[15] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. 3, 6 +[16] Y. He, J. Lin, Z. Liu, H. Wang, L. Li, and S. Han. Amc: Automl for model compression and acceleration on mobile devices. In ECCV, 2018. 2 +[17] Y.Q. Hu, Y. Yu, W.W. Tu, Q. Yang, Y. Chen, and W. Dai. Multi-fidelity automatic hyper-parameter tuning via transfer series expansion. In AAAI, 2019. 2 +[18] Y. Huang, Y. Li, Z. Li, and Z. Zhang. An asymptotically optimal multi-armed bandit algorithm and hyperparameter optimization. arXiv preprint arXiv:2007.05670, 2020. 2 +[19] Z. Huang, X. Wang, L. Huang, C. Huang, Y. Wei, and W. Liu. Ccnet: Criss-cross attention for semantic segmentation. In ICCV, 2019. 3, 6 + +[20] F. Hutter, H.H. Hoos, and K. Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In LION, 2011. 2 +[21] F. Itano, M.A.A. de Sousa, and E. Del-Moral-Hernandez. Extending mlp ann hyper-parameters optimization by using genetic algorithm. In IJCNN, 2018. 2 +[22] M. Jaderberg, V. Dalibard, S. Osindero, W.M. Czarnecki, J. Donahue, A. Razavi, O. Vinyls, T. Green, I. Dunning, K. Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09846, 2017. 2, 3 +[23] K. Jamieson and A. Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In AISTATS, 2016. 2 +[24] K. Kandasamy, K.R. Vysyaraju, W. Neiswanger, B. Paria, C.R. Collins, J. Schneider, B. Poczos, and E.P. Xing. Tuning hyperparameters without grad students: Scalable and robust bayesian optimisation with dragonfly. JMLR, 21(81):1-27, 2020. 2 +[25] Z. Karnin, T. Koren, and O. Somekh. Almost optimal exploration in multi-armed bandits. In ICML, 2013. 2 +[26] A. Klein, S. Falkner, J.T. Springenberg, and F. Hutter. Learning curve prediction with bayesian neural networks. In ICLR, 2017. 2 +[27] T. Kong, F. Sun, H. Liu, Y. Jiang, L. Li, and J. Shi. Fove-xyz: Beyond anchor-based object detection. IEEE TIP, 29:7389-7398, 2020. 3, 6 +[28] J. Krause, M. Stark, J. Deng, and L. Fei-Fei. 3d object representations for fine-grained categorization. In ICCVW, 2013. 6 +[29] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. Technical Report, 2009. 6 +[30] H.C.L. Law, P. Zhao, L. Chan, J. Huang, and D. Sejdinovic. Hyperparameter learning via distributional transfer. In NeurIPS, 2019. 2 +[31] L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. JMLR, 18(1):6765-6816, 2017. 2 +[32] L. Li, K. Jamieson, A. Rostamizadeh, E. Gonina, M. Hardt, B. Recht, and A. Talwalkar. A system for massively parallel hyperparameter tuning. In MLSys, 2020. 2, 3 +[33] R. Liaw, E. Liang, R. Nishihara, P. Moritz, J.E. Gonzalez, and I. Stoica. Tune: A research platform for distributed model selection and training. In ICMLW, 2018. 6 +[34] T.Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar. Focal loss for dense object detection. In ICCV, 2017. 3, 6 +[35] S. Liu, X. Sun, P.J. Ramadge, and R.P. Adams. Task-agnostic amortized inference of gaussian process hyperparameters. In NeurIPS, 2020. 2 +[36] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. 3, 6 +[37] P.R. Lorenzo, J. Nalepa, M. Kawulok, L.S. Ramos, and J.R. Pastor. Particle swarm optimization for hyper-parameter selection in deep neural networks. In GECCO, 2017. 2 +[38] J. Lorraine, P. Vicol, and D. Duvenaud. Optimizing millions of hyperparameters by implicit differentiation. In AISTATS, 2020. 2 + +[39] W. Ma, T. Tian, H. Xu, Y. Huang, and Z. Li. Aabo: Adaptive anchor box optimization for object detection via bayesian sub-sampling. In ECCV, 2020. 2 +[40] D. Maclaurin, D. Duvenaud, and R. Adams. Gradient-based hyperparameter optimization through reversible learning. In ICML, 2015. 2 +[41] V. Mnih, K. Kavukcuoglu, D. Silver, A.A. Rusu, J. Veness, M.G. Bellemare, A. Graves, M. Riedmiller, A.K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015. 2 +[42] E. Parisotto, F. Song, J. Rae, R. Pascanu, C. Gulcehre, S. Jayakumar, M. Jaderberg, R.L. Kaufman, A. Clark, S. Noury, et al. Stabilizing transformers for reinforcement learning. In ICML, 2020. 2, 4 +[43] J. Parker-Holder, V. Nguyen, and S.J. Roberts. Provably efficient online hyperparameter optimization with population-based bandits. In NeurIPS, 2020. 2 +[44] F. Pedregosa. Hyperparameter optimization with approximate gradient. In ICML, 2016. 2 +[45] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: towards real-time object detection with region proposal networks. IEEE TPAMI, 39(6):1137-1149, 2016. 3, 6 +[46] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. 2, 5 +[47] A. Shaban, C.A. Cheng, N. Hatch, and B. Boots. Truncated back-propagation for bilevel optimization. In AISTATS, 2019. 2 +[48] J. Snoek, H. Larochelle, and R.P. Adams. Practical bayesian optimization of machine learning algorithms. In NeurIPS, 2012. 2 +[49] N. Srinivas, A. Krause, S.M. Kakade, and M. Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. In ICML, 2010. 2 + +[50] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A.N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In NeurlPS, 2017. 2 +[51] CFJ. Wu and M.S. Hamada. Experiments: planning, analysis, and optimization, volume 552. John Wiley & Sons, 2011. 2 +[52] S. Xie, R. Girshick, P. Dollar, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In CVPR, 2017. 3, 6 +[53] L. Yang and A. Shami. On hyperparameter optimization of machine learning algorithms: Theory and practice. Neurocomputing, 415:295-316, 2020. 1 +[54] Z. Yang, S. Liu, H. Hu, L. Wang, and S. Lin. Reppoints: Point set representation for object detection. In ICCV, 2019. 3, 6 +[55] H. Zhang, C. Wu, Z. Zhang, Y. Zhu, Z. Zhang, H. Lin, Y. Sun, T. He, J. Mueller, R. Manmatha, et al. Resnest: Split-attention networks. arXiv preprint arXiv:2004.08955, 2020. 3, 6 +[56] S. Zhang, C. Chi, Y. Yao, Z. Lei, and S.Z. Li. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In CVPR, 2020. 3, 6 +[57] X. Zhang, X. Chen, L. Yao, C. Ge, and M. Dong. Deep neural network hyperparameter optimization with orthogonal array tuning. In ICONIP, 2019. 2 +[58] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. In CVPR, 2017. 3, 6 +[59] H. Zhao, Y. Zhang, S. Liu, J. Shi, C.C. Loy, D. Lin, and J. Jia. Pisanet: Point-wise spatial attention network for scene parsing. In ECCV, 2018. 3, 6 +[60] C. Zhu, Y. He, and M. Savvides. Feature selective anchor-free module for single-shot object detection. In CVPR, 2019, 3, 6 +[61] B. Zoph and Q.V. Le. Neural architecture search with reinforcement learning. In ICLR, 2016. 2, 4 \ No newline at end of file diff --git a/ameattentionandmemoryenhancementinhyperparameteroptimization/images.zip b/ameattentionandmemoryenhancementinhyperparameteroptimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3f16cd23daaf42430f292c2ed1ac55d32eed175e --- /dev/null +++ b/ameattentionandmemoryenhancementinhyperparameteroptimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7ea1bf354c6d1a4839b33e08761e5ed2665c054fdc9ecd6bed10b9535ef1d4e +size 480854 diff --git a/ameattentionandmemoryenhancementinhyperparameteroptimization/layout.json b/ameattentionandmemoryenhancementinhyperparameteroptimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fd719e6c9c3b3fd5e72e9d71553b32a88bdca4d1 --- /dev/null +++ b/ameattentionandmemoryenhancementinhyperparameteroptimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86a3a121442eeaf09fa4fb6baed66efbae5ca3bb7eb892468cf8617f71a55e16 +size 442856 diff --git a/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_content_list.json b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f79496d45a16d1888d89047d163e20c85d224569 --- /dev/null +++ b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7eff207e31ca81e98c914a458fc874d1efddbc2439e8728a4e01a9c4d8ba331e +size 75673 diff --git a/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_model.json b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1af833ea83b180cafc82b05670c9b5b6738386ed --- /dev/null +++ b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e55046303c866834d26ce20f3fc1392bc1777f18a6665c4be0d181874c89e3b +size 94757 diff --git a/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_origin.pdf b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..62173f6828143ec354399e8452a05093ebe4edfe --- /dev/null +++ b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/2e829c89-73c3-4e32-b563-bb3d3e5c418f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:760995bfd867259c9c5ec43b21b15e22dff539881d2646c28c9731736f001707 +size 1656652 diff --git a/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/full.md b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d3524ed9a28e03be14c5b0b7ae7ee4804bb1dc2d --- /dev/null +++ b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/full.md @@ -0,0 +1,318 @@ +# AP-BSN: Self-Supervised Denoising for Real-World Images via Asymmetric PD and Blind-Spot Network + +Wooseok Lee $^{1}$ Sanghyun Son $^{1}$ Kyoung Mu Lee $^{1,2}$ $^{1}$ Dept. of ECE & ASRI, $^{2}$ IPAI, Seoul National University +adntjr4@gmail.com, {thstkdgus35, kyoungmu}@snu.ac.kr + +# Abstract + +Blind-spot network (BSN) and its variants have made significant advances in self-supervised denoising. Nevertheless, they are still bound to synthetic noisy inputs due to less practical assumptions like pixel-wise independent noise. Hence, it is challenging to deal with spatially correlated real-world noise using self-supervised BSN. Recently, pixel-shuffle downsampling (PD) has been proposed to remove the spatial correlation of real-world noise. However, it is not trivial to integrate PD and BSN directly, which prevents the fully self-supervised denoising model on real-world images. We propose an Asymmetric PD (AP) to address this issue, which introduces different PD stride factors for training and inference. We systematically demonstrate that the proposed AP can resolve inherent trade-offs caused by specific PD stride factors and make BSN applicable to practical scenarios. To this end, we develop AP-BSN, a state-of-the-art self-supervised denoising method for real-world sRGB images. We further propose random-replacing refinement, which significantly improves the performance of our AP-BSN without any additional parameters. Extensive studies demonstrate that our method outperforms the other self-supervised and even unpaired denoising methods by a large margin, without using any additional knowledge, e.g., noise level, regarding the underlying unknown noise. + +# 1. Introduction + +Image denoising is one of the essential topics in the computer vision area, which aims to recover a clean image from the noisy signal. Due to its practical usage in several vision-related applications, several learning-based denoising algorithms [28, 36, 43, 44] have been proposed with the advent of convolutional neural networks (CNNs). Conventional methods usually adopt additive white Gaussian noise (AWGN) to acquire large-scale training data by synthesizing clean-noisy image pairs for supervised learning. Never + +![](images/76e5a871fdc00b11ba3ef0ec741fb00ba6ec68fc1b31e0b44d5d36522518a412.jpg) +(a) DnCNN [43] (Supervised) + +![](images/cec693edf06548d8f7ed4d32bee79011638e00d327b147c9766906c442575fbc.jpg) +(b) C2N [19] + DIDN [40] (Unpaired) + +![](images/bb7efe97a3ee4452476581dbf5b521660187f13ff7b908d4b964636b7cf6ce01.jpg) +(c) NAC [39] (Self-supervised) + +![](images/c1f1a728882367237a61e44712051753dea3cf951a897b0ef391b18e64c36a2a.jpg) +(d) $\mathbf{AP - BSN} + \mathbf{R}^3$ (Ours) (Self-supervised) +Figure 1. Visual comparison between different denoising methods on the DND benchmark [34]. (a) DnCNN is trained on real-world noisy-clean pairs from the SIDD [1] dataset. (b) C2N uses clean SIDD [1] and noisy DND [34] samples to simulate real-world noise distribution in an unsupervised manner. (c-d) Self-supervised methods can be trained on the DND [34] noisy images directly. We mark PSNR(dB) and SSIM with respect to the ground-truth clean image for the quantitative comparison. + +theless, models learned on the synthetic noise do not generalize well in practice since the characteristics of real-world noise differ much from AWGN. To overcome the limitation, several attempts have been made to construct pairs of real-world datasets like SIDD [1] and NIND [4]. Using the real-world training pairs, supervised denoising methods [8, 16, 21, 41, 42] can be trained to restore clean images from the noisy real-world input. However, constructing the real-world dataset requires massive human labor, strictly controlled environments, and complicated post-processing. In addition, it is difficult to generalize the learned model toward diverse practical scenarios as the characteristic of noise varies much for the different capturing devices. + +Recently, several self-supervised approaches [3, 17, 23, 24, 31, 38, 39] have been introduced, which do not rely on paired training data. Such methods require noisy images only for training instead of clean-noisy pairs. Among them, Blind-Spot Network (BSN) [23] is one of the representative methods motivated by Noise2Noise [25]. Under the assumption that noise signals are pixel-wise independent and zero-mean, BSN reconstructs a clean pixel from the neighboring noisy pixels without referring to the corresponding input pixel. Based on BSN, several approaches [15, 24, 37] have achieved better performance on synthetic noise while ensuring strict blindness w.r.t. the center pixel. However, real-world noises are known to be spatially-correlated [6, 20, 32], which does not meet the basic assumption of BSN: noise is pixel-wise independent. + +To break spatial correlation of real-world noise, Zhou et al. [45] utilize pixel-shuffle downsampling (PD). PD creates a mosaic by subsampling a noisy image with a fixed stride factor, and thereby increases an actual distance between noise signals. Nevertheless, integrating PD to BSN is nontrivial when handling real-world noise in a fully self-supervised manner, where it cannot stand alone without knowledge from additional noisy-clean synthetic pairs [37]. We identify that the principal reason for such limitation is the trade-off between the pixel-wise independent assumption and reconstruction quality. For example, a large PD stride factor $(>3)$ ensures the strict pixel-wise independent noise assumption and benefits BSN during training. However, it also destructs detailed structures and textures from the noisy image. In contrast, a small PD stride factor $(\leq 3)$ preserves image structures but cannot satisfy the pixel-wise independent assumption when training BSN. + +Inspired by these observations, we propose Asymmetric PD (AP), which uses different stride factors for training and inference. For real-world noise, we systematically validate that a specific combination of training and inference strides can compensate shortcomings of each other. Then, we integrate AP to BSN (AP-BSN), which can learn to denoise noisy real-world inputs in a fully self-supervised manner, without requiring any prior knowledge of underlying noise. Furthermore, we propose random-replacing refinement $(\mathbf{R}^3)$ , a novel post-processing method that improves the performance of our AP-BSN without any additional training. To the best of our knowledge, our AP-BSN is the first attempt to introduce self-supervised BSN for real-world sRGB noisy images. Extensive studies demonstrate that our method outperforms not only the state-of-the-art self-supervised denoising methods but also several unsupervised/unpaired approaches by a large margin. We summarize our contributions as follows: + +- To handle spatially correlated real-world noise in a blind fashion, we propose a novel self-supervised AP-BSN. Our framework employs asymmetric PD stride factors for + +training and inference in conjunction with BSN. + +- We propose random-replacing refinement $(\mathbf{R}^3)$ , a novel post-processing method that further improves our APBSN without any additional parameters. +- Our AP-BSN is the first self-supervised BSN that covers real-world sRGB noisy inputs and outperforms the other self-supervised and even several unpaired solutions by large margins. + +# 2. Related Work + +Deep image denoising for synthetic noise. Beyond the classical non-learning based approaches [2, 9, 12, 18], DnCNN [43] has introduced a CNN-based architecture to remove AWGN from a given image. Following DnCNN, several learning-based approaches have been proposed such as FFDNet [44], RED30 [28], and MemNet [36], with advanced network architectures. Nevertheless, the methods trained on AWGN suffer from generalization toward the real-world denoising due to domain discrepancy between real and synthetic noises. Specifically, Guo et al. [13] have demonstrated that AWGN-based denoisers do not perform well when input noise signals are signal-dependent [10] or spatially-correlated [6, 20, 32]. + +Real-world image denoising. To reduce the gap between synthetic and real-world denoising, CBDNet [13] simulates in-camera ISP with gamma correction and demosaicking process. Then, synthetic heteroscedastic Gaussian noise can be transformed into realistic noise signals, which can be used to generate training pairs for supervised learning. Zhou et al. [45] have proposed pixel-shuffle down-sampling (PD) to cover spatially-correlated real-world noise with conventional AWGN denoisers. In contrast, there have been a few attempts to capture the noisy-clean training pairs from real-world [1, 4]. Using the real-world pairs, it is straightforward to train supervised denoising methods [8, 16, 21, 41, 42], which generalize well on the corresponding real-world inputs. However, constructing real-world pairs require huge labor and is not always available. + +Unpaired image denoising. When sets of unpaired clean and real-world noisy images are available, several methods leverage generative approaches [11] to synthesize realistic noise from the clean samples [5, 7, 14, 19]. Among them, GCBD [7] selectively uses plain regions from noisy images for stable learning. Recently, C2N [19] explicitly considers various noise characteristics to simulate real-world noise more accurately. Using the generated noisy-clean pairs, the following supervised denoising model [40, 43] can be trained to deal with real-world noise. On the other hand, Wu et al. [37] distill knowledge from a self-supervised denoising model while adopting synthetic noisy-clean pairs. Still, it is important to match the scene statistics of clean and noisy datasets even in the unpaired configuration [19], which can be difficult in practice. + +Self-supervised denoising. A major bottleneck for real-world denoising is the absence of appropriate training data. Therefore, several approaches have been proposed to train their model using noisy images only. Motivated by Noise2Noise [25], Noise2Void [23] and Noise2Self [3] have introduced novel self-supervised learning frameworks by masking a portion of noisy pixels from the input image. Notably, the concept of BSN [23] has been later extended to more efficient architectures in the form of four halved receptive fields [24] or dilated and masked convolutions [37]. While Noise2Same [38] does not use BSN, a novel loss term is used to satisfy $\mathcal{J}$ -invariant property [3] in the denoising network. Neighbor2Neighbor [17], on the other hand, acquires the noisy-noisy pair for self-supervision by subsampling the given input. Nevertheless, the above self-supervised methods heavily rely on assumptions that noise signals are pixel-wise independent. Therefore, they usually end up learning identity mappings when applied to real-world sRGB images as noise signals are spatially-correlated [6, 20, 32]. + +Recent Noisier2Noise [29], NAC [39], and R2R [31] add different synthetic noise signals to the given input to make auxiliary training pairs. However, Noisier2Noise requires prior knowledge regarding the underlying noise distribution, and Noisy-As-Clean relies on weak noise assumptions. R2R also requires several prior information such as noise level and ISP function, which may not be available in real-world scenarios. + +# 3. BSN and PD + +Blind-spot network. BSN [23] is a variant of the conventional CNN that does not see the center pixel in the receptive field to predict the corresponding output pixel. Several studies [3, 23] have demonstrated that BSN $B(\cdot)$ can learn to denoise a noisy image $\mathrm{I_N} \in \mathbb{R}^{H \times W}$ in a self-supervised manner. We note that the image has a resolution of $H \times W$ , and color channels are omitted for simplicity. To train BSN, the following two assumptions must be satisfied: noise is spatially, i.e., pixel-wise, independent and zero-mean. Under such assumptions, it is known [3, 38] that minimizing the self-supervised loss $\mathcal{L}_{\mathrm{self}}$ w.r.t. BSN is equivalent to conventional supervised learning as follows: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {s e l f}} = \mathbb {E} _ {\mathrm {I} _ {\mathrm {N}}} \| B (\mathrm {I} _ {\mathrm {N}}) - \mathrm {I} _ {\mathrm {N}} \| _ {2} ^ {2} \tag {1} \\ = \mathbb {E} _ {\mathbf {I} _ {\mathrm {N}}, \mathrm {I} _ {\mathrm {C}}} \| B (\mathbf {I} _ {\mathrm {N}}) - \mathbf {I} _ {\mathrm {C}} \| _ {2} ^ {2} + c = \mathcal {L} _ {\text {s u p e r}} + c, \\ \end{array} +$$ + +where $\mathrm{I_C} \in \mathbb{R}^{H \times W}$ is a clean ground-truth for the noisy input $\mathrm{I_N}$ , $\mathcal{L}_{\mathrm{super}}$ is a supervised denoising loss function, and $c$ is a constant, respectively. + +Therefore, several types of BSN [24, 37] are constructed under the pixel-wise independent noise assumption. However, real-world noise is spatially correlated due to the image signal processors (ISP). Specifically, demosaicking on + +![](images/709feab31be0d30d78a7afd90c42100f3b1f837d1cfc88fa4f77587a9fb264d5.jpg) +(a) By relative distances $d$ + +![](images/d3775ba9673e55bd1af39358e6ea1dd0a0f5fd4d0c7406019b3ebb7bbd7d3b6d.jpg) +(b) By relative locations +Figure 2. Analysis of spatial correlation on real-world noise. (a) As the relative distance $d$ between two noise signals increases, their correlation decreases. We note that different camera devices, e.g., Motorola Nexus 6 (N6) or LG G4, in the SIDD [1] dataset show similar noise behaviors in terms of spatial correlation, as illustrated with dotted lines. (b) $x$ and $y$ axis represent a relative distance along with horizontal and vertical directions, respectively. + +Bayer filter [6, 20, 32] involves interpolation between noisy subpixels. Fig. 2 demonstrates that in real-world, noise intensities between neighboring pixels show non-negligible correlation based on their relative distance. Since the neighboring noise signals can be clues for inferring the unseen center pixel, we have identified that BSN operates as an approximately identity mapping on real-world sRGB images. + +Pixel-shuffle downsampling. Zhou et al. [45] have introduced a novel concept of PD to break down the spatial correlation in the real-world noise. Specifically, $\mathrm{PD}_s$ can be regarded as an inverse operation of the pixel-shuffling [35] with a stride factor of $s$ . Since real-world noise signals are correlated with few neighboring pixels, subsampling in PD process may break the dependency between them. Then, conventional denoising algorithms can be applied to the downsampled images, where the PD-inverse operation $\mathrm{PD}_s^{-1}$ follows to reconstruct a full-sized output. To preserve image textures and details, Zhou et al. [45] set the stride factor to 2, i.e. $\mathrm{PD}_2$ , for the best performance. + +# 4. Method + +Our goal is to generalize BSN on real-world sRGB images in a self-supervised manner. To this end, we adopt PD and minimize the following loss $\mathcal{L}_{\mathrm{BSN}}$ to train BSN: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {B S N}} = \left\| \mathrm {P D} _ {s} ^ {- 1} \left(B \left(\mathrm {P D} _ {s} \left(\mathrm {I} _ {\mathrm {N}}\right)\right)\right) - \mathrm {I} _ {\mathrm {N}} \right\| _ {1} \tag {2} \\ = \left\| \mathbf {I} _ {\mathrm {B S N}} ^ {s} - \mathbf {I} _ {\mathrm {N}} \right\| _ {1}, \\ \end{array} +$$ + +where $\mathrm{I}_{\mathrm{BSN}}^s$ is an output from $\mathrm{PD}_s$ and BSN pipeline, namely $\mathbf{P}\mathbf{D}_s$ -BSN. Instead of widely-used $L^2$ loss, we use $L^1$ norm for better generalization [26]. In brief, we first decompose the given noisy image $\mathrm{I_N}$ into $s^2$ sub-images. We note that $\mathrm{PD}_s(\mathrm{I_N})$ is a tiling of those sub-images [45] $\mathrm{I}_{\mathrm{sub}}^s\in \mathbb{R}^{H / s\times W / s}$ , as shown in Fig. 4. Then, we apply BSN to the sub-images and reconstruct the output $\mathrm{I}_{\mathrm{BSN}}^s$ using the PD-inverse operation $\mathrm{PD}_s^{-1}$ . + +![](images/0d315dae183e7829b893bdbb110b6e53c4225d14ba46de629d362c3594358e92.jpg) +(a) Real-world noisy image $\mathrm{I_N}$ + +![](images/588b5aad2865a7c7b738b11f64b35210d7734b3b724a76c9cc79dbc3af38e0e0.jpg) +(b) Clean image $\mathrm{I_C}$ + +![](images/db5dc8673f1c7162dd9e89f25ab7efb4ff971e7e16399c21a01a705b72e0e48a.jpg) +(c) $\mathrm{PD}_2$ -BSN + +![](images/3eb5d9bdeacb78a05945b84442cc48b254cf3be4a1ce0b0a6c3e06fdf0462171.jpg) +(d) $\mathrm{PD}_5$ -BSN + +![](images/2c43b54f329961176cccf2567ca3d78370192b9d9a8ffd33f21bf2bd7e3ff013.jpg) +(e) Zhou et al. [45] +Figure 3. Issues on $\mathbf{PD}_s$ -BSN when handling real-world noise. (c) With a small stride factor, PD-BSN cannot remove noise from the input $\mathrm{I_N}$ . (d) With a large stride factor, PD-BSN destructs edge structures. (e) When AWGN denoiser meets PD [45], the model cannot completely remove real-world noise. (f) Our self-supervised approach delivers an accurate denoising result by overcoming the limitation of combining PD and BSN. + +![](images/e3e4b730653c2d327d68d762a84e895463cb24dab51ad4b2a84304b75672123b.jpg) +(f) $\mathbf{AP - BSN} + \mathbf{R}^3$ (Ours) + +However, it is not straightforward to apply PD-BSN directly on real-world sRGB images. While Wu et al. [37] have also tried to integrate PD and BSN, they resort to knowledge distillation combined with additional synthetic noisy-clean pairs. We have also observed that PD-BSN is not applicable to real-world noisy images when trained with the self-supervised loss in Eq. (2). Figs. 3c and 3d demonstrate that $\mathrm{PD}_2$ -BSN and $\mathrm{PD}_5$ -BSN cannot restore a clean and sharp image from the given noisy input, regardless of the PD stride factor $s$ . + +# 4.1. Trade-offs in PD-BSN + +When applying the AWGN-based denoiser on real-world images, Zhou et al. [45] use $\mathrm{PD}_2$ . However, we have observed that PD exhibits different behaviors as the stride factor $s$ varies. Therefore, we first describe two important aspects of PD-BSN regarding the stride factor $s$ . + +Breaking spatial correlation. Originally, PD has been proposed to reduce spatial correlation between neighboring noise signals in real-world images. While Zhou et al. [45] resort to the stride factor of 2, our analysis in Fig. 2a demonstrates that the stride factor should be at least 5 to minimize the dependency in the given noise signal. In other words, noise signals in the sub-images $\mathrm{I}_{\mathrm{sub}}^2$ are still spatially cor + +![](images/dc74fd2ae23f26366433a8287f973370884e4239a6322f515c6f20da17323ee4.jpg) +Figure 4. Comparison between $\mathbf{PD}_2$ and $\mathbf{PD}_5$ . Each operation decomposes the given image into 4 and 25 sub-images, respectively. In sub-images from $\mathbf{PD}_5$ , we mark the aliasing artifact, i.e. a black dot, with red, which can be interpreted as noise for BSN. We note that the artifact does not appear in the blue sub-image. + +related, where the pixel-wise independent noise assumption for BSN does not hold. + +Al aliasing artifacts. Nevertheless, the sub-images $\mathrm{I}_{\mathrm{sub}}^s$ from $\mathrm{PD}_s$ suffer stronger degree of aliasing as the stride factor $s$ becomes larger. From the perspective of signal processing, it is well-known that a downsampled image suffers aliasing when the original signal is not properly bandlimited [30]. Since the PD process does not leverage a low-pass filter before subsampling, we have identified that aliasing occurs as a form of noise when applying large-stride PD, e.g., $s = 5$ , as shown in Fig. 4. + +# 4.2. Effective training stride factor for PD-BSN + +We next establish a strategy to train $\mathrm{PD}_s$ -BSN. For such purpose, the correlation between noise signals in the training input images $\mathrm{I_N}$ has to be minimized [23]. However, as discussed in Section 4.1, $\mathrm{PD}_2$ is not enough to break spatial correlation of real-world noise. Since the underlying assumption of BSN is not satisfied, the model cannot learn to denoise with $\mathrm{PD}_2$ . By setting $s = 5$ to suppress the spatial correlation between noise signals in training samples, we can train BSN on the smaller sub-images $\mathrm{I}_{\mathrm{sub}}^5$ . + +We note that BSN also learns to remove the aliasing artifacts induced by the large PD stride factor. The aliasing happens when high-frequency signals are not removed before subsampling [30]. As the high-frequency components change rapidly in the original noisy image $\mathrm{I_N}$ , we can ignore the spatial correlation of aliasing artifacts in the sub-images $\mathrm{I_{sub}^5}$ . The artifacts also satisfy the zero-mean constraint, i.e., their statistical mean is approximately the same as that of the noisy image $\mathrm{I_N}$ , since they are random samples of the observed signal. As the aliasing artifacts satisfy two preconditions of BSN, our PD-BSN also learns to remove them. + +# 4.3. Asymmetric PD for BSN + +Several studies [7, 19] have already identified that matching data distribution between training and test samples play a critical role in accurate image denoising. Therefore, it is + +![](images/3e9d9de69042bf6db0d185fe3904fc20de06cdff6eb2223bffe2bfaaf0402890.jpg) +Figure 5. Overview of the proposed AP-BSN and $\mathbf{R}^3$ post-processing. We visualize the proposed $\mathrm{AP}_{5/2}$ -BSN. To apply BSN on real-world sRGB images, we introduce $\mathrm{AP}_{a/b}$ to maximize synergies of using different stride factors for training and inference. We use a large stride factor, e.g., $a = 5$ , to ensure pixel-wise independence between noise signals for training. During the inference, we use a minimum stride factor of $b = 2$ to avoid aliasing artifacts while breaking down the spatial correlation of noise to some extent. Our random-replacing refinement $(\mathbb{R}^3)$ further improves the performance of AP-BSN without any additional parameters. + +natural to use the same stride factor for training and inference when applying PD-BSN. However, we have found that the learned BSN recognizes aliasing artifacts from $\mathrm{PD}_5$ as noise signals to be removed during inference. Since those artifacts contain necessary information to reconstruct high-frequency details, $\mathrm{PD}_5$ -BSN destructs image structures during inference while removing noise as shown in Fig. 3d. + +Instead, we propose an asymmetric stride factor during the inference of PD-BSN, which we refer to as Asymmetric PD $(\mathrm{AP}_{a / b})$ . We note that $a$ and $b$ are stride factors for training and inference, respectively. Specifically, we set $b = 2$ so that the sub-images $\mathrm{I}_{\mathrm{sub}}^2$ contain minimum aliasing artifacts during inference, while the correlation between neighboring noise signals can be decreased. In Section 5, we demonstrate how each trade-off, i.e., spatial correlation and aliasing artifacts, affects the denoising performance of our method. Our BSN with the proposed $\mathrm{AP}_{5 / 2}$ (AP-BSN) can learn to remove real-world noise in a self-supervised manner, while preserving image structures as shown in Fig. 3f. We also note that our AP-BSN does not require any clean samples for training and is directly applicable to sRGB noisy images in practical scenarios. Fig. 5 illustrates our asymmetric training and inference schemes for AP-BSN. + +# 4.4. Random-replacing refinement + +Even with the smallest stride factor, PD and the following denoising step may remove some informative high-frequency components from the input, resulting in visual artifacts [45]. Therefore, Zhou et al. [45] propose PD-refinement to suppress artifacts from the PD process and enhance details of the denoising result. In PD-refinement, + +![](images/9966888aa6cbd0c94c89b799ac466da5f7ce2c6522b047b557a4398b0acb33e4.jpg) +Figure 6. Comparison between PD-refinement and our $\mathbf{R}^3$ . While PD-refinement adopts regular binary masks $\mathcal{M}_i$ with a stride of 2, our $\mathbf{R}^3$ uses randomized masks $\mathcal{R}_i$ . (a) We compare the expected spatial correlation of noise signals in the replaced image $\mathrm{I}_{\mathcal{M}_i}$ and $\mathrm{I}_{\mathcal{R}_i}$ . (b) Each gray box represents a pixel from the original noisy image $\mathrm{I_N}$ , which replaces the denoised pixel in $\mathrm{I}_{\mathrm{BSN}}^s$ . + +an $i$ -th replaced image $I_{\mathcal{M}_i}$ is formulated as follows: + +$$ +\mathrm {I} _ {\mathcal {M} _ {i}} = \mathcal {M} _ {i} \odot \mathrm {I} _ {\mathrm {N}} + (\mathbf {1} - \mathcal {M} _ {i}) \odot \mathrm {I} _ {\mathrm {B S N}} ^ {s}, \tag {3} +$$ + +where $\mathcal{M}_i\in \{0,1\}^{H\times W}$ is a binary mask indicating pixels to be replaced and $\odot$ denotes element-wise multiplication. Here, $\mathcal{M}_i$ is a structured binary matrix where ones are placed with a fixed stride of 2 and $\sum_{i}\mathcal{M}_{i} = 1$ . After the replacement, each image $I_{\mathcal{M}_i}$ is denoised again and averaged to reconstruct the final result $\mathrm{I_{DN}}$ as follows: + +$$ +\mathrm {I} _ {\mathrm {D N}} = \frac {1}{T} \sum_ {i = 1} ^ {T} D \left(\mathrm {I} _ {\mathcal {M} _ {i}}\right), \tag {4} +$$ + +where $D$ is the denoising model targeting pixel-wise independent noise and $T$ is the number of masks, i.e., $2^{2} = 4$ , for the original PD-refinement. + +However, the deterministic strategy in PD-refinement leaves a non-negligible correlation between the replaced noise signals. Specifically, a replaced noisy pixel in $\mathbf{I}_{\mathcal{M}_i}$ is always correlated with some of its neighbors, as visualized in Fig. 6a. Such correlation negatively affects the performance of the following denoising method $D$ , which assumes spatially uncorrelated noise. Therefore, we propose an advanced random-replacing refinement $(\mathbf{R}^3)$ strategy to mitigate the limitation of PD-refinement. + +In our $\mathbb{R}^3$ , we adopt $T$ randomized binary masks $\mathcal{R}_i$ instead, which are defined as follows: + +$$ +\mathcal {R} _ {i} (x, y) = \left\{ \begin{array}{l l} 1, & \text {w i t h a p r o b a b i l i t y o f} p, \\ 0, & \text {o t h e r w i s e}, \end{array} \right. \tag {5} +$$ + +where $(x,y)$ denotes an index of the element in a $H\times W$ matrix. For Eq. (3) and Eq. (4), we adopt the randomized mask $\mathcal{R}_i$ rather than the fixed one $\mathcal{M}_i$ to acquire the final output. Since noisy pixels are randomly placed in the $i$ -th replaced image $\mathrm{I}_{\mathcal{R}_i}$ , an expected correlation between two noise signals is multiplied by $p$ , as shown in Fig. 6a. Hence, our $\mathbb{R}^3$ significantly reduces the expected correlation compared to the previous PD-refinement. When we combine $\mathbb{R}^3$ with AP-BSN, we do not perform PD and feed the replaced image $\mathrm{I}_{\mathcal{R}_i}$ to BSN directly because spatial correlation of noise in the input is almost negligible. Fig. 6 highlights major differences between PD-refinement and our $\mathbb{R}^3$ . + +# 5. Experiment + +# 5.1. Experimental configurations + +Dataset. To train and evaluate our AP-BSN, we adopt widely-used real-world image denoising datasets: SIDD [1] and DND [34]. SIDD-Medium consists of 320 real-world noisy and clean image pairs for training. For validation and performance evaluation, we adopt SIDD validation and benchmark datasets, respectively. Both contain 1,280 noisy patches with a size of $256 \times 256$ , where the corresponding clean images are also provided for the validation set. + +The DND dataset does not include training images and consists of 50 real-world noisy inputs only for evaluation. Rather than using the SIDD-Medium training dataset for this case, we enjoy the advantage of a fully self-supervised learning framework and use the same data for training and performance evaluation. In other words, we train our APBSN on 50 noisy DND images and reconstruct the final denoising results from the same inputs. + +Metric. To evaluate our AP-BSN and compare it with the other denoising methods, we introduce widely-used peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) metrics. For SIDD and DND benchmarks, we upload our results to the evaluation sites to calculate the metrics. On the SIDD validation dataset, we use the cor + +![](images/9dce919557ac30e9b82c8a19004cc450b56bee52e58adeeb36f7d09691ef3b5a.jpg) +(a) Effects of asymmetric $a / b$ + +![](images/e74909e65b65cbfba8b8ba9cd2a1eee00c6d07ff65d85a566867e5926fa46ab6.jpg) +(b) Effects of aliasing artifacts + +![](images/3ea7e5c876b80028f47b2a7f792cbdecf2e578953cb446cb3a4ff8472513481b.jpg) +Figure 7. Ablation study of $\mathbf{AP}_{a / b}$ -BSN on the SIDD validation dataset. We note that the proposed $\mathbb{R}^3$ post-processing is not applied in these ablation studies. (a) Our $\mathrm{AP}_{a / b}$ -BSN consistently achieves the best performance when $b = 2$ . (b) We validate $\mathrm{AP}_{5 / b}$ -BSN on two representative images displayed in Figs. 8a and 8b. + +![](images/db2f6eef707d0ac6abf39cab06e48f8c7ce1b3a7c8f9bbcf14e888184aa49fd5.jpg) +(b) Textured region + +![](images/d3afd9083486f7888c9fb44b9e9b7fada39bbcc1a893ea9bc30e063a1aa88bad.jpg) +(a) Plain region + +![](images/812881ff8cbea35537c59115af18fac74b15a4ba122d58608e82c1fad93c9496.jpg) +(c) $\mathrm{AP}_{5 / 1}$ (d) $\mathrm{AP}_{5 / 2}$ (e) $\mathrm{AP}_{5 / 5}$ +(f) $\mathrm{AP}_{5 / 1}$ (g) $\mathrm{AP}_{5 / 2}$ (h) $\mathrm{AP}_{5 / 5}$ +Figure 8. Visual comparison of the trade-off in $\mathbf{AP}_{a / b}$ -BSN. (c-e) For a plain region in (a), performance of AP-BSN gradually increases as the inference stride factor $b$ becomes larger. (f-h) For a textured region in (b), AP-BSN performs the best when $b = 2$ but shows decreased performance for larger $b$ . Please refer to Fig. 7b for more details. + +responding functions in skimage.metrics library and RGB color space for comparison. + +Implementation and optimization. We use PyTorch 1.9.0 [33] for implementation. By default, we adopt $\mathrm{AP}_{5/2}$ and set $p$ and $T$ to 0.16 and 8, respectively, for the proposed $\mathbf{R}^3$ . For BSN, we modify the architecture from Wu et al. [37] for efficiency. AP-BSN is trained using Adam [22] optimizer, and the initial learning rate starts from $10^{-4}$ . More details are described in our supplementary material. + +# 5.2. Analyzing Asymmetric PD + +We first validate the effect of AP for real-world sRGB denoising. To this end, we conduct an extensive study on all possible combinations of feasible stride factors, i.e., $a \in \{2,3,4,5,6\}$ and $b \in \{1,2,3,4,5,6\}$ , in Fig. 7a. We note that BSN cannot be trained when $a = 2$ due to the spatial correlation of real-world noise. With larger training stride factors $a$ , the input noise of BSN follows pixel-wise independent assumption more strictly. Therefore, the model can learn the denoising function better, where the performances are maximized with $a = 5$ . When $a = 6$ is used, + +
MethodSIDDDND
PSNR†(dB)SSIM†PSNR†(dB)SSIM†
Non-learning basedBM3D [9]25.650.68534.510.851
WNNM [12]25.780.80934.670.865
Supervised (Synthetic pairs)DnCNN [43]23.660.58332.430.790
CBDNet [13]33.280.86838.050.942
Zhou et al. [45]34.00°0.898°38.400.945
Supervised (Real pairs)DnCNN [43]35.13°0.896°37.89°0.932°
AINDNet (R)* [21]38.840.95139.340.952
VDN [41]39.260.95539.380.952
DANet [42]39.430.95639.580.955
Unsupervised (Unpaired)GCBD [7]--35.580.922
C2N [19] + DIDN* [40]35.350.93737.280.924
D-BSN [37] + MWCNN [27]--37.930.937
Self-supervisedNoise2Void [23]27.68R0.668R--
Noise2Self [3]29.56R0.808R--
NAC [39]--36.200.925
R2R [31]34.780.898--
AP-BSN (Ours)34.900.90037.460.924
AP-BSN + R3 (Ours)35.970.92538.090.937
AP-BSN† + R3 (Ours)36.910.931--
+ +Table 1. Quantitative comparison of various denoising methods on the SIDD and DND benchmarks. We note that several supervised methods leverage SIDD noisy-clean pairs for training and perform much better than our AP-BSN, while we use noisy sRGB images only for training. By default, we report official evaluation results from SIDD and DND benchmark websites. $\diamond$ and $\mathbf{R}$ indicate that the performances are evaluated by ourselves, or reported from R2R [31], respectively. We also mark methods with $*$ which adopt self-ensemble strategy [26]. $\dagger$ denotes that the model is trained on SIDD benchmark images in a fully self-supervised fashion. + +$\mathrm{AP}_{6 / b}$ -BSN performs slightly worse since the noise in the SIDD [1] dataset show increasing correlation as shown in Fig. 2a. Interestingly, $a = 6$ is slightly better than $a = 5$ on the NIND [4] dataset, as the correlation gradually decreases w.r.t. to the relative distance between pixels. More analysis on the NIND dataset is reported in our supplementary material. During the inference, BSN cannot remove real-world noise without PD, i.e., $b = 1$ , as it is learned on pixel-wise independent noise. The performances are maximized when $b = 2$ , as the trade-off between spatial correlation and aliasing can be optimized. With larger inference stride factors, i.e., $b > 2$ , AP-BSN performs worse because more image details are removed in the form of aliasing artifacts. + +In Fig. 7b, we justify that the existence of aliasing artifacts is a critical factor for our denoising framework. When applying $\mathrm{AP}_{5 / b}$ -BSN to the plain region illustrated in Fig. 8a, the model performs better as the inference stride factor $b$ becomes larger. Since the region does not contain high-frequency information, aliasing artifacts do not appear in Figs. 8c, 8d, and 8e. Rather, the spatial correlation of noise signals becomes smaller with a larger $b$ , which results in better performance. For a general image in Fig. 8b, our $\mathrm{AP}_{5 / b}$ -BSN shows a similar behavior to that of Fig. 7a, while the performance drop is much severe due to the stronger aliasing artifacts as shown in Fig. 8h. + +![](images/9e899b9fceba6d6df21161d30bec2380e2687c06505faa213eabeb6f9ee6c078.jpg) +Figure 9. Ablation study of AP-BSN + $\mathbf{R}^3$ on the SIDD validation dataset. We note that AP-BSN without $\mathbf{R}^3$ achieves 34.86dB on the same dataset. (a) We investigate the effect of different $p$ for $T = 2, 4, 8$ . (b) We fix $p = 0.16$ to see the effect of $T$ in our $\mathbf{R}^3$ . + +![](images/9a84a891b48615d46fbe73930158aa8cb78db8fcc4267998b15ad28179167aba.jpg) + +# 5.3. Analyzing Random-Replacing Refinement + +Fig. 9 shows a detailed ablation study on hyperparameters for the proposed $\mathbf{R}^3$ . We first set $T = 2,4,8$ to find the optimal replacement probability $p$ . As shown in Fig. 9a, our $\mathbf{R}^3$ shows a consistent behavior where the maximum performance is achieved with $p \approx 0.16$ . We note that a larger $p$ increases the expected spatial correlation of noise signals which degrades the performance. Due to the stochastic behavior, the number of randomized masks $T$ is not limited in our $\mathbf{R}^3$ , while PD-refinement can only use $T = 4$ . Fig. 9b demonstrates that the proposed $\mathbf{R}^3$ performs better than PD-refinement even with $T = 2$ , and the performance increases as the number of randomized masks $T$ goes higher. Since + +![](images/1c63c9440c9419d2bc0ac93f5df9fbf66dc6ab83565c4818f02908fa910ca768.jpg) + +![](images/ebe3f3a9fe5147c9b8b4cc6442c304146fcbd997094de58dc910670abdb1302d.jpg) +(a) DnCNN [43] +bervised - Real SI + +![](images/096cbfa84cd7bf4fa8d42ffaea4feea0d63ba275a8fff1c079261ece99768e99.jpg) + +![](images/309f1db456ddf4913848c7f2c139169ac073f89f7a9ce9ff26464e6c14f816e3.jpg) +(b) Zhou et al. [45] Supervised - Synthetic noise + +![](images/50691540c033491f62c5ca56df4120bde505cdd4fdf90b048bf7e09b5aa0d013.jpg) + +![](images/4e04a2610631d0b0b01280faa512a47f0786cf472ad69a6e6cb696749b8c9684.jpg) +(c) C2N [19] + DIDN [40] Unpaired +Figure 10. Qualitative comparison between different denoising methods on DND [34] and SIDD [1] benchmarks. (a) DnCNN is trained on the paired SIDD-Medium dataset. (b) Zhou et al. train their method on synthetic AWGN and impulse noise. The learned denoising model is then combined with PD to handle real-world noise. (c) C2N generates a realistic noisy image from the clean input, where the following denoising model, i.e., DIDN, is trained on the generated pairs. (d-e) Recent self-supervised approaches are trained on noisy images only. (f) Our method is directly learnable on the practical sRGB images. We note that the DND benchmark (Upper) provides per-sample PSNR/SSIM, while SIDD benchmark (Lower) does not, i.e., Not available. + +![](images/d4748b66c97fbb07bedd7d47cc04ece96389d6df9927a416edd220fd6da9082a.jpg) +(d) NAC [39] + +![](images/62655d49d9fc9cd678b34c1002a9b14c3152bb02740f2228c35ebe49e0fe0985.jpg) +(e) R2R [31] Self-supervised + +![](images/27d8ad7a376935791769b3a956b7a20fbb6f0e5690f818828cc56c2678e78454.jpg) + +![](images/ad615c87a334ff7e483ad04c32c745ef6870f0e470c515b81dc78525871a85c9.jpg) +(f) AP-BSN + R³ (Ours) Self-supervised + +the computational complexity of $\mathbf{R}^3$ is proportional to $T$ , we set $T = 8$ to balance the performance and runtime. + +# 5.4. AP-BSN for real-world denoising + +Our AP-BSN aims to denoise real-world sRGB images in a self-supervised manner. Table 1 compares various image denoising models on widely-used SIDD and DND benchmark datasets. Using noisy images only for training, the proposed AP-BSN $+\mathbb{R}^3$ achieves the best performance among several unpaired [19, 37] and selfsupervised approaches. Especially, we note that selfsupervised NAC [39] and R2R [31] are constructed on less practical assumptions like noise level is weak or ISP function is known. On the other hand, our approach adopts BSN with several observations regarding the properties of PD and real-world noise. Therefore, we do not rely on specific assumptions and show better generalization on several real-world datasets. In addition, the proposed $\mathbb{R}^3$ postprocessing further improves the evaluation PSNR more than 1dB on the SIDD benchmark track without any additional parameters. Fig. 10 provides visual comparisons between several methods addressed in Table 1. + +Furthermore, AP-BSN can be trained on noisy samples directly, without using any clean images. Since several un-/self-supervised methods are trained on auxiliary images [31] or generated noise [19], the discrepancy between training and test distributions may result in sub-optimal solutions. In contrast, our approach can use target sRGB noisy images directly during training phase. To validate the merit of our framework, we train AP-BSN on the SIDD bench + +mark and evaluate on the same dataset. The last row of Table 1 shows that the fully self-supervised strategy improves the denoising performance by about 1dB without making any modifications. Although SIDD-Medium contains about $\times 60$ more pixels than the benchmark split, such an improvement highlights that AP-BSN can also generalize well on practical cases where there exist noisy test samples only. + +# 6. Conclusion + +In this paper, we first identify several trade-offs regarding different PD stride factors in perspective of BSN. Rather than directly integrate PD and BSN, we propose asymmetric PD between training and inference to satisfy pixel-wise independent assumption while preserving image details. To this end, we propose AP-BSN, a fully self-supervised approaches for real-world denoising. We also propose random-replacing refinement $\mathbf{R}^3$ , which removes visual artifacts of AP-BSN without any additional parameters. The proposed AP-BSN + $\mathbf{R}^3$ does not require any prior knowledge on real-world noise and outperforms recent self-supervised/unsupervised denoising methods. + +# Acknowledgment + +This work was supported in part by IITP grant funded by the Korea government (MSIT) [No. 2021-0-01343, Artificial Intelligence Graduate School Program (Seoul National University), and No.2021-0-02068, Artificial Intelligence Innovation Hub] + +# References + +[1] Abdelrahman Abdelhamed, Stephen Lin, and Michael S Brown. A high-quality denoising dataset for smartphone cameras. In CVPR, 2018. 1, 2, 3, 6, 7, 8 +[2] Michal Aharon, Michael Elad, and Alfred Bruckstein. K-SVD: An algorithm for designing overcomplete dictionaries for sparse representation. IEEE TSP, 54(11):4311-4322, 2006. 2 +[3] Joshua Batson and Loic Royer. Noise2Self: Blind denoising by self-supervision. In ICML, 2019. 2, 3, 7 +[4] Benoit Brummer and Christophe De Vleeschouwer. Natural image noise dataset. In CVPR Workshops, 2019. 1, 2, 7 +[5] Sungmin Cha, Taeon Park, and Taesup Moon. GAN2GAN: Generative noise learning for blind image denoising with single noisy images. In ICLR, 2021. 2 +[6] Priyam Chatterjee, Neel Joshi, Sing Bing Kang, and Yasuyuki Matsushita. Noise suppression in low-light images through joint denoising and demosaicing. In CVPR, 2011. 2, 3 +[7] Jingwen Chen, Jiawei Chen, Hongyang Chao, and Ming Yang. Image blind denoising with generative adversarial network based noise modeling. In CVPR, 2018. 2, 4, 7 +[8] Shen Cheng, Yuzhi Wang, Haibin Huang, Donghao Liu, Haoqiang Fan, and Shuaicheng Liu. NBNet: Noise basis learning for image denoising with subspace projection. In CVPR, 2021. 1, 2 +[9] Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Image denoising by sparse 3-D transform-domain collaborative filtering. IEEE TIP, 16(8):2080-2095, 2007. 2, 7 +[10] Alessandro Foi, Mejdi Trimeche, Vladimir Katkovnik, and Karen Egiazarian. Practical Poissonian-Gaussian noise modeling and fitting for single-image raw-data. IEEE TIP, 17(10):1737-1754, 2008. 2 +[11] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. 2 +[12] Shuhang Gu, Lei Zhang, Wangmeng Zuo, and Xiangchu Feng. Weighted nuclear norm minimization with application to image denoising. In CVPR, 2014. 2, 7 +[13] Shi Guo, Zifei Yan, Kai Zhang, Wangmeng Zuo, and Lei Zhang. Toward convolutional blind denoising of real photographs. In CVPR, 2019. 2, 7 +[14] Zhiwei Hong, Xiaocheng Fan, Tao Jiang, and Jianxing Feng. End-to-end unpaired image denoising with conditional adversarial networks. In AAAI, 2020. 2 +[15] David Honzátko, Siavash A Bigdeli, Engin Türetken, and L Andrea Dunbar. Efficient blind-spot neural network architecture for image denoising. In SDS, 2020. 2 +[16] Xiaowan Hu, Ruijun Ma, Zhihong Liu, Yuanhao Cai, Xiaole Zhao, Yulun Zhang, and Haoqian Wang. Pseudo 3D auto-correlation network for real image denoising. In CVPR, 2021. 1, 2 +[17] Tao Huang, Songjiang Li, Xu Jia, Huchuan Lu, and Jianzhuang Liu. Neighbor2Neighbor: Self-supervised denoising from single noisy images. In CVPR, 2021. 2, 3 + +[18] Samuel Hurault, Thibaud Ehret, and Pablo Arias. EPLL: an image denoising method using a Gaussian mixture model learned on a large set of patches. IPOL, 8:465-489, 2018. 2 +[19] Geonwoon Jang, Wooseok Lee, Sanghyun Son, and Kyoung Mu Lee. C2N: Practical generative noise modeling for real-world denoising. In ICCV, 2021. 1, 2, 4, 7, 8 +[20] Qiyu Jin, Gabriele Facciolo, and Jean-Michel Morel. A review of an old dilemma: Demosaicking first, or denoising first? In CVPR Workshops, 2020. 2, 3 +[21] Yoonsik Kim, Jae Woong Soh, Gu Yong Park, and Nam Ik Cho. Transfer learning from synthetic to real-noise denoising with adaptive instance normalization. In CVPR, 2020. 1, 2, 7 +[22] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 6 +[23] Alexander Krull, Tim-Oliver Buchholz, and Florian Jug. Noise2Void-learning denoising from single noisy images. In CVPR, 2019. 2, 3, 4, 7 +[24] Samuli Laine, Tero Karras, Jaakko Lehtinen, and Timo Aila. High-quality self-supervised deep image denoising. In NeurIPS, 2019. 2, 3 +[25] Jaakko Lehtinen, Jacob Munkberg, Jon Hasselgren, Samuli Laine, Tero Karras, Miika Aittala, and Timo Aila. Noise2Noise: Learning image restoration without clean data. In ICML, 2018. 2, 3 +[26] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Young Mu Lee. Enhanced deep residual networks for single image super-resolution. In CVPR Workshops, 2017. 3, 7 +[27] Pengju Liu, Hongzhi Zhang, Kai Zhang, Liang Lin, and Wangmeng Zuo. Multi-level Wavelet-CNN for image restoration. In CVPR Workshops, 2018. 7 +[28] Xiaojiao Mao, Chunhua Shen, and Yu-Bin Yang. Image restoration using very deep convolutional encoder-decoder networks with symmetric skip connections. In NIPS, 2016. 1, 2 +[29] Nick Moran, Dan Schmidt, Yu Zhong, and Patrick Coady. Noisier2Noise: Learning to denoise from unpaired noisy data. In CVPR, 2020. 3 +[30] Alan V Oppenheim, Alan S Willsky, Syed Hamid Nawab, Gloria Mata Hernández, et al. Signals & systems. Pearson Education, 1997. 4 +[31] Tongyao Pang, Huan Zheng, Yuhui Quan, and Hui Ji. Recorrupted-to-Recorrupted: Unsupervised deep learning for image denoising. In CVPR, 2021. 2, 3, 7, 8 +[32] Sung Hee Park, Hyung Suk Kim, Steven Lansel, Manu Parmar, and Brian A Wandell. A case for denoising before demosaicking color filter array data. In ACSSC, 2009. 2, 3 +[33] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Workshops, 2017. 6 +[34] Tobias Plotz and Stefan Roth. Benchmarking denoising algorithms with real photographs. In CVPR, 2017. 1, 6, 8 +[35] 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 CVPR, 2016. 3 + +[36] Ying Tai, Jian Yang, Xiaoming Liu, and Chunyan Xu. MemNet: A persistent memory network for image restoration. In ICCV, 2017. 1, 2 +[37] Xiaohe Wu, Ming Liu, Yue Cao, Dongwei Ren, and Wangmeng Zuo. Unpaired learning of deep image denoising. In ECCV, 2020. 2, 3, 4, 6, 7, 8 +[38] Yaochen Xie, Zhengyang Wang, and Shuiwang Ji. Noise2Same: Optimizing a self-supervised bound for image denoising. In NeurIPS, 2020. 2, 3 +[39] Jun Xu, Yuan Huang, Ming-Ming Cheng, Li Liu, Fan Zhu, Zhou Xu, and Ling Shao. Noisy-As-Clean: Learning self-supervised denoising from corrupted image. IEEE TIP, 29:9316-9329, 2020. 1, 2, 3, 7, 8 +[40] Songhyun Yu, Bumjun Park, and Jechang Jeong. Deep iterative down-up CNN for image denoising. In CVPR Workshops, 2019. 1, 2, 7, 8 +[41] Zongsheng Yue, Hongwei Yong, Qian Zhao, Lei Zhang, and Deyu Meng. Variational denoising network: Toward blind noise modeling and removal. In NeurIPS, 2019. 1, 2, 7 +[42] Zongsheng Yue, Qian Zhao, Lei Zhang, and Deyu Meng. Dual adversarial network: Toward real-world noise removal and noise generation. In ECCV, 2020. 1, 2, 7 +[43] Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a Gaussian denoiser: Residual learning of deep CNN for image denoising. IEEE TIP, 26(7):3142-3155, 2017. 1, 2, 7, 8 +[44] Kai Zhang, Wangmeng Zuo, and Lei Zhang. FFDNet: Toward a fast and flexible solution for CNN-based image denoising. IEEE TIP, 27(9):4608-4622, 2018. 1, 2 +[45] Yuqian Zhou, Jianbo Jiao, Haibin Huang, Yang Wang, Jue Wang, Honghui Shi, and Thomas Huang. When AWGN-based denoiser meets real noises. In AAAI, 2020. 2, 3, 4, 5, 7, 8 \ No newline at end of file diff --git a/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/images.zip b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ddab03038cd30066757a5a76668e4a6fdda76418 --- /dev/null +++ b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e71b59e1c6b1f176f4ab99ae9d7a142d0e74e15e53afdd25d11738dc25ff00f2 +size 632559 diff --git a/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/layout.json b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9086ad5f0af18558635773d55958acffbbd6f549 --- /dev/null +++ b/apbsnselfsuperviseddenoisingforrealworldimagesviaasymmetricpdandblindspotnetwork/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29bdb10667ef5a850c0e8c5adb3a72aec74072c3ad8f05446810ead3af36ad56 +size 495975 diff --git a/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_content_list.json b/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..702324f29675a89d692fe99ab22a443645a632b9 --- /dev/null +++ b/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e37d8904b45ee6998fa25a6446713f0cad254c84ee3990629dcd90e24f8a9c1b +size 76771 diff --git a/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_model.json b/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e57ef22b71bbf6a97b11277e14f1c5e1b7cdb069 --- /dev/null +++ b/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53cbe90fae9f6a4a6f30f7f0366bf18b28b819114de7413215c4e903d7a67be4 +size 96759 diff --git a/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_origin.pdf b/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7d1d348c4e23afb7d510b3227933307e2fdd6cd1 --- /dev/null +++ b/apesarticulatedpartextractionfromspritesheets/5013a7c5-b9b5-46b0-9746-aa86ce9f44bb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86aa4a19e954a326857a42ae82476ff71001f87248584b5480d10e6015fdff3f +size 7342892 diff --git a/apesarticulatedpartextractionfromspritesheets/full.md b/apesarticulatedpartextractionfromspritesheets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fd660aa2983cd8b0e89553f2f899241e23054edb --- /dev/null +++ b/apesarticulatedpartextractionfromspritesheets/full.md @@ -0,0 +1,331 @@ +# APES: Articulated Part Extraction from Sprite Sheets + +Zhan Xu $^{1,2}$ Matthew Fisher $^{2}$ Yang Zhou $^{2}$ Deepali Aneja $^{2}$ Rushikesh Dudhat $^{1}$ Li Yi $^{3}$ Evangelos Kalogerakis $^{1}$ $^{1}$ University of Massachusetts Amherst $^{2}$ Adobe Research $^{3}$ Tsinghua University + +# Abstract + +Rigged puppets are one of the most prevalent representations to create 2D character animations. Creating these puppets requires partitioning characters into independently moving parts. In this work, we present a method to automatically identify such articulated parts from a small set of character poses shown in a sprite sheet, which is an illustration of the character that artists often draw before puppet creation. Our method is trained to infer articulated parts, e.g. head, torso and limbs, that can be re-assembled to best reconstruct the given poses. Our results demonstrate significantly better performance than alternatives qualitatively and quantitatively. Our project page https://zhan-xu.github.io/parts/ includes our code and data. + +# 1. Introduction + +Creating rich, animated characters has traditionally been accomplished by independently drawing each frame of the character. To accelerate this process, tools have been developed to allow precisely rigged 2D characters to be easily rendered in different poses by manipulating the rig. To create these rigs, artists often start by drawing several different poses and configurations of the complete character in a sprite sheet or turnaround sheet. They then manually segment out the common parts in these sheets and stitch them together to create the final character rig, which can then be articulated to reconstruct the original character drawings [23]. The obtained parts from different sprite sheets can also be used as assets and assembled freely to create new character rigs1. + +Significant expertise is required to create a well-rigged 2D character, and automatic rigging methods have several unique challenges. Animated characters can have a wide range of different limbs, accessories, and viewing angles, which prevents a single template from working across all characters. Furthermore, the amount of available examples for rigged, animated characters is relatively small when compared against real datasets that can be acquired by motion capture or other techniques. This limited data is particularly challenging to work with because characters are + +![](images/0c4ffc01aeac4bb36277777a721a715e6174f664ebd44a70aaa7c793542203c2.jpg) +Figure 1. Given sprite sheets as input (a), APES produces articulated parts (b) that can best express poses in the sprite sheets. The obtained parts can further be warped to generate new poses (c), or manipulated freely to create new puppets. + +often drawn and animated in different styles. Finally, poses shown in sprite sheets have both articulated variation and non-rigid deformation. Extracting articulated parts that express given poses requires effective analysis of the motion demonstrated in sprite sheets. + +We propose a method to automatically construct a 2D character rig from a sprite sheet containing a few examples of the character in different poses. Our rig is represented as a set of deformable layers [50], each capturing an articulated part. We assume that all characters in the sprite sheet can be reconstructed by applying a different deformation to each puppet layer and then compositing the layers together. We start by learning a deep network that computes correspondences between all pairs of sprites. We then use these correspondences to compute possible segmentations of each sprite. Finally, we attempt to reconstruct the other sprites in the sprite sheet using the possible puppet segmentations, choosing the set with minimal overall reconstruction error. + +We evaluate our method on several test sprite sheets. We show that our method can successfully produce articulated parts and significantly outperforms other representative appearance and motion-based co-part segmentation works [16, 37]. Our contributions are the following: + +- A method for analyzing a sprite sheet and creating a corresponding articulated character that can be used as a puppet for character animation. +- A neural architecture to predict pixel motions andclus + +ter pixels into articulated moving parts without relying on a known character template. + +- An optimization algorithm for selecting the character parts that can best reconstruct the given sprite poses. + +# 2. Related Work + +Rigid motion segmentation. Several approaches [38,41-43,46,58] have been proposed to cluster pixels into groups following similar rigid motions. One line of work [41,42] identifies rigid groups by discovering distinct motion patterns from 2D optical flow. These methods typically work well on smooth video sequences, but cannot generalize to images with large pose changes between each other. They also aim at object level segmentation, and often miss articulated parts within each object. Other works employ 3D geometric constraints and features to infer the underlying motion of pixels for clustering [38, 43, 46, 55, 58]. These methods also assume small motions, and require multi-view input to perform 3D geometric inference, thus are not applicable to artistic sprites. + +Co-part segmentation. Several works focus on segmenting common foreground objects or parts from a set of images or video frames [7,8,16,18,24,44,45,59]. They often utilize features from pretrained networks on ImageNet [34], thus are more suitable for natural images instead of non-photorealistic images, such as sprites. Most importantly, their segmentation relies more on appearance and semantic consistency rather than part motion. As a result, they miss articulated parts, even when trained on our datasets, as shown in our experiments in the case of SCOPS [16]. + +Other co-part segmentation works rely on motion to better extract articulated parts. Early methods use keypoint tracking and various strategies for trajectory recovery and modeling [6, 9, 28, 47, 54]. However, they are often hand-tuned and prone to noisy tracking and large pose deformations. More recently, deep learning methods have shown promising results for motion-based co-segmentation [35, 37, 52]. However, they heavily rely on well-predicted optical flow. When input images have distinct and large pose changes, optical flow becomes unreliable. They are also more suitable for natural images of objects from a single category. When trained on sprite sheets with varying articulation structure, they produce unsatisfactory results, as shown in our experiments for the recent approach of [37]. + +3D mobility segmentation. Mobility-based segmentation for 3D point clouds has also been investigated in recent works [21, 22, 49, 51]. Yi et al. [56] predicted point cloud segmentation from a pair of instances under different object articulation states. Hayden et al. [12] proposed an unsupervised part model to infer parts in a 3D motion sequence. MultiBodySync [15] achieved consistent correspondence and segmentation from multiple articulation states of the + +same object by spectral synchronization. All these approaches are designed for 3D point clouds or meshes. Although we are inspired by these approaches to handle large pose variations, our method incorporates several adaptations for processing 2D sprites, including a convolutional correspondence module for pixel correspondence, a neural voting strategy to handle efficient clustering of rigid motions in superpixel space, and an optimization strategy to find common parts leading to the best reconstruction of sprites. + +Puppet rigging and deformation. Prior works on puppet deformation [13, 30] assumes that the parts and their hierarchy are given i.e., the articulated parts have been specified by artists. Our approach is complementary to these methods, aiming to automate part extraction useful in their input. Recently, Xu et al. [53] proposed a neural network to infer a hierarchical rig for articulated characters. However, it relies only on the 3D geometry of the model, and does not take into account motion cues, as we do. + +# 3. Method + +The goal of our method is to infer the articulated parts of a 2D cartoon character given only a few poses drawn by an artist under different articulations. The number of poses can vary for each character, e.g. 6 to 10 in our datasets. The input are $P$ sprite RGB raster images $\mathbf{I}_i$ and their accompanying foreground binary masks $\mathbf{M}_i$ , $i = [1, \dots, P]$ , where $P$ is the total number of poses. The output is a set of articulated body parts that artists can subsequently animate based on standard part rigging methods and software [2,5,23] (see Fig. 1 for examples). + +The pipeline of our method is shown in Fig. 2. First, given any pair of images (poses) from the inputs, the first module of our method, i.e correspondence module, (Sec. 3.1) infers the pixel correspondences which capture the candidate motions of pixels between images. These correspondences are then processed through the clustering module (Sec. 3.2), which attempts to find pixels with similar motion patterns and groups them into a set of candidate articulated parts as the output. This modular architecture has the advantage of disentangling motion from appearance and using only motion patterns for clustering. Finally, we gather candidate parts from all pairs and select a final set of parts to represent the target puppet (Sec. 3.3). The selected parts are required to have minimum overlap with each other and also reconstruct all poses with as-rigid-as-possible deformations. + +The correspondence and clustering module have the form of neural networks that we both train jointly in a supervised manner (Sec. 4) based on publicly available puppet datasets (Sec. 5.1). We observe that networks can still generalize to real, artist-made cartoon characters and poses. The part selection solves a parameter-free optimization problem + +![](images/086018dbb984908bd173442b31cd959de1c179d3ef4b4090338d58c9be02fc15.jpg) +(a) Correspondence and Clustering modules + +![](images/667d35af0a7fbe961dcda0922c6f057331c41670fafef27532c645fc291c7c32.jpg) +(b) Whole pipeline +Figure 2. Pipeline overview. (a) Given any pair of images, the correspondence module (Sec.3.1) predicts candidate pixel correspondence between them. The clustering module (Sec.3.2) then groups superpixels with similar rigid transformation together. (b) After applying the correspondence and clustering modules to all pairs of images, we collected parts scattered across all poses. We select a subset through optimization that can best reconstruct the given poses while having minimal overlap between them. + +tion problem which does not require training. + +# 3.1. Correspondence module + +Given a pair of images $\mathbf{I}_s, \mathbf{I}_t$ and corresponding binary foreground masks $\mathbf{M}_s, \mathbf{M}_t$ from the input set, the correspondence module predicts the candidate motion mapping of foreground pixels between two images. To achieve this, the module first concatenates each input image and mask, then transforms them into a feature map $\mathbf{F}_s \in \mathbb{R}^{H \times W \times 64}$ using a convnet. The network follows a U-Net architecture [33] and consists of ten convolutional layers in its encoder and another ten layers in its decoder. The convolutional layers in the encoder implement gated convolution [57], whose gating mechanism prevents background pixels indicated by the masks from influencing the foreground pixel correspondences. The feature vector of each pixel is normalized according to its $L_2$ norm such that it is unit length (i.e., it lies on the unit hypersphere [48]). + +Next, given each foreground pixel $\mathbf{x} = (x,y)$ in the source image $\mathbf{I}_s$ , its corresponding pixel $\mathbf{x}' = (x',y')$ in the target image $\mathbf{I}_t$ is found as the pixel with the most similar feature vector in terms of cosine similarity: + +$$ +\mathbf {x} ^ {\prime} = \underset {\mathbf {u} \in \mathbf {I} _ {t}, \mathbf {M} _ {t} (\mathbf {u}) = 1} {\arg \max } \left(\mathbf {F} _ {s} (\mathbf {x}) \cdot \mathbf {F} _ {t} (\mathbf {u})\right) \tag {1} +$$ + +We experimented with alternatives to extract correspondences such as RAFT [40] and COTR [17] trained on the same dataset as ours. Both resulted in worse results (see our experiments section for comparisons and discussion). + +# 3.2. Clustering module + +Given the pixel correspondences between the source and the target image $\mathbf{I}_s, \mathbf{I}_t$ , our clustering module aims to discover character articulated parts by grouping pixels with similar motion transformations. Since it is not possible to estimate the transformation, i.e. 2D rotation and translation + +from a single pixel, we instead gather votes for transformations from pairs of corresponding points $(\mathbf{x}_1,\mathbf{x}_1^{\prime})$ and $(\mathbf{x}_2,\mathbf{x}_2^{\prime})$ , where $\mathbf{x}_1,\mathbf{x}_2$ are source pixels, and $\mathbf{x}_1^{\prime},\mathbf{x}_2^{\prime}$ are their correspondences in the target image. Then we cluster these votes to discover the dominant rigid motion transformations and associated parts, similarly to Hough voting [4]. + +Voting pairs. Gathering votes from correspondences of all possible pixel pairs $\mathbf{x}_1, \mathbf{x}_2$ would be computationally expensive even for moderate image resolutions. In addition, distant pixels often belong to different parts, thus, their votes would tend to be irrelevant. To accelerate computations, we apply the superpixel segmentation method SLIC [1] to our input images and assume all pixels within a superpixel share the same motion transformation. + +Rotation extraction. To extract the rotation from pairs of correspondences, one popular method is to use the orthogonal Procrustes analysis [14]. However, through our experiments, this approach turned out not to be robust - even slightly noisy correspondences can significantly distort the votes. Instead, we follow a convnet approach that learns to estimate the transformations from approximate correspondences. The input to our network is a map storing the voting pairs. Specifically, for each source pixel $\mathbf{x}_1$ , we store the 2D vector $\mathbf{x}_1 - \mathbf{x}_c$ representing its relative position with respect to its superpixel centroid $\mathbf{x}_c$ , and also the corresponding 2D vector $\mathbf{x}_1' - \mathbf{x}_c'$ . This results in a $H \times W \times 4$ input voting map. Pixels without any correspondences are indicated by an additional binary mask. + +The voting and mask maps are processed through a U-Net backbone and gated convolutions similar to the convnet of our correspondence module. The output is a $H\times W\times 64$ feature map representing motion features per pixel in the source image. We then apply average pooling spatially over each superpixel area to acquire motion features $\mathbb{R}^{K_s\times 64}$ for all $K_{s}$ superpixels. Finally, an MLP layer is applied to map + +the features to $\mathbb{R}^{K_s\times 2}$ space, representing (residual) sine and cosine of the rotation angles for $K_{s}$ superpixels. + +Translation extraction. Directly predicting both translation and rotation is possible, however we found it is more accurate to predict the rotation first, then update the motion features based on the rotation, and finally predict the translation (see also our ablation). In this manner, we discourage the network to express any small rotations merely as translations. The translation prediction network shares the same architecture of the rotation extraction network. + +Clustering. Given extracted rotations and translations for superpixels, we proceed with characterizing their motion similarity, or in other words affinity. This affinity is computed based on motion residuals inspired by [15]. We apply the estimated rotation and translation of each superpixel to transform all other superpixels, and compute the position difference between the transformed superpixels and their corresponding superpixels. Specifically, given a super-pixel $\mathbf{p}_i$ with extracted rotation matrix $\mathbf{R}_s[i]$ and translation $\mathbf{t}_s[i]$ , the motion residual for the super-pixel $\mathbf{p}_j$ is computed as: + +$$ +\mathbf {D} _ {s} (i, j) = \frac {\sum_ {\mathbf {x} \in \mathbf {p} _ {j}} \left(\mathbf {R} _ {s} [ i ] \cdot \mathbf {x} + \mathbf {t} _ {s} [ i ] - \mathbf {x} ^ {\prime}\right)}{| \mathbf {p} _ {j} |} \tag {2} +$$ + +where $|\mathbf{p}_j|$ is the number of pixels in the superpixel $\mathbf{p}_j$ . The motion residual matrix $\mathbf{D}_s \in \mathbb{R}^{K_s \times K_s \times 2}$ is processed through more MLP layers to compute the superpixel affinity matrix $\mathbf{A}_s \in \mathbb{R}^{K_s \times K_s}$ . More details on the architecture can be found in the supplementary. + +Given the predicted affinity matrix $\mathbf{A}_s$ , the grouping is achieved by using spectral clustering [27]. Here we follow the differential clustering approach [3, 15], which results in matrix $\mathbf{G}_s \in \mathbb{R}^{K_s \times C_s}$ representing a soft membership of superpixels to $C_s$ clusters. We follow [15] to set the number of clusters based on the number of eigenvalues extracted from spectral clustering larger than a threshold. Here we set the threshold as $1\%$ of the sum of the first 10 eigenvalues. By converting the soft membership to a hard one, the resulting clusters reveal articulated parts for the source pose based on its paired target pose. + +# 3.3. Part Selection + +By passing each pair of poses $\mathbf{I}_s, \mathbf{I}_t$ through our correspondence and segmentation modules, we obtain a set of parts for the source pose $\mathbf{I}_s$ . Processing all pairs of poses yields a "soup" of candidate parts $\mathbf{Q} = \{\mathbf{q}_1, \mathbf{q}_2, \dots, \mathbf{q}_C\}$ scattered across all poses, where $C = \sum_{s} C_s$ is their total number. Obviously many of these parts are redundant e.g., the same arm extracted under different poses. Our part selection procedure selects a compact set of parts that (a) can reconstruct all poses with minimal error, and also (b) have minimum overlap with each other. To reconstruct poses, one possibility is to use rigid transformations of candidate + +parts. Despite the fact that rigidity was used to approximately model the motion of parts in the previous section, not all the sprite sheet characters are fully rigidly deformed. There are often small non-rigid deformations within each part and around their boundaries. Thus we resort to as-rigid-as-possible (ARAP) deformation [39] for reconstructing poses using the selected parts more faithfully. + +To satisfy the above criteria, we formulate a "set cover" optimization problem where the smallest sub-collection of "sets" (i.e., parts in our case) covers a universe $\mathbf{P} = \{\mathbf{p}_i\}$ of "elements" (i.e., all the superpixels across all poses). Specifically, by introducing a binary variable $z_{c}$ indicating whether a part $\mathbf{q}_c$ belongs to the optimal set (the "set cover") or not, we formulate the following optimization problem: + +$$ +\min \sum_ {\mathbf {q} _ {c} \in \mathbf {Q}} z _ {c} +$$ + +$$ +s. t. \sum_ {\mathbf {q} _ {c}: \mathbf {p} _ {i} \in \mathbf {q} _ {c}} z _ {c} \geq 1 f o r a l l \mathbf {p} _ {i} \in \mathbf {P} \tag {3} +$$ + +We solve the above Integer Linear Programming (ILP) problem through relaxation. This yields a continuous linear programming problem solved using the interior point method [11]. We finally apply the randomized-rounding algorithm [32] to convert the continuous result to our desired binary predictions. The randomized-routing can give us multiple possible solutions. We measure their quality by deforming the selected parts in each solution to best reconstruct all the given poses. The deformation is based on ARAP [39]. We choose the best solution with the minimal reconstruction error (see details in the supplementary). + +# 4. Training + +The correspondence and clustering modules are involved in our training procedure. + +Correspondence module supervision. We train the correspondence module through a contrastive learning approach using supervision of pair-wise pixel correspondences. Specifically, given a pair of input images $\mathbf{I}_s$ , $\mathbf{I}_t$ , we minimized a correspondence loss [26, 29] that encourages the representation of ground-truth corresponding pixel pairs $(\mathbf{x},\mathbf{x}^{\prime})$ to be more similar than non-corresponding ones: + +$$ +L _ {\mathbf {x}, \mathbf {x} ^ {\prime}} ^ {(c o r r)} = - \log \frac {\exp \left(\mathbf {F} _ {s} (\mathbf {x}) \cdot \mathbf {F} _ {t} \left(\mathbf {x} ^ {\prime}\right) / \tau\right)}{\sum_ {\mathbf {u} \in \mathbf {U} _ {t}} \exp \left(\mathbf {F} _ {s} (\mathbf {x}) \cdot \mathbf {F} _ {t} (\mathbf {u}) / \tau\right)} \tag {4} +$$ + +where $\mathbf{U}_t$ is a predefined number of pixels we randomly sample from the foreground region of the image $\mathbf{I}_t$ indicated by its mask $\mathbf{M}_t$ . We set this number to 1024 in our experiments. The temperature $\tau$ is used to scale the cosine similarities. It is initially set as 0.07, and is learned simultaneously as we train the correspondence module [31]. The total correspondence loss $L_{c}$ is averaged over all training corresponding pixel pairs. + +During training, we alternatively replace the argmax of Eq. 1 with a soft version to preserve differentiability and enable backpropagation of losses from the clustering model. Specifically, we replace it with the weighted average of the top- $\kappa$ closest target image foreground pixels to each source image pixel ( $\kappa = 3$ in our implementation): + +$$ +\mathbf {x} ^ {\prime} = \frac {\sum_ {\mathbf {u} _ {\kappa} \in \mathcal {U} (\mathbf {x})} \exp \left(\mathbf {F} _ {s} (\mathbf {x}) \cdot \mathbf {F} _ {t} \left(\mathbf {u} _ {\kappa}\right) / \tau\right) \cdot \mathbf {u} _ {\kappa}}{\sum_ {\mathbf {u} _ {\kappa} \in \mathcal {U} (\mathbf {x})} \exp \left(\mathbf {F} _ {s} (\mathbf {x}) \cdot \mathbf {F} _ {t} \left(\mathbf {u} _ {\kappa}\right) / \tau\right)} \tag {5} +$$ + +where $\mathcal{U}(\mathbf{x})$ represent the top- $\kappa$ most similar target pose pixels to $\mathbf{x}$ using cosine similarity. The closest pixels are updated after each forward pass through our network. + +Clustering module supervision. We train the clustering module with the binary cross-entropy (BCE) loss over the supervision of ground-truth affinity matrix $\mathbf{A}_s^{gt}(i,j)$ . + +$$ +L _ {s} ^ {(a f f)} = B C E \left(\mathbf {A} _ {s}, \mathbf {A} _ {s} ^ {g t}\right) \tag {6} +$$ + +Similarly to [15], we introduce an additional loss on the motion residual matrix $\mathbf{D}_s$ to encourage consistent rigid transformation predictions, i.e. $\mathbf{R}_s, \mathbf{t}_s$ in Eq. 2, across superpixels of the same part: + +$$ +L _ {s} ^ {(m o t i o n)} = \frac {\sum_ {i , j} [ \mathbf {A} _ {s} ^ {g t} (i , j) = 1 ] \cdot \| \mathbf {D} _ {s} (i , j) \| ^ {2}}{\sum_ {i , j} [ \mathbf {A} ^ {g t} (i , j) = 1 ]} \tag {7} +$$ + +where $[\cdot ]$ is an indicator function. + +Finally, we adopt the soft IoU loss [19] to push the clustering memberships of superpixels in matrix $\mathbf{G}_s$ to be as similar as possible to the ground-truth ones $\mathbf{G}_s^{gt}$ . + +$$ +L _ {s} ^ {(c l u s t)} = \sum_ {c = 1} ^ {C _ {s} ^ {(g t)}} \frac {\left\langle \mathbf {g} _ {c} , \mathbf {g} _ {\mathcal {H} (c)} ^ {g t} \right\rangle}{\| \mathbf {g} _ {c} \| _ {1} + \| \mathbf {g} _ {\mathcal {H} (c)} ^ {g t} \| _ {1} - \left\langle \mathbf {g} _ {c} , \mathbf {g} _ {\mathcal {H} (c)} ^ {g t} \right\rangle} \tag {8} +$$ + +where $\mathbf{g}_c$ and $\mathbf{g}_c^{gt}$ represent the column of the $\mathbf{G}_s$ and $\mathbf{G}_s^{gt}$ respectively. $C_s^{gt}$ is the total number of parts in the ground-truth. $\mathcal{H}(c)$ represents the matched column index $c$ of predicted cluster to the ground-truth cluster based on Hungarian matching [20]. + +We note that the ILP solution does not participate in our network training implementation. End-to-end training would require methods for differentiating ILPs [10, 25], yet these would make training computationally too expensive. + +Implementation Details. The correspondence and clustering modules are trained using the Adam optimizer using the sum of all the above losses. We refer readers to the supplemental for more details, and also to our project page for source code (the link is included in our abstract). + +# 5. Experiments + +In this section, we discuss our dataset and results. We also show qualitative and quantitative comparisons. + +# 5.1. Datasets + +To provide supervision to our neural modules, we make use of two publicly available datasets. + +OkaySamurai dataset. First, we use the publicly available puppets from the OkaySamurai website2. The dataset consists of 57 artist-created and rigged characters, with varying numbers of articulated parts and spanning different categories such as full or half body humansoids, dolls, robots, often having accessories such as clothes and handheld objects. The advantage of this dataset is that the rigged characters are already segmented into parts, which can be used to train our neural modules and allow numerical evaluation. We split the data such that 30 puppets are used for training, 7 for hold-out validation, and 20 for testing. For each training and validation puppet, we generate 200 random poses and sample 100 pose pairs to train the correspondence and clustering modules. The different poses are created by specifying random angles in a range $[-0.3\pi, 0.3\pi]$ to their skeletal joints. We also apply small, additional non-rigid deformations on each body part to improve the pose diversity (see supplementary for details). + +Creative Flow+ dataset. Despite augmentation for poses, the number of training puppets in the OkaySamurai remains limited. Since our correspondence module is appearance-sensitive, we can pre-train it separately on larger datasets with ground-truth correspondences. One such example is the recent Creative Flow+ dataset [36]. The dataset contains 2D artistic, cartoon-like renderings of animation sequences along with ground truth pixel-wise correspondences. The dataset does not contain segmentation of articulated parts, yet, it is still a useful source to pretrain our correspondence module. The animation sequences are generated from various 3D meshes. We removed the ones having no articulated pose structure, e.g., the ones generated from ShapeNet models. Since we are also interested in training on pose pairs with large motion variations, we sample poses at least 30 frames in between. In total, we pick 8058 pairs of CreativeFlow+ cartoon renderings for training, 1165 pairs for validation, and 1078 pairs for evaluating our correspondences against alternatives. + +SPRITES dataset. We use one more dataset to evaluate how well our method generalizes to other data not involved in our training. We obtained 10 sprite sheets manually created by artists3. We refer to this dataset as "SPRITES". For each sprite sheet, we gathered 6-10 poses of the character, all artist-drawn. The characters of this dataset are not rigged, nor segmented into parts, thus we use this dataset for qualitative evaluation. + +Training strategy. We first pre-train our correspondence module using the InfoNCE loss of Eq. 4 on the Creative + +![](images/9494c96a9ae2da8a33c43d26c1c85ca2cde61c26a398fec4ddd90f849dfbd5e2.jpg) +Figure 3. Left: The top row of each OkaySamurai test puppet shows the input poses of the sprite sheet. The bottom row shows our reconstructed poses. Right (box): The predicted articulated parts from APES. + +Flow+ dataset. Starting from the pre-trained correspondence module, we then train both neural modules on the training split of the OkaySamurai dataset. This strategy offered the best performance. We also found helpful to apply color jittering augmentation to each training pair. + +Evaluation metrics. The test split from CreativeFlow+ dataset can be used for evaluating correspondence accuracy. We use the end-point-error (EPE) as our evaluation protocol which measures the average distance between the predicted and the ground-truth corresponding pixels. + +The test split of OkaySamurai is used to evaluate part extraction. For each testing puppet, we generate 10 different + +poses to get 200 test poses. We process all possible pairs (45 pairs per puppet) through our trained correspondence, clustering modules and part selection procedure to output selected articulated parts for each puppet. We also deform the selected parts by ARAP to best reconstruct each input pose (see Sec. 3.3). For evaluating the output parts, we first perform Hungarian matching between ground-truth and reconstructed parts based on Intersection over Union (IoU), with $1 - IoU$ is used as cost. The resulting average part IoU is used as our main evaluation metric. As additional evaluation metrics, we also use the difference between the reconstructed and ground-truth poses by MSE, PNSR and + +![](images/111056a31e65697e7961b78574ff5fc9ebad562b9b600f18e066a49b68b17f66.jpg) +Figure 4. Part extraction from sprite sheets created by artists ("SPRITES" dataset). In the box, we show the predicted articulated parts. + +![](images/7aa59a46272a73edfc2777d8f5baddff75f24d41478ff5d15810b2673688f7c9.jpg) + +![](images/568950504e9ecb542446fa608d32f51f0161f0dc09e84b66629e834b268cdd86.jpg) + +![](images/1e2ab3ba3ad19e0672bd5e2035ddb4689d3af23acb75e69e757aa4decc0febed.jpg) + +LPIPS [60]. High reconstruction error indicates implausible parts used in deformation. + +# 5.2. Articulated Parts Selection from Sprite Sheets + +Figure 3 shows our articulated part extraction results from our method for characteristic sprite sheets from the OkaySamurai dataset. We also include reconstruction results based on the deformation procedure described in Section 3.3 on the second row of each example. Our method successfully recovers articulated parts in most cases, although boundaries of parts are not always accurate (e.g., see shoulders and hips in the last example). Figure 4 shows results from the SPRITES dataset. Our method is able to detect intuitive articulated parts in these artist-drawn poses, although regions near part boundaries (e.g., legs, tail of bird) are slightly grouped off. + +Our supplementary material includes additional qualitative results from the CreativFlow+ dataset. In addition, the supplementary video shows applications of our method to automatic puppet creation and automatic synthesis of animation skeletons based on our identified parts. + +# 5.3. Comparisons + +# Articulated part extraction. + +Our method (APES) is the first to deal with articulated part extraction from sprite sheets. There are no prior methods that have been applied to this problem. Yet, one important question is whether methods that have been developed for part co-segmentation in photorealistic images can be applied to our problem. + +One may argue that appearance cues might be enough to detect the common parts across different poses of a character. To test this hypothesis, we perform comparisons with SCOPS [16], a state-of-the-art co-part segmentation method. The method is self-supervised, and the self-supervision is applied to real-world images. We train SCOPS on the same training sources with our method (CreativeFlow+ and OkaySamurai), and we also add supervisory signal using our clustering loss. We call this super + +
MethodIoU
SCOPS [16]27.4%
SCOPS-s (sc)33.1%
SCOPS-s (nosc)35.8%
MoCoSeg [37]26.0%
MoCoSeg-s32.3%
APES71.0%
+ +Table 1. Results in the OkaySamurai test set. + +vised variant as SCOPS-s. We note that SCOPS does not make use of optical flow or external correspondences, thus APES still uses more supervision than SCOPS-s. Nevertheless, we consider useful to show this comparison, since SCOPS is a characteristic example of a method that does not consider motion cues. We also note that SCOPS uses a semantic consistency loss that makes segmentations more consistent across objects of the same category. We tested SCOPS-s with and without this loss; we refer to these variants as SCOPS-s (sc) and SCOPS-s (nosc). We exhaustively tested the loss weights to find the best configuration, and select the best number of output parts (12 parts). We note that the output segmentation map from SCOPS includes a background region – we ignore it in our evaluation. The resulting part regions can be evaluated with the same metrics, averaged over all poses of the test puppets of OkaySamurai. We finally note that SCOPS cannot perform reconstruction, thus, we report only segmentation performance in the OkaySamurai test dataset. + +Table 1 presents the average part IoU for the OkaySamurai test set. Note that we also include the performance of the original self-supervised SCOPS approach just for reference. All SCOPS variants have low performance e.g., APES' IoU in OkaySamurai is $71\%$ , twice as high compared to the best SCOPS variant $(35\%)$ . The results indicate that appearance-based co-part segmentation is not effective at extracting articulated parts in sprite sheets. + +An alternative co-segmentation approach is the one by Siarohin et al [37], which relies on motion cues. We denote it as MoCoSeg. Like SCOPS, it is self-supervised and trained on videos. Similarly, to make a fair comparison, we re-train this method on the same training sources as ours, and also add supervisory signal using both our clustering loss and our correspondence loss on its flow output. We call this supervised variant as MoCoSeg-s. We tuned their loss weights and output number of parts to achieve best performance in the validation split. + +Table 1 shows the performance of MoCoSeg-s and MoCoSeg, both of which are low. We suspect that the motion inferred by MoCoSeg is correlated to their part segmentation, which is more suitable for objects with consistent articulation structure. This indicates that such motion-based segmentation methods are not appropriate for our setting. + +Figure 5 shows characteristic outputs from the above + +![](images/9fa03eaf7122cd6cfdd4aa8db2a74423b7f4397437ea9729b44e620bf2350173.jpg) +Figure 5. Identified parts from different methods on characteristic poses from the OkaySamurai dataset. Note that different color indicates different parts (colors have no semantic correspondence). APES identifies articulated parts much more successfully. + +
MethodRAFT [40]COTR [17]APES
EPE (end-point-error)28.0731.9322.90
+ +SCOPS and MoCoSeg variants and APES. Our method can infer articulated parts from the input poses much more accurately compared to competing methods, aligning better with the underlying articulated motion. + +Correspondences. We also evaluate our correspondence module against alternatives. First we compare our method with an optical flow method RAFT [40]. For RAFT, we remove their online-generated masks to allow longer-range optical flows and incorporate foreground masks in the correlation operation so that only foreground pixels have positive correlation. In addition, we shifted the predicted corresponding pixels to their nearest foreground pixels. We note that we fine-tuned RAFT on the same training datasets as ours (CreativeFlow+ and OkaySamurai training splits). This worked better compared to training it from scratch on our datasets, or using its pre-trained model without finetuning. Table 2 shows quantitative results on our test split of CreativeFlow+. Our correspondence module produces much more accurate correspondences compared to RAFT. + +We also compare to a pixel correspondence method based on transformers, called COTR [17]. We fine-tuned COTR on the same training splits as ours, and shifted the predicted corresponding pixels to their nearest foreground pixels. Still, COTR's results are inferior to APES. For visualization of correspondence results from our method and others, please see our supplementary material. + +# 5.4. Ablation Study + +We perform a set of ablation experiments on the OkaySamurai dataset since it includes ground-truth articulated parts for evaluation. We compare with the following variants of our method: RT_simult: we predict rotation and translation of each superpixel simultaneously, instead of sequentially as in our original method. No Eq. 7: we train the + +Table 2. Quantitative results on the Creative Flow test split based on the EPE metric. Our method achieves the lowest EPE. + +
MethodIoUMSEPNSRLPIPS
RT_simult69.5%741.5820.190.10
No Eq.770.1%749.5820.140.10
No Eq.659.4%838.1119.470.11
RAFT corr.63.5%788.3919.780.11
COTR corr.60.2%862.2819.400.12
APES71.0%733.1220.200.10
+ +Table 3. Ablation study of our variants (OkaySamurai dataset). + +segmentation module with Eq. 6 and Eq. 8 only, without supervision for the motion residual matrix. No Eq. 6: we train the segmentation module with Eq. 7 and Eq. 8 only, without supervision on the affinity matrix. RAFT corr: Instead of our UNet-based correspondence module, we use RAFT to predict correspondences used in the following steps. COTR corr: we use COTR to produce correspondences instead. + +We report all our evaluation metrics in Table 3, including reconstruction metrics, since all the above variants employ the same part selection and reconstruction stage. We observe inferior results from all reduced variants. + +# 6. Conclusion + +We presented APES, a method that extracts articulated parts from a sparse set of character poses of a sprite sheet. As far as we know, APES is the first method capable of automatically extracting deformable puppets from unsegmented character poses. We believe that methods able to parse character artwork and generate rigs have the potential to significantly automate the character animation workflow. + +Limitations. While we can handle a wide range of character styles and part configurations, there are some limitations. Parts with non-rigid or subtle motion cannot be extracted well. For example, given the cater + +![](images/221ed65bdbf915fc4ddceb18496872572402df6d2e17250af28131a901a69ee6.jpg) + +pillar poses shown on the right, our method extracts the head, arms, and body chunks, yet it does not segment the thin legs and the individual abdomen segments, since these do not seem to have distinct rotations with respect to the rest of the body. As discussed in our experiments, the boundary of parts is not always accurate. Our method selects parts such that they minimally overlap during part selection. As a result, small articulated parts might be missed and replaced by larger ones. Handling strongly overlapping parts more explicitly, layer order changes between sprites (such as a character turning around), and large occlusions would make our method applicable to a wider range of sprite sheet cases. + +Acknowledgements. Our research was partially funded by NSF (EAGER-1942069) and Adobe. + +# References + +[1] Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Susstrunk. Slic superpixels compared to state-of-the-art superpixel methods. IEEE TPAMI, 34(11), 2012. 3 +[2] Adobe. Character Animator, version. 2021. https://www.adobe.com/products/character-animator.html.2 +[3] Federica Arrigoni and Tomas Pajdla. Motion segmentation via synchronization. In ICCV Workshops, 2019. 4 +[4] Dana H Ballard. Generalizing the hough transform to detect arbitrary shapes. PR, 13(2), 1981. 3 +[5] Péter Borosán, Ming Jin, Doug DeCarlo, Yotam Gingold, and Andrew Nealen. Rigmesh: automatic rigging for part-based shape modeling and deformation. ACM TOG, 31(6), 2012. 2 +[6] Hyung Jin Chang and Yiannis Demiris. Highly articulated kinematic structure estimation combining motion and skeleton information. IEEE TPAMI, 40(9), 2017. 2 +[7] Subhabrata Choudhury, Iro Laina, Christian Rupprecht, and Andrea Vedaldi. Unsupervised part discovery from contrastive reconstruction. In NeurIPS, 2021. 2 +[8] Edo Collins, Radhakrishna Achanta, and Sabine Susstrunk. Deep feature factorization for concept discovery. In ECCV, 2018. 2 +[9] Luca Del Pero, Susanna Ricco, Rahul Sukthankar, and Vitorio Ferrari. Discovering the physical parts of an articulated object class from multiple videos. In CVPR, 2016. 2 +[10] Aaron Ferber, Bryan Wilder, Bistra Dilkina, and Milind Tambe. Mipaal: Mixed integer program as a layer. In AAAI, 2020. 5 +[11] Robert M Freund. Primal-dual interior-point methods for linear programming based on newton's method. Massachusetts Institute of Technology, 2004. 4 +[12] David S Hayden, Jason Pacheco, and John W Fisher. Nonparametric object and parts modeling with lie group dynamics. In CVPR, 2020. 2 +[13] Tobias Hinz, Matthew Fisher, Oliver Wang, Eli Shechtman, and Stefan Wermter. Charactergan: Few-shot keypoint character animation and reposing. arXiv preprint arXiv:2102.03141, 2021. 2 +[14] Berthold KP Horn. Closed-form solution of absolute orientation using unit quaternions. Josa a, 4(4), 1987. 3 +[15] Jiahui Huang, He Wang, Tolga Birdal, Minhyuk Sung, Federica Arrigoni, Shi-Min Hu, and Leonidas Guibas. Multi-bodiesync: Multi-body segmentation and motion estimation via 3d scan synchronization. In CVPR, 2021. 2, 4, 5 +[16] Wei-Chih Hung, Varun Jampani, Sifei Liu, Pavlo Molchanov, Ming-Hsuan Yang, and Jan Kautz. Scops: Self-supervised co-part segmentation. In CVPR, 2019. 1, 2, 7 +[17] Wei Jiang, Eduard Trulls, Jan Hosang, Andrea Tagliasacchi, and Kwang Moo Yi. Cotr: Correspondence transformer for matching across images. In ICCV, 2021. 3, 8 +[18] Armand Joulin, Francis Bach, and Jean Ponce. Multi-class cosegmentation. In CVPR, 2012. 2 + +[19] Philipp Krahenbuhl and Vladlen Koltun. Parameter learning and convergent inference for dense random fields. In Int. Conf. Machine Learning, 2013. 5 +[20] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2), 1955. 5 +[21] Hao Li, Guowei Wan, Honghua Li, Andrei Sharf, Kai Xu, and Baoquan Chen. Mobility fitting using 4d ransac. Computer Graphics Forum, 35(5), 2016. 2 +[22] Ting Li, Vinutha Kallem, Dheeraj Singaraju, and René Vidal. Projective factorization of multiple rigid-body motions. In CVPR, 2007. 2 +[23] Songrun Liu, Alec Jacobson, and Yotam Gingold. Skinning cubicBezier splines and catmull-clark subdivision surfaces. ACM TOG, 33(6), 2014. 1, 2 +[24] Xiankai Lu, Wenguan Wang, Jianbing Shen, David Crandall, and Jiebo Luo. Zero-shot video object segmentation with coattention siamese networks. IEEE TPAMI, 2020. 2 +[25] Jayanta Mandi and Tias Guns. Interior point solving for lp-based prediction+optimisation. In NeurIPS, 2020. 5 +[26] Natalia Neverova, David Novotny, Vasil Khalidov, Marc Szafraniec, Patrick Labatut, and Andrea Vedaldi. Continuous surface embeddings. In NeurIPS, 2020. 4 +[27] Andrew Y Ng, Michael I Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In NeurIPS, 2002. 4 +[28] Peter Ochs and Thomas Brox. Object segmentation in video: A hierarchical variational approach for turning point trajectories into dense regions. In ICCV, 2011. 2 +[29] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 4 +[30] Omid Poursaeed, Vladimir Kim, Eli Shechtman, Jun Saito, and Serge Belongie. Neural puppet: Generative layered cartoon characters. In WACV, 2020. 2 +[31] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In Int. Conf. Machine Learning, 2021. 4 +[32] Prabhakar Raghavan and Clark D Tompson. Randomized rounding: a technique for provably good algorithms and algorithmic proofs. Combinatorica, 7(4), 1987. 4 +[33] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234-241, 2015. 3 +[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. IJCV, 115(3), 2015. 2 +[35] Sara Sabour, Andrea Tagliausacchi, Soroosh Yazdani, Geoffrey Hinton, and David J Fleet. Unsupervised part representation by flow capsules. In Int. Conf. Machine Learning, 2021. 2 +[36] Maria Shugrina, Ziheng Liang, Amlan Kar, Jiaman Li, Angad Singh, Karan Singh, and Sanja Fidler. Creative flow+ dataset. In CVPR, 2019. 5 + +[37] Aliaksandr Siarohin, Subhankar Roy, Stéphane Lathuilière, Sergey Tulyakov, Elisa Ricci, and Nicu Sebe. Motion-supervised co-part segmentation. In ICPR, 2021. 1, 2, 7 +[38] Yafei Song, Xiaowu Chen, Jia Li, and Qinping Zhao. Embedding 3d geometric features for rigid object part segmentation. In ICCV, 2017. 2 +[39] Olga Sorkine and Marc Alexa. As-rigid-as-possible surface modeling. In SGP, volume 4, 2007. 4 +[40] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In ECCV, 2020. 3, 8 +[41] Pavel Tokmakov, Karteek Alahari, and Cordelia Schmid. Learning motion patterns in videos. In CVPR, 2017. 2 +[42] Pavel Tokmakov, Cordelia Schmid, and Karteek Alahari. Learning to segment moving objects. *IJCV*, 127(3), 2019. 2 +[43] Roberto Tron and René Vidal. A benchmark for the comparison of 3-d motion segmentation algorithms. In CVPR, 2007. 2 +[44] Yi-Hsuan Tsai, Guangyu Zhong, and Ming-Hsuan Yang. Semantic co-segmentation in videos. In ECCV, 2016. 2 +[45] Sara Vicente, Carsten Rother, and Vladimir Kolmogorov. Object cosegmentation. In CVPR, 2011. 2 +[46] René Vidal, Yi Ma, Stefano Soatto, and Shankar Sastry. Two-view multibody structure from motion. *IJCV*, 68(1), 2006. 2 +[47] J.Y.A. Wang and E.H. Adelson. Layered representation for motion analysis. In CVPR, 1993. 2 +[48] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Int. Conf. Machine Learning, 2020. 3 +[49] Xiaogang Wang, Bin Zhou, Yahao Shi, Xiaowu Chen, Qinping Zhao, and Kai Xu. Shape2motion: Joint analysis of motion parts and attributes from 3d shapes. In CVPR, 2019. 2 +[50] Nora S Willett, Wilmot Li, Jovan Popovic, Floraine Berthouzoz, and Adam Finkelstein. Secondary motion for performed 2d animation. In UIST, 2017. 1 +[51] Xun Xu, Loong-Fah Cheong, and Zhuwen Li. 3d rigid motion segmentation with mixed and unknown number of models. IEEE TPAMI, 43(1), 2019. 2 +[52] Zhenjia Xu, Zhijian Liu, Chen Sun, Kevin Murphy, William T Freeman, Joshua B Tenenbaum, and Jiajun Wu. Unsupervised discovery of parts, structure, and dynamics. In ICLR, 2019. 2 +[53] Zhan Xu, Yang Zhou, Evangelos Kalogerakis, Chris Landreth, and Karan Singh. Rignet: Neural rigging for articulated characters. ACM TOG, 39, 2020. 2 +[54] Jingyu Yan and Marc Pollefeys. A factorization-based approach for articulated nonrigid shape, motion and kinematic chain recovery from video. IEEE TPAMI, 30(5), 2008. 2 +[55] Gengshan Yang and Deva Ramanan. Learning to segment rigid motions from two frames. In CVPR, 2021. 2 +[56] Li Yi, Haibin Huang, Difan Liu, Evangelos Kalogerakis, Hao Su, and Leonidas Guibas. Deep part induction from articulated object pairs. ACM TOG, 37(6), 2018. 2 +[57] Jiahui Yu, Zhe Lin, Jamei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Free-form image inpainting with gated convolution. In ICCV, 2019. 3 + +[58] Chang Yuan, Gerard Medioni, Jinman Kang, and Isaac Cohen. Detecting motion regions in the presence of a strong parallax from a moving camera by multiview geometric constraints. IEEE TPAMI, 29(9), 2007. 2 +[59] Chi Zhang, Guankai Li, Guosheng Lin, Qingyao Wu, and Rui Yao. Cyclesegnet: Object co-segmentation with cycle refinement and region correspondence. IEEE TIP, 2021. 2 +[60] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018. 7 \ No newline at end of file diff --git a/apesarticulatedpartextractionfromspritesheets/images.zip b/apesarticulatedpartextractionfromspritesheets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a2805fd4df1c6c4e17840cc48966093eca5d0f0b --- /dev/null +++ b/apesarticulatedpartextractionfromspritesheets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7a7755e9f26529ef9e1c2e18898362b94550d79004ae6e83044592408325284 +size 571072 diff --git a/apesarticulatedpartextractionfromspritesheets/layout.json b/apesarticulatedpartextractionfromspritesheets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..23460aec3e1eaf7bd996bfd40e393b516e1c5644 --- /dev/null +++ b/apesarticulatedpartextractionfromspritesheets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92d760c812eb8e6867262eb0757bce7df4829d37d12638631beb1e1af3105bf7 +size 388308 diff --git a/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_content_list.json b/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c4fd802b7a7d9e8dc8199f714c0c8740a5055c33 --- /dev/null +++ b/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:285a0f6add7cc08680c0547814e1b1121c03ca98d110b96ace7ccad6dac5bc5a +size 76824 diff --git a/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_model.json b/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1811aa89040bacadadfd86d0c23a67040f098230 --- /dev/null +++ b/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16e855f2edb31a4fd8139eea68fa7b4154645beb54da704d9b5d5441bb1f7d47 +size 96800 diff --git a/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_origin.pdf b/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2205ec2d1b5c37611a48d14cd3e96f3da4eb059 --- /dev/null +++ b/aprilfindingtheachillesheelonprivacyforvisiontransformers/0a3f5f64-0976-43db-ad2a-b0ebfc4b5ab0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c104573c9a1221368194fe32740ed537f7766bd267087f693e8ea73576a6c977 +size 2871545 diff --git a/aprilfindingtheachillesheelonprivacyforvisiontransformers/full.md b/aprilfindingtheachillesheelonprivacyforvisiontransformers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ab321de9127584e00789b6c76e823c4f91b62a71 --- /dev/null +++ b/aprilfindingtheachillesheelonprivacyforvisiontransformers/full.md @@ -0,0 +1,386 @@ +# APRIL: Finding the Achilles' Heel on Privacy for Vision Transformers + +Jiahao Lu $^{1,2}$ , Xi Sheryl Zhang $^{1}$ , Tianli Zhao $^{1,2}$ , Xiangyu He $^{1,2}$ , Jian Cheng $^{1}$ + +$^{1}$ Institute of Automation, Chinese Academy of Sciences + +$^{2}$ School of Artificial Intelligence, University of Chinese Academy of Sciences + +{lujiahao2019, xi.zhang, zhaotianli2019}@ia.ac.cn;{xiangyu.he, jcheng}@nlpr.ia.ac.cn + +# Abstract + +Federated learning frameworks typically require collaborators to share their local gradient updates of a common model instead of sharing training data to preserve privacy. However, prior works on Gradient Leakage Attacks showed that private training data can be revealed from gradients. So far almost all relevant works base their attacks on fully-connected or convolutional neural networks. Given the recent overwhelmingly rising trend of adapting Transformers to solve multifarious vision tasks, it is highly valuable to investigate the privacy risk of vision transformers. In this paper, we analyse the gradient leakage risk of self-attention based mechanism in both theoretical and practical manners. Particularly, we propose APRIL - Attention PIVacy Leakage, which poses a strong threat to self-attention inspired models such as ViT. Showing how vision Transformers are at the risk of privacy leakage via gradients, we urge the significance of designing privacy-safer Transformer models and defending schemes. + +# 1. Introduction + +Federated or collaborative learning [25] have been gaining massive attention from both academia [20, 21] and industry [7, 19]. For the purpose of privacy-preserving, the typical federated learning keeps local training data private and trains a global model by sharing its gradients collaboratively. By avoiding to transmit the raw data directly to a central server, the learning paradigm is widely believed to offer sufficient privacy. Thereby, it has been employed in real-world applications, especially when user privacy is highly sensitive, e.g. hospital data [2, 18]. + +Whilst this setting prevents direct privacy leakage by keeping training data invisible to collaborators, a recent line of the works [12, 16, 39, 41, 43, 44] demonstrates that it is possible to (partially) recover private training data from the model gradients. This attack dubbed gradient leakage or gradient inversion poses a severe threat to the federated learning systems. The previous works primarily focus on + +inverting gradients from fully connected networks (FCNs) or convolutional neural networks (CNNs). Particularly, Yin et al. [39] recover images with high fidelity relying on gradient matching with BatchNorm layer statistics; Zhu et al. [43] theoretically analyse the risk of certain architectures to enable the full recovery. One intriguing question of our interest is that, does gradient privacy leakage occur in the context of architectures other than FCNs and CNNs? + +The recent years have witnessed a surge of methods of Transformer [32]. As an inherently different architecture, Transformer can build large scale contextual representation models, and achieve impressive results in a broad set of natural language tasks. For instance, huge pre-trained language models including BERT [8], XLNet [38], GPT-3 [3], Megatron-LM [30], and so forth are established on the basis of Transformers. Inspired by the success, original works [1, 6, 29, 33] seek to the feasibility of leveraging self-attention mechanism with convolutional layers to vision tasks. Then, DETR [4] makes pioneering progress to use Transformer in object detection and ViT [10] resoundingly succeeds in image classification with a pure Transformer architecture. Coming after ViT, dozens of works manage to integrate Transformer into various computer vision tasks [11, 22-24, 35-37, 40]. Notably, vision Transformers are known to be extremely data-hungry [10], which makes the large-scale learning in the federated fashion more favorable. + +Despite the rapid progress aforementioned, there is a high chance that vision Transformers suffer the gradient leakage risk. Nevertheless, the line of the study on this privacy issue is absent. Although the prior work [16] provides an attack algorithm to recover private training data for a Transformer-based language model via an optimization process, the inherent reason of Transformer's vulnerability is unclear. Different with leakage on Transformer in natural language tasks [16], we claim that vision Transformers with the position embedding not only encodes positional information for patches but also enables gradient inversion from the layer. In this paper, we introduce a novel analytic gradient leakage to reveal why vision Transformers are easy to be + +attacked. Furthermore, we explore gradient leakage by recovery mechanisms based on an optimization approach and provide a new insight about the position embedding. Our results of gradient attack will shed light on future designs for privacy-preserving vision Transformers. + +To summarize, our contributions are as follows: + +- We prove that for the classic self-attention module, the input data can be perfectly reconstructed without solving an intractable optimization problem, if the gradient w.r.t. the input is known. +- We demonstrate that jointly using self-attention and learnable position embedding place the model at severe privacy risk. The attacker obtain a closed-form solution to the privacy leakage under certain conditions, regardless of the complexity of networks. +- We propose an Attention Privacy Leakage (APRIL) attack, to discover the Archilles' Heel. As an alternative, APRIL performs an optimization-based attack, apart from the closed-form attack. The attacks show that our results superior to SOTA. +- We suggest to switch the learnable position embedding to a fixed one as the defense against privacy attacks. Empirical results certify the effectiveness of our defending scheme. + +# 2. Preliminary + +Federated Learning. Federated learning [25] offers the scheme that trains statistical models collaboratively involving multiple data owners. Due to the developments in areas of privacy, large-scale training, and distributed optimization, federated learning methods have been deployed by applications which require computing at the edge [2,9,13,14, 28]. In this scenario, we aim to learn a global model by locally processed client data and communicating intermediate updates to a central server. Formally, the typical goal is minimizing the following loss function $l$ with parameters $w$ , + +$$ +\min _ {w} l _ {w} (x, y), \text {w h e r e} l _ {w} (x, y) := \sum_ {i = 1} ^ {N} p _ {i} l _ {w} ^ {i} \left(x _ {i}, y _ {i}\right) \tag {1} +$$ + +where $p_i \geq 0$ and $\sum_{i} p_i = 1$ . Since the $N$ clients owns the private training data. Let $(x_i, y_i)$ denote samples available locally for the $i$ th client, and $l_w^i(x_i, y_i)$ denote the local loss function. In order to preserve data privacy, clients periodically upload their gradients $\nabla_w l_w^i(x_i, y_i)$ computed on their own local batch. The server aggregates gradients from all clients, updates the model using gradient descent and then sends back the updated parameters to every client. + +Gradient Leakage Attack. As an honest-but-curious adversary at the server side may reconstruct clients' private + +training data without messing up the training process, sharing gradients in federated learning is no longer safe for client data. Endeavors of existing threat models which use gradients to recover input mainly focus on two directions: optimization-based attacks and closed-form attacks. + +The basic recovery mechanism is defined by optimizing an euclidean distance as follows, + +$$ +\min _ {x _ {i} ^ {\prime}, y _ {i} ^ {\prime}} \left\| \nabla_ {w} l _ {w} ^ {i} \left(x _ {i}, y _ {i}\right) - \nabla_ {w} l _ {w} ^ {i} \left(x _ {i} ^ {\prime}, y _ {i} ^ {\prime}\right) \right\| ^ {2} \tag {2} +$$ + +Deep leakage [44] minimizes the matching term of gradients from dummy input $(x_i', y_i')$ and those from real input $(x_i, y_i)^1$ . On the top of this proposal, iDLG [41] finds that in fact we can derive the ground-truth label from the gradient of the last fully connected layer. By eliminating one optimization objective in Eq.(2), the attack procedure becomes even faster and smoother. Also, Geiping et al. [12] prove that inversion from gradient is strictly less difficult than recovery from visual representations. GradInversion [39] incorporates heuristic image prior as regularization by utilizing BatchNorm matching loss and group consistency loss for image fidelity. Lately, GIML [17] illustrates that a generative model pre-trained on data distribution can be exploited for reconstruction. + +One essential challenge of optimization procedures is that there is no sufficient condition for the uniqueness of the optimizer. The closed-form attack, as another of the ingredients in this line, is introduced by Phong et al. [27], which reconstructs inputs using a shallow network such as a single-layer perceptron. R-GAP [43] is the first derivation-based approach to perform an attack on CNNs, which models the problem as linear systems with closed-form solutions. Compared to the optimization-based method, analytic gradient leakage heavily depends on the architecture of neural networks and thus cannot always guarantee a solution. + +Transformers. Transformer [32] is introduced for neural machine translation to model the long-term correlation between tokens meanwhile represent dependencies between any two distant tokens. The key of outstanding representative capability comes from stacking multi-head self-attention modules. Recently, vision Transformers and its variants are broadly used for powerful backbones [10, 24, 31], object detection [4], semantic segmentation [42], image generation [5, 15, 26], etc. + +Given the fundamentals of vision Transformer, we will investigate the gradient leakage in terms of closed-formed and optimization-based manners. Thus far, almost all the gradient leakage attacks adopt CNNs as the testing ground, typically using VGG or ResNet. Besides, TAG [16] conducts experiments on popular language models using Transformers without concerning any analytic solution as well as the function of position embedding. + +# 3. APRIL: Attention PRIvacy Leakage + +In light of the missing investigation of the gradient leakage problem for vision transformers, we first prove that gradient attacks on self-attention can be analytically conducted. Next, we will discuss the possible leakage from the position embedding based on its analytic solution, which naturally gives rise to two attack approaches. + +# 3.1. Analytic Gradient Attack on Self-Attention + +It has been proven that the closed-form solution for input $x$ can always be perfectly obtained on a fully-connected layer $\sigma (Wx + b) = z$ , through deriving gradients w.r.t. weight $W$ and bias $b$ . The non-linear function $\sigma$ is an activation [27]. In this work, we delve into a more subtle formulation of a self-attention to demonstrate the existence of the closed-form solution. + +Theorem 1. (Input Recovery). Assume a self-attention module expressed as: + +$$ +Q z = q; K z = k; V z = v; \tag {3} +$$ + +$$ +\frac {\operatorname {s o f t m a x} \left(q \cdot k ^ {T}\right)}{\sqrt {d _ {k}}} \cdot v = h \tag {4} +$$ + +$$ +W h = a; \tag {5} +$$ + +where $z$ is the input of the self-attention module, $a$ is the output of the module. Let $Q, K, V, W$ denote the weight matrix of query, key, value and projection, and $q, k, v, h$ denote the intermediate feature map. Suppose the loss function can be written as + +$$ +l = l (f (a), y) +$$ + +If the derivative of loss $l$ w.r.t. the input $z$ is known, then the input can be recovered uniquely from the network's gradients by solving the following linear system: + +$$ +\frac {\partial l}{\partial z} z ^ {T} = Q ^ {T} \frac {\partial l}{\partial Q} + K ^ {T} \frac {\partial l}{\partial K} + V ^ {T} \frac {\partial l}{\partial V} +$$ + +Proof. In spite of the non-linear formulation of self-attention modules, the gradients w.r.t. $z$ can be derived in a succinct linear equation: + +$$ +\frac {\partial l}{\partial z} = Q ^ {T} \frac {\partial l}{\partial q} + K ^ {T} \frac {\partial l}{\partial k} + V ^ {T} \frac {\partial l}{\partial v} \tag {6} +$$ + +Again, according to the chain rule of derivatives, we can derive the gradients w.r.t. $Q$ , $K$ and $V$ from Eq. (3): + +$$ +\frac {\partial l}{\partial Q} = \frac {\partial l}{\partial q} z ^ {T} +$$ + +$$ +\frac {\partial l}{\partial K} = \frac {\partial l}{\partial k} z ^ {T} \tag {7} +$$ + +$$ +\frac {\partial l}{\partial V} = \frac {\partial l}{\partial v} z ^ {T} +$$ + +# Algorithm 1: Closed-Form APRIL + +Input: Attention module: $F(z, w)$ ; + +Module weights $w$ ; Module gradients $\frac{\partial l}{\partial w}$ + +Derivative of loss w.r.t. $z$ : $\frac{\partial l}{\partial z}$ + +Output: Embedding feed into attention module: $z$ + +1: procedure APRIL-CLOSED-FORM $(F, w, \frac{\partial l}{\partial w}, \frac{\partial l}{\partial z})$ +2: Extract $Q, K, V$ from module weights $w$ +3: Extract $\frac{\partial l}{\partial Q}, \frac{\partial l}{\partial K}, \frac{\partial l}{\partial V}$ from module gradients $\frac{\partial l}{\partial w}$ +4: $A\gets \frac{\partial l}{\partial z}$ +5: $b\gets Q^T\cdot \frac{\partial l}{\partial Q} +V^T\cdot \frac{\partial l}{\partial V} +K^T\cdot \frac{\partial l}{\partial K}$ +6: $z\gets A^{\dagger}\cdot b$ $\triangleright A^{\dagger}$ : Moore-Penrose +7: pseudoinverse of $A$ +8: $z\gets z^T$ $\triangleright$ Transpose +9: end procedure + +By multiplying $z^T$ to both sides of Eq. (6) and substituting Eq. (7), we obtain: + +$$ +\begin{array}{l} \frac {\partial l}{\partial z} z ^ {T} = Q ^ {T} \frac {\partial l}{\partial q} z ^ {T} + K ^ {T} \frac {\partial l}{\partial k} z ^ {T} + V ^ {T} \frac {\partial l}{\partial v} z ^ {T} \tag {8} \\ = Q ^ {T} \frac {\partial l}{\partial Q} + K ^ {T} \frac {\partial l}{\partial K} + V ^ {T} \frac {\partial l}{\partial V} \\ \end{array} +$$ + +which completes the proof. + +Remark. Surprisingly we find that for a malicious attacker aiming to recover the input data $z$ . Since an adversary in the context of federated learning knows both learnable parameters and gradients w.r.t. them, in this case, $Q$ , $K$ , $V$ and $\frac{\partial l}{\partial Q}$ , $\frac{\partial l}{\partial K}$ , $\frac{\partial l}{\partial V}$ . The right side of Eq. (8) is known. As a result, once the derivative of the loss w.r.t. the input $\frac{\partial l}{\partial z}$ is exposed to the adversary, the attacker can easily get an accurate reconstruction of $z$ by solving the linear equation system in Eq. (8). + +Solution Feasibility. Suppose the dimension of the embedding $z$ is $\mathbb{R}^{p\times c}$ , with patch number $p$ and channel number $c$ . This linear system has $p\times c$ unknown variables yet $c\times c$ linear constraints. Since deep neural networks normally have wide channels for the sake of expressiveness, $c\gg p$ in most model designs, which leads to an overdetermined problem and thereby a solvable result. In other words, $z$ can be accurately reconstructed if $\frac{\partial l}{\partial z}$ is available. The entire procedure of the closed-form attack is presented in Alg.1. + +# 3.2. Position Embedding: The Achilles' Heel + +Now we focus on the how to access the critical derivative $\frac{\partial l}{\partial z}$ by introducing the leakage caused by the position embedding. Under general settings of federated learning, the sensitive information related with $z$ is invisible from users' side. Here, we show that $\frac{\partial l}{\partial z}$ is unfortunately exposed by gradient sharing for vision Transformers with a + +![](images/37167eb36a00239c2898cedd6fd2735ed9d7a92a9f5a294555e2bb7cff8be7d1.jpg) +Figure 1. We consider two Transformer designs throughout the paper. (A): Encoder modules stack multi-head attention, normalization, and MLP in VGG-style. (B): A real-world design as introduced in ViT [10]. The architecture in (A) satisfies the precondition of a closed-form APRIL attack, since the output of position embedding is exactly input for multi-head attention, showing by the red dashed line box. In contrast, the optimization-based APRIL attack can be placed in any design of architectures, showing by the yellow dashed line boxes in (A) and (B). + +learnable position embedding. Specifically, we give the following theorem to illustrate the leakage. + +Theorem 2. (Gradient Leakage). For a Transformer with learnable position embedding $E_{pos}$ , the derivative of loss w.r.t. $E_{pos}$ can be given by + +$$ +\frac {\partial l}{\partial E _ {p o s}} = \frac {\partial l}{\partial z} \tag {9} +$$ + +where $\frac{\partial l}{\partial z}$ is defined by the linear system in Theorem 1. + +Proof. Without loss of generality, the embedding $z$ defined by Theorem 1 can be divided into a patch embedding $E_{patch}$ and a learnable position embedding $E_{pos}$ as, + +$$ +z = E _ {\text {p a t c h}} + E _ {\text {p o s}} \tag {10} +$$ + +Straightforwardly, we compute the derivative of loss w.r.t. $E_{pos}$ using Eq. (10), Eq. (9) holds. + +Remark. The sensitive information $\frac{\partial l}{\partial z}$ is exactly the same as the gradient of the position embedding $\frac{\partial l}{\partial E_{pos}}$ , denoting as $\nabla E_{pos}$ for simplicity. As model gradients are sharing, $\nabla E_{pos}$ is available for not only legal users but also potential adversaries, which means a successful attack on self-attention inputs. + +While vision Transformers [10, 24, 34] embody prominent accuracy raise using learnable position embeddings rather than the fixed ones, updating of parameter $E_{pos}$ will result in privacy-preserving troubles based on our theory. + +More severely, the attacker only requires a learnable position embedding and a self-attention stacked at the bottom in VGG-style, regardless of the complexity of the rest architecture, as shown in Fig. 1 (A). At a colloquial level, we suggest two strategies to alleviate this leakage, which is either employing one fixed position embedding instead of the learnable one or updating $\nabla E_{pos}$ only on local client without transmission. + +# 3.3. APRIL attacks on vision Transformer + +So far the analytic gradient attack have succeeded in reconstructing input embedding $z$ meanwhile obtaining the gradient of position embedding $\nabla E_{pos}$ . One question is that can APRIL take advantage of the sensitive information to further recover the original input $x$ . The answer is affirmative. + +Closed-Form APRIL. As a matter of the fact, APRIL attacker can inverse the embedding via a linear projection to get original input pixels. For a vision Transformer, the input image is partitioned into many patches and sent through a so-called "Patch Embedding" layer, defined as + +$$ +E _ {p a t c h} = W _ {p} x \tag {11} +$$ + +The bias term is omitted since it can be represented in an augmented matrix $W_{p}$ . With $W_{p}$ , pixels are linearly mapped to features, and the attacker calculates the original pixels by left-multiply its pseudo-inverse. + +Optimization-based APRIL. Given the linear system in Theorem 1, it can also be decomposed into two components as $z$ and $\nabla E_{pos}$ based on Eq.(9). Arguably, component $\nabla E_{pos}$ indicates the directions of the gradients of position embeddings and contributes to the linear system independently with data. Considering the significance of the learnable position embedding in gradient leakage, intuitively, matching the updating direction of $E_{pos}$ with an direction caused by dummy data can do benefits on the recovery. Therefore, we proposed an optimization-based attack with constraints on $\nabla E_{pos}$ . To do so, apart from architecture in Fig. 1(A), typical design of ViT illustrated in Fig. 1(B) using normalization and residual connections with a different stacked order can also be attacked by our proposed APRIL. + +For expression simplicity, we use $\nabla w^{\prime}$ and $\nabla w$ denote the gradients of parameter collections for dummy data and real inputs, respectively. In detail, the new integrated term of gradients of $\nabla E_{pos}$ is set as $\mathcal{L}_A$ . For modelling directional information, we utilize a cosine similarity between real and dummy position embedding derivatives as a regularization. The intact optimization problem is written as + +$$ +\begin{array}{l} \mathcal {L} = \mathcal {L} _ {G} + \alpha \mathcal {L} _ {A} \\ = \left\| \nabla w ^ {\prime} - \nabla w \right\| _ {F} ^ {2} - \alpha \cdot \frac {< \nabla E _ {p o s} , \nabla E _ {p o s} ^ {\prime} >}{\left\| \nabla E _ {p o s} \right\| \cdot \left\| \nabla E _ {p o s} ^ {\prime} \right\|}. \tag {12} \\ \end{array} +$$ + +Algorithm 2: Optimization-based APRIL +Input: Transformer with learnable position embedding: $F(x,w)$ ; Module parameter weights: $w$ ; Module parameter gradients: $\nabla w$ ; APRIL loss term scalar: $\alpha$ +Output: Image feed into the self-attention module: $x$ +1: procedure APRIL-OPTIMIZATION-ATTACK(F, w, $\nabla w$ ) +2: Extract final linear layer weights $w_{fc}$ from $w$ +3: $y \gets i$ s.t. $\nabla w_{fc}^{T} \nabla w_{fc}^{j} \leq 0, \forall j \neq i$ ▷ Extract ground-truth label using the iDLG trick +4: Extract position embedding layer's gradients $\nabla E_{pos}$ from $\nabla w$ +5: $x' \gets \mathcal{N}(0,1)$ ▷ Initialize the dummy input +6: While not converged do +7: $\frac{\partial l'}{\partial w} \gets \partial l(F(x';w), y)/\partial w$ ▷ Calculate dummy gradients +8: $\mathcal{L}_G = \|\nabla w' - \nabla w\|_F^2$ ▷ Calculate L-2 difference between gradients +9: $\frac{\partial l}{\partial E_{pos}'} \gets \partial l(F(x';w), y)/\partial E_{pos}'$ ▷ Calculate the derivative of dummy loss w.r.t. dummy input +10: $\mathcal{L}_A = -\frac{<\nabla E_{pos}, \nabla E_{pos}'>}{\|\nabla E_{pos}\| \cdot \|\nabla E_{pos}'\|}$ ▷ Calculate cosine distance between derivative of input +11: $\mathcal{L} = \mathcal{L}_G + \alpha \mathcal{L}_A$ +12: $x' \gets x' - \eta \nabla_{x'} \mathcal{L}$ ▷ Update the dummy input +13: end procedure + +where hyperparameter $\alpha$ balances the contributions of two matching losses. Eventually, we set Eq.(12) to be another variant of our proposed method, optimization-based APRIL attack. The associated algorithm is described in Alg.2. By enforcing a gradient matching on the learnable position embedding, it is plaguily easy to break privacy in a vision Transformer. + +# 4. Experiments + +In this section, we aspire to carry out experiments to answer the following questions: (1) To what extent can APRIL break privacy of a Transformer? (2) How strong is the APRIL attack compared to existing privacy attack methods? (3) What defensive strategy can we take to alleviate APRIL attack? (4) How to testify the functionality of position embedding in privacy preserving? + +We mainly carry out experiments in the setting of image classification; however, APRIL as a universal attack for Transformers can also be performed in a language task setting. Here we only discuss APRIL attack for vision Transformers in this section. + +We carry out experiments on two different architectures, as illustrated in Fig. 1, architecture (A) has a position embedding layer directly connected to attention module, making it possible to perform APRIL-closed-form attack. Architecture (B) has the same structure as ViT-Base [10], which is composed of multiple encoders, each with a normalization layer before attention module as well as a residual connection. For small datasets like CIFAR and MNIST, we refer to the implementation of ViT-CIFAR $^2$ . We set the + +hidden dimension to 384, attention head to 4, and partition input images into 4 patches. The encoder depth is 4, after that the classification token is connected to a classification head. For experiments on ImageNet, we follow the original ViT design3 and architecture setting, which includes 16x16 image patch size, 12 attention heads, 12 layers of encoders with hidden dimensions of 768. + +# 4.1. APRIL as the Gradient Attack + +We first apply APRIL attacks on Architecture (A) and compare it with other attacking approaches. As Fig. 2 shows, closed-form APRIL attack provides a perfect reconstruction, which shows nearly no difference to the original input, which proves the correctness of our theorem. Comparing optimization-based attacks, for easy tasks like MNIST and CIFAR with a clean background, all existing attacking algorithms show their ability to break privacy, although DLG [44] and IG [12] have some noises in their results. The comparison is obvious for ImageNet reconstructions, where DLG, IG and TAG reconstructions are nearly unrecognizable to humans, with strong block artifacts. In contrast, the proposed APRIL-Optimization attack behaves prominently better, which reveals quite a lot of sensitive information from the source image, including details like the color and shape of the content. + +We further studied the optimization procedure of reconstruction, shown in Fig. 3. We illustrate the updating process of the dummy image. We can observe that all three approaches can break some sort of privacy, but they differ in convergence speed and final effects. An apparent observa + +![](images/50138e266dd97257b38e85c9b16161c5632d91776efb2d08d04bfa21f0461c24.jpg) +Figure 2. Results for different privacy attacking approaches on Architecture (A). For optimization-based attacks, we use an Adam optimizer to update 800 iterations for MNIST, 1500 iterations for CIFAR-10 and 5000 iterations for ImageNet. Please zoom-in to see details. + +
AttackMNISTCIFAR-10ImageNet
MSESSIMMSESSIMMSESSIM
DLG [44]1.291e-04 ± 2.954e-040.997 ± 0.0030.017 ± 0.0090.959±0.0451.328±0.5930.056 ± 0.027
IG [12]0.043±0.0220.833±0.0760.125±0.1020.635±0.1651.671±0.6530.029±0.013
TAG [16]3.438e-05 ± 1.322e-050.998±0.0020.006 ± 0.0050.965±0.0471.180 ± 0.4730.062 ± 0.026
APRIL4.796e-05±3.593e-050.998 ± 0.0020.002±0.0060.991 ± 0.0271.092±0.6630.099 ± 0.046
+ +Table 1. Mean and standard deviation for MSE of 500 reconstructions on MNIST, CIFAR-10 and ImageNet validation datasets, respectively. We randomly selected 50 images from each class in MNIST and CIFAR-10, and one image for random 500 classes in ImageNet. + +tion is that our optimization-based APRIL converges consistently faster than the other two. Besides, our approach generally ends up at a better terminal point, which results in smoother and cleaner image reconstructions. + +Apart from visualization results, we want to have a quantitative comparison between these optimization-based attacks. We carry out this experiment on Architecture(B), where we do not have the condition to use closed-form APRIL attack. The statistical results from Sec. 4 show consistent good performance of APRIL, and we obtain best results nearly across every task setting. + +Finally, we try to attack batched input images. As shown in Fig. 4, our optimization results on batched input achieved impressive results as well. Note here we used the trick introduced by Yin et al. [39] to restore batch labels before optimization. More results are put in Appendix. It's worth mentioning that the use of a closed-form APRIL attack is limited under batched setting, since the gradients are contributed by all samples in a batch, and we can only solve an "averaged" version of $z$ in Eq. (8). We give more reconstruction results and discuss more thoroughly on the phenomenon in Appendix. + +All experiments shown above demonstrate that the proposed APRIL outperforms all existing privacy attack approaches in the context of Transformer, thus posing a strong threat to Vision Transformers. + +# 4.2. APRIL-inspired Defense Strategy + +How robust is the closed-form APRIL. In the last subsection, we show that under certain conditions, closed-form APRIL attack can be executed to get almost perfect reconstructions. The execution of this attack is based on solving a linear system. Linear systems can be unstable and ill-conditioned when the condition number is large. With this knowledge, we are interested to know how much disturbance can APRIL bear to remain a good attack? We discuss a few defensive strategies towards APRIL. + +We first testified the influence of changing hidden channel dimensions. A successful closed-form reconstruction relies on the linear system with $P \cdot C$ unknowns and $C \cdot C$ constraints, to be overdetermined. As common configuration suggests $C$ far larger than $P$ , we deem the linear system to be solvable. To test the robustness of APRIL under different architecture settings, we try four different hidden di + +# Optimization Iterations + +![](images/a66e060eab660dbb05f7962ae5d52e038ad656fcfa2c2e2e8c460cf249f62369.jpg) +(A) MNIST + +![](images/c1d1869eeeb46c1c33cf3a5a571b2cdddf2c1bce92a5a7b34471bd3acf538c3e.jpg) +(B) ImageNet + +![](images/2bfc08ff7d338cd0c01963bcbea0a7c3ee3a1b4f6a1fdac3172deaa7504dc7d3.jpg) +(C) CIFAR-10 + +![](images/7cdf488a455c6df4d96c61dcc02e064731051c500bd4c4bbb6c35f33aa1ba1d7.jpg) +Figure 4. Optimization-based APRIL attack on batched inputs. + +![](images/fb94e121f4f11df47878013d9c66b36dcc1939deeb62b0ce37d156a1d4ea2556.jpg) +Figure 5. Influences of varying hidden dimension to the reconstruction of APRIL attack. + +mensions. As Fig. 5 shows, using the original configuration of ViT-base [10] cannot be privacy-preserving, the original input image can be entirely leaked by closed-form APRIL attack. Only by shrinking hidden dimensions to a small value (e.g., half of the patch number) can we have solid protection. However, in this configuration, we doubt the network's capacity to gain high accuracy with such small channel number. + +Another more straightforward way to defend against privacy attacks from gradients is to add noise on gradients. We experiment with Gaussian and Laplacian noises and report results in Fig. 6. We found that the defense level does not depend on the absolute magnitude of noise variance, but its relative scale to gradient norm. Specifically, when the Gaussian noise variance is lower than 0.1 times (or 0.01 for Laplacian) of gradient norm, the defense won't work. As the variance goes up, the defense ability is greatly promoted. + +A Practical and Cheap Defense Scheme. Apart from + +![](images/e131c9bc6dcb840710c4bf47fb084100f711f6613419c1d1bfd9e81431abbcd5.jpg) +Figure 3. Visualization of the optimization process for optimization-based APRIL, DLG and TAG. Our approach has faster convergence speed and does not easily fall into bad local minima, thus yields a prominently better reconstruction result. +Figure 6. Influences of adding noise to gradients. + +adding noise and changing channel dimensions, a more straightforward way of defending against APRIL is to switch learnable position embedding to a fixed one. In this part, we will show that this is a realistic and practical defense, not only for the proposed APRIL, but for all kinds of attacks. + +By using a fixed position embedding, clients will not share the gradients w.r.t. the input. Therefore, it is impossible to perform closed-form APRIL attack. How will optimization-based privacy attacks act when the position embedding is transparent to the attacker? + +We experimented to find out the answer. Note that when position embedding is unknown to the attacker, the optimization-based APRIL attack turns into a more general DLG attack. From results, we noticed that similar to twin data mentioned by [43], closing the position embedding gradients seems to result in a family of anamorphic data, which is highly different from original data, but can trigger exactly similar gradients in a Transformer. We visualize these patterns as shown in Sec. 4.2. Currently we are not sure about the relationship between twin and original data, but it's safe to conclude that if we cease sharing position embedding gradients, the gradient matching process will produce semantically meaningless reconstructions. In + +![](images/86dfe027757588c815de577125430b17c517f53e1520d6f54388df70ec0adf7c.jpg) + +![](images/072faa224f2467f304c6437120e397793753e092157afdd4719dd306e2f1b020.jpg) +"Twin" On Arch A + +![](images/fe883c3c6474a37cc7a553421423b39502d3c55c6fde9667f584c85cc5aa7f2f.jpg) + +![](images/3a2a27f11600c94093c9e2a8b57d73afc89549e85903a44ffcac52a70579dfa3.jpg) + +![](images/7b85bdc3a6ccf7671f44e8db2e6c28ebb6ea00a1e8da71d2d23ee35547b47da3.jpg) + +![](images/9ff47e1bbd5b75cdd238158e61879aeeec2bf698e5cae9002c242271e6e8947b.jpg) + +![](images/2e156225f9e3849b3e694033d144c619525c03c5283bcc85072cf7a8fa8f3435.jpg) +Figure 7. Twin data emerge from privacy attack after we stop sharing position embedding. It attested the validity of the defense, in which way confirms that position embedding is indeed the most critical part to Transformer's privacy. + +![](images/bf997c11a036a9f43a6ed15726d4caf157eb98b790f2d7f5a018d52ab9f42d22.jpg) + +![](images/8410fd56669130f1b1e40d9917c34a965bdd171c388e3dd60c793c3c3d300bc8.jpg) + +![](images/d19a8dc579405b49be75ff91ef565456bb8d7c1da347b4bd229390c0b8e4be38.jpg) +(A) Gradient 12 loss and image MSE on Architecture A + +![](images/33c081563bca2321dc387c3fa5f0c43ccaf6094d3987c5ba73d02b0c37d01b5a.jpg) +(B) Gradient 12 loss and image MSE on Architecture B +Figure 8. Changes of gradient matching and input reconstruction versus optimization iterations. When position embedding is off, matching gradients does not provide semantically meaningful reconstructions. + +this way, the attacks fail to break privacy. + +To sum up, changing the learnable position to fixed ones or simply not sharing position embedding gradient is practical to prevent privacy leakage in Transformers, which pre + +serves privacy in a highly economic way. + +# 5. Discussion and Conclusion + +In this paper, we introduce a novel approach Attention PRIvacy Leakage attack (APRIL) to steal private local training data from shared gradients of a Transformer. The attack builds its success on a key finding that learnable position embedding is the weak spot for Transformer's privacy. Our experiments show that in certain cases the adversary can apply a closed-form attack to directly obtain the input. For broader scenarios, the attacker can make good use of position embedding to perform an optimization-based attack to easily reveal the input. This sets a great challenge to training Transformer models in distributed learning systems. We further discussed possible defenses towards APRIL attack, and verified the effectiveness of using a fixed position embedding. We hope this work would shed light on privacy-preserving network architecture design. In summary, our work has a key finding that learnable position embedding is a weak spot to leak privacy, which greatly advances the understanding of privacy leakage problem for Transformers. Based on the finding, we further propose a novel privacy attack APRIL and discuss effective defending schemes. + +**Limitation.** Our proposed APRIL attack is composed of two parts: closed-form attack when the input gradients are exposed and optimization-based attack otherwise. Closed-form APRIL attack is powerful, nonetheless relies on a strong assumption, which makes it limited to use in real-world Transformer designs. On the other hand, optimization-based APRIL attack implicitly solves a nonlinear system. Although they all make good use of gradients from position embedding, there seems to be room to explore a more profound relationship between the two attacks. + +Potential Negative Societal Impact. We demonstrate the privacy risk of learnable position embedding, as it is largely used as a paradigm in training Transformers. The privacy attack APRIL proposed in this paper could be utilized by the malicious to perform attack towards existing federated learning systems to steal user data. We put stress on the defense strategy proposed in the paper as well, and urge the importance of designing privacy-safer Transformer blocks. + +# 6. Acknowledgement + +This work was supported in part by the National Key Research and Development Program of China (No. 2020AAA0103400) and the Strategic Priority Research Program of Chinese Academy of Sciences (No. XDA27040300). + +# References + +[1] Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional net + +works. In Proceedings of the IEEE/CVF international conference on computer vision, pages 3286-3295, 2019. 1 +[2] Theodora S Brisimi, Ruidi Chen, Theofanie Mela, Alex Olshevsky, Ioannis Ch Paschalidis, and Wei Shi. Federated learning of predictive models from federated electronic health records. International journal of medical informatics, 112:59-67, 2018. 1, 2 +[3] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakanthan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. 1 +[4] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV. Springer, 2020. 1, 2 +[5] Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In ICML, pages 1691-1703. PMLR, 2020. 2 +[6] Jean-Baptiste Cordonnier, Andreas Loukas, and Martin Jaggi. On the relationship between self-attention and convolutional layers. In International Conference on Learning Representations, 2019. 1 +[7] Google TensorFlow Developers. TensorFlow Federated, December 2018. 1 +[8] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, Volume 1 (Long and Short Papers), 2019. 1 +[9] Jiahua Dong, Lixu Wang, Zhen Fang, Gan Sun, Shichao Xu, Xiao Wang, and Qi Zhu. Federated class-incremental learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2022. 2 +[10] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2020. 1, 2, 4, 5, 7 +[11] Yuxin Fang, Bencheng Liao, Xinggang Wang, Jiemin Fang, Jiyang Qi, Rui Wu, Jianwei Niu, and Wenyu Liu. You only look at one sequence: Rethinking transformer in vision through object detection. NeurIPS, 2021. 1 +[12] Jonas Geiping, Hartmut Bauermeister, Hannah Droge, and Michael Moeller. Inverting gradients - how easy is it to break privacy in federated learning? In NeurIPS, 2020. 1, 2, 5, 6 +[13] Andrew Hard, Kanishka Rao, Rajiv Mathews, Swaroop Ramaswamy, Françoise Beaufays, Sean Augenstein, Hubert Eichner, Chloe Kiddon, and Daniel Ramage. Federated learning for mobile keyboard prediction. arXiv preprint arXiv:1811.03604, 2018. 2 +[14] Li Huang, Andrew L Shea, Huining Qian, Aditya Masurkar, Hao Deng, and Dianbo Liu. Patient clustering improves efficiency of federated machine learning to predict mortality and hospital stay time using distributed electronic medical records. Journal of biomedical informatics, 99, 2019. 2 + +[15] Yifan Jiang, Shiyu Chang, and Zhangyang Wang. Transgan: Two transformers can make one strong gan. NeurIPS, 2021. 2 +[16] Deng Jieren, Wang Yijue, Shang Chao, Liu Hang, Rajasekaran Sanguthevar, and Ding Caiwen. Tag: Gradient attack on transformer-based language models. In findings of EMNLP, 2021. 1, 2, 6 +[17] Jeon Jinwoo, Kim Jaechang, Lee Kangwook, Oh Sewoong, and Ok Jungseul. Gradient inversion with generative image prior. In FL-ICML workshop in ICML, 2021. 2 +[18] Arthur Jochems, Timo M Deist, Johan Van Soest, Michael Eble, Paul Bulens, Philippe Coucke, Wim Dries, Philippe Lambin, and Andre Dekker. Distributed learning: developing a predictive model based on data from multiple hospitals without data leaving the hospital-a real life proof of concept. Radiotherapy and Oncology, 121(3):459-467, 2016. 1 +[19] Bonawitz Keith, Eichner Hubert, Grieskamp Wolfgang, Huba Dzmitry, Ingerman Alex, Ivanov Vladimir, Kiddon Chloe, Konecy Jakub, Mazzocchi Stefano, McMahan H.Brendan, Overveldt Timon, Van, Petrou David, Ramage Daniel, and Roselander Jason. Towards federated learning at scale: System design. In SysML, 2019. 1 +[20] Jakub Konečný, H Brendan McMahan, Daniel Ramage, and Peter Richtárik. Federated optimization: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016. 1 +[21] Mu Li, David G Andersen, Jun Woo Park, Alexander J Smola, Amr Ahmed, Vanja Josifovski, James Long, Eugene J Shekita, and Bor-Yiing Su. Scaling distributed machine learning with the parameter server. In 11th {USENIX} Symposium on Operating Systems Design and Implementation (OSDI) 14), pages 583-598, 2014. 1 +[22] Zhaowen Li, Zhiyang Chen, Fan Yang, Wei Li, Yousong Zhu, Chaoyang Zhao, Rui Deng, Liwei Wu, Rui Zhao, Ming Tang, and Jinqiao Wang. Mst: Masked self-supervised transformer for visual representation. 2021. 1 +[23] Songhua Liu, Tianwei Lin, Dongliang He, Fu Li, Ruifeng Deng, Xin Li, Errui Ding, and Hao Wang. Paint transformer: Feed forward neural painting with stroke prediction. In ICCV, pages 6598-6607, 2021. 1 +[24] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, October 2021. 1, 2, 4 +[25] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics, pages 1273-1282. PMLR, 2017. 1, 2 +[26] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In ICML, pages 4055-4064, 2018. 2 +[27] Le Trieu Phong, Yoshinori Aono, Takuya Hayashi, Lihua Wang, and Shiho Moriai. Privacy-preserving deep learning via additively homomorphic encryption. IEEE Transactions on Information Forensics and Security, 13(5), 2018. 2, 3 +[28] Tao Qi, Fangzhao Wu, Chuhan Wu, Yongfeng Huang, and Xing Xie. Privacy-preserving news recommendation model + +learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 1423-1432, 2020. 2 +[29] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jon Shlens. Stand-alone self-attention in vision models. Advances in Neural Information Processing Systems, 32, 2019. 1 +[30] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatronlm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019. 1 +[31] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021. 2 +[32] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurlPS, 2017. 1, 2 +[33] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[34] Kan Wu, Houwen Peng, Minghao Chen, Jianlong Fu, and Hongyang Chao. Rethinking and improving relative position encoding for vision transformer. In ICCV, pages 10033-10041, 2021. 4 +[35] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. NeurIPS, 2021. 1 +[36] Bin Yan, Houwen Peng, Jianlong Fu, Dong Wang, and Huchuan Lu. Learning spatio-temporal transformer for visual tracking. 2021. 1 +[37] Sen Yang, Zhibin Quan, Mu Nie, and Wankou Yang. Transpose: Keypoint localization via transformer. In ICCV, pages 11802-11812, 2021. 1 +[38] Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. NeurIPS, 32, 2019. 1 +[39] Hongxu Yin, Arun Mallya, Arash Vahdat, Jose M Alvarez, Jan Kautz, and Pavlo Molchanov. See through gradients: Image batch recovery via gradinversion. In CVPR, pages 16337-16346, 2021. 1, 2, 6 +[40] Xumin Yu, Yongming Rao, Ziyi Wang, Zuyan Liu, Jiwen Lu, and Jie Zhou. Pointr: Diverse point cloud completion with geometry-aware transformers. In ICCV, pages 12498-12507, 2021. 1 +[41] Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. idlg: Improved deep leakage from gradients. arXiv preprint arXiv:2001.02610, 2020. 1, 2 +[42] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In CVPR, pages 6881-6890, 2021. 2 + +[43] Junyi Zhu and Matthew B Blaschko. R-gap: Recursive gradient attack on privacy. In ICLR, 2020. 1, 2, 7 +[44] Ligeng Zhu, Zhijian Liu, and Song Han. Deep leakage from gradients. NeurIPS, 2019. 1, 2, 5, 6 \ No newline at end of file diff --git a/aprilfindingtheachillesheelonprivacyforvisiontransformers/images.zip b/aprilfindingtheachillesheelonprivacyforvisiontransformers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..306c8acd3a9adfd02b77154a92b97759aa1f1732 --- /dev/null +++ b/aprilfindingtheachillesheelonprivacyforvisiontransformers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a305c2e3db15a33d3fb63e00fe837fc62f543fad1ddcfcc62e7027b31b0aec73 +size 590533 diff --git a/aprilfindingtheachillesheelonprivacyforvisiontransformers/layout.json b/aprilfindingtheachillesheelonprivacyforvisiontransformers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..595f9251cbbc88481629e48d516be56bbf0665f2 --- /dev/null +++ b/aprilfindingtheachillesheelonprivacyforvisiontransformers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7611b46bfbe7b96a261e274daf317e52ece2664c4236b0c916be337cdf0e07a9 +size 442463 diff --git a/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_content_list.json b/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c6886f3bd4d41c7d3c31eb22ce072cd162040e97 --- /dev/null +++ b/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d08f5f33366644af03d86ef372c6c16a2f7e72db717805190cdb685e29d15041 +size 102517 diff --git a/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_model.json b/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..efc8c321343358bb09b8edc8697a7dda6f6180c9 --- /dev/null +++ b/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6787eaf502b6231bee8c071d7de2a6756c0ba0458870bc08503496e6deb5e1e +size 130819 diff --git a/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_origin.pdf b/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d60db7be7221c6dd5a649a6d4947fd5cb3a95e97 --- /dev/null +++ b/arcsaccuraterotationandcorrespondencesearch/f6fd8db3-3ebc-4505-a45b-291203a17ee3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53bf85367a585a79529bf00213ebf8cee40e0d04317393b720bc22baf063f14c +size 456385 diff --git a/arcsaccuraterotationandcorrespondencesearch/full.md b/arcsaccuraterotationandcorrespondencesearch/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3b4c16b46d33dfc184071bad1cee4367dfaf838d --- /dev/null +++ b/arcsaccuraterotationandcorrespondencesearch/full.md @@ -0,0 +1,481 @@ +# ARCS: Accurate Rotation and Correspondence Search + +Liangzu Peng +Johns Hopkins University +lpeng25@jhu.edu + +Manolis C. Tsakiris +ShanghaiTech University +mtsakiris@shanghaitech.edu.cn + +René Vidal +Johns Hopkins University +rvidal@jhu.edu + +# Abstract + +This paper is about the old Wahba problem in its more general form, which we call "simultaneous rotation and correspondence search". In this generalization we need to find a rotation that best aligns two partially overlapping 3D point sets, of sizes $m$ and $n$ respectively with $m \geq n$ . We first propose a solver, ARCS, that i) assumes noiseless point sets in general position, ii) requires only 2 inliers, iii) uses $O(m \log m)$ time and $O(m)$ space, and iv) can successfully solve the problem even with, e.g., $m, n \approx 10^6$ in about 0.1 seconds. We next robustify ARCS to noise, for which we approximately solve consensus maximization problems using ideas from robust subspace learning and interval stabbingbing. Thirdly, we refine the approximately found consensus set by a Riemannian subgradient descent approach over the space of unit quaternions, which we show converges globally to an $\varepsilon$ -stationary point in $O(\varepsilon^{-4})$ iterations, or locally to the ground-truth at a linear rate in the absence of noise. We combine these algorithms into ARCS+, to simultaneously search for rotations and correspondences. Experiments show that ARCS+ achieves state-of-the-art performance on large-scale datasets with more than $10^6$ points with a $10^4$ time-speedup over alternative methods. https://github.com/liangzhu/ARCS + +# 1. Introduction + +The villain Procrustes forced his victims to sleep on an iron bed; if they did not fit the bed he cut off or stretched their limbs to make them fit [27]. + +Richard Everson + +Modern sensors have brought the classic Wahba problem [75], or slightly differently the Procrustes analysis problem [31], into greater generality that has increasing importance to computer vision [34, 50], computer graphics [58], and robotics [12]. We formalize this generalization as follows. + +Problem 1 (simultaneous rotation and correspondence + +search). Consider point sets $\mathcal{Q} = \{\pmb {q}_1,\dots ,\pmb {q}_m\} \subset \mathbb{R}^3$ and $\mathcal{P} = \{\pmb {p}_1,\dots ,\pmb {p}_n\} \subset \mathbb{R}^3$ with $m\geq n$ . Let $\mathcal{C}^*$ be a subset of $[m]\times [n]\coloneqq \{1,\ldots ,m\} \times \{1,\ldots ,n\}$ of size $k^{*}$ , called the inlier correspondence set, such that all pairs $(i_{1},j_{1})$ and $(i_2,j_2)$ of $\mathcal{C}^*$ satisfy $i_1\neq i_2$ and $j_{1}\neq j_{2}$ . Assume that + +$$ +\boldsymbol {q} _ {i} = \boldsymbol {R} ^ {*} \boldsymbol {p} _ {j} + \epsilon_ {i, j}, \quad \text {i f} (i, j) \in \mathcal {C} ^ {*} \tag {1} +$$ + +where $\epsilon_{i,j} \sim \mathcal{N}(0, \sigma^2 I_3)$ is noise, $R^*$ is an unknown 3D rotation, and $(\pmb{q}_i, \pmb{p}_j)$ is called an inlier. If $(i,j) \notin \mathcal{C}^*$ then $(\pmb{q}_i, \pmb{p}_j)$ is arbitrary and is called an outlier. The goal of the simultaneous rotation and correspondence search problem is to simultaneously estimate the 3D rotation $\pmb{R}^*$ and the inlier correspondence set $\mathcal{C}^*$ from point sets $\mathcal{Q}$ and $\mathcal{P}$ . + +We focus on Problem 1 for two reasons. First, it already encompasses several vision applications such as image stitching [16]. Second, the more general and more important simultaneous pose and correspondence problem, which involves an extra unknown translation in (1), reduces to Problem 1 by eliminating the translation parameters (at the cost of squaring the number of measurements) [80]. As surveyed in [38], whether accurate and fast algorithms exist for solving the pose and correspondence search is largely an open question. Therefore, solving the simpler Problem 1 efficiently is an important step for moving forward. + +For Problem 1 or its variants, there is a vast literature of algorithms that are based on i) local optimization via iterative closest points (ICP) [13, 20, 66] or graduated nonconvexity (GNC) [1, 76, 85] or others [23, 41, 59], ii) global optimization by branch & bound [18, 21, 50, 54, 55, 64, 70, 81], iii) outlier removal techniques [16, 62, 63, 69, 80], iv) semidefinite programming [39, 58, 71, 77, 79], v) RANSAC [28, 51, 52, 72], vi) deep learning [4, 9, 22, 37], and vii) spherical Fourier transform [12]. But all these methods, if able to accurately solve Problem 1 with the number $k^*$ of inliers extremely small, take $\Omega(mn)$ time. Yet we have: + +Theorem 1 (ARCS). Suppose there are at least two inliers, $k^{*} \geq 2$ , and that the point sets $\mathcal{Q}$ and $\mathcal{P}$ of Problem 1 are noiseless "in general position". Then there is an algorithm that solves Problem 1 in $O(m\log m)$ time and $O(m)$ space. + +Remark 1 (general position assumption). In Theorem 1, by "in general position" we mean that i) for any outlier $(\pmb{q}_i,\pmb{p}_j)$ , we have $\| \pmb{q}_i\| _2\neq \| \pmb{p}_j\| _2$ , ii) there exists some inlier pairs $(\pmb{q}_{i_1},\pmb{p}_{j_1})$ and $(\pmb{q}_{i_2},\pmb{p}_{j_2})$ such that $\pmb{q}_{i_1}$ and $\pmb{q}_{i_2}$ are not parallel. If point sets $\mathcal{Q}$ and $\mathcal{P}$ are randomly sampled from $\mathbb{R}^3$ , these two conditions hold true with probability 1. + +A numerical illustration of Theorem 1 is that our ARCS solver, to be described in §3, can handle the case where $m = 10^6$ , $n = 8 \times 10^5$ and $k^* = 2$ , in about 0.1 seconds (cf. Table 1). However, like other correspondence-based minimal solvers for geometric vision [29,45-47,61], ARCS might be fragile to noise. That being said, it can be extended to the noisy case, leading to a three-step algorithm called ARCS+, which we summarize next. + +The first step $\mathrm{ARCS}_{\mathrm{N}}$ of $\mathrm{ARCS}+$ extends $\mathrm{ARCS}$ by establishing correspondences under noise. $\mathrm{ARCS}_{\mathrm{N}}$ outputs in $O(\ell + m \log m)$ time a candidate correspondence set $\overline{\mathcal{C}}$ of size $\ell$ that contains $\mathcal{C}^*$ . Problem 1 then reduces to estimating $\pmb{R}^*$ and $\mathcal{C}^*$ from $\mathcal{P}, \mathcal{Q}$ , and hypothetical correspondences $\overline{\mathcal{C}}$ , a simpler task of robust rotation search [16, 63, 77, 85]. + +The second step $\mathrm{ARCS}_{\circ}$ of $\mathrm{ARCS}+$ is to remove outliers from the previous step 1. To do so we approximately maximize an appropriate consensus over $\mathrm{SO}(3)$ (§4.2). Instead of mining inliers in $\mathrm{SO}(3)$ [10, 34, 43, 50, 64], we show that the parameter space of consensus maximization can be reduced from $\mathrm{SO}(3)$ to $\mathbb{S}^2$ and further to $[0, \pi]$ (see [16] for a different reduction). With this reduction, $\mathrm{ARCS}_{\circ}$ removes outliers via repeatedly solving in $O(\ell \log \ell)$ time a computational geometry problem, interval stabbing [24] (§4.2.1). Note that $\mathrm{ARCS}_{\circ}$ only repeats for $s \approx 90$ times to reach satisfactory accuracy. Therefore, conceptually, for $\ell \geq 10^{6}$ , it is $10^{4}$ times faster than the most related outlier removal method GORE [16], which uses $O(\ell^{2} \log \ell)$ time (Table 4). + +The third and final step $\mathsf{ARCS}_{\mathbb{R}}$ of our $\mathsf{ARCS}+$ pipeline is to accurately estimate the rotation, using the consensus set from the second step (§4.3). In short, $\mathsf{ARCS}_{\mathbb{R}}$ is a Riemannian subgradient descent method. Our novelty here is to descend in the space $\mathbb{S}^3$ of unit quaternions, not $\mathrm{SO}(3)$ [14]. This allows us to derive, based on [53], that $\mathsf{ARCS}_{\mathbb{R}}$ converges linearly though locally to the ground-truth unit quaternion, thus obtaining the first to our knowledge convergence rate guarantee for robust rotation search. + +Numerical highlights are in order (§5). $\mathrm{ARCS}_{\mathrm{O}}$ is an outlier pruning procedure for robust rotation search that can handle extremely small inlier ratios $k^{*} / \ell = 3000 / 10^{7} = 0.03\%$ in 5 minutes; $\mathrm{ARCS}_{\mathrm{O}} + \mathrm{ARCS}_{\mathrm{R}}$ , or $\mathrm{ARCS}_{\mathrm{OR}}$ for short, accurately solves the robust rotation search problem with $k^{*} / \ell = 10^{3} / 10^{6}$ in 23 seconds (see Table 4). $\mathrm{ARCS}_{\mathrm{N}} + \mathrm{ARCS}_{\mathrm{OR}}$ , that is $\mathrm{ARCS}+$ , solves Problem 1 with $m = 10^{4}$ , $n = 8000$ , $k^{*} = 2000$ in 90 seconds (see Figure 2). To the best of our knowledge, all these challenging cases + +have not been considered in prior works. In fact, as we will review soon (§2), applying state-of-the-art methods to those cases either gives wrong estimates of rotations, or takes too much time ( $\geq 8$ hours), or exhausts the memory (Table 4). + +# 2. Prior Art: Accuracy Versus Scalability + +Early efforts on Problem 1 have encountered an accuracy versus scalability dilemma. The now classic ICP algorithm [13] estimates the rotation and correspondences in an alternating fashion, running in real time but requiring a high-quality and typically unavailable initialization to avoid local and usually poor minima; the same is true for its successors [20,23,41,59,66]. The GO-ICP method [81,82] of the branch & bound type enumerates initializations fed to ICP to reach a global minimum—in exponential time; the same running time bound is true for its successors [18,55,64]. + +The above ICP versus GO-ICP dilemma was somewhat alleviated by a two-step procedure: i) compute a candidate correspondence set $\hat{\mathcal{C}}$ , via hand-crafted [67] or learned [30] feature descriptors, and ii) estimate the rotation from point sets indexed by $\hat{\mathcal{C}}$ . But, as observed in [80], due to the quality of the feature descriptors, there could be fewer than 2 inliers remaining in $\hat{\mathcal{C}}$ , from which the ground-truth rotation can never be determined. An alternative and more conservative idea is to use all-to-all correspondences $\hat{\mathcal{C}} := [m] \times [n]$ , although now the inlier ratio becomes extremely small. + +This justifies why researchers have recently focused on designing robust rotation search algorithms for extreme outlier rates, e.g., $\geq 90$ outliers out of 100. One such design is GORE [16], a guaranteed outlier removal algorithm of $O(\ell^2\log \ell)$ time complexity that heavily exploits the geometry of SO(3). The other one is the semidefinite relaxation QUASAR of [77], which involves sophisticated manipulation on unit quaternions; $\ell \approx 1000$ constitutes the current limit on the number of points this relaxation can handle. Yet another one is TEASER++ [80]; its robustness to outliers comes mainly from finding via parallel branch & bound [65] a maximum clique of the graph whose vertices represent point pairs and whose edges indicate whether two point pairs can simultaneously be inliers. This maximum clique formulation was also explored by [62] where it was solved via a different branch & bound algorithm. Since finding a maximum clique is in general NP-hard, their algorithms take exponential time in the worst case; in addition, TEASER++ was implemented to trade $O(\ell^2)$ space for speed. One should also note though that if noise is small then the graph is sparse so that the otherwise intractable branch & bound algorithm can be efficient. Since constructing such a graph entails checking $\binom{\ell}{2}$ point pairs, recent follow-up works [51, 56, 69, 71, 72] that use such a graph entail $O(\ell^2)$ time complexity. While all these methods are more accurate than scalable, the following two are on the other side. FGR [85] combines graduated non-convexity + +(GNC) and alternating minimization, while GNC-TLS [76] combines truncated least squares, iteratively reweighted least-squares, and GNC. Both of them scale gracefully with $\ell$ , while being robust against up to $80 / 100 = 80\%$ outliers. + +Is such accuracy versus scalability dilemma of an inherent nature of the problems here, or can we escape from it? + +# 3. ARCS: Accuracy & Scalability + +Basic Idea. Although perhaps not explicitly mentioned in the literature, it should be known that there is a simple algorithm that solves Problem 1 under the assumptions of Theorem 1. This algorithm first computes the $\ell_2$ norm of each point in $\mathcal{Q}$ and $\mathcal{P}$ and the difference $d_{i,j} \coloneqq \left\| \pmb{q}_i \right\|_2 - \left\| \pmb{p}_j \right\|_2$ . Since $\mathcal{Q}$ and $\mathcal{P}$ are in general position (Remark 1), we have that $(\pmb{q}_i, \pmb{p}_j)$ is an inlier pair if and only if $d_{i,j} = 0$ . Based on the $d_{i,j}$ 's, extract all such inlier pairs. Since $k^* \geq 2$ , and by the general position assumption (Remark 1), there exist two inlier pairs say $(\pmb{q}_1, \pmb{p}_1)$ , $(\pmb{q}_2, \pmb{p}_2)$ such that $\pmb{q}_1$ and $\pmb{q}_2$ are not parallel. As a result and as it has been well-known since the 1980's [3, 35, 36, 57], if not even earlier [68, 75], $\pmb{R}^*$ can be determined from the two inlier pairs by SVD. + +ARCS: Efficient Implementation. Not all the $d_{i,j}$ 's should be computed in order to find the correspondence set $\mathcal{C}^*$ , meaning that the otherwise $O(mn)$ time complexity can be reduced. Our ARCS Algorithm 1 seeks all point pairs $(\pmb{q}_i, \pmb{p}_j)$ 's whose norms are close, i.e., they satisfy $|d_{i,j}| \leq c$ , for some sufficiently small $c \geq 0$ . Here $c$ is provided as an input of ARCS and set as 0 in the current context. It is clear that, under the general position assumption of Theorem 1, the set $\overline{\mathcal{C}}$ returned by ARCS is exactly the ground-truth correspondence set $\mathcal{C}^*$ . It is also clear that ARCS takes $O(m \log m)$ time and $O(m)$ space (recall $m \geq n \geq |\mathcal{C}^*|$ ). + +We proved Theorem 1. It is operating in the noiseless case that allows us to show that Problem 1 can be solved accurately and at large scale. Indeed, ARCS can handle more than $10^{6}$ points with $k^{*} = 2$ in about 0.1 seconds, even though generating those points has taken more than 0.2 seconds, as shown in Table 1. $^{2}$ Note that in the setting of Table 1 we have only $k^{*} = 2$ overlapping points, a situation where all prior methods mentioned in $\S 1$ and $\S 2$ , if directly applicable, in principle break down. One reason is that they are not designed to handle the noiseless case. The other reason is that the overlapping ratio $k^{*} / m$ of Table 1 is the minimum possible. While the achievement in Table 1 is currently limited to the noiseless case, it forms a strong motivation that urges us to robustify ARCS to noise, while keeping as much of its accuracy and scalability as possible. Such robustification is the main theme of the next section. + +Algorithm 1: ARCS +1 Input: $\mathcal{Q} = \{\pmb {q}_i\}_{i = 1}^m$ $\mathcal{P} = \{\pmb {p}_j\}_{j = 1}^n,c\geq 0;$ +2 Sort $\mathcal{Q}$ so that (w.l.o.g.) $\left\| \pmb {q}_1\right\| _2\leq \dots \leq \left\| \pmb {q}_m\right\| _2;$ +3 Sort $\mathcal{P}$ so that (w.l.o.g.) $\left\| \pmb {p}_1\right\| _2\leq \dots \leq \left\| \pmb {p}_n\right\| _2;$ +4 $i = 1;j = 1;\overline{C} = \varnothing$ +5 while $i\leq m$ and $j\leq n$ do +6 $d_{i,j}\gets \| q_i\| _2 - \| p_j\| _2;$ +7 if $d_{i,j} > c$ then +8 $j\gets j + 1;$ +9 end +10 if $d_{i,j} < - c$ then +11 $i\gets i + 1;$ +12 end +13 if $-c\leq d_{i,j}\leq c$ then +14 $|\overline{C}\gets \overline{C}\cup (i,j);(i,j)\gets (i + 1,j + 1);$ +15 end +16 end +17 return $\overline{C}$ + +Table 1. Time (msec) of generating noiseless Gaussian point sets (G) and solving Problem 1 by ARCS (100 trials, $k^{*} = 2$ ). + +
m104105106
n8 × 1038 × 1048 × 105
G5.915.0212.8
Brute Force73.883048380441.5
ARCS1.518.4121.1
+ +# 4. ARCS+: Robustifying ARCS to Noise + +Here we consider Problem 1 with noise $\epsilon_{i,j}$ . We will illustrate our algorithmic ideas by assuming $\epsilon_{i,j} \sim \mathcal{N}(0, \sigma^2 I_3)$ , although this is not necessary for actual implementation. As indicated in §1, $\mathrm{ARCS}+$ has three steps. We introduce them respectively in the next three subsections. + +# 4.1. Step 1: Finding Correspondences Under Noise + +A simple probability fact is $\left\| \pmb{q}_i - \pmb{R}^*\pmb{p}_j \right\|_2 \leq 5.54\sigma$ for any inlier $(\pmb{q}_i, \pmb{p}_j)$ , so $|d_{i,j}| \leq 5.54\sigma$ with probability at least $1 - 10^{-6}$ (see, e.g., [80]). To establish correspondences under noise, we need to modify the while loop of Algorithm 1, such that, in $O(\ell + m\log m)$ time, it returns the set $\overline{\mathcal{C}}$ of all correspondences of size $\ell$ where each $(i,j) \in \overline{\mathcal{C}}$ satisfies $|d_{i,j}| \leq c$ , with $c$ now set to $5.54\sigma$ . Note that, to store the output correspondences, we need an extra $O(\ell)$ time, which can not be simply ignored as $\ell$ is in general larger than $m$ in the presence of noise (Table 2). We call this modified version $\mathrm{ARCS}_{+N}$ . $\mathrm{ARCS}_{+N}$ gives a set $\overline{\mathcal{C}}$ that + +Table 2. The number $\ell$ of candidate correspondences produced by ${\mathrm{{ARCS}}}_{ + }{}_{\mathrm{N}}$ on synthetic noisy Gaussian point sets. A single trial. + +
m1000500010000
n80040008000
k*20010002000
l366229312083762888
l/(mn)4.58%4.66%4.70%
+ +contains all inlier correspondences $\mathcal{C}^*$ with probability at least $(1 - 10^{-6})^{k^*}$ . This probability is larger than $99.9\%$ if $k^* \leq 10^3$ , or larger than $99\%$ if $k^* \leq 10^4$ . + +Remark 2 (feature matching versus all-to-all correspondences versus $\mathsf{ARCS} + _N$ ). Feature matching methods provide fewer than $n$ hypothetical correspondences and thus speed up the subsequent computation, but they might give no inliers. Using all-to-all correspondences preserves all inliers, but a naive computation needs $O(mn)$ time and leads to a large-scale problem with extreme outlier rates. $\mathsf{ARCS} + _N$ strikes a balance by delivering in $O(\ell +m\log m)$ time a candidate correspondence set $\overline{\mathcal{C}}$ of size $\ell$ containing all inliers with high probability and with $\ell \ll mn$ . + +For illustration, Table 2 reports the number $\ell$ of correspondences that $\mathrm{ARCS}_{\mathrm{N}}$ typically yields. As shown, even though $\ell / (mn)$ is usually smaller than $5\%$ , yet $\ell$ itself could be very large, and the inlier ratio $k^{*} / \ell$ is extremely small ( $e.g., \leq 0.05\%$ ). This is perhaps the best we could do for the current stage, because for now we only considered every point pair individually, while any pair $(q_{i}, p_{i})$ is a potential inlier if it satisfies the necessary (but no longer sufficient) condition $|d_{i,j}| \leq c$ . On the other hand, collectively analyzing the remaining point pairs allows us to further remove outliers, and this is the major task of our next stage ( $\S 4.2$ ). + +# 4.2. Step 2: Outlier Removal + +Let there be some correspondences given, by, e.g., either $\mathsf{ARCS} + _{\mathbb{N}}$ or feature matching (cf. Remark 2). Then we arrive at an important special case of Problem 1, called robust rotation search. For convenience we formalize it below: + +Problem 2. (robust rotation search) Consider $\ell$ pairs of 3D points $\{(\pmb {y}_i,\pmb {x}_i)\}_{i = 1}^\ell$ , with each pair satisfying + +$$ +\boldsymbol {y} _ {i} = \boldsymbol {R} ^ {*} \boldsymbol {x} _ {i} + \boldsymbol {o} _ {i} + \boldsymbol {\epsilon} _ {i}. \tag {2} +$$ + +Here $\epsilon_{i}\sim \mathcal{N}(0,\sigma^{2}I_{3})$ is noise, $o_i = 0$ if $i\in \mathcal{I}^*$ where $\mathcal{I}^*\subset [\ell ]$ is of size $k^{*}$ , and if $i\notin \mathcal{I}^*$ then $o_i$ is nonzero and arbitrary. The task is to find $\pmb{R}^{*}$ and $\mathcal{I}^*$ . + +The percentage of outliers in Problem 2 can be quite large (cf. Table 2), so our second step $\mathsf{ARCS}_{\circ}$ here is to remove outliers. In §4.2.1, we shortly review the interval stabbing problem, on which $\mathsf{ARCS}_{\circ}$ of §4.2.2 is based. + +# 4.2.1 Preliminaries: Interval Stabbing + +Consider a collection of subsets of $\mathbb{R}$ , $\{\mathcal{J}_i\}_{i=1}^L$ , where each $\mathcal{J}_i$ is an interval of the form $[a, b]$ . In the interval stabbing problem, one needs to determine a point $\omega \in \mathbb{R}$ and a subset $\mathcal{I}$ of $\{\mathcal{J}_i\}_{i=1}^L$ , so that $\mathcal{I}$ is a maximal subset whose intervals overlap at $\omega$ . Formally, we need to solve + +$$ +\max _ {\mathcal {I} \subset [ L ], \omega \in \mathbb {R}} | \mathcal {I} | \tag {3} +$$ + +$$ +\begin{array}{l l} \text {s . t .} & \omega \in \mathcal {J} _ {i}, \forall i \in \mathcal {I} \end{array} +$$ + +For this purpose, the following result is known. + +Lemma 1 (interval stabbing). Problem (3) can be solved in $O(L \log L)$ time and $O(L)$ space. + +Actually, the interval stabbing problem can be solved using sophisticated data structures such as interval tree [24] or interval skip list [32]. On the other hand, it is a basic exercise to find an algorithm that solves Problem (3), which, though also in $O(L \log L)$ time, involves only a sorting operation and a for loop (details are omitted, see, e.g., [17]). Finally, note that the use of interval stabbing for robust rotation search is not novel, and can be found in GORE [16, 63]. However, as the reader might realize after §4.2.2, our use of interval stabbing is quite different from GORE. + +# 4.2.2 The Outlier Removal Algorithm + +We now consider the following consensus maximization: + +$$ +\max _ {\mathcal {I} \subset [ \ell ], \boldsymbol {R} \in \operatorname {S O} (3)} | \mathcal {I} | \tag {4} +$$ + +$$ +\begin{array}{l} \text {s . t .} \quad \| \boldsymbol {y} _ {i} - \boldsymbol {R x} _ {i} \| _ {2} \leq c, \forall i \in \mathcal {I}. \end{array} +$$ + +It has been shown in [73] that for the very related robust fitting problem, such consensus maximization is in general NP-hard. Thus it seems only prudent to switch our computational goal from solving (4) exactly to approximately. + +From SO(3) to $\mathbb{S}^2$ . Towards this goal, we first shift our attention to $\mathbb{S}^2$ where the rotation axis $b^{*}$ of $R^{*}$ lives. An interesting observation is that the axis $b^{*}$ has the following interplay with data, independent of the rotation angle of $R^{*}$ . + +Proposition 1. Let $\pmb{v}_i\coloneqq \pmb {y}_i - \pmb {x}_i$ . Recall $\epsilon_{i}\sim \mathcal{N}(0,\sigma^{2}\pmb{I}_{3})$ If $(\pmb {y}_i,\pmb {x}_i)$ is an inlier pair, then $\pmb{v}_i^\top \pmb {b}^*\sim \mathcal{N}(0,\sigma^2)$ , and so $|\pmb {v}_i^\top \pmb {b}^* |\leq 4.9\sigma$ with probability at least $1 - 10^{-6}$ + +Proposition 1 (cf. Appendix C) leads us to Problem (5): + +$$ +\max _ {\mathcal {I} \subset [ \ell ], \boldsymbol {b} \in \mathbb {S} ^ {2}} \quad | \mathcal {I} | +$$ + +$$ +\text {s . t .} \quad | \boldsymbol {v} _ {i} ^ {\top} \boldsymbol {b} | \leq \bar {c}, \forall i \in \mathcal {I} \tag {5} +$$ + +$$ +b _ {2} \geq 0. +$$ + +In (5) the constraint on the second entry $b_{2}$ of $\pmb{b}$ is to eliminate the symmetry, and Proposition 1 suggests to set $\bar{c} := 4.9\sigma$ . Problem (5) is easier than (4) as it has fewer degrees of freedom; see also [16] where a different reduction to a 2 DoF (sub-)problem was derived for GORE. + +Solving (5) is expected to yield an accurate estimate of $\pmb{b}^*$ , from which the rotation angle can later be estimated. Problem (5) reads: find a plane (defined by the normal $\pmb{b}$ ) that approximately contains as much points $\pmb{v}_i$ 's as possible. This is an instance of the robust subspace learning problem [25, 26, 48, 74, 83, 86, 87], for which various scalable algorithms with strong theoretical guarantees have been developed in more tractable formulations (e.g., $\ell_1$ minimization) than consensus maximization. Most notably, the so-called dual principal component pursuit formulation [74] was proved in [87] to be able to tolerate $O\left((k^*)^2\right)$ outliers. Still, all these methods can not handle as many outliers as we currently have (cf. Table 2), even though they can often minimize their objective functions to global optimality. + +From $\mathbb{S}^2$ to $[0,\pi ]$ . We can further "reduce" the degrees of freedom in (5) by 1, through the following lens. Certainly $\pmb {b}\in \mathbb{S}^2$ in (5) is determined by two angles $\theta \in [0,\pi ]$ , $\phi \in [0,\pi ]$ . Now consider the following problem: + +$$ +\max _ {\mathcal {I} \subset [ \ell ], \theta \in [ 0, \pi ]} \qquad | \mathcal {I} | +$$ + +s.t. $|\pmb{v}_i^\top \pmb{b}| \leq \bar{c}, \forall i \in \mathcal{I}$ (6) + +$$ +\pmb {b} = \left[ \sin (\theta) \cos (\phi), \sin (\theta) \sin (\phi), \cos (\theta) \right] ^ {\top}. +$$ + +Problem (6) is a simplified version of (5) with $\phi$ given. Clearly, to solve (5) it suffices to minimize the function $f:[0,\pi ]\to \mathbb{R}$ which maps any $\phi_0\in [0,\pi ]$ to the objective value of (6) with $\phi = \phi_0$ . Moreover, we have: + +Proposition 2. Problem (6) can be solved in $O(\ell \log \ell)$ time and $O(\ell)$ space via interval stabbing. + +Proposition 2 gives an $O(\ell \log \ell)$ time oracle to access the values of $f$ . Since computing the objective value of (5) given $\theta, \phi$ already needs $O(\ell)$ time, the extra cost of the logarithmic factor in Proposition 2 is nearly negligible. Since $f$ has only one degree of freedom, its global minimizer can be found by one-dimensional branch & bound [42]. But this entails exponential time complexity in the worst case, a situation we wish to sidestep. Alternatively, the search space $[0, \pi]$ is now so small that the following algorithm $\mathsf{ARCS} + _{\circ}$ turns out to be surprisingly efficient and robust: i) sampling from $[0, \pi]$ , ii) stabbing in $\mathbb{S}^2$ , and iii) stabbing in SO(3). + +Sampling from $[0, \pi]$ . Take $s$ equally spaced points $\phi_j = (2j - 1)\pi/(2s), \forall j \in [s]$ , on $[0, \pi]$ . The reader may find this choice of $\phi_j$ 's similar to the uniform grid approach [60]; in the latter Nesterov commented that "the reason why it works here is related to the dimension of the problem". + +![](images/024eb56fb7759f11ab2ac160ef26a22e1fa7f302f19a104179c8f78356126e57.jpg) +(a) $\mathrm{ARCS} + _{\mathrm{O}}$ + +![](images/6f58d7f32efa3db36413ca2e47422a003027c10645007aa62750990c6115bdec.jpg) +(b) $\mathrm{ARCS} + _{\mathrm{OR}}$ +Figure 1. Rotation errors (in degrees) of steps 2 and 3 for robust rotation search methods with $s$ varying (500 trials, $\sigma = 0.01$ ). + +Stabbing in $\mathbb{S}^2$ . For each $j \in [s]$ , solve (6) with $\phi = \phi_j$ to get $s$ candidate consensus set $\mathcal{I}_j$ 's and $s$ angles $\theta_j$ 's. From each $\phi_j$ and $\theta_j$ we obtain a candidate rotation axis $\pmb{b}_j$ . + +Stabbing in SO(3). Since now we have estimates of rotation axes, $\pmb{b}_{j}$ 's, there is one degree of freedom remaining, the rotation angle $\omega$ . For this we consider: + +$$ +\max _ {\mathcal {I} \subset [ \ell ], \omega \in [ 0, 2 \pi ]} \qquad | \mathcal {I} | +$$ + +s.t. $\left\| \pmb{y}_i - \pmb{R}\pmb{x}_i\right\|_2 \leq c, \forall i \in \mathcal{I}$ (7) + +$$ +\boldsymbol {R} = \boldsymbol {b} \boldsymbol {b} ^ {\top} + [ \boldsymbol {b} ] _ {\times} \sin (\omega) + (\boldsymbol {I} _ {3} - \boldsymbol {b} \boldsymbol {b} ^ {\top}) \cos (\omega) +$$ + +Here $[b]_{\times} \in \mathbb{R}^{3 \times 3}$ denotes the matrix generating the cross product $\times$ by $b$ , that is $[b]_{\times}a = b \times a$ for all $a \in \mathbb{R}^3$ . Similarly to Proposition 2, we have the following result: + +Proposition 3. Problem (7) can be solved in $O(\ell \log \ell)$ time and $O(\ell)$ space via interval stabbing. + +After solving (7) with $\pmb{b} = \pmb{b}_j$ for each $j \in [s]$ , we obtain $s$ candidate consensus sets $\tilde{\mathcal{I}}_1, \ldots, \tilde{\mathcal{I}}_s$ , and we choose the one with maximal cardinality as an approximate solution to (4). Finally, notice that the time complexity $O(s\ell \log \ell)$ of $\mathrm{ARCS}_{\circ} +$ depends on the hyper-parameter $s$ . We set $s = 90$ as an invariant choice, as suggested by Figure 1. + +This output consensus set $\tilde{\mathcal{I}}$ typically has very few outliers; see Table 3. Thus it will be used next in $\mathrm{ARCS}_{\mathrm{R}}$ , our final step for accurately estimating the rotation (§4.3). + +Table 3. The output of $\mathrm{ARCS}_{+0}$ with inputs from Table 2. + +
Input Inlier Ratio20036622100093120820003762888
Output Inlier Ratio199213993131419513184
+ +# 4.3. Step 3: Rotation Estimation + +The final step $\mathrm{ARCS}_{\mathbb{R}}$ of $\mathrm{ARCS}+$ is a refinement procedure that performs robust rotation search on the output correspondences $\tilde{\mathcal{I}}$ of $\mathrm{ARCS}_{\mathbb{O}}$ . Since $\tilde{\mathcal{I}}$ contains much fewer + +outlier correspondences than we previously had (cf. Table 2 and 3), in what follows we simplify the notations by focusing on the point set $\{(\pmb {y}_i,\pmb {x}_i)\}_{i\in [\ell ]}$ , which we assume has few outliers (say $\leq 50\%$ ). Then, a natural formulation is + +$$ +\min _ {\boldsymbol {R} \in \mathrm {S O} (3)} \sum_ {i = 1} ^ {\ell} \left\| \boldsymbol {y} _ {i} - \boldsymbol {R} \boldsymbol {x} _ {i} \right\| _ {2}. \tag {8} +$$ + +Problem (8) appears easier to solve than consensus maximization (4), as it has a convex objective function at least. Next we present the $\mathrm{ARCS}_{\mathbb{R}}$ algorithm and its theory. + +Algorithm. We start with the following equivalence. + +Proposition 4. We have $\boldsymbol{w}^{\top}\boldsymbol{D}_{i}\boldsymbol{w} = \left\| \boldsymbol{y}_{i} - \boldsymbol{R}\boldsymbol{x}_{i}\right\|_{2}^{2}$ , where $\boldsymbol{w} \in \mathbb{S}^{3}$ is a quaternion representation of $\boldsymbol{R}$ of (8), and $\boldsymbol{D}_{i} \in \mathbb{R}^{4\times 4}$ is a positive semi-definite matrix whose entries depend on $\boldsymbol{x}_{i}, \boldsymbol{y}_{i}$ . So Problem (8) is equivalent to + +$$ +\min _ {\boldsymbol {w} \in \mathbb {S} ^ {3}} h (\boldsymbol {w}), \quad h (\boldsymbol {w}) = \sum_ {i = 1} ^ {\ell} \sqrt {\boldsymbol {w} ^ {\top} \boldsymbol {D} _ {i} \boldsymbol {w}}. \tag {9} +$$ + +The exact relation between unit quaternions and rotations is reviewed in Appendix A, where Proposition 4 is proved and the expression of $D_{i}$ is given. For what follows, it suffices to know that a unit quaternion is simply a unit vector of $\mathbb{R}^4$ , and that the space of unit quaternions is $\mathbb{S}^3$ . + +Note that the objective $h$ of (9) is convex, while both problems (8) and (9) are nonconvex (due to the constraint) and nonsmooth (due to the objective). Though (8) and (9) are equivalent, the advantage of (9) will manifest itself soon. Before that, we first introduce the $\mathrm{ARCS}_{\mathbb{R}} +$ algorithm for solving (9). $\mathrm{ARCS}_{\mathbb{R}} +$ falls into the general Riemannian subgradient descent framework (see, e.g., [53]). It is initialized at some unit quaternion $w^{(0)} \in \mathbb{S}^3$ and proceeds by + +$$ +\boldsymbol {w} ^ {(t + 1)} \leftarrow \operatorname {P r o j} _ {\mathbb {S} ^ {3}} \left(\boldsymbol {w} ^ {(t)} - \gamma^ {(t)} \tilde {\nabla} _ {s} h (\boldsymbol {w} ^ {(t)})\right), \tag {10} +$$ + +where $\mathrm{Proj}_{\mathbb{S}^3}(\cdot)$ projects a vector onto $\mathbb{S}^3$ , $\gamma^{(t)}$ is some step-size, $\tilde{\nabla}_{\mathrm{s}}h(\boldsymbol{w}^{(t)})$ is a Riemannian subgradient of $h$ at $\boldsymbol{w}^{(t)}$ . + +Theory. Now we are able to compare (8) and (9) from a theoretical perspective. As proved in [14], for any fixed outlier ratio and $k^{*} > 0$ , Riemannian subgradient descent when applied to (8) with proper initialization converges to $\pmb{R}^{*}$ in finite time, as long as i) $\ell$ is sufficiently large, ii) all points $y_{i}$ 's and $x_{i}$ 's are uniformly distributed on $\mathbb{S}^2$ , iii) there is no noise. But in [14] no convergence rate is given. One main challenge of establishing convergence rates there is that projecting on $\mathrm{SO}(3)$ does not enjoy a certain kind of nonexpansiveness property, which is important for convergence analysis (cf. Lemma 1 of [53]). On the other hand, + +projection onto $\mathbb{S}^3$ of (9) does satisfy such property. As a result, we are able to provide convergence rate guarantees for $\mathrm{ARCS}_{\mathrm{R}}$ . For example, it follows directly from Theorem 2 of [53] that $\mathrm{ARCS}_{\mathrm{R}}(10)$ converges to an $\varepsilon$ -stationary point in $O(\varepsilon^{-4})$ iterations, even if initialized arbitrarily. + +We next give conditions for $\mathrm{ARCS}_{\mathbb{R}}$ to converge linearly to the ground-truth unit quaternion $\pm \pmb{w}^{*}$ that represents $\pmb{R}^{*}$ . Let the distance between a unit quaternion $\pmb{w}$ and $\pm \pmb{w}^{*}$ be + +$$ +\operatorname {d i s t} (\boldsymbol {w}, \pm \boldsymbol {w} ^ {*}) := \min \left\{\left\| \boldsymbol {w} - \boldsymbol {w} ^ {*} \right\| _ {2}, \left\| \boldsymbol {w} + \boldsymbol {w} ^ {*} \right\| _ {2} \right\}. +$$ + +If $\mathrm{dist}(\pmb {w},\pm \pmb{w}^{*}) < \rho$ with $\rho >0$ then $\pmb{w}$ is called $\rho$ -close to $\pm \pmb{w}^*$ . We need the following notion of sharpness. + +Definition 1 (sharpness [15, 44, 49, 53]). We say that $\pm \pmb{w}^{*}$ is an $\alpha$ -sharp minimum of (9) if $\alpha > 0$ and if there exists a number $\rho_{\alpha} > 0$ such that any unit quaternion $\pmb{w} \in \mathbb{S}^3$ that is $\rho_{\alpha}$ -close to $\pm \pmb{w}^{*}$ satisfies the inequality + +$$ +h (\boldsymbol {w}) - h \left(\boldsymbol {w} ^ {*}\right) \geq \alpha \operatorname {d i s t} \left(\boldsymbol {w}, \pm \boldsymbol {w} ^ {*}\right). \tag {11} +$$ + +We provide a condition below for $\pm \pmb{w}^{*}$ to be $\alpha^{*}$ -sharp: + +Proposition 5. If $\alpha^{*} := k^{*}\eta_{\min} / \sqrt{2} - (\ell - k^{*})\eta_{\max} > 0$ and if $\epsilon_{i} = 0$ in Problem 2, then Problem (9) admits $\pm w^{*}$ as an $\alpha^{*}$ -sharp minimum. Here $\eta_{\min}, \eta_{\max}$ are respectively + +$$ +\eta_ {\min } := \frac {1}{k ^ {*}} \min _ {\boldsymbol {w} \in \mathcal {S} ^ {*} \cap \mathbb {S} ^ {3}} \sum_ {i \in \mathcal {I} ^ {*}} \sqrt {\boldsymbol {w} ^ {\top} \boldsymbol {D} _ {i} \boldsymbol {w}}, a n d \tag {12} +$$ + +$$ +\eta_ {\max } := \frac {1}{\ell - k ^ {*}} \max _ {\boldsymbol {w} \in \mathbb {S} ^ {3}} \sum_ {i \in [ \ell ] \backslash \mathcal {I} ^ {*}} \sqrt {\boldsymbol {w} ^ {\top} \boldsymbol {D} _ {i} \boldsymbol {w}}, \tag {13} +$$ + +where $S^{*}$ is the hyperplane of $\mathbb{R}^4$ perpendicular to $\pm \pmb{w}^{*}$ . + +Proposition 5 is proved in Appendix B.1. The condition $\alpha^{*} > 0$ defines a relation between the number of inliers $(k^{*})$ and outliers $(\ell - k^{*})$ , and involves two quantities $\eta_{\mathrm{min}}$ and $\eta_{\mathrm{max}}$ whose values depend on how $D_{i}$ 's are distributed on the positive semi-definite cone. We offer probabilistic interpretations for $\eta_{\mathrm{min}}$ and $\eta_{\mathrm{max}}$ in Appendix B.2. + +With Theorem 4 of [53] and Proposition 5 we have that $\mathsf{ARCS}_{\mathbb{R}} + _{\mathbb{R}}(10)$ , if initialized properly and with suitable step-sizes, converges linearly to the ground-truth unit quaternion $\pm \pmb{w}^{*}$ , as long as $\pm \pmb{w}^{*}$ is $\alpha^{*}$ -sharp. A formal statement is: + +Theorem 2. Suppose $\alpha^{*}:= k^{*}\eta_{\mathrm{min}} / \sqrt{2} -(\ell -k^{*})\eta_{\mathrm{max}}>$ 0. Let $L_{h}$ be a Lipschitz constant of $h$ . Run Riemannian subgradient descent $\mathsf{ARCS}_{+R}$ (10) with initialization $\pmb{w}^{(0)}$ satisfying $\mathrm{dist}(\pmb{w}^{(0)},\pm \pmb{w}^{*})\leq \min \{\alpha^{*} / L_{h},\rho_{\alpha^{*}}\}$ and with geometrically diminishing step sizes $\gamma^{(t)} = \beta^t\gamma^{(0)}$ , where + +$$ +\gamma^ {(0)} < \min \left\{\frac {2 e _ {0} \left(\alpha^ {*} - L _ {h} e _ {0}\right)}{L _ {h} ^ {2}}, \frac {e _ {0}}{2 \left(\alpha^ {*} - L _ {h} e _ {0}\right)} \right\}, +$$ + +$$ +\beta^ {2} \in \left[ 1 + 2 \left(L _ {h} - \frac {\alpha^ {*}}{e _ {0}}\right) \gamma^ {(0)} + \frac {L _ {h} ^ {2} (\gamma^ {(0)}) ^ {2}}{e _ {0} ^ {2}}, 1\right), +$$ + +$$ +e _ {0} = \min \left\{\max \left\{\operatorname {d i s t} \left(\boldsymbol {w} ^ {(0)}, \pm \boldsymbol {w} ^ {*}\right), \frac {\alpha^ {*}}{2 L _ {h}} \right\}, \rho_ {\alpha^ {*}} \right\}. +$$ + +Table 4. Average errors in degrees | standard deviation | running times in seconds of various algorithms on synthetic data (20 trials). + +
Inlier Ratio k* /ell103/105= 1%103/106= 0.1%3×103/5×106= 0.06%3×103/107= 0.03%103/107= 0.01%
TEASER++ [80]out-of-memory
RANSAC0.39 | 0.20 | 29.1≥ 8.4 hours
GORE [16,63]3.43 | 2.10 | 1698≥ 12 hours
FGR [85]52.2 | 68.5 | 3.6495.0 | 60.9 | 37.784.9 | 59.4 | 14586.5 | 56.9 | 31197.3 | 61.3 | 314
GNC-TLS [76]3.86 | 9.51 | 0.1363.4 | 50.5 | 2.2649.9 | 31.1 | 15.990.2 | 45.6 | 40.1120 | 34.3 | 36.3
ARCS+R9.92 | 13.1 | 0.1265.2 | 48.9 | 0.9655.6 | 38.3 | 5.5888.4 | 36.2 | 12.698.2 | 36.0 | 12.2
ARCS+O0.86 | 0.29 | 1.710.99 | 0.37 | 23.20.91 | 0.30 | 1250.98 | 0.42 | 28755.6 | 60.9 | 281
ARCS+OR0.03 | 0.03 | 1.720.09 | 0.07 | 23.20.11 | 0.07 | 1250.22 | 0.15 | 28755.4 | 60.1 | 281
+ +In the noiseless case $(\epsilon_{i} = 0)$ we have each $\pmb{w}^{(t)}$ satisfying + +$$ +\operatorname {d i s t} \left(\boldsymbol {w} ^ {(t)}, \pm \boldsymbol {w} ^ {*}\right) \leq \beta^ {t} e _ {0}. \tag {14} +$$ + +Remark 3 (a posteriori optimality guarantees). Theorem 2 endows $\mathsf{ARCS}_{\mathbb{R}} + (10)$ with convergence guarantee. On the other hand, a posteriori optimality guarantees can be obtained via semidefinite certification [5, 19, 78, 80]. + +# 5. Experiments + +In this section we evaluate $\mathsf{ARCS}+$ via synthetic and real experiments for Problem 1, simultaneous rotation and correspondence search. We also evaluate its components, namely $\mathsf{ARCS}_{\circ}$ ( $\S 4.2$ ) and $\mathsf{ARCS}_{\mathbb{R}}$ ( $\S 4.3$ ) for Problem 2, robust rotation search, as it is a task of independent interest. For both of the two problems we compare the following state-of-the-art methods (reviewed in $\S 2$ ): FGR [85], GORE [16], RANSAC, GNC-TLS [76], and TEASER++ [80]. + +# 5.1. Experiments on Synthetic Point Clouds + +Setup. We set $\sigma = 0.01$ , $\bar{c} = c = 5.54\sigma$ , $n = \lfloor 0.8m \rfloor$ , and $s = 90$ unless otherwise specified. For all other methods we used default or otherwise appropriate parameters. We implemented $\mathsf{ARCS}^+$ in MATLAB. No parallelization was explicitly used and no special care was taken for speed. + +Robust Rotation Search. From $\mathcal{N}(0, I_3)$ we randomly sampled point pairs $\{(y_i, x_i)\}_{i=1}^{\ell}$ with $k^*$ inliers and noise $\epsilon_i \sim \mathcal{N}(0, \sigma^2 I_3)$ . Specifically, we generated the ground-truth rotation $\pmb{R}^*$ from an axis randomly sampled from $\mathbb{S}^2$ and an angle from $[0, 2\pi]$ , rotated $k^*$ points randomly sampled from $\mathcal{N}(0, I_3)$ by $\pmb{R}^*$ , and added noise to obtain $k^*$ inlier pairs. Every outlier point $\pmb{y}_j$ or $\pmb{x}_j$ was randomly sampled from $\mathcal{N}(0, I_3)$ with the constraint $-c \leq \| \pmb{y}_j \|_2 - \| \pmb{x}_j \|_2 \leq c$ ; otherwise $(\pmb{y}_j, \pmb{x}_j)$ might simply be detected and removed by computing $\| \pmb{y}_j \|_2 - \| \pmb{x}_j \|_2$ . + +We compared $\mathrm{ARCS}_{\mathrm{o}}$ and $\mathrm{ARCS}_{\mathrm{R}}$ and their combination $\mathrm{ARCS}_{\mathrm{OR}}$ with prior works. The results are in Table 4. We first numerically illustrate the accuracy versus scalability dilemma in prior works (§2). On the one + +hand, we observed an extreme where accuracy overcomes scalability: RANSAC performed well with error 0.39 when $k^{*} / \ell = 10^{3} / 10^{5}$ , but its running time increased greatly with decreasing inlier ratio, from 29 seconds to more than 8.4 hours. The other extreme is where scalability overcomes accuracy: Both GNC-TLS and FGR failed in presence of such many outliers—as expected—even though their running time scales linearly with $\ell$ . + +Table 4 also depicted the performance of our proposals $\mathrm{ARCS}_{\mathrm{o}}$ and $\mathrm{ARCS}_{\mathrm{R}}$ . Our approximate consensus strategy $\mathrm{ARCS}_{\mathrm{o}}$ reached a balance between accuracy and scalability. In terms of accuracy, it made errors smaller than 1 degree, as long as there are more than $3 \times 10^{3} / 10^{7} = 0.03\%$ inliers; this was further refined by Riemannian subgradient descent $\mathrm{ARCS}_{\mathrm{R}}$ , so that their combination $\mathrm{ARCS}_{\mathrm{OR}}$ had even lower errors. In terms of scalability, we observed that $\mathrm{ARCS}_{\mathrm{OR}}$ is uniformly faster than FGR, and is at least 1800 times faster than GORE for $k^{*} / \ell = 10^{3} / 10^{6} = 0.1\%$ . But it had been harder to measure exactly how faster $\mathrm{ARCS}_{\mathrm{OR}}$ is than GORE and RANSAC for even larger point sets. Finally, $\mathrm{ARCS}_{\mathrm{OR}}$ failed at $k^{*} / \ell = 10^{3} / 10^{7} = 0.01\%$ . + +Simultaneous Rotation and Correspondence Search. We randomly sampled point sets $\mathcal{Q}$ and $\mathcal{P}$ from $\mathcal{N}(0, I_3)$ with $k^*$ inlier pairs and noise $\epsilon_{i,j} \sim \mathcal{N}(0, \sigma^2 I_3)$ (cf. Problem 1). Each outlier point was randomly and independently drawn also from $\mathcal{N}(0, I_3)$ . Figure 2 shows that $\mathrm{ARCS+}$ accurately estimated the rotations for $k^* \geq 2000$ (in 90 seconds), and broke down at $k^* = 1000$ , a situation where there were $k^*/m = 10\%$ overlapping points. We did not compare methods like TEASER++, GORE, RANSAC here, because giving them correspondences from $\mathrm{ARCS+}_\mathrm{N}$ would result unsatisfactory running time or accuracy (recall Tables 2 and 4), while feature matching methods like FPFH do not perform well on random synthetic data. + +# 5.2. Experiments on 3DMatch + +The 3DMatch $^6$ dataset [84] contains more than 1000 point clouds for testing, representing 8 different scenes + +Table 5. Success rates of methods run on the scene pairs of the 3DMatch dataset [84] for which the ground-truth rotation and translation are provided (rotation error smaller than 10 degree means a success [80]; see also the first paragraph of Appendix E). + +
Scene Type +# Scene PairsKitchen +506Home 1 +156Home 2 +208Hotel 1 +226Hotel 2 +104Hotel 3 +54Study Room +292MIT Lab +77Overall +1623
TEASER++99.0%98.1%94.7%98.7%99.0%98.1%97.0%94.8%97.72%
ARCS++OR98.4%97.4%95.7%98.7%98.1%100%97.3%96.1%97.72%
+ +![](images/0d5c1e227f0726ec35a6ca43cb10ca444f27aa03092a27168715e24e603183f7.jpg) +Figure 2. Rotation errors of $\mathbb{A}\mathbb{R}\mathbb{C}\mathbb{S}+$ on synthetic Gaussian point clouds. 20 trials, $m = 10^{4}$ , $n = \lfloor 0.8m\rfloor$ , $\sigma = 0.01$ . + +(such as kitchen, hotel, etc.), while the number of point clouds for each scene ranges from 77 to 506. Each point cloud has more than $10^{5}$ points, yet in [84] there are 5000 keypoints for each cloud. We used the pretrained model7 of the 3DSmoothNet [30] to extract descriptors from these key points, and matched them using the Matlab function pmatchfeatures, with its parameter MatchThreshold set to the maximum 1. We assume that the ground-truth translation $\pmb{t}^*$ is given, and run TEASER++ and $\mathrm{ARCS}_{\mathrm{OR}}$ on $(\pmb{y}_i - \pmb{t}^*, \pmb{x}_i)$ 's; the performance is comparable. We did not compare other methods here, as TEASER++ currently has the best performance on 3DMatch (to the best of our knowledge); see [80] for comparison with optimization-based methods, and see [22] for the success rates (recall) of deep learning methods. + +See the supplementary materials for more experiments. + +# 6. Discussion and Future Work + +Despite of the progress that we made for robust rotation search and simultaneous rotation and correspondence search on large-scale point clouds, our ARCS+ pipeline has a few limitations, and we discuss them next. + +For small datasets (e.g., $\ell \leq 500$ ), as in homography fitting [16], other methods, e.g., MAGSAC++ [6-8], VSAC [40], TEASER++ [80], and GORE [16] might be considered with higher priority; they come with efficient C++ implementations. For more points, e.g., $\ell \geq 10^4$ , but with higher inlier rates than in Table 4 (e.g., $\geq 15\%$ ), GNC-TLS [76] and RANSAC are our recommendations for what to use. + +Modern point clouds have more than $10^{5}$ points, and are naturally correspondences-less (cf. [17]). ARCS operates at that scale in the absence of noise (Table 1), while $\mathrm{ARCS + }$ can handle $m,n\approx 10000$ (Figure 2) and $\mathrm{ARCS + _{OR}}$ can handle $\ell \approx 10^7$ correspondences (Table 4); all these are limited to the rotation-only case. To find rotation (and translation) from such point sets "in the wild", it seems inevitable to downsample them. An interesting future work is to theoretically quantify the tradeoff between downsampling factors and the final registration performance. Another tradeoff to quantify, as implied by Remark 2, is this: Can we design a correspondence matching algorithm that better balances the number of remaining points and the number of remaining inliers? In particular, such matching should take specific pose into consideration (cf. ARCS); many methods did not. + +Like TEASER++, GORE, GNC-TLS, RANSAC, our algorithm relies on an inlier threshold $c$ . While how to set this hyper-parameter suitably is known for Gaussian noise with given variance, in practice the distance threshold is usually chosen empirically, as Hartley & Zisserman wrote [33]. While mis-specification of $c$ could fail the registration, certain heuristics have been developed to alleviate the sensitivity to such mis-specification; see [2, 6-8]. Finally, our experience is to set $c$ based on the scale of the point clouds. + +Our outlier removal component $\mathsf{ARCS}_{\circ}$ presented good performance (Table 3), yet with no optimality guarantees. Note that, with $s = 90$ we have $|\phi_j - \phi^*| \leq 1$ for some $\phi_j$ , while Figure 1a shows that $\mathsf{ARCS}_{\circ}$ gave roughly 1 degree error at $s = 90$ . Theoretically justifying this is left as future work. Without guarantees, registration could fail, which might lead to undesired consequences in safety-critical applications. On the other hand, we believe that $\mathsf{ARCS}+$ is a good demonstration of trading optimality guarantees for accuracy and scalability; enforcing all of the three properties amounts to requiring solving NP hard problems efficiently at large scale! In fact, since any solutions might get certified for optimality (Remark 3), bold algorithmic design ideas can be taken towards improving accuracy and scalability, while relying on other tools for optimality certification. + +Acknowledgments. The first author was supported by the MINDS PhD fellowship at Johns Hopkins University. This work was supported by NSF Grants 1704458 and 1934979, and by the Northrop Grumman Mission Systems Research in Applications for Learning Machines (REALM) initiative. + +# References + +[1] Pasquale Antonante, Vasileios Tzoumas, Heng Yang, and Luca Carlone. Outlier-robust estimation: Hardness, minimally-tuned algorithms, and applications. Technical report, arXiv:2007.15109v2 [cs.CV], 2020. 1 +[2] Pasquale Antonante, Vasileios Tzoumas, Heng Yang, and Luca Carlone. Outlier-robust estimation: Hardness, minimally tuned algorithms, and applications. IEEE Transactions on Robotics, 2021. 8 +[3] K Somani Arun, Thomas S Huang, and Steven D Blostein. Least-squares fitting of two 3D point sets. IEEE Transactions on Pattern Analysis and Machine Intelligence, (5):698-700, 1987. 3 +[4] Xuyang Bai, Zixin Luo, Lei Zhou, Hongkai Chen, Lei Li, Zeyu Hu, Hongbo Fu, and Chiew-Lan Tai. Pointdsc: Robust point cloud registration using deep spatial consistency. In IEEE Conference on Computer Vision and Pattern Recognition, pages 15859-15869, 2021. 1 +[5] Afonso S Bandeira. A note on probably certifiably correct algorithms. Comptes Rendus Mathematique, 354(3):329-333, 2016. 7 +[6] Daniel Barath, Jiri Matas, and Jana Noskova. Magsac: marginalizing sample consensus. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10197-10205, 2019. 8 +[7] Daniel Barath, Jana Noskova, Maksym Ivashechkin, and Jiri Matas. Magsac++, a fast, reliable and accurate robust estimator. In IEEE/CVF conference on computer vision and pattern recognition, pages 1304-1312, 2020. 8 +[8] Daniel Barath, Jana Noskova, and Jiri Matas. Marginalizing sample consensus. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. 8 +[9] Dominik Bauer, Timothy Patten, and Markus Vincze. Reagent: Point cloud registration using imitation and reinforcement learning. In IEEE Conference on Computer Vision and Pattern Recognition, pages 14586-14594, 2021. 1 +[10] Jean-Charles Bazin, Yongduek Seo, and Marc Pollefeys. Globally optimal consensus set maximization through rotation search. In Asian Conference on Computer Vision, pages 539–551, 2012. 2 +[11] Amir Beck. First-Order Methods in Optimization. Society for Industrial and Applied Mathematics, 2017. 6 +[12] Lukas Bernreiter, Lionel Ott, Juan Nieto, Roland Siegwart, and Cesar Cadena. PHASER: A robust and correspondence-free global pointcloud registration. IEEE Robotics and Automation Letters, 6(2):855-862, 2021. 1 +[13] PJ Besl and Neil D McKay. A method for registration of 3D shapes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(2):239-256, 1992. 1, 2 +[14] Cindy Orozco Bohorquez, Yuehaw Khoo, and Lexing Ying. Maximizing robustness of point-set registration by leveraging non-convexity. Technical report, arXiv:2004.08772v3 [math.OC], 2020. 2, 6 +[15] James V Burke and Michael C Ferris. Weak sharp minima in mathematical programming. SIAM Journal on Control and Optimization, 31(5):1340-1359, 1993. 6 + +[16] Álvaro Parra Bustos and Tat-Jun Chin. Guaranteed outlier removal for rotation search. In IEEE International Conference on Computer Vision, pages 2165-2173, 2015. 1, 2, 4, 5, 7, 8 +[17] Zhipeng Cai, Tat-Jun Chin, Alvaro Parra Bustos, and Konrad Schindler. Practical optimal registration of terrestrial lidar scan pairs. ISPRS Journal of Photogrammetry and Remote Sensing, 147:118-131, 2019. 4, 8 +[18] Dylan Campbell and Lars Petersson. GOGMA: Globally-optimal gaussian mixture alignment. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. 1, 2 +[19] Luca Carlone, Giuseppe C. Calafiore, Carlo Tommolillo, and Frank Dellaert. Planar pose graph optimization: Duality, optimal solutions, and verification. IEEE Transactions on Robotics, 32(3):545-565, 2016. 7 +[20] Dmitry Chetverikov, Dmitry Svirko, Dmitry Stepanov, and Pavel Krsek. The trimmed iterative closest point algorithm. In Object recognition supported by user interaction for service robots, volume 3, pages 545-548, 2002. 1, 2 +[21] Tat-Jun Chin, Yang Heng Kee, Anders Eriksson, and Frank Neumann. Guaranteed outlier removal with mixed integer linear programs. In IEEE Conference on Computer Vision and Pattern Recognition, pages 5858-5866, 2016. 1 +[22] Christopher Choy, Wei Dong, and Vladlen Koltun. Deep global registration. In IEEE Conference on Computer Vision and Pattern Recognition, 2020. 1, 8 +[23] Haili Chui and Anand Rangarajan. A new point matching algorithm for non-rigid registration. Computer Vision and Image Understanding, 89(2-3):114-141, 2003. 1, 2 +[24] Mark De Berg, Marc Van Kreveld, Mark Overmars, and Otfried Schwarzkopf. Computational Geometry. Springer, 1997. 2, 4 +[25] Tianyu Ding, Zhihui Zhu, Tianjiao Ding, Yunchen Yang, René Vidal, Manolis C. Tsakiris, and Daniel Robinson. Noisy dual principal component pursuit. In International Conference on Machine Learning, pages 1617-1625, 2019. 5 +[26] Tianyu Ding, Zhihui Zhu, René Vidal, and Daniel P Robinson. Dual principal component pursuit for robust subspace learning: Theory and algorithms for a holistic approach. In International Conference on Machine Learning, pages 2739-2748, 2021. 5 +[27] Richard Everson. Orthogonal, but not orthonormal, Procrustes problems. Advances in Computational Mathematics, 3(4), 1998. 1 +[28] Martin A Fischler and Robert C Bolles. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 24(6):381-395, 1981. 1 +[29] Xiao-Shan Gao, Xiao-Rong Hou, Jianliang Tang, and Hang-Fei Cheng. Complete solution classification for the perspective-three-point problem. IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(8):930–943, 2003. 2 +[30] Zan Gojcic, Caifa Zhou, Jan D. Wegner, and Andreas Wieser. The perfect match: 3D point cloud matching with smoothed densities. In IEEE Conference on Computer Vision and Pattern Recognition, pages 5540-5549, 2019. 2, 8 + +[31] John C Gower, Garmt B Dijksterhuis, et al. Procrustes Problems, volume 30. Oxford University Press on Demand, 2004. 1 +[32] Eric N. Hanson. The interval skip list: A data structure for finding all intervals that overlap a point. In Algorithms and Data Structures, pages 153-164, 1991. 4 +[33] Richard Hartley and Andrew Zisserman. Multiple View Geometry in Computer Vision. Cambridge University Press, 2004. 8 +[34] Richard I Hartley and Fredrik Kahl. Global optimization through rotation space search. International Journal of Computer Vision, 82(1):64-79, 2009. 1, 2 +[35] Berthold KP Horn. Closed-form solution of absolute orientation using unit quaternions. Journal of the Optical Society of America A, 4(4):629-642, 1987. 3 +[36] Berthold KP Horn, Hugh M Hilden, and Shahriar Negahdaripour. Closed-form solution of absolute orientation using orthonormal matrices. Journal of the Optical Society of America A, 5(7):1127-1135, 1988. 3 +[37] Shengyu Huang, Zan Gojcic, Mikhail Usvyatsov, Andreas Wieser, and Konrad Schindler. PREDATOR: Registration of 3D point clouds with low overlap. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4267-4276, 2021. 1 +[38] Xiaoshui Huang, Guofeng Mei, Jian Zhang, and Rana Abbas. A comprehensive survey on point cloud registration. Technical report, arXiv:2103.02690v2 [cs.CV], 2021. 1 +[39] Jose Pedro Iglesias, Carl Olsson, and Fredrik Kahl. Global optimality for point set registration using semidefinite programming. In IEEE Conference on Computer Vision and Pattern Recognition, 2020. 1 +[40] Maksym Ivashechkin, Daniel Barath, and Jiří Matas. Vsac: Efficient and accurate estimator for h and f. In IEEE/CVF International Conference on Computer Vision, pages 15243-15252, 2021. 8 +[41] Bing Jian and Baba C. Vemuri. Robust point set registration using gaussian mixture models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(8):1633-1645, 2011. 1, 2 +[42] Yanmei Jiao, Yue Wang, Bo Fu, Qimeng Tan, Lei Chen, Minhang Wang, Shoudong Huang, and Rong Xiong. Globally optimal consensus maximization for robust visual inertial localization in point and line map. In International Conference on Intelligent Robots and Systems, pages 4631-4638, 2020. 5 +[43] Kyungdon Joo, Hongdong Li, Tae-Hyun Oh, and In So Kweon. Robust and efficient estimation of relative pose for cameras on selfie sticks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. 2 +[44] Mohammad Mahdi Karkhaneei and Nezam Mahdavi-Amiri. Nonconvex weak sharp minima on Riemannian manifolds. Journal of Optimization Theory and Applications, 183(1):85-104, 2019. 6 +[45] Zuzana Kukelova, Martin Bujnak, and Tomas Pajdla. Automatic generator of minimal problem solvers. In European Conference on Computer Vision, pages 302-315, 2008. 2 + +[46] Viktor Larsson, Kalle Astrom, and Magnus Oskarsson. Efficient solvers for minimal problems by syzygy-based reduction. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2383-2392, 2017. 2 +[47] Viktor Larsson, Magnus Oskarsson, Kalle Astrom, Alge Wallis, Zuzana Kukelova, and Tomas Pajdla. Beyond grobner bases: Basis selection for minimal solvers. In IEEE Conference on Computer Vision and Pattern Recognition, 2018. 2 +[48] Gilad Lerman and Tyler Maunu. An overview of robust subspace recovery. Proceedings of the IEEE, 106(8):1380-1410, 2018. 5 +[49] Chong Li, Boris S. Mordukhovich, Jinhua Wang, and Jen-Chih Yao. Weak sharp minima on Riemannian manifolds. SIAM Journal on Optimization, 21(4):1523-1560, 2011. 6 +[50] Hongdong Li and Richard Hartley. The 3D-3D registration problem revisited. In IEEE International Conference on Computer Vision, pages 1–8, 2007. 1, 2 +[51] Jiayuan Li, Qingwu Hu, and Mingyao Ai. GESAC: Robust graph enhanced sample consensus for point cloud registration. ISPRS Journal of Photogrammetry and Remote Sensing, 167:363-374, 2020. 1, 2 +[52] Jiayuan Li, Qingwu Hu, and Mingyao Ai. Point cloud registration based on one-point RANSAC and scale-annealing biweight estimation. IEEE Transactions on Geoscience and Remote Sensing, pages 1-14, 2021. 1 +[53] Xiao Li, Shixiang Chen, Zengde Deng, Qing Qu, Zhihui Zhu, and Anthony Man-Cho So. Weakly convex optimization over Stiefel manifold using Riemannian subgradient-type methods. SIAM Journal on Optimization, 31(3):1605-1634, 2021. 2, 6 +[54] Wei Lian, Lei Zhang, and Ming-Hsuan Yang. An efficient globally optimal algorithm for asymmetric point matching. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(7):1281-1293, 2017. 1 +[55] Yinlong Liu, Chen Wang, Zhijian Song, and Manning Wang. Efficient global point cloud registration by matching rotation invariant features through translation search. In European Conference on Computer Vision, 2018. 1, 2 +[56] Parker C. Lusk, Kaveh Fathian, and Jonathan P. How. CLIPPER: A graph-theoretic framework for robust data association. Technical report, arXiv:2011.10202v2 [cs.R0], 2021. 2 +[57] F Landis Markley. Attitude determination using vector observations and the singular value decomposition. Journal of the Astronautical Sciences, 36(3):245-258, 1988. 3 +[58] Haggai Maron, Nadav Dym, Itay Kezurer, Shahar Kovalsky, and Yaron Lipman. Point registration via efficient convex relaxation. ACM Transactions on Graphics, 35(4), 2016. 1 +[59] Andriy Myronenko and Xubo Song. Point set registration: Coherent point drift. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(12):2262-2275, 2010. 1, 2 +[60] Yurii Nesterov. Lectures on Convex Optimization. Springer, 2018. 5 +[61] David Nister. An efficient solution to the five-point relative pose problem. IEEE Transactions on Pattern Analysis and Machine Intelligence, 26(6):756-770, 2004. 2 + +[62] Álvaro Parra, Tat-Jun Chin, Frank Neumann, Tobias Friedrich, and Maximilian Katzmann. A practical maximum clique algorithm for matching with pairwise constraints. Technical report, arXiv:1902.01534v2 [cs.CV], 2020. 1, 2 +[63] Álvaro Parra Bustos and Tat-Jun Chin. Guaranteed outlier removal for point cloud registration with correspondences. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(12):2868-2882, 2018. 1, 2, 4, 7 +[64] Álvaro Parra Bustos, Tat-Jun Chin, Anders Eriksson, Hongdong Li, and David Suter. Fast rotation search with stereographic projections for 3D registration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(11):2227-2240, 2016. 1, 2 +[65] Ryan A. Rossi, David F. Gleich, and Assefaw H. Gebremedhin. Parallel maximum clique algorithms with applications to network analysis. SIAM Journal on Scientific Computing, 37(5):C589-C616, 2015. 2 +[66] Szymon Rusinkiewicz and Marc Levoy. Efficient variants of the ICP algorithm. In International Conference on 3D Digital Imaging and Modeling, pages 145-152. IEEE, 2001. 1, 2 +[67] Radu Bogdan Rusu, Nico Blodow, and Michael Beetz. Fast point feature histograms (FPFH) for 3D registration. In IEEE International Conference on Robotics and Automation, pages 3212-3217, 2009. 2 +[68] Peter H Schonemann. A generalized solution of the orthogonal Procrustes problem. Psychometrika, 31(1):1-10, 1966. 3 +[69] Jingnan Shi, Heng Yang, and Luca Carlone. ROBIN: a graph-theoretic approach to reject outliers in robust estimation using invariants. Technical report, arXiv:2011.03659v2 [cs.CV], 2021. 1, 2 +[70] Julian Straub, Trevor Campbell, Jonathan P How, and John W Fisher. Efficient global point cloud alignment using bayesian nonparametric mixtures. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2941-2950, 2017. 1 +[71] Lei Sun. IRON: Invariant-based highly robust point cloud registration. Technical report, arXiv:2103.04357v2 [cs.CV], 2021. 1, 2 +[72] Lei Sun. RANSIC: Fast and highly robust estimation for rotation search and point cloud registration using invariant compatibility. Technical report, arXiv:2104.09133v3 [cs.CV], 2021. 1, 2 +[73] Chin Tat-Jun, Cai Zhipeng, and Frank Neumann. Robust fitting in computer vision: Easy or hard? International Journal of Computer Vision, 128(3):575-587, 2020. 4 +[74] Manolis C. Tsakiris and René Vidal. Dual principal component pursuit. Journal of Machine Learning Research, 19(18):1-50, 2018. 5 +[75] Grace Wahba. A least squares estimate of satellite attitude. SIAM Review, 7(3):409, 1965. 1, 3 +[76] Heng Yang, Pasquale Antonante, Vasileios Tzoumas, and Luca Carlone. Graduated non-convexity for robust spatial perception: From non-minimal solvers to global outlier rejection. IEEE Robotics and Automation Letters, 5(2):1127-1134, 2020. 1, 3, 7, 8 + +[77] Heng Yang and Luca Carlone. A quaternion-based certifiably optimal solution to the Wahba problem with outliers. In IEEE International Conference on Computer Vision, pages 1665-1674, 2019. 1, 2 +[78] Heng Yang and Luca Carlone. One ring to rule them all: Certifiably robust geometric perception with outliers. In Advances in Neural Information Processing Systems, 2020. 7 +[79] Heng Yang, Ling Liang, Kim-Chuan Toh, and Luca Carlone. STRIDE along spectrahedral vertices for solving large-scale rank-one semidefinite relaxations. Technical report, arXiv:2105.14033 [math.OC], 2021. 1 +[80] Heng Yang, Jingnan Shi, and Luca Carlone. TEASER: Fast and certifiable point cloud registration. IEEE Transactions on Robotics, 37(2):314-333, 2021. 1, 2, 3, 7, 8 +[81] Jiaolong Yang, Hongdong Li, Dylan Campbell, and Yunde Jia. Go-ICP: A globally optimal solution to 3D ICP point-set registration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(11):2241-2254, 2016. 1, 2 +[82] Jiaolong Yang, Hongdong Li, and Yunde Jia. Go-ICP: Solving 3D registration efficiently and globally optimally. In IEEE International Conference on Computer Vision, pages 1457–1464, 2013. 2 +[83] Yunzhen Yao, Liangzu Peng, and Manolis Tsakiris. Unlabeled principal component analysis. Advances in Neural Information Processing Systems, 2021. 5 +[84] Andy Zeng, Shuran Song, Matthias Nießner, Matthew Fisher, Jianxiong Xiao, and T Funkhouser. 3DMatch: Learning the matching of local 3D geometry in range scans. In IEEE Conference on Computer Vision and Pattern Recognition, page 4, 2017. 7, 8 +[85] Qian-Yi Zhou, Jaesik Park, and Vladlen Koltun. Fast global registration. In European Conference on Computer Vision, pages 766-782, 2016. 1, 2, 7 +[86] Zhihui Zhu, Tianyu Ding, Daniel Robinson, Manolis Tsakiris, and René 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, 2019. 5 +[87] Zhihui Zhu, Yifan Wang, Daniel Robinson, Daniel Naiman, René Vidal, and Manolis C. Tsakiris. Dual principal component pursuit: Improved analysis and efficient algorithms. In Advances in Neural Information Processing Systems, 2018. 5 \ No newline at end of file diff --git a/arcsaccuraterotationandcorrespondencesearch/images.zip b/arcsaccuraterotationandcorrespondencesearch/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bab50a0592a8f516889b722f3da552bf3104e0fa --- /dev/null +++ b/arcsaccuraterotationandcorrespondencesearch/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c10955120539cb8dd5b60c96b6875340ca1395f61e3eb9892f8875f6b8c89757 +size 295015 diff --git a/arcsaccuraterotationandcorrespondencesearch/layout.json b/arcsaccuraterotationandcorrespondencesearch/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..667c0d52680438889bf630094529053fdb8680f1 --- /dev/null +++ b/arcsaccuraterotationandcorrespondencesearch/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0aefec678c7893cf8604f11d12902b3f3deb8c4659b7329528d9c3b6c1e7390 +size 835679 diff --git a/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_content_list.json b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cf2585afa0e41208454710a7228efbde53d47f53 --- /dev/null +++ b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89493a2ea2fd2bc5ca3c586253ac5f8395337787f52fd3014ac379bbcbb02fd4 +size 77885 diff --git a/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_model.json b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..304e8bd793ad3a1c657295f8bc6da225881d0ab4 --- /dev/null +++ b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e53b734397ac0f235945d93b1d1d9644bd106f1e79f2d29301bcfbd6f1a61d60 +size 95525 diff --git a/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_origin.pdf b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..916900035506d33833e49e0648fca3a1c99f13aa --- /dev/null +++ b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/954e71e8-40d0-45cd-9fa9-fa9fb04f9ab3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7871b1e1ed49f2403451185c59f8e0f11dc3404a3e82713514071dd13c1fc7fe +size 530025 diff --git a/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/full.md b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6e0fb138e27f0229120a8c1ba8c3cab2d8776d7e --- /dev/null +++ b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/full.md @@ -0,0 +1,319 @@ +# A Re-Balancing Strategy for Class-Imbalanced Classification Based on Instance Difficulty + +Sihao Yu, Jiafeng Guo*, Ruqing Zhang, Yixing Fan, Zizhen Wang and Xueqi Cheng +University of Chinese Academy of Sciences, Beijing, China +CAS Key Lab of Network Data Science and Technology, Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China + +{yusihao,guojiafeng,zhangruqing,fanyixing,wangzizhen,cxq}@ict.ac.cn + +# Abstract + +Real-world data often exhibits class-imbalanced distributions, where a few classes (a.k.a. majority classes) occupy most instances and lots of classes (a.k.a. minority classes) have few instances. Neural classification models usually perform poorly on minority classes when training on such imbalanced datasets. To improve the performance on minority classes, existing methods typically re-balance the data distribution at the class level, i.e., assigning higher weights to minority classes and lower weights to majority classes during the training process. However, we observe that even the majority classes contain difficult instances to learn. By reducing the weights of the majority classes, such instances would become more difficult to learn and hurt the overall performance consequently. To tackle this problem, we propose a novel instance-level re-balancing strategy, which dynamically adjusts the sampling probabilities of instances according to the instance difficulty. Here the instance difficulty is measured based on the learning speed of instance, which is inspired by the human-leaning process (i.e., easier instances will be learned faster). We theoretically prove the correctness and convergence of our resampling algorithm. Empirical experiments demonstrate that our method significantly outperforms state-of-the-art re-balancing methods on the class-imbalanced datasets. + +# 1. Introduction + +Over the years, the performance of the classification has witnessed incredible progress on high-quality synthetic datasets, e.g., CIFAR [40], ImageNet [36], MS-COCO [26]. However, the datasets in real-world applications often exhibit imbalanced data distributions [27, 30]. This imbalance is intuitively reflected by the sizes of different classes. On one hand, there are some classes that have a large number of + +![](images/f5202a40ac4e77b876ac9f1e43e7b2cfcafb5a3bdf8d8a02517aa348ac05e03d.jpg) +(a) The Digit Distribution. + +![](images/bf7ea61de8fc96d0c7c0d2081dbb7c423da71ad07307b91f08f9f8169b6c78f3.jpg) +(b) Accuracy of Evens. +Figure 1. Binary Classification on the Long-Taied MNIST. Fig. 1a shows the digit and class distribution of the training data. Fig. 1b shows the validation accuracy of digits in the even class. "Others" denotes the average accuracy of digit 0, 2, 4, 6. "Normal" shows the results of base model. "Balance" shows the results of the class-balance loss which reduces the weight of the majority class. + +instances. We call them majority classes in this paper. On the other hand, there are also some classes that have rarely few instances. We call them minority classes in this paper. Such class-imbalanced distributions pose critical challenges for neural classification models. Neural models perform with biases toward the majority classes when training on such datasets [1,37]. Therefore, models usually perform poorly on the minority classes [7]. + +The class-imbalanced classification problem has attracted a lot of attention in the machine learning community [13, 27]. Researchers have introduced a variety of strategies to re-balance the data distribution when training the model. The mainstream solutions are re-sampling and reweighting. Re-sampling methods directly adjust the training data by repeating the instances of minority classes and removing some instances of majority classes [6, 16, 41, 44]. The re-weighting methods focus on the cost(e.g., loss) of different classes, specifically paying more attention to the minority classes' cost and less on the majority classes [5, 7]. In summary, existing methods typically consider and solve the imbalance problem at the class level by adjusting the observed class distribution. + +However, these class-level re-balancing strategies are too coarse to distinguish the difference of instances. Even within a majority class, there are some difficult instances for classification models to learn. By reducing the weights of the majority classes, such instances would be further ignored and become more difficult to learn, which hurts the models' performance. Fig. 1 gives a support example by a simulation experiment. A neural model needs to learn the binary classification of odd and even numbers on the digital pictures of 0-9(digits 0,2,4,6,8 are labeled as even, digits 1,3,5,7,9 are labeled as odd), whose distribution is shown as Fig. 1a. When testing the model on the validation set, we find that pictures of digit 8 only have a $65\%$ probability to be right inferred as odd numbers. Compared with other even digits, digit 8 is badly learned by the model. If we adopt the class-balance loss [7] (i.e., an effective class-level re-balancing method) in the training process, the weight of the majority class(i.e., even) will be reduced. Compared with the $1\%$ drop of other even digits, the accuracy of digit 8 has dropped significantly. It indicates that digit 8 should not be treated as same as other digits in the even class. + +In the above case, adjusting the sub-class (i.e., digit) distribution seems to be an effective solution. However, in most other cases, we do not know the labels of the subclasses, and we even can not determine whether sub-classes exist. Moreover, even in a sub-class, the difficulty of different instances is also different. Therefore, we need to consider the weight adjustment at the instance level. At the instance level, we can not assign weights like existing class-level methods, because each instance usually appears only once. Even worse, the model's performance on the training set also can not reflect the difficulty of instances, because most instances in the training set can be correctly inferred after training. + +However, different instances are learned at different speeds. Inspired by the process of human learning, the speed and difficulty of learning are usually strongly correlated. By the study of instance learning speed in the model's training process, we find that the instance learning process is directly affected by the data distribution. Specifically, instances have intermittent unlearning events during the learning process, which are performed as loss increments. Instances from the minority classes or minority subclasses usually have more unlearning events in training. So these instances are learned more slowly. Therefore, identifying instances with slow learning speed as more difficult instances and increasing their weights in learning can effectively balance the data distribution. + +Based on the above analyses, we design an instance difficulty model according to the learning speed and propose a novel instance-level re-balancing strategy for training classification models. Specifically, we record the predictions of each instance after each training epoch, and measure the in + +stance difficulty based on the prediction variations. Then our method re-samples the data according to the instance difficulty model by assigning higher weights to difficult instances. In addition, we prove the correctness and convergence of our re-sampling strategy theoretically. + +In this paper, we conduct some empirical experiments to show the multifaceted capabilities of our method. Specifically, the long-tailed classification experiments indicate that our strategy outperforms some strong baselines on the class-imbalanced datasets. Especially, we achieve new state-of-the-art results on the long-tailed CIFAR-10/-100 for image classification. The simulation experiments further verify the data re-balancing ability of our method, which reduces the imbalance ratio of labeled classes and unlabeled subclasses. And the generality experiments show the generality of our methods on several different datasets. + +The key contributions of this paper can be summarized as follows: (1) We demonstrate the pitfalls of popular class-level methods, and point out the importance of the instance-level distribution adjustment. (2) We theoretically propose a new difficulty definition for instances inspired by the learning speed, and we analyze the relationship of our difficulty and data distribution. (3) We propose an instance-level rebalancing strategy. It empirically performs well with theoretical proof. + +# 2. Related Works + +In this section, we briefly review two lines of related works: (1) Class re-balancing strategies. (2) Difficulty-sensitive methods. + +# 2.1. Class Re-Balancing Strategies + +From the intuitive experimental performance, the minority class performs poorly when the training data is class-imbalanced. So it is effective to directly re-balance the class contribution of the training data. To achieve this goal, there are two implementations: re-sampling [4, 30, 44] and reweighting [5, 21, 38]. + +Re-sampling methods aim to achieve a more balanced data distribution by adjusting the frequency of instances during training. This adjustment is mainly at the class level, including the following three types. Over-sampling increases the instances of minority classes by repeating [6,11] or interpolating [6, 12, 45]. Under-sampling [13, 16] removes some instances of majority classes to decrease the proportion of majority classes. And class-balance sampling methods [24,28] not only increase the minority classes' frequency but also decrease the majority classes'. + +Re-weighting methods balance the class distribution by adjusting the weights for training instances in the loss function. Specifically, allocating high weights for minority classes and low weights for majority classes. The core of + +this type of method is to determine the weights. One intuitive way is to use inverse class frequency as the weights of different classes [42]. Such a tough setting does not perform well in many situations, so [28,32] proposes some smoothed versions of the inverse class frequency. Inspired by the random covering problem, the class-balance loss models the effective number, replacing the class frequency, for each class [7]. + +Class-level adjustment is the relatively mainstream way to solve the class-imbalance problem in classification. However, the class-level approaches are too coarse, which ignores the differences between instances in the same class. + +Besides, it is worthy to introduce existing work that has also explored other ways to solve the class-imbalanced classification. With the idea of transferring knowledge from majority classes to minority classes, transfer learning [2, 33, 43], two-stage training [5, 19] and dynamic curriculum learning [41] significantly increase the performance of class-imbalanced classification. Based on causal inference [34, 35], removing the causal effect of bad gradient momentum can effectively relieve the bias to head class [39]. + +# 2.2. Difficulty-Sensitive Methods + +Difficulty-sensitive methods adjust the data distribution to balance the difficulty. The adjustments usually are implemented by re-weighting, more difficult instances are assigned higher weights in training. So the core of these methods is to quantify the difficulty. Difficulty-sensitive methods typically focus on instance level. The most popular works quantify instances' difficulty in terms of the losses incurred by the model [8, 10, 25, 29]. Besides, meta-learning can be used to find the conditional weights for instances [15]. While our method presents a novel difficulty inspired by the learning speed. There is a strong connection between our difficulty and data distribution, so our method is more advantageous in solving the class-imbalanced problem. Moreover, when the difficulty is defined, additional controls are available beyond adjusting the data distribution. For example, curriculum learning [3] and self-paced learning [18, 23] not only adjust the distribution of the data, but focus more on the order in which the data appears from easy to difficult. + +# 3. Our Method + +In this section, we introduce our re-sampling method, which re-balances the data distribution by instance-level adjustments in training neural models for classification. Specifically, we introduce our method in 3 steps: (1) Task Formulation: we theoretically define the classification task and the optimization object of the model; (2) Re-sampling Framework: we introduce the role of our re-sampling strategy in the training framework; (3) Instance Difficulty Model: By theoretical analysis, we measure the difficulties + +Algorithm 1 Re-Sampling +1: Input: dataset $S$ , network $Net$ , training times $T$ +2: Initialize sampling weight (probability) $\omega \gets \{\frac{1}{|S|}\}^{|\mathcal{S}|}$ +3: Initialize $p_{i,0} \gets \{\frac{1}{k}, \ldots\}$ for each $\boldsymbol{x}_i$ in $S$ +4: for $t$ in 1 to $T$ do +5: $S^* \gets$ Sample from $S$ according to $\omega$ +6: Train $Net$ by using $S^*$ +7: for $\boldsymbol{x}_i$ in $S$ do +8: $p_{i,t} \gets Net(\boldsymbol{x}_i)$ +9: $D_{i,t} \gets Difficulty(p_{i,0}, \ldots, p_{i,t})$ +10: end for +11: calculate new $\omega$ by $D$ +12: end for + +of learning instances, which is the key of our method to assign weights for instances. + +# 3.1. Task Formulation + +Without loss of generality, a classification task with $\mathbf{k}$ classes are formed in this section. Let $S := \{z_i = (\pmb{x}_i, y_i) : 1 \leq i \leq N\}$ be the training data with $N$ instances, where $z_i$ denotes the $i^{\text{th}}$ instance, $\pmb{x}_i$ denotes its features and $y_i \in \{1, \dots, k\}$ denotes its class label. Then a neural model $Net$ is adopted to fit the mapping of features to class labels. Suppose the final layer of $Net$ is softmax, which normalizes the output of $Net$ as a probability distribution for prediction. Specifically, we denote $p_i = Net(\pmb{x}_i)$ as the prediction distribution of the instance $z_i$ . $\text{argmax}(p_i) = y_i$ indicates that the instance $z_i$ are correctly inferred by $Net$ . To achieve higher inference accuracy, a suitable loss function $\mathcal{L}$ is adopted to help us learn the parameters $\theta$ of $Net$ . Assume that $\mathcal{L}(\theta, S) = \sum_{i=1}^{N} \mathcal{L}(\theta, z_i)$ is twice-differentiable [22]. The learning goal is to minimize the total loss $\mathcal{L}(\theta, S)$ by changing $\theta$ of $Net$ . + +# 3.2. Re-sampling Framework + +The model optimizes the parameters by training on the dataset. However, even if the optimization method remains unchanged, the data distribution will greatly affect the learning of the model. Our method only adjusts the data distribution used in training to optimize the model. The overall training framework with our re-sampling method is shown in Algorithm 1. + +The core of our re-sampling method is calculating the sampling weights for all instances. Different from the existing class-level methods, the probability of sampling each instance in our method can be different, even in the same class. With different difficulty models and weight calculation methods, the performance of final trained model is different. Inspired by the idea that difficult instances should be paid more attention to. In our method, we simply calculate + +the sampling weights as + +$$ +w _ {i, t} = \frac {D _ {i , t}}{\sum_ {j = 1} ^ {N} D _ {j , t}}, \tag {1} +$$ + +where $w_{i,t}$ determines the sampling probability of the instance $z_i$ after the $t^{\text{th}}$ iteration. Our sampling method dynamically adjusts the sampling weight of each instance according to its current difficulty. So the difficulty model is the core of our method, which directly determines the sampling probability of each instance. Next, we will introduce it in detail. + +# 3.3. Instance Difficulty Modeling + +In this section, we introduce the instance difficulty model of our method through 3 steps: (1) Theoretical Analysis: To design the difficulty model, we make a theoretical analysis for the learning process of the instance. (2) Model Design: we design the instance difficulty model based on the analysis. (3) Characteristics: we explain our difficulty model in vector space and prove its convergence. + +# 3.3.1 Theoretical Analysis + +In this section, we analyze the reasons why an instance becomes difficult to learn. When using gradient descent to update $\theta$ , the goal of updates is to make $\mathcal{L}(\theta, S)$ smaller. According to the Taylor Expansion, when $\theta \to \theta_0$ , $\mathcal{L}(\theta, S)$ can be approximated as + +$$ +\mathcal {L} (\theta , \mathcal {S}) = \mathcal {L} \left(\theta_ {0}, \mathcal {S}\right) + \mathcal {L} ^ {\prime} \left(\theta_ {0}, \mathcal {S}\right) \left(\theta - \theta_ {0}\right), \tag {2} +$$ + +where $\mathcal{L}'(\theta_0, S) = \sum_{i=1}^{N} \mathcal{L}'(\theta_0, z_i)$ . To get the fastest descent speed, $\triangle \theta = (\theta - \theta_0) = -\eta \mathcal{L}'(\theta_0, S)$ , where $\eta$ denotes the learning rate. + +Suppose that the parameters change from $\theta_0$ to $\theta_{1}$ after an update, and satisfies $\theta_{1} = \theta_{0} - \eta \mathcal{L}'(\theta_{0},\mathcal{S})$ . For a specific instance $z$ , its loss will be changed after the parameter update. The variation which is $\mathcal{L}(\theta_1,z) - \mathcal{L}(\theta_0,z)$ can be estimated as + +$$ +\triangle \mathcal {L} _ {z} = - \eta \left\langle \mathcal {L} ^ {\prime} \left(\theta_ {0}, z\right), \mathcal {L} ^ {\prime} \left(\theta_ {0}, \mathcal {S}\right) \right\rangle , \tag {3} +$$ + +where $\langle \cdot, \cdot \rangle$ denotes the inner product. The loss of the $z$ will rise if $\langle \mathcal{L}'(\theta_0, z), \mathcal{L}'(\theta_0, S) < 0 \rangle$ . We call that $z$ is unlearned in this update. In particular, we can construct two subsets of $\mathcal{S}$ , which are the assistance set $\mathcal{A}_z := \{a : a \in \mathcal{S}, \langle \mathcal{L}'(\theta_0, z), \mathcal{L}'(\theta_0, a) \rangle > 0\}$ and the hindrance set $\mathcal{H}_z := \{r : r \in \mathcal{S}, \langle \mathcal{L}'(\theta_0, z), \mathcal{L}'(\theta_0, r) \rangle < 0\}$ . The decline of instances' loss indicates the degree to which the instances are learned by the model. In the process of learning $z$ , it is obvious that the instances in $\mathcal{A}_z$ provide the assistance but the instances in $\mathcal{H}_z$ create the hindrance. Moreover, when the weight of any instance in $\mathcal{A}_z$ is decreased or the weight of any instance in $\mathcal{H}_z$ is increased, the loss of $z$ will become more difficult to reduce. It indicates that the difficulty of instances is affected by the data distribution. + +As a naive idea, the instance difficulty for learning can be evaluated by all inner products of every two gradients. + +However, this naive method is too slow because of complex calculations. In fact, because of the twice-differentiable assumption, the gradient changes little when the model parameters are slightly perturbed. Between two adjacent iterations, the prediction variations of the model have similar trends when $\triangle \theta$ is slight. Therefore, prediction variations in the last iteration can be used to estimate the variations in the current iteration. Specifically, we denote $Net_{t}$ as the model which has been trained $t$ iterations, and $p_{i,t} = Net_{t}(\boldsymbol{x}_{i})$ as the prediction distribution of $Net_{t}$ for instance $z_{i}$ . At the $t + 1$ training iteration, we take the variation between $p_{i,t - 1}$ and $p_{i,t}$ to estimate the learning results whether $z_{i}$ tends to be learned or unlearned. If an instance is often unlearned, it will be difficult to be learned by the model. Obviously, such an instance will be learned more easily when its weight is increased. + +# 3.3.2 Model Design + +Following our analysis, to measure the difficulty, we estimate the prediction variations in the learning direction and the unlearning direction. And then we design the instance difficulty model. Specifically, for a given instance $z_{i}$ , its difficulty after $T$ iterations is estimated as + +$$ +D _ {i, T} = \frac {c + \sum_ {t = 1} ^ {T} d u _ {i , t}}{c + \sum_ {t = 1} ^ {T} d l _ {i , t}}, \tag {4} +$$ + +where $c$ is the prior parameter of instance difficulty, $du_{i,t}$ denotes the prediction variation on the unlearning direction after $t$ iterations, $dl_{i,t}$ denotes the prediction variation on the learning direction. In particular, all instances have the same $c$ , which regulates the sensitivity of difficulty to prediction variations. In Eq. (4), the numerator records the accumulation of the unlearning trends, and the denominator records the accumulation of the learning trends. For any instances $z_i$ and $z_j$ , $D_{i,t} > D_{j,t}$ means $z_i$ is more difficult than $z_j$ so far, after $t$ iterations have been updated. Consistent with the priori, all difficulties are treated as the same before the first iteration, since $D_{i,0} = 1$ for any instance $z_i$ . + +According to the different calculation methods of $du_{i,t}$ and $dl_{i,t}$ , we can get different difficulty models. In this paper, we define them based on the PSI (a.k.a. Population Stability Index [17, 20]), which is a well defined index to measure the distance between distributions. Regardless of learning direction, the prediction variation between $p_{i,t-1}$ and $p_{i,t}$ is the distance that + +$$ +d _ {i, t} = \sum_ {j = 1} ^ {k} \left(p _ {i, t} ^ {j} - p _ {i, t - 1} ^ {j}\right) \ln \left(\frac {p _ {i , t} ^ {j}}{p _ {i , t - 1} ^ {j}}\right), \tag {5} +$$ + +where $p_{i,t}^{j}$ denotes the probability that $Net_{t}$ predicts the class of $z_{i}$ as $j$ . Then we take into account the learning direction. Specifically, $p_{i,t}^{y_i} - p_{i,t-1}^{y_i} > 0$ indicates learning and $p_{i,t}^{y_i} - p_{i,t-1}^{y_i} < 0$ indicates unlearning. Moreover, there are similar settings in other dimensions of the probability + +distribution but the conclusion is opposite. Therefore, we define $du_{i,t}$ and $dl_{i,t}$ as + +$$ +\begin{array}{l} d u _ {i, t} = \min _ {k} \left(p _ {i, t} ^ {y _ {i}} - p _ {i, t - 1} ^ {y _ {i}}, 0\right) \ln \left(\frac {p _ {i , t} ^ {y _ {i}}}{p _ {i , t - 1} ^ {y _ {i}}}\right) \tag {6} \\ + \sum_ {j = 1, j \neq y _ {i}} ^ {k} \max \left(p _ {i, t} ^ {j} - p _ {i, t - 1} ^ {j}, 0\right) \ln \left(\frac {p _ {i , t} ^ {j}}{p _ {i , t - 1} ^ {j}}\right), \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} d l _ {i, t} = \max _ {k} \left(p _ {i, t} ^ {y _ {i}} - p _ {i, t - 1} ^ {y _ {i}}, 0\right) \ln \left(\frac {p _ {i , t} ^ {y _ {i}}}{p _ {i , t - 1} ^ {y _ {i}}}\right) \\ + \sum_ {j = 1, j \neq y _ {i}} ^ {k} \min \left(p _ {i, t} ^ {j} - p _ {i, t - 1} ^ {j}, 0\right) \ln \left(\frac {p _ {i , t} ^ {j}}{p _ {i , t - 1} ^ {j}}\right), \\ \end{array} +$$ + +which satisfy that $d_{i,t} = du_{i,t} + dl_{i,t}$ + +Whenever the model is iterated after multiple batches of training such as an epoch, our method needs to infer the instances of training data once to record the prediction of the current model. By all records, i.e., $(p_{i,0}, p_{i,1}, \ldots)$ , the instance difficulty is calculated to adjust the sampling weight of instance $z_i$ . Here $p_{i,0}$ can be the prediction before training or initialized as uniform distribution. + +# 3.3.3 Model Characteristics + +In this section, we discuss the characteristics of our instance difficulty model (i.e., Eq. (4)), which directly controls the sampling weights. Our instance difficulty has a intuitive explanation in the vector space. $D_{i,T}$ is the slope of the difficulty vector $\vec{D_{i,T}} = \vec{c} +\sum_{t = 1}^{T}\vec{d_{i,t}}$ , where $\vec{c} = (c,c)$ and $\vec{d_{i,t}} = (du_{i,t},dl_{i,t})$ . When our method tries to update the sampling weight, a new difficulty vector will be calculated for each instance. As illustrated in Fig. 2, the difficulty space is composed of the unlearning trend and the learning trend. If the model tends to unlearn an instance, the direction of its difficulty vector will closely point to the unlearning trend. Similarly, if the model tends to learn an instance, the direction of its difficulty vector will closely point to the learning trend. + +In particular, for a single difficulty vector of an instance, its direction may be deviated due to the error of trend prediction. In our method, the overall trend summation makes the trend estimation more accurate. Generally, such accumulation can reduce the error in the direction of a single vector. In addition, the final results of our difficulty will be converged with the convergence of models. In an ideal situation, we prove that $||D_{i,t-1}|| = ||D_{i,t}||$ when $t \to \infty$ . The specific proof are presented in the Appendix. + +# 4. Experiments + +In this section, we show the ability of our method by experiments, comparing with baselines introduced in Sec. 4.1. Then experiments are divided into three parts, according to + +![](images/6f571bcbfd1378e3659b8026efc70662af0f7617b8ba75c03a0e03b3a2d4d3d4.jpg) +Figure 2. Instance Difficulty in Vector Space. Instance difficulty defined in Eq. (4) is presented by colors. The final difficulty is accumulated by period sliced difficulty vectors(grey solid arrow) calculated in different iterations. + +different purposes: (1) Long-tail classification experiments test the performance of our method under different imbalance ratios. (2) Simulation experiments illustrate the rebalancing ability of our method. (3) Generality experiments demonstrate the generality of our method. + +# 4.1. Baselines + +This section introduces the baseline methods used in the experiments. + +- Class-Balance Loss: A class-level re-balancing method which adjusts the weights of classes based on effective numbers of classes. [7]. The effective number is related to the sample size of the category and regulated by the hyperparameter of the method. +- Focal Loss: An instance-level difficulty-sensitive method which assigns higher weights to instances in terms of losses. Every instance may have different weights [25]. +- TDE: A state-of-the-art method that removes the accumulated preference of the majority class according to the causal effect in inference [39]. In particular, TDE does not adjust the data distribution during training. + +Especially, we adopt different base models for different experiments. The baselines do not change the base model itself. They are a kind of additional adjustment method to optimize the learning of the given base model. Specifically, we adopt the ResNet [14] with different layers, the Multi-layer Perceptron [9], and the logistic regression [31] as the base models in experiments. + +# 4.2. Long-Tailed Classification Experiments + +The intention of our method is to solve the class-imbalanced problem in classification. This section presents the performance of our method to solve the long-tailed classification problem with different imbalance ratios. + +Table 1. Accuracy % on Long-Tailed CIFAR-10/-100 with Different Imbalance Ratios. All methods use the same network structure (the ResNet-32 backbone and a multi-head decision classifier). + +
Dataset NameLong-tailed CIFAR 10Long-tailed CIFAR 100
Imbalance Ratio1205010012050100
Base Model92.183.978.372.270.653.045.040.6
Focal Loss92.283.878.272.670.853.145.641.0
Class-Balance Loss92.184.179.174.370.654.946.141.1
Our Method93.885.580.275.071.554.548.042.3
TDE91.184.782.179.167.854.548.543.5
TDE + Our Method93.587.284.579.670.555.950.344.9
+ +# 4.2.1 Experimental Settings + +To verify the superiority of our instance-level strategy, we conduct extensive studies on long-tailed CIFAR datasets [7] with various imbalance ratios. Specifically, the training instances of each class are reduced, according to an exponential function $n = n_i \mu^i$ , where $i$ is the class index, $n_i$ is the original number of class $i$ and $\mu \in (0,1)$ . And the overall imbalance ratio is denoted as $n_{\mathrm{max}} / n_{\mathrm{min}}$ . + +# 4.2.2 Performance of Different Imbalance Ratios + +To show the performance of our method for solving class-imbalanced classification, we adopt experiments on long-tailed CIFAR-10/-100 with different imbalance ratios. As shown in Tab. 1, we can see that: (1) Training with different methods can differently improve the accuracy of the base model. (2) The improvement of the focal loss is not obvious, which indicates difficulty in terms of losses can not effectively solve the class-imbalanced classification. (3) Under the uniform class distribution (the imbalance ratio is 1), Class-Balance Loss performs the same as Base Model. Because it does not adjust any weight of class when the class distribution has been balanced. Under the imbalanced class distribution, performances of Class-Balance Loss are improved, because the distribution is re-balanced on class level. (4) Focus on the Focal Loss, Class-Balance Loss and our method, in the case of ensuring the model is the same, the final accuracy can reflect the performance of the different distribution adjustments. Our method outperforms the focal loss and class-balance loss at most situations, which shows the effectiveness of our strategy for re-balancing the distribution. (5) TDE only works on class-imbalanced situations, because TDE is based on causal analysis under the class-imbalanced assumption. Moreover, the effect of TDE is more obvious when the imbalance ratio is higher. Under a higher imbalance ratio, the model usually has a more obvious preference for majority classes. So the correction by TDE is larger and more accurate. (6) Compared with TDE, our method works better when the imbalance ratios are low. + +Table 2. Accuracy % on Long-Tailed CIFAR100 with Imbalance Ratio 100. The network is the same as that in Tab. 1. Class-Balance(More Minority) is another instance of Class-Balance Loss, which assigns much more weights for minority classes. + +
MethodsMajorityMinorityOverall
Base Model54.19.040.6
Focal Loss54.79.141.0
Class-Balance Loss53.511.041.1
Class-Balance(More Minority)49.312.238.2
Our Method56.29.942.3
+ +However, since TDE does not modify the data distribution, our method can be integrated with TDE. After fusion, our method can further improve the performance of TDE. + +# 4.2.3 Performance on Majority and Minority Classes + +To study the model performance in detail, we observe the performance on majority and minority classes in the experiment of long-tailed CIFAR-100 whose imbalance ratio is 100. Specifically, following the previous study [39], the 30 classes with the least number of instances are defined as the minority classes. They only accounted for $2.9\%$ of all data in training. Then we denote the rest as the majority classes. + +As shown in Tab. 2, different strategies have their own characteristics when improving the base model. We can see that: (1) Focal Loss mainly improves the performance on majority classes, since Focal Loss is not forced to assign higher weights to minority classes. This indicates that only adopting the values of losses to determine the difficulties of samples is hard for the model to perceive the minority classes. (2) Class-Balance Loss improves the performance on minority classes but slightly deteriorates the performance on majority classes. As a typical class-level method, it directly adjusts the weights of classes. As expected, the performance on the majority classes deteriorates because their weights are reduced. On the contrary, the weights of the minority classes are increased, so the performance on the minority classes is improved. Since + +Table 3. Accuracy % on Long-Tailed MNIST with Imbalance Ratio 100 for Simulation Binary Classification. All methods use the same network structure. The Base Model is the Multilayer Perceptron. Two ratio columns present the class imbalance ratio(i.e., "Class Ratio") and the sub-class imbalance ratio(i.e. "Sub-Class Ratio"). Especially, the values in these two columns are the imbalance ratios that calculated after re-balancing. The "Major" and "Minor" represent the majority sub-classes and the minority sub-classes within a class. + +
MethodsClass RatioSub-Class RatioOverallEven (Majority Class)Odd (Minority Class)
OverallMajorMinorOverallMajorMinor
Base Model1.7100.086.0490.9598.8885.5481.2896.9270.09
Class-Balance Loss1.269.686.1989.7798.7383.6682.7297.1172.44
Our Approach1.437.387.9992.3399.0887.7383.7897.4177.43
+ +the performance improvement on minority classes is greater than the performance loss of majority ones, the overall performance is improved. (3) Class Balance(More Minority) performs better on minority classes, since it assigns higher weights for minority classes. However, lower weights for majority classes result in severe performance degradation on majority classes, thus the final performance is even less than the base model which does not adjust the data distribution. (4) Our method can effectively improve both majority and minority classes. Because our method pays more attention to the instances that are really hard to learn. Difficult instances in the majority classes are strengthened, so the performance on majority classes is improved. Although the improvement in the minority classes is not as good as Class-Balance Loss, our approach has a better performance overall. Compared with Focal Loss, our method can better perceive the importance of minority classes and is more effective in improving the majority classes. + +# 4.3. Simulation Experiments + +In this section, we show the performance of our method for unlabeled imbalanced sub-classes. Moreover, we verify the re-balancing ability of our method and analyze why our method can re-balance the distribution of classes and unlabeled sub-classes. + +# 4.3.1 Experimental Settings + +The simulation experiments are carried out by the task of the binary classification on Long-Tailed MNIST. The two classes are even and odd. Original MNIST is a popular dataset of handwritten digit recognition. We constructed a long-tailed version of MNIST by under-sampling according to the construction method of Long-tailed CIFAR [7]. From the perspective of the class level, the distribution is long-tailed, since the even class is much larger than the odd class. From the perspective of the sub-class (digit) level, the sub-class distribution in each class obeys the long-tailed either. In the training process, the model knows the class labels, but not the sub-class labels. For a more specific introduction and settings, please refer to the Appendix. + +# 4.3.2 Performance on Imbalanced Sub-Classes + +To observe the performance of our method on unlabeled sub-classes, we conduct the simulation experiment, whose class distribution and unlabeled sub-class distribution are imbalanced. The overall results are summarized in Tab. 3. As an illustration, the majority sub-classes of the even class are composed of the digit 0 and 2, while the minority subclasses are composed of the numbers 4,6,8. The majority sub-classes of the odd class are composed of 1 and 3, while the minority sub-classes are composed of 5,7,9. + +As shown in Tab. 3, we can see that: (1) On the class level, the performance is consistent with the results in Tab. 1, which leads to a similar conclusion. (2) The performance on minority sub-classes is much smaller than that on majority sub-classes, which indicates that the imbalanced issue also exists in unlabeled sub-classes. (3) The class-balance Loss performs more poorly on minority sub-classes of the majority class(i.e., Even). Because re-balancing the distribution on the class level leads to lower weights for such minority sub-classes. (4) Our method has a more significant improvement on minority sub-classes, compared to the class-level adjustment, which indicates the superiority of instance-level adjustments. The difficulty defined by our method can perceive the problems caused by the imbalanced distribution of unlabeled sub-classes. + +In addition, we recalculated the current imbalance ratio based on the weighted result of instances. The results (two ratio columns in Tab. 3) show that our method effectively reduces the imbalance ratio for both labeled classes and unlabeled sub-classes. + +# 4.3.3 Analysis for Re-Balancing the Class Distribution + +Because of the connection between our difficulty model and the data distribution, our method can re-balance the distribution of the classes or even the unlabeled sub-classes. In this section, we verify this conclusion by simulation experiments. Specifically, we record the unlearning frequency of different classes and sub-classes, and visualize the relationship between unlearning frequency and difficulty. + +![](images/d2c26dc38ee774a9a48ba12296e6eed6f053f93d08207d00927d75eb2a2b4891.jpg) +Figure 3. Unlearning Frequency of Classes and Sub-Classes. E denotes the even class. O denotes the odd class. + +![](images/9def4611dca6e01772dd7a23e81b7838c1430a8dd43fa00e1d631dea7b94711a.jpg) +(a) Loss + +![](images/98646f9436fdddc7a2879c505586289c49443e2adc4d5d3592891c68797cf2b8.jpg) +(b) Difficulty +Figure 4. Loss and Difficulty of Instances in Training. "Easy" is unlearned with $10\%$ probability, "Normal" is unlearned with $20\%$ probability, "Hard" is unlearned with $40\%$ probability. + +As the analysis in Sec. 3.3, the instance sometimes is unlearned during the learning process. Fig. 3 presents the unlearning frequency of different classes and sub-classes. We can see that rarer classes or sub-classes typically have a higher unlearning frequency. It indicates there is a strong correlation between the data distribution and the unlearning frequency. Then we conduct simulations for instances with different unlearning probabilities (see the Appendix for specific settings). Fig. 4 presents the variation of loss and difficulty for three types of instances which are unlearned with different probabilities. We can see that our instance difficulty is consistent with the unlearning frequency. Instances with higher unlearning frequency will receive higher difficulties and higher weights. Therefore, our method can rebalance the distribution of classes or sub-classes. + +# 4.4. Generality Experiments + +To demonstrate the generality of our method, we perform our method on various classification datasets. Specifically, the datasets include ten tiny classification datasets in the UCI machine learning repository, whose results are shown in Tab. 4. The results show that our method can steadily improve the performance of the base models on tiny datasets. Compared with the class-level method, our instance-level method is more effective. The detailed information of datasets is introduced in the Appendix. Moreover, we also evaluate our method on a large-scale dataset named iNaturalist 2019, our method also is effective to improve the performance of models. Specifically, our method + +Table 4. Accuracy % on 10 Datasets. All methods use the same network structure. The "Base" here is the Logistic Regression. "CB" denotes the class re-balance loss [7]. + +
MethodsBaseCBOurs
Sonar83.383.385.7
Balance91.292.092.8
CMC59.060.062.4
Ecoli82.485.385.3
Glass34.944.253.5
Heart72.272.272.2
Iris93.393.396.7
Robot93.594.094.1
Seeds97.697.697.6
Wine41.741.741.7
Average74.976.478.2
+ +improves the accuracy of the 50-layer ResNet from $70.19\%$ to $71.08\%$ and the accuracy of the 101-layer ResNet from $72.84\%$ to $73.32\%$ . The completed experimental results are shown in the Appendix. In conclusion, these results illustrate the generality of our method. + +# 5. Conclusions and Future Works + +In this paper, we studied the class-imbalanced classification problem from a more general instance-level view. Inspired by the idea that learning speed reflects the learning difficulty, we designed an instance difficulty model and presented a novel instance-level re-sampling strategy. Our method can re-balance the distribution of classes and unlabeled sub-classes. Moreover, our method achieved state-of-the-art results on the long-tailed benchmarks. In particular, this paper analyzed the relationship between the instance difficulty and the data distribution. Following our analysis, variant methods can be designed. The method of estimating the difficulty in this paper needs more computation, and the performance would be destroyed when there are wrong labeled instances. For such limitations, we presented more progress of our method and ideas for future works in the Appendix. In future works, we hope to design more efficient and robust variants for class-imbalanced classification. + +# 6. Acknowledgement + +This work was funded by the National Natural Science Foundation of China (NSFC) under Grants No. 62006218, 61902381, and 61872338, the Youth Innovation Promotion Association CAS under Grants No. 20144310, and 2021100, the Lenovo-CAS Joint Lab Youth Scientist Project, and the Foundation and Frontier Research Key Program of Chongqing Science and Technology Commission (No. cstc2017jcyjBX0059). + +# References + +[1] K. Ahuja, J. Wang, A. Dhurandhar, K. Shanmugam, and K. R. Varshney. Empirical or invariant risk minimization? a sample complexity perspective. 2020. 1 +[2] Samy Bengio. Sharing representations for long tail computer vision problems. In Proceedings of the 2015 ACM on International Conference on Multimodal Interaction, pages 1-1, 2015. 3 +[3] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41-48, 2009. 3 +[4] Jonathon Byrd and Zachary Lipton. What is the effect of importance weighting in deep learning? In International Conference on Machine Learning, pages 872-881. PMLR, 2019. 2 +[5] Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems, 2019. 1, 2, 3 +[6] Nitesh V. Chawla, Kevin W. Bowyer, Lawrence O. Hall, and W. Philip Kegelmeyer. Smote: Synthetic minority oversampling technique. Journal of Artificial Intelligence Research, 16(1):321-357, 2002. 1, 2 +[7] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In CVPR, 2019. 1, 2, 3, 5, 6, 7, 8 +[8] Q. Dong, S. Gong, and X. Zhu. Class rectification hard mining for imbalanced deep learning. IEEE, 2017. 3 +[9] Mwgr Dorling. Artificial neural networks (the multilayer perceptron)—a review of applications in the atmospheric sciences. Atmospheric Environment, 1998. 5 +[10] Yoav Freund and Robert Elias Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences, 1997. 3 +[11] Hui Han, Wen Yuan Wang, and Bing Huan Mao. Borderlinesmote: A new over-sampling method in imbalanced data sets learning. In Proceedings of the 2005 international conference on Advances in Intelligent Computing - Volume Part I, 2005. 2 +[12] Haibo He, Yang Bai, Edwardo A. Garcia, and Shutao Li. Adasyn: Adaptive synthetic sampling approach for imbalanced learning. In Neural Networks, 2008. IJCNN 2008. (IEEE World Congress on Computational Intelligence). IEEE International Joint Conference on, 2008. 2 +[13] Haibo He and Edwardo A Garcia. Learning from imbalanced data. IEEE Transactions on knowledge and data engineering, 21(9):1263-1284, 2009. 1, 2 +[14] K. He, X. Zhang, S. Ren, and S. Jian. Identity mappings in deep residual networks. Springer, Cham, 2016. 5 +[15] M. A. Jamal, M. Brown, M. H. Yang, L. Wang, and B. Gong. Rethinking class-balanced methods for long-tailed visual recognition from a domain adaptation perspective. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 3 + +[16] Nathalie Japkowicz and Shaju Stephen. The class imbalance problem: A systematic study. Intelligent data analysis, 6(5):429-449, 2002. 1, 2 +[17] Harold Jeffreys. An invariant form for the prior probability in estimation problems. Proceedings of the Royal Society of London, 186(1007):453, 1946. 4 +[18] Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander G Hauptmann. Self-paced curriculum learning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015. 3 +[19] Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations (ICLR), 2020. 3 +[20] Grigoris Karakoulas. Empirical validation of retail credit-scoring models. *Rma Journal*, (Sept), 2004. 4 +[21] Salman H Khan, Munawar Hayat, Mohammed Bennamoun, Ferdous Sohel, and Roberto Togneri. Cost sensitive learning of deep feature representations from imbalanced data. IEEE Transactions on Neural Networks & Learning Systems, 29(8):3573-3587, 2018. 2 +[22] Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pages 1885-1894. PMLR, 2017. 3 +[23] M Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. Advances in neural information processing systems, 23, 2010. 3 +[24] Shen Li, Zhouchen Lin, and Qingming Huang. Relay backpropagation for effective learning of deep convolutional neural networks. In European Conference on Computer Vision, 2016. 2 +[25] Tsung Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 2999-3007, 2017. 3, 5 +[26] Tsung Yi Lin, Michael Maire, Serge Belongie, James Hays, and C. Lawrence Zitnick. Microsoft coco: Common objects in context. In European Conference on Computer Vision, 2014. 1 +[27] Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X. Yu. Large-scale long-tailed recognition in an open world. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1 +[28] Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens Van Der Maaten. Exploring the limits of weakly supervised pretraining. In Proceedings of the European Conference on Computer Vision (ECCV), pages 181-196, 2018. 2, 3 +[29] T. Malisiewicz, A. Gupta, and A. A. Efros. Ensemble of exemplar-svms for object detection and beyond. In International Conference on Computer Vision, 2011. 3 +[30] Buda Mateusz, Maki Atsuto, and Maciej A. Mazurowski. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, pages S0893608018302107-, 2017. 1, 2 + +[31] S. Menard. Logistic regression. American Statistician, 58(4):364, 2004. 5 +[32] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. arXiv preprint arXiv:1310.4546, 2013. 3 +[33] Wanli Ouyang, Xiaogang Wang, Cong Zhang, and Xiaokang Yang. Factors in finetuning deep model for object detection with long-tail distribution. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 3 +[34] Judea Pearl, Madelyn Glymour, and Nicholas P Jewell. Causal inference in statistics: A primer. John Wiley & Sons, 2016. 3 +[35] Judea Pearl and Dana Mackenzie. The book of why: the new science of cause and effect. Science, 361(6405):855.2-855, 2018. 3 +[36] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, and M. Bernstein. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211-252, 2015. 1 +[37] S. Sinha, H. Ohashi, and K. Nakamura. Class-wise difficulty-balanced loss for solving class-imbalance. In Computer Vision - ACCV 2020, 2021. 1 +[38] Jingru Tan, Changbao Wang, Buyu Li, Quanquan Li, Wanli Ouyang, Changqing Yin, and Junjie Yan. Equalization loss for long-tailed object recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11662-11671, 2020. 2 +[39] Kaihua Tang, Jianqiang Huang, and Hanwang Zhang. Long-tailed classification by keeping the good and removing the bad momentum causal effect. In NeurIPS, 2020. 3, 5, 6 +[40] A Torralba, R Fergus, and W. T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. IEEE Transactions on Pattern Analysis & Machine Intelligence, 30(11):1958-1970, 2008. 1 +[41] Yiru Wang, Weihao Gan, Jie Yang, Wei Wu, and Junjie Yan. Dynamic curriculum learning for imbalanced data classification. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), 2020. 1, 3 +[42] Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Learning to model the tail. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 7032-7042, 2017. 3 +[43] Xi Yin, Xiang Yu, Kihyuk Sohn, Xiaoming Liu, and Manmohan Chandraker. Feature transfer learning for deep face recognition with under-represented data. arXiv preprint arXiv:1803.09014, 2018. 3 +[44] B. Zhou, Q. Cui, X. S. Wei, and Z. M. Chen. Bbn: Bilateral-branch network with cumulative learning for long-tailed visual recognition. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 1, 2 +[45] Yang Zou, Zhiding Yu, BVK Kumar, and Jinsong Wang. Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In Proceedings of the European conference on computer vision (ECCV), pages 289-305, 2018. 2 \ No newline at end of file diff --git a/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/images.zip b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0fab15bc50ba22504843aa7c0ba242eab444bf5f --- /dev/null +++ b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b58e90eee2a919b511af4af32cce83eb7cb26fb4120cf7dfe541b50a741d8424 +size 252006 diff --git a/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/layout.json b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d3706b94dc9528a1b65c29aa4a7c0707991359ff --- /dev/null +++ b/arebalancingstrategyforclassimbalancedclassificationbasedoninstancedifficulty/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7415fdd041a15a0b61d85b137ae0108d9746865cecb21efa2d1771efe3990763 +size 409900 diff --git a/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_content_list.json b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cd515f41ba2084d563481976a37d850c52620b2d --- /dev/null +++ b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69560b10f4282b84d72ad635c4be313b76780e0cf897711735436dadf0a0f208 +size 90134 diff --git a/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_model.json b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e2b2f9496051d9421e0fcf6d9b1d7cec7e51a837 --- /dev/null +++ b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7694f09f326c07d6293f9d28bdc5fdf6551a24b78e95ad38387072bbfd362c51 +size 122087 diff --git a/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_origin.pdf b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3939595a2f960c39eeb3b7b71c00652b7b4c0564 --- /dev/null +++ b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/8635e9b9-c8ec-4976-bd6b-e2f8d5afbf56_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cef9a510f55c8fb64dadbbe518ff3345a49e062795a7222f3ffe7aca3a551fdc +size 2085293 diff --git a/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/full.md b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/full.md new file mode 100644 index 0000000000000000000000000000000000000000..535123ab208bb2a034dec0ef8adf1e52f5ab0e9b --- /dev/null +++ b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/full.md @@ -0,0 +1,354 @@ +# AR-NeRF: Unsupervised Learning of Depth and Defocus Effects from Natural Images with Aperture Rendering Neural Radiance Fields + +Takuhiro Kaneko + +NTT Communication Science Laboratories, NTT Corporation + +![](images/982b702abf30276dd9a2e01bb4c7399f1619e5e1c1f4a165df317ad1fed20923.jpg) +(a) Training images +(b) Generated images and depths +Figure 1. Unsupervised learning of depth and defocus effects from unstructured (and view-limited) natural images. (a) During training, we used only a collection of unstructured single natural images and did not use any supervision (e.g., ground-truth depth, pairs of multiview images, defocus supervision, or pretrained models). (b) After training, AR-NeRF can generate sets of images and depths. In particular, in the generation of an image, AR-NeRF can adjust the defocus strength and focus distance intuitively and continuously using photometric constraints. The project page is available at https://www.kecl.ntt.co.jp/people/kaneko.takuhiro/projects/ar-nerf/. + +# Abstract + +Fully unsupervised 3D representation learning has gained attention owing to its advantages in data collection. A successful approach involves a viewpoint-aware approach that learns an image distribution based on generative models (e.g., generative adversarial networks (GANs)) while generating various view images based on 3D-aware models (e.g., neural radiance fields (NeRFs)). However, they require images with various views for training, and consequently, their application to datasets with few or limited viewpoints remains a challenge. As a complementary approach, an aperture rendering GAN (AR-GAN) that employs a defocus cue was proposed. However, an AR-GAN is a CNN-based model and represents a defocus independently from a viewpoint change despite its high correlation, which is one of the reasons for its performance. As an alternative to an AR-GAN, we propose an aperture rendering NeRF (AR-NeRF), which can utilize viewpoint and defocus cues in a unified manner by representing both factors in a common ray-tracing framework. Moreover, to learn defocus-aware and defocus-independent representations in a disentangled manner, we propose aperture randomized training, for which we learn to generate images while randomizing the aperture size and latent codes independently. During + +our experiments, we applied AR-NeRF to various natural image datasets, including flower, bird, and face images, the results of which demonstrate the utility of AR-NeRF for unsupervised learning of the depth and defocus effects. + +# 1. Introduction + +Natural images are 2D projections of the 3D world. Solving the inverse problem, i.e., understanding the 3D world from natural images, is a principal challenge in computer vision and graphics and has been actively studied in various fields owing to its diverse applications, such as environmental understanding in robotics, content creation in advertisements, and photo editing in the arts. + +After collecting pairs of 2D and 3D data or sets of multiview images, a successful approach is to learn the 3D predictor using direct or photometric-driven supervision. This approach demonstrates promising results in terms of fidelity. However, the collection of such data is often difficult or impractical. To reduce the collection costs, learning from single images (i.e., from a dataset that includes a single image per training instance) has been actively studied. + +To obtain clues under such setting, several studies [19, 32, 75, 77, 93] have introduced object-specific shape models, including 3DMM [5] and SMPL [51], and searched + +for solutions within the shape model constraints. Other studies have utilized auxiliary information such as 2D keypoints [33, 87] or 2D silhouettes [10, 22, 27, 44] to simplify the problem by aligning the object parts or separating the target objects from the background. These studies also demonstrate remarkable results; however, the construction of the shape model is not always easy and narrows the applicable objects, and auxiliary information incurs extra costs in terms of data collection. + +To alleviate such restrictions, a fully unsupervised approach, which learns 3D representations from single images without any additional supervision (including auxiliary information and pre-trained models), has gained attention. Under this setting, the viewpoint is a principal clue, which typical methods utilize by learning an image distribution using a generative model (e.g., a generative adversarial network (GAN) [23]) while generating various viewpoint images based on viewpoint-aware 3D models, such as voxels [27, 58, 59], primitives [46], and neural radiance fields (NeRFs) [9, 24, 56, 60, 61, 76]. This allows learning a viewpoint-aware 3D representation; however, owing to the diverse viewpoints needed, the application to a dataset in which viewpoint cues are limited or unavailable without the use of a preprocessing (e.g., natural flower or bird images, as shown in Figure 1) remains a challenge. + +As a complement to a viewpoint cue, an aperture rendering GAN (AR-GAN) [34] was proposed to exploit a defocus cue by equipping the aperture rendering [83] on top of the CNN GANs. This constraint allows the learning of both depth and depth-of-field (DoF) effects in an unsupervised manner. However, as a limitation, an AR-GAN employs the defocus cue independently from the viewpoint cue and cannot utilize both factors jointly despite these two factors being highly correlated with the ability to help each other. Consequently, the quality of the depth prediction when using AR-GAN remains limited. + +We thus aim to construct a unified model that can leverage defocus and viewpoint cues jointly by considering the application of unsupervised learning of the 3D representation (particularly depth and defocus effects) from natural unstructured (and view-limited) images (Figure 1). To achieve this, we propose a new extension of NeRF called aperture rendering NeRF (AR-NeRF), which can represent defocus effects and viewpoint changes in a unified manner by representing both factors through a common ray-tracing framework. More precisely, in contrast to the standard NeRF, which represents each pixel using a single ray under the pin-hole camera assumption, AR-NeRF employs an aperture camera [79] that represents each pixel using a collection of rays that converge at the focus plane and whose scale is de + +terminated according to the aperture size. Through such modeling, we can represent both viewpoint changes and defocus effects by simply changing the inputs and the integration of the implicit function (multilayer perceptron (MLP)), which converts the point position and view direction into the RGB color and volume density. Consequently, through training, we can optimize the MLP while reflecting both factors. + +Moreover, to disentangle defocus-aware and defocus-independent representations in an unsupervised manner, we introduce aperture randomized training, in which we learn to generate images in a GAN framework while changing the aperture size and latent codes both randomly and independently. A similar technique is commonly used in viewpoint-aware representation learning [9, 24, 27, 46, 56, 58-61, 76], and this training is useful for disentangling the effect of the corresponding factor from latent codes. + +We applied AR-NeRF to natural image datasets, including view-limited (Oxford Flowers [64] (flower) and CUB200-2011 [90] (bird)) datasets and datasets with various views (FFHQ [39] (face)), and demonstrated that AR-NeRF is better than or comparable to the baseline models, including a state-of-art fully unsupervised depth-learning model (i.e., AR-GAN [34]) and generative NeRF (particularly piGAN [9]), in terms of the depth prediction accuracy. We also demonstrated that AR-NeRF can manipulate the defocus effects (i.e., defocus strength and focus distance) intuitively and continuously while retaining the image quality, whereas AR-GAN has difficulty doing so. + +Overall, our contributions can be summarized as follows: + +- To achieve an unsupervised learning of the depth and defocus effects, we propose a new extension of NeRF called AR-NeRF, which can employ viewpoint and defocus cues in a unified manner by representing both factors in a common ray-tracing framework. +- To disentangle defocus-aware and defocus-independent representations under unsupervised conditions, we introduce aperture randomized training, by which we learn to generate images while changing the aperture size and latent codes both randomly and independently. +- We empirically demonstrate the utility of AR-NeRF for the unsupervised learning of the depth and defocus effects using various natural image datasets, including view-limited (flower and bird) datasets and datasets of various views (face). We provide detailed analyses and extended results in the supplementary material.2 + +# 2. Related work + +Implicit neural representations. Owing to their 3D-aware, continuous, and memory-efficient nature, implicit neural representations have gained attention in both + +learning-based 3D [2, 11, 12, 20, 54, 55, 62, 66, 68, 74] and scene [8, 13, 31, 69] reconstructions. Typical representations are supervised using 3D data; however, to eliminate the need for 3D supervision, the incorporation of differentiable rendering has also been proposed [49, 50, 63, 82, 100]. The most relevant model is NeRF [56], which combines implicit neural representations with volume rendering for a novel view synthesis. Our AR-NeRF is based on NeRF and obtains a viewpoint-aware functionality by inheriting it. However, to obtain the defocus-aware functionality, AR-NeRF employs an aperture camera model instead of a pinhole camera model, which is typically used in NeRF. Moreover, the described studies aimed to learn a single network per scene using a set of multiview images, whereas we aimed to construct a generative model from the collection of unstructured single images. Owing to this difference, we do not aim to compare AR-NeRF with NeRF in this study; however, reimporting our idea (i.e., the usage of an aperture camera) to the original task remains for future research. + +Generative adversarial networks. GANs [23] have shown remarkable results in 2D image modeling through a series of advancements (e.g., [7, 37-40]). A strong property of GANs is their ability to learn the data distribution through random sampling without directly defining the distribution. This property allows GANs to learn the data distribution through measurements [6, 35, 36, 43, 67] and architectural constraints [88, 94, 95, 99, 105]. Using the same logic, unsupervised 3D-aware GANs [9, 24, 27, 34, 46, 56, 58-61, 65, 76, 84] have succeeded in learning 3D-aware representations by incorporating 3D-2D projection modules and/or 3D-aware constraints. More specifically, most studies address viewpoint-aware representation learning using 3D representations based on voxels [27, 58, 59], primitives [46], and NeRFs [9, 24, 56, 60, 61, 76], and a few studies [34] have addressed the learning of defocus-aware representations. Herein, we introduce a unified model that can jointly leverage both defocus and viewpoint cues to strengthen the latter category model. We demonstrate the utility of their joint usage in the experiments described in Section 5.3. + +Learning 3D representations from single images. As discussed in Section 1, to eliminate the cost of collecting 3D data or multiview images, the learning of a 3D representation from single images has garnered attention. Promising approaches involve the use of shape models [19, 32, 75, 77, 93] and the incorporation of auxiliary information such as 2D keypoints [33, 87] or 2D silhouettes [10, 22, 27, 44]. Although such approaches have yielded remarkable results, the requirement for shape models or auxiliary information remains a bottleneck. To eliminate this bottleneck, a fully unsupervised learning approach based on generative models has been actively studied. The learning targets differ according to the studies applied, and to date, the unsupervised learning of viewpoints [9, 24, 27, 46, 56, 58-61, 65, 73, 76, 84, 96], albedo [96], texture [84], light [96], 3D meshes [73, 84], depth [34, 65, 96], and defocus effects [34] has been pro + +posed. Among these approaches, AR-NeRF shares the motivation with AR-GAN [34] with the aim of learning the depth and defocus effects. However, as the main difference, an AR-GAN represents an aperture renderer in a discretized CNN and is specific to the learning of the depth and defocus effects, whereas our AR-NeRF represents an aperture renderer with continuous radiance fields and can explain and utilize other ray-tracing-related phenomena (e.g., viewpoints) in a unified manner. We empirically demonstrate these merits in Section 5.2. + +Learning of depth and defocus effects. There is a large body of studies conducted on depth learning. Representative approaches involve training the depth predictor using pairs or sets of data, such as image and depth pairs [15, 16, 41, 42, 48, 98], multiview image pairs [18, 21, 97], and consecutive frame sets [91, 101, 104]. Defocus synthesis has also garnered interest in computer vision and graphics, and both model-based [3, 26, 30, 78, 89] and learning-based [29, 70, 83, 92] defocus synthesizers have been proposed. Based on the high correlation between the depth and defocus strength, some studies [25, 83] have proposed learning the depth while reconstructing focused images from all-in-focus images under the assumption that pairs of focused and all-in-focus images are available for training. Although our study is motivated by the success of such studies, the main difference is that we address a challenging but practically important situation in which there are no training data available other than natural unstructured (and view-limited) images. The latest model addressing this problem is an ARGAN [34]. As stated previously, we investigate the quantitative and qualitative differences in Section 5.2. + +# 3. Preliminaries + +# 3.1. GAN + +We begin by describing the two previous work upon which our model is built. The first is a GAN [23], which learns the data distribution implicitly through a two-player min-max game using the following objective: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {G A N}} = \mathbb {E} _ {\mathbf {I} ^ {r} \sim p ^ {r} (\mathbf {I})} [ \log D (\mathbf {I} ^ {r}) ] \\ + \mathbb {E} _ {\mathbf {z} \sim p ^ {g} (\mathbf {z})} [ \log (1 - D (G (\mathbf {z}))) ], \tag {1} \\ \end{array} +$$ + +where, given a latent code $\mathbf{z}$ , a generator $G$ generates an image $\mathbf{I}^g$ that fools the discriminator $D$ by minimizing this objective, whereas $D$ distinguishes $\mathbf{I}^g$ from a real image $\mathbf{I}^r$ by maximizing this objective. Here, the superscripts $r$ and $g$ represent real and generated data, respectively. Through adversarial training, $p^g (\mathbf{I})$ reaches close to $p^r (\mathbf{I})$ . + +# 3.2. NeRF + +NeRF [56] (in particular, we consider generative variants [9,76] relevant to our study) represents a scene using an MLP that takes the 3D position $\mathbf{x} \in \mathbb{R}^3$ and view direction $\mathbf{d} \in \mathbb{S}^2$ as inputs and predicts the RGB color $\mathbf{c}(\mathbf{x},\mathbf{d}) \in \mathbb{R}^3$ + +and volume density $\sigma (\mathbf{x})\in \mathbb{R}^{+}$ . More precisely, in [9, 76], positional encoding [56, 86] and sine nonlinearity [80] were used prior to or during the application of the MLP to encode positional information; however, we omit them for a general representation. Moreover, in a generative variant, the MLP also takes the latent code $\mathbf{z}\in \mathbb{R}^{L_{\mathbf{z}}}$ as input to represent a variety of data. However, this is omitted for simplicity. + +NeRF employs a pinhole camera (Figure 2(a)) and predicts the color of each pixel $\mathbf{C}(\mathbf{r})$ and the corresponding depth $Z(\mathbf{r})$ by integrating over a single camera ray $\mathbf{r}(t) = \mathbf{o} + t\mathbf{d}$ (where $\mathbf{o}$ and $\mathbf{d}$ are the camera origin and direction, respectively) within a distance $t \in [t_n, t_f]$ using the volume rendering equation [53]: + +$$ +\mathbf {C} (\mathbf {r}) = \int_ {t _ {n}} ^ {t _ {f}} T (t) \sigma (\mathbf {r} (t)) \mathbf {c} (\mathbf {r} (t), \mathbf {d}) d t, +$$ + +$$ +Z (\mathbf {r}) = \int_ {t _ {n}} ^ {t _ {f}} T (t) \sigma (\mathbf {r} (t)) t d t, +$$ + +where $T(t) = \exp \left(-\int_{t_n}^t\sigma (\mathbf{r}(s))ds\right)$ (2) + +In practice, the integral is intractable; thus, a discretized form with stratified and hierarchical sampling [56] is used. + +# 4. Aperture rendering NeRF: AR-NeRF + +# 4.1. Problem statement + +We first clarify the problem statement. We address fully unsupervised learning of the depth and defocus effects, where no supervision or pretrained models are available and only a collection of unstructured single images are accessible during training. Owing to the lack of explicit supervision, it is difficult to learn a conditional model that can directly predict the depth and defocus effects from an input image. As an alternative, we aim to construct an unconditional generator $G(\mathbf{z})$ that can generate the image and depth as a set while varying the defocus effects. Similar to viewpoint-aware representation learning, which requires a dataset that includes various view images to acquire the viewpoint cue, our defocus-aware representation learning requires a dataset that includes variously defocused images to obtain a defocus cue. More formally, we impose the following assumption for the dataset: + +Assumption 1 The training images are captured using various aperture-sized cameras, and the dataset includes diversely defocused images. + +Two factors affecting the defocus effects (as detailed in Section 4.2) are the aperture size and focus distance (distance between the ray origin and the plane where all objects are in focus). Hence, we can also impose the assumption of diversity of the focus distance instead of or in addition to Assumption 1. However, under a practical scenario, the focused target tends to be fixed when the scene is determined. + +![](images/910fcc8089ee23785996aab99350f7588ede9bc8c652f38ae85d8cd3d089cce2.jpg) +(a) Pinhole camera-based ray tracing on NeRF + +![](images/efe9d847e5ad1ac36f96a79a4d50f66261870be7f678ebd3d9d8913232f7e156.jpg) +(b) Aperture camera-based ray tracing on AR-NeRF (ours) +Figure 2. Comparison of ray tracing on NeRF and AR-NeRF. + +Hence, in this study, only Assumption 1 is imposed.3 + +Note that we assume the existence of diversely defocused images but do not assume the existence of their pairs/sets. We observed that this assumption is satisfied in a typical natural image dataset, as shown in Figure 1. + +# 4.2. Aperture rendering with NeRF + +As described in Section 3.2, NeRF is a strongly 3D-aware model that can jointly represent an image and depth at the design level (Equation 2). To utilize this strong property in our problem (Section 4.1), we consider representing aperture rendering in a ray-tracing framework, which is the basis of NeRF. This is achieved by replacing pinhole camera-based ray tracing (Figure 2(a)), which is used in a standard NeRF, with aperture camera-based ray tracing [79] (Figure 2(b)). + +For pinhole-camera-based ray tracing, we cast all rays from a single point $\mathbf{o}$ . By contrast, with aperture camera-based ray tracing, we cast rays from an aperture of radius $s$ . More formally, the origin of a ray from the aperture $(\mathbf{o}^{\prime})$ is written as + +$$ +\mathbf {o} ^ {\prime} = \mathbf {o} + \mathbf {u}, \tag {3} +$$ + +where $|\mathbf{u}| \in [0, s]$ , and the direction of $\mathbf{u}$ is orthogonal to $\mathbf{o}$ . + +A bundle of rays emitted from the aperture converges to a point on the plane at a focal distance of $f$ . Based on this definition, the direction of the ray from the aperture $(\mathbf{d}^{\prime})$ is calculated as follows: + +$$ +\mathbf {d} ^ {\prime} = \left(\mathbf {o} + f \mathbf {d} - \mathbf {o} ^ {\prime}\right) / f, \tag {4} +$$ + +Based on Equations 3 and 4, we can calculate the ray from the origin $\mathbf{o}'$ , that is, $\mathbf{r}'(t) = \mathbf{o}' + t\mathbf{d}'$ , and render the corresponding color $\mathbf{C}(\mathbf{r}')$ and depth $Z(\mathbf{r}')$ using volume rendering (Equation 2). The final color and depth are calculated by integrating over $\mathbf{C}(\mathbf{r}')$ and $Z(\mathbf{r}')$ for all rays in $|\mathbf{u}| \in [0, s]$ . However, similar to volume rendering, the integral is intractable in practice; therefore, a discretized form is used. + +More precisely, we generate a finite bundle of rays from the sampled $|\mathbf{u}| \in [0, s]$ and calculate the final output by taking the average of the corresponding $\mathbf{C}(\mathbf{r}')$ and $Z(\mathbf{r}')$ . + +# 4.3. Aperture randomized training + +To learn defocus-aware and defocus-independent representations in a disentangled manner, we introduce aperture randomized training, in which we learn to generate images by varying the aperture size and latent codes both randomly and independently. More formally, we rewrite the GAN objective (Equation 1) as follows:5 + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {A R - N e R F}} = \mathbb {E} _ {\mathbf {I} ^ {r} \sim p ^ {r} (\mathbf {I})} [ \log D (\mathbf {I} ^ {r}) ] \\ + \mathbb {E} _ {\mathbf {z} \sim p ^ {g} (\mathbf {z}), s \sim p ^ {g} (s)} [ \log (1 - D (G (\mathbf {z}, s))) ], \tag {5} \\ \end{array} +$$ + +where the latent code $\mathbf{z}$ and aperture size $s$ are sampled randomly and independently. In practice, we represent $p^g (s)$ using a half-normal distribution and parameterize its standard deviation $\sigma_{s}$ to determine the range of aperture sizes in a data-driven manner. As a side note, we represent the focus distance $f$ , another variable in aperture rendering, using MLP, taking $\mathbf{z}$ as the input under the assumption that $f$ is determined according to the rendered target. + +As discussed in Section 4.2, our aperture rendering has a strong 3D constraint based on ray tracing, and therefore when we train a model using Equation 5, $\mathbf{z}$ must capture the representations that are independent and robust to the change in defocus driven by the fluctuation of $s$ . + +# 4.4. Advanced techniques for practice + +To the best of our knowledge, unsupervised learning of the depth and defocus effects is a relatively new task (e.g., the first attempt was at CVPR 2021 [34]), and practical techniques (in particular, those specific to NeRF) have yet to be sufficiently developed. To advance this research direction, we discuss practical techniques considered for this task. + +Representation of unbounded background with $\mathrm{NeRF}++$ . A typical generative NeRF [9, 76] renders an entire scene in a tightly bounded 3D space to efficiently model the foreground. However, this strategy is problematic when training images with an unbounded background (e.g., bird images in Figure 1). In particular, this problem is critical in terms of learning the defocus effects because its strength is determined according to depth. We cannot represent a strong defocus effect at the design level when using a tightly bounded 3D space. To address this problem, we implemented a synthesis network using $\mathrm{NeRF}++$ [103], which is composed of a foreground NeRF in a unit sphere and background NeRF modeled using inverted sphere + +parameterization. This implementation allows representing a strong defocus effect in a far background. For a fair description, we note that concurrent approaches [24, 60] have also incorporated $\mathrm{NeRF}++$ for image generation to represent an unbounded background. + +Learning depth and defocus effects with changes in viewpoint. Fully unsupervised learning of the depth and defocus effects is a challenging and ill-posed problem, although our aperture randomized training alleviates this difficulty. To obtain a hint from another source, we jointly learn viewpoint-aware and view-independent representations by randomly sampling the camera poses during training [9, 76]. To prevent sampled camera parameters beyond a real distribution, we restrict its range (using a standard deviation of 0.1 radian in practice). We found that this setting works reasonably well for both datasets, including limited and wide viewpoints (Section 5.3). + +Aperture ray sampling scheme. In typical ray tracing used in computer graphics [79], a large number of rays (e.g., 100) are sampled per pixel in aperture rendering (Section 4.2) to improve the synthesis fidelity. However, this increases both the processing time and memory. To efficiently represent the aperture using limited rays, we used stratified sampling [56]. More concretely, we used five rays; the origin of one ray was placed at the center of the aperture, and the origins of the others were placed along the circumference of the aperture with equal intervals. We examine the effect of this approximation in the supplementary material. + +# 5. Experiments + +# 5.1. Experimental settings + +We conducted two experiments to verify the effectiveness of AR-NeRF from multiple perspectives: a comparative study (Section 5.2) in which we compared AR-NeRF to AR-GAN [34], which is a pioneering model with a similar objective, and an ablation study (Section 5.3) in which we investigated the importance of our ideas. In this section, we present the common settings and discuss the details of each in the next sections. + +Dataset. Following the AR-GAN study [34], we evaluated AR-NeRF using three natural image datasets: two view-limited datasets, i.e., Oxford Flowers [64] (8,189 flower images with 102 categories) and CUB-200-2011 [90] (11,788 bird images with 200 categories), and a viewvarious dataset, that is, FFHQ [39] (70,000 face images). To effectively examine various cases, we resized the images to a pixel resolution of $64 \times 64$ . This strategy was also used in the AR-GAN study [34]. Therefore, we can compare AR-NeRF to AR-GAN under fair conditions. We provide detailed information about the datasets in the supplementary material. + +Evaluation metrics. We evaluated the effectiveness of AR-NeRF quantitatively using the same two metrics used in the AR-GAN study [34] for a direct comparison. The first is + +the kernel inception distance (KID) [4], which measures the maximum mean discrepancy between real and generated images within the inception model [85]. We used the KID to evaluate the visual fidelity of the generated images. We calculated this score using 20,000 generated images and all real images. Based on our objective (i.e., training an unconditional model on unstructured natural images), preparing the ground truth depth is nontrivial. Following [34], as an alternative, we calculated the depth accuracy by (1) training the depth predictor using pairs of images and depths generated through GANs, (2) predicting the depths of real images using the trained depth predictor, and (3) comparing the predicted depths to those predicted by a highly generalizable monocular depth estimator [97] trained using stereo pairs. To measure the differences in depth, we used the scale-invariant depth error (SIDE) [15], which measures the difference between depths in a scale-invariant manner and is useful for comparing the depths predicted by different representation systems. For both metrics, the smaller the value, the better the performance. + +Implementation. We implemented AR-NeRF based on piGAN [9], which is a state-of-the-art generative variant of NeRF. Because the original pi-GAN was not applied to the dataset used in our experiments, we carefully tuned the configurations and hyperparameters such that the baseline piGAN could generate images reasonably well. Next, we incorporated a background synthesis network into pi-GAN based on $\mathrm{NeRF}++$ [103] (Section 4.4). Hereafter, we refer to this model as $pi-GAN++$ . Subsequently, we incorporated aperture rendering (Section 4.2) and aperture randomized training (Section 4.3) into $pi-GAN++$ . This is the model denoted by AR-NeRF below. We provide implementation details in the supplementary material. + +# 5.2. Comparative study + +To determine the validity of AR-NeRF for unsupervised learning of the depth and defocus effects, we first investigated the comparative performance between AR-NeRF and AR-GAN [34], which is a state-of-art model for this problem. The main difference between AR-NeRF and AR-GAN is the architectural difference, where AR-NeRF is constructed based on the continuous radiance fields, whereas AR-GAN is constructed based on discretized CNNs. Another small but significant difference is that AR-NeRF represents the defocus distribution (i.e., aperture size distribution) using a half-normal distribution (Equation 5), whereas AR-GAN represents it (i.e., depth scale distribution in this case) using a binomial distribution (Equation 6 in [34]). To confirm the effects of this difference, we also evaluated a variant of AR-GAN (referred to as $AR - GAN + +$ ), in which + +
Oxford FlowersCUB-200-2011FFHQ
KID↓SIDE↓KID↓SIDE↓KID↓SIDE↓
AR-GAN11.234.4614.303.585.754.21
AR-GAN++10.184.4213.913.615.434.88
RGBD-GAN12.047.0114.927.066.735.81
AR-NeRF (ours)7.863.946.813.633.672.61
+ +Table 1. Comparison of $\mathrm{{KID}} \downarrow \left( {\times {10}^{3}}\right)$ and $\mathrm{{SIDE}} \downarrow \left( {\times {10}^{2}}\right)$ between baseline GANs and AR-NeRF (ours). + +the defocus distribution was expressed using a half-normal distribution, similar to AR-NeRF. Furthermore, as a reference, we report the scores of RGBD-GAN [65], which learns the depth information using viewpoint cues.[9] + +Quantitative comparisons. We summarize quantitative comparison results in Table 1. AR-NeRF outperformed the baseline GANs in terms of the KID and SIDE, except for SIDE on CUB-200-2011, where AR-GAN/AR-GAN++ was comparable to AR-NeRF. $^{10}$ These results validate the utility of AR-NeRF for unsupervised learning of depth. We believe that the strengths of AR-NeRF, i.e., the joint usage of the viewpoint and defocus cues and continuous representations based on implicit functions, contribute to this improvement. We present qualitative comparisons of the predicted depths in the supplementary material. $^{2}$ + +Qualitative comparisons. We conducted qualitative comparisons to validate the effectiveness of unsupervised learning of the defocus effects. We present examples of generated images and depths in Figure 3. In AR-NeRF, we manipulated the defocus strength and focus distance by changing $s$ and $f$ (Figure 2(b)). As discussed above, the original ARGAN discretely represents the defocus distribution. Therefore, differently from AR-NeRF, it is unsuitable for conducting continuous operations. Alternatively, we examine the performance of AR-GAN++, which represents a continuous defocus distribution. In AR-GAN++, we manipulated the defocus strength and focus distance by changing the scale and offset of depth, respectively. + +The results indicate that AR-NeRF can manipulate both the defocus strength and focus distance without generating significant artifacts. In particular, in the manipulation of the focus distance, AR-NeRF succeeds in refocusing on both the foreground and background, the appearances of which are the same as those in the all-in-focus images (in the left-most column). By contrast, AR-GAN++ often generates + +![](images/2ba35fcb2a7e2bfb39f66b72312bea6cff81956a5aeada6912a3760c6b4b2cb2.jpg) +Figure 3. Comparison of generated images and depths between AR-GAN++ and AR-NeRF (ours). To manipulate the defocus strength, we varied the strength within $[0, \sigma_s, 2\sigma_s, 3\sigma_s]$ , where $\sigma_s$ indicates the standard deviation of a half-normal distribution, which is used to represent the defocus distribution during training. To manipulate the focus distance, we used a range in which the foregrounds and backgrounds were focused. + +![](images/2153baaf3808e99d1e7d394e2c5c004783b4d2d7bc3d169b6ca9fc3e925ae34e.jpg) + +unexpected artifacts, particularly when it attempts to refocus on the background (in the second-to-last column). As possible causes for this phenomenon, (1) AR-GAN++ discretely represents light fields in a 2D space; thus, the discretization error becomes critical when large manipulations are counted and (2) the predicted depths include artifacts (e.g., holes appearing in objects), causing errors when images are rendered based on depth. The properties of AR-NeRF, that is, (1) a continuous representation in a 3D space and (2) joint usage of defocus and viewpoint cues, are useful for addressing these defects. As another advantage of AR-NeRF, it can increase the resolution of the generated images by increasing the density of the input points owing to the nature of the implicit function [9]. We demonstrate this strength in Figure 1, where $128 \times 128$ images are generated using the same model as that used in Figure 3. + +# 5.3. Ablation study + +We conducted ablation studies to examine the utility of AR-NeRF as a generative variant of the NeRF. We compared AR-NeRF to five baselines: $pi-GAN$ [9], where a background synthesis network and aperture rendering are ablated; $pi-GAN++$ , where aperture rendering is ablated; $AR-NeRF-0$ , where viewpoint changes (Section 4.4) are not applied during training; $AR-NeRF-F$ , where the full viewpoint changes that are optimized to the face dataset (FFHQ) are used; and $pi-GAN++-F$ , where aperture rendering is ablated from $AR-NeRF-F$ . We tested the last two models on FFHQ only because viewpoint cues were limited on the + +
(Oxford Flowers)CUB-200-2011FFHQ
(B)(D)(V)KID↓SIDE↓KID↓SIDE↓
pi-GANL3.695.235.044.874.29
pi-GAN++L8.304.839.843.884.43
AR-NeRF-006.814.038.673.74
AR-NeRF-FF---4.59
pi-GAN++-FF----5.06
AR-NeRFL7.863.946.813.63
+ +Table 2. Comparison of $\mathrm{KID} \downarrow (\times 10^{3})$ and $\mathrm{SIDE} \downarrow (\times 10^{2})$ between AR-NeRF and ablated models. Check marks (B) and (D) indicate the use of a background synthesis network and defocus cue, respectively. In column (V), L, F, and 0 indicate the use of local, full, and no viewpoint changes, respectively. + +other datasets. For $pi-GAN++$ , we set the number of rays to be the same as that in AR-NeRF by an ensemble of multiple rays with an aperture size of $s = 0$ . We used this implementation to investigate the pure performance differences between the models with and without aperture rendering. + +Results. We list the quantitative results in Table 2 and provide a qualitative comparison of the predicted depths in the supplementary material. Our findings are as follows: + +(1) Effects of the background synthesis network (pi-GAN vs. pi-GAN++) We found that pi-GAN outperforms piGAN++ in terms of the KID. We consider that the compact representation of the pi-GAN is advantageous for efficiently learning 2D image distributions. However, pi-GAN was outperformed by pi-GAN++ in terms of the SIDE. This result indicates that pi-GAN is unsuitable for our aims (i.e., unsupervised learning of depth information) despite its abl + +ity to generate high-fidelity images. + +(2) Effects of aperture rendering (pi-GAN++ vs. AR-NeRF). We found that AR-NeRF outperformed pi-GAN++ on both metrics, except for SIDE on FFHQ, where piGAN++ was comparable to AR-NeRF. The same tendency holds for the comparison between AR-NeRF-F and piGAN++-F. This is because FFHQ includes sufficient viewpoint variations to leverage the viewpoint cues. By contrast, Oxford Flowers and CUB-200-2011 do not contain them. In this case, the defocus cues used in AR-NeRF contributed to an improvement. +(3) Comparison between viewpoint and defocus cues (pi-GAN++ vs. AR-NeRF-0). With these models, the defocus and viewpoint manipulations are ablated. Therefore, we can analyze each effect by comparing them. We found that, in FFHQ, pi-GAN++ outperformed AR-NeRF-0 in terms of SIDE, whereas in the other datasets, AR-NeRF-0 outperformed pi-GAN++. This can be explained by differences in the availability of the viewpoint cues, as discussed in (2). +(4) Comparison between local and full viewpoint changes (AR-NeRF vs. AR-NeRF-F). We found that AR-NeRF outperformed AR-NeRF-F on both metrics. This result indicates that we do not need to carefully tune the camera parameters for unsupervised depth learning. The same tendency was observed in the comparison between pi-GAN++ and pi-GAN++-F. Note that AR-NeRF-F has an advantage in the viewpoint manipulation capability because it can learn full view variations, whereas AR-NeRF can only learn local view variations. + +Detailed analyses. For further analyses, we examined (1) the importance of learning defocus effects from images, (2) the effect of the aperture ray sampling scheme, (3) simultaneous control of the viewpoint and defocus, (4) generation of higher-resolution images, (5) application to defocus renderers, (6) the Fréchet inception distance (FID) [28], and (7) the gradient of the difference in depth [14]. See the supplementary material for further details. + +# 6. Discussion + +# 6.1. Limitations and future work + +AR-NeRF has two limitations, stemming from radiance field representations and fully unsupervised learning. + +Limitations caused by radiance field representations. In radiance field representations, the computational complexity increases not only with the image size but also with the depth along each ray. Consequently, the calculation cost is higher than that of a CNN GAN (e.g., AR-GAN [34]); therefore, application to high-resolution images is difficult. AR-NeRF requires multiple rays per pixel to represent aperture rendering. Therefore, it incurs a larger calculation cost than the standard NeRF, which represents each pixel using a single ray. Through our experiments, we found that AR-NeRF outperforms the baseline NeRF, which has a similar calculation cost (in particular, pi-GAN++) + +![](images/d94474c65abdcd0fee182cc24c24ad37163db7b632c0096c24ef2e24f5d3d84d.jpg) +Figure 4. Failure case. + +This demonstrates the validity of our research direction. However, improving the calculation cost remains an important topic for future research. Recent concurrent studies [17, 24, 47, 71, 81, 102] have addressed reducing the calculation cost of NeRF, and the incorporation of these methods is also a promising research area. + +Limitations caused by fully unsupervised learning. Fully unsupervised learning of the depth and defocus effects is highly challenging, and some limitations remain. During our experiments, we found that our model is better than or comparable to the models trained under the same conditions. However, its performance is lower than that of supervised models. In particular, application to complex images will be difficult because AR-NeRF is a generative approach that assumes that it can learn the image generation reasonably well. Furthermore, the use of an unbounded background based on $\mathrm{NeRF}++$ [103] allows strong defocus effects that occur in the far plane to be represented. However, it is still difficult to distinguish the defocus blur from the flat texture when the defocus blur is extremely strong (e.g., Figure 4). Addressing these problems is a possible direction for future research. + +# 6.2. Potential negative social impact + +The method presented in this paper enables the creation of realistic images. This poses a potential risk to the creation of misleading content (e.g., deepfake). In particular, our model can increase the credibility of fake content in terms of 3D consistency and may potentially deceive systems that rely on 3D structures, such as face recognition systems. Therefore, we believe that it is essential for the community to develop technology to distinguish fake images from real images and carefully monitor advancements in the corresponding research fields [1,45,52,57,72]. + +# 7. Conclusion + +To advance the research on the fully unsupervised learning of depth and defocus effects, we introduced AR-NeRF, which extends NeRF by incorporating aperture rendering. AR-NeRF is noteworthy because it can employ defocus and viewpoint cues in a unified manner by representing both factors through a common ray-tracing framework. We empirically demonstrated the effectiveness of AR-NeRF for unsupervised learning of the depth and defocus effects. Although we focused on a generative variant of NeRF in this study, our idea, that is, the incorporation of aperture rendering in NeRF, is general, and we expect that its usage will broaden the applications of NeRF under practical scenarios. + +# References + +[1] Shruti Agarwal, Hany Farid, Yuming Gu, Mingming He, Koki Nagano, and Hao Li. Protecting world leaders against deep fakes. In CVPR Workshops, 2019. 8 +[2] Matan Atzmon and Yaron Lipman. SAL: Sign agnostic learning of shapes from raw data. In CVPR, 2020. 3 +[3] Jonathan T. Barron, Andrew Adams, YiChang Shih, and Carlos Hernandez. Fast bilateral-space stereo for synthetic defocus. In CVPR, 2015. 3 +[4] Mikołaj Binkowski, Dougal J. Sutherland, Michael Arbel, and Arthur Gretton. Demystifying MMD GANs. In ICLR, 2018. 6 +[5] Volker Blanz and Thomas Vetter. A morphable model for the synthesis of 3D faces. In SIGGRAPH, 1999. 1 +[6] Ashish Bora, Eric Price, and Alexandros G. Dimakis. AmbientGAN: Generative models from lossy measurements. In ICLR, 2018. 3 +[7] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In ICLR, 2019. 3 +[8] Rohan Chabra, Jan E. Lenssen, Eddy Ilg, Tanner Schmidt, Julian Straub, Steven Lovegrove, and Richard Newcombe. Deep local shapes: Learning local SDF priors for detailed 3D reconstruction. In ECCV, 2020. 3 +[9] Eric R. Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-GAN: Periodic implicit generative adversarial networks for 3D-aware image synthesis. In CVPR, 2021. 2, 3, 4, 5, 6, 7 +[10] Wenzheng Chen, Huan Ling, Jun Gao, Edward Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to predict 3D objects with an interpolation-based differentiable renderer. In NeurlPS, 2019. 2, 3 +[11] Zhiqin Chen, Kangxue Yin, Matthew Fisher, Siddhartha Chaudhuri, and Hao Zhang. BAE-NET: Branched autoencoder for shape co-segmentation. In ICCV, 2019. 3 +[12] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. In CVPR, 2019. 3 +[13] Julian Chibane, Aymen Mir, and Gerard Pons-Moll. Neural unsigned distance fields for implicit function learning. In NeurIPS, 2020. 3 +[14] David Eigen and Rob Fergus. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. In ICCV, 2015. 6, 8 +[15] David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from a single image using a multi-scale deep network. In NIPS, 2014. 3, 6 +[16] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In CVPR, 2018. 3 +[17] Stephan J. Garbin, Marek Kowalski, Matthew Johnson, Jamie Shotton, and Julien Valentin. FastNeRF: High-fidelity neural rendering at 200FPS. In ICCV, 2021. 8 +[18] Ravi Garg, Vijay Kumar B G, Gustavo Carneiro, and Ian Reid. Unsupervised CNN for single view depth estimation: Geometry to the rescue. In ECCV, 2016. 3 +[19] Baris Gecer, Stylianos Ploumpis, Irene Kotsia, and Stefanos Zafeiriou. GANFIT: Generative adversarial network fitting for high fidelity 3D face reconstruction. In CVPR, 2019. 1, 3 + +[20] Kyle Genova, Forrester Cole, Daniel Vlasic, Aaron Sarna, William T. Freeman, and Thomas Funkhouser. Learning shape templates with structured implicit functions. In ICCV, 2019. 3 +[21] Clément Godard, Oisin Mac Aodha, and Gabriel J. Brostow. Unsupervised monocular depth estimation with left-right consistency. In CVPR, 2017. 3 +[22] Shubham Goel, Angjoo Kanazawa, and Jitendra Malik. Shape and viewpoint without keypoints. In ECCV, 2020. 2,3 +[23] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. 2, 3 +[24] Jiatao Gu, Lingjie Liu, Peng Wang, and Christian Theobalt. StyleNeRF: A style-based 3D-aware generator for high-resolution image synthesis. In ICLR, 2022. 2, 3, 5, 8 +[25] Shir Gur and Lior Wolf. Single image depth estimation trained via depth from defocus cues. In CVPR, 2019. 3 +[26] Samuel W. Hasinoff and Kiriakos N. Kutulakos. A layer-based restoration framework for variable-aperture photography. In ICCV, 2007. 3 +[27] Philipp Henzler, Niloy Mitra, and Tobias Ritschel. Escaping Plato's cave using adversarial training: 3D shape from unstructured 2D image collections. In ICCV, 2019. 2, 3 +[28] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Günter Klambauer, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a Nash equilibrium. In NIPS, 2017. 8 +[29] Andrey Ignatov, Jagruti Patel, and Radu Timofte. Rendering natural camera bokeh effect with deep learning. In CVPR Workshops, 2020. 3 +[30] David E. Jacobs, Jongmin Baek, and Marc Levoy. Focal stack compositing for depth of field control. Stanford Computer Graphics Laboratory Technical Report, 1(1):2012, 2012. 3 +[31] Chiyu Max Jiang, Avneesh Sud, Ameesh Makadia, Jingwei Huang, Matthias Nießner, and Thomas Funkhouser. Local implicit grid representations for 3D scenes. In CVPR, 2020. 3 +[32] Angjoo Kanazawa, Michael J. Black, David W. Jacobs, and Jitendra Malik. End-to-end recovery of human shape and pose. In CVPR, 2018. 1, 3 +[33] Angjoo Kanazawa, Shubham Tulsiani, Alexei A. Efros, and Jitendra Malik. Learning category-specific mesh reconstruction from image collections. In ECCV, 2018. 2, 3 +[34] Takuhiro Kaneko. Unsupervised learning of depth and depth-of-field effect from natural images with aperture rendering generative adversarial networks. In CVPR, 2021. 2, 3, 4, 5, 6, 8 +[35] Takuhiro Kaneko and Tatsuya Harada. Noise robust generative adversarial networks. In CVPR, 2020. 3 +[36] Takuhiro Kaneko and Tatsuya Harada. Blur, noise, and compression robust generative adversarial networks. In CVPR, 2021. 3 +[37] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In ICLR, 2017. 3 +[38] Tero Karras, Miika Aittala, Samuli Laine, Erik Härkönen, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Alias-free generative adversarial networks. In NeurIPS, 2021. 3 + +[39] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. 2, 3, 5 +[40] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In CVPR, 2020. 3 +[41] Yevhen Kuznietsov, Jorg Stuckler, and Bastian Leibe. Semi-supervised deep learning for monocular depth map prediction. In CVPR, 2017. 3 +[42] Iro Laina, Christian Rupprecht, Vasileios Belagiannis, Federico Tombari, and Nassir Navab. Deeper depth prediction with fully convolutional residual networks. In 3DV, 2016. 3 +[43] Steven Cheng-Xian Li, Bo Jiang, and Benjamin Marlin. MisGAN: Learning from incomplete data with generative adversarial networks. In ICLR, 2019. 3 +[44] Xueting Li, Sifei Liu, Kihwan Kim, Shalini De Mello, Varun Jampani, Ming-Hsuan Yang, and Jan Kautz. Self-supervised single-view 3D reconstruction via semantic consistency. In ECCV, 2020. 2, 3 +[45] Yuezun Li, Xin Yang, Pu Sun, Honggang Qi, and Siwei Lyu. Celeb-DF: A large-scale challenging dataset for DeepFake forensics. In CVPR, 2020. 8 +[46] Yiyi Liao, Katja Schwarz, Lars Mescheder, and Andreas Geiger. Towards unsupervised learning of generative models for 3D controllable image synthesis. In CVPR, 2020. 2, 3 +[47] David B. Lindell, Julien N. P. Martel, and Gordon Wetzstein. AutoInt: Automatic integration for fast neural volume rendering. In CVPR, 2021. 8 +[48] Fayao Liu, Chunhua Shen, Guosheng Lin, and Ian Reid. Learning depth from single monocular images using deep convolutional neural fields. IEEE Trans. Pattern Anal. Mach. Intell., 38(10):2024-2039, 2015. 3 +[49] Shichen Liu, Shunsuke Saito, Weikai Chen, and Hao Li. Learning to infer implicit surfaces without 3D supervision. In NeurIPS, 2019. 3 +[50] Shaohui Liu, Yinda Zhang, Songyou Peng, Boxin Shi, Marc Pollefeys, and Zhaopeng Cui. DIST: Rendering deep implicit signed distance function with differentiable sphere tracing. In CVPR, 2020. 3 +[51] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black. SMPL: A skinned multi-person linear model. ACM Trans. Graph., 34(6):1-16, 2015. 1 +[52] Francesco Marra, Diego Gragnaniello, Davide Cozzolino, and Luisa Verdoliva. Detection of GAN-generated fake images over social networks. In MIPR, 2018. 8 +[53] Nelson Max. Optical models for direct volume rendering. IEEE Trans Vis Comput Graph, 1(2):99-108, 1995. 4 +[54] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3D reconstruction in function space. In CVPR, 2019. 3 +[55] Mateusz Michalkiewicz, Jhony K. Pontes, Dominic Jack, Mahsa Baktashmotlagh, and Anders Eriksson. Implicit surface representations as layers in neural networks. In ICCV, 2019. 3 +[56] Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. + +NeRF: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. 2, 3, 4, 5 +[57] Lakshmanan Nataraj, Tajuddin Manhar Mohammed, B. S. Manjunath, Shivkumar Chandrasekaran, Arjuna Flenner, Jawadul H. Bappy, and Amit K. Roy-Chowdhury. Detecting GAN generated fake images using co-occurrence matrices. In $EI$ , 2019. 8 +[58] Thu Nguyen-Phuoc, Chuan Li, Lucas Theis, Christian Richardt, and Yong-Liang Yang. HoloGAN: Unsupervised learning of 3D representations from natural images. In ICCV, 2019. 2, 3, 6 +[59] Thu Nguyen-Phuoc, Christian Richardt, Long Mai, Yong-Liang Yang, and Niloy Mitra. BlockGAN: Learning 3D object-aware scene representations from unlabelled images. In NeurIPS, 2020. 2, 3 +[60] Michael Niemeyer and Andreas Geiger. CAMPARI: Camera-aware decomposed generative neural radiance fields. In 3DV, 2021. 2, 3, 5 +[61] Michael Niemeyer and Andreas Geiger. GIRAFFE: Representing scenes as compositional generative neural feature fields. In CVPR, 2021. 2, 3 +[62] Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Occupancy flow: 4D reconstruction by learning particle dynamics. In ICCV, 2019. 3 +[63] Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable volumetric rendering: Learning implicit 3D representations without 3D supervision. In CVPR, 2020. 3 +[64] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In ICVGIP, 2008. 2, 5 +[65] Atsuhiro Noguchi and Tatsuya Harada. RGBD-GAN: Unsupervised 3D representation learning from natural image datasets via RGBD image synthesis. In ICLR, 2020. 2, 3, 6 +[66] Michael Oechsle, Lars Mescheder, Michael Niemeyer, Thilo Strauss, and Andreas Geiger. Texture fields: Learning texture representations in function space. In ICCV, 2019. 3 +[67] Arthur Pajot, Emmanuel de Bezenac, and Patrick Gallinari. Unsupervised adversarial image reconstruction. In ICLR, 2018. 3 +[68] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. DeepSDF: Learning continuous signed distance functions for shape representation. In CVPR, 2019. 3 +[69] Songyou Peng, Michael Niemeyer, Lars Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy networks. In ECCV, 2020. 3 +[70] Ming Qian, Congyu Qiao, Jiamin Lin, Zhenyu Guo, Chenghua Li, Cong Leng, and Jian Cheng. BGGAN: Bokeh-glass generative adversarial network for rendering realistic bokeh. In ECCV Workshops, 2020. 3 +[71] Christian Reiser, Songyou Peng, Yiyi Liao, and Andreas Geiger. KiloNeRF: Speeding up neural radiance fields with thousands of tiny MLPs. In ICCV, 2021. 8 +[72] Andreas Rossler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner. FaceForensics++: Learning to detect manipulated facial images. In ICCV, 2019. 8 + +[73] Mihir Sahasrabudhe, Zhixin Shu, Edward Bartrum, Riza Alp Guler, Dimitris Samaras, and Iasonas Kokkinos. Lifting AutoEncoders: Unsupervised learning of a fully-disentangled 3D morphable model using deep non-rigid structure from motion. In ICCV Workshops, 2019. 3 +[74] Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. PIFu: Pixel-aligned implicit function for high-resolution clothed human digitization. In ICCV, 2019. 3 +[75] Soubhik Sanyal, Timo Bolkart, Haiwen Feng, and Michael J. Black. Learning to regress 3D face shape and expression from an image without 3D supervision. In CVPR, 2019. 1, 3 +[76] Katja Schwarz, Yiyi Liao, Michael Niemeyer, and Andreas Geiger. GRAF: Generative radiance fields for 3D-aware image synthesis. In NeurIPS, 2020. 2, 3, 4, 5 +[77] Jiaxiang Shang, Tianwei Shen, Shiwei Li, Lei Zhou, Ming-min Zhen, Tian Fang, and Long Quan. Self-supervised monocular 3D face reconstruction by occlusion-aware multi-view geometry consistency. In ECCV, 2020. 1, 3 +[78] Xiaoyong Shen, Xin Tao, Hongyun Gao, Chao Zhou, and Jiaya Jia. Deep automatic portrait matting. In ECCV, 2016. 3 +[79] Peter Shirley. Ray tracing in one weekend. https://raytracing.github.io/books/RayTracingInOneWeekend.html, December 2020. 2,4,5 +[80] Vincent Sitzmann, Julien Martel, Alexander Bergman, David Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. In NeurIPS, 2020. 4 +[81] Vincent Sitzmann, Semon Rezchikov, William T. Freeman, Joshua B. Tenenbaum, and Fredo Durand. Light field networks: Neural scene representations with single-evaluation rendering. In NeurIPS, 2021. 8 +[82] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3D-structure-aware neural scene representations. In NeurIPS, 2019. 3 +[83] Pratul P. Srinivasan, Rahul Garg, Neal Wadhwa, Ren Ng, and Jonathan T. Barron. Aperture supervision for monocular depth estimation. In CVPR, 2018. 2, 3 +[84] Attila Szabó, Givi Meishvili, and Paolo Favaro. Unsupervised generative 3D shape learning from natural images. arXiv preprint arXiv:1910.00287, 2019. 3 +[85] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the Inception architecture for computer vision. In CVPR, 2016. 6 +[86] Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, and Ren Ng. Fourier features let networks learn high frequency functions in low dimensional domains. In NeurIPS, 2020. 4 +[87] Luan Tran and Xiaoming Liu. Nonlinear 3D face morphable model. In CVPR, 2018. 2, 3 +[88] Carl Vondrick, Hamed Piriaviash, and Antonio Torralba. Generating videos with scene dynamics. In NIPS, 2016. 3 +[89] Neal Wadhwa, Rahul Garg, David E. Jacobs, Bryan E. Feldman, Nori Kanazawa, Robert Carroll, Yair Movshovitz-Attias, Jonathan T. Barron, Yael Pritch, and Marc Levoy. + +Synthetic depth-of-field with a single-camera mobile phone. ACM Trans. Graph., 37(4):1-13, 2018. 3 +[90] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. 2, 5 +[91] Chaoyang Wang, José Miguel Buenapasada, Rui Zhu, and Simon Lucey. Learning depth from monocular videos using direct methods. In CVPR, 2018. 3 +[92] Lijun Wang, Xiaohui Shen, Jianming Zhang, Oliver Wang, Zhe Lin, Chih-Yao Hsieh, Sarah Kong, and Hutchuan Lu. DeepLens: Shallow depth of field from a single image. ACM Trans. Graph., 37(6):1-11, 2018. 3 +[93] Mengjiao Wang, Zhixin Shu, Shiyang Cheng, Yannis Panagakis, Dimitris Samaras, and Stefanos Zafeiriou. An adversarial neuro-tensorial approach for learning disentangled representations. Int. J. Comput. Vis., 127(6-7):743-762, 2019. 1, 3 +[94] Xiaolong Wang and Abhinav Gupta. Generative image modeling using style and structure adversarial networks. In ECCV, 2016. 3 +[95] Jiajun Wu, Chengkai Zhang, Tianfan Xue, Bill Freeman, and Josh Tenenbaum. Learning a probabilistic latent space of object shapes via 3D generative-adversarial modeling. In NIPS, 2016. 3 +[96] Shangzhe Wu, Christian Rupprecht, and Andrea Vedaldi. Unsupervised learning of probably symmetric deformable 3D objects from images in the wild. In CVPR, 2020. 3 +[97] Ke Xian, Jianming Zhang, Oliver Wang, Long Mai, Zhe Lin, and Zhiguo Cao. Structure-guided ranking loss for single image depth prediction. In CVPR, 2020. 3, 6 +[98] Dan Xu, Elisa Ricci, Wanli Ouyang, Xiaogang Wang, and Nicu Sebe. Multi-scale continuous CRFs as sequential deep networks for monocular depth estimation. In CVPR, 2017. 3 +[99] Jianwei Yang, Anitha Kannan, Dhruv Batra, and Devi Parikh. LR-GAN: Layered recursive generative adversarial networks for image generation. In ICLR, 2017. 3 +[100] Lior Yariv, Yoni Kasten, Dror Moran, Meirav Galun, Matan Atzmon, Ronen Basri, and Yaron Lipman. Multiview neural surface reconstruction by disentangling geometry and appearance. In NeurIPS, 2020. 3 +[101] Zhichao Yin and Jianping Shi. GeoNet: Unsupervised learning of dense depth, optical flow and camera pose. In CVPR, 2018. 3 +[102] Alex Yu, Ruilong Li, Matthew Tancik, Hao Li, Ren Ng, and Angjoo Kanazawa. *PlenOctrees for real-time rendering of neural radiance fields*. In ICCV, 2021. 8 +[103] Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. NeRF++: Analyzing and improving neural radiance fields. arXiv preprint arXiv:2010.07492, 2020. 5, 6, 8 +[104] Tinghui Zhou, Matthew Brown, Noah Snavely, and David G. Lowe. Unsupervised learning of depth and egomotion from video. In CVPR, 2017. 3 +[105] Jun-Yan Zhu, Zhoutong Zhang, Chengkai Zhang, Jia-jun Wu, Antonio Torralba, Joshua B. Tenenbaum, and William T. Freeman. Visual object networks: Image generation with disentangled 3D representation. In NeurIPS, 2018. 3 \ No newline at end of file diff --git a/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/images.zip b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..87dbdcb6e58cfaae0eab81731e54d29a6fcd5937 --- /dev/null +++ b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:672e6277f122ba313b6dc2088c0495e14310c3b58276faf17c9b240cd2a0deec +size 350348 diff --git a/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/layout.json b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..92f89e342c568ee09f862fc0cc01cf7307319481 --- /dev/null +++ b/arnerfunsupervisedlearningofdepthanddefocuseffectsfromnaturalimageswithaperturerenderingneuralradiancefields/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5d4d6e57639a72f41b7121db3803904ce1567dad568f5c2c49b4df72aeacd6c +size 459928 diff --git a/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_content_list.json b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..22cc28a2e3216119d25f9d3fc54f0ff949909aeb --- /dev/null +++ b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1bca9e4ce5260a432d4c24d8d51fc1b335a9d3ee1147fd62394748551742b04 +size 79705 diff --git a/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_model.json b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1f927ef552776a5cee31db56b9c666d79fd0f478 --- /dev/null +++ b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edb609f499e2dd46f3ffd846ff570d2d4218e417ff304ed141f606367b2354ab +size 99547 diff --git a/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_origin.pdf b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c1a8fd207b2d9c2ef8525ef0c3be61104abc1781 --- /dev/null +++ b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/039eab44-4b92-44f1-a48a-d2e9ac64abd3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f183c5f225c3d1831687f058d97bf632b96ba7d0ff0fbea56e1abff181e81ab1 +size 938283 diff --git a/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/full.md b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b1b937cc6497a2f2d6cbdd678437c965a96cbeb6 --- /dev/null +++ b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/full.md @@ -0,0 +1,317 @@ +# ART-Point: Improving Rotation Robustness of Point Cloud Classifiers via Adversarial Rotation + +Ruibin Wang $^{1}$ , Yibo Yang $^{2,*}$ , Dacheng Tao $^{2}$ + +1 Key Laboratory of Machine Perception (MOE), School of Artificial Intelligence, Peking University +2 JD Explore Academy, China + +{robin_wang, ibo}@pku.edu.cn, dacheng.tao@gmail.com + +# Abstract + +Point cloud classifiers with rotation robustness have been widely discussed in the 3D deep learning community. Most proposed methods either use rotation invariant descriptors as inputs or try to design rotation equivariant networks. However, robust models generated by these methods have limited performance under clean aligned datasets due to modifications on the original classifiers or input space. In this study, for the first time, we show that the rotation robustness of point cloud classifiers can also be acquired via adversarial training with better performance on both rotated and clean datasets. Specifically, our proposed framework named ART-Point regards the rotation of the point cloud as an attack and improves rotation robustness by training the classifier on inputs with Adversarial RoTations. We contribute an axis-wise rotation attack that uses back-propagated gradients of the pre-trained model to effectively find the adversarial rotations. To avoid model over-fitting on adversarial inputs, we construct rotation pools that leverage the transferability of adversarial rotations among samples to increase the diversity of training data. Moreover, we propose a fast one-step optimization to efficiently reach the final robust model. Experiments show that our proposed rotation attack achieves a high success rate and ART-Point can be used on most existing classifiers to improve the rotation robustness while showing better performance on clean datasets than state-of-the-art methods. + +# 1. Introduction + +A very basic requirement for point cloud classification is expecting the network to obtain stable predictions on inputs undergoing rigid transformations since such transformations do not change the shape of the object, let alone change its semantic meanings. This basic requirement is even more important in practical applications. For exam- + +ple, when a robot is identifying and picking up an object, the object is usually in an unknown pose. However, many studies [7, 17, 51] have shown that most existing point cloud classifiers can be easily attacked by simply rotating the inputs. To use these classifiers we require to align all input objects which is a very expensive and time-consuming process. To this end, how to improve the robustness of point cloud classifiers to arbitrary rotations, becomes a very popular and necessary research topic. + +In order to make the network robust to rotated inputs, most existing works can be classified into three categories: (1) Rotation Augmentation Methods attempt to augment the training data using rotations and have been widely used in the earlier point cloud classifiers [29, 30, 39]. However, data augmentation can hardly be applied to improve model robustness to arbitrary rotations due to the astronomical number of rotated data [49]. (2) Rotation-Invariance Methods propose to convert the input point clouds into geometric descriptors that are invariant to rotations. Typical invariant descriptors can be the distance and angles between local point pairs [4,8,47,48] or point norms [17,49] and principal directions [47] calculated from global coordinates. (3) Rotation-Equivariance Methods try to solve the rotation problem from the perspective of model architectures. For example, [5,27,37,40] use convolution with steerable kernel bases to construct rotation-equivariant networks and [7,34,50] modify existing networks with equivariant operations. While both methods (2) and (3) can effectively improve model robustness to arbitrary rotations, they either require time-consuming pre-processing on inputs or need complex architectural modifications, which will result in limited performance on clean aligned datasets. + +In this paper, we try to explore a new technical route for the rotation robustness problem in point clouds. Our method is inspired by adversarial training [22], a typical defense method to improve model robustness to attacks. The idea of adversarial training is straightforward: it augments training data with adversarial examples in each training loop. Thus adversially trained models behave more + +normally when facing adversarial examples than standardly trained models. Adversarial training has shown its great effectiveness in improving model robustness to image or text perturbations [9, 11, 21, 33, 44], while keeping a strong discriminative ability. In 3D point clouds, [18, 35, 36] also successfully leverage adversarial training to defend against point cloud perturbations such as random point shifting or removing. However, using adversarial training to improve the rotation robustness of point cloud classifiers has rarely been studied. + +To this end, by regarding rotation as an attack, we develop the ART-Point framework to improve the rotation robustness by training networks on inputs with Adversarial RoTations. Like the general framework of adversarial training, ART-Point forms a classic min-max problem, where the max step finds the most aggressive rotations, on which the min step is performed to optimize the network parameters for rotation robustness. For the max step, we propose an axis-wise rotation attack algorithm to find the most offensive rotating samples. Compared with the existing rotation attack algorithm [51] that directly optimizes the transformation matrix, our method optimizes on the rotation angles which reduces the optimization parameters, while ensuring that the attack is pure rotation to serve for the adversarial training. For the min step, we follow the training scheme of the original classifier to retrain the network on the adversarial samples. To overcome the problem of over-fitting on adversarial samples caused by label leaking [15], we construct a rotation pool that leverages the transferability of adversarial rotations among point cloud samples to increase the diversity of training data. Finally, inspired by ensemble adversarial training [38], we contribute a fast one-step optimization method to solve the min-max problems. Instead of alternately optimizing the min-max problem until the model converges, the one-step method can quickly reach the final robust model with competitive performance. + +Compared with the rotation-invariant and equivariant methods, the ART-Point framework aims to optimize network parameters such that the converged model is naturally robust to both arbitrary and adversarial rotations, without the necessity of either geometric descriptor extractions or architectural modifications that may impede the model to learn discriminative features. So our resulting robust model better inherits the original performance on the clean (aligned) datasets. It has no constraint on the model design and can be integrated on most point cloud classifiers. + +In experiments, we mainly verify the effectiveness of our methods under two datasets ModelNet40 [42] and ShapeNet16 [46]. We adopt PointNet [29], PointNet++ [30] and DGCNN [39] as the basic classifiers. Firstly, compared with the existing rotation attack method [51], our proposed attack achieves a higher attack success rate. Then, compared with existing rotation robust classifiers, our best + +model (ART-DGCNN) shows a more robust performance on randomly rotated datasets. Meanwhile, our methods generally show less accuracy reduction on clean aligned datasets. Beyond arbitrary rotations, the resulting models also show a solid defense against adversarial rotations.1 Our contributions can be summarized as follows: + +- For the first time, we successfully improve the rotation robustness of point cloud classifiers from the perspective of model attack and defense. Our proposed framework, ART-Point, enjoys fewer architectural modifications than previous rotation-equivariant methods and requires no descriptor extractions on input data. +- We propose an axis-wise rotation attack algorithm to efficiently find the most aggressive rotated samples for adversarial training. A rotation pool is designed to avoid over-fitting of models on adversarial samples. We also contribute a fast one-step optimization to solve the min-max problem. +- We validate our method on two datasets with three point cloud classifiers. The results show that our attack algorithm achieves a higher attack success rate than existing methods. Moreover, the proposed ART-Point framework can effectively improve model rotation robustness allowing the model to defend against both arbitrary and adversarial rotations, while hardly affecting model performance on clean data. + +# 2. Related Work + +# 2.1. Rotation Robust Point Cloud Classifiers + +Rotation Augmentation. The initial work of the point cloud classifier [29,30,39] adopt rotation augmentation during training to improve rotation robustness. Nevertheless, rotation augmentation can only result in models robust to a small range of angles. More recently, to obtain models robust to arbitrary rotation angles, both rotation-invariance and rotation-equivariance methods are proposed. + +Rotation-invariance methods extract rotation-invariant descriptors from point clouds as model inputs. For example, [4, 8, 28, 48] cleverly construct distances and angles from local point pairs. [17, 47, 49] further extend local invariant descriptors with global invariant contexts. In addition to using invariant descriptors with a clear geometric meaning, [20, 28, 31] also design invariant convolutions to automatically learn various descriptors for processing. + +Rotation-equivariance methods expect the learned features to rotate correspondingly with the input thus resulting in rotation robust models. Most of these works usually rely on rotation-equivariant convolutions [5, 6, 10, 14, 27, 37, 40] + +to construct equivariant networks. Other works like [7, 34, 50] attempt to modify modules in existing point cloud classifiers [29, 30, 39] to make them rotation-equivariant. + +However, these methods usually require specific descriptors or network modules which will reduce the performance of the classifier on the aligned datasets. Our study differs from these methods in that we try to obtain a robust model by optimizing the parameters without changing the input space or network architectures. + +# 2.2. Adversarial Training + +Adversarial Training [13, 22] has been proved to be the most effective technique against adversarial attacks [23, 26, 32], receiving considerable attention from the research community. Unlike other defense strategies, adversarial training aims to enhance the robustness of models intrinsically [1]. This property makes adversarial training widely used in various fields to improve the robustness of the model, including image recognition [11, 12, 33, 44], text classification [9, 21, 24, 25], relation extraction [41] etc. In 3D point clouds classification, adversarial training can also be effectively used. For example, [18] employs adversarial training to improve the model robustness to point shifting perturbation by training on both clean and adversially perturbed point clouds. [36] presents an in-depth study showing how adversarial training behaves in point cloud classification. However, existing works only focus on improving the model's robustness to perturbations of random point shifting or removing [12, 16, 19, 43, 45, 52]. + +Recently, [51] designs a rotation attack algorithm for existing point cloud classifiers. Yet it does not provide detailed strategies to defense the rotation attack. As a comparison, we design a new attack algorithm that enjoys a higher attack success rate. More importantly, it serves for our adversarial training framework that generates model naturally defending against both arbitrary and adversarial rotations. + +# 3. Methods + +In this section, we first provide a brief review of adversarial training (Sect. 3.1). Then, we reformulate the adversarial training objective under rotation attack of point clouds (Sect. 3.2). Next, we propose attack (Sect. 3.3) and defense (Sect. 3.4) algorithms to obtain good solutions to the reformulated objective. Finally, we provide a one-step optimization to fast reach a robust model (Sect. 3.5). + +# 3.1. Preliminaries on Adversarial Training + +Let us first consider a standard classification task with an underlying data distribution $\mathcal{D}$ over inputs $p\in \mathbb{R}^d$ and corresponding labels $q\in [k]$ . The goal then is to find model parameters $\theta$ that minimize the risk $\mathbb{E}_{(p,q)\sim \mathcal{D}}[L(\theta ,p,q)]$ where $L(\theta ,p,q)$ is a suitable loss function. To improve the model robustness, we wish no perturbations are possible to + +fool the network, which gives rise to the following formulation: + +$$ +\min _ {\theta} \rho (\theta), \quad \text {w h e r e} \quad \rho (\theta) = \mathbb {E} _ {(p, q) \sim \mathcal {D}} [ L (\theta , p + \delta , q) ], \tag {1} +$$ + +where $p + \delta$ refers to the perturbed samples generated by introducing perturbations $\delta \in S$ on input data $p$ . $S$ refers to the allowed perturbation set. Eq. (1) reflects the basic idea of data augmentations. + +In contrast, adversarial training improves model robustness more efficiently. By the in-depth study of the landscape of adversarial samples, [22] finds the concentration phenomenon of different adversarial samples, which suggests that training on the most aggressive adversary yields robustness against all other concentrated adversaries. This gives rise to the formulation of adversarial training which is a saddle point problem: + +$$ +\min _ {\theta} \rho (\theta), \quad \text {w h e r e} \quad \rho (\theta) = \mathbb {E} _ {(p, q) \sim \mathcal {D}} [ \max _ {\delta \in \mathcal {S}} L (\theta , p + \delta , q) ]. \tag {2} +$$ + +The saddle point problem can be viewed as the composition of an inner maximization problem and an outer minimization problem, where the inner maximization problem is finding the worst-case samples for the given model, and the outer minimization problem is to train a model robust to adversarial samples. Compared with data augmentation, adversarial training searches for the best solution to the worst-case optimum and can improve the model robustness to perturbations in larger ranges [22]. + +# 3.2. Problem Formulation + +Our main goal is to improve the robustness of the point cloud classifiers to rotation attacks through the adversarial training framework. We reformulate Eq. (2) by specifying the perturbation to be the point cloud rotation as follows: + +$$ +\min _ {\theta} \rho (\theta), \quad \text {w h e r e} \quad \rho (\theta) = \mathbb {E} _ {(p, q) \sim \mathcal {D}} [ \max _ {R \in S O (3)} L (\theta , R p, q) ], \tag {3} +$$ + +where $p \in \mathbb{R}^{n \times 3}$ refers to an input point cloud of size $n$ and $q \in [k]$ is the corresponding class label. $\theta$ is the parameters of point cloud classifiers such as PointNet [29] or DGCNN [39]. $Rp$ refers to the adversarial samples generated by using matrix $R$ to rotate the input $p$ and $SO(3)$ is the group of all rotations around the origin of $\mathbb{R}^3$ Euclidean space. We set the rotation $R \in SO(3)$ to ensure the objective is to make the model robust to arbitrary rotations. + +As discussed in [22], one key element for obtaining a good solution to Eq. (3) is using the strongest possible adversarial samples to train the networks. Following this principle, we first propose a novel rotation attack method that enjoys satisfactory attack success and thus better serves for the adversarial training to improve model robustness. + +![](images/51245f822dde289a66b6912267f043f5c86cd55f9164f758b04a4293c69ec766.jpg) +Figure 1. The general pipeline of our adversarial training approach. In the upper branch, the network takes a clean batch (aligned object) as inputs and finds the most aggressive attack angles by maximizing the classification loss of the eval model. The attack angles will be stored by class in the rotation pool. In the lower branch, the network samples angles from the rotation pool to produce adversarial point clouds for re-training the classifier to obtain the rotation robust model. The red and blue dashed lines respectively indicate routes of the backward gradient in two optimization tasks and point to the final optimized parameters. In the real implementations, the one-step optimization will construct the rotation pool by attacking multiple eval models, while the iterative optimization will update the parameter of the eval model by parameters of the latest re-trained model in each min-max iterations. + +# 3.3. Attack—Inner Maximization + +For the inner maximization problem, we expect a strong rotation attack algorithm that can find the most aggressive samples inducing high classification loss. A previous study [51] introduced two rotation attack methods, Thompson Sampling Isometry (TSI) attack and Combined Targeted Restricted Isometry (CTRI) attack, for generating adversarial rotations. However, they can hardly be used in adversarial training for the following reasons: (1) the TSI attack is a black-box attack, which has no direct access to the classifier parameters and thus can hardly be used to find samples inducing high loss. (2) CTRI attack is a white-box attack and one can use parameter information to search the most aggressive samples. Yet, in CTRI, there is no strict constraint for the matrix to be a pure rotation, which leads to adversarial samples with non-rigid deformation. To this end, we propose a novel white-box attack that finds the most aggressive samples while guaranteeing that the attack is pure rotation. + +Gradient Descent on Angles. Firstly, to ensure the attack is pure rotation, we propose to optimize the attack by gradient descent on rotating angles. Specifically, for an n-point cloud $p = [x_i,y_i,z_i], i = 1\dots n$ , we consider vectors $\Phi = [\phi_x,\phi_y,\phi_z]$ with 3 parameters denoting rotation angles along three axes. Rotating points along $z$ axis by $\delta$ will increase the loss $L$ by $\frac{\partial L}{\partial\phi_z}\delta$ , which can then be calculated + +under the spherical coordinate, by the chain rule as: + +$$ +\begin{array}{l} \frac {\partial L}{\partial \phi_ {z}} = \sum_ {i = 1} ^ {n} \left(\frac {\partial x _ {i}}{\partial \phi_ {z}} \frac {\partial L}{\partial x _ {i}} + \frac {\partial y _ {i}}{\partial \phi_ {z}} \frac {\partial L}{\partial y _ {i}} + \frac {\partial z _ {i}}{\partial \phi_ {z}} \frac {\partial L}{\partial z _ {i}}\right) \tag {4} \\ = \sum_ {i = 1} ^ {n} (- y _ {i} \frac {\partial L}{\partial x _ {i}} + x _ {i} \frac {\partial L}{\partial y _ {i}}), \\ \end{array} +$$ + +where, $\frac{\partial L}{\partial x} = \nabla_x L(\theta, p, q)$ and $\frac{\partial L}{\partial y} = \nabla_y L(\theta, p, q)$ are gradients back-propagated on point coordinates. For the rest of the rotation axes, $\frac{\partial L}{\partial \phi_x}$ and $\frac{\partial L}{\partial \phi_y}$ can also be calculated in the same way. Based on Eq. (4), we can iteratively optimize the angles by gradient descent to obtain adversarial rotations that induce high loss. Finally, the rotation matrix is generated from optimized angles as $R = R_{\phi_z} R_{\phi_y} R_{\phi_x}$ , where $R_{\phi_x}$ corresponds to the rotation matrix that rotates $\phi_x$ degrees around $x$ axis. More derivations about the gradient calculation and rotation matrix construction will be provided in the supplementary. + +Axis-Wise Attack. In order to efficiently find the most aggressive rotations, based on the angle gradients, we further propose an axis-wise mechanism. Specifically, we subdivide a rotation in SO(3) into rotations around three axes for optimization. By doing so, each time we can choose the most aggressive axis to rotate, resulting in stronger attacks. We approximate the loss change ratio of a specific axis by $\left|\frac{\partial L}{\partial \phi}\right|$ , which reflects the influence of rotating around a certain axis on final losses. Next, we select the most influenced + +# Algorithm 1 Axis-Wise Rotation Attack + +Require: Point cloud input $p$ , label $q$ and model parameters $\theta$ , loss function $L(\theta, p, q)$ , number of iterations $T$ , step size $\alpha$ , initial rotation angles $\Phi = [\phi_x, \phi_y, \phi_z]$ and corresponding rotation matrix $R = R_{\phi_x} R_{\phi_y} R_{\phi_z}$ . + +1: for $t = 0$ to $T$ do +2: Compute the gradients on coordinates: +3: $\frac{\partial L}{\partial p^{(t)}} = [\frac{\partial L}{\partial x^{(t)}},\frac{\partial L}{\partial y^{(t)}},\frac{\partial L}{\partial z^{(t)}} ]$ +4: Compute the gradients on angles by Eq. (4). +5: Determining the target axis by Eq. (5). +6: Attack the target axis by Eq. (7). +7: Update the rotation matrix: +8: $R^{(t + 1)} = R_{\phi_x^{(t + 1)}}R_{\phi_y^{(t + 1)}}R_{\phi_z^{(t + 1)}}$ +9: Obtain the attacked point clouds: $p^{(t + 1)} = R^{(t + 1)}p$ + +10: end for + +Output $R^{(T)},p^{(T)}$ + +axis + +$$ +\xi^ {*} = \operatorname {a r g m a x} _ {\xi} \left| \frac {\partial L}{\partial \phi_ {\xi}} \right|, \xi \in [ x, y, z ], \tag {5} +$$ + +and attack the axis by rotating one step in the opposite direction of gradient descent: + +$$ +\phi_ {\xi^ {*}} ^ {(t + 1)} = \phi_ {\xi^ {*}} ^ {(t)} + \alpha \operatorname {s i g n} \left(\frac {\partial L}{\partial \phi_ {\xi^ {*}}}\right). \tag {6} +$$ + +Compared with simultaneously optimizing on all three axes, the axis-wise attack can specify a gentler change of the rotation angles in each attack step. + +Implementation Details. In the real implementations, we adopt several other general settings to find adversarial samples. Firstly, we use the Projected Gradient Descent (PGD) [22] to optimize angles. Compared with the normal gradient descent, PGD ensures that the optimized angles can be constrained into certain scopes: + +$$ +\phi_ {\xi^ {*}} ^ {(t + 1)} = \operatorname {P r o j} _ {[ - \pi , \pi ]} \left(\phi_ {\xi^ {*}} ^ {(t)} + \alpha \operatorname {s i g n} \left(\frac {\partial L}{\partial \phi_ {\xi^ {*}}}\right)\right). \tag {7} +$$ + +In our case, we set the projected scope as $[- \pi, \pi]$ to avoid the discontinuity caused by the periodicity of rotation. Then, instead of cross-entropy, we follow [43, 51] to adopt CW loss [3] to modify the cross-entropy as a more powerful adversarial objective to generate stronger adversary. Finally, to make sure that the generated adversary can be more evenly distributed among $[- \pi, \pi]$ , we adopt a random start strategy. For each input point cloud, we will initialize it with a random rotation angle, then continue to attack along with the initialization angles. The proposed axis-wise rotation attack algorithm is illustrated in Algorithm (1). + +# 3.4. Defense—Outer Minimization + +On the defense side, we use Stochastic Gradient Descent (SGD) [2] to re-train the model on the adversarial samples. + +![](images/04cf2155ce4a04c59f7459b2a7d04d9cd2a6338b031af41a923b7c5e4bd9bcb4.jpg) +Figure 2. Transferability of adversarial rotations among samples in the same categories. The adversarial rotation found on one sample in "Bench" can be applied to other samples of the same category to induce high loss and mislead the model to classify them into a wrong category "Bookshelf". + +During experiments, we find that for the original training set $\mathcal{A}$ and its attacked set $\mathcal{B}$ with rotations, directly training on set $\mathcal{B}$ can easily lead to model over-fitting. This behavior is known as label leaking [15] and stems from the fact that the gradient-based attack produces a very restricted set of adversarial examples that the network can overfit. The problem can be even worse on the smaller training set, in our case, ModelNet40 [42]. To solve the label leaking caused over-fitting problems, we propose to increase the training data with more kinds of adversarial rotations. A simple solution is to construct the training set $\mathcal{B}$ with multiple attack $\mathcal{B} = [\mathrm{attack}_1(\mathcal{A}),\mathrm{attack}_2(\mathcal{A}),\dots,\mathrm{attack}_i(\mathcal{A})]$ . However, multiple attacks can be very time-consuming. To this end, we construct a rotation pool to increase the diversity of training data in a more efficient manner. + +Rotation Pool. As shown in Fig. (4), we observe that the adversarial rotation found on one sample has a strong transferability on other samples of the same category. Based on this observation, instead of saving the rotated samples, we suggest saving the rotation angles produced on each sample by class to construct a rotation pool: + +$$ +\mathcal {R} = \left[ \left\{\Phi_ {i, 1} \right\} _ {i = 1} ^ {n _ {1}}, \dots , \left\{\Phi_ {i, k} \right\} _ {i = 1} ^ {n _ {k}}, \dots , \left\{\Phi_ {i, K} \right\} _ {i = 1} ^ {n _ {K}} \right], \tag {8} +$$ + +where $\Phi_{i,k}$ is the rotation found on sample $i$ of category $k$ . We will save the rotations corresponding to all $n_k$ samples in the category $k$ and traverse all $K$ categories to construct the final rotation pool $\mathcal{R}$ . During defense training, we only need to sample rotations from the rotation pool according to the category to transform the input into adversaries. Thanks to the transferability, the adversarial samples generated by the rotation pool can also induce high classification loss. Experiments in Sect. 4.5 also confirm that the rotation pool can effectively solve the over-fitting problem. + +![](images/751cde2d349c5cc4f6944f3be9270d09609e458771207daa7807afa89881fe5c.jpg) +Figure 3. Comparison of different optimizations. For the iterative optimization (a), model with parameters $\theta$ will be repeatedly optimized on the min-max problem $T$ times until converging to a robust parameter $\theta^T$ . In contrast, the proposed one-step optimization (b) constructs the rotation pool by attacking $m$ different models and requires only one step to obtain robust parameters of the targeted model. + +![](images/bb72796ec8bcef07ee3deec096d00f969d06698c0c57745e982d0083fe69a1d1.jpg) + +Iterative Optimization. In order to solve the minimization problem, i.e. Eq. (3), in adversarial training to reach the final robust models, an iterative optimization scheme is usually adopted. Specifically, in the first iteration, we will attack the pre-trained classifier to initialize the rotation pool and then re-train the classifier on adversarial samples generated from the rotation pool towards a robust model. In the following iterations, we will attack the latest robust model to update the rotation pool iteratively: + +$$ +\Phi_ {i, q _ {i}} ^ {(t)} = \max _ {\Phi} L (\theta^ {(t)}, R _ {\Phi} p _ {i}, q _ {i}), \tag {9} +$$ + +where $\theta^{(t)}$ refers to the parameters of robust model after $t$ iterations, $R_{\phi}$ is the rotation matrix of random start angles $\phi$ and $q_{i}$ is the class label corresponding to input sample $p_i$ . $\Phi_{i,q_i}^{(t)}$ refers to the rotation found on sample $i$ of category $q_{i}$ in the $t$ -th iteration. We then re-train the classifier on the adversaries generated from the updated pool $\mathcal{R}^{(t)}$ to reach a more robust model. The process will be repeated until the model converges to the most robust state. + +# 3.5. One-Step Optimization + +The naive implementation above requires multiple iterations on both the attack and defense sides. Though obtaining robust models, the whole process is extremely time-consuming. Inspired by the ensemble adversarial training (EAT) [38], we further propose an efficient one-step optimization to reach the robust model with lower training cost. + +Specifically, instead of iterating multiple times for obtaining more aggressive samples, EAT proposes to introduce the adversarial examples crafted on other stronger static pre-trained models. Intuitively, as adversarial samples transfer between models, perturbations crafted on the more robust model are good approximations for the maximization problem of the target model. We follow this principle to solve the minimization problem Eq. (3) in one step. Concretely, we not only attack the target classifier but attack more robust classifiers to construct a larger rotation pool: + +$$ +\Phi_ {i, q _ {i}} ^ {(m)} = \max _ {\Phi} L \left(\theta_ {m}, R _ {\Phi} p _ {i}, q _ {i}\right), \tag {10} +$$ + +where, $\theta_{m}$ refers to the parameters of model $m$ and $\Phi_{i,q_i}^{(m)}$ is the adversarial rotation generated by attacking model $m$ . By attacking $m$ models, the resulting rotation pool has $m$ times more aggressive rotations than the iterative optimization does. For defense, similar to the iterative optimization, we use the adversarial rotation sampled from the rotation pool to re-train the target model. Compared with the iterative manner, the one-step optimization achieves competitive results with faster training progress. Hence, we select the one-step optimization as the default implementation of our ART-Point framework. The comparison between the two optimization methods is shown in Fig. (3). Detailed implementations and comparison experiments will be provided in the supplementary. + +# 4. Experiments + +# 4.1. Experiment Setup + +Datasets. We evaluate our methods on two classification datasets ModelNet40 [42] and ShapeNet16 [46]. ModelNet40 contains 12,311 meshed CAD models from 40 categories. ShapeNet16 is a larger dataset which contains 16,881 shapes from 16 categories. For both datasets, we follow the official train and test split scheme and use the same data pre-processing as in [29, 30, 39] where each model is uniformly sampled with 1,024 points from the mesh faces and rescaled to fit into the unit sphere. + +Models. We select three point cloud classifiers to evaluate our method, including PointNet [29], a pioneer network that processes points individually, PointNet++ [30], a hierarchical feature extraction network and DGCNN [39], a graph-based feature extraction network. These classifiers lack robustness to rotation. By verifying these classifiers, we show that ART-Point can be applied to various learning architectures to improve rotation robustness. + +Evaluations. In order to comprehensively compare the rotation robustness of different models, we design three evaluation protocols: (1) Attack. The test set is adversarially rotated by the proposed attack algorithm for evaluating model defense. (2) Random. The test set is randomly + +
MethodModelNet40
AttackRandomClean
PointNet [29] (RA)55.674.476.7
PointNet++ [30] (RA)58.980.182.3
DGCNN [39] (RA)65.685.787.6
ART-PointNet (Ours)85.6(30.0↑)84.3(9.9↑)85.5(8.8↑)
ART-PointNet++ (Ours)90.1(31.2↑)87.5(7.4↑)88.6(6.3↑)
ART-DGCNN (Ours)91.5(25.9↑)90.5(4.8↑)91.3(3.7↑)
MethodShapeNet16
AttackRandomClean
PointNet [29] (RA)66.487.389.5
PointNet++ [30] (RA)70.589.792.1
DGCNN [39] (RA)74.490.594.3
ART-PointNet (Ours)96.9(30.5↑)95.1(7.8↑)96.2(6.7↑)
ART-PointNet++ (Ours)97.8(27.3↑)96.3(6.6↑)97.5(5.4↑)
ART-DGCNN (Ours)98.4(24.0↑)97.7(7.2↑)98.1(3.8↑)
+ +rotated for evaluating model rotation robustness. (3) Clean. The test set is unchanged for evaluating the discriminative ability under aligned data. Moreover, we use the attack success rate to evaluate our attack algorithm. The attack success rate is calculated as the percentage of correctly predicted samples in the test set before and after the attack. + +# 4.2. Comparison with Rotation Augmentation + +We first compare the effectiveness of the proposed ART-Point with rotation augmentation (RA) for improving model rotation robustness. For classifiers using rotation augmentation, we will train them with randomly rotated inputs. In Tab. (1), we illustrate the comparison results under ModelNet40 [42] and ShapeNet16 [46]. From the table, several observations can be obtained. Firstly, compared with rotation augmentation, the proposed ART-Point results in models performing better under all protocols. Such performance improvements can be consistently observed on all three classifiers under both datasets. Secondly, under the attacked test set, the classification accuracy of model trained using ART-point is significantly higher than model trained with RA. (maximum increase: $31.2\%$ ). This is mainly because that rotation augmentation can hardly defend against adversarial rotations found using model gradient information. In contrast, our method shows stronger defense to adversarial rotations. We will further test the defense ability of our method under different rotation attacks in Sect. 4.4. Both observations suggest that the proposed ART-Point is a more effective method to improve the rotation robustness of point cloud classifiers than rotation augmentation. + +Table 1. Comparing three evaluation protocols under ModelNet40 [42] and ShapeNet16 [46] for classifiers trained via rotation augmentation (RA) and adversarial rotation (ART). + +
MethodModelNet40
AttackRandomClean
Classifiers Using Invariant Descriptors
SFCNN [31]90.190.190.1
RI-Conv [48]86.586.486.5
ClusterNet [4]87.187.187.1
RI-Framework [17]89.489.389.4
Classifiers with Equivariant Architectures
TFN [37]87.687.687.6
REQNN [34]74.474.174.4
VN-PointNet [7]77.277.277.2
VN-DGCNN [7]90.290.290.2
EPN [5]88.388.388.3
Ours
ART-PointNet85.684.385.5
ART-PointNet++90.187.588.6
ART-DGCNN91.590.591.3
+ +Table 2. Comparing three evaluation protocols under ModelNet40 [42] for various rotation robust classifiers. + +# 4.3. Comparison with Rotation Robust Classifiers + +We further compare robust models trained by ART-Point with existing rotation robust classifiers, including [4,17,31,48] that convert point clouds into rotation invariant descriptors and [5,7,34,37] that design rotation-equivariant architectures, to further illustrate appealing properties of our method. Rotation robust classifiers will be trained on random rotated inputs. The comparison results based on all protocols under ModelNet40 [42] are shown in Tab. (2). Firstly, our best model ART-DGCNN outperforms all equivariant or invariant methods under three evaluation protocols, which indicates its stronger robustness over rotations. Secondly, both equivariant or invariant methods perform similarly under all protocols, which is undesirable, since the clean test set should more easily be classified by the model. This is mainly because that these methods obtain rotation robustness by separating the pose information from point clouds via modifications on input space or model architectures. In contrast, ART-Point uses original classifiers for training on adversarial samples in 3D space, the resulting model not only better inherits the performance of original classifiers on clean sets but shows great defense on the attacked test set. + +# 4.4. Attack and Defense + +Beyond rotation robustness, our method provides a complete set of tools for attack and defense on point cloud classifiers. To verify the proposed attack algorithm, we compare the attack success rate of our method with other rotation attacks proposed in [51]. Meanwhile, we also show the defense ability of classifiers trained with ART-Point. The + +
ModelsRotation Attack Algorithm
TSI [51]CTRI [51]Ours
PointNet [29]96.9299.4499.54
PointNet++ [30]91.3197.9398.96
DGCNN [39]89.8197.9998.51
ART-PointNet (Ours)9.7111.1312.78
ART-PointNet++ (Ours)4.316.607.92
ART-DGCNN (Ours)3.145.336.62
+ +Table 3. Comparing attack success rate (\%) of several attack algorithms on different classifiers under ModelNet40 [42]. + +
MethodsLossAcc.MethodsLossAcc.
Random5.1374.4w/o RP12.7255.8
TSI [51]7.3579.5RP(pn1)10.1982.9
CTRI [51]8.8782.1RP(pn1,pn2)12.0182.6
Ours (step=1)7.6581.5RP(pn1,dg)12.5583.1
Ours (step=5)9.5782.8RP(pn2,dg)13.0384.0
Ours (step=10)13.4984.3RP(pn1,pn2,dg)13.4984.3
+ +Table 4. The average loss of adversarial samples generated by different methods and accuracy of corresponding adversarial training. $\mathrm{RP}(\mathrm{pn1})$ refers to the rotation pool generated by attacking PointNet [29]. pn2 and dg refer to PointNet++ [30] and DGCNN [39]. + +results are illustrated in Tab. (3). In the first three rows, we report the attack success rate of different attack algorithms on classifiers trained using clean samples. As can be seen, compared with the other two rotation attacks, our attack achieves the highest success rate on all three classifiers. In the last three rows, we further report the attack success rate on classifiers trained using ART-Point. As can be seen, ART-Point improves model defense against rotation attacks. + +# 4.5. Ablation Study + +Finally, we conduct ablation studies to prove the effectiveness of our designs in ART-Point. All ablation experiments are conducted on the PointNet [29] classifier and evaluated under randomly rotated test sets1. + +Different Attacks. We use adversarial samples generated by different rotation attacks for adversarial training and investigate the impact on the robustness of the resulting models. We adopt several attacks to generate adversarial samples that induce different loss values, including the random rotation attack, attacks in [51] and our attacks with different steps. In the left column of Tab. (4), we illustrate the average classification loss of samples produced by different attacks and results of adversarial training using corresponding samples. + +Rotation Pool. We verify the necessity of constructing the rotation pool. We compare the results of adversarial training with, without rotation pools and constructing ro + +![](images/53a30678b5d67a5355b160a2218ddb3c21acc5adf83eb0d8e046f6d146e762e4.jpg) +Figure 4. Averaged loss values of attacked samples produced by standard attack and axis-wise attack under different attack steps. + +tation pools from different models. As shown in the right column of Tab. (4), although adversarial training without rotation pool generates samples inducing high loss values, the final result is worse than training with rotation pool due to the over-fitting caused by label leaking [15]. + +Axis-Wise Attack. We compare our proposed axis-wise rotation attack with the standard attack algorithm, which simultaneously optimizes three angles in one gradient descent. We mainly follow [22] to show the average loss value of attacked samples in each step. We restart the attack 20 times with random angle initialization. The comparison results are shown in Fig. (4). As can be seen, the axis-wise mechanism enables the attack algorithm to find more aggressive rotated samples. + +# 4.6. Discussions of Limitations and Society Impact + +Since our method is mainly based on adversarial training, one limitation is that we need to obtain a fully trained model with accessible parameters in the first place. Meanwhile, the rotating attack algorithm may be exploited for attacking point cloud based 3D object detection systems, which is a potential negative societal impact. + +# 5. Conclusion + +In this paper, we propose ART-Point to improve the rotation robustness of point cloud classifiers via adversarial training. ART-Point consists of an axis-wise rotation attack and a defense method with the rotation pool mechanism. It can be adopted on most existing classifiers with fast one-step optimization to obtain rotation robust models. Experiments show that the novel rotation attack achieves a high attack success rate on most point cloud classifiers. Moreover, our best model ART-DGCNN shows great robustness to arbitrary and adversarial rotations and outperforms existing state-of-the-art rotation robust classifiers. Acknowledgment This work is supported by the Major Science and Technology Innovation 2030 "Brain Science and Brain-like Research" key project (No. 2021ZD0201402 and 2021ZD0201405). + +# References + +[1] Tao Bai, Jinqi Luo, Jun Zhao, Bihan Wen, and Qian Wang. Recent advances in adversarial training for adversarial robustness. arXiv preprint arXiv:2102.01356, 2021. 3 +[2] Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT'2010, pages 177-186. Springer, 2010. 5 +[3] 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. 5 +[4] 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/CVF Conference on Computer Vision and Pattern Recognition, pages 4994-5002, 2019. 1, 2, 7 +[5] Haiwei Chen, Shichen Liu, Weikai Chen, Hao Li, and Randall Hill. Equivariant point network for 3d point cloud analysis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14514-14523, 2021. 1, 2, 7 +[6] Taco S Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical cnns. arXiv preprint arXiv:1801.10130, 2018. 2 +[7] Congyue Deng, Or Litany, Yueqi Duan, Adrien Poulenard, Andrea Tagliasacchi, and Leonidas Guibas. Vector neurons: A general framework for so (3)-equivariant networks. arXiv preprint arXiv:2104.12229, 2021. 1, 3, 7 +[8] Haowen Deng, Tolga Birdal, and Slobodan Ilic. Ppf-foldnet: Unsupervised learning of rotation invariant 3d local descriptors. In Proceedings of the European Conference on Computer Vision (ECCV), pages 602-618, 2018. 1, 2 +[9] Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. Hotflip: White-box adversarial examples for text classification. arXiv preprint arXiv:1712.06751, 2017. 2, 3 +[10] 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 (ECCV), pages 52–68, 2018. 2 +[11] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096-2030, 2016. 2, 3 +[12] Chengyue Gong, Tongzheng Ren, Mao Ye, and Qiang Liu. Maxup: Lightweight adversarial training with data augmentation improves neural network training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2474-2483, 2021. 3 +[13] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. 3 +[14] Lingshen He, Yuxuan Chen, Yiming Dong, Yisen Wang, Zhouchen Lin, et al. Efficient equivariant network. Advances in Neural Information Processing Systems, 34, 2021. 2 + +[15] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016. 2, 5, 8 +[16] Itai Lang, Uriel Kotlicki, and Shai Avidan. Geometric adversarial attacks and defenses on 3d point clouds. arXiv preprint arXiv:2012.05657, 2020. 3 +[17] Xianzhi Li, Ruihui Li, Guangyong Chen, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. A rotation-invariant framework for deep point cloud analysis. IEEE Transactions on Visualization and Computer Graphics, 2021. 1, 2, 7 +[18] Daniel Liu, Ronald Yu, and Hao Su. Extending adversarial attacks and defenses to deep 3d point cloud classifiers. In 2019 IEEE International Conference on Image Processing (ICIP), pages 2279-2283. IEEE, 2019. 2, 3 +[19] Hongbin Liu, Jinyuan Jia, and Neil Zhenqiang Gong. Pointguard: Provably robust 3d point cloud classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6186-6195, 2021. 3 +[20] Min Liu, Fupin Yao, Chiho Choi, Ayan Sinha, and Karthik Ramani. Deep learning 3d shapes using alt-az anisotropic 2-sphere convolution. In International Conference on Learning Representations, 2018. 2 +[21] Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. Adversarial multi-task learning for text classification. arXiv preprint arXiv:1704.05742, 2017. 2, 3 +[22] 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. 1, 3, 5, 8 +[23] Pratyush Maini, Eric Wong, and Zico Kolter. Adversarial robustness against the union of multiple perturbation models. In International Conference on Machine Learning, pages 6640-6650. PMLR, 2020. 3 +[24] Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Adversarial training methods for semi-supervised text classification. arXiv preprint arXiv:1605.07725, 2016. 3 +[25] John X Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in nlp. arXiv preprint arXiv:2005.05909, 2020. 3 +[26] Tianyu Pang, Xiao Yang, Yinpeng Dong, Hang Su, and Jun Zhu. Bag of tricks for adversarial training. arXiv preprint arXiv:2010.00467, 2020. 3 +[27] Adrien Poulenard and Leonidas J Guibas. A functional approach to rotation equivariant non-linearities for tensor field networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13174-13183, 2021. 1, 2 +[28] Adrien Poulenard, Marie-Julie Rakotosaona, Yann Ponty, and Maks Ovsjanikov. Effective rotation-invariant point cnn with spherical harmonics kernels. In 2019 International Conference on 3D Vision (3DV), pages 47-56. IEEE, 2019. 2 +[29] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference + +on computer vision and pattern recognition, pages 652-660, 2017. 1, 2, 3, 6, 7, 8 +[30] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pages 5099-5108, 2017. 1, 2, 3, 6, 7, 8 +[31] Yongming Rao, Jiwen Lu, and Jie Zhou. Spherical fractal convolutional neural networks for point cloud recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 452-460, 2019. 2, 7 +[32] Lukas Schott, Jonas Rauber, Matthias Bethge, and Wieland Brendel. Towards the first adversarially robust neural network model on mnist. arXiv preprint arXiv:1805.09190, 2018. 3 +[33] Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! arXiv preprint arXiv:1904.12843, 2019. 2, 3 +[34] Wen Shen, Binbin Zhang, Shikun Huang, Zhihua Wei, and Quanshi Zhang. 3d-rotation-equivariant quaternion neural networks. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XX 16, pages 531–547. Springer, 2020. 1, 3, 7 +[35] Jiachen Sun, Yulong Cao, Christopher B Choy, Zhiding Yu, Anima Anandkumar, Zhuoqing Morley Mao, and Chaowei Xiao. Adversarily robust 3d point cloud recognition using self-supervisions. Advances in Neural Information Processing Systems, 34, 2021. 2 +[36] Jiachen Sun, Karl Koenig, Yulong Cao, Qi Alfred Chen, and Zhuoqing Mao. On the adversarial robustness of 3d point cloud classification. 2020. 2, 3 +[37] Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. arXiv preprint arXiv:1802.08219, 2018. 1, 2, 7 +[38] Florian Tramér, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017. 2, 6 +[39] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. ACM Transactions on Graphics, 38(5):1-12, 2019. 1, 2, 3, 6, 7, 8 +[40] Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco Cohen. 3d steerable cnns: Learning rotationally equivariant features in volumetric data. arXiv preprint arXiv:1807.02547, 2018. 1, 2 +[41] Yi Wu, David Bamman, and Stuart Russell. Adversarial training for relation extraction. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1778-1783, 2017. 3 +[42] 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. 2, 5, 6, 7, 8 + +[43] Chong Xiang, Charles R Qi, and Bo Li. Generating 3d adversarial point clouds. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9136-9144, 2019. 3, 5 +[44] Cihang Xie and Alan Yuille. Intriguing properties of adversarial training at scale. arXiv preprint arXiv:1906.03787, 2019. 2, 3 +[45] Jiancheng Yang, Qiang Zhang, Rongyao Fang, Bingbing Ni, Jinxian Liu, and Qi Tian. Adversarial attack and defense on point sets. arXiv preprint arXiv:1902.10899, 2019. 3 +[46] Li Yi, Vladimir G Kim, Duygu Ceylan, I-Chao Shen, Mengyan Yan, Hao Su, Cewu Lu, Qixing Huang, Alla Sheffer, and Leonidas Guibas. A scalable active framework for region annotation in 3d shape collections. ACM Transactions on Graphics (ToG), 35(6):1-12, 2016. 2, 6, 7 +[47] Zhiyuan Zhang, Binh-Son Hua, Wei Chen, Yibin Tian, and Sai-Kit Yeung. Global context aware convolutions for 3d point cloud understanding. In 2020 International Conference on 3D Vision (3DV), pages 210–219. IEEE, 2020. 1, 2 +[48] Zhiyuan Zhang, Binh-Son Hua, David W Rosen, and Sai-Kit Yeung. Rotation invariant convolutions for 3d point clouds deep learning. In 2019 International Conference on 3D Vision (3DV), pages 204–213. IEEE, 2019. 1, 2, 7 +[49] Chen Zhao, Jiaqi Yang, Xin Xiong, Angfan Zhu, Zhiguo Cao, and Xin Li. Rotation invariant point cloud classification: Where local geometry meets global topology. arXiv preprint arXiv:1911.00195, 2019. 1, 2 +[50] Yongheng Zhao, Tolga Birdal, Jan Eric Lenssen, Emanuele Menegatti, Leonidas Guibas, and Federico Tombari. Quaternion equivariant capsule networks for 3d point clouds. In European Conference on Computer Vision, pages 1-19. Springer, 2020. 1, 3 +[51] Yue Zhao, Yuwei Wu, Caihua Chen, and Andrew Lim. On isometry robustness of deep 3d point cloud models under adversarial attacks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1201-1210, 2020. 1, 2, 3, 4, 5, 7, 8 +[52] Tianhang Zheng, Changyou Chen, Junsong Yuan, Bo Li, and Kui Ren. Pointcloud saliency maps. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1598-1606, 2019. 3 \ No newline at end of file diff --git a/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/images.zip b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cd39cb493077e60df6cfab62f785dd54e2d38ea4 --- /dev/null +++ b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28392d4bb083fcd4d4f676253cf7cd98aabdb156c713baad7ced33b4ae5a1122 +size 474972 diff --git a/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/layout.json b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3951869bd54859b3a5e29ed321823bb2f0c8a63c --- /dev/null +++ b/artpointimprovingrotationrobustnessofpointcloudclassifiersviaadversarialrotation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7daf0d52b94cfc418def87d788e1612d7a773ca5cb53b037dbcdbc30404a894 +size 381492 diff --git a/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_content_list.json b/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..422c34132944954b2a1f54ba2a97030103e4306b --- /dev/null +++ b/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30b2a6dd958598bbb36c9a90ec67b88127b4337da87e977e60226f2c8f1a91c0 +size 73319 diff --git a/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_model.json b/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_model.json new file mode 100644 index 0000000000000000000000000000000000000000..31837794b4e9ac82c1478569ba2d2ad22e4fa256 --- /dev/null +++ b/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa9174d39fa110c07736132dcd787dae99e531fac20f16b04aabb3571cbf64be +size 91373 diff --git a/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_origin.pdf b/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..53324d2c52375a0e6123bf0f386549d180f2d11c --- /dev/null +++ b/asamplingbasedapproachforefficientclusteringinlargedatasets/9e5c5cca-65a5-48b2-bd67-5731f27f5488_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53441b5b28d29e90d2f808e8bb9e640069da7b45113528856c4ca60c4b129d3c +size 557312 diff --git a/asamplingbasedapproachforefficientclusteringinlargedatasets/full.md b/asamplingbasedapproachforefficientclusteringinlargedatasets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cd185930d0e834965c4e7017252d3766e78e949b --- /dev/null +++ b/asamplingbasedapproachforefficientclusteringinlargedatasets/full.md @@ -0,0 +1,355 @@ +# A sampling-based approach for efficient clustering in large datasets + +Georgios Exarchakis* + +IHU Strasbourg, France + +ICube, University of Strasbourg, CNRS, France + +Sorbonne Université, INSERM, CNRS, France + +Institut de la Vision, 17 rue Moreau, F-75012 Paris, France + +georgios.exarchakis@ihu-strasbourg.eu + +Omar Oubari + +Sorbonne Université, INSERM, CNRS, + +Institut de la Vision, 17 rue Moreau, F-75012 Paris, France + +Gregor Lenz + +Sorbonne Université, INSERM, CNRS, + +Institut de la Vision, 17 rue Moreau, F-75012 Paris, France + +# Abstract + +We propose a simple and efficient clustering method for high-dimensional data with a large number of clusters. Our algorithm achieves high-performance by evaluating distances of datapoints with a subset of the cluster centres. Our contribution is substantially more efficient than $k$ -means as it does not require an all to all comparison of data points and clusters. We show that the optimal solutions of our approximation are the same as in the exact solution. However, our approach is considerably more efficient at extracting these clusters compared to the state-of-the-art. We compare our approximation with the exact $k$ -means and alternative approximation approaches on a series of standardised clustering tasks. For the evaluation, we consider the algorithmic complexity, including number of operations to convergence, and the stability of the results. An efficient implementation of the algorithm is available online. + +# 1. Introduction + +Data clustering is an ubiquitous problem in Machine Learning literature. One of the most popular approaches for clustering is the k-means algorithm. Due to the simplicity of the algorithm and relative efficiency of identifying clusters the algorithm has found use in a wide range of fields, e.g. medicine, physics and computer vision among many others. With the increasingly large supply of data, computational + +efficiency improvements become all the more significant. Recent advances in approximate inference methods have allowed for training algorithms with convergence performance that is sub-linear to the number of clusters [16]. This is typically achieved by avoiding the comparison between datapoints and clusters that lie far away in feature space. + +Probabilistic data models that relate to the k-means algorithm can be found in Gaussian Mixture Models (GMM). In particular, Lücke and Forster [31] detail the relationship between k-means and a variational approximation of the Expectation Maximisation (EM) algorithm for isotropic GMMs. In most cases, the GMM-based formulation of the clustering problem provides higher likelihoods without introducing impractical constraints [31]. Theoretical developments in convergence analysis of Gaussian Mixture Models (GMM) [9, 32, 35] concerning global and optimal convergence have sparked renewed interest in the field. Novel training algorithms that aim for stability [22, 24] and increased efficiency [16, 21] are actively being developed. Markov Chain Monte Carlo (MCMC) methods have also been employed for fitting GMMs to account for input variation [13, 27, 36]. Tree-based methods have also been proposed for efficient inference in k-means [19, 34]. However, tree-based methods are known to exhibit instabilities when faced with small perturbations in the data, due to their recurrent structure, and therefore are likely to produce substantially different clusters for small changes in the input. + +In this work, we propose a method for efficient EM-based learning that uses a truncated approximation [29, 30] of the posterior in the E-step. To identify the truncated space, we + +draw samples from a proposal distribution that is based on the truncated subspace of the previous iteration and favours clusters near the optimal cluster of the previous truncated posterior. Our algorithm integrates recent developments in initialisation methods [1, 2] and can be applied on coresets [3, 20] to maintain comparable performance to state-of-the-art approaches. + +Truncated approximations have been used in the past for multiple-cause models [8, 11, 12, 15] to achieve efficient training in discrete latent variable models. Stochastic approximations on a truncated space [18, 29] focusing on deep learning models have also been proposed. We expect a stochastic approach to avoid well-known local optima issues [23] related to EM-based learning for GMMs. + +Truncated approximations on clustering algorithms have only been attempted with deterministic approximation techniques [16, 21]. In fact, our literature research shows that the vc-GMM [21] sets the state-of-the-art in terms of computational efficiency for a GMM with similar constraints to the ones we study. vc-GMM relies on a set of indices of datapoints that get assigned to the same cluster in order to identify similar clusters. The most similar cluster is identified at each step and immediately assigned to the truncated space of a datapoint to efficiently navigate to the optimal clustering solution. The approach, however, is deterministic and such methods typically exhibit results unstable to initialisation and frequently converge to local optima. It would be therefore prudent to explore stochastic analogues to these approximations. The approach we take in this work largely resembles vc-GMM, however, we utilise a similarity matrix over the clusters in order to identify clusters with a higher probability of being near a datapoint without having to evaluate its distance to all clusters. Estimating the similarity matrix relies on posterior approximations from earlier iterations and does not require excessive computation. We show that our stochastic approach improves over the performance of vc-GMM and we consider the definition and implementation of our algorithm to be significantly simpler. + +In the numerical experiments section, we evaluate the performance of the algorithm and compare with relevant literature. In the artificial data section, we evaluate our algorithm in terms of extracting the ground truth and we compare it to k-means to observe an improved performance. In the real data clustering section, we apply the algorithm on four different datasets, namely, KDD, a protein homology dataset [7], CIFAR-10, an image dataset [25], SONG, a dataset of music metadata [5] and SUSY, a high energy physics dataset [4]. We compare our algorithm to the state-of-the-art in terms of efficiency, stability and accurate cluster recovery. + +Results show that our algorithm sets the state-of-the-art in terms of efficiency without compromising, and probably improving, stability. Our method can be applied on a wide + +variety of tasks while maintaining a competitive clustering performance. + +# 2. EM with sparsely sampled clusters for GMMs + +To introduce the k-means algorithm in terms of an optimisation framework, we consider a Gaussian Mixture Model fitted with the Expectation Maximisation algorithm. The relationship between k-means and variational approximations to a GMM are detailed by Lücke and Forster [31]. Using the GMM-based formalisation, we can derive a novel clustering algorithm with same global optima as the original algorithm, and substantial computational efficiency benefits. + +For a dataset of $N$ data points, $\mathcal{Y} = \{\mathbf{y}^{(1)},\dots ,\mathbf{y}^{(N)}\}$ we wish to identify, $M$ , cluster centres $\mu_c,\forall c\in \{1,\ldots ,M\}$ . To that end, each datapoint $\mathbf{y}^{(n)}$ is treated as an instance of a random variable $Y$ that follows one of $M$ possible Gaussian distributions $p(Y|C = c;\theta) = \mathcal{N}(Y;\mu_c,\sigma \mathbb{1})$ with a prior probability distribution $p(C) = \frac{1}{M}$ , where $C$ takes values in $\{1\dots ,M\}$ and $\theta = \{\mu_{1:M},\sigma \}$ denotes the set of model parameters. We can learn the optimal parameters, $\theta = \{\mu_{1,\dots ,M},\sigma \}$ , by maximising the data log-likelihood $\mathcal{L}(\theta)\triangleq \log p(Y = \mathcal{Y}|\theta)$ using the EM algorithm. The EM algorithm optimises the variational lower bound to the log-likelihood: + +$$ +\begin{array}{l} L (\mathcal {Y}, \theta) \triangleq \sum_ {n} \sum_ {c} p _ {c} ^ {(n)} \log p (C = c, Y = \mathbf {y} ^ {(n)} | \theta) \\ + \sum_ {n} \mathcal {H} \left(p _ {c} ^ {(n)}\right) (1) \\ = \sum_ {n} \sum_ {c} p _ {c} ^ {(n)} \log \frac {p (C = c | Y = \mathbf {y} ^ {(n)} , \theta)}{p _ {c} ^ {(n)}} \\ + \sum_ {n} \log p (Y = \mathbf {y} ^ {(n)} | \theta) (2) \\ \end{array} +$$ + +where $\mathcal{H}\left(p_c^{(n)}\right)$ denotes the Shannon entropy of the distribution $p_{c}^{(n)}$ . The distribution $p_{c}^{(n)}$ is typically set to be the posterior distribution $p\left(C = c|Y = \mathbf{y}^{(n)};\hat{\theta}\right)$ , as it sets the first term of Eq. 2 to 0 and the variational lower bound to be equal to the log-likelihood1. Under the assumed model constraints each Gaussian distribution is defined as $p\left(Y = \mathbf{y}^{(n)}|C = c;\theta\right) = \left(2\pi \sigma^2\right)^{-\frac{D}{2}}e^{-\frac{d_c^{(n)}}{2\sigma^2}}$ , where $d_c^{(n)} = \left\| \mathbf{y}^{(n)} - \mu_c\right\|^2$ is the squared euclidean distance between the datapoint $\mathbf{y}^{(n)}$ and the mean of Gaussian indexed by $c$ , and $D$ is the number of observed variables. + +Exact EM is an iterative algorithm that optimises the likelihood by alternating between two steps. The first step, + +E-step, is to identify the distribution $p_c^{(n)}$ that sets the lower bound in Eq. 2 to be equal to the log-likelihood. That is $p_c^{(n)}$ has to be equal to the posterior in order to set the KL-divergence in Eq. 2 to be equal to 0. For the Gaussian Mixture Model in this work that would be: + +$$ +p _ {c} ^ {(n)} = \exp \left(- d _ {c} ^ {(n)} / 2 \sigma^ {2}\right) / \sum_ {c ^ {\prime} = 1} ^ {M} \exp \left(- d _ {c ^ {\prime}} ^ {(n)} / 2 \sigma^ {2}\right) \tag {3} +$$ + +Here we notice that Eq. 3 is a softmax function which produces mostly 0 values. In fact, for $\sigma^2 \to 0$ it is exactly equal to the maximum indicator function for the (negative) distances, i.e. it returns the value 1 for the smallest distance and 0 for all others, and is often considered as the probabilistic analogue of k-means [6, 26, 31]. The second step, M-step, amounts to maximising Eq. 1 with respect to $\theta$ using a gradient update as: + +$$ +\mu_ {c} = \frac {\sum_ {n = 1} ^ {N} p _ {c} ^ {(n)} \mathbf {y} ^ {(n)}}{\sum_ {n = 1} ^ {N} p _ {c} ^ {(n)}} \tag {4} +$$ + +$$ +\sigma^ {2} = \frac {1}{D N} \sum_ {n = 1} ^ {N} \sum_ {c = 1} ^ {M} p _ {c} ^ {(n)} \left\| \mathbf {y} ^ {(n)} - \mu_ {c} \right\| ^ {2} \tag {5} +$$ + +The EM algorithm iterates between the E-step and M-step until $\theta$ converges. Updating $\sigma^2$ , as opposed to the hard-assignment produced by $\sigma^2 \to 0$ in k-means, increases the variational lower bound [31] and offers a better and more efficient approximation of the log-likelihood. + +The E-step requires estimating the differences between all clusters and all the datapoints. Thus, the complexity of the E-step is $\mathcal{O}(DNM)$ making it a very efficient algorithm. Here, we focus on a method to avoid estimating the softmax over all dimensions since it leads to redundant computation. In order to avoid the dependency of the complexity on $M$ , we use an approximation $q_{c}^{(n)}$ of the posterior, $p_{c}^{(n)}$ , over a subset $\mathcal{K}^{(n)} \subset \{1, \ldots, M\}$ , with $|\mathcal{K}^{(n)}| = H$ as: + +$$ +q _ {c} ^ {(n)} = \frac {\exp \left(- d _ {c} ^ {(n)} / 2 \sigma^ {2}\right)}{\sum_ {c ^ {\prime} \in \mathcal {K} ^ {(n)}} \exp \left(- d _ {c ^ {\prime}} ^ {(n)} / 2 \sigma^ {2}\right)} \delta (c \in \mathcal {K} ^ {(n)}) \tag {6} +$$ + +where $\delta (c\in \mathcal{K}^{(n)})$ is the Kronecker delta. In other words, we assume that clusters outside $\mathcal{K}^{(n)}$ have a probability of 0 for datapoint $\mathbf{y}^{(n)}$ , and therefore are not estimated. Using $q_{c}^{(n)}$ instead of $p_c^{(n)}$ , modifies the exact EM algorithm by not setting the KL-divergence to 0 at the E-step. However, we can derive an algorithm an algorithm that monotonically increases the variational lower bound by identifying a $q_{c}^{(n)}$ that decreases the KL-divergence at each E-step. + +Proposition 1. Let $\mathcal{K}^{(n)}$ be a set of cluster indices, and $\mathcal{K}'^{(n)} = \mathcal{K}^{(n)} \setminus \{i\} \cup \{j\}$ , where $i \in \mathcal{K}^{(n)}, j \notin \mathcal{K}^{(n)}$ . Then $KL[q^{(n)} \| p^{(n)}] < KL[q'^{(n)} \| p^{(n)}]$ if and only if $d_i^{(n)} < d_j^{(n)}$ . + +Proof. Since all the Gaussians are equiprobable $d_i^{(n)} < d_j^{(n)} \Rightarrow p_i^{(n)} > p_j^{(n)}$ . Note that $\lim_{x \to 0} x \log x = 0$ . It follows that: + +$$ +K L [ q ^ {(n)} \| p ^ {(n)} ] < K L [ q ^ {\prime (n)} \| p ^ {(n)} ] \Leftrightarrow +$$ + +$$ +\sum_ {c \in \mathcal {K} ^ {(n)}} q _ {c} ^ {(n)} \log \frac {q _ {c} ^ {(n)}}{p _ {c} ^ {(n)}} < \sum_ {c \in \mathcal {K} ^ {\prime (n)}} q _ {c} ^ {\prime (n)} \log \frac {q _ {c} ^ {\prime (n)}}{p _ {c} ^ {(n)}} \Leftrightarrow +$$ + +$$ +\sum_ {c \in \mathcal {K} ^ {(n)}} q _ {c} ^ {(n)} \log \frac {p _ {c} ^ {(n)} / \sum_ {c ^ {\prime} \in \mathcal {K} ^ {(n)}} p _ {c ^ {\prime}} ^ {(n)}}{p _ {c} ^ {(n)}} < +$$ + +$$ +\sum_ {c \in \mathcal {K} ^ {\prime (n)}} q _ {c} ^ {(n)} \log \frac {p _ {c} ^ {(n)} / \sum_ {c ^ {\prime} \in \mathcal {K} ^ {\prime (n)}} p _ {c ^ {\prime}} ^ {(n)}}{p _ {c} ^ {(n)}} \Leftrightarrow +$$ + +$$ +\sum_ {c \in \mathcal {K} ^ {(n)}} q _ {c} ^ {(n)} \log \sum_ {c ^ {\prime} \in \mathcal {K} ^ {(n)}} p _ {c ^ {\prime}} ^ {(n)} > +$$ + +$$ +\sum_ {c \in \mathcal {K} ^ {\prime} ^ {(n)}} q _ {c} ^ {\prime (n)} \log \sum_ {c ^ {\prime} \in \mathcal {K} ^ {\prime} ^ {(n)}} p _ {c ^ {\prime}} ^ {(n)} \Leftrightarrow +$$ + +$$ +\log \sum_ {c ^ {\prime} \in \mathcal {K} ^ {(n)}} p _ {c ^ {\prime}} ^ {(n)} > \log \sum_ {c ^ {\prime} \in \mathcal {K} ^ {\prime (n)}} p _ {c ^ {\prime}} ^ {(n)} \Leftrightarrow p _ {i} ^ {(n)} > p _ {j} ^ {(n)} +$$ + +![](images/c7284a39ac1bef65f8c601b63f13aeb9f0022b7b8e09ed30407cac56bfd60649.jpg) + +Proposition 1 shows that in order to decrease the KL-divergence at each E-step we only need to iteratively update the set $\mathcal{K}^{(n)}$ with clusters that are closer to the data-point, $\mathbf{y}^{(n)}$ . The M-step can be modified to utilise $q_{c}^{(n)}$ , instead of $p_{c}^{(n)}$ , and maintain monotonic convergence [33]. + +To identify the clusters in $\mathcal{K}^{(n)}$ , we start by selecting $H$ clusters uniformly at random. We iteratively update $\mathcal{K}^{(n)}$ by using $R$ randomly sampled clusters in the vicinity of the one that is nearest to the datapoint $\mathbf{y}^{(n)}$ . To efficiently identify the clusters centred near a datapoint, we define a distribution $p(C_t|C_{t-1} = \bar{c}_n; S)$ , where $\bar{c}_n = \arg \min_c \left\{d_c^{(n)} | c \in \mathcal{K}^{(n)}\right\}$ . The parameter $S \in \mathbb{R}^{M \times M}$ denotes a similarity matrix among the clusters that assigns higher values, $S_{i,j}$ , to cluster pairs, $\{i, j\}$ , that are likely to be close to the same datapoints, as in Eq. 12. The iterative update of $\mathcal{K}^{(n)}$ is defined as: + +$$ +\bar {\mathcal {K}} _ {t} ^ {(n)} = \mathcal {K} _ {t - 1} ^ {(n)} \cup \left\{c _ {1: R} | c _ {i} \sim p \left(C _ {t} \mid C _ {t - 1} = \bar {c} _ {n}\right) \wedge c _ {i} \notin \mathcal {K} _ {t - 1} ^ {(n)} \right\} \tag {7} +$$ + +$$ +\mathcal {K} _ {t} ^ {(n)} = \left\{c \mid c \in \bar {\mathcal {K}} _ {t} ^ {(n)} \text {w i t h} H \text {s m a l l e s t} d _ {c} ^ {(n)} \right\} \tag {8} +$$ + +where $t$ denotes the EM iteration. $p\left(C_t|C_{t-1} = \bar{c}_n; S\right)$ is the distribution that is given by the normalised row of a cluster similarity matrix $S$ after setting the probabilities corresponding to $\mathcal{K}^{(n)}$ to 0: + +$$ +p \left(C _ {t} = c \mid C _ {t - 1} = \bar {c} _ {n}; S\right) = \frac {S _ {\bar {c} _ {n} , c}}{\sum_ {c ^ {\prime} \in \mathcal {K} ^ {(n)}} S _ {\bar {c} _ {n} , c ^ {\prime}}} \delta \left(c \notin \mathcal {K} ^ {(n)}\right) \tag {9} +$$ + +i.e. the distribution at time $t$ is given by the row defined by the cluster $\bar{c}_n$ that had the minimal distance with the datapoint $\mathbf{y}^{(n)}$ at time $t - 1$ . + +The parameter updates, from Eq. 4 and 5, are adapted to the approximate posterior. + +$$ +\mu_ {c} = \sum_ {n = 1} ^ {N} q _ {c} ^ {(n)} \mathbf {y} ^ {(n)} / \sum_ {n = 1} ^ {N} q _ {c} ^ {(n)} \tag {10} +$$ + +$$ +\sigma^ {2} = \frac {1}{D N} \sum_ {n = 1} ^ {N} \sum_ {c \in \mathcal {K} ^ {(n)}} q _ {c} ^ {(n)} \left\| \mathbf {y} ^ {(n)} - \mu_ {c} \right\| ^ {2} \tag {11} +$$ + +The similarity matrix is defined based on the distances $d_{c}^{(n)}$ under the assumption that nearby clusters have small distances to similar datapoints + +$$ +S _ {i, j} = \frac {1}{N} \sum_ {n = 1} ^ {N} e ^ {- \left(d _ {i} ^ {(n)} + d _ {j} ^ {(n)}\right)} \delta \left(\{i, j \} \subset \mathcal {K} ^ {(n)}\right) \tag {12} +$$ + +Algorithm 1 Data Similarity Gaussian Mixture Model (D-GMM) + +Require: Dataset $\mathcal{X}$ # of centres $M$ +1: initialise $\mu_{1:M},\sigma ,\mathcal{K}^{(n)}$ and $S = 0$ for all $n$ +2: repeat +3: $\mu_{1:M}^{new} = 0$ , $\sigma^{new} = 0$ , and $S^{new} = 0$ +4: $\mathcal{J} = \{1,\dots ,N\}$ +5: for $n\in \mathcal{J}$ do +6: $\bar{c}_n = \arg \min_c\left\{\| \mathbf{y}^{(n)} - \mu_c\| ^2 |c\in \mathcal{K}^{(n)}\right\}$ +7: $p\left(C_{t} = c \mid C_{t - 1} = \bar{c}_{n}; S\right) := \frac{S_{\bar{c}_{n}, c}}{\sum_{c^{\prime}} S_{\bar{c}_{n}, c^{\prime}}}$ +8: $\bar{\mathcal{K}}^{(n)} = \left\{c_{1:R}|c_i\sim p\left(C_t|C_{t - 1} = \bar{c}_n;S\right)\wedge c_i\notin \mathcal{K}^{(n)}\right\}$ +9: $\bar{\mathcal{K}}^{(n)} = \bar{\mathcal{K}}^{(n)}\cup \mathcal{K}^{(n)}$ +10: for $c\in \bar{\mathcal{K}}^{(n)}$ do +11: $d_c^{(n)} = \left\| \mathbf{y}^{(n)} - \mu_c\right\|^2$ +12: end for +13: $\mathcal{K}^{(n)} = \left\{c|c\in \bar{\mathcal{K}}^{(n)}\text{with the} H\text{smallest} d_c^{(n)}\right\}$ +14: end for +15: Calculate $\mu_{1:M},\sigma^2$ , and $S$ using Eqs. 10-12 +16: until $\mu_{1:M}$ and $\sigma^2$ have converged + +Eq. 12 produces a symmetric positive definite matrix, that is used to sample datapoints near the optimal at each step of the process, with a simple reduction operation over pre-computed values. Iterating between Eq. 6 and the parameter updates, Eqs. 10-12, details an algorithm that we call Data Similarity GMM (D-GMM), Alg. 1, due to the similarity matrix being based on a data "voting" process. The complexity of an E-step of the $D$ -GMM algorithm reduces compared to an E-step of the exact EM algorithm for GMMs from $\mathcal{O}(NMD)$ to $\mathcal{O}(N(R + H)D)$ , where + +typically $R + H < < M$ . For the M-step, the complexity becomes $\mathcal{O}\left(NHD + NH^2\right)$ from $\mathcal{O}(NMD)$ , however, as we will show in the experiments' section, $H^2 < < M$ to be sufficient for most applications. + +Initialisation. During the first epoch of the proposed algorithm the sets $\mathcal{K}^{(n)}$ are initialised using prior samples. The centres of the gaussians, $\mu_{1:C}$ , are initialised using the AFK-MC $^2$ [1] initialisation method. After an epoch has passed, the $\mathcal{K}^{(n)}$ is updated as in algorithm 1. The AFK-MC $^2$ algorithm samples an initial centre $\mu_1 \in \mathcal{V}$ uniformly at random and then uses it to derive the proposal distribution $g(\mathbf{y}|\mu_1)$ . A markov chain of length $m$ is used to sample sufficiently distinct new centres, $\mu_{2:M}$ , iteratively. The complexity of AFK-MC $^2$ is $\mathcal{O}(ND)$ to define the proposal distribution $g(\mathbf{y}|\mu_1)$ . The centres are sampled from the data using Markov chains of length $m$ with a complexity of $\mathcal{O}\left(m(M - 1)^2 D\right)$ . + +Lightweight Coresets (lwcs). To further improve computational efficiency we can optionally use coresets of the dataset [3, 14, 28]. Coresets are smaller, $N' < < N$ , representative subsets, $\mathcal{Y}' = \{(\mathbf{y}_1, w_1), \dots, (\mathbf{y}_{N'}, w_{N'})\}$ , of a full dataset, $\mathcal{Y}$ , in which each datapoint is individually weighted by a weight $w_{1:N'}$ depending on its significance in describing the original data. The objective on a coreset is adjusted to account for the weights on each data point: + +$$ +\begin{array}{l} L \left(\mathcal {Y} ^ {\prime}, \theta\right) \triangleq \sum_ {n} w _ {n} \sum_ {c \in \mathcal {K} ^ {(n)}} q _ {c} ^ {(n)} \log p (C = c, Y = \mathbf {y} ^ {(n)} | \theta) \\ + \sum_ {n} w _ {n} \mathcal {H} \left(q _ {c} ^ {(n)}\right) \\ \end{array} +$$ + +(13) + +Since the parameter updates are gradient-based updates of Eq. 13, the weights $w_{1:N'}$ are a multiplicative constant on the parameters and therefore the parameter updates become: + +$$ +\mu_ {c} = \sum_ {n = 1} ^ {N ^ {\prime}} w _ {n} q _ {c} ^ {(n)} \mathbf {y} ^ {(n)} / \sum_ {n = 1} ^ {N ^ {\prime}} w _ {n} q _ {c} ^ {(n)} \tag {14} +$$ + +$$ +\sigma^ {2} = \frac {1}{D N ^ {\prime}} \sum_ {n = 1} ^ {N ^ {\prime}} \sum_ {c} w _ {n} q _ {c} ^ {(n)} \left\| \mathbf {y} ^ {(n)} - \mu_ {c} \right\| ^ {2} \tag {15} +$$ + +$$ +S _ {i, j} = \frac {1}{N ^ {\prime}} \sum_ {n = 1} ^ {N ^ {\prime}} w _ {n} e ^ {- \left(d _ {i} ^ {(n)} + d _ {j} ^ {(n)}\right)} \delta \left(\{i, j \} \subset \mathcal {K} ^ {(n)}\right) \tag {16} +$$ + +These updates can replace Eq. 10 to 12 in algorithm 1 to allow applications on a coreset $\mathcal{Y}'$ . Working on coresets introduces an error in the approximation that has been analysed rigorously in earlier work [3]. Constructing the coreset requires two iterations of complexity $\mathcal{O}(ND)$ over the data. Working on coreset reduces the complexity of D-GMM to + +![](images/1bfdd1ee87ba86da7971ed1061821103cc1f0c27ac11239195da86593401c7c7.jpg) + +![](images/8f38835c2b308fa0b60c29eccb3f20dee542bf7228537e57abab2341d043c1d3.jpg) +Figure 1. Validation on a two-dimensional synthetic dataset: D-GMM outperforms other methods across 500 trials (top) and fully recovers all centres (bottom) + +$\mathcal{O}\left(N^{\prime}\left(R + H\right)D\right)$ for the E-step and $\mathcal{O}\left(N^{\prime}HD + N^{\prime}H^{2}\right)$ for the M-step. The complexity of AFK-MC is also reduced since the proposal distribution is defined on the coreset with complexity $\mathcal{O}\left(N^{\prime}D\right)$ . + +# 3. Experiments and results + +We evaluate the performance of the algorithm experimentally on three classes of tasks. The software used for the experiments is a vectorised $\mathrm{C + + }$ implementation provided in the supplementary material. First, we examine convergence on artificial data where the ground truth is known. We proceed with a comparison against the state-of-the-art algorithm for training GMMs with similar constraints vc-GMM [21] on popular clustering datasets. + +For all tasks, the Gaussian centres are initialised using the AFK-MC² algorithm with $m = 5$ . Furthermore, we follow the same convergence protocol as in [21] and terminate the algorithm when the variational lower bound increment following Eq. 13 is less than $\epsilon = 10^{-3}$ . Unless stated otherwise, we evaluate the stability of the results on 10 repetitions for all experiments. + +For clarity, below is a reminder for the hyperparameter notations: + +- $M$ denotes the number of centres + +![](images/a48c915dc2588c075956d0d56e42a041b5cbc42c3758411988c610fd9d7bbe54.jpg) +Figure 2. Variational lower bound values of D-GMM through EM iterations compared to the log-likelihood of the exact algorithm: We can see that our approximation is slower to converge, however, each iteration is considerably more efficient. + +- $N'$ denotes the coreset size +- $H$ and $C'$ denote the size of the truncated subspace for D-GMM and vc-GMM respectively. +- $R$ and $G$ are the search space hyperparameters for D-GMM and vc-GMM respectively. + +When choosing the truncation hyperparameters $H(C')$ , we consider that the probability values of the exact posterior decays exponentially and accordingly set $H = 5(C' = 5)$ under the assumption that lower probability values will be negligible. We follow the same rationale for the truncation updates $R(G)$ . We use various configurations for $M$ and $N'$ so we can compare with the state-of-the-art. + +# 3.1. Artificial Data + +In this section, we present a convergence analysis on artificial data [17] with $N = 5000$ data points and 15 Gaussian centres. Fig. 1 on the left shows the root mean squared error between the learned centres of the algorithms and the ground truth centres. We compare our algorithm, D-GMM, against vc-GMM, and standard k-means, setting the hyperparameters to $M = 15$ , $N' = 1000$ , $H = 3$ and $R = 5$ . The vc-GMM is parametrised with $C' = 3$ and $G = 5$ . The results suggest that both truncated algorithms are able to recover the centres as well as the exact algorithm. The slight improvement (below a standard deviation) might be attributed to the fact that a truncated approximation will "hard-code" very low probabilities to 0 which may enhance numerical stability. With the D-GMM algorithm, the stochastic behaviour might also have an effect on avoiding locally optimal solutions. In Fig. 1 on the right, we present an example of a run where the centres were successfully recovered. + +# 3.2. Clustering Analysis + +For a more detailed comparison with the state-of-the-art, we consider a series of well-known clustering datasets. Tab. + +Table 1. Relative quantisation error and distance evaluation speedup + +
DatasetAlgorithmRelative Error ηDistance Eval. SpeedupIters.
nameN'H(C')R(G)
KDDk-means---0.0 ± 0.7%×1.0 ± 0.05.0 ± 0.0
N = 145,751k-means + lwcs212--14.0 ± 0.5%×35.1 ± 0.05.0 ± 0.0
D = 74vc-GMM2125512.0 ± 0.4%×533.1 ± 36.511.7 ± 1.0
M = 500D-GMM2125512.0 ± 1.0%×622.1 ± 28.017.0 ± 0.7
CIFAR-10k-means---0.0 ± 0.0%×1.0 ± 0.07.6 ± 0.4
Ntrain = 50,000k-means + lwcs212--7.0 ± 0.1%×48.9 ± 3.55.4 ± 0.4
Ntest = 10,000vc-GMM212557.0 ± 0.0%×674.7 ± 45.811.8 ± 0.8
D = 3,072D-GMM212558.0 ± 0.0%×731.5 ± 41.921.4 ± 1.2
SONGk-means---0.0 ± 0.0%×1.0 ± 0.05.0 ± 0.0
N = 515,345k-means + lwcs216--8.0 ± 0.0%×7.8 ± 0.05.0 ± 0.0
D = 90vc-GMM216558.0 ± 0.1%×698.2 ± 0.712.0 ± 0.0
M = 4000D-GMM216558.0 ± 0.2%×862.1 ± 18.321.7 ± 0.4
SUSYk-means---0.0 ± 0.0%×1.0 ± 0.014.7 ± 0.4
N = 5,000,000k-means + lwcs216--6.0 ± 0.1%×11.1 ± 0.414.1 ± 0.5
D = 18vc-GMM216556.0 ± 0.1%×663.1 ± 17.125.4 ± 0.6
M = 2000D-GMM216555.0 ± 0.1%×605.7 ± 11.155.6 ± 1.0
+ +1 details a comparison between k-means, vc-GMM [16, 21], and D-GMM. We use the k-means algorithm on the full dataset to define a baseline for the centres. The accuracy of the rest of the algorithms is measured using the relative error $\eta = (\mathcal{Q}_{\mathrm{algorithm}} - \mathcal{Q}_{\mathrm{k-means}}) / \mathcal{Q}_{\mathrm{k-means}}$ where $\mathcal{Q}$ stands for an algorithm's quantization error. Since D-GMM and vcGMM are going through fewer clusters per datapoint in each iteration, convergence is slower for these two algorithms (see Fig. 2). However, the efficiency of the algorithm is determined by the overall number of distance evaluations. In the last two columns of Tab. 1, we present the average number of iterations from initialisation to convergence as well as the average speedup in terms of distance evaluations, $d_c^{(n)}$ , relative to k-means. The results show a clear speedup for D-GMM in most cases and comparable relative error. + +Fig. 3 presents a comparison between the efficient clustering algorithms with increasing coreset size. K-means on the full dataset is presented as baseline. The size of each marker in Fig. 3 represents the size of the coreset. We find that in most cases D-GMM clusters data with a low relative error to the baseline for the least amount of distance evaluations. + +Complexity The approximation method we use is focused on avoiding distance evaluations, $d_c^{(n)}$ with all available clusters. Therefore, it is very efficient in problems where a high number of clusters is expected to be present in the dataset. Fig. 4 (left) shows the scaling behaviour of our algorithm with an increasing number of clusters $M$ on the CIFAR-10 dataset, with $M$ ranging from 100 to 1500 cluster + +centres. The distance evaluations for each algorithm are normalised by the minimum value across all $M$ and presented in a log-log plot which indicates the power of the relationship between operation complexity and number of clusters. We normalised both axes for an easier visualisation of the complexity. As expected, the scaling behaviour of k-means is linear to the number of clusters while the approximations are sub-linear. D-GMM is the most efficient algorithm in terms of distance evaluations as the number of cluster centres increases. + +Stability We test the ability of the algorithm to recover the same clusters using different initialisation. We run the clustering algorithm on CIFAR-10 100 times with hyperparameters $M = 500, H = 5, R = 5$ , and compare the recovered centres of every distinct pair of runs using the $l_{2}$ -norm between the centres after reshuffling them. The average and standard deviation between all errors are plotted in Fig. 4 (right). + +Hyperparameter Search In Fig. 5, we see the effect that the hyperparameters $H$ and $R$ have to the optimisation speed-up. At the top plot, we fix $H = 5$ and view the effect $R$ has to the algorithm's number of operations and runtime. We see that reducing the values of $R$ progressively decreases the amount of required operations. In terms of runtime, values lower than $R = 40$ introduce a lower speedup. This is due to the fact that we need to perform more iterations and therefore spend more time instantiating samplers than + +![](images/6e4294fcff0e1466c9b8fa5f600c238d1612b10af7fd5b4846ba6b6cd90835a0.jpg) + +![](images/df950c8f5ad2a4255e853597e34cf0bf7b96fd4a0676bb0153cdba8edf536c6a.jpg) + +![](images/25ddd7cd8c69f5b0d9fb718493f70d56e3884f889400e054b93dfe7842986730.jpg) + +![](images/98beb690c9040f73eb9f0e6a1b6505182e8747ac63d32b531b7fa8d7e6d1786f.jpg) + +![](images/5238e25a439837f087d02d5a146b028e7f659773d3a8fa4d0e29b1b4bc36185f.jpg) +Figure 3. Distance evaluations vs relative quantisation error on increasingly large datasets + +![](images/0ff9c0fc11c8fb8d299866e96fd2b14476919805ebf158c52da74b6c426e27e8.jpg) + +![](images/d8f062d26785a5d16504bca6491ad3322ffdaae5027cb4b514cbe8b64a042837.jpg) +Figure 4. Operations complexity and stability on CIFAR-10 over 100 trials. (right) RMSE between the learned centres ( $M = 500$ ). (left) Normalised log distance evaluations for an increasing $M$ , with 100 trials for each $M$ . (both) error bars denote 1 standard deviation. + +![](images/fb5f360cea03e74006fea851a922d73d55a6cc52849e64cb45ff365466cc5538.jpg) + +drawing samples from them + +To identify the optimal hyperparameter $H$ , we fix $R = 10$ and observe the effect varying values of $H$ have to the runtime and number of operations of the algorithm. Both runtime and number of operations monotonically reduce + +with smaller truncated space $H$ . Suggesting that caching only a small number of centres is sufficient to efficiently cluster datapoints. + +To test the scalability of D-GMM to larger datasets, we use the full ImageNet dataset downsampled to a 64x64 res + +![](images/fdcfbf25fe12160ca38b748933028d6e463c0ef75a80d6530a77a3b1ff55ff41.jpg) + +![](images/b54778d7ee0612c3a8d57f1dd21f47c527ec4cae5ae1de462caec3915b5c93cb.jpg) +Figure 5. Hyperparameter search for $R$ (top) and $H$ (bottom). The blue line shows performance gains with respect to computation. The green line shows performance increase in terms of runtime. The results are relative to the dotted black line which is the exact k-means. + +olution [10]. For such a large dataset it was impractical to use k-means as a baseline, as it would not converge in a reasonable time, so we resort to comparing the improvement in number of distance evaluations from initialisation to convergence of the two algorithms. For coreset sizes $2^{13}$ , $2^{14}$ , $2^{15}$ , $2^{16}$ , and $2^{17}$ we get a reduction on the number of distance evaluations of a factor of $22\%$ , $31\%$ , $40\%$ , $44\%$ , and $49\%$ respectively when we use D-GMM compared to vc-GMM. + +# 4. Discussion + +We have presented a novel data clustering algorithm. Our algorithm considerably increases computational efficiency compared to k-means by calculating the posterior over a data-specific subset of clusters. The subset is iteratively refined by sampling in the neighbourhood of the best performing cluster at each EM iteration. To identify the neighbourhood of each cluster we propose a similarity matrix based on earlier computed distances between the clusters and datapoints, thus avoiding additional complexity. Furthermore, we implemented lightweight coresets and the AFK-MC² initialisation [1, 3] which are state-of-the-art methods in the literature for data pre-processing and GMM centre initialisation respectively. We compare our algorithm to vc-GMM [16,21] which + +is, to our knowledge, the most efficient GMM algorithm currently available. In terms of computational complexity, our algorithm is more efficient in most cases, improving both with an increasing number of datapoints and with an increasing number of clusters compared to vc-GMM. Furthermore, the advantage in efficiency is complemented by a more stable recovery of clusters centres, as demonstrated on the CIFAR-10 database. + +It is significant to emphasise that D-GMM is substantially simpler to intuit and implement compared to vc-GMM. Arguably, the use of elementary operations on matrix containers is easier to implement than task specific containers for comparison. Simplicity of an algorithm is a considerable advantage when it comes to communicating and implementing the algorithm in different contexts. + +Our experiments suggest that the bottleneck for D-GMM lies with the efficiency of low-level operators like calculating exponentials and sampling from discrete distributions. Improving these operators could be an interesting future direction in this work, affecting an even larger body of literature. A key feature of D-GMM that we consider valuable for further development is that reduced computational complexity implies lower energetic demands. Therefore, when setting future software development strategies considering low-level operators used in clustering algorithms we can take into account the reduced number of operations of D-GMM. The constraints we introduce on the GMM data model are crucial for the D-GMM approximation, however, they have an impact on the expressive potential of our algorithm. Future work aims at developing the optimisation algorithm in a way that would allow training GMMs with fewer constraints on covariance and prior structure. + +To enable further development of this work, we participate in the "variational sublinear clustering" organisation with an international team of independent researchers to jointly develop software for efficient probabilistic clustering. The D-GMM implementation, found in the supplementary material, will be contributed to this organisation, under an open source license, and further developed through a collaboration with a larger pool of researchers. + +In conclusion, we find that D-GMM sets the state-of-the-art in terms of efficiency and stability for GMM-based clustering. There is room for improvement in terms of optimisation of low-level operators and loosening the GMM constraints. A long-term plan to develop and popularise efficient clustering is under way. + +# Acknowledgement + +We would like to thank Jörg Lücke for his valuable insight during the preparation of this manuscript. This work was partially supported by French state funds managed within the "Plan Investissements d'Avenir" by the ANR (reference ANR-10-IAHU-02). + +# References + +[1] Olivier Bachem, Mario Lucic, Hamed Hassani, and Andreas Krause. Fast and provably good seedings for k-means. In Advances in neural information processing systems, pages 55–63, 2016. 2, 4, 8 +[2] Olivier Bachem, Mario Lucic, S Hamed Hassani, and Andreas Krause. Approximate k-means++ in sublinear time. In Thirtieth AAAI Conference on Artificial Intelligence, 2016. 2 +[3] Olivier Bachem, Mario Lucic, and Andreas Krause. Scalable k-means clustering via lightweight coresets. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1119-1127, 2018. 2, 4, 8 +[4] Pierre Baldi, Peter Sadowski, and Daniel Whiteson. Searching for exotic particles in high-energy physics with deep learning. Nature communications, 5:4308, 2014. 2 +[5] Thierry Bertin-Mahieux, Daniel P.W. Ellis, Brian Whitman, and Paul Lamere. The million song dataset. In Proceedings of the 12th International Conference on Music Information Retrieval (ISMIR 2011), 2011. 2 +[6] Tamara Broderick, Brian Kulis, and Michael Jordan. Mad-bayes: Map-based asymptotic derivations from bayes. In International Conference on Machine Learning, pages 226-234. PMLR, 2013. 3 +[7] Rich Caruana, Thorsten Joachims, and Lars Backstrom. Kdd-cup 2004: results and analysis. ACM SIGKDD Explorations Newsletter, 6(2):95-108, 2004. 2 +[8] Zhenwen Dai, Georgios Exarchakis, and Jörg Lücke. What are the invariant occlusive components of image patches? a probabilistic generative approach. In Advances in neural information processing systems, pages 243-251, 2013. 2 +[9] Constantininos Daskalakis and Gautam Kamath. Faster and sample near-optimal algorithms for proper learning mixtures of gaussians. In Conference on Learning Theory, pages 1183–1213, 2014. 1 +[10] 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. 8 +[11] Georgios Exarchakis, Marc Henniges, Julian Eggert, and Jörg Lücke. Ternary sparse coding. In International Conference on Latent Variable Analysis and Signal Separation, pages 204-212. Springer, 2012. 2 + +[12] Georgios Exarchakis and Jörg Lücke. Discrete sparse coding. Neural computation, 29(11):2979-3013, 2017. 2 +[13] Stefano Favaro, Yee Whye Teh, et al. Mcmc for normalized random measure mixture models. Statistical Science, 28(3):335-359, 2013. 1 +[14] Dan Feldman, Matthew Faulkner, and Andreas Krause. Scalable training of mixture models via coresets. In Advances in neural information processing systems, pages 2142-2150, 2011. 4 +[15] Dennis Forster and Jorg Lücke. Truncated variational em for semi-supervised neural simpletons. In 2017 International Joint Conference on Neural Networks (IJCNN), pages 3769-3776. IEEE, 2017. 2 +[16] Dennis Forster and Jörg Lücke. Can clustering scale sublinearly with its clusters? a variational em acceleration of gmms and k-means. In International Conference on Artificial Intelligence and Statistics, pages 124-132, 2018. 1, 2, 6, 8 +[17] P. Franti and O. Virmajoki. Iterative shrinking method for clustering problems. Pattern Recognition, 39(5):761-765, 2006. 5 +[18] Enrico Guiraud, Jakob Drefs, and Jörg Lücke. Evolutionary expectation maximization. In Proceedings of the Genetic and Evolutionary Computation Conference, pages 442-449, 2018. 2 +[19] Greg Hamerly. Making k-means even faster. In Proceedings of the 2010 SIAM international conference on data mining, pages 130-140. SIAM, 2010. 1 +[20] Sariel Har-Peled and Soham Mazumdar. On coresets for k-means and k-median clustering. In Proceedings of the thirty-sixth annual ACM symposium on Theory of computing, pages 291–300, 2004. 2 +[21] Florian Hirschberger, Dennis Forster, and Jörg Lücke. Accelerated training of large-scale gaussian mixtures by a merger of sublinear approaches. IEEE Transaction on Pattern Analysis and Machine Intelligence., 1050:12, 2021. 1, 2, 5, 6, 8 +[22] Reshad Hosseini and Suvrit Sra. An alternative to em for gaussian mixture models: Batch and stochastic riemannian optimization. Mathematical Programming, pages 1-37, 2019. 1 +[23] Chi Jin, Yuchen Zhang, Sivaraman Balakrishnan, Martin J Wainwright, and Michael I Jordan. Local maxima + +in the likelihood of gaussian mixture models: Structural results and algorithmic consequences. In Advances in neural information processing systems, pages 4116-4124, 2016. 2 +[24] Soheil Kolouri, Gustavo K. Rohde, and Heiko Hoffmann. Sliced Wasserstein distance for learning gaussian mixture models. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. 1 +[25] Alex Krizhevsky. Learning multiple layers of features from tiny images. University of Toronto, 05 2012. 2 +[26] Brian Kulis and Michael I Jordan. Revisiting k-means: New algorithms via bayesian nonparametrics. arXiv preprint arXiv:1111.0352, 2011. 3 +[27] Y. Li, S. Pal, and M. J. Coates. Invertible particleflow-based sequential mcmc with extension to gaussian mixture noise models. IEEE Transactions on Signal Processing, 67(9):2499-2512, 2019. 1 +[28] Mario Lucic, Matthew Faulkner, Andreas Krause, and Dan Feldman. Training gaussian mixture models at scale via coresets. The Journal of Machine Learning Research, 18(1):5885-5909, 2017. 4 +[29] Jörg Lücke, Zhenwen Dai, and Georgios Exarchakis. Truncated variational sampling for 'black box'optimization of generative models. In International Conference on Latent Variable Analysis and Signal Separation, pages 467-478. Springer, 2018. 1, 2 +[30] Jörg Lücke and Julian Eggert. Expectation truncation and the benefits of preselection in training generative models. Journal of Machine Learning Research, 11(Oct):2855-2900, 2010. 1 +[31] Jörg Lücke and Dennis Forster. k-means as a variational em approximation of gaussian mixture models. Pattern Recognition Letters, 125:349-356, 2019. 1, 2, 3 +[32] Ankur Moitra and Gregory Valiant. Settling the polynomial learnability of mixtures of gaussians. In 2010 IEEE 51st Annual Symposium on Foundations of Computer Science, pages 93-102. IEEE, 2010. 1 +[33] Radford M Neal and Geoffrey E Hinton. A view of the em algorithm that justifies incremental, sparse, and other variants. In Learning in graphical models, pages 355-368. Springer, 1998. 3 +[34] James Newling and François Fleuret. Fast k-means with accurate bounds. In International Conference on Machine Learning, pages 936-944. PMLR, 2016. 1 + +[35] Ji Xu, Daniel J Hsu, and Arian Maleki. Global analysis of expectation maximization for mixtures of two gaussians. In Advances in Neural Information Processing Systems, pages 2676-2684, 2016. 1 +[36] Ming-Hsuan Yang and Narendra Ahuja. Gaussian mixture model for human skin color and its applications in image and video databases. In Storage and retrieval for image and video databases VII, volume 3656, pages 458-466. International Society for Optics and Photonics, 1998. 1 \ No newline at end of file diff --git a/asamplingbasedapproachforefficientclusteringinlargedatasets/images.zip b/asamplingbasedapproachforefficientclusteringinlargedatasets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5504d96259f73dcbd92f0dc30fe06da09faa4193 --- /dev/null +++ b/asamplingbasedapproachforefficientclusteringinlargedatasets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee6ed9dd52a76cc6c98354183e2f0f28e618c13c4972a51824ab8670d2121d8f +size 459282 diff --git a/asamplingbasedapproachforefficientclusteringinlargedatasets/layout.json b/asamplingbasedapproachforefficientclusteringinlargedatasets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..943001bf982d453fda4e86412c71835af16e8f4e --- /dev/null +++ b/asamplingbasedapproachforefficientclusteringinlargedatasets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d93ceb3c566ffe0ab2458e3986e3f70e2a2b52e5c5b846f85fada3a7f67dc4eb +size 462725 diff --git a/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_content_list.json b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a8fb023ec64270f5b4aa0c106137f0ff9669a718 --- /dev/null +++ b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c93e2d39f57e95d27f1f538dec166ed4dafbf085d36d80273083e8c736bb9970 +size 76583 diff --git a/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_model.json b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4636a2e42e7545cc0b1313eda873141c98d0514a --- /dev/null +++ b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2071b4d0a112a8ef1e0f4c02aa1705b650d2fd10424dc6efd46714244fe9dba5 +size 106854 diff --git a/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_origin.pdf b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..98ed1dbe21396be6512d44308a611d8b96eabb91 --- /dev/null +++ b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/d6821581-3a27-4c61-8e2e-a4221ac10d5e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0654be42b6beac69ca1520d3b9b775a8738fdbaa0babc8d0ff20a04ea816ce5d +size 7578336 diff --git a/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/full.md b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ca5152cb4e1d0c2152f4d3b712fb79d7f794397a --- /dev/null +++ b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/full.md @@ -0,0 +1,357 @@ +# A Scalable Combinatorial Solver for Elastic Geometrically Consistent 3D Shape Matching + +Paul Roetzer $^{1,2}$ Paul Swoboda $^{3}$ Daniel Cremers $^{1}$ Florian Bernard $^{2}$ TU Munich $^{1}$ University of Bonn $^{2}$ MPI Informatics $^{3}$ + +![](images/9a23c9d1abdc2981c0836b3a43c41c252e1145d8bc36c2f07ef351aecd104a8f.jpg) +Orientation-preserving matching + +![](images/73b148ec4983e2d629ad4247cfba93edf2951f08322d2d45c8dd407270159f58.jpg) +Partial-to-partial shape matching (without using complete shape) +Figure 1. We propose a novel combinatorial solver for the non-rigid matching of 3D shapes based on discrete orientation-preserving diffeomorphisms [66] (left). For the first time we utilize an orientation-preserving diffeomorphism to constrain the challenging problem of non-rigidly matching a pair of partial shapes without availability of complete shapes (center). Our solver scales significantly better compared to existing solvers and can thus handle shapes with practically relevant resolutions (right). + +![](images/c9921658f7d2055fa09cf35f4cf17aef36f9719c121e9ab345b5df2151255ed9.jpg) +Runtime comparison to Windheuser et al. + +# Abstract + +We present a scalable combinatorial algorithm for globally optimizing over the space of geometrically consistent mappings between 3D shapes. We use the mathematically elegant formalism proposed by Windheuser et al. [66] where 3D shape matching was formulated as an integer linear program over the space of orientation-preserving diffeomorphisms. Until now, the resulting formulation had limited practical applicability due to its complicated constraint structure and its large size. We propose a novel primal heuristic coupled with a Lagrange dual problem that is several orders of magnitudes faster compared to previous solvers. This allows us to handle shapes with substantially more triangles than previously solvable. We demonstrate compelling results on diverse datasets, and, even showcase that we can address the challenging setting of matching two partial shapes without availability of complete shapes. Our code is publicly available at http://github.com/paulOnoh/sm-comb. + +# 1. Introduction + +The shape matching problem is widely studied in graphics and vision due to its high relevance in numerous appli + +cations, including 3D reconstruction, tracking, shape modeling, shape retrieval, interpolation, texture transfer, or the canonicalization of geometric data for deep learning. Shape matching refers to finding correspondences between parts of shapes – for example, the shapes may be represented as triangular surface meshes, and correspondences may be obtained between vertices or triangles of individual shapes. While identifying such correspondences is a relatively easy task for humans, from a computational perspective shape matching is much more challenging. This is because many formulations lead to high-dimensional combinatorial optimization problems. While some of them are efficiently solvable, e.g. based on the linear assignment problem [47], such simple approaches do not take geometric relations between the shape parts into account and thus typically lead to poor matchings. In contrast, most practically relevant formulations account for geometric consistency in some form, which in turn lead to significantly more difficult optimization problems (e.g. the NP-hard quadratic assignment problem [51], or mixed-integer programming formulations [3]). + +A decade ago Windheuser et al. [66, 67] proposed an elegant formalism for the deformable matching of 3D shapes. Most notably, their approach is able to account for geometric consistency based on an orientation-preserving discrete diffeomorphism. While this formulation is conceptually ap- + +pealing, it requires to solve a difficult integer linear programming (ILP) problem. The authors proposed to relax the binary variables to continuous variables, so that a linear programming (LP) problem is obtained. Although this LP formulation is convex and can thus be solved to global optimality, the resulting optimization problem is prohibitively large, and in turn only shapes with low resolution (at most 250 triangles) can be matched with existing solvers. + +In this work we close this gap and propose a scalable combinatorial solver for geometrically consistent deformable 3D shape matching. Our main contributions are: + +- We propose a novel primal heuristic, which, together with a Lagrange dual problem, gives rise to a combinatorial solver for orientation-preserving deformable 3D shape matching based on the formalism by Windheuser et al. [66, 67]. +- We show that in the special case of consistent triangulations between both shapes our primal heuristic can readily be used to solve the ILP formulation to global optimally in polynomial time. +- Our solver is orders of magnitude faster than previous solvers, which allows us to handle shapes with a substantially higher resolution. +- Experimentally we demonstrate state-of-the-art results on a range of different shape matching problems, and we showcase the applicability to the difficult case of partial-to-partial shape matching. + +# 2. Related Work + +In the following we give an overview of existing shape matching approaches. For a more extensive overview we refer interested readers to the survey papers [59, 64]. + +Rigid shape matching methods consider the matching of shapes under the assumption that one shape undergoes a rigid-body transformation. For known correspondences, the resulting orthogonal Procrustes problem has a closed-form solution [61]. In general, the assumption that correspondences are known is a severe limitation and typically one also wants to find the correspondences. Such tasks are commonly tackled via local optimization, e.g. via the Iterative Closed Point (ICP) algorithm [6] or variants thereof [7, 21, 48]. The main drawback of local methods is that they heavily depend on the initialization and generally do not obtain global optima. There are also global approaches, for example based on semidefinite programming [43], Branch and Bound (BnB) [49], or quasi-BnB [15]. A major limitation of rigid matching approaches is that in practice shapes are often non-rigidly deformed, for which rigid transformation models are too restricted. + +For shapes that undergo an elastic transformation, non-rigid shape matching is more suitable. One example is the functional map framework [50], which have led to remarkable results for isometric shapes [50, 55]. Yet, their + +main drawback is that they are generally sensitive to noise and less reliable in non-isometric settings. A wide variety of extensions of functional maps was developed to overcome specific drawbacks, e.g. related to computation time [32], missing parts [56], orientation preservation [55], deblurring [22], denoising [54] non-isometric shapes [18], or multi-matching [26, 33]. + +An alternative non-rigid shape matching formulation is via the Quadratic Assignment Problem (QAP), also known as graph matching. Due to the NP-hardness of the QAP [51], numerous heuristic methods have been proposed [38, 39]. There also exist various convex relaxation methods for the QAP [4, 16, 25, 35, 63]. Although these methods are appealing as they can produce optimality bounds, they cannot guarantee to find global optima in all cases. In [2], a globally optimal but exponential-time BnB method was presented. In [65], the authors consider an iterative linearization of the QAP for addressing shape matching. Recently, simulated annealing was used for QAP-based shape matching [31]. Similar to the QAP, the ILP problem we address is NP-hard in general and theoretically solvable with (exponential-time) BnB methods. + +There are various alternative local methods for non-rigid shape matching, e.g. based on Gromov-Hausdorff distances [9, 46], as-conformal-as-possible formulations [42], iterative spectral upsampling [45], higher-order projected power iterations, [5], a discrete solver for functional map energies [53], a hybrid spatial-spectral approach [68], triangle-based deformation models [62], elastic membrane energy optimization [23], and many more. A major downside of local methods is that they heavily depend on a good initialization. + +Opposed to local optimization approaches are global methods, which have the strong advantage that they are independent of the initialization. Globally optimal non-rigid matchings can be obtained using shortest path algorithms for 2D shape matching [13, 24] and for 2D-to-3D matching [36]. Unfortunately, shortest path algorithms are not applicable for 3D-to-3D shape matching, since matchings cannot be represented as a shortest path but rather form a minimal surface [66]. An alternative formulation based on a convex relaxation was proposed in [11], which, however relies on an extrinsic term that requires a good spatial alignment. In [3] a BnB strategy is used to tackle a mixed-integer programming formulation that utilizes a low-dimensional discrete matching model. Despite the exponential worst-case complexity, it was shown that global optimality can be certified in most of the considered shape matching instances. The framework by Windheuser et al. [60, 66, 67] considers an ILP formulation for the orientation-preserving diffeomorphic matching of 3D shapes. The main issue is that to date there is no efficient combinatorial solver that can solve large instances of respective problems, so that their + +framework is currently impracticable. The framework will be discussed in more detail in Sec. 3. The main objective of our work is to propose the first efficient solver tailored specifically to this formalism. + +Learning-based shape matching. A wide variety of learning-based approaches has been used to address shape matching. While unsupervised approaches do not need time-consuming labeling of data [14, 19, 20, 30, 58, 69], supervised methods rely on the availability of labeled data [10, 28, 40, 52, 57]. Overall, learning-based techniques are ideal to obtain task-specific features to solve shape matching problems, and it was demonstrated that respective approaches achieve remarkable results. However, a major difficulty is that they often lack the ability to generalize to other types of shapes, which in contrast is a major strength of learning-free approaches. In this work we focus on a specific formalism in the latter class of optimization-based learning-free methods, and we believe that our work may be a first step towards integrating such powerful methods into modern learning approaches in order to eventually achieve the best from both worlds. + +# 3. Background of the Shape Matching ILP + +In the following we recapitulate the shape matching integer linear program (ILP) of Windheuser et al. [66]. We provide the used notation in Tab. 1. + +
X,Yshapes (triangular surface meshes)
(VX,EX,FX)vertices, edges and triangles of shape X
Fproduct space of vertex-triangle, edge-triangle and triangle-triangle pairs
Eedge product space
Γ ∈{0,1}|F|indicator vector of matches
πX,πYproduct vector projection on X and Y
δgeometric consistency constraints
Ematching energy
+ +Definition 1 (Shape). We define a shape $X$ as a triplet $(V_X, E_X, F_X)$ of vertices $V_X$ , edges $E_X \subset V_X \times V_X$ and triangles $F_X \subset V_X \times V_X \times V_X$ , such that the manifold induced by the triangles is oriented and has no boundaries1. + +In the remainder we will consider two shapes $X = (V_X, E_X, F_X)$ and $Y = (V_Y, E_Y, F_Y)$ that shall be elastically matched to each other. A matching between $X$ and $Y$ is defined by triangle-triangle, triangle-edge or triangle-vertex correspondences between pairs of elements in $X$ and $Y$ . We allow for triangle-edge and triangle-vertex matches + +Table 1. Notation used in this paper. + +
CorrespondenceProduct Triangle
(a)a1a3b1b2b3(a1,b1)(a2,b2)(a3,b3)
(b)a1a3b1b2(a1,b1)(a2,b2)(a3,b2)
(c)a1a3b1b2(a1,b1)(a2,b1)(a3,b1)
+ +to account for compressing and stretching shapes. For convenience, by $\overline{F}_{\bullet}$ we denote the set of degenerate triangles, that in addition to the triangles $F_{\bullet}$ also contains triangles formed by edges (a triangle with two vertices at the same position) and triangles formed by vertices (a triangle with three vertices at the same position). Similarly, we consider edge products and the set of degenerate edges $\overline{E}_{\bullet}$ . + +Definition 2 (Product Spaces). Let two shapes $X$ and $Y$ be given. The triangle product space is defined as + +$$ +F := \left\{\left( \begin{array}{c} a _ {1}, b _ {1} \\ a _ {2}, b _ {2} \\ a _ {3}, b _ {3} \end{array} \right) \Big | \begin{array}{l} (a _ {1} a _ {2} a _ {3} \in F _ {X} \wedge b _ {1} b _ {2} b _ {3} \in \overline {{F}} _ {Y}) \vee \\ (a _ {1} a _ {2} a _ {3} \in \overline {{F}} _ {X} \wedge b _ {1} b _ {2} b _ {3} \in F _ {Y}) \end{array} \right\}. +$$ + +The edge product space is defined as + +$$ +E := \left\{\left( \begin{array}{c} a _ {1}, b _ {1} \\ a _ {2}, b _ {2} \end{array} \right) \middle | \begin{array}{l} (a _ {1} a _ {2} \in E _ {X} \wedge b _ {1} b _ {2} \in \overline {{E}} _ {Y}) \vee \\ (a _ {1} a _ {2} \in \overline {{E}} _ {X} \wedge b _ {1} b _ {2} \in E _ {Y}) \end{array} \right\}. +$$ + +An illustration of possible correspondences represented as product triangles, i.e. elements of the product triangle space, can be seen in Fig. 2. In order to guarantee a geometrically consistent matching, we impose two types of constraints: + +(i) Projection constraints $\pi$ . We require that all triangles from $X$ must be matched to a vertex, edge or triangle from $Y$ , and vice versa. + +![](images/e75030b8217d5f44b873d131611416680733924ad6d73ff1d41d989d5c7656a4.jpg) +Figure 2. Correspondences represented as product triangles of $F$ : If a product triangle (right) is part of the computed solution it implies that the respective triangle is matched to a triangle (top row), an edge (middle) or a vertex (bottom). Each product triangle is associated with a local matching cost that encodes feature similarity and costs for stretching/compressing and bending. +Figure 3. Two product triangles are neighboring if they share the same product edge with opposite orientation. + +(ii) Geometric consistency constraints $\partial$ . Neighboring elements of $X$ must be matched to neighboring elements of $Y$ . Whenever a product edge is part of the matching, there must exist exactly two product triangles sharing the product edge oriented in opposite directions, see Fig. 3. This ensures geometric consistency by requiring that the matching is a two-manifold in the product space, which also implies that the respective 3D mapping is orientation preserving. + +Together with the energy $\mathbb{E} \in \mathbb{R}^{|F|}$ that quantifies the matching cost of individual correspondences (elements of the product space), the ILP shape matching problem reads + +$$ +\min _ {\Gamma \in \{0, 1 \} ^ {| F |}} \mathbb {E} ^ {\top} \Gamma \text {s . t .} \left( \begin{array}{c} \pi_ {X} \\ \pi_ {Y} \\ \partial \end{array} \right) \Gamma = \left( \begin{array}{c} \mathbf {1} _ {| F _ {X} |} \\ \mathbf {1} _ {| F _ {Y} |} \\ \mathbf {0} _ {| E |} \end{array} \right), \quad (\text {I L P - S M}) +$$ + +where $\Gamma$ is the matching vector represented as indicator vector of the triangle product space $F$ . For more details about (ILP-SM) we refer to [60, 66, 67]. + +Proposition 3. If only triangle-triangle correspondences are allowed, problem (ILP-SM) is solvable to global optimality in polynomial time. + +Proof. The two-manifold property of the matching and of both shapes $X$ and $Y$ yields that a single triangle-triangle match determines all other triangle-triangle matches due to geometric consistency. + +Despite the conceptual elegance of the formulation, as soon as degenerate matchings are allowed for (e.g. triangle-edge or triangle-vertex), which is necessary for virtually any real-world shape matching instance, problem (ILP-SM) is significantly more difficult. Specifically, it belongs to the class of ILPs, which are NP-hard in general. Windheuser et al. [60, 66, 67] address this based on an LP relaxation that relaxes the binary variables to continuous ones. However, even their convex LP formulation has several drawbacks that impede a practical application: + +(i) The relaxed LP formulation involves a very large number of variables. For example, non-rigidly matching two 3D shapes with 1000 faces each leads to a total of about $2 \cdot 10^{7}$ variables. The authors implement an efficient parallelized GPU-based primal-dual solver [17], which can handle problems with up to 250 faces (leading to about $10^{6}$ binary variables), requiring a total time of about $2\mathrm{h}$ . The same applies to modern state-of-the-art LP solvers [29]. Currently no solver exists that can solve even moderately-sized instances of problem (ILP-SM). +(ii) Windheuser et al. attempt to address this based on a coarse-to-fine scheme. Initially, at the coarsest scale, they match severely downsampled shapes, and repeatedly apply their framework to refine the non-rigid matching only in the local neighborhood of the matching at the previous coarser scale. Overall, this has the downside that the final matching + +substantially depends on the initial matching at the coarsest scale. With that, there is the risk that the initial low resolution shapes do not contain sufficient details for finding a reliable matching. +(iii) Furthermore, solutions of the continuous relaxation are generally not binary, so that a rounding step is necessary to obtain a discrete solution. To this end, the authors propose to repeatedly solve the expensive LP relaxations while gradually fixing more and more variables to be binary. + +Overall, to make problem (ILP-SM) practicable, being able to solve larger shape matching instances is of great importance. To address this, we propose an efficient combinatorial solver based on the Lagrange decomposition to optimize problem (ILP-SM). + +# 4. Lagrange Decomposition + +Next, we introduce our Lagrange decomposition reformulation for problem (ILP-SM), which is amenable to dual optimization. + +Decomposition into subproblems. We associate a small subproblem $S$ for each row of the constraint matrix in (ILP-SM): + +Definition 4 (Subproblems). For each individual projection and geometry consistency constraint we define a set of subproblems as + +$$ +\begin{array}{l} \forall j: \mathcal {S} _ {j} ^ {\pi_ {X}} = \left\{\Gamma \in \{0, 1 \} ^ {| F |}: \sum_ {i} \left(\pi_ {X}\right) _ {j i} \Gamma_ {i} = 1 \right\}, (1) \\ \forall j: \mathcal {S} _ {j} ^ {\pi_ {Y}} = \left\{\Gamma \in \{0, 1 \} ^ {| F |}: \sum_ {i} \left(\pi_ {Y}\right) _ {j i} \Gamma_ {i} = 1 \right\}, (2) \\ \forall j: \mathcal {S} _ {j} ^ {\partial} = \left\{\Gamma \in \{0, 1 \} ^ {| F |}: \sum_ {i} (\partial) _ {j i} \Gamma_ {i} = 0 \right\}. (3) \\ \end{array} +$$ + +We write the set of all subproblems as + +$$ +\boldsymbol {\mathcal {S}} = \left\{\mathcal {S} _ {j = 1, \dots , | F _ {X} |} ^ {\pi_ {X}}, \mathcal {S} _ {j = 1, \dots , | F _ {Y} |} ^ {\pi_ {Y}}, \mathcal {S} _ {j = 1, \dots , | E |} ^ {\partial} \right\}. \tag {4} +$$ + +With the above decomposition we can write the Lagrange dual shape matching problem as + +$$ +\begin{array}{l l} \max _ {\boldsymbol {\lambda} = \{\lambda^ {\mathcal {S}} \}} & \sum_ {\mathcal {S} \in \boldsymbol {\mathcal {S}}} \min _ {\Gamma \in \mathcal {S}} \langle \lambda^ {\mathcal {S}}, \Gamma \rangle \\ \text {s . t .} & \sum_ {\mathcal {S} \in \boldsymbol {\mathcal {S}}} \lambda^ {\mathcal {S}} = \mathbb {E}. \end{array} \tag {LD-SM} +$$ + +Min-margins. While we cannot easily derive a matching from a solution $\lambda$ of the dual problem (LD-SM), we can nevertheless obtain important dual costs that will guide our primal solution search. We use dual costs based on min-margins, which are defined as follows: + +Definition 5 (Min-margins). For any subproblem $S \in S$ we define the min-marginal for the $i$ -th variable as the difference of the optima with the corresponding variable fixed to 1 vs. 0 as + +$$ +m _ {i} ^ {\mathcal {S}} = \min _ {\Gamma \in \mathcal {S}: \Gamma_ {i} = 1} \left\langle \lambda^ {\mathcal {S}}, \Gamma \right\rangle - \min _ {\Gamma \in \mathcal {S}: \Gamma_ {i} = 0} \left\langle \lambda^ {\mathcal {S}}, \Gamma \right\rangle . \tag {5} +$$ + +![](images/fe52eef0ad9da9a80aec67c65b0d7c9d50f9aab51c32200c46d338b54a4927fb.jpg) +Figure 4. The pipeline of our combinatorial solver for the ILP shape matching problem (ILP-SM). The individual stages (a)-(e) are explained in Sec. 5. + +In words, a min-marginal quantifies by how much a variable wants to attain the value 1 resp. 0 in the subproblem $S$ . + +The total min-marginal is defined as the sum over all min-margins + +$$ +M _ {i} = \sum_ {\mathcal {S} \in \mathcal {S}} m _ {i} ^ {\mathcal {S}}. \tag {6} +$$ + +If for each variable all min-margins have the same sign, and the total min-marginal is non-zero, we can directly reconstruct a primal solution by setting $\Gamma_{i} = 1$ if $M_{i} < 0$ $\Gamma_{i} = 0$ if $M_{i} > 0$ . This case occurs when the relaxation defined by the Lagrange decomposition (LD-SM) is tight, which is not true in general. If not tight, the above reconstruction will result in infeasible $\Gamma$ . However, in that case good solutions will mostly agree with the sign of the total min-marginal, which we exploit in our primal rounding strategy. We optimize the Lagrange decomposition and compute min-margins with the approximate solver [37]. + +# 5. Primal Rounding + +In the following we introduce our heuristic for primal rounding, i.e. obtaining primal solutions based on the dual costs that were computed through the Lagrange decomposition (LD-SM). Before we explain details, we provide a high-level summary of the main concept: First, we pick a suitable initial product triangle as first correspondence candidate. After we have solved the Lagrange decomposition and obtained the total min-margins, we iteratively add product triangle matchings, i.e. we select elements of the matching vector $\Gamma$ that are to be set to 1. This may induce additional product triangle correspondences (due to the constraints in problem (ILP-SM)), so we also force assignments of other variables. In case a conflict arises, we detect it and backtrack. After a given number of variable assignments, or if too many backtracking steps occur, we solve the Lagrange decomposition (LD-SM) again, while fixing the already found correspondences. With the updated total min-margins we start the search again until we find a complete solution. Our overall pipeline is shown in Fig. 4, which we explain next in detail. + +(a) Initialization. Given the empty matching, we choose the first triangle-triangle matching as follows: +(i) Consider the shape $Z \in \{X, Y\}$ with fewer triangles. +(ii) In $Z$ , we choose the most regular triangle $z$ (all angles between $20^{\circ}$ and $90^{\circ}$ , area is close to the mean area of all triangles, triangle lies in low curvature region). +(iii) We select all elements in $\Gamma$ that form non-degenerate triangle-triangle matchings of $z$ . +(iv) Among these, we choose the matching candidate with smallest total min-margins. +(b) Exploration of candidates. We maintain a set of individual triangle-triangle matchings, i.e. elements of the matching vector $\Gamma$ , to explore in subsequent iterations $F_{\mathrm{expl}} \subset F$ . After adding a product triangle $ab = (a_1b_1, a_2b_2, a_3b_3) \in F_{\mathrm{expl}}$ to our matching $\Gamma$ , we add all other product triangles $a'b' \in F$ that share a product edge oriented in the opposite direction with the currently selected $ab$ to $F_{\mathrm{expl}}$ . In other words, in the next iteration we select one of the tentative product triangles such that the Geometric Consistency I constraint (Tab. 2) is fulfilled for one of the already selected product triangles. We explore product triangles in $F_{\mathrm{expl}}$ according to their total min-margins in ascending order (see Appendix for a formal description). + +Overall, the purpose of exploring only the elements of $F_{\mathrm{expl}}$ minimizes the possibility of obtaining several disjoint submatchings that do not fit together geometrically. + +(c) Constraints & propagation. After each individual variable assignment we analyze all constraints that involve the modified variable, and then check whether any other variable assignments are forced. If so, we set the forced variable and recursively propagate. All used constraints and propagation rules are summarized shown in Tab. 2. +(d) Conflict detection. After each variable assignment we check for potential conflicts due to two potential cases: +(i) Infeasibility: individual constraints are not satisfiable anymore by the variables that are not set yet. +(ii) Contradicting assignments: variables which are already set to one would have to be set to zero by the propagation and vice versa. + +Injectivity +![](images/23af402a209085f647e3c903b896014b2d87953509825a06cc6c2312c01554db.jpg) +Constraint: Each face can only have one matching. + +Surjectivity +![](images/ae32756eb933bdb83f9e6fb33b9f3b4c12f8d1b75dbffe385b8dabc151a8c130.jpg) +Constraint: Each face of each shape needs to have a matching. + +Two-manifold +![](images/b02e1a0a25752629d68eeab9f02c71c95e1c204d081abac2cd62c6897b7b4ced.jpg) +Constraint: The same product edge orientation can only occur once in the solution + +Geometric Consistency I +![](images/a7fae735dac0066ca89c24cfe5ca4f6e00a1f525b1796449942d87dfd56a078c.jpg) +Propagation: Matching a triangle from one shape implies all other correspondences involving the same triangle have to be set to 0. +Constraint: Each product edge needs to have a counterpart (opposite orientation). +Propagation: A solution must include exactly one of the product triangles containing the opposite orientation of the product edge. + +Geometric Consistency II +![](images/95a465ec9d91189947a31c9dd94b683b9f8f137c33c6dc2f454318ecee0765b1.jpg) +Propagation: If all correspondences involving a given triangle are 0, then the remaining one is set to 1. +Constraint: Each product edge needs to have a counterpart (opposite orientation). +Propagation: If there is only one counterpart left within the possible matches, it has to be part of the solution. + +Closedness +Table 2. Matching constraints and the derived propagation rules used in the primal heuristic. Product triangles are visualized with blue-black edges, triangles of 3D shapes with black edges. +![](images/2067ed09c741f62245776dbdd4b24095752a6345bee539135f3a225c9602a158.jpg) +Propagation: If a product edge is part of a matching, all other occurrences of the same product edge are set to 0. +Constraint: No holes are allowed in the matching. +Propagation: Whenever all three neighbors of a product face are part of the solution, the product face itself is also part of the solution. + +In cases of conflicts we perform backtracking by undoing the assignments and respective propagations that participated in the conflict. + +(e) Recomputation of min-margins. In order to better reflect the quality of product triangle candidates in $F_{\mathrm{expl}}$ w.r.t. already obtained partial matching, we regularly recompute (total) min-margins. Whenever a certain amount of product triangles is set, we fix the respective variables in (ILP-SM), dualize the subproblem to obtain a new reduced Lagrange decomposition (LD-SM), and eventually optimize again to obtain the updated total min-margins $M_{i}$ . We refer to the Appendix for details. + +# 6. Experiments + +In the following we experimentally evaluate our approach on various datasets in a range of different settings. + +Shape matching data. In our experiments we consider shape matching instances from several datasets: TOSCA [8], TOSCA partial [56], SHREC-watertight [27], SMAL [70], SHREC '19 [44] and KIDS [57]. We down-sample all meshes to about at most 1000 faces. We do not perform post-processing on the obtained matchings. The energy $\mathbb{E}$ of problem (ILP-SM) is computed analogously to [67]. + +Shape matching algorithms. Since our main objective is to improve the computational performance of the best existing solver for problem (ILP-SM), as a baseline we reim + +pleted the rounding strategy proposed by Windheuser et al. $[66]^2$ based on the state-of-the-art LP solver Gurobi [29]. For further details we refer to the Appendix. + +In addition, we also compare our solver for problem (ILP-SM) with two recent state-of-the-art methods that rely on other shape matching formalisms. Among them is a method based on smooth shells (Eisenberger et al.) [18], and a method based on a discrete functional map optimization framework (Ren et al.) [53]. + +# 6.1. Combinatorial Solvers for Problem (ILP-SM) + +First, we compare against the directly related approach of Windheuser et al. [66], which solves the same problem (ILP-SM) as ours. + +In Fig. 1 (right) we show the scalability of the solver of Windheuser et al. and ours depending on the number of triangles per shape. We find that while Windheuser et al. already takes $1\mathrm{h}$ for low-resolution shapes with $\approx 200$ triangles (leading to a total of $\approx 8\cdot 10^{5}$ binary variables in problem (ILP-SM)), our method scales significantly better and can handle shapes with substantially higher resolutions. Our method has a linear memory consumption (to the problem size, which is quadratic in the shape resolution). We note that the bump in the graph stems from the heuristically determined recomputation of the min-margins which may + +![](images/99a18c906244867666734151fdf45f05b642226d9fe0542be28f179ff13f888a.jpg) +Figure 5. Qualitative comparison of the method by Eisenberger et al. [18] (second row), Ren et al. [53] (third row) and Ours (last row). While Eisenberger et al. and Ren et al. do not guarantee orientation preservation they lead to erroneous matchings (e.g. left-right flips, see red arrows), whereas our method leads to smooth and orientation-preserving matchings. + +![](images/27fd5178188cf5dd8ed3be3890347fb765c62f1de1d69ba7ded7414010e8bb17.jpg) +Figure 6. Comparison of the average percentage of correct matchings for the entire TOSCA dataset of Windheuser et al. vs. Ours (left). The horizontal axis shows the geodesic error threshold, and the vertical axis shows the percentage of matches that are smaller than or equal to this error. For Windheuser et al. we allow the solver to take $10 \times$ more time than our method needed (per shape matching instance) - even then the curve of Windheuser et al. is low because it is unable to find good matchings within the given time budget, see the qualitative example on the right (black shows unmatched parts, all shapes have 175 triangles). + +vary for individual matching problems (see Sec. A3 in Appendix). + +In Fig. 6 we show quantitative and qualitative results of both solvers on the full TOSCA dataset, where we have + +found that our method performs significantly better with an average area under the curve (higher is better) of 0.91 vs. 0.72 for Windheuser et al. (see Appendix for more details). + +# 6.2. Comparison to State of the Art + +Next, we compare our method to recent state-of-the-art shape matching approaches. Since Eisenberger et al. [18] show that their recent method substantially outperforms a range of other methods (BCICP [55], Zoomout [45], KM [65], FM [50], BIM [34]) on various datasets, for our comparison we only focus on the method by Eisenberger et al. [18], and in addition also include results of the more recent method of Ren et al. [53]. + +In Fig. 5 we show qualitative results for various non-rigid 3D shape matching instances from the datasets TOSCA, SHREC-watertight, SMAL and KIDS. The method of Ren et al. suffers from matchings that are not geometrically consistent, which thus leads to nonsmooth matchings (e.g. the pliers in the sixth column, or the kid in the eighth column). Moreover, both Ren et al. and Eisenberger et al. do not guarantee orientation preservation, so that for example left-right flips occur (e.g. the lion in the fifth column for Eisenberger et al., or the cat in the second-last column for Ren et al.). In contrast, our method obtains reliable matchings in these cases which are smooth and preserve the orientation. + +In Fig. 8 we show quantitative results on the TOSCA, + +![](images/340fd94141d39f74ea93826a76eb47dc4e388c566e9cb59cb4b9acc08f6ef80c.jpg) +Figure 7. Our method can handle the difficult case of matching pairs of partial shapes without availability of complete shapes, in which the orientation-preserving diffeomorphism serves as powerful constraint (boundaries are shown as red lines). (Best viewed magnified on screen) + +![](images/bb2a2f0e79477bb9cf4933e3367a8e1a65ca5a9f15cfd8e1c2e81c132b0c595b.jpg) + +![](images/2a75aaee93bcca212e424a7fb2c4248f4048a59ee8e6778e1b826414d75248f4.jpg) +Figure 8. Comparison of the percentage of correct matchings for the TOSCA dataset (left), the KIDS dataset (middle) and the SHREC'19 dataset (right). The horizontal axis shows the geodesic error threshold, and the vertical axis shows the percentage of matches smaller than or equal to this error. Ours obtains the highest area under curve $(\uparrow)$ (0.929 for ours vs. 0.836 for Ren et al. and 0.910 for Eisenberger et al. on TOSCA). + +![](images/29752dcd244ab537df30c6022a6b24256cfc1432a19013f3e7c161827454669d.jpg) + +![](images/c19af93c78a2eac8dc2a6de918b0ca2202aa96b6205f96b56bb27894ddfb99e1.jpg) + +KIDS and SHREC'19 datasets. Despite the fact that our method aims to directly solve a high-dimensional ILP with up to $2 \cdot 10^{7}$ binary variables (see problem (ILP-SM)), our method outperforms the baselines in terms of solution quality. Due to the large number of binary variables, our approach requires $22.68\mathrm{min}$ on average to compute a matching (opposed to few seconds for Ren et al. and Eisenberger et al.). For some individual shape classes we have found that ours has slightly worse performance (see Appendix), which stems from poor local optima for individual shape matching instances. + +# 6.3. Partial-to-Partial Non-Rigid Matching + +In Fig. 7 we showcase that our proposed solver is even able to handle difficult non-rigid partial-to-partial shape matching problems. Although partial shape matching has attracted a lot of attention recently [3, 40, 41, 45, 56, 65, 68], most existing works typically consider the case of matching a partial shape to a complete shape. There are also some partial-partial shape matching methods [1, 12] that build upon machine learning, which we consider to be orthogonal to our method. In contrast, for the first time we utilize orientation-preserving diffeomorphisms to constrain the challenging problem of non-rigidly matching a pair of + +partial shapes without availability of complete shapes. + +# 7. Discussion & Limitations + +Our experimental analysis has confirmed that we can compute matchings involving up to $2 \cdot 10^{7}$ variables on a range of datasets within about $2\mathrm{h}$ . Although our solver does not guarantee to find globally optimal solutions and thus may lead to suboptimal results in some cases (see Appendix), our experiments confirm that in most cases we produce high-quality matchings, and that we can even handle partial-to-partial shape matching. + +# 8. Conclusion + +We proposed a novel combinatorial solver for efficiently computing solutions to the mathematically elegant integer linear programming formulation of 3D shape matching introduced in [66]. Our solver consists of a primal-dual approach where the primal step makes use of min-margins computed globally for the full problem. The original solver of [66] could only handle shapes of up to 250 triangles and therefore had to be applied in a heuristic coarse-to-fine strategy. In contrast, the proposed method leads to a drastic speedup and can therefore handle ILPs with millions of variables and 3D shapes of practically relevant resolution. This allows us to globally optimize over all orientation preserving geometrically consistent non-rigid mappings providing state-of-the-art matching results. Moreover, we extend this combinatorial matching approach to challenging scenarios like partial-to-partial shape matching without availability of the complete shapes. We argue that also generalizations, e.g. to more than two shapes, should be practically solvable through a similar combinatorial optimization approach. + +# References + +[1] Souhaib Attaiki, Gautam Pai, and Maks Ovsjanikov. Dpfm: Deep partial functional maps. In 3DV, 2021. 8 +[2] Mokhtar, S. Bazaraa and A. N. Elshafei. An exact branch-and-bound procedure for the quadratic-assignment problem. + +Naval Research Logistics Quarterly, 26(1):109-121, Mar. 1979. 2 +[3] Florian Bernard, Zeeshan Khan Suri, and Christian Theobalt. MINA: Convex Mixed-Integer Programming for Non-Rigid Shape Alignment. In CVPR, 2020. 1, 2, 8 +[4] Florian Bernard, Christian Theobalt, and Michael Moeller. DS*: Tighter Lifting-Free Convex Relaxations for Quadratic Matching Problems. In CVPR, 2018. 2 +[5] Florian Bernard, Johan Thunberg, Paul Swoboda, and Christian Theobalt. HiPPI: Higher-order projected power iterations for scalable multi-matching. In ICCV, 2019. 2 +[6] Paul J. Besl and Neil D. McKay. A method for registration of 3-D shapes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(2):239-256, Feb. 1992. 2 +[7] Seth Billings and Russell Taylor. Iterative Most Likely Oriented Point Registration. In MICCAI, 2014. 2 +[8] Alexander Bronstein, Michael Bronstein, and Ron Kimmel. Numerical Geometry of Non-Rigid Shapes. Springer Science & Business Media, 2008. 6 +[9] Alexander M Bronstein, Michael M Bronstein, Ron Kimmel, Mona Mahmoudi, and Guillermo Sapiro. A gromov-hausdorff framework with diffusion geometry for topologically-robust non-rigid shape matching. International Journal of Computer Vision, 89(2-3):266-286, 2010. 2 +[10] R. Qi Charles, Hao Su, Mo Kaichun, and Leonidas J. Guibas. PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation. In CVPR, 2017. 3 +[11] Qifeng Chen and Vladlen Koltun. Robust Nonrigid Registration by Convex Optimization. In ICCV, 2015. 2 +[12] Luca Cosmo, Emanuele Rodola, Jonathan Masci, Andrea Torsello, and Michael M. Bronstein. Matching deformable objects in clutter. In 3DV, 2016. 8 +[13] James Coughlan, Alan Yuille, Camper English, and Dan Snow. Efficient Deformable Template Detection and Localization without User Initialization. Computer Vision and Image Understanding, 78(3):303-319, June 2000. 2 +[14] Nicolas Donati, Abhishek Sharma, and Maks Ovsjanikov. Deep Geometric Functional Maps: Robust Feature Learning for Shape Correspondence. In CVPR, 2020. 3 +[15] Nadav Dym and Shahar Ziv Kovalsky. Linearly converging quasi branch and bound algorithms for global rigid registration. In ICCV, 2019. 2 +[16] Nadav Dym, Haggai Maron, and Yaron Lipman. DS++: A flexible, scalable and provably tight relaxation for matching problems. ACM Transactions on Graphics, 36(6):1-14, Nov. 2017. 2 +[17] Jonathan Eckstein, Dimitri P Bertsekas, et al. An alternating direction method for linear programming. 1990. 4 +[18] Marvin Eisenberger, Zorah Lahner, and Daniel Cremers. Smooth Shells: Multi-Scale Shape Registration With Functional Maps. In CVPR, 2020. 2, 6, 7 +[19] Marvin Eisenberger, David Novotny, Gael Kerchenbaum, Patrick Labatut, Natalia Neverova, Daniel Cremers, and Andrea Vedaldi. NeuroMorph: Unsupervised Shape Interpolation and Correspondence in One Go. In CVPR, 2021. 3 + +[20] Marvin Eisenberger, Aysim Token, Laura Leal-Taixe, and Daniel Cremers. Deep Shells: Unsupervised Shape Correspondence with Optimal Transport. In NeurIPS, 2020. 3 +[21] Raul San José Estépar, Anders Brun, and Carl-Fredrik Westin. Robust Generalized Total Least Squares Iterative Closest Point Registration. In MICCAI, 2004. 2 +[22] Danielle Ezuz and Mirela Ben-Chen. Deblurring and Denoising of Maps between Shapes. Computer Graphics Forum, 36(5):165-174, Aug. 2017. 2 +[23] Danielle Ezuz, Behrend Heeren, Omri Azencot, Martin Rumpf, and Mirela Ben-Chen. Elastic Correspondence between Triangle Meshes. Computer Graphics Forum, 38(2):121-134, 2019. 2 +[24] Pedro F Felzenszwalb. Representation and Detection of Deformable Shapes. IEEE Transactions on Pattern Analysis and Machine Intelligence, page 32, 2005. 2 +[25] Fajwel Fogel, Rodolphe Jenatton, Francis Bach, and Alexandre d'Aspremont. Convex Relaxations for Permutation Problems. SIAM Journal on Matrix Analysis and Applications, 36(4):1465-1488, Jan. 2015. 2 +[26] Maolin Gao, Zorah Lahner, Johan Thunberg, Daniel Cremers, and Florian Bernard. Isometric Multi-Shape Matching. In CVPR, 2021. 2 +[27] Daniela Giorgi, Silvia Biasotti, and Laura Paraboschi. SHape REtrieval Contest 2007: Watertight Models Track. page 25, 2007. 6 +[28] Thibault Groueix, Matthew Fisher, Vladimir G. Kim, Bryan C. Russell, and Mathieu Aubry. Unsupervised cycle-consistent deformation for shape matching. arXiv:1907.03165, July 2019. 3 +[29] Gurobi Optimization, LLC. Gurobi optimizer reference manual, 2021. 4, 6 +[30] Oshri Halimi, Or Litany, Emanuele Rodola Rodola, Alex M. Bronstein, and Ron Kimmel. Unsupervised Learning of Dense Shape Correspondence. In CVPR, 2019. 3 +[31] Benjamin Holzschuh, Zorah Lahner, and Daniel Cremers. Simulated Annealing for 3D Shape Correspondence. In 3DV, 2020. 2 +[32] Ling Hu, Qinsong Li, Shengjun Liu, and Xinru Liu. Efficient Deformable Shape Correspondence via Multiscale Spectral Manifold Wavelets Preservation. In CVPR, 2021. 2 +[33] Ruqi Huang, Jing Ren, Peter Wonka, and Maks Ovsjanikov. Consistent zoomout: Efficient spectral map synchronization. In Computer Graphics Forum, volume 39, pages 265-278, 2020. 2 +[34] Vladimir G. Kim, Yaron Lipman, and Thomas Funkhouser. Blended intrinsic maps. In Transactions on Graphics (TOG), 2011. 7 +[35] Yam Kushinsky, Haggai Maron, Nadav Dym, and Yaron Lipman. Sinkhorn algorithm for lifted assignment problems. SIAM Journal on Imaging Sciences, 12(2):716-735, 2019. 2 +[36] Zorah Lahner, Emanuele Rodola, Frank R Schmidt, Michael M Bronstein, and Daniel Cremers. Efficient globally optimal 2d-to-3d deformable shape matching. In CVPR, 2016. 2 + +[37] Jan-Hendrik Lange and Paul Swoboda. Efficient Message Passing for 0-1 ILPs with Binary Decision Diagrams. In ICML, 2021. 5 +[38] D. Khue Le-Huu and Nikos Paragios. Alternating Direction Graph Matching. In CVPR, 2017. 2 +[39] Marius Leordeanu, Martial Hebert, and Rahul Sukthankar. An integer projected fixed point method for graph matching and map inference. In NIPS, 2009. 2 +[40] Or Litany, Tal Remez, Emanuele Rodola, Alex Bronstein, and Michael Bronstein. Deep Functional Maps: Structured Prediction for Dense Shape Correspondence. In ICCV, 2017. 3, 8 +[41] Or Litany, Emanuele Rodolà, Alexander M Bronstein, Michael M Bronstein, and Daniel Cremers. Non-rigid puzzles. In Computer Graphics Forum, volume 35, pages 135-143, 2016. 8 +[42] Manish Mandad, David Cohen-Steiner, Leif Kobbelt, Pierre Alliez, and Mathieu Desbrun. Variance-minimizing transport plans for inter-surface mapping. ACM Transactions on Graphics, 36(4):1-14, July 2017. 2 +[43] Haggai Maron, Nadav Dym, Itay Kezurer, Shahar Kovalsky, and Yaron Lipman. Point registration via efficient convex relaxation. ACM Transactions on Graphics, 35(4):1-12, July 2016. 2 +[44] Simone Melzi, Riccardo Marin, Emanuele Rodolà, Umberto Castellani, Jing Ren, Adrien Poulenard, Peter Wonka, and Maks Ovsjanikov. Shrec 2019: Matching humans with different connectivity. In Eurographics Workshop on 3D Object Retrieval, 2019. 6 +[45] Simone Melzi, Jing Ren, Emanuele Rodola, Abhishek Sharma, Peter Wonka, and Maks Ovsjanikov. Zoomout: spectral upsampling for efficient shape correspondence. ACM Transactions on Graphics (TOG), 38(6):1-14, 2019. 2, 7, 8 +[46] Facundo Memoli and Guillermo Sapiro. A theoretical and computational framework for isometry invariant recognition of point cloud data. Foundations of Computational Mathematics, 5(3):313-347, 2005. 2 +[47] James Munkres. Algorithms for the Assignment and Transportation Problems. Journal of the Society for Industrial and Applied Mathematics, 5(1):32-38, Mar. 1957. 1 +[48] Andriy Myronenko and Xubo Song. Point Set Registration: Coherent Point Drift. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(12):2262-2275, Dec. 2010. 2 +[49] Carl Olsson, Fredrik Kahl, and Magnus Oskarsson. Branch-and-Bound Methods for Euclidean Registration Problems. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(5):783-794, May 2009. 2 +[50] Maks Ovsjanikov, Mirela Ben-Chen, Justin Solomon, Adrian Butscher, and Leonidas Guibas. Functional maps: a flexible representation of maps between shapes. ACM Transactions on Graphics (TOG), 31(4):1-11, 2012. 2, 7 +[51] Panos M Pardalos, Franz Rendl, and Henry Wolkowicz. The Quadratic Assignment Problem - A Survey and Recent Developments. DIMACS Series in Discrete Mathematics, 1993. 1, 2 + +[52] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NeurIPS, volume 30, 2017. 3 +[53] Jing Ren, Simone Melzi, Peter Wonka, and Maks Ovsjanikov. Discrete Optimization for Shape Matching. Computer Graphics Forum, 40(5):81-96, Aug. 2021. 2, 6, 7 +[54] Jing Ren, Mikhail Panine, Peter Wonka, and Maks Ovsjanikov. Structured Regularization of Functional Map Computations. Computer Graphics Forum, 38(5):39-53, Aug. 2019. 2 +[55] Jing Ren, Adrien Poulenard, Peter Wonka, and Maks Ovsjanikov. Continuous and orientation-preserving correspondences via functional maps. ACM Transactions on Graphics, 37(6):1-16, Jan. 2018. 2, 7 +[56] E. Rodola, L. Cosmo, M. M. Bronstein, A. Torsello, and D. Cremers. Partial Functional Correspondence: Partial Functional Correspondence. Computer Graphics Forum, 36(1):222-236, Jan. 2017. 2, 6, 8 +[57] Emanuele Rodola, Samuel Rota Bulo, Thomas Windheuser, Matthias Vestner, and Daniel Cremers. Dense Non-rigid Shape Correspondence Using Random Forests. In CVPR, 2014. 3, 6 +[58] Jean-Michel Roufosse, Abhishek Sharma, and Maks Ovsjanikov. Unsupervised deep learning for structured shape matching. In ICCV, 2019. 3 +[59] Yusuf Sahillioglu. Recent advances in shape correspondence. The Visual Computer, 36(8):1705-1721, 2020. 2 +[60] F. R. Schmidt, T. Windheuser, U. Schlickewei, and D. Cremers. Dense elastic 3d shape matching, 2014. 2, 4 +[61] Peter H. Schonemann. A generalized solution of the orthogonal procrustes problem. Psychometrika, 31(1):1-10, Mar. 1966. 2 +[62] Robert W. Sumner and Jovan Popovic. Deformation transfer for triangle meshes. ACM Trans. Graph., 23(3):399-405, Aug. 2004. 2 +[63] Paul Swoboda, Carsten Rother, Hassan Abu Alhaija, Dagmar Kainmuller, and Bogdan Savchynskyy. A study of lagrangean decompositions and dual ascent solvers for graph matching. In CVPR, 2017. 2 +[64] Oliver van Kaick, Hao Zhang, Ghassan Hamarneh, and Daniel Cohen-Or. A Survey on Shape Correspondence: O. van Kaick et al. / A Survey on Shape Correspondence. Computer Graphics Forum, 30(6):1681-1707, Sept. 2011. 2 +[65] Matthias Vestner, Zorah Lahner, Amit Boyarski, Or Litany, Ron Slossberg, Tal Remez, Emanuele Rodola, Alex Bronstein, Michael Bronstein, Ron Kimmel, and Daniel Cremers. Efficient Deformable Shape Correspondence via Kernel Matching. In 3DV, 2017. 2, 7, 8 +[66] Thomas Windheuser, Ulrich Schlickewei, Frank R. Schmidt, and Daniel Cremers. Geometrically consistent elastic matching of 3D shapes: A linear programming solution. In ICCV, 2011. 1, 2, 3, 4, 6, 7, 8 +[67] Thomas Windheuser, Ulrich Schlickwei, Frank R. Schimdt, and Daniel Cremers. Large-Scale Integer Linear Programming for Orientation Preserving 3D Shape Matching. Computer Graphics Forum, 30(5):1471-1480, Aug. 2011. 1, 2, 4, 6 + +[68] Rui Xiang, Rongjie Lai, and Hongkai Zhao. A Dual Iterative Refinement Method for Non-Rigid Shape Matching. In CVPR, 2021. 2, 8 +[69] Yiming Zeng, Yue Qian, Zhiyu Zhu, Junhui Hou, Hui Yuan, and Ying He. CorrNet3D: Unsupervised End-to-End Learning of Dense Correspondence for 3D Point Clouds. In CVPR, 2021. 3 +[70] Silvia Zuffi, Angjoo Kanazawa, David Jacobs, and Michael J. Black. 3D menagerie: Modeling the 3D shape and pose of animals. In CVPR, 2017. 6 \ No newline at end of file diff --git a/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/images.zip b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..19ee9203f113065e10d87f5b54d635224e95f14e --- /dev/null +++ b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4941ea03e9fecaefa2992e319e921380508247f3c1253f12714a17a51af6e525 +size 443936 diff --git a/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/layout.json b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c8e491c1ca19bfe97ff3b03806b62b6e0254a5c5 --- /dev/null +++ b/ascalablecombinatorialsolverforelasticgeometricallyconsistent3dshapematching/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cab95b95840a5f2c780bc9cd9b6c89f7737b00017554a9836e110988b1707639 +size 442934 diff --git a/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_content_list.json b/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f1a82c7c52ebfb7cbd3739c6694b98e5cdff09a8 --- /dev/null +++ b/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6704e2cc644629f5151e07e187ef0bddae4b126602b6ba5a5c6e45c85c891d74 +size 84152 diff --git a/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_model.json b/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2e954da0b3077e1c4f954adf40d673900ebfa49a --- /dev/null +++ b/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da242bb12db2efeb7562a6e06ae39ea1189eefbde1e1899feef3f9d7aec4e9b7 +size 104885 diff --git a/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_origin.pdf b/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e62c0c7ddb39282db3ccfa38c240e6f6ad97d042 --- /dev/null +++ b/aselfsuperviseddescriptorforimagecopydetection/6558237c-256a-4b86-a1e5-00bedcd4677a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:301fa2d8e784a607ee4b7c52258763f51b0a70c43d5958c7d36db8b78530127d +size 2444069 diff --git a/aselfsuperviseddescriptorforimagecopydetection/full.md b/aselfsuperviseddescriptorforimagecopydetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9ff29557cc6fe41a3e0395d93dff5782e2a6b6e4 --- /dev/null +++ b/aselfsuperviseddescriptorforimagecopydetection/full.md @@ -0,0 +1,371 @@ +# A Self-Supervised Descriptor for Image Copy Detection + +Ed Pizzi + +Sreya Dutta Roy + +Sugosh Nagavara Ravindra + +Priya Goyal + +Matthijs Douze + +Meta AI + +# Abstract + +Image copy detection is an important task for content moderation. We introduce SSCD, a model that builds on a recent self-supervised contrastive training objective. We adapt this method to the copy detection task by changing the architecture and training objective, including a pooling operator from the instance matching literature, and adapting contrastive learning to augmentations that combine images. + +Our approach relies on an entropy regularization term, promoting consistent separation between descriptor vectors, and we demonstrate that this significantly improves copy detection accuracy. Our method produces a compact descriptor vector, suitable for real-world web scale applications. Statistical information from a background image distribution can be incorporated into the descriptor. + +On the recent DISC2021 benchmark, SSCD is shown to outperform both baseline copy detection models and self-supervised architectures designed for image classification by huge margins, in all settings. For example, SSCD outperforms SimCLR descriptors by $48\%$ absolute. + +Code is available at https://github.com/facebookresearch/sscd-copy-detection. + +# 1. Introduction + +All online photo sharing platforms use content moderation to block or limit the propagation of images that are considered harmful: terrorist propaganda, misinformation, harassment, pornography, etc. Some content moderation can be performed automatically, for unambiguous data like pornographic pictures, but this is much harder for complex data like memes [31] or misinformation [2]. In these cases, content is moderated manually. For of viral images, where copies of same image may be uploaded thousands of times, manual moderation of each copy is tedious and unnecessary. Instead, each image for which a manual moderation decision is taken can be recorded in a database, so that it can be re-identified later and handled automatically. + +This paper is concerned with this basic task of re-identification. This is non trivial because copied images are + +![](images/51a83424a306f93f933692afbdf930d4d6d153475dcb650aeef5060e7ef6b71f.jpg) +Figure 1. The SSCD architecture for image copy detection. It is based on SimCLR, with the following additions: the entropy regularization, cutmix/mixup-aware InfoNCE, and inference-time score normalization. + +often altered, for technical reasons (e.g. a user shares a mobile phone screenshot that captures additional content), or users may make adversarial edits to evade moderation. + +Image re-identification is an image matching problem, with two additional challenges. The first is the enormous scale at which copy detection systems are deployed. At this scale, the only feasible approach is to represent images as short descriptor vectors, that can be searched efficiently with approximate nearest neighbor search methods [23, 30]. Copy detection systems typically proceed in 2 stages: a retrieval stage that produces a shortlist of candidate matches and a verification stage, often based on local descriptor matching that operates on the candidates. In this work, we are concerned with the first stage. Figure 1 shows the overall architecture of our Self Supervised Copy Detection (SSCD) approach. + +The second challenge is that there is a hard match/non-match decision to take, and positive image pairs are rare. We wish to limit verification candidates using a threshold, which is a harder constraint than the typical image retrieval setting, where only the order of results matter. + +SSCD uses differential entropy regularization [42] to + +promote a uniform embedding distribution, which has three effects: (1) it makes distances from different embedding regions more comparable; (2) it avoids the embedding collapse described in [29], making full use of the embedding space; (3) it also improves ranking metrics that do not require consistent thresholds across queries. + +Score normalization is important for ranking systems. An advanced score normalization relies on matching the query images with a set of background images. In this work, we show how this normalization can be incorporated in the image descriptor itself. We anticipate that this work will set a strong single-model baseline for image copy detection. We plan to release code and models for our method. + +Section 2 discusses works related to this paper. Section 3 motivates the use of an entropy loss term in a simplified setting. Section 4 carefully describes SSD. Section 5 presents results and ablations of our method. Section 6 points out a few observations about the copy detection task. + +# 2. Related work + +Content tracing approaches. Content tracing on a user-generated photo sharing platform aims at re-identifying images when they circulate out and back into the platform. There are three broad families of tracing methods: metadata-based [1, 3], watermarking [13, 32, 51, 63] and content-based. This work belongs to this last class. + +Classical image datasets for content tracing, like Cassia [16,36] focus on image alterations like splicing, removal and copy-move transformations [16,44,54] that alter only a small fraction of the image surface, so the re-identification is done reliably with simple interest-point based techniques. The challenge is to detect the tampered surface, which is typically approached with deep models inspired by image segmentation [34, 62]. A related line of research is image phylogeny: the objective is to identify the series of edits that were applied to an image between an initial and a final state [14, 15, 33]. The Nimble/Media forensics series of competitions organized by NIST aim at benchmarking these tasks [40, 57]. In this work we focus on the identification itself, with strong transformations and near duplicates that need to be distinguished (see Figure 2). + +Semantic and perceptual image comparison Several definitions of near-duplicate image matching, form a continuum between pixel-wise copy and instance matching [18, 28]. The definition we use in this work is: images are considered copies iff they come from the same 2D image source. More relaxed definitions allow, for example, to match nearby frames in a video. + +There is a large body of literature about solving instance matching [7, 11, 26, 35, 37, 46-48] i.e., recognizing images of the same 3D object with viewpoint/camera changes. In this + +![](images/237b66bf3d0c307b0895545d99189111426cd9e41502ca9358f2299f14d8b8de.jpg) +Figure 2. Example retrieval results from the DISC2021 dataset. Each row is an example. From left to right: query image, first result returned by SSCD, first result returned by the SimCLR baseline. + +work, we build on this literature because it addresses complex image matching, and to our knowledge, recent works and benchmarks for strict copy detection are rare [17, 53]. + +Instance matching. Classical instance matching relies on 3D matching tools, like interest points [26, 35, 43]. CNN-based approaches use backbones from image classification, either pre-trained [4, 20, 49] or trained end-to-end [21, 38], with two adaptations: (1) the pooling layer that converts the last CNN activation map to a vector is a max-pooling [49], or more generally GeM pooling [39], a form of $L_{p}$ normalization where $p$ is adapted to the image resolution [7]; (2) careful normalization of the vectors. In addition to simple L2-normalization [4], "whitening" is often used to compare descriptors [25, 49]. An additional normalization technique contrasts the distances w.r.t. a background distribution of images [18, 27]. In this work, we apply these pooling and normalization techniques to copy detection. + +Contrastive self-supervised learning. A recent line of self-supervised learning research uses contrastive objectives that learn image representations that bring transformed im + +ages together. These methods either discriminate image features [10, 22, 24] or the cluster assignments of these image features [8]. These methods either rely on memory banks [24, 56] or large batch sizes [10]. In particular, SimCLR [10] uses matching transformed image copies as a surrogate task to learn a general image representation that transfer well to other tasks, such as image classification. A contrastive InfoNCE loss [52] is used to map copies of the same source image nearby in the embedding space. + +Differential entropy regularization. Increasing the entropy of media descriptors forces them to spread over the representation space. Sablayrolles et al. [42] observed that the entropy can be estimated locally with the Kozachenko-Leononenko differential entropy estimator [6], that can be incorporated directly into the loss to maximize descriptor entropy. The work of El-Nouby et al. [19] is closest to our approach. It adds the entropy term to a contrastive loss at fine-tuning time to improve the accuracy for category and instance retrieval. Our approach is similar, applied to a self-supervised objective and image copy detection. + +# 3. Motivation + +In this section, we start from the SimCLR [10] method, then perform a simple experiment where we combine it with the entropy loss from [42] and witness how it impacts classification and copy detection tasks. + +# 3.1. Preliminaries: SimCLR + +SimCLR training is best described at the mini-batch level. For batches of $N$ images, it creates two augmented copies of each image (repeated augmentations), yielding $2N$ transformed images. The positive pairs of matching images are $P = \{(i,i + N),(i + N,i)\}_{i = 1..N}$ . We denote positive matches for image $i$ as $P_{i} = \{j\mid (i,j)\in P\}$ . Each image is transformed by a CNN backbone network. The final activation map of the CNN is average pooled, then projected using a two-layer MLP into a L2-normalized descriptor $z_{i}\in \mathbb{R}^{d}$ . Descriptors are compared with a cosine similarity: $\mathrm{sim}(z_i,z_j) = z_i^\top z_j$ . A contrastive InfoNCE loss maximizes the similarity between copies relative to the similarity of non-copies. For inference (e.g. to transfer to image classification), SimCLR discards the training-time MLP, using globally pooled features from the CNN trunk directly. + +The InfoNCE loss. SimCLR's InfoNCE loss is a softmax cross-entropy with temperature, that matches descriptors to other descriptors. Let $s_{i,j}$ be the temperature-adjusted cosine similarity $s_{i,j} = \sin (z_i,z_j) / \tau$ . The InfoNCE loss is defined as a mean of $\ell_{i,j}$ terms for positive pairs $(i,j)\in P$ : + +$$ +\ell_ {i, j} = - \log \frac {\exp (s _ {i , j})}{\sum_ {k \neq i} \exp (s _ {i , k})} \tag {1} +$$ + +$$ +\mathcal {L} _ {\text {I n f o N C E}} = \frac {1}{| P |} \sum_ {i, j \in P} \ell_ {i, j}. \tag {2} +$$ + +# 3.2. Entropy regularization + +We use the differential entropy loss proposed in [42], based on the Kozachenko-Leononenko estimator. We adapt it to the repeated augmentation setting by only regularizing neighbors from different source images: + +$$ +\mathcal {L} _ {\mathrm {K o L e o}} = - \frac {1}{N} \sum_ {i = 1} ^ {N} \log \left(\min _ {j \notin \hat {P} _ {i}} \| z _ {i} - z _ {j} \|\right), \tag {3} +$$ + +where $\hat{P}_i = P_i \cup \{i\}$ . Since this entropy loss is a log of the distance to the nearest neighbor, its impact is very high for nearby vectors but dampens quickly when the descriptors are far apart. The effect is to "push" apart nearby vectors. + +![](images/c21acc322aeccfff97597142fe44cf06526aff59ed5c7d4021b06ec78c59cd55.jpg) +Figure 3. Preliminary experiment: we train SimCLR models on ImageNet with varying differential entropy regularization strength, (regular SimCLR: $\lambda = 0$ ). We measure: ImageNet linear classification accuracy and DISC2021 micro average precision ( $\mu AP$ ), with optional score normalization ( $\mu AP_{SN}$ ). The ImageNet and DISC2021 measures are not comparable, but trends within each curve are significant. + +# 3.3. Experiment: SimCLR and entropy + +For this experiment, we combine our contrastive loss with the entropy loss, using a weighting factor $\lambda$ , similar to [19, 42]: + +$$ +\mathcal {L} _ {\text {b a s i c}} = \mathcal {L} _ {\text {I n f o N C E}} + \lambda \mathcal {L} _ {\text {K o L e o}}. \tag {4} +$$ + +We then evaluate the impact of the combined loss on an image classification setting and a copy detection setting, see Section 5.1 for more details about the setup. + +Figure 3 shows how varying entropy loss weight $\lambda$ impacts both tasks. As the entropy loss weight increases, ImageNet linear classification accuracy decreases: this loss + +![](images/31cf1e254f057afc4dff7b91980d83a9ce7255e4eddc2fae89f7f7892ade8718.jpg) + +![](images/efb5c7f07eed293a9565551d09581353cfb71825838b7b4dc0d3a5c5a128be5c.jpg) +Figure 4. Preliminary experiment: histogram of squared distances for DISC2021 matching images and non-matching nearest neighbors. Above: baseline SimCLR. Below: SimCLR combined with entropy regularization (weight $\lambda = 30$ ), without whitening or similarity normalization. + +term is not helpful for classification. Conversely, for copy detection the accuracy increases significantly. + +Figure 4 shows the distribution of distances between matching images (positive pairs) and the nearest nonmatching neighbors (negative pairs). Applying the entropy loss increases all distances and makes the negative distance distribution more narrow. The result is that there is a larger contrast between positive pairs and the mode of the negative distribution, i.e. they are more clearly separated. + +# 4. Method + +Having seen how the entropy loss improves copy detection accuracy, in this section we expand it into a robust image copy detection approach: SSCD. This entails adapting the architecture, the data augmentation, the pooling and adding a normalization stage, as shown in Figure 1. + +# 4.1. Architecture + +SSCD uses a ResNet-50 convolutional trunk to extract image features. We standardize on this architecture because it is widely used, well optimized and still very competitive for image classification [55], but any CNN or transformer backbone could be used (see Section 5). + +Pooling. For classification, the last CNN activation map is converted to a vector by mean pooling. We use generalized mean (GeM) pooling instead, which was shown [7, 39] to improve the discriminative ability of descriptors. This is desirable for instance retrieval and our copy detection case alike. GeM introduces a parameter $p$ , equivalent to average pooling when $p = 1$ and max-pooling when $p \to \infty$ . SSCD uses $p = 3$ , following common practice for image retrieval models [7, 39, 49]. + +
typedetails
SimCLRhorizontal flip, random crop, color jitter, grayscale, Gaussian blur
Strong blur50% large-radius Gaussian blur (σ ∈ [1, 5])
Advanced10% rotation, 10% text, 20% emoji, 20% JPEG compression
Adv. + mixup2.5% mixup, 2.5% cutmix
+ +Table 1. List of data augmentations used for SSCD. The presentations is incremental: each set of augmentations includes the ones from all rows before. The percentages are probabilities to apply each augmentation. + +While GeM pooling at inference time systematically improves accuracy, we observe that it is beneficial at training time only in combination with the differential entropy regularization, i.e. with a vanilla InfoNCE it is better to train with average pooling. We conjecture that GeM pooling may reduce the difficulty of the training task without the additional objective of maximally separating embedding points. We observe that learning the scalar $p$ , as proposed in [39], fails for contrastive learning: the pooling parameter grows unbounded until training becomes numerically unstable. + +Descriptor projection. SimCLR uses a 2-layer MLP projection at training time. For inference, the MLP is discarded and CNN trunk features are used directly. The MLP is partly motivated to retain transformation-covariant features in the base network, which may be useful for downstream tasks, despite a training task that requires a transformation-invariant descriptor. Jing et al. [29] also find that the MLP insulates the trunk model from an embedding collapse into a lower-dimensional space caused by the InfoNCE loss. + +For SSCD, the training and inference tasks are the same, obviating the need for transformation-covariant features, and differential entropy regularization prevents the dimensional collapse. We replace the MLP with a simple linear projection to the target descriptor size, and retain this projection for inference. + +# 4.2. Data Augmentation + +Self-supervised contrastive objectives learn to match images across image transforms. These methods are sensitive to the augmentations seen at training time [10], since invariance to these transforms is the only supervisory signal. + +Table 1 lists the SSCD augmentations used in our experiments. Note that since our main evaluation dataset (DISC2021) is built in part with data augmentation, there is a risk of overfitting to the augmentations of that dataset. This is mitigated by (1) DISC2021's set of augmentations is not known precisely and (2) we present strong results trained using a simple blur augmentation. Our starting baseline is the default set of SimCLR augmentations. + +Strong blur. Empirically, copy detection benefits from a stronger blur than is typically used for contrastive learning. We strengthen the blur augmentation compared to SimCLR. We suggest that invariance to blur confers a low-frequency bias, reducing the model's sensitivity to high-frequency noise common to real world copies. We use this setting for most ablation steps, because it is easy to reproduce, and provides a good baseline setting for comparing methods. This augmentation was initially tuned on a proprietary dataset, and is unlikely to overfit to DISC2021. + +Advanced augmentations. We evaluate our method with additional augmentations, to demonstrate how SSCD extends as augmentations are added. Half of rotations rotate by multiples of 90 degrees and half are unconstrained. The text has a random font, text, opacity, font size, and color. We add emoji of random size. We apply JPEG compression with randomly sampled compression quality. These augmentations are somewhat inspired by DISC2021 but are still fairly generic for image copy detection problems. + +Mixed images. We use two augmentations that combine content from two images within a training batch. In a copy detection context, these augmentations model partial copies, where part of an image is included in a composite image. Mixup [61] is a pixelwise weighted average of two images $(a$ and $b)$ with parameter $\gamma \in [0,1]$ : $\gamma \cdot a + (1 - \gamma)\cdot b$ . CutMix [59] moves rectangular regions from one image into another. See Appendix D for implementation details. Mixed images match multiple images in the batch, requiring changes to our losses, outlined below. + +# 4.3. Loss Functions + +SSCD uses a weighted combination of the contrastive InfoNCE and the entropy loss, as in Equation (4). However, we need to adapt both losses for the mixed-image augmentation case, where $P_{i}$ may contain multiple matching images. + +InfoNCE with MixUp/CutMix augmentations. We adapt the InfoNCE loss (see Section 3.1) to accommodate augmentations that mix features from multiple images. Given an image $i$ with full or partial matches $j \in P_i$ , we modify the pairwise loss term from Equation (1) as: + +$$ +\hat {\ell} _ {i, j} = - \log \frac {\exp \left(s _ {i , j}\right)}{\exp \left(s _ {i , j}\right) + \sum_ {k \notin \hat {P} _ {i}} \exp \left(s _ {i , j}\right)}, \tag {5} +$$ + +where $\hat{P}_i = P_i\cup \{i\}$ . We then combine these terms by taking a mean per image, so that each image contributes similarly to the overall loss, and average per-image losses. Note that this is equivalent to InfoNCE for non-mixed images. + +$$ +\mathcal {L} _ {\text {I n f o N C E - m i x}} = \frac {1}{2 N} \sum_ {i = 1} ^ {2 N} \frac {1}{| P _ {i} |} \sum_ {j \in P _ {i}} \hat {\ell} _ {i, j}. \tag {6} +$$ + +Entropy loss. Our formulation of the entropy loss in Equation (3) remains the same, with $\hat{P}_i$ updated to include multiple matching images. + +Combination. The losses are combined with entropy weight parameter $\lambda$ : + +$$ +\mathcal {L} = \mathcal {L} _ {\text {I n f o N C E - m i x}} + \lambda \mathcal {L} _ {\mathrm {K o L e o}} \tag {7} +$$ + +Multi-GPU implementation. The contrastive matching task benefits from a large batch size, since this provides stronger negatives. Losses are evaluated over the global batch, after aggregating image descriptors across GPUs. Descriptors from all GPUs are included in the negatives InfoNCE matches against, and we choose nearest neighbors for entropy regularization from the global batch. Batch normalization statistics are synchronized across GPUs to avoid leaking information within a batch. We use the LARS [58] optimizer for stable training at large batch size. + +# 4.4. Inference and retrieval + +For inference, the loss terms are discarded. Features are extracted from the images using the convolutional trunk followed by GeM pooling, the linear projection head, and L2 normalization. Then we apply whitening to the descriptors. The whitening matrix is learned on the DISC2021 training set. The descriptors are compared with cosine similarity or equivalently with simple L2 distance. + +# 4.5. Similarity normalization + +We follow [18] using similarity normalization [12, 27] as one of our evaluation settings. It uses a background dataset of images as a noise distribution, and produces high similarity scores only for queries whose reference similarity is greater than their similarity to nearest neighbors in the background dataset. Given a query image $q$ and a reference image $r$ with similarity $s(q, r) = \mathrm{sim}(z_q, z_r)$ , the adjusted similarity is $\hat{s}_0(q, r) = s(q, r) - \beta s(q, b_n)$ where $b_n$ is the $n^{\text{th}}$ nearest neighbor from the background dataset, and $\beta \geq 0$ is a weight. + +We generalize this by aggregating an average similarity across multiple neighbors ( $n$ to $n_{\mathrm{end}}$ ) from the background dataset: + +$$ +\hat {s} (q, r) = s (q, r) - \underbrace {\frac {\beta}{1 + n _ {\mathrm {e n d}} - n} \sum_ {i = n} ^ {n _ {\mathrm {e n d}}} s (q , b _ {i})} _ {\mathrm {b i a s} (q)}. \tag {8} +$$ + +Integrated bias. Carrying around a bias term makes indexing of descriptors more complex. Therefore, we include the bias into the descriptors as an additional dimension: + +$$ +\hat {z} _ {q} = \left[ \begin{array}{l l} z _ {q} & - \operatorname {b i a s} (q) \end{array} \right] \quad \hat {z} _ {r} = \left[ \begin{array}{l l} z _ {r} & 1 \end{array} \right] \tag {9} +$$ + +Then we are back to $\hat{s}(q,r) = \mathrm{sim}(\hat{z}_q, \hat{z}_r)$ . The descriptors are not normalized, i.e. the dot product similarity is not equivalent to L2 distance. If L2 distance is preferred for indexing, it is possible to convert the max dot product search task into L2 search using the approach from [5]. + +Similarity normalization consistently improves metrics. However it adds operational complexity, and may make it difficult to detect content similar to the background distribution. Therefore, we report results both with and without this normalization. + +# 5. Experiments + +In this section we evaluate SSCD for image copy detection. Despite its relative simplicity, it depends on various settings that we evaluate in an extensive ablation study. + +# 5.1. Datasets + +DISC2021. Most evaluations are on the validation dataset of the Image Similarity Challenge, DISC2021 [18]. DISC2021 contains both automated image transforms and manual edits. There are 1 million reference images and 50,000 query images, of which 10,000 are true copies. A disjoint 1 million image training set is used for model training and as background dataset for score normalization. The training set contains no copies or labels, but is representative of the image distribution of the dataset. The performance is evaluated with micro average precision $(\mu AP)$ that measures the precision-recall tradeoff with a uniform distance threshold. + +ImageNet. For some experiments we train models on the ImageNet [41] training set (ignoring the class labels). We use ImageNet linear classification to measure how our copy detection methods affect semantic representation learning. + +Copydays [17] is a small copy detection dataset. Following common practice [7,9], we augment it with 10k distractors from YFCC100M [45], a setting known as CD10K, and evaluate the retrieval performance with mean average precision $(mAP)$ on the "strong" subset of robustly transformed copies. In addition to this standard measure, we evaluate the $\mu AP$ on the overall dataset. + +# 5.2. Training implementation + +We use the training schedule and hyperparameters from SimCLR [10]: batch size $N = 4096$ , resolution $224 \times 224$ , learning rate of $0.3 \times N / 256$ , and a weight decay of $10^{-6}$ . We train models for 100 epochs on either ImageNet or the DISC training set, using a cosine learning rate schedule without restarts and with a linear ramp-up. We use the LARS optimizer for stable training at large batch size. We train at spatial resolution $224 \times 224$ . + +We use a lower temperature than SimCLR, $\tau = 0.05$ versus 0.1, following an observation in [10] that this setting + +yields better accuracy on the training task, while reducing accuracy of downstream classification tasks. + +# 5.3. Evaluation protocol + +Inference. We resize the small edge of an image to size 288 preserving aspect ratio for fully convolutional models. We use a larger inference size than seen at training to avoid train-test discrepancy [50]. We use different preprocessing for the DINO [9] ViT baseline, following their copy detection method. See Appendix D for details. + +Descriptor postprocessing. Image retrieval benefits from PCA whitening. SSCD descriptors are whitened, then L2 normalized. For baseline methods that use CNN trunk features, we L2 normalize both before and after whitening. SimCLR projection features often occupy a low-dimensional subspace, making whitening at full descriptor size unstable, and many representations perform better when whitened with low-variance dimensions excluded. For baseline methods, we try dimensionalities $\{d,\frac{3}{4} d,\frac{d}{2},\frac{d}{4},\ldots \}$ and choose the one that maximizes the final accuracy. For SSCD, we whiten at full descriptor size. + +We use the FAISS [30] library to apply embedding postprocessing and perform exhaustive k-nearest neighbor search. We train PCA on the DISC2021 training dataset, following standard protocol for this dataset. + +# 5.4. Results + +
methodtrained ontransformsdimsμAPμAPSN
Multigrain [7, 18]ImageNet*150016.536.5
HOW [18,48]SfM-120k*17.337.2
Multigrain [7]ImageNet*204820.541.7
DINO [9]†ImageNet150032.253.8
SimCLR [10] trunkImageNetSimCLR204813.133.9
SimCLR [10] projImageNetSimCLR1289.417.3
SimCLRCD trunkImageNetstrong blur204839.856.8
SSCDImageNetstrong blur51250.464.5
SSCDImageNetadvanced51255.571.0
SSCDImageNetadv.+mixup51256.872.2
SSCDDISCstrong blur51254.863.6
SSCDDISCadvanced51260.471.1
SSCDDISCadv.+mixup51261.572.5
SSCDlarge†DISCadv.+mixup102463.775.3
+ +Table 2. Copy detection performance in $\mu AP$ on the DISC2021 dataset. *: methods that use supervised labels. †: trunk larger than ResNet50. DINO baseline uses ViT-B/16. + +DISC results. Table 2 reports DISC2021 results from the baseline methods published in [18] and SSCD. Our evaluation protocol obtains somewhat stronger results for the Multigrain baseline ( $3^{\text{rd}}$ row). The first observation is that SSCD improves the baseline accuracy by $2 \times$ to $5 \times$ before + +score normalization, demonstrating that copy detection benefits from specific architectural and training adaptations. + +We present results on a few different SSCD models trained on ImageNet or DISC2021, using the three augmentation settings we propose. The intermediate model $\mathrm{SimCLR}_{\mathrm{CD}}$ has all of our proposed changes except the entropy loss. $\mathrm{SSCD}_{\mathrm{large}}$ model uses a larger descriptor size and a ResNeXt-101 trunk. + +We evaluate SimCLR using both trunk and projected features, and find trunk features $(\mu AP = 13.1)$ to outperform features from the projection head $(\mu AP = 9.4)$ with and without score normalization. Further experiments (Appendix A) show the reverse when training with entropy loss: projected features have similar accuracy to trunk features, despite a much more compact representation. + +The gain of $\mathrm{SimCLR}_{\mathrm{CD}}$ ( $\mu AP = 39.8$ without score normalization) over SimCLR (13.1) is decomposed in Section 5.5. Introducing the entropy loss in SSCD contributes an additional $10\%$ absolute of $\mu AP$ , which is further increased by stronger augmentations $(+6.2\%)$ and training on a dataset with less domain shift $(+4.7\%)$ . These findings are confirmed after score normalization. + +Copydays results. Table 3 reports results for baseline methods using publicly released models, but omit Multigrain settings that we were unable to reproduce. We used published preprocessing settings for baselines and whitening. Our DINO results outperform published results. + +
modeltrunkdimssize\( {mAP} \)\( {\mu AP} \)
Multigrain [7]ResNet501500long 80082.377.3
DINO [9]ViT-B/161536\( {224}^{2} \)82.892.3
DINO [9]ViT-B/81536\( {320}^{2} \)86.188.4
SSCDResNet50512short 28886.698.1
\( {\mathrm{{SSCD}}}_{\text{large }} \)ResNeXt1011024long 80093.697.1
+ +The first SSCD result is with all settings from our DISC2021 experiments, where we resize the short side of each image to 288 pixels. With no tuning on this dataset, our method outperforms published results. We also show results for $\mathrm{SSCD}_{\mathrm{large}}$ using a ResNeXt101 trunk and 1024 descriptor dimensions, at larger inference size. We report more results on CD10K in Appendix B. + +In addition to state-of-the-art accuracy using the customary $mAP$ ranking metric, our method provides a significant improvement in the global $\mu AP$ metric, indicating better distance calibration. On high-resolution images that are common for image retrieval, we observe improved $mAP$ but degraded $\mu AP$ . SSCD descriptors are more compact than baselines. + +# 5.5. Ablations + +Comparison with SimCLR. We provide a stepwise comparison between SimCLR and our method in Table 4. SimCLR projection features are not particularly strong for this task until we apply several of our adaptations. SimCLR is unable to exploit a $\mathbb{R}^{512}$ descriptor, only slightly outperforming its $\mathbb{R}^{128}$ setting. $\mathrm{SimCLR}_{\mathrm{CD}}$ represents our architectural and hyper-parameter changes before adding differential entropy representation. Differential entropy regularization alone adds $+17.4\%$ $\mu AP$ and $+12.9\%$ $\mu AP_{SN}$ , more than any other step. + +Table 3. Copydays (CD10K) accuracy measured in mAP on the "strong" subset, and $\mu AP$ on the full dataset. + +
nameScore normalization:NoYes
methoddimsμAP256dμAPSN256d
SimCLRtrunk features204813.17.333.926.8
+ GeM pooling204821.512.145.335.8
SimCLRprojection1289.49.417.317.3
+ GeM pooling12811.111.118.818.8
+ strong blur12814.114.126.026.0
+ low temp12826.026.041.541.5
+ 512d proj51227.527.543.543.5
SimCLRCD+ linear proj51233.032.451.650.5
SSCD+ entropy loss51250.444.064.557.8
SSCD+ adv. augs51255.549.771.065.8
SSCD+ mixup51256.851.172.267.1
+ +Entropy weight. Table 5 compares how varying entropy loss weight $(\lambda)$ affects copy detection accuracy, using $\mathrm{SimCLR}_{\mathrm{CD}}$ as a baseline. Models for this experiment are trained using the strong blur augmentation setting. + +Table 4. Ablation from SimCLR to our method, showing DISC2021 $\mu AP$ performance for models trained on ImageNet. To compare descriptors of different sizes, we also show metrics after PCA reduction to 256 dimensions. + +
modelμAPμAPSNrecall@1MRR
SimCLRCD33.051.658.660.5
λ = 133.151.958.760.9
λ = 338.056.162.965.1
λ = 1045.361.567.769.5
λ = 3050.464.569.871.4
+ +Table 5. DISC2021 accuracy metrics with varying entropy weight $\lambda$ for models trained on ImageNet. + +As the entropy weight increases, we see a corresponding increase in global accuracy metrics. We also see a similar increase in per-query ranking metrics, such as recall at 1 and mean reciprocal rank (MRR). The increase in ranking metrics demonstrates that differential entropy regularization improves copy detection accuracy in general, beyond creating a more uniform notion of distance. + +In contrast to metric learning contexts where entropy regularization has been used, copy detection benefits from higher $\lambda$ values. Our standard setting is $\lambda = 30$ , while [19] reports reduced accuracy with $\lambda > 1$ , and [42] uses values $< 0.1$ . At $\lambda > 40$ , training becomes unstable, and tends to minimize the entropy loss at the expense of the InfoNCE loss: embeddings are uniformly distributed, but meaningless because image copies are not near anymore. + +Additional ablations. We explore how batch size, training schedule, descriptor dimensions, and score normalization affect accuracy in Appendix A. + +# 6. Discussion + +Dimensional collapse. We find, similar to [29, 60], that SimCLR collapses to a subspace of approximately 256 dimensions when trained in 512 dimensions. Table 4 shows that SimCLR's accuracy does not improve much when the descriptor size increases from 128 to 512 dimensions. SSCD's entropy regularization resolves this collapse, and allows the model to use the full descriptor space. + +Entropy regularization and whitening. SSCD is much more accurate than baselines when compared without whitening or similarity normalization: $47.8\mu AP$ for $\lambda = 30$ when trained on ImageNet, versus 26.8 for an equivalent $\lambda = 0$ model. Both the entropy loss and post-training PCA whitening aim at creating a more uniform descriptor distribution. However PCA whitening can distort the descriptor space learned during training, particularly when many dimensions have trivial variance. Differential entropy regularization promotes an approximately uniform space, allowing the model to adapt to an approximately whitened descriptor during training, reducing the distortion whitening induces. + +Uniform distribution as a perceptual prior. For most experiments in this work we focus on the $\mu AP$ metric that requires a separation between matches and non-matches at a fixed threshold. However Table 5 shows that ranking metrics also improve with increased the entropy loss weight, i.e. better calibration across queries does not fully explain the benefit of entropy regularization. + +Differential entropy regularization acts as a kind of prior, selecting for an embedding space that is uniformly distributed. We argue that, when applied to contrastive learning, this regularization is a perceptual prior, selecting for stronger copy detection representations. An ideal copy detection descriptor would map copies of the same image together, while keeping even semantically similar (same "class") images far apart i.e. the descriptor distribution is uniform. This differs from the ideal properties of a representation for transfer learning to classification, where images depicting the same class should be nearby (a dense region) and well separated other classes (a sparse region between classes). + +Visual results. Figure 2 shows a few retrieval results, where SSCD outperforms the vanilla SimCLR. The two first examples demonstrate the impact of more appropriate data augmentation at training time: SSCD ignores text overlays and blur/color balance. The two last examples show that SimCLR falls back on low-level texture matching (grass) when SSCD correctly recovers the source image. + +Limitations. Our method is explicitly text-insensitive when training with text augmentation, and we find that it is somewhat text-insensitive even when trained without text augmentation. For this reason, SSCD is not precise when matching images composed entirely of text. Different photos of the same scene (e.g. of landmarks) may be identified as copies, even if the photos are distinct. Sometimes, images are combined to create a composite image or collage, where the copied content may occupy only a small region of the composite image. "Partial" copies of this kind are hard to detect with global descriptor models like SSCD, and local descriptor methods may be necessary in this case. Finally, matching at high precision often requires an additional verification step. + +Ethical considerations. We focus our investigation on the DISC2021 dataset, which is thoughtful in its approach to images of people, using only identifiable photos of paid actors who gave consent for their images to be used for research. Copy detection for content moderation is adversarial. There is a risk that publishing research for this problem will better inform actors aiming to evade detection. We believe that this is offset by the improvements that open research will bring. + +This technology allows scaling manual moderation, which helps protect users from harmful content. However, it can also be used for e.g. political censorship. We still believe that advancing this technology is a net benefit. + +# 7. Conclusion + +We presented a method to train effective image copy detection models. We have demonstrated architecture and objective changes to adapt contrastive learning to copy detection. We show that the differential entropy regularization dramatically improves copy detection accuracy, promoting consistent separation of image descriptors. + +Our method demonstrates strong results on DISC2021, significantly surpassing baselines, and transfers to Copydays, yielding state-of-the-art results. Our method is efficient because it relies on a standard trunk, uses smaller inference sizes than are typical for image retrieval, and produces a compact descriptor. Additionally, its calibrated distance metric limits candidates for verification. We believe that these results demonstrate a unique compatibility between uniform embedding distributions and the task of copy detection. + +# References + +[1] Social media sites photo metadata test results 2019. https://iptc.org/standards/photo-metadata/social-media-sites-photo-metadata-test-results-2019/. Accessed: 2020-10-20. 2 +[2] Hunt Allcott, Matthew Gentzkow, and Chuan Yu. Trends in the diffusion of misinformation on social media. Research & Politics, 6(2):2053168019848554, 2019. 1 +[3] J Aythora, R Burke-Aguiero, A Chamayou, S Clebsch, M Costa, J Deutscher, N Earnshaw, L Ellis, P England, C Fournet, et al. Multi-stakeholder media provenance management to counter synthetic media risks in news publishing. In Proc. Intl. Broadcasting Convention (IBC), volume 1, page 8, 2020. 2 +[4] Artem Babenko, Anton Slesarev, Alexandr Chigorin, and Victor Lempitsky. Neural codes for image retrieval. In Proc. ECCV, pages 584-599. Springer, 2014. 2 +[5] Yoram Bachrach, Yehuda Finkelstein, Ran Gilad-Bachrach, Liran Katzir, Noam Koenigstein, Nir Nice, and Ulrich Paquet. Speeding up the xbox recommender system using a euclidean transformation for inner-product spaces. In Proceedings of the 8th ACM Conference on Recommender Systems, pages 257-264, 2014. 6 +[6] Jan Beirlant, E J. Dudewicz, L Gyor, and E.C. Meulen. Nonparametric entropy estimation: An overview. International Journal of Mathematical and Statistical Sciences, 6, 1997. 3 +[7] Maxim Berman, Hervé Jégou, Andrea Vedaldi, Iasonas Kokkinos, and Matthijs Douze. Multigrain: a unified image embedding for classes and instances. arXiv preprint arXiv:1902.05509, 2019. 2, 4, 6, 7, 13 +[8] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020. 3 +[9] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the International Conference on Computer Vision (ICCV), 2021. 6, 7, 13 +[10] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Proc. ICML, pages 1597-1607. PMLR, 2020. 3, 4, 6 +[11] Ondrej Chum, James Philbin, Josef Sivic, Michael Isard, and Andrew Zisserman. Total recall: Automatic query expansion with a generative feature model for object retrieval. In Proc. ICCV, 2007. 2 +[12] Alexis Conneau, Guillaume Lample, Marc'Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. Word translation without parallel data. arXiv preprint arXiv:1710.04087, 2017. 5 +[13] Ingemar Cox, Matthew Miller, Jeffrey Bloom, Jessica Fridrich, and Ton Kalker. Digital watermarking and steganography. Morgan Kaufmann, 2007. 2 +[14] Zanoni Dias, Siome Goldenstein, and Anderson Rocha. Large-scale image phylogeny: Tracing image ancestral relationships. *IEEE Multimedia*, 20(3):58-70, 2013. 2 + +[15] Zanoni Dias, Anderson Rocha, and Siome Goldenstein. Image phylogeny by minimal spanning trees. IEEE Transactions on Information Forensics and Security, 7(2):774-788, 2011. 2 +[16] Jing Dong, Wei Wang, and Tieniu Tan. Casia image tampering detection evaluation database. In 2013 IEEE China Summit and International Conference on Signal and Information Processing, pages 422-426. IEEE, 2013. 2 +[17] Matthijs Douze, Hervé Jégou, Harsimrat Sandhawalia, Laurent Amsaleg, and Cordelia Schmid. Evaluation of gist descriptors for web-scale image search. In Proc. CIVR, 2009. 2, 6 +[18] Matthijs Douze, Giorgos Tolias, Ed Pizzi, Zoë Papakipos, Lowik Chanussot, Filip Radenovic, Tomas Jenicek, Maxim Maximov, Laura Leal-Taixe, Ismail Elezi, et al. The 2021 image similarity dataset and challenge. arXiv preprint arXiv:2106.09672, 2021. 2, 5, 6 +[19] Alaaeldin El-Nouby, Natalia Neverova, Ivan Laptev, and Hervé Jégou. Training vision transformers for image retrieval. arXiv:2102.05644, 2021. 3, 8 +[20] Yunchao Gong, Liwei Wang, Ruiqi Guo, and Svetlana Lazebnik. Multi-scale orderless pooling of deep convolutional activation features. In Proc. ECCV, 2014. 2 +[21] Albert Gordo, Jon Almazán, Jérôme Revaud, and Diane Larlus. Deep image retrieval: Learning global representations for image search. In Proc. ECCV, 2016. 2 +[22] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. 3 +[23] Ruiqi Guo, Philip Sun, Erik Lindgren, Quan Geng, David Simcha, Felix Chern, and Sanjiv Kumar. Accelerating large-scale inference with anisotropic vector quantization. In International Conference on Machine Learning, pages 3887-3896. PMLR, 2020. 1 +[24] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proc. CVPR, pages 9729-9738, 2020. 3 +[25] Hervé Jégou and Ondrej Chum. Negative evidences and co-occurrences in image retrieval: The benefit of pca and whiten-ing. In Proc. ECCV, pages 774–787. Springer, 2012. 2 +[26] Herve Jegou, Matthijs Douze, and Cordelia Schmid. Hamming embedding and weak geometric consistency for large scale image search. In Proc. ECCV. Springer, 2008. 2 +[27] Hervé Jégou, Matthijs Douze, and Cordelia Schmid. Exploiting descriptor distances for precise image search. Technical report, INRIA, 2011. 2, 5 +[28] Amornched Jinda-Apiraksa, Vassilios Vonikakis, and Stefan Winkler. California-nd: An annotated dataset for near-duplicate detection in personal photo collections. In 2013 Fifth International Workshop on Quality of Multimedia Experience (QoMEX), pages 142-147. IEEE, 2013. 2 +[29] Li Jing, Pascal Vincent, Yann LeCun, and Yuandong Tian. Understanding dimensional collapse in contrastive self-supervised learning. arXiv:2110.09348, 2021. 2, 4, 8, 13 + +[30] Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billionscale similarity search with gpus. arXiv, 2017. 1, 6 +[31] Douwe Kiela, Hamed Firooz, Aravind Mohan, Vedanuj Goswami, Amanpreet Singh, Pratik Ringshia, and Davide Testuggine. The hateful memes challenge: Detecting hate speech in multimodal memes. arXiv preprint arXiv:2005.04790, 2020. 1 +[32] Xiyang Luo, Ruohan Zhan, Huiwen Chang, Feng Yang, and Peyman Milanfar. Distortion agnostic deep watermarking. In CVPR, 2020. 2 +[33] Daniel Moreira, Aparna Bharati, Joel Brogan, Allan Pinto, Michael Parowski, Kevin W Bowyer, Patrick J Flynn, Anderson Rocha, and Walter J Scheirer. Image provenance analysis at scale. IEEE Transactions on Image Processing, 27(12):6109-6123, 2018. 2 +[34] Eric Nguyen, Tu Bui, Viswanathan Swaminathan, and John Collomosse. Oscar-net: Object-centric scene graph attention for image attribution. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14499-14508, 2021. 2 +[35] David Nister and Henrik Stewenius. Scalable recognition with a vocabulary tree. In Proc. CVPR, 2006. 2 +[36] Nam Thanh Pham, Jong-Weon Lee, Goo-Rak Kwon, and Chun-Su Park. Hybrid image-retrieval method for imagesplicing validation. Symmetry, 11(1):83, 2019. 2 +[37] Filip Radenovic, Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Revisiting oxford and paris: Large-scale image retrieval benchmarking. In Proc. CVPR, 2018. 2 +[38] Filip Radenovic, Giorgos Tolias, and Ondrej Chum. CNN image retrieval learns from BoW: Unsupervised fine-tuning with hard examples. In Proc. ECCV, 2016. 2 +[39] Filip Radenovic, Giorgos Tolias, and Ondrej Chum. Finetuning cnn image retrieval with no human annotation. IEEE transactions on pattern analysis and machine intelligence, 41(7):1655-1668, 2018. 2, 4 +[40] Eric Robertson, Haiying Guan, Mark Kozak, Yooyoung Lee, Amy N Yates, Andrew Delgado, Daniel Zhou, Timothee Kheyrkhah, Jeff Smith, and Jonathan Fiscus. Manipulation data collection and annotation tool for media forensics. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 29-37, 2019. 2 +[41] 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, 2015. 6 +[42] Alexandre Sablayrolles, Matthijs Douze, Cordelia Schmid, and Hervé Jégou. Spreading vectors for similarity search. 2019. 1, 3, 8 +[43] Josef Sivic and Andrew Zisserman. Video google: A text retrieval approach to object matching in videos. In null, page 1470. IEEE, 2003. 2 +[44] NIST MediFor Team. Nimble challenge 2017 evaluation plan, 2017. 2 + +[45] Bart Thomee, David A. Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. Yfcc100m: the new data in multimedia research. Commun. ACM, 59:64-73, 2016. 6 +[46] Giorgos Tolias, Yannis Avrithis, and Hervé Jégou. To aggregate or not to aggregate: Selective match kernels for image search. In Proc. ICCV, 2013. 2 +[47] Giorgos Tolias, Yannis Avrithis, and Hervé Jégou. Image search with selective match kernels: aggregation across single and multiple images. *IJCV*, 116(3):247-261, 2016. 2 +[48] Giorgos Tolias, Tomas Jenicek, and Ondrej Chum. Learning and aggregating deep local descriptors for instance-level recognition. In Proc. ECCV, pages 460-477. Springer, 2020. 2, 6 +[49] Giorgos Tolias, Ronan Sicre, and Hervé Jégou. Particular object retrieval with integral max-pooling of cnn activations. In Proc. ICLR, pages 1-12, 2016. 2, 4 +[50] Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Hervé Jégou. Fixing the train-test resolution discrepancy. arXiv preprint arXiv:1906.06423, 2019. 6 +[51] Matthieu Urvoy, Dalila Goudia, and Florent Autrusseau. Perceptual dft watermarking with improved detection and robustness to geometrical distortions. IEEE Transactions on Information Forensics and Security, 2014. 2 +[52] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv:1807.03748, 2018. 3 +[53] Shuang Wang and Shuqiang Jiang. Instre: a new benchmark for instance-level object retrieval and recognition. ACM Transactions on Multimedia Computing, Communications, and Applications, 11(3):37, 2015. 2 +[54] Bihan Wen, Ye Zhu, Ramanathan Subramanian, Tian-Tsong Ng, Xuanjing Shen, and Stefan Winkler. Coverage—a novel database for copy-move forgery detection. In 2016 IEEE international conference on image processing (ICIP), pages 161-165. IEEE, 2016. 2 +[55] Ross Wightman, Hugo Touvron, and Hervé Jégou. Resnet strikes back: An improved training procedure in timm, 2021. 4 +[56] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3733-3742, 2018. 3 +[57] Amy N Yates, Haiying Guan, Yooyoung Lee, Andrew P Delgado, Daniel F Zhou, Jonathan G Fiscus, et al. Nimble challenge 2017 evaluation data and tool. 2017. 2 +[58] Yang You, Igor Gitman, and Boris Ginsburg. Large batch training of convolutional networks. arXiv:1708.03888, 2017. 5 +[59] 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. 5 +[60] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. In Proc. ICML, volume 139, pages 12310-12320. PMLR, 2021. 8, 13 + +[61] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In Proc. ICLR, 2018. 5 +[62] Peng Zhou, Xintong Han, Vlad I Morariu, and Larry S Davis. Learning rich features for image manipulation detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1053-1061, 2018. 2 +[63] Jiren Zhu, Russell Kaplan, Justin Johnson, and Li Fei-Fei. Hidden: Hiding data with deep networks. In ECCV, 2018. 2 \ No newline at end of file diff --git a/aselfsuperviseddescriptorforimagecopydetection/images.zip b/aselfsuperviseddescriptorforimagecopydetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..494189571f333f953d8709911fd4228969768074 --- /dev/null +++ b/aselfsuperviseddescriptorforimagecopydetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79eeb49904097f6254ffbdfdb717a9cd7b01d23512ea975f52eeba1ae84f4944 +size 411526 diff --git a/aselfsuperviseddescriptorforimagecopydetection/layout.json b/aselfsuperviseddescriptorforimagecopydetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3a0d4c7b651e665a80e1aa754b8a1b543f592d22 --- /dev/null +++ b/aselfsuperviseddescriptorforimagecopydetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09e0ee8d2d1a54b7b89f1f8d0cf822581e874ea147712f3a72ce850275e29f82 +size 417583 diff --git a/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_content_list.json b/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..408b00c95ce769d711476a5fb5296333ac88e6d1 --- /dev/null +++ b/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e8ad55057dc54ab439472766b25ce7668ac7e8351de2b3140d2c281326150b9 +size 81467 diff --git a/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_model.json b/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5d4ecfa57fe4acc76f6f781d70bc20f2dd691abb --- /dev/null +++ b/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95c15572acff72caa3ad9ab8985c8d1ca17f93bbf738aa7f2755c92e7843a784 +size 99464 diff --git a/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_origin.pdf b/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3df04e7d81eaaccbd6692a8f5b09010082fbd86b --- /dev/null +++ b/asimpledatamixingpriorforimprovingselfsupervisedlearning/aae1e39c-c22f-4170-b004-0e83ac52669d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74090dd2556f879c783af85f63562eea4e1727b2179985f5722d3b2b6b0900b3 +size 1164052 diff --git a/asimpledatamixingpriorforimprovingselfsupervisedlearning/full.md b/asimpledatamixingpriorforimprovingselfsupervisedlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4a026bd24ca34a55051803395ac14a3b563ac510 --- /dev/null +++ b/asimpledatamixingpriorforimprovingselfsupervisedlearning/full.md @@ -0,0 +1,341 @@ +# A Simple Data Mixing Prior for Improving Self-Supervised Learning + +Sucheng Ren $^{1}$ Huiyu Wang $^{2}$ Zhengqi Gao $^{3}$ Shengfeng He $^{1*}$ Alan Yuille $^{2}$ Yuyin Zhou $^{4}$ Cihang Xie $^{4*}$ + +$^{1}$ South China University of Technology $^{2}$ Johns Hopkins University $^{3}$ Massachusetts Institute of Technology $^{4}$ UC Santa Cruz + +# Abstract + +Data mixing (e.g., Mixup, Cutmix, ResizeMix) is an essential component for advancing recognition models. In this paper, we focus on studying its effectiveness in the self-supervised setting. By noticing the mixed images that share the same source images are intrinsically related to each other, we hereby propose SDMP, short for Simple Data Mixing Prior, to capture this straightforward yet essential prior, and position such mixed images as additional positive pairs to facilitate self-supervised representation learning. + +Our experiments verify that the proposed SDMP enables data mixing to help a set of self-supervised learning frameworks (e.g., MoCo) achieve better accuracy and out-of-distribution robustness. More notably, our SDMP is the first method that successfully leverages data mixing to improve (rather than hurt) the performance of Vision Transformers in the self-supervised setting. Code is publicly available at https://github.com/OliverRensu/SDMP. + +# 1. Introduction + +Data mixing is one of the key ingredients for improving recognition models. The concept of data mixing is firstly introduced in Mixup [47], which trains models on convex combinations of pairs of images and their labels. This idea subsequently inspires several follow-ups, including mixing images and cropped patches [45], mixing images and thumbnails [44], and mixing among cropped patches [4,38]. + +However, interestingly, data mixing plays little role in the recent surge of self-supervised learning. For instance, while naively replacing original images with their mixed counterparts substantially improves Vision Transformers (ViTs) in the supervised setting [39], it cannot improve ViTs under the self-supervised setting. Though many efforts [27, 31, 42] have been made recently by developing more sophisticated training strategies in data mixing, they + +![](images/e17debed3a88b40ed1f36c28a8f6c8ad3d289290f87e994b853fc130f4212a75.jpg) +Figure 1. For the mixed images that share the same source (e.g., a cat image and a dog image), they are semantically related and can be treated as additional positive pairs in self-supervised learning. + +are exclusively focusing on Convolutional Neural Networks (CNNs). As shown in Table 1 in Section 4, all these methods still fail to help (or even hurt) ViTs [16]. + +In this paper, we aim to develop a generic training strategy in data mixing that can improve the self-supervised representation learning of both CNNs and ViTs. By taking a closer look at the popular data mixing implementation where an image is mixed with another image that sampled from the same batch but with the flipped order $^1$ , we observe such created mixed samples are inherently related in pairs (e.g., an example is provided in Figure 1). This indicates that, now for one mixed image, there exist three related samples (i.e., a pair of source images and a mixed image created with a different mixing parameter) in the same training batch. This intrinsic relationship qualifies the pair of mixed images to be treated as additional positive samples in self-supervised learning to facilitate representation learning. + +Motivated by the observation above, we hereby propose to leverage this Simple Data Mixing Prior (dubbed SDMP) to holistically model the relationship among samples for enhancing self-supervised learning. Different from previous methods [27, 31, 32, 36, 42], SDMP not only considers the relationships between source images and the mixed counterparts, but also encodes the connections between mixed samples in representation learning. We further enhance SDMP's representation learning by semantically weighting the loss to accurately capture the relationships among samples. + +Our empirical results verify that the proposed SDMP successfully helps a set of self-supervised learning frameworks gain better accuracy on different visual benchmarks and robustness on out-of-distribution samples, using both CNNs and ViTs. More essentially, we would like to highlight that our SDMP is the first strategy that enables data mixing to improve self-supervised ViTs. For example, by building upon the latest MoCo v3 [11], while existing training strategies [27, 31, 42] all hurt the top-1 ImageNet accuracy of ViT-S by $0.2\% - 1.6\%$ , SDMP successfully improves the top-1 ImageNet accuracy of ViT-S by $0.6\%$ . We hope the technical insights and results provided in this work will be helpful for future works on studying data mixing in self-supervised learning. + +# 2. Related Work + +Self-supervised learning. Self-supervised learning aims to let models acquire semantically meaningful representations without human annotations. Traditional pretext tasks include reconstruction by autoencoder [3], colorization [48], rotation prediction [17] or combination of them [15,34]. + +Contrastive learning, which aims to discriminate different views and samples, is one of the most successful pretext tasks. Its basic idea is to maximize the similarity of positive pairs and to minimize the similarity of negative pairs. However, discrimination based methods generally require a large amount of negative pairs, e.g., SimCLR [8] takes a large training batch, MoCo [9, 21] requires a memory bank, and others [1, 5, 46] take a grouping or clustering. Later works [7, 10, 19] successfully remove the need for negative samples, enabling small batch training in self-supervised learning. In this work, we focus on improving self-supervised learning, using data mixing. + +Data mixing. Mixup [47] is the first work on data mixing, which convexly combines data pairs and their corresponding labels to regularize network training, inspiring numerous followups, including Cutout [14], CutMix [45], SaliencyMix [40] and PuzzleMix [28]. + +Recent works begin to introduce data mixing into self-supervised learning. Verma et al. [42] utilize Mixup to create similar and dissimilar examples by mixing data samples differently, either at the input or hidden-state levels. [29, 31] + +explore the semi-contrastive encoding with mixup of negative and positive pairs. Unlike previous works which focus on CNNs, we are the first to explore data mixing for improving ViTs under the self-supervised setting. We additionally point out that properly modeling the relationships among intra-batch mixed data (which was largely overlooked) is essential for strengthening self-supervised learning. + +Transformers. Transformer [13, 41] is the de-facto standard for natural language processing tasks. Recently, Dosovitskiy et al. [16] successfully introduce the pure Transformer architecture for computer vision, attaining competitive visual recognition performance compared to CNNs on a range of benchmarks. Nonetheless, the original ViT training framework strongly demands hundreds of millions of external (in-house) images [37] in training. Touvron et al. [39] relax this learning constraint by incorporating a set of strong regularization techniques into ViT training framework, where data mixing plays a vital role. In this work, we are particularly interested in exploring whether data mixing can improve ViT under the self-supervised setting. + +# 3. Method + +# 3.1. Which Images For Mixing? + +Traditionally, data mixing generates mixed data by mixing two randomly sampled images (usually drawn from two different min-batches). While in this work, we follow the strategy of the widely used Python Deep Learning Package timm [43]—we mix the $i$ -th image with another randomly selected $j$ -th image that comes from the same batch. We by default set $j$ to $n-i$ where $n$ is the number of images in this batch, for facilitating implementation. We call this mixing strategy as intra-batch mixing. Specifically, this intra-batch mixing strategy enables the mixed images now are related in pairs (as they share the same source images, see an example in Figure 1), which will facilitate the virtual label assignment introduced in Section 3.3. + +# 3.2. How To Mix? + +To mix images, we mainly consider an element-wise data mixing method, Mixup [47], and two regional data mixing methods, i.e., CutMix [45] and ResizeMix [35]. + +Mixup. Mixup element-wisely mix two sample while preserving the whole source data. Specifically, Mixup takes the weight $\lambda_{i}$ following a Beta distribution $\mathrm{Beta}(\alpha ,\alpha)$ and mixes the data as the following: + +$$ +\begin{array}{l} \begin{array}{l} x _ {i} ^ {\text {m i x}} = \lambda_ {i} x _ {i} + (1 - \lambda_ {i}) x _ {n - i}, \\ \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \quad \dots \quad \text {m i x} \end{array} \tag {1} \\ x _ {i} ^ {\prime \mathrm {m i x}} = \lambda_ {i} x _ {i} ^ {\prime} + (1 - \lambda_ {i}) x _ {n - i} ^ {\prime}, \\ \end{array} +$$ + +where $x_{i}$ and $x_{n - i}$ indicate the $i$ -th and the $(n - i)$ -th image. $x_{i}'$ and $x_{n - i}'$ are another view of the source images $x_{i}$ and $x_{n - i}$ , created by data augmentation (e.g., color jittering). + +Algorithm 1 Loss computation of our SDMP +Figure 2. Left panel: The positive pairs considered in self-supervised learning, i.e., the pair of different views (denoted as naive), the pair of the source image and the mixed image (denoted as source positive) and the pair of the mixed images (denoted as intra batch positive). Right panel: the pseudo code of the SDMP in PyTorch. +![](images/46ab2f68704a6e4a01c56f1d73975488b88f7b7639243f3fd5f7e57af7b3a1aa.jpg) +a, b = aug(x), aug(x) # two different views of input x +lam = Beta(alpha, alpha).sample() # mixing coefficient +a = mix(a, a.flip(), lam) +a = normalize(model(a)) +x_one_hot = one_hot(arange(len(x))) +logits1 = matmul(a, normalize(model(b)).T) / t +label1 = lam * x_one_hot + (1-lam) * x_one_hot.flip() +loss1 = CrossEntropyLoss(logits1, label1) +clam = min(lam, 1-lam.flip()) + min(1-lam, lam.flip()) +logits2 = matmul(a, normalize(model(mix(b, b.flip(), lam))).T) / t +label2 = 1/(1+clam) * x_one_hot + clam/(1+clam) * x_one_hot.flip() +loss2 = CrossEntropyLoss(logits2, label2) +loss = loss1 + loss2 + +CutMix. Different from Mixup, CutMix [45] mixes data regionally by cropping and pasting a specific patch from one image to another, i.e., the mixed data comes from one whole image and a local region of another image. Note that both Mixup and CutMix by default are included in Transformer's training recipe [39] under the supervised training setting. + +ResizeMix. For CutMix, the cropped patch and the image itself could be label-irrelevant, e.g., the background of the source image is selected. To accurately match the semantics of the patch and the source data, ResizeMix [35] proposes to take the resized source image as the patch, as the following: + +$$ +\begin{array}{l} P _ {i} = R \left(x _ {i}, H _ {i} ^ {p}, W _ {i} ^ {p}\right) \quad P _ {i} ^ {\prime} = R \left(x _ {i} ^ {\prime}, H _ {i} ^ {p}, W _ {i} ^ {p}\right), \\ x _ {i} ^ {\text {m i x}} = \operatorname {P a s t e} \left(P _ {n - i}, x _ {i}\right), \\ x _ {i} ^ {\prime \text {m i x}} = \operatorname {P a t e} \left(P _ {n - i} ^ {\prime}, x _ {i} ^ {\prime}\right), \tag {2} \\ \lambda_ {i} = 1 - \frac {W _ {n - i} ^ {p} * H _ {n - i} ^ {p}}{W _ {i} * H _ {i}} \\ \end{array} +$$ + +where $R(\cdot, h, w)$ indicate the resize function applied with the size of height $h$ and width $w$ . $\operatorname{Paste}(P, x)$ indicates pasting the patch $P$ onto a random region of the image $x$ . $H_i, W_i$ indicate the height and the width of the $i$ -th image; $H_i^p, W_i^p$ are randomly sampled patch height and patch width for the $i$ -th image. + +# 3.3. What is the label in self-supervised learning? + +Given true labels are not available in self-supervised learning, we next show how to assign virtual labels accordingly. We provide two case studies of assigning virtual labels in popular self-supervised learning frameworks. + +Case 1: contrastive learning. Contrastive learning positions self-supervised learning as an instance classification + +task, assigning only one positive label to the positive pair and setting all the rest samples as negative. However, such assumption will confuse models, especially when the training batch is large and contain multiple samples from the same or the similar category. + +Our SDMP explicitly relaxes this assumption by introducing extra positive pairs. Specifically, we propose to assign the virtual positive labels to all the positive pairs, including 1) the source data and the mixed counterparts; and 2) the pair of mixed data that comes from the same source data. This label assignment enforces the model to learn to minimize the distance between more than just one pair. + +More concretely, firstly, to model the relationship between the source data and the mixed counterpart, the mix data $x_{i}^{m}$ and the other view of the source images $x_{i}^{\prime}$ and $x_{n - i}^{\prime}$ (obtained via augmentation) will be feed into the the encoder $f$ and the momentum encoder $f_{k}$ , respectively, as the "query" and the "key". Therefore, the first part of our data mixing contrastive loss, learning from source data, is: + +$$ +\begin{array}{l} y _ {i} ^ {m} = f (x _ {i} ^ {m}) \quad y _ {i} ^ {\prime} = f _ {k} (x _ {i} ^ {\prime}) \quad y _ {n - i} ^ {\prime} = f _ {k} (x _ {n - i} ^ {\prime}) \\ \mathcal {L} _ {\mathrm {M o C o}} ^ {\mathrm {s}} = - \lambda_ {i} \log \frac {\exp \left(< y _ {i} ^ {m} , y _ {i} ^ {\prime} > / \tau\right)}{\sum_ {j = 0} ^ {n} \exp \left(< y _ {i} ^ {m} , y _ {j} ^ {\prime} > / \tau\right)} \tag {3} \\ - \left(1 - \lambda_ {i}\right) \log \frac {\exp \left(< y _ {i} ^ {m} , y _ {n - i} ^ {\prime} > / \tau\right)}{\sum_ {j = 0} ^ {n} \exp \left(< y _ {i} ^ {m} , y _ {j} ^ {\prime} > / \tau\right)}, \\ \end{array} +$$ + +where $\tau$ is the temperature to normalize the output $y$ . + +As mentioned in Section 3.1, we follow the intra-batch mixing strategy of timm [43] to mix one batch of data and its reversed-order version accordingly. Therefore such mixed images are related in pairs (e.g., $x_{i}^{m}$ and $x_{n - i}^{m}$ ) as they share the same source data. Moreover, by considering data aug- + +mentation, we now have $x_{i}^{m}, x_{i}^{\prime m}$ and $x_{n - i}^{\prime m}$ , which share the same source image $x_{i}$ and $x_{n - i}$ , as the positive samples. The second part of our data mixing MoCo loss, which aims to from intra-batch mixing data, should be written as: + +$$ +\begin{array}{l} \lambda_ {i} ^ {c} = \min (\lambda_ {i}, 1 - \lambda_ {n - i}) + \min (1 - \lambda_ {i}, \lambda_ {n - i}), \\ \mathcal {L} _ {\mathrm {M o C o}} ^ {m} = - \frac {1}{1 + \lambda_ {i} ^ {c}} \log \frac {\exp \left(< y _ {i} ^ {m} , y _ {i} ^ {\prime m} > / \tau\right)}{\sum_ {j = 0} ^ {n} \exp \left(< y _ {i} ^ {m} , y _ {j} ^ {\prime m} > / \tau\right)} \tag {4} \\ - \frac {\lambda_ {i} ^ {c}}{1 + \lambda_ {i} ^ {c}} \log \frac {\exp \left(< y _ {i} ^ {m} , y _ {n - i} ^ {\prime m} > / \tau\right)}{\sum_ {j = 0} ^ {n} \exp \left(< y _ {i} ^ {m} , y _ {j} ^ {\prime m} > / \tau\right)} \\ \end{array} +$$ + +where $\lambda^c$ indicate the shared part between two mixed data. + +To sum up, our mixing MoCo loss can be used as an extra view, or replace one of the symmetric view in the MoCo. We hereby take the replace version to describe the loss of our mix MoCo loss: + +$$ +\mathcal {L} = \sum_ {i = 0} ^ {n} \left[ \mathcal {L} _ {\mathrm {M o C o}} ^ {s} \left(x _ {i}, x _ {i} ^ {\prime}\right) + \mathcal {L} _ {\mathrm {M o C o}} ^ {m} \left(x _ {i} ^ {\prime m}, x _ {i}, x _ {n - i}, x _ {i} ^ {m}\right) \right] \tag {5} +$$ + +Case 2: knowledge distillation. Recent research focuses on removing the negative samples in self-supervised transformer. DINO [7] introduce knowledge distillation to self-supervised training transformer. The student and the teacher network has parameters $\theta_{s}$ and $\theta_{t}$ and the output of student network should be close to the output of teacher model. There is a distillation loss: + +$$ +H \left(P _ {t} (x), P _ {s} (x)\right) = - P _ {t} (x) \log P _ {s} (x) \tag {6} +$$ + +where $P_{s}(x)$ and $P_{t}(x)$ are respectively student and teacher model output distribution (i.e. after a softmax function). + +In our data mixing case, there are two teachers the student needs to distill from. The first one is distilling from the source teacher: + +$$ +\mathcal {L} _ {\mathrm {D I N O}} ^ {s} = H \left(\lambda_ {i} P _ {t} \left(x _ {i} ^ {\prime}\right) + \left(1 - \lambda_ {i}\right) P _ {t} \left(x _ {n - i} ^ {\prime}\right), P _ {s} \left(x _ {i} ^ {m}\right)\right), \tag {7} +$$ + +Based on the loss, we can minimize the distance between mixed data and two source data. Another teacher is the mix teacher which take the mixed data as input: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {D I N O}} ^ {m} = \frac {1}{1 + \lambda_ {i} ^ {c}} H \left(P _ {t} \left(x _ {i} ^ {\prime m}\right), P _ {s} \left(x _ {i} ^ {m}\right)\right), \\ + \frac {\lambda_ {i} ^ {c}}{1 + \lambda_ {i} ^ {c}} H \left(P _ {t} \left(x _ {n - i} ^ {\prime m}\right), P _ {s} \left(x _ {i} ^ {m}\right)\right) \\ \end{array} +$$ + +The student can learn the probability of the mixed data from the mixed teacher output. The two teachers share the same network parameter but different input data. In practice, the teacher is not pretrained but the exponential moving average update on the student weights. + +To sum up, the total loss of SDMP + DINO is: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {D I N O}} + \mathcal {L} _ {\mathrm {D I N O}} ^ {m} + \mathcal {L} _ {\mathrm {D I N O}} ^ {s} \tag {9} +$$ + +where $\mathcal{L}_{\mathrm{DINO}}$ is the original DINO [7] loss applied to the teacher-student pairs without using any data mixing. + +# 4. Experiment + +Given no prior works successfully apply data mixing to improve self-supervised ViTs, we take ViT [16] as the major backbone in experiments. We set contrastive learning and knowledge distillation as self-supervised learning pretext tasks, and measure the representation quality of the pretrained models by linear evaluation, end-to-end finetuning, and semi-supervised learning. The ImageNet top-1 accuracy [12] is reported for performance comparisons. In addition, we evaluate model robustness on out-of-distribution benchmarks [24-26]. + +# 4.1. Implementation Details + +We take a small Transformer, ViT-S [39], as the default architecture in our experiments. The input patch size of ViT-S is $16 \times 16$ . Therefore, the sequence length is 196 for the $224 \times 224$ input images. There are 12 transformer blocks, and the dimension of each block is 384. For the data augmentation, we follow the settings in BYOL [19], which includes random resize crop, color jittering, Gaussian Blurring, and solarization. We use Adam with weight decay as the optimizer [33]. We set the learning rate $lr$ following the linear scaling rule [18]: $lr = 0.0005 * batchsize / 256$ ; the default training batch size is 1024. + +# 4.2. Classification on ImageNet-1K + +# 4.2.1 Linear Evaluation + +Linear Evaluation is the standard protocol [7, 22] in evaluating the performance of self-supervised learning by freezing the parameter in the backbone network and training a linear classifier. Following the previous method [22], we only take resize, crop and random flipping as data augmentation. Due to the variance of feature space in different self-supervised methods, we take a different learning rate for different pretraining methods. Note that most self-supervised method only takes the last class token for linear evaluation, but DINO takes the last four class tokens. We will follow the default settings in their method. When we apply the proposed SDMP on MoCo, we randomly replace one of the symmetric views with our mixing data. When we apply SDMP on DINO, we randomly replace some local crops with our mixing data. Our data mixing strategy will not bring extra computation costs in the student model. + +The results are reported in Table 1, our method is compatible with MoCo and DINO and brings consistent improvements under the same training epochs and crops. + +
MethodModelParam.EpochTop-1 (%)
SimCLR [8]Res5023M20060.6
BYOL [19]Res5023M20061.9
SwAV [6]Res5023M80075.3
MoCo v1 [21]Res5023M20060.6
MoCo v2 [9]Res5023M80071.1
MoCo v3 [11]Res5023M30072.8
+ i-mix [31]Res5023M30072.8
+ SDMP (ours)Res5023M30073.5
Supervised [39]ViT-S21M30079.8
BYOL [19]ViT-S21M30071.4
MoCo v2 [9]ViT-S21M30072.7
SwAV [6]ViT-S21M30073.5
MoCo v3 [11]ViT-S21M30073.2
+ imix* [31]ViT-S21M30071.6
+ DACL* [42]ViT-S21M30072.3
+ MoChi* [27]ViT-S21M30073.0
+ SDMP (ours)ViT-S21M30073.8
DINO [7]ViT-S21M30076.0
+ SDMP (ours)ViT-S21M30076.4
MoCo v3ViT-B85M30076.7
+ SDMP (ours)ViT-B85M30077.2
+ +Specifically, we only replace the view or crops. Therefore, without using extra crops or views, we achieve $0.6\%$ accuracy improvement over the vanilla MoCo v3 baseline (i.e., $73.2\%$ vs. $73.8\%$ ) and $0.4\%$ accuracy improvement over DINO (i.e., $76.0\%$ vs. $76.4\%$ ). In contrast, for all other training strategies in data mixing, including i-mix, DACL and MoChi, they cannot improve the performance of ViT-S over the vanilla MoCo v3 baseline. Lastly, we verify that SDMP scales well with large ViTs, i.e., it successfully help ViT-B beat the vanilla MoCo v3 baseline by $0.5\%$ accuracy. + +# 4.2.2 End-to-End Fintuning + +We follow the same training recipe in DeiT [39] for finetuning models, including data augmentation and regularization like mixup [47], cutmix [45], random flipping, random cropping, and random erasing. The whole network will be end-to-end finetuned for 100 epochs. + +As shown in Table 2, we compare different self-supervised methods and the supervised baseline. "Supervised" indicates random initialization, while the rest use the pre-trained models as initialization. All self-supervised methods are pretrained for 300 epochs. Compared with the 100-epoch supervised training from random initialization, our method significantly outperforms it by a large margin. + +Table 1. Comparison with different pretraining methods in Linear evaluation on ImageNet-1K. Our method consistently brings improvements without using extra crops or views. * indicate our reproduced results with Transformer. + +
MethodModelParam.EpochTop-1
SupervisedViT-S21M10075.8
SupervisedViT-S21M30079.8
MoCo v3ViT-S21M10078.7
+ SDMPViT-S21M10079.1
DINOViT-S21M10079.7
+ SDMPViT-S21M10080.0
+ +These finetuning results even closely match or outperform the performance of the 300-epoch supervised training setting (i.e., $79.1\%$ or $80.0\%$ vs. $79.8\%$ ). Compared with the vanilla baseline, our proposed SDMP brings substantial and consistent improvements over the self-supervised learning methods (i.e., MoCo v3 and DINO) under the same pretraining and finetuning setups. + +# 4.2.3 Semi-Supervised Learning + +In semi-supervised learning, we followed the same procedures of self-supervised pretraining on the whole ImageNet and supervised finetuning with $10\%$ data and $1\%$ data. Compared with the end-to-end finetuning, semi-supervised learning utilizes fewer labels. Therefore, stronger regularization and data augmentation techniques are required for obtaining a more generalized pretrained model. + +The results are reported in Table 3, our model consistently outperforms the method without applying data mixing, and the performance gap is much larger than that in the end-to-end finetuning. Additionally, we observe that the performance gap increases when using less data for fintuning. Therefore, the model trained with our proposed SDMP can be regarded as a more generalized model. Specifically, for MoCo with and without our proposed SDMP, the performance gap increases by $0.4\%$ with $100\%$ data (end-to-end fintuning settings), $0.7\%$ (10% data semi-supervised learning) and $1.1\%$ (1% data semi-supervised learning). + +Table 2. End-to-end tintuning on ImageNet-1K. All methods are pretrained for 300 epochs. The "Epoch" in the table indicates the number of tintuning epochs. + +
MethodModelParam.10%1%
MoCo v3ViT-S21M66.754.4
+ SDMPViT-S21M67.455.5
DINOViT-S21M67.255.6
+ SDMPViT-S21M68.056.3
+ +Table 3. Semi-supervised learning on ImageNet-1K with ${10}\%$ and $1\%$ labeled data. All methods are pretrained for 300 epochs. + +
MethodImageNet (%)A (%)R (%)C (mCE)
MoCo78.718.142.152.9
+ SDMP79.118.942.853.4
DINO79.720.044.954.7
+ SDMP79.921.145.355.0
+ +Table 4. Performance on ImageNet and out-of-distribution datasets. "A", "R", "C" refer to ImageNet-A [26], ImageNet-R [24], and ImageNet-C [25], respectively. Note that when measuring performance on ImageNet-C, we directly use top-1 accuracy rather than "mCE" [25] as the evaluation metric. + +# 4.2.4 Robustness on Out-of-Distribution Datasets + +To evaluate the robustness of our approach against out-of-distribution data, we test the performance on perturbed versions of ImageNet, i.e., natural adversarial examples (ImageNet-A [26]), semantic shifts (ImageNet-R [24]), common image corruption (ImageNet-C [25]). + +As shown in Table 4, our method not only improves the standard classification performance on ImageNet but also consistently improves the performance on different Out-of-Distribution datasets compared with the baseline methods, i.e., MoCo and DINO. Notably, the robustness improvement is even more significant than the standard ImageNet classification performance boost. For instance, applying our proposed SDMP to standard ImageNet classification only yields a performance improvement of $0.2\%$ . But for ImageNet-A classification, our method outperforms DINO by $1.1\%$ . This suggests that SDMP can be an excellent addition to existing self-supervised learning frameworks to improve model robustness. + +# 4.3. ResNet Results + +In addition to ImageNet, we also test our method on CIFAR-10 and CIFAR-100 [30] to verify the generalization of our proposed data mixing strategy. In this section, we explore the effectiveness using CNN architectures, i.e., ResNet [23], to show that our method can be also compatible with different architectures. CIFAR-10 and CIFAR-100 contain $32 \times 32$ small size images with 10 and 100 classes, respectively. There are 50000 training images and 10000 testing images. Specifically, we pretrain ResNet-50 and ResNet-101 on CIFAR-10 and CIFAR-100, and ResNet-50 on ImageNet-1K respectively. If we apply ResNet on CIFAR-10 and CIFAR-100, the first convolution and max-pooling layer will be replaced by a convolution layer with the kernel size of $3 \times 3$ and stride of 1. We re-implement i-mix [31] on MoCo v3 for fair comparison. + +ResNet on CIFAR-10. As shown in Table 5, we compare ResNet-50 and ResNet-101 pre-trained models based on + +
MethodModelEpochCIFAR10CIFAR100
MoCo v3Res5020086.563.2
+ i-mixRes5020088.666.1
+ SDMPRes5020089.568.2
MoCo v3Res50200093.769.0
+ i-mixRes50200095.477.3
+ SDMPRes50200095.878.7
MoCo v3Res10120086.463.3
+ i-mixRes10120089.467.7
+ SDMPRes10120090.069.7
MoCo v3Res101200093.868.5
+ i-mixRes101200095.878.4
+ SDMPRes101200095.880.0
+ +Table 5. Linear evaluation on CIFAR-10 and CIFAR-100. + +MoCo with and without applying data mixing. Though both improve the baseline method, we note that our method consistently yields more significant performance improvements than i-mix. Specifically, with ResNet-50 and 200 epoch pretraining, i-mix yields performance improvement of $1.9\%$ while our proposed SDMP substantially produces $2.9\%$ performance improvement. + +ResNet on CIFAR-100. Similar to the results in CIFAR-10, our method also consistently yields more significant performance improvement compared to i-mix for CIFAR-100, as shown in Table 5. However, because CIFAR-100 is a relatively smaller dataset (5000 training sample per class in CIFAR-10 and 500 training sample per class in CIFAR100) and ResNet-101 is the larger model, the performance of ResNet-101 slightly drops compared with ResNet-50 (pretraining for 2000 epochs). Therefore, stronger data augmentation like SDMP is required to help larger models perform better, and with the proposed SDMP, ResNet-101 outperforms ResNet-50 when pretraining for 2000 epochs. Besides, when training is longer, the improvement is more significant. Specifically, compared with baseline MoCo, the proposed SDMP improves $6.4\%$ in pretraining 200 epoch but improve $11.5\%$ in pretraining 2000 epochs, which also shows the regularization power of our method. + +ResNet on ImageNet. Compared with CIFAR-10 and CIFAR-100, ImageNet is a much larger dataset. Therefore data augmentation plays a less important role in pretraining. As shown in Table 1, i-mix hardly improves ResNet result on the MoCo v3 baseline. In contrast, our SDMP encodes more accurate relationship cross data and successfully boost accuracy by $0.7\%$ . + +
MethodλiλicLinearFinetuning
MoCoNoneNone73.278.7
+ SDMPStaticRand.71.578.0
+ SDMPRand.Static72.578.4
+ SDMPRand.Rand.73.779.1
DINONoneNone76.079.7
+ SDMPStaticRand.75.579.4
+ SDMPRand.Static76.179.9
+ SDMPRand.Rand.76.479.9
+ +Table 6. Ablation on the mixing weight in the loss. "None" indicate that data mixing is not applied. "Rand." indicate that $\lambda$ is randomly sampled, where both the data mixing and the mixing loss take the same weight $\lambda$ . "Static" indicate the $\lambda$ in loss is static, predefined and irrelevant with the weight in data mixing. + +# 4.4. Ablation Study + +# 4.4.1 On the importance of $\lambda$ + +When mixing two images, we sample $\lambda$ from Beta distributions as the weight. In pretraining, we regard such $\lambda$ as the prior in our mixing loss. In this part, we ablate how this prior $\lambda$ setup affects model performance. + +Static weight. There are two parts in the loss related to the data mixing and the $\lambda$ : source loss and mixing loss. To verify $\lambda$ as a useful prior, we manually opt out the prior when computing the mixing loss (referred to as "static weight"). Specifically, we only keep the randomly sampled $\lambda$ in data mixing for training. But for the loss computation, we set $\lambda_{i}, 1 - \lambda_{i}$ equals to 0.5 in the source loss and $\lambda_{i}^{c}$ equals to 0 in the mix loss separately. all $\lambda_{i}, 1 - \lambda_{i}$ and $\lambda_{i}^{c}$ equal to 1. + +As shown in Table 6, for the weight of source loss (see in Eq. (7) and Eq. (3)), the performance of both DINO and MoCo significantly drops under the linear evaluation protocol when setting a fixed weight for computing the mix loss. But DINO is relatively more stable (with much less performance degradation). On the other hand, for end-to-end finetuning, the performance drop for both MoCo and DINO decreases. This suggests that for the mixing loss, the importance of the loss prior has declined compared to that in linear evaluation. As a comparison, we also randomly sample $\lambda$ and apply it both for reweighting the mixing data and the mixing loss (referred to as "random weight"). Specifically, we find that applying either a static weight or a random weight for the mixing loss have no difference in DINO with end-to-end finetuning. We think this might be attributed to the intra batch similarity, because the intra batch sample pair (the second term in Eq. (3) or Eq. (7)) we build share the same source data but only with the different mixing weight. Comparing MoCo and DINO, our proposed data mixing strategy SDMP is more stable in DINO if we + +
MethodλiλicLinearFinetuning
MoCoNoneNone73.278.7
+ SDMPSharedShared72.378.2
+ SDMPInd.Ind.73.779.1
DINONoneNone76.079.7
+ SDMPSharedShared74.579.0
+ SDMPInd.Ind.76.479.9
+ +Table 7. "Ind." and "Shared" indicate using independent (persample) and shared (per-batch) $\lambda$ in a training batch. + +adjust the weight of the mixing and the source loss. + +Per-sample weight vs. per-batch weight assignment. In our current method, we assign each sample a mixup weight $\lambda$ which provides more diversity in a batch and enlarges the training difficulty. In contrast, if we assign a shared mixup weight for a batch, namely, $\lambda_{1} = \lambda_{2} = \ldots = \lambda_{n}$ in a batch, the training difficulty will be reduced since the same mixing pattern is applied to the entire training batch. The results are reported in Table 7, taking a shared weight of mixing in a batch reduce the training difficulty but lead to $0.9\%$ performance drop in the linear evaluation and $0.5\%$ performance drop in end-to-end finetuning. This indicates assigning the per-sample weight is more effective than assigning the per-batch weight for mixing the data in our method. + +# 4.4.2 Data Mixing Strategies + +our default setup is to select a data mixing strategy from the set $\{\text{Mixup, Cutmix and ResizeMix}\}$ uniformly at random. To ablate the effects of applying different data mixing strategies, we then compare our default setup with two additional settings: 1) applying exclusively with the element-wise data mixing Mixup; and 2) applying exclusively with the regional data mixing Resizemix. We report the results in Table 8. We note that: 1) our SDMP consistently outperforms the MoCo or DINO baseline, even if only one data mixing strategy is applied; 2) our SDMP achieves the best results when $\{\text{Mixup, Cutmix and ResizeMix}\}$ are all used. + +
MethodModelMixingEpochTop-1 (%)
MoCo v3ViT-SNone10064.7
+ SDMPViT-SMixup10065.1
+ SDMPViT-SResizemix10065.4
+ SDMPViT-SBoth10065.5
DINOViT-SNone10073.8
+ SDMPViT-SMixup10074.3
+ SDMPViT-SResizemix10074.4
+ SDMPViT-SBoth10074.4
+ +Table 8. Ablations of different data mixing strategies. + +# 4.4.3 Extra Version and Replace Version + +The original MoCo by default see two different augmented views of the same input. Our proposed SDMP generates the mixed data, which can be then used to replace one of the existing views in MoCo or form an extra view. Therefore for a fair comparison, the number of training epochs should be the same as MoCo for the replace version but reduced to 2/3 for the extra version, given there remains 2 views for original MoCo and the replace version, but increases to 3 views for the extra version. Table 9 reports the performance comparison between the replace version and the extra version. We can see under this fair comparison, both the replace and the extra version outperform the MoCo baseline. + +
MethodModelEpochTop-1 (%)
MoCo v3ViT-S15066.7
+ SDMP (Replace)ViT-S15067.4
+ SDMP (Extra)ViT-S10067.5
+ +Table 9. Comparison of extra version and replace version. + +# 4.4.4 Local Crops in Training + +The most important contribution of DINO is the local crop in training. We explore the function of local crops in SDMP. When we apply SDMP on DINO with local crops, we replace the local crops by our mixed data. In contrast, for the non local crops version, we replace one of the global crops with our mixed data. The results are shown in Table 10, without local crops, the performance of our proposed SDMP significantly drops and is even lower than the original version of DINO in linear evaluation. With the number of local crops growing, SDMP narrows down the gap and + +
MethodGlobal CleanGlobal MixedLocal CleanLocal MixedTop-1 (%)
DINO2XXX67.8
DINO11XX64.1
DINO2X2X71.5
DINO2X1170.9
DINO2X6X73.8
DINO2X3374.0
DINO2X8X74.0
DINO2X4474.4
+ +Table 10. Top-1 accuracy of different variants of multi-crop. We pretrain all models with 100 epochs. Global clean and Local clean indicate the global crops and local crops without data mixing. Global mixed and local mixed indicate the global crops and local crops with data mixing. + +
MethodModelParam.EpochLinear
SupervisedViT-S21M30088.0
MoCo v3ViT-S21M30079.1
+ SDMPViT-S21M30081.8
DINOViT-S21M30082.0
+ SDMPViT-S21M30083.2
+ +Table 11. Linear evaluation on ImageNet-100. Different from previous transfer learning methods which pretrain on large-scale datasets and finetune on small-scale datasets, we pretrain our model and perform linear evaluation on ImageNet-100. + +finally outperforms the original DINO when the number of local crops reaches 6, which demonstrates the superiority of our proposed SDMP. Therefore, the local crops help stabilize the training when introducing the mixing data. + +# 4.4.5 Generalization on Small-Scale Datasets + +Compared with ResNet, it is known that ViTs require much more data to train. In this part, we explore whether our method can still help self-supervised ViT on the relatively small dataset, i.e., ImageNet-100. As shown in Table 11, we can observe that the proposed SDMP can consistently improve MoCo (from $79.1\%$ to $81.8\%$ ) and DINO (from $82.0\%$ to $83.2\%$ ), demonstrating its effectiveness at different data scale regime. + +# 5. Conclusion + +In this paper, we develop a generic training strategy in data mixing for helping self-supervised training, especially for Vision Transformers. By following the intra-batch data mixing strategy in timm [43], we propose SDMP to capture the intrinsic relationships between mixed data in a precise manner. Experiments show that our method brings consistent improvements, and is compatible with kinds of self-supervised learning methods, architectures, and datasets. + +Discussion & Limitation This work introduces an extra intra-batch relationship between mixed samples for different self-supervised learning frameworks, i.e., MoCo and DINO. Future work should examine how to integrate our method to other recent self-supervised masked image modeling methods, especially for the masked image modeling based methods [2,20,49]. In addition, due to computational limitation, our experiments are mostly built upon the small-sized ViT (i.e., ViT-S); it deserves to further validate our method at a larger scale. + +Acknowledgements This work is supported by a gift from Open Philanthropy and ONR N00014-21-1-2812. + +# References + +[1] Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. arXiv preprint arXiv:1911.05371, 2019. 2 +[2] Hangbo Bao, Li Dong, and Furu Wei. Beit: Bert pre-training of image transformers. arXiv preprint arXiv:2106.08254, 2021.8 +[3] Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in neural information processing systems, pages 153-160, 2007. 2 +[4] Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020. 1 +[5] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 132-149, 2018. 2 +[6] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. 5 +[7] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In ICCV, 2021. 2, 4, 5 +[8] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. 2, 5 +[9] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. 2, 5 +[10] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15750-15758, 2021. 2 +[11] Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised vision transformers. In ICCV, 2021. 2, 5 +[12] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248-255. IEEE, 2009. 4 +[13] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019. 2 +[14] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 2 +[15] Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In Proceedings of the IEEE International Conference on Computer Vision, pages 2051–2060, 2017. 2 +[16] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, + +Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2020. 1, 2, 4 +[17] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018. 2 +[18] Priya Goyal, Piotr Dólar, 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. 4 +[19] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. 2, 4, 5 +[20] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollar, and Ross Girshick. Masked autoencoders are scalable vision learners. arXiv preprint arXiv:2111.06377, 2021. 8 +[21] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729-9738, 2020. 2, 5 +[22] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 4 +[23] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. 6 +[24] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. ICCV, 2021. 4, 6 +[25] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. *ICLR*, 2019. 4, 6 +[26] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. CVPR, 2021. 4, 6 +[27] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. arXiv preprint arXiv:2010.01028, 2020. 1, 2, 5 +[28] Jang-Hyun Kim, Wonho Choo, and Hyun Oh Song. Puzzle mix: Exploiting saliency and local statistics for optimal mixup. In International Conference on Machine Learning, pages 5275-5285. PMLR, 2020. 2 +[29] Sungnyun Kim, Gihun Lee, Sangmin Bae, and Se-Young Yun. Mixco: Mix-up contrastive learning for visual representation. arXiv preprint arXiv:2010.06300, 2020. 2 +[30] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. 6 + +[31] Kibok Lee, Yian Zhu, Kihyuk Sohn, Chun-Liang Li, Jinwoo Shin, and Honglak Lee. i-mix: A domain-agnostic strategy for contrastive representation learning. In ICLR, 2021. 1, 2, 5, 6 +[32] Chunyuan Li, Xiujun Li, Lei Zhang, Baolin Peng, Mingyuan Zhou, and Jianfeng Gao. Self-supervised pre-training with hard examples improves visual representations. arXiv preprint arXiv:2012.13493, 2020. 2 +[33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In *ICLR*, 2019. 4 +[34] Mehdi Noroozi, Ananth Vinjimoor, Paolo Favaro, and Hamed Pirsiavash. Boosting self-supervised learning via knowledge transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9359-9367, 2018. 2 +[35] Jie Qin, Jiemin Fang, Qian Zhang, Wenyu Liu, Xingang Wang, and Xinggang Wang. Resizemix: Mixing data with preserved object information and true labels. arXiv preprint arXiv:2012.11101, 2020. 2, 3 +[36] Zhiqiang Shen, Zechun Liu, Zhuang Liu, Marios Savvides, Trevor Darrell, and Eric Xing. Un-mix: Rethinking image mixtures for unsupervised visual representation learning. arXiv preprint arXiv:2003.05438, 2020. 2 +[37] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In ICCV, 2017. 2 +[38] Ryo Takahashi, Takashi Matsubara, and Kuniaki Uehara. Ricap: Random image cropping and patching data augmentation for deep cnns. In Asian Conference on Machine Learning, 2018. 1 +[39] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021. 1, 2, 3, 4, 5 +[40] AFM Uddin, Mst Monira, Wheemyung Shin, TaeChoong Chung, Sung-Ho Bae, et al. Saliencymix: A saliency guided data augmentation strategy for better regularization. arXiv preprint arXiv:2006.01791, 2020. 2 +[41] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. 2 +[42] Vikas Verma, Thang Luong, Kenji Kawaguchi, Hieu Pham, and Quoc Le. Towards domain-agnostic contrastive learning. In International Conference on Machine Learning, pages 10530–10541. PMLR, 2021. 1, 2, 5 +[43] Ross Wightman. Pytorch image models. https://github.com/rwrightman/pytorch-image-models, 2019.1,2,3,8 +[44] Tianshu Xie, Xuan Cheng, Xiaomin Wang, Minghui Liu, Jiali Deng, Tao Zhou, and Ming Liu. Cut-thumbnail: A novel data augmentation for convolutional neural network. In Proceedings of the 29th ACM International Conference on Multimedia, pages 1627-1635, 2021. 1 +[45] 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, pages 6023-6032, 2019. 1, 2, 3, 5 + +[46] Xiaohang Zhan, Jiahao Xie, Ziwei Liu, Yew-Soon Ong, and Chen Change Loy. Online deep clustering for unsupervised representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6688-6697, 2020. 2 +[47] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018. 1, 2, 5 +[48] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pages 649-666. Springer, 2016. 2 +[49] Jinghao Zhou, Chen Wei, Huiyu Wang, Wei Shen, Cihang Xie, Alan Yuille, and Tao Kong. ibot: Image bert pre-training with online tokenizer. arXiv preprint arXiv:2111.07832, 2021.8 \ No newline at end of file diff --git a/asimpledatamixingpriorforimprovingselfsupervisedlearning/images.zip b/asimpledatamixingpriorforimprovingselfsupervisedlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0738b994a043e28fc49da3e7d58293fd34d5ec6e --- /dev/null +++ b/asimpledatamixingpriorforimprovingselfsupervisedlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10989ecaecf2c601360cb793075f23d036ebfde2acdb7b7d869b7482a03f2826 +size 564527 diff --git a/asimpledatamixingpriorforimprovingselfsupervisedlearning/layout.json b/asimpledatamixingpriorforimprovingselfsupervisedlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7f6512e02ec604959a112e84c824865e8f00c93e --- /dev/null +++ b/asimpledatamixingpriorforimprovingselfsupervisedlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f175c2ecdd4c51e736af5b1fc53a0dce0ae4315c06406a842f3571aa2cd217e5 +size 405240 diff --git a/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_content_list.json b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..77f65c596c7bb7ce1e87510b4bd74d8b60e76f7f --- /dev/null +++ b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19d6e9a8bf45804d806873c90fc7b4ee4edb95be51e0b5e33bc0e569f0dee3a1 +size 87036 diff --git a/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_model.json b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e694224396072c409e7b7dc6edce650602b44ac1 --- /dev/null +++ b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df8a1aabb5d99261cd2bb1d4b95a3ec297fd5a04e78c1ebe1de88a5195d1e0a2 +size 107999 diff --git a/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_origin.pdf b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4e56d6b43f4128b41650e45ac2339584a778a506 --- /dev/null +++ b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/7ea84cfb-9de2-44c4-8256-886f45bdccce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1545498c86f0fdf4ad9665b55a7a58ac2d8803ad8b7c0049a1021dea484a929 +size 1358438 diff --git a/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/full.md b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8a936ab965ce9ec5172b9891dc9e29a5785a9f44 --- /dev/null +++ b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/full.md @@ -0,0 +1,343 @@ +# A Simple Episodic Linear Probe Improves Visual Recognition in the Wild + +Yuanzhi Liang\*1,2, Linchao Zhu?, Xiaohan Wang?, and Yi Yang? + +$^{1}$ Baidu Research $^{2}$ ReLER Lab, AAll, University of Technology Sydney $^{3}$ Zhejiang University + +liangyzh18@outlook.com linchao.zhu@uts.edu.au xiaohan.wang@zju.edu.cn yangyics@zju.edu.cn + +# Abstract + +Understanding network generalization and feature discrimination is an open research problem in visual recognition. Many studies have been conducted to assess the quality of feature representations. One of the simple strategies is to utilize a linear probing classifier to quantitatively evaluate the class accuracy under the obtained features. The typical linear probe is only applied as a proxy at the inference time, but its efficacy in measuring features' suitability for linear classification is largely neglected in training. In this paper, we propose an episodic linear probing (ELP) classifier to reflect the generalization of visual representations in an online manner. ELP is trained with detached features from the network and re-initialized episodically. It demonstrates the discriminability of the visual representations in training. Then, an ELP-suitable Regularization term (ELP-SR) is introduced to reflect the distances of probability distributions between the ELP classifier and the main classifier. ELP-SR leverages a re-scaling factor to regularize each sample in training, which modulates the loss function adaptively and encourages the features to be discriminative and generalized. We observe significant improvements in three real-world visual recognition tasks: fine-grained visual classification, long-tailed visual recognition, and generic object recognition. The performance gains show the effectiveness of our method in improving network generalization and feature discrimination. + +# 1. Introduction + +Deep neural networks have achieved impressive improvements in visual recognition. The neural networks trained on large-scale visual recognition datasets, e.g., Ima + +geNet [30], OpenImages [27], demonstrate remarkable generalization capabilities. The learned visual representations are compact and enjoy strong discriminability. Many works have been conducted to theoretically explain the rationale behind deep networks' generalization [60], but this problem is still largely unsolved and remains to be investigated. + +There are a few analytical tools to probe deep neural networks' learning and generalization capabilities. Early works utilize visualization tools to understand the optimized parameters or employ dimensionality reduction techniques to visualize the quality of learned representations [42, 51, 59]. Though helpful, such visualization techniques only provide qualitative inspections on deep networks [8]. Some works develop geometric probes to analyze the geometric properties of object manifold and connect object category manifolds' linear separability with the underlying geometric properties [46]. These methods reveal the structure of memorization from different layers in deep networks but only probe layer capacity at the inference time, as shown in Fig. 1 (a). + +Another simple strategy is to perform linear probing. One can use linear probes to evaluate the feature's quality quantitatively. Since the discrimination capability of linear classifiers is low, linear classifiers heavily rely on the quality of the input representation to obtain good classification accuracy [3]. Alain et al. [1] use linear probes to examine the dynamics of intermediate layers. The linear probe is a linear classifier taking layer activations as inputs and measuring the discriminability of the networks. This linear probe does not affect the training procedure of the model. Recently, linear probes [3] have been used to evaluate feature generalization in self-supervised visual representation learning. After representation pre-training on pretext tasks [3], the learned feature extractor is kept fixed. The linear probe classifier is trained on top of the pre-trained feature representations. Though conceptually straightforward, linear probes are effective and have been widely used + +![](images/452d9cb29316e27643f70d27cd2168e06dfb796eebafbdce36503557ca097da0.jpg) +(a) The typical linear probe test the feature separability at the test time. + +![](images/23536f8d7524fedf3433b07a2ec4c213a8d2cd17d2b84e6022934049b6ce5f27.jpg) + +![](images/1021f0094c34e891e32a391d97f12b1490daee4e0118ce015dc195341a99cd32.jpg) +(b) Our episodic linear probing classifier provides measurements at the training time. +Figure 1. The typical linear probe in testing (a) and our ELP in training (b). Our ELP is episodically re-initialized to maintain simplicity. It effectively measures the discrimination of visual representations in an online manner. + +in measuring the discriminability of visual representations. Noticeably, the linear probing classifier is only used in testing. A natural question arises: can we utilize linear probes during training and bring the signal from the linear probes to regularize the model training? + +In this paper, we introduce a simple strategy to regularize the network to be immediately plausible for an episodic linear probing classifier. Our simple framework (Fig. 1 (b)) consists of a main classifier, an episodic linear probing classifier, and a regularization term. The regularization term considers the relation between the main classifier and the episodic linear probing classifier, which effectively penalizes examples that are not immediately plausible for episodic linear probes. + +First, we propose an episodic linear probing (ELP) classifier to estimate the discrimination of visual representation in an online way. Similar to the existing linear probes [1], ELP is applied on top of the last layer of a deep network. ELP classifier is trained to classify the detached features into the same label space as a regular classifier. Different from [1], ELP is applied during model training. It is episodically re-initialized at each epoch. This maintains its simplicity, avoids classifier overfitting, and prevents the classifier from memorizing features. ELP implicitly reflects the feature discriminability and separability [40,41]. If the ELP classifier can quickly classify the feature points, it indicates that the given features are easily separable and would potentially be more generalizable. + +Second, we introduce a penalization for less suitable examples for an episodic linear probe. Intuitively, given a training example, if the episodic linear probe and the main classifier contradict each other, e.g., the episodic linear probe receives a low prediction score while the main clas + +sifier produces a high prediction score, it indicates that the main network exhibits overfitting on the given instance and a larger penalty should be enforced for proper regularization. Thus we design an ELP-suitable Regularization term (ELP-SR) to mitigate the intrinsic model bias and improve the linear separability of the learned features. ELP-SR sets a re-scaling factor to each instance and adaptively modulates the cross-entropy loss to avoid overfitting. The re-scaling factor considers the deviation between an example's predictive score from the main classifier and ELP classifier, which, to a certain extent, assesses the example's suitability for linear classification. + +Without bells and whistles, our method achieves significant improvements for visual recognition tasks in the wild, providing consistent gains for fine-grained, long-tailed, and generic visual recognition. The fine-grained visual recognition datasets often contain high inter-class similarities. The long-tailed visual recognition datasets exhibit long-tailed data distribution, which is realistic in real-world recognition problems. We extensively evaluate the generalization performance on six standard datasets. The results indicate that our strategy empowers various deep networks with better discrimination and mitigates the model bias. + +# 2. Related Work + +Various works have been proposed to learn visual representation based on deep learning. In diverse recognition tasks in the wild, deep neural networks possess the powerful ability to learn and represent images to high-dimensional features. With the high-quality features, some simple classifiers [29, 56] are components to recognize the samples. Further, the quality of features is influenced by many factors. We roughly divided the factors into three aspects: data processing, network design, and training manner. Though the exact effect of representation learning [60] remains to be investigated, numerous researchers keep exploring and propose many valuable solutions. + +For data processing, large-scale datasets provide considerable network samples and are the most straightforward way to improve representation. Benefiting from the powerful ability of networks, taking large-scale datasets as inputs lead the network to learn various samples and memorize plenty of properties for discriminating. Some diverse and hard examples may be difficult in a limited data scale [2,35]. Under the view of larger scales of collections, it is always possible for the network to mine particular patterns. Besides directly collecting real data, pre-processing [11,64] or generating data [63] are also equivalent. Various augmentations [43, 50] enforce the networks to solve problems with higher requirements and urge the network to be generalized to different conditions. + +Moreover, well-designed network structures also dramatically boost representation and become the hottest di + +rection in recent years. Diverse methods constantly emerge like skip-connection [19, 22], fusing channels [48], attention strategies [4, 37], architecture searching [5], transformers [52, 54], etc. With the same inputs, these methods explore different directions to boost the network's capacity. Meanwhile, almost all kinds of visual tasks [30, 33] develop further with better networks. + +Furthermore, besides data processing and network designs, the training manner is also crucial for visual representation. It contains various aspects like the optimizer [20,39], regularization [31, 32], learning manner [25, 44], etc. In this direction, regularization plays an important role. It can be reflected in the loss function [9, 32], training strategies [18], etc., and is general to various networks and datasets. A proper regularization can leverage the network to learn better visual representation, for example, avoiding overfitting [32], explicit attention to the target [9], better diversity [14], etc. Vikash et al. [41] propose an interesting margin to describe the separability of features. Rather than focusing on the accuracy of the classifier, the quality of features can be reflected through immediate suitability. The more discriminative features are considered more than memorable by the classifier. + +In our work, going further with the immediate suitability, we propose an episodic linear probing (ELP) classifier to reflect the generalization of visual representation online. ELP can be applied as a novel regularization to encourage the network to produce more discriminative features. Rather than re-weighting according to samples' easiness [25] or a meta set with iterative learning [44], we design an ELP-suitable regularization (ELP-SR) and leverage the ELP-SR to the regular loss function. Experimental results show that ELP-SR generally improves the performances of networks in three different benchmarks. + +# 3. Method + +In this work, we introduce an auxiliary episodic linear probing classifier to provide additional regularization for better representation learning. As illustrated in Fig. 2, our framework consists of three components, i.e., a deep neural network, a main linear classifier, and an episodic linear probing classifier. We illustrate our episodic linear probing classifier in Section 3.1. The details of the ELP-suitable regularization are introduced in Section 3.2. In Section 3.3, we describe the training and inference strategies of the model. + +# 3.1. Episodic Linear Probing Classifier + +# 3.1.1 Review of The Typical Linear Probes + +Training the Feature Extractor. Given a training sample $\pmb{x}$ , a neural network $(F)$ extracts its feature $\pmb{h}$ . A linear classifier $(Cls)$ projects the feature to a probability distribution $\pmb{p}$ . The cross-entropy (CE) loss calculates the cross-entropy + +![](images/8d959eac61da9777f65654ada51a57e512fabd255b429e95146cf8ecb2556902.jpg) +Figure 2. The training flow of our framework. Black lines indicate that the gradient can be back-propagated, while the blue dotted lines indicate that the gradient back-propagation is stopped. + +between $\pmb{p}$ and the ground-truth distribution $\pmb{y}$ . Formally, we denote the typical training procedure below: + +$$ +\boldsymbol {h} = F (\boldsymbol {x}), \tag {1} +$$ + +$$ +\boldsymbol {p} = C l s (\boldsymbol {h}), \tag {2} +$$ + +$$ +\ell_ {c e} (\boldsymbol {p}, \boldsymbol {y}) = - \sum_ {j = 1} ^ {C} y ^ {j} \log (p ^ {j}), \tag {3} +$$ + +where $C$ is the number of categories. $y^{j} = 1$ if $j$ is the ground-truth label. Otherwise, $y^{j} = 0$ . $p^{j}$ is the prediction score of class $j$ . The feature extractor and the classifier are jointly optimized end-to-end using back-propagation. + +Test-time Linear Probing. Linear probing is usually built to assess the quality of deep representations after the neural network is sufficiently trained [1]. That amounts to training an auxiliary linear classifier on top of the pre-trained features. The parameters of the linear probe are randomly initialized, while the original classifier layer is neglected. The pre-trained backbone is frozen and not trained during linear probing. Since the complexity of the auxiliary classifier is not sufficient to provide additional discrimination, the classification performance heavily depends on the quality of the feature representations. Thus, predictive scores of the auxiliary linear classifier can probe the discrimination of the input features. During implementation, a linear probe can be extended to a Multi-Layer Perceptron (MLP) probe where the linear layer is replaced with a MLP [21]. + +The existing probes are mainly used during inference time, either providing quantitative evaluation on pre-trained features or interpreting intermediate layers [15]. This drives us to incorporate a linear probe during training and borrow the simple nature of the linear probe for network regularization. + +# 3.1.2 Episodic Linear Probing Classifier + +Motivated by the efficacy of test-time linear probe in assessing representation quality, we aim to design a linear probing classifier in training to measure the discrimination of a + +neural network and further leverage the probing signal to empower representation learning. We introduce an episodic linear probing (ELP) classifier and discuss its weight update scheme in training. + +Detached Linear Probing Classifier in Training. When incorporating a linear probing classifier in training, we need to maintain its independence from the main classifier. While keeping the main classifier and the backbone network unchanged, we build a new episodic linear probing classifier on top of the feature extractor. We stop the linear probe classifier's gradient to back-propagate to the backbone network. This helps the linear probe not be biased by the main classifier and produce a neutral evaluation of the discrimination of the feature representations. + +Formally, the episodic linear probing classifier is trained to classify the features into $C$ categories using the same labels assigned to the main classifier, + +$$ +\boldsymbol {p} = C l s _ {\text {m i n}} (\boldsymbol {h}), \tag {4} +$$ + +$$ +\boldsymbol {q} = C l s _ {\mathrm {e l p}} (\operatorname {s t o p - g r a d} (\boldsymbol {h})), \tag {5} +$$ + +$$ +\ell_ {\text {m a i n}} (\boldsymbol {x}, \boldsymbol {y}) = \ell_ {c e} (\boldsymbol {p}, \boldsymbol {y}), \tag {6} +$$ + +$$ +\ell_ {\mathrm {e l p}} (\boldsymbol {x}, \boldsymbol {y}) = \ell_ {c e} (\boldsymbol {q}, \boldsymbol {y}). \tag {7} +$$ + +$C l s_{\mathrm{main}}$ is the main classifier, and it produces a probability prediction of $\pmb{p}$ . $C l s_{\mathrm{elp}}$ is the linear probe classifier, and it generates a probability prediction of $\pmb{q}$ . $C l s_{\mathrm{elp}}$ is trained in an online manner, but its optimization is detached from the main branch. "stop-grad" indicates that feature $\pmb{h}$ is detached to train $C l s_{\mathrm{elp}}$ . The gradients from the ELP classifier are unavailable to the backbone and main classifier, and vice versa. The main difference between the detached linear classifier and the test-time linear probe is that the features of the detached linear classifier are adaptively changed by the network, while the features of the test-time linear classifier are always fixed. + +Episodic weight re-initialization overcomes overfitting. Training the detached linear classifier with the same number of epochs as the main classifier would lead to the detached linear classifier overfitting the features. This overfitting should be avoided because the simple linear probe is supposed to reflect the discrimination of the features. If the ELP classifier memorizes all samples, it would not be competent to evaluate the features effectively. To prevent the ELP classifier from overfitting the training data, we reinitialize its parameters episodically every $\mathcal{I}$ epochs where $\mathcal{I}$ indicates episodic re-initialization interval. Specifically, given a linear classifier parameterized with $W$ and $b$ , where $W$ is the projection matrix, and $b$ is the bias, both $W$ and $b$ are randomly re-initialized at the interval of $\mathcal{I}$ epochs. + +The episodic linear probe enables us to measure and understand the feature discriminability throughout the training process. A larger value of $\mathcal{I}$ enforces the ELP classifier to be better trained, but it makes the ELP classifier more likely + +to be overfitted. In contrast, the ELP classifier is underfitted, if $\mathcal{I}$ is too small. An under-fitted ELP classifier may not well describe the generalization capabilities of the features. In practice, we set $\mathcal{I}$ as a hyper-parameter. Empirically, $\mathcal{I} = 2$ achieves consistent good probing performances across datasets. + +# 3.2. The ELP-Suitable Regularization + +ELP-Suitable Regularization through loss modulation. ELP assesses the features' separability in an online way. The standalone ELP is detached from the backbone and does not influence the main network. In this paper, we aim to utilize the prediction from the auxiliary ELP classifier to effectively improve the discriminability of the main branch. However, the design of this regularization is not straightforward. Considering the episodic nature of the ELP classifier, ELP's prediction is periodic and not as confident as the main classifier. If the regularization is not well constructed, the performance of the main branch would be severely impaired. + +In this paper, we introduce a simple formulation that modulates the cross-entropy loss with an adaptive factor $\phi$ , + +$$ +\mathcal {L} _ {E L P - S R} = \sum_ {i = 1} ^ {B} \operatorname {s t o p - g r a d} \left(\phi_ {i}\right) * \ell_ {c e} \left(\boldsymbol {p} _ {i}, \boldsymbol {y} _ {i}\right), \tag {8} +$$ + +where $\pmb{p}_i$ is the prediction probability from the main classifier, $B$ is the batch size. The scalar factor $\phi_i$ is assigned to each instance to modulate its cross-entropy loss adaptively. $\phi$ measures the main network's suitability for an ELP classifier. If an instance is not suitable for the ELP classifier, e.g., the instance may be not discriminative, or an out-of-distribution data point, $\phi$ imposes a relatively large value so that the network would pay more attention to this instance. Our ELP-Suitable Regularization (ELP-SR) effectively mitigates the intrinsic model bias and regularizes the network towards better linear separability. + +We detach the gradients from $\phi$ so that the factor only influences the magnitude of the loss gradients, but the gradient orientation is not altered. This makes the optimization progress relatively easy and stable. The strategy works surprisingly well in practice. + +The instantiation of the ELP-SR factor. As aforementioned, $\phi$ aims to measure the main network's suitability for an ELP classifier. Given an instance $x$ with the label $c$ , we instantiate the ELP-SR factor by considering the prediction score of the main classifier $(p^c)$ and the prediction of the ELP classifier $(q^c)$ . We utilize two elements when we construct the regularization factor $\phi$ . + +First, the distance metric $(D)$ between the prediction of the ELP classifier and the prediction of the main classifier should be concerned. The distance should reflect the main classifier's confidence gap compared to the ELP classifier. + +If the distance is minimized, the main classifier is pushed to act like a less-trained linear classifier. Relatively, The features would be remarkably discriminative if a less-trained classifier is already sufficient for recognizing. Therefore, this metric encourages the main classifier to become simpler, promoting the features to be more discriminative. We instantiate $D$ by simply computing the $\ell_1$ distance between $p^c$ and $q^c$ , i.e., $D = |p^c - q^c|$ . + +Second, we incorporate a normalization metric $(R)$ to reveal the discriminability of both the ELP classifier and the main classifier. The distance metric $(D)$ measures the relative confidence gap, but we should also consider the absolute values of the confidence scores. If the distance between $p^c$ and $q^c$ is small, but both absolute scores are low, the network has not been well optimized to classify the instance. Thus, we should normalize the distance with a normalization metric. For simplicity, we set $R$ as the average of $p^c$ and $q^c$ , i.e., $R = (p^c + q^c) / 2$ . + +We formulate the ELP-SR factor $\phi$ as, + +$$ +\phi = \left(\frac {D}{R}\right) ^ {\gamma} = \left(\frac {2 \left| p ^ {c} - q ^ {c} \right|}{p ^ {c} + q ^ {c}}\right) ^ {\gamma}, \tag {9} +$$ + +where $\gamma$ smoothly adjusts the rate between $D$ and $R$ . We empirically study other ELP-SR factor variants in the experiment section. + +# 3.3. Training and inference + +In the training phase, we calculate the softmax cross-entropy loss for both the main classifier and the ELP classifier. Our ELP-SR loss is summed with these losses. The overall training objective is below, + +$$ +\mathcal {L} = \sum_ {i = 1} ^ {B} \ell_ {\text {m a i n}} \left(\boldsymbol {p} _ {i}, \boldsymbol {y} _ {i}\right) + \ell_ {\mathrm {e l p}} \left(\boldsymbol {q} _ {i}, \boldsymbol {y} _ {i}\right) + \phi_ {i} * \ell_ {c e} \left(\boldsymbol {p} _ {i}, \boldsymbol {y} _ {i}\right) \tag {10} +$$ + +In the test phase, we remove the auxiliary ELP classifier and only keep the main classifier. The final prediction is obtained only from the main classifier. Our framework does not introduce any additional overhead during testing. + +# 4. Experiments + +In the challenges of diverse objects of images in the wild, our method shows significant superiority for generalization. We evaluate three classification tasks, i.e., fine-grained visual recognition, long-tailed recognition, and generic object recognition. First, since the classes in fine-grained recognition are similar, and samples are difficult to be recognized even by humans, the fine-grained recognition task brings extra challenges to learning discriminative features. Second, long-tailed recognition involves the extremely imbalanced distributions of data samples. This requests the + +method to possess generalization ability and recognize the tailed classes with limited samples. The evaluations of these tasks reveal the advantages of our method in improving visual representations. + +We further evaluate our method on ImageNet-1K to study the generalization ability of ELP-SR. Besides the classification accuracy metric, we also report the results of a k-nearest-neighbor (KNN) classifier on the test set. This further manifests the effectiveness of our method in improving the discriminability of feature representations. Moreover, we provide ablation studies to compare different $\gamma$ , $\mathcal{I}$ , and formulations of the ELP-SR factor. To further demonstrate the ability of the ELP classifier, we present a comparison of the linear classifier's accuracy. The results reflect that the network with ELP-SR produces more discriminative and generalized features. + +To be noticed, for all the tasks, we did NOT introduce any additional annotations nor incorporate extra parameters at the inference time. During testing, only the backbone networks are used to produce predictions. + +# 4.1. Fine-grained Visual Recognition + +Classes in fine-grained recognition are similar. They are difficult to distinguish, even for a human. Meanwhile, samples in every class are diverse [2]. Objects may be shown in various angles, illuminations, occlusions, backgrounds, etc. These induce fine-grained categories to show large intraclass variances, but small inter-class variances [2]. Samples in fine-grained classification are hard to be generalized and discriminated, which brings difficulties for learning discriminative features by networks. + +Dataset and Implementation Details. To show the efficacy, we compare the performances on three standard benchmarks: CUB-200-2011 (CUB) [53], Stanford Cars (CAR) [28], and FGVC-Aircarft (AIR) [36]. + +Following the same training procedure in [10], we adapt ResNet-50 [19] pre-trained by ImageNet [30] as the backbone model. As the regular augmentations [10, 16, 65] in this task, resizing, random crops, rotations, and horizontal flips are applied. After operating these standard transformations, the final inputs become $448 \times 448$ resolutions. Similar to the ResNet50 baseline [10, 65], we train our method for 240 epochs and optimize the loss function by SGD. In our method, we report the results of $\gamma = 3$ for all three datasets with $D = p^{c} - q^{c}$ and $R = (p^{c} + q^{c}) / 2$ . For CUB, CAR, and AIR, we set $\mathcal{I} = 2$ , 2, and 1, respectively. These are the best settings for parameters and will be discussed in the ablation section 4.4. + +Experimental Results. As in Table 1, our method achieves significant improvements based on the ResNet50 baseline. Without bells and whistles, our results are competitive or even outperform many recent methods with complicated network designs [24], additional augmentations [10, 16], or + +
MethodDataset
CUBCARAIR
B-CNN [34]84.191.384.1
HIHCA [6]85.391.788.3
RA-CNN [17]85.392.588.2
OPAM [38]85.892.2-
Kernel-Pooling [13]84.791.185.7
MA-CNN [62]86.592.889.9
MAMC [47]86.593.0-
HBP [58]87.193.790.3
DFL-CNN [55]87.493.191.7
NTS-Net [57]87.593.991.4
DCL [10]87.894.593.0
PMG [16]88.995.092.8
ACNet [24]88.194.692.5
LIO [65]88.094.592.7
ResNet50 Baseline85.592.790.3
ResNet50 Baseline + ELP-SR88.894.292.7
+ +multi-scale features [16, 65]. Merely utilizing naive backbone with ELP-SR in training, the simple backbone networks boost $3.3\%$ , $1.5\%$ , and $2.4\%$ respectively in three datasets which are significant improvements in this task. Boosts in this task reveal that our method effectively improves the networks' ability to discriminate and generalize samples. To further manifest the superiority of our method, more discussions will be presented in 4.4. + +# 4.2. Long-tailed Visual Recognition + +In long-tail recognition, the data distributions of different classes show extreme imbalance. As the long-tailed distribution, a handful of 'head' classes contain considerable samples, but a large number of tail' classes only include limited samples. The networks are biased toward 'head' classes, and the samples in tail' classes are hard to be generalized. In this section, we also evaluate the performances of our method under the challenging long-tailed distribution. + +Dataset and Implementation Details. The experiments are operated based on long-tailed CIFAR-10 and CIFAR-100 datasets [29]. We first produce several versions of long-tailed datasets following [7] under different imbalance ratios, which denotes the ratio between the largest and smallest numbers of samples in classes. We report the results in three kinds of imbalance ratios which are 100, 50, and 10, respectively. To perform fair comparisons, we evaluate our method based on the ResNet-32 baseline from [7]. + +Experimental Results. As shown in Table 2, ELP-SR dramatically improves the performances of the baseline method in all the settings and datasets. The improvements + +Table 1. Comparison of three benchmarks of fine-grained classification. Without additional augmentations or network designs, our method achieves significant improvements. + +
MethodCIFAR-10CIFAR-100
Imbalance ratio10050101005010
Focal Loss [32]70.476.786.738.343.955.7
CB Focal [12]74.679.387.139.645.258.0
Meta-weight [44]75.280.087.842.046.758.4
CDB-CE [45]---42.546.758.7
Mixup [61]73.177.888.339.645.058.2
ERM [7]70.474.886.438.343.955.7
ERM [7] + ELP-SR77.481.287.939.144.757.9
ERM [7] + ELP-SR (τ = 1)77.581.588.442.448.358.9
ERM [7] + ELP-SR (τ*)78.081.588.742.448.359.1
LDAM [7]77.081.088.242.046.658.7
LDAM [7] + ELP-SR78.282.388.143.948.259.1
+ +Table 2. Comparison of top-1 validation accuracy of different methods on imbalanced CIFAR-10 and CIFAR-100 datasets. All results are implemented based on ResNet-32. $\tau = 1$ indicates applying $\tau$ -normalization [26] with $\tau = 1$ . $\tau*$ stands for results with the best settings of $\tau$ . + +in CIFAR-10 of imbalance ratio 100 and 50 are even larger than LDAM [7]. Moreover, after adapting the normalization from [26], the results of our method show more competitiveness in this task. All results in different settings outperform LDAM. + +Besides, we further investigate our method based on the LDAM [7]. By minimizing the margin-based boundary considering the generalization [7], LDAM is well-designed for long-tailed recognition and boosts the performances dramatically. Meanwhile, our method can achieve higher performances on the foundation of LDAM. Though without specific consideration for the long-tailed distribution, ELP-SR offers general improvements to this task. These results demonstrate that our method helps the network generalize and produce discriminative features against the challenging distributions. + +# 4.3. Generic Visual Recognition on ImageNet + +To reveal the generalization of ELP-SR, we further investigate our method in generic object recognition on the standard benchmark for visual representation. + +Dataset and Implementation Details. We evaluate ELP-SR on ImageNet-1K [30], containing 1.28 million images with 1000 categories. To show the effectiveness and generalization, we apply ELP-SR on different backbone networks, which are ResNet-50 [19], ResNet-101 [19], ResNet-152 [19], BN-Inception [23], Inception-V3 [49], and Inception-ResNet-V2 [48]. According to the standard implementations of these works, we adapt SGD with momentum 0.9 as the optimizer. All the networks are trained with the augmentations of random crops and horizontal flips. For ResNet-50, ResNet-101, ResNet-152, and BN-inception, we first resize the images to $256 \times 256$ resolutions and then randomly crop them to $224 \times 224$ . For Inception-V3 and Inception-ResNet-V2, we resize to $320 \times 320$ and + +
BackboneTop-1 AccuracyTop-5 Accuracy
BaselineELP-SRBaselineELP-SR
ResNet5076.1376.8292.8693.32
ResNet10177.3777.8693.5494.06
ResNet15278.3178.7794.0494.42
BN-Inception73.52†74.0591.56†91.74
Inception-V377.4578.1293.5694.04
Inception-ResNet-V279.63†80.2294.79†95.24
SE-ResNet5077.0577.4593.4893.88
SE-ResNet10177.6277.9493.9394.38
SE-ResNet15278.4378.6194.2794.53
+ +randomly crop to $299 \times 299$ as the corresponding implementations in their works [48, 49]. As in Table 3, we report top-1 and top-5 accuracy respectively and compare all the backbones with ELP-SR. + +Experimental Results. As in Table 3, with ELP-SR, all backbone networks achieve performance gains. The results reveal that our method is valuable to various backbone models and generally ameliorates the representations of networks. Almost all the backbones obtain about a $0.5\%$ percent increase in top-1 accuracy. + +Furthermore, to verify the general improvements introduced by our method, we explore the performances of our method with SE-block [22]. As shown in Table 3, though SE-block already promotes the performances, our method leads to further boosts on the fundamental of SE-block [22]. $k$ -nearest neighbors accuracy. To reveal the effectiveness of our method, we provide an additional evaluation with the KNN classifier [56]. For feature vector $h$ , we select the top $k$ nearest neighbors by the weights $\exp(h \cdot h'/t)$ corresponding to the labels, where $h'$ indicates features from the training set and $t$ is a temperature term. We apply $t = 0.1$ in our experiments. + +As shown in Table 4, the results with 20 and 200 nearest neighbors are displayed. With the KNN classifier, our method outperforms the backbone network. This reflects that the features after training with ELP-SR become more discriminative. + +In all, the general improvements in all the backbones, methods, and tasks reflect that ELP-SR is not sensitive to particular networks, designs, or visual challenges. It provides a valuable regularization for visual representation learning. + +# 4.4. Ablation Studies + +# 4.4.1 Ablation on Hyper-parameters + +Episodic interval $\mathcal{I}$ . The number of periodical intervals prevents the ELP from overfitting the features. We experi + +Table 3. Comparison of single-crop accuracy $(\%)$ on the ImageNet-1K validation set. Different backbones with our method show significant improvements. To perform a fair comparison, $\dagger$ indicates the results implemented and re-trained by ours. + +
Method20200
ResNet5075.0473.21
ResNet50 + ELP-SR75.4873.88
+ +Table 4. KNN accuracy on ImageNet-1K. Results of accuracy with 20 and 200 nearest neighbors are presented. + +iment with the different values of $\mathcal{I}$ in the CUB dataset. As shown in Table 5, the performances are influenced by $\mathcal{I}$ . The larger $\mathcal{I}$ induces the degradation of performances. With plenty of training iterations, the ELP classifier tends to be overfitting and cannot measure generalization effectively. + +Besides, we also operate comparisons on the ImageNet dataset. The model achieves 76.13, 76.82, and 76.30 when $\mathcal{I}$ equals to 1, 2, and 3, respectively. The proper value of $\mathcal{I}$ can better empower the advantages of ELP. Minor $\mathcal{I}$ may not be sufficient for the construction of ELP. The more significant $\mathcal{I}$ may induce degradation of the ability of the ELP classifier to indicate features' discrimination. Thus, we apply $\mathcal{I} = 2$ in our experiments as this condition generally shows improvements in several datasets. + +$\gamma$ in the SR Factor. The parameter $\gamma$ is responsible for adjusting the intensity of regularization. Since $\frac{D}{R}$ is always lower than 1, the larger $\gamma$ leverages smaller regularization for the inputs. As shown in Table 5, we compare multiple conditions of $\gamma$ in fine-grained classification. The variances of $\gamma$ slightly influence the performances. A proper $\gamma$ leads to better performances but is not deterministic for fine-grained classification. Moreover, we evaluate different $\gamma$ values under the condition of $\mathcal{I} = 2$ on ImangeNet-1K. The recognition accuracies are 76.23, 76.82, and 76.30 when $\gamma$ is set to 1, 2, and 3, respectively. + +The Variations of SR Factor. We further investigate our ELP-SR in different forms, as shown in Table 6. First, for regularization, the confidences of the ELP classifier reflect the discriminability of features. Since the main classifier tends to be overfitting, $p^c$ is relatively higher and close to 1. Thus, a similar effect may occur for $1 - q^c$ and $p^c - q^c$ . As shown in Table 6, both formulations enable regularizing the networks to perform better while the model with $p^c - q^c$ achieves a higher result. This is because $p^c - q^c$ provides a more precise measurement of the deviation between the main classifier and the ELP classifier. + +Second, to formulate the normalization term, we require both confidence of the ELP classifier and the main classifier to become higher. The higher confidence of the main classifier indicates that the sample can be correctly recognized. This is a primary requirement for better representation of the feature. If the features are hard to recognize even for the main classifier, this may indicate that the visual representation quality is relatively low. It is a primary criterion that the network should provide at least recognizable features. As shown in Table 6, higher performances are + +shown if applying the normalization terms. Both $p^c + q^c$ and $p^c * q^c$ are valid to normalize our ELP-SR. Third, only the regularization of higher $q^c$ can also boost the performances. Without the normalization term, the impact of ELP-SR also guides the networks to be more generalized. However, lacking normalization, the improvements are relatively lower. Besides, simple normalization is also valuable. Since $\frac{2}{p^c + q^c}$ and $\frac{2}{p^c * q^c}$ also expect higher confidences of ELP, a similar influence may occur through leveraging the normalization term only. These results demonstrate that regularization and normalization are valuable in ELP-SR. Simultaneously, the combinations of both sides introduce a further increase in performances. + +Finally, we also operate ablations for the distillation of the probability of two classifiers. Remarkable decreases are shown in Table 6 of both conditions for L1 and L2 regressions. The network should not be optimized to solve features' discriminability directly. Distilling can lead the main classifier to perform similarly to the ELP classifier but does not encourage the network to be more generalized. If the main classifier is optimal according to the ELP classifier, the network can 'pretend' to achieve discriminative features. However, in testing, this 'cheating' is useless. Additionally, we replace the ELP classifier with a memory bank and update the memory by a momentum-based moving average. When the momentum is 0.9 and 0.1, the results are $86.1\%$ and $86.5\%$ , respectively. The results show that the moving average operation helps fine-grained recognition, but it provides a weaker regularization than the episodically initialized ELP classifier. + +# 4.4.2 Visualization + +To demonstrate the efficacy of our ELP, we present a visualization for the testing accuracy of our ELP based on CUB. In detail, we train the baseline method, take the features from the backbone to train ELP, but do not leverage ELP-SR for network training. Meanwhile, we take our method training with ELP-SR as the comparison. This is similar to applying linear probing for every epoch. Since ELP is reinitialized every two epochs for CUB, to better reveal the capacity of ELP under different conditions, we plot the accuracy every two epochs. As shown in Fig. 3, unseen features in the testing set are remarkably more recognizable. This indicates that the network with ELP-SR is more generalized and produces more discriminative features. Even for the simple classifier, the unseen samples represented by the network are easier to be classified. + +# 5. Conclusion + +In this paper, we propose episodic linear probing (ELP) to estimate the generalization and discriminability of features online. By ELP, we propose an ELP-suitable Reg- + +
ParameterI=1I=2I=3I=4I=5
γ=188.088.288.288.087.8
γ=288.088.588.288.087.8
γ=387.688.888.088.087.6
γ=487.588.087.887.887.5
+ +Table 5. Results for different values of $\mathcal{I}$ and $\gamma$ on CUB. $\mathcal{I}$ prevents the ELP from overfitting, and $\gamma$ adjusts the intensity of regularization. + +
FormulationDRTop-1 Accuracy
\(\frac{D}{R}\)\(p^c-q^c\)\(p^c+q^c\)76.82
\(p^c-q^c\)\(p^c*q^c\)76.75
\(1-q^c\)\(p^c+q^c\)76.78
\(1-q^c\)\(p^c*q^c\)76.70
D\(p^c-q^c\)-76.71
\(1-q^c\)-76.60
\(\frac{1}{R}\)-\(p^c+q^c\)76.25
-\(p^c*q^c\)76.23
DistillationL176.12
L276.18
+ +Table 6. Comparison for variations of SR Factor on ImageNet-1K. Various conditions are presented, including different formulations of $D$ and $R$ ,with or without $D$ and $R$ ,and direct distillation of the main and ELP classifier. + +![](images/c68feab3a1c85697d63a356aeed63d05360265e184732b7bc627cae4d3a468b2.jpg) +Figure 3. Curves of testing accuracy only with ELP classifier on CUB. Compared with our method, We utilize the baseline method that extracts the features from the backbone, trains ELP with features individually but does not leverage ELP-SR for the backbone training. Features trained with ELP-SR are more discriminative than the baseline and easier to be classified by simple ELP. + +ularization term (ELP-SR) to regularize the models. Our insights are two-fold. 1). Since the main classifier may be overfitting and its confidence may not indicate the discrimination of features, the ELP classifier provides additional regularization for more discriminative features. 2). Immediate suitability is effective in measuring the discrimination of features. An intuitive hypothesis is that if the features are highly discriminative, they should be recognizable by an easily learned linear classifier. Our ELP is episodically re-initialized, effectively mitigating overfitting and regularizing the network towards better linear separability. + +# References + +[1] Guillaume Alain and Yoshua Bengio. Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644, 2016. 1, 2, 3 +[2] Connor Anderson, Matt Gwilliam, Adam Teuscher, Andrew Merrill, and Ryan Farrell. Facing the hard problems in fgvc. arXiv preprint arXiv:2006.13190, 2020. 2, 5 +[3] Yuki M Asano, Christian Rupprecht, and Andrea Vedaldi. A critical analysis of self-supervision, or what we can learn from a single image. arXiv preprint arXiv:1904.13132, 2019. 1 +[4] Ali Borji and Laurent Itti. State-of-the-art in visual attention modeling. IEEE transactions on pattern analysis and machine intelligence, 35(1):185-207, 2012. 3 +[5] Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. arXiv preprint arXiv:1812.00332, 2018. 3 +[6] Sijia Cai, Wangmeng Zuo, and Lei Zhang. Higher-order integration of hierarchical convolutional activations for fine-grained visual categorization. In Proceedings of the IEEE International Conference on Computer Vision, pages 511-520, 2017. 6 +[7] Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems, 2019. 6 +[8] Arantxa Casanova, Michal Drozdal, and Adriana Romero-Soriano. Generating unseen complex scenes: are we there yet? arXiv preprint arXiv:2012.04027, 2020. 1 +[9] D. Chang, Y. Ding, J. Xie, A. K. Bhunia, X. Li, Z. Ma, M. Wu, J. Guo, and Y. Song. The devil is in the channels: Mutual-channel loss for fine-grained image classification. IEEE Transactions on Image Processing, 29:4683-4695, 2020. 3 +[10] Yue Chen, Yalong Bai, Wei Zhang, and Tao Mei. Destruction and construction learning for fine-grained image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 5, 6 +[11] 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 +[12] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9268-9277, 2019. 6 +[13] Yin Cui, Feng Zhou, Jiang Wang, Xiao Liu, Yuanqing Lin, and Serge Belongie. Kernel pooling for convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2921-2930, 2017. 6 +[14] Bo Dai, Sanja Fidler, Raquel Urtasun, and Dahua Lin. Towards diverse and natural image descriptions via a conditional gan. In Proceedings of the IEEE International Conference on Computer Vision, pages 2970-2979, 2017. 3 + +[15] Amit Dhurandhar, Karthikeyan Shanmugam, Ronny Luss, and Peder Olsen. Improving simple models with confidence profiles. arXiv preprint arXiv:1807.07506, 2018. 3 +[16] Ruoyi Du, Dongliang Chang, Ayan Kumar Bhunia, Jiyang Xie, Yi-Zhe Song, Zhanyu Ma, and Jun Guo. Fine-grained visual classification via progressive multi-granularity training of jigsaw patches. In European Conference on Computer Vision, 2020. 5, 6 +[17] Jianlong Fu, Heliang Zheng, and Tao Mei. Look closer to see better: Recurrent attention convolutional neural network for fine-grained image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4438-4446, 2017. 6 +[18] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729-9738, 2020. 3 +[19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770-778, 2016. 3, 5, 6 +[20] Robert Hecht-Nielsen. Theory of the backpropagation neural network. In Neural networks for perception, pages 65-93. Elsevier, 1992. 3 +[21] Evan Hernandez and Jacob Andreas. The low-dimensional linear geometry of contextualized word representations. arXiv preprint arXiv:2105.07109, 2021. 3 +[22] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018. 3, 7 +[23] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448-456. PMLR, 2015. 6 +[24] Ruyi Ji, Longyin Wen, Libo Zhang, Dawei Du, Yanjun Wu, Chen Zhao, Xianglong Liu, and Feiyue Huang. Attention convolutional binary neural tree for fine-grained visual categorization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10468-10477, 2020. 5, 6 +[25] Lu Jiang, Deyu Meng, Shouou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander Hauptmann. Self-paced learning with diversity. Advances in Neural Information Processing Systems, 27:2078-2086, 2014. 3 +[26] Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations, 2020. 6 +[27] Ivan Krasin, Tom Duerig, Neil Alldrin, Andreas Veit, Sami Abu-El-Haija, Serge Belongie, David Cai, Zheyun Feng, Vittorio Ferrari, Victor Gomes, Abhinav Gupta, Dhyanesh Narayanan, Chen Sun, Gal Chechik, and Kevin Murphy. Openimages: A public dataset for large-scale multi-label and multi-class image classification. Dataset available from https://github.com/openimages, 2016.1 + +[28] 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. 5 +[29] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 2, 6 +[30] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84-90, 2017. 1, 3, 5, 6 +[31] 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. 3 +[32] 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. 3, 6 +[33] 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. 3 +[34] 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. 6 +[35] Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X. Yu. Large-scale long-tailed recognition in an open world. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 2 +[36] S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013. 5 +[37] Volodymyr Mnih, Nicolas Heess, Alex Graves, et al. Recurrent models of visual attention. In Advances in neural information processing systems, pages 2204-2212, 2014. 3 +[38] Yuxin Peng, Xiangteng He, and Junjie Zhao. Object-part attention model for fine-grained image classification. IEEE Transactions on Image Processing, 27(3):1487-1500, 2017. 6 +[39] David E Rumelhart, Richard Durbin, Richard Golden, and Yves Chauvin. Backpropagation: The basic theory. Backpropagation: Theory, architectures and applications, pages 1-34, 1995. 3 +[40] Mohammad Sabokrou, Mohammad Khalooei, and Ehsan Adeli. Self-supervised representation learning via neighborhood-relational encoding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8010-8019, 2019. 2 +[41] Vikash Sehwag, Mung Chiang, and Prateek Mittal. On separability of self-supervised representations. ICML workshop on Uncertainty and Robustness in Deep Learning (UDL), 2020. 2, 3 +[42] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via + +gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pages 618-626, 2017. 1 +[43] Connor Shorten and Taghi M Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 6(1):1-48, 2019. 2 +[44] Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Meta-weight-net: Learning an explicit mapping for sample weighting. arXiv preprint arXiv:1902.07379, 2019. 3, 6 +[45] Saptarshi Sinha, Hiroki Ohashi, and Katsuyuki Nakamura. Class-wise difficulty-balanced loss for solving class-imbalance. In Proceedings of the Asian Conference on Computer Vision, 2020. 6 +[46] Cory Stephenson, Suchismita Padhy, Abhinav Ganesh, Yue Hui, Hanlin Tang, and SueYeon Chung. On the geometry of generalization and memorization in deep neural networks. arXiv preprint arXiv:2105.14602, 2021. 1 +[47] Ming Sun, Yuchen Yuan, Feng Zhou, and Errui Ding. Multi-attention multi-class constraint for fine-grained image recognition. In Proceedings of the European Conference on Computer Vision (ECCV), pages 805–821, 2018. 6 +[48] Christian Szegedy, Sergey Ioffe, and Vincent Vanhoucke. Inception-v4, inception-resnet and the impact of residual connections on learning. CoRR, abs/1602.07261, 2016. 3, 6, 7 +[49] 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. 6, 7 +[50] Martin A Tanner and Wing Hung Wong. The calculation of posterior distributions by data augmentation. Journal of the American statistical Association, 82(398):528-540, 1987. 2 +[51] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. 1 +[52] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008, 2017. 3 +[53] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 5 +[54] Rui Wang, Dongdong Chen, Zuxuan Wu, Yinpeng Chen, Xiyang Dai, Mengchen Liu, Yu-Gang Jiang, Luowei Zhou, and Lu Yuan. Bevt: Bert pretraining of video transformers. arXiv preprint arXiv:2112.01529, 2021. 3 +[55] Yaming Wang, Vlad I Morariu, and Larry S Davis. Learning a discriminative filter bank within a cnn for fine-grained recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4148-4157, 2018. 6 +[56] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3733-3742, 2018. 2, 7 + +[57] Ze Yang, Tiange Luo, Dong Wang, Zhiqiang Hu, Jun Gao, and Liwei Wang. Learning to navigate for fine-grained classification. In Proceedings of the European Conference on Computer Vision (ECCV), pages 420-435, 2018. 6 +[58] Chaojian Yu, Xinyi Zhao, Qi Zheng, Peng Zhang, and Xinge You. Hierarchical bilinear pooling for fine-grained visual recognition. In Proceedings of the European conference on computer vision (ECCV), pages 574-589, 2018. 6 +[59] Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818-833. Springer, 2014. 1 +[60] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. 1, 2 +[61] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 6 +[62] Heliang Zheng, Jianlong Fu, Tao Mei, and Jiebo Luo. Learning multi-attention convolutional neural network for fine-grained image recognition. In Proceedings of the IEEE international conference on computer vision, pages 5209–5217, 2017. 6 +[63] Zhedong Zheng, Liang Zheng, and Yi Yang. Unlabeled samples generated by gan improve the person re-identification baseline in vitro. In Proceedings of the IEEE international conference on computer vision, pages 3754–3762, 2017. 2 +[64] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001-13008, 2020. 2 +[65] Mohan Zhou, Yalong Bai, Wei Zhang, Tiejun Zhao, and Tao Mei. Look-into-object: Self-supervised structure modeling for object recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 5, 6 \ No newline at end of file diff --git a/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/images.zip b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0ba4d55d5fc868999903836fac4c4649f64c33b7 --- /dev/null +++ b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a62df581a55a6be6abbf171f5d3022dc860efc03f597abef864009e81aab41a +size 322612 diff --git a/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/layout.json b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e2f20cd2583c64cb594caae57af27b2868f74789 --- /dev/null +++ b/asimpleepisodiclinearprobeimprovesvisualrecognitioninthewild/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41888fd19f8e7a38295c07dd8b5fa7de64af5f8da4c9c26a472f481bc08bb1e5 +size 446546 diff --git a/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_content_list.json b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3a8225cfa710c6aa57f5c68cdaa210ca99c2aee4 --- /dev/null +++ b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2ab77f629d81f7a820f7d47c34382b6f93bc4b6f3a93ee867fb247de8f73626 +size 79205 diff --git a/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_model.json b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c2518181ab7b70cb6e9567ac490261bac260eaab --- /dev/null +++ b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a7459e010e78b9bdaeb6ba8fcc3582e906fcdde251bb63ef1662a693646ee1e +size 97757 diff --git a/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_origin.pdf b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b3e5415cded8b19165855068053e727829b31c15 --- /dev/null +++ b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/fbb3683e-4bd3-4d13-80a0-67c4dfab1032_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:820569a57951480c3ad08f864b08f9220b07e2c596ba3868129b6c7abdfc11fc +size 568369 diff --git a/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/full.md b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3454890d2a609d91794fed3643ffa14e62dcaf37 --- /dev/null +++ b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/full.md @@ -0,0 +1,270 @@ +# A Simple Multi-Modality Transfer Learning Baseline for Sign Language Translation + +Yutong Chen $^{1*}$ Fangyun Wei $^{2}$ Xiao Sun $^{2}$ Zhirong Wu $^{2}$ Stephen Lin $^{2}$ + +$^{1}$ Tsinghua University $^{2}$ Microsoft Research Asia + +chenytjudy@gmail.com {fawe, xias, wuzhiron, stevelin}@microsoft.com + +# Abstract + +This paper proposes a simple transfer learning baseline for sign language translation. Existing sign language datasets (e.g. PHOENIX-2014T, CSL-Daily) contain only about 10K-20K pairs of sign videos, gloss annotations and texts, which are an order of magnitude smaller than typical parallel data for training spoken language translation models. Data is thus a bottleneck for training effective sign language translation models. To mitigate this problem, we propose to progressively pretrain the model from general-domain datasets that include a large amount of external supervision to within-domain datasets. Concretely, we pretrain the sign-to-gloss visual network on the general domain of human actions and the within-domain of a sign-to-gloss dataset, and pretrain the gloss-to-text translation network on the general domain of a multilingual corpus and the within-domain of a gloss-to-text corpus. The joint model is fine-tuned with an additional module named the visual-language mapper that connects the two networks. This simple baseline surpasses the previous state-of-the-art results on two sign language translation benchmarks, demonstrating the effectiveness of transfer learning. With its simplicity and strong performance, this approach can serve as a solid baseline for future research. + +# 1. Introduction + +Sign languages are visual signals for communication among the deaf and hard of hearing. These languages are primarily expressed through manual articulations, but are also greatly aided by the movement of body, head, mouth, eyes and eyebrows. While technology for automatic machine translation of spoken languages have successfully been deployed in production [8,25,33,44], research on sign language translation (SLT) lags behind and is still in early-stage development. An effective system for automatic sign language translation may help to build a bridge between + +![](images/ec7356e4651f105cada182f5790259cc7a412e49f22dddd5e0d4f2ad5197be86.jpg) +Figure 1. We decouple sign language translation into a visual task (left part) and a language task (right part), and propose a visual-language mapper (V-L Mapper) to bridge the connection between them. The decoupling allows both the visual and language networks to be effectively and independently pretrained before joint training. Both spatio-temporal information from sign videos and semantic knowledge from text transcriptions are encoded through VL-Mapper. + +hearing-impaired and unimpaired people. + +Existing sign language translation methods follow the framework of neural machine translation (NMT) originally developed for spoken languages [4-6, 46, 49, 50], with the distinction that the source language is represented as spatiotemporal pixels instead of discrete tokens. To be concrete, sign videos are first fed into a video backbone network to extract an intermediate representation, which is then mapped to the target language text via NMT. The intermediate representation is usually supervised by glosses1 [6, 49, 50], where each gloss corresponds to the semantic meaning of a single sign (e.g. happy, sad) in the continuous video input. + +Despite adopting the formulation of advanced neural machine translation, the current results are far from sat- + +isfactory. The best reported sign language translation performance [49] on the PHOENIX-Weather-2014T test dataset [4] is 24.32 in terms of BLEU-4, while a baseline transformer achieves a 30.9 BLEU-4 score for English to German translation [33]. We hypothesize that the key factor that hinders the progress of sign language translation is the scale of the training data. To effectively train a typical NMT model, it usually requires a corpus of 1M paralleled samples [42]. However, existing sign language datasets are an order of magnitude smaller, containing only fewer than 20K paralleled samples [4, 49]. + +In this paper, we study a multi-modal pretraining approach to cope with the data scarcity issue for sign language translation. While pretraining and transfer learning has greatly improved performance in tasks of vision [11, 17, 34], language [10, 25, 27, 33, 40] and cross-modality [26, 31, 35, 39, 47], they are still under explored in SLT. Our work aims to exploit their strength in SLT. + +SLT can be broken down into two disjoint tasks: a visual action recognition task that converts sign videos into semantic glosses (Sign2Gloss), and a language translation task that maps glosses into spoken language texts (Gloss2Text). Our transfer learning approach progressively pretrains each task separately and then finetunes the joint model. For Sign2Gloss, we first pretrain the visual model on a general domain to learn generic human actions [21, 28], and then we transfer it to within the domain to learn fine-grained glosses. Similarly for Gloss2Text, we adopt mBART [33], a denoising auto-encoder pretrained on a large-scale general-domain multilingual corpus, and transfer it to the within-domain task of gloss-to-text translation. By leveraging existing datasets and supervisions that can effectively transfer to sign language translation, the necessity of gathering large parallel data is lessened. + +With well-trained Sign2Gloss and Gloss2Text modules, we can build a two-staged pipeline known as Sign2Gloss2Text to generate a gloss sequence from the video and then translate the predicted gloss sequence into text. This two-staged pipeline is also implemented in [4, 6, 46, 49] and shows promising results. However, glosses are discrete representations of the language modality, without encoding any spatio-temporal visual information from sign videos such as facial expressions2, which may lead to degraded translation performance. For example, hearing-impaired individuals use exaggerated facial expressions to convey the adverb 'Extremely', but this kind of information is ignored in gloss annotation. In contrast, labelers and linguists have to take into account these adverbs to produce translated sentences that are complete and semantically accurate. Incorporation of both visual and language modalities is thus needed. + +To this end, we introduce a visual-language mapper which connects the visual features before gloss classification in the visual model to the gloss embedding in the translation model. With this mapper, the full model is jointly optimized and the discrete gloss representation is circumvented in joint training. The mapper is simply implemented as a fully connected MLP with two hidden layers. Figure 1 shows our design. + +In contrast to previous works which attempt to improve translation performance by integrating multiple cues from mouthing or pose in a handcrafted manner [5, 50] or by adopting advanced machine translation techniques such as back-translation [49], our overall framework is extremely simple, resulting in a transfer learning approach on top of a standard NMT model. Some previous works conduct transfer learning for SLT by pretraining visual backbone on human action recognition [29] or loading pretrained word embeddings [29, 46], while we are the first to adopt both general-domain and within-domain pretraining in a progressive manner and incorporate pretrained spoken language model into SLT. Our experimental results demonstrate that this progressive pretraining of visual and translation models greatly boosts performance. Our simple approach surpasses all existing methods by large margins, including those that employ semi-supervised learning, on PHOENIX-2014T [4] and CSL-Daily [49]. + +# 2. Related Work + +Sign Language Recognition. A fundamental task in sign language understanding is Isolated Sign Language Recognition (ISLR), which aims to identify a single gloss word label for a short video clip [2, 19, 20, 28, 30, 43]. The more challenging task of Continuous Sign Language Recognition (CSLR) seeks to convert a continuous sign video into a gloss sequence using only weak sentence-level annotations [9, 22, 23, 37, 50]. Our work fully exploits gloss annotations for SLT by transferring within-domain knowledge from ISLR to CSLR and SLT. + +Sign Language Translation. Sign Language Translation (SLT) aims to translate a raw video sequence to a spoken language sentence [4-6, 12, 29, 46, 49, 50]. Existing works attempt to formulate this task as a neural machine translation (NMT) problem. However, unlike NMT which benefits from a large-scale parallel corpus, SLT greatly suffers from data scarcity. To tackle this issue, [6] jointly trains SLR and SLT to enforce regularization on the translation encoder; [49] proposes a data augmentation strategy of back-translating text to visual features using glosses as the pivot. Moreover, [5, 50] manually design sophisticated multi-cue channels to model the collaboration of multiple visual cues in sign language, and [29] introduces a temporal semantic pyramid network to capture multiple levels of temporal granularity in sign videos. Compared to these ef + +![](images/0458a295152ad338382ccd4da21a3336b39f8d5e0b50d8aae0e24b78a2bbc4ad.jpg) +Figure 2. Overview of our framework. We decouple sign language translation into a visual task and a language task. The proposed visual-language mapper (V-L Mapper) establishes a bridge between features of the visual modality and language modality for end-to-end training. The decoupling allows both visual and language networks to be progressively and independently pretrained. + +forts, our method is simple yet more effective by utilizing a large amount of external supervision through progressive pretraining. + +Action Recognition. A related research field that may facilitate visual modeling of sign language is action recognition, where many works focus on network architecture [7, 13, 14, 38, 45] and large-scale dataset construction [15, 18, 21]. As fine-grained gesture understanding is a special case of human action recognition, some works for ISLR [2, 28, 30] and SLT [29] initialize their visual network with weights pretrained on action classification task. We employ general-domain pretraining on action recognition together with within-domain pretraining on Sign2Gloss in a progressive manner. + +Pretraining for Text Generation. Recently, the NLP community has seen rapid progress in large-scale self-supervised pretraining [8, 10, 27, 40, 41], which brings significant gains on downstream tasks. In particular, pretraining a language model on a large-scale monolingual corpus brings large improvements in low-resource NMT [1, 3, 8, 33]. Some multi-modality tasks such as image caption and VQA also leverage pretrained language models as initialization for bi-modal transformers [31, 35, 48]. As sign language is a full-fledged language system, powerful NLP techniques can likely be extended into SLT to help address the data-scarcity issue. We are the first to apply a pretrained language model for spoken language in SLT. + +Transfer learning in SLT. Some previous works attempt to transfer external vision or language knowledge to SLT. For visual pretraining, [29] pretrains the visual backbone on Kinetics-400 [21] and two ISLR datasets [20, 28]. [4, 6, 49, 50] pretrain their visual backbones on within-domain Sign2Gloss task with gloss annotations. We adopt both general-domain and within-domain pretraining in a progressive manner. For language pretraining, [29, 46] load pretrained word embeddings into the decoder embedding layer + +but fail to demonstrate their effectiveness. We are the first to leverage powerful pretrained language models, which brings significant improvement. + +# 3. Method + +In this section, we introduce our simple method for sign language translation. Given an input sign video $\mathcal{V} = (v_{1},\dots,v_{T})$ with $T$ frames, our goal is to learn a neural network $N_{\theta}(\cdot)$ that can predict the associated spoken language sentence $\mathcal{S} = (s_1,\dots,s_U)$ with $U$ words directly from the sign video $\mathcal{V}$ : + +$$ +\mathcal {S} = N _ {\theta} (\mathcal {V}). \tag {1} +$$ + +In order to transfer knowledge from general domains of action recognition and machine translation, we break down the SLT framework into two disjoint tasks: a visual action recognition task that converts the sign videos to semantic glosses (Sign2Gloss), and a language translation task that maps glosses to spoken language texts (Gloss2Text). This allows us to pretrain each task separately and then finetune the joint model. + +In our approach, the overall network $N_{\theta}(.)$ is composed of three sub-networks: 1) a visual encoder network $\mathcal{E}$ that transforms raw video into visual features; 2) a sequence-to-sequence translation network $\mathcal{D}$ that translates language features into spoken language text; 3) a visual-language mapper $\mathcal{M}$ that bridges between features of the visual modality and language modality for joint training. The framework is illustrated in Figure 2. + +In this work, we demonstrate that using such a simple, no-frills framework can achieve high sign language translation performance. Besides its simplicity and high performance, we reveal that the bottleneck of current SLT systems mainly lies in the lack of training data, so that a more flexible architecture that can leverage as much training data as possible via pretraining, from both the vision and language sides, is superior. + +![](images/1cee2c826b19e64b6665926d00548d6d00fe54d9ce144215c3af601274eeecaa.jpg) +Figure 3. Architecture of our visual encoder network. + +# 3.1. Visual Encoder Network and Pretraining + +The visual encoder network $\mathcal{E}$ transforms the raw video input into a visual feature. The visual feature in this stage is mainly used to predict gloss labels, which is essentially a fine-grained action recognition task. Figure 3 shows the network architecture, which consists of a video backbone and a lightweight head to further encode temporal information. + +Video Backbone. We use S3D [45] as our backbone due to its excellent trade-off between performance and inference speed. We feed each $T \times 224 \times 224 \times 3$ video into the backbone. Only the first four blocks of S3D are used since our goal is to extract a dense representation for gloss sequence prediction, and thus the extracted S3D features are of size $T / 4 \times 832$ after spatial pooling. The extracted features then serve as the input of our head network. + +Head Network. As shown in Figure 3, our lightweight head network consists of a projection block containing a temporal linear layer, a batch normalization layer, and a ReLU layer, as well as a temporal convolutional block which contains two temporal convolutional layers with a temporal kernel size of 3 and a stride of 1, a linear translation layer, and a ReLU layer. We feed the S3D features into the projection block and the following temporal convolutional block to generate $\mathcal{Z} \in \mathcal{R}^{T/4 \times 512}$ . We call it a gloss representation since it represents gloss categories in the high dimensional space. Then a linear classifier and a Softmax function are applied to extract frame-level gloss probabilities $\mathcal{P} \in \mathcal{R}^{T/4 \times K}$ , where $K$ is the size of the gloss vocabulary. + +Progressive Pretraining. We progressively pretrain the visual encoder $\mathcal{E}$ by first pretraining it in a general domain to learn generic human actions and then transferring it + +to the within-domain task of learning fine-grained glosses. Specifically, for general-domain pretraining, we pretrain our S3D backbone on Kinetics-400, an action recognition dataset [21] and then WLASL, an isolated sign recognition dataset [28]. Next, for within-domain pretraining, we train our visual encoder under the Sign2Gloss task supervised by the continuous gloss annotations provided in SLT datasets. + +Unlike spoken language texts, the continuous gloss annotations are chronologically consistent with the sign signals. We utilize the well-known connectionist temporal classification (CTC) loss [16] for within-domain pretraining under the supervision of gloss annotations. The CTC loss considers all possible alignments between two sequences while minimizing the error. Concretely, for an input video $\mathcal{V}$ and the corresponding ground truth gloss sequence $\mathcal{G}$ , we use CTC to compute $p(\mathcal{G}|\mathcal{V})$ by marginalizing over all possible $\mathcal{V}$ to $\mathcal{G}$ alignments: + +$$ +p (\mathcal {G} | \mathcal {V}) = \sum_ {\pi \in \mathcal {B}} p (\pi | \mathcal {V}), \tag {2} +$$ + +where $\pi$ denotes a path and $\mathcal{B}$ is the set of all viable paths that correspond to $\mathcal{G}$ . The probability $p(\pi|\mathcal{V})$ is computed by the visual encoder $\mathcal{E}$ . The CTC loss is then formulated as + +$$ +\mathcal {L} = - \ln p (\mathcal {G} | \mathcal {V}). \tag {3} +$$ + +Gloss Sequence Prediction. Once the pretraining is finished, our visual encoder network can be used to predict gloss sequences given sign videos. As shown in Figure 3, we first use our visual encoder to extract gloss probabilities, then CTC decoding is utilized to generate the predicted gloss sequence. Details of the CTC decoding can be found in the supplementary materials. + +# 3.2. Translation Network and Pretraining + +Now we introduce the translation network $\mathcal{D}$ , which learns a mapping between gloss sequences and spoken language texts, and present the corresponding progressive pretraining procedure. + +Translation Network. Inspired by the recent progress of neural machine translation and multilingual denoising pretraining, we use mBART [33], a sequence-to-sequence denoising auto-encoder pretrained on large-scale multi-lingual corpus, as initialization for our translation network. The architecture is a standard sequence-to-sequence Transformer [44] with 12 layers for the encoder, 12 layers for the decoder, and a model dimension of 1024 on 16 heads. + +Progressive Pretraining. With mBART initialization, our translation network is already pretrained in the general language domain. We further conduct within-domain pretraining on the Gloss2Text task to transfer mBART to the specific domain of gloss-to-text translation. Our goal is to train a translation network that can predict a text sentence $S$ from a given gloss sequence $\mathcal{G}$ . Concretely, we split + +both $\mathcal{G}$ and $S$ into sub-word units using mBART's SentencePiece tokenizer [24] and project one-hot vectors into dense embeddings via mBART's pretrained word embedding layer. Then, we add positional embeddings to the word embeddings as inputs to the bottoms of the encoder and decoder stacks. We train mBART on the Gloss2Text corpus to minimize the sequence-to-sequence cross-entropy loss $\mathcal{L} = -\log P(S|\mathcal{G})$ . After obtaining a well-trained translation model, we can predict spoken language sentences given gloss sequences. Translating from ground-truth sign gloss sequences to spoken language texts (Gloss2Text) is regarded as a virtual upper bound for performance on the SLT task [4, 6]. The two-stage translation task that first utilizes a Sign2Gloss model (our visual encoder) to generate a gloss sequence and then feeds the predicted gloss sequence to a well-trained Gloss2Text pipeline is known as Sign2Gloss2Text. However, using glosses as the intermediate representations may be sub-optimal since glosses cannot fully encode spatio-temporal visual information. To overcome this limitation, we bridge vision and language modalities via our V-L mapper for joint training. + +# 3.3. End-to-end Sign Language Translation + +So far, we have described the architectures and the pretraining processes of our visual encoder and translation network. Now we introduce the Visual-Language Mapper (V-L Mapper), which builds a connection between the two networks modeling different modalities for the purpose of joint training. Our V-L Mapper is simply implemented as a fully-connected MLP with two hidden layers. As shown in Figure 2, it converts visual features extracted by the visual encoder to language features, which are subsequently taken as the input of the translation encoder. We study the effects of feeding different visual features into the V-L Mapper in Section 4.4.3, and use gloss representations (see Figure 3) as our default setting. Thanks to the V-L Mapper, our framework can be trained in an end-to-end manner, under the joint supervision of the CTC loss and translation loss. Surprisingly, our framework even outperforms the acknowledged upper bound, i.e., translating from ground-truth sign gloss sequences to spoken language texts by using a well-trained Gloss2Text model, on the RWTHPHOENIX-Weather-2014T test set. This is because our framework encodes both spatio-temporal information from sign videos and semantic knowledge from text transcriptions, providing more clues compared with the Gloss2Text model of only the language modality. + +# 4. Experiments + +# 4.1. Datasets and Evaluation Metrics + +RWTH-PHOENIX-Weather 2014T. PHOENIX-2014T [4] is the most widely used benchmark for SLT in recent years [4, 6, 46, 49, 50]. The parallel corpus is collected + +from weather forecast news of the German public TV station PHOENIX over three years, including 8k triplets of RGB sign language videos of nine signers performing German Sign Language (DGS), sentence-level gloss annotations, and German translations transcribed from the news speaker. It contains 7096, 519 and 642 video segments in train, dev and test splits, respectively. The vocabulary size is 1066 for sign glosses and 2887 for German text. We compare our method with state-of-the-art methods on both the dev set and the test set. All ablation studies are conducted on this dataset. + +CSL-Daily. CSL-Daily [49] is a recently published Chinese sign language (CSL) translation dataset recorded in a studio. It contains 20k triplets of (video, gloss, text) performed by ten different signers. The content contains topics such as family life, medical care, and school life. CSL-Daily contains 18401, 1077 and 1176 segments in train, dev and test splits. The vocabulary size is 2000 for sign glosses and 2343 for Chinese text. We compare our approach with state-of-the-art methods on both the dev set and test set. + +Evaluation Tasks. We examine performance on the following tasks: + +- Sign2Gloss: Predict the gloss sequence given raw video input. This task is also known as CSLR (Continuous Sign Language Recognition). This task is mainly used to evaluate our visual encoder. +- Gloss2Text: Translate a ground-truth gloss sequence to text. Its results are generally regarded as an upper bound for the sign language translation task. We also use this task to evaluate our translation model. +- Sign2Gloss2Text: A two-stage pipeline where we first adopt a Sign2Gloss module to predict a gloss sequence and then translate the predicted glosses to text by a Gloss2Text module. We use this to evaluate pipelines in which the visual encoder and the translation model are connected by the predicted gloss sequence. +- Sign2Text: Directly translate sign language video into text, which is our goal. + +Following previous work [4, 6, 49, 50], we use Word Error Rate (WER) to evaluate Sign2Gloss, and ROUGE [32] and BLEU [36] to evaluate the other three tasks. + +# 4.2. Implementation details + +Our model is implemented in PyTorch. Details about all hyperparameters are given in the supplementary materials. + +Visual Encoder Pretraining. We progressively pretrain the visual encoder from general domain to within domain. First we pretrain the S3D backbone on two action recognition datasets sequentially, namely Kinetics-400 [21], the most popular human action recognition dataset containing 400 action classes, and WLASL [28], a large-scale Word-Level American Sign Language video datasets containing 2000 isolated sign classes. The training procedure follows [45]. + +
Sign2Gloss2Text (two-stage)DevTest
RB1B2B3B4RB1B2B3B4
SL-Luong [4]44.1442.8830.3023.0218.4043.8043.2930.3922.8218.13
SL-Transf [6]-47.7334.8227.1122.11-48.4735.3527.5722.45
BN-TIN-Transf [49]47.8347.7234.7826.9421.8647.9847.7435.2727.5922.54
BN-TIN-Transf + BT* [49]49.5349.3336.4328.6623.5149.3548.5536.1328.4723.51
STMC-Transf [46]46.3148.2735.2027.4722.4746.7748.7336.5329.0324.00
Ours50.2350.3637.5029.6924.6349.5949.9437.2829.6724.60
Sign2Text (end-to-end)RB1B2B3B4RB1B2B3B4
SL-Luong† [4]31.8031.8719.1113.169.9431.8032.2419.0312.839.58
TSPNet-Joint† [29]-----34.9636.1023.1216.8813.41
SL-Transf [6]-47.2634.4027.0522.38-46.6133.7326.1921.32
STMC-T [50]48.2447.6036.4329.1824.0946.6546.9836.0928.7023.65
BN-TIN-Transf + BT* [49]50.2951.1137.9029.8024.4549.5450.8037.7529.7224.32
Ours53.1053.9541.1233.1427.6152.6553.9741.7533.8428.39
+ +Table 1. Comparison with state-of-the-art methods on PHOENIX-2014T. † denotes methods without using gloss annotations. * denotes methods with semi-supervised learning. ‘R’ represents ROUGE, and ‘B1’ denotes BLEU-1, with the same for ‘B2-B4’. Our framework outperforms all methods by large margins. + +Video clips are fed through five blocks in S3D backbone followed by a 3D average pooling layer and a linear classification layer to predict the action class. Next we conduct within-domain pretraining on Sign2Gloss task using the CTC loss (Eq. 3), where we only use the first four blocks of the pretrained S3D and spatially pool the S3D features to the size of $T / 4 \times 832$ as inputs of our head network. + +Translation Pretraining. For general-domain pretraining, we initialize our language model with the official release of mBART-large-cc253 which is pretrained on CC25, a multilingual corpus of size 1300GB from Common Crawl4 that covers 25 languages. We also try GPT2 [40] pretrained on 16GB German monolingual corpus. Unless otherwise specific, we use mBART by default. + +Joint Training. We load the two independently pretrained modules as the initialization for joint training. The features before the linear classifier, i.e. gloss representation, are projected into vectors of 1024 dimension by the V-L Mapper and position embeddings are added to them to form inputs to the translation encoder. The whole network is trained under the joint supervision of the CTC loss and cross-entropy loss with both weights set to 1.0. + +# 4.3. Comparison with State-of-the-art Methods + +We compare our approach to state-of-the-art methods on PHOENIX-2014T and CSL-Daily, as shown in Table 1 and Table 2. Without integrating multi-cue features [5, 50] nor advanced data augmentation strategies such as back translation [49], our simple method significantly surpasses all + +counterparts on PHOENIX-2014T and CSL-Daily. + +# 4.4. Ablation Study + +# 4.4.1 Pretraining of Visual Encoder + +Our visual encoder is pretrained in a progressive manner. We first study the effects of using different general-domain pretraining strategies: + +- Scratch. No general-domain pretraining is conducted. The S3D backbone is trained from scratch. +- K-400. General-domain pretraining is done on Kinetics-400 [21], a large-scale action recognition set. +- K-400 $\longrightarrow$ WLASL. We further pretrain the K-400 pretrained S3D backbone on WLASL [28], a large-scale word-level sign language recognition dataset. + +We conduct within-domain Sign2Gloss pretraining on these pretrained models and report the effects on both the Sign2Gloss and Sign2Text tasks in Table 3. The performance of Sign2Gloss directly reflects the effects of different general-domain pretrained models. Although K-400 is an action classification dataset, using the model pretrained on it as initialization nevertheless improves Sign2Gloss performance compared to the model trained from scratch, reducing the WER from 28.06 to 23.50 on the test set. Using K-400 $\longrightarrow$ WLASL as the initialization further boosts performance, achieving 22.45 WER on the test set. Though there exist differences between WLASL and PHOENIX-2014T, e.g., the former is proposed to solve isolated sign language recognition for American sign language while the latter aims to solve continuous sign language recognition for German sign language, general-domain pretraining on WLASL still learns relevant representations, e.g., low-level + +
Sign2Gloss2Text (two-stage)DevTest
RB1B2B3B4RB1B2B3B4
SL-Luong [4]40.1841.4625.7116.5711.0640.0541.5525.7316.5411.03
SL-Transf [6]44.1846.8232.2222.4915.9444.8147.0932.4922.6116.24
BN-TIN-Transf [49]44.2146.6132.1122.4415.9344.7846.8532.3722.5716.25
BN-TIN-Transf + BT* [49]48.3850.9736.1626.2619.5348.2150.6836.0026.2019.67
Ours51.3550.8937.9628.5321.8851.4350.3337.4428.0821.46
Sign2Text (end-to-end)RB1B2B3B4RB1B2B3B4
SL-Luong† [4]34.2834.2219.7212.247.9634.5434.1619.5711.847.56
SL-Transf [6]37.0637.4724.6716.8611.8836.7437.3824.3616.5511.79
BN-TIN-Transf [49]37.2940.6626.5618.0612.7337.6740.7426.9618.4813.19
BN-TIN-Transf + BT* [49]49.4951.4637.2327.5120.8049.3151.4237.2627.7621.34
Ours53.3853.8140.8431.2924.4253.2553.3140.4130.8723.92
+ +Table 2. Comparison with state-of-the-art methods on CSL-Daily. † denotes methods without using gloss annotations. * denotes methods with semi-supervised learning. Without any tricks nor using manually generated extra data, our method surpasses the recent semi-supervised method BN-TIN-Transf + BT [49]. + +
PretrainingSign2GlossSign2Text
DevWERTestWERRB1DevB2B3B4RB1TestB2B3B4
27.2528.0651.9752.9940.4232.5927.2751.8252.5340.1832.3727.01
23.0523.5053.2453.9941.4733.6328.1952.4253.6641.2733.3627.91
21.9022.4553.1053.9541.1233.1427.6152.6453.9741.7533.8428.39
--45.8447.3133.6425.8320.7645.9347.4034.3026.4721.44
+ +Table 3. Ablation study of visual encoder with different pretraining settings on the PHOENIX Sign2Gloss and PHOENIX Sign2Text tasks. K, WL, S2G denote pretraining on Kinetics-400, WLASL and Sign2Gloss, respectively. + +gesture features. As for Sign2Text, the gains of visual pretraining become narrowed, which suggests that learning favorable visual features is not the only determining factor for Sign2Text. For example, the translation model provides complementary information. In addition, to verify the importance of within-domain Sign2Gloss pretraining for Sign2Text, we load the visual encoder only pretrained on K-400 and WLASL into Sign2Text joint training. As the last column in Table 3 shows, skipping within-domain pretraining considerably hurts performance, reducing BLEU-4 by nearly 7 on both sets. We conclude that both general-domain and within-domain pretraining contribute to our method's high performance. + +# 4.4.2 Pretraining of Translation Model + +SLT greatly suffers from the data scarcity issue. Recently, language pretraining has shown promising results in low-resource NMT [1,8,25,33], which inspires us to introduce language pretraining to SLT. + +General-domain Pretraining Improves Gloss2Text. We first experiment with two popular pretrained language models, namely mBART [33] and GPT2 [40], to verify the effects of using different architectures and different large- + +scale general-domain corpus, through direct evaluation on the PHOENIX Gloss2Text task. Table 4 shows the results. As baselines, we train two translation networks with the same architecture as mBART or GPT2 but with random initializations. mBART outperforms GPT2, suggesting that the encoder-decoder architecture and bidirectional attention of mBART makes it more suitable for Gloss2Text than GPT2 which only has a decoder with unidirectional attention. However, general-domain pretraining on large corpus improves both mBART and GPT2 on Gloss2Text and mBART pretrained on CC25 achieves the best performance. We use mBART for further experiments. Additionally, mBART is pretrained on the multilingual corpus and thus can be used as a generic pretraining model for various sign languages. + +Progressive Pretraining Improves Sign2Text. We examine the effects of progressive pretraining of the translation model on the Sign2Text task, which is our final goal. Four pretraining settings are studied: 1) without pretraining; 2) pretraining on the Gloss2Text task; 3) pretraining on the CC25 corpus; 4) progressive pretraining, i.e., the translation model is first pretrained on CC25, then a further within-domain pretraining is conducted on the Gloss2Text task. + +
General-domain +PretrainingDevTest
RB1B2B3B4RB1B2B3B4
GPT2 Scratch44.4545.9331.9624.1719.4043.5744.6231.2723.6518.96
mBart Scratch46.5648.4235.2227.5522.7147.0348.1635.3227.6322.57
GPT2 w/ German Corpus49.9950.8638.0730.3225.1148.6148.9836.5528.8823.82
mBART w/ CC2553.7954.0141.4133.5028.1952.5452.6539.9932.0726.70
+ +Table 4. Ablation study of general-domain language pretraining on the PHOENIX Gloss2Text task. We conduct within-domain pretraining on the Gloss2Text task to transfer from the general domain to the specific domain of gloss-to-text translation. + +
CC25Gloss2TextDevTest
RB1B2B3B4RB1B2B3B4
46.4746.9933.7525.8320.7046.6747.4534.3926.4721.36
48.7749.4635.9827.9822.8947.6549.0136.1628.3323.28
52.3052.3939.9732.2826.9951.8353.0540.3432.2826.95
53.1053.9541.1233.1427.6152.6553.9741.7533.8428.39
+ +Table 5. Ablation study of mBART with different pretraining settings on the PHOENIX Sign2Text task. 'CC25' denotes transformer with mBART initialization, 'Gloss2Text' represents transformer pretrained on the Gloss2Text task. + +
MethodDevTest
RB1B2B3B4RB1B2B3B4
Gloss2Text53.7954.0141.4133.5028.1952.5452.6539.9932.0726.70
Sign2Gloss2Text50.2350.3637.5029.6924.6349.5949.9437.2829.6724.60
Sign2Text w/ Gloss Logits52.4553.2340.5532.6627.2352.7153.7041.2033.2227.78
Sign2Text w/ Gloss Reps53.1053.9541.1233.1427.6152.6553.9741.7533.8428.39
Sign2Text w/ S3D Features43.5344.1131.4624.6020.2443.7744.6832.0225.0220.62
+ +Table 6. Ablations on different visual features as the V-L Mapper input on PHOENIX Sign2Text. + +For all settings, we use the same joint training process for Sign2Text. The results are shown in Table 5. We use transformer of the same architecture without pretraining as our baseline. From the table we can observe that the translation model pretrained on the Gloss2Text task yields a slight improvement (+1.92 BLEU-4 on the test set). When pretraining on CC25, our method achieves 26.95 BLEU-4 on the test set, which demonstrates the importance of language pretraining on the large-scale corpus. The best result is achieved by progressive pretraining, which can be attributed to both general-domain pretraining on the large-scale corpus and domain alignment through within-domain pretraining (Gloss2Text) and the downstream task (Sign2Text). + +# 4.4.3 Joint Multi-modality Training + +At last, we study the effectiveness of our joint multimodality Sign2Text training by bridging the two modalities via the V-L Mapper. The most straightforward approach is to build a two-stage translation pipeline, i.e. Sign2Gloss2Text, where predicted glosses serve as the intermediate state. As the discrete glosses cannot fully capture the semantics in sign video, here we study using different visual features as the inputs to the V-L Mapper. In an ablation study, we examine the three features shown in Figure 3, namely gloss logits, gloss representations, and S3D + +features. Table 6 shows the results. Translating from a ground-truth gloss sequence to text (Gloss2Text) is generally regarded as an upper bound in SLT. Surprisingly, our joint Sign2Text training with gloss representations and with gloss logits outperforms not only Sign2Gloss2Text, but also the Gloss2Text upper bound, which demonstrates the effectiveness of our progressive pretraining and the proposed multi-modality transfer learning. + +# 5. Conclusion + +We present a simple yet effective multi-modality transfer learning baseline for sign language translation. To alleviate the data scarcity issue, we exploit large-scale external knowledge from human action and spoken language by progressively pretraining visual and language modules from general domains to within the target domains. The two individually pretrained modules are then bridged via the Visual-Language Mapper for joint SLT training. Experiments on two SLT datasets show that our approach outperforms all state-of-the-art methods. Our method can be applied to various sign languages. In future work, we would like to use this framework to transfer more external knowledge into SLT for further improvement. We hope our simple baseline can facilitate future research in SLT and motivate more researchers to engage in this field. + +# References + +[1] Roee Aharoni, Melvin Johnson, and Orhan First. Massively multilingual neural machine translation. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT), 2019. 3, 7 +[2] Samuel Albanie, Gül Varol, Liliane Momeni, Triantafyllos Afouras, Joon Son Chung, Neil Fox, and Andrew Zisserman. BSL-1K: Scaling up co-articulated sign language recognition using mouthing cues. In European Conference on Computer Vision, 2020. 2, 3 +[3] Christos Baziotis, Barry Haddow, and Alexandra Birch. Language model prior for low-resource neural machine translation. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020. 3 +[4] Necati Cihan Camgoz, Simon Hadfield, Oscar Koller, Hermann Ney, and Richard Bowden. Neural sign language translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. 1, 2, 3, 5, 6, 7 +[5] Necati Cihan Camgoz, Oscar Koller, Simon Hadfield, and Richard Bowden. Multi-channel transformers for multi-articulatory sign language translation. In ECCV 2020 Workshops, 2020. 1, 2, 6 +[6] Necati Cihan Camgoz, Oscar Koller, Simon Hadfield, and Richard Bowden. Sign language transformers: Joint end-to-end sign language recognition and translation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2020. 1, 2, 3, 5, 6, 7 +[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, 2017. 3 +[8] Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, 2020. 1, 3, 7 +[9] Runpeng Cui, Hu Liu, and Changshui Zhang. Recurrent convolutional neural networks for continuous sign language recognition by staged optimization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. 2 +[10] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT, 2019. 2, 3 +[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. ICLR, 2021. 2 +[12] Amanda Duarte, Shruti Palaskar, Lucas Ventura, Deepti Ghadiyaram, Kenneth DeHaan, Florian Metze, Jordi Torres, + +and Xavier Giro-i Nieto. How2sign: A large-scale multimodal dataset for continuous american sign language. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 2 +[13] Haoqi Fan, Yanghao Li, Bo Xiong, Wan-Yen Lo, and Christoph Feichtenhofer. Pyslowfast. https://github.com/facebookresearch/slowfast, 2020.3 +[14] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 3 +[15] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fründ, Peter Yianilos, Moritz Mueller-Freitag, Florian Hoppe, Christian Thurau, Ingo Bax, and Roland Memisevic. The "something something" video database for learning and evaluating visual common sense. In IEEE International Conference on Computer Vision, ICCV, 2017. 3 +[16] Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber. Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd international conference on Machine learning, 2006. 4 +[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. 2 +[18] Fabian Caba Heilbron, Victor Escorcia, Bernard Ghanem, and Juan Carlos Niebles. Activitynet: A large-scale video benchmark for human activity understanding. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, 2015. 3 +[19] Alfarabi Imashev, Medet Mukushev, Vadim Kimmelman, and Anara Sandygulova. A dataset for linguistic understanding, visual evaluation, and recognition of sign languages: The k-RSL. In Proceedings of the 24th Conference on Computational Natural Language Learning, 2020. 2 +[20] Hamid Reza Vaezi Joze and Oscar Koller. MS-ASL: A large-scale data set and benchmark for understanding american sign language. In 30th British Machine Vision Conference, BMVC, 2019. 2, 3 +[21] Will Kay, João Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, Mustafa Suleyman, and Andrew Zisserman. The kinetics human action video dataset. CoRR, 2017. 2, 3, 4, 5, 6 +[22] Oscar Koller, Necati Cihan Camgoz, Hermann Ney, and Richard Bowden. Weakly supervised learning with multistream cnn-lstm-hmms to discover sequential parallelism in sign language videos. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. 2 +[23] Oscar Koller, Sepehr Zargaran, and Hermann Ney. Re-sign: Re-aligned end-to-end sequence modelling with deep recurrent cnn-hmms. In IEEE Conference on Computer Vision and Pattern Recognition, 2017. 2 +[24] Taku Kudo and John Richardson. Sentencepiece: A simple and language independent subword tokenizer and deto + +kenizer for neural text processing. In Eduardo Blanco and Wei Lu, editors, Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP: System Demonstrations, 2018. 5 +[25] Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. Advances in Neural Information Processing Systems (NeurIPS), 2019. 1, 2, 7 +[26] Jie Lei, Linjie Li, Luowei Zhou, Zhe Gan, Tamara L. Berg, Mohit Bansal, and Jingjing Liu. Less is more: Clipbert for video-and-language learning via sparse sampling. In CVPR, 2021. 2 +[27] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, 2020. 2, 3 +[28] Dongxu Li, Cristian Rodriguez, Xin Yu, and Hongdong Li. Word-level deep sign language recognition from video: A new large-scale dataset and methods comparison. In The IEEE Winter Conference on Applications of Computer Vision, 2020. 2, 3, 4, 5, 6 +[29] Dongxu Li, Chenchen Xu, Xin Yu, Kaihao Zhang, Benjamin Swift, Hanna Suominen, and Hongdong Li. Tspnet: Hierarchical feature learning via temporal semantic pyramid for sign language translation. In Advances in Neural Information Processing Systems, 2020. 2, 3, 6 +[30] Dongxu Li, Xin Yu, Chenchen Xu, Lars Petersson, and Hongdong Li. Transferring cross-domain knowledge for video sign language recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. 2, 3 +[31] Xiujun Li, Xi Yin, Chunyuan Li, Xiaowei Hu, Pengchuan Zhang, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, Yejin Choi, and Jianfeng Gao. Oscar: Object-semantics aligned pre-training for vision-language tasks. ECCV, 2020. 2, 3 +[32] Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain, July 2004. Association for Computational Linguistics. 5 +[33] Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 2020. 1, 2, 3, 4, 7 +[34] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. International Conference on Computer Vision (ICCV), 2021. 2 +[35] Huaishao Luo, Lei Ji, Botian Shi, Haoyang Huang, Nan Duan, Tianrui Li, Jason Li, Taroon Bharti, and Ming Zhou. Univl: A unified video and language pre-training model for multimodal understanding and generation. arXiv preprint arXiv:2002.06353, 2020. 2, 3 + +[36] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, 2002. 5 +[37] Junfu Pu, Wengang Zhou, and Houqiang Li. Iterative alignment network for continuous sign language recognition. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, 2019. 2 +[38] Zhaofan Qiu, Ting Yao, and Tao Mei. Learning spatiotemporal representation with pseudo-3d residual networks. In IEEE International Conference on Computer Vision, ICCV, 2017. 3 +[39] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML, 2021. 2 +[40] Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019. 2, 3, 6, 7 +[41] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 2020. 3 +[42] Rico Sennrich and Biao Zhang. Revisiting low-resource neural machine translation: A case study. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019. 2 +[43] Ozge Mercanoglu Sincan and Hacer Yalim Keles. Autsl: A large scale multi-modal turkish sign language dataset and baseline methods. IEEE Access, 2020. 2 +[44] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, 2017. 1, 4 +[45] 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), 2018. 3, 4, 5 +[46] Kayo Yin and Jesse Read. Better sign language translation with STMC-transformer. In Proceedings of the 28th International Conference on Computational Linguistics, 2020. 1, 2, 3, 5, 6 +[47] Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. Vinvl: Making visual representations matter in vision-language models. CVPR, 2021. 2 +[48] Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. Vinvl: Revisiting visual representations in vision-language models. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, 2021. 3 +[49] Hao Zhou, Wengang Zhou, Weizhen Qi, Junfu Pu, and Houqiang Li. Improving sign language translation with + +monolingual data by sign back-translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021. 1, 2, 3, 5, 6, 7 +[50] Hao Zhou, Wengang Zhou, Yun Zhou, and Houqiang Li. Spatial-temporal multi-cue network for sign language recognition and translation. IEEE Transactions on Multimedia, 2022. 1, 2, 3, 5, 6 \ No newline at end of file diff --git a/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/images.zip b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2871a3cc132ac5c2a44bcde5ad451c1f5b7ad60a --- /dev/null +++ b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d05da617894f1954283287858dbe2034c2b0079e68d8b909194dc40990406590 +size 593917 diff --git a/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/layout.json b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dd1e281114dfdb5d8e8e0e1b0b59add116972871 --- /dev/null +++ b/asimplemultimodalitytransferlearningbaselineforsignlanguagetranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c723e3c2c163eece26ebf688e702c8f740e45899de79446035049fb2aa360b28 +size 322987 diff --git a/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_content_list.json b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e69ae97740534c28a77ff8fd26e10512245ca763 --- /dev/null +++ b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af862486776e811a78ca2e0788f460027db1c6fcb6e65e7573d8bca7855b3137 +size 87585 diff --git a/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_model.json b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9dbc1d2a6df2d7c7120c5161a739ddef9d1e0259 --- /dev/null +++ b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5520d1f9790f60306fa893cb501ad0a79b5fd8f73a925e2c9b19c77482bd663 +size 110041 diff --git a/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_origin.pdf b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..98dcd1b6ab5ff47c133c41e27996d6654a901f40 --- /dev/null +++ b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/ad07058c-f929-443a-8e11-53b47bed08e4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d81601cc07c05a244f9c924e064d8d77e81b7195d15c2ea2dbfb8109bd6d7896 +size 8611152 diff --git a/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/full.md b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..25b0d05d5efb97fba079baf9ae0a4ada36bdea8d --- /dev/null +++ b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/full.md @@ -0,0 +1,347 @@ +# ASM-Loc: Action-aware Segment Modeling for Weakly-Supervised Temporal Action Localization + +Bo He $^{1}$ , Xitong Yang $^{1}$ , Le Kang $^{2}$ , Zhiyu Cheng $^{2}$ , Xin Zhou $^{2}$ , Abhinav Shrivastava $^{1}$ + +1University of Maryland, College Park 2Baidu Research, USA + +{bohe,xyang35,abhinav}@cs.umd.edu,{kangle01,zhiyucheng,zhouxin16}@baidu.com + +# Abstract + +Weakly-supervised temporal action localization aims to recognize and localize action segments in untrimmed videos given only video-level action labels for training. Without the boundary information of action segments, existing methods mostly rely on multiple instance learning (MIL), where the predictions of unlabeled instances (i.e., video snippets) are supervised by classifying labeled bags (i.e., untrimmed videos). However, this formulation typically treats snippets in a video as independent instances, ignoring the underlying temporal structures within and across action segments. To address this problem, we propose ASM-Loc, a novel WTAL framework that enables explicit, action-aware segment modeling beyond standard MIL-based methods. Our framework entails three segment-centric components: (i) dynamic segment sampling for compensating the contribution of short actions; (ii) intra- and inter-segment attention for modeling action dynamics and capturing temporal dependencies; (iii) pseudo instance-level supervision for improving action boundary prediction. Furthermore, a multi-step refinement strategy is proposed to progressively improve action proposals along the model training process. Extensive experiments on THUMOS-14 and ActivityNetv1.3 demonstrate the effectiveness of our approach, establishing new state of the art on both datasets. The code and models are publicly available at https://github.com/boheumd/ASM-Loc. + +# 1. Introduction + +Weakly-supervised temporal action localization (WTAL) has attracted increasing attention in recent years. Unlike its fully-supervised counterpart, WTAL only requires action category annotation at the video level, which is much easier to collect and more scalable for building large-scale datasets. To tackle this problem, recent works [1-12] mostly rely on the multiple instance learning (MIL) framework [13], where the entire untrimmed video is treated as a labeled bag containing multiple unlabeled + +![](images/7d71aa2df2b11fcc3cc5f4a5bd9a2214107055863231a29a2f30fa515f394110.jpg) +Figure 1. Action-aware segment modeling for WTAL. Our ASM-Loc leverages the action proposals as well as the proposed segment-centric modules to address the common failures in existing MIL-based methods. + +instances (i.e., video frames or snippets). The action classification scores of individual snippets are first generated to form the temporal class activation sequences (CAS) and then aggregated by a top- $k$ mean mechanism to obtain the final video-level prediction [3, 6, 8, 14]. + +While significant improvement has been made in prior work, there is still a huge performance gap between the weakly-supervised and fully-supervised settings. One major challenge is localization completeness, where the models tend to generate incomplete or over-complete action segments due to the inaccurate predictions of action boundaries. Another challenge is the missed detection of short action segments, where the models are biased towards segments with longer duration and produce low-confidence predictions on short actions. Figure 1 demonstrates an example of these two common errors. Although these challenges are inherently difficult due to the lack of segment-level annotation, we argue that the absence of segment-based modeling in existing MIL-based methods is a key reason for the inferior results. In particular, these MIL-based + +methods treat snippets in a video as independent instances, where their underlying temporal structures are neglected in either the feature modeling or prediction stage. + +In this paper, we propose a novel framework that enables explicit, action-aware segment modeling for weakly-supervised temporal action localization, which we term ASM-Loc. To bootstrap segment modeling, we first generate action proposals using the standard MIL-based methods. These proposals provide an initial estimation of the action locations in the untrimmed video as well as their duration. Based on the action proposals, we introduce three segment-centric modules that correspond to the three stages of a WTAL pipeline, i.e., the feature extraction stage, the feature modeling stage and the prediction stage. + +First, a dynamic segment sampling module is proposed to balance the contribution of short-range and long-range action segments. As shown in Figure 1, action proposals with short duration are up-sampled along the temporal dimension, with the scale-up ratios dynamically computed according to the length of the proposals. Second, intra- and inter-segment attention modules are presented to capture the temporal structures within and across action segments at the feature modeling stage. Specifically, the intra-segment attention module utilizes self-attention within action proposals to model action dynamics and better discriminate foreground and background snippets. On the other hand, the inter-segment attention module utilizes self-attention across different actions proposals to capture the relationships, facilitating the localization of action segments that involve temporal dependencies (e.g., "CricketBowling" is followed by "CricketShotting" in Figure 1). Note that both attention modules are segment-centric, which is critical to suppress the negative impact of noisy background snippets in untrimmed videos. Third, a pseudo instance-level loss is introduced to refine the localization result by providing fine-grained supervision. The pseudo instance-level labels are derived from the action proposals, coupled with uncertainty estimation scores that mitigate the label noise effects. Finally, a multi-step proposal refinement is adopted to progressively improve the quality of action proposals, which in turn boosts the localization performance of our final model. + +We summarize our main contributions as follows: + +- We show that segment-based modeling can be utilized to narrow the performance gap between the weakly-supervised and supervised settings, which has been neglected in prior MIL-based WTAL methods. +- We introduce three novel segment-centric modules that enable action-aware segment modeling in different stages of a WTAL pipeline. +- We provide extensive experiments to demonstrate the effectiveness of each component of our design. Our ASM-Loc establishes new state of the art on both THUMOS-14 and ActivityNet-v1.3 datasets. + +# 2. Related works + +Temporal Action Localization (TAL). Compared with action recognition [15-21], TAL is an more challenging task for video understanding. Current fully-supervised TAL methods can be categorized into two groups: the anchor-based methods [22-25] perform boundary regression based on pre-defined action proposals, while the anchor-free methods [26-28] directly predict boundary probability or actionness scores for each snippet in the video, and then employ a bottom-up grouping strategy to match pairs of start and end for each action segment. All these methods require precise temporal annotation of each action instance, which is labor-intensive and time-consuming. + +Weakly-supervised Temporal Action Localization. Recently, the weakly supervised setting, where only video-level category labels are required during training, has drawn increasing attention from the community [1-12, 29-35]. Specifically, UntrimmedNet [1] is the first to introduce the multiple instance learning (MIL) framework to tackle this problem, which selects foreground snippets and groups them as action segments. STPN [2] improves UntrimmedNet by adding a sparsity loss to enforce the sparsity of selected snippets. CoLA [9] utilizes contrastive learning to distinguish the foreground and background snippets. UGCT [10] proposes an online pseudo label generation with uncertainty-aware learning mechanism to impose the pseudo label supervision on the attention weight. All these MIL-based methods treat each snippet in the video individually, neglecting the rich temporal information at the segment-level. In contrast, our ASM-Loc focuses on modeling segment-level temporal structures for WTAL, which is rarely explored in prior work. + +Pseudo Label Guided Training. Using pseudo labels to guide model training has been widely adopted in vision tasks with weak or limited supervision. In weakly supervised object detection, one of the seminal directions is self-training [36-39], which first trains a teacher model and then the predictions with high confidence are used as instance-level pseudo labels to train a final detector. Similarly, in semi-supervised learning [40-44] and domain adaptation [45-47], models are first trained on the labeled / source dataset and then used to generate pseudo labels for the unlabeled / target dataset to guide the training process. + +Similar to these works, our ASM-Loc utilizes pseudo segment-level labels (i.e., action proposals) to guide our training process in the WTAL task. However, we do not limit our approach to using pseudo labels for supervision only. Instead, we leverage the action proposals in multiple segment-centric modules, such as dynamic segment sampling, intra- and inter-segment attention. + +# 3. WTAL Base Model + +WTAL aims to recognize and localize action segments in untrimmed videos given only video-level action labels during training. Formally, let us denote an untrimmed training video as $V$ and its ground-truth label as $y \in \mathbb{R}^C$ , where $C$ is the number of action categories. Note that $y$ could be a multi-hot vector if more than one action is present in the video and is normalized with the $l_1$ normalization. The goal of temporal action localization is to generate a set of action segments $S = \{(s_i, e_i, c_i, q_i)\}_{i=1}^I$ for a testing video, where $s_i, e_i$ are the start and end time of the $i$ -th segment and $c_i, q_i$ are the corresponding class prediction and confidence score. + +Most existing WTAL methods [1-12] employ the multiple instance learning (MIL) formulation. A typical pipeline of MIL-based methods consists of three main stages (depicted in Figure 2): (i) The feature extraction stage takes the untrimmed RGB videos and optical flow as input to extract snippet-level features using pre-trained backbone networks. (ii) The feature modeling stage transforms the extracted features to the task-oriented features by performing temporal modeling. (iii) The prediction stage generates class probabilities and attention weights for each time step and computes video-level loss following the MIL formulation during training. In the following subsections, we review the common practices of these three stages and present our base model in detail. + +# 3.1. Feature Extraction and Modeling + +Following the recent WTAL methods [2,4,10,32,34], we first divide each untrimmed video into non-overlapping 16-frame snippets, and then apply a Kinetics-400 pre-trained I3D model [15] to extract features for both RGB and optical flow input. After that, the RGB and optical flow features are concatenated along the channel dimension to form the snippet-level representations $F \in \mathbb{R}^{T \times D}$ , where $T$ is the number of snippets in the video and $D = 2048$ is the feature dimensionality. Following [4,6,9,48], the features are then fed into a temporal convolution layer and the ReLU activation for feature modeling: $X = \mathrm{ReLU}(\mathrm{conv}(F))$ . + +# 3.2. Action Prediction and Training Losses + +Given the embedded features $X$ , a fully-connected (FC) layer is applied to predict the temporal class activation sequence (CAS) $P \in \mathbb{R}^{T \times (C + 1)}$ , where $C + 1$ denotes the number of action categories plus the background class. To better differentiate the foreground and background snippets, a common strategy [2,4,7] is to introduce an additional attention module that outputs the attention weights for each time step of the untrimmed video. Following [34, 48], we generate the attention weights $A \in \mathbb{R}^{T \times 2}$ using an FC layer, where the two weight values at each time step are normalized by the softmax operation to obtain the foreground + +and background attention weights, respectively. Finally, the CAS and the attention weights are combined to get the attention weighted CAS: $\hat{P}^m (c) = P(c)\odot A^m,m\in \{\mathrm{fg},\mathrm{bg}\}$ , where $c$ indicates the class index and $\odot$ denotes elementwise multiplication. + +Following the MIL formulation, the video-level classification score is generated by the top- $k$ mean strategy [3,6,8]. For each class $c$ , we take the $k$ largest values of the attention weighted CAS and compute their averaged value: $\hat{p}^m (c) = \frac{1}{k}\sum \mathrm{Top - k}(\hat{P}^m (c))$ . Softmax normalization is then performed across all classes to obtain the attention weighted video-level action probabilities. We adopt three video-level losses in such a weakly-supervised setting. + +Foreground loss. To guide the training of video-level action classification, we apply the cross-entropy loss between the foreground-attention weighted action probabilities $\hat{p}^{\mathrm{fg}}$ and the video-level action label $y^{\mathrm{fg}} = [y;0]$ , written as: + +$$ +\mathcal {L} ^ {\mathrm {f g}} = - \sum_ {c = 1} ^ {C + 1} y ^ {\mathrm {f g}} (c) \log \hat {p} ^ {\mathrm {f g}} (c). \tag {1} +$$ + +Background loss. To ensure that the negative instances in the untrimmed video are predicted as the background class, we regularize the background-attention weighted action probabilities $\hat{p}^{\mathrm{bg}}$ with an additional background loss [32, 48]. Specifically, we compute the cross-entropy between $\hat{p}^{\mathrm{bg}}$ and the background class label $y^{\mathrm{bg}}$ : + +$$ +\mathcal {L} ^ {\mathrm {b g}} = - \sum_ {c = 1} ^ {C + 1} y ^ {\mathrm {b g}} (c) \log \hat {p} ^ {\mathrm {b g}} (c), \tag {2} +$$ + +where $y^{\mathrm{bg}}(C + 1) = 1$ and $y^{\mathrm{bg}}(c) = 0$ for all other $c$ . + +Action-aware background loss. Although no action is taking place in background snippets, we argue that rich context information is still available to reflect the actual action category label. As an example in Figure 3(c), even though the background frames are stationary with only a billiard table, one can still expect the existence of the action category "Billiard" somewhere in the video. Therefore, the background instances are related to not only the background class label but also the action class label. + +Based on this observation, we formulate the action-aware background loss as the cross-entropy loss between the background-attention weighted action probabilities $\hat{p}^{\mathrm{bg}}$ and the video-level action label $y^{\mathrm{fg}}$ : + +$$ +\mathcal {L} ^ {\mathrm {a b g}} = - \sum_ {c = 1} ^ {C + 1} y ^ {\mathrm {f g}} (c) \log \hat {p} ^ {\mathrm {b g}} (c). \tag {3} +$$ + +The total video-level loss for our base model is the weighted combination of all three losses: + +$$ +\mathcal {L} ^ {\mathrm {v i d}} = \lambda_ {\mathrm {f g}} \mathcal {L} ^ {\mathrm {f g}} + \lambda_ {\mathrm {b g}} \mathcal {L} ^ {\mathrm {b g}} + \lambda_ {\mathrm {a b g}} \mathcal {L} ^ {\mathrm {a b g}}, \tag {4} +$$ + +where $\lambda_{\mathrm{fg}}, \lambda_{\mathrm{bg}}$ and $\lambda_{\mathrm{abg}}$ are trade-off parameters for balancing the contribution of the three losses. + +![](images/de747c69dbb18d4cf969be47ded44d77d0f59cd7853764beeb844342252fc834.jpg) +(a) Framework Overview + +![](images/38186d1d44bc853412fb5351a5523e87566f3c68690d83d7bcd0bdbfbbf84c15.jpg) +(b) Dynamic Segment Sampling + +![](images/79fb4944e5f005a008803df97a0c3fd70f4b495c0898aa4321e1b7a058ea0d45.jpg) +(c) Intra-Segment Attention +Figure 2. (a) Framework Overview. The gray modules indicate the components of the base model (e.g. conv and FC), while the others are our action-aware segment modeling modules. (b) Dynamic segment sampling is based on the cumulative distribution of the sampling weight vector $W$ . The red dots on the $T$ -axis represent the final sampled timesteps. Shorter action segments have higher scale-up ratios. (c) Intra-segment attention applies self-attention within each action proposal. (d) Inter-segment attention applies self-attention among all proposals in a video. $\odot$ , $\otimes$ and $\bigoplus$ denote element-wise multiplication, matrix multiplication, and element-wise addition. $T$ , $N$ are the number of snippets and action proposals, respectively. + +![](images/1d352be569126856fee4d0c8a2dcc62b184c8a6f1c4652a82dab9e13f4ddeaae.jpg) +(d) Inter-Segment Attention + +# 3.3. Discussion + +As discussed in Sec. 1, our base model follows the MIL formulation and neglects the temporal structures among video snippets. Nevertheless, the prediction results generated by the base model still provide a decent estimation of the action locations and durations in the untrimmed video, which can serve as a bootstrap for our segment modeling process. In particular, we generate the initial action proposals based on the prediction results of the base model: $S \mapsto \tilde{S} = \{(s_n, e_n, c_n)\}_{n=1}^N$ , where $s_n$ , $e_n$ and $c_n$ denote the start time, the end time, and the predicted category label of the $n$ -th action proposal, respectively. More details on generating action proposals are available in the supplementary material. The main focus of our work is to leverage the action proposals for segment-level temporal modeling, as described in the following section. + +# 4. Action-aware Segment Modeling + +Figure 2(a) illustrates an overview of our ASM-Loc framework. Given the action proposals generated by the base model, we introduce action-aware segment modeling into all three stages of the WTAL pipeline: dynamic segment sampling in the feature extraction stage (Sec. 4.1), intra- and inter-segment attention in the feature modeling stage (Sec. 4.2) and pseudo instance-level supervision in + +the prediction stage (Sec. 4.3). A multi-step proposal refinement is adopted to progressively improve the action proposals and the localization results, as discussed in Sec. 4.4. + +# 4.1. Dynamic Segment Sampling + +Action segments in an untrimmed video may have various durations, ranging from less than 2 seconds to more than 1 minute. Intuitively, short actions have small temporal scales, and therefore, their information is prone to loss or distortion throughout the feature modeling stage. As shown in Table 5, we observe that models are indeed biased towards the segments with longer duration and produce lower confidence scores on short segments, resulting in missed detection or inferior localization results. Similar observations are in object detection, where smaller objects have worse detection performance than larger ones [49, 50]. + +In order to address this problem in the WTAL setting, we propose a novel segment sampling module that dynamically up-samples action proposals according to their estimated duration. Formally, we first initialize a sampling weight vector $W \in \mathbb{R}^T$ with values equal to 1 at all time steps. Then, we compute the updated sampling weight for short proposals with duration less than a pre-defined threshold $\gamma$ : + +$$ +W \left[ s _ {n}: e _ {n} \right] = \frac {\gamma}{e _ {n} - s _ {n}}, \quad \text {i f} (e _ {n} - s _ {n}) \leq \gamma , \tag {5} +$$ + +where $s_n, e_n$ denote the start and end time of the $n$ -th action proposal. The sampling procedure is based on the Inverse Transform Sampling method as shown in Figure 2(b). The intuition is to sample snippets with frame rates proportional to their sampling weights $W$ . We first compute the cumulative distribution function (CDF) of the sampling weights $f_W = \operatorname{cdf}(W)$ , then uniformly sample $T$ timesteps from the inverse of the CDF: $\{x_i = f_W^{-1}(i)\}_{i=1}^T$ . In this way, the scale-up ratio of each proposal is dynamically computed according to its estimated duration. We apply linear interpolation when up-sampling is needed. + +# 4.2. Intra- and Inter-Segment Attention + +Intra-Segment Attention. Action modeling is of central importance for accurate action classification and temporal boundary prediction. Recent work [18, 51] applies temporal attention globally on trimmed videos for action recognition and achieves impressive performance. However, untrimmed videos are usually dominated by irrelevant background snippets which introduce extra noise to the action segment modeling process. Motivated by this observation, we propose the intra-segment attention module that performs self-attention within each action proposal. + +We formulate this module using a masked attention mechanism, as shown in Figure 2(c). Specifically, an attention mask $M \in \mathbb{R}^{T \times T}$ is defined to indicate the foreground snippets corresponding to different action proposals. The attention mask is first initialized with 0 at all entries and assigned $M[s_{n}:e_{n},s_{n}:e_{n}] = 1$ for all proposals. The attention mask is then applied to the attention matrix computed by the standard self-attention approach [52, 53]: + +$$ +Q = X W _ {Q}, K = X W _ {K}, V = X W _ {V}, \tag {6} +$$ + +$$ +A _ {i, j} = \frac {M _ {i , j} \exp \left(Q _ {i} K _ {j} ^ {T} / \sqrt {D}\right)}{\sum_ {k} M _ {i , k} \exp \left(Q _ {i} K _ {k} ^ {T} / \sqrt {D}\right)} \tag {7} +$$ + +$$ +Z = X + \mathrm {B N} (A V W _ {O}), \tag {8} +$$ + +where $W_{Q}, W_{K}, W_{V}, W_{O} \in \mathbb{R}^{D \times D}$ are the linear projection matrices for generating the query, key, value and the output. Multi-head attention [52] is also adopted to improve the capacity of the attention module. In this way, we explicitly model the temporal structures within each action proposal, avoiding the negative impact of the irrelevant and noisy background snippets. + +Inter-Segment Attention. Action segments in an untrimmed video usually involve temporal dependencies with each other. For example, "CricketBowling" tends to be followed by "CricketShooting", while "VolleyballSpiking" usually repeats multiple times in a video. Capturing these dependencies and interactions among action segments can therefore improve the recognition and localization performance. + +Similar to the intra-segment attention module, we leverage a self-attention mechanism to model the relationships across multiple action proposals. As shown in Figure 2(d), we first aggregate the snippet-level features within each action proposal by average pooling on the temporal dimension $\hat{X}_n = \frac{1}{e_n - s_n + 1}\sum_{t = s_n}^{e_n}X(t)$ . The multi-head self-attention is then applied on all segment-level features $\{\hat{X}_n\}_{n = 1}^N$ to model the interactions between different action proposal pairs. The output features are replicated along the time axis and added to the original feature $X$ in a residual manner. + +# 4.3. Pseudo Instance-level Loss + +Due to the absence of segment-level annotation, standard MIL-based methods only rely on video-level supervision provided by the video-level action category label. To further refine the localization of action boundaries, we leverage the pseudo instance-level label provided by the action proposals and propose a pseudo instance-level loss that offers more fine-grained supervision than the video-level losses. + +Given the action proposals $\tilde{S} = \{s_n, e_n, c_n\}_{n=1}^N$ , we construct the pseudo instance-level label $\tilde{Q} \in \mathbb{R}^{T \times (C+1)}$ by assigning action labels to the snippets that belong to the action proposals and assigning the background class label to all other snippets: + +$$ +\tilde {Q} _ {t} (c) = \left\{ \begin{array}{l l} 1, & \text {i f} \exists n, t \in \left[ s _ {n}, e _ {n} \right] \text {a n d} c = c _ {n} \\ 1, & \text {i f} \forall n, t \notin \left[ s _ {n}, e _ {n} \right] \text {a n d} c = C + 1 \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {9} +$$ + +Note that $\tilde{Q}$ is also normalized with the $l_{1}$ normalization. + +As the action proposals are generated from the model prediction, it is inevitable to produce inaccurate pseudo instance-level labels. To handle the label noise effects, we follow the recent work [10, 54-56] and introduce an uncertainty prediction module that guides the model to learn from noisy pseudo labels. Specifically, we employ an FC layer to output the uncertainty score $U \in \mathbb{R}^T$ , which is then used to re-weight the pseudo instance-level loss at each time step. Intuitively, instances with high uncertainty scores are limited from contributing too much to the loss. Coupled with uncertainty scores, the pseudo instance-level loss can be written as the averaged cross-entropy between the temporal CAS $P$ and the pseudo instance-level label $\tilde{Q}$ : + +$$ +\mathcal {L} _ {\text {i n s}} = \frac {1}{T} \sum_ {t = 1} ^ {T} \exp (- U _ {t}) \left(- \sum_ {c = 1} ^ {C + 1} \tilde {Q} _ {t} (c) \log \left(P _ {t} (c)\right)\right) + \beta U _ {t} \tag {10} +$$ + +where $\beta$ is a hyper-parameter for the weight decay term, which prevents the uncertainty prediction module from predicting infinite uncertainty for all time steps (and therefore zero loss). + +# 4.4. Multi-step Proposal Refinement + +Action proposals play an important role in action-aware modeling. As discussed in Sec. 5.3, the quality of proposals is positively correlated with the performance of multiple components in our approach. While our initial action proposals are obtained from the base model, it is intuitive to leverage the superior prediction results generated by our ASM-Loc to generate more accurate action proposals. Based on this motivation, we propose a multi-step training process that progressively refines the action proposals via multiple steps. + +As a bootstrap of segment modeling, we first train the base model (Sec. 3) for $E$ epochs and obtain the initial action proposals $\tilde{S}_0$ . After that, we train our ASM-Loc for another $E$ epochs and obtain the refined action proposals $\tilde{S}_1$ with a more accurate estimation of the action location and duration. The same process can be applied for multiple steps until the quality of action proposals is converged. The complete multi-step proposal refinement process is summarized in Alg. 1. Finally, we train our ASM-Loc using the refined proposals $\tilde{S}$ until the model is converged. + +# 5. Experiment + +# 5.1. Experimental Setup + +Dataset. We evaluate our method on two popular action localization datasets: THUMOS-14 [60] and ActivityNet-v1.3 [61]. THUMOS-14 contains untrimmed videos from 20 categories. The video length varies from a few seconds to several minutes and multiple action instances may exist in a single video. Following previous works [1,3,7,9], we use the 200 videos in the validation set for training and the 213 videos in the testing set for evaluation. ActivityNet-v1.3 is a large-scale dataset with 200 complex daily activities. It has 10,024 training videos and 4,926 validation videos. Following [10,35], we use the training set to train our model and the validation set for evaluation. + +Implementation Details. We employ the I3D [15] network pretrained on Kinetics-400 [15] for feature extraction. We apply TVL1 [62] algorithm to extract optical flow from RGB frames. The Adam optimizer is used with the learning rate of 0.0001 and with the mini-batch sizes of 16, 64 for THUMOS-14 and ActivityNet-v1.3, respectively. The number of sampled snippets $T$ is 750 for THUMOS-14 and 150 for ActivityNet-v1.3. For the multi-step proposal refinement, $E$ is set to 100 and 50 epochs for THUMOS-14 and ActivityNet-v1.3, respectively. Action proposals are generated at the last epoch of each refinement step. More dataset-specific training and testing details are available in the supplementary material. + +# 5.2. Comparison with the State of the Art + +In Table 1, we compare our ASM-Loc with state-of-the-art WTAL methods on THUMOS-14. Selected fully + +Algorithm 1: Multi-step Proposal Refinement +Input: Training epochs $E$ , refinement steps $L$ Output: Action proposals $\tilde{S}$ +1 Train the base model for $E$ epochs. +2 Get initial action proposals: $\tilde{S}_0$ +3 for $l$ in $\{1,\dots,L\}$ do +4 Train ASM-Loc for $E$ epochs with $\tilde{S}_{l - 1}$ +5 Update action proposals with $\tilde{S}_l$ +6 end + +supervised methods are presented for reference. We observe that ASM-Loc outperforms all the previous WTAL methods and establishes new state of the art on THUMOS-14 with $45.1\%$ average mAP for IoU thresholds 0.1:0.7. In particular, our approach outperforms UGCT [10], which also utilizes pseudo labels to guide the model training but without explicit segment modeling. Even compared with the fully supervised methods, ASM-Loc outperforms SSN [25] and TAL-Net [22] and achieves comparable results with GTAN [57] and P-GCN [58] when the IoU threshold is low. The results demonstrate the superior performance of our approach with action-aware segment modeling. + +We also conduct experiments on ActivityNet-v1.3 and the comparison results are summarized in Table 2. Again, our ASM-Loc obtains a new state-of-the-art performance of $25.1\%$ average mAP, surpassing the latest works (e.g. UGCT [10], FAC-Net [12]). The consistent superior results on both datasets justify the effectiveness of our ASM-Loc. + +# 5.3. Ablation Studies on THUMOS-14 + +Contribution of each component. In Table 3, we conduct an ablation study to investigate the contribution of each component in ASM-Loc. We first observe that adding the background loss $\mathcal{L}_{\mathrm{bg}}$ and the action-aware background loss $\mathcal{L}_{\mathrm{abg}}$ largely enhance the performance of the base model. The two losses encourage the sparsity in the foreground attention weights by pushing the background attention weights to be 1 at background snippets, and therefore improve the foreground-background separation. + +For action-aware segment modeling, it is obvious that a consistent gain $(\geq 1\%)$ can be achieved by adding any of our proposed modules. In particular, introducing segment modeling in the feature modeling stage (i.e., intra- and intersegment attention) significantly increases the performance by $2.4\%$ . The two attention modules are complementary to each other, focusing on modeling temporal structure within and across action segments. When incorporating all the action-aware segment modeling modules together, our approach boosts the final performance from $40.3\%$ to $45.1\%$ . + +Are action proposals necessary for self-attention? We propose an intra-segment attention module that performs + +Table 1. Comparison with state-of-the-art methods on THUMOS-14 dataset. The average mAPs are computed under the IoU thresholds [0.1,0.1,0.7]. UNT and I3D are abbreviations for UntrimmedNet features and I3D features, respectively. + +
SupervisionMethodPublicationmAP@IoU (%)
0.10.20.30.40.50.60.7AVG
Full (-)SSN [25]ICCV 201766.059.451.941.029.8---
TAL-Net [22]CVPR 201859.857.153.248.542.833.820.845.1
GTAN [57]CVPR 201969.163.757.847.238.8---
P-GCN [58]ICCV 201969.567.863.657.849.1---
VSGN [59]ICCV 2021--66.760.452.441.030.4-
Weak (UNT)AutoLoc [30]ECCV 2018--35.829.021.213.45.8-
CleanNet [31]ICCV 2019--37.030.923.913.97.1-
Bas-Net [6]AAAI 2020--42.834.725.117.19.3-
Weak (I3D)STPN [2]CVPR 201852.044.735.525.816.99.94.327.0
CMCS [4]CVPR 201957.450.841.232.123.115.07.032.4
WSAL-BM [32]ICCV 201960.456.046.637.526.817.69.036.3
DGAM [33]CVPR 202060.054.246.838.228.819.811.437.0
TSCN [7]ECCV 202063.457.647.837.728.719.410.237.8
ACM-Net [48]TIP 202168.962.755.044.634.621.810.842.6
CoLA [9]CVPR 202166.259.551.541.932.222.013.140.9
UGCT [10]CVPR 202169.262.955.546.535.923.811.443.6
AUMN [35]CVPR 202166.261.954.944.433.320.59.041.5
FAC-Net [12]ICCV 202167.662.152.644.333.422.512.742.2
ASM-Loc (Ours)-71.265.557.146.836.625.213.445.1
+ +Table 2. Comparison with state-of-the-art methods on ActivityNet-v1.3 dataset. The AVG column shows the averaged mAP under the IoU thresholds [0.5:0.05:0.95]. + +
MethodPublicationmAP@IoU (%)
0.50.750.95AVG
STPN [2]CVPR 201829.316.92.616.3
ASSG [63]MM 201932.320.14.018.8
CMCS [4]CVPR 201934.020.95.721.2
Bas-Net [6]AAAI 202034.522.54.922.2
TSCN [7]ECCV 202035.321.45.321.7
A2CL-PT [64]ECCV 202036.822.05.222.5
ACM-Net [48]TIP 202137.624.76.524.4
TS-PCA [10]CVPR 202137.423.55.923.7
UGCT [10]CVPR 202139.122.45.823.8
AUMN [35]CVPR 202138.323.55.223.5
FAC-Net [12]ICCV 202137.624.26.024.0
ASM-Loc (ours)41.024.96.225.1
+ +self-attention within action proposals to suppress the noise from background snippets. To verify the effectiveness of our design, we compare different settings for self-attention in Table 4. Specifically, the "Global" setting indicates that the self-attention operation is applied directly to all snippets in the untrimmed video. It can be observed that this setting does not provide any gain to the baseline, as the model fails to capture meaningful temporal structure due to the existence of irrelevant and noisy background snippets. Moreover, the "BG" setting, which stands for self-attention on background snippets only, has negative impact and achieves + +even worse localization results. Finally, our intra-segment attention outperforms these two settings by a large margin, indicating the importance of applying self-attention within action proposals. We also present the settings of using the ground-truth action segments as proposals for intra-segment attention. This setting can be viewed as an upper bound of our approach and it provides even more significant gains over the baseline. This observation inspires us to further improve the action proposals by multi-step refinement. + +Impact of dynamic segment sampling. In Table 5, we evaluate the impact of dynamic segment sampling for action segments with different durations. We divide all action segments into five groups according to their duration in seconds and evaluate the averaged mAP [65] separately for each group. As mentioned in the introduction, localization performance on short actions (XS, S) is much worse than longer actions (M, L, XL). By up-sampling the short actions with our dynamic segment sampling module, the model achieves significant gains on short actions $(+4.9\%$ for XS and $+1.2\%$ for S) and improves the overall performance by $1.1\%$ . Similarly, we present the results using ground-truth segment annotation for dynamics segment sampling, which achieves even larger improvement over the baseline. + +Impact of uncertainty estimation. We propose an uncertainty estimation module to mitigate the noisy label problem in pseudo instance-level supervision. Table 6 shows that using uncertainty estimation consistently improves the localization performance at different IoU thresholds, and increases the average mAP by $1\%$ . + +Impact of multi-step refinement. Table 7 shows the results + +
Base modelASM-LocAVG
\( \mathcal{L}_{\text{fg}} \)\( \mathcal{L}_{\text{bg}} \)\( \mathcal{L}_{\text{abg}} \)DSSIntraInter\( \mathcal{L}_{\text{ins}} \)
24.3
36.6
40.3
41.4
41.8
42
41.3
42.7
43.7
44.3
45.1
+ +Table 4. Ablation on self-attention under different settings. "Global", "BG" indicate self-attention on all and background snippets, respectively. + +Table 3. Contribution of each component. $\mathcal{L}_{\mathrm{fg}}$ , $\mathcal{L}_{\mathrm{bg}}$ and $\mathcal{L}_{\mathrm{abg}}$ represents the foreground, background and action-aware background loss, which are based on MIL with video-level labels. While DSS, Intra, Inter, and $\mathcal{L}_{\mathrm{ins}}$ denote the dynamic segment sampling, intra-segment attention, inter-segment attention, and pseudo instance-level loss, respectively, which exploit segment-level information. + +
LabelSettingmAP@IoU (%)
0.10.30.50.7AVG
Base67.851.830.710.140.3
Global67.350.830.210.540.1
Action ProposalBG6650.130.610.439.6
Ours68.653.432.511.841.8
Ground TruthBG64.749.630.39.738.8
Ours73.356.233.613.244.3
+ +Table 5. Impact of dynamic segment sampling (DSS). Actions are divided into five duration groups (seconds): XS (0, 1], S (1, 2], M (2, 4], L (4, 6], and XL (6, inf). + +
LabelSettingAveraged mAP (%)
XSSMLXLAVG
Base10.633.745.948.338.340.3
Action Proposal+DSS15.534.947.148.638.541.4
+4.9+1.2+1.2+0.3+0.2+1.1
Ground Truth+DSS203847.649.738.843
+9.4+4.3+1.7+1.4+0.5+2.7
+ +Table 6. Effectiveness of the uncertainty estimation module. + +
Uncer.mAP@IoU (%)
0.30.50.7AVG
55.535.513.844.1
57.136.613.445.1
+ +Table 7. Ablation on the number of refinement steps. "0" indicates the base model without action-aware segment modeling. + +
Num.mAP@IoU (%)
0.30.50.7AVG
051.830.710.140.3
154.434.112.543.1
256.235.413.844.7
357.136.613.445.1
457.336.714.145.1
+ +of increasing the number of refinement steps for multi-step proposal refinement. We can see that the performance improves as the number of steps increases, indicating that better localization results can be achieved by refined proposals. We adopt 3 refinement steps as our default setting since the performance saturates after that. + +# 5.4. Qualitative Results + +Figure 3 shows the visualization comparisons between the base model and our ASM-Loc. We observe that the common errors in existing MIL-based methods can be partly addressed by our action-aware segment modeling method, such as the missed detection of short actions and incomplete localization of the action "VolleySpiking" (Figure 3(a)) and the over-complete localization of the action "BaseballPitch" (Figure 3(b)). We also provide a failure case in Figure 3(c), where our method fails to localize the first action segment due to the largely misaligned action proposal generated by the base model. This also verifies the importance of improving the quality of action proposals and should be further studied in future work. + +# 6. Conclusion + +In this paper, we propose a novel WTAL framework named ASM-Loc which enables explicit action-aware segment modeling beyond previous MIL-based methods. We introduce three novel segment-centric modules corresponding to the three stages of a WTAL pipeline, which narrows the performance gap between the weakly-supervised and fully-supervised settings. We further introduce a multi-step training strategy to progressively refine the action proposals + +![](images/be99949121bed73da3285f7af9ae874945291275ae5ada12a742ccafac86d935.jpg) +(a) An example of "VolleyballSpiking" action + +![](images/557b8b9d2c8e23050ceb298e8ce1c02665eddf74f4a1bd59c7ba7dd70d627dc1.jpg) +(b) An example of "BaseballPitch" action + +![](images/002604ff7e4ccc2d484fe21bc48321329cc040ba0abbb2be9a9da0e77ac2f3c7.jpg) +(c) An example of "Billards" action (failure case) +Figure 3. Visualization of ground-truth, predictions and action proposals. Top-2 predictions with the highest confidence scores are selected for the base model and our ASM-Loc. Transparent frames represent background frames. + +till the localization performance saturates. Our ASM-Loc achieves state-of-the-art results on two WTAL benchmarks. + +Acknowledgements. This work was supported by the Air Force (STTR awards FA865019P6014, FA864920C0010) and Amazon Research Award to AS. + +# References + +[1] Limin Wang, Yuanjun Xiong, Dahua Lin, and Luc Van Gool. Untrimmednets for weakly supervised action recognition and detection. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 4325-4334, 2017. 1, 2, 3, 6 +[2] Phuc Nguyen, Ting Liu, Gautam Prasad, and Bohyung Han. Weakly supervised action localization by sparse temporal pooling network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6752-6761, 2018. 1, 2, 3, 7 +[3] Sujoy Paul, Sourya Roy, and Amit K Roy-Chowdhury. W-talc: Weakly-supervised temporal activity localization and classification. In Proceedings of the European Conference on Computer Vision (ECCV), pages 563-579, 2018. 1, 2, 3, 6 +[4] Daochang Liu, Tingting Jiang, and Yizhou Wang. Completeness modeling and context separation for weakly supervised temporal action localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1298-1307, 2019. 1, 2, 3, 7 +[5] Zhekun Luo, Devin Guillory, Baifeng Shi, Wei Ke, Fang Wan, Trevor Darrell, and Huijuan Xu. Weakly-supervised action localization with expectation-maximization multi-instance learning. In European conference on computer vision, pages 729-745. Springer, 2020. 1, 2, 3 +[6] Pilhyeon Lee, Youngjung Uh, and Hyeran Byun. Background suppression network for weakly-supervised temporal action localization. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 11320-11327, 2020. 1, 2, 3, 7 +[7] Yuanhao Zhai, Le Wang, Wei Tang, Qilin Zhang, Junsong Yuan, and Gang Hua. Two-stream consensus network for weakly-supervised temporal action localization. In European conference on computer vision, pages 37-54. Springer, 2020. 1, 2, 3, 6, 7 +[8] Ashraful Islam, Chengjiang Long, and Richard Radke. A hybrid attention mechanism for weakly-supervised temporal action localization. arXiv preprint arXiv:2101.00545, 2021. 1, 2, 3 +[9] Can Zhang, Meng Cao, Dongming Yang, Jie Chen, and Yuexian Zou. Cola: Weakly-supervised temporal action localization with snippet contrastive learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16010-16019, 2021. 1, 2, 3, 6, 7 +[10] Wenfei Yang, Tianzhu Zhang, Xiaoyuan Yu, Tian Qi, Yongdong Zhang, and Feng Wu. Uncertainty guided collaborative training for weakly supervised temporal action detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 53-63, 2021. 1, 2, 3, 5, 6, 7 +[11] Yuan Liu, Jingyuan Chen, Zhenfang Chen, Bing Deng, Jianqiang Huang, and Hanwang Zhang. The blessings of unlabeled background in untrimmed videos. In Proceedings of + +the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6176-6185, 2021. 1, 2, 3 +[12] Linjiang Huang, Liang Wang, and Hongsheng Li. Foreground-action consistency network for weakly supervised temporal action localization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8002-8011, 2021. 1, 2, 3, 6, 7 +[13] Oded Maron and Tomás Lozano-Pérez. A framework for multiple-instance learning. Advances in neural information processing systems, pages 570-576, 1998. 1 +[14] Ashraful Islam and Richard Radke. Weakly supervised temporal action localization using deep metric learning. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 547-556, 2020. 1 +[15] 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, 3, 6 +[16] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF international conference on computer vision, pages 6202-6211, 2019. 2 +[17] Xitong Yang, Haoqi Fan, Lorenzo Torresani, Larry S. Davis, and Heng Wang. Beyond short clips: End-to-end video-level learning with collaborative memories. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7567-7576, June 2021. 2 +[18] Bo He, Xitong Yang, Zuxuan Wu, Hao Chen, Ser-Nam Lim, and Abhinav Shrivastava. Gta: Global temporal attention for video action understanding. British Machine Vision Conference (BMVC), 2021. 2, 5 +[19] Xitong Yang, Xiaodong Yang, Sifei Liu, Deqing Sun, Larry Davis, and Jan Kautz. Hierarchical contrastive motion learning for video action recognition. British Machine Vision Conference (BMVC), 2021. 2 +[20] Zuxuan Wu, Hengduo Li, Caiming Xiong, Yu-Gang Jiang, and Larry Steven Davis. A dynamic frame selection framework for fast video recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. 2 +[21] Rui Wang, Dongdong Chen, Zuxuan Wu, Yinpeng Chen, Xiyang Dai, Mengchen Liu, Yu-Gang Jiang, Luowei Zhou, and Lu Yuan. Bevt: Bert pretraining of video transformers. arXiv preprint arXiv:2112.01529, 2021. 2 +[22] Yu-Wei Chao, Sudheendra Vijayanarasimhan, Bryan Seybold, David A Ross, Jia Deng, and Rahul Sukthankar. Rethinking the faster r-cnn architecture for temporal action localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1130–1139, 2018. 2, 6, 7 +[23] Zheng Shou, Dongang Wang, and Shih-Fu Chang. Temporal action localization in untrimmed videos via multi-stage cnns. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1049-1058, 2016. 2 + +[24] Huijuan Xu, Abir Das, and Kate Saenko. R-c3d: Region convolutional 3d network for temporal activity detection. In Proceedings of the IEEE international conference on computer vision, pages 5783-5792, 2017. 2 +[25] Yue Zhao, Yuanjun Xiong, Limin Wang, Zhirong Wu, Xiaou Tang, and Dahua Lin. Temporal action detection with structured segment networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2914-2923, 2017. 2, 6, 7 +[26] Tianwei Lin, Xu Zhao, Haisheng Su, Chongjing Wang, and Ming Yang. Bsn: Boundary sensitive network for temporal action proposal generation. In Proceedings of the European Conference on Computer Vision (ECCV), pages 3-19, 2018. 2 +[27] Tianwei Lin, Xiao Liu, Xin Li, Errui Ding, and Shilei Wen. Bmn: Boundary-matching network for temporal action proposal generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3889-3898, 2019. 2 +[28] Chuming Lin, Jian Li, Yabiao Wang, Ying Tai, Donghao Luo, Zhipeng Cui, Chengjie Wang, Jilin Li, Feiyue Huang, and Rongrong Ji. Fast learning of temporal action proposal via dense boundary generator. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 11499-11506, 2020. 2 +[29] Krishna Kumar Singh and Yong Jae Lee. Hide-and-seek: Forcing a network to be meticulous for weakly-supervised object and action localization. In 2017 IEEE international conference on computer vision (ICCV), pages 3544-3553. IEEE, 2017. 2 +[30] Zheng Shou, Hang Gao, Lei Zhang, Kazuyuki Miyazawa, and Shih-Fu Chang. Autoloc: Weakly-supervised temporal action localization in untrimmed videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 154-171, 2018. 2, 7 +[31] Ziyi Liu, Le Wang, Qilin Zhang, Zhanning Gao, Zhenxing Niu, Nanning Zheng, and Gang Hua. Weakly supervised temporal action localization through contrast based evaluation networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. 2, 7 +[32] Phuc Xuan Nguyen, Deva Ramanan, and Charless C Fowlkes. Weakly-supervised action localization with background modeling. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5502-5511, 2019. 2, 3, 7 +[33] Baifeng Shi, Qi Dai, Yadong Mu, and Jingdong Wang. Weakly-supervised action localization by generative attention modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1009-1019, 2020. 2, 7 +[34] Humam Alwassel, Fabian Caba Heilbron, Ali Thabet, and Bernard Ghanem. Refineloc: Iterative refinement for weakly-supervised action localization. 2019. 2, 3 + +[35] Wang Luo, Tianzhu Zhang, Wenfei Yang, Jingen Liu, Tao Mei, Feng Wu, and Yongdong Zhang. Action unit memory network for weakly supervised temporal action localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9969–9979, 2021. 2, 6, 7 +[36] Yang Zou, Zhiding Yu, Xiaofeng Liu, BVK Kumar, and Jinsong Wang. Confidence regularized self-training. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5982-5991, 2019. 2 +[37] Yongqiang Zhang, Yancheng Bai, Mingli Ding, Yongqiang Li, and Bernard Ghanem. W2f: A weakly-supervised to fully-supervised framework for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 928-936, 2018. 2 +[38] Dong Li, Jia-Bin Huang, Yali Li, Shengjin Wang, and Ming-Hsuan Yang. Weakly supervised object localization with progressive domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3512-3520, 2016. 2 +[39] Zhongzheng Ren, Zhiding Yu, Xiaodong Yang, MingYu Liu, Yong Jae Lee, Alexander G Schwing, and Jan Kautz. Instance-aware, context-focused, and memory-efficient weakly supervised object detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10598-10607, 2020. 2 +[40] Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, volume 3, page 896, 2013. 2 +[41] Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016. 2 +[42] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249, 2019. 2 +[43] Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685, 2020. 2 +[44] Zejia Weng, Xitong Yang, Ang Li, Zuxuan Wu, and Yu-Gang Jiang. Semi-supervised vision transformers. arXiv preprint arXiv:2111.11067, 2021. 2 +[45] Kuniaki Saito, Yoshitaka Ushiku, and Tatsuya Harada. Asymmetric tri-training for unsupervised domain adaptation. In International Conference on Machine Learning, pages 2988-2997. PMLR, 2017. 2 +[46] Jian Liang, Ran He, Zhenan Sun, and Tieniu Tan. Exploring uncertainty in pseudo-label guided unsupervised domain adaptation. Pattern Recognition, 96:106996, 2019. 2 +[47] Debasmit Das and CS George Lee. Graph matching and pseudo-label guided deep unsupervised domain adaptation. + +In International conference on artificial neural networks, pages 342-352. Springer, 2018. 2 +[48] Sanqing Qu, Guang Chen, Zhijun Li, Lijun Zhang, Fan Lu, and Alois Knoll. Acm-net: Action context modeling network for weakly-supervised temporal action localization. arXiv preprint arXiv:2104.02967, 2021. 3, 7 +[49] 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. 4 +[50] Bharat Singh, Mahyar Najibi, and Larry S Davis. Sniper: Efficient multi-scale training. arXiv preprint arXiv:1805.09300, 2018. 4 +[51] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? arXiv preprint arXiv:2102.05095, 2021. 5 +[52] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008, 2017. 5 +[53] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794-7803, 2018. 5 +[54] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? arXiv preprint arXiv:1703.04977, 2017. 5 +[55] Hwanjun Song, Minseok Kim, Dongmin Park, Yooju Shin, and Jae-Gil Lee. Learning from noisy labels with deep neural networks: A survey. arXiv preprint arXiv:2007.08199, 2020. 5 +[56] Zhedong Zheng and Yi Yang. Rectifying pseudo label learning via uncertainty estimation for domain adaptive semantic segmentation. International Journal of Computer Vision, 129(4):1106-1120, 2021. 5 +[57] Fuchen Long, Ting Yao, Zhaofan Qiu, Xinmei Tian, Jiebo Luo, and Tao Mei. Gaussian temporal awareness networks for action localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 344-353, 2019. 6, 7 +[58] Runhao Zeng, Wenbing Huang, Mingkui Tan, Yu Rong, Peilin Zhao, Junzhou Huang, and Chuang Gan. Graph convolutional networks for temporal action localization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7094-7103, 2019. 6, 7 +[59] Chen Zhao, Ali K Thabet, and Bernard Ghanem. Video self-stitching graph network for temporal action localization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 13658-13667, 2021. 7 +[60] 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. 6 + +[61] Fabian Caba Heilbron, Victor Escorcia, Bernard Ghanem, 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. 6 +[62] Vincent Duval, Jean-François Aujol, and Yann Gousseau. The tv1 model: a geometric point of view. Multiscale Modeling & Simulation, 8(1):154-189, 2009. 6 +[63] Chengwei Zhang, Yunlu Xu, Zhanzhan Cheng, Yi Niu, Shiliang Pu, Fei Wu, and Futai Zou. Adversarial seeded sequence growing for weakly-supervised temporal action localization. In Proceedings of the 27th ACM international conference on multimedia, pages 738-746, 2019. 7 +[64] Kyle Min and Jason J Corso. Adversarial background-aware loss for weakly-supervised temporal activity localization. In European conference on computer vision, pages 283-299. Springer, 2020. 7 +[65] 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. 7 \ No newline at end of file diff --git a/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/images.zip b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c86b13a04335f5ad754815ed00495337e666a1a5 --- /dev/null +++ b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f6fb2d921491c8b9a8d63f8e65bb968d53d443b9ec1a32f2fd12e53b9f5974d +size 559433 diff --git a/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/layout.json b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..29bce191432aff35e6386e4208198f2934152022 --- /dev/null +++ b/asmlocactionawaresegmentmodelingforweaklysupervisedtemporalactionlocalization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e878356c7e80b7a0d481aae87e21bcd8df25d1a3cc7af8b5abfe0160707958cb +size 437990 diff --git a/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_content_list.json b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..43862e09aeb6cf4669eec64611fed49423259ecd --- /dev/null +++ b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff248f6ac9832958932679b1d95c9b34640582ab5ce32e60e421516373de0464 +size 85417 diff --git a/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_model.json b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..10eb6abeb3f4f47d4f8cb954f11dabccfa21740c --- /dev/null +++ b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38a0bf7b0ff6ba35cbe88672de5b1785b4f75b2105dcf534194e6032af41f7c8 +size 104085 diff --git a/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_origin.pdf b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b634d4088779d9a98b462dd5a669c08a09900f1 --- /dev/null +++ b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/47290942-8bd5-402f-a60a-ee4580f7a85b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aba9bfe6fe500314ab17adaf6ac748f1689800f2ce5ef7a61131d20776a8bbb7 +size 1378002 diff --git a/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/full.md b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9073825dd8f48928a7664a9ef9f41df8b7c2cbc7 --- /dev/null +++ b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/full.md @@ -0,0 +1,306 @@ +# A Stitch in Time Saves Nine: A Train-Time Regularizing Loss for Improved Neural Network Calibration + +Ramya Hebbalaguppe $^{1,2}$ Jatin Prakash $^{1}$ Neelabh Madan $^{1}$ Chetan Arora $^{1}$ $^{1}$ Indian Institute of Technology Delhi, India $^{2}$ TCS Research, India + +https://github.com/mdca-loss + +![](images/1ffdaf280906e54c5e78a8a0077d137a7b0182ded74ea1cbcd826ab608212d95.jpg) +(c)GT: Person + +![](images/59dbe81844ac3d879361b327bcb15af9fc6fdae451899f37b0159ee4f6c498b3.jpg) +(e) Class Activation Maps (CAMs) + +![](images/8f29422fd2bf0aa7aa15925218c79b7346b3d399e23ac6caa55e36afbbe3ed29.jpg) +(f) Class-wise Reliability Diagrams +Figure 1. We present a new regularizing loss (MDCA) for train time calibration of Deep Neural Networks (DNN). Figures (a)-(d) show comparison with a model trained using Cross Entropy loss (NLL), and ours $(\mathrm{FL} + \mathrm{MDCA})$ . In (a), a DNN trained using NLL makes an incorrect but over-confident prediction. Whereas, training with MDCA reduces the confidence of the mis-predicted label, and increases confidence of the second-highest confident, but correct label. In (b) for a CIFAR 10 minority class, "truck", a model trained with MDCA confidently predicts the correct label as compared to a NLL trained model. In (c) and (d), we show an image from in-domain and out-of-domain dataset. In (c), picture is taken from "Photo" domain (in-domain) of the PACS [30] dataset on which we trained the DNN. Both the models trained with our method as well as NLL predict high confidence score for the correct label. However, in (d), when we change the domain to "Art" (out-of-domain), we see NLL trained model makes highly over-confident mistake on domain shift, whereas, MDCA regularized model remains calibrated. In (e) we show the Class Activation Maps (CAMs) for a model calibrated with Temperature Scaling (TS), and ours for label cow (top row), and person (bottom row). More accurate CAMs show that training with MDCA improves model explainability. (f) shows class-wise reliability diagrams of models trained with NLL and our method. Latter leads to models which are calibrated for all classes. + +# Abstract + +Deep Neural Networks (DNNs) are known to make overconfident mistakes, which makes their use problematic in safety-critical applications. State-of-the-art (SOTA) calibration techniques improve on the confidence of predicted labels alone, and leave the confidence of non-max classes (e.g. top-2, top-5) uncalibrated. Such calibration is not suitable for + +label refinement using post-processing. Further, most SOTA techniques learn a few hyper-parameters post-hoc, leaving out the scope for image, or pixel specific calibration. This makes them unsuitable for calibration under domain shift, or for dense prediction tasks like semantic segmentation. In this paper, we argue for intervening at the train time itself, so as to directly produce calibrated DNN models. We propose a novel auxiliary loss function: Multi-class Difference in Confidence and Accuracy (MDCA), to achieve the same. + +MDCA can be used in conjunction with other application/task specific loss functions. We show that training with MDCA leads to better calibrated models in terms of Expected Calibration Error (ECE), and Static Calibration Error (SCE) on image classification, and segmentation tasks. We report ECE (SCE) score of 0.72 (1.60) on the CIFAR 100 dataset, in comparison to 1.90 (1.71) by the SOTA. Under domain shift, a ResNet-18 model trained on PACS dataset using MDCA gives a average ECE (SCE) score of 19.7 (9.7) across all domains, compared to 24.2 (11.8) by the SOTA. For segmentation task, we report a $2 \times$ reduction in calibration error on PASCAL-VOC dataset in comparison to Focal Loss [32]. Finally, MDCA training improves calibration even on imbalanced data, and for natural language classification tasks. + +# 1. Introduction + +Deep Neural Networks (DNNs) have shown promising results for various pattern recognition tasks in recent years. In a classification setting, with input $\mathbf{x} \in \mathcal{X}$ , and label $y \in \mathcal{Y} = \{1, \dots, K\}$ , a DNN typically outputs a confidence score vector $\mathbf{s} \in \mathbb{R}^K$ . The vector, $\mathbf{s}$ , is also a valid probability vector, and each element of $\mathbf{s}$ is assumed to be the predicted confidence for the corresponding label. It has been shown in recent years that the confidence vector, $\mathbf{s}$ , output by a DNN is often poorly calibrated [14, 36]. That is: + +$$ +\mathbb {P} \left(\widehat {y} = y ^ {*} \mid \mathbf {s} [ \widehat {y} ]\right) \neq \mathbf {s} [ \widehat {y} ], \tag {1} +$$ + +where $\widehat{y}$ , and $y^{*}$ are the predicted, and true label respectively for a sample. E.g. if a DNN predicts a class "truck" for an image with score 0.7, then a network is calibrated, if the probability that the image actually contains a truck is 0.7. If the probability is lower, a network is said to be overconfident, and under-confident if probability is higher. For a pixel-wise prediction task like semantic segmentation, we would like to calibrate prediction for each pixel. Similarly, we would like calibration to hold not only for the predicted label, i.e. $\widehat{y} = \arg \max_{y\in \mathcal{V}}s[y]$ , but for the whole vector s (all labels), i.e., $\forall y\in \mathcal{V}$ . + +One of the main reasons for the miscalibration is the specific training regimen used. Most modern DNNs, when trained for classification in a supervised learning setting, are trained using one-hot encoding that have all the probability mass centered in one class; the training labels are thus zero-entropy signals that admit no uncertainty about the input [48]. The DNN is thus trained to become overconfident. Besides creating a general distrust in the model predictions, the miscalibration is especially problematic in safety critical applications, such as self-driving cars [13], legal research [51] and healthcare [10,46], where giving the correct confidence for a predicted label is as important as the correct label prediction itself. + +Researchers have tried to address miscalibration by learning a post-hoc transformation of the output vector so that the confidence of the predicted label matches with the likelihood of the label for the sample [15, 17]. Since such techniques focus on the predicted label only, they could end up calibrating only the label which has maximum confidence for each sample. Hence, in a multi-class setting, the labels with nonmaximal confidence scores remain uncalibrated. This makes any post-processing for label refinement, such as posterior inference using MRF-MAP [4], ineffective. + +In this paper we argue for the calibration at the train-time. Unlike post-hoc calibration techniques that use limited parameters1, a train time strategy allows exploiting millions of learnable parameters of DNN itself, thus providing a flexible learning more suited to image and pixel specific transformation for model calibration. Our experiments under domain shift, and for a dense predict task (semantic segmentation) show the strength of the approach. + +Armed with the above insight, we propose a novel auxiliary loss function: Multi-class Difference in Confidence and Accuracy (MDCA). The proposed loss function is designed to be used during the training stage in conjunction with other application specific loss functions, and overcomes the non-differentiability of the loss functions proposed in earlier methods. Though we do not advocate it, the proposed technique is complimentary to the post-hoc techniques which may still be used after the training, if there is a separate holdout dataset available for exploitation. Since ours is a train time calibration approach, it implies good regularization for the predictions. We show that models trained using our loss function remain calibrated even under domain shift. + +Contributions: We make the following key contributions: (1) A trainable DNN calibration method with inclusion of a novel auxiliary loss function, termed MDCA, that takes into account the entire confidence vector in a multi-class setting. Our loss function is differentiable and can be used in conjunction with any existing loss term. We show experiments with Cross-Entropy, Label Smoothing [38], and Focal Loss [32]. (2) Our approach is on par with post-hoc methods [14, 23] without the need for hold-out set making the deployment more practical (See Tab. 6). (3) Our loss function is a powerful regularizer, maintaining calibration even under domain/dataset drift and dataset imbalance which We demonstrate on PACS [30], Rotated MNIST [29] and imbalanced CIFAR 10 datasets. (4) Although the focus is primarily on image classification, our experiments on multi-class semantic segmentation show that our technique outperforms TS based calibration, and Focal Loss [32]. We also show the effectiveness of our approach on natural language classification task on 20Newsgroup dataset [27]. + +# 2. Related Work + +Techniques for calibrating DNNs can be broadly classified into train-time calibration, post-hoc calibration, and calibration through Out-Of-Distribution (OOD). Train-time calibration integrate model calibration during the training procedure while a post-hoc calibration method utilizes a hold-out set to tune the calibration measures. On the other hand, learning to reject OOD samples (at train-time or post-hoc) mitigates overconfidence and thus, calibrates DNNs. + +Train-Time Calibration: One of the earliest train-time methods proposes Brier Score for the calibrating binary probabilistic forecast [2]. [14] show models trained with Negative-Log-Likelihood (NLL) tend to be over-confident and empirically show a disconnect between NLL and accuracy. Specifically, the overconfident scores necessitates re-calibration. A common calibration approach is to use additional loss terms other than the NLL loss: [44] use entropy as a regularization term whereas Müller et al. [38] propose Label Smoothing (LS) [47] on soft-targets which aids in improving calibration. Recently, [37] showed that focal loss [32] can implicitly calibrate DNNs by reducing the KL-divergence between predicted and target distribution whilst increasing the entropy of the predicted distribution, thereby preventing the model from becoming overconfident. Liang et al. [31] have proposed an auxiliary loss term, DCA, which is added with Cross-Entropy to help calibrate the model. The DCA term penalizes the model when the cross-entropy loss is reduced, but the accuracy remains the same, i.e., when the over-fitting occurs. [26] propose to use MMCE, an auxiliary loss term for calibration, computed using a reproducing kernel in a Hilbert space [12]. Maronás et al. [33] analyse MixUp [52] data augmentation for calibrating DNNs and conclude Mixup does not necessarily improve calibration. + +Post-Hoc Calibration: Post-hoc calibration techniques calibrate a model using a hold-out training set, which is usually the validation set. Temperature scaling (TS) smoothes the logits to calibrate a DNN. Specifically, TS is a variant of Platt scaling [45] that works by dividing the logits by a scalar $T > 0$ , learnt on a hold-out training set, prior to taking a softmax. The downside of using TS during calibration is reduction in confidence of every prediction, including the correct one. A more general version of TS transforms the logits using a matrix scaling. The matrix $M$ is learnt using the hold-out set similar to TS. Dirichlet calibration (DC) uses Dirichlet distributions to extend the Beta-calibration [24] method for binary classification to a multi-class one. DC is easy to implement as an extra layer in a neural network on log-transformed class probabilities, which is learnt on a hold-out set. Meta-calibration proposes differentiable ECE-driven calibration to obtain well-calibrated and high-accuracy models [1]. Islam et al. [18] propose class-distribution-aware TS and LS that can be used as a post-hoc calibration. They + +use a class-distribution aware vector for TS/LS to fix the overconfidence. Ding et al. [9] propose a spatially localized calibration approach for semantic segmentation. + +Calibration Through OOD Detection: Hein et al. [34] show that one of the main reasons behind the overconfidence in DNNs is the usage of ReLu activation that gives high confidence predictions when the input sample is far away from the training data. They propose data augmentation using adversarial training, which enforces low confidence predictions for samples far away from the training data. Guo et al. [14] analyze the effect of width, and depth of a DNN, batch normalization, and weight decay on the calibration. Karimi et al. [19] use spectral analysis on initial layers of a CNN to determine OOD sample and calibrate the DNN. We refer the reader to [8, 16, 35, 43] for other representative works on calibrating a DNN through OOD detection. + +# 3. Proposed Methodology + +Calibration: A calibrated classifier outputs confidence scores that matches the empirical frequency of correctness. If a calibrated model predicts an event with 0.7 confidence, then $70\%$ of the times the event transpires. If the empirical occurrence of the event is $< 70\%$ then the model is overconfident, and if the empirical probability $>70\%$ then the model is under-confident. Formally, we define calibration in a classical supervised setting as follows. Let $\mathcal{D} = \langle (x_i,y_i)\rangle_{i = 1}^N$ denote a dataset consisting of $N$ samples from a joint distribution $\mathcal{D}(\mathcal{X},\mathcal{Y})$ , where for each sample $x_{i}\in \mathcal{X}$ is the input and $y_{i}^{*}\in \mathcal{Y} = \{1,2,\dots,K\}$ is the ground-truth class label. Let $\mathbf{s}\in \mathbb{R}^{K}$ , and $\mathbf{s}_i[y] = f_\theta (x_i)$ be the confidence that a DNN, $f$ , with model parameters $\theta$ predicts for a class $y$ on a given input $x_{i}$ . The class, $\widehat{y}_i$ , predicted by $f$ for a sample $x_{i}$ is computed as: + +$$ +\widehat {y} _ {i} = \underset {y \in \mathcal {Y}} {\arg \max } \mathbf {s} _ {i} [ y ]. \tag {2} +$$ + +The confidence for the predicted class is correspondingly computed as $\widehat{s}_i = \max_{y\in \mathcal{Y}}s_i[y]$ . A model is said to be perfectly calibrated [14] when, for each sample $(x,y)\in \mathcal{D}$ : + +$$ +\mathbb {P} (y = y ^ {*} \mid \mathrm {s} [ y ] = s) = s. \tag {3} +$$ + +Note that the perfect calibration requires each score value (and not only the $\widehat{s}$ ) to be calibrated. On the other hand, most calibration techniques focus only on the predicted class. That is, they only ensure that: $\mathbb{P}(\widehat{y}_i = y_i^* \mid \widehat{s}_i) = \widehat{s}_i$ . + +Expected Calibration Error (ECE): ECE is calculated by computing a weighted average of the differences in the confidence of the predicted class, and the accuracy of the samples, predicted with a particular confidence score [39]: + +$$ +\mathrm {E C E} = \sum_ {i = 1} ^ {M} \frac {B _ {i}}{N} \left| A _ {i} - C _ {i} \right|. \tag {4} +$$ + +Here $N$ is the total number of samples, and the weighting is done on the basis of the fraction of samples in a given confidence bin/interval. Since the confidence values are in a continuous interval, for the computation of ECE, we divide the confidence range $[0,1]$ into $M$ equidistant bins, where $i^{\mathrm{th}}$ bin is the interval $\left(\frac{i - 1}{M},\frac{i}{M}\right]$ in the confidence range, and $B_{i}$ , represents the number of samples in the $i^{\mathrm{th}}$ bin. Further, $A_{i} = \frac{1}{|B_{i}|}\sum_{j\in B_{i}}\mathbb{I}(\hat{y}_{j} = y_{j})$ , denotes accuracy for the samples in bin $B_{i}$ , and $C_i = \frac{1}{|B_i|}\sum_{j:\widehat{s}_j\in B_i}\widehat{s}_j$ , is the average predicted confidence of the samples, such that $\widehat{s}_j\in B_i$ . The evaluation of DNN calibration via ECE suffers from the following shortcomings: (a) ECE does not measure the calibration of all score values in the confidence vector, and (b) the metric is not differentiable, and hence can not be incorporated as a loss term during training procedure itself. Specifically, non-differentiability arises due to binning samples into bins $B_{i}$ . + +Maximum Calibration Error (MCE): MCE is defined as the maximum absolute difference between the average accuracy and average confidence of each bin: + +$$ +\mathrm{MCE} = \max_{i\in 1,\dots ,M}\left|A_{i} - C_{i}\right|. +$$ + +The max operator ends up pruning a lot of useful information about calibration, making the metric not-so-popular. However, it does represent a statistical value that can be used to discriminate large differences in calibration. + +Static Calibration Error (SCE): SCE is a recently proposed metric to measure calibration by [41]: + +$$ +\mathrm {S C E} = \frac {1}{K} \sum_ {i = 1} ^ {M} \sum_ {j = 1} ^ {K} \frac {B _ {i , j}}{N} \left| A _ {i, j} - C _ {i, j} \right|, \tag {5} +$$ + +where, $K$ denotes the number of classes, and $B_{i,j}$ denotes number of samples of the $j^{\mathrm{th}}$ class in the $i^{\mathrm{th}}$ bin. Further, $A_{i,j} = \frac{1}{B_{i,j}}\sum_{k\in B_{i,j}}\mathbb{I}(j = y_k)$ is the accuracy for the samples of $j^{\mathrm{th}}$ class in the $i^{\mathrm{th}}$ bin, and $C_{i,j} = \frac{1}{B_{i,j}}\sum_{k\in B_{i,j}}\mathbf{s}_k[j]$ or average confidence for the $j^{\mathrm{th}}$ class in the $i^{\mathrm{th}}$ bin. Classwise-ECE [23] is another metric for measuring calibration in a multi-class setting, but is identical to Static Calibration Error (SCE). It is easy to see that SCE is a simple class-wise extension to ECE. Since SCE takes into account the whole confidence vector, it allows us to measure calibration of the non-predicted classes as well. Note that, similar to ECE, the metric SCE is also non-differentiable, and can not be used as a loss term during training. + +Class- $j$ -ECE: [23] has proposed to evaluate calibration error of each class independent of other classes. This allows one to capture the contribution of a single class $j$ to the overall SCE (or classwise-ECE) error. We refer to this metric as class- $j$ -ECE in our results/discussion. + +# 3.1. Proposed Auxiliary loss: MDCA + +We propose a novel multi-class calibration technique using the proposed auxiliary loss function. The loss function is inspired from SCE [41] but avoids the non-differentiability caused due to binning $B_{i,j}$ as shown in Eq. (5) [31]. Our calibration technique is independent of the binning scheme/bins. This is important, because as [50] and [25] have also highlighted, binning scheme leads to underestimated calibration errors. We name our loss function, Multi-class Difference of Confidence and Accuracy (MDCA), and apply it for each mini-batch during training. The loss is defined as follows: + +$$ +\mathcal {L} _ {\mathrm {M D C A}} = \frac {1}{K} \sum_ {j = 1} ^ {K} \left| \frac {1}{N _ {b}} \sum_ {i = 1} ^ {M} \mathbf {s} _ {i} [ j ] - \frac {1}{N _ {b}} \sum_ {i = 1} ^ {M} q _ {i} [ j ] \right|, \tag {6} +$$ + +where $q_{i}[j] = 1$ if label $j$ is the ground truth label for sample $i$ , i.e. $j = y_{i}^{*}$ , else $q_{i}[j] = 0$ . Note the second term inside $|\cdot|$ corresponds to average count of samples in a mini-batch containing $N_{b}$ training samples. Since the average count is a constant value so learning gradients solely depends on the first term representing confidence assigned by the DNN. $K$ denotes number of classes. $\mathcal{L}_{\mathrm{MDCA}}$ is computed on a mini-batch, and the modulus operation $(|\cdot|)$ implies that the summations are not interchangeable. Further, $\mathbf{s}_i[j]$ represents the confidence score by a DNN for the $j^{\text{th}}$ class, of $i^{th}$ sample in the mini-batch. + +Note that $\mathcal{L}_{\mathrm{MDCA}}$ is differentiable, whereas, the loss given by DCA [31] involves accuracy over the mini-batch, and is non-differentiable. The differentiability of our loss function ensures that it can be easily used in conjunction with other application specific loss functions as follows: + +$$ +\mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {C} + \beta \cdot \mathcal {L} _ {\mathrm {M D C A}}, \tag {7} +$$ + +where $\beta$ is a hyperparameter to control the relative importance with respect to application specific losses, and is typically found using a validation set. $\mathcal{L}_C$ is a standard classification loss, such as Cross Entropy, Label Smoothing [47], or Focal loss [32]. Our experiments indicate that the proposed MDCA loss in conjunction with focal loss gives best calibration performance. + +Ideally to achieve confidence calibration, we want the average prediction confidence to be same as accuracy of the model. However, in multiclass calibration, we want average prediction confidence of every class $k_{i}$ to match with its average occurrence in the data-distribution. In $\mathcal{L}_{MDCA}$ , we explicitly capture this idea for every mini-batch i.e. we + +intuitively want that $\tilde{s} [k_i]\approx \tilde{q} [k_i]$ (where $\tilde{s} [k_i],\tilde{q} [k_i]$ is the average prediction confidence and the average count class $k_{i}$ in a mini-batch respectively). Any deviation from this leads DNN to be penalized by $\mathcal{L}_{MDCA}$ + +# 4. Dataset and Evaluation + +Datasets: We validate our technique on well-known benchmark datasets for image classification, semantic segmentation and natural language processing (NLP). For each of the datasets: CIFAR10/100 [22], SVHN [40], Mendeley V2 [20], Tiny-ImageNet [7] and 20-Newsgroups [28], we have a separate train and test set. The train set is further split into 2 mutually exclusive sets (a) training set containing $90\%$ of the samples, and (b) the validation set containing $10\%$ . We use validation set as the hold-out set for post-hoc calibration. This division has been consistent throughout our experimentation. See Supplementary material for detailed description of datasets, DNN architectures, and training procedure. + +Evaluation: We report calibration measures, SCE, ECE, and class- $j$ -ECE along with test error for studying calibration performance. We observe that we achieve superior calibration using our technique without any significant drop in the accuracy. We also visualize the calibration using reliability diagrams (please see supplementary material for detailed description of reliability diagrams). + +Compared Techniques: We compare our method against models trained with Cross-Entropy (NLL), Label Smoothing (LS) [47], DCA [31], Focal Loss (FL) [32], Brier Score (BS) [2], FLSD [37] as well as MMCE [26]. For details on individual methods and their training specifics, please refer to the supplementary. + +# 5. Results + +# Experiments with Application Specific Loss Functions: + +Our loss is meant to be used in conjunction with another application specific loss function to help improve the calibration performance of a model. Common application specific loss include cross entropy loss (NLL) which in turn minimizes negative log likelihood score of the ground truth label in the predicted confidence vector. Focal Loss (FL) [32] has been proposed to improve training in the presence of many easy negatives, and fewer hard negatives. Whereas Label Smoothing (LS) [47] introduces another term in the NLL to smoothen the prediction of a model. We add the proposed MDCA with each of these loss terms, and measure the calibration performance of a model (in terms of ECE, and SCE scores), before and after adding our loss. Tab. 1 shows the result. We refer to configurations using our technique as ${}^{*} + \mathbf{MDCA}$ , where $*$ refers to NLL/LS/FL. For each of the combination we use relative weight of $\beta \in \{1,5,10,15,20,25\}$ for $\mathcal{L}_{\mathrm{MDCA}}$ , and report the calibration performance of the most accurate model on the val + +![](images/e37dcc773e64a16747fae88e2970ce0dd2d5812498645d4e4aa5d5ce803142e8.jpg) +(a) + +![](images/73a1494f3ae3ee4c2ac93b1aa5ab4672f14b7419f7cc3d3385732d8bcf7b6e53.jpg) +(b) + +![](images/9c17012693a2925c46c05223d1c023eb17f718998b86f4d50a800b38eba77e07.jpg) +(c) + +![](images/431a54090d1a2aa2838158dd0e0c612f4985398b57c15713e2a4a832663823b1.jpg) +(d) + +![](images/856e4ce77ffa65f126b42911facfaf1f89bc04908367662bfe74931bd0d51d0d.jpg) +(e) + +![](images/11dc77ce7915c7cf4dffb62cf6911a57ee9dae13c30abe9707a38a24f4c4e1af.jpg) +(f) + +![](images/74e264f034ae4a2dfc405854aa169f5a0ad4af4582682359c0d0212416b8fa3a.jpg) +(g) + +![](images/f8c5d461fa9b00bae52e66597fb8ebd65f1d4ea1504d8d7d77bef3d8125e0b3a.jpg) +(h) +Figure 2. First row shows Reliability diagrams (a,b) and confidence histograms (c,d) of NLL trained model compared against MDCA regularized version (NLL+MDCA). We use ResNet-32 trained on CIFAR10 dataset for comparison. Second row shows corresponding plots for ResNet-20 network trained with Label Smoothing(LS) vs. MDCA regularized LS on SVHN dataset. Please refer to the text for the interpretation of the plots. We show a similar comparison with FL, and FL+DCA in the supplementary. + +ization set. Our experiments suggest that setting $\beta < 1$ did not have strong regularizing effect). For $\mathcal{L}_{\mathrm{LS}}$ we use $\alpha = 0.1$ , and for $\mathcal{L}_{\mathrm{FL}}$ we use $\gamma \in \{1,2,3\}$ . Please refer to [47] and [32] for interpretation of $\alpha$ , and $\gamma$ respectively. Tab. 1 shows that the proposed MDCA loss improves calibration performance of all the above application specific loss functions, across multiple datasets, and architectures. We also note that FL+MDCA gives best calibration performance. We will use this loss configuration in our experiments hereafter. + +Calibration Comparison with SOTA: Tab. 2 compares calibration performance of our method with all recent SOTA methods. We note that calibration using our method improves both SCE as well as ECE score on all the datasets, and different architectures. + +Class-Conditioned Calibration Error: Current state-of-the-art focuses on calibrating the predicted label only, which leaves some of the minority class un-calibrated. One of the benefits of our calibration approach is better calibration for all and not only the predicted class. To demonstrate the effectiveness of our method, we report class- $j$ -ECE % values of all the competing methods against our method, using ResNet-20 model trained on the SVHN dataset. Tab. 3 shows the result. Our method gives best scores for all but 3 out of 10 classes, where it is second-best. Class-wise reliability diagrams (c.f. Fig. 1) reinforce a similar conclusion. We show results on CIFAR 10 dataset in the supplementary. + +Test Error: Tab. 2 also shows the Test Error (TE) obtained by a model trained using our method and other SOTA approaches. We note that using our proposed loss, a model is able to achieve best calibration performance without sacrificing on the prediction accuracy (Test Error). + +
DatasetModelNLLNLL+MDCALS [38]LS+MDCAFL [32]FL+MDCA
SCE(10-3)ECE (%)SCE(10-3)ECE (%)SCE(10-3)ECE (%)SCE(10-3)ECE (%)SCE(10-3)ECE (%)SCE(10-3)ECE (%)
CIFAR10ResNet328.684.254.631.6914.086.2810.394.314.601.763.220.93
ResNet567.113.276.873.1512.545.389.883.974.181.112.930.70
CIFAR100ResNet323.0312.452.599.941.992.091.742.291.831.621.721.49
ResNet562.509.322.418.951.738.941.681.481.662.291.600.72
SVHNResNet203.431.641.460.4318.808.8813.916.462.540.891.900.47
ResNet563.841.821.470.5321.0810.0017.628.437.853.891.510.23
Mendeley V2ResNet50131.24.7888.143.63103.82.6897.385.03108.38.1785.684.81
Tiny-ImageNetResNet341.9114.911.8714.221.385.961.365.901.192.261.171.99
20 NewsgroupsGlobal-Pool CNN602.6814.78559.5016.53988.423.45520.5017.30729.3913.35487.8216.55
+ +Table 1. Our loss is meant to be used in addition to another application specific loss. The table compares the calibration performance improvement using MDCA over three commonly used loss functions (NLL/LS/FL). Our loss improves calibration performance across multiple datasets and architectures. + +
DatasetModelBS [2]DCA [31]MMCE [26]FLSD [37]Ours (FL+MDCA)
SCEECETESCEECETESCEECETESCEECETESCEECETE
CIFAR10ResNet326.602.927.768.414.007.068.173.318.419.484.417.873.220.937.18
ResNet565.442.177.757.593.386.539.113.718.237.713.497.042.930.707.08
CIFAR100ResNet321.975.3233.532.8211.3129.672.7911.0931.621.771.6932.151.721.4931.58
ResNet561.864.6930.722.779.2943.432.358.6128.751.711.9029.111.600.7229.8
SVHNResNet202.120.453.564.292.023.839.184.344.1218.989.374.101.900.473.92
ResNet562.180.663.252.160.493.329.694.484.2626.1513.233.651.510.233.85
Mendeley V2ResNet50117.63.7518.43145.18.2917.47130.43.4515.06104.39.6419.7185.684.8117.95
Tiny-ImageNetResNet341.537.7943.002.1117.4036.681.629.7140.751.181.9137.011.171.9937.49
20 NewsgroupsGlobal-Pool CNN725.8213.7125.93719.8315.3028.07731.3112.6928.63940.704.5230.80487.8216.5527.88
+ +Table 2. Calibration measures SCE $(10^{-3})$ and ECE $(\%)$ score) and Test Error (TE) $(\%)$ in comparison with various competing methods. We use $M = 15$ bins for SCE and ECE calculation. We outperform all the baselines across various popular benchmark datasets, and architectures in terms of calibration, while maintaining a similar accuracy. + +
MethodClasses
0123456789
Cross Entropy0.200.620.330.650.230.360.250.260.210.41
Focal Loss [32]0.300.480.410.180.380.190.330.360.320.30
LS [38]1.632.602.541.901.911.741.731.751.631.58
Brier Score [2]0.230.280.400.450.250.260.250.270.210.37
MMCE [26]1.782.352.122.001.741.871.651.761.701.84
DCA [31]0.310.700.400.720.310.460.350.350.370.36
FLSD [37]1.523.242.742.151.791.821.841.621.541.38
Ours (FL+MDCA)0.220.160.240.250.220.160.160.170.250.20
+ +Table 3. Class- $j$ -ECE (%) score on all 10 classes for ResNet20 model trained on the SVHN dataset with different learnable calibration methods. Our method gives best calibration for 7 out of 10 classes, and is second-best on 3 classes. + +Mitigating Under/Over-Confidence: Tab. 1 and Tab. 2 already show that our method improves over SOTA in terms of SCE, and ECE scores. However the tables do not highlight whether they correct for over-confidence or under-confidence. We show the reliability diagram (Fig. 2) for a ResNet-32/20 model trained on CIFAR 10/SVHN. The uncalibrated model is overconfident (Fig. 2a) which gets rectified after calibrating with our method (Fig. 2b). We also show confidence plots in the picture, and the colored dashed lines to indicate average confidence of the predicted label, and the accuracy. It can be seen that accuracy is lower than average confidence in the uncalibrated confidence plot + +![](images/c8d84f8e89971a3f5c5f178460447bec89c6eb5cff6712d1de8ea72144b14b15.jpg) +(a) + +![](images/3dd64ab32a66c97c71096ad991912255753f23b65db6dc88c2d83be6cfc8ed1e.jpg) +(b) +Figure 3. Confidence value histogram for misclassified predictions. MDCA regularized NLL makes less confident incorrect predictions as compared to the uncalibrated method trained using NLL. + +(Fig. 2c), which indicates the overconfident model. After calibrating with our method, the two dashed lines almost overlap indicating the perfect calibration achieved (Fig. 2d). Similarly, second row of Fig. 2 show that the model trained with LS solely is under-confident; and a model trained with LS along with MDCA is confident and calibrated. + +Confidence Values for Incorrect Predictions: The focus of the discussion so far has been on the fact that confidence value for a class should be consistent with the likelihood of the class for the sample. Here, we analyze our method for the confidence values it gives when the prediction is incorrect. Fig. 3 shows the confidence value histogram for + +
MethodArtCartoonSketchAverage
NLL6.3317.9515.0113.10
LS [38]7.8011.9510.8810.21
FL [32]8.6116.6210.9412.06
Brier Score [2]6.5513.1915.6311.79
MMCE [26]6.3515.7017.1613.07
DCA [31]7.4918.0114.9913.49
FLSD [37]8.3513.3913.8611.87
Ours (FL+MDCA)6.2111.9111.089.73
+ +Table 4. Calibration performance (SCE $(10^{-3})$ ) under domain shift on PACS dataset [30]. For each column we train on the other two subsets, and then test on the subset listed as the column heading. + +
MethodCIFAR10SVHN
IF-10IF-50IF-100IF-2.7
NLL18.4432.2131.043.43
FL [32]14.6529.6728.892.54
LS [38]14.8826.3020.7918.80
BS [2]15.7433.5729.012.12
MMCE [26]15.1029.0521.569.18
FLSD [37]16.0531.3530.2818.98
DCA [31]18.5732.8135.534.29
Ours (FL+MDCA)11.8322.9726.891.90
+ +all the incorrect predictions made by the ResNet-32 model trained on CIFAR 10 dataset using NLL vs. MDCA regularized NLL. It is clear that our calibration reduces the confidence for the mis-prediction. The same is also evident from the Fig. 1 shown earlier. + +Calibration Performance under Dataset Drift: Tomani et al. [49] show that DNNs are over-confident and highly uncalibrated under dataset/domain shift. Our experiments shows that a model trained with MDCA fairs well in terms of calibration performance even under non-semantic/natural domain shift. We use two datasets (a) PACS [30] and (b) Rotated MNIST inspired from [42]. The datasets are benchmarks for synthetic non-semantic shift and natural rotations respectively. Dataset specifics and training procedure are provided in the supplementary. Tab. 4 shows that our method achieves the best average SCE value across all the domains in PACS. A similar trend is observed on Rotated MNIST dataset as well (see supplementary), where our method achieves the least average SCE value across all rotation angles. + +Calibration Performance on Imbalanced Datasets: The real-world datasets are often skewed and exhibit long-tail distributions, where a few classes dominate over the rare classes. In order to study the effect of class imbalance on the calibration quality, we conduct the following experiment, where we introduce a deliberate imbalance on CIFAR 10 dataset to force a long-tail distribution as detailed in [6]. + +Table 5. Our calibration technique works best even when there is a significant class imbalance in the dataset. For this experiment we created imbalance of various degrees in CIFAR 10 as suggested in [6]. Original SVHN has a Imbalance Factor(IF) of 2.7. Hence we show calibration performance (SCE $(10^{-3})$ ) on original SVHN. + +
MethodPost HocSCE(10-3)↓
CIFAR10CIFAR100SVHN
NLLNone7.122.503.84
TS3.251.494.16
DC4.981.912.69
LS [38]None12.551.7321.08
TS4.491.673.12
DC5.341.982.81
FL [32]None4.191.897.85
TS4.191.622.72
DC5.482.023.36
BS [2]None5.441.862.18
TS3.941.683.88
DC4.831.802.11
MMCE [26]None9.122.359.69
TS4.051.613.74
DC6.261.955.11
DCA [31]None7.602.872.16
TS3.001.564.29
DC4.202.062.95
FLSD [37]None7.711.7126.15
TS3.271.714.41
DC5.622.014.31
Ours (FL+MDCA)None2.931.601.51
TS2.931.605.00
DC3.811.872.72
+ +Table 6. Results after combining various trainable calibration methods including ours with two post-hoc calibration methods (TS: Temperate scaling [45], and DC: Dirichlet Calibration [23]) on SCE $(10^{-3})$ . We use ResNet56 model on CIFAR 10, CIFAR 100, and SVHN datasets for this experiment. Though other methods benefit by post-hoc calibration, our method outperforms them without using any post-hoc calibration. + +Tab. 5 shows that a model trained with our method has best calibration performance in terms of SCE score across all imbalance factors. We observe that SVHN dataset already has a imbalance factor of 2.7, and hence create no artificial imbalance in the dataset for this experiment. The efficacy of our approach on the imbalanced data is due to the regularization provided by MDCA which penalizes the difference between average confidence and average count even for the non-predicted class, hence benefiting minority classes. + +Our Approach + Post-hoc Calibration: We study the performance of combined effect of post-hoc calibration methods, namely Temperature Scaling (TS) [45], and Dirichlet Calibration (DC) [23], applied over various train-time calibration methods including ours (FL+MDCA). Tab. 6 shows the results. We observe that while TS, and DC improve the performance of other competitive methods, our method outperforms them even without using any of these methods. On the other hand, the performance of our method seems to either remain same or slightly decrease after application of post-hoc methods. We speculate that this is because our method already calibrates the model to near perfection. For example, on performing TS, we observe the optimal temperature values are $T \approx 1$ implying that it leaves little scope for the TS to improve on top of it. Thus, any further attempt to over-spread the confidence prediction using TS or + +
MethodPixel Acc. (%)mIoU (%)SCE (10-3)ECE (%)
NLL94.8179.496.47.77
NLL+TS94.8179.496.266.1
FL92.8577.2211.87.69
Ours (FL+MDCA)94.4778.665.84.66
+ +Table 7. Segmentation results on Xception65 [5] backbone DeeplabV3+ model [3] on PASCAL-VOC 2012 validation dataset. + +![](images/1949dd00c117d446a8b2da49233c37eb54445ffb776adcb54e2d9c442c62baf6.jpg) +Figure 4. Effect of different batch sizes on Calibration performance metrics (ECE/SCE/Accuracy) while training with MDCA on a ResNet-32 model on CIFAR 10 dataset. The calibration performance drops with larger batch size because SGD optimization is more effective in a small-batch regime [21]. A larger batch results in a degradation in the quality of the model, as measured by its ability to generalize. The performance degradation is also consistent with the model trained using solely on FL on a large batch size. + +![](images/4e00630a03f97c44f146f1b7e07bfac0102c0a7562e4ad6d4ce3fb163c92d7a1.jpg) +Figure 5. Comparison of ECE/SCE at various epochs for MDCA, MMCE, and DCA. Though, MMCE, and DCA directly optimize for ECE, their loss function is not differentiable and hence the techniques are not able to reduce ECE as much as MDCA. Differentiability of loss function allows MDCA to reduce ECE better even when it does not directly optimize it. We use a learning rate decay of $1/10$ at epochs 50 and 70. Please refer to the supplementary for the details of the experiment. + +DC negatively affects the confidence quality. + +Calibration Results for Semantic Segmentation: One of the major advantages of our technique is that it allows to use billions of weights of a DNN model to be used for the calibration. This is in contrast to other calibration approaches which are severely constrained in terms of parameters available for tuning. For example in TS one has a single temperature parameter to tune. This makes it hard for TS to provide image and pixel specific confidence transformation for calibration. To highlight pixel specific calibration aspect of our technique we have done experiments on semantic segmentation task, which can be seen as pixel level classification. For the experiment, we train a DeepLabV3+ [3] model with a pre-trained Xception65 [5] backbone on the PASCAL-VOC 2012 [11] dataset. We compare the performance of our method against NLL, FL and TS (post-hoc calibration). Please refer to the supplementary for more details on the training. Tab. 7 shows the results. We see a significant drop in both SCE/ECE in case of our method (FL+MDCA) as compared to FL $(2\times$ drop in SCE and a $40\%$ decrease in ECE). Our method also outperforms TS (after training with NLL) by $23.6\%$ . + +# 6. Ablation Study + +Effect of Batch Size: Fig. 4 shows the effect of different batch sizes on the calibration performance. We vary the batch sizes exponentially and observe that a model trained with MDCA achieves best calibration performance around batch size of 64 or 128. As we decrease (or increase) the + +![](images/bf9e5e921188c98de18bfd0d0d5afb8163147b12ccd020673ebc9e03298d4036.jpg) + +![](images/0c133bf04f0c97c828a0d77c96ae8fb235fcefd772c602f37b233480208f6ea9.jpg) + +batch size, we see a degradation in calibration, though the drop is not significant. + +Comparison of ECE/SCE Convergence with SOTA: In previous sections, we compared the ECE scores of MDCA with other contemporary trainable calibration methods like MMCE [26] and DCA [31]. Many of these methods explicitly aim to reduce ECE scores. While MDCA does not directly optimize ECE, yet we see in our experiments that MDCA manages to get better ECE scores at convergence. We speculate that this is due to the differentiability of MDCA loss which helps optimize the loss better using backpropagation. To verify the hypothesis, we plot the ECE convergence for various methods in Fig. 5. + +# 7. Conclusion & Future work + +We have presented a train-time technique for calibrating the predicted confidence values of a DNN based classifier. Our approach combines standard classification loss functions with our novel auxiliary loss named, Multi-class Difference of Confidence and Accuracy (MDCA). Our proposed loss function when combined with focal loss yields the least calibration error among both trainable and post-hoc calibration methods. We show promising results in case of long tail datasets, natural/synthetic dataset drift, semantic segmentation and a natural language classification benchmark too. In future we would like to investigate the role of class hierarchies to develop cost-sensitive calibration techniques. + +# 8. Acknowledgments + +Thanks to Mayank Baranwal and Harshad Khadilkar for helpful discussions and suggestions. + +# References + +[1] Ondrej Bohdal, Yongxin Yang, and Timothy Hospedales. Meta-calibration: Meta-learning of model calibration using differentiable expected calibration error. 2021. iii +[2] Glenn W Brier et al. Verification of forecasts expressed in terms of probability. Monthly weather review, 78(1):1-3, 1950. iii, v, vi, vii +[3] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. CoRR, abs/1802.02611, 2018. viiii +[4] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L. Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4):834-848, 2018. ii +[5] 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. viii +[6] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9260-9269, 2019. vii +[7] 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. v +[8] Terrance DeVries and Graham W Taylor. Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018. iii +[9] Zhipeng Ding, Xu Han, Peirong Liu, and Marc Niethammer. Local temperature scaling for probability calibration. CoRR, abs/2008.05105, 2020. iii +[10] Michael W. Dusenberry, Dustin Tran, Edward Choi, Jonas Kemp, Jeremy Nixon, Ghassen Jerfel, Katherine Heller, and Andrew M. Dai. Analyzing the role of model uncertainty for electronic health records. Proceedings of the ACM Conference on Health, Inference, and Learning, Apr 2020. ii +[11] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2012 (VOC2012) Results. http://www.pascalnetwork.org/challenges/VOC/voc2012/workshop/index.html.viii +[12] Arthur Gretton. Introduction to rkhs, and some simple kernel algorithms. Adv. Top. Mach. Learn. Lecture Conducted from University College London, 16:5-3, 2013. iii +[13] Sorin Grigorescu, Bogdan Trasnea, Tiberiu Cocias, and Gigel Macesanu. A survey of deep learning techniques for autonomous driving. Journal of Field Robotics, 37(3):362-386, 2020. ii +[14] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. 2019. ii, iii +[15] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. CoRR, abs/1610.02136, 2016. ii + +[16] Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. *ICLR*, 2018. iii +[17] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. ii +[18] Mobarakol Islam, Lalithkumar Seenivasan, Hongliang Ren, and Ben Glocker. Class-distribution-aware calibration for long-tailed visual recognition. ICML Uncertainty in Deep Learning Workshop, 2021. iii +[19] Davood Karimi and Ali Gholipour. Improving calibration and out-of-distribution detection in medical image segmentation with convolutional neural networks. CoRR, abs/2004.06569, 2020. iii +[20] Daniel Kermany, Kang Zhang, Michael Goldbaum, et al. Labeled optical coherence tomography (oct) and chest x-ray images for classification. Mendeley data, 2(2), 2018. v +[21] N. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In ICLR, 2017. viii +[22] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. v +[23] Meelis Kull, Miquel Perello-Nieto, Markus Kangsepp, Hao Song, Peter Flach, et al. Beyond temperature scaling: Obtaining well-calibrated multiclass probabilities with dirichlet calibration. arXiv preprint arXiv:1910.12656, 2019. ii, iv, vii +[24] Meelis Kull, Telmo Silva Filho, and Peter Flach. Beta calibration: a well-founded and easily implemented improvement on logistic calibration for binary classifiers. In Artificial Intelligence and Statistics, pages 623-631. PMLR, 2017. iii +[25] Ananya Kumar, Percy Liang, and Tengyu Ma. Verified uncertainty calibration. arXiv preprint arXiv:1909.10155, 2019. iv +[26] Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 2805-2814. PMLR, 10-15 Jul 2018. vii, viii, viiii +[27] Ken Lang. Newsweeder: Learning to filter netnews. In Proceedings of the Twelfth International Conference on Machine Learning, pages 331-339, 1995. ii +[28] Ken Lang. Newsweeder: Learning to filter netnews. In Machine Learning Proceedings 1995, pages 331-339. Elsevier, 1995. v +[29] Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010. ii +[30] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pages 5542-5550, 2017. i, ii, vii +[31] Gongbo Liang, Yu Zhang, Xiaoqin Wang, and Nathan Jacobs. Improved trainable calibration method for neural networks on medical imaging classification. CoRR, abs/2009.04057, 2020. iii, iv, v, vii, viii + +[32] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988, 2017. ii, iii, iv, v, vi, vii +[33] Juan Maroñas, Daniel Ramos, and Roberto Paredes. On calibration of mixup training for deep neural networks. In Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), pages 67-76. Springer, 2021. iii +[34] H. Matthias, A. Maksym, and B. Julian. Why relu networks yield high-confidence predictions far away from the training data and how to mitigate the problem. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 41-50, 2019. iii +[35] Lassi Meronen, Christabella Irwanto, and Arno Solin. Stationary activations for uncertainty calibration in deep learning. arXiv preprint arXiv:2010.09494, 2020. iii +[36] Matthias Minderer, Josip Djolonga, Rob Romijnders, Frances Hubis, Xiaohua Zhai, Neil Houlsby, Dustin Tran, and Mario Lucic. Revisiting the calibration of modern neural networks. arXiv preprint arXiv:2106.07998, 2021. ii +[37] Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip H. S. Torr, and Puneet K. Dokania. Calibrating deep neural networks using focal loss, 2020. iii, v, vi, vii +[38] Rafael Müller, Simon Kornblith, and Geoffrey Hinton. When does label smoothing help? arXiv preprint arXiv:1906.02629, 2019. ii, iii, vi, vii +[39] Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015. iii +[40] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011. v +[41] Jeremy Nixon, Michael W Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran. Measuring calibration in deep learning. In CVPR Workshops, volume 2, 2019. iv +[42] Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua V Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. arXiv preprint arXiv:1906.02530, 2019. vii +[43] Shreyas Padhy, Zachary Nado, Jie Ren, Jeremiah Liu, Jasper Snoek, and Balaji Lakshminarayanan. Revisiting one-vs-all classifiers for predictive uncertainty and out-of-distribution detection in neural networks. arXiv preprint arXiv:2007.05134, 2020. iii +[44] Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions, 2017. iii +[45] John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers, 10(3):61-74, 1999. iii, vii +[46] Monika Sharma, Oindrila Saha, Anand Sriraman, Ramya Hebbalaguppe, Lovekesh Vig, and Shirish Karande. Crowd- + +sourcing for chromosome segmentation and deep classification. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 786-793, 2017. ii +[47] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision, 2015. iii, iv, v +[48] Sunil Thulasidasan, Gopinath Chennupati, Jeff Bilmes, Tan-moy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. arXiv preprint arXiv:1905.11001, 2019. ii +[49] Christian Tomani, Sebastian Gruber, Muhammed Ebrar Erdem, Daniel Cremers, and Florian Buettner. Post-hoc uncertainty calibration for domain drift scenarios. CoRR, abs/2012.10988, 2020. vii +[50] David Widmann, Fredrik Lindsten, and Dave Zachariah. Calibration tests in multi-class classification: A unifying framework. arXiv preprint arXiv:1910.11385, 2019. iv +[51] Ronald Yu and Gabriele Spina Ali. What's inside the black box? ai challenges for lawyers and researchers. Legal Information Management, 19(1):2-13, 2019. ii +[52] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018. iii \ No newline at end of file diff --git a/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/images.zip b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8d33e92de8df267586ac350f15f849ad15ba429d --- /dev/null +++ b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3c91f1a5a56acee69c14af70c106b926000df144055cfed5d6b341dd4967aa2 +size 577880 diff --git a/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/layout.json b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..699122ca697cd312c0042d2193d89f3504a777ee --- /dev/null +++ b/astitchintimesavesnineatraintimeregularizinglossforimprovedneuralnetworkcalibration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:673a1dc169af486d3edf56b9b73ef53e394d045ee623ccfaa80afd030c93df02 +size 431662 diff --git a/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_content_list.json b/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..77b1d06b9c6967f61c3fdf93a6d004d786b60bd6 --- /dev/null +++ b/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:847f59bdcd9bf93e86017ae2120ebaf98d221cb78ca1fed2b233e28e676d2e7d +size 84307 diff --git a/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_model.json b/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e0ec1e16ab03584cd435ff0b98be733be461ce02 --- /dev/null +++ b/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8e6f9b017f682e2b133b08c78936e2fb2d1d7f336e6c83ecef55502cd574151 +size 105076 diff --git a/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_origin.pdf b/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..72ad8856928bb24f5f22c4d0e6fc9de61bec3e4e --- /dev/null +++ b/astructureddictionaryperspectiveonimplicitneuralrepresentations/bd4b28a5-70ab-4e24-b10e-5293baed7b6a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f79731eae400d18b5530ce356fb8f7ee09323ca9f2b916891123a71e9de527ab +size 3528677 diff --git a/astructureddictionaryperspectiveonimplicitneuralrepresentations/full.md b/astructureddictionaryperspectiveonimplicitneuralrepresentations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1891eaf6a46c4b80da6025407242fa52247751f3 --- /dev/null +++ b/astructureddictionaryperspectiveonimplicitneuralrepresentations/full.md @@ -0,0 +1,328 @@ +# A Structured Dictionary Perspective on Implicit Neural Representations + +Gizem Yüce* ETH Zurich + +gyuece@ethz.ch + +Guillermo Ortiz-Jiménez* Beril Besbinar Pascal Frossard École Polytechnique Fédérale de Lausanne (EPFL) + +{name.surname}@epfl.ch + +# Abstract + +Implicit neural representations (INRs) have recently emerged as a promising alternative to classical discretized representations of signals. Nevertheless, despite their practical success, we still do not understand how INRs represent signals. We propose a novel unified perspective to theoretically analyse INRs. Leveraging results from harmonic analysis and deep learning theory, we show that most INR families are analogous to structured signal dictionaries whose atoms are integer harmonics of the set of initial mapping frequencies. This structure allows INRs to express signals with an exponentially increasing frequency support using a number of parameters that only grows linearly with depth. We also explore the inductive bias of INRs exploiting recent results about the empirical neural tangent kernel (NTK). Specifically, we show that the eigenfunctions of the NTK can be seen as dictionary atoms whose inner product with the target signal determines the final performance of their reconstruction. In this regard, we reveal that meta-learning has a reshaping effect on the NTK analogous to dictionary learning, building dictionary atoms as a combination of the examples seen during meta-training. Our results permit to design and tune novel INR architectures, but can also be of interest for the wider deep learning theory community. + +# 1. Introduction + +Implicit neural representations (INRs) have recently emerged as a powerful alternative to classical, discretized, representations of multimedia signals [9, 13, 30, 31, 39, 47, 48, 52, 53]. In contrast to traditional methods, INRs parameterize the continuous mapping between coordinates and signal values using neural networks. This allows for an efficient and compact representation of signals that can be easily integrated into modern differentiable learning pipelines. + +The recent success of INRs in many applications, such as surface representation [47], volume rendering [27,31,40, + +![](images/ea426cf501978acf53776b4d473b8e58a7f425adabf90d4895329260833091ee.jpg) +Figure 1. Conceptual illustration of our main theoretical contributions: i) Each layer of an INR increases the frequency support of the representation by splitting a signal into higher order harmonics. ii) INRs can be interpreted as signal dictionaries whose atoms are the eigenfunctions of their NTK at initialization. + +50] or generative modelling [7, 14] can be largely attributed to the development of new periodic representations that can circumvent the spectral bias of standard neural networks. Indeed, there is ample evidence that the use of periodic representations [22, 31, 48, 52] can mitigate the bias of standard architectures towards low frequency [43]. + +Nevertheless, even if INRs have become widely adopted in practice, the theoretical understanding of their principles and properties is rather limited. For example, there is no clear criterion to select between different INR families, their parameters are mostly based on heuristics, and their limitations are not well understood. These shortcomings are slowing down further research developments. In this work, we therefore take a step back and focus on understanding the mechanisms behind the success of modern INRs, but also their failure modes, in order to develop more informed design strategies. We provide a unified perspective with the aim to answer the following important questions: + +1. What is the expressive power of INRs? + +# 2. How does initialization affect their inductive bias? + +Specifically, we first leverage results from harmonic analysis and deep learning theory, and we discover that the expressive power of most INRs is equivalent to that of a structured signal dictionary whose atoms are integer harmonics of the frequencies that define their initial input mapping (see Fig. 1). This unifies many INR architectures under a single perspective, and can serve to understand them better and mitigate some of their common problems. + +Then, we delve deeper on the inductive bias of INRs. We build upon the foundational work in [52], and exploit recent results in deep learning theory to give a new unifying framework to analyse the inductive bias of any INR architecture in terms of its empirical neural tangent kernel (NTK) [20]. In particular, we reveal the existence of a close analogy between the eigenfunctions of the empirical NTK and the atoms of a signal dictionary, and show that the difficulty of learning a signal with an INR is intimately connected to how efficiently it can be encoded by this dictionary. + +Finally, we use our novel perspective to explain the role of meta-learning in improving the performance of INRs. INRs are known to be notoriously inefficient, requiring long training times, and a large sample exposure to achieve good results, especially in 3D settings [17, 18, 45]. However, recent works have shown that using meta-learning algorithms to initialize INRs can greatly improve their speed of convergence and sample complexity [46, 51]. In this work, we show that meta-learning works as a dictionary learning algorithm, transforming the NTK of an INR into a rich signal dictionary whose atoms are formed by combinations of the examples seen during meta-training. This increases the representation efficiency of the target signals by the NTK [37], thus improving performance and training speed. + +In summary, the main contributions of our work are: + +- We provide a unified perspective to theoretically analyze the expressive power and inductive bias of INRs. +- We show that the frequency support of INRs grows exponentially with depth, as each layer splits its input into higher order harmonics, demonstrating their efficiency in representing wide spectrum signals. +- We use this theory to explain the main failure modes of INRs: imperfect recovery and aliasing. +- We show that the inductive bias of INRs can be characterized by the ability of their empirical NTKs to encode different target signals efficiently. +- Finally, we discover that meta-learning greatly increases the encoding efficiency of the NTK by constructing a rich signal dictionary using different combinations of the meta-training tasks. + +Overall, we believe that our findings can impact the future research in INRs and their applications, and contribute + +to speeding up the development of new principled algorithms in the field. It gives a fresh perspective to understand and alleviate the drawbacks of the current architectures, as well as new intuitions to design better INR algorithms. Finally, our analysis on the effect of meta-learning can also be of broader interest for the deep learning theory community1. + +# 2. Implicit Neural Representations + +The goal of an implicit neural representation is to encode a continuous target signal $g: \mathbb{R}^D \to \mathbb{R}^C$ using a neural network $f_{\theta}: \mathbb{R}^D \to \mathbb{R}^C$ , parameterized by a set of weights $\pmb{\theta} \in \mathbb{R}^N$ , by representing the mapping between input coordinates $\pmb{r} \in \mathbb{R}^D$ , e.g., pixels, and signal values $g(\pmb{r}) \in \mathbb{R}^C$ , e.g., RGB colors. This is achieved minimizing a distortion measure, like mean-squared error, during training using some form of (stochastic) gradient descent (SGD). + +The continuous parameterization of INRs allows to store signals at a constant memory cost regardless of the spatial resolution, which makes INRs standout for reconstructing high-dimensional signals, such as videos or 3D scenes. The main challenge for INRs, though, is to reconstruct high frequency details present in most multimedia signals, e.g., textures in images. Classical neural network architectures are well-known for their strong spectral bias towards lower frequencies [43], and this has made them traditionally useless for implicit representation tasks. Recently, however, few works [47, 52] have come up with different solutions to circumvent the spectral bias of neural networks, allowing faster convergence and greater fidelity of INRs. + +In what follows, we provide an overview of the main solutions under a unified architecture formulation. Specifically, we note that most INR architectures can be decomposed into a mapping function $\gamma : \mathbb{R}^D \to \mathbb{R}^T$ followed by a multilayer perceptron (MLP), with weights $W^{(\ell)} \in \mathbb{R}^{F_{\ell-1} \times F_\ell}$ , bias $b^{(\ell)} \in \mathbb{R}^{F_\ell}$ , and activation function $\rho^{(\ell)} : \mathbb{R} \to \mathbb{R}$ , applied elementwise; at each layer $\ell = 1, \ldots, L-1$ . That is, if we denote by $z^{(\ell)}$ each layers post activation, most INR architectures compute + +$$ +\begin{array}{l} z ^ {(0)} = \gamma (\boldsymbol {r}), \tag {1} \\ \boldsymbol {z} ^ {(\ell)} = \rho^ {(\ell)} \left(\boldsymbol {W} ^ {(\ell)} \boldsymbol {z} ^ {(\ell - 1)} + \boldsymbol {b} ^ {(\ell)}\right), \ell = 1, \dots , L - 1 \\ f _ {\boldsymbol {\theta}} (\boldsymbol {r}) = \boldsymbol {W} ^ {(L)} \boldsymbol {z} ^ {(L - 1)} + \boldsymbol {b} ^ {(L)}. \\ \end{array} +$$ + +We now examine the two most popular INR architectures: + +Fourier feature networks (FFNs) In [52], Tancik et al. proposed to use a Fourier mapping $\gamma (\boldsymbol {r}) = \sin (\Omega \boldsymbol {r} + \phi)$ with parameters $\Omega \in \mathbb{R}^{T\times D}$ and $\phi \in \mathbb{R}^T$ followed by an MLP with $\rho^{(\ell)} = \mathrm{ReLU}$ . Specifically, they showed that initializing $\Omega_{i,j}\sim \mathcal{N}(0,\sigma^2)$ with random Fourier features [44] can modulate the spectral bias of an FFN, with + +larger values of $\sigma$ biasing these networks towards higher frequencies. Alternative formulations with deterministic initialization, commonly used for neural rendering algorithms [31] can be considered as a special category of these networks where the frequencies in $\Omega$ are taken to be powers of 2 and the frequencies in $\phi$ alternate between $\{0,\pi /2\}$ + +Sinusoidal representation networks (SIRENs) In [47], Sitzmann et al. proposed to use MLP with sinusoidal activations, i.e., $\rho^{(\ell)} = \sin$ , where the first layer post activation, $z^{(0)} = \sin\left(\omega_0(W^{(0)}r + b^{(0)})\right)$ can be interpreted as $\gamma(r) = \sin(\Omega r + \phi)$ . They showed that, by rescaling the parameters at initialization by the constant factor $\omega_0$ , SIRENs can also modulate the spectral bias, with larger $\omega_0$ biasing these networks towards higher frequencies. + +Nonetheless, despite the ample empirical evidence that shows that these architectures are effective at representing natural images or other visual signals, there is little theoretical understanding of how they do so. Moreover, since the design of each of these networks is guided by very different principles, the sheer diversity in the structure of these architectures makes their analysis very involved. + +In the next sections, we provide a unified perspective to analyze the expressive power and inductive bias of INRs and show that all modern INRs are intrinsically guided by the same fundamental principles, which let them express a wide range of signals. However, it also makes them prone to the same type of failure modes. Our novel framework can be used to design new principled solutions to address these shortcomings, but also simplify the tuning of current INRs. + +# 3. Expressive Power of INRs + +We now provide an integrated analysis of the expressive power of INRs. To that end, we will follow the formulation in Eq. (1), where, to simplify our derivations, we will restrict ourselves to polynomial activation functions, i.e., nonlinearities of the form $\rho(x) = \sum_{k=0}^{K} \alpha_k x^k$ . Note that this is a very mild assumption, as all analytic activation functions, e.g., sinusoids, can be approximated using polynomials with a naive Taylor expansion; and that even the nondifferentiable ReLUs can be effectively approximated using Chebyshev polynomials [28]. Note, also, that the sequence of coefficients of the polynomial expansion of most activation functions used in practice decays very rapidly [28]. + +Now, without loss of generality, let $D = 1$ and consider what happens when a single-frequency mapping, i.e. $\gamma (r) = e^{j\omega r}$ , goes through such a polynomial activation: The output of the activation consists of a linear combination of the integer harmonics of the input frequency, i.e., + +$$ +\rho (\gamma (r)) = \rho (e ^ {j \omega r}) = \sum_ {k = 0} ^ {K} \alpha_ {k} e ^ {j k \omega r}. \tag {2} +$$ + +This harmonic expansion is precisely the mechanism that + +controls the frequency representation in INRs. More generally, the mapping $\gamma (\boldsymbol {r})$ acts as a collection of single frequency basis, whose spectral support is expanded after each non-linear activation into a collection of higher order harmonics. This particular structure is shared among all FFNs and SIRENs and it gives rise to the following result regarding their expressive power, i.e. the class of functions that can be represented with these architectures. + +Theorem 1. Let $f_{\theta}:\mathbb{R}^{D}\to \mathbb{R}$ be an INR of the form of Eq. (1) with $\rho^{(\ell)}(z) = \sum_{k = 0}^{K}\alpha_{k}z^{k}$ for $\ell >1$ . Furthermore, let $\Omega = [\Omega_0,\dots ,\Omega_{T - 1}]^\top \in \mathbb{R}^{T\times D}$ and $\phi \in \mathbb{R}^T$ denote the matrix of frequencies and vector of phases, respectively, used to map the input coordinate $\pmb {r}\in \mathbb{R}^{D}$ to $\gamma (\pmb {r}) = \sin (\pmb {\Omega}\pmb {r} + \phi)$ . This architecture can only represent functions of the form + +$$ +f _ {\boldsymbol {\theta}} (r) = \sum_ {\omega^ {\prime} \in \mathcal {H} (\Omega)} c _ {\omega^ {\prime}} \sin \left(\left\langle \boldsymbol {\omega} ^ {\prime}, \boldsymbol {r} \right\rangle + \phi_ {w ^ {\prime}}\right), \tag {3} +$$ + +where + +$$ +\mathcal {H} (\boldsymbol {\Omega}) \subseteq \left\{\sum_ {t = 0} ^ {T - 1} s _ {t} \boldsymbol {\Omega} _ {t} \mid s _ {t} \in \mathbb {Z} \wedge \sum_ {t = 0} ^ {T - 1} | s _ {t} | \leq K ^ {L - 1} \right\}. \tag {4} +$$ + +Proof. See Appendix. + +Thm. 1 shows that the expressive power of FFNs and SIRENs is restricted to functions that can be expressed as a linear combination of certain harmonics of the feature mapping $\gamma(r)$ . That is, these architectures have the same expressive power as a structured signal dictionary whose atoms are sinusoids with frequencies equal to sums and differences of the integer harmonics of the mapping frequencies2. Interestingly, an analogous result was also proven for the Multiplicative Filter Networks (MFNs) [15], a proof-of-concept architecture based on a multiplicative connection between layers instead of the usual compositional structure of MLPs. In particular, it can be shown that MFNs, although very different in structure, are also only able to express linear combinations of certain harmonics of their sinusoidal filters [15], which means that they have the same expressive power as FFNs and SIRENs. + +Besides this unification, Thm. 1 also highlights that the way all these architectures encode different signals is very similar. Indeed, instead of representing a signal by directly learning the coefficients of the linear combination, which would require to store $\mathcal{O}(TK^L)$ coefficients $c_{\omega'}$ ; the multilayer structure of all INRs imposes a certain low rank structure over the coefficients - akin to the sparsity assumption in classical dictionaries [54] - which can greatly save on memory as it only requires to store $\mathcal{O}(T^2 L)$ parameters. This is better understood through an illustrative example3. + +Example. Let $f_{\theta}$ be a three-layer SIREN defined as + +$$ +f _ {\boldsymbol {\theta}} (r) = \boldsymbol {w} ^ {(2) ^ {\top}} \sin \left(\boldsymbol {W} ^ {(1)} \sin (\boldsymbol {\Omega} r)\right), \tag {5} +$$ + +where $\Omega \in \mathbb{R}^T$ , $\pmb{W}^{(1)} \in \mathbb{R}^{F \times T}$ , and $\pmb{w}^{(2)} \in \mathbb{R}^F$ . The output of this network can equivalently be represented as + +$$ +f _ {\boldsymbol {\theta}} (r) = \sum_ {m = 0} ^ {F - 1} \sum_ {s _ {1}, \dots , s _ {T} = - \infty} ^ {\infty} c _ {m, s _ {1}, \dots , s _ {T}} \sin \left(\sum_ {t = 0} ^ {T - 1} s _ {t} \omega_ {t} r\right), \tag {6} +$$ + +where + +$$ +c _ {m, s _ {1}, \dots , s _ {T}} = \left(\prod_ {t = 0} ^ {T - 1} J _ {s _ {t}} \left(W _ {m, t} ^ {(1)}\right)\right) w _ {m} ^ {(2)}, \tag {7} +$$ + +and $J_{s}$ denotes the Bessel function of first kind of order $s$ . + +Proof. See Appendix + +![](images/7c815140ed0c329929240aa959295978c857f89110e4ccbf9b9fd362d4d714c3.jpg) + +As we can see, the harmonic expansion introduced by the nested sinusoids of this simple SIREN can be developed into a signal with a very large bandwidth. Indeed, the few coefficients of this network are enough to represent a signal supported by an infinite number of frequency harmonics. + +On the other hand, note that composing sinusoids is a common operation in communication theory as it defines the basis of frequency modulation (FM) technology [42]. Interestingly, drawing analogies between FM signals and SIRENs is a good source of inspiration to intuitively understand how these networks modulate their spectral bias: Recall that for FM signals, such as $\sin (\beta \sin (\omega_0r))$ , the parameter $\beta$ controls the bandwidth of the modulation, which is generally limited by the decreasing nature of the Bessel coefficients $J_{n}(\beta)$ in $n$ . Increasing $\beta$ has the effect of expanding the spectral support of the modulation, as the arguments of the Bessel functions increase. + +The analogous phenomenon can be observed in Eq. (6) for this simple SIREN, but can be extended to more general architectures. In general, we see that due to the decreasing nature of the Bessel functions $J_{s_t}(W_{m,t}^{(1)})$ , the high order harmonics in Eq. (6) tend to have smaller weights than the lower ones. This specific parameterization acts as an implicit bias mechanism, which focuses most of the energy of the output signal in a narrow band around the input frequencies $\Omega$ . Nevertheless, we can also see that increasing the scale of the coefficients in the inner layer, e.g., $W^{(1)}$ , makes the coefficients of higher order terms in Eq. (7) larger, thus increasing the power of the higher order harmonics, and allowing the network to learn a wider range of frequencies. + +The fact that all modern INRs encode information in a similar way can explain why all these architectures are as powerful, in practice. However, it may also explain why they all suffer from the same failure modes. In Sec. 4, we study these in more detail. + +![](images/6d181f12c465261de26b536eb873f2b53aeab50b6590511efb05ec635608f5a0.jpg) +Figure 2. Left Image reconstruction with different mappings of the input coordinates. Right: Magnitude of the DFT of the reconstruction. The FFN uses random Fourier encodings as defined in Sec. 2, and the single frequency mappings correspond to $\gamma (\boldsymbol {r}) = [\cos (2\pi f_0\boldsymbol {r}),\sin (2\pi f_0\boldsymbol {r})]^T$ + +# 4. Failure modes of INRs + +We now move on to study of the main failure modes of INRs. In particular, we will see how the specific harmonic expansion from Thm. 1 can sometimes lead to very recognizable artifacts in the learned reconstructions. Specifically, imperfect signal recovery and aliasing. + +# 4.1. Imperfect recovery + +One of the main consequences of Thm. 1 is that the set of frequencies that define the base embedding $\gamma(r)$ completely determines the frequency support of the reconstruction $f_{\theta}(r)$ . In this sense, it is fundamental to guarantee that the set $\mathcal{H}(\Omega)$ permits to properly cover the spectrum of $g(r)$ . When this is not the case, the reconstructed representations can exhibit severe artifacts in the spatial domain stemming from an incorrect choice of fundamental frequencies determined by the INR mapping in Eq. (1). + +Let us illustrate this phenomenon for $\mathrm{FFN}s^4$ , but note that other types of architectures, such as SIRENs, also can suffer from spatial artifacts. To that end, let us take the extreme case of an FFN $f_{\theta}:\mathbb{R}^{2}\to \mathbb{R}^{3}$ , with a deterministic single frequency Fourier encoding $\gamma (\boldsymbol {r}) = [\sin (2\pi f_0\boldsymbol {r}),\cos (2\pi f_0\boldsymbol {r})]^{\top}$ , reconstructing an image $f: [-1,1]^2\rightarrow \mathbb{R}^3$ , from samples in a grid of $N\times N$ + +Now, note that, in light of Thm. 1, this network can only represent signals with a frequency support in $\mathcal{H}(\Omega) \subseteq \{2k \cdot \pi f_0 | k \in \mathbb{Z}\}$ , i.e., containing only even multiples of $\pi f_0$ . This means that if we choose $f_0 = 1$ , the discrete Fourier transform (DFT) of the reconstruction will only have nonzero coefficients at frequencies corresponding to $2k \cdot 2\pi / N$ for $k = 0, \ldots, \lfloor (N - 1) / 2 \rfloor$ . This frequency covering is certainly not enough to completely represent images, as it misses all odd multiples of $2\pi / N$ . + +As shown in Fig. 2, reconstructing an image with such network produces severe artifacts. The learned representation with $f_{0} = 1$ is highly distorted. That is, we see multiple displaced versions of the target image imposed over each other. The nature of this artifact is much more clear when we inspect the DFT of the reconstruction, which is supported on a perfect grid in the spectral domain, missing all the values of the spectrum at the odd coefficients. + +Strikingly, setting $f_0 = 0.5$ is enough to completely get rid of this type of artifact. Indeed, when $f = 0.5$ the set $\mathcal{H}(\Omega) \subseteq \{\pi k | k \in \mathbb{Z}\}$ , which means that the DFT of the reconstruction can have energy in all spectral coefficients. Nonetheless, we also observe that the resulting image is quite blurry. As we will see, this is due to the fast decay of the polynomial coefficients in Eq. (2) for most activation functions, including ReLUs [28], which causes the weights of the high frequency harmonics in Eq. (3) to be very small. This phenomenon can be greatly alleviated, however, by increasing the frequency cover of the initial mapping $\gamma(\boldsymbol{r}) = \sin(\Omega r + \phi)$ and sampling $\Omega \in \mathbb{R}^{D \times T}$ using $\Omega_{i,j} \sim \mathcal{N}(0, \sigma^2)$ . Indeed, using a large $T$ with a large $\sigma$ can reduce the probability of having a limited representation of the frequency spectrum of the target signal. Nevertheless, as we will see in Sec. 4.2, setting $\sigma$ too large can introduce other problems. + +# 4.2. Aliasing + +It has been empirically shown that INRs with high fundamental frequencies in $\gamma (\boldsymbol {r})$ converge faster, and achieve higher performances in the training set [47,52]; even for targets with high frequency details. Nevertheless, it has also been reported that initializing these frequencies too high leads to poor performance outside the exact support of the training set, and produces aliasing artifacts [5]. To the best of our knowledge, this behavior is still poorly understood. + +Thm. 1 can, however, shed new light on this phenomenon. To that end, it is useful to see INRs as digital-to-analog converters (DAC), since INRs do little more than reconstruct a continuous signal from a set of discrete training samples. Classical sampling theory [36] guarantees that one can reconstruct a bandlimited signal from its samples provided the sampling frequency is above the Nyquist rate. Nevertheless, it also states that without this prior knowledge, the problem of reconstructing a continuous signal + +![](images/771ecb0b995e1d73a94249a65e6194b0ddd6fadbb9fe79c35354038a0b218a6b.jpg) +Figure 3. Magnitude of the spectrum of $g(r) = \sin (2\pi \cdot 23r)$ and its SIREN reconstruction trained at $f_{s} = 128\mathrm{Hz}$ . Top row shows $\omega_0 = 300$ , and bottom row $\omega_0 = 30$ . On the left the signals are sampled at $f_{s} = 128\mathrm{Hz}$ and on the right at $f_{s} = 256\mathrm{Hz}$ . + +![](images/6e41c1a7f253d6bd2db5a656118d783054f43f2068e0a0fb5e6915236d524fd9.jpg) + +from its samples is, in general, ill-posed – there are many continuous functions that can lead to the exact same samples. Since INRs do not have an explicit knowledge of the bandwidth of the target, only their implicit bias can determine which of all these functions they reconstruct. + +When the implicit bias does not match the nature of the signals, this can lead to reconstruction artifacts. Take for instance the problem of reconstructing a single-frequency signal $g(r) = \sin (2\pi \cdot 23r)$ using a SIREN $(\omega_0 = 300 \mathrm{rad / s})$ trained on 128 evenly spaced samples in the range [0, 1], i.e., sampled with a frequency of $f_{s} = 128 \mathrm{Hz}$ . As we can see in Fig. 3, the discrete-time Fourier transform of the reconstruction at the training points perfectly matches the target signal, i.e., the training loss is zero. Surprisingly, though, if one reconstructs the signal on a finer grid, e.g., $f_{s} = 256 \mathrm{Hz}$ , which contains coordinates not seen during training, one can see that the spectrum of the reconstruction has an additional peak at $105 \mathrm{Hz}$ that is not present in the target signal. That is, the implicit bias of the network has "chosen" to reconstruct the signal using an aliased higher frequency component, as it had no way to discard this feasible solution. Interestingly, if one initializes the SIREN using $\omega_0 = 30 \mathrm{rad / s}$ , instead, this aliased copy disappears. + +Thm. 1 gives the key to understand this behaviour. Specifically, note that most non-linearities used in INRs, e.g., ReLU or sin, can be effectively approximated by polynomials of small order, or with rapidly decaying coefficients. As a result, even if the frequency support of the INRs can include harmonics of very high frequencies, theoretically, those components tend to be weighted with much smaller coefficients in practice. Increasing the value of the fundamental frequencies does help to include higher frequency components without relying in very high order harmonics. However, it does so, at the cost of introducing high frequency components with large weights in Eq. (3), thus increasing the chances of yielding aliased reconstructions. + +Reconstructing signals at low sampling rates makes the aliased high frequency components in Eq. (3) indistinguishable from lower frequency components. As we have seen this phenomenon stems from the underspecification [11] of the reconstruction of the reconstruction problem in INRs, which can yield aliasing artifacts when testing at higher sampling rates. Solving this issues is crucial in application where a certain degree of generalization is required from the INRs. Applications such as super-resolution [8, 21] or scene reconstruction [47] cannot rely on pure overfitting, and require INRs to generalize outside of their training support. Overall, we hope that our new insights can support the design of a new generation of INR architectures and algorithms that can mitigate this underspecification. + +# 5. Inductive bias of INRs + +All our results, so far, have only dealt with expressive power, i.e., the type of functions that can be represented by INRs. However, even if a network can express a signal, it does not mean that it can learn to represent it efficiently. MLPs, for instance, are widely known to be universal function approximators [10], but still they have a hard time learning to high frequency functions [43]. To the best of our knowledge, the inductive bias of INRs is a largely unexplored topic. Besides the fact that INRs can circumvent the spectral bias [47,52], little is known of how different design choices influence the learnability of different signals. + +In what follows, we will try to narrow this knowledge gap, as we will leverage recent results from deep learning theory to shed new light on the inductive bias of INRs, and how their initialization has a crucial role on what they learn. + +# 5.1. Overview of NTK theory + +Studying the inductive bias of deep learning is hard. This is mostly due to the non-linear nature of the mapping between parameters and functions specified by neural networks. Recent studies, however, have started arguing that studying learnability approximately is much more tractable. Notably, the neural tangent kernel (NTK) framework [20] proposes to approximate any neural network by its first order Taylor decomposition around the initialization $\theta_0$ , i.e., + +$$ +f _ {\boldsymbol {\theta}} (\boldsymbol {r}) \approx f _ {\boldsymbol {\theta} _ {0}} (\boldsymbol {r}) + \left(\boldsymbol {\theta} - \boldsymbol {\theta} _ {0}\right) ^ {\top} \nabla_ {\boldsymbol {\theta}} f _ {\boldsymbol {\theta} _ {0}} (\boldsymbol {r}), \tag {8} +$$ + +since using this approximation, the network is reduced to a simple linear predictor defined by the kernel + +$$ +\boldsymbol {\Theta} \left(\boldsymbol {r} _ {1}, \boldsymbol {r} _ {2}\right) = \left\langle \nabla_ {\boldsymbol {\theta}} f _ {\boldsymbol {\theta} _ {0}} \left(\boldsymbol {r} _ {1}\right), \nabla_ {\boldsymbol {\theta}} f _ {\boldsymbol {\theta} _ {0}} \left(\boldsymbol {r} _ {2}\right) \right\rangle . \tag {9} +$$ + +Remarkably, while the understanding of deep learning is still in its infancy, the learning theory of kernels is much more developed [49]. Specifically, it can be shown that using the kernel in Eq. (9), the sample complexity, and optimization difficulty, of learning a target function $g$ grows proportionally to its kernel norm [6], i.e., + +![](images/040adc04a7bf953494ea5f11aca5050324d2dc9dfae0d36bda511422d4cd1f18.jpg) +Figure 4. Average energy concentration of 100 validation images from CelebA on subspaces spanned by the eigenfunctions of the empirical NTK associated to eigenvalues greater than a given threshold. Legend shows the average test PSNR after training to reconstruct those images from $50\%$ randomly selected pixels. + +$$ +\left\| g \right\| _ {\Theta} ^ {2} = \sum_ {i = 0} ^ {\infty} \frac {1}{\lambda_ {i}} \left| \left\langle \phi_ {i}, g \right\rangle \right| ^ {2}, \tag {10} +$$ + +where $\langle \phi_i,g\rangle = \mathbb{E}_r[\phi_i(\boldsymbol {r})g(\boldsymbol {r})]$ , and $\{\lambda_i,\phi_i\}_{i = 0}^{\infty}$ denote the eigenvalue, eigenfunction pairs of the kernel given by its Mercer's decomposition, i.e., $\Theta (r_1,r_2) =$ $\sum_{i = 0}^{\infty}\lambda_{i}\phi_{i}(r_{1})\phi_{i}(r_{2})$ . That is, those targets that are more concentrated in the span of the eigenfunctions associated with the largest eigenvalues of the kernel are easier to learn. + +Eq. (8) holds with equality only if the neural network $f_{\theta}$ is infinitely wide and has a specific structure [1, 20]. For the finite-size neural networks used in practice, it only provides a rough approximation. Fortunately, recent studies have shown that even if finite-size neural networks and their kernel approximations do not have exactly the same dynamics, their sample complexity when learning a target $g$ scales in both cases with its kernel norm [37], which makes Eq. (10) a good proxy for learnability in deep learning. + +# 5.2. NTK eigenfunctions as dictionary atoms + +The fact that the empirical NTK can approximately capture learnability in deep learning leads to a new interpretation of INRs: we can view INRs as signal dictionaries whose atoms are given by the eigenfunctions of the NTK at initialization. In this view, the study of the inductive bias of an INR is equivalent to the study of the representation capabilities of its NTK dictionary, in the sense that the functions that can be efficiently encoded by this dictionary are the ones that will be easier to learn. + +The simplicity of this analogy allows us to investigate phenomena that appear complex otherwise. For example, we can use this perspective to constructively characterize the effect of the parameter $\omega_0$ in the inductive bias of a SIREN, and compare different networks, or initializations. To that end, we measure the average energy concentration $^6$ of $N = 100$ validation images $\{g_n\}_{n=1}^N$ from the CelebA + +![](images/98b2a050c25afa133d4fdfdd0b3d40fbe0ecd8f325023666f678538873d2ce65.jpg) +Figure 5. First eigenfunctions of the empirical NTK of different INRs at initialization. The first six architectures are initialized as described in Sec. 2. The learned initialization row shows the eigenfunctions of a SIREN initialized after meta-learning on 1,000 training images from the CelebA dataset [25] following the procedure described in [51]. Details of this experiment can be found in the Appendix. + +dataset [25] on the span of the eigenfunctions of the NTK associated to eigenvalues greater than a given threshold, i.e., + +$$ +\mathcal {E} (\lambda) = \frac {1}{N} \sum_ {n = 1} ^ {N} \sum_ {\lambda_ {i} / \lambda_ {0} \geq \lambda} \frac {\left| \langle \phi_ {i} , g _ {n} \rangle \right| ^ {2}}{\left| \langle g _ {n} , g _ {n} \rangle \right| ^ {2}}. \tag {11} +$$ + +This metric is intimately connected to the kernel norm in Eq. (10), and it can give us a convenient perspective of the region of the NTK spectrum that will represent an image. The results of this procedure applied to different networks are shown in Fig. 4. Remarkably, for very low values of $\omega_0$ , most of the energy of these images is concentrated on the eigenfuctions corresponding to small eigenvalues. However, as we increase $\omega_0$ , the energy concentration gets more skewed towards the eigenfunctions associated with large eigenvalues. Interestingly, after some point ( $\omega_0 > 40$ ), the energy profile starts receding to the right, again. + +Comparing the energy profiles with the generalization performance of these networks, we observe a clear pattern: the more energy is concentrated on the eigenfunctions associated with larger eigenvalues, the better the test peak signal-to-noise ratio (PSNR)7. To understand this phenomenon, we can inspect the eigenfunctions of the NTK. As it is shown in Fig. 5, the eigenfunctions of the SIRENs with larger $\omega_0$ have higher frequency content. This means that increasing $\omega_0$ can have a positive effect in generalization as it yields a dictionary that better spans the medium-high frequency spectrum of natural images. Increasing $\omega_0$ too much, on the other hand, yields atoms with an overly high frequency content that cannot span the space of natural images efficiently, which explains their poor reconstruction performance of these networks. + +Overall, we see how interpreting learnability as encoding efficiency of the NTK dictionary is a powerful analogy that + +can explain diverse phenomena, and lets us study under a single framework all sorts of INR questions, including those which might not be readily understood from Thm. 1. This is a very powerful tool that we further exploit in Sec. 5.3 to provide novel insights on the role of meta-learning in INRs. + +# 5.3. Meta-learning as dictionary learning + +Prior work has shown that a correct initialization is key to ensure a good performance for INRs [47, 52]. In this sense, recent studies [46, 51] have shown that the use of learned initialization, such as the ones obtained from meta-learning algorithms [16], can significantly boost the performance of INRs. Indeed, initializing with meta-learned weights is one of the most effective remedies against the slow speed of convergence, and high sample complexity of INRs. However, while there has been recently great progress in understanding traditional forms of deep learning, the role of meta-learning on the inductive bias of deep neural networks remains largely overlooked. Interestingly, we now show how using the connections between INRs and signal dictionaries can help us understand meta-learning in general. + +To do so, we follow the same experimental protocol as in Sec. 5.2, where instead of computing the eigenfunctions of the NTK at a random initialization point, we linearize the INRs using Eq. (8) at the meta-learned weights, after pre-training on 1,000 training images from CelebA using model agnostic meta-learning (MAML) [16, 51]. + +As it is shown in Fig. 4, the meta-learned weights yield an eigenstructure that concentrates most of the energy of the target images on a subspace spanned by the eigenfunctions of the NTK with the largest eigenvalues, with almost no energy concentrated on the eigenfunctions corresponding to smaller eigenvalues. Therefore, training this INR starting from the meta-learned weights, results in a very fast speed of convergence and superior generalization capacity. + +As it happened with the role of $\omega_0$ in Sec. 5.2, visually inspecting the eigenfunctions of the NTK can help to build an intuition around this phenomenon. In this regard, recall that the CelebA dataset consists of a collection of face images. Strikingly, as illustrated in Fig. 5, the first eigenfunctions of the meta-learned NTK also look like faces. Clearly, meta-learning has reshaped the NTK so that the eigenfunctions have a large correlation with the target images. + +To the best of our knowledge, we are the first to report the NTK reshaping behavior of meta-learning, which cannot be obviously explained by first order approximation theories (cf. Eq. (8)). This result is remarkable for deep learning theory, as it helps us understand the high-order dynamics of the NTK during training, which remains one of the main open questions of the field. Prior work had observed that standard training procedures change the first few eigenfunctions of the NTK so that they look like the target task [4, 23, 37, 38], but our observations in Fig. 4 and Fig. 5 go one step further, and show that meta-learning has the potential to reshape a much larger space of the NTK dictionary by combining many tasks together, thus increasing the capacity of the NTK to efficiently encode a full metadata distribution of signals8. In this sense, we believe that that drawing parallels between classical dictionary learning algorithms [54] and meta-learning can be a strong abstraction which can simplify the complexity of this problem, thus leading to a promising avenue for future research. Delving deeper in this connection will not only improve our understanding of meta-learning as a whole, but it can also provide new insights for the design of more efficient INRs by leveraging data to construct richer dictionaries. + +# 6. Related work + +INRs are a very active research field in computer vision, as they have become integral parts of many applications such as volume reconstruction [30, 39], scene rendering [31, 34, 48], texture synthesis [19, 35], generative modelling [7, 9, 33], or compression [13]. Recent architectural advances have focused mostly on improving the inference and training cost [12, 24, 32, 41, 46, 51] of INRs, as well as on mitigating aliasing and improving generalization [5, 29]. + +The theory behind INRs has attracted much less attention, however. Similar to our work, Fathony et al. studied the expressive power of INRs, but their results only apply to their proposed multiplicative filter network architecture [15]. Zheng et al. [55], on the other hand, studied the trade-off between the rank and distance-preserving properties of different activation functions on INRs. Most notably, however, Tancik et al. [52] showed that precoding the input of an infinitely wide ReLU-network with random Fourier features [44] is equivalent to using a tunable + +shift-invariant kernel method. This gives a static intuition of how randomly initialized FFNs circumvent the spectral bias [43]. Our work goes one step further, and builds upon recent empirical results [37] to extend this NTK analysis to finite networks with arbitrary weights and activations, e.g., meta-learned SIRENs. This allows us to investigate dynamical aspects of INRs such as the role of pre-training. + +Interestingly, Kopitkov and Indelman [23] also used the visualization of the eigenfunctions of the NTK during training to understand other high-order training effects, such as the increase of alignment of the NTK with the target signal [4, 23, 37, 38]. Our experiments use a similar approach to show the complex dictionary learning behaviour of MAML [16] in the NTK, which to the best of our knowledge is the first time this has been reported in the literature. + +Connected to Thm. 1, other works have also used a similar harmonic expansion to analyze certain effects in deep learning, such as the increase in roughness of the loss landscape with respect to the weights for deeper layers [28], or how skip-connections can avoid shattered gradients [3]. + +Finally, we note that most of our work draws inspirations from the classical signal processing literature [36]. Some of our derivations are intimately connected to standard techniques in communications [42], and most of our analogies are founded on the field of signal representation [26] and dictionary design [54]. Moving forward, delving deeper on these connections will be a fruitful avenue for future work. + +# 7. Conclusion + +In this paper, we have analyzed the expressive power and inductive bias of modern INRs from a unified perspective. We have shown that the expressive power of a large class of INRs with sinusoidal encodings is given by the space of linear combinations of the integer harmonics of their input mapping. This allows INRs to encode signals with an exponentially large frequency support using a few coefficients, but also cause them to suffer from imperfect signal recovery or aliasing. We have also seen that the inductive bias of INRs is captured by the ability of the empirical NTK to encode signals efficiently, and we have revealed that meta-learning can modify the NTK and increase this efficiency. + +A natural future extension would be to generalize Thm. 1 to input mappings beyond sinusoids [5, 15] or include normalization layers [2]. Similarly, one could also study the effect of out-of-distribution data on the alignment with the NTK after meta-training. + +Finally, it is important to note that our insights should be readily extensible to higher dimensional settings, although most of our practical results were performed using one or two-dimensional signals. In this sense, designing methods to visualize the eigenfunctions of the NTK in higher dimensions would clearly help to inform practitioners about the inductive bias of different INRs. + +# References + +[1] Sanjeev Arora, Simon S. Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems (NeurIPS), 2019. 6 +[2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. stat, 1050:21, 2016. 8 +[3] David Balduzzi, Marcus Frean, Lennox Leary, JP Lewis, Kurt Wan-Duo Ma, and Brian McWilliams. The shattered gradients problem: If resnets are the answer, then what is the question? In International Conference on Machine Learning (ICML), 2017. 8 +[4] Aristide Baratin, Thomas George, César Laurent, R. Devon Hjelm, Guillaume Lajoie, Pascal Vincent, and Simon Lacoste-Julien. Implicit regularization via neural feature alignment. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2021. 8 +[5] Jonathan T. Barron, Ben Mildenhall, Matthew Tancik, Peter Hedman, Ricardo Martin-Brualla, and Pratul P. Srinivasan. Mip-nerf: A multiscale representation for anti-aliasing neural radiance fields. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021. 5, 8 +[6] Peter L. Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. In Computational Learning Theory (COLT), 2001. 6 +[7] Eric R Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 1, 8 +[8] Yinbo Chen, Sifei Liu, and Xiaolong Wang. Learning continuous image representation with local implicit image function. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 6 +[9] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 8 +[10] George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303-314, 1989. 6 +[11] Alexander D'Amour, Katherine A. Heller, Dan Moldovan, Ben Adlam, Babak Alipanahi, Alex Beutel, Christina Chen, Jonathan Deaton, Jacob Eisenstein, Matthew D. Hoffman, Farhad Hormozdiari, Neil Houlsby, Shaobo Hou, Ghassen Jerfel, Alan Karthikesalingam, Mario Lucic, Yi-An Ma, Cory Y. McLean, Diana Mincu, Akinori Mitani, Andrea Montanari, Zachary Nado, Vivek Natarajan, Christopher Nielson, Thomas F. Osborne, Rajiv Raman, Kim Ramasamy, Rory Sayres, Jessica Schrouff, Martin Seneviratne, Shannon Sequeira, Harini Suresh, Victor Veitch, Max Vlademyrov, Xuezhi Wang, Kellie Webster, Steve Yadlowsky, Taedong Yun, Xiaohua Zhai, and D. Sculley. Underspecification presents challenges for credibility in modern machine learning. arXiv preprint arXiv:2011.03395, 2020. 6 + +[12] Kangle Deng, Andrew Liu, Jun-Yan Zhu, and Deva Ramanan. Depth-supervised nerf: Fewer views and faster training for free. arXiv preprint arXiv:2107.02791, 2021. 8 +[13] Emilien Dupont, Adam Golinski, Milad Alizadeh, Yee Whye Teh, and Arnaud Doucet. COmpression with implicit neural representations. In Neural Compression: From Information Theory to Applications ICLRW, 2021. 1, 8 +[14] Emilien Dupont, Yee Whye Teh, and Arnaud Doucet. Generative models as distributions of functions. arXiv preprint arXiv:2102.04776, 2021. 1 +[15] Rizal Fathony, Anit Kumar Sahu, Devin Willmott, and J Zico Kolter. Multiplicative filter networks. In International Conference on Learning Representations (ICLR), 2021. 3, 8 +[16] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (ICML), 2017, 7, 8 +[17] Stephan J. Garbin, Marek Kowalski, Matthew Johnson, Jamie Shotton, and Julien Valentin. Fastnerf: High-fidelity neural rendering at 200fps. arXiv preprint arXiv:2103.10380, 2021. 2 +[18] Peter Hedman, Pratul P Srinivasan, Ben Mildenhall, Jonathan T Barron, and Paul Debevec. Baking neural radiance fields for real-time view synthesis. arXiv preprint arXiv:2103.14645, 2021. 2 +[19] Philipp Henzler, Niloy J Mitra, and Tobias Ritschel. Learning a neural 3d texture space from 2d exemplars. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 8 +[20] Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, 2018. 2, 6 +[21] Jaechang Kim, Yunjoo Lee, Seunghoon Hong, and Jungseul Ok. Learning continuous representation of audio for arbitrary scale super resolution. arXiv preprint arXiv:2111.00195, 2021. 6 +[22] Sylwester Klocek, Łukasz Maziarka, Maciej Wolczyk, Jacek Tabor, Jakub Nowak, and Marek Śmieja. Hypernetwork functional image representation. In International Conference on Artificial Neural Networks (ICANN), 2019. 1 +[23] Dmitry Kopitkov and Vadim Indelman. Neural spectrum alignment: Empirical study. In International Conference on Artificial Neural Networks (ICANN), 2020. 8 +[24] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 8 +[25] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015. 7 +[26] Stéphane Mallat. A wavelet tour of signal processing. Elsevier, 1999. 8 +[27] Ricardo Martin-Brualla, Noha Radwan, Mehdi S. M. Sajjadi, Jonathan T. Barron, Alexey Dosovitskiy, and Daniel Duckworth. Nerf in the wild: Neural radiance fields for unconstrained photo collections. In Proceedings of the IEEE/CVF + +Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 1 +[28] Christian H.X. Ali Mehmeti-Göpel, David Hartmann, and Michael Wand. Ringing relus: Harmonic distortion analysis of nonlinear feedforward networks. In International Conference on Learning Representations (ICLR), 2021. 3, 5, 8 +[29] Ishit Mehta, Michael Gharbi, Connelly Barnes, Eli Shechtman, Ravi Ramamoorthi, and Manmohan Chandraker. Modulated periodic activations for generalizable local functional representations. arXiv preprint arXiv:2104.03960, 2021. 8 +[30] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 8 +[31] Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In Proceedings of European Conference on Computer Vision (ECCV), 2020. 1, 3, 8 +[32] Thomas Neff, Pascal Stadlbauer, Mathias Parger, Andreas Kurz, Joerg H. Mueller, Chakravarty R. Alla Chaitanya, Anton S. Kaplanyan, and Markus Steinberger. DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks. Computer Graphics Forum, 2021. 8 +[33] Michael Niemeyer and Andreas Geiger. Giraffe: Representing scenes as compositional generative neural feature fields. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 8 +[34] Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable volumetric rendering: Learning implicit 3d representations without 3d supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. 8 +[35] Michael Oechsle, Lars Mescheder, Michael Niemeyer, Thilo Strauss, and Andreas Geiger. Texture fields: Learning texture representations in function space. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2019. 8 +[36] Alan V Oppenheim. Discrete-time signal processing. Pearson Education India, 1999. 5, 8 +[37] Guillermo Ortiz-Jiménez, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. What can linearized neural networks actually say about generalization? In Advances in Neural Information Processing Systems (NeurIPS), 2021. 2, 6, 8 +[38] Jonas Paccolat, Leonardo Petrini, Mario Geiger, Kevin Tyloo, and Matthieu Wyart. Geometric compression of invariant manifolds in neural networks. Journal of Statistical Mechanics: Theory and Experiment, 2021. 8 +[39] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 8 +[40] Keunhong Park, Utkarsh Sinha, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Steven M Seitz, and Ricardo + +Martin-Brualla. Nerfies: Deformable neural radiance fields. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021. 1 +[41] Keunhong Park, Utkarsh Sinha, Peter Hedman, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Ricardo MartinBrualla, and Steven M Seitz. Hypernerf: A higher-dimensional representation for topologically varying neural radiance fields. arXiv preprint arXiv:2106.13228, 2021. 8 +[42] John G. Proakis and Masoud Salehi. Fundamentals of Communication Systems. Pearson Education Limited, 2014. 4, 8 +[43] Nasim Rahaman, Aristide Baratin, Devansh Arpit, Felix Draxler, Min Lin, Fred Hamprecht, Yoshua Bengio, and Aaron Courville. On the spectral bias of neural networks. In International Conference on Machine Learning (ICML), 2019. 1, 2, 6, 8 +[44] Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems (NeurIPS), 2008. 2, 8 +[45] Christian Reiser, Songyou Peng, Yiyi Liao, and Andreas Geiger. Kilonerf: Speeding up neural radiance fields with thousands of tiny mlps, 2021. 2 +[46] Vincent Sitzmann, Eric R Chan, Richard Tucker, Noah Snavely, and Gordon Wetzstein. Metasdf: Meta-learning signed distance functions. arXiv preprint arXiv:2006.09662, 2020. 2, 7, 8 +[47] Vincent Sitzmann, Julien Martel, Alexander Bergman, David Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 1, 2, 3, 5, 6, 7 +[48] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. arXiv preprint arXiv:1906.01618, 2019. 1, 8 +[49] Alexander J Smola and Bernhard Schölkopf. On a kernel-based method for pattern recognition, regression, approximation, and operator inversion. Algorithmica, 22(1):211-231, 1998. 6 +[50] Pratul P Srinivasan, Boyang Deng, Xiuming Zhang, Matthew Tancik, Ben Mildenhall, and Jonathan T Barron. Nerv: Neural reflectance and visibility fields for relighting and view synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 1 +[51] Matthew Tancik, Ben Mildenhall, Terrance Wang, Divi Schmidt, Pratul P. Srinivasan, Jonathan T. Barron, and Ren Ng. Learned initializations for optimizing coordinate-based neural representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021. 2, 7, 8 +[52] Matthew Tancik, Pratul Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan Barron, and Ren Ng. Fourier features let networks learn high frequency functions in low dimensional domains. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 1, 2, 5, 6, 7, 8 + +[53] A. Tewari, O. Fried, J. Thies, V. Sitzmann, S. Lombardi, Z. Xu, T. Simon, M. Nießner, E. Tretschk, L. Liu, B. Mildenhall, P. Srinivasan, R. Pandey, S. Orts-Escalano, S. Fanello, M. Guo, G. Wetzstein, J.-Y. Zhu, C. Theobalt, M. Agrawala, D. B Goldman, and M. Zollhöfer. Advances in neural rendering. In ACM SIGGRAPH 2021 Courses, SIGGRAPH '21, 2021. 1 +[54] Ivana Tošić and Pascal Frossard. Dictionary learning. IEEE Signal Processing Magazine, 28(2):27-38, 2011. 3, 8 +[55] Jianqiao Zheng, Sameera Ramasinghe, and Simon Lucey. Rethinking positional encoding. arXiv preprint arXiv:2107.02561, 2021. 8 \ No newline at end of file diff --git a/astructureddictionaryperspectiveonimplicitneuralrepresentations/images.zip b/astructureddictionaryperspectiveonimplicitneuralrepresentations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3fb7b3fae7f42f3cfe3c38f20dfdee1fc5f49212 --- /dev/null +++ b/astructureddictionaryperspectiveonimplicitneuralrepresentations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1159a2a2bb7de83a93cc71f12958682d099a12b665e7a5b9f775faa3c617aa55 +size 341845 diff --git a/astructureddictionaryperspectiveonimplicitneuralrepresentations/layout.json b/astructureddictionaryperspectiveonimplicitneuralrepresentations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4405a3dc92856a52a6e5c8b42166a196dfaee9b3 --- /dev/null +++ b/astructureddictionaryperspectiveonimplicitneuralrepresentations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2336dbc38d921c668976d8c937f7998fda003f06ee544f216947961f82e8e9a0 +size 416545 diff --git a/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_content_list.json b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8cfe841753da51a064382aaa0bc83bd33761995d --- /dev/null +++ b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0b04e1e058a14e75eef9b3b0afa3642c88a957987d2a1922ec2536c32a7e66d +size 73500 diff --git a/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_model.json b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f5dfeb0ec6a570ba87068d22b120b3f27ef5f25b --- /dev/null +++ b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:682e9336fba329a16024cfbe33dcf7854059cd0c6335f08709ce2c05b690897c +size 91031 diff --git a/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_origin.pdf b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..241a2a9d5e4ade2ae5633205f1fe411a5c8204bf --- /dev/null +++ b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/1c3c5263-c94f-468e-bd1b-e5684a3f219e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52a47a0ae06eb2deecbfb4808b830cbd41bcaf0a697df9ca0305d802105f2403 +size 1839716 diff --git a/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/full.md b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0edb3e140226ae03a7e1320d0681401ffa54dd55 --- /dev/null +++ b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/full.md @@ -0,0 +1,277 @@ +# A study on the distribution of social biases in self-supervised learning visual models + +Kirill Sirotkin, Pablo Carballeira, Marcos Escudero-Vinolo +Video Processing and Understanding Lab, Univ. Autónoma de Madrid, 28049, Madrid, Spain +{kirill.sirotkin, pablo.carballeira, marcos.escudero}@uam.es + +# Abstract + +Deep neural networks are efficient at learning the data distribution if it is sufficiently sampled. However, they can be strongly biased by non-relevant factors implicitly incorporated in the training data. These include operational biases, such as ineffective or uneven data sampling, but also ethical concerns, as the social biases are implicitly present—even inadvertently, in the training data or explicitly defined in unfair training schedules. In tasks having impact on human processes, the learning of social biases may produce discriminatory, unethical and untrustworthy consequences. It is often assumed that social biases stem from supervised learning on labelled data, and thus, Self-Supervised Learning (SSL) wrongly appears as an efficient and bias-free solution, as it does not require labelled data. However, it was recently proven that a popular SSL method also incorporates biases. In this paper, we study the biases of a varied set of SSL visual models, trained using ImageNet data, using a method and dataset designed by psychological experts to measure social biases. We show that there is a correlation between the type of the SSL model and the number of biases that it incorporates. Furthermore, the results also suggest that this number does not strictly depend on the model's accuracy and changes throughout the network. Finally, we conclude that a careful SSL model selection process can reduce the number of social biases in the deployed model, whilst keeping high performance. The code is available at https://github.com/vpulab/SB-SSL. + +# 1. Introduction + +Supervised Deep Learning models currently constitute the state-of-the-art in the fields of computer vision and natural language processing. However, the recent developments [17, 24] in the field of Self-Supervised Learning (SSL) — a type of unsupervised learning, are slowly closing the performance gap gained via human guidance usually provided in the shape of target labels. SSL methods aim at solving a + +pre-formulated pretext task—defined by automatically generated labels, whose solution is expected to require high-level understanding of the data in order to learn descriptive feature embeddings with strong transferability potential. + +Human social biases are a well-studied and, in some cases, numerically quantifiable phenomenon [23] that causes unjustified prejudices against social groups based, among others, on aspects such as age, gender and race. Whereas one cannot assign prejudices or preferences to deep learning approaches as these are highly subjective characteristics attributed solely to humans, deep learning methods can wrongly correlate certain concepts if the labeled training data distribution is biased itself [45]. In practice, this leads to the replication of social biases. Several cases have been studied and reported, including: an incorrect gender prediction based on the contextual cues (i.e., location - kitchen, office), rather than on visual evidence associated with the described person [30], a fewer number of automatic high-paying job recommendations for female candidates than for male ones [20] and a promotion of biased suggestions in the dating/political decision-making context [7]. Anticipating these situations, institutional initiatives are being developed internationally to extinguish social biases from the training data, as declared in the Ethics Guidelines for a Trustworthy AI issued by the European Commission, and regulate the use of machine learning methods with potential human implications, as stated in numerous US bills [2, 3, 18] and the legislative documents of other countries [1, 4-6]. + +Previously, it was demonstrated that supervised learning models are prone to implicitly learn biases from the datasets containing them [9, 27, 30], as these human biases are encapsulated in the target labels. For instance, it has been shown that the earlier versions of ImageNet [21] exposed an imbalanced distribution regarding skin colors, ages and genders, leading to the under-representation of certain groups [43]. Furthermore, datasets collecting raw comments scraped from the web [10, 40] contain explicit biases against certain social groups [31]. + +SSL approaches, being unsupervised, are expected to be + +unaffected by biases-bearing labels. However, as they require large amounts of training data that often prevents its curation, it is not unlikely that the data itself contains some social human biases. In fact, results for a recent study [37], suggest that two of the state-of-the-art unsupervised learning models also contain association biases learned from the data, only in this case it cannot be explained by the choice of class labels, as the unsupervised models do not leverage this information in the training process. This result indicates that at least one top performing SSL model [15] might implicitly learn social biases while training to solve the targeted pretext task. Hence, data should be handled carefully, as the neural network's capacity to avoid inadvertent perpetuation of undesirable social biases is an important quality to consider, alongside classification accuracy, in the design of deep learning models. + +This paper addresses this phenomenon and attempts to answer the questions: what is the origin of the biases in the SSL setting? What affects the model's proneness to learn an implicit social bias? What is the relationship between the model's accuracy and the biases it learns? Whereas a preliminary work addresses the first question and hypothesizes on the origins of implicit social biases in a couple of unsupervised models [37], to our knowledge, this is the first attempt to study a wider and more varied set of SSL models. In particular, the contributions of this paper are: + +- We study the association biases acquired by 11 SSL models that share the same ResNet-50 [29] architecture, and vary in terms of pretext task and, thus, their accuracy after transfer learning. The results of this study suggest that the nature of the pretext task influences the number and nature of incorporated biases, and that contrastive models are more prone to acquire biased associations that are implicit in the data. +- We also perform an analysis of biases acquired in the embeddings at different layers of the models, showing that the number and strength of the biases vary at different model depths. The results of the per-layer analysis suggest that a careful consideration of bias in transfer learning applications can improve the trade-off between bias and accuracy, as the accuracy achieved using embeddings from highly-biased layers is not far from the accuracy achieved by a less-biased embeddings layer. + +# 2. Related work + +# 2.1. Measuring biases of computer vision models + +Many of the existing methods for measuring the biased associations are based on the Implicit Association Test (IAT) [23] that measures the differential relationships between a target concept and an attribute. The IAT measures + +the difference in reaction time of a respondent when correlating concepts and attributes for which biased associations are prone to exist and for which they are not. For instance, a biased test subject strongly associating a concept flower with an attribute pleasant takes less time to correlate verbal or visual stimuli representing them rather than correlating stimuli representing a concept insect with an attribute pleasant. + +Until recently, association bias tests were mostly used for Natural Language Processing (NLP) [11, 19, 35, 39, 45], but a recent work has extended the Word Embedding Association Test (WEAT) [11] to the image domain, thereby, making it possible to quantify association biases in computer vision models. This approach, named Image Embedding Association Test (iEAT), measures the differential association of the target concepts X and Y with the attributes A and B based on the image embeddings obtained by feeding images representing these concepts and attributes to a trained deep learning model. For instance, let the chosen target concepts be insect (X) and flower (Y) and the attributes be unpleasant (A) and pleasant (B). Then, the association test will measure the strength of correlation between insect and unpleasant, and flower and pleasant based on the cosine distances between the embeddings of X, Y, A and B. A more detailed explanation is given in Section 3. + +# 2.2. Image embeddings via self-supervised learning models + +In this paper, we refer to an image embedding as the features extracted at a given layer of a deep learning model when a particular image is fed to it. These embeddings are accepted as a representative description of the image—subjected to the training target. Usually, one can expect that, at a given layer and for a given architecture, the higher the performance of the learned model is, the more representative the embeddings will be. A common way to obtain image embeddings is by using a network trained in the supervised mode [29, 38]. Alternatively, SSL models can be used if images are to be represented in label scarce scenarios—as medical data requiring expert annotations or data acquired using devices capturing at non-visual modalities. SSL methods, instead of being trained for a label-driven task can be trained by using objectives such as a simple geometric task [22, 32], pseudo labels generated through automatic clustering [12, 44], or promoting proximity of “similar” data points in the feature space [14–17, 24, 28]. These objectives are commonly known as pretext tasks and can be used to arrange SSL models into the following three groups. + +Geometric models One of the most straightforward approaches to defining a pretext task is applying a geometric transformation to an input image and training a network to solve it. The three geometric pretext tasks considered in + +![](images/e06753c12a6c2718094cd1da3c6b5c330156cbc6b3916994add8808954ddf147.jpg) +Figure 1. Images representing the concepts of overweight people (at the top) and thin people (on the bottom). The images are used to identify a weight-valence bias in the iEAT and original IATs [23]. + +![](images/110b12b967121525e880c88f8972ce4b54fce83023479ec03febd05e1f473418.jpg) + +![](images/fcac0bded9fa19dfcf056e235eb1d1df9527f14ba926658650e20b8bb30b07b2.jpg) +Figure 2. Images representing the concepts of valence: pleasant (at the top) and unpleasant (on the bottom). The images correspond to the verbal stimuli commonly used to describe the valence concepts [23]. + +![](images/f9ee008b03eeebaefdaae3dec9a7604ee415c623362610e721dcad5887cd499f.jpg) + +![](images/6cfe61e877e45e4a0189a2d9fa6d00afc5ff6faa1a8dd67a7128e71452b02b64.jpg) + +![](images/9cb362714b8b6a8031eb4af6ea4c97b89d1308a666eff8a0088b6f9d362ac8ec.jpg) + +![](images/e3fa286e2e20d6900c17486063787562f0af88155d2fd1354290ed68946937fa.jpg) + +![](images/f02640d0967ff889049c28e527bddd50dcd33140369e6bca796ff869b711873d.jpg) + +![](images/f291336a8ca94acb9286e3d235f4806344b55976d534be31e06e338bc4d3ad58.jpg) + +![](images/b52bded773b77675359c3034601dd5157c1941f770ac87dbe0f4ec12a2751898.jpg) + +![](images/9fa158757a04ff010d0ce74d20fe235ffbfcc936f587d60e179d5490a881f5bd.jpg) + +this paper are rotation prediction [32], relative patch location prediction [22] and jigsaw puzzles [36]. The rotation prediction pretext task randomly applies one out of 4 rotations: $0^{\circ}$ , $90^{\circ}$ , $180^{\circ}$ , $270^{\circ}$ , to each training image sample and trains the network to predict which rotation was applied to a given image. On the other hand, a model trained to predict patch locations is based on randomly sampling two close regions from an input image and training the network to predict their relative spatial location. Finally, when a jigsaw puzzle strategy is followed, the image is divided into tiles, that are then randomly shuffled. Then, the network is trained to predict their original arrangement. + +Clustering-based representation learning A more sophisticated approach to deep unsupervised learning is based on the classical clustering methods that are used to group unlabeled data into clusters according to some homogeneity criteria. An obvious way to incorporate clustering into the pretext task formulation is to perform clustering after each model update step. The generated labels are then used as pseudo-labels to evaluate the model in a supervised manner. These labels would, in turn, change the embeddings at the next step as the newly generated labels may differ from the labels at the previous step. This is the strategy followed by Deep Clustering (DC) [12], that suffers from instability during the training process due to the random permutation of labels at each step. To tackle the issue of labels permutation and instability, Cluster Fit [42] relies on using a + +teacher network to define the pseudo-labels. Differently, in Online Deep Clustering (ODC) [44] the labels are updated using mini-batches and this process is integrated into the model update. This way, the embeddings and labels evolve together and the instability inherent in DC is eliminated. + +Contrastive models Top performing SSL models are driven by pretext tasks using contrastive losses [26]. Although exact implementations vary from model to model, the main idea remains the same: to learn representations that map the positives close together and push apart the negatives. The positive samples might be chosen based on modifications of patches in the same image or applying different augmentations obtained from the same image. + +Non-Parametric Instance Discrimination (NPID) [41] treats each input image (instance) as belonging to a unique class and trains the classifier to separate between each instance via the noise-contrastive estimation [25]. The motivation for it comes from the observation that supervised learning approaches return similar embeddings for related images. Specifically, it is often the case that the second top scoring predicted class at the end of the model is semantically close to the first one following a human interpretation. Therefore, the network is expected to learn the semantic similarity between classes without explicitly having it as the objective. + +Momentum Contrast (MoCo) [28] leverages a dynamic dictionary where a query and associated keys represent image encodings obtained with an encoder network. If a query and a key come from the same image, they are considered to be a positive pair, otherwise a negative one. The queries and the keys are encoded by separate networks and the key encoder is updated as a moving average of the query encoder, enabling a large and consistent dictionary for learning visual representations. + +Simple Framework for Contrastive Learning of Visual Representations (SimCLR) [14], building on the principles of contrast learning, introduces a series of design changes that allow it to outperform MoCo [28] not requiring a memory bank. Among these changes are a more careful choice of data augmentation strategies, addition of a non-linearity between the embeddings and the contrastive loss, and increased batch sizes and the number of training steps. Further improving on the results of SimCLR [14], the second version of Momentum Contrast model (MoCo v2) [16] acknowledges its efficient design choices and takes advantage of an MLP projection head and more data augmentations. + +Bootstrap Your Own Latent (BYOL) [24] reaches a new state-of-the-art on ImageNet linear classification while avoiding one of the greatest challenges that other contrastive models face: a need for negative pairs. BYOL circumvents this problem by generating the target representations with a randomly initialized model and then using them for its on- + +line training. By iteratively updating the target network, the online network is expected to learn better and better representations. + +Finally, SwAV [13] describes a hybrid clustering-contrastive method that avoids the computation of pairwise distances between positive and negative samples by clustering the data in consistency-enforced clusters of the different image augmentations. Thereby, defining positive samples according to cluster memberships and reducing the distance storage requirements of the other contrastive methods. + +# 3. Methodology + +Given the set of SSL models described in Section 2.2, we apply the iEAT framework [37] introduced in Section 2.1 to each model and investigate the presence of association biases. iEAT takes a set of input embeddings $\{x,y\}$ of images representing the target concepts $(X,Y)$ and a set of input embeddings $\{a,b\}$ representing the measured attributes $(A,B)$ . For instance, the target concepts overweight people and thin people are represented by the example images on Figure 1, while the attributes pleasant and unpleasant can be visualized by the images representing the valence concept (see examples in Figure 2). The null-hypothesis tested by iEAT states that $X =$ overweight people embeddings are as similar as $Y =$ thin people embeddings to $(A,B) =$ (pleasant, unpleasant) embeddings, or that the dissimilarities are alike. The rejection of the null-hypothesis would mean that one target concept is more correlated with one attribute than the other target concept, thus, detecting an association bias. iEAT tests the null-hypothesis by a permutation test and a metric quantifying the differential association $s(X,Y,A,B)$ , defined as follows: + +$$ +s (X, Y, A, B) = \sum_ {x \in X} s (x, A, B) - \sum_ {y \in Y} s (y, A, B), \quad (1) +$$ + +where: + +$$ +s (t, A, B) = \underset {a \in A} {\text {m e a n}} \cos (t, a) - \underset {b \in B} {\text {m e a n}} \cos (t, b) \text {f o r} t = \{x, y \}. \tag {2} +$$ + +The permutation test randomly shuffles the labels of the set of embeddings representing target concepts $(X,Y)$ , creating 10000 randomly permuted sets (or the maximum number of permutations allowed by the set size). Then, the differential association (Eq. 1) of each one of these permuted sets is measured. The $p$ -value collects the percentage of permuted sets resulting in a larger or equal differential association than the original set. The null-hypothesis can be rejected (and thus a bias detected) with high probability if the $p$ -value is below a certain threshold. The strength of the bias can be measured as the effect size ( $d$ -value) — measures the separation between the two distributions of the distances of the two sets of target concept samples to the attribute samples [11]: + +$$ +d = \frac {\underset {x \in X} {\operatorname {m e a n}} s (x , A , B) - \underset {y \in Y} {\operatorname {m e a n}} s (y , A , B)}{\underset {t \in X \cup Y} {\operatorname {s t d}} s (t , A , B)}. \tag {3} +$$ + +The full bias-detection pipeline for a given network model, therefore, consists of the extraction of deep feature embeddings of 4 image sets representing 2 target concepts and 2 attributes (i.e., Office-Home vs. Male-Female) with the same model, and running the permutation test described above on these embedding sets. + +We evaluate the SSL models on the data provided by the authors of the iEAT framework [37]. This data encompasses visual stimuli for sets of target concepts such as race, gender and age. The dataset contains 3 to 55 psychologists-selected images per concept taken from well-established IAT tests [23], CIFAR-100 dataset [33] or the web. Following the approach outlined above, we collect the $p$ - and $d$ -values representing the likelihood and strength of each of the 39 association biases proposed in the iEAT framework (see supplementary material for a complete list). + +All models used in this paper were trained on ImageNet2012 [21] and share the same backbone architecture: ResNet-50 [29]. The weights for the pretrained networks were taken from the OpenSelfSupervised Framework $^{2}$ and VISSL $^{3}$ with training hyper-parameters listed in Table 1. We evaluate embeddings obtained from the first max pooling layer (layer 1 hereinafter), as well as the embeddings obtained after each ResNet block (layers 2-5) and the final Global Average Pooling (GAP). To achieve a more comprehensive overview of the presence of biases in the SSL models, we do not limit our choice to the state-of-the-art architectures and select networks that conceptually represent different approaches for SSL: Rotation prediction (Rotation) [32], Relative patch location prediction (Relative Location, RL) [22], Jigsaw puzzles [36], SwAV [13], ClusterFit [42], ODC [44], NPID [41], MoCo_v1 [28], MoCo_v2 [16], SimCLR [14] and BYOL [24], as well as a randomly initialized ResNet-50 (random) and a fully supervised ResNet-50 (supervised) [29]. + +# 4. Experimental results + +This section summarizes the results of the bias detection on the deepest ResNet-50 embeddings, as well as on embeddings of its intermediate and shallow layers. + +As stated in Section 3, the $p$ -values are obtained with the permutation test. Due to the inherent randomness of this test, we repeat each experiment three times to confirm the consistency of the results and average the obtained $p$ - and $d$ -values (statistical error results are provided in the supplementary material). Moreover, we evaluate three instances + +1distributed under CC BY-NC-SA 4.0 license +2https://rb.gy/iz1xlg +3https://rb.gy/rveiso + +Table 1. Hyperparameters used to train the SSL models and the fully supervised ResNet-50. + +
JigsawRLClusterFitRotationNPIDODCMoCo v1SimCLRMoCo v2BYOLSwAVSup.
Batch size256512256512256512256409625640964096256
Epochs105701057020044020020020020020090
Base lr0.10.20.10.20.030.060.030.30.030.30.30.1
ImageNet accuracy (best layer)48.5749.3153.6354.9956.6157.7061.0266.6167.6971.6173.8574.12
+ +![](images/950dcf32f1ff525079fc14a66d8177a03d545cdb02176600e13b1b4a29345c76.jpg) +(a) $2^{\mathrm{nd}}$ ResNet block + +![](images/0f9c9b332a234d713bb340c1e091c2fe9fe7166acedc2fe12ddc8e2ef2706ad4.jpg) +(b) GAP ResNet layer +Figure 3. Number of biases for different values of $p_t$ . Biases detected for lower values of $p_t$ are statistically more significant. Contrastive models are plotted with thick solid lines, geometric models and clustering-based models with dashed lines. + +of the random ResNet-50 model, in order to account for the random weight initialization. Thus, the $p$ - and $d$ -values reported for the random model are averaged for three instances and three permutation tests. + +# 4.1. Bias-analysis for the GAP embeddings + +The first analysis of the presence of social biases on different SSL models is performed using the embeddings at the deepest layer of the CNN architecture, i.e., after the GAP layer of ResNet-50, (GAP embeddings hereafter). GAP embeddings generally convey a high performance in transfer learning scenarios (although not necessarily the highest). Thus, given the reduced dimensionality of the GAP embeddings with respect to those extracted at previous layers (which leads to faster training of a classifier on top of them) they are a common choice for transfer learning applications. + +A bias is considered to be present in the model if its statistical significance, measured with the $p$ -value yielded by the permutation test, is below a certain threshold $p_t$ . Given the absence of a universally correct $p_t$ value, a possible approach to categorize bias detection is to split them + +into groups of significance, as done in previous works [37]. Here, we take a similar approach, and explore the biases acquired by a model for $p_t$ values in the $[10^{-4}, 10^{-1}]$ interval—which sits in the range of high statistical significance. Figure 3b shows the number of biases found at the GAP embeddings of the thirteen considered models with respect to the $p$ -value threshold. From Figure 3b one can observe a clear separation in the number of detected biases between two groups of models: contrastive SSL models yield more biases than geometric/clustering-based models, with the exception of the RL model. For example, at $p_t = 10^{-2}$ no bias is detected for the rotation model and only 2 biases are detected for ODC, while the number of biases for contrastive models ranges from 8 to 12. This holds for any value of the threshold, showing the reliability of this conclusion. This is also shown on the large differences in the number of acquired biases among the three groups of models depicted in Figure 4. Especially for the intersectional biases (the most common ones) detected at the GAP embeddings. Results for all embeddings and biases are in the supplementary material. + +We quantitatively assess the difference in the number + +![](images/9f31269bd5bfd2512dd07b025bca4241bcf20d9ead6f4613319120a72d70ced3.jpg) +Figure 4. Numbers of intersectional biases detected in the embeddings of the Global Average Pooling layer with $p_t < 0.01$ . Note that a hybrid clustering-contrastive model SwAV [13] is labeled as a clustering method for better readability of the figure. + +of biases acquired by contrastive and non-contrastive models, by a statistical analysis of the biases present in two equal-sized sets of models: i) contrastive (NPID, SimCLR, MoCo_v1, MoCo_v2, BYOL) and ii) non-contrastive (Jigsaw, Rotation, ODC, RL, ClusterFit): + +1. Initially, $p_t$ is set to 0, and is gradually increased to 0.1 (i.e., $p_t$ is moved in the direction of the x-axis of Figure 3b). +2. For each $p_t$ value, we: + +2.1. Compute $\delta_{orig}$ : difference between the number of biases for the contrastive and non-contrastive sets. +2.2. Permute the labels between the contrastive and non-contrastive sets, and, for each permutation $k$ , compute $\delta_{k}$ : the difference between the number of biases for the two sets generated in the permutation. +2.3. For each permutation $k$ , check if $(\delta_{orig} < \delta_k)$ , and use this to estimate the probability of randomly permuted sets having more biases than the original sets. + +3. Finally, we average the probabilities computed for each step of $p_t$ . + +This test yields a $p$ -value of 0.049 that validates the premise by the rejection of the null-hypothesis: "contrastive models are not more biased than other models". + +Finally, if we compare the bias data in Figure 3b with the accuracy data in Table 1, there is no direct link between the model's classification accuracy and the number of biases it + +incorporates. Indeed, BYOL and MoCo acquired more biases than the more accurate supervised model. Moreover, the least accurate model (RL) is one of the models that incorporates the highest number of biases. + +# 4.2. Bias detections in the random model + +Performing the bias analysis on the embeddings of the baseline random ResNet-50 model, we discovered a high number of biases. While it is implausible that a randomly initialized model can consistently contain certain biases, the bias detections themselves are possible in conditions that relate to the specific test data. We hypothesize that the bias detections in the random models come from the correlations in the test data caused by strong similarities between some low-level features. To test this hypothesis we randomly permute the pixels in the images representing two target concepts (i.e., Weapon, Tool), while leaving the images representing the two attributes (i.e., Black, White) unchanged, and repeat the bias test. This allows to remove the high-level visual concepts and most of the low-level features (such as textures) from the images, preserving only the distribution of pixel values. We perform this test for 13 social biases that are detected in the random model and observe that after the permutation of pixels, 11 of them remain present (see supplementary material for complete results) and, in some cases, even have lower $p$ -values (Lincoln-Trump vs. Pleasant-Unpleasant). + +# 4.3. Per-layer analysis + +Anticipating that the strength and the number of biases varies for different layers of the network architecture due to increasing semantic interpretability in the internal CNN representations [8], the bias-detection procedure is carried out on the feature embeddings extracted from all ResNet blocks. Our findings are partially depicted in Figure 3, that presents the cumulative number of biases varying $p_t$ in the embeddings of the $2^{\text{nd}}$ ResNet block and Global Average Pooling layer. Figure 5 complements these results by summarizing the number and cumulative strength of biases in the embeddings extracted from all ResNet blocks. The strength of a bias refers to the $d$ -value (Section 3), and the cumulative strength is the sum of the $d$ -values of all detected biases. + +The results shown on Figure 3a indicate that the biases are also detected in the feature embeddings of shallow ResNet layers that semantically resemble low-level features. However, the biases detected in the shallow layers mostly repeat for all models. For example, in Figure 3a four out of five biases at $p < 10^{-2}$ are common for all models and are race-related. On the other hand, the feature embeddings extracted from deeper layers, as shown on Figure 3b, result in more biases given the same value of the threshold. This statement holds for all the models except for the ro + +tation prediction model. Model-wise, the number of biases with the same degree of statistical significance is more uniform in the shallow layer embeddings and begins to differ towards the end of the network, with contrastive SSL and supervised models having a larger amount of biases. + +Dissecting the bias detections at $p < 10^{-2}$ (Figure 5) for the embeddings of different ResNet blocks we gain insight into the distribution of the number and strength of the biases identified at different model depths. Overall, the cumulative strength of detected biases is smallest around the $3^{\mathrm{rd}}$ and $4^{\mathrm{th}}$ blocks, and it grows at the $5^{\mathrm{th}}$ block. One can observe that some models (e.g., rotation, jigsaw and supervised) deviate from this pattern. Finally, for each model, the embeddings of the $1^{\mathrm{st}}$ ResNet block yield some of the highest cumulative strength values. + +# 4.4. Biases in the downstream tasks + +Additionally, we perform a preliminary experiment that further exemplifies the practical consequences of a contrastive model being more biased than a clustering one. Specifically, we analyze two SSL models: SimCLR (contrastive) and ODC (clustering). According to both $p$ - and $d$ -values of the Gender-Career bias (see Table 7 in Supplementary Material) the classification of people's occupation (career) is more biased by gender in SimCLR than in ODC. To validate this result, we transfer the knowledge of the SSL models to a relationship classifier for image subjects, and assess the differences in the classification accuracy for male and female subjects. To this aim, we train two linear classifiers on top of SimCLR and ODC features, to predict people's relationship ("Friends", "Family", "Couple", "Professional"), using the training set of the People in Social Context dataset [34]. We evaluate the predictions of both models on the test set, where the people's gender has been manually annotated in 400 images (male-only: M, female-only: F, and male/s and female/s together: M+F). Table 2 shows the classification accuracy for each relationship category, for the whole test set (A) and for the M, F and M+F gender subsets. The results indicate that whereas SimCLR performs better overall (in line with the results in Table 1), it is less accurate than ODC in the classification of female professionals, while being better in the classification of male professionals. Hence, the Gender-Career bias detected in the SSL backbone is transferred to the downstream task and noticeably affects the results favoring "Professional" predictions towards male subjects. + +# 5. Discussion on the experimental results + +# 5.1. Relation between the number of biases and SSL learning strategy + +Figures 3b and 5 suggest that deep embeddings obtained with contrastive SSL models show more biases than the + +Table 2. Classification accuracy of the Professional-Family-Friends-Couple categories according to the genders of people present in the image. M stands for "Male-only", F stands for "Female-only", A stands for "Any gender"-males, females or both together, $\mathrm{M} + \mathrm{F}$ stands for males and females together. + +
ODC, accuracy (%)SimCLR, accuracy (%)
AMFM+FAMFM+F
Professional69.274.681.856.375.282.572.766.7
Family51.446.950.056.355.656.337.559.4
Couple44.059.128.633.354.068.242.942.9
Friends40.938.645.041.350.950.045.054.4
+ +ones computed with geometric and clustering-based models. We hypothesize that the reason for this difference might lie in the nature of the contrastive loss function. A contrastive loss promotes the similarity between features of two images representing a concept and an attribute (not necessarily related) if the images are similar. Instead, a geometry-based loss function will not amplify this circumstantial similarity as much as a contrastive one. + +Moreover, we state that a higher classification accuracy of the SSL model does not necessarily result in a higher number of social biases incorporated into it. Figure 5 provides a good example of this by showing that one of the least accurate, among studied, model (RL) yields the highest cumulative strength of biases detected in it. In addition to it, ODC demonstrates an inferior to NPID cumulative biasstrength, whilst being more accurate (based on the accuracy of linear classifiers trained on the features of the $5^{\mathrm{th}}$ ResNet block). + +The aforementioned conclusions might have an important application in the deployment of deep learning models for tasks that have an impact on human processes: in the context of transfer learning, one must not solely rely on final accuracy when choosing a model or the layer-depth to extract embeddings from. Based on the ImageNet performances, we argue that it might be beneficial, for some models, to give preference to embeddings resulting in a slightly lower accuracy but significantly reducing the strength of identified biases. For instance, for two linear classifiers trained on the embeddings from the $5^{\text{th}}$ block and the GAP layer of NPID, the difference in classification accuracy on ImageNet is only $0.01\%$ . Meanwhile, cumulative strength of biases of these two layers differs by $9\%$ . Furthermore, the classifier trained on the GAP embeddings of NPID is $3.18\%$ more accurate than the classifier trained on the GAP embeddings of ODC, but the number of intersectional biases acquired by them differs significantly (see Figure 4). + +# 5.2. Distribution of biases along the layers + +Although the presence of biases in initial layers of the model might be counterintuitive, we believe that it can be + +![](images/12b3fc6150a0a09ad3ecf12df9444f6074ef72fed5f15b3544c4b40fcb5d72f0.jpg) +(a) Cumulative strength of biases with $p$ -value $< 0.01$ +Figure 5. Cumulative strength (on the left) and number (on the right) of biases detected in different layers. The number of biases correlates with the cumulative strength (see additional plots in supplementary material). Models are ordered according to their classification accuracy on ImageNet. + +![](images/13be6818a2b99a2e8382c2a0c4af1c97ca54d0c87435aee7a62b909af532e4c0.jpg) +Block 1 Block 2 Block 3 Block 4 Block 5 Layer GAP +(b) Number of biases with $p$ -value $< 0.01$ + +explained through a correlation between the low-level characteristics of the test data and the nature of the filters learned in the shallow layers of CNNs, i.e., similar data issues affect the first layer and the random models as described in Section 4.2. For example, many of the biases that are consistently detected in the $1^{\text{st}}$ block embeddings of all models relate to the skin tone and valence or weight and valence. Considering that images representing the concept of pleasantness contain brighter pixels (like the images of white skin tone) and images representing the concept of unpleasantness contain darker pixels (like the images of dark skin tone), it could be expected that the correlation identified between corresponding embeddings might be caused by these data factors (as we explore in the supplementary material) and not by the meaning of the depicted concepts. + +Regarding the distribution of the biases, besides the aforementioned behaviour in the first layer, biases grow in strength and quantity as one advances along the contrastive models, strongly correlating the number and intensity of the acquired biases with the classification potential of the embeddings at each layer of a given model—generally the deeper the better as reported in OpenSelfSupervised Framework: the more specialized the embeddings are within a model, the more and stronger biases are acquired. The same trend is observable in the RL model, and in a more subtle way in the ODC model. Biases in the supervised model are more evenly distributed along the layers and strongly increase in the last layers, maybe because these are closer to the label-guided classification layer. The rotation model shows a different behaviour with lower and less intense biases evenly distributed along the model without representa + +tive biases in the GAP layer. + +# 6. Conclusion + +In this work, building on the existing approaches, we study the presence of common social biases in three types of SSL models: geometric, clustering-based and contrastive. We show that the number of detected biases does not depend on the SSL model's classification accuracy but on its type, with contrastive models yielding the highest number of biases. Moreover, we show that the presence of biases is not constant across different layers of a model, and that this layer-distribution of biases changes across models. Given these findings, we suggest that the number and strength of biases should be taken into account, alongside the resulting accuracy, when performing transfer learning on (supervised or SSL) pre-trained models. Specially for tasks that have an impact on human processes, this educated selection would result in models with a better trade-off in terms of accuracy and bias. Nevertheless, not all open questions have been answered yet: the sources of biases that stem from training data need to be isolated, and the influence of the dataset used during the models training needs to be investigated more closely. In fact, this study considered an ample number of models, although all of them trained only on ImageNet. This limitation opens avenues for further exploration of biases that arise in models trained using different datasets. + +Acknowledgements: This work was supported by the Consejería de Educación e Investigación of the Comunidad de Madrid under Project SI1/PJI/2019-00414. + +# References + +[1] Kenya's High Court Delays National Biometric ID Program. 1 +[2] SB 6280 - 2019-20. Concerning the use of facial recognition services. 1 +[3] SB S5140B. Relates to the use of biometric identifying technology. 1 +[4] Indian Supreme Court decision, K. S. Puttaswamy v. Union of India, Supreme Court of India, Writ Petition (Civil) No. 494, 2012. 1 +[5] Edward Bridges v. Chief Constable of South Wales Police and Secretary of State For The Home Department, EWHC 2341 (Admin), Case No. CO/4085/2018, September 4, para. 59, 2019. 1 +[6] Jamaican Supreme Court Decision, Julian Robinson v. Attorney General of Jamaica JMFC Full 04, 2019. 1 +[7] Ujue Agudo and Helena Matute. The influence of algorithms on political and dating decisions. Plos one, 16(4):e0249454, 2021. 1 +[8] David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. 6 +[9] Avrim Blum and Kevin Stangl. Recovering from Biased Data: Can Fairness Constraints Improve Accuracy? In 1st Symposium on Foundations of Responsible Computing, volume 156, pages 3:1-3:20, 2020. 1 +[10] Daniel Borkan, Lucas Dixon, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Nuanced metrics for measuring unintended bias with real data for text classification. In Companion proceedings of the 2019 world wide web conference, pages 491-500, 2019. 1 +[11] Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183-186, 2017. 2, 4 +[12] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision, pages 132-149, 2018. 2, 3 +[13] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In Advances in Neural Information Processing Systems, volume 33, pages 9912–9924, 2020. 4, 6 +[14] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR, 2020. 2, 3, 4 +[15] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E Hinton. Big self-supervised models are strong semi-supervised learners. In Advances in Neural Information Processing Systems, volume 33, pages 22243-22255, 2020. 2 + +[16] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. 2, 3, 4 +[17] Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised visual transformers. arXiv preprint arXiv:2104.02057, 2021. 1, 2 +[18] Kate Conger, Richard Fausset, and Serge F Kovaleski. San Francisco bans facial recognition technology. The New York Times, 14, 2019. 1 +[19] Christine Basta Marta R Costa-juss and Noe Casas. Evaluating the underlying gender bias in contextualized word embeddings. GeBNLP 2019, page 33, 2019. 2 +[20] Amit Datta, Michael Carl Tschantz, and Anupam Datta. Automated experiments on ad privacy settings: A tale of opacity, choice, and discrimination. arXiv preprint arXiv:1408.6491, 2014. 1 +[21] Jia Deng, Alex Berg, Sanjeev Satheesh, Hao Su, Aditya Khosla, and Fei-Fei Li. Large scale visual recognition challenge. www(image-net.org/challenges/LSVRC/2012, 1, 2012. 1, 4 +[22] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1422-1430, 2015. 2, 3, 4 +[23] Anthony G Greenwald, Debbie E McGhee, and Jordan LK Schwartz. Measuring individual differences in implicit cognition: the implicit association test. Journal of personality and social psychology, 74(6):1464, 1998. 1, 2, 3, 4 +[24] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Remi Munos, and Michal Valko. Bootstrap your own latent - a new approach to self-supervised learning. In Advances in Neural Information Processing Systems, volume 33, pages 21271-21284, 2020. 1, 2, 3, 4 +[25] Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 297–304, 2010. 3 +[26] Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, volume 2, pages 1735-1742. IEEE, 2006. 3 +[27] Moritz Hardt, Eric Price, and Nathan Srebro. Equality of opportunity in supervised learning. In Advances in neural information processing systems, volume 29, page 3323-3331, 2016. 1 +[28] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9729-9738, 2020. 2, 3, 4 +[29] 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, 4 + +[30] Lisa Anne Hendricks, Kaylee Burns, Kate Saenko, Trevor Darrell, and Anna Rohrbach. Women also snowboard: Overcoming bias in captioning models. In Proceedings of the European Conference on Computer Vision, pages 771-787, 2018. 1 +[31] Ben Hutchinson, Vinodkumar Prabhakaran, Emily Denton, Kellie Webster, Yu Zhong, and Stephen Craig Denuyl. Social Biases in NLP Models as Barriers for Persons with Disabilities. In Proceedings of ACL, 2020. 1 +[32] Nikos Komodakis and Spyros Gidaris. Unsupervised representation learning by predicting image rotations. In International Conference on Learning Representations, 2018. 2, 3, 4 +[33] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 4 +[34] Junnan Li, Yongkang Wong, Qi Zhao, and Mohan S Kankanhalli. Dual-glance model for deciphering social relationships. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2650-2659, 2017. 7 +[35] Chandler May, Alex Wang, Shikha Bordia, Samuel R. Bowman, and Rachel Rudinger. On measuring social biases in sentence encoders. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, volume 1, pages 622-628, 2019. 2 +[36] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Proceedings of the European Conference on Computer Vision, 2016, 3, 4 +[37] Ryan Steed and Aylin Caliskan. Image representations learned with unsupervised pre-training contain human-like biases. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, pages 701-713, 2021. 2, 4, 5 +[38] 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. 2 +[39] Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Yaron Singer, and Stuart Shieber. Investigating gender bias in language models using causal mediation analysis. In Advances in Neural Information Processing Systems, volume 33, pages 6-12, 2020. 2 +[40] Rob Voigt, David Jurgens, Vinodkumar Prabhakaran, Dan Jurafsky, and Yulia Tsvetkov. RtGender: A corpus for studying differential responses to gender. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation, 2018. 1 +[41] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3733-3742, 2018. 3, 4 +[42] Xueting Yan, Ishan Misra, Abhinav Gupta, Deepti Ghadiyaram, and Dhruv Mahajan. Clusterfit: Improving generalization of visual representations. In Proceedings of the + +IEEE Conference on Computer Vision and Pattern Recognition, pages 6509-6518, 2020. 3,4 +[43] Kaiyu Yang, Clint Qinami, Li Fei-Fei, Jia Deng, and Olga Russakovsky. Towards fairer datasets: Filtering and balancing the distribution of the people subtree in the imagenet hierarchy. In Proceedings of the ACM Conference on Fairness, Accountability, and Transparency, pages 547–558, 2020. 1 +[44] Xiaohang Zhan, Jiahao Xie, Ziwei Liu, Yew-Soon Ong, and Chen Change Loy. Online deep clustering for unsupervised representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6688-6697, 2020. 2, 3, 4 +[45] Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2979–2989, 2017. 1, 2 \ No newline at end of file diff --git a/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/images.zip b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ae06ad0402c00803075f0656827b7ee8155f6fff --- /dev/null +++ b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8c6e507b1a9021bd33c3832be5308b67a98d1bdf2885807ba2cc3200dbb00a0 +size 332529 diff --git a/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/layout.json b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..96dcf8297e6e09b8d93b259a85b59918e4b2a8c0 --- /dev/null +++ b/astudyonthedistributionofsocialbiasesinselfsupervisedlearningvisualmodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b830b7de83b837fe07e842a81976b5296f715d83a12608c736d2f018542ed283 +size 346372 diff --git a/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_content_list.json b/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..64e62dd8aac4200101d32872c9a1b9d31d069d3c --- /dev/null +++ b/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc37bc010897633cd0298c7ca8936d95cca6d53b8cbfe23869f58f8122cb8737 +size 67195 diff --git a/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_model.json b/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_model.json new file mode 100644 index 0000000000000000000000000000000000000000..37cb192b205d8ac3a6331b4e25be2aa8b25fe37a --- /dev/null +++ b/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b557b9ffd092b1ac18d310ba09c211b00d80f3f3c511c0f0586459bdcab54bf +size 82901 diff --git a/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_origin.pdf b/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..25dd8a7352746966c680ed3ab3d402d138a96c2a --- /dev/null +++ b/astyleawarediscriminatorforcontrollableimagetranslation/f6410232-dd83-4295-a02c-b0bf31719749_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbdacfcd20f93d0b3ebe5be19b42aa235252294c50fd87ee443e6a994812c3bd +size 2862136 diff --git a/astyleawarediscriminatorforcontrollableimagetranslation/full.md b/astyleawarediscriminatorforcontrollableimagetranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..76ffa75bff88fed3e5936317a96280084c66a540 --- /dev/null +++ b/astyleawarediscriminatorforcontrollableimagetranslation/full.md @@ -0,0 +1,290 @@ +# A Style-aware Discriminator for Controllable Image Translation + +Kunhee Kim Sanghun Park Eunyeong Jeon Taehun Kim Daijin Kim Pohang University of Science and Technology (POSTECH) + +{kunkim,sanghunpark,eyjeon,taehoon1018,dkim}@postech.ac.kr + +# Abstract + +Current image-to-image translations do not control the output domain beyond the classes used during training, nor do they interpolate between different domains well, leading to implausible results. This limitation largely arises because labels do not consider the semantic distance. To mitigate such problems, we propose a style-aware discriminator that acts as a critic as well as a style encoder to provide conditions. The style-aware discriminator learns a controllable style space using prototype-based self-supervised learning and simultaneously guides the generator. Experiments on multiple datasets verify that the proposed model outperforms current state-of-the-art image-to-image translation methods. In contrast with current methods, the proposed approach supports various applications, including style interpolation, content transplantation, and local image translation. The code is available at github.com/kunheek/style-aware-discriminator. + +# 1. Introduction + +Image-to-image (I2I) translation aims to manipulate the style of an existing image, where style refers to generic attributes that can be applied to any image in a dataset (e.g., texture or domain). Content generally refers to the remaining information, such as the pose and structure. This task has shown significant progress with generative adversarial network (GAN) [15] developments. Recent studies have expanded the functionality to multi-modal and multi-domains using domain-specific discriminators and latent injection [18], enabling the direct manipulation of existing images using domain labels or reference images [10, 11, 31, 32, 40]. + +However, despite promising functionality advances, there remains considerable room for development in terms of controllability. For example, users can only control the classes used for training. Although a reference image can be used to control output but this can often lead to erroneous results, particularly for misrecognition within the same class; and another common problem is inability to fine-tune the output. Since the label space does not con + +sider the semantic distance between classes, the learned style space cannot reflect these semantic distances, which leads to unrealistic images when controlling the results by manipulating the style code [32]. + +This study investigates I2I translation controllability, i.e., to be able to edit the result as desired using the style code, without being limited to the previously defined label space. The proposed model learns the style space using prototype-based self-supervised learning [6] with carefully chosen augmentations. Although the current domain-specific discriminators are not designed for an external continuous space, this is possible if the discriminator knows the style internally. Therefore, we propose a Style-aware Discriminator, combining a style encoder and a discriminator into a single module. Thus, the proposed model is somewhat lighter by reducing one module and achieves better performance because of the better representation space of the discriminator. We used the style code sampled from prototypes during training to improve the controllability; and feature-level and pixel-level reconstructions to improve the consistency. Thus, the proposed model goes beyond image translation to support various applications, including style interpolation and content transplantation. Finally, we propose feedforward local image translation by exploiting spatial properties of the GAN feature space. + +We evaluated the model on several challenging datasets: Animal Faces HQ (AFHQ) [11], CelebA-HQ [22], LSUN churches [41], Oxford-102 [34], and FlickrFaces-HQ (FFHQ) [24]. Extensive experiments confirm that the proposed method outperforms current state-of-the-art models in terms of both performance and efficiency without semantic annotations. The proposed model can also project an image into the latent space faster than baselines while achieving comparable reconstruction results. + +The contributions from this study are summarized as follows: (i) We propose an integrated module for style encoding and adversarial losses for I2I translation, as well as a data augmentation strategy for the style space. The proposed method reduces the parameter count significantly and does not require semantic annotations. (ii) We achieve state-of-the-art results in truly unsupervised I2I translation + +in terms of the Fréchet Inception Distance (FID) [17]. The proposed method shows similar or better performance compared with supervised methods. (iii) We extend image translation functionality to various applications, including style interpolation, content transplantation, and local image translation. + +# 2. Related work + +Multi-domain I2I translation StarGAN [10] enabled many-to-many translation using a given attribute label, but this and similar approaches have the disadvantage of being deterministic for a given input and domain. Subsequent studies suggested using reference images rather than labels [31,40], enabling translation based on an image from unseen classes in the same domain. StarGAN v2 [11] introduced a noise-to-latent mapping network to synthesize diverse results for the same domain, but since all of these methods depend on labels defined for classification, representations for image manipulation cannot be learned. Therefore, we developed a new multi-domain I2I approach from two perspectives. The proposed method learns a style-specific representation suitable for image manipulation without relying on labels; and then provides more user-controllability while supporting various applications. + +To overcome the problem of label dependency, Bahng et al. [4] clustered the feature space for pre-trained networks to create pseudo-labels and corresponding latent code. Similarly, TUNIT trained a guiding network using contrastive learning and clustering directly in target data [3]. These methods obtain pseudo-labels that can be substituted for class labels; however, the proposed approach models a continuous style space rather than discrete pseudo-labels. Thus the proposed model is significantly more efficient than previous approaches. CLUIT [27] recently proposed using contrastive learning through a discriminator, but used contrastive learning to replace the multi-task discriminator. Therefore, the style encoder exists independently, in contrast with the proposed model. Furthermore, CLUIT requires additional process (e.g., clustering), to obtain a style code without a reference image. + +Learning-based image editing. Recently, Karras et al. discovered that GANs naturally learn to disentangle predefined latent space [24, 25]. Several subsequent sutides proposed image editing methods using StyleGANs [1,2,43]. However, these methods suffered from the long time it takes to find a corresponding latent. Recently, StyleMapGAN [26] and Swapping Autoencoder (SwapAE) [37] proposed directly encoding an image into the latent, enabling real-time and various image editing applications. Our study is different in that content and style can be manipulated separately because of disentangled latent space. SwapAE has a separate latent space called texture and structure, similar to the proposed method, but is challenging to operate without + +a reference image. In addition, its texture-focused representation does not work well for tasks that require dramatic changes, such as the interspecies variation of animal faces (Fig. 3). On the other hand, since the proposed method learns the style space and the prototype, manipulating an image without a reference image is possible. Furthermore, because our method is designed for I2I translation, more challenging manipulations are possible. + +Discriminator and self-supervised learning GANs [15] have always suggested that discriminators could be feature extractors, and many previous studies have demonstrated that GANs benefit from representation learning through a discriminator [9, 20, 21, 29, 30]. We also utilize self-supervised learning via the discriminator, but differ from previous approaches in that the primary purpose of the self-supervised learning is to function as an encoder, not just to improve the quality. Hence, our discriminator continues to work as an encoder after training; as opposed to most current GANs, which abandon discriminators after training. + +# 3. Methods + +Our aim was to build a flexible and manipulative style space. In particular, we considered the following objectives. (i) Visual similarity should be considered. For example, visually similar pairs, such as a wolf and a dog, should be placed in similar places in the style space. (ii) There should be a representative value, such as a discrete label, providing a good starting point when the user wants to fine-tune the result. + +# 3.1. Framework + +The framework overview is shown in Fig. 1, which shows the sampling strategies for the style code and the training procedures of the entire model. + +Style-aware discriminator Given an image $\mathbf{x} \in \mathcal{X}$ , discriminator $D$ returns a vector as output. The discrimination head $h_D$ determines whether $\mathbf{x}$ is a real or fake image, and the style head outputs the latent code $\mathbf{z}_s = h_s(D(\mathbf{x}))$ . We formulate the traditional discriminator $f_D(\mathbf{x})$ and the style encoder $f_s(\mathbf{x})$ as $h_D(D(\mathbf{x}))$ and $h_s(D(\mathbf{x}))$ , respectively. + +Prototypes We represent the style space using a set of L2-normalized vectors $\mathbf{C} \in \mathbb{R}^{K \times D}$ rather than predefined labels or pseudo-labels, where $K$ and $D$ denote the number of prototypes and style code dimension, respectively. We denote $\mathbf{c}_k$ as an element of $\mathbf{C}$ . + +Generator The generator comprises an encoder and a decoder, similar to typical current I2I translation generators [11]. The encoder $G_{enc}(\mathbf{x})$ extracts style-agnostic content code $\mathbf{z}_c \in \mathbb{R}^{D \times W \times H}$ from input $\mathbf{x}$ , and decoder $G_{dec}(\mathbf{z}_c, \mathbf{z}_s)$ synthesizes a new image reflecting content code and style code. Similar to Karras et al. [23], we use a 2-layer multi-layer perceptron (MLP) to transform the normalized style code $\mathbf{z}_s$ into valid features. The generator uses + +![](images/6e1886b3b564d54d443c905feb2daa3cd6da7290702d80fcc574997a0b47fa39.jpg) +Figure 1. Framework overview. (a) The style code is sampled from the learned prototypes or dataset. (b) The discriminator not only learns to distinguish between real and fake images but also learns the style space via the swapped prediction loss. (c) The generator is enforced to utilize the style code via the style reconstruction and to preserve the input content via the content reconstruction. + +![](images/482220f6bab45bbe35732a70200080c613b56c0b54dcb97ff349e8b654a7f27f.jpg) + +weight modulation [25] or AdaIN [18] for latent injection. + +# 3.2. Modeling the style space + +Intuitively, an ideal style encoder would output the same code even though the input image was geometrically transformed. This idea is the fundamental concept underlying contrastive learning [6, 8, 16, 28, 35], which has been actively studied in recent years. We adopted self-supervised learning in our framework to learn the style space. + +Data augmentation The goal of existing contrastive learning is to classify object instances other than the style in images. Chen et al. [8] proposed a specific augmentation pipeline (e.g., random crop, color distortion) which has become the preferred approach. However, distorting the color does not serve our purpose since style is deeply related to color. Hence we use geometric transforms (e.g., scale, rotation) to learn content invariant representation, and cutout [14] to learn styles such as gender and facial expressions for human faces. We also use random crop and resize following the work of [8]. + +SwAV We used the SwAV framework [6], online clustering based self-supervised learning, because it aligns with our goals in terms of updating prototypes and achieving better performance for small batch sizes. The basic concept is that encoded representations from both views (i.e., augmented images) for the same image predict each other's assignments $\mathbf{q}$ . The objective for learning style space is expressed as: + +$$ +\mathcal {L} _ {s w a p} = l \left(\mathbf {q} ^ {(2)}, \mathbf {z} _ {s} ^ {(1)}\right) + l \left(\mathbf {q} ^ {(1)}, \mathbf {z} _ {s} ^ {(2)}\right), \tag {1} +$$ + +where $l(\mathbf{q}, \mathbf{z}_s) = -\sum_k^K \mathbf{q}_k (\exp(\frac{\mathbf{z}_s \cdot \mathbf{c}_k}{\tau}) / \sum_{k'}^K \exp(\frac{\mathbf{z}_s \cdot \mathbf{c}_{k'}}{\tau}))$ , $\tau$ is a temperature parameter, and $\mathbf{q}$ is a code computed using the Sinkhorn algorithm [6, 13]. Note that swapped prediction loss can be replaced by other self-supervised learning objectives, such as InfoNCE [35], by sacrificing the advantages of the prototype. + +# 3.3. Learning to synthesize + +During training, we sample a target style code $\tilde{\mathbf{z}}_s$ from the prototype or dataset $\mathcal{X}$ . When sampling from the prototype, we use perturbed prototypes or samples that are linearly interpolated between two prototypes (see Appendix A.3 for more details). Then, we apply a stop-gradient to prevent the style space from being affected by other objectives. + +As shown in Fig. 1 (c), the generator $G$ synthesizes a fake image $G(\mathbf{x},\tilde{\mathbf{z}}_s)$ . To enforce synthesized image be realistic, we adopted a non-saturating adversarial loss [15]: + +$$ +\mathcal {L} _ {a d v} = \mathbb {E} _ {\mathbf {x}} \left[ \log \left(f _ {D} (\mathbf {x})\right) \right] + \mathbb {E} _ {\mathbf {x}, \tilde {\mathbf {z}} _ {s}} \left[ \log \left(1 - f _ {D} \left(G (\mathbf {x}, \tilde {\mathbf {z}} _ {s})\right)\right) \right]. \tag {2} +$$ + +We also employed R1 regularization [33] following previous works [3, 11, 26, 27, 37]. + +We adopted a style reconstruction loss to ensure the generator $G$ utilize the style code: + +$$ +\mathcal {L} _ {\text {s t y l e}} = \mathbb {E} _ {\mathbf {x}, \tilde {\mathbf {z}} _ {s}} [ | | \tilde {\mathbf {z}} _ {s} - f _ {s} (G (\mathbf {x}, \tilde {\mathbf {z}} _ {s})) | | _ {2} ^ {2} ], \tag {3} +$$ + +Previous multi-domain and multi-modal I2I translation methods [3, 11, 19] introduced similar objectives, the difference between the current and previous approaches is that we do not update a style encoder using this objective. + +# 3.4. Disentanglement of style and content + +An ideal image manipulation network should be able to separate an image into two mutually exclusive representations and synthesize them back into the original image without information loss [19]. Thus, the framework must satisfy the following: + +$$ +\phi (\mathbf {x}, G \left(f _ {c} (\mathbf {x}), f _ {s} (\mathbf {x})\right)) = 0, \tag {4} +$$ + +where $\phi (\cdot)$ is a distance measure in pixel space; and $f_{c}(\mathbf{x})$ $f_{s}(\mathbf{x})$ are encoding functions for content and style, respectively. To achieve this, we employ a reconstruction loss: + +$$ +\mathcal {L} _ {\text {r e c o n}} = \mathbb {E} _ {\mathbf {x}} \left[ \phi (\mathbf {x}, G (\mathbf {x}, \operatorname {s g} (f _ {s} (\mathbf {x})))) \right], \tag {5} +$$ + +where $\mathfrak{sg}$ denotes a stop-gradient operation. This objective encourages $G_{\mathrm{enc}}$ to encode mutually exclusive features with the style code since $f_{s}(\mathbf{x})$ is not updated. Although any distance measure in pixel space can be used, we used learned perceptual image patch similarity (LPIPS) [42] since we empirically found this works better than Euclidean or Manhattan distance. + +In order to learn content space through the reconstruction loss above, it is necessary to condition that the generator should not ignore input latents code. For example, the generator may ignore the content code and perform reconstruction with only style code. To prevent this, we enforce the generator to preserve input content code using a content reconstruction loss: + +$$ +\mathcal {L} _ {\text {c o n t e n t}} = \mathbb {E} _ {\mathbf {x}, \tilde {\mathbf {z}} _ {s}} \left[ \frac {1}{W H} \sum_ {i, j} ^ {W, H} \left\| \mathbf {z} _ {c, i, j} - \tilde {\mathbf {z}} _ {c, i, j} \right\| _ {2} ^ {2} \right], \tag {6} +$$ + +where $\mathbf{z}_c$ , $\tilde{\mathbf{z}}_c$ are $G_{enc}(\mathbf{x})$ , $G_{enc}(G(\mathbf{z}_c, \tilde{\mathbf{z}}_s))$ , respectively. This objective enforces patch-level similarity between inputs and outputs, similar to PatchNCE [36]. However, our proposed objective is simpler since we only compare the last layer features, and our objective does not contrast features between patches. + +In practice, we found that there was no need to apply this loss every step, and hence we apply the objective every 16th step. We assume that this is because similar results can be obtained through a reconstruction loss. + +Overall objectives Our final objective function for the discriminator is $\mathcal{L}_{StyleD} = \mathcal{L}_{adv} + \lambda_{swap}\mathcal{L}_{swap}$ , and for the generator is $\mathcal{L}_G = \mathcal{L}_{adv} + \lambda_{sty}\mathcal{L}_{style} + \lambda_{rec}\mathcal{L}_{recon}$ , where $\lambda_{sty},\lambda_{rec}$ are hyperparameters for each term, and we use for all $\lambda = 1.0$ except $\lambda_{rec} = 0.3$ for AdaIN-based models. We set $K$ as 32 and 64 for AFHQ and CelebA-HQ, respectively. Please refer to Appendix A for more details. + +# 3.5. Local image translation + +One advantage of factored representations is having a higher degree of freedom when editing an image. The content of an image can easily be copied or moved by editing + +in the content space [37]. To progress further, we propose a simple method of patch-level image translation. Kim et al. [26] proposed mixing spatial information in the latent space to enable local editing. Similarly, we mix spatial information in the feature space. + +$$ +\mathbf {f} _ {o} = \mathbf {m} \otimes \operatorname {m o d} \left(\mathbf {f} _ {i}, \mathbf {z} _ {s} ^ {(i)}\right) + (1 - \mathbf {m}) \otimes \operatorname {m o d} \left(\mathbf {f} _ {i}, \mathbf {z} _ {s} ^ {(j)}\right), \tag {7} +$$ + +where $\mathbf{f}$ and $\mathbf{m}$ are feature map and mask, and mod is modulated convolution [25] or AdaIN. For patch-level image translation, we simply replace the entire modulated convolution layer [25] with above. To ensure content is maintained even when several styles are mixed, we mixed two styles with a random mask when calculating a content preserving loss. + +# 4. Experiments + +# 4.1. Experimental setup + +We not only employed a StyleGAN2-based generator but also considered models using AdaIN to enable a fair comparison with I2I translation models that use AdaIN. + +Datasets We trained the proposed and various comparator models on AFHQ, AFHQ v2 [11], CelebA-HQ [22], FFHQ [24], Oxford-102 [34], and LSUN churches [41]. Since high resolution models require considerable training time, the proposed and comparison models were trained and evaluated at $256 \times 256$ resolution. For AFHQ and CelebAHQ, we used the splits provided by Choi et al. [11]. + +Baselines Our primary goal is to synthesize an image with a reference image or a latent sampled from a learned space (i.e., I2I translation). We compared the proposed approach with recent supervised [11, 32] and unsupervised [3, 27] methods. In contrast with most I2I translation methods, the proposed approach has further applications such as image editing. To compare real-time image editing capability, we compared our approach with Swapping Autoencoder (SwapAE) [37] and StyleMapGAN [26]. + +We used pre-trained networks provided by the authors whenever possible. Otherwise, we trained the models from scratch using the official implementation, except for CLUIT, where we employed our implementation because the authors have not yet published their code. We showed 1.6 and $5\mathrm{M}$ images to the AdaIN- and StyleGAN2-based models, respectively. For StyleMapGAN, we used pretrained networks trained for $5\mathrm{M}$ images. + +# 4.2. Main results + +We quantitatively and qualitatively evaluated the proposed approach and the baselines on two datasets: AFHQ and CelebA-HQ. + +Latent-guided image synthesis We report Fréchet Inception Distance (FID) [17] and Kernel Inception Distance (KID) [5] to evaluate the latent-guided image synthesis + +![](images/efe0eb1dd58867e7b9f81c1820bf338f8644ea4ba9468547b2101d61fb996966.jpg) +LSUN churches + +![](images/e13939c21568b7846a6cdbe913ed6dbda2ed35fcfe0ac073c281860b05910657.jpg) +FFHQ +Figure 2. Prototype-guided synthesis. Our model discovers various style prototypes from the dataset in an unsupervised manner. The style prototype consists of a combination of various attributes including (left) time, weather, season, and texture; and (right) age, gender, and accessories. Each row shows the result of manipulating the leftmost image with learned prototypes. + +quality, calculating FID and KID between 50,000 synthesized images and training samples. Parmer et al. [38] recently demonstrated that values of these metrics depend on the resizing method; therefore, we calculated FID and KID for all methods using Pillow-bicubic [12]. + +To synthesize images, we used a style code sampled using the strategy used in the training. To evaluate supervised methods [11, 32], we created a style code using randomly sampled domain and noise. We performed style mixing with randomly sampled latent with StyleMapGAN [26]. In Table 1, the proposed model showed better results than the existing unsupervised methods and comparable results to the supervised methods. Although the result of the proposed approach is slightly worse than StarGAN v2 in AFHQ, our approach allows users to choose one of several prototypes, whereas StarGAN v2 only allows users to choose from three classes. In Fig. 2, we show the prototype-guided synthesis results of our methods trained on unlabeled datasets. Note that we directly used prototypes obtained during the training without additional processing. + +Reference-guided image synthesis Although FID/KID protocol can estimate the manipulated image quality, it provides good performance scores even if the generator ignores the given latent (e.g., reconstruction). Therefore, we evaluated reference-guided image synthesis to evaluate whether the generator reflects the latent corresponding to each domain. Following [11], we synthesize images using a source-reference pair from each task (e.g., cat→dog, male→female) and calculate FID and KID with a training set of a target domain. We report average values of all tasks (mFID and mKID). + +As shown in the first two rows of Fig. 3, supervised approaches [11, 32] often misrecognized the style of reference images within the same classes. However, the proposed method successfully captures the styles of reference images. Furthermore, while other methods failed to preserve the details of the source image, the proposed method was the only method that preserved details such as pose and background. User study To investigate the human preferences, we conducted a survey using the Amazon MTurk platform. We randomly generated 100 source-reference pairs per dataset and asked the respondents to answer three questions: (Q1) Which one best reflects the style of the reference while preserving the content of the source? (Q2) Which one is the most realistic? (Q3) Which one would you use for manipulating an image? Each set was answered by 10 respondents. As shown in Table 2, the respondents obviously preferred our method in the AFHQ. In the CelebA-HQ, our model was not preferred over the supervised models (which use attribute labels and a pre-trained face alignment network); nevertheless, our model was still the most preferred among the unsupervised methods. + +See Appendix B for additional results including experiments on AFHQ v2 and Oxford-102. + +# 4.3. Controllable image translation + +Real image projection To edit an image in the latent space, we first need to project the image into the latent space. What matters here is how quickly and accurately the image can be reconstructed. We measured the runtime and LPIPS [42] between the input and reconstructed images. As shown in Table 3, our model can embed an image into the + +![](images/5a073d59c9c5d7488febd7cbce7c26224e3e564da40f8188649b64171c0836e9.jpg) +Figure 3. Qualitative comparison of reference-guided image synthesis on AFHQ (top three rows) and CelebA-HQ (bottom three rows). + +
MethodParam. (M)Latent-guided synthesisReference-guided synthesis
AFHQCelebA-HQAFHQCelebA-HQ
FID↓KID↓FID↓KID↓mFID↓mKID↓mFID↓mKID↓
Ours56.5110.02.16.82.810.62.112.64.9
Ours-AdaIN57.7512.52.510.94.914.75.417.68.6
*StarGAN v2 [11]87.679.82.313.98.020.09.828.317.3
*Liu et al. [32]87.6726.07.017.811.051.728.626.716.8
TUNIT [3]107.70116.199.7128.0122.0223.0187.7173.7193.7
CLUIT [27]80.54N/A22.610.528.918.1
SwapAE [37]109.03N/A61.228.825.417.8
*StyleMapGAN [26]126.2332.818.724.315.264.351.328.825.1
+ +Table 1. Quantitative comparison on image synthesis. We report FID and KID $\times {10}^{3}$ . An asterisk (*) denotes that we used the pre-trained networks provided by authors. Bold indicates the best result and bold+italicize indicates the best result among the unsupervised methods. + +latent space faster and more accurately than other real-time image editing methods. + +Style interpolation With the proposed method, it is possible to control only the style of the image as desired. In Fig. 4 (a), we first projected images into content and style space, then interpolated style code with randomly selected prototypes. The results show that the proposed approach is suitable for controlling the results of synthesized images. + +Content transplantation Although we did not specifically target content transplantation, the proposed method + +supports this application. We achieved this by copying the content code from another content code. After manipulating the content code, we synthesized the image using a style code of the source image. As shown in Fig. 4 (b), our model shows qualitatively similar results to the StyleMapGAN, which specifically targeting the local editing. Since our model separated the content and style, it is also possible to transplant only the content (i.e., a big smile) without changing the style (i.e., a beard) (bottom). + +Local image translation Fig. 4 (c) shows the results of + +![](images/02966980c3a963a988442419f988bc0a205d9b8f42c5e33b309b4eefcc16f18b.jpg) +(a) Reconstruction and style interpolation results on FFHQ, and AFHQ. The first two source images are from CelebA-HQ. + +![](images/92fbe91bd0eac2e48f17babf0bbe3a964e928bbe4b3204b6e195ed657e323c61.jpg) +(b) Content transplantation comparison on CelebA-HQ + +![](images/849dcb29bc57c04041d5daf67e30eb12ffaa396122e436db5237e7f67e1f034c.jpg) +(c) Local image translation results on CelebA-HQ and AFHQ. +Figure 4. Examples of various applications. The proposed method is capable of manipulating the style and content of an image in real-time. + +
MethodAFHQ (%)CelebA-HQ (%)
Q1Q2Q3Q1Q2Q3
Ours24.522.425.025.019.323.2
CLUIT18.719.718.114.215.015.5
TUNIT21.918.017.911.810.79.2
*Liu et al.19.319.220.126.728.226.3
*StarGAN v215.620.618.822.426.825.7
+ +Table 2. User study. Q1: content and style. Q2: realism. Q3: preference. A star $(\star)$ denotes models trained with extra information. + +
MethodRuntime (sec)AFHQCelebA-HQ
MSELPIPSMSELPIPS
Ours0.0290.0120.2690.0070.202
SwapAE0.0370.0090.3030.0050.241
StyleMapGAN0.0920.0390.3160.0260.255
+ +Table 3. Quantitave comparison for real image projection. We used a single NVIDIA Xp GPU to measure the runtime. + +
MethodParam. (M)k-NN↑mFID↓
Ours-AdaIN57.7599.114.7
separated76.7780.6159.7
+ +Table 4. Quantitative comparison using the AFHQ dataset. + +local image translation. The first two rows are the result of using vertically split masks. The red box in the bottom row indicates the mask for reference 1. The proposed method can synthesize the content using multiple styles. + +# 4.4. Analysis + +Effect of the style-aware discriminator We trained the model with a separated discriminator and style encoder to analyze the effect of integrating the discriminator and style encoder. The difference is that we used the hard-assigned prototypes as pseudo-label for the multi-task discriminator. To evaluate the alignment between learned style representation and domain labels, we measured the k-NN accuracy used for self-supervised learning [7, 16]. In Table 4, separated achieved significantly lower k-NN accuracy, + +![](images/f2474a04f2a1468627d9eca12d76181bdb3e8a501371fa9266922a3ab7837477.jpg) +Figure 5. Similarity search results on the AFHQ and CelebA-HQ datasets. We projected the query and test set into the style space and performed a nearest neighbor search. We plot here the five most similar images in style space. + +![](images/ff8e84ad11dd3e8cf49763b0eedbd02206e284b090e23383c835b24fd5512b5f.jpg) +Figure 6. Comparison of the results for various augmentations. + +and failed to reflect the style of the target images (high mFID). See Appendix C.1 for a further discussion. + +Effect of data augmentation We employed random resized crop, rotation, and scale for augmentation, along with random erasing for facial datasets (e.g., CelebA-HQ, FFHQ). Among them, we analyzed the effect of color distortion and cutout, which are major differences compared with other methods [3, 27]. As shown in Fig. 5, different augmentation choice leads to different style space. This result further leads to incorrect or unwanted synthesis results (Fig. 6). For example, when the color distortion is used, the style space ignores the color. On the other hand, if the cutout is not applied in the human face domain, learned style space failed to capture the attribute information such as gender. + +Speed and memory Table 5 shows the trainable parameter counts and the training time of each method. The proposed approach is more efficient and faster than conventional I2I translation methods because it requires one less module for training and has fewer modules than SwapAE, which uses two discriminators. Nevertheless, the proposed method achieved comparable or better performance, which shows the efficiency of our method. + +# 5. Discussion and limitation + +In this study, we proposed a style-aware discriminator, which learns a style space in a self-supervised manner and guides the generator. Here, we discuss reasons why the proposed approach can be successfully trained. First, rep + +
MethodParameters (M)sec/iter
GDE
Ours36.819.70.383
Ours-AdaIN38.119.70.351
StarGAN v2 [11]43.520.920.90.678
TUNIT [3]27.471.09.30.667
CLUIT [27]34.425.220.91.016
SwapAE [36]25.153.430.60.692
StyleMapGAN [26]79.728.917.61.475
+ +Table 5. Efficiency of proposed method. We measured the training speed (s/iter) with minibatch size 2 on a single TITAN Xp GPU. + +resentation learning using human-defined labels cannot be a representation for style space. In contrast, the proposed method learns latent space specifically designed for style. Second, in the existing I2I translation, both the generator and the style encoder are updated together by the signal from the discriminator. In this case, the separation between content and style is ambiguous. Conversely, the proposed model can have a separate content space with the style encoder being updated completely separately from the generator, which results in better disentanglement. Finally, a style-aware discriminator can provide a better signal to the generator since it has a better understanding of the style space. + +Yet still, the proposed method cannot preserve the face identity of the source image, unlike [11, 32]. One can therefore consider using a pre-trained network for identity or landmark following previous works [11, 39]. However, preserving the identity may increase risks of misuse or abuse. Therefore, we did not force the proposed method to preserve the facial identity of a source image. Though, preserving the facial identity without using additional information (e.g., face landmark or id) will be a valuable future work. + +Acknowledgements This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.B0101-15-0266, Development of High Performance Visual BigData Discovery Platform for Large-Scale Realtime Data Analysis) and (No.2017-0-00897, Development of Object Detection and Recognition for Intelligent Vehicles) + +# References + +[1] Rameen Abdul, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? In ICCV, 2019. 2 +[2] Rameen Abdul, Yipeng Qin, and Peter Wonka. Image2stylegan++: How to edit the embedded images? In CVPR, 2020. 2 +[3] Kyungjune Baek, Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Hyunjung Shim. Rethinking the truly unsupervised image-to-image translation. In ICCV, 2021. 2, 3, 4, 6, 8 +[4] Hyojin Bahng, Sunghyo Chung, Seungjoo Yoo, and Jaegul Choo. Exploring unlabeled faces for novel attribute discovery. In CVPR, 2020. 2 +[5] Mikołaj Binkowski, Danica J Sutherland, Michael Arbel, and Arthur Gretton. Demystifying mmd gans. In ICLR, 2018. 4 +[6] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. 1, 3 +[7] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In ICCV, 2021. 7 +[8] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. 3 +[9] Ting Chen, Xiaohua Zhai, Marvin Ritter, Mario Lucic, and Neil Houlsby. Self-supervised gans via auxiliary rotation loss. In CVPR, 2019. 2 +[10] 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 CVPR, 2018. 1, 2 +[11] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In CVPR, 2020. 1, 2, 3, 4, 5, 6, 8 +[12] Alex Clark. Pillow (pil fork) documentation, 2015. 5 +[13] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NeurIPS, 2013. 3 +[14] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. 3 +[15] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. In NeurIPS, 2014. 1, 2, 3 +[16] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 3, 7 +[17] 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. 2, 4 +[18] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017. 1, 3 + +[19] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In ECCV, 2018. 3, 4 +[20] Eunyeong Jeon, Kunhee Kim, and Daijin Kim. Fa-gan: Feature-aware gan for text to image synthesis. In ICIP, 2021. 2 +[21] Jongheon Jeong and Jinwoo Shin. Training gans with stronger augmentations via contrastive discriminator. In ICLR, 2020. 2 +[22] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In ICLR, 2018. 1, 4 +[23] Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In NeurIPS, 2020. 2 +[24] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. 1, 2, 4 +[25] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In CVPR, 2020. 2, 3, 4 +[26] Hyunsu Kim, Yunjey Choi, Junho Kim, Sungwoo Yoo, and Youngjung Uh. Exploiting spatial dimensions of latent in gan for real-time image editing. In CVPR, 2021. 2, 3, 4, 5, 6, 8 +[27] Hanbit Lee, Jinseok Seol, and Sang goo Lee. Contrastive learning for unsupervised image-to-image translation. arXiv preprint arXiv:2105.03117, 2021. 2, 3, 4, 6, 8 +[28] Junnan Li, Pan Zhou, Caiming Xiong, and Steven Hoi. Prototypical contrastive learning of unsupervised representations. In ICLR, 2020. 3 +[29] Ru Li, Shuaicheng Liu, Guangfu Wang, Guanghui Liu, and Bing Zeng. Jigsawan: Self-supervised learning for solving jigsaw puzzles with generative adversarial networks. arXiv preprint arXiv:2101.07555, 2021. 2 +[30] Bingchen Liu, Yizhe Zhu, Kunpeng Song, and Ahmed Elgammal. Towards faster and stabilized gan training for high-fidelity few-shot image synthesis. In ICLR, 2020. 2 +[31] Ming-Yu Liu, Xun Huang, Arun Mallya, Tero Karras, Timo Aila, Jaakko Lehtinen, and Jan Kautz. Few-shot unsupervised image-to-image translation. In ICCV, 2019. 1, 2 +[32] Yahui Liu, Enver Sangineto, Yajing Chen, Linchao Bao, Haoxian Zhang, Nicu Sebe, Bruno Lepri, Wei Wang, and Marco De Nadai. Smoothing the disentangled latent style space for unsupervised image-to-image translation. In CVPR, 2021. 1, 4, 5, 6, 8 +[33] Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Which training methods for gans do actually converge? In ICML, 2018. 3 +[34] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics and Image Processing, 2008. 1, 4 +[35] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 3 + +[36] Taesung Park, Alexei A Efros, Richard Zhang, and JunYan Zhu. Contrastive learning for unpaired image-to-image translation. In ECCV, 2020. 4, 8 +[37] Taesung Park, Jun-Yan Zhu, Oliver Wang, Jingwan Lu, Eli Shechtman, Alexei A. Efros, and Richard Zhang. Swapping autoencoder for deep image manipulation. In NeurlPS, 2020. 2, 3, 4, 6 +[38] Gaurav Parmar, Richard Zhang, and Jun-Yan Zhu. On buggy resizing libraries and surprising subtleties in fid calculation. arXiv preprint arXiv:2104.11222, 2021. 5 +[39] Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. Styleclip: Text-driven manipulation of stylegan imagery. In ICCV, 2021. 8 +[40] Kuniaki Saito, Kate Saenko, and Ming-Yu Liu. Coco-funit: Few-shot unsupervised image translation with a content conditioned style encoder. In ECCV, 2020. 1, 2 +[41] Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 1, 4 +[42] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018. 4, 5 +[43] Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. Indomain gan inversion for real image editing. In ECCV, 2020. 2 \ No newline at end of file diff --git a/astyleawarediscriminatorforcontrollableimagetranslation/images.zip b/astyleawarediscriminatorforcontrollableimagetranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9fcc00ffeef03e444b4eb92cd3a62a29f249413e --- /dev/null +++ b/astyleawarediscriminatorforcontrollableimagetranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a25b70b615f7bb449242d2af1d6792ada75d7db13d1841f3604f9dd1d77547ea +size 1001802 diff --git a/astyleawarediscriminatorforcontrollableimagetranslation/layout.json b/astyleawarediscriminatorforcontrollableimagetranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7069c77413b5f87eaafdba1f5ee039fa9f3156b8 --- /dev/null +++ b/astyleawarediscriminatorforcontrollableimagetranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a02cc61313058e0aa885c54ffc3e8d1e0aa214f47027ed3ff06a59f6c7473ac +size 314428 diff --git a/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_content_list.json b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b67a2f4696fee963ecaaa376809127bc65bba859 --- /dev/null +++ b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e81199bbe9b179920ee418a6d1068b7fc90f6dca4b9a2d18c6ae6155c568ec0 +size 76862 diff --git a/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_model.json b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8011159d1ba8756647a9b86fdcee196312168066 --- /dev/null +++ b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5d0a082f0c4ba4d848bd9ec67f925b741b74546275bb043936f7f9ad22c2a50 +size 93834 diff --git a/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_origin.pdf b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c36392dc4b4bb93c66eba8a37d5edf86159d5426 --- /dev/null +++ b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/ce20117a-c966-4e5f-833d-9aabf3a590ed_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df5b786a4d9651f3c43951de000cc929c2fdc0730006ed9c8395130aad9c2f5f +size 10317554 diff --git a/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/full.md b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6a3b4eb9f4e0f4642fe7b7d26629317ed54fd4c0 --- /dev/null +++ b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/full.md @@ -0,0 +1,291 @@ +# A Text Attention Network for Spatial Deformation Robust Scene Text Image Super-resolution + +Jianqi Ma1 Zhetong Liang2 Lei Zhang1 +1The Hong Kong Polytechnic University; 2OPPO Research +{csjma, cslzhang}@comp.polyu.edu.hk, zhetongliang@163.com + +# Abstract + +Scene text image super-resolution aims to increase the resolution and readability of the text in low-resolution images. Though significant improvement has been achieved by deep convolutional neural networks (CNNs), it remains difficult to reconstruct high-resolution images for spatially deformed texts, especially rotated and curve-shaped ones. This is because the current CNN-based methods adopt locality-based operations, which are not effective to deal with the variation caused by deformations. In this paper, we propose a CNN based Text ATTention network (TATT) to address this problem. The semantics of the text are firstly extracted by a text recognition module as text prior information. Then we design a novel transformer-based module, which leverages global attention mechanism, to exert the semantic guidance of text prior to the text reconstruction process. In addition, we propose a text structure consistency loss to refine the visual appearance by imposing structural consistency on the reconstructions of regular and deformed texts. Experiments on the benchmark TextZoom dataset show that the proposed TATT not only achieves state-of-the-art performance in terms of PSNR/SSIM metrics, but also significantly improves the recognition accuracy in the downstream text recognition task, particularly for text instances with multi-orientation and curved shapes. Code is available at https://github.com/mjq11302010044/TATT. + +# 1. Introduction + +The text in an image is an important source of information in our daily life, which can be extracted and interpreted for different purposes. However, scene text images often encounter various quality degradation during the imaging process, resulting in low resolution and blurry structures. This problem significantly impairs the performance of the downstream high-level recognition tasks, including scene text detection [23, 46], optical character recognition (OCR) and scene text recognition [21, 31, 32]. Thus, it is neces + +![](images/0f203632b817c4fcb7f189781c4a98f79ee58b5e07dbb494fc8b561f577442ac.jpg) +Figure 1. SR recovery of different models on rotated and curve-shaped text images. 'R', 'P' and 'S' stand for recognition, PSNR and SSIM results. Characters in red are missing or wrong. + +![](images/4819b470fdd37eb6e8b5e98a159bd142df365af4e1ab1bcd2e89a16adfb40ea2.jpg) + +sary to increase the resolution as well as enhance the visual quality of scene text images. + +In the past few years, many scene text image super-resolution (STISR) methods have been developed to improve the image quality of text images, with notable progress obtained by deep-learning-based methods [4,9,35, 36, 41]. By using a dataset of degraded and original text image pairs, a deep convolutional neural network (CNN) can be trained to super-resolve the text image. With strong expressive capability, CNNs can learn various priors from data and demonstrate much strong performance. A recent advance is the TPGSR model [22], where the semantics of the text are firstly recognized as prior information and then used to guide the text reconstruction process. With the high-level prior information, TPGSR can restore the semantically correct text image with compelling visual quality. + +Despite the great progress, many CNN-based methods still have difficulty in dealing with spatially-deformed text images, including those with rotation and curved shape. Two examples are shown in Fig. 1, where the text in the left image has rotation and the right one has a curved shape. One can see that the current representative methods, includ + +ing TSRN [35] and TPGSR [22], produce blurry texts with semantically incorrect characters. This is because the architectures in current works mainly employ locality-based operations like convolution, which are not effective in capturing the large position variation caused by the deformations. In particular, the TPGSR model adopts a simplistic approach to utilize the text prior: it merely merges text prior with image feature by convolutions. This arrangement can only let the text prior interact with the image feature within a small local range, which limits the effect of text prior on the text reconstruction process. Based on the this observation, some globality-based operations (e.g., attention) should be employed to capture long range correlation in the text image for better STISR performance. + +In this paper, we propose a novel architecture, termed Text ATTention network (TATT), for spatial deformation robust text super resolution. Similar to TPGSR, we first employ a text recognition module to recognize the character semantics as text prior (TP). Then we design a transformer-based module termed TP Interpreter to enforce global interaction between the text prior and the image feature. Specifically, the TP Interpreter operates cross attention between the text prior and the image feature to capture long-range correlation between them. The image feature can then receive rich semantic guidance in spite of the spatial deformation, leading to improved text reconstruction. To further refine the text appearance under spatial deformation, we design a text structure consistency loss, which measures the structural distance between the regular and deformed texts. As can be seen in Fig. 1, the characters recovered by our method show better visual quality with correct semantics. + +Overall, our contributions can be summarized as follows: + +- We propose a novel method to align the text prior with the spatially-deformed text image for better SR recovery by using CNN and Transformer. +- We propose a text structure consistency loss to enhance the robustness of text structure recovery from spatially-deformed low-resolution text images. +- Our proposed model not only achieves state-of-the-art performance on the TextZoom dataset in various evaluation metrics, but also exhibits outstanding generalization performance in recovering orientation-distorted and curve-shaped low-resolution text images. + +# 2. Related Works + +# 2.1. Single Image Super Resolution + +Single image super resolution (SISR) aims at recovering a high-resolution (HR) image from a given low-resolution (LR) input image. The traditional methods design hand-crafted image priors for this task, including statistical prior [11], self-similarity prior [24] and sparsity prior [40]. The recent deep-learning-based methods train + +convolutional neural networks (CNNs) to address the SISR task and achieve leading performance. The seminal work SRCNN [8] adopts a three-layer CNN to learn the SR recovery. Later on, more complex CNN architectures have been developed to upgrade the SISR performance, e.g., residual block [19], Laplacian pyramid [17], dense connections [44] and channel attention mechanism [43]. Recently, generative adversarial networks have been employed in SISR to achieve photo-realistic results [5, 18, 37]. + +# 2.2. Scene Text Image Super Resolution (STISR) + +Different from the general purported SISR that works on natural scene images, STISR focuses on scene text images. It aims to not only increase the resolution of text image, but also reconstruct semantically correct texts that can benefit the down-stream recognition task. The early methods directly adopt the CNN architectures from SISR for the task of STISR. In [9], Dong et al. extended SRCNN [8] to text images, and obtained the best performance in ICDAR 2015 competition [27]. PlugNet [25] adopts a pluggable super-resolution unit to deal with LR images in feature domain. TextSR [36] utilizes the text perceptual loss to generate the desired HR images to benefit the text recognition. + +To address the problem of STISR on real-world scenes, Wang et al. [35] built a real-world STISR image dataset, namely the TextZoom, where the LR and HR text image pairs were cropped from real-world SISR datasets [2, 42]. They also proposed TSRN [35] to use the sequential residual block to exploit the semantic information in internal features. SCGAN [39] employs a multi-class GAN loss to supervise the STISR model for more perceptual-friendly face and text images. Further, Quan et al. [29] proposed a cascading model for recovering blurry text images in high-frequency domain and image domain collaboratively. Chen et al. [4] and Zhao et al. [45] enhanced the network block structures to improve the STISR performance by selfattending the image features and attending channels. + +# 2.3. Scene Text Recognition + +Scene text recognition aims to extract text content from the input images. Some early approaches tend to recognize each character first and then interpret the whole word [12, 14], while some others regard the text image as a whole and performing word-level classification [13]. Considering text recognition as an image-to-sequence problem, CRNN [31] extracts image features and uses the recurrent neural networks to model the semantic information. It is trained with CTC [10] loss to align the predicted sequence and the target sequence. Recently, attention-based methods achieve a great progress due to the robustness in extracting text against shape variance of text images [6, 7]. Despite the great performance achieved by the recent methods, it is still difficult to recognize the text in low-resolution images. + +![](images/d643defcc1a2434b335ac38052598af9f6e56c4a68b03b1d54b315cf94a4f571.jpg) +Figure 2. Architecture of our proposed TATT network for STISR. TPGB, TPG and SRB are short for text prior guided blocks, TP Generator and Sequential-Recurrent Blocks, respectively, while $\oplus$ means the element-wise addition. + +Therefore, we aim to solve the problem of high-resolution text image restoration for better recognition in this paper. + +# 3. Methodology + +# 3.1. Overall Architecture + +The pipeline of our TATT network is shown in Fig. 2. It takes low-resolution (LR) text images $Y \in \mathbb{R}^{h \times w \times 3}$ as input, which is processed in the following two paths. In the first path, the input images are sent into a TP Generator (TPG) to predict the recognition probability sequence as text prior $f_{p}$ (similar to [22]). This process can be denoted as $f_{P} = TPG(Y)$ . $f_{P} \in \mathbb{R}^{l \times |\mathcal{A}|}$ is an $l$ -length sequence composed of categorical probability vectors with size $|\mathcal{A}|$ . $\mathcal{A}$ denotes the character set which is composed of '0' to '9', 'a' to 'z' and a blank class (37 in total). The second path extracts image features $f_{I} \in \mathbb{R}^{h \times w \times c}$ from the input LR image $Y$ by a $9 \times 9$ convolution layer (we denote this process as $f_{I} = \operatorname{Conv}(Y)$ ). + +Then, the text prior $f_{P}$ and the image feature $f_{I}$ are passed to the TP Interpreter $TPI(\cdot)$ to calculate a TP map $f_{TM} \in \mathbb{R}^{h \times w \times c}$ , which is denoted as $f_{TM} = TPI(f_{P}, f_{I})$ . The TP Interpreter computes the correlation between the text prior $f_{P}$ and image feature $f_{I}$ , and assigns the semantic guidance in $f_{P}$ to the corresponding location in the spatial domain to guide the final SR text recovery. The resultant TP map $f_{TM}$ is a modulating map which can be used to enhance the semantics-specific part of the image feature. + +Finally, the TP map $f_{TM}$ and the image feature $f_{I}$ are passed into a reconstruction module. This module includes 5 Text-Prior Guided Blocks (TPGBs) that progressively fuse $f_{TM}$ and $f_{I}$ , and a final Pixel-Shuffle layer to increase the resolution. Each of the 5 TPGBs firstly merges $f_{TM}$ and $f_{I}$ by element-wise addition, followed by a Sequential-Recurrent Block (SRB) [35] to reconstruct the high-resolution image feature. The output of this module is the super-resolved (SR) text image. + +# 3.2. TP Interpreter + +In the proposed architecture, the crucial part lies in the design of TP Interpreter (TPI). The TP Interpreter aims to interpret the text prior $f_{P}$ to the image feature $f_{I}$ so that the influence of the semantics guidance can be exerted to the correlated spatial position in the image feature domain. One intuitive idea is to enlarge $f_{P}$ to the shape of $f_{I}$ and then merge them by convolution. Since the convolution operation has a small effective range, the semantics of $f_{P}$ cannot be assigned to the distant spatial location in $f_{I}$ , especially in the case of spatially-deformed text. Thus, we turn to design a Transformer-based TP Interpreter with attention mechanism to enforce global correlation between text prior $f_{P}$ and the image feature $f_{I}$ . + +As shown in Fig. 3, the proposed TP Interpreter consists of an Encoder part and a Decoder part. The Encoder encodes the text prior $f_{P}$ by performing correlation between the semantics of each character in $f_{P}$ and outputs the context-enhanced feature $f_{E}$ . The decoder performs cross attention between $f_{E}$ and $f_{I}$ to interpret the semantic information to the image feature. + +Encoder. The Encoder takes the text prior $f_{P}$ as input and project it to $C$ channels to match the image feature channel. Since the input text prior is processed in parallel in the encoder, the model is not aware of the semantic order in TP. We thus encode the position by adding the Fixed Positional Encoding (FPE) to $f_{P}$ in an element-wise manner before feeding it into the encoder. Note that we adopt Sinusoidal Positional Encoding [34] as our FPE in this paper. After encoding the position, the text prior is passed into the encoder module. The encoder has a Multi-head Self Attention (MSA) layer and a FeedForward Network (FFN) layer [34]. Skip connection is deployed between the current layer and the previous layer to enable residual learning. The MSA layer performs global correlation between the semantic elements in text prior $f_{P}$ , resulting in a contextually enhanced TP feature $f_{E} \in \mathbb{R}^{l \times c}$ for later computation. Due + +![](images/f84ec4270f1ecbd09bb22f6cb7cbb999ae6578825a1f4df6c9f5229ffacdce02.jpg) +Figure 3. Architecture of TP Interpreter. 'MSA', 'LN', 'MCA' and 'FFN' namely mean the Multi-head Self-Attention, Layer-Norm, Multihead Cross-Attention and Feed-Forward Network layers, while 'FPE' and 'RPE' refer to the Fixed Positional Encoding and Recurrent Positional Encoding. While $\oplus$ means the element-wise addition. + +to the space limit, the description of MSA and FFN is omitted. One can refer to [34] for details. + +Decoder. The decoder module accepts the output from the encoder module $f_{E}$ and image feature $f_{I}$ to perform global cross attention. Similar to the setting in encoder, we firstly add a position encoding to $f_{I}$ to incorporate position information. We design a recurrent positional encoding (RPE) to better encode the bias contained in sequential dependency of image feature in horizontal direction, and better help the model look up the text semantic features in the subsequent cross attention [20, 33]. In RPE, we maintain the learnable parameter with the same shape as image feature and encode the sequential dependency in horizontal direction to help the model better learn the neighboring context. See supplementary file for more details. + +The position-encoded image feature, denoted by $f_{I}^{\prime}$ , and the encoder output $f_{E}$ are then delivered to the decoder module for correlation computation. We process the two inputs with a Multi-head Cross Attention (MCA) layer, which performs cross attention operation between $f_{E}$ and $f_{I}^{\prime}$ . Firstly, the features of $f_{E}$ and $f_{I}^{\prime}$ are divided into $n$ subgroups in the channel dimension. Then a cross attention operation $CA_{i}$ is performed on the $i$ -th group of $f_{E}$ and $f_{I}^{\prime}$ : + +$$ +C A _ {i} \left(f _ {E i}, f _ {I i} ^ {\prime}\right) = S M \left(\frac {\left(f _ {I i} ^ {\prime} W _ {i} ^ {\alpha}\right) \left(f _ {E i} W _ {i} ^ {\beta}\right) ^ {T}}{\sqrt {d _ {k}}}\right) \left(f _ {E i} W _ {i} ^ {\gamma}\right) \tag {1} +$$ + +where $f_{Ei} \in \mathbb{R}^{l \times \frac{c}{n}}$ and $f_{Ii}^{\prime} \in \mathbb{R}^{hw \times \frac{c}{n}}$ denote the $i$ -th group of $f_{E}$ and $f_{I}^{\prime}$ , respectively. $W_{i}^{\alpha} \in \mathbb{R}^{\frac{c}{n} \times d_{k}}$ , $W_{i}^{\beta} \in \mathbb{R}^{\frac{c}{n} \times d_{k}}$ and $W_{i}^{\gamma} \in \mathbb{R}^{\frac{c}{n} \times d_{k}}$ are the parameters of linear projections. $SM$ refers to the Softmax operation. We process the results $CA_{i}$ ( $i \in \{0,1,\dots,n-1\}$ ) with a channel-wise concatenation $\odot(\cdot)$ and a linear projection $W^{o}$ , described as + +$$ +M C A = \odot \left(C A _ {0}, C A _ {1}, \dots , C A _ {n - 1}\right) W ^ {o} \tag {2} +$$ + +The output of MCA is passed to a FFN for feature refinement, and then reshaped to obtain the TP map $f_{TM}$ . + +By using the MCA operation, the text prior $f_{E}$ can effectively interact with the image feature $f_{I}^{\prime}$ by correlating every element in semantic domain to the position in spatial domain. Thus, the semantically meaningful regions in the spatial domain are strengthened in the TP map $f_{TM}$ , which can be used to modulate the image feature for semantic-specific text reconstruction. + +# 3.3. Text Structure Consistency Loss + +While the proposed TATT network can attain a good performance, the reconstructed text image still needs some refinement to improve the visual appearance. This is because it is a bit difficult for a CNN model to represent the deformed text features as it does for regular text features, and the reconstructed text image has weaker character structures with relatively low contrast. As a remedy, we simulate deformed text images and design a text structure consistency (TSC) loss to train the proposed TATT network. + +We consider minimizing the distance of three images, i.e., the deformed version of the SR text image $\mathbf{D}\mathcal{F}(Y)$ , the SR version of the deformed LR text image $\mathcal{F}(\mathbf{D}Y)$ and the deformed ground truth $\mathbf{D}(X)$ , where $\mathbf{D}$ denotes the random deformation1. By increasing the similarity among the three items, we can encourage the CNN model to reduce the performance drop when encountering spatial deformations. The proposed TSC loss firstly measures the structural similarity between the above triplet. For this purpose, we extend the Structure-Similarity Index Measure (SSIM) [38] to a triplex SSIM (TSSIM), described as + +$$ +\begin{array}{l} T S S I M (x, y, z) = \\ \left(\mu_ {x} \mu_ {y} + \mu_ {y} \mu_ {z} + \mu_ {x} \mu_ {z} + C _ {1}\right) \left(\sigma_ {x y} + \sigma_ {y z} + \sigma_ {x z} + C _ {2}\right) \\ \left(\mu_ {x} ^ {2} + \mu_ {y} ^ {2} + \mu_ {z} ^ {2} + C _ {1}\right) \left(\sigma_ {x} ^ {2} + \sigma_ {y} ^ {2} + \sigma_ {z} ^ {2} + C _ {2}\right) \tag {3} \\ \end{array} +$$ + +where $\mu_x, \mu_y, \mu_z$ and $\sigma_x, \sigma_y, \sigma_z$ represent the mean and + +standard deviation of the triplet $x, y$ and $z$ , respectively. $\sigma_{xy}, \sigma_{yz}$ and $\sigma_{xz}$ denote the correlation coefficients between $(x, y)$ , $(y, z)$ and $(x, z)$ , respectively. $C_1$ and $C_2$ are small constants to avoid instability for dividing values close to zero. The derivation is in the supplementary file. + +Lastly, TSC loss $L_{TSC}$ is designed to measure the mutual structure difference among $\mathbf{D}\mathcal{F}(Y)$ , $\mathcal{F}(\mathbf{D}Y)$ and $\mathbf{D}X$ : + +$$ +\begin{array}{l} L _ {T S C} (X, Y; \mathbf {D}) = \\ 1 - T S C V (\mathbf {D}, \mathbf {T} (Y), \mathbf {T} (\mathbf {D} Y), \mathbf {D}, Y) \end{array} \tag {4} +$$ + +$$ +1 - T S S I M (\mathbf {D} \mathcal {F} (Y), \mathcal {F} (\mathbf {D} Y), \mathbf {D} X) +$$ + +# 3.4. Overall Loss Function + +In the training, the overall loss function includes a super resolution loss $L_{SR}$ , a text prior loss $L_{TP}$ and the proposed TSC loss $L_{TSC}$ . The SR loss $L_{SR}$ measures the difference between our SR output $\mathcal{F}(Y)$ and the ground-truth HR image $X$ . We adopt $L_{2}$ norm for this computation. The TP loss measures the $L_{1}$ norm and KL Divergence between the text prior extracted from the LR image and those from the ground truth. Together with TSC loss $L_{TSC}$ , the overall loss function is described as follows: + +$$ +L = L _ {S R} + \alpha L _ {T P} + \beta L _ {T S C} \tag {5} +$$ + +where the $\alpha$ and $\beta$ are the balancing parameters. + +# 4. Experiments + +# 4.1. Implementation Details + +TATT is trained and tested on a single RTX 3090 GPU. We adopt Adam [16] optimizer to train the model with batch size 64. The training lasts for 500 epochs with learning rate $10^{-3}$ . The input image of our model is of width 64 and height 16, while the output is the $2 \times \mathrm{SR}$ result. We set the $\alpha$ and $\beta$ in (5) to 1 and 0.1, respectively (see supplementary file for ablations). The deformation operation $\mathbf{D}$ in $L_{TSC}$ is implemented by applying random rotation in a range of $[-10, 10]$ degree, shearing and aspect ratio in a range of $[0.5, 2.0]$ . The head numbers of MSA and MCA layers are both set to 4 (following the best settings in [3]). The number of image feature channels $c$ , $d_k$ in MSA, MCA and FFN calculation are all set to 64. The model size of TATT is $14.9\mathrm{M}$ in total. When training, the TPG is initialized with pretrained weights derived from [1], while other parts are randomly initialized. When testing, TATT will occupy 6.5GB of GPU memory with batch size 50. + +# 4.2. Datasets + +TextZoom. TextZoom [35] has 21,740 LR-HR text image pairs collected by changing the focal length of the camera in real-world scenarios, in which 17,367 samples are used for training. The rest samples are divided into three subsets, based on the camera focal length, for testing, + +namely easy (1, 619 samples), medium (1, 411 samples) and hard (1, 343 samples). Text label is provided in TextZoom. + +Scene Text Recognition Datasets. Besides experiments conducted in TextZoom, we also adopt ICDAR2015 [15], CUTE80 [30] and SVTP [28] to evaluate the robustness of our model in recovering spatially-deformed LR text images. ICDAR2015 has 2,077 scene text images for testing. Most text images suffer from both low quality and perspective-distortion, making the recognition extremely challenging. CUTE80 is also collected in the wild. The test set has 288 samples in total. Samples in SVTP are mostly curve-shaped text. The total size of the test set is 649. Besides evaluating our model on the original samples, we further degrade the image quality to test the model generalization against unpredicted bad conditions. + +# 4.3. Ablation Studies + +In this section, we investigate the impact of TP Interpreter, the TSC loss function and the effectiveness of positional encoding. All evaluations in this section are performed on the real-world STISR dataset TextZoom [35]. The text recognition is performed by CRNN [31]. + +Impact of TP Interpreter in SR recovery. Since our TP Interpreter aims at providing better alignment between TP and the image feature and use text semantics to guide SR recovery, we compare it with other guiding strategies, e.g., first upsampling the TP to match the image feature with deconvolution layers [22] or pixel shuffle to align text prior to image feature, and then fusing them to perform guidance with element-wise addition or SFT layers $[37]^2$ . The results are shown in Tab. 1. One can see that the proposed TP interpreter obtains that highest PSNR/SSIM, which also indicates the best SR performance. + +Referring to the SR text image recognition, one can see that using Pixel-Shuffle and deconvolution strategies provides inferior guidance (46.2% and 49.8%). There is no stable improvement by combining them with the SFT layers (47.9% and 48.6%). This is because none of the competing strategies performs global correlation between the text semantics and the image feature, resulting in inferior semantic guidance for SR recovery. In contrast, our TP Interpreter can obtain a good semantics context and accurate alignment to the text region. It thus strengthens the guidance in image feature and improves the text recognition result to 52.6%. This validates that using TP Interpreter is an effective way to utilize TP semantics for SR recovery. Some visual comparisons are shown in Fig. 4. One can see that the setting with TP interpreter can lead to the highest quality SR text image with correct semantics. + +To demonstrate how the TP Interpreter provides global context, we visualize the attention heatmap provided by our + +
StrategyavgPSNRSSIM
w/o TP41.4%21.420.7690
PS + A46.2%20.580.7683
PS + S [37]47.9%20.720.7560
D [23] + A50.6%21.100.7819
D [23] + S [37]49.6%20.870.7783
TPI52.6%21.520.7930
+ +![](images/a62a0480bb0a270475834ed85c5fd8343929415b6783e568deb52f8a052218fd.jpg) +Figure 4. SR recovery by different guiding strategies. + +![](images/cd8055987cc5bb27375c3546ce683fdb9f2f6dd08ede4a7639a021613309fa91.jpg) +Figure 5. Attention heatmap of the foreground characters. + +MCA (the outputs from the SM layer in (1)) in Fig. 5. One can see that the region of the corresponding foreground character has the highest weight (highlighted). It thus proves that the ability of TP Interpreter in finding semantics in image features. Some other highlighted regions in the neighborhood also demonstrate that the TP Interpreter can be aware of the neighboring context, which can provide better guidance for final SR recovery. + +Impact of training with TSC loss. To validate the effectiveness of the TSC loss in refining text structure, we compare the results of 4 models trained with and without the TSC loss, including non-TP based TSRN [35], TBSRN [4], TP based TPGSR [22] and TATT. From the results in Tab. 2, one can see that all models lead to a performance gain (4.3% for TSRN, 1.3% for TBSRN, 0.8% for TPGSR, and 1.0% for TATT) in SR text recognition when adopting our TSC loss. Notably, though TBSRN [4] is claimed to be robust for multi-oriented text, it can still be improved with our TSC loss, indicating that training with the TSC loss can improve the robustness of reconstructing the character structure against various spatial deformations. + +Effectiveness of the RPE. We evaluate the impact of recurrent positional encoding in learning text prior guidance. We deploy different combinations of fixed positional encoding (FPE), learnable positional encoding [3] and the pro + +Table 1. Modules adopted in aligning and guiding the TP sequence to the image feature. D and PS refer to aligning operations Deconvolution and Pixel-Shuffle, respectively. A and S refer to guidance fusion operations by element-wise Addition and SFT Layers [37], respectively. TPI is the TP Interpreter. + +
Approach\(L_{TSC}\)easymediumhardavg
TSRN [35]×52.5%38.2%31.4%41.4%
58.0%43.2%33.4%45.7%
TBSRN [4]×59.6%47.1%35.3%48.1%
60.8%49.6%36.1%49.4%
TPGSR [22]×61.0%49.9%36.7%49.8%
62.0%49.8%37.4%50.6%
ours×62.1%52.1%37.8%51.6%
62.6%53.4%39.8%52.6%
+ +Table 2. TextZoom results of models with and without TSC loss. + +
ApproachEncDecavg
OursFPEFPE50.5%
FPELPE50.8%
FPERPE52.6%
+ +Table 3. SR text image recognition results of different positional encoding ablations on TextZoom. The Enc and Dec refer to the encoder and decoder of the TP Interpreter. + +posed recurrent positional encoding (RPE) in the encoder and decoder modules, and compare the corresponding text recognition results on the SR text images. From Tab. 3, we observe that using LPE or FPE in decoder shows limited performance because they are weak in learning the sequential information. By adopting RPE in the decoder, the SR recognition is increased by $1.8\%$ , indicating that RPE is beneficial to text sequential semantics learning. + +# 4.4. Comparison with State-of-the-Arts + +Results on TextZoom. We conduct experiments on the real-world STISR dataset TextZoom [35] to compare the proposed TATT network with state-of-the-art SISR models, including SRCNN [8] and SRResNet [18] and HAN [26], and STISR models, including TSRN [35], TPGSR [22], PCAN [45] and TBSRN [4]. For TPGSR, we compare two models of it, i.e., 1-stage and 3-stage (TPGSR-3). The evaluation metrics are SSIM/PSNR and text recognition accuracy. The comparison results are shown in Tab. 4 and Tab. 5. + +One can see that our model trained with $L_{TSC}$ achieves the best PSNR (21.52) and SSIM (0.7930) overall performance. This verifies the superiority of our method in improving the image quality. As for the SR text recognition, our method achieves new state-of-the-art accuracy under all settings by using the text recognition models of ASTER [32] and CRNN [31]. It even surpasses the 3-stage model TPGSR-3 by using only a single stage. + +We also test the inference speed of the three most competitive STISR methods, i.e., TBSRN (982 fps), TPGSR (1,085 fps) and our TATT model (960 fps). TATT has comparable speed with TPGSR and TBSRN, while surpasses them by $2.7\%$ and $3.6\%$ in SR image text recognition by using ASTER as the recognizer. + +To further investigate the performance on spatially de + +
PSNRSSIM
MethodLosseasymediumhardavgeasymediumhardavg
Bicubic×22.3518.9819.3920.350.78840.62540.65920.6961
SRCNN [8]L223.4819.0619.3420.780.83790.63230.67910.7227
SRResNet [18]L2+Ltv+Lp24.3618,8819.2921.030.86810.64060.69110.7403
HAN [26]L223.3019.0220.1620.950.86910.65370.73870.7596
TSRN [35]L2+LGP25.0718.8619.7121.420.88970.66760.73020.7690
TBSRN [22]LPOS+LCON23.4619.1719.6820.910.87290.64550.74520.7603
PCAN [45]L2+LEG24.5719.1420.2621.490.88300.67810.74750.7752
TPGSR [22]L2+LTP23.7318.6820.0620.970.88050.67380.74400.7719
TPGSR-3 [22]L2+LTP24.3518.7319.9321.180.88600.67840.75070.7774
TATTL2+LTP+LTSC24.7219.0220.3121.520.90060.69110.77030.7930
+ +Table 4. PSNR/SSIM indices for competing SISR and STISR methods. \*3' means multi-stage settings in [22]. + +
ASTER [32]MORAN [21]CRNN [31]
MethodLosseasymediumhardavgeasymediumhardavgeasymediumhardavg
Bicubic×64.7%42.4%31.2%47.2%60.6%37.9%30.8%44.1%36.4%21.1%21.1%26.8%
SRCNN [8]L269.4%43.4%32.2%49.5%63.2%39.0%30.2%45.3%38.7%21.6%20.9%27.7%
SRResNet [18]L2+Ltp+Lp69.4%47.3%34.3%51.3%60.7%42.9%32.6%46.3%39.7%27.6%22.7%30.6%
HAN [26]L271.1%52.8%39.0%55.3%67.4%48.5%35.4%51.5%51.6%35.8%29.0%39.6%
TSRN [35]L2+LGP75.1%56.3%40.1%58.3%70.1%53.3%37.9%54.8%52.5%38.2%31.4%41.4%
TBSRN [22]LPOS+LCON75.7%59.9%41.6%60.0%74.1%57.0%40.8%58.4%59.6%47.1%35.3%48.1%
PCAN [45]L2+LEG77.5%60.7%43.1%61.5%73.7%57.6%41.0%58.5%59.6%45.4%34.8%47.4%
TPGSR [22]L2+LTP77.0%60.9%42.4%60.9%72.2%57.8%41.3%57.8%61.0%49.9%36.7%49.8%
TPGSR-3 [22]L2+LTP78.9%62.7%44.5%62.8%74.9%60.5%44.1%60.5%63.1%52.0%38.6%51.8%
TATTL2+LTP+LTSC78.9%63.4%45.4%63.6%72.5%60.2%43.1%59.5%62.6%53.4%39.8%52.6%
HR-94.2%87.7%76.2%86.6%91.2%85.3%74.2%84.1%76.4%75.1%64.6%72.4%
+ +Table 5. SR text recognition for competing SISR and STISR methods. -3' means multi-stage settings in [22]. + +
MethodAS [32]MO [21]CR [31]PSNRSSIM
Bicubic [35]36.1%32.2%19.5%19.680.6658
TSRN [35]46.6%43.8%35.2%19.700.7157
TBSRN [4]48.5%45.1%37.3%19.100.7066
TPGSR [23]46.6%45.3%40.2%19.790.7293
Ours51.7%47.3%43.8%20.200.7535
HR80.8%75.7%68.8%--
+ +formed text images, we manually pick 804 rotated and curve-shaped samples from TextZoom test set to evaluate the compared models. Results in Tab. 6 indicate that our TATT model obtains the best performance, and the average gap over models like TPGSR and TBSRN becomes larger when encountering spatially deformed text. + +We also visualize the recovery results of both regular samples and spatially-deformed samples of TextZoom in Fig. 6. Without TP guidance, TSRN and TBSRN perform far from readable and they are visually unacceptable. With the TP guidance, TPGSR is still unstable in recovering spatially-deformed images. In contrast, our TATT network performs much better in recovering text semantics in samples of all cases compared to all the competitors. With TSC loss, our model further upgrades the visual quality of the + +Table 6. Evaluation of competitive STISR models on spatially-deformed samples picked in TextZoom in terms of recognition, PSNR and SSIM. 'AS', 'MO' and 'CR' refer to ASTER [32], MORAN [21] and CRNN [31], respectively. + +
super-resolverAS [32]MO [21]CR [31]
OBicubic38.1%29.1%18.1%
TSRN [35]41.5%33.8%26.6%
TBSRN [4]46.8%45.3%38.3%
TPGSR [22]53.1%52.3%42.5%
Ours53.4%59.1%47.2%
COBicubic33.2%28.1%23.6%
TSRN [35]46.4%42.1%29.1%
TBSRN [4]45.5%44.7%31.9%
TPGSR [22]48.3%52.8%38.3%
Ours54.7%54.0%45.1%
GNBicubic29.4%25.8%7.5%
TSRN [35]31.3%27.5%11.5%
TBSRN [4]40.2%33.4%15.8%
TPGSR [22]35.7%31.7%18.1%
Ours43.0%33.4%21.1%
GBBicubic27.0%22.3%5.5%
TSRN [35]39.2%35.8%20.4%
TBSRN [4]42.6%42.8%20.8%
TPGSR [22]45.9%43.8%29.6%
Ours47.4%43.8%35.7%
+ +Table 7. Impact of using different STISR models as super-resolver against degradation. 'O', 'CO', 'GB' and 'GN' refer to original images and image degradation in terms of contrast, Guussian blurring and Gaussian noise. 'AS', 'MO' and 'CR' refer to ASTER [32], MORAN [21] and CRNN [31], respectively. + +samples with better-refined character structure. + +Generalization to recognition dataset. We evaluate the generalization performance of our TATT network to other + +![](images/1ffcc6f2f11e8069f7cde09578bc0658a1235ae585f63e703fbc1d55f505adee.jpg) +Figure 6. Visualization of regular and spatially-deformed samples from TextZoom recovered by state-of-the-art STISR models and the SR text recognition results. Characters in red are missing or wrong. 'w TSC' means that the model is trained with our TSC loss. + +![](images/e04ca0450c6652c246ec422a785d9793d1ecdeb49a54d92aed606bfad99aaea1.jpg) +Figure 7. Visualization of the STISR and text recognition results on extremely compressed and blurred text samples. + +real-world text image datasets, including ICDAR15 [15], CUTE80 [30] and SVTP [28]. These datasets are built for text recognition purpose and contain spatially deformed text image in natural scenes. Since some of the images in these datasets have good quality, we only pick the low-resolution images (i.e., lower than $16 \times 64$ ) to form our test set with 533 samples (391 from ICDAR15, 3 from CUTE80 and 139 from SVTP). Since the degradation is relatively small, we manually add some degradation on them, including contrast variation, Gaussian noise and Gaussian blurring (see details in supplementary file). We compare with TSRN [35], TB-SRN [4] and TPGSR [22] in this test and evaluate the recognition accuracy on the SR results. All models are trained on TextZoom and tested on the picked low-quality images. + +The results are illustrated in Tab. 7, we can see that the proposed TATT network achieves the highest recognition accuracy across all types of degradations. This indicates that our TATT network, though trained on TextZoom, can be well generalized to images in other datasets. The recon + +structured high-quality text images by TATT can benefit the downstream tasks such as text recognition. + +# 5. Conclusion and Discussions + +In this paper, we proposed a Text ATTention network for single text image super-resolution. We leveraged a text prior, which is the semantic information extracted from the text image, to guide the text image reconstruction process. To tackle with the spatially-deformed text recovery, we developed a transformer-based module, called TP Interpreter, to globally correlate the text prior in the semantic domain to the character region in image feature domain. Moreover, we proposed a text structure consistency loss to refine the text structure by imposing structural consistency between the recovered regular and deformed texts. Our model achieved state-of-the-art performance in not only the text super resolution task but the downstream text recognition task. + +Though recording state-of-the-art results, the proposed TATT network has limitation on recovering extremely blurry texts, as shown in Fig. 7. In such cases, the strokes of the characters in the text are mixed together, which are difficult to separate. In addition, the computational complexity of our TATT network grows exponentially with the length of the text in the image due to the global attention adopted in our model. It is expected to reduce the computational complexity and improve run-time efficiency of TATT, which will be our future work. + +# 6. Acknowledgements + +This work is supported by the Hong Kong RGC RIF grant (R5001-18). We thank Dr. Lida Li for the useful discussion on this project. + +# References + +[1] crnn.pytorch. https://github.com/meijieru/cnn.pytorch.5 +[2] Jianrui Cai, Hui Zeng, Hongwei Yong, Zisheng Cao, and Lei Zhang. Toward real-world single image super-resolution: A new benchmark and a new model. In Int. Conf. Comput. Vis., pages 3086-3095, 2019. 2 +[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Eur. Conf. Comput. Vis., pages 213-229. Springer, 2020. 5, 6 +[4] Jingye Chen, Bin Li, and Xiangyang Xue. Scene text telescope: Text-focused scene image super-resolution. In IEEE Conf. Comput. Vis. Pattern Recog., pages 12026-12035, 2021. 1, 2, 6, 7, 8 +[5] Yu Chen, Ying Tai, Xiaoming Liu, Chunhua Shen, and Jian Yang. FSRNet: End-to-end learning face super-resolution with facial priors. In IEEE Conf. Comput. Vis. Pattern Recog., pages 2492-2501, 2018. 2 +[6] Zhanzhan Cheng, Fan Bai, Yunlu Xu, Gang Zheng, Shiliang Pu, and Shuigeng Zhou. Focusing attention: Towards accurate text recognition in natural images. In Int. Conf. Comput. Vis., pages 5076-5084, 2017. 2 +[7] Zhanzhan Cheng, Yangliu Xu, Fan Bai, Yi Niu, Shiliang Pu, and Shuigeng Zhou. AON: Towards arbitrarily-oriented text recognition. In IEEE Conf. Comput. Vis. Pattern Recog., pages 5571-5579, 2018. 2 +[8] Chao Dong, Chen Change Loy, Kaiming He, and Xiaou Tang. Image super-resolution using deep convolutional networks. IEEE Trans. Pattern Anal. Mach. Intell., 38(2):295-307, 2015. 2, 6, 7 +[9] Chao Dong, Ximei Zhu, Yubin Deng, Chen Change Loy, and Yu Qiao. Boosting optical character recognition: A superresolution approach. arXiv preprint arXiv:1506.02211, 2015.2 +[10] Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber. Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In Int. Conf. Machine Learn., pages 369-376, 2006. 2 +[11] Bahadir K. Gunturk, Yucel Altunbasak, and Russell M. Mersereau. Super-resolution reconstruction of compressed video using transform-domain statistics. IEEE Trans. Image Process., 13(1):33-43, 2004. 2 +[12] Pan He, Weilin Huang, Yu Qiao, Chen Change Loy, and Xiaou Tang. Reading scene text in deep convolutional sequences. In AAAI, 2016. 2 +[13] Max Jaderberg, Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Reading text in the wild with convolutional neural networks. Int. J. Comput. Vis., 116(1):1-20, 2016. 2 +[14] Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Deep features for text spotting. In *Eur. Conf. Comput. Vis.*, pages 512-528. Springer, 2014. 2 +[15] Dimosthenis Karatzas, Lluis Gomez-Bigorda, Anguelos Nicolaou, Suman Ghosh, Andrew Bagdanov, Masakazu Iwamura, Jiri Matas, Lukas Neumann, Vijay Ramaseshan Chandrasekhar, Shijian Lu, et al. ICDAR 2015 competition on + +robust reading. In Int. Conf. Doc. Anal. Recog., pages 1156-1160. IEEE, 2015. 5, 8 +[16] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. *ICLR*, 2015. 5 +[17] Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep Laplacian pyramid networks for fast and accurate super-resolution. In IEEE Conf. Comput. Vis. Pattern Recog., pages 624-632, 2017. 2 +[18] Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photorealistic single image super-resolution using a generative adversarial network. In IEEE Conf. Comput. Vis. Pattern Recog., pages 4681-4690, 2017. 2, 6, 7 +[19] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Young Mu Lee. Enhanced deep residual networks for single image super-resolution. In IEEE Conf. Comput. Vis. Pattern Recog. Worksh., pages 136-144, 2017. 2 +[20] Antoine Liutkus, Ondrej Cifka, Shih-Lun Wu, Umut Simsekli, Yi-Hsuan Yang, and Gael Richard. Relative positional encoding for transformers with linear complexity. In Int. Conf. Machine Learn., pages 7067-7079. PMLR, 2021. 4 +[21] Canjie Luo, Lianwen Jin, and Zenghui Sun. MORAN: A multi-object rectified attention network for scene text recognition. Pattern Recognit., 90:109-118, 2019. 1, 7 +[22] Jianqi Ma, Shi Guo, and Lei Zhang. Text prior guided scene text image super-resolution. arXiv preprint arXiv:2106.15368, 2021. 1, 2, 3, 5, 6, 7, 8 +[23] Jianqi Ma, Weiyuan Shao, Hao Ye, Li Wang, Hong Wang, Yingbin Zheng, and Xiangyang Xue. Arbitrary-oriented scene text detection via rotation proposals. IEEE Trans. Multimedia, 20(11):3111-3122, 2018. 1, 6, 7 +[24] Julien Mairal, Francis R. Bach, Jean Ponce, Guillermo Sapiro, and Andrew Zisserman. Non-local sparse models for image restoration. In IEEE 12th International Conference on Computer Vision, ICCV 2009, Kyoto, Japan, September 27 - October 4, 2009, pages 2272-2279. IEEE Computer Society, 2009. 2 +[25] Yongqiang Mou, Lei Tan, Hui Yang, Jingying Chen, Leyuan Liu, Rui Yan, and Yaohong Huang. PlugNet: Degradation aware scene text recognition supervised by a pluggable super-resolution unit. In Eur. Conf. Comput. Vis., 2020. 2 +[26] Ben Niu, Weilei Wen, Wenqi Ren, Xiangde Zhang, Lianping Yang, Shuzhen Wang, Kaihao Zhang, Xiaochun Cao, and Haifeng Shen. Single image super-resolution via a holistic attention network. In Eur. Conf. Comput. Vis., pages 191-207. Springer, 2020. 6, 7 +[27] Clément Peyrard, Moez Baccouche, Franck Mamalet, and Christophe Garcia. ICDAR2015 competition on text image super-resolution. In Int. Conf. Doc. Anal. Recog., pages 1201-1205. IEEE, 2015. 2 +[28] Trung Quy Phan, Palaiahnakote Shivakumara, Shangxuan Tian, and Chew Lim Tan. Recognizing text with perspective distortion in natural scenes. In Int. Conf. Comput. Vis., pages 569-576, 2013. 5, 8 +[29] Yuhui Quan, Jieting Yang, Yixin Chen, Yong Xu, and Hui Ji. Collaborative deep learning for super-resolving blurry text images. IEEE Trans. Comput. Imaging, 6:778-790, 2020. 2 + +[30] Anhar Risnumawan, Palaiahankote Shivakumara, Chee Seng Chan, and Chew Lim Tan. A robust arbitrary text detection system for natural scene images. Expert Syst. Appl, 41(18):8027-8048, 2014. 5, 8 +[31] Baoguang Shi, Xiang Bai, and Cong Yao. An end-to-end trainable neural network for image-based sequence recognition and its application to scene text recognition. IEEE Trans. Pattern Anal. Mach. Intell., 39(11):2298-2304, 2016. 1, 2, 5, 6, 7 +[32] Baoguang Shi, Mingkun Yang, Xinggang Wang, Pengyuan Lyu, Cong Yao, and Xiang Bai. ASTER: An attentional scene text recognizer with flexible rectification. IEEE Trans. Pattern Anal. Mach. Intell., 41(9):2035-2048, 2018. 1, 6, 7 +[33] Vighnesh Shiv and Chris Quirk. Novel positional encodings to enable tree-based transformers. Adv. Neural Inform. Process. Syst., 32:12081-12091, 2019. 4 +[34] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Adv. Neural Inform. Process. Syst., 2017. 3, 4 +[35] Wenjia Wang, Enze Xie, Xuebo Liu, Wenhai Wang, Ding Liang, Chunhua Shen, and Xiang Bai. Scene text image super-resolution in the wild. In Eur. Conf. Comput. Vis., 2020. 1, 2, 3, 5, 6, 7, 8 +[36] Wenjia Wang, Enze Xie, Peize Sun, Wenhai Wang, Lixun Tian, Chunhua Shen, and Ping Luo. TextSR: Content-aware text super-resolution guided by recognition. In Eur. Conf. Comput. Vis., 2020. 1, 2 +[37] Xintao Wang, Ke Yu, Chao Dong, and Chen Change Loy. Recovering realistic texture in image super-resolution by deep spatial feature transform. In IEEE Conf. Comput. Vis. Pattern Recog., pages 606-615, 2018. 2, 5, 6 +[38] Zhou Wang, Alan C. Bovik, Hamid R. Sheikh, and Eero P. Simoncelli. Image quality assessment: From error visibility to structural similarity. IEEE Trans. Image Process., 13(4):600-612, 2004. 4 +[39] Xiangyu Xu, Deqing Sun, Jinshan Pan, Yujin Zhang, Hanspeter Pfister, and Ming-Hsuan Yang. Learning to superresolve blurry face and text images. In Int. Conf. Comput. Vis., pages 251-260, 2017. 2 +[40] Jianchao Yang, John Wright, Thomas S. Huang, and Yi Ma. Image super-resolution via sparse representation. IEEE Trans. Image Process., 19(11):2861-2873, 2010. 2 +[41] Haochen Zhang, Dong Liu, and Zhiwei Xiong. CNN-based text image super-resolution tailored for OCR. In Vis. Commun. Image Process., pages 1-4. IEEE, 2017. 1 +[42] Xuaner Zhang, Qifeng Chen, Ren Ng, and Vladlen Koltun. Zoom to learn, learn to zoom. In IEEE Conf. Comput. Vis. Pattern Recog., pages 3762-3770, 2019. 2 +[43] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In Eur. Conf. Comput. Vis., pages 286-301, 2018. 2 +[44] Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image super-resolution. In IEEE Conf. Comput. Vis. Pattern Recog., pages 2472-2481, 2018. 2 + +[45] Cairong Zhao, Shuyang Feng, Brian Nlong Zhao, Zhijun Ding, Jun Wu, Fumin Shen, and Heng Tao Shen. Scene text image super-resolution via parallelly contextual attention network. In ACM Int. Conf. Multimedia, pages 2908-2917, 2021. 2, 6, 7 +[46] Xinyu Zhou, Cong Yao, He Wen, Yuzhi Wang, Shuchang Zhou, Weiran He, and Jiajun Liang. EAST: An efficient and accurate scene text detector. In IEEE Conf. Comput. Vis. Pattern Recog., pages 5551-5560, 2017. 1 \ No newline at end of file diff --git a/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/images.zip b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9859f729c8ddc113790328a24fceceacf52406ec --- /dev/null +++ b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26846999ca50d640c177aeb483506a6c6d313675194e13b9b2d3381f18b0f9ee +size 763366 diff --git a/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/layout.json b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c22d45ce1fff3d45676633a9fdbe58ff77751de9 --- /dev/null +++ b/atextattentionnetworkforspatialdeformationrobustscenetextimagesuperresolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b19a849094f84a4dc2a1c688592a745942b9a71c63270940ebf4c891bdba0f4f +size 394168 diff --git a/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_content_list.json b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f95090427d973668b3c1c3ac0839a56ec96a60a4 --- /dev/null +++ b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad6bdf9faa8389164bae18af3e9a1261355b8abf473313dc4b585500df351097 +size 77981 diff --git a/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_model.json b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dce6ff35ae2a5144ad86b8f8a250d035bd842b06 --- /dev/null +++ b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cef6d40ebc5a2f446c486299766a713c1e1a718a319deb5e14b1c34d004b2e57 +size 93382 diff --git a/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_origin.pdf b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9d9cdea105f23cd9b9a7e4f8b904874abfcb72d2 --- /dev/null +++ b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/8b150388-3fba-44af-a270-152383fbf491_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa68d9aa1d1d3d7b981659f08c2179d81df0e6dabf158c2fd245a9ff2c3797a5 +size 1000849 diff --git a/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/full.md b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/full.md new file mode 100644 index 0000000000000000000000000000000000000000..618430c4c98f11c998da611a53d005b1e013eed5 --- /dev/null +++ b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/full.md @@ -0,0 +1,344 @@ +# ATPFL: Automatic Trajectory Prediction Model Design under Federated Learning Framework + +Chunnan Wang $^{1}$ , Xiang Chen $^{1}$ , Junzhe Wang $^{1}$ , Hongzhi Wang $^{1,2*}$ + +1Harbin Institute of Technology + +$^{2}$ Peng Cheng Laboratory + +WangChunnan@hit.edu.cn, {20s003052,1190201815}@stu.hit.edu.cn, wangzh@hit.edu.cn + +# Abstract + +Although the Trajectory Prediction (TP) model has achieved great success in computer vision and robotics fields, its architecture and training scheme design rely on heavy manual work and domain knowledge, which is not friendly to common users. Besides, the existing works ignore Federated Learning (FL) scenarios, failing to make full use of distributed multi-source datasets with rich actual scenes to learn more a powerful TP model. In this paper, we make up for the above defects and propose ATPFL to help users federate multi-source trajectory datasets to automatically design and train a powerful TP model. In ATPFL, we build an effective TP search space by analyzing and summarizing the existing works. Then, based on the characters of this search space, we design a relation-sequence-aware search strategy, realizing the automatic design of the TP model. Finally, we find appropriate federated training methods to respectively support the TP model search and final model training under the FL framework, ensuring both the search efficiency and the final model performance. Extensive experimental results show that ATPFL can help users gain well-performed TP models, achieving better results than the existing TP models trained on the single-source dataset. + +# 1. Introduction + +Human Trajectory Prediction (TP) models aim to predict the movement of pedestrians [13, 20]. Their high performance greatly depends on abundant trajectory data. However, in real applications, the TP data sources are generally monitor devices scattered across different regions. They contain trajectory data in a variety of scenarios but can not be shared due to privacy protection, which brings limitations to the existing TP works. In order to break the TP data island problem, Federated Learning (FL) framework needs + +![](images/cce02daa2402d77071fe2b9d831c190e18930af645be65e2b3ebf7e2203a163c.jpg) +Figure 1. ATPFL combines AutoML with FL techniques on TP area, aiming to utilize multi-source TP datasets to jointly design and train the powerful TP model. + +to be introduced to unite these multiple data sources jointly obtain a more robust and general TP model in a distributed and privacy-preserving manner. While this idea brings two major challenges. + +On one hand, the design of TP models under the FL framework is difficult. Specifically, the TP model design process requires both heavy manual work and domain knowledge. However, FL users are generally non-experts. They fail to realize the independent development without the domain knowledge, which brings great obstacles to the general application of TP models under the FL framework. + +On the other hand, the FL method suitable for TP models has not been studied or discussed yet. The existing FL works are mainly built around CNN [6,8,19] without paying attention to TP models. How to train TP models effectively under the FL framework remains to be further studied. + +In this paper, we aim to tackle the above two challenges and propose ATPFL algorithm, which combines Automated Machine Learning (AutoML) with FL (as is shown in Figure 1), to federate multi-source trajectory datasets to automatically design and train powerful TP models. + +For the first challenge, in ATPFL, we design an AutoML algorithm suitable for the TP area, thus achieving the TP model's automatic design. We summarize the design process of the TP model, collect available operations for each step and identify the limitation of each operation by analyzing the existing TP works. We integrate the above experience and knowledge in a relation graph and thus construct an effective search space for the TP area. + +Besides, considering the complex restrictive relations, temporal relations and technical connections among operations, we design a relation-sequence-aware strategy to effectively and efficiently explore the TP search space. This strategy can utilize the constructed relation graph, Graph Neural Network (GNN) [4] combined with Recurrent Neural Network (RNN) to learn high-level features of the selected operation sequence, and thus provide an effective reference for designing subsequent steps. Also, it can avoid invalid model design schemes by consulting the relation graph at each step, thus greatly improving the search efficiency. Compared with the traditional search strategy for AutoML which ignores relations among operations during the model design [10, 12, 21], our strategy is more suitable for the TP area. + +As for the second challenge, we find appropriate federated training methods for TP models, enabling ATPFL to perform effectively and efficiently under the FL framework. We identify a method with fast convergence to support the fast evaluation of TP model candidates in AutoML, thus ensuring the search efficiency of ATPFL. Besides, we choose the most effective federated training method to train the optimal TP model discovered by ATPFL, so as to further improve the final performance of ATPFL. + +Our major contributions are summarized as follows. + +1. Knowledge: We construct a detailed knowledge graph for operations in the TP area. This graph can deepen our understanding of TP models and provide favorable help for further study. +2. Novelty: We simultaneously break the data island and professional restrictions, empower non-experts to combine multi-source trajectory datasets to design powerful TP models automatically. +3. Effectiveness: Extensive experiments show that our designed search strategy and selected federated training methods are well suited to the TP area, and helpful for obtaining more powerful TP models, which demonstrate the effectiveness of ATPFL. + +# 2. Related Works + +# 2.1. Trajectory Prediction Models + +The deep neural network based TP models [1,2,11,13, 14,16,20,25,29,30,32] have emerged recently as powerful + +tools for forecasting future trajectories of humans. SocialLSTM [1] is one of the earliest deep TP models, which applies an RNN and a pooling mechanism to model the motion pattern of pedestrians and form social features between them. Social-GAN [11] extends Social-LSTM into a generative adversarial model to further explore the multimodality of human behaviors and achieve better results. STGAT [13] presents a novel spatial-temporal graph attention network to capture both spatial and temporal features of the crowd interactions, and achieves good performance. More recently, Social-STGCNN [20] proposes to model the pedestrians' trajectories as a spatio-temporal graph, and directly manipulates over the graph to model pedestrians' interactions using a graph Convolutional Neural Network(CNN) and a temporal CNN. + +These existing neural models focus on different insights to solve the TP problems, having made promising progress in real applications. In this paper, we aim to flexibly use the model design experience provided by them to support the automatic design of TP models. + +# 2.2. Federated Training Methods + +FL [31] aims to train a high-quality centralized model based on datasets that are distributed across multiple clients without sharing their data. It makes it possible to vigorously develop neural models in the privacy-preserving era, and attracts great attention of scholars. FedAvg [19] is the first federated training method designed for neural models. It uses local SGD updates in each client and builds a global model from a subset of clients with non-i.i.d. data. PerFedAvg [7] adds the idea of personalization to FedAvg. It allows each client to perform one gradient update based on the global model using its local dataset to obtain a personalized model solution. More recently, pFedMe [6] was proposed to further improve the performance of Per-FedAvg. It allows each client to use any optimization method for multi-step updates without deviating too much from the global model parameters to obtain better personalized model solutions. It can parallelly optimize the personalized models with low complexity and achieve good results. + +These federated training methods on neural models provide strong supports for TP model training under the FL framework. But previous works only analyze their performance on classification models or other motion prediction models [9, 18], while ignoring their characteristics on TP ones. In this paper, we aim to fill the gap and identify appropriate federated training methods for TP models, ensuring the search efficiency and final performance of ATPFL under the FL framework. + +# 2.3. Neural Architecture Search Algorithms + +The Neural Architecture Search (NAS) which leans to automatically search for good neural architectures [27], + +is an important research topic in AutoML. The existing NAS algorithms can be classified into three categories, Reinforcement Learning (RL) based methods, Evolutionary Algorithm (EA) based methods and gradient-based methods. The RL-based NAS [3, 10] uses an RNN as the controller to determine a sequence of operators and connection tokens, thus constructing networks sequentially. EA-based NAS [5,24] initializes a population of architectures first and then evolves them with their validation accuracies as fitnesses. As for the gradient-based NAS methods [12, 17, 21], they relax the search space to be continuous, so that the architecture can be optimized with respect to its validation performance by gradient descent. + +These NAS algorithms are generally designed for CNN or GNN classification models, where operations in the search space do not have complex relations. They are unable to tackle valuable connections among TP operations to further improve the final performance, which is not well suited for TP-based NAS problems. This paper aims to fill this gap and design a more suitable NAS solution for the TP area, realizing efficient and automatic TP model design. + +# 3. Our Approach + +In this section, we first design an AutoML algorithm to realize the automated design of the TP model in ATPFL (Section 3.1). Then, we determine the appropriate federated training methods to guide ATPFL to effectively and efficiently work under the FL framework (Section 3.2). + +# 3.1. Automatic design of TP model + +We utilize the existing TP model design experience to construct an effective TP search space (3.1.2), and design a relation-sequence-aware search strategy to guide ATPFL to efficiently search for a high-performance TP model (3.1.3). Section 3.1.1 gives the notations on the TP model and defines the search target of ATPFL. + +# 3.1.1 Notations and Search Target + +Notations. Assume there are $N$ pedestrians involved in a scene, represented as $p_1, p_2, \ldots, p_N$ . The position of pedestrian $p_i$ at time-step $t$ is denoted as $p_i^t = (x_i^t, y_i^t)$ , and the set of observed history positions of all pedestrians over a time period $t_{\mathrm{obs}}$ is denoted as $\mathbb{X} = \{p_i^{1:t_{\mathrm{obs}}} | i = 1, \ldots, N\}$ . A TP model $\mathcal{M}$ can predict the upcoming trajectories of all pedestrians over a future time horizon $t_{\mathrm{pred}}$ , which is denoted by $\mathbb{Y} = \{p_i^{t_{\mathrm{obs}} + 1:t_{\mathrm{pred}}} | i = 1, \ldots, N\}$ , according to $\mathbb{X}$ . We use $\hat{\mathbb{Y}} = \mathcal{M}(\mathbb{X})$ to represent the prediction of model $\mathcal{M}$ , and compare $\hat{\mathbb{Y}}$ and $\mathbb{Y}$ using the Average Displacement Error (ADE) metric or a certain loss function, so as to examine the effectiveness of the TP model $\mathcal{M}$ . + +Search Target. Given a TP search space $\mathbb{S}$ and a federated TP dataset $\mathbb{D} = \{D_1, \dots, D_C\}$ that are distributed and non-shared across $C$ clients, the AutoML part of ATPFL algorithm aims to find an optimal TP model $\mathcal{M}^* \in \mathbb{S}$ that minimizes the overall validation ADE score on $\mathbb{D}$ . + +$$ +\mathcal {M} ^ {*} = \underset {\mathcal {M} \in \mathbb {S}} {\arg \min } \mathrm {A D E} _ {\mathbb {D} _ {\text {v a l}}} \left(\mathbf {W} _ {\mathcal {M}} ^ {*}, \mathcal {M}\right) \tag {1} +$$ + +$$ +\text {s . t .} \mathbf {W} _ {\mathcal {M}} ^ {*} = \underset {\mathbf {W}} {\arg \min } \mathcal {L} _ {\mathbb {D} _ {\text {t r a i n}}} (\mathbf {W}, \mathcal {M}) +$$ + +where $\mathcal{L}_{\mathbb{D}_{\mathrm{train}}}\left(\mathbf{W},\mathcal{M}\right)$ denotes the overall training loss of TP model $\mathcal{M}$ on $\mathbb{D}$ under weights $\mathbf{W}$ , and $\mathbf{W}_{\mathcal{M}}^{*}$ can be learned using a federated training method. + +# 3.1.2 Search Space + +We sum up 5 stages of the TP model design by learning from the existing TP models (these stages are common to existing TP models). We apply 10 parameters to describe the main contents of these stages and extract effective operations of each parameter from 5 state-of-the-art TP models, including SGCN [26] $(\mathcal{M}_1)$ , LB-EBM [22] $(\mathcal{M}_2)$ , Social-STGCNN [20] $(\mathcal{M}_3)$ , Social Ways [2] $(\mathcal{M}_4)$ , STGAT [13] $(\mathcal{M}_5)$ . Table 1 summarizes all contents of this part. + +In ATPFL, we utilize the experience information in Table 1 to construct an effective TP search space. Specifically, apart from the 10 parameters defined above, which outline the design process of a TP model, we add two parameters: $\mathbf{FExM}_{\mathrm{add}}$ and $\mathbf{FEnM}_{\mathrm{add}}$ to TP search space, corresponding to an additional group of feature extraction and enhancement operation in Stage 2, so as to acquire more powerful TP models. We apply these 12 parameters to describe the design scheme of a TP model, allowing them to be set to their options in the fourth column of Table 1, and thus obtain a search space with diversified TP models (about $1.3\times 10^{6}$ TP models design scheme contained in the search space). + +# 3.1.3 Relation-Sequence-Aware Search Strategy + +In this part, we aim to design an effective strategy for ATFFL to efficiently search for the high-performance TP model from the huge search space designed in Section 3.1.2. + +Features of TP search space. We notice that TP search space is more complex than the traditional CNN search space, where operations are simple and do not have restrictions on use. There are multiple associations among operations in the TP search space (Details are shown in Figure 2): + +$\mathbf{R_1}$ Temporal Relations. Each operation in the search space corresponds to only one of the stages of TP model design, and the operations of Stage 1 to Stage 5 should be sequentially selected (as follows) during the TP model design process. + +Table 1. 5 stages of the TP model design. The $4^{th}$ column lists options of 10 parameters used to describe a TP model. Options are extracted from 5 TP models: SGCN [26] $(\mathcal{M}_1)$ , LB-EBM [22] $(\mathcal{M}_2)$ , Social-STGCNN [20] $(\mathcal{M}_3)$ , Social Ways [2] $(\mathcal{M}_4)$ , STGAT [13] $(\mathcal{M}_5)$ . + +
StageFunction DescriptionInvolved Operations (Parameters)Solutions (Parameters' Options) Provided by Existing Works
Stage 1: Data Preprocessing StageEnhance the representation power of the input.Input Processing Method (IPM) X' = IPM(X)IPM1: Real Position (M2) IPM2: Relative Position (M1, M3, M5) IPM3: Real + Relative Position (M4)
Stage 2: Feature Extraction StageCapture features of the historical trajectory.Feature Extraction Method (FExM) F = FExM(X', X)FExM1: Sparse Graph Convolution Network (M1) FExM2: Multilayer Perceptron Network (M2) FExM3: Spatio-Temporal Graph CNN (M3) FExM4: LSTM based Motion Encoder Module (M4) FExM5: GAT-based Crowd Interaction Modeling (M5)
Feature Enhancement Method (FEnM) F' = FEnM(X', X, F)FEnM1: None (M1, M3) FEnM2: Latent Belief Energy-based Module (M2) FEnM3: Attention Pooling Module (M4) FEnM4: LSTM-based Temporal Correlation Modeling (M5)
Stage 3: Feature Fusion StageCombine features of historical trajectory.Feature Fusion Method (FFM) Fall = FFM(F, F')FFM1: Concentrate All Features in Stage 2 (M1, M2, M3) FFM2: Concentrate All Features in Stage 2 and Noise (M4, M5)
Stage 4: Trajectory Prediction StageTransform the output of the Stage 3 into the expected prediction.Prediction Processing Structure (PPS) Y = PPS(Fall)PPS1: Time Convolution Network (M1) PPS2: Time-Extrapolator Convolution Neural Network (M3) PPS3: Multiple Fully-Connected Layer (M2, M4) PPS4: LSTM + Fully-Connected Layer (M5)
Output Contents (OC)OC1: Predict Coordinates Sequentially (M4) OC2: Predict Coordinates Directly (M2, M5) OC3: Predict Parameters of Bi-Variate Gaussian Distribution (M1, M3)
Stage 5: Model Training StageDetermine suitable training setting for the designed Trajectory Prediction model.Loss Function (LF)LF1: L2 loss (M2, M4, M5) LF2: Distribution-based Negative Log-Likelihood Loss (M1, M3)
Training Mode (TM)TM1: General LF-based Model Training (M1, M2, M3) TM2: Generative Adversarial Network based Model Training (M4) LM3: Variety Loss based Model Training (M5)
Learning Rate (LR)LR1: 1e-2 (M1, M3) LR2: 1e-4 (M2) LR3: 0.0015 LR4: 1e-3 (M4, M5)
Optimization Function (OF)OF1: Adam (M1, M2, M4, M5) OF2: SGD (M3)
+ +$$ +\begin{array}{l}\mathrm {I P M} \rightarrow \mathrm {F E x M} \rightarrow \mathrm {F E n M} \rightarrow \mathrm {F E x M} _ {\mathrm {a d d}} \rightarrow \mathrm {F E n M} _ {\mathrm {a d d}}\\\rightarrow \mathrm {F F M} \rightarrow \mathrm {P P S} \rightarrow \mathrm {O C} \rightarrow \mathrm {L F} \rightarrow \mathrm {T M} \rightarrow \mathrm {L R} \rightarrow \mathrm {O F}\end{array} +$$ + +$\mathbf{R}_2$ Restrictive Relations. Some operations may fail to cooperate with certain operations to construct effective TP models due to special requirements. + +For example, $\mathbf{LF}_2$ in Table 1 is designed for TP models which estimate bi-variate distribution $(\mathbf{OC}_3)$ , not applicable to $\mathbf{OC}_1$ and $\mathbf{OC}_2$ . $\mathbf{FExM}_2$ is unable to deal with variable-length trajectories, and thus fail to predict coordinates sequentially $(\mathbf{OC}_1)$ . + +$\mathbf{R}_{3}$ Technical Connections. Some operations may apply the same type of neural architectures or techniques. + +For example, both $\mathbf{FExM}_3$ and $\mathbf{PPS}_1$ use CNN, $\mathbf{FExM}_5$ and $\mathbf{FEnM}_3$ apply the attention mechanism. + +These association relationships are valuable and can help improve the search performance: $\mathbf{R}_1 - \mathbf{R}_3$ can assist search strategy better understanding characteristics of each operation, obtaining better TP models; $\mathbf{R}_1$ and $\mathbf{R}_2$ can guide the search strategy to avoid invalid operation combinations and thus improve the search efficiency. In addition, we note that the valid and optimal options of the subsequent operations can be affected by the selected TP operation sequence. + +Relation-Sequence-Aware Strategy. Based on above features, we design a relation-sequence-aware search strategy in ATPFL, which can utilize relational information among operations, combining with the historical operation sequence to sequentially and efficiently select the optimal subsequent operations, and thus obtain effective TP models. Figure 2 gives the overall framework of our strategy. + +Our strategy contains two parts, i.e., GNN based embedding learning and masked RNN optimizer. + +Part1: GNN based Embedding Learning. We firstly use GNN to learn the effective embedding representation of each operation from relational information in the TP search space. We treat the operations in search space as nodes and transform $\mathbf{R}_1 - \mathbf{R}_3$ into three different types of edges to connect related operation pairs, and thus construct a heterogeneous graph to represent relations among operations. Then, we introduce FAGCN [4], an effective GCN with a self-gating mechanism, to automatically learn associations between nodes and obtain high-level node features by adaptively integrating related neighboring information. + +Note that different types of neighbors may make different contributions to the final embedding of the target operation node. Therefore, we make FAGCN adaptively learn the importance of different edge types on the target node. + +![](images/468b5aab96490b061a7e1ffd4113e4e91e1f288d936844798b8b5b2beb6ede18.jpg) +Figure 2. The overall framework of the relation-sequence-aware search strategy in ATPFL. Note that $\mathbf{R_1}$ , i.e., temporal relation, exists between adjacent operations with different types and we omit these edges in the heterogeneous graph. + +The embedding learning formula for each operation in the search space is as follows: + +$$ +\mathbb {E} _ {i} ^ {\prime} = \epsilon \cdot \mathbf {x} _ {i} + \sum_ {k = 1} ^ {3} \sum_ {j \in \mathcal {N} _ {i, \mathbf {R} _ {\mathbf {k}}}} \frac {\alpha_ {i , j , \mathbf {R} _ {\mathbf {k}}}}{\sqrt {d _ {i , \mathbf {R} _ {\mathbf {k}}} d _ {j , \mathbf {R} _ {\mathbf {k}}}}} \mathbf {x} _ {j} \tag {2} +$$ + +where $\mathbf{x}_i$ , $\mathcal{N}_{i,\mathbf{R_k}}$ and $d_{i,\mathbf{R_k}}$ denote the initial embedding representation, neighbor set and node degree w.r.t. edge $\mathbf{R_k}$ of node $i$ , respectively. The attention coefficients $\alpha_{i,j,\mathbf{R_k}}$ are computed based on the trainable parameter vector $\mathbf{a}_{\mathbf{R_k}}$ . + +$$ +\alpha_ {i, j, \mathbf {R} _ {\mathbf {k}}} = \operatorname {t a n h} \left(\mathbf {a} _ {\mathbf {R} _ {\mathbf {k}}} ^ {\top} \left[ \mathbf {x} _ {i}, \mathbf {x} _ {j} \right]\right) \tag {3} +$$ + +Part2: Masked RNN Optimizer. Then, we use RNN, heterogeneous graph and the learned high-level operation embeddings to sequentially and efficiently obtain the optimal and valid TP model design scheme. + +We fed embeddings of the selected operations $o_{1 \sim t} = (o_1, \ldots, o_t)$ into RNN sequentially to extract the effective features $\mathbb{F}_{o_{1 \sim t}}$ of the historical operation sequence. And predict the possibility $\mathbb{P}_{t+1}^{o_{1 \sim t}}$ that each next-step operation is the optimal according to $\mathbb{F}_{o_{1 \sim t}}$ . + +$$ +\mathbb {P} _ {t + 1} ^ {\sigma_ {1} \sim t} = \operatorname {s o f t m a x} \left(\mathbf {F C} \left(\mathbf {R N N} \left(\mathbb {E} _ {o _ {1}}, \dots , \mathbb {E} _ {o _ {t}}\right)\right)\right) \tag {4} +$$ + +$\mathbb{P}_{t + 1}^{o_{1}\sim t}\in \mathbb{R}^{|S_{t + 1}|}$ , where $S_{t + 1}$ denotes the set of operations in the next step, can guide us to explore more promising TP models, but may recommend invalid TP model design schemes due to ignorance of $\mathbf{R}_2$ restrictive relations among operations. In order to avoid invalid exploration and further improve the search efficiency, we construct a mask vector $\mathbb{M}_{t + 1}^{o_1\sim t}\in \mathbb{R}^{|S_{t + 1}|}$ for $\mathbb{P}_{t + 1}^{o_1\sim t}$ to shield out invalid next-step operations. Specifically, we identify $\mathbf{R}_2$ neighbors of $o_{1\sim t}$ from $S_{t + 1}$ , setting their mask values to 0 while keep the other values to 1, and thus obtain $\mathbb{M}_{t + 1}^{o_1\sim t}$ . With the help of $\mathbb{M}_{t + 1}^{o_1\sim t}$ , $\mathbb{P}_{t + 1}^{o_1\sim t}$ is modified to $\widetilde{\mathbb{P}_{t + 1}^{o_1\sim t}}$ , and thus RNN can filter out the effective operation options and obtain the next best operation more efficiently. + +$$ +\widetilde {\mathbb {P} _ {t + 1} ^ {o _ {1} \sim t}} = \operatorname {s o f t m a x} \left(\mathbb {M} _ {t + 1} ^ {o _ {1} \sim t} \cdot \mathbb {P} _ {t + 1} ^ {o _ {1} \sim t}\right) \tag {5} +$$ + +Repeat above steps, then a promising and valid TP model design scheme can be obtained. + +As for the model parameters $\theta$ involved in the GCN and RNN optimizer, we optimize their weights following the reinforce policy [10, 28]. + +$$ +\begin{array}{l} \nabla_ {\theta} \mathbb {E} _ {P (o _ {1 \sim 1 2}; \theta)} [ \mathrm {R e w a r d} ] \\ = \sum_ {t = 1} ^ {1 2} \mathbb {E} _ {P \left(o _ {1 \sim t}; \theta\right)} \left[ \nabla_ {\theta} \log \widetilde {\mathbb {P} _ {t} ^ {o _ {1 \sim t - 1}}} (\text {R e w a r d} - b) \right] \tag {6} \\ \end{array} +$$ + +where $b$ is an exponential moving average of the previous model rewards, and $Reward$ is the negative ADE score of the TP model generated by RNN optimizer. This reinforce strategy can effectively update the model weights by maximizing the expected benefits of the strategy, guiding our search strategy to recommend better TP models. + +# 3.2. Federated Training of the TP Model + +ATPFL needs to find suitable federated TP model training methods, to be able to work effectively and efficiently under the FL framework. + +Specifically, the optimal model search stage of ATPFL generally needs to evaluate many TP models, and requires a federated training method with fast convergence. In this way, ATPFL can distinguish TP models with different performances using few federated training epochs, and thus reducing evaluation cost and increasing search efficiency. In addition, the optimal TP model training stage of ATPFL requires the most effective federated training method. In this way, ATPFL can gain a more powerful TP model under the FL framework, further improving the final performance. + +Based on the above demands, we analyze the convergence speed and federated performance of three federated training methods, including FedAvg [19], Per-FedAvg [7] and pFedMe [6], on TP models, aiming to find appropriate ones to work for ATPFL. + +Three Federated Training Methods. Given a dataset $\mathbb{D} = \{D_1, \ldots, D_C\}$ that are distributed and non-shared across $C$ clients, federated training methods optimize the + +![](images/153d6528c57630a4ef9bd2d819c8fef825921f19110543f91c2583f90769bb20.jpg) +(a) Social-STGCNN Model + +![](images/7fa21d5bc36864f3f8501ee429be0e53dbd2d5964ef15e9325c04d22e86014c4.jpg) +(b) STGAT Model +Figure 3. Performance curves of different federated training methods on TP models and a federated TP dataset. We simulates this federated dataset by equally distributing trajectory data of ETH [23] and UCY [15] to 20 clients. + +global model weight $\mathbf{w}$ as follows. + +$$ +\nabla F (\mathbf {w}) = \frac {1}{C} \sum_ {i = 1} ^ {C} \nabla F _ {i} (\mathbf {w}) \tag {7} +$$ + +$$ +\mathbf {w} = \mathbf {w} + \eta \nabla F (\mathbf {w}) +$$ + +where $F_{i}(\mathbf{w})$ is the local training loss of client $i$ , and is calculated differently in different federated training methods. FedAvg directly considers $f_{i}(\mathbf{w})$ , i.e., the training loss of $\mathbf{w}$ on local dataset $D_{i}$ , as $F_{i}(\mathbf{w})$ : + +$$ +F _ {i} (\mathbf {w}) := f _ {i} (\mathbf {w}) \tag {8} +$$ + +Per-FedAvg uses personalized models to obtain $F_{i}(\mathbf{w})$ : + +$$ +F _ {i} (\mathbf {w}) := f _ {i} \left(\theta_ {i} (\mathbf {w})\right) = f _ {i} (\mathbf {w} - \alpha \nabla f _ {i} (\mathbf {w})) \tag {9} +$$ + +pFedMe generates more flexible personalized weights $\vartheta_{i}$ under the guidance of global weight $\mathbf{w}$ to measure $F_{i}(\mathbf{w})$ : + +$$ +F _ {i} (\mathbf {w}) := \min _ {\vartheta_ {i}} \left\{f _ {i} \left(\vartheta_ {i}\right) + \frac {\lambda}{2} \left\| \vartheta_ {i} - \mathbf {w} \right\| ^ {2} \right\} \tag {10} +$$ + +Features of Three Methods. We analyze the performance curves of above three methods on existing TP models (Figure 3 gives an example). We find that FedAvg coverage the fastest among them at the early training stage, and also achieves the best final performance among them. pFedMe and Per-FedAvg are not prominent in both convergence speed and federated performance, and thus not suitable for our ATPFL algorithm. These findings show us that powerful TP models heavily rely on abundant data sources, and personalized training methods, which pay more attention to the local data, do not help much in TP area. + +Based on these observations, we use FedAvg to quickly evaluate TP models during the TP model search stage of ATPFL, and train the optimal TP model in ATPFL. With its help, ATPFL can achieve better performance under FL framework. + +# 4. Experiments + +In this section, we examine the performance of ATPFL. We analyze the importance of federated training on TP models, and compare the AutoML part of ATPFL with existing AutoML algorithms (Section 4.2). In addition, ablation experiments are conducted to analyze the relation-sequence-aware search strategy designed in ATPFL (Section 4.3). All experiments are implemented using Pytorch. + +# 4.1. Experimental Setup + +Datasets. In order to evaluate the performance of our approach under FL framework, we construct a federated TP dataset $\mathbb{D}$ by equally distributing trajectory data of two publicly available datasets: ETH [23] and UCY [15], to 20 clients. The ETH dataset contains two scenes of real-world human trajectories, i.e., ETH and Hotel, each with 750 different pedestrians. The UCY dataset has 3 components: ZARA01, ZARA02 and UNIV, containing two scenes with 786 people. In total, our federated TP dataset $\mathbb{D}$ contains 5 sets of data with 4 different trajectory scenes. For each client, we hold the $60\%$ , $20\%$ , $20\%$ of its local dataset as the training set, validation set and test set, respectively. As for the evaluation of TP models under single-source datasets, we take ETH, Hotel, ZARA01, ZARA02 and UNIV as 5 single-source datasets applying the same split ratio. + +Evaluation Metrics. We use Average Displacement Error (ADE) [23] and Final Displacement Error (FDE) [1] to examine prediction errors of the TP models. + +$$ +\mathrm {A D E} = \frac {\sum_ {i \in \mathcal {P}} \sum_ {t = t _ {\mathrm {o b s}} + 1} ^ {t _ {\mathrm {p r e d}}} \left\| \left(\left(\hat {x} _ {t} ^ {i} , \hat {y} _ {t} ^ {i}\right) - \left(x _ {t} ^ {i} , y _ {t} ^ {i}\right)\right) \right\| _ {2}}{| \mathcal {P} | \cdot t _ {\mathrm {p r e d}}} \tag {11} +$$ + +$$ +\mathrm {F D E} = \frac {\sum_ {i \in \mathcal {P}} \left\| \left(\left(\hat {x} _ {t} ^ {i} , \hat {y} _ {t} ^ {i}\right) - \left(x _ {t} ^ {i} , y _ {t} ^ {i}\right)\right) \right\| _ {2}}{\left| \mathcal {P} \right|}, t = t _ {p r e d} +$$ + +where $\mathcal{P} = \{p_1, p_2, \ldots, p_N\}$ is the set of pedestrians, $(\hat{x}_t^i, \hat{y}_t^i)$ are the predicted coordinates at time $t$ and $(x_t^i, y_t^i)$ are the ground-truth coordinates. + +As for the final federated performance of TP models, we use the federated ADE/FDE score on test set to compare their performance under FL framework: + +$$ +\mathrm {A D E} _ {\mathbb {D} _ {\text {t e s t}}} = \sum_ {i = 1} ^ {C} \frac {\left| D _ {i , \text {t e s t}} \right|}{\left| \mathbb {D} _ {\text {t e s t}} \right|} \mathrm {A D E} (\mathcal {M}, D _ {i, \text {t e s t}}) \tag {12} +$$ + +where $D_{i,\mathrm{test}}$ is the test set of client $i$ , and $\mathbb{D}_{\mathrm{test}}$ denotes all test data in the federated TP dataset $\mathbb{D}$ . Replace $ADE$ to $FDE$ then we get $\mathrm{ADE}_{\mathbb{D}_{\mathrm{test}}}$ . + +Baselines. We compare ATPFL with two popular search strategies for AutoML: an RL search strategy that combines recurrent neural network controller [10] and EA-based search strategy for multi-objective optimization [5], and a commonly used baseline in AutoML, Random Search. + +Table 2. Performance comparison of ATPFL, AutoML algorithms and manually designed TP models. The first part examines the performance of existing TP models on single-source TP datasets. The second part compares different federated training methods on a TP model. The third part compares different AutoML methods under FL framework. Best-i denotes the $i^{st}$ best ADE score achieved by the clients. + +
FL MethodsTP ModelsADE/FDE on single-sorce dataset
AVGSTDMINMAXDatasets
ETHHotelUNIVZARA01ZARA02
NoneSocial-STGCNN0.78/1.060.4142 /0.70600.31/0.452.04/2.712.04/2.710.45/0.520.53/0.940.46/0.700.31/0.45
Social Ways1.07/1.881.4042 /3.99110.23/0.403.39/5.763.39/5.760.43/0.900.23/0.400.35/0.560.94/1.79
STGAT0.97/1.780.2421 /0.68980.65/1.271.94/3.411.94/3.410.68/1.280.68/1.260.89/1.670.65/1.27
SGCN0.38/0.580.0761 /0.15160.13/0.180.92/1.320.92/1.320.13/0.180.34/0.500.26/0.490.26/0.39
+ +
FL MethodsTP ModelsFederated ADE/FDE under FL framework
AVGSTDMINSTDBest-1Best-2Best-3Best-4Best-5
FedAvgSGCN0.32/0.590.0004 /0.00230.27/0.500.35/0.660.27/0.500.29/0.510.29/0.520.29/0.520.30/0.55
Per-FedAvgSGCN0.50/0.860.0013 /0.00460.42/0.730.55/0.980.42/0.730.44/0.760.45/0.780.46/0.790.47/0.79
pFedMeSGCN0.42/0.750.0005 /0.00220.37/0.650.46/0.830.37/0.650.38/0.670.39/0.690.40/0.710.41/0.71
+ +
FL MethodsAutoML MethodsFederated ADE/FDE under FL + AutoML framework
AVGSTDMINMAXBest-1Best-2Best-3Best-4Best-5
FedAvgRL0.40/0.650.0006 /0.00380.36/0.530.46/0.790.36/0.530.36/0.560.37/0.580.37/0.590.37/0.60
FedAvgEvolution0.57/1.140.0008 /0.00420.52/1.050.63/1.260.52/1.050.53/1.050.54/1.060.541/1.100.55/1.11
FedAvgRandom0.49/1.020.0008 /0.00510.45/0.890.55/0.110.45/0.890.46/0.920.46/0.920.47/0.930.47/0.96
FedAvgATPFL0.30/0.570.0003 /0.00290.27/0.460.35/0.650.27/0.460.28/0.470.28/0.480.28/0.510.28/0.53
+ +![](images/77e2f59b8258c24b2372851781a2b66f35770ba24600fbc2b40427e8bab961f7.jpg) +Figure 4. The federated performance of the optimal TP model searched by different AutoML algorithms. + +We replace the relation-sequence-aware strategy in ATPFL to these three search strategies, so as to examine their performance under TP models and FL framework. + +In addition, we take 4 state-of-the-art human-invented TP models: Social Ways [2], STGAT [13], NS [20] and SGCN [26], as baselines, to show the importance of automatic TP model design under FL framework. + +1. Social Ways: It uses a GAN to sample plausible predictions for any agent in the scene avoid mode collapsing and dropping. +2. STGAT: A spatial temporal graph attention network which based on a sequence-to-sequence architecture to predict future trajectories of pedestrians. +3. Social-STGCNN: It substitutes the need of aggregation methods by modeling the interactions as a graph. + +![](images/bbbde2d843e0cf35c87bcd4898168a83013f1b9af496aaa6fec11217a168230f.jpg) +Figure 5. Optimal TP model design scheme searched by ATPFL. + +4. SGCN: It models the sparse directed interaction and motion tendency with a sparse directed graph to improve the predicted trajectories. + +Implementation Details. In ATPFL, the embedding size and hidden size are set to 100. RNN optimizer is trained with the Adam optimizer with a learning rate of 3.5e-4. For each TP model candidate, we train it for 5 epochs using FedAvg. After ATPFL searches for 1.5 GPU days, we choose the best TP model that achieves the highest federated performance on validation datasets, and train it for 500 epochs using FedAvg. As for the compared AutoML algorithms, we follow implementation details reported in their papers, and control the running time of each AutoML algorithm to be the same. + +# 4.2. Performance Evaluation + +The performance of 4 AutoML algorithms under FL framework and 4 manually designed TP models are shown in Table 2 and Figure 4, and Figure 5 visualizes TP models searched by ATPFL algorithm. + +![](images/7ea1a0eb9585629bb4936c263d4651d13aa0fa530f0a75923606ecddaf2cbdc5.jpg) +Figure 6. The federated performance of the optimal TP model searched by different versions of ATPFL. + +We can observe from the third part of Table 2 and Figure 4 that ATPFL exceeds the other AutoML algorithms on the federated TP dataset, discovering more powerful TP models within the same search time. This result shows the effectiveness of our proposed algorithm and demonstrates the importance of considering the relations among operations in the TP search space. With the help of relation-sequence-aware search strategy, ATPFL can take full advantage of the relations among operations in the search space to avoid useless evaluations to improve search efficiency, and learn effective features of operations to further improve the prediction precision, thus providing good recommendation results more efficiently. + +In addition, we observe from the second and third part of Table 2 that TP models discovered by AutoML algorithms generally outperform existing human-invented TP models under FL framework. This result shows the practicability and validity of the automatic design of the TP model under FL framework. Our proposed ATPFL empowers non-experts to jointly deploy appropriate and powerful TP models, greatly reduces the labour of human experts, which is meaningful and practical. + +We also notice that federated training methods, especially FedAvg, can obtain a more powerful TP model, compared to the non-federated method. This result shows the importance of FL on TP area. The high performance of the TP model heavily relies on a large number of trajectory data with multiple scenes, and FL framework is essential for obtaining powerful TP models. + +# 4.3. Ablation Experiments + +We further investigate the effect of the GNN based embedding method and the masked RNN optimizer, two core components of our relation-sequence-aware search strategy, on the performance of ATPFL algorithm using the following two variants of ATPFL, thus verifying the innovations presented in this paper. + +1. ATPFL without mask: This version of ATPFL algo + +rithm removes the masking operation from the masked RNN optimizer. It ignores the restrictive relations among operations, assuming that all TP model design schemes contained in the search space are valid. + +2. ATPFL without GCN and mask: This version of ATPFL algorithm applies the RNN optimizer without the masking operation and replaces the GNN based embedding method to a common embedding layer. It ignores the multiple relations among operations in the search space, and does not apply GNN to extract high-level representations of the various operations. + +Corresponding results are shown in Figure 6, we can see that ATPFL has much better performance than ATPFL without mask. Owing to neglect of restrictive relations among operations in the search space, a great amount of invalid design schemes for the TP model are formed in ATPFL without mask. These noisy choices increase the search difficulty making ATPFL without mask less effective under the same search time. This result further demonstrates the importance of considering restrictive relations among operations when designing the AutoML tools for TP area, and the rationality of our proposed algorithm. + +Besides, we observe that ATPFL without GCN and mask performs much worse than ATPFL. This result shows us the significance and necessity of considering multiple relations among operations and using GNN technique in the ATPFL algorithm. GNN can extract high-level features of each operation in the search space by adaptively aggregating information from highly relevant operations, and thus providing a more rational basis for recommending an effective design scheme of the TP model. Therefore, applying the GNN technique in ATPFL is reasonable and effective. + +# 5. Conclusion and Future Works + +In this paper, we combine AutoML and FL techniques on the TP area, and propose ATPFL to help users to federate private and multiple-source trajectory datasets to automatically design and train powerful TP models. As we know, this is the first TP work that simultaneously breaks data island and technical limitations. Extensive experiments show that our designed search strategy and selected federated training methods are well suited to the TP area. They empower ATPFL to gain well-performed TP models under the FL framework, achieving better results than manually designed TP models trained on the single-source dataset. In future works, we will try to further enrich our search space, and design a more efficient search strategy for further improving the performance of ATPFL. + +# Acknowledgements + +This paper was supported by NSFC grant (U1866602). + +# References + +[1] Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social lstm: Human trajectory prediction in crowded spaces. In CVPR, pages 961–971, 2016. 2, 6 +[2] Javad Amirian, Jean-Bernard Hayet, and Julien Pettré. Social ways: Learning multi-modal distributions of pedestrian trajectories with gans. In CVPR, pages 0–0, 2019. 2, 3, 4, 7 +[3] Irwan Bello, Barret Zoph, Vijay Vasudevan, and Quoc V. Le. Neural optimizer search with reinforcement learning. In ICML, volume 70, pages 459-468. PMLR, 2017. 3 +[4] Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. Beyond low-frequency information in graph convolutional networks. In AAAI, pages 3950-3957. AAAI Press, 2021. 2, 4 +[5] Yukang Chen, Gaofeng Meng, Qian Zhang, Shiming Xiang, Chang Huang, Lisen Mu, and Xinggang Wang. RE-NAS: reinforced evolutionary neural architecture search. In CVPR, pages 4787-4796. Computer Vision Foundation / IEEE, 2019. 3, 6 +[6] Canh T Dinh, Nguyen H Tran, and Tuan Dung Nguyen. Personalized federated learning with moreau envelopes. arXiv preprint arXiv:2006.08848, 2020. 1, 2, 5 +[7] Alireza Fallah, Aryan Mokhtari, and Asuman Ozdaglar. Personalized federated learning: A meta-learning approach. arXiv preprint arXiv:2002.07948, 2020. 2, 5 +[8] Alireza Fallah, Aryan Mokhtari, and Asuman E. Ozdaglar. Personalized federated learning with theoretical guarantees: A model-agnostic meta-learning approach. In NeurIPS, 2020. 1 +[9] Jie Feng, Can Rong, Funing Sun, Diansheng Guo, and Yong Li. PMF: A privacy-preserving human mobility prediction framework via federated learning. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., 4(1):10:1-10:21, 2020. 2 +[10] Yang Gao, Hong Yang, Peng Zhang, Chuan Zhou, and Yue Hu. Graph neural architecture search. In Christian Bessiere, editor, IJCAI, pages 1403-1409. ijcai.org, 2020. 2, 3, 5, 6 +[11] Agrim Gupta, Justin Johnson, Li Fei-Fei, Silvio Savarese, and Alexandre Alahi. Social gan: Socially acceptable trajectories with generative adversarial networks. In CVPR, pages 2255–2264, 2018. 2 +[12] Ramtin Hosseini, Xingyi Yang, and Pengtao Xie. DSRNA: differentiable search of robust neural architectures. In CVPR, pages 6196-6205. Computer Vision Foundation / IEEE, 2021. 2, 3 +[13] Yingfan Huang, HuiKun Bi, Zhaoxin Li, Tianlu Mao, and Zhaoqi Wang. Stgat: Modeling spatial-temporal interactions for human trajectory prediction. In ICCV, pages 6272-6281, 2019. 1, 2, 3, 4, 7 +[14] Vineet Kosaraju, Amir Sadeghian, Roberto Martin-Martin, Ian Reid, S Hamid Rezatofighi, and Silvio Savarese. Socialbigat: Multimodal trajectory forecasting using bicyclegan and graph attention networks. arXiv preprint arXiv:1907.03395, 2019. 2 +[15] Alon Lerner, Yiorgos Chrysanthou, and Dani Lischinski. Crowds by example. In Computer graphics forum, volume 26, pages 655-664. Wiley Online Library, 2007. 6 + +[16] Junwei Liang, Lu Jiang, Juan Carlos Niebles, Alexander G Hauptmann, and Li Fei-Fei. Peeking into the future: Predicting future person activities and locations in videos. In CVPR, pages 5725–5734, 2019. 2 +[17] Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: differentiable architecture search. In ICLR. OpenReview.net, 2019.3 +[18] Nathalie Majcherczyk, Nishan Srishankar, and Carlo Pinciroli. Flow-fl: Data-driven federated learning for spatiotemporal predictions in multi-robot systems. In ICRA, pages 8836–8842. IEEE, 2021. 2 +[19] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics, pages 1273-1282. PMLR, 2017. 1, 2, 5 +[20] Abduallah Mohamed, Kun Qian, Mohamed Elhoseiny, and Christian Claudel. Social-stgcnn: A social spatio-temporal graph convolutional neural network for human trajectory prediction. In CVPR, pages 14424-14432, 2020. 1, 2, 3, 4, 7 +[21] Asaf Noy, Niv Nayman, Tal Ridnik, Nadav Zamir, Sivan Doveh, Itamar Friedman, Raja Giryes, and Lihi Zelnik. ASAP: architecture search, anneal and prune. In AISTATS, volume 108 of Proceedings of Machine Learning Research, pages 493-503. PMLR, 2020. 2, 3 +[22] Bo Pang, Tianyang Zhao, Xu Xie, and Ying Nian Wu. Trajectory prediction with latent belief energy-based model. In CVPR, pages 11814-11824. Computer Vision Foundation / IEEE, 2021. 3, 4 +[23] Stefano Pellegrini, Andreas Ess, Konrad Schindler, and Luc Van Gool. You'll never walk alone: Modeling social behavior for multi-target tracking. In 2009 IEEE 12th International Conference on Computer Vision, pages 261-268. IEEE, 2009. 6 +[24] Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Regularized evolution for image classifier architecture search. In AAAI, pages 4780-4789. AAAI Press, 2019. 3 +[25] Amir Sadeghian, Vineet Kosaraju, Ali Sadeghian, Noriaki Hirose, Hamid Rezatofighi, and Silvio Savarese. Sophie: An attentive gan for predicting paths compliant to social and physical constraints. In CVPR, pages 1349-1358, 2019. 2 +[26] Liushuai Shi, Le Wang, Chengjiang Long, Sanping Zhou, Mo Zhou, Zhenxing Niu, and Gang Hua. SGCN: sparse graph convolution network for pedestrian trajectory prediction. In CVPR, pages 8994-9003. Computer Vision Foundation / IEEE, 2021. 3, 4, 7 +[27] Dilin Wang, Meng Li, Chengyue Gong, and Vikas Chandra. Attentivenas: Improving neural architecture search via attentive sampling. In CVPR, pages 6418-6427. Computer Vision Foundation / IEEE, 2021. 2 +[28] Williams and J. Ronald. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229-256, 1992. 5 +[29] Yanyu Xu, Zhixin Piao, and Shenghua Gao. Encoding crowd interaction with deep neural network for pedestrian trajectory prediction. In CVPR, pages 5275-5284, 2018. 2 + +[30] Hao Xue, Du Q Huynh, and Mark Reynolds. Ss-lstm: A hierarchical LSTM model for pedestrian trajectory prediction. In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1186-1194. IEEE, 2018. 2 +[31] Q. Yang, Y. Liu, T. Chen, and Y. Tong. Federated machine learning: Concept and applications. ACM Transactions on Intelligent Systems and Technology, 10(2):1-19, 2019. 2 +[32] Pu Zhang, Wanli Ouyang, Pengfei Zhang, Jianru Xue, and Nanning Zheng. Sr-lstm: State refinement for LSTM towards pedestrian trajectory prediction. In CVPR, pages 12085-12094, 2019. 2 \ No newline at end of file diff --git a/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/images.zip b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b401ddbb6ffbdff0f4a1e8a5dad71351e536783a --- /dev/null +++ b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a157b19af87c8187d7b4f3336631ad1f48627c4114e7e4a308e0f0f841a03451 +size 624052 diff --git a/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/layout.json b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cd915d4082a54ea63d9e82f6b95eaefd62d8527e --- /dev/null +++ b/atpflautomatictrajectorypredictionmodeldesignunderfederatedlearningframework/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b70ce92fb8018f112fa6fe73b919b8f443a20b6475320a407edc748e374d76e9 +size 392645 diff --git a/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_content_list.json b/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..97d2945b048d3ae0ac953fb651b68ad18d8a7134 --- /dev/null +++ b/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7c8287b38f2bd106a8f8955fddcdbc0eac52a98323eb2b5cad73840a32a9349 +size 78838 diff --git a/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_model.json b/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_model.json new file mode 100644 index 0000000000000000000000000000000000000000..350b3cde326cb9db196f612ddbbc58fec5aa5154 --- /dev/null +++ b/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5411d31e03c630844a8ff062c12d0ba4ef0922476cec4314891ad731001ce1a9 +size 95371 diff --git a/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_origin.pdf b/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..212bbc6a17383d2f54d0089c42f25d2b3b286a03 --- /dev/null +++ b/aunifiedframeworkforimplicitsinkhorndifferentiation/6249775a-2255-4fc8-938f-6ab73eaa6a33_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:305ed0d48e4ec9ea1ae74215d4540eb6652a0bd20c79accad2e7686627d55b02 +size 5358932 diff --git a/aunifiedframeworkforimplicitsinkhorndifferentiation/full.md b/aunifiedframeworkforimplicitsinkhorndifferentiation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0e57ebb5115653c7b72a19859d33aaed6ab8a0d5 --- /dev/null +++ b/aunifiedframeworkforimplicitsinkhorndifferentiation/full.md @@ -0,0 +1,348 @@ +# A Unified Framework for Implicit Sinkhorn Differentiation + +Marvin Eisenberger*, Aysim Token*, Laura Leal-Taixe*, Florian Bernard†, Daniel Cremers* +Technical University of Munich*, University of Bonn† + +![](images/c11c3f558d360ae31d15647e86b76b8fd8b1de4499e69b08283e8512a570094a.jpg) +(a) Registration of two point clouds + +![](images/514e43e40c1302e057ccf0a60f959d0384d74f9a3da0fc34830cf5de373ff7c5.jpg) +Figure 1. The Sinkhorn operator is becoming a fundamental building block for various computer vision algorithms. Relevant applications include (a) point cloud registration, (b) interpolation on manifolds, (c) image clustering, and many more [13,25,39,46,47]. A recent trend to training respective neural networks efficiently is implicit differentiation [7, 11, 17, 22, 26]. In this work, we provide a framework of implicit Sinkhorn differentiation that generalizes existing methods. It is the first to derive analytical gradients for the Sinkhorn operator in its most general form, covering all the applications (a)-(c) shown above. + +![](images/ac9c55187f4bf1dae19f2875d79b4b49b5651e113eecd36f299f9c39bcc13cbd.jpg) +(b) Barycentric interpolation of distributions on a torus + +![](images/4aec89e8ff64810cffc971c0e038262820b648ea7e704640e59f4bcbd1d09617.jpg) + +![](images/f536e89e09a94cd5647b827637ba1fb46adee4b15067bd2e5dcfe300ba399859.jpg) + +![](images/a652a3d00918e8e8eb50bd06a7a6b1216862508024169b55514d2b7580363d43.jpg) + +![](images/a430150af15a519bd649080d8c93b025b6ad5ff1c4ea0bf0bcc675c415b4a460.jpg) +(c) MNIST clustering + +# Abstract + +The Sinkhorn operator has recently experienced a surge of popularity in computer vision and related fields. One major reason is its ease of integration into deep learning frameworks. To allow for an efficient training of respective neural networks, we propose an algorithm that obtains analytical gradients of a Sinkhorn layer via implicit differentiation. In comparison to prior work, our framework is based on the most general formulation of the Sinkhorn operator. It allows for any type of loss function, while both the target capacities and cost matrices are differentiated jointly. We further construct error bounds of the resulting algorithm for approximate inputs. Finally, we demonstrate that for a number of applications, simply replacing automatic differentiation with our algorithm directly improves the stability and accuracy of the obtained gradients. Moreover, we show that it is computationally more efficient, particularly when resources like GPU memory are scarce. + +# 1. Introduction + +Computing matchings and permutations is a fundamental problem at the heart of many computer vision and machine learning algorithms. Common applications include pose estimation, 3D reconstruction, localization, information transfer, ranking, and sorting, with data domains ranging from images, voxel grids, point clouds, 3D surface meshes to generic Euclidean features. A popular tool to address this is the Sinkhorn operator, which has its roots in the theory of entropy regularized optimal transport [9]. The + +Sinkhorn operator can be computed efficiently via a simple iterative matrix scaling approach. Furthermore, the resulting operator is differentiable, and can therefore be readily integrated into deep learning frameworks. + +A key question is how to compute the first-order derivative of a respective Sinkhorn layer in practice. The standard approach is automatic differentiation of Sinkhorn's algorithm. Yet, this comes with a considerable computational burden because the runtime of the resulting backward pass scales linearly with the number of forward iterations. More importantly, since the computation graph needs to be maintained for all unrolled matrix-scaling steps, the memory demand is often prohibitively high for GPU processing. + +A number of recent works leverage implicit gradients as an alternative to automatic differentiation [7, 11, 17, 22, 26] to backpropagate through a Sinkhorn layer. Although such approaches prove to be computationally inexpensive, a downside is that corresponding algorithms are less straightforward to derive and implement. Hence, many application works still rely on automatic differentiation [13, 25, 39, 46, 47]. Yet, the computational burden of automatic differentiation might drive practitioners to opt for an insufficiently small number of Sinkhorn iterations which in turn impairs the performance as we experimentally verify in Sec. 5. + +To date, existing work on implicit differentiation of Sinkhorn layers suffers from two major limitations: (i) Most approaches derive gradients only for very specific settings, i.e. specific loss functions, structured inputs, or only a subset of all inputs. Algorithms are therefore often not transferable to similar but distinct settings. (ii) Secondly, beyond their empirical success, there is a lack of an in-depth theoretical analysis that supports the use of implicit gradients. + +Our work provides a unified framework of implicit dif + +ferentiation techniques for Sinkhorn layers. To encourage practical adaptation, we provide a simple module that works out-of-the-box for the most general formulation, see Fig. 2. We can thus recover existing methods as special cases of our framework, see Tab. 1 for an overview. Our contribution can be summarized as follows: + +1. From first principles we derive an efficient algorithm for computing gradients of a generic Sinkhorn layer. +2. We provide theoretical guarantees for the accuracy of the resulting gradients as a function of the approximation error in the forward pass (Theorem 5). +3. Our PyTorch module can be applied in an out-of-the-box manner to existing approaches based on automatic differentiation. This often improves the quantitative results while using significantly less GPU memory. + +# 2. Related work + +There is a vast literature on computational optimal transport (OT) [33,43]. In the following, we provide an overview of related machine learning applications. Our approach is based on entropy regularized optimal transport pioneered by [9]. The resulting differentiable Sinkhorn divergence can be used as a loss function for training machine learning models [8, 16, 18]. To allow for first-order optimization, two common approaches for computing gradients are implicit differentiation [11, 22, 26] and automatic differentiation [1, 19]. Relevant applications of the Sinkhorn divergence include computing Wasserstein barycenters [10, 27, 41], dictionary learning [40], as well as using a geometrically meaningful loss function for autoencoders [31] or generative adversarial networks (GAN) [19, 37]. + +More recently, several approaches emerged that use the Sinkhorn operator as a differentiable transportation layer in a neural network. Potential applications include permutation learning [28, 38], ranking [2, 12], sorting via reinforcement learning [14], discriminant analysis [17] and computing matchings between images [39], point clouds [25,46,47] or triangle meshes [13, 29]. Most of these approaches rely on automatic differentiation of the Sinkhorn algorithm to address the resulting bilevel optimization problem. In our work, we follow the recent trend of using implicit differentiation for the inner optimization layer [3, 5, 20]. Other approaches compute the input cost matrix via Bayesian inverse modeling [42] or smooth the OT linear assignment problem (LAP) directly [34]. + +There are a number of methods that compute analytical gradients of a Sinkhorn layer, see Tab. 1 for an overview. The idea of our work is to provide a unifying framework that generalizes specific methods, as well as providing additional theoretical insights. The pioneering work of Luise et al. [26] computes gradients for the Sinkhorn divergence + +
Method∇[a;b]l∇xl∇ClLossObj.
Luiset al. [26]XXWassersteindual
Klattet al. [22]XXWassersteinprimal
Ablinet al. [1]XXWassersteindual
Flamaryet al. [17]XXDiscr. analysisprimal
Campbellet al. [7]Xanyprimal
Xieet al. [45]Xanydual
Cuturiet al. [11]Xanydual
Oursanyprimal
+ +Table 1. Overview of prior work. We provide an overview of related approaches that, like ours, derive implicit gradients of a Sinkhorn layer. For each method, we denote admissible inputs, i.e. which inputs are differentiated. In the most general case, we want to optimize both the marginals $\mathbf{a}$ and $\mathbf{b}$ and the cost matrix $\mathbf{C}$ defined in Sec. 3. As a special case, [11, 17] provide gradients $\nabla_{\mathbf{x}}\ell$ for low rank cost matrices of the form $C_{i,j}\coloneqq \| \pmb {x}_i - \pmb {y}_j\| _2^p$ . We furthermore denote which types of loss functions are permitted and whether gradients are derived via the primal or dual objective. + +loss, while optimizing for the marginals. [1] and [22] provide further theoretical analysis. Flamary et al. [17] compute explicit gradients for the application of discriminant analysis. However, they directly solve the linear system specified by the implicit function theorem which leads to an algorithmic complexity of $\mathcal{O}(n^6)$ . Similar to ours, [7] and [45] compute gradients of the cost matrix $C$ , but they assume constant marginals. The recent approach by Cuturi et al. [11] derives implicit gradients from the dual objective for the special case of low rank cost matrices $C(x,y)$ . + +# 3. Background + +Optimal transport. Optimal transport enables us to compute the distance between two probability measures on the same domain $\Omega \subset \mathbb{R}^d$ . In this work, we consider discrete probability measures $\mu \coloneqq \sum_{i=1}^{m} a_i \delta_{\boldsymbol{x}_i}$ and $\nu \coloneqq \sum_{j=1}^{n} b_j \delta_{\boldsymbol{y}_j}$ , defined over the sets of points $\{\boldsymbol{x}_1, \ldots, \boldsymbol{x}_m\}$ and $\{\boldsymbol{y}_1, \ldots, \boldsymbol{y}_n\}$ , where $\delta_{\boldsymbol{x}_i}$ is the Dirac measure at $\boldsymbol{x}_i$ . Such measures are fully characterized by the probability mass vectors $\boldsymbol{a} \in \Delta_m$ and $\boldsymbol{b} \in \Delta_n$ that lie on the probability simplex + +$$ +\Delta_ {m} = \left\{\boldsymbol {a} \in \mathbb {R} ^ {m} \mid a _ {i} \geq 0, \boldsymbol {a} ^ {\top} \mathbb {1} _ {m} = 1 \right\}, \tag {1} +$$ + +where $\mathbb{1}_m\in \mathbb{R}^m$ is the vector of all ones. We can then define the distance between $\mu$ and $\nu$ as + +$$ +d (\mu , \nu) := \min _ {\boldsymbol {P} \in \Pi (\boldsymbol {a}, \boldsymbol {b})} \langle \boldsymbol {P}, \boldsymbol {C} \rangle_ {F}. \tag {2} +$$ + +The transportation plan $P \in \Pi(a, b)$ determines a discrete probability measure on the product space $\{\pmb{x}_1, \dots, \pmb{x}_m\} \times \{\pmb{y}_1, \dots, \pmb{y}_n\}$ , whose marginal distributions coincide with $\mu$ and $\nu$ . Consequently, $P$ is contained in the transportation polytope $\Pi(a, b)$ defined as + +$$ +\Pi (\boldsymbol {a}, \boldsymbol {b}) := \left\{\boldsymbol {P} \in \mathbb {R} _ {+} ^ {m \times n} | \boldsymbol {P} \mathbb {1} _ {n} = \boldsymbol {a}, \boldsymbol {P} ^ {\top} \mathbb {1} _ {m} = \boldsymbol {b} \right\}. \tag {3} +$$ + +![](images/4be545780e64a0a02ea1bd89056bce9169c7137b9fcba862fbd929779c0af8ff.jpg) +Figure 2. Overview of a typical workflow with an embedded Sinkhorn layer. We consider a neural network whose inputs are e.g. images, 3D point clouds, voxel grids, surface meshes, etc. The Sinkhorn layer maps the cost matrix $\mathbf{C}$ and marginals $\mathbf{a}, \mathbf{b}$ to the transportation plan $\mathbf{P}$ via iterative matrix scaling. During training, we compute respective gradients $(\nabla_{\mathbf{C}}\ell, \nabla_{\mathbf{a}}\ell, \nabla_{\mathbf{b}}\ell)$ in closed form via implicit differentiation. Our algorithm applies to the most general formulation of the Sinkhorn operator: Both the cost matrix $\mathbf{C}$ and marginals $\mathbf{a}, \mathbf{b}$ are learnable and the whole network potentially contains learnable weights before and after the Sinkhorn layer. + +The cost matrix $C \in \mathbb{R}^{m \times n}$ specifies the transportation cost from individual points $\pmb{x}_i$ to $\pmb{y}_j$ . Choosing + +$$ +\boldsymbol {C} _ {i, j} := \left\| \boldsymbol {x} _ {i} - \boldsymbol {y} _ {j} \right\| _ {2} ^ {p} +$$ + +for $p \geq 1$ , e.g. yields the so-called Wasserstein distance $d(\cdot, \cdot) = W_p^p(\cdot, \cdot)$ , see [43]. + +Entropy regularization. Evaluating the distance $d(\mu, \nu)$ in practice requires solving the linear assignment problem (LAP) from Eq. (2). This can be done via specialized algorithms like the Hungarian algorithm [23] or the Auction algorithm [4], as well as recent solvers [32, 36]. However, most approaches are computationally heavy and slow in practice [9]. A popular alternative is augmenting the LAP objective in Eq. (2) with an additional entropy regularizer, giving rise to the Sinkhorn operator + +$$ +S _ {\lambda} (\boldsymbol {C}, \boldsymbol {a}, \boldsymbol {b}) := \underset {\boldsymbol {P} \in \Pi (\boldsymbol {a}, \boldsymbol {b})} {\arg \min } \left\langle \boldsymbol {P}, \boldsymbol {C} \right\rangle_ {F} - \lambda h (\boldsymbol {P}), \tag {4} +$$ + +where $\lambda > 0$ weights the regularization. The seminal work of Cuturi et al. [9] shows that the additional entropy regularization term $h(P) = -\sum_{i,j} P_{i,j} (\log P_{i,j} - 1)$ allows for an efficient minimization of Eq. (4). Specifically, this can be done via a scheme of alternating Sinkhorn projections + +$$ +\boldsymbol {S} _ {\lambda} ^ {(0)} := \exp \left(- \frac {1}{\lambda} \boldsymbol {C}\right), \quad \text {a n d} +$$ + +$$ +\boldsymbol {S} _ {\lambda} ^ {(t + 1)} := \mathcal {T} _ {c} \left(\mathcal {T} _ {r} \left(\boldsymbol {S} _ {\lambda} ^ {(t)}\right)\right). \tag {5} +$$ + +The operators $\mathcal{T}_c(S) := S \oslash (\mathbb{1}_m\mathbb{1}_m^\top S) \odot (\mathbb{1}_mb^\top)$ and $\mathcal{T}_r(S) := S \oslash (S\mathbb{1}_n\mathbb{1}_n^\top) \odot (a\mathbb{1}_n^\top)$ correspond to renormalizations of the columns and rows of $S_{\lambda}^{(t)}$ , where $\odot$ denotes the Hadamard product and $\oslash$ denotes element-wise division. As shown by [9], in the limit this scheme converges + +to a minimizer $S_{\lambda}^{(t)} \xrightarrow{t \to \infty} S_{\lambda}$ of Eq. (4). In practice, we can use a finite number of iterations $\tau \in \mathbb{N}$ to achieve a sufficiently small residual. + +# 4. Method + +# 4.1. Problem formulation + +Integrating the Sinkhorn operator from Eq. (4) into deep neural networks has become a popular tool for a wide range of practical tasks, see our discussion in Sec. 2. A major contributing factor is that the entropy regularization makes the mapping $S_{\lambda}:\mathbb{R}^{m\times n}\times \mathbb{R}^{m}\times \mathbb{R}^{n}\to \mathbb{R}^{m\times n}$ differentiable. To allow for first-order-optimization, we need to compute + +$$ +(\boldsymbol {C}, \boldsymbol {a}, \boldsymbol {b}) \quad \mapsto \quad \boldsymbol {P} ^ {*} := S _ {\lambda} (\boldsymbol {C}, \boldsymbol {a}, \boldsymbol {b}) \quad \text {a n d} \tag {6} +$$ + +$$ +\nabla_ {\boldsymbol {P}} \ell \quad \mapsto \quad (\nabla_ {\boldsymbol {C}} \ell , \nabla_ {\boldsymbol {a}} \ell , \nabla_ {\boldsymbol {b}} \ell), \tag {7} +$$ + +which denote the forward pass and the backpropagation of gradients, respectively. Those expressions arise in the context of a typical workflow within a deep neural network with a scalar loss $\ell$ and learnable parameters before and/or after the Sinkhorn operator $S_{\lambda}$ , see Fig. 2 for an overview. + +A common strategy is to replace the exact forward pass $S_{\lambda}(C, a, b)$ in Eq. (6) by the approximate solution $S_{\lambda}^{(\tau)}$ from Eq. (5). Like the original solution in Eq. (4), $S_{\lambda}^{(\tau)}$ is differentiable w.r.t. $(C, a, b)$ . Moreover, the mapping $(C, a, b) \mapsto S_{\lambda}^{(\tau)}$ consists of a small number of matrix scaling operations that can be implemented in a few lines of code, see Eq. (5). + +# 4.2. Backward pass via implicit differentiation + +The goal of this section is to derive the main result stated in Theorem 3, which is the key motivation of our algorithm + +in Sec. 4.3. To this end, we start by reframing the optimization problem in Eq. (4) in terms of its Karush-Kuhn-Tucker (KKT) conditions, see Appendix C.1 for a proof: + +Lemma 1. The transportation plan $\pmb{P}^{*}$ is a global minimum of Eq. (4) iff $\mathcal{K}(c, a, b, p^{*}, \alpha^{*}, \beta^{*}) = \mathbf{0}_{l}$ , with + +$$ +\mathcal {K} (\cdot) := \left[ \begin{array}{c} \boldsymbol {c} + \lambda \log \left(\boldsymbol {p} ^ {*}\right) + \mathbb {1} _ {n} \otimes \boldsymbol {\alpha} ^ {*} + \beta^ {*} \otimes \mathbb {1} _ {m} \\ \left(\mathbb {1} _ {n} ^ {\top} \otimes \boldsymbol {I} _ {m}\right) \boldsymbol {p} ^ {*} - \boldsymbol {a} \\ \left(\boldsymbol {I} _ {n} \otimes \mathbb {1} _ {m} ^ {\top}\right) \boldsymbol {p} ^ {*} - \boldsymbol {b} \end{array} \right] \tag {8} +$$ + +where $l \coloneqq mn + m + n$ . Here, $\alpha^{*} \in \mathbb{R}^{m}$ and $\beta^{*} \in \mathbb{R}^{n}$ are the dual variables corresponding to the two equality constraints in Eq. (3). We further define $\pmb{c}, \pmb{p}^{*} \in \mathbb{R}^{mn}$ as the vectorized versions of $\pmb{C}, \pmb{P}^{*} \in \mathbb{R}^{m \times n}$ , respectively, and assume $\log(p) \coloneqq -\infty, p \leq 0$ . + +Establishing this identity is an important first step towards computing a closed-form gradient for the backward pass in Eq. (7). It reframes the optimization problem in Eq. (4) as a root-finding problem $\mathcal{K}(\cdot) = 0$ . In the next step, this then allows us to explicitly construct the derivative of the Sinkhorn operator $S_{\lambda}(\cdot)$ via implicit differentiation, see Appendix C.2 for a proof: + +Lemma 2. The KKT conditions in Eq. (8) implicitly define a continuously differentiable function $(\pmb {c},\pmb {a},\tilde{\pmb{b}})\mapsto (\pmb {p},\pmb {\alpha},\tilde{\pmb{\beta}})$ with the Jacobian $\pmb {J}\in \mathbb{R}^{(l - 1)\times (l - 1)}$ being + +$$ +\boldsymbol {J} := \frac {\partial [ \boldsymbol {p} ; \boldsymbol {\alpha} ; \tilde {\boldsymbol {\beta}} ]}{\partial [ \boldsymbol {c} ; - \boldsymbol {a} ; - \tilde {\boldsymbol {b}} ]} = - \underbrace {\left[ \begin{array}{l l} \lambda \operatorname {d i a g} (\boldsymbol {p}) ^ {- 1} & \tilde {\boldsymbol {E}} \\ \tilde {\boldsymbol {E}} ^ {\top} & \boldsymbol {0} \end{array} \right] ^ {- 1}} _ {:= K}. \tag {9} +$$ + +For brevity we use the short hand notation $[\pmb{v};\pmb{u}]\coloneqq [\pmb{v}^{\top},\pmb{u}^{\top}]^{\top}$ for stacking vectors $\pmb {v},\pmb{u}$ vertically. Note that the last entry of $\tilde{\pmb{b}}\coloneqq \pmb{b}_{-n}$ and $\tilde{\beta}\coloneqq \beta_{-n}$ is removed. This is due to a surplus degree of freedom in the equality conditions from Eq. (3), see part (b) of the proof. Likewise, for + +$$ +\boldsymbol {E} = \left[ \begin{array}{l l} \mathbb {1} _ {n} \otimes \boldsymbol {I} _ {m} & \boldsymbol {I} _ {n} \otimes \mathbb {1} _ {m} \end{array} \right] \in \mathbb {R} ^ {m n \times (m + n)}, \tag {10} +$$ + +the last column is removed $\pmb{\tilde{E}}\coloneqq \pmb{E}_{:, - (m + n)}$ + +In principle, we can use Lemma 2 directly to solve Eq. (7). However, the computational cost of inverting the matrix $\pmb{K}$ in Eq. (9) is prohibitive. In fact, even storing the Jacobian $\pmb{J}$ in the working memory of a typical machine is problematic, since it is a dense matrix with $\mathcal{O}(mn)$ rows and columns, where $m, n > 1000$ in practice. Instead, we observe that computing Eq. (7) merely requires us to compute vector-Jacobian products (VJP) of the form $v^\top J$ . The main results from this section can therefore be summarized as follows, see Appendix C.3 for a proof: + +Theorem 3 (Backward pass). For $\mathbf{P} = \mathbf{P}^{*}$ , the backward pass in Eq. (7) can be computed in closed form by solving the following linear system: + +$$ +\left[ \begin{array}{c c} \lambda \operatorname {d i a g} (\boldsymbol {p}) ^ {- 1} & \tilde {\boldsymbol {E}} \\ \tilde {\boldsymbol {E}} ^ {\top} & \mathbf {0} \end{array} \right] \left[ \begin{array}{c} \nabla_ {c} \ell \\ - \nabla_ {[ \boldsymbol {a}; \tilde {\boldsymbol {b}} ]} \ell \end{array} \right] = \left[ \begin{array}{c} - \nabla_ {\boldsymbol {p}} \ell \\ \mathbf {0} \end{array} \right]. \tag {11} +$$ + +# 4.3. Algorithm + +In the previous section, we derived a closed-form expression of the Sinkhorn backward pass in Theorem 3. This requires solving the sparse linear system in Eq. (11), which has $\mathcal{O}(mn)$ rows and columns, and thus amounts to a worst-case complexity of $\mathcal{O}(m^3 n^3)$ [17]. We can further reduce the computation cost by exploiting the specific block structure of $K$ , which leads to the following algorithm: + +Algorithm 1: Sinkhorn operator backward +Input: $\nabla_P\ell ,P,a,b$ Output: $\nabla_{C}\ell ,\nabla_{a}\ell ,\nabla_{b}\ell$ +1 $T\gets P\odot \nabla_{P}\ell$ +2 $\tilde{T}\gets T_{:, - n},\tilde{P}\gets P_{:, - n}\in \mathbb{R}^{m\times n - 1}.$ +3 $t^{(a)}\gets T\mathbb{1}_n,\tilde{t}^{(b)}\gets \tilde{T}^{\top}\mathbb{1}_m.$ +4 $\left[ \begin{array}{c}\nabla_{a}\ell \\ \nabla_{\tilde{b}}\ell \end{array} \right]\gets \left[ \begin{array}{cc}\mathrm{diag}(a) & \tilde{P}\\ \tilde{P}^\top & \mathrm{diag}(\tilde{b}) \end{array} \right]^{-1}\left[ \begin{array}{c}t^{(a)}\\ \tilde{t}^{(b)} \end{array} \right].$ +5 $\nabla_{b}\ell \gets [\nabla_{\tilde{b}}\ell ;0]$ +6 $U\gets \nabla_{a}\ell \mathbb{1}_{n}^{\top} + \mathbb{1}_{m}\nabla_{b}\ell^{\top}.$ +7 $\nabla_C\ell \gets -\lambda^{-1}(T - P\odot U).$ + +See Appendix A for a PyTorch implementation of this algorithm. Most methods listed in Tab. 1 consider a special case of the functional specified in Eq. (4). The resulting gradients of Algorithm 1 are thereby, for the most part, consistent with such specialized approaches. We now show that the resulting gradients $\nabla_{C}\ell, \nabla_{a}\ell, \nabla_{b}\ell$ from Algorithm 1 are indeed solutions of the linear system in Theorem 3. + +Theorem 4. Let $\mathbf{a}, \mathbf{b}$ be two input marginals and $P = P^{*}$ the transportation plan resulting from the forward pass in Eq. (6), then Algorithm 1 solves the backward pass Eq. (7). + +Sketch of the proof. The main idea of this proof is showing that Algorithm 1 yields a solution $\nabla_{[c;a,\tilde{b} ]}\ell$ of the linear system from Eq. (11). To that end, we leverage the Schur complement trick which yields the following two expressions: + +$$ +\nabla_ {[ \boldsymbol {a}; \tilde {\boldsymbol {b}} ]} \ell = \left(\tilde {\boldsymbol {E}} ^ {\top} \operatorname {d i a g} (\boldsymbol {p}) \tilde {\boldsymbol {E}}\right) ^ {- 1} \tilde {\boldsymbol {E}} ^ {\top} \operatorname {d i a g} (\boldsymbol {p}) \nabla_ {\boldsymbol {p}} \ell . \tag {12a} +$$ + +$$ +\nabla_ {\boldsymbol {c}} \ell = - \lambda^ {- 1} \left(\operatorname {d i a g} (\boldsymbol {p}) \nabla_ {\boldsymbol {p}} \ell - \operatorname {d i a g} (\boldsymbol {p}) \tilde {\boldsymbol {E}} \nabla_ {[ \boldsymbol {a}; \tilde {\boldsymbol {b}} ]} \ell\right). \tag {12b} +$$ + +In Appendix C.4 we further show that these two identities in their vectorized form are equivalent to Algorithm 1. $\square$ + +# 4.4. Practical considerations + +Error bounds. Theorem 4 proves that Algorithm 1 computes the exact gradients $\nabla_{C}\ell, \nabla_{a}\ell, \nabla_{b}\ell$ , given that $P = P^{*}$ is the exact solution of Eq. (4). In practice, the operator $S_{\lambda}$ in Eq. (6) is replaced by the Sinkhorn approximation + +$S_{\lambda}^{(\tau)}$ from Eq. (5) for a fixed, finite $\tau \in \mathbb{N}$ . This small discrepancy in the approximation $P = S_{\lambda}^{(\tau)} \approx P^{*}$ propagates to the backward pass as follows: + +Theorem 5 (Error bounds). Let $P^{*} \coloneqq S_{\lambda}(C, a, b)$ be the exact solution of Eq. (4) and let $P^{(\tau)} \coloneqq S_{\lambda}^{(\tau)}$ be the Sinkhorn estimate from Eq. (5). Further, let $\sigma_{+}, \sigma_{-}, C_{1}, C_{2}, \epsilon > 0$ , s.t. $\left\| P^{*} - P^{(\tau)} \right\|_{F} < \epsilon$ and that for all $P$ for which $\| P - P^{*} \|_{F} < \epsilon$ we have $\min_{i,j} P_{i,j} \geq \sigma_{-}$ , $\max_{i,j} P_{i,j} \leq \sigma_{+}$ and the loss $\ell$ has bounded derivatives $\left\| \nabla_{\pmb{p}} \ell \right\|_{2} \leq C_{1}$ and $\left\| \nabla_{\pmb{p}}^{2} \ell \right\|_{F} \leq C_{2}$ . For $\kappa = \| \tilde{\pmb{E}}^{\dagger} \|_{2}$ , where $\tilde{\pmb{E}}^{\dagger}$ indicates the Moore-Penrose inverse of $\tilde{\pmb{E}}$ , the difference between the gradients $\nabla_{C} \ell^{*}, \nabla_{a} \ell^{*}, \nabla_{b} \ell^{*}$ of the exact $P^{*}$ and the gradients $\nabla_{C} \ell^{(\tau)}, \nabla_{a} \ell^{(\tau)}, \nabla_{b} \ell^{(\tau)}$ of the approximate $P^{(\tau)}$ , obtained via Algorithm 1, satisfy + +$$ +\begin{array}{l} \left\| \nabla_ {[ \boldsymbol {a}; \boldsymbol {b} ]} \ell^ {*} - \nabla_ {[ \boldsymbol {a}; \boldsymbol {b} ]} \ell^ {(\tau)} \right\| _ {F} \leq \\ \kappa \sqrt {\frac {\sigma_ {+}}{\sigma_ {-}}} \left(\frac {1}{\sigma_ {-}} C _ {1} + C _ {2}\right) \| \boldsymbol {P} ^ {*} - \boldsymbol {P} ^ {(\tau)} \| _ {F} \tag {13a} \\ \end{array} +$$ + +$$ +\begin{array}{l} \left\| \nabla_ {\boldsymbol {C}} \ell^ {*} - \nabla_ {\boldsymbol {C}} \ell^ {(\tau)} \right\| _ {F} \leq \\ \lambda^ {- 1} \sigma_ {+} \left(\frac {1}{\sigma_ {-}} C _ {1} + C _ {2}\right) \| \boldsymbol {P} ^ {*} - \boldsymbol {P} ^ {(\tau)} \| _ {F}. \tag {13b} \\ \end{array} +$$ + +We provide a proof in Appendix C.5, as well as an empirical evaluation in Appendix B.1. + +Computation cost. In comparison to automatic differentiation (AD), the computation cost of Algorithm 1 is independent of the number of Sinkhorn iterations $\tau$ . For square matrices, $m = n$ , the runtime and memory complexities of AD are $\mathcal{O}(\tau n^2)$ . On the other hand, our approach has a runtime and memory complexity of $\mathcal{O}(n^3)$ and $\mathcal{O}(n^2)$ respectively. We show empirical comparisons between the two approaches in Sec. 5.1. Another compelling feature of our approach is that none of the operations in Algorithm 1 explicitly convert the matrices $P, \nabla_P \ell, \nabla_C \ell, \dots \in \mathbb{R}^{m \times n}$ into their vectorized form $p, \nabla_p \ell, \nabla_c \ell, \dots \in \mathbb{R}^{mn}$ . This makes it computationally more efficient since GPU processing favors small, dense matrix operations over the large, sparse linear system in Eq. (11). + +Marginal probability invariance. As discussed in Lemma 2, the last element of $\tilde{\pmb{b}}$ needs to be removed to make $\pmb{K}$ invertible. However, setting the last entry of the gradient $\nabla_{b_n}\ell = 0$ to zero still yields exact gradients: By definition, the full marginal $\pmb{b}$ is constrained to the probability simplex $\Delta_{n}$ , see Eq. (1). In practice, we apply an a priori softmax to $\pmb{b}$ (and analogously $\pmb{a}$ ). For some applications, $\pmb{b}$ can be assumed to be immutable, if we only want to learn the cost matrix $\pmb{C}$ and not the marginals $\pmb{a}$ and $\pmb{b}$ . Overall, this means that the gradient of $\pmb{b}$ is effectively indifferent to constant offsets of all entries, and setting $\nabla_{b_n}\ell = 0$ does not contradict the statement of Theorem 3. + +# 5. Experiments + +In Sec. 5.1, we empirically compare the computation cost of Algorithm 1 to automatic differentiation (AD). In Sec. 5.2 and Sec. 5.3, we show results on two common classes of applications where we want to learn the marginals $\mathbf{a}$ and the cost matrix $\mathbf{C}$ respectively. We assume a fixed GPU memory (VRAM) budget of 24GB – any setting that exceeds this limit is deemed out of memory (OOM). + +# 5.1. Computation cost + +We empirically compare the computation cost of our algorithm with the standard automatic differentiation approach, see Fig. 3. All results were computed on a single NVIDIA Quadro RTX 8000 graphics card. In practice, the computation cost of both approaches primarily depends on the parameters $m, n, \tau$ . It is for the most part indifferent to other hyperparameters and the actual values of $C, a, b$ . We therefore use random (log normal distributed) cost matrices $\ln C_{i,j} \sim \mathcal{N}(0,1)$ and uniform marginals $a = b = \frac{1}{n}\mathbb{1}_n$ with $m = n \in \{10, 100, 1000\}$ . For each setting, we report the cost of the forward and backward pass averaged over 1k iterations. Depending on $m, n$ , our approach is faster for $\tau \gtrsim 40, 50, 90$ iterations. Note that our backward pass is independent of the number of forward iterations $\tau$ . Finally, the memory requirements are dramatically higher for AD, since it needs to maintain the computation graph of all $\tau$ forward iterations. In practice, this often limits the admissible batch size or input resolution, see Sec. 5.2 and Sec. 5.3. + +# 5.2. Wasserstein barycenters + +The main idea of Barycenter computation is to interpolate between a collection of objects $\{\pmb{b}_1, \dots, \pmb{b}_k\} \subset \mathbb{R}^n$ as a convex combination with weights that lie on the probability simplex $\pmb{w} \in \Delta_k$ , see Eq. (1). Specifically, we optimize + +$$ +\boldsymbol {a} ^ {*} := \underset {\boldsymbol {a} \in \Delta_ {n}} {\arg \min } \sum_ {i = 1} ^ {k} w _ {i} d (\boldsymbol {a}, \boldsymbol {b} _ {i}) \quad \text {w i t h} \tag {14} +$$ + +$$ +d (\boldsymbol {a}, \boldsymbol {b}) := \min _ {\boldsymbol {P} \in \Pi (\boldsymbol {a}, \boldsymbol {b})} \left\langle \boldsymbol {P}, \boldsymbol {D} \right\rangle_ {F} - \lambda h (\boldsymbol {P}), \tag {15} +$$ + +where $D \in \mathbb{R}^{n \times n}$ denotes the squared pairwise distance matrix between the domains of $a$ and $b$ . We use the Adam optimizer [21] for the outer optimization in Eq. (14). The inner optimization Eq. (15) is a special case of Eq. (4). Overall, Eq. (14) allows us to compute geometrically meaningful interpolations in arbitrary metric spaces. We consider the explicit tasks of interpolating between images in Fig. 4 and functions on manifolds in Fig. 5. Note that there are a number of specialized algorithms that minimize Eq. (14) in a highly efficient manner [10, 27, 41]. In Appendix B.2, we further show how to apply the barycenter technique to image clustering on the MNIST dataset. + +![](images/8aabed4587bfb994d5a2a17af9fa1f8413e36946f94fe0d65ef04e61726a91f9.jpg) + +![](images/546432b89f1aa9c2303c852d82f083003e9eb6cba495ce10818777f5289decf4.jpg) +Figure 3. Computational complexity. We compare the runtime per iteration (top row) and GPU memory requirements (bottom row) of our approach (blue) and automatic differentiation (orange). We consider a broad range of settings with quadratic cost matrices of size $m = n \in \{10, 100, 1000\}$ and $\tau \in [10, 2000]$ Sinkhorn iterations. For the runtime, we show both the total time (solid lines) and the time of only the backward pass (dashed lines). Both ours and AD were implemented in the PyTorch [30] framework, where memory is allocated in discrete units, which leads to a large overlap for the minimum allocation size of 2MB (bottom row, left plot). + +![](images/e7799914d9acc692d848957f6c2829a87c506d21decd5ad2d335895265e04bcb.jpg) + +![](images/6d8a329360f129e6a0df6a223f8d8f837a45f4684b4d536b05137e07e6adaaf6.jpg) + +![](images/ebc9c0d2443ef903d6d3bfd4f3a53c1a7e3fe34ad238562e80f11bd02ca4ab0c.jpg) + +![](images/b24f9e05060fad3ee272bab179481d2b9d2a0a868b126e2293de435b87550aa8.jpg) + +![](images/1a117ec647897f52cab147b5d33bf5d775e616ef6150d74872e39fe50a560d68.jpg) +Figure 4. Wasserstein barycenter. A comparison between our method (top row) and AD (bottom row) on the application of image barycenter computation. In each cell, we show 5 centroids of 4 input images (corners) with bilinear interpolation weights. The predictions based on the proposed implicit gradients are more stable (providing more crisp interpolations), even for very few Sinkhorn iterations $\tau$ . Moreover, AD is out of memory for $\tau \geq 200$ . Here, the input images have a resolution of $n = 64^2$ and we set $\lambda = 0.002$ . + +# 5.3. Permutation learning and matching + +Number sorting. The Sinkhorn operator is nowadays a standard tool to parameterize approximate permutations within a neural network. One work that clearly demonstrates the effectiveness of this approach is the Gumbel-Sinkhorn (GS) method [28]. The main idea is to learn the natural ordering of sets of input elements $\{x_{1},\ldots ,x_{n}\}$ , see + +Appendix B.3 for more details. Here, we consider the concrete example of learning to sort real numbers from the unit interval $x_{i} \in [0,1]$ for $n \in \{200,500,1000\}$ numbers. We compare the implicit Sinkhorn module to the vanilla GS method in Fig. 6. Without further modifications, our method significantly decreases the error at test time, defined as the proportion of incorrectly sorted elements. + +![](images/17ebd8ee60ca116d97c9bfe90ca19b3e5ec2a3ffd9abd9f8cb49d0037a093683.jpg) +Figure 5. Manifold barycenter. We compute barycenters of two circular input distributions on the surface of a sphere (first row). Specifically, we compare the results of minimizing Eq. (14) with AD (second row) and implicit gradients (third row). The sphere is discretized as a triangular mesh with 5000 vertices. On this resolution, AD is out of memory for $\tau \geq 200$ Sinkhorn iterations whereas ours is still feasible for $\tau = 1000$ . The obtained interpolations produce the slightly elongated shape of an ellipse since the surface of the sphere has a constant positive Gaussian curvature. + +![](images/a55b3545d5f421a6eb424c47ac5a0e3b9cff52deca2024ccab462502b421da09.jpg) +Figure 6. Number sorting. We show that we can improve the Gumbel-Sinkhorn method [28] directly with Algorithm 1. Specifically, we consider the task of permutation learning to sort random number sequences of length $n \in \{200,500,1000\}$ , see [28, Sec 5.1] for more details. We replace AD in the GS network with implicit differentiation (blue curves) and compare the obtained results to the vanilla GS architecture (orange curves). Our approach yields more accurate permutations while using much less computational resources - GS is out of memory for $\tau > 200,100,50$ forward iterations, respectively. For all settings, we show the mean proportion of correct test set predictions (solid lines), as well as the 10 and 90 percentiles (filled areas). The curves are to some degree noisy, since individual results depend on a finite number of (random) test samples. Also, notice that the log-scale of the y-axis exaggerates small fluctuations for $\tau \geq 100$ . + +![](images/ed5089a170297167e27e1de2bd1f422c9c601b4c5672f7c69faac495ae69f761.jpg) + +![](images/2c0d906441a5107f2404dbc8e129b5fee3b4749aa1df6b2f8f1bdf5c4473169d.jpg) + +Point cloud registration. Several recent methods use the Sinkhorn operator as a differentiable, bijective matching layer for deep learning [13, 25, 39, 46, 47]. Here, we consider the concrete application of rigid point cloud registration [47] and show that we can improve the performance with implicit differentiation, see Tab. 2. While our results on the clean test data are comparable but slightly worse than + +the vanilla RPM-Net [47], our module generalizes more robustly to partial and noisy observations. This indicates that, since computing gradients with our method is less noisy than AD, it helps to learn a robust matching policy that is overall more consistent, see Fig. 7 for qualitative comparisons. We provide further details on the RPM-Net baseline and more qualitative results in Appendix B.3. + +
clean datapartialnoisy
90%80%70%σ = 0.001σ = 0.01σ = 0.1
Rot. MAE (↓)RPM0.029941.142747.184852.594518.588628.143643.1884
Ours0.13714.495511.051920.92741.02381.25482.2272
Trans. MAE (↓)RPM0.00020.17430.21260.24900.08480.11870.1770
Ours0.00150.04840.09950.15780.00960.01130.0171
Chamf. dist. (↓)RPM0.00054.34134.68294.95812.20773.04924.6935
Ours0.00540.54981.42912.20800.07830.12370.4562
+ +Table 2. Point cloud registration. We compare the quantitative performance of RPM-Net [47] and implicit differentiation on ModelNet40 [44]. The two architectures are identical except for the altered Sinkhorn module. For all results, we follow the training protocol described in [47, Sec. 6]. Moreover, we assess the ability of the obtained networks to generalize to partial and noisy inputs at test time. For the former, we follow [47, Sec. 6.6] and remove up to $70\%$ of the input point clouds from a random half-space. For the noisy test set, we add Gaussian white noise $\mathcal{N}(0,\sigma)$ with different variances $\sigma \in \{0.001, 0.01, 0.1\}$ . For all settings, we report the rotation and translation errors, as well as the Chamfer distance to the reference surface. The latter is scaled by a factor of $1e2$ for readability. + +![](images/e13c1dc91b72bccb57c1e6f962178e56bc6bdd02e4ee9943aba20d565b1d597f.jpg) +Figure 7. Point cloud registration. Qualitative comparisons of RPM-Net [47] and the improved version based on implicit differentiation. In each row, we show a different test pair with the input pose $X$ (1st column, blue), as well as the overlap of the reference pose $Y$ (orange) and the predicted pose (blue) for the clean, noisy, and partial settings. Both approaches work well for the clean data, but ours generalize more robustly to noisy and partial pairs. + +# 6. Conclusion + +We presented a unifying framework that provides analytical gradients of the Sinkhorn operator in its most general form. In contrast to more specialized approaches [7,11, 17,22,26], our algorithm can be deployed in a broad range of applications in a straightforward manner. Choosing the number of Sinkhorn iterations $\tau \in \mathbb{N}$ is generally subject to a trade-off between the computation cost and accuracy. The main advantage of implicit differentiation is that it proves to be much more scalable than AD, since the backward pass is independent of $\tau$ . Our experiments demonstrate that combining the implicit Sinkhorn module with existing approaches often improves the performance. We further provide theoretical insights and error bounds that quantify the accuracy of Algorithm 1 for noisy inputs. + +Limitations & societal impact In our view, one of the main limitations of Algorithm 1 is that AD results in a faster training time for very few iterations $\tau \approx 10$ . Whether this is offset by the empirically more stable training (see Sec. 5.2 and Sec. 5.3) has to be judged on a case-by-case basis. In terms of the societal impact, one of the major advantages of our method is that it reduces computation time and GPU memory demand of Sinkhorn layers within neural networks. It thereby has the potential to make such techniques more accessible to individuals and organizations with limited access to computational resources. + +# Acknowledgements + +This work was supported by the ERC Advanced Grant SIMULACRON and the Munich School for Data Science. + +# References + +[1] Pierre Ablin, Gabriel Peyré, and Thomas Moreau. Super-efficiency of automatic differentiation for functions defined as a minimum. In International Conference on Machine Learning, pages 32-41. PMLR, 2020. 2 +[2] Ryan Prescott Adams and Richard S Zemel. Ranking via Sinkhorn propagation. arXiv preprint arXiv:1106.1925, 2011. 2 +[3] Brandon Amos and J Zico Kolter. Optnet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning, pages 136-145. PMLR, 2017. 2 +[4] Dimitri P Bertsekas. A distributed algorithm for the assignment problem. Lab. for Information and Decision Systems Working Paper, MIT, 1979. 3 +[5] Mathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig, Stephan Hoyer, Felipe Llinares-López, Fabian Pedregosa, and Jean-Philippe Vert. Efficient and modular implicit differentiation. arXiv preprint arXiv:2105.15183, 2021. 2 +[6] Ethan D Bolker. Transportation polytopes. Journal of Combinatorial Theory, Series B, 13(3):251-262, 1972. 16 +[7] Dylan Campbell, Liu Liu, and Stephen Gould. Solving the blind perspective-n-point problem end-to-end with robust differentiable geometric optimization. In European Conference on Computer Vision, pages 244-261. Springer, 2020. 1, 2, 8 +[8] Lenaic Chizat, Pierre Roussillon, Flavien Léger, François-Xavier Vialard, and Gabriel Peyré. Faster Wasserstein distance estimation with the Sinkhorn divergence. Advances in Neural Information Processing Systems, 33, 2020. 2 +[9] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pages 2292-2300, 2013. 1, 2, 3, 11 +[10] Marco Cuturi and Arnaud Doucet. Fast computation of Wasserstein barycenters. In International conference on machine learning, pages 685-693. PMLR, 2014. 2, 5 +[11] Marco Cuturi, Olivier Teboul, Jonathan Niles-Weed, and Jean-Philippe Vert. Supervised quantile normalization for low-rank matrix approximation. arXiv preprint arXiv:2002.03229, 2020. 1, 2, 8 +[12] Marco Cuturi, Olivier Teboul, and Jean-Philippe Vert. Differentiable ranking and sorting using optimal transport. Advances in Neural Information Processing Systems, 32, 2019. 2 +[13] Marvin Eisenberger, Aysim Token, Laura Leal-Taixe, and Daniel Cremers. Deep shells: Unsupervised shape correspondence with optimal transport. In Advances in Neural Information Processing Systems, volume 33, pages 10491-10502. Curran Associates, Inc., 2020. 1, 2, 7, 11 +[14] Patrick Emami and Sanjay Ranka. Learning permutations with Sinkhorn policy gradient. arXiv preprint arXiv:1805.07010, 2018. 2 +[15] Sven Erlander and Neil F Stewart. The gravity model in transportation analysis: theory and extensions, volume 3. Vsp, 1990. 16 + +[16] Jean Feydy, Thibault Séjourne, François-Xavier Vialard, Shun-ichi Amari, Alain Trouve, and Gabriel Peyré. Interpolating between optimal transport and MMD using Sinkhorn divergences. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 2681–2690. PMLR, 2019. 2 +[17] Rémi Flamary, Marco Cuturi, Nicolas Courty, and Alain Rakotomamonjy. Wasserstein discriminant analysis. Machine Learning, 107(12):1923-1945, 2018. 1, 2, 4, 8 +[18] Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya-Polo, and Tomaso Poggio. Learning with a Wasserstein loss. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pages 2053–2061, 2015. 2 +[19] Aude Geneva, Gabriel Peyré, and Marco Cuturi. Learning generative models with Sinkhorn divergences. In International Conference on Artificial Intelligence and Statistics, pages 1608-1617. PMLR, 2018. 2 +[20] Stephen Gould, Richard Hartley, and Dylan Campbell. Deep declarative networks: A new hope. arXiv preprint arXiv:1909.04866, 2019. 2 +[21] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.5 +[22] Marcel Klatt, Carla Tameling, and Axel Munk. Empirical regularized optimal transport: Statistical theory and applications. SIAM Journal on Mathematics of Data Science, 2(2):419-443, 2020. 1, 2, 8 +[23] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83-97, 1955. 3, 11 +[24] Yann LeCun. The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998. 11 +[25] Liu Liu, Dylan Campbell, Hongdong Li, Dingfu Zhou, Xibin Song, and Ruigang Yang. Learning 2d-3d correspondences to solve the blind perspective-n-point problem. arXiv preprint arXiv:2003.06752, 2020. 1, 2, 7, 11 +[26] Giulia Luise, Alessandro Rudi, Massimiliano Pontil, and Carlo Ciliberto. Differential properties of Sinkhorn approximation for learning with Wasserstein distance. Advances in Neural Information Processing Systems, 31:5859-5870, 2018. 1, 2, 8 +[27] Giulia Luise, Saverio Salzo, Massimiliano Pontil, and Carlo Ciliberto. Sinkhorn barycenters with free support via Frank-Wolfe algorithm. Advances in Neural Information Processing Systems, 32:9322-9333, 2019. 2, 5 +[28] G Mena, J Snoek, S Linderman, and D Belanger. Learning latent permutations with Gumbel-Sinkhorn networks. In ICLR 2018 Conference Track, volume 2018. OpenReview, 2018. 2, 6, 7, 11, 12 +[29] Gautam Pai, Jing Ren, Simone Melzi, Peter Wonka, and Maks Ovsjanikov. Fast sinkhorn filters: Using matrix scaling for non-rigid shape correspondence with functional maps. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 384-393, 2021. 2 +[30] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming + +Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32:8026-8037, 2019. 6, 11 +[31] Giorgio Patrini, Rianne van den Berg, Patrick Forre, Marcello Carioni, Samarth Bhargav, Max Welling, Tim Genewein, and Frank Nielsen. Sinkhorn autoencoders. In Uncertainty in Artificial Intelligence, pages 733-743. PMLR, 2020. 2 +[32] Ofir Pele and Michael Werman. Fast and robust earth mover's distances. In 2009 IEEE 12th international conference on computer vision, pages 460-467. IEEE, 2009. 3 +[33] Gabriel Peyré, Marco Cuturi, et al. Computational optimal transport: With applications to data science. Foundations and Trends® in Machine Learning, 11(5-6):355-607, 2019. 2, 16 +[34] Marin Vlastelica Pogan, Anselm Paulus, Vit Musil, Georg Martius, and Michal Rolinek. Differentiation of black-box combinatorial solvers. In International Conference on Learning Representations, 2019. 2 +[35] 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. 11 +[36] Yossi Rubner, Leonidas J Guibas, and Carlo Tomasi. The earth mover's distance, multi-dimensional scaling, and color-based image retrieval. In Proceedings of the ARPA image understanding workshop, volume 661, page 668, 1997. 3 +[37] Tim Salimans, Dimitris Metaxas, Han Zhang, and Alec Radford. Improving gans using optimal transport. In 6th International Conference on Learning Representations, ICLR 2018, 2018. 2 +[38] Rodrigo Santa Cruz, Basura Fernando, Anoop Cherian, and Stephen Gould. Deeper: Visual permutation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3949-3957, 2017. 2 +[39] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4938-4947, 2020. 1, 2, 7, 11 +[40] Morgan A Schmitz, Matthieu Heitz, Nicolas Bonneel, Fred Ngole, David Coeurjolly, Marco Cuturi, Gabriel Peyré, and Jean-Luc Starck. Wasserstein dictionary learning: Optimal transport-based unsupervised nonlinear dictionary learning. SIAM Journal on Imaging Sciences, 11(1):643-678, 2018. 2 +[41] Justin Solomon, Fernando De Goes, Gabriel Peyre, Marco Cuturi, Adrian Butscher, Andy Nguyen, Tao Du, and Leonidas Guibas. Convolutional Wasserstein distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics (TOG), 34(4):1-11, 2015. 2, 5 +[42] Andrew M Stuart and Marie-Therese Wolfram. Inverse optimal transport. SIAM Journal on Applied Mathematics, 80(1):599-619, 2020. 2 +[43] Cédric Villani. Topics in optimal transportation. Number 58. American Mathematical Soc., 2003. 2, 3 + +[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. 8, 13, 15 +[45] Yujia Xie, Hanjun Dai, Minshuo Chen, Bo Dai, Tuo Zhao, Hongyuan Zha, Wei Wei, and Tomas Pfister. Differentiable top-k operator with optimal transport. arXiv preprint arXiv:2002.06504, 2020. 2 +[46] Lei Yang, Wenxi Liu, Zhiming Cui, Nenglun Chen, and Wenping Wang. Mapping in a cycle: Sinkhorn regularized unsupervised learning for point cloud shapes. In European Conference on Computer Vision, pages 455-472. Springer, 2020. 1, 2, 7, 11 +[47] Zi Jian Yew and Gim Hee Lee. RPM-net: Robust point matching using learned features. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 11824-11833, 2020. 1, 2, 7, 8, 11, 13, 15 \ No newline at end of file diff --git a/aunifiedframeworkforimplicitsinkhorndifferentiation/images.zip b/aunifiedframeworkforimplicitsinkhorndifferentiation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4fa764847214fcae5a4b22b2f8517d4699bd76a9 --- /dev/null +++ b/aunifiedframeworkforimplicitsinkhorndifferentiation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:542b6b482759e3232ccd89d87334db6313087ed866ce97f3a71800588f26e7bd +size 635039 diff --git a/aunifiedframeworkforimplicitsinkhorndifferentiation/layout.json b/aunifiedframeworkforimplicitsinkhorndifferentiation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0cb10291bc9609e6a0cbae0507e23e197e89f693 --- /dev/null +++ b/aunifiedframeworkforimplicitsinkhorndifferentiation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f08b537847e5530fc159e17f95a2d1c0436c6b3394805356734c07c5a8a2ced +size 464728 diff --git a/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_content_list.json b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d31c0c446ea2a99d09715e63880896deeb102225 --- /dev/null +++ b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24c8188a424a2d49a2ea19625e43b176f70025a495d9e7867f489dbaeb1de2e3 +size 89775 diff --git a/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_model.json b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1baefc2aa875555de91e74178f8f8b94e2da5c17 --- /dev/null +++ b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2526f27bcefd10ffac99857a6ebaadd56dea47e0fde36b80f47bd07157a46507 +size 112543 diff --git a/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_origin.pdf b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e9672ca1eed6f81df40aba095c9015550202c63b --- /dev/null +++ b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/fd368003-b2c5-4530-8307-bbaad17475b3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26364c639b27f82a7a503bbd4a0ca6eede2dd57623493b8838c62e386e55d834 +size 7602379 diff --git a/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/full.md b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/full.md new file mode 100644 index 0000000000000000000000000000000000000000..00ec7cdcf0209a9dff2fa0241d07ff7613558694 --- /dev/null +++ b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/full.md @@ -0,0 +1,453 @@ +# A Unified Model for Line Projections in Catadioptric Cameras with Rotationally Symmetric Mirrors + +Pedro Miraldo +Mitsubishi Electric Research Labs (MERL) +miraldo@merl.com + +Jose Pedro Iglesias Chalmers University of Technology jose.iglesias@chalmers.se + +# Abstract + +Lines are among the most used computer vision features, in applications such as camera calibration to object detection. Catadioptric cameras with rotationally symmetric mirrors are omnidirectional imaging devices, capturing up to a 360 degrees field of view. These are used in many applications ranging from robotics to panoramic vision. Although known for some specific configurations, the modeling of line projection was never fully solved for general central and non-central catadioptric cameras. We start by taking some general point reflection assumptions and derive a line reflection constraint. This constraint is then used to define a line projection into the image. Next, we compare our model with previous methods, showing that our general approach outputs the same polynomial degrees as previous configuration-specific systems. We run several experiments using synthetic and real-world data, validating our line projection model. Lastly, we show an application of our methods to an absolute camera pose problem. + +# 1. Introduction + +Catadioptric cameras are imaging devices combining general mirrors with perspective cameras, [41]. These systems are used to get up to a 360-degree field of view with a single image and are suitable for applications ranging from robotics to medical imaging. In theory, particular cases of catadioptric cameras can be modeled by the central perspective model $[3]^{1}$ . However, this modeling requires the use of specific mirrors and that the camera is perfectly aligned and at a specific distance concerning the mirror's positions. Therefore, even if possible in theory, as argued in [53], catadioptric camera systems are non-central cameras. + +Due to their non-linear distortions, modeling point and line projections in catadioptric systems are significantly more complex than in the perspective cameras. Researchers + +made a big effort to derive a unified model for the projection of points, firstly only for central systems, [4, 18], and for general configurations, central and non-central, [1, 2]. On the other hand, although solved for some particular configurations, e.g., [1, 4, 7, 8], a unified model for line projection was never proposed. + +Line projections have been used in many computer vision applications, such as: i) camera calibration [15, 28, 36, 46]; ii) epipolar geometry [5, 25, 31, 50, 52]; iii) the Structure-from-Motion, and pose estimation [12, 20, 26, 37, 43, 47]; iv) and 3D reconstruction [10, 19, 35, 38]. In all these examples, we assume the use of central systems. To develop a similar application using catadioptric systems, we need to derive the respective projection of straight lines. A couple of papers [35,56] are published on self-calibration of non-central catadioptric cameras using the epipolar geometry. However, the authors assume central approximations for computing epipolar lines, i.e., approximation of the projection of 3D lines by a central camera model. On the other hand, imaging models for representing any camera (central and non-central) have been proposed; see [24, 40, 49]. [51, 59] list the advantages of non-central cameras compared to central. For example, when using a non-central camera, a single image of the environment is enough to recover the line's 3D parameters, e.g., [11, 17, 29, 54]). + +This paper presents the first unified model for the projection of 3D straight lines in general catadioptric cameras with rotationally symmetric mirrors; central and non-central systems. In Tab. 1, we show the degrees of the polynomials of prior specifically-derived methods and some results obtained from our derivations. Next, we present the related work. Secs. 3 and 4 define the problem and derive the proposed unified model. Section 5 presents the experiments and Sec. 6 concludes the paper. + +# 2. Related Work + +This section shows the related work on modeling point and line projections in omnidirectional cameras for central and non-central systems. + +
System SetupCurve DegreePrevious?
Mirror TypeCamera PositionMirror ParametersCentral?
GeneralAnyA = *, B = *, C = *No6-
GeneralAxialA = *, B = *, C = *No6-
SphereAnyA = 1, B = 0, C = *No4[1]
ConeAxialA = -1, B = 0, C = 0No4[7,8]†
EllipsoidalAxialA = 2k/c32+2k, B = -2c3k/c32+2k, C = -c32k/2c32+4k + k/2No6-
EllipsoidalAt the foci, i.e., [0 0 c3]TA = 2k/c32+2k, B = -2c3k/c32+2k, C = -c32k/2c32+4k + k/2Yes2[4,18]
HyperboloidalAxialA = -2/k-2, B = 2c3/k-2, C = c32k/k-2 - c32k/2kNo6-
HyperboloidalAt the foci, i.e., [0 0 c3]TA = -2/k-2, B = 2c3/k-2, C = c32k/k-2 - c32k/2kYes2[4,18]
+ +Table 1. We show a small set of specific configurations representing the degrees of the implicit equations derived in this paper against the previous techniques when there is one. We note that previous methods only consider specific camera configurations in mirror parameters and camera position. The parameter $k$ in the table is a general mirror parameter representing central catadioptric cameras, as defined in [3]. $\dagger$ indicates these polynomial degrees are not directly derived in [7,8]. + +Points and central systems: This has been extensively studied for perspective cameras [25,31]. For the conditions derived in [3], [18] proposes a unified projection model for central omnidirectional cameras. This method uses a two projections pipeline. It first consists of projecting the points into a sphere, then projecting them into the image using a changed perspective projection model. [33] adapts this model and considers planar grids for a flexible calibration technique. Other well-known works on the image formation of omnidirectional systems consider projection approximations, such as [16,48]. [55] presents another interesting work. A point is projected into a line in the image, making it model-independent from distortion. + +Lines and central systems: Line projection for perspective cameras is well defined; see [25, 31]. We also find their modeling for central catadioptric systems. [18] is the first work exploring this problem. The authors follow the same two projections strategy used to project 3D points. In [4], the authors further explore this line projection problem. They present some relevant properties and their advantages in camera calibration. Some other authors focus on line projection fitting; see for example [6,9,32]. Table 1 lists current central solutions. + +Points and non-central systems: One of the first works addressing the image formation of non-central catadioptric cameras is [53], in which the authors use caustics on the modeling. Most authors use polynomials (implicit equations) to represent these 3D point projections at the mirror. [1] starts by proposing a polynomial equation of degree 6 to represent the projection of 3D points in axial noncentral catadioptric cameras (camera aligned with the mirrors axis of symmetry). This work is extended for general camera positions in [2], with a polynomial equation of degree 8. In [21-23], the authors follow a different approach. They notice that the problem could not be solved using + +closed-form operations and focus on defining efficient iterative techniques. + +Lines and non-central catadioptric: Analytical solutions to the line-image for non-central catadioptric cameras were only analyzed for two camera positions/mirror configurations. As in the latest works on modeling 3D projection of points, previous authors rely on modeling these projections using implicit equations in the form of polynomials. [1] proposes a solution to the 3D projection of lines into non-central catadioptric cameras with spherical mirrors. The authors obtain a 4-degree polynomial to represent the curve in the image. In [7, 8], the line projection model and their fitting for conical non-central catadioptric cameras are proposed. Concerning the model, the authors assume an axial system and get a 4-degree polynomial to represent the curve in the mirror. Other authors admit approximate solutions for this line projection. [14] study the projection of 3D lines using the Generalized Linear Camera model, showing good results for a small local window. Yang et al. [57] fit several lines using an approximate projection that makes use of a set of basis functions and a look-up table. Other authors present analytical solutions to different non-central systems; see [27, 34, 44, 58]. + +Unlike prior work, this paper offers a general and analytical model for the 3D projection of lines in the entire image space. Our solution can be used to model systems with any rotationally symmetric mirror and camera positions, i.e., central and non-central imaging devices. + +# 3. Problem Definition + +As in previous catadioptric image formation works, [1,4, 7,8,18], we use rotationally symmetric mirrors, represented by $\Omega (\mathbf{m}) = 0$ , where + +$$ +\Omega (\mathbf {m}) = x ^ {2} + y ^ {2} + A z ^ {2} + B z - C, \tag {1} +$$ + +![](images/b4540d52ac7e4d9c5f403d2918f7265c80537e5359edfb7065ea8055c47eee30.jpg) +Figure 1. Projection model: The input is a line in the world $(\mathbf{q}_w$ and a direction $\mathbf{d}_w$ ). The first step transforms the line parameters to the mirror's reference frame by applying a rigid transformation $\mathbf{R}_w \in \mathcal{SO}(3)$ and $\mathbf{c}_w \in \mathbb{R}^3$ (the rotation and world frame position of the mirror, respectively). Next, we map the 3D line from the world into the normalized image space. Last step applies a standard collineation between two projective planes; $\mathbf{H} = \mathbf{K}\mathbf{R}$ . + +and $\mathbf{m} = [xy]^T$ is a point on the mirror's surface. From (1), the normal vector at the mirror point $\mathbf{m}$ is given by + +$$ +\mathbf {n} (\mathbf {m}) = \nabla \Omega (\mathbf {m}) = \left[ \begin{array}{l l l} x & y & A z + B / 2 \end{array} \right] ^ {T}. \tag {2} +$$ + +Taking the perspective projection equation (see [25]), the image of a point in the mirror's surface is given by + +$$ +\zeta \left[ \begin{array}{l} u \\ v \\ 1 \end{array} \right] = \mathbf {K R} (\mathbf {m} - \mathbf {c}) \tag {3} +$$ + +where $\mathbf{K} \in \mathbb{R}^{3 \times 3}$ represents the camera intrinsics. $[u v]$ are an image point in pixel coordinates. $\mathbf{R} \in \mathcal{SO}(3)$ and $\mathbf{c} \in \mathbb{R}^3$ are the rotation of the camera and its center with respect to the mirror's reference frame, respectively. As in [1], without loss of generality, given its symmetry, one can rotate the mirror's coordinate system, getting $\mathbf{c} = [0 c_2 c_3]^T$ . + +To represent lines, we use a point $\mathbf{q} \in \mathbb{R}^3$ and a direction $\mathbf{s} \in \mathbb{R}^3$ ; any point on the line satisfies + +$$ +\mathbf {p} (\lambda) = \mathbf {q} + \lambda \mathbf {s}, \text {f o r a n y} \lambda \in \mathbb {R}. \tag {4} +$$ + +Given the high degrees of some polynomials in the paper, we use $\kappa_{i}^{j}[.]$ to denote the $i^{\mathrm{th}}$ polynomials $j^{\mathrm{th}}$ total degree $^2$ . + +We conclude this section by describing our problem: + +Problem 1 (Line projection). The projection of lines in general catadioptric cameras with rotationally symmetric mirrors is given by an implicit equation (in polynomial form), $\mathcal{I}(u,v)$ , with coefficients specified as a function of the $3D$ line, perspective camera, and mirror parameters. + +# 4. Line Projection in Catadioptric Cameras + +Figure 1 shows the projection model used for catadioptric cameras. As in [1,4], without loss of generality, we assume that the world reference frame is aligned with the mirror (i.e., $\mathbf{R}_w = \mathbf{I}$ and $\mathbf{c}_w = \mathbf{0}$ ). Then, this section focuses on mapping the line coordinates. + +![](images/6d169a9518f92eee2be4edd12b242e2dd561f7ea24bebb5f482bf549dd7ea824.jpg) +(a) Reflection Plane + +![](images/533a456e15cc2947fd54ce4e42d8a70c4d2a4dad1e5590676a3392959bfa2d6f.jpg) +(b) Snell Reflection Law +Figure 2. Projection constraints: At the left, we show the planar constraint defined by each point on the line, its reflection point on the mirror, and the perspective camera center. At the right, we show Snell's reflection constraint. The red curve in the images represents the line projection into the mirror. + +Consider a 3D line, $\mathbf{p}(\lambda)$ , represented in the mirror frame, as shown in (4). This section proposes a parametric representation for the line projection, $\mathcal{I}(u,v)$ ; i.e., solves Problem 1. We start by defining some basic projection constraints in Sec. 4.1. The algebraic line-reflection constraint we use to model line projections is derived in Sec. 4.2. Section 4.3 presents the parameterization of the projection curve in normalized image coordinates. To conclude, the implications on the application of the standard collineation is shown in Sec. 4.4 (affine transformation $\mathbf{H}$ in Fig. 1). + +# 4.1. Projection Constraints + +We use two basic properties of the catadioptric image formation for deriving the line-projection constraint (to be presented in the following subsection), see [2, 21]: + +Definition 1. A point on the line, $\mathbf{p}(\lambda)$ , its reflection point on the mirror, $\mathbf{m}(\lambda)$ , and the perspective camera's center of projection, $\mathbf{c}$ , define a plane $\Pi(\lambda)$ (see Fig. 2(a)); and + +Definition 2. The incoming and reflected rays, $\mathbf{d}_{p,m}(\lambda)$ (from $\mathbf{p}(\lambda)$ to $\mathbf{m}(\lambda)$ ) and $\mathbf{d}_{m,c}(\lambda)$ (from $\mathbf{m}(\lambda)$ to $\mathbf{c}$ ) respectively, in Fig. 2(b), must satisfy the Snell's law of reflection. + +We start with the plane constraint at Definition 1. Using the fact that $\mathbf{k}(\lambda) = \mathbf{m}(\lambda) + \mu \nabla \Omega (\mathbf{m})$ , for $\mu \in \mathbb{R}$ , is in the 3D plane and intersects the mirror's axis of symmetry at $\mu = -1$ , we write + +$$ +\mathbf {k} (\lambda) = \left[ \begin{array}{l l l} 0 & 0 & (1 - A) z - B / 2 \end{array} \right] ^ {T}. \tag {5} +$$ + +Now, stacking $\mathbf{m}(\lambda),\mathbf{k}(\lambda),\mathbf{c},$ and $\mathbf{p}(\lambda)$ , such that + +$$ +\mathbf {M} ^ {T} = \left[ \begin{array}{c c c c} \mathbf {m} (\lambda) & \mathbf {p} (\lambda) & \mathbf {k} (\lambda) & \mathbf {c} \\ 1 & 1 & 1 & 1 \end{array} \right], \tag {6} +$$ + +since all these points are on the same plane, a constraint is obtained; the determinant of $\mathbf{M}$ must be zero, $\mathcal{C}_1(\mathbf{m},\lambda) = \det (\mathbf{M}) = 0$ . By expanding the determinant of $\mathbf{M}$ , we describe the following Lemma: + +Lemma 1 (Plane reflection constraint). A 3D point on the line, $\mathbf{p}(\lambda)$ , verifying Definition 1 provides a constraint $\mathcal{C}_1(\mathbf{m},\lambda) = 0$ , such that + +$$ +\mathcal {C} _ {1} (\mathbf {m}, \lambda) \doteq \kappa_ {1} ^ {1} [ x, y ] \lambda z + \kappa_ {2} ^ {1} [ x, y ] z + \kappa_ {3} ^ {1} [ x, y ] \lambda + \kappa_ {4} ^ {1} [ x, y ]. \tag {7} +$$ + +Let us now focus on Definition 2. Taking the Snell reflection law and the fact that $\mathbf{d}_{p,m}(\lambda) \times \mathbf{d}_{p,m}(\lambda) = \mathbf{0}$ , after some simplifications, we obtain + +$$ +\begin{array}{l} \langle \mathbf {n} (\mathbf {m}), \mathbf {n} (\mathbf {m}) \rangle [ \mathbf {d} _ {p, m} (\lambda) ] _ {\mathrm {x}} \mathbf {d} _ {m, c} (\lambda) - \\ 2 \langle \mathbf {d} _ {m, c} (\lambda), \mathbf {n} (\mathbf {m}) \rangle [ \mathbf {d} _ {p, m} (\lambda) ] _ {\mathrm {x}} \mathbf {n} (\mathbf {m}) = \mathbf {0}, \tag {8} \\ \end{array} +$$ + +in which $[\mathbf{a}]_{\mathbf{x}}$ is a skew-symmetric matrix that linearizes the cross product, i.e., $\mathbf{a} \times \mathbf{b} = [\mathbf{a}]_{\mathbf{x}}\mathbf{b} = \mathbf{0}$ . In addition, by definition, we have + +$$ +\mathbf {d} _ {m, c} (\lambda) = \mathbf {m} (\lambda) - \mathbf {c}, \text {a n d} \mathbf {d} _ {p, m} (\lambda) = \mathbf {p} (\lambda) - \mathbf {m} (\lambda). \tag {9} +$$ + +Substituting (9) in (8), we get three algebraic constraints3 and define the following Lemma: + +Lemma 2 (Reflection law constraints). Definition 2 generates the following three algebraic constraints: + +$$ +\mathcal {C} _ {i + 1} (\mathbf {m}, \lambda) = \kappa_ {3 + 2 i} ^ {3} [ x, y, z ] \lambda + \kappa_ {4 + 2 i} ^ {4} [ x, y, z ], \quad i = 1, 2, 3. \tag {10} +$$ + +Next, we define the line reflection constraint, which will use for modeling the 3D line projection. + +# 4.2. Line-Reflection Constraint + +Line projection does not depend on the depth of the point on the line, i.e., $\lambda$ . To define the line-reflection constraint, we use Lemmas 1 and 2 to get a constraint as a function of only $x$ , $y$ and $z$ . We start by taking $\mathcal{C}_2(\mathbf{m}, \lambda) = 0$ , from Lemma 1, and solve it as a function of $\lambda$ : + +$$ +\lambda = - \frac {\kappa_ {2} ^ {1} [ x , y ] z + \kappa_ {4} ^ {1} [ x , y ]}{\kappa_ {1} ^ {1} [ x , y ] z + \kappa_ {3} ^ {1} [ x , y ]}. \tag {11} +$$ + +Now, taking Lemma 2, we substitute the $\lambda$ from (11) at (10), and pre-multiply the resulting equations by the denominator of (11). We obtain $\widetilde{C}_{i+1}(\mathbf{m}) = 0$ such that + +$$ +\widetilde {\mathcal {C}} _ {i + 1} (\mathbf {m}) = \kappa_ {1 1} ^ {2} [ x, y, z ] \kappa_ {1 1 + i} ^ {4} [ x, y, z ], \quad i = 1, 2, 3. \tag {12} +$$ + +We note that (12) contain two polynomial factors of degrees 2 and 4, where the former depends only on the mirror and camera's parameters. These lower degree polynomial factors are thus considered a system singularity and disregarded, leaving $\widetilde{C}_{i+1}(\mathbf{m})$ as a 4 degree polynomial. The degree of $\widetilde{C}_{i+1}(\mathbf{m})$ can be further decreased by replacing $z^2$ by $C - x^2 - y^2 - Bz$ . Doing this turns all 3 constraints at (12) linear dependent. Taking one, we describe the following theorem: + +Theorem 1 (Line-reflection constraint). The Line-Reflection constraint is given by the points in the mirror with coordinates $x$ , $y$ and $z$ verifying the algebraic constraints $C_{lr}(\mathbf{m}) = 0$ , such that + +$$ +\mathcal {C} _ {l r} (\mathbf {m}) = \kappa_ {1 5} ^ {2} [ x, y ] z + \kappa_ {1 6} ^ {3} [ x, y ]. \tag {13} +$$ + +Although not needed to define the 3D line projection into the image, Thm. 1 can be used to represent the 3D line reflection curve in the mirror: + +Remark 1 (3D reflection curve on the mirror). Taking the point on the mirror constraint $\Omega(x, y, z) = 0$ , the line reflection constraint $\mathcal{C}_{lr}(\mathbf{m}) = 0$ in Thm. 1, and $z\mathcal{C}_{lr}(\mathbf{m}) = 0$ , we define + +$$ +\underbrace {\left[ \begin{array}{c c c} A & B & x ^ {2} + y ^ {2} - C \\ 0 & \kappa_ {1 5} ^ {2} [ x , y ] & \kappa_ {1 6} ^ {3} [ x , y ] \\ \kappa_ {1 5} ^ {2} [ x , y ] & \kappa_ {1 6} ^ {3} [ x , y ] & 0 \end{array} \right]} _ {\mathbf {N}} \left[ \begin{array}{l} z ^ {2} \\ z \\ 1 \end{array} \right] = \mathbf {0}. \tag {14} +$$ + +With this, we define a constraint $\mathcal{R}(x,y) = \det(\mathbf{N}) = 0$ , which is a 6-degree polynomial equation, parametrizing the reflection curve as a function of $x$ and $y$ . To get the respective $z$ for modeling the 3D curve on the mirror, we solve (13), for a known $\{x,y\}$ . + +Combining our line-reflection constraint, the mirror equation, and the perspective projection model, we obtain bi-variable polynomials that implicitly parameterize the projection curve of the 3D line on the image plane. These derivations are given in the following subsections. + +# 4.3. Modeling Line Projection + +Here, we use the mirror's equation, (1), the line-reflections constraint (13), and the projection into the normalized plane: + +$$ +\left[ \begin{array}{l} \tilde {u} \\ \tilde {v} \\ 1 \end{array} \right] \times (\mathbf {m} - \mathbf {c}) = \mathbf {0}, \tag {15} +$$ + +which is obtained from (3) without the last collineation step; i.e., without the application of the transformation $\mathbf{H}$ (see Fig. 1). Notice that $\xi$ was removed from the camera equation (see (3)) by considering the cross product of $[\widetilde{u} \widetilde{v} 1]^T$ on both sides. This operation provides two linearly independent equations that can be used to write $x$ and $y$ as a function of $\widetilde{u}, \widetilde{v}$ and $z$ : + +$$ +x = \frac {\kappa_ {1 9} ^ {2} [ \widetilde {u} , \widetilde {v} , z ]}{\kappa_ {1 8} ^ {1} [ \widetilde {u} , \widetilde {v} ]}, \text {a n d} y = \frac {\kappa_ {2 1} ^ {2} [ \widetilde {u} , \widetilde {v} , z ]}{\kappa_ {2 0} ^ {1} [ \widetilde {u} , \widetilde {v} ]}. \tag {16} +$$ + +Plugging (16) into $\Omega (\mathbf{m})$ and $\mathcal{C}_{tr}(\mathbf{m})$ gives + +$$ +\widetilde {\Omega} [ \widetilde {u}, \widetilde {v}, z ] = \kappa_ {2 2} ^ {2} [ \widetilde {u}, \widetilde {v} ] z ^ {2} + \kappa_ {2 3} ^ {2} [ \widetilde {u}, \widetilde {v} ] z + \kappa_ {2 4} ^ {2} [ \widetilde {u}, \widetilde {v} ], \tag {17} +$$ + +$$ +\widetilde {\mathcal {C}} _ {l r} [ \widetilde {u}, \widetilde {v}, z ] = \kappa_ {2 5} ^ {5} [ \widetilde {u}, \widetilde {v} ] z + \kappa_ {2 6} ^ {5} [ \widetilde {u}, \widetilde {v} ], \tag {18} +$$ + +where in $\tilde{C}_{lr}[\widetilde{u},\widetilde{v},z]$ we have replaced $z^2$ by $-( \kappa_{23}^2 [\widetilde{u},\widetilde{v}]z + \kappa_{24}^2 [\widetilde{u},\widetilde{v} ]) / \kappa_{22}^2 [\widetilde{u},\widetilde{v} ]$ + +Now, to get the line in the image space, we want to remove $z$ from the constraints. Taking (17), (18), and $z\widetilde{C}_{lr}[\widetilde{u},\widetilde{v},z] = 0$ , we setup the following algebraic equation: + +$$ +\underbrace {\left[ \begin{array}{c c c} \kappa_ {2 2} ^ {2} [ \widetilde {u} , \widetilde {v} ] & \kappa_ {2 3} ^ {2} [ \widetilde {u} , \widetilde {v} ] & \kappa_ {2 4} ^ {2} [ \widetilde {u} , \widetilde {v} ] \\ 0 & \kappa_ {2 5} ^ {5} [ \widetilde {u}, \widetilde {v} ] & \kappa_ {2 6} ^ {5} [ \widetilde {u}, \widetilde {v} ] \\ \kappa_ {2 5} ^ {5} [ \widetilde {u}, \widetilde {v} ] & \kappa_ {2 6} ^ {5} [ \widetilde {u}, \widetilde {v} ] & 0 \end{array} \right]} _ {\mathbf {N} \in \mathbb {R} ^ {3 \times 3}} \left[ \begin{array}{l} z ^ {2} \\ z \\ 1 \end{array} \right] = \mathbf {0}. \tag {19} +$$ + +For (19) to be true, the determinant of $\mathbf{N}$ must be zero. Then, by computing $\operatorname*{det}(\mathbf{N})$ , after some simplifications, we get a polynomial of maximum degree 6, which we use to describe the following Theorem: + +Theorem 2 (Projection curve on the normalized plane). The projection curve on the normalized plane of a 3D line is given by + +$$ +\widetilde {\mathcal {I}} (\widetilde {u}, \widetilde {v}) = 0, \tag {20} +$$ + +where $\widetilde{\mathcal{I}} (\widetilde{u},\widetilde{v})$ is a polynomial of maximum degree 6. + +With respect to the degree of $\widetilde{\mathcal{L}} (\widetilde{u},\widetilde{v})$ , we define the following remark: + +Remark 2. The degree of $\widetilde{\mathcal{I}} (\widetilde{u},\widetilde{v})$ is lower for some specific system configurations. For instance, for spherical and conical systems the degree of $\widetilde{\mathcal{I}} (\widetilde{u},\widetilde{v})$ is 4. The same happens to the central cases, getting a 2 degree curve. These reductions are obtained by disregarding factors in $\widetilde{\mathcal{I}} (\widetilde{u},\widetilde{v})$ , which are only system dependent. Some specific configurations and corresponding polynomial degrees are summarized in Tab. 1. They validate previous results. + +MATLAB scripts with all our derivations are public at https://github.com/pmiraldo/line-projection-catadioptric. + +# 4.4. On the Application of the Collineation + +As shown in Fig. 1, collineation between the normalized and the image plane is expressed as + +$$ +\zeta \left[ \begin{array}{l} u \\ v \\ 1 \end{array} \right] = \underbrace {\mathbf {K R}} _ {\mathbf {H}} \left[ \begin{array}{l} \tilde {u} \\ \tilde {v} \\ 1 \end{array} \right]. \tag {21} +$$ + +Assuming $\mathbf{K}$ as an upper triangular matrix, from the third equation of (21) we have that + +$$ +\zeta = r _ {3 1} \widetilde {u} + r _ {3 2} \widetilde {v} + r _ {3 3}, \tag {22} +$$ + +and replacing $\zeta$ in the first two equations of (21), a relation between $(\widetilde{u},\widetilde{v})$ and $(u,v)$ is obtained as $\widetilde{u} = \frac{\kappa_{30}^{1}[u,v]}{\kappa_{29}^{1}[u,v]}$ and $\widetilde{v} = \frac{\kappa_{31}^{1}[u,v]}{\kappa_{29}^{1}[u,v]}$ , where the denominators of the two fractions are identical. Variables $\widetilde{u}$ and $\widetilde{v}$ are replaced in (20) and, after multiplication with $(\kappa_{29}^{1}[u,v])^{6}$ , we get the following result: + +
SystemParameters
ABCc2c3
Elliptic0100235
Parabolic0.5080240
General-1.2-1.4-23.21030
Hyperboloidal Central-0.41435035
Ellipsoidal Central0.14-4.97.0035
Axial Cone-100025
+ +Table 2. Simulated Systems: Mirror parameters $A$ , $B$ , and $C$ , and the camera positions with respect to the mirror $c_{2}$ and $c_{3}$ , used in to generate the synthetic data (see results of Fig. 3 and Fig. 4). The top three rows show three examples of systems that cannot be modeled by previous models. + +Theorem 3 (Projection curve on the image). The projection of a 3D line defined by a point $\mathbf{q}$ and direction $\mathbf{s}$ , a perspective camera centered at $\mathbf{c}$ with rotation $\mathbf{R}$ , intrinsic calibration matrix $\mathbf{K}$ , and a quadratic mirror $\Omega(\mathbf{m})$ is defined by + +$$ +\mathcal {I} (u, v) = 0, \tag {23} +$$ + +where $\mathcal{I}(u,v)$ is a polynomial of maximum degree 6. + +# 5. Experiments + +We present the first unified model for line projection in catadioptric cameras. Therefore, we start these experimental results by giving some line projections for general configurations, mirror, and camera positions settings, validating the theoretical contributions of the paper. In addition, we consider cases where small misalignments of specific configurations occur to show the advantages of using our unified model over previous specific ones. The reader can test other catadioptric systems with the Matlab scripts in the link indicated above. Section 5.2 presents some results with real data. Section 5.3 shows an application of our methods in absolute pose estimation and AR problems. + +# 5.1. Line Projection + +We start with synthetic experiments for validation and comparisons with prior modelings. Using Matlab, we simulate systems with parameters in Tab. 2, and + +$$ +\mathbf {K} = \left[ \begin{array}{c c c} 7 5 0 & 0 & 6 0 0 \\ 0 & 7 5 0 & 4 0 0 \\ 0 & 0 & 1 \end{array} \right] \text {a n d} \mathbf {R} = \operatorname {d i a g} (1, - 1, - 1), \tag {24} +$$ + +with images size $1200 \times 800$ . Then, we apply results from Thm. 3 and Rmk. 1, to obtain the projection curves in the image and mirror, respectively. + +Validation: We take the first three systems of Tab. 2, which are examples of systems that previous techniques cannot + +![](images/54c16561d5faee965d6dc484b5868d31e1dcc4b2b823699441db3668dd17c501.jpg) +(a) Elliptical System + +![](images/8505707d88478d46a5164c88f817f5326e6ec8b326cd21d10699aa3bc50f7864.jpg) + +![](images/a18f35f22ec3a546ffa9c6cc8ddbc3b5f19c90587d1686d16268e958da5f3f1f.jpg) +(a) Hyperboloidal Central + +![](images/2c3fcc969c8087735931478edf07ac3c6d11be19d2ac18da4facbb5e401b61dd.jpg) + +![](images/6459f9da07307623632f0b00118c9d67a98528c83f0fc286a4a43a5d7fc6e197.jpg) +(b) Parabolic System + +![](images/36048238e345578712f1ee89cbc1aecc8e9fe05ae541df7c5384e0008c355c35.jpg) + +![](images/f4c415bc6813b088e4d5f3931ffbb2674f28d0991d556128e1e6016ee9fdb4a8.jpg) +(b) Ellipsoidal Central + +![](images/70dc0a315b4fc34bba9d568538f7529ba63d620b3652eb12e8eeb3dbc4030885.jpg) + +![](images/f4b92502d559c0e3d095de7f7e23622f369351f18e467e795f79844a514403d5.jpg) +(c) General mirror and camera position + +![](images/f0b98c54d37ed027a71d0ddf1f4e0e231c6abf12ef5697a9820c92a027535d2a.jpg) +Figure 4. Exact vs. approximation models: Prior models consider rigorous camera placements with respect to the mirror. In practice, we cannot guarantee that this will happen. This figure evaluates the effects of considering our unified model against the previous specific models when computing the line projection with small misalignments. We use the three cases listed in the three last rows of Tab. 2, and a misalignment of $5\%$ ; i.e. corresponding to systems with settings $c_{2} = 0.05c_{3}$ . Green curves represent the proposed model, and the red ones represent the approximations using previous methods. As we can see, the red curves are, in some cases, significantly far from the correct point projection (computed using [2]) that lies on top of our unified model. + +![](images/eab56e7932a878691dd7d111a963ed673be679f490b47344dd219926d7c14522.jpg) +Figure 3. Validation: We show the application of the proposed unified line projection modeling in the images and mirrors for three catadioptric systems. On the left, we show the camera system, the 3D lines, and the reflection curve in the mirror (Rmk. 1). At the right, we show the projection of the 3D lines into the images (Thm. 3). We consider two sets of three 3D parallel lines and their respective projections for each system in orange and green curves. We show that the curve matches the projection of 3D points from [2], identified with purple dots in the images. The 3D graphs only show one sheet of the mirror and their respective projection curves. We do not have this constraint in the image and, therefore, get up to two curves per 3D line. We note that these are three examples of systems that previous techniques cannot model concerning the mirror and camera position parameters. + +![](images/6292e73dda1dbcc0bb66690513e4af467a3374d883173c5e6dd0e7d95e07de9f.jpg) +(c) Axial cone + +model, and use our unified model. Results are shown in Fig. 3. Two sets of three parallel 3D lines are used in each system. To validate our model, we sample a small number of points from the 3D lines and project them into the image using [2]. We see that the images of these 3D points lie on the projection curves from Thm. 3, validating our results. + +Comparisons with previous modelings: In addition to the validation experiments, we show how our model can be used to represent systems that the current techniques can only approximate. As described in the introduction, it is impossible to have a perfectly aligned camera with the axis + +of symmetry or have it at a specific distance. To test the importance of these deviations and the advantages of the use of the proposed unified model, we run a test using three of the four systems4 in which the specific models were derived in the literature. Namely central cases [4, 18] and axial cone [7, 8]). The settings are listed in the three last rows of Tab. 2. Then, we consider small misalignment. Specifically, we consider the cases in which the perspective camera deviates from the perfect system requirement position. + +Figure 4 shows the results with misalignments in the $y-$ axis of only $5\%$ with respect to the distance of the camera to the mirror (instead of $c_{2} = 0$ , we have $c_{2} = 0.05c_{3}$ ). In addition, we run an experiment that generates 300 points in the + +
SystemMisalignment
1%5%10%15%
Hyperboloidal Central Ellipsoidal Central Axial Cone2.612.526.441.3
3.616.736.264.9
11.258.0119.1181.7
+ +Table 3. Misalignments: Average of the distance in pixels from the projection of the 3D points and the approximated projection, by considering camera misalignment and previous modelings. A total of 300 points equally distributed in the environment were considered and their projection lines were considered. + +world incident with a set of distinct 3D lines. We vary the misalignment from $1\%$ of to $15\%$ and compute the average error in pixels corresponding to the distance between the 3D projection of the points (exact projection) and the respective line projection approximated by the previous specific models5, i.e., setting $c_{2} = 0$ and using perfect systems and previous models. The errors in pixels are shown in Tab. 3. The table concludes that the approximation of slightly misaligned systems needed for using previous models can significantly deteriorate the results. On the other hand, our unified model always gives the perfect fit. + +# 5.2. Results with Real Data + +We use a non-central catadioptric camera with a commercially available hyperbolical mirror and a FLIR Flea3, model FL3-U3-13E4C-C, with a resolution of $1280 \times 1024$ . The perspective camera was previously calibrated, and the mirror's manufacturer gave its parameters. We use [45] to get transformation between the mirror and camera. + +Four images are used to evaluate our unified model. First, we run an edge detection to extract candidate pixels to line projections. We compute a 3D line using a straightforward RANSAC cycle, in which, for each iteration: + +1. We sample a set of four pixels that are candidates for images of a line; +2. Compute the four inverse projection rays corresponding to each of the four pixels obtained in item 1; +3. Using $[54]^6$ , we compute the 3D line that passes through four lines inverse projection rays of item 2. This 3D line will be the hypothesis for the 3D line coordinates obtained from the four points in item 1; +4. Using the 3D line estimated by item 3, we compute its projection $\mathcal{I}(u,v) = 0$ , using Thm. 3; + +5. We do inlier counting using $\mathcal{I}(u,v) = 0$ and computing a distance to the remaining pixels in the image listed as potential line images. The ones with a distance smaller than a defined threshold are considered inliers. This distance is calculated as in Sec. 5.1, paragraph "Comparisons with previous modelings." + +We repeat the process a certain number of iterations, and the final 3D line estimate is given by the hypothesis that obtained the largest number of inliers. Then, we apply our 3D projection line modeling again to the resulting 3D line model. By running the previously defined RANSAC cycle multiple times (and removing inliers from previous runs), we can extract multiple 3D lines. Figure 5(a) shows the results of fitting multiple lines with $\mathcal{I}(u,v) = 0$ . + +The same technique was applied to new images of a chessboard in different positions. In this case, we apply corner detection, select the corners within the chessboard, define the chessboard's rows and columns individually, and run the pipeline described in the previous paragraph. The results are shown in Fig. 5(b). + +This section shows that our unified imaging model obtains the correct projection of a 3D line and that, in combination with [54], our model can be used to fit multiple line images. We ran additional experiments with the RANSAC-based line fitting, namely synthetic data, evaluating different noise levels, specific camera systems, and RANSAC 2D vs. 3D. Due to space limitations, we send these experiments in supplementary materials. Note that these results could be refined using nonlinear optimization using the detected inliers, which we leave for future work. + +# 5.3. Applications to Pose Estimation and AR + +We propose a simple application for a camera localization problem and Augmented Reality (AR) to evaluate our methods further. We use a non-central catadioptric camera with a spherical mirror, calibrated as described in the previous subsection. Four green 3D straight lines are placed on for floor, and we consider the following procedure: + +1. We run a color filter to get green pixels in the image; +2. Four projection curves are estimated using our RANSAC-based fitting method described in the previous section. Figure 6(a) shows the fitted curves; +3. We compute the intersecting points of the projection curves; +4. Using three of the four intersecting points and their respective coordinates in the world, we compute the camera pose using minimal data [13, 30, 39, 42], getting up to four solutions for the camera pose; and +5. We get the correct transformation by selecting the pose that minimizes the fourth point's re-projection error. + +![](images/7e37d1ab667018a0b95ebba470a7a6e300769dfd49656357eb4ddb35914df5e4.jpg) + +![](images/db709e25819792c85d9e587a6965fc0c9e95cb9e73af37652cf8f6ac0dfb41de.jpg) + +![](images/c730bb77a0dc51ca4d03560725eae11d319e3d69dc71ee2f8a76de131446060d.jpg) + +![](images/33652899f86ee2f3f38a58b9a9306b5e63e47da01dd119ae6b3484440a5ddac7.jpg) + +![](images/42a5b07939705fba2b1d9d46520fd51ab744956b6a994d53f552fef16bbfec70.jpg) +(b) Results for images of 3D straight lines given corner detection in a chessboard. + +![](images/338a57c6ab674d798dfd6a52e6b5620b0e86a8ebd86249d25345a76b35736599.jpg) +(a) Results for potential images of 3D straight lines given by edge detection. + +![](images/c4156a68d22c258fb39f0f6f0ec2a170ad51c55857acbae2c737c527b6222519.jpg) + +![](images/bc5e66993ae31b17d82c4ac079f1fb9b4b21a77d64f9c5185e54db1f55eb3513.jpg) + +![](images/da06e494e8446a546890b256182882b7521ca7665051243c819801eb6d42d00e.jpg) +(a) We show curves representing the 3D projection lines in spherical catadioptric cameras. Green points are the image point candidates for line images. +Figure 6. (a) shows two images acquired with a spherical catadioptric camera, four green 3D straight lines on the floor, and the respective four-line images. (b) shows the augmented reality application. Four parallelepiped objects are correctly projected into the image. + +![](images/b42cc5322d4d7fb5ef3526a81e17c4b97d66412d33a9ad8199e547d609a40a7d.jpg) + +![](images/0ae4220a290e158afc54e6e70ee163724c6aba1a47fda7f6958459b3cd4d53e7.jpg) +Figure 5. Line projection and fitting techniques using a non-central hyperbolic catadioptric camera. Images were acquired outside and inside. Red or blue curves represent the projection curves, while green points are the inliers considered to fit each curve. +(b) We estimate the 3D line using the RANSAC-based method in Sec. 5.2, compute their intersections, and the camera's pose. Using the estimated pose, we offer a simple augmented reality application. + +![](images/edc811466400d8f88aed2c2e1eb208ac6422f9d7bdee085f00fc5a01b03c4c2a.jpg) + +To evaluate our results, we define four rectangular parallelepipeds in the world and project their edges into the image using our model. The results are shown in Fig. 6(b). We conclude that the parallelepipeds are correctly projected. + +# 6. Discussion + +This paper proposes the first unified model for 3D line projection in catadioptric cameras. We start by describing the line-reflection constraint. Then, derive the reflection curve on the mirror and get a projection curve in the image. We ran several experiments with both synthetic & real data and different types of catadioptric camera systems. + +For future work, we plan to i) derive a unified method for catadioptric camera calibration using line projections and ii) add geometrical constraints for improving the RANSAC- + +based line fitting for a better 3D and 2D estimation. + +# Acknowledgements + +This work was supported by the LARSyS - FCT Project UIDB/50009/2020, by the European Regional Development Fund, under the Smart Growth Operational Programme, project POIR.01.01.01-00-0102/20, with the title "Development of an innovative, autonomous mobile robot for retail stores", by the Swedish Research Council (grant 2018-05375), the Swedish Foundation for Strategic Research (Semantic Mapping and Visual Navigation for Smart Robots), and the Wallenberg AI, Autonomous Systems and Software Program (WASP). We thank the reviewers and area chairs for valuable feedback. + +# References + +[1] Amit Agrawal, Yuichi Taguchi, and Srikumar Ramalingam. Analytical forward projection for axial non-central dioptic and catadioptric cameras. In European Conf. Computer Vision (ECCV), pages 129-143, 2010. 1, 2, 3 +[2] Amit Agrawal, Yuichi Taguchi, and Srikumar Ramalingam. Beyond Alhazen's problem: Analytical projection model for non-central catadioptric cameras with quadric mirrors. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), pages 2993-3000, 2011. 1, 2, 3, 6 +[3] Simon Baker and Shree K. Nayar. A theory of single-viewpoint catadioptric image formation. Int'l J. Computer Vision (IJCV), 35(2):175-196, 1999. 1, 2 +[4] Joao P. Barreto and Helder Araujo. Issues on the geometry of central catadioptric image formation. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 2, pages 422-427, 2001. 1, 2, 3, 6 +[5] Joao P. Barreto and Kostas Daniilidis. Epipolar geometry of central projection systems using veronese maps. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages 1258-1265, 2006. 1 +[6] Jean Charles Bazin, Cedric Demonceaux, and Pascal Vasseur. Fast central catadioptric line extraction. In Iberian Conference on Pattern Recognition and Image Analysis (IbPRIA), pages 25-32, 2007. 2 +[7] J. Bermudez-Cameo, G. Lopez-Nicolas, and J.J. Guerrero. Line-images in cone mirror catadioptric systems. In IEEE Int'l Conf. Pattern Recognition (ICPR), pages 2083-2088, 2014. 1, 2, 6 +[8] Jesus Bermudez-Cameo, Gonzalo Lopez-Nicolas, and Jose J. Guerrero. Fitting line projections in non-central catadioptric cameras with revolution symmetry. Computer Vision and Image Understanding (CVIU), 167:134-152, 2018. 1, 2, 6 +[9] J. Bermudez-Cameo, Luis Puig, and J.J. Guerrero. Hypercatadioptric line images for 3d orientation and image rectification. Robotics and Autonomous Systems (RAS), 60(6):755-768, 2012. 2 +[10] Roland Bunschoten and Ben Krose. Robust scene reconstruction from an omnidirectional vision system. IEEE Trans. Robotics and Automation (T-RA), 19(2):351-357, 2002. 1 +[11] Vincenzo Caglioti and Simone Gasparini. On the localization of straight lines in 3d space from single 2d images. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), pages 1129-1134, 2005. 1 +[12] David Caruso, Jakob Engel, and Daniel Cremers. Large-scale direct slam for omnidirectional cameras. In IEEE/RSJ Int'l Conf. Intelligent Robots and Systems (IROS), pages 141-148, 2015. 1 +[13] Chu-Song Chen and Wen-Yan Chang. On pose recovery for generalized visual sensors. IEEE Trans. Pattern Analysis and Machine Intelligence (T-PAMI), 26(7):848-861, 2004. 7 +[14] Yuanyuan Ding, Jingyi Yu, and Peter Sturm. Recovering specular surfaces using curved line images. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), pages 2326-2333, 2009. 2 + +[15] O. D. Faugeras, Q.-T. Luong, and S. J. Maybank. Camera self-calibration: Theory and experiments. In European Conf. Computer Vision (ECCV), pages 321-334, 1992. 1 +[16] Andrew W. Fitzgibbon. Simultaneous linear estimation of multiple view geometry and lens distortion. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages I-I, 2001. 2 +[17] Simone Gasparini and Vincenzo Caglioti. Line localization from single catadioptric images. Int'l J. Computer Vision (IJCV), 94(3):361-374, 2011. 1 +[18] Christopher Geyer and Kostas Daniilidis. A unifying theory for central panoramic systems and practical implications. In European Conf. Computer Vision (ECCV), pages 445-461, 2000. 1, 2, 6 +[19] Raja N. Ghanem, Charulatha Ramanathan, Ping Jia, and Yoram Rudy. Heart-surface reconstruction and ecg electrodes localization using fluoroscopy, epipolar geometry and stereovision: Application to noninvasive imaging of cardiac electrical activity. IEEE Trans. Medical Imaging (T-MI), 22(10):1307-1318, 2003. 1 +[20] Joshua Gluckman, Shree K. Nayar, and Keith J. Thoresz. Real-time omnidirectional and panoramic stereo. In DARPA Image Understanding Workshop, pages 299–303, 1998. 1 +[21] Nuno Goncalves. On the reflection point where light reflects to a known destination on quadratic surfaces. OSA Opt. Lett., 35(2):100-102, 2010. 2, 3 +[22] Nuno Goncalves and Ana Catarina Nogueira. Projection through quadric mirrors made faster. In IEEE Int'l Conf. Computer Vision Workshops, pages 2141-2148, 2009. 2 +[23] Nuno Goncalves, Ana Catarina Nogueira, and Andre Lages Miguel. Forward projection model of non-central catadioptric cameras with spherical mirrors. Robotica, 35(6):1378-1396, 2017. 2 +[24] Michael D. Grossberg and Shree K. Nayar. A general imaging model and a method for finding its parameters. In IEEE Int'l Conf. Computer Vision (ICCV), volume 2, pages 108-115, 2001. 1 +[25] Richard Hartley and Andrew Zisserman. Multiple View Geometry in Computer Vision. Cambridge University Press, 2 edition, 2004. 1, 2, 3 +[26] Richard I. Hartley. In defense of the eight-point algorithm. IEEE Trans. Pattern Analysis and Machine Intelligence (T- PAMI), 19(6):580-593, 1997. 1 +[27] Fay Huang. Epipolar geometry in concentric panoramas. Technical report, CMP, Czech Technical University - CTU-CMP-2000-07, 2000. 2 +[28] Sing Bing Kang. Catadioptric self-calibration. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages 201-207, 2000. 1 +[29] Douglas Lanman, Megan Wachs, Gabriel Taubin, and Fernando Cukierman. Reconstructing a 3d line from a single catadioptric image. In Int'l Symposium on 3D Data Processing, Visualization, and Transmission (3DPVT), pages 89-96, 2006. 1 +[30] Gim Hee Lee, Bo Li, Marc Pollefeys, and Friedrich Fraundorfer. Minimal solutions for the multi-camera pose estimation problem. The International Journal of Robotics Research (IJRR), 34(7):837-848, 2015. 7 + +[31] Yi Ma, Stefano Soatto, Jana Kosecka, and S. Shankar Sastry. An Invitation to 3-D Vision. Springer-Verlag, 2004. 1, 2 +[32] Christopher Mei and Ezio Malis. Fast central catadioptric line extraction, estimation, tracking and structure from motion. In IEEE/RSJ Int'l Conf. Intelligent Robots and Systems (IROS), pages 4774-4779, 2006. 2 +[33] Christopher Mei and Patrick Rives. Single view point omnidirectional camera calibration from planar grids. In IEEE Int'l Conf. Robotics and Automation (ICRA), pages 3945-3950, 2007. 2 +[34] Marc Menem and Tomas Pajdla. Constraints on perspective images and circular panoramas. In *British Machine Vision Conference (BMVC)*, 2004. 2 +[35] Branislav Micusik and Tomas Pajdla. Autocalibration & 3d reconstruction with non-central catadioptric cameras. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages 58-65, 2004. 1 +[36] Branislav Micusik and Tomas Pajdla. Para-catadioptric camera auto-calibration from epipolar geometry. In Asian Conf. Computer Vision (ACCV), volume 2, pages 748-753, 2004. 1 +[37] Branislav Micusik and Tomas Pajdla. Structure from motion with wide circular field of view cameras. IEEE Trans. Pattern Analysis and Machine Intelligence (T-PAMI), 28(7):1135-1149, 2006. 1 +[38] Ondrej Miksik, Yousef Amar, Vibhav Vineet, Patrick Perez, and Philip H. S. Torr. Incremental dense multi-modal 3d scene reconstruction. In IEEE/RSJ Int'l Conf. Intelligent Robots and Systems (IROS), pages 908-915, 2015. 1 +[39] Pedro Miraldo and Helder Araujo. A simple and robust solution to the minimal general pose estimation. In IEEE Int'l Conf. Robotics and Automation (ICRA), pages 2119-2125, 2014. 7 +[40] Pedro Miraldo, Helder Araujo, and Joao Queiro. Point-based calibration using a parametric representation of the general imaging model. In IEEE Int'l Conf. Computer Vision (ICCV), pages 2304-2311, 2011. 1 +[41] Shree K. Nayar. Catadioptric omnidirectional camera. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), pages 482-488, 1997. 1 +[42] David Nister. A minimal solution to the generalised 3-point pose problem. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages 560-567, 2004. 7 +[43] David Nister, Oleg Naroditsky, and James Bergen. Visual odometry. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages 652-659, 2004. 1 +[44] Tomas Pajdla. Stereo with oblique cameras. Int'l J. Computer Vision (IJCV), 47(1):161-170, 2002. 2 +[45] Luis Perdigoto and Helder Araujo. Calibration of mirror position and extrinsic parameters in axial non-central cardio-ptic systems. Computer Vision and Image Understanding (CVIU), 117(8):909-921, 2013. 7 +[46] Marc Pollefeys, Reinhard Koch, and Luc Van Goo. Self-calibration and metric reconstruction in spite of varying and unknown intrinsic camera parameters. Int'l J. Computer Vision (IJCV), 32(1):7-25, 1999. 1 + +[47] Marc Pollefeys, Reinhard Koch, and Luc Van Goo. A simple and efficient rectification method for general motion. In IEEE Int'l Conf. Computer Vision (ICCV), volume 1, pages 496-501, 1999. 1 +[48] Davide Scaramuzza, Agostino Martinelli, and Roland Siegwart. A toolbox for easily calibrating omnidirectional cameras. In IEEE/RSJ Int'l Conf. Intelligent Robots and Systems (IROS), pages 5695-5701, 2006. 2 +[49] Peter Sturm, , and Srikumar Ramalingam. A generic concept for camera calibration. In European Conf. Computer Vision (ECCV), pages 1-13, 2004. 1 +[50] Peter Sturm and Joao P. Barreto. General imaging geometry for central catadioptric cameras. In European Conf. Computer Vision (ECCV), pages 609-622, 2008. 1 +[51] Peter Sturm, Srikumar Ramalingam, Jean-Philippe Tardif, Simone Gasparini, and Joao Barreto. Camera models and fundamental concepts used in geometric computer vision. Foundations and Trends in Computer Graphics and Vision, 6(1/2):1–183, 2011. 1 +[52] Tomas Svoboda and Tomas Pajdla. Epipolar geometry for central catadioptric cameras. Int'l J. Computer Vision (IJCV), 49(1):23-37, 2002. 1 +[53] Rahul Swaminathan, Michael D. Grossberg, and Shree K. Nayar. Non-single viewpoint catadioptric cameras: Geometry and analysis. Int'l J. Computer Vision (IJCV), 66(3):211-229, 2006. 1, 2 +[54] Seth Teller and Michael Hohmeyer. Determining the lines through four lines. J. Graphics Tools, 4(3):11-22, 1999. 1, 7 +[55] SriRam Thirthala and Marc Pollefeys. The radial trifocal tensor: a tool for calibrating the radial distortion of wide-angle cameras. In IEEE Conf. Computer Vision and Pattern Recognition (CVPR), volume 1, pages 321-328, 2005. 2 +[56] Zhiyu Xiang, Xing Dai, Yanbing Zhou, and Xiaojin Gong. Self-calibration for a non-central catadioptric camera with approximate epipolar geometry. Meas. Sci. Technol., 25:085005, 2014. 1 +[57] Wei Yang, Yu Ji, Jinwei Ye, S. Susan Young, and Jingyi Yu. Coplanar common points in non-centric cameras. In European Conf. Computer Vision (ECCV), pages 220-233, 2014. 2 +[58] Jinwei Ye, Yu Ji, and Jingyi Yu. A rotational stereo model based on xslit imaging. In IEEE Int'l Conf. Computer Vision (ICCV), pages 489-496, 2013. 2 +[59] Jinwei Ye and Jingyi Yu. Ray geometry in non-pinhole cameras: a survey. The Visual Computer (Vis Comput), 30(1):93-112, 2013. 1 \ No newline at end of file diff --git a/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/images.zip b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c17e110eb617319b64e9dc2a01071952c6dd8251 --- /dev/null +++ b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f1404bccb87ffe416397bd0357b90dc443bec0ab7414a420b85fd4f4349d162 +size 633942 diff --git a/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/layout.json b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4bbc3a7dcc2612f08809fdd35ecafeb5b0a9cc5b --- /dev/null +++ b/aunifiedmodelforlineprojectionsincatadioptriccameraswithrotationallysymmetricmirrors/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9344a25172dc9390e97be500cb6192068b5e942407247d573f9fce75e5cef17 +size 514041 diff --git a/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_content_list.json b/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f6709891afb856983473a62525822fd3f97d47f --- /dev/null +++ b/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f346948bfe59a6b7cfbbed6c225e5edeb42d2532d8da34d4e71cd21a8549528 +size 83180 diff --git a/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_model.json b/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_model.json new file mode 100644 index 0000000000000000000000000000000000000000..684732cf48789eb05a774c7f3b99c6dfaf3bd542 --- /dev/null +++ b/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f639b2dd5ba4ab194c3a8368ecad54c1251d9ea65e63fc8df423e627a7a1fbee +size 106298 diff --git a/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_origin.pdf b/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1a953e258470d1d72f16f3d103df122019ed639e --- /dev/null +++ b/aunifiedquerybasedparadigmforpointcloudunderstanding/58df2e0d-1e4a-489f-851e-dbc621750104_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ffffd817ed6fd8da45d2f37ea00d670bbfddf0e42f621ef7419d9ee8d97bdd8 +size 1122106 diff --git a/aunifiedquerybasedparadigmforpointcloudunderstanding/full.md b/aunifiedquerybasedparadigmforpointcloudunderstanding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..72c1a37306064c1cacaae73197580dc6d88f0520 --- /dev/null +++ b/aunifiedquerybasedparadigmforpointcloudunderstanding/full.md @@ -0,0 +1,357 @@ +# A Unified Query-based Paradigm for Point Cloud Understanding + +Zetong Yang $^{1,4*}$ Li Jiang $^{2*}$ Yanan Sun $^{3}$ Bernt Schiele $^{2}$ Jiaya Jia $^{1}$ $^{1}$ CUHK $^{2}$ MPI Informatics $^{3}$ HKUST $^{4}$ SmartMore + +{tomztyang, now.syn}@gmail.com {lijiang, schiele}@mpi-inf.mpg.de leojia@cse.cuhk.edu.hk + +# Abstract + +3D point cloud understanding is an important component in autonomous driving and robotics. In this paper, we present a novel Embedding-Querying paradigm (EQ-Paradigm) for 3D understanding tasks including detection, segmentation and classification. EQ-Paradigm is a unified paradigm that enables combination of existing 3D backbone architectures with different task heads. Under the EQ-Paradigm, the input is first encoded in the embedding stage with an arbitrary feature extraction architecture, which is independent of tasks and heads. Then, the querying stage enables the encoded features for diverse task heads. This is achieved by introducing an intermediate representation, i.e., $Q$ -representation, in the querying stage to bridge the embedding stage and task heads. We design a novel $Q$ -Net as the querying stage network. Extensive experimental results on various 3D tasks show that EQ-Paradigm in tandem with $Q$ -Net is a general and effective pipeline, which enables flexible collaboration of backbones and heads. It further boosts performance of state-of-the-art methods. + +# 1. Introduction + +3D point cloud understanding is an essential line in computer vision since it could benefit many applications, such as autonomous driving [14], robotics [12], and augmented reality [31]. + +In point cloud understanding, there are two dominant input representations: points and voxels. Specifically designed for these two representations, mainstream models can be grouped into point- [19, 23, 28, 36, 51, 56, 69] and voxel-based [7, 16, 61, 71] networks. In both cases, state-of-the-art models consist of an encoder network to gradually downsample the points/voxels by sampling algorithms / strided convolution. There are also a decoder network to propagate features of the subsampled points/voxels into original ones and a task-specific head for making predictions. We call these methods Encoder-Decoder paradigm (ED-Paradigm) models. Due to the + +![](images/2e782240d48af7fbbf3090f5106707a307e7e5d8d6569788221985d0126d3172.jpg) +Figure 1. Illustration of the unified query-based EQ-Paradigm. The query position can be randomly designated in the 3D scene, thus making it possible to combine any backbone embedding networks with different task heads. + +downsampling-upsampling design, ED-Paradigm models extract features for some fixed positions appearing in the downsampling process. + +In this paper, we propose a novel Embedding-Querying paradigm (EQ-Paradigm) for 3D understanding tasks. Compared to the ED-Paradigm, which extracts features for fixed positions, EQ-Paradigm enables feature generation for any position in the 3D scene. Thus, the EQ-paradigm is generalization of the ED-Paradigm. Any ED-Paradigm model has an EQ-Paradigm counterpart. An EQ-Paradigm model consists of three stages: an Embedding stage, a Querying stage, and a task-specific head. + +The embedding stage can be implemented with any feature extraction architecture, including voxel- and point-based networks, regardless of tasks and heads. We use the embedding network to extract support features for following stages. The querying stage then takes a set of positions as query positions and generates their intermediate representation, i.e., $Q$ -representation, based on the support features. Note that the query positions could be any point in the contiguous 3D space, thus enabling feature generation for any location. We further present a novel querying stage net + +work called $Q$ -Net to effectively extract Q-representation. Afterwards, a task head is employed for generating predictions based on the Q-representation. + +Due to the flexibility in query position designation, the EQ-Paradigm is a unified query-based paradigm that can easily combine any state-of-the-art 3D backbone networks with different task heads without extra efforts (Figure 1), which gives a lot of freedom in the head design. For example, SSD head [21] designed for voxel-based detectors [61, 72] can be applied with a point-based embedding network under EQ-Paradigm; an EQ-Paradigm segmentation model can directly obtain point-wise features based on a voxel-based embedding network [7, 16]; also, an EQ-Paradigm version of PVRCNN [39] is able to directly generate proposal grid features from the voxel-based backbones for the following detection head. This greatly increases the flexibility of model design for different tasks. + +We evaluate our EQ-Paradigm on multiple important 3D understanding tasks including object detection [26, 32, 39, 40, 61], semantic segmentation [7, 16] and shape classification [36]. Our experiments show that our EQ-Paradigm and Q-Net can be well integrated with any state-of-the-art models regardless of tasks, backbone architectures and head designs, while making consistent performance improvement. Our primary contributions are the following. + +- We propose an Embedding-Querying paradigm for 3D point cloud understanding. It is a unified query-based paradigm enabling combination of arbitrary point- or voxel-based networks with different task heads. +- We present a novel querying stage network Q-Net, to extract intermediate Q-representation, i.e., query features, for the designed query positions. +- We integrate our EQ-Paradigm and Q-Net into multiple state-of-the-art 3D networks for different tasks and achieve consistent performance improvement from extensive experiments. + +# 2. Related Work + +ED-Paradigm ED-Paradigm models are widely used. They consist of an encoder network to extract high-level semantic features, a decoder network for feature propagation, and a task head to perform predictions. U-Net [37] is a classical ED-Paradigm network to deal with biomedical image segmentation. It inspires following work on 2D pixel-level tasks including semantic segmentation [5, 6, 27, 70], super resolution (SR) [50] and matting [13, 44, 57]. In 3D tasks, it is also a mainstream paradigm for object detection [18,34,61,72] and semantic segmentation [23,28,45,54,69]. + +Point-based 3D Architectures Point-based 3D models deal with raw point clouds, which extract sparse point features, downsample point cloud in encoder networks, propagate + +features to original points by decoders, and make predictions by task-specific heads. PointNet++ [36] is a fundamental point-based backbone and has been widely applied to many point-based models [26,33,34,40,52,63,64]. These models utilize a series of set-abstraction layers as their encoders and multiple feature propagation layers as decoders. + +Some models focus on developing elegant heads to leverage the sparse point features. For example, F-PointNet [34] achieves amodal 3D box estimation. In [40, 65], canonical 3D bounding box refinement and PointsPool layer are proposed respectively. Other point-based backbones [19, 59, 68] focus on improving the feature aggregation operation in PointNet++ by introducing graph convolutions [42, 48], convolution-like operations [45, 54, 56] or transformer structure [30,69]. For raw point cloud, a point-based model can extract features with accurate relative positions and structural information. But it is limited in dealing with large-scale point cloud due to high time complexity for ball query and farthest point sampling. + +Voxel-based 3D Architectures Voxel-based methods first divide raw point cloud into regular voxels, then apply convolutional neural networks (CNNs) composed of sparse [7, 15, 16] or dense [72] convolutions as their encoder and decoder networks to extract voxel features. Still, voxel-based models are widely applied in various methods [7, 18, 39, 41, 61, 72] on different tasks. Compared to point-based architectures, voxel-based methods reduce a large number of redundant points in the same voxels but sacrifice the data precision during the voxelization process. However, voxel-based methods are able to deal with the large-scale scenario. In this paper, we propose an EQ-Paradigm for enabling models on different tasks to easily switch between these two backbone architectures and providing great flexibility in head design. + +# 3. EQ-Paradigm + +We first give an overview of the EQ-paradigm in this section, then elaborate our novel querying stage design, Q-Net, in the next section. + +# 3.1. Overview + +As shown in Figure 2, our EQ-Paradigm has three stages: an Embedding stage, a Querying stage and a task head. First, the embedding stage extracts features from the input point cloud $I \in \mathbb{R}^{N \times 3}$ . We take those features as support features $F_{S}$ for the following querying stage. The corresponding 3D positions of $F_{S}$ are denoted as support points $S \in \mathbb{R}^{n \times 3}$ . The querying stage is then responsible for generating Q-representation, that is, query features $F_{Q}$ for query positions $Q \in \mathbb{R}^{m \times 3}$ based on support points $S$ and support features $F_{S}$ . Notably, $Q$ is not required to be a subset of $I$ . Instead, a query point is expected to be any position + +in the continuous 3D space. We provide a novel querying stage design called Q-Net. Finally, the task head produces predictions based on query positions $Q$ and features $F_{Q}$ . Our EQ-Paradigm is expressed as + +$$ +F _ {S}, S = \operatorname {E m b e d d i n g} (I), +$$ + +$$ +F _ {Q} = \operatorname {Q u e y e r i n g} \left(F _ {S}, S, Q\right), \tag {1} +$$ + +$$ +O = \operatorname {H e a d} (F _ {Q}, Q), +$$ + +where $O$ indicates the final outputs for specific tasks. + +# 3.2. Embedding Stage + +In the EQ-Paradigm, the feature extraction network in the embedding stage can be any 3D network, including voxel-based networks with voxelized input [7, 15, 16] and point-based networks with raw point clouds [23, 35, 36, 54], independent of tasks and heads. The goal of the embedding stage is to generate support points $S$ and support features $F_{S}$ . For point-based embedding networks, the support points $S$ are usually a subsample of the input point cloud $I$ , depending on the downsampling strategy (e.g., farthest point sampling) of the network. In the voxel-based situation, downsampling is usually achieved by strided convolutions, and we take the downsampled voxel centers as $S$ . + +As mentioned in Section 2, a voxel-based backbone is able to deal with large-scale point cloud scenarios, while a point-based backbone can extract more precise structural information. In the EQ-Paradigm, a model can arbitrarily specify its embedding stage network according to the practical demand, which brings flexibility in model design. + +# 3.3. Querying Stage + +The querying stage is utilized for extracting query features $F_{Q}$ for a set of manually designated query positions $Q$ from support features $F_{S}$ and their positions $S$ . The queried features are then sent to the task-specific head for generating final predictions. + +The key aspect of the querying stage lies in the selection of query positions according to different tasks and head designs, as illustrated in Figure 2 and the following. + +- Query positions in detection. To deploy an SSD [21, 61] head in an outdoor 3D object detection model, query positions are selected to be the pixel centers within the target Bird-Eye-View (BEV) map (Figure 2(a)). To utilize point-based heads proposed in [32, 40, 63], query positions are subsampled points from the raw input point cloud by uniform or farthest point sampling (Figure 2(b)). +- Query positions in segmentation. In semantic segmentation, query positions are the points requiring pointwise class predictions in a 3D scene (Figure 2(c)). Usually, the whole input point cloud $I$ is taken as $Q$ . + +![](images/0215453f37bf078fd8a341fa544b920f20e4d3cc0f66e631da1620ecfd910102.jpg) +Figure 2. Overview of our EQ-Paradigm. Given an input point cloud $I$ , a set of support features $F_{S}$ for support points $S$ are generated in the embedding stage. The support points (marked in green) can be voxel centers or point samples for voxel- or point-based embedding networks, respectively. The querying stage network generates the query features $F_{Q}$ (also known as Q-representation) used in the task head for query positions $Q$ based on $S$ and $F_{S}$ . The query positions $Q$ (marked in yellow) for different tasks and heads are shown in (a)-(d). + +- **Query positions in classification.** In classification, $Q$ can be the shape center to produce a representative feature for the classifier, or can also be multiple uniformly-distributed positions indicating different parts of an object to vote for the category (Figure 2(d)). In this paper, we intend to vote category using 16 sampled points as query positions. + +The querying stage is agnostic of the embedding network type and has great flexibility in query position selection. The point or voxel features extracted in the embedding stage can be well propagated to the query positions required by different tasks and heads. Also, for a specific task head, it is possible to switch the point- or voxel-based embedding networks depending on which representation is better for the head. This is valuable for tasks like detection, where the head and backbone designs are both important, as shown in the ablation study in Section 5.5. + +# 4. Q-Net + +Our querying stage network Q-Net is based on the transformer structure [11, 47] to extract Q-representations, i.e., + +![](images/32ea7efd78dbba067fbf68e7cb7fc5d36c87c1331f9f7bfa2f5551c5a912a16f.jpg) +Figure 3. Illustration of our Q-Net in EQ-Paradigm. Taking as input the support points $S$ and support features $F_{S}$ , Q-Net generates query features $F_{Q}$ for query positions $Q$ . Q-Net consists of $L$ consecutive Q-Blocks, each containing a Q-Encoder layer for updating support features and a Q-Decoder layer for refining query features. We initialize $F_{Q}^{0}$ by $\mathbf{0}$ and take $F_{S}$ as the initial support features $F_{S}^{0}$ . + +query features $F_{Q}$ . Recently, transformer models have shown great potential in the field of 2D computer vision [4,10,11,25,46,62] as well as 3D tasks [29,30,66,69]. Here, we develop our Q-Net based on the transformer to effectively generate features for query positions due to the flexible receptive field and strong representation ability of transformer layers. Note that the transformer mechanism suits the querying stage because the attention operator with positional encoding both contributes a global perspective and considers the relative positions between points, which satisfies the need of feature generation for flexible query positions. Figure 3 shows the architecture of Q-Net. + +# 4.1. Q-Block + +Q-Net is a stack of $L$ Q-Blocks. Each Q-Block has four input elements. For the $l$ -th block, the four inputs are query positions $Q$ , support points $S$ , query features $F_{Q}^{l - 1}$ , and support features $F_{S}^{l - 1}$ , where $F_{Q}^{l - 1}$ and $F_{S}^{l - 1}$ are the output of the $(l - 1)$ -th block. For the first Q-Block, we initialize $F_{Q}^{0}$ as $\mathbf{0}$ . Since query positions $Q$ are not necessarily a subset of input point cloud $I$ , initializing their features as zeros does not introduce any inductive bias. Meanwhile, $F_{S}^{0}$ is initialized by the support features $F_{S}$ from the embedding stage. These $L$ Q-Blocks update the query and support features in iterations. $L$ is set to 3 in our implementation. Ablation study on $L$ is included in the supplementary material. + +Each Q-Block utilizes two layers. They are a Q-Encoder layer and a Q-Decoder layer to update the support features and refine the query features, respectively. The support features are updated to encode richer global semantic information, thus benefiting the query feature refinement. We abandon the Q-Encoder layer in the last Q-Block, since we do not need updated support features anymore without the next Q-Decoder layer. The output of the last Q-Block is the final query features $F_{Q}$ , which are fed into the task head for + +making predictions. Formally, the Q-Block is depicted as + +$$ +F _ {Q} ^ {l} = \text {Q - D e c o d e r} \left(Q, F _ {Q} ^ {l - 1}, S, F _ {S} ^ {l - 1}\right), \tag {2} +$$ + +$$ +F _ {S} ^ {l} = \operatorname {Q - E n c o d e r} \left(S, F _ {S} ^ {l - 1}\right). +$$ + +We follow the original transformer [47] to build our Q-Encoder and Q-Decoder layers. We adopt the transformer encoder layer as our Q-Encoder layer, while the Q-Decoder layer is adapted from the transformer decoder layer. + +Q-Encoder Layer We use the Q-Encoder layer to update the support features. Architecture of our Q-Encoder layer follows the widely-used transformer encoder layer, which consists of an attention layer (Attention) and a feed-forward network (FFN). We formulate the Q-Encoder layer as + +$$ +\hat {F} _ {S} ^ {l} = \operatorname {A t t e n t i o n} \left(S, F _ {S} ^ {l - 1}, S, F _ {S} ^ {l - 1}\right) + F _ {S} ^ {l - 1}, \tag {3} +$$ + +$$ +F _ {S} ^ {l} = \mathrm {F F N} (\hat {F} _ {S} ^ {l}) + \hat {F} _ {S} ^ {l}. +$$ + +The attention layer here is a classical qkv-based multi-head self-attention [47], where $\mathbf{q}$ , $\mathbf{k}$ and $\mathbf{v}$ are all from the support features $F_{S}^{l - 1}$ . We use LayerNorm [3] to normalize features before each Attention and FFN module. + +Q-Decoder Layer The Q-Decoder layer generates enhanced feature representations for query positions. Different from the transformer decoder layer, in the Q-Decoder layer, we do not apply self-attention to query features and instead directly adopt the cross-attention layer to generate query features from the support features, formulated as + +$$ +\hat {F} _ {Q} ^ {l} = \operatorname {A t t e n t i o n} \left(Q, F _ {Q} ^ {l - 1}, S, F _ {S} ^ {l - 1}\right) + F _ {Q} ^ {l - 1}, \tag {4} +$$ + +$$ +F _ {Q} ^ {l} = \operatorname {F F N} \left(\hat {F} _ {Q} ^ {l}\right) + \hat {F} _ {Q} ^ {l}, +$$ + +where the attention layer is a qkv-based multi-head crossattention, in which $\mathbf{q}$ is from the query features while $\mathbf{k}$ and $\mathbf{v}$ are from the support features. Removing the self-attention + +in the conventional transformer decoder layer keeps independence of query positions. That is, the query feature of a query position only depends on its relationship with the support points/features, but not with other query positions/features, thus providing more freedom in the choice of query positions. For example, we can query the features of only parts of interest in the whole scene. The ablation study in Section 5.5 shows the advantages of this design. + +Attention Layer The Attention layer, formulated as + +$$ +\tilde {F} _ {Y} = \text {A t t e n t i o n} (Y, F _ {Y}, X, F _ {X}), \tag {5} +$$ + +plays a fundamental role in a Q-Block. It leverages $m$ target positions $Y \in \mathbb{R}^{m \times 3}$ with features $F_{Y} \in \mathbb{R}^{m \times d}$ and $n$ source positions $X \in \mathbb{R}^{n \times 3}$ with features $F_{X} \in \mathbb{R}^{n \times d}$ to obtain new target features $\tilde{F}_{Y} \in \mathbb{R}^{m \times d}$ . Here, $d$ denotes the channel number of features. A qkv-based attention layer can be viewed as applying attention weights to the source features $F_{X}$ for computing new target features. Here, we describe the single-head calculation for clarity. The computation of the $i$ -th new target feature $\tilde{F}_{Y}^{(i)}$ is formulated as + +$$ +\tilde {F} _ {Y} ^ {(i)} = \mathcal {A} ^ {(i)} \left(F _ {X} W _ {\mathbf {v}} + B _ {\mathbf {v}} ^ {(i)}\right). \tag {6} +$$ + +The attention weight $\mathcal{A} \in \mathbb{R}^{m \times n}$ is obtained by utilizing a softmax function on the result of dot product between target features $F_{Y}$ and source features $F_{X}$ as + +$$ +\mathcal {A} = \operatorname {S o f t M a x} \left(\frac {\left(F _ {Y} W _ {\mathbf {q}}\right) \left(F _ {X} W _ {\mathbf {k}}\right) ^ {T} + B _ {\mathbf {q k}}}{\sqrt {d}}\right). \tag {7} +$$ + +$W_{\mathbf{q}}$ , $W_{\mathbf{k}}$ and $W_{\mathbf{v}}$ are weights of the linear layers for $\mathbf{q}$ , $\mathbf{k}$ and $\mathbf{v}$ , respectively. Also, in our Q-Block, we apply two types of relative positional encoding. The first $B_{\mathbf{v}} \in \mathbb{R}^{m \times n \times d}$ in Eq. (6) is for providing relative geometric information in the value vectors. The second $B_{\mathbf{qk}} \in \mathbb{R}^{m \times n}$ in Eq. (7) encodes the Euclidean positional difference between the target $Y$ and source $X$ in the attention weights. + +Relative Positional Encoding Relative positional encoding is an indispensable component in our Q-Net. Unlike previous transformer structures [4, 47] that adopt input features with effective semantic and position information, we initialize query features $F_{Q}^{0}$ by 0 in the first Q-Block, which avoids introducing inductive biases and provides no effective information. Hence, at the beginning of our Q-Net, query positions are the only hints for generating query features from support points and support features. + +Meanwhile, it is not optimal to update query features in the first block only depending on the coordinate difference between query and support points, since it makes no difference in attention weights for object points with the same relative position but in various scales and shapes. Inspired by [38, 53], we adopt contextual relative positional encoding, which fits our Q-Block well. + +![](images/fce9692d048009bf12132b14881b0cceb0dbfbd5dca6e3674291b4a40361f79a.jpg) +Figure 4. The hierarchical extension of our Q-Net. + +Compared to bias-mode relative positional encoding [25, 53, 62], contextual relative positional encoding considers the interactions of positional embeddings with the $\mathbf{q}$ , $\mathbf{k}$ , $\mathbf{v}$ features, making the relative positional encoding automatically adapt to features with different contextual information. Hence, it produces various responses for points in objects with diverse scales and shapes, even when some point pairs share the same relative positional difference. We provide the details of our relative positional encoding strategy and its effect in the supplementary material. + +Local Attention When the numbers of target $m$ and source $n$ are large, e.g., 40k, applying global attention to them is extremely GPU memory-consuming, since the attention weight $\mathcal{A} \in \mathbb{R}^{m \times n}$ is too large to store. To address this issue, we instead apply local attention in our Q-Net inspired by [30,69]. Specifically, for each target point, we figure out its $K$ nearest neighbors (KNN) in source points according to Euclidean distances and compute attention only on these neighbors. In this way, the size of attention weight $\mathcal{A}$ is greatly reduced to $m \times K$ , and $K$ is far smaller than $n$ . + +# 4.2. Hierarchical Q-Net + +Hierarchical multi-level architecture is proven to be essential for 3D tasks [7, 36] considering the diversity in 3D scene scales and object sizes. Especially for a point-wise prediction task like semantic segmentation, the multi-level features are of great importance in producing state-of-the-art results [7, 69], since the fine-grained features are needed to make detailed per-point segmentation. + +We develop a hierarchical Q-Net for exploiting multilevel features. As illustrated in Figure 4, we apply a series of Q-Nets on support features from multiple levels of the hierarchical embedding network and concatenate the query features from different levels to generate final predictions. + +# 5. Experiments + +We conduct experiments on four popular 3D tasks: semantic segmentation, indoor object detection, outdoor object detection and shape classification. Implementation details of training schedule, hyper-parameters and network + +
MethodScanNetS3DIS
ValidationTestArea 56-fold
PointNet [35]--41.147.6
PointNet++ [36]-33.9--
PointCNN [19]-45.857.365.4
PointWeb [68]--60.366.7
PointEdge [17]63.461.861.967.8
PointConv [54]61.066.6--
PointASNL [60]66.466.662.668.7
KPConv [45]69.268.667.170.6
FusionNet [67]-68.867.2-
SparseConvNet [16]-72.5--
MinkowskiNet [7]72.273.665.4-
PACov [56]--66.669.3
PointTransformer [69]--70.473.5
Sparse U-Net (Baseline)72.9-66.972.6
Sparse EQ-Net (Ours)75.374.371.377.5
Improvement+2.4-+4.4+4.9
+ +Table 1. Semantic segmentation results on mIoU(%) of our method and other 3D networks on ScanNet and S3DIS. The Sparse U-Net is our re-implemented version of SparseConvNet. + +
MethodNetworkmAP @0.25mAP @0.5
ScanNetV2
VoteNet [32]PointNet++58.633.5
VoteNet+PointNet++62.939.9
VoteNet (Ours)EQ-PointNet++64.345.4
GroupFree [26]PointNet++ (L6, O256)67.348.9
GroupFree+PointNet++ (L6, O256)66.347.8
GroupFree (Ours)EQ-PointNet++ (L6, O256)68.050.0
SUN RGB-D
VoteNet [32]PointNet++57.732.9
VoteNet+PointNet++59.135.8
VoteNet (Ours)EQ-PointNet++60.538.5
+ +Table 2. Performance of different methods with PointNet++ and EQ-PointNet++ on ScanNetV2 and SUN RGB-D datasets. ${}^{ + }$ denotes the models reproduced by MMDetection3D [8]. + +structure are included in the supplementary material. + +# 5.1. Semantic Segmentation + +Datasets For point cloud semantic segmentation, we use competitive and popular datasets of ScanNetV2 [9] and S3DIS [1] in our experiments. ScanNetV2 comprises 1,613 indoor scans (1,201/312/100 for train/val/test) with pointwise semantic labels in 20 object categories. S3DIS is composed of 271 point cloud scenes collected from 6 large-scale indoor areas, annotated with 13 semantic classes. For evaluation, we follow the commonly-used S3DIS dataset split [7, 19, 68] to test on Area 5 and train on other 5 areas, and also apply the 6-fold cross validation, which takes each area as test set once. For the evaluation metrics, we adopt the mean Intersection-over-Union (mIoU). + +Models We utilize the voxel-based residual U-Net structure with sparse convolutions [7, 16] as the baseline model in our experiments. The sparse U-Net follows the ED-Paradigm with an encoder network and a decoder one. It is a power + +ful backbone structure in 3D segmentation. We develop our network with EQ-Paradigm based on the sparse U-Net by keeping the encoder as our embedding network and adopting the Q-Net to extract the features for each point. In the embedding stage, the input 3D volume is downsampled for 6 times, providing multi-level support features. We use the center coordinates of the voxels as the support positions and apply the hierarchical Q-Net to fuse the multi-level features to get better feature representations for the query positions. The queried features are then fed into a classifier to produce point-wise semantic predictions. + +Experimental Results We compare our EQ-Net with our baseline model and other 3D networks. The results are shown in Table 1. On both datasets, our method attains higher mIoU than the strong baseline models, with significant gain of $2.4\%$ , $4.4\%$ and $4.9\%$ on ScanNet validation set, S3DIS Area 5 and 6-fold, respectively. Also, compared with recent state-of-the-art 3D segmentation networks, our EQ-Net still achieves higher performance on these two datasets, showing effectiveness of the EQ-Paradigm and our well-designed Q-Net in point-wise prediction tasks. + +# 5.2. Indoor Object Detection + +Datasets We evaluate our method on two popular datasets of ScanNetV2 [9] and SUN RGB-D [43]. ScanNetV2 contains 1,513 scenes with bounding boxes labeled in 18 categories; SUN RGB-D includes 5k training scenes with bounding boxes in 10 classes. Evaluation metric is the mean Average Precision (mAP) with intersection-overunion (IoU) 0.25 (mAP@0.25) and 0.5 (mAP@0.5) following [32]. + +Baseline Models We test our approach on VoteNet [32] and GroupFree [26] for ScanNetV2 dataset, and on VoteNet for SUN RGB-D dataset. All baseline models are publicly available at MMDetection3D [8] codebase. VoteNet is the classical indoor detector serving as the baseline model for all modern methods; GroupFree is the current state-of-the-art indoor detector. + +EQ-PointNet++ PointNet++ [36] is the cornerstone of indoor 3D object detection. Recent methods [26,32] all utilize it to extract sparse point features for detection heads. + +EQ-PointNet++ is the EQ-Paradigm version of PointNet++. It treats a stack of set-abstraction layers as its embedding stage similar to PointNet++ and applies a hierarchical Q-Net in its querying stage to extract query features with multi-level information. Query positions are 1,024 points obtained by applying furthest point sampling (FPS) on the raw input point cloud following [26, 32]. For all models, we replace their PointNet++ backbone networks by our EQ-PointNet++ networks. + +Experimental Results As shown in Table 2, models with EQ-PointNet++ achieve better performance on both + +
SetMethodCar (%)Pedestrian (%)Cyclist (%)
EasyModerateHardEasyModerateHardEasyModerateHard
ValSECOND [61]90.8581.6678.5756.0751.1246.1483.0666.6963.02
EQ-SECOND (Ours)91.7481.4978.6257.4853.6449.5585.0167.1363.34
PointRCNN [40]91.3580.2577.8461.1954.3347.4389.7771.5567.20
EQ-PointRCNN (Ours)91.8084.0082.2964.8058.3652.5591.2371.0966.35
PVRCNN [39]92.0784.7582.4662.3254.4249.8190.3970.4265.99
EQ-PVRCNN† (Ours)92.6385.4182.9766.7859.2354.3493.3475.7171.11
EQ-PVRCNN§ (Ours)92.5285.6183.1369.9562.5556.5191.5174.0269.46
TestPVRCNN [39]90.2581.4376.8252.1743.2940.2978.6063.7157.65
EQ-PVRCNN§ (Ours)90.1382.0177.5355.8447.0242.9485.4169.1062.30
+ +datasets. Specifically, VoteNet with EQ-PointNet++ gains $5.5\%$ and $2.7\%$ mAP@0.5 improvement on ScanNetV2 and SUN RGB-D datasets respectively. On state-of-the-art indoor detector GroupFree [26], our approach brings consistent performance improvement in terms of mAP@0.25 and mAP@0.5 by $0.7\%$ and $1.1\%$ compared to the official results [26] and by $1.7\%$ and $2.2\%$ compared to our reproduced results [8]. These experiments demonstrate our EQ-Paradigm and Q-Net are well adapted into indoor detectors and boost their performance. + +# 5.3. Outdoor Object Detection + +Datasets For outdoor detection, we conduct experiments on the widely adopted KITTI dataset [14]. There are 7,481 training point clouds and 7,518 testing point clouds with 3 categories of "Car", "Pedestrian" and "Cyclist". Following [72], we split the original KITTI training dataset into 3,717 images/scenes train set and 3,769 images/scenes val set. All "AP" results are calculated with 40 recall positions following the official KITTI protocol. + +Baseline Models We select 3 outdoor detectors to demonstrate the superiority of our approach. They are SECOND [61], PointRCNN [40] and PVRCNN [39]. These methods with different heads require varying query position designation. In SECOND, query positions are the pixel centers within the target BEV map; in PointRCNN, all points within the input point cloud serve as query positions; while in PVRCNN, they can be coordinates either of keypoints (EQ-PVRCNN $^{\S}$ ) following the original PVRCNN design or of proposal grids in a straightforward way (EQ-PVRCNN $\dagger$ ). + +Experimental Results As listed in Table 3, our approach yields consistent improvement on different detectors. Especially on PointRCNN, EQ-PointRCNN obtains significant improvements, e.g., $3.75\%$ "AP" improvement on "Car" instances labeled as "Moderate" difficulty. Compared to the state-of-the-art model PVRCNN, our approach achieves remarkable improvement on both KITTI val and test sets. On the test set, EQ-PVRCNN8 attains $3.73\%$ and $5.39\%$ improvement on "Pedestrian" and "Cyclist" instances labeled as "Moderate" difficulty level. + +These practical improvement indicates that EQ- + +Table 3. Performance comparison on the KITTI val and test sets. + +
MethodInputAccuracy (%)
PCNN [2]1k points92.3
RS-CNN (SSG) [23]1k points92.4
PointCNN [19]1k points92.5
KPCov [45]1k points92.9
DGCNN [51]1k points92.9
InterpCNN [28]1k points93.0
DensePoint [22]1k points93.2
Grid-GCN [58]1k points93.1
PosPool [24]5k points93.2
SpecGCN [49]2k points+normal92.1
PointWeb [68]1k points + normal92.3
SpiderCNN [59]1k points+normal92.4
PointConv [54]1k points+normal92.5
PointNet++ (SSG)1k points92.1
EQ-PointNet++ (SSG)1k points93.2
+ +Table 4. Accuracy comparison on the ModelNet40 dataset. + +Paradigm and Q-Net can be widely applied to any 3D outdoor detectors and deliver sustained performance improvement. Meanwhile, by altering query positions, our approach can inspire some new designs on existing methods. As shown in Table 3, by directly obtaining proposal grid features for box prediction to get rid of a few modules (including voxel-set abstraction, predicted keypoint weighting, and RoI-grid Pooling in PVRCNN), EQ-PVRCNN† still achieves impressive performance improvement with concise head design. + +# 5.4. Shape Classification + +Datasets and Models We conduct classification experiments on ModelNet40 dataset [55], which includes 9,843 training and 2,468 testing meshed models in 40 categories. We employ EQ-PointNet++ as our classification model. Query positions are 16 points obtained by furthest point sampling on the input point cloud. In the recognition head, we deploy another set-abstraction layer to summarize the 16 query features for category prediction. + +Experimental Results As shown in Table 4, EQ-PointNet++ surpasses PointNet++ with single-scale grouping (SSG) by $1.1\%$ in terms of classification accuracy. Compared with other classifiers [51], EQ-PointNet++ still yields better performance, showing the generalization ability of EQ-Paradigm and effectiveness of Q-Net. + +
HeadEmbedding NetworkAP (%)
voxel-basedpoint-based
SECOND head (voxel-based)-81.49
-82.70
82.94
PointRCNN head (point-based)-82.65
-84.00
84.38
+ +# 5.5. Ablation Study + +Analysis on the EQ-Paradigm In Table 5, we verify the capacity of EQ-Paradigm in combining point- or voxel-based backbone networks with different task heads by adopting different embedding structures in voxel- and point-based detectors, SECOND [61] and PointRCNN [40]. Experiments are conducted on KITTI validation set with "AP" calculated on "Moderate" difficulty level in class "Car". We use the SparseConvNet in SECOND [61] as the voxel-based embedding network, and PointNet++ without decoder in PointRCNN [40] as the point-based embedding network. + +As illustrated in Table 5, heads in SECOND and PointR-CNN are both applicable to point- and voxel-based embedding stage networks and produce promising performance. This manifests the EQ-Paradigm unifies different 3D architectures. Notably, SECOND with point-based embeddings achieves $1.21\%$ improvement over its voxel-based baseline. This demonstrates that different architectures have unique advantages. For example, point-based architectures extract more precise structural information. + +Meanwhile, in Table 5, we show that voxel- and point-based embedding networks can be simultaneously utilized in an EQ-Paradigm model to yield further improvement. These experiments demonstrate that EQ-Paradigm is vastly flexible in backbone and head selection and is able to combine strengths of points and voxels. + +Analysis on the Hierarchical Q-Net Multi-level features play an important role in recognition [5, 20, 70]. Our EQ-Paradigm is naturally compatible with the multi-level scheme by simply employing multi-level features as support features in the querying stage. We accordingly design a simple and yet effective hierarchical Q-Net structure. We validate the advantage of fusing multi-level information by conducting experiments on point cloud semantic segmentation, which calls for fine-grained features to better segment points on object boundaries. + +Table 6 lists effect of incorporating levels of features in the querying stage on ScanNet validation set. We start from the coarsest layer and gradually include more finer features. Continuous performance improvement is observed with the increasing number of feature levels, manifesting the effectiveness of our hierarchical Q-Net. + +Table 5. AP comparison on different head designs with point- and voxel-based embedding networks. + +
No. of Levels123456
mIoU (%)58.464.168.371.974.275.3
+ +Table 6. Effects of the number of feature levels in our hierarchical Q-Net. The experiments are conducted on ScanNet validation set. + +
MethodSAQuery Position SelectionAP (%)
traintest
EQ-SECONDpatchpatch81.61
patchrandom74.96
-patchpatch81.49
-patchrandom81.49
+ +Table 7. AP comparison on EQ-SECOND utilizing Q-Decoder layer with or without self-attention ("SA") layers. + +Analysis on the Q-Decoder In Q-Decoder layer, to make query positions independent of each other to allow arbitrary query position selection, we remove the self-attention layer for query points in the transformer decoder layer. In Table 7, we compare the performance of EQ-SECOND with and without the self-attention layer on different test modes. Both models are trained in "patch" mode, and tested in modes of "patch" and "random". In "patch" mode, we split the target BEV map into patches with equal sizes, randomly select one patch at each iteration, and treat all pixel centers within the patch as query positions. In "random" mode, we arbitrarily choose pixel centers within the BEV map as query positions. + +The self-attention layer encodes the relation among query positions, thus restricting the choice of query positions at test time. Table 7 shows AP drop of $6.65\%$ on the model with self-attention layer when tested with randomly-selected query positions. Great negative effect of self-attention layer to arbitrary query position selection is observed. In contrast, our model free of self-attention enables arbitrary selection without influencing performance. It is also noticeable that self-attention layer brings limited AP improvement $(0.12\%)$ and incurs large computation overhead when dealing with a large number of query positions. + +# 6. Conclusion + +We have presented a novel unified pipeline of EQ-Paradigm for 3D understanding tasks including object detection, semantic segmentation and classification. The EQ-Paradigm enables combination of 3D backbone architectures, heads and tasks freely. We achieve this by proposing a querying stage to transfer the support features extracted in the embedding stage to the positions required by heads and tasks. We further develop a dedicated Q-Net for the querying stage, applicable to different state-of-the-art models for clear performance improvement. In the future, we plan to generalize our EQ-Paradigm to other 3D tasks like scene completion and instance segmentation. We will extend the EQ-Paradigm as a unified pipeline for all 3D tasks. + +# References + +[1] Iro Armeni, Ozan Sener, Amir Roshan Zamir, Helen Jiang, Ioannis K. Brilakis, Martin Fischer, and Silvio Savarese. 3d semantic parsing of large-scale indoor spaces. In CVPR, 2016. 6 +[2] Matan Atzmon, Haggai Maron, and Yaron Lipman. Point convolutional neural networks by extension operators. ACM Trans. Graph., 2018. 7 +[3] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 4 +[4] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, ECCV, 2020. 4, 5 +[5] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L. Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. TPAMI, 2018. 2, 8 +[6] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In ECCV, 2018. 2 +[7] Christopher B. Choy, JunYoung Gwak, and Silvio Savarese. 4d spatio-temporal convnets: Minkowski convolutional neural networks. In CVPR, 2019. 1, 2, 3, 5, 6 +[8] MMDetection3D Contributors. MMDetection3D: Open-MMLab next-generation platform for general 3D object detection. https://github.com/open-mmlab/mmdetection3d, 2020.6.7 +[9] Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas A. Funkhouser, and Matthias Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In CVPR, 2017. 6 +[10] Stéphane d'Ascoli, Hugo Touvron, Matthew L. Leavitt, Ari S. Morcos, Giulio Biroli, and Levent Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. In ICML, 2021. 4 +[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. 3, 4 +[12] Haoshu Fang, Chenxi Wang, Minghao Gou, and Cewu Lu. Graspnet-1billion: A large-scale benchmark for general object grasping. In CVPR, 2020. 1 +[13] Marco Forte and François Pitie. F, b, alpha matting. CoRR, abs/2003.07711, 2020. 2 +[14] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The KITTI dataset. I. J. Robotics Res., 2013. 1, 7 +[15] Ben Graham. Sparse 3d convolutional neural networks. In BMVC, 2015. 2, 3 + +[16] Benjamin Graham, Martin Engelcke, and Laurens van der Maaten. 3d semantic segmentation with submanifold sparse convolutional networks. In CVPR, 2018. 1, 2, 3, 6 +[17] Li Jiang, Hengshuang Zhao, Shu Liu, Xiaoyong Shen, ChiWing Fu, and Jiaya Jia. Hierarchical point-edge interaction network for point cloud semantic segmentation. In ICCV, 2019. 6 +[18] Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. CVPR, 2019. 2 +[19] Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. Pointcnn: Convolution on x-transformed points. In NIPS, 2018. 1, 2, 6, 7 +[20] Tsung-Yi Lin, Piotr Dólar, Ross B. Girshick, Kaiming He, Bharath Hariharan, and Serge J. Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 8 +[21] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott E. Reed, Cheng-Yang Fu, and Alexander C. Berg. SSD: single shot multibox detector. In ECCV, 2016. 2, 3 +[22] Yongcheng Liu, Bin Fan, Gaofeng Meng, Jiwen Lu, Shiming Xiang, and Chunhong Pan. Densepoint: Learning densely contextual representation for efficient point cloud processing. In ICCV, 2019. 7 +[23] Yongcheng Liu, Bin Fan, Shiming Xiang, and Chunhong Pan. Relation-shape convolutional neural network for point cloud analysis. In CVPR, 2019. 1, 2, 3, 7 +[24] Ze Liu, Han Hu, Yue Cao, Zheng Zhang, and Xin Tong. A closer look at local aggregation operators in point cloud analysis. In ECCV, 2020. 7 +[25] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. CoRR, 2021. 4, 5 +[26] Ze Liu, Zheng Zhang, Yue Cao, Han Hu, and Xin Tong. Group-free 3d object detection via transformers. ICCV, 2021. 2, 6, 7 +[27] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. 2 +[28] Jiageng Mao, Xiaogang Wang, and Hongsheng Li. Interpolated convolutional networks for 3d point cloud understanding. ICCV, 2019. 1, 2, 7 +[29] Ishan Misra, Rohit Girdhar, and Armand Joulin. An End-to-End Transformer Model for 3D Object Detection. In ICCV, 2021. 4 +[30] Xuran Pan, Zhuofan Xia, Shiji Song, Li Erran Li, and Gao Huang. 3d object detection with pointformer. In CVPR, 2021. 2, 4, 5 +[31] Youngmin Park, Vincent Lepetit, and Woontack Woo. Multiple 3d object tracking for augmented reality. In ISMAR, 2008. 1 +[32] Charles R Qi, Or Litany, Kaiming He, and Leonidas J Guibas. Deep hough voting for 3d object detection in point clouds. In ICCV, 2019. 2, 3, 6 +[33] Charles R. Qi, Or Litany, Kaiming He, and Leonidas J. Guibas. Deep hough voting for 3d object detection in point clouds. ICCV, 2019. 2 + +[34] Charles Ruizhongtai Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J. Guibas. Frustum pointnets for 3d object detection from RGB-D data. CVPR, 2018. 2 +[35] Charles Ruizhongtai Qi, Hao Su, Kaichun Mo, and Leonidas J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, 2017. 3, 6 +[36] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J. Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NIPS, 2017. 1, 2, 3, 5, 6 +[37] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. 2 +[38] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In *NAACL-HLT*, 2018. 5 +[39] Shaoshuai Shi, Chaoxu Guo, Li Jiang, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. PV-RCNN: point-voxel feature set abstraction for 3d object detection. In CVPR, 2020. 2, 7 +[40] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointr-cnn: 3d object proposal generation and detection from point cloud. In CVPR, 2019. 2, 3, 7, 8 +[41] Shaoshuai Shi, Zhe Wang, Xiaogang Wang, and Hongsheng Li. Part-a $^2$ net: 3d part-aware and aggregation neural network for object detection from point cloud. arXiv preprint arXiv:1907.03670, 2019. 2 +[42] Martin Simonovsky and Nikos Komodakis. Dynamic edge-conditioned filters in convolutional neural networks on graphs. In CVPR, 2017. 2 +[43] Shuran Song, Samuel P. Lichtenberg, and Jianxiong Xiao. SUN RGB-D: A RGB-D scene understanding benchmark suite. In CVPR, 2015. 6 +[44] Yanan Sun, Chi-Keung Tang, and Yu-Wing Tai. Semantic image matting. In CVPR, 2021. 2 +[45] Hugues Thomas, Charles R. Qi, Jean-Emmanuel Deschaud, Beatrix Marcotegui, François Goulette, and Leonidas J. Guibas. Kpconv: Flexible and deformable convolution for point clouds. ICCV, 2019. 2, 6, 7 +[46] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021. 4 +[47] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, NIPS, 2017. 3, 4, 5 +[48] Chu Wang, Babak Samari, and Kaleem Siddiqi. Local spectral graph convolution for point set feature learning. In ECCV, 2018. 2 +[49] Chu Wang, Babak Samari, and Kaleem Siddiqi. Local spectral graph convolution for point set feature learning. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, ECCV, 2018. 7 +[50] Xintao Wang, Kelvin C.K. Chan, Ke Yu, Chao Dong, and Chen Change Loy. Edvr: Video restoration with enhanced deformable convolutional networks. In CVPR, 2019. 2 + +[51] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E. Sarma, Michael M. Bronstein, and Justin M. Solomon. Dynamic graph CNN for learning on point clouds. ACM Trans. Graph., 2019. 1, 7 +[52] Zhixin Wang and Kui Jia. Frustum convnet: Sliding frustums to aggregate local point-wise features for amodal 3d object detection. In IROS. IEEE, 2019. 2 +[53] Kan Wu, Houwen Peng, Minghao Chen, Jianlong Fu, and Hongyang Chao. Rethinking and improving relative position encoding for vision transformer. 2021. 5 +[54] Wenxuan Wu, Zhongang Qi, and Fuxin Li. Pointconv: Deep convolutional networks on 3d point clouds. In CVPR, 2019, 2, 3, 6, 7 +[55] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In CVPR, 2015. 7 +[56] Mutian Xu, Runyu Ding, Hengshuang Zhao, and Xiaojuan Qi. Paconv: Position adaptive convolution with dynamic kernel assembling on point clouds. In CVPR, 2021. 1, 2, 6 +[57] Ning Xu, Brian L. Price, Scott Cohen, and Thomas S. Huang. Deep image matting. In CVPR, 2017. 2 +[58] Qiangeng Xu, Xudong Sun, Cho-Ying Wu, Panqu Wang, and Ulrich Neumann. Grid-gcn for fast and scalable point cloud learning. In CVPR, 2020. 7 +[59] Yifan Xu, Tianqi Fan, Mingye Xu, Long Zeng, and Yu Qiao. SpiderCNN: Deep learning on point sets with parameterized convolutional filters. In ECCV, 2018. 2, 7 +[60] Xu Yan, Chaoda Zheng, Zhen Li, Sheng Wang, and Shuguang Cui. Pointasnl: Robust point clouds processing using nonlocal neural networks with adaptive sampling. In CVPR, 2020. 6 +[61] Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 2018. 1, 2, 3, 7, 8 +[62] Jianwei Yang, Chunyuan Li, Pengchuan Zhang, Xiyang Dai, Bin Xiao, Lu Yuan, and Jianfeng Gao. Focal self-attention for local-global interactions in vision transformers. CoRR, 2021. 4, 5 +[63] Zetong Yang, Yanan Sun, Shu Liu, and Jiaya Jia. 3dssd: Point-based 3d single stage object detector, 2020. 2, 3 +[64] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia. IPOD: intensive point-based object detector for point cloud. CoRR, 2018. 2 +[65] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia. STD: sparse-to-dense 3d object detector for point cloud. ICCV, 2019. 2 +[66] Zetong Yang, Yin Zhou, Zhifeng Chen, and Jiquan Ngiam. 3d-man: 3d multi-frame attention network for object detection. In CVPR, 2021. 4 +[67] Feihu Zhang, Jin Fang, Benjamin Wah, and Philip Torr. Deep fusionnet for point cloud semantic segmentation. In ECCV, 2020. 6 +[68] Hengshuang Zhao, Li Jiang, Chi-Wing Fu, and Jiaya Jia. Pointweb: Enhancing local neighborhood features for point cloud processing. In CVPR, 2019. 2, 6, 7 + +[69] Hengshuang Zhao, Li Jiang, Jiaya Jia, Philip H. S. Torr, and Vladlen Koltun. Point transformer. In ICCV, 2021. 1, 2, 4, 5, 6 +[70] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017. 2, 8 +[71] Xingyi Zhou, Dequan Wang, and Philipp Krahenbuhl. Objects as points. CoRR, 2019. 1 +[72] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. CVPR, 2018. 2, 7 \ No newline at end of file diff --git a/aunifiedquerybasedparadigmforpointcloudunderstanding/images.zip b/aunifiedquerybasedparadigmforpointcloudunderstanding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6983ed7e57b63c96f0b494a3eab050cc365e06ad --- /dev/null +++ b/aunifiedquerybasedparadigmforpointcloudunderstanding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edcd2be7abdb606c3c6bad3412ba8b9fdde782dfa51a686c3ac513660e93bd2b +size 517811 diff --git a/aunifiedquerybasedparadigmforpointcloudunderstanding/layout.json b/aunifiedquerybasedparadigmforpointcloudunderstanding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c9e0211d39cce98483a34e8afa31431364e655fe --- /dev/null +++ b/aunifiedquerybasedparadigmforpointcloudunderstanding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c551f4003ead2738c62574bfaa4250ae07e11de09c2e4d4ccfc9cd2c89a780f +size 461841 diff --git a/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_content_list.json b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0dcb8883c204c3fde4d779745e5ee8eca9a97f56 --- /dev/null +++ b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf81a8b1d2269638777f3c17a0f37b322e97581c1f3fc4b69af1cc46b3f8638d +size 84400 diff --git a/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_model.json b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_model.json new file mode 100644 index 0000000000000000000000000000000000000000..50947f7eaad5f65b36598f0555c72da092dd4c20 --- /dev/null +++ b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3b76eb620a632f900df931ad359436ae2f7fa9050425006bb6ba115cc9c1477 +size 101963 diff --git a/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_origin.pdf b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ce05a49598637125336f85551cc754aa9eb99419 --- /dev/null +++ b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/8e11e823-1196-4601-9919-bc8117b10a63_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:321cc662a226f7ce1bb7968f46189cff83103bd9781f3d455454ee232fc061df +size 5008196 diff --git a/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/full.md b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d9b063de7c7e99e9fb10e9e53d9efb1f58a91e89 --- /dev/null +++ b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/full.md @@ -0,0 +1,395 @@ +# AUV-Net: Learning Aligned UV Maps for Texture Transfer and Synthesis + +Zhiqin Chen $^{1,2}$ Kangxue Yin $^{1}$ Sanja Fidler $^{1,3,4}$ + +NVIDIA Simon Fraser University2 University of Toronto Vector Institute4 + +# Abstract + +In this paper, we address the problem of texture representation for 3D shapes for the challenging and under-explored tasks of texture transfer and synthesis. Previous works either apply spherical texture maps which may lead to large distortions, or use continuous texture fields that yield smooth outputs lacking details. We argue that the traditional way of representing textures with images and linking them to a 3D mesh via UV mapping is more desirable, since synthesizing 2D images is a well-studied problem. We propose AUV-Net which learns to embed 3D surfaces into a 2D aligned UV space, by mapping the corresponding semantic parts of different 3D shapes to the same location in the UV space. As a result, textures are aligned across objects, and can thus be easily synthesized by generative models of images. Texture alignment is learned in an unsupervised manner by a simple yet effective texture alignment module, taking inspiration from traditional works on linear subspace learning. The learned UV mapping and aligned texture representations enable a variety of applications including texture transfer, texture synthesis, and textured single view 3D reconstruction. We conduct experiments on multiple datasets to demonstrate the effectiveness of our method. + +# 1. Introduction + +The field of 3D shape reconstruction and synthesis has witnessed significant advancements in the past few years. By utilizing the power of deep learning, several works reconstruct 3D shapes from voxels, point clouds, single and multi-view images, with a variety of output shape representations [12, 14, 15, 20, 24, 30, 51]. 3D generative models have also been proposed to synthesize new shapes [4, 11, 19, 34, 39], with the aim of democratizing 3D content creation. However, despite the importance of textures in bringing 3D shapes to life, very few methods have tackled semantic-aware texture transfer or synthesis for 3D shapes [5, 10, 18, 22, 35, 36, 50]. + +Previous work on texture generation mostly relies on warping a spherical mesh template to the target shape [5, 10, 22, 35], therefore obtaining a texture map defined on + +![](images/f094c9f09595da3f7d6401cbaedb74ee7bedddd7595c4992ab8d3a67cff29b35.jpg) +Texture image (front part) + +![](images/77d052b5313fea275726805a09afb0d55fb026acd7d947cfc5b096d3edd9d318.jpg) +Textured + +![](images/61721db8c93367cc4eb6cbc4a6ed2005023c4723b046d100e952d55a9395e232.jpg) + +![](images/9eb6c2d677003cd9e30f3db0c6e1aa92208b945514ddfa49530de91b8e264228.jpg) + +![](images/a1ea3d5225d54c91cb9ea0bb0de2b9e48d2f6a856d21053ed86f61396e9e995d.jpg) + +![](images/f97a003e10e0e7e64cffbf0aa34f21d4760fa544e46ef5ac9d9b22f354089c22.jpg) + +![](images/f82b952ca91eb7770174f435abc29cd7f433de2b816b1b1dd9a0864ab3b6a58e.jpg) + +![](images/53abc59b46382cf4263c03069b1e24756e034bef3245d5bd83dacf5f43ed1a06.jpg) + +![](images/402ad21262428be3aaf14d1d53bd13e79cb6f3854ba70a735d44d39e234f25c5.jpg) + +![](images/fa384b017391ebb5c55e98d83d1fb7b17a3213518336555229ce59fdee62cf90.jpg) + +![](images/af7fb650c8f30ea09a3fac29f75e46495afda4d22bc88a23fd4775513ad592a8.jpg) + +![](images/454e9698392ac1ce6b0603ce41ac8c4045b461d06895553ffb72a5b3507a7a9a.jpg) + +![](images/316822e4155d1c6b9673b946e8ce83aa3fbf52b0677116953bcaa769289641d1.jpg) + +![](images/d5225cc501828ea163515ccfb58a2675fa06114b09f5a2a4dd500541c63c94f6.jpg) + +![](images/98c30f597940a5e40c1c141d2853329451f5e7fd2f54b6f7b348b12f489f9b1a.jpg) + +![](images/6119714713f809286b71a9fe173b5f14fddf78d8a2f10aaed76ea8600c7da302.jpg) +Figure 1. AUV-Net learns aligned UV maps for a set of 3D shapes, enabling us to easily transfer textures between shapes. + +![](images/e1b0335e3074fc9c2636ed81281ccb697ef2d99ec662b5db386ecf993803dc4e.jpg) + +![](images/85a036647ee5b065bd0c05bce1e2ef92dadbea35e2dad670ec66728e36e05689.jpg) + +![](images/eef7c79f89b335789be302ecb374c2d10d3c302b3dac6ac28be563b68cb58653.jpg) + +![](images/caec67ac2ae6a7d30f24746255954a6dc2f3ab286404f2513084911ab404ddd7.jpg) + +the sphere's surface, which can be re-projected into a square image for the goal of texture synthesis. NeuTex [47] generates 3D shapes with a neural implicit representation for arbitrary surface topology, yet embeds the surface of the shape onto a sphere, which also results in a spherical texture map. Spherical texture maps can only support limited topology, and may introduce severe distortions for thin parts such as animal limbs [27, 43]. Another line of work uses implicit texture fields for texture synthesis [32], without relying on explicit texture mapping. Although texture fields were successfully applied to multi-view image reconstruction [31], they have primarily been used for fitting a single object or scene. Generative models usually suffer from overly smoothed synthesized textures [37, 48]. + +In contrast, the traditional UV mapping in computer graphics handles arbitrary shape topology and avoids heavy distortions by cutting the surface into pieces and mapping different pieces to different regions on the 2D UV plane. It further preserves texture details by storing the texture in a + +high-resolution texture image. However, the UV mappings are usually created by 3D artists, and thus are inconsistent across different shapes. Therefore, using such representation for texture synthesis and transfer would require dense shape correspondences. + +In this paper, we propose to train a neural network to predict the UV mapping and the texture image jointly, aiming at high-quality texture transfer and synthesis without needing to conform to a pre-defined shape topology. Specifically, our network learns to embed 3D coordinates on mesh surfaces into a 2D aligned UV space, where corresponding parts of different 3D shapes are mapped to the same locations in the texture image, as shown in Figure 1. Such alignment is enabled by a simple yet effective texture alignment module inspired by traditional linear subspace learning methods such as Principal Component Analysis (PCA), as shown in Figure 3. The network generates a basis shared by all shape textures, and predicts input-specific coefficients to construct the texture image for each shape as a linear combination of the basis images. This forces the texture images to be aligned so that they can be effectively decomposed into combinations of basis images, as visualized in Figure 2. Afterwards, the network reconstructs the colors of the input shape by learning a UV mapping to index the aligned texture image. To unwrap 3D shapes of complex structure or topology, we further introduce a masking network that cuts the shape into multiple pieces to reduce the distortion in the UV mapping. + +Our method effectively aligns textures across all shapes, allowing us to swap textures between different objects, by simply replacing the texture image from one object with another. The aligned high-quality texture images produced by our method make it significantly easier to train generative models of textures, since they are aligned and disentangled from geometry. They also enable textured 3D shape reconstruction from single images. We perform extensive experiments on multiple categories including human heads, human bodies, mammals, cars, and chairs, to demonstrate the efficacy of our approach. + +# 2. Related work + +We discuss previous work that is most relevant to ours in the fields of texture transfer and synthesis for 3D shapes. + +Template-based methods assume that all target shapes can be represented by deforming a template mesh, usually a sphere [5, 10, 22, 27, 35, 43] or a plane [33, 46]. The UV mapping of the template mesh is given and transferred to the target shape after deformation. However, by imposing a mesh template, these methods often cannot capture details, especially when the topology or the structure of the target shape is complex. For example, when deforming a sphere into a human body, it is hard to accurately reconstruct the fingers. Even if the deformation is successful, the texture of + +the fingers, when projected from the human body to a sphere and then to its texture image, is typically heavily distorted. + +UV map from artists. Another line of work [8, 50] does not assume template meshes are given, but instead assumes that the UV maps are provided with the 3D shapes. The UV maps and textures are typically modeled by artists and can be in arbitrary layouts. To address this issue, these methods usually require ground-truth semantic segmentation of the texture image or the 3D shape for semantic-aware texture synthesis. In our work, we aim to perform texture synthesis without such supervision. Automatic UV mapping has also been extensively studied in computer graphics, though for single shapes. It includes mesh parameterization with certain constraints, and surface cutting to generate charts with disk topology. We refer to [38] for a survey of related techniques. Different from these traditional methods, we learn aligned UV maps for a set of shapes. + +Discretization and colorization. Instead of adopting UV maps to reduce the dimensionality of textures from 3D to 2D, some methods discretize the 3D shapes into "atoms" and then colorize each "atom". When a shape is represented as a voxel grid, the shape can be textured by predicting the color of each voxel [9, 41]. For triangle meshes, the color of each vertex can be predicted [17]. However, since discretization is in 3D rather than in 2D (pixels), these approaches either cannot scale up, or cannot predict the color efficiently due to the irregularity of the representation. + +Texture fields [32] predict the color for each 3D point in a continuous 3D space. The NeRF family [31] also adopts this approach, by using the viewing direction as an additional condition for predicting the color of each point. Since the NeRF family does not directly generate textures for 3D shapes, we mainly discuss and compare with Texture Fields in this paper. One major issue of Texture Fields is that it is unable to represent high-frequency details, which is a property of the MLPs that it uses. Positional encoding [31] and SIREN [40] are proposed to alleviate this issue, which works well on overfitting of single shapes. However, performance degrades significantly in generative tasks. The results of implicit methods tend to be smooth and lack high-frequency details [6, 40]. + +Shape correspondences. There is a large body of work that finds dense correspondences among shapes [16, 28], which can also enable texture transfer. However, these methods do not take color into account when finding correspondences, which may hinder their performance. + +# 3. Our Approach + +In this section, we first introduce our core alignment module in 2D and verify it with a 2D-to-2D image alignment experiment in Sec 3.1. We then explain our network architecture for learning aligned UV maps for 3D shapes in Sec 3.2. Finally, in Sec 3.3 we show applications enabled by + +![](images/c5de231c8a07b95ab5a58da657502b8da014953170b951c0ea3f41ae4faaae21.jpg) +(a) Input images + +![](images/6fe292884824b0d7d088c0b766c781143a7808ad8ce3172cd8fe83af2f9f841a.jpg) +(b) Outputs + +![](images/ea4e57f51c58e135916feea360d16de43ae04c5dc5689864951b6d54b9b29874.jpg) +(c) Learned texture images +Figure 2. Results of the 2D toy experiment on the face dataset. Our network reconstructs input images (a) by learning a set of basis images (d) and linearly combining them into aligned texture images (c), and then deforming the texture images (c) into the outputs (b) via learned UV mapping. The learned UV mapping can be used to deform the input images (a) into aligned high-quality texture images (e). + +![](images/f84f246efc45abd1436677b281b2974992c62dc4aa253c1f6579282fb8eb0423.jpg) +(d) Learned basis images + +![](images/7e600fb55807c6969928f21166901e094c862487d327a11582ae17557241fbb5.jpg) +(e) Aligned textures by deforming (a) + +![](images/dc5ce5d295eddd7224f42779c37b6ec91c4617e7286a087cd6e551385dfdaf97.jpg) +Figure 3. Network architecture of the 2D toy experiment on the face dataset, to demonstrate the concept of our alignment module. + +our approach, including texture transfer, texture synthesis, and texture prediction from single images. + +# 3.1. Texture alignment module + +Learning aligned textures for a set of shapes is a complex task. However, we show that a simple alignment module performs surprisingly well. Before we introduce our network for 3D shapes, we will use a toy 2D experiment to demonstrate how the alignment module works. + +Task. Given a set of face images in random poses, as shown in Fig. 2(a), we aim to align them into a canonical pose, as shown in Fig. 2(e). We take 1,000 face images from CelebA-HQ [25,29] and perform random perspective transformations to obtain 128x128 training images, such as those in Fig. 2(a). To link this task with texture mapping, one could consider training images in Fig. 2(a) as square shapes in 2D, and Fig. 2(e) are their aligned texture images. The color of each pixel in the square shape must be retrieved from the shape's texture image, by mapping the pixel's coordinates into the UV space to get the UV coordinates, and then indexing the texture image with those UV coordinates. + +Insight. We take inspiration from classic linear subspace learning methods such as eigenfaces [44], where a basis is computed via PCA for a set of face images, so that each face is decomposed into a weighted sum of the eigenfaces. Note that PCA works best when the images are aligned. Therefore, if a network is designed to decompose the input im + +ages into weighted sums of basis images, and is allowed to deform the input images before the decomposition, the network should learn to align the input images into a canonical pose, and decompose the aligned images so as to minimize the reconstruction error. + +Framework. Fig. 3 illustrates our alignment module operating for 2D images. It is composed of three neural networks: a basis generator to predict a set of basis images; an encoder to predict the coefficients to weigh the basis images; and a UV mapper to predict the UV coordinates for each query point. The encoder also predicts a shape code to condition the UV mapper. + +**Basis generator.** Our basis generator is a Multilayer Perceptron (MLP) that takes a 2D point $(x, y)$ as input and outputs the color of this point. For $N$ basis images, the network outputs $N$ values ( $N$ gray-scale colors). In this toy 2D experiment, we use $N = 128$ . We adopt an MLP for generating the basis because it is fully differentiable with respect to both the colors of the basis and the input point coordinates. In contrast, if a Convolutional Neural Network (CNN) or a grid of learnable weights is applied to generate the basis, one would need to index the output grid with query points, limiting the gradients from the output color to the basis and the query point coordinates to small neighborhoods. + +UV mapper. Once trained, we can input a regular grid of query points to the basis generator to obtain the aligned basis images such as those in Fig. 2(d), and the aligned texture images shown in Fig. 2(c) by multiplying the basis images with the coefficients. However, at training time, we need to "deform" the texture images to reconstruct the input images in Fig. 2(a). This is achieved by the UV mapper, which maps the query points sampled from the square shape into UV coordinates to index the texture image, as shown in Fig. 3. The final deformed outputs are shown in Fig. 2(b). The UV mapper is an MLP conditioned on a shape latent code. It takes 2D point coordinates concatenated with the shape code as input, and outputs UV coordinates. + +Encoder and loss function. Since the inputs are images, we use a 2D CNN as our encoder to predict shape codes + +![](images/921d59db6223f1e3b9932fa666b49d72be47759cf66e7210f9ae3bb1a5021099.jpg) +Figure 4. Network architecture of our AUV-Net. + +and coefficients. The deformed basis produced by the basis generator is multiplied with the coefficients to produce the final output, as shown in Fig 3. We use Mean Squared Error (MSE) between the output and the input image as the reconstruction loss. During early stage of training (first few epochs), we apply a prior loss, i.e., MSE between the query point coordinates and their corresponding UV coordinates, to encourage the UV mapper to perform an identity mapping, so that the basis is initialized with appropriate orientation, scale, and position. + +Obtaining high-quality texture images. After training, our network produces aligned texture images as shown in Fig. 2(c). However, the images are in low quality since they are constructed by a limited number of over-smoothed basis images. To obtain a high-quality texture image with details, we can deform the input image into the UV space. We sample points from the input image, feed those points to the UV mapper to obtain UV coordinates, use the UV coordinates and colors of the sampled points to fill a blank image, and finally inpaint the missing regions. We use [42] for inpainting. The results are shown in Fig. 2(e). + +# 3.2. Learning aligned UV maps for 3D shapes + +Our network for 3D shapes, dubbed AUV-Net, is built upon the alignment module in Fig. 3. It can be thought of as a 3D-to-2D version of the 2D-to-2D alignment module, with modifications to address issues caused by the properties of 3D shapes. The architecture of AUV-Net is shown in Fig. 4. In the following, we will first describe the notable changes in AUV-Net compared to the 2D alignment module, and then the loss functions and training details. + +Predicting color, normal, and coordinate maps. 3D shapes tend to have textures with large areas of pure color or similar colors. Those featureless regions make it hard + +for our network to align the textures with only a loss function defined on colors. Therefore, in addition to the color maps, our network also produces normal maps and coordinate maps, as shown in Fig. 4 top-right. The normal maps are used for predicting the unit normals of input points. The coordinate maps are used for predicting the positions of the input 3D points, therefore forming a 3D-2D-3D cycle in our network, which encourages injective UV mapping. + +Cutting surfaces with a masking network. Unlike images, it is usually impossible to embed a 3D shape onto a 2D plane without overlap or severe distortion. Therefore, we introduce a masker, to generate a segmentation mask for the input shape, as shown in Fig. 4 bottom-left. This can be considered as cutting the 3D shape into multiple pieces, so that each piece can be represented by a single texture image. The input to the masker contains point coordinates, point normals, and the shape code. The normals are essential to segmenting the shapes, since thin parts such as fingers on a human body mesh are very hard to segment with only point coordinates. The predicted segmentation mask $(M)$ is used to mask the outputs of the two basis generators $(A$ and $B)$ , as $M\cdot A + (1 - M)\cdot B$ , to produce the final output. + +Multiple basis generators. We introduce two basis generators to represent the "front" and the "back" part of a shape, respectively. The "front" does not have to literally denote the front-facing part of a shape. It simply refers to a part of the shape so that the union of the "front" and "back" covers the entire shape. The outputs of the two basis generators are shown in Fig. 4 right, where the head is being represented with two texture maps. Note that the number of basis generators does not have to be two; we use four basis generators for chairs in our experiments. + +Shared UV mapper. We use one shared UV mapper for both the front and the back basis generators, instead of two + +independent UV mappers. This is based on a careful consideration. In our experiments, one of the most prominent issues when we transfer the texture from one shape to another is that we inevitably obtain seams between the two pieces of shapes using two different texture images. A shared UV mapper alleviates this issue by forcing the two pieces to share the same boundary in the texture images. It does not fully resolve the seam issue, but it is very helpful in practice. After we inpaint the texture images, the seams are barely visible in most cases. + +Loss functions. To train AUV-Net, the meshes are converted into point clouds with normals and colors, as input to our network. We also voxelize the point clouds to obtain colored voxel grids as input to the 3D CNN encoder. The overall loss function is composed of five terms: + +$$ +L = w _ {c} L _ {c} + w _ {n} L _ {n} + w _ {x} L _ {x} + w _ {s} L _ {s} + w _ {p} L _ {p} \tag {1} +$$ + +where $L_{c}, L_{n}, L_{x}$ denote the color loss, the normal loss, and the cycle consistency loss on the 3D coordinates, respectively. They are defined as MSEs between the predictions and the ground truth. + +$L_{s}$ is the smoothness loss. For a subset of input points, we find their neighbors within a distance $\sigma = 0.02$ , and use the distances between the points and their neighbors to regularize the corresponding distances in the UV space: + +$$ +L _ {s} = \frac {1}{M N} \sum_ {i = 1} ^ {M} \sum_ {j = 1} ^ {N} | D (p _ {i}, p _ {j}) - D (q _ {i}, q _ {j}) | \cdot T (p _ {i}, p _ {j}) \tag {2} +$$ + +where $N$ is the number of input points, $M$ is the size of the subset, $p_i$ is the $i$ -th input 3D point, $q_i$ is the 2D UV point predicted for $p_i$ by the UV mapper. $D(a,b)$ is the Euclidean distance between point $a$ and $b$ . $T(a,b)$ is defined as 1 if $D(a,b) < \sigma$ , and 0 otherwise. In each mini-batch, we process one shape, with $N = 16,384$ and $M = 2,048$ . + +$L_{p}$ is the prior loss to initialize the UV coordinates and the masks. It may vary per category of the training shapes. For the human head dataset shown in Fig. 1 and Fig. 4, where all the heads are facing $z$ direction, we have: + +$$ +L _ {p} = \frac {1}{N} \sum_ {i = 1} ^ {N} \left(p _ {i} ^ {x} - q _ {i} ^ {x}\right) ^ {2} + \left(p _ {i} ^ {y} - q _ {i} ^ {y}\right) ^ {2} + \left(m _ {i} - n _ {i}\right) ^ {2} \tag {3} +$$ + +where $p_i^x$ is the x coordinate of $p_i$ , $q_i^x$ is the x coordinate of $q_i$ , $m_i$ is the masking value predicted by the masker for $p_i$ . $n_i$ is defined as 1 if the unit normal of $p_i$ in the z direction is greater than -0.5, and 0 otherwise. This prior loss initializes the UV mapping by projecting the 3D points onto the xy-plane. To cut the shape into two pieces, this prior loss follows our prior that: if the angle between a point's normal and z axis is less than 120 degrees, the point belongs to the "front" part. Similar to Sec. 3.1, prior loss is only used in + +the first few epochs of training to initialize the mask and the UV coordinates. We provide the definitions of prior losses for other categories in the supplementary. + +Assumptions on the training set. Note that the above loss terms assume certain properties of the training dataset. First, the shapes need to have part-level correspondences, as the network actually assigns dense correspondences between shapes when it maps all shapes into the same UV space. Therefore, we only train our model on 3D shapes of the same category. Second, the shapes need to be pose aligned, e.g., heads should all face z direction in the aforementioned human head dataset. We also normalize all shapes to unit boxes before training, to avoid interference of drastically different scales. + +Multi-stage training. We train the network in three stages, due to a trade-off between the quality of the texture alignment and the level of distortion. In some cases, aligning textures requires heavy distortion in the texture images, e.g., when aligning a sedan with a van (Fig. 5). However, less distortion is a desirable feature that reduces aliasing effect when rendering the textures, and makes post-processing easier, e.g., when being edited by an artist. We find that if the network is trained with fixed weighting of the loss terms, we cannot get both the alignment and minimal distortion. Therefore, we first initialize the network with prior loss $L_{p}$ and a set of weights focused on minimal distortion. In the second stage, we remove $L_{p}$ , and use weights focused on alignment. In the final stage, we use weights focused on minimal distortion. For the human head dataset, the first stage has 10 epochs, with $\{w_{c}, w_{n}, w_{x}, w_{s}, w_{p}\} = \{1, 0.5, 100, 100, 1\}$ ; second stage has 2,000 epochs, with $\{1, 0.5, 1, 1, 0\}$ ; third stage has 2,000 epochs, with $\{1, 0.5, 100, 100, 0\}$ . Training takes 2 days on one NVIDIA RTX 3080 Ti GPU. Other training details are in the supplementary. + +# 3.3. Applications + +Texture transfer. After training AUV-Net, we obtain aligned high-quality texture images $(1024^2$ in our experiments) for all training shapes, as shown in Fig. 1. The fact that these texture images are aligned allows us to transfer textures between two training shapes by simply swapping their texture images, as shown in Fig. 1 and 5. We denote this application as Tsf (transfer). Given a new shape that is not in the training set, we can also texture it by mapping its vertices into the aligned UV space. This is done via a posttraining optimization stage, in which we add the new shape into the training set, and continue training the network for a few epochs. During the optimization, we fix the weights of the basis generators to reuse the well-learned texture basis. + +Texture synthesis. A great advantage of having aligned texture images is that it allows us to utilize existing 2D generative models to synthesize new textures for 3D shapes. + +
Dataset nameNumber of ShapesApplications
ShapeNet [7] cars7,497Tsf, Gen, SVR
ShapeNet [7] chairs6,778Tsf, Gen, SVR
Turbosquid [3] cars436Tsf
RenderPeople [1] human bodies500Tsf
Triplegangers [2] heads515Tsf, Gen
Turbosquid [3] animals442Tsf
+ +Table 1. Datasets used in our experiments. Tsf, Gen, and SVR refer to the applications listed in Sec. 3.3. + +We train StyleGAN2 [26] in experiments and show results in Fig. 9. We denote this application as Gen (generation). + +Single-image 3D reconstruction. We can condition texture synthesis on a variety of inputs, for example, reconstructing textured 3D shapes from single images, as shown in Fig. 10. To this end, we add a 2D ResNet [21] image encoder to predict the texture latent code and the shape code from an input image, a CNN decoder to predict the aligned texture images from the texture latent code, and an IM-Net decoder [14] to predict the geometry of the shape conditioned on the shape code. We denote this application as SVR (single view reconstruction). Implementation details are provided in the supplementary. + +# 4. Experiments + +Datasets. We use six datasets in our experiments, as listed in Table 1. Information about dataset licenses is in the supplementary. We mainly perform generative tasks (Gen, SVR) on ShapeNet [7] categories since other datasets have too few training shapes. Note that the original shapes in ShapeNet usually have complex geometry but simple textures. We create a new version of ShapeNet Cars and Chairs better suited for the texture transfer/synthesis task, by simplifying the meshes to reduce geometric details and baking the geometric details into textures. + +# 4.1. Texture Transfer + +We show texture transfer results in Fig. 1 and 5. Only non-ShapeNet categories are shown due to page limit. More results can be found in the supplementary. Our method uses cues such as colors, normals, and positions when learning aligned UV mapping, and therefore performs well on aligning facial orifices, car windows and wheels, fingers, and animal limbs. Previous methods find dense correspondences among shapes by deforming geometry [16, 28]. However, they do not utilize color information, and may thus misalign regions with fewer geometric cues, as shown in Fig. 6. We show results on transferring textures to new shapes that are clearly different from the training shapes in Fig. 5. Our method is able to correctly texture an oversimplified texture-less car model, and transfer textures to a cartoon character model. + +Quantitative evaluation. To evaluate the alignment quality, we label one texture image with a different color per semantic part, as shown in Fig. 7 (b). Since the texture image + +![](images/0f9efd28aeefa388be07786936943b0220e0ca7ab71d7e9313858b8c415e63ee.jpg) + +![](images/d8cc7d42b4b7b02ee7076c3d15ac0d1ca58a370d2d611ded43725ff622ac8d58.jpg) + +![](images/b4cc6e19845a37c932cd4e69b8f96a73aa3a2e50c2cf25a489956018ffaf2be3.jpg) +Figure 5. Texture transfer results. We show three categories in this figure: Turbosquid cars (top), Turbosquid animals (middle), and RenderPeople human bodies (bottom). Triplegangers heads can be found in Figure 1. For RenderPeople, we show a zoom-in of the head on the lower left of each shape; we also show zoom-ins of hands for the second column of shapes. + +is aligned across shapes, we get semantic segmentation of 3D shapes with a single labeled example. We evaluate our part segmentation of shapes with ground truth segmentation provided in the ShapeNet part dataset [49]. We compare with BAE-Net [13] that performs one-shot shape segmentation and DIF-Net [16] that learns dense correspondences, and report Intersection Over Union (IOU) in Table 2. Our method outperforms alternatives. + +Ablation study. We provide the ablation study in Table 3 and Fig. 8, where we remove one of the five loss terms in + +![](images/12978c94681901f14c8963f72a4669942c08823cd981f84a95e966cd2d93103d.jpg) +(a) Source texture + +![](images/91815f142611701c8583fbfc318c3ebd56cc2da3a94107b7a08057269be42a44.jpg) +(b) Source geometry + +![](images/8395942ea89ce08318aa94b14751d35275140b9e8d77ed5cb620b2fd90607816.jpg) +(c) DIF-Net +Figure 6. Comparison with DIF-Net [16] on texture transfer. The texture is transferred from (a) to (b). In (c), the eyes' shapes are not changed with respect to (a), the lips are misaligned, and the hat is lower than it should be compared to (b). Those details are mostly represented in colors rather than geometry. + +![](images/cc2feb5bd6745ad6ed8e51186d89c21025ffb33485ed78c36134b522d2f5b208.jpg) +(d) AUV-Net + +![](images/e2fa24c6e17e547a19a22b126a29ed1cc1a1c47f716100fad48a0ebc86f0e876.jpg) + +![](images/cdebced8b6819267358d8dd07ff674b0859a197e8986e999ca2898c182a03786.jpg) +(a) Texture image + +![](images/5c165e83c420c9570fc1b629b88adc822a28d626ba918ec9fa4bf50295ff00e8.jpg) +(b) Segmentation +Figure 7. Sample texture images and segmentation on ShapeNet cars and chairs. (a) shows texture images before inpainting. Note that there are 2 texture images for each car and 4 for each chair. In (b), we show the segmentation we used to produce Table 2. A visualization on 3D shapes is shown in (c). + +![](images/1204e21715a2c1ecce6f55c327e229e5fc9590d94cc618bee480327da3a552ea.jpg) +(c) Visualization + +
Dataset (#parts)ShapeNet cars (4)ShapeNet chairs (4)
Segmented partsWheel, body, hood, roofBack, seat, leg, arm
BAE-Net59.385.2
DIF-Net69.080.3
AUV-Net72.785.8
+ +Eq. 1, or the masker module. We use the same evaluation setting described above. The results are consistent with our design choices of the individual modules. The color loss $L_{c}$ , the normal loss $L_{n}$ , and the cycle loss $L_{x}$ are designed to help find correspondences, therefore removing them often causes the performance to drop (Table 3). The smoothness loss $L_{s}$ is designed to regularize the UV coordinates; it may hurt the correspondence, but removing it can cause certain parts to be squished (Fig. 8 column 4), thus making texture synthesis difficult. The cycle loss $L_{x}$ also helps regularize the UV coordinates since it encourages one-to-one mapping between surfaces of 3D shapes and the 2D textures; removing it causes overlap in the texture images (Fig. 8 column 3). The prior loss $L_{p}$ and the masker are critical to our model, as removing them causes severe segmentation and overlap issues (Fig. 8 column 5&6). Also note that different categories have different sensitivity to the loss terms. As + +![](images/8aaaae54d6891b2129a5158656dc61817ec01cd38133585e053124c68899aeab.jpg) +No $L_{c}$ + +![](images/3a167b3fe0cf6c20787bd2a90e055980f1b7e26b90f34e4d5cd16ec76dca12a2.jpg) + +![](images/394862e68d39748a16d715b75ea2ffb3c1e9b4a05b3ded209007471bda9773d6.jpg) + +![](images/2b082826beefdd9e643aa2cf883749e537073a91c1924f8a7f2040b10aefc5f6.jpg) +Figure 8. Ablation study: learned texture images with different settings. Each chair has four texture images (shown vertically). + +![](images/81f2b8d6d2281127c224ce23f931dab8b97f0d459dc928759a7751c423eb5a39.jpg) +No $L_{n}$ + +![](images/04a9981323fd88d5d8b87e472dbbfeaf2aed8da67fd7739b0656488c29afce00.jpg) + +![](images/c9b031fe9f653148065ffe49d8ddf4176c5075a1f8bb20219c032bf0f92e8573.jpg) + +![](images/3f268e009783cdb71f3bef023c179afdaeb08c41d3a1f60135fae4440c4e06b9.jpg) + +![](images/c15b8de6a0b7dd3351c4c40cefdb4add7adbe16373feebed6a4817bd3bfd400c.jpg) +No $L_{x}$ + +![](images/d8795b0eba9ea334c90fe3670c9d3a55d4872d4af9b667cf033913d9a860831c.jpg) + +![](images/ed71d1e7357d68514785ba129143fa61ae94f0bd5048921a4c4c4aba14cf5a92.jpg) + +![](images/80809554577e13706bdfe6349c500cec6cbb0d4bf5ab20e5d37f0d398e2b8b40.jpg) + +![](images/d8150b104074f4c2913a5c317af9db86fcd4b43cd6c844ee94d20f142ebd3202.jpg) + +![](images/1684f719e0c227c3b78d6e25c1e2dddbb8a6ae45fa93521b9701293107d862da.jpg) + +![](images/2ae4c531528f155f9a5e2f0b520ea88893bb9ee92fea3dbd7b978ca6d46cff50.jpg) +No $L_{s}$ +No $L_{p}$ + +![](images/fde74e917bafd1f13ce45d56d521bd807b1893c05f932b64fb0b6ab99ce3449e.jpg) +No masker + +![](images/fb09eed8bc99d5a39b907a9df2354a714e510738b840b87046a3bb794552788e.jpg) +Full model + +![](images/15a65325bd065277ec850be15180309cb3e4ba064a6369fae476128363ac02ee.jpg) + +![](images/061054b86e5c5c10ca7aad0ded4796eb9ae6c351abf9965546bc73457656e8e1.jpg) + +Table 2. Semantic segmentation results in IOU, comparing with BAE-Net [13] and DIF-Net [16]. + +
No LcNo LnNo LxNo LsNo LpNo maskerFull model
Cars68.571.773.072.870.672.072.7
Chairs85.284.683.787.185.771.185.8
+ +Table 3. Ablation study: semantic segmentation results in IOU. + +
TriplegangersShapeNet carsShapeNet chairs
Tex. Fields24.5953.097.03
AUV-Net5.6912.115.33
+ +Table 4. Quantitative results of generative models in FID. + +shown in Table 3, the car category relies heavily on the colors: removing $L_{c}$ leads to significant performance drop. In contrast, chair category is less sensitive: removing $L_{c}$ has no visible effect on the learned texture maps in Fig. 8. + +# 4.2. Texture Synthesis + +We show texture synthesis results in Fig. 9, and compare them with Texture Fields [32] (TF). Our method generates more details and gets correct alignments, while TF outputs smooth color chunks that are sometimes misaligned. This is because TF uses an MLP to map continuous 3D coordinates into colors, and does not properly disentangle texture and geometry. In contrast, Our method uses a sophisticated 2D generative model trained on aligned texture images to generate the outputs. The texture images aligned by AUV-NET are mostly independent from the actual mesh geometry. + +To evaluate the methods quantitatively, we use Fréchet Inception Distance (FID) [23]. We test on 1,000 shapes for each ShapeNet category and 100 shapes for Triplegangers heads. For each test shape, we generate 5 textures, and render each textured shape into 8 views. Results are presented in Table 4, where our method clearly outperforms baseline. + +# 4.3. Textured Single-View 3D Reconstruction + +We show results in Fig. 10, and compare with TF. For a fair comparison on texture prediction, we use the mesh generated by our method as the output mesh of TF, so that TF only needs to predict textures of the shapes. The results show that our method produces sharper boundaries and more details in the textures. + +In addition to FID evaluated on a set of shapes, we use Structural Similarity Index Measure (SSIM) [45] and feature- $l_{1}$ [32] to evaluate the quality of each rendered view and then average them, as proposed in TF. Table 5 reports + +![](images/8372b36be012e26417ef89a7bf7470fc743d91fe850f63e88eff342742fa2654.jpg) +Figure 9. Texture synthesis results. The holes on chairs are hallucinated via texture transparency (alpha channels in the texture images). + +![](images/9761ec267acfdd6cf177a4ccd0b4666163e76f4bc6e5016549bbf1dc7366db83.jpg) +Figure 10. Textured single view reconstruction results. Zoom in to see the details, e.g., wheels of the cars. + +
ShapeNet carsShapeNet chairs
FIDSSIMfeature-l1FIDSSIMfeature-l1
Tex. Fields92.890.8970.21936.890.8550.193
AUV-Net40.850.8940.18633.260.8530.189
+ +Table 5. Results of textured single view reconstruction. + +the results, with AUV-Net outperforming the baseline. We observe that both methods overfitted on ShapeNet chairs, and are unable to recover the correct textures of complex test shapes. This is likely due to the fact that the dataset has significant variation for chairs, but has insufficient training examples. In addition, we find that SSIM, which is not semantics-aware, may not be a good evaluation metric when the results are not very close to the ground truth. As shown in Table 5, the SSIM of ours and the baseline are very close, though other metrics show clear differences. + +![](images/7c933933f4b2158e87ff3bbccf7a1c4a91a0a2acd666849f1ac54431fc306c43.jpg) +Figure 11. When transferring texture of a cartoon giraffe into other animals, the positions of the eyes are wrong. The cut seam on the hippo is clearly visible, although inpainted. + +# 5. Conclusion, Limitations, and Future Work + +We introduce the first method to learn aligned texture maps for a set of shapes in an unsupervised manner. We show that alignment can be done with a simple alignment module inspired by PCA. The resulting texture images of our method are well aligned and disentangled from geometry. They have enabled several applications including texture transfer, texture synthesis, and textured single view 3D reconstruction, which we showcase in our experiments. + +There are three main limitations of our approach. First, our method does not handle seams that arise when texturing the shape, and only exploits a shared UV mapper network to alleviate the issue. Therefore, seams may become conspicuous for some shapes after transferring textures, as shown in Fig. 11. Second, our method does not always find correct correspondences, especially when the textures are messy, e.g., the animal dataset - one can observe that the eyes are not properly aligned in Fig. 5. Adding weak supervision could help, e.g., annotating two points for the eyes in all training shapes. Third, our method does not handle shapes with complex topology well. In fact, ShapeNet chairs pose a significant difficulty for our method with two basis generators, and we had to use four to avoid overlapping textures. We leave these challenges to future work. + +Acknowledgements. We thank the reviewers for their valuable comments. This work was completed when the first author was carrying out an internship at NVIDIA. + +# References + +[1] Renderpeople. https://renderpeople.com/. 6 +[2] Triplegangers. https://triplegangers.com/. 6 +[3] Turbosquid. https://www.turbosquid.com/. 6 +[4] Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas J Guibas. Learning representations and generative models for 3D point clouds. In ICML, 2018. 1 +[5] Anand Bhattachad, Aysegul Dundar, Guilin Liu, Andrew Tao, and Bryan Catanzaro. View generalization for single image textured 3d models. In CVPR, 2021. 1, 2 +[6] Eric R Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis. In CVPR, 2021. 2 +[7] 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. arXiv preprint arXiv:1512.03012, 2015. 6 +[8] Bindita Chaudhuri, Nikolaos Sarafianos, Linda Shapiro, and Tony Tung. Semi-supervised synthesis of high-resolution editable textures for 3d humans. In CVPR, 2021. 2 +[9] Kevin Chen, Christopher B Choy, Manolis Savva, Angel X Chang, Thomas Funkhouser, and Silvio Savarese. Text2shape: Generating shapes from natural language by learning joint embeddings. ACCV, 2018. 2 +[10] Wenzheng Chen, Jun Gao, Huan Ling, Edward Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to predict 3d objects with an interpolation-based differentiable renderer. In Advances In Neural Information Processing Systems, 2019. 1, 2 +[11] Zhiqin Chen, Vladimir G. Kim, Matthew Fisher, Noam Aigerman, Hao Zhang, and Siddhartha Chaudhuri. Decorgan: 3d shape detailization by conditional refinement. CVPR, 2021. 1 +[12] Zhiqin Chen, Andrea Tagliasacchi, and Hao Zhang. Bspnet: Generating compact meshes via binary space partitioning. CVPR, 2020. 1 +[13] Zhiqin Chen, Kangxue Yin, Matthew Fisher, Siddhartha Chaudhuri, and Hao Zhang. BAE-NET: Branched autoencoder for shape co-segmentation. ICCV, 2019. 6, 7 +[14] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. CVPR, 2019. 1, 6 +[15] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3D-R2N2: A unified approach for single and multi-view 3D object reconstruction. In ECCV, 2016. 1 +[16] Yu Deng, Jiaolong Yang, and Xin Tong. Deformed implicit field: Modeling 3d shapes with learned dense correspondence. In CVPR, 2021. 2, 6, 7 +[17] Jun Gao, Wenzheng Chen, Tommy Xiang, Clement Fuji Tsang, Alec Jacobson, Morgan McGuire, and Sanja Fidler. Learning deformable tetrahedral meshes for 3d reconstruction. NeurIPS, 2020. 2 +[18] Lin Gao, Tong Wu, Yu-Jie Yuan, Ming-Xian Lin, Yu-Kun Lai, and Hao Zhang. Tm-net: Deep generative networks for textured meshes. In Siggraph Asia, 2021. 1 + +[19] Lin Gao, Jie Yang, Tong Wu, Yu-Jie Yuan, Hongbo Fu, Yu-Kun Lai, and Hao Zhang. Sdm-net: Deep generative network for structured deformable mesh. ACM Transactions on Graphics (TOG), 38(6):1-15, 2019. 1 +[20] Thibault Groueix, Matthew Fisher, Vladimir G. Kim, Bryan Russell, and Mathieu Aubry. AtlasNet: A papier-mâché approach to learning 3D surface generation. In CVPR, 2018. 1 +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 6 +[22] Paul Henderson, Vagia Tsiminaki, and Christoph Lampert. Leveraging 2D data to learn textured 3D mesh generation. In CVPR, 2020. 1, 2 +[23] 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. 7 +[24] Krishna Murthy J., Edward Smith, Jean-Francois Lafleche, Clement Fuji Tsang, Artem Rozantsev, Wenzheng Chen, Tommy Xiang, Rev Lebaredian, and Sanja Fidler. Kaolin: A pytorch library for accelerating 3d deep learning research. arXiv:1911.05063, 2019. 1 +[25] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In ICLR, 2018. 3 +[26] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In CVPR, 2020. 6 +[27] Xueting Li, Sifei Liu, Shalini De Mello, Kihwan Kim, Xiaolong Wang, Ming-Hsuan Yang, and Jan Kautz. Online adaptation for consistent mesh reconstruction in the wild. In NeurIPS, 2020. 1, 2 +[28] Feng Liu and Xiaoming Liu. Learning implicit functions for topology-varying dense 3d shape correspondence. In NeurIPS, 2020. 2, 6 +[29] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In ICCV, 2015. 3 +[30] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3D reconstruction in function space. In CVPR, 2019. 1 +[31] Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. 1, 2 +[32] Michael Oechsle, Lars Mescheder, Michael Niemeyer, Thilo Strauss, and Andreas Geiger. Texture fields: Learning texture representations in function space. In ICCV, 2019. 1, 2, 7 +[33] Xingang Pan, Bo Dai, Ziwei Liu, Chen Change Loy, and Ping Luo. Do 2d gans know 3d shape? unsupervised 3d shape reconstruction from 2d image gans. In ICLR, 2021. 2 +[34] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. DeepSDF: Learning continuous signed distance functions for shape representation. In CVPR, 2019. 1 + +[35] Dario Pavllo, Graham Spinks, Thomas Hofmann, Marie-Francine Moens, and Aurelien Lucchi. Convolutional generation of textured 3d meshes. NeurIPS, 2020. 1, 2 +[36] Amit Raj, Cusuh Ham, Connelly Barnes, Vladimir Kim, Jingwan Lu, and James Hays. Learning to generate textures on 3d meshes. In CVPR Workshops, 2019. 1 +[37] Katja Schwarz, Yiyi Liao, Michael Niemeyer, and Andreas Geiger. Graf: Generative radiance fields for 3d-aware image synthesis. In NeurlPS, 2020. 1 +[38] Alla Sheffer, Emil Praun, and Kenneth Rose. Mesh parameterization methods and their applications. Foundations and Trends® in Computer Graphics and Vision, 2(2):105-171, 2007. 2 +[39] Tianchang Shen, Jun Gao, Kangxue Yin, Ming-Yu Liu, and Sanja Fidler. Deep marching tetrahedra: a hybrid representation for high-resolution 3d shape synthesis. In NeurIPS, 2021. 1 +[40] Vincent Sitzmann, Julien Martel, Alexander Bergman, David Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. NeurIPS, 2020. 2 +[41] Yongbin Sun, Ziwei Liu, Yue Wang, and Sanjay E Sarma. Im2 avatar: Colorful 3d reconstruction from a single image. arXiv preprint arXiv:1804.06375, 2018. 2 +[42] Alexandru Telea. An image inpainting technique based on the fast marching method. Journal of graphics tools, 9(1):23-34, 2004. 4 +[43] Shubham Tulsiani, Nilesh Kulkarni, and Abhinav Gupta. Implicit mesh reconstruction from unannotated image collections, 2020. 1, 2 +[44] Matthew Turk and Alex Pentland. Eigenfaces for recognition. J. Cognitive Neuroscience, 3(1):71-86, 1991. 3 +[45] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600-612, 2004. 7 +[46] Shangzhe Wu, Christian Rupprecht, and Andrea Vedaldi. Unsupervised learning of probably symmetric deformable 3d objects from images in the wild. In CVPR, pages 1-10, 2020. 2 +[47] Fanbo Xiang, Zexiang Xu, Milos Hasan, Yannick Hold-Geoffroy, Kalyan Sunkavalli, and Hao Su. Neutex: Neural texture mapping for volumetric neural rendering. In CVPR, 2021. 1 +[48] Tarun Yenamandra, Ayush Tewari, Florian Bernard, Hans-Peter Seidel, Mohamed Elgharib, Daniel Cremers, and Christian Theobalt. i3dmm: Deep implicit 3d morphable model of human heads. In CVPR, 2021. 1 +[49] Li Yi, Vladimir G Kim, Duygu Ceylan, I-Chao Shen, Mengyan Yan, Hao Su, Cewu Lu, Qixing Huang, Alla Sheffer, and Leonidas Guibas. A scalable active framework for region annotation in 3D shape collections. Siggraph Asia, 35(6), 2016. 6 +[50] Kangxue Yin, Jun Gao, Maria Shugrina, Sameh Khamis, and Sanja Fidler. 3dstylenet: Creating 3d shapes with geometric and texture style variations. In ICCV, 2021. 1, 2 +[51] Yuxuan Zhang, Wenzheng Chen, Huan Ling, Jun Gao, Yi-nan Zhang, Antonio Torralba, and Sanja Fidler. Image gans + +meet differentiable rendering for inverse graphics and interpretable 3d neural rendering. In ICLR, 2021. 1 \ No newline at end of file diff --git a/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/images.zip b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..825af5cc0c028d7b48e580d43402017037fc4bdc --- /dev/null +++ b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46db3288e3d0c9c07a0397cf64ff6b62e03481f06f477913a33b3ffe341e725e +size 754261 diff --git a/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/layout.json b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b6649b3579d1a87eb6a46ba9c31d20755cfb150f --- /dev/null +++ b/auvnetlearningaligneduvmapsfortexturetransferandsynthesis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21db45222898aa34d65d948acca94bc09485f965706621fcd3705712edbf2147 +size 442202 diff --git a/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_content_list.json b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..442f1a31d85e9e796a219f191d378676f7e8a517 --- /dev/null +++ b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cde381a3e353669ba5625fd7b157e4db828a7797848c9aaecd7304dfeacec83c +size 85479 diff --git a/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_model.json b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3a3bff4585987196ccea4a17431f25c9d797d4d4 --- /dev/null +++ b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55e96378aa967f3f796d2dd5880dabe1538b965d754dbc06de5d8ac30f150b77 +size 103590 diff --git a/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_origin.pdf b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e67aea55eb90932271fe5e658929fa2bfc041382 --- /dev/null +++ b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/b5c54838-cd8d-4d37-bac5-caef3cf8f27d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac5066a14e4976f4c5d735bee428e03466bdd36694c4606472abf68fcea5c4fa +size 2154796 diff --git a/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/full.md b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..dd385285f27064421fe2ea74b91aef4dbd2e3012 --- /dev/null +++ b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/full.md @@ -0,0 +1,437 @@ +# A variational Bayesian method for similarity learning in non-rigid image registration + +Daniel Grzech1, Mohammad Farid Azampour1,2,3, Ben Glocker1, Julia Schnabel3,4, Nassir Navab3,5, Bernhard Kainz1,6, Loïc Le Folgoc1 +1 Imperial College London, 2 Sharif University of Technology, +3 Technische Universität München, 4 King's College London, 5 Johns Hopkins University, +6 Friedrich-Alexander-Universität Erlangen-Nürnberg + +# Abstract + +We propose a novel variational Bayesian formulation for diffeomorphic non-rigid registration of medical images, which learns in an unsupervised way a data-specific similarity metric. The proposed framework is general and may be used together with many existing image registration models. We evaluate it on brain MRI scans from the UK Biobank and show that use of the learnt similarity metric, which is parametrised as a neural network, leads to more accurate results than use of traditional functions, e.g. SSD and LCC, to which we initialise the model, without a negative impact on image registration speed or transformation smoothness. In addition, the method estimates the uncertainty associated with the transformation. The code and the trained models are available in a public repository: https://github.com/dgrzech/learnsim. + +# 1. Introduction + +Image registration attempts to align images so that corresponding locations contain the same semantic information. It is a necessary pre-processing step for the statistical analysis of clinical imaging data, computer-aided diagnosis, and computer-assisted intervention. In order to calculate the transformation, traditional image registration methods minimise an energy function which consists of task-specific similarity and regularisation terms, e.g. [4, 27, 38]. The algorithm needs to be run independently for every pair of images to be aligned and optimisation of the energy function is performed in an iterative manner. + +Traditional image registration methods minimise an energy function, which is similar to the training of neural networks by the minimisation of loss functions. However, using deep learning for medical image registration is difficult due to the lack of ground truth transformations. DLIR [15] and VoxelMorph (VXM) [5, 6, 13, 14] both use neural net + +works in order to learn in an unsupervised way a function that outputs a deformation field given a pair of input images, instead of optimising an energy function independently for each image pair. The calculation of transformations by evaluation of the neural network in a single forward pass speeds up the process by several orders of magnitude and maintains an accuracy comparable to traditional methods. The claim that deep learning models for image registration are limited to self- and unsupervised learning was recently countered by training a generative model exclusively on synthetic images and segmentations [25]. + +In this work, we present a new model for atlas-based diffeomorphic non-rigid image registration which, given a dataset of images, learns in an unsupervised way a suitable similarity metric for the task. The model implements the similarity metric as a neural network that takes as input two three-dimensional images and outputs the value of a function which needs to be minimised to align them. The few existing approaches for unsupervised similarity learning rely either on feature extraction used together with classical similarity metrics [12, 44, 45] or ad-hoc adversarial training [17, 18, 36]. In contrast to them, we refine the similarity metric itself, working within a rigorous Bayesian framework. The choice of a Bayesian model makes it possible to learn a data-specific similarity metric with relatively little data, improves robustness by proxy of the approximate variational posterior of the transformation parameters, and allows to quantify the uncertainty associated with the output. The following are the main contributions of our work: + +1. We propose a novel variational Bayesian method for unsupervised similarity learning in atlas-based non-rigid medical image registration; + +2. We show that the learnt metric outperforms traditional similarity metrics used in image registration on the examples of SSD and LCC, to which we initialise the model; + +3. Furthermore, we show that the learnt metrics generalise well by comparing the accuracy of VXM trained using the baseline and learnt similarity metrics; +4. The proposed formulation also makes it possible to estimate the voxel-wise uncertainty associated with the diffeomorphic transformation. + +Related work. State-of-the-art image registration models based on deep learning tend to rely on traditional similarity metrics, e.g. sum of squared differences (SSD) and local cross-correlation (LCC) in case of VXM [5,6,13,14] or LCC and mutual information (MI) in case of DLIR [15,16]. Deep learning has been used not only to learn a function that maps a pair of input images directly to a deformation field but also to improve image registration accuracy by learning image representations optimised for the task of image registration in a supervised [32] and weakly-supervised [8,39] setting, a spatially-adaptive regulariser [34], and extracting features which were then used together with traditional similarity metrics [12,44]. + +Traditionally, similarity metrics in medical image registration were designed manually rather than learnt, e.g. the modality-independent neighbourhood descriptor for multimodal CT/MRI registration of the thorax [23]. Learnt metrics were used in rigid multi-modal registration for CT/MRI and PET/MRI [31], and for MRI/ultrasound [22]. Similarity learning in a supervised setting, which requires costly manual data annotation, was proposed for the registration of T1-T2 MRI brain scans [9], T1-T2 neonatal MRI brain scans [40], and CT/MRI head [11] and prostate scans [10]. + +The two existing methods for unsupervised similarity learning are closely related and used a generative adversarial network, with the discriminator network learning a similarity metric for the training of an image registration model [17, 18, 36]. In order to train the discriminator, they required pre-registered image patches that were generated from the dataset in an ad-hoc way, by defining patches of a weighted sum of the fixed and moving images and of the fixed image as positive samples, and patches of the warped moving image and of the fixed image as negative samples. These choices raise the question of what happens when the input images are similar prior to registration or accurately registered by the model. Moreover, only one of the models guaranteed diffeomorphic transformations [36]. + +Related non-rigid image registration models were previously adopted for the probabilistic inference of regularisation strength [41], uncertainty quantification [30], and learning a probabilistic model for diffeomorphic registration [28], but not for similarity learning. + +# 2. Method + +Background. We denote by $\mathcal{D} = \{(F,M_k)\mid k\in$ $\{1,\ldots ,K\}\}$ a dataset of image pairs, where $F\colon \Omega_F\to$ + +$[0,1]$ and $M_{k}\colon \Omega_{M_{k}}\to [0,1]$ are a fixed and a moving image respectively. The aim of mono-modal image registration is to align the underlying domains $\Omega_F$ and $\Omega_{M_k}$ using a transformation $\varphi (w_k):\Omega_F\to \Omega_{M_k}$ , i.e. to find parameters $w_{k}$ such that $F\simeq M_{k}(w_{k})\coloneqq M_{k}\circ \varphi^{-1}(w_{k})$ . The transformation is often expected to possess some desirable properties, e.g. diffeomorphic transformations are smooth and invertible, with a smooth inverse. + +We parametrisse the transformation using stationary velocity fields (SVFs) [1, 2]. The ordinary differential equation that defines the transformation is given by: + +$$ +\frac {\partial \varphi^ {(t)}}{\partial t} = w _ {k} \left(\varphi^ {(t)}\right) \tag {1} +$$ + +where $\varphi^{(0)}$ is the identity transformation and $t\in [0,1]$ . Under the assumption of a spatially smooth velocity field $w_{k}$ , the solution to Equation (1) is diffeomorphic [1]. Numerical integration is done by scaling and squaring, which uses the following recurrence relation with $2^{T}$ steps: + +$$ +\varphi^ {(1 / 2 ^ {t - 1})} = \varphi^ {(1 / 2 ^ {t})} \circ \varphi^ {(1 / 2 ^ {t})} \tag {2} +$$ + +Mathematical foundation. Throughout registration, the model residuals will include voxel-wise error $e_k \coloneqq F - M_k(w_k)$ due to noise and the misalignment of the images1. Therefore, in order to find the registration parameters, in probabilistic image registration we maximise the log-likelihood of the fixed image $\log p(F \mid M_k, w_k)$ given the moving image and the transformation parameters. The expression for the log-likelihood depends on the assumptions about the distribution of the error, e.g. noise assumed to be independent and identically distributed across image voxels with the normal distribution corresponds to the SSD similarity metric [3]: + +$$ +\log p (F \mid M _ {k}, w _ {k}) \propto - \frac {1}{2} e _ {k} ^ {\mathrm {T}} \mathrm {K} ^ {- 1} e _ {k} \tag {3} +$$ + +where $\mathrm{K}^{-1}$ is a precision matrix of the error in the image. To regularise the registration, a prior distribution on the transformation parameters $w_{k}$ is used. The usual choice is a multivariate normal distribution [2, 19, 35]: + +$$ +\log p \left(w _ {k}\right) \propto - \frac {1}{2} \lambda_ {\text {r e g}} \left(\mathrm {L} w _ {k}\right) ^ {\mathrm {T}} \mathrm {L} w _ {k} \tag {4} +$$ + +where $\lambda_{\mathrm{reg}}$ is the regularisation weight and $L$ is the matrix of a differential operator. In what follows, we assume that L represents the gradient operator, which regularises the magnitude $\| \mathbf{L}w\| ^2$ of the $1^{\mathrm{st}}$ derivative of the velocity field. + +When using the maximum a posteriori method, a single value of parameters $w_{k}$ is computed rather than the probability density function, aiming to find the most likely transformation parameters: + +$$ +p \left(w _ {k} \mid \mathcal {D}\right) = p \left(\mathcal {D} \mid w _ {k}\right) \frac {p \left(w _ {k}\right)}{p (\mathcal {D})} \tag {5} +$$ + +The objective function to be minimised is the negative logarithm, which corresponds to a sum of the log-likelihood and the prior, i.e. similarity and regularisation terms $\mathcal{E}_{\mathrm{sim}}$ and $\mathcal{E}_{\mathrm{reg}}$ respectively: + +$$ +- \log p (w _ {k} \mid \mathcal {D}) = \underbrace {- \log p (F \mid M , w _ {k})} _ {\mathcal {E} _ {\text {s i m}}} - \underbrace {- \log p (w _ {k})} _ {\mathcal {E} _ {\text {r e g}}} \tag {6} +$$ + +Model. We wish to find a similarity metric which maximises the likelihood of images in the dataset when registering them to the atlas. Let $g_{\theta} \colon (F, M_k(w_k)) \mapsto \mathbb{R}_+$ be a similarity metric, implemented as a neural network with parameters $\theta$ . We use a Boltzmann distribution as likelihood: + +$$ +p (F \mid M _ {k}, w _ {k}, \theta) = \frac {1}{Z (\theta)} \cdot \exp \left(- g _ {\theta} (F, M _ {k} (w _ {k}))\right) \tag {7} +$$ + +where $Z(\theta)$ is a normalisation constant. When using the Boltzmann distribution, maximising the log-likelihood in order to find the transformation parameters is equivalent to minimising the value of the similarity metric in traditional image registration. + +In order to calculate the transformation parameters $w$ and the neural network parameters $\theta$ , we use variational inference. The posterior distribution of the model parameters $p(w, \theta \mid \mathcal{D})$ is approximated as a parametric probability distribution $q(w, \theta)$ . We assume that $w$ and $\theta$ are independent, and that $w_k$ are mutually independent. Thus, the approximation of the posterior distribution factorises over the parameters: + +$$ +q (w, \theta) = q (w) \cdot q (\theta) = \left\{\prod_ {k = 1} ^ {K} q _ {k} \left(w _ {k}\right) \right\} \cdot q (\theta) \tag {8} +$$ + +We also assume that, for each image, the approximate posterior distribution of the transformation parameters follows a multivariate normal distribution $q_{wk} \sim \mathcal{N}(\mu_{wk}, \Sigma_{wk})$ , where $\mu_{wk} \in \mathbb{R}^{3N^3 \times 1}$ , $\Sigma_{wk} \in \mathbb{R}^{3N^3 \times 3N^3}$ is a positive semi-definite covariance matrix, and $N$ is the number of voxels along each dimension. Due to high dimensionality, the covariance matrix is approximated as a sum of diagonal and low-rank parts, i.e. $\Sigma_{wk} = \mathrm{diag}\left(\sigma_{wk}^2\right) + u_{wk}u_{wk}^\top$ , with $\sigma_{wk} \in \mathbb{R}^{3N^3 \times 1}$ and $u_{wk} \in \mathbb{R}^{3N^3 \times R}$ , where $R$ is a hyperparameter that defines the rank of the parametrisation. This choice of an approximate posterior distribution is standard in image registration but in contrast to other recent models based on SVFs, e.g. [13,28], we use a diagonal + low-rank covariance matrix, rather than just diagonal. + +To find the parameters $\mu_{wk},\Sigma_{wk}$ , and $\theta$ , we maximise the evidence lower bound, which fits the model and pe + +nalises deviation of parameters from the priors [26]: + +$$ +\begin{array}{l} \mathcal {L} (q) = - \int_ {\theta} \int_ {w} q (w, \theta) \log \frac {q (w , \theta)}{p (\mathcal {D} , w , \theta)} d w d \theta \\ = - \int_ {\theta} \int_ {w} q (w, \theta) \log \frac {q (w , \theta)}{p (F \mid M , w , \theta) p (w , \theta)} d w d \theta \\ = \underbrace {\mathbb {E} _ {q} \left[ \log p (F \mid M , w , \theta) \right]} _ {- \left\langle \varepsilon_ {\text {s i m}} \right\rangle_ {q}} - \mathrm {D} _ {\mathrm {K L}} (q | | p) \tag {9} \\ \end{array} +$$ + +where $\mathrm{D}_{\mathrm{KL}}(q(w,\theta) || p(w,\theta))$ is the Kullback-Leibler divergence between the approximate posterior $q(w,\theta)$ and the prior $p(w,\theta)$ and $\langle \cdot \rangle$ denotes the expected value. Similarly to maximum a posteriori, this corresponds to the sum of similarity and regularisation terms, with an additional entropy term $H(q)$ : + +$$ +\begin{array}{l} \mathrm {D} _ {\mathrm {K L}} (q \mid | p) = \underbrace {\int_ {\theta} \int_ {w} q (w , \theta) \log q (w , \theta) \mathrm {d} w \mathrm {d} \theta} _ {- H (q)} \\ - \underbrace {\int_ {w} q (w) \log p (w) \mathrm {d} w} _ {- \left\langle \mathcal {E} _ {\text {r e g}} \right\rangle_ {q}} - \int_ {\theta} q (\theta) \log p (\theta) \mathrm {d} \theta \tag {10} \\ \end{array} +$$ + +We choose a flat prior on $\theta$ , so the gradient of the last term on the RHS in Equation (10) w.r.t. $\theta$ is zero. In order to reduce the computational overhead, we also assume that the approximate posterior $q(\theta)$ is the Dirac delta function. + +We use contrastive divergence [24] to deal with the intractable normalisation constant $Z(\theta)$ in Equation (7), with $p\left(F\mid M_k,w_k,\theta\right)$ approximated by a multivariate normal distribution $q_{F}\sim \mathcal{N}(F,\Sigma_{F})$ . We have: + +$$ +\begin{array}{l} \frac {\partial \mathcal {L} (q)}{\partial \theta} = \frac {\partial Z (\theta)}{\partial \theta} - \left\langle \frac {\partial g _ {\theta} (F , M _ {k} (w _ {k}))}{\partial \theta} \right\rangle_ {q} \\ \approx \left\langle \frac {\partial g _ {\theta} (F , M _ {k} (w _ {k}))}{\partial \theta} \right\rangle_ {q _ {F}} - \left\langle \frac {\partial g _ {\theta} (F , M _ {k} (w _ {k}))}{\partial \theta} \right\rangle_ {q} \tag {11} \\ \end{array} +$$ + +We again assume that the covariance matrix $\Sigma_F = \mathrm{diag}\left(\sigma_F^2\right) + u_F u_F^\intercal$ is diagonal + low-rank, with $\sigma_F^2 \in \mathbb{R}^{N^3 \times 1}$ , and $u_F \in \mathbb{R}^{N^3 \times R}$ , which makes it easy to sample from the likelihood distribution when training the model. + +Training. We optimise in turn parameters of the approximate variational posteriors and of the neural network, starting with the transformation parameters. We use the reparametrisation trick with two samples per update to backpropagate with respect to the parameters of the variational posteriors. For every moving image $M_{k}$ , we sample $w_{k} \sim q_{w_{k}}$ : + +$$ +\begin{array}{l} w _ {k} = \mu_ {w k} \pm (\operatorname {d i a g} (\sigma_ {w k}) \cdot \epsilon + u _ {w k} \cdot x) \tag {12} \\ \epsilon \sim \mathcal {N} (0, I _ {3 N ^ {3}}), x \sim \mathcal {N} (0, I _ {R}) \\ \end{array} +$$ + +![](images/8baf540ed684518300f19374f2c0ff63fe81cdbf5bf424c92e96540bcb3070e4.jpg) +3D U-Net (encoder) +Figure 1. Neural network parametrising the similarity metric initialised to SSD. In case of LCC, we re-use the same architecture, with output of the aggregation layer convolved with a learnable $3 \times 3 \times 3$ kernel whose weights are initialised to one, in order to calculate the local intensity means and variances in the fixed and moving images. + +In order to make optimisation less susceptible to local maxima of the loss function, we take advantage of Sobolev gradients [33]. Samples from $q_{w}$ are convolved with a Sobolev kernel $S$ , approximated for a given size $s_{H^1}$ and value of $\lambda_{H^1}$ by solving the linear system of equations: + +$$ +\left(I _ {s _ {H ^ {1}} ^ {3}} - \lambda_ {H ^ {1}} \Delta\right) S = v \tag {13} +$$ + +where $v \in \mathbb{R}^{s_{H^1}^3 \times 1}$ is a discretised Dirac impulse and $\Delta$ is the Laplacian matrix, discretised with a 7-point stencil [42]. To lower the computational overhead, we further approximate the three-dimensional kernel by three separable one-dimensional kernels by calculating the tensor higher-order singular value decomposition of $S$ and retaining only the $1^{\mathrm{st}}$ singular vector from each resulting matrix, which is then normalised to unit sum [29, 42]. + +Initialisation of the similarity metric. The similarity metrics that are commonly used in non-rigid image registration include SSD, LCC, and MI. The function is chosen based on the dataset—SSD is the similarity metric of choice in case of mono-modal images with comparable intensity distributions, LCC is robust to linear intensity scaling and suitable when data was acquired with use of different imaging protocols, and MI is favoured in multi-modal image registration tasks. + +Training a similarity metric from scratch would be difficult because a quantitative measure of whether a pair of images is aligned is required to register images to begin with. To solve this problem in a more rigorous way than previous methods for unsupervised similarity learning, we put the focus on functions that are useful in the context of inter-subject mono-modal registration, i.e. SSD and LCC, + +and initialise the neural networks such that: + +$$ +g _ {\theta_ {\mathrm {S S D}}} (F, M) = \frac {1}{2} \| F - M (w) \| ^ {2} \tag {14} +$$ + +$$ +g _ {\theta_ {\mathrm {L C C}}} (F, M) = - \frac {1}{2} \left\langle \frac {\widehat {F}}{\| \widehat {F} \|}, \frac {\widehat {M}}{\| \widehat {M} \|} \right\rangle^ {2} \tag {15} +$$ + +where $\widehat{F} \colon x \mapsto \sum_{x' \in N(x)} F(x') / n^3$ is the local intensity mean of an image, $N(x)$ denotes the local neighbourhood of a voxel, and $n = |N(x)|$ is the count of voxels along each dimension inside the local neighbourhood. + +For each similarity metric, the initialisation may proceed in two ways—by training in a supervised way a neural network that approximates the value of the chosen similarity metric for a given image pair or, more elegantly, by initialising a neural network in such a way that its output is approximately equal to the similarity metric. In Figure 1, we show the architecture for SSD used in the experiments, which consists of a 3D U-Net encoder [37] initialised to the Dirac delta function and followed by a 1D convolutional layer. Feature maps output by the 3D U-Net are used to compute a weighted sum returned by the aggregation layer. In case of LCC, we re-use this architecture, with its output convolved with a learnable $3 \times 3 \times 3$ kernel ( $n^3 = 27$ ) whose weights are initialised to one, in order to calculate the local intensity means and variances in the fixed image and the moving image. + +Neural networks can also be trained to approximate MI [7], so the proposed method is not limited to monomodal image registration but potentially applicable to multimodal registration problems as well. + +![](images/99356eed424c87e9470a927995276bebc4fd49a86a94d5c17daf5c47914e01c1.jpg) +F + +![](images/6397f8830a84f3eb9f97ade3d366919aa0c90981a6aa4ed4cc9dabe30902491b.jpg) +$M_{1}$ + +![](images/ff0a6a03a2da26d9e5ee62bdd737eff6c6634fe1ec2b20648abfd4165da1b2e8.jpg) +$M_{1}(w_{1})$ + +![](images/30f263659fea4e18d071503cfe62dc220841176472cc1d8cb5c673c4893cac66.jpg) +$M_{1}(w_{1})$ (learnt) + +![](images/b1e992d89f2a0a838ab7d7b8359c306a6b6fb264747e12102f185ab7095ea513.jpg) +$F - M_{1}$ + +![](images/e3c8b512ccace025d1f5449eb3707e178938de29adc54c7f2d2b07607dd95fcb.jpg) +$F - M_{1}(w_{1})$ + +![](images/67d011b336ab1219e3f6c8a401a543a6c5257ed8ecfce1fff6920aff0940dfea.jpg) +$F - M_{1}(w_{1})$ (learnt) + +![](images/41189c8182a3b19c49470b89b1a9255d2303a6737a104fbc40cae8b8b7bf1013.jpg) +std.dev. + +![](images/64f17437641f31b21822c6cd7a30041c0800f8d51e6e6d205be082aa85896813.jpg) +std.dev.(learnt) + +![](images/30a2e8e4c78c6158abb82887fe095f55a8a280ef99f6740ed8a8142877ef7e76.jpg) + +![](images/65ace33c439e92238b47e9837f0fb58b34281d3ee7d32536ddc8cbbca45ef0e3.jpg) +$M_2$ + +![](images/1136ca11a45fa9d28e2f4f7aa65a920443f1942048bd0964c7e57618733f9bb2.jpg) +$M_2(w_2)$ + +![](images/5536d47c2f446da3e2566f762ad383d53d11927a11c7d8ae54db1f776a65b633.jpg) +$M_2(w_2)$ (learnt) + +![](images/e425b55a0da8b5c6838c3b629e5805d4fafdb28e1add4791c83a125c35770bef.jpg) +$F - M_{2}$ + +![](images/b4a1b45815dbbff468e5d6d80175f379fdb0772cab1d2903397a6927ef308173.jpg) +$F - M_{2}(w_{2})$ + +![](images/2b2328b683b438ba383b1e33dc8a2145762b99a0bfb94503c126631243712cd1.jpg) +$F - M_{2}(w_{2})$ (learnt) + +![](images/5754568a48dd46f9a3117b3c81459539ae5e4dbedf74ccfe4dc45115d66e5cbd.jpg) +std.dev. +Figure 2. The output on two sample images in the test split when using the baseline and the learnt similarity metrics. In case of SSD, the average improvement in DSC over the baseline on the image above is approximately 27.2 percentage points and in case of LCC, it is approximately 6.5 percentage points. The uncertainty estimates are visualised as the standard deviation of the displacement field, based on 50 samples. Use of the learnt similarity metric which was initialised to SSD results in better calibration of uncertainty estimates than in case of the baseline, e.g. higher uncertainty within regions with homogeneous voxel intensities. + +![](images/3d4f10eccbbcd20df2b364bffc81f4e180ef91d0d1c407f4aea2ca7c3be24253.jpg) +std.dev.(learnt) + +![](images/e536a9372b58a2b96099e0a3be6880aa5220e2d393d32983103dd419031104a8.jpg) + +# 3. Evaluation + +The model is implemented in PyTorch 1.7.1. We manually select an atlas image without white matter hyperintensities and use a random sample of 1,500 moving images from the 13,401 three-dimensional T2-FLAIR MRI brain scans in the UK Biobank dataset [43]. $80\%$ of the images are used for training and $20\%$ for testing. The input is preregistered with the affine component of drop2 [20] and then resampled to $N = 128$ isotropic voxels of length $1.82\mathrm{mm}$ along each dimension. + +In order to show that the learnt metrics generalise well, we also train VXM using the baseline and learnt similarity metrics2. VXM is trained on a random 80/20 split of the + +whole UK Biobank dataset, using the same atlas image as our models. To make the comparison fair, we set the hyperparameters of VXM trained with the baseline similarity metrics to ensure diffeomorphic transformations, and then use the same hyperparameter values, including the regularisation weight that determines the transformation smoothness, for training VXM with the learnt similarity metrics. + +Implementation details. We determined $\lambda_{\mathrm{reg}} = 1.8$ for SSD and $\lambda_{\mathrm{reg}} = 2.8$ for LCC to be the minimum values of regularisation weight which guaranteed diffeomorphic transformations. The integration of SVFs is done in $2^{12}$ steps. In order to start training in a stable way with small displacements, we set the rank hyperparameter to $R = 1$ and initialise $\mu_w$ to zero, $\sigma_w$ to half a voxel in every direction, and $u_w$ to a tenth of a voxel in every direction. We ob + +served that a variational posterior of transformation parameters with only a diagonal covariance matrix is too restrictive for accurate image registration. Moreover, use of the rank parameter set to $R \geq 2$ in the diagonal + low-rank approximation is not possible due to constraints on GPU memory. The parameters of $q_{F}$ are initialised to $\sigma_F = u_F = 0.1$ . We set the Sobolev kernel width to $s_{H^1} = 7$ and the smoothing parameter to $\lambda_{H^1} = 0.5$ . We use the Adam optimiser with a step size of $1 \times 10^{-1}$ and $2 \times 10^{-2}$ for the variational posterior $q_{w}$ respectively in case of SSD and LCC, $1 \times 10^{-3}$ for $q_{F}$ , and $1 \times 10^{-5}$ for $\theta$ . Between every update to $q_{F}$ and $\theta$ , we run 1,024 and 1,344 updates to the variational parameters of $q_{w}$ respectively in case of SSD and LCC, which is sufficient for convergence. + +We run training of each similarity metric for 5 epochs. It takes approximately 6 days on a system with an Intel Core i9-1090X CPU, 128 GB RAM, and two GeForce RTX 3090 GPUs, and requires 4 GB of memory per image in a minibatch. The registration of one image takes approximately 1 to 3 min, depending on the similarity metric (cf. Table 2). + +Results. First, we show that, ceteris paribus, our trained models outperform the baseline SSD and LCC similarity metrics. To register images in the test split, we calculate the variational posteriors of transformation parameters using the same number of iterations and the same initialisation as during training. The neural network parameters are held constant. In case of our model, we sample five transformations for every image in the test split, which gives a total of 1,500 samples. VXM is deterministic, so the results related to it are based on a single transformation per image, i.e. a total of 2,679 samples. In Figures 2 and 3, we show the result on four MRI brain scans in the test split for models initialised to SSD and LCC, as well as for VXM trained with the baseline and the learnt similarity metrics. The improvement over image registration with the baseline similarity metrics is clearly visible. + +In Figure 4, we report the average surface distances (ASDs) and Dice scores (DSCs) of subcortical structure segmentations for the two baseline and learnt similarity metrics, and for VXM trained with the baseline and learnt similarity metrics. For the majority of subcortical structures, image registration with the learnt similarity metrics yields consistently better ASDs and DSCs. We observe an average increase in DSC of 4.1 percentage points per structure in case of SSD, 0.6 percentage points in case of LCC, 2.0 percentage points in case of VXM + SSD, and 1.5 percentage points in case of VXM + LCC. There is a corresponding average decrease in ASD of $0.1\mathrm{mm}$ per structure in case of SSD, $0.01\mathrm{mm}$ in case of LCC, $0.06\mathrm{mm}$ in case of VXM + SSD, and $0.06\mathrm{mm}$ in case of VXM + LCC. We performed one-tailed Welch's $t$ tests at the 0.05 significance level to determine if the improvement in accuracy over the baseline models is statistically significant. We found that + +
method|det Jφ-1| ≤ 0% (×10-5)
baseline (SSD)0.00 (0.00)0.00 (0.00)
learnt0.10 (0.39)0.00 (0.00)
baseline (LCC)0.00 (0.04)0.00 (0.00)
learnt0.00 (0.00)0.00 (0.00)
VXM + SSD0.00 (0.00)0.00 (0.00)
VXM + learnt0.03 (0.38)0.00 (0.00)
VXM + LCC0.00 (0.00)0.00 (0.00)
VXM + learnt0.00 (0.00)0.00 (0.00)
+ +Table 1. Mean and standard deviation of the number and percentage of voxels where the sampled transformation is not diffeomorphic on the test data. The methods produce only a small number of voxels where the sampled transformations are not diffeomorphic. The use of learnt similarity metrics does not have a negative impact on the transformation smoothness. + +this was the case in terms of ASD for 12/15 structures for SSD, 10/15 for LCC, 10/15 for VXM + SSD, and 14/15 for VXM + LCC, and in terms of DSC for 13/15 structures for SSD, 11/15 for LCC, 10/15 for VXM + SSD, and 15/15 for VXM + LCC. + +Because it is trivial to improve accuracy at the expense of smoothness, e.g. by lowering the regularisation weight, it is also necessary to show that the proposed method does not have a negative impact on transformation smoothness. To do this, we count the number of voxels where the sampled transformations are not diffeomorphic, i.e. where the Jacobian determinant of the sampled transformation is nonpositive, denoted by $|\det J_{\varphi^{-1}}| \leq 0$ . In Table 1, we report the mean and the standard deviation of the values. The statistics are nearly zero for both the baseline and the learnt similarity metrics. The learnt similarity metric which was initialised to LCC not only improves accuracy but also reduces the count of voxels with a non-positive determinant of the transformation Jacobian. There is no evidence that the learnt similarity metrics have a negative impact on smoothness of the transformations. + +# 4. Discussion + +It is difficult to interpret the data-specific similarity metrics but the fact that VXM trained with the learnt similarity metrics is more accurate than VXM trained with the baseline functions indicates that the model does learn meaningful features. There are other methods to improve probabilistic image registration that cause a lower computational overhead than the proposed method, e.g. virtual decimation [21, 41]. However, unlike virtual decimation, the proposed method is not specific to SSD and could be easily integrated with many existing deterministic and probabilistic image registration algorithms. Moreover, the ideas for + +![](images/030d7c8e7edabb65b7164b9f3769fc6669dc263d6955f7e026a13025a71bae92.jpg) + +![](images/537883835793996647ea0045f1e56a332d46d85dd12a64f9924392d0e720409e.jpg) + +![](images/1b9ca34b0448f6cf776711755e54feaf59e1e8d467d736b24cf4eecbb9d20ca5.jpg) +$M_{3}$ + +![](images/cb4f007cd9e72725deffe828200019803e46f5630761cee1c855bef1b588545c.jpg) + +![](images/9cd1cff0dddf3628e7cf29012abe7efa2e0d2d4a68741dc910f4713133bdd8c3.jpg) + +![](images/ac8ae3cd9eba4c127e6b985d16058f742767eebcf5edc650693a86fbe344952b.jpg) +$M_3(w_3)$ + +![](images/47a2bc5a78988f21dbf3cc9657f2cc176b67b9444b7b63988fede1c2f7990c4c.jpg) + +![](images/a10be6c41ab86126231bf588fe4f97119e67120589d16d884b15c77ef94281f9.jpg) + +![](images/4c1adaf6a3272748ff1fc190336bdf7d8fbc408b7ecd46be0941b25fb7048edc.jpg) +$M_3(w_3)$ (learnt) + +![](images/0101deff132bd365a948b51878261e4f5b8703d770972a80cc1d749923ce5335.jpg) + +![](images/7126c63a1f3565740615704737ed6f5cf04ff786dc8958de521e080d1db06247.jpg) + +![](images/4226560501c9104685ef4baa6926df1f3209b0b3dd999179f35ea179bdec74c9.jpg) +$F - M_{3}$ + +![](images/ff5c444d3b70f452ea08a66301d3b5a9461f4f036917f111f526256d61077f4c.jpg) + +![](images/13a1609b1b033f659dac1a17845de90de45fa4456ecd0f2743dbd1bb7da444d0.jpg) + +![](images/f17979aed7146cd67792c306b44bef11a579a9c8c8ffee7fff3c746dd3d5db25.jpg) +$F - M_{3}(w_{3})$ + +![](images/a8e56aeb168f68d8bedb83351be79fe98b790e070db778d891fd026a5d32d84a.jpg) + +![](images/741ff4bb74f7f1998f153428b261cd5933afce5d721563faeb06501d92992386.jpg) + +![](images/d3f7fe93b3b1a5570be575e58b895c8d9ddae058c5e09f056283ab1be4a1cb30.jpg) +$F - M_{3}$ (w3) + +![](images/972631bbd44c20a2b13fa32b68aa02fa8970bcc5a668169cb9636b211a4f664f.jpg) + +![](images/d0cd76be35f4c24498e15196edbe6ee7f6c6d18a8338c91fb2e6915ad3999766.jpg) + +![](images/6f4c205688941cd98014ae03b066ca2a36240fe1c8daffcc063b50b8358ef101.jpg) +$\varphi^{-1}(w_3)$ + +![](images/c7ca16534692634f9bc4a26b1f1f07fb23d5180088da2ca1f84681c53f8c1124.jpg) + +![](images/4cb75566f3580e4f500bad61e791aa4d8da4fffff833acefdbb5baec1eb4b082.jpg) + +![](images/1db699631646506d0609298344fefcc3ad1d10a771919dc797364ca8309f93d0.jpg) +$\varphi^{-1}(w_3)$ (learnt) + +![](images/8fd22645dce8394e17e83cef544f6ea0fe5fe3aeaee05f462e33add4c973f452.jpg) + +![](images/bd8ba4205a5c172b4225b20b3b18ddbf051f105faed13b3ca163f965a5d5f88a.jpg) + +![](images/52a23893fd5810b03d91ef24c37c22c978f7e69a67c139304f6b44d7a4f845c6.jpg) +$M_4$ + +![](images/8bc54b6bf9b2bb72966c2cfd95484ba76c939336cb93bcfd5497f652d3247aad.jpg) + +![](images/9c6491679dbeaadb8bebbbcfb6ab56385d2bb2532cb0f6ab7744ce8b4cdb7789.jpg) + +![](images/78bc59008c5b5da12ffa11a605c355ee403023a1dfcffe611d7d2747c0e9495d.jpg) +$M_4(w_4)$ + +![](images/b33bf963c6dffd9390a4e75dab7e2e7a93e9090e3f458a9e1fae552238289de1.jpg) + +![](images/8cde5fa5339b8da510f089b49ee4216e4be59c0622c9c8bd7a65293e8bb099af.jpg) + +![](images/374998fb5aa0856306bd5fbf1172029b42b41fcada60cf514b082566fccf1359.jpg) +$M_4(w_4)$ (learnt) + +![](images/8761bcf505ba41261cf872201c1216ff0130f52560048c0b0bf2e989e88ccd8b.jpg) +(a) VXM + SSD + +![](images/6651fba31a2352a765de018d79618385a0ef16d6b1b8fc8e4a2350d779499831.jpg) + +![](images/d7d1032e47d993728a75718e3a9c2d2545ad98e529fe80c8415d4f9ccfb88fba.jpg) +$F - M_4$ +(b) $\mathrm{VXM} + \mathrm{LCC}$ + +![](images/8ac640006ebf217ce6ad273f0cfc138a5edc8576c5959420dd820764c10c72f1.jpg) + +![](images/0fdcda69f806ab4dea4f7f08197a24f92ea297c185f360906ce495441a141c9d.jpg) + +![](images/93aa20cb7c1d423b84e84bb71bff39c07e820280d1227b3690bf37b2145625e3.jpg) +$F - M_4(w_4)$ + +![](images/f27a4cf251715dec933e898a918afe0184ed74b62d224f82dff24ffbf116f81d.jpg) +(learnt) + +![](images/4f29ef2df2dc4165d198911f3e2b577ec77c4ba637505653baa81299d47258c2.jpg) + +![](images/e975b38ff88ab0dc8651167fed4f634f284f234a009d1548f127a7fe20f82c77.jpg) +$F - M_4(w_4)$ (learnt) +Figure 3. The output on two sample images in the test split when using VXM with the baseline and the learnt similarity metrics. In order to make the comparison fair, we use the exact same hyperparameter values for VXM trained with the baseline and the learnt similarity metrics. We also use the same atlas image as in Figure 2. In case of VXM + SSD, the average improvement in DSC over the baseline on the image above is approximately 25.3 percentage points and in case of LCC, it is approximately 11.8 percentage points. + +![](images/54f054b537e8d3fe8d989556d00a6d02a968d4449c9496b909d5d0f075ef8902.jpg) + +![](images/0ed8c99a7022ab1f417d5c37f04836812ca47785a3a30f318ac9ab7334e5f75f.jpg) + +![](images/87e952c489da215089a633bf64312b82bce84a3be6ca9875a7a44fa924fc4931.jpg) +$\varphi^{-1}\left(w_4\right)$ + +![](images/7de9e9a6b789d53643cde51604e5059d29fe7b3a4062a307ef6c3def7c9cd3a7.jpg) + +![](images/0cd582dcc8d6d1c2d26b744fdc9f4643b6f5ee65ff6f84f5a52560458a7070c9.jpg) + +![](images/c253e7be490d2e423782e3d2771eb77d54f174c5113342d8784c1ea83908fd5c.jpg) +$\varphi^{-1}(w_4)$ (learnt) + +unsupervised similarity learning that we present are not limited to medical image registration. + +Limitations. Training of the similarity metric initialised to SSD does not converge despite the promising results, due to the negative samples used in Equation (11) which make the optimisation numerically unstable. The method is slower than image registration models based on deep learning that use neural networks to map a pair of input images directly to a deformation field but it can be seamlessly + +integrated with them. Finally, use of a fixed regularisation strength leads to sub-optimal accuracy in case of large datasets, so the proposed method would also benefit from a reliable way to infer regularisation strength for a given pair of images. + +Moral, political, and societal issues. Everyday use of non-rigid image registration in medical image analysis remains in the distant future but accurate image registration models could be employed both to help and to further disad + +![](images/599a7692d30a749a4d17408f0a936deb92941ac462249ec5583c3d969fbb44da.jpg) + +![](images/db313d605a348c4a54b628a23160503c4a516e8032c736962298408751cb619c.jpg) +Figure 4. ASDs and DSCs calculated on the subcortical structure segmentation when aligning images in the test split using the baseline and learnt similarity metrics. For the probabilistic methods, we use five samples per image, which results in a total of 1,500 samples. The learnt models show clear improvement over the baselines. On average, when comparing different methods, DSC increases in the range of 0.6 to 4.1 percentage points and ASD decreases in the range of 0.01 to $0.1\mathrm{mm}$ . We provide details on the statistical significance of the improvement in the main text. + +
methodtraining timeregistration time
baseline (SSD)1 min
learnt (SSD)6 d1 min
baseline (LCC)2 min
learnt (LCC)6.5 d3 min
VXM + SSD1.5 d< 1 sec
VXM + learnt1.5 d< 1 sec
VXM + LCC1.5 d< 1 sec
VXM + learnt1.5 d< 1 sec
+ +Table 2. Training and image registration time for a single image. Use of the learnt similarity metrics does not result in a large increase in the training time of the models or the inference time. The baseline methods do not require training. + +vantage marginalised groups, e.g. by comparing individuals to healthy populations and to deny them access to healthcare services based on the result. For this reason, care needs to be taken to ensure that the benefits of fast and accurate im + +age registration, such as democratisation of access to specialised healthcare and knowledge gained through medical imaging population studies, outweigh the political and societal costs. + +# 5. Conclusion + +In this paper we presented a new method for unsupervised similarity learning in medical image registration. We showed on the examples of SSD and LCC that it can significantly improve the result of image registration without a negative impact on the transformation smoothness. We also showed that the data-specific similarity metrics generalise well and may be used together with other existing image registration models to improve accuracy. + +Acknowledgments. We would like to thank Rhea Jiang from the Harvard Graduate School of Design for the figures. This research used UK Biobank resources ID 12579 and was supported by EPSRC EP/L015226/1, EP/P023509/1, EP/S013687/1, and the UKRI London Medical Imaging & Artificial Intelligence Centre for Value-Based Healthcare. + +# References + +[1] Vincent Arsigny, Olivier Commowick, Xavier Pennec, and Nicholas Ayache. A log-euclidean framework for statistics on diffeomorphisms. In MICCAI, 2006. 2 +[2] John Ashburner. A fast diffeomorphic image registration algorithm. NeuroImage, 38(1), 2007. 2 +[3] John Ashburner and Karl J. Friston. Nonlinear spatial normalization using basis functions. Human Brain Mapping, 7(4), 1999. 2 +[4] Brian B. Avants, Nicholas J. Tustison, Michael Stauffer, Gang Song, Baohua Wu, and James C. Gee. The insight toolkit image registration framework. Frontiers in Neuroinformatics, 8, 2014. 1 +[5] Guha Balakrishnan, Amy Zhao, Mert R. Sabuncu, John Guttag, and Adrian V. Dalca. An unsupervised learning model for deformable medical image registration. In CVPR, 2018. 1, 2 +[6] Guha Balakrishnan, Amy Zhao, Mert R. Sabuncu, John Guttag, and Adrian V. Dalca. Voxelmorph: a learning framework for deformable medical image registration. IEEE TMI, 38(8), 2019. 1, 2 +[7] Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeshwar, Sherjil Ozair, Yoshua Bengio, Aaron Courville, and Devon Hjelm. Mutual information neural estimation. In ICML, 2018. 4 +[8] Max Blendowski, Lasse Hansen, and Mattias P. Heinrich. Weakly-supervised learning of multi-modal features for regularised iterative descent in 3d image registration. MedIA, 67, 2021. 2 +[9] Michael M. Bronstein, Alexander M. Bronstein, Fabrice Michel, and Nikos Paragios. Data fusion through cross-modality metric learning using similarity-sensitive hashing. In CVPR, 2010. 2 +[10] Xiaohuan Cao, Jianhuan Yang, Li Wang, Zhong Xue, Qian Wang, and Dinggang Shen. Deep learning based intermodality image registration supervised by intra-modality similarity. In MLMI MICCAI, 2018. 2 +[11] Xi Cheng, Li Zhang, and Yefeng Zheng. Deep similarity learning for multimodal medical images. In MICCAI Workshop on Deep Learning in Medical Image Analysis, 2018. 2 +[12] Steffen Czolbe, Oswin Krause, and Aasa Feragen. DeepSim: Semantic similarity metrics for learned image registration. In Medical Imaging Meets NeurIPS, 2020. 1, 2 +[13] Adrian V. Dalca, Guha Balakrishnan, John Guttag, and Mert R. Sabuncu. Unsupervised learning for fast probabilistic diffeomorphic registration. In MICCAI, 2018. 1, 2, 3 +[14] Adrian V. Dalca, Guha Balakrishnan, John Guttag, and Mert R. Sabuncu. Unsupervised learning of probabilistic diffeomorphic registration for images and surfaces. MedIA, 57, 2019. 1, 2 +[15] Bob D. de Vos, Floris F. Berendsen, Max A. Viergever, Hessam Sokooti, Marius Staring, and Ivana Isgum. A deep learning framework for unsupervised affine and deformable image registration. MedIA, 52, 2019. 1, 2 +[16] Bob D. de Vos, Bas H.M. van der Velden, Jörg Sander, Kenneth G.A. Gilhuijs, Marius Staring, and Ivana Isgum. Mutual + +information for unsupervised deep learning image registration. In Medical Imaging 2020: Image Processing. International Society for Optics and Photonics, 2020. 2 +[17] Jingfan Fan, Xiaohuan Cao, Qian Wang, Pew-Thian Yap, and Dinggang Shen. Adversarial learning for mono-or multimodal registration. MedIA, 58, 2019. 1, 2 +[18] Jingfan Fan, Xiaohuan Cao, Zhong Xue, Pew-Thian Yap, and Dinggang Shen. Adversarial similarity network for evaluating image alignment in deep learning based registration. In MICCAI, 2018. 1, 2 +[19] James C. Gee and Ruzena K. Bajcsy. Elastic matching: Continuum mechanical and probabilistic analysis. In *Brain Warping*, volume 2. Elsevier, 1998. 2 +[20] Ben Glocker, Nikos Komodakis, Georgios Tziritas, Nassir Navab, and Nikos Paragios. Dense image registration through mrfs and efficient linear programming. MedIA, 12(6), 2008. 5 +[21] Adrian R. Groves, Christian F. Beckmann, Steve M. Smith, and Mark W. Woolrich. Linked independent component analysis for multimodal data fusion. NeuroImage, 54(3), 2011. 6 +[22] Grant Haskins, Jochen Kruecker, Uwe Kruger, Sheng Xu, Peter A. Pinto, Brad J. Wood, and Pingkun Yan. Learning deep similarity metric for 3d mr-trus image registration. International Journal of Computer Assisted Radiology and Surgery, 14(3), 2019. 2 +[23] Mattias P. Heinrich, Mark Jenkinson, Manav Bhushan, Tahreema Matin, Fergus V. Gleeson, Michael Brady, and Julia A. Schnabel. Mind: Modality independent neighbourhood descriptor for multi-modal deformable registration. MedIA, 16(7), 2012. 2 +[24] Geoffrey E. Hinton. Training products of experts by minimizing contrastive divergence. Neural Computation, 14(8), 2002. 3 +[25] Malte Hoffmann, Benjamin Billot, Juan E. Iglesias, Bruce Fischl, and Adrian V. Dalca. Learning mri contrast-agnostic registration. In ISBI, 2021. 1 +[26] Michael I. Jordan, Zoubin Ghahramani, Tommi S. Jaakkola, and Lawrence K. Saul. Introduction to variational methods for graphical models. Machine Learning, 37(2), 1999. 3 +[27] Stefan Klein, Marius Staring, Keelin Murphy, Max A. Viergever, and Josien P.W. Pluim. Elastix: a toolbox for intensity-based medical image registration. IEEE TMI, 29(1), 2009. 1 +[28] Julian Krebs, Hervé Delingette, Boris Mailhé, Nicholas Ayache, and Tommaso Mansi. Learning a probabilistic model for diffeomorphic registration. IEEE TMI, 38(9), 2019. 2, 3 +[29] Joseph B. Kruskal. Rank, decomposition, and uniqueness for 3-way and N-way arrays. Multiway data analysis, 1989. 4 +[30] Loic Le Folgoc, Herve Delingette, Antonio Criminisi, and Nicholas Ayache. Quantifying registration uncertainty with sparse Bayesian modelling. IEEE TMI, 36(2), 2016. 2 +[31] Daewon Lee, Matthias Hofmann, Florian Steinke, Yasemin Altun, Nathan D. Cahill, and Bernhard Scholkopf. Learning similarity measure for multi-modal 3d image registration. In CVPR, 2009. 2 + +[32] Matthew C.H. Lee, Ozan Oktay, Andreas Schuh, Michiel Schaap, and Ben Glocker. Image-and-spatial transformer networks for structure-guided image registration. In MIC-CAI, 2019. 2 +[33] John Neuberger. Sobolev gradients and differential equations. Springer, 1997. 4 +[34] Marc Niethammer, Roland Kwitt, and François-Xavier. Metric learning for image registration. In CVPR, 2019. 2 +[35] Xavier Pennec, Pierre Fillard, and Nicholas Ayache. A Riemannian framework for tensor computing. *IJCV*, 66(1), 2006. 2 +[36] Chen Qin, Bibo Shi, Rui Liao, Tommaso Mansi, Daniel Rueckert, and Ali Kamen. Unsupervised deformable registration for multi-modal images via disentangled representations. In IPMI, 2019. 1, 2 +[37] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. 4 +[38] Julia A. Schnabel, Daniel Rueckert, Marcel Quist, Jane M. Blackall, Andy D. Castellano-Smith, Thomas Hartkens, Graeme P. Penney, Walter A. Hall, Haiying Liu, Charles L. Truwit, F. Gerritsen, D. Hill, and D. Hawkes. A generic framework for non-rigid registration based on non-uniform multi-level free-form deformations. In MICCAI, 2001. 1 +[39] Alireza Sedghi, Lauren J. O'Donnell, Tina Kapur, Erik Learned-Miller, Parvin Mousavi, and William M. Wells III. Image registration: Maximum likelihood, minimum entropy and deep learning. MedIA, 69, 2021. 2 +[40] Martin Simonovsky, Benjamin Gutiérrez-Becker, Diana Mateus, Nassir Navab, and Nikos Komodakis. A deep metric for multimodal registration. In MICCAI, 2016. 2 +[41] Ivor J.A. Simpson, Julia A. Schnabel, Adrian R. Groves, Jesper L.R. Andersson, and Mark W. Woolrich. Probabilistic inference of regularisation in non-rigid registration. NeuroImage, 59(3), 2012. 2, 6 +[42] Miroslava Slavcheva, Maximilian Baust, and Slobodan Ilic. SobolevFusion: 3D reconstruction of scenes undergoing free non-rigid motion. In CVPR, 2018. 4 +[43] Cathie Sudlow, John Gallacher, Naomi Allen, Valerie Beral, Paul Burton, John Danesh, Paul Downey, Paul Elliott, Jane Green, Martin Landray, and Others. UK Biobank: an open access resource for identifying the causes of a wide range of complex diseases of middle and old age. PLoS Medicine, 12(3), 2015. 5 +[44] Guorong Wu, Minjeong Kim, Qian Wang, Brent C. Munsell, and Dinggang Shen. Scalable high-performance image registration framework by unsupervised deep feature representations learning. IEEE Transactions on Biomedical Engineering, 63(7), 2015. 1, 2 +[45] Junshen Xu, Eric Z. Chen, Xiao Chen, Terrence Chen, and Shanhui Sun. Multi-scale neural ODEs for 3D medical image registration. In MICCAI, 2021. 1 \ No newline at end of file diff --git a/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/images.zip b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..beee7f873e8c69393d294f6936be8510ab9b99e3 --- /dev/null +++ b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cd6db0083424f52efb7da6c9da778a0f0ce4c07582ff8fca8902f23b3f195cc +size 844070 diff --git a/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/layout.json b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6b2cbf392510700bd3b6c5dd3125a0e35ce133d1 --- /dev/null +++ b/avariationalbayesianmethodforsimilaritylearninginnonrigidimageregistration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:605554dadfb5243b2f270ba8d67ee21bfc9b1c47692d4e5bf273bc37470e2a31 +size 513766 diff --git a/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_content_list.json b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..dfd75ef2be4c12e66a4073fffac8a487926739f4 --- /dev/null +++ b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc32f14979234b1175de44dbefb9189f58de74135d69fe8822c93e1425ebe603 +size 67555 diff --git a/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_model.json b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2e3221086fa73d9a146180374952c54aab5c27e3 --- /dev/null +++ b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e47e47f1566ce92213725cc1a12fb61d282b85791e363b1deb355580e9c905cd +size 79892 diff --git a/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_origin.pdf b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2e47c030d6637daf36882fbc4baf40b000041778 --- /dev/null +++ b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/9edf8348-151d-4835-b80d-2574da15c955_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:059c2c7a99f6f8811e37187550693f35282f88e6d7dc3b8ff3c27f1f8ce5c268 +size 2715708 diff --git a/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/full.md b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..efe4284e09ac5ac64ae96b3c1fe1735158e0e75e --- /dev/null +++ b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/full.md @@ -0,0 +1,236 @@ +# A Versatile Multi-View Framework for LiDAR-based 3D Object Detection with Guidance from Panoptic Segmentation + +Hamidreza Fazlali + +Yixuan Xu + +Yuan Ren + +Bingbing Liu* + +# Abstract + +3D object detection using LiDAR data is an indispensable component for autonomous driving systems. Yet, only a few LiDAR-based 3D object detection methods leverage segmentation information to further guide the detection process. In this paper, we propose a novel multi-task framework that jointly performs 3D object detection and panoptic segmentation. In our method, the 3D object detection backbone in Bird's-Eye-View (BEV) plane is augmented by the injection of Range-View (RV) feature maps from the 3D panoptic segmentation backbone. This enables the detection backbone to leverage multi-view information to address the shortcomings of each projection view. Furthermore, foreground semantic information is incorporated to ease the detection task by highlighting the locations of each object class in the feature maps. Finally, a new center density heatmap generated based on the instance-level information further guides the detection backbone by suggesting possible box center locations for objects. Our method works with any BEV-based 3D object detection method and, based on experiments on the nuScenes dataset, it provides significant performance gains. Notably, the proposed method based on a single-stage CenterPoint 3D object detection network achieve state-of-the-art performance on nuScenes 3D Detection Benchmark with 67.3 NDS. + +# 1. Introduction + +Over the past few years, there has been remarkable progress in autonomous vehicles (AVs) vision systems for understanding complex 3D environments [8,9,31]. 3D object detection is one of the core computer vision tasks that empowers AVs for robust decision-making. In this task, each foreground object, such as a car, a pedestrian, etc., needs to be accurately classified and localized by a 3D bounding box with 7 degrees of freedom (DOF), including the 3D box center location (x, y, z), size (l, w, h), and yaw angle $(\alpha)$ . + +![](images/44438ebf022e76235eefba3a4eaf89c4cd82fff6b97e745c9a38502ce760aec1.jpg) +Figure 1. The proposed center density heatmap (colored in green) guides the detection head toward possible box center regions on the BEV plane. The blue and red boxes represent predictions and ground truth, respectively. Best viewed in color. + +LiDAR-based 3D object detection methods rely on different strategies for 3D point cloud data representation. Some of these detection methods [13,17,28] are categorized as point-based methods. These methods directly process the raw point cloud to extract useful information. While they usually achieve high accuracy, their computational cost is significant. The other subset of LiDAR-based 3D object detection methods are known as grid-based methods [9,18,26,31]. These methods transform the unordered point cloud into regular 3D volumetric grids, i.e., voxels or pillars, and extract discriminative features from the points inside each gird cell. The extracted features are further processed by 2D or 3D Convolutional Neural Networks (CNN). Although point sub-sampling helps grid-based methods to be computationally efficient, some information is lost during projection and discretization [27]. + +Many of the points in each LiDAR scan represent the background region, including drivable surface, sidewalk, vegetation, etc. Feeding all this information to a 3D object detection algorithm without providing extra clues, e.g., semantic information, makes the recognition and localization process challenging. Several works [17, 22, 28] have exploited a binary or semantic segmentation model for filtering background points or providing extra semantic features that can guide the proposal generation or detection process. + +Inspired by this notion of providing guidance, we leverage 3D panoptic segmentation as an auxiliary task for guiding and further improving the performance of Bird's-Eye-View (BEV) based 3D object detection algorithms. A 3D panoptic segmentation method predicts the semantic class + +label and performs instance-level segmentation for each point in the 3D space, both of which are useful as guidance signals for detecting objects. In addition, guiding a BEV-based detection model with features learned from a Range-View (RV) based network can reduce the sparsity of features representation in BEV projection. We validate these ideas by training a BEV-based 3D object detection method in conjunction with an RV-based 3D panoptic segmentation method. More specifically, the BEV-based detection backbone is supplemented with additional RV features extracted from the panoptic segmentation backbone, providing a rich set of multi-view information to aid the detection. Moreover, we exploit the semantic labels of the foreground objects estimated by the panoptic segmentation network to refine the 3D object detection backbone features. Finally, a center density heatmap in the BEV plane is designed based on the instance-level information obtained from the panoptic segmentation, highlighting regions that contain box centers of objects. In conjunction, the augmented backbone features, foreground semantic labels, and the center density heatmap guide the detection model towards a more accurate 3D box recognition and localization. We will describe our multi-task framework based on the single-stage CenterPoint 3D object detection method [30], but later in the experimental results section, we will quantitatively demonstrate that our approach can help any existing BEV-based 3D object detection method. + +Our contributions can be summarized into four-fold. (1) We propose a multi-task framework that jointly learns 3D panoptic segmentation and 3D object detection for improving the 3D object recognition and localization. To the best of our knowledge, this is the first framework that leverages both the semantic- and instance-level information concurrently for improving 3D object detection. (2) The framework is also designed to be easily attached to any BEV-based object detection method as a plug-and-play solution to boost its detection performance. (3) With experiments conducted on the nuScenes dataset [2], which includes both the panoptic and 3D box information, we validate the effectiveness of our method with different BEV-based 3D object detection methods. (4) We conduct ablation studies to further examine the usefulness of each added component for performance improvement. + +# 2. Related Work + +3D Object Detection with Point-based Methods. The point-based methods take in the unordered sets of 3D point cloud and rely on PointNet [14] or PointNet++ [15] for feature extraction. FPointNet [13] uses the 2D object proposals from camera images to filter the point cloud and then uses PointNet for 3D object detection based on the proposal regions. Its performance suffers as proposal regions generated from RGB images lack accurate 3D information. PointR- + +CNN [17] addresses this problem by first segmenting the foreground points using PointNet++ and then refining the proposals using the segmentation features. STD [28] uses PointNet++ for proposal generation and then further densifies the point features within each proposal using a pooling strategy. Generally, the point-based methods have a larger receptive field compared to the grid-based methods; however, their computational complexity is very high. [16]. + +3D Object Detection with Grid-based Methods. These methods divide the 3D space into volumetric grids known as voxels, so they can be processed by 2D or 3D CNN. Earlier methods encode each voxel with some hand-crafted features. **PIXOR** [27] encodes each voxel based on the occupancy and reflectance of points. **Complex-YOLO** [19] encodes each grid cell with the maximum height, maximum intensity, and normalized point density. In order to extract a more useful and richer set of features, the authors of VoxelNet [31] designed a Voxel Feature Encoder (VFE) layer to leverage the power of deep learning for voxel feature learning and then used a 3D CNN for its detlection backbone. **PointPillars** [9] reduces the number of voxels to one along the height dimension, improving both the inference time and detection accuracy. In [1], 3D object detection is done in RV using a range-conditioned dilation (RCD) layer to address the problem of object scale change in the range image. To take advantage of both BEV and RV point cloud representations, CVCNet [3] uses Hybrid-Cylindrical-Spherical (HCS) voxels. RSN [22] is another multi-view fusion method that first performs binary segmentation on the RV and then applies sparse convolutions on the foreground voxels with the learned RV features to detect objects. To address the imbalance of voxel sparsity between object classes, [4] considers a limited number of non-empty object voxels as hotspots and the detection head predicts these hot spots and the corresponding boxes. Following the success of CenterNet [6] in 2D object detection, CenterPoint [30] uses an anchor-free 3D object detection head (center-head) that first detects the center point of each object in the BEV plane and subsequently regresses the bounding box dimensions. + +# 3. Preliminaries + +Cluster-free 3D Panoptic Segmentation (CPSeg). CPSeg [10] uses a dual-decoder architecture to conduct panoptic segmentation without generating object proposals or using clustering algorithms. The backbone takes in the RV representation of the LiDAR point cloud and provides multi-scale feature maps. The semantic decoder provides semantic labels, while the instance decoder predicts the object mass centroid as instance embedding for each point. Different from the semantic decoder, which only utilizes encoded feature maps, the instance decoder benefits from the additional information of computed surface normals. + +![](images/c376f6e7d06220f84ed764304ec1f7de70ee6258d77a176b47ed112147905bd8.jpg) +Figure 2. Block diagram of the proposed method. The gray blocks (dotted border) represent the CPSeg model [10] and the blue blocks (dashed border) represent the single-stage CenterPoint model [30]. The green blocks (solid border) are the proposed modules for combining the 3D panoptic segmentation and 3D object detection under a multi-task framework. Best viewed in color. + +Then, the cluster-free instance segmentation head dynamically groups points with similar instance embedding as pillars in BEV, and objects are segmented by calculating the connectivity between pillars through a pairwise embedding comparison matrix. + +CenterPoint 3D Object Detection. Originally, CenterPoint is a two-stage 3D object detection method, where bounding boxes are regressed in the first stage and further refined in the second stage. Specifically, the second stage takes in the backbone feature maps in the BEV plane and considers information at locations where four sides of the first-stage bounding box are located. During training, the model estimates a center heatmap for each object class and other regression targets, including the box center offset, size, angle, and velocity. In the estimated center heatmap for each class, the local-maxima values represent the confidence scores. Their locations on the map are used to estimate the other regression targets. Overall, CenterPoint removes the need for anchor boxes in 3D object detection, which are originally inherited from the 2D object detection and are challenging to fit in the 3D space. + +# 4. Proposed Approach + +The block diagram of the proposed multi-task framework is shown in Figure 2. This method receives raw LiDAR point cloud data as input and outputs both the 3D panoptic segmentation and object detection results. For panoptic segmentation, we use CPSeg for its state-of-the-art and real-time performance. We made some architectural modifications to the CPSeg model for speeding up the proposed multi-task framework. The details of these changes are described in the supplementary materials. Furthermore, instead of predicting mass-center offsets as in the original CPSeg, the instance segmentation head in our modified CPSeg provides the 3D box-center offsets, useful for + +guiding the 3D object detection. Other than center offsets, CPSeg also provides its encoder feature maps and generated foreground semantic predictions to aid the detection model, as shown in Figure 2. + +For 3D object detection, we chose CenterPoint for its performance superiority compared to the anchor-based 3D object detection methods. We use the single-stage CenterPoint method based on VoxelNet backbone [6]. The CenterPoint consists of two main components: the backbone and the detection head. As shown in Figure 2, the detection backbone consists of the voxelization module that divides a point cloud into volumetric voxel grids, the 3D CNN backbone that learns 3D structural features, and a 2D CNN backbone that further processes the learned features in BEV. The detection head includes a group of class-specific center heads that predict center heatmap and other bounding box regression targets. We remove the second stage refinement process within the CenterPoint in our multi-task framework as information from panoptic segmentation is found to be sufficient in guiding the detection head to accurate detections. Moreover, in the Experiments section, we will show that our multi-task framework can easily work with any existing BEV-based 3D object detection method by simply replacing the detection backbone and head. + +The 3D object detection and panoptic segmentation methods in our framework are trained jointly. First, the backbone of the detection network is augmented with the addition of a rich set of RV features from the panoptic segmentation encoder. Furthermore, foreground semantic labels and instance box center offsets estimated by the panoptic segmentation network are also injected to guide the 2D backbone and detection head to attend to the locations of potential objects and their centers, respectively. As illustrated in Figure 2, the integration takes place in the multiview backbone augmentation, class-wise foreground attenuation. + +![](images/1e8cd9292fdac7337d794714ee4d40eb47ed9464492731b17d02699198cffd36.jpg) +Figure 3. Cascade feature fusion module. The selected RV feature maps are fused and the projected to BEV plane and then downsampled to match the detection backbone feature map resolution. Best viewed in color. + +tion, and center density heatmap modules. More details about these blocks are covered in the following subsections. + +# 4.1. Multi-View Backbone Augmentation + +RV and BEV representations of point clouds enable the design of efficient 3D perception models. Feature extractors of state-of-the-art panoptic segmentation models commonly rely on range view [11,20], while most well-known 3D detection methods operate on the BEV plane [4, 9, 26, 30]. However, each form of projection has its strengths and weaknesses. For example, features representation in RV are denser and align with the LiDAR scan patterns. Thus, small objects, e.g., pedestrians, traffic cones, motorcycles, and bicycles, are more visible and easier to be detected and classified. However, determining the sizes and boundaries of crowded or distant objects is difficult in RV due to occlusions and size variations. On the other hand, BEV avoids the issues presented in RV, but its sparse and coarse representations make it challenging to detect smaller objects. + +Similar to [3, 5], we attempt to leverage the strength of each view to improve the performance of 3D object detection. Here, we introduce the concept of feature weighting to combine multi-view features, by adaptively weighting each feature value in RV and BEV maps based on its perceived importance in boosting the detection performance. The multi-view backbone augmentation is composed of two steps. First, RV feature maps from the segmentation model backbone are projected to the BEV plane and further downsampled to match the resolution of the extracted BEV feature maps in the detection backbone. Then, the RV- and BEV-based feature maps are fused using a proposed space-channel attention module, which weights each feature map based on its usefulness for the detection task. These two steps are elaborated below. + +# 4.1.1 Cascade RV Feature Fusion Module + +The RV feature maps generated in the panoptic segmentation backbone can help augment the detection backbone, which operates in the BEV plane, in detecting smaller objects that are otherwise not properly represented. + +A cascade feature fusion module, as shown in Figure 3, processes multi-scale RV feature maps and prepares them for the detection backbone augmentation. The coarser RV feature maps, $r_1$ and $r_2$ , are obtained from intermediate layers of the CPSeg encoder, which contain contextual RV information that can benefit multiple tasks. On the other hand, high-resolution feature maps, $r_3$ , encode additional geometric information of point cloud in the RV plane to emphasize the locations and presence of objects. More specifically, the learned geometric features extracted from surface normal vectors originated in CPSeg are concatenated with the 3D Cartesian coordinates associated with each point. + +In the proposed cascade feature fusion module, starting from the coarsest-scale, feature maps $r_1$ are first processed by a Convolutional Bottleneck Attention Module (CBAM) [25]. This module is responsible for adaptive feature refinement along space- and channel-dimensions. Then, the resulted feature maps are up-sampled by a factor of 2 using a $3 \times 3$ Transposed Convolution layer and passed to the boundary refinement layer to reduce the upsampling artifacts. These up-sampled features are then concatenated to higher-resolution feature maps, $r_2$ , and the same previously mentioned operations are applied on the concatenated feature maps. After the features are concatenated at the highest-resolution scale with $r_3$ , they are passed through a CBAM and a $1 \times 1$ convolution layer, and subsequently projected to the BEV plane. Finally, a sequence of down-sampling blocks reduces the resolution of the features to the specifications of the detection backbone. Each Space2Depth operation reduces the spatial resolution of the feature maps by half and doubles the channel number, and the accompanied $1 \times 1$ convolution layer compresses the feature maps along the depth dimension. + +# 4.1.2 Attention-based RV-BEV Feature Weighting Module + +After the cascade RV feature fusion module, feature maps extracted from two different views are concatenated. An attention-based weighting module is crucial so that the model learns to adaptively focus on feature values from a particular view given the scenario. To this end, a modified CBAM [25] is proposed here to provide useful weighting for RV and BEV features. + +The diagram of this module is shown in Figure 4. The attention-based RV-BEV weighting module takes in the concatenated feature maps from both views, and distributes them to channel- and space-attention streams. The channel + +![](images/b65e1e64eb923f8a391c6e3825a8e5a49bd9c5ebace6481087d36b6d281328df.jpg) +Figure 4. Attention-based RV-BEV feature weighting module. The model learns to highlight the best feature values among the RV and BEV representations along space and channel dimensions. Best viewed in color. + +![](images/b2fd164d6c8b772cc954441b913d3683e98a87ea61752e1ec600b36146e2e4bf.jpg) +Figure 5. Visualization of the attention map generated by the attention-based RV-BEV feature weighting module. Regions in red and blue indicate locations where BEV and RV features are deemed more significant with higher weights, respectively. Boxes in blue are ground truth object bounding boxes. Colors in background are shaded for better visualization. Best viewed in color. + +attention stream applies max-pooling and average-pooling across $x$ - and $y$ -axis of the BEV and RV feature maps, resulting in 4 sets of feature vectors, which are then fed to a multilayer perceptron (MLP) to learn an attention value for each channel in RV and BEV feature maps. The space-attention stream applies the same pooling operations depth-wise to obtain 4 feature maps, which are then fed to a $3 \times 3$ convolution layer with a dilation rate of 3 to learn spatial attention values. The resulted feature map from the space-attention stream and the feature vector from the channel-attention stream are both broadcasted to the same shape, summed, and passed through a sigmoid activation function to generate an attention map. By applying this attention map to the input feature maps, the feature values from either views that help the detection task are highlighted. This enables the detection backbone to dynamically pay more attention to features from a particular view given the presented scene. For + +![](images/df653971379838d1f401f38b560d383291b1f8c2086ce444e30b993a9e99aedf.jpg) +Figure 6. Class-wise foreground attention module. This module is responsible to embed the semantic information regarding the object of interest in the feature maps. + +instance, as shown in Figure 5, the attention-based RV-BEV weighting module assigns higher weights for the RV features representing nearby and smaller objects, while for the occluded and distant objects it favors BEV features more. + +# 4.2. Class-wise Foreground Attention Module + +In the proposed multi-task framework, the panoptic segmentation estimates the semantic labels for all points in the RV plane, covering both foreground and background objects. However, for 3D object detection, we are only interested in detecting foreground objects. Thus, leveraging the foreground semantic information can ease the detection task by placing more focus on class-specific foreground regions. + +For this purpose, a class-wise foreground attention module is designed, as shown in Figure 6. The module takes in the estimated probability maps for each foreground object category from CPSeg. These maps are projected to the BEV plane and down-sampled via max-pooling to match the resolution of the combined RV-BEV feature maps. For each foreground object category, a class-wise attention branch is created, which performs element-wise multiplication between the probability map of the specific class and the input feature maps, and then compresses the channel depth of the resulted output through a $1 \times 1$ convolution layer. After the attention branch, feature maps are gathered and passed through another $1 \times 1$ convolution layer to keep the channel size the same as the input feature map. Finally, input feature maps are added to these semantically rich feature maps via a skip connection. Overall, this module embeds the foreground semantic information in the feature maps, which can help both the classification and localization tasks. + +# 4.3. Center Density Heatmap Module + +The aim of this module is to provide instance-level information for the detection head. The estimated 3D boxes center offsets for each point from CPSeg are used to create a heatmap of potential locations of 3D boxes centers to guide the detection head. More specifically, an estimated foreground mask from CPSeg is used to filter out background points, as the center offsets from those points are not mean + +
MethodmAPNDSCarTruckBusTrailerCVPedMotorBicTCBarrier
CenterPoint [30]56.464.884.754.867.235.317.182.957.435.963.365.1
Ours60.367.185.157.168.343.620.584.762.543.671.566.0
Improvement+3.9+2.3+0.4+2.3+1.1+8.3+3.4+1.8+5.7+7.7+8.2+0.9
+ +Table 1. Comparison of the proposed method with the two-stage CenterPoint method on the nuScenes validation set. In the columns, CV, Ped, Motor, Bic, and TC are abbreviations for Construction Vehicle, Pedestrian, Motorcycle, Bicycle, and Traffic Cone, respectively. + +ingful. The remaining foreground points are shifted according to the offset predictions and projected to the BEV plane. Then, the center density heatmap is generated as, + +$$ +H (x, y) = \operatorname {T a n h} (\log (C (x, y) + 1)) \tag {1} +$$ + +where $C(x,y)$ is the number of projected points, $H(x,y)$ is the resulted center density heatmap, and $x$ and $y$ represent the horizontal and vertical coordinates on the BEV plane, respectively. The $\text{Tanh}$ activation function is applied after a log operation to constrain the heatmap values in [0, 1]. + +This gray-scale center density heatmap is applied to the feature maps extracted from the 2D detection backbone before the detection head. An element-wise multiplication is performed between feature maps and the estimated center density heatmap and the result is added to the feature maps. As shown in Figure 1, the center density heatmap provides an effective guide to direct the detection head towards each possible box center region. + +# 5. Experiments + +We introduce the dataset used (Sec. 5.1) and the implementation details of our framework and the methods (Sec. 5.2). Moreover, we compare the proposed method with other state-of-the-art methods (Sec. 5.3) and conduct ablation studies to show the effectiveness of each new component in our framework (Sec. 5.4). + +# 5.1. Dataset + +The nuScenes [2] is a popular large-scale driving-scene dataset. It provides both ground-truth 3D boxes and panoptic labels. Moreover, as the proposed method relies on both ground-truth panoptic labels and the 3D boxes, we use the nuScenes dataset for both training and evaluation. The nuScenes dataset contains 1000 sequences of driving scenes. Overall, 40K frames are annotated for the 3D object detection task with 10 object categories, from which 28K, 6K, and 6K frames are for training, validation, and test sets, respectively. The mean Average Precision (mAP) is one of the metrics used for 3D object detection, which is calculated on the BEV plane based on different center distance thresholds i.e. $0.5\mathrm{m}$ , $1.0\mathrm{m}$ , $2.0\mathrm{m}$ , and $4.0\mathrm{m}$ . Another important metric is the nuScenes Detection Score (NDS), which is a weighted sum of mAP and 4 other metrics that determine the quality of the detections in terms of box translation, scale, orientations, velocity, and other attributes [2]. + +To demonstrate the robustness of the proposed model, we also perform experiments on the Waymo Open Dataset [21] after creating our own panoptic segmentation labels given the 3D ground-truth boxes. Detailed information regarding the experiment performed on the Waymo dataset and results are included in the supplementary materials. + +# 5.2. Implementation Details + +We used the Pytorch deep learning library [12] and based our implementation on the OpenPCDet [23], an open-source project for LiDAR-based 3D object detection. In order to demonstrate that the proposed framework can improve any BEV-based 3D object detection method, we use SECOND [26] and PointPillars [9] 3D object detectors in our framework as alternatives to the CenterPoint. For each experiment using our multi-task framework, the panoptic segmentation model CPSeg and one of the 3D object detection models, such as CenterPoint, are trained jointly from scratch in an end-to-end manner. + +To supervise the detection model, the focal loss is used for regressing the center heatmap and for all the other regression targets, the Smooth L1 loss is exploited. The focal loss is computed over all locations on the output heatmap, while the regression loss is only calculated over positive locations. We followed CPSeg for all the panoptic segmentation loss terms. All the models were trained for 120 epochs on 8 Tesla V100 GPUs with Adam optimizer and a weight decay of $10^{-2}$ . Finally, the learning rate was set to $10^{-3}$ and the One Cycle policy was used for learning rate scheduling. + +# 5.3. Results + +First, we present the detection results of our method and the CenterPoint on the nuScenes validation set, as shown in Table 1. It can be seen that the proposed multi-task framework, which is based on the single-stage CenterPoint detection model, outperforms the original two-stage CenterPoint considerably in NDS and mAP. More specifically, the proposed method significantly improves the AP for all the object categories, specially the smaller ones, such as motorcycles, bicycles, and traffic cones. This performance boost is made possible by exploiting the panoptic segmentation, particularly the RV features in which the smaller objects are better preserved and represented. Qualitative results on two sample LiDAR frames of the validation set are shown in Figure 7, while additional quantitative and qualitative com + +
MethodmAPNDSCarTruckBusTrailerCVPedMotorBicTCBarrier
WYSIWYG [7]35.041.979.130.446.640.17.16518.20.128.834.7
PointPillars [9]30.545.368.423.028.223.44.159.727.41.130.838.9
PointPainting [24]46.458.177.935.836.237.315.873.341.524.162.460.2
PMPNet [29]45.453.179.733.647.143.118.176.540.77.958.848.8
SSN [33]46.458.180.737.539.943.914.672.343.720.154.256.3
CBGS [32]52.863.381.148.554.942.910.580.151.522.370.965.7
CVCNet [3]55.364.482.746.146.649.422.679.859.131.465.669.6
CenterPoint [30]58.065.584.651.060.253.217.583.453.728.776.770.9
HotSpotNet [4]59.366.083.150.956.453.323.081.363.536.673.071.6
Ours60.967.384.650.063.255.323.483.765.138.976.868.2
Improvement+1.6+1.30.0-1.0+3.0+2.0+0.4+0.3+1.6+2.3+0.1-3.4
+ +parisons are included in the supplementary materials. + +The comparison results with the state-of-the-art methods on the nuScenes test set are shown in Table 2. It can be seen that the proposed method surpasses others by a considerable margin, increasing both the NDS and mAP by 1.3 and 1.6 points over HotSpotNet, respectively. This improvement is even higher compared to the CenterPoint model, with 1.8 and 2.9 points increase in NDS and mAP, respectively. + +The advantage of the proposed method over CenterPoint can be further shown in Figure 8. By using the guidance from RV panoptic features, our method improves on the corner cases, such as overlapping pedestrians or sparsely represented traffic cones. As shown in 9, point representation in BEV is less detailed, which is less problematic for large objects with more LiDAR points, but critical for thin and shallow objects. RV panoptic features are able to capture more details for bicycles and motorcycles and, as seen in Figure 8, provide strong guidance for both classification and box regression. In terms of larger classes such as bus, the larger receptive field of the network based on incorporation of the RV helps detector to perceive them better. In addition, the center density map guides the detector to locate the box centers of large objects, which is otherwise difficult as the centers are located far away from the LiDAR points on the corresponding surfaces. + +# 5.4. Ablation Studies + +Effects of each proposed component The key components proposed in our multi-task framework include the multi-view backbone augmentation, class-wise foreground attention, and center density heatmap modules. The effect of each of these components on the performance of the proposed method evaluated using the nuScenes validation set is shown in Table 3. Based on these results, the multi-view backbone has the most impact on performance improvement by providing panoptic-level RV feature maps to augment the detection backbone. Moreover, the use of + +![](images/a5d4b90223775cdad321e97d6a57aa51e6f8e4c9a7e9867625a1cc096a8c4e23.jpg) + +![](images/3b4e5b4ad283949116e48eb0fbc81d08ce5c58e7c422c68245444b3e47d8c61d.jpg) +Figure 8. Class-wise qualitative results on the nuScenes validation set, containing the predicted bounding boxes (in blue), ground truth bounding boxes (in red), and center density heatmap for the bus class (in green). Best viewed in color. + +![](images/e1a202b3b9e6997515a69115a9013dec58bac4216e3312530a833a52720c3cd9.jpg) +Figure 9. Comparison of point cloud representation in BEV and RV planes for a motorcycle. Best viewed in color. + +Table 2. Comparison of the state-of-the-art methods on the nuScenes test set. In the columns, CV, Ped, Motor, Bic and TC represent Construction Vehicle, Pedestrian, Motorcycle, Bicycle, and Traffic Cone, respectively. + +
MethodMBACFACDHNDS
Baseline63.8
66.5
66.9
67.1
+ +Table 3. Effects of different proposed component on the performance improvement evaluated on the nuScenes validation set. In the columns MBA, CFA, and CDH are abbreviations for multi-View backbone augmentation, Class-wise foreground attention, center density heatmap modules, respectively. The baseline is the single-stage CenterPoint method with VoxelNet (VN) backbone. + +class-wise foreground attention and center density heatmap + +![](images/f4942d0b86ad070a279d2d5d32fe80d029d7d708d221c535460d8d984c2e504e.jpg) +Figure 7. Examples of qualitative results, containing the predicted bounding boxes (in blue), ground truth bounding boxes (in red), and panoptic segmentation results. Best viewed in color. + +![](images/ab57dce1cc3ec45a8d9794cb24b00dd6b9427c0ff9a3df053254082ba9d288f4.jpg) + +
MethodmAPNDS
PointPillars [9]43.056.8
Multi-Task+PointPillars50.560.5
Improvement+7.5+3.7
SECOND [26]51.762.6
Multi-Task+SECOND56.264.8
Improvement+4.5+2.2
+ +modules also contribute to the performance gains in detection scores considerably. This suggests that the injection of panoptic segmentation information provides helpful guidance for CenterPoint instead of creating confusion. + +Compatibility with other BEV-based 3D object detection models To demonstrate that our proposed multi-task framework can potentially improve the performance of any BEV-based detection method, we ran another set of experiments, with two different 3D object detection methods, PointPillars and SECOND. While the detection backbone and the detection head are swapped, the rest of the framework and experiment setup are unchanged. As shown in Table 4, when integrated as part of the multi-task framework, the performance of these two detectors are improved significantly. This demonstrates that the effectiveness of our framework is universal across different BEV-based 3D detection methods. More specifically, using a feature weighting mechanism to combine multi-task, multi-view features provides an unintrusive way to enrich any BEV-based detection backbone. Furthermore, feature maps that embed potential locations of object boundaries and centers are well received by any detection head. + +Effects of using a pre-trained CPSeg model Another alternative for guiding the 3D object detection model is to pre-train the panoptic segmentation model prior to training the 3D object detection model (Single-task learning). We pre-trained the CPSeg model using panoptic targets, and subsequently trained the CenterPoint model while keeping + +Table 4. Performance of PointPillars and SECOND under the proposed multi-task framework on the nuScenes validation set. + +
MethodmAPNDS
Single-task learning59.966.8
Multi-task learning60.367.1
+ +Table 5. Performance comparison between the proposed multitask learning and the single-task learning (pre-trained CPSeg with frozen weights) on the nuScenes validation set. + +the weights of CPSeg frozen. From the results in Table 5, it can be seen that multi-task learning has a better performance. This shows that when jointly trained, CPSeg learns to pick up RV features that not only benefits the panoptic segmentation task, but also guides the detection backbone. + +# 5.5. Limitation and Future Work + +Despite observing a boost in performance, integrating the object detection method as part of our multi-task framework has a shortcoming. The proposed framework is composed of two separate backbones, which increases the overall framework complexity. Despite some modifications to simplify both backbones, our proposed method runs at 6 FPS on the nuScenes dataset. We plan to design a shared backbone for both 3D panoptic segmentation and object detection for a reduced complexity and faster run-time. + +# 6. Conclusions + +We propose a framework for guiding the LiDAR-based 3D object detection method using panoptic segmentation. In this framework, the RV features of the panoptic segmentation model backbone are used to augment the BEV features of the detection model. Furthermore, the semantic information estimated by the segmentation model highlights the location of each class of foreground objects in the detection backbone. Also, the instance-level information guides the detection head to attend to possible centers of each object bounding box in the BEV plane. Experimental results on the nuScenes dataset, demonstrate the effectiveness of the proposed framework for increasing the detection accuracy of multiple BEV-based 3D detection methods. + +# References + +[1] Alex Bewley, Pei Sun, Thomas Mensink, Dragomir Anguelov, and Cristian Sminchisescu. Range conditioned dilated convolutions for scale invariant 3d object detection. arXiv preprint arXiv:2005.09927, 2020. 2 +[2] Holger Caesar, Varun Bankiti, Alex H Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuscenes: A multimodal dataset for autonomous driving. In CVPR, pages 11621-11631, 2020. 2, 6 +[3] Qi Chen, Lin Sun, Ernest Cheung, and Alan L Yuille. Every view counts: Cross-view consistency in 3d object detection with hybrid-cylindrical-spherical voxelization. NeurIPS, 2020. 2, 4, 7 +[4] Qi Chen, Lin Sun, Zhixin Wang, Kui Jia, and Alan Yuille. Object as hotspots: An anchor-free 3d object detection approach via firing of hotspots. In ECCV, pages 68-84. Springer, 2020. 2, 4, 7 +[5] Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia. Multi-view 3d object detection network for autonomous driving. In CVPR, pages 1907-1915, 2017. 4 +[6] Kaiwen Duan, Song Bai, Lingxi Xie, Honggang Qi, Qingming Huang, and Qi Tian. Centernet: Keypoint triplets for object detection. In CVPR, pages 6569-6578, 2019. 2, 3 +[7] Peiyun Hu, Jason Ziglar, David Held, and Deva Ramanan. What you see is what you get: Exploiting visibility for 3d object detection. In CVPR, pages 11001-11009, 2020. 7 +[8] Jason Ku, Melissa Mozifian, Jungwook Lee, Ali Harakeh, and Steven L Waslander. Joint 3d proposal generation and object detection from view aggregation. In IROS, pages 1-8, 2018. 1 +[9] Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. In CVPR, pages 12697-12705, 2019. 1, 2, 4, 6, 7, 8, 11, 12 +[10] Enxu Li, Ryan Razani, Yixuan Xu, and Liu Bingbing. Cpseg: Cluster-free panoptic segmentation of 3d lidar point cloud, 2021. 2, 3 +[11] Andres Milioto, Jens Behley, Chris McCool, and Cyril Stachniss. Lidar panoptic segmentation for autonomous driving. In IROS, pages 8505-8512, 2020. 4 +[12] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. NeurIPS, 32:8026-8037, 2019. 6 +[13] Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3d object detection from rgb-d data. In CVPR, pages 918-927, 2018. 1, 2 +[14] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, pages 652-660, 2017. 2 +[15] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NeurIPS, pages 5099-5108, 2017. 2 + +[16] Shaoshuai Shi, Chaoxu Guo, Li Jiang, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. Pv-rcnn: Pointvoxel feature set abstraction for 3d object detection. In CVPR, pages 10529–10538, 2020. 2 +[17] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointr-cnn: 3d object proposal generation and detection from point cloud. In CVPR, pages 770-779, 2019. 1, 2 +[18] Shaoshuai Shi, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. From points to parts: 3d object detection from point cloud with part-aware and part-aggregation network. IEEE TPAMI, 2020. 1 +[19] Martin Simony, Stefan Milzy, Karl Amendey, and Horst-Michael Gross. Complex-yolo: An euler-region-proposal for real-time 3d object detection on point clouds. In ECCV Workshops, pages 0-0, 2018. 2 +[20] Kshitij Sirohi, Rohit Mohan, Daniel Bscher, Wolfram Burgard, and Abhinav Valada. Efficientlps: Efficient lidar panoptic segmentation, 2021. 4 +[21] Pei Sun, Henrik Kretzschmar, Xerxes Dotiwalla, Aurelien Chouard, Vijaysai Patnaik, Paul Tsui, James Guo, Yin Zhou, Yuning Chai, Benjamin Caine, et al. Scalability in perception for autonomous driving: Waymo open dataset. In CVPR, pages 2446-2454, 2020. 6, 11 +[22] Pei Sun, Weiyue Wang, Yuning Chai, Gamaleldin Elsayed, Alex Bewley, Xiao Zhang, Cristian Sminchisescu, and Dragomir Anguelov. Rsn: Range sparse net for efficient, accurate lidar 3d object detection. In CVPR, pages 5725-5734, 2021. 1, 2 +[23] OpenPCDet Development Team. Openpcdet: An opensource toolbox for 3d object detection from point clouds. https://github.com/open-mmlab/OpenPCDet, 2020.6 +[24] Sourabh Vora, Alex H Lang, Bassam Helou, and Oscar Bei-jbom. Pointpainting: Sequential fusion for 3d object detection. In CVPR, pages 4604-4612, 2020. 7 +[25] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In ECCV, pages 3–19, 2018. 4 +[26] Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 18(10):3337, 2018. 1, 4, 6, 8, 11, 12 +[27] Bin Yang, Wenjie Luo, and Raquel Urtasun. Pixor: Realtime 3d object detection from point clouds. In CVPR, pages 7652-7660, 2018. 1, 2 +[28] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Std: Sparse-to-dense 3d object detector for point cloud. In ICCV, pages 1951-1960, 2019. 1, 2 +[29] Junbo Yin, Jianbing Shen, Chenye Guan, Dingfu Zhou, and Ruigang Yang. Lidar-based online 3d video object detection with graph-based message passing and spatiotemporal transformer attention. In CVPR, pages 11495-11504, 2020. 7 +[30] Tianwei Yin, Xingyi Zhou, and Philipp Krahenbuhl. Center-based 3d object detection and tracking. In CVPR, pages 11784-11793, 2021. 2, 3, 4, 6, 7, 12 +[31] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. In CVPR, pages 4490-4499, 2018. 1, 2 + +[32] Benjin Zhu, Zhengkai Jiang, Xiangxin Zhou, Zeming Li, and Gang Yu. Class-balanced grouping and sampling for point cloud 3d object detection. arXiv preprint arXiv:1908.09492, 2019.7 +[33] Xinge Zhu, Yuexin Ma, Tai Wang, Yan Xu, Jianping Shi, and Dahua Lin. Ssn: Shape signature networks for multiclass object detection from point clouds. In ECCV, pages 581-597, 2020. 7 \ No newline at end of file diff --git a/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/images.zip b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b5cff8f10eab45ba4dd76f0e6b556fc181cec608 --- /dev/null +++ b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f5832e590328bf5c3f64698fb433d31d1035e0db011358260188bb49c480aa0 +size 530913 diff --git a/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/layout.json b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..716991d1b7daa3c02d66e6306423dbbe3972d891 --- /dev/null +++ b/aversatilemultiviewframeworkforlidarbased3dobjectdetectionwithguidancefrompanopticsegmentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d51f0f5d8e150799a0a167799b6431cd3a2011325285419ee865e8412d982e9 +size 263119 diff --git a/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_content_list.json b/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c87c3865b8296c7734da7161674f9da9b5c0cb46 --- /dev/null +++ b/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae0090c71d1da968a9abd7c0bfa615c8b3f8d751da2f4644161750e5f5f2970e +size 76857 diff --git a/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_model.json b/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_model.json new file mode 100644 index 0000000000000000000000000000000000000000..06d0657aa8a0a7952298b82c91fe860810e627de --- /dev/null +++ b/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f515c6f3bf025f0be277224b8b134902743e781ad27ab87c8de45ed0bcb252a +size 96420 diff --git a/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_origin.pdf b/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ba24cf1a986565d4b09dd17b0fcc9ca2332a5e10 --- /dev/null +++ b/avitadaptivetokensforefficientvisiontransformer/c519ca3f-5be7-4a1a-b87a-d27b7e29ff73_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7a1409ee05ec1a36dc13dac5eba92e457a35b05b51718cfa5c768c1f38a1b93 +size 4201685 diff --git a/avitadaptivetokensforefficientvisiontransformer/full.md b/avitadaptivetokensforefficientvisiontransformer/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8d8fdbd3b0f65809d329d2c252a6c73b24c97e80 --- /dev/null +++ b/avitadaptivetokensforefficientvisiontransformer/full.md @@ -0,0 +1,356 @@ +# A-ViT: Adaptive Tokens for Efficient Vision Transformer + +# Hongxu Yin Arash Vahdat Jose M. Alvarez Arun Mallya Jan Kautz Pavlo Molchanov NVIDIA + +{danny, avahdat, josea, amallyla, jkautz, pmolchanov}@nvidia.com + +![](images/715fd2e4d65dc800ab372056078a224449bf06964730fa9a7ca4ebada9433ec3.jpg) + +![](images/bc616291c61ba7abfc63e72e7fbfea878e0b1f3c31cb3452df8bf7d130befc3a.jpg) +Figure 1. We introduce A-ViT, a method to enable adaptive token computation for vision transformers. We augment the vision transformer block with adaptive halting module that computes a halting probability per token. The module reuses the parameters of existing blocks and it borrows a single neuron from the last dense layer in each block to compute the halting probability, imposing no extra parameters or computations. A token is discarded once reaching the halting condition. Via adaptively halting tokens, we perform dense compute only on the active tokens deemed informative for the task. As a result, successive blocks in vision transformers gradually receive less tokens, leading to faster inference. Learnt token halting vary across images, yet align surprisingly well with image semantics (see examples above and more in Fig. 3). This results in immediate, out-of-the-box inference speedup on off-the-shelf computational platform. + +![](images/cdf8d62185c37972013f54359630e8a566f94401b3f7a16aed1e56f8bb89116d.jpg) + +![](images/d19d86df62483fa91b18470f92faf32ad0f30c7779080ffda31b07fb30e3af80.jpg) + +![](images/3bb6953af3e6de062fb58204a4019ab6b479b60db86c4aa42c563869dd12b45e.jpg) + +![](images/e6d9da61438290ddc880f969e0dfa90ff3986ef080f5bc1b97ef5b1de26c3a86.jpg) + +# Abstract + +We introduce A-ViT, a method that adaptively adjusts the inference cost of vision transformer (ViT) for images of different complexity. A-ViT achieves this by automatically reducing the number of tokens in vision transformers that are processed in the network as inference proceeds. We reformulate Adaptive Computation Time (ACT [17]) for this task, extending halting to discard redundant spatial tokens. The appealing architectural properties of vision transformers enables our adaptive token reduction mechanism to speed up inference without modifying the network architecture or inference hardware. We demonstrate that A-ViT requires no extra parameters or sub-network for halting, as we base the learning of adaptive halting on the original network parameters. We further introduce distributional prior regularization that stabilizes training compared to prior ACT approaches. On the image classification task (ImageNet1K), we show that our proposed A-ViT yields high efficacy in filtering informative spatial features and cutting down on the overall compute. The proposed method improves the throughput of DeiT-Tiny by $62\%$ and DeiT-Small by $38\%$ with only $0.3\%$ accuracy drop, outperforming prior art by a large margin. + +# 1. Introduction + +Transformers have emerged as a popular class of neural network architecture that computes network outputs using highly expressive attention mechanisms. Originated from the natural language processing (NLP) community, they have been shown effective in solving a wide range of problems in NLP, such as machine translation, representation learning, and question answering [2, 9, 22, 35, 44]. Recently, vision transformers have gained an increasing popularity in the vision community and they have been successfully applied to a broad range of vision applications, such as image classification [11, 16, 32, 43, 48, 55], object detection [3, 7, 39], image generation [20, 21], and semantic segmentation [28, 52]. The most popular paradigm remains when vision transformers form tokens via splitting an image into a series of ordered patches and perform inter-/intra-calculations between tokens to solve the underlying task. Processing an image with vision transformers remains computationally expensive, primarily due to the quadratic number of interactions between tokens [36, 40, 53]. Therefore, deploying vision transformers on data processing clusters or edge devices is challenging amid significant computational and memory resources. + +The main focus of this paper is to study how to automati- + +cally adjust the compute in visions transformers as a function of the complexity of the input image. Almost all mainstream vision transformers have a fixed cost during inference that is independent from the input. However, the difficulty of a prediction task varies with the complexity of the input image. For example, classifying a car versus a human from a single image with a homogeneous background is relatively simple; while differentiating between different breeds of dogs on a complex background is more challenging. Even within a single image, the patches that contain detailed object features are far more informative compared to those from the background. Inspired by this, we develop a framework that adaptively adjusts the compute used in vision transformers based on the input. + +The problem of input-dependent inference for neural networks has been studied in prior work. Graves [17] proposed adaptive computation time (ACT) to represent the output of the neural module as a mean-field model defined by a halting distribution. Such formulation relaxes the discrete halting problem to a continuous optimization problem that minimizes an upper bound on the total compute. Recently, stochastic methods were also applied to solve this problem, leveraging geometric-modelling of exit distribution to enable early halting of network layers [1]. Figurnov et al. [13] proposed a spatial extension of ACT that halts convolutional operations along the spatial cells rather than the residual layers. This approach does not lead to faster inference as high-performance hardware still relies on dense computations. However, we show that the vision transformer's uniform shape and tokenization enable an adaptive computation method to yield a direct speedup on off-the-shelf hardware, surpassing prior work in efficiency-accuracy tradeoff. + +In this paper, we propose an input-dependent adaptive inference mechanism for vision transformers. A naive approach is to follow ACT, where the computation is halted for all tokens in a residual layer simultaneously. We observe that this approach reduces the compute by a small margin with an undesirable accuracy loss. To resolve this, we propose A-ViT, a spatially adaptive inference mechanism that halts the compute of different tokens at different depths, reserving compute for only discriminative tokens in a dynamic manner. Unlike point-wise ACT within convolutional feature maps [13], our spatial halting is directly supported by high-performance hardware since the halted tokens can be efficiently removed from the underlying computation. Moreover, entire halting mechanism can be learnt using existing parameters within the model, without introducing any extra parameters. We also propose a novel approach to target different computational budgets by enforcing a distributional prior on the halting probability. We empirically observe that the depth of the compute is highly correlated with the object semantics, indicating that our model can ignore less relevant background information (see quick examples in Fig. 1 and + +more examples in Fig. 3). Our proposed approach significantly cuts down the inference cost - A-ViT improves the throughput of DEIT-Tiny by $62\%$ and DEIT-Small by $38\%$ with only $0.3\%$ accuracy drop on ImageNet1K. + +Our main contributions are as follows: + +- We introduce a method for input-dependent inference in vision transformers that allows us to halt the computation for different tokens at different depth. +- We base learning of adaptive token halting on the existent embedding dimensions in the original architecture and do not require extra parameters or compute for halting. +- We introduce distributional prior regularization to guide halting towards a specific distribution and average token depth that stabilizes ACT training. +- We analyze the depth of varying tokens across different images and provide insights into the attention mechanism of vision transformer. +- We empirically show that the proposed method improves throughput by up to $62\%$ on hardware with minor drop in accuracy. + +# 2. Related Work + +There are a number of ways to improve the efficiency of transformers including weight sharing across transformer blocks [26], dynamically controlling the attention span of each token [5, 40], allowing the model to output the result in an earlier transformer block [38, 56], and applying pruning [53]. A number of methods have aimed at reducing the computationally complexity of transformers by reducing the quadratic interactions between tokens [6, 23, 24, 41, 47]. We focus on approaches related to adaptive inference that depends on the input image complexity. A more detailed analysis of the literature is present in [19]. + +Special architectures. One way is to change the architecture of the model to support adaptive computations [4, 14, 15, 18, 25, 27, 30, 37, 42, 51, 54]. For example, models that represent a neural network as a fixed-point function can have the property of adaptive computation by default. Such models compute the difference to the internal state and, when applied over multiple iterations, converge towards the solution (desired output). For example, neural ordinary differential equations (ODEs) use a new architecture with repetitive computation to learn the dynamics of the process [10]. Using ODEs requires a specific solver, is often slower than fix depth models and requires adding extra constraints on the model design. [54] learns a set of classifiers with different resolutions executed in order; computation stops when confidence of the model is above the threshold. [27] proposed a residual variant with shared weights and a halting mechanism. + +Stochastic and reinforcement learning (RL) methods. The depth of a residual neural network can be changed during inference by skipping a subset of residual layers. This + +is possible since residual networks have the same input and output feature dimensions and they are known to perform feature refinements iteratively. Individual extra models can be learned on the top of a backbone to change the computational graph. A number of approaches [29, 34, 49, 50] proposed to train a separate network via RL to decide when to halt. These approaches require training of a dedicated halting model and their training is challenging due to the high-variance training signal in RL. Conv-AIG [45] learns conditional gating of residual blocks via Gumbel-softmax trick. [46] extends the idea to spatial dimension (pixel level). Adaptive inference in vision transformers. With the increased popularity, researchers have very recently explored adaptive inference for vision transformers. DynamicViT [36] uses extra control gates that are trained with the Gumbel-softmax trick to halt tokens and it resembles some similarities to Conv-AIG [45] and [46]. Gumbel-softmax-based relaxation solutions might be sub-optimal due to the difficulty of regularization, stochasticity of training, and early convergence of the stochastic loss, requiring multi-stage token sparsification as a heuristic guidance. In this work, we approach the problem from a rather different perspective, and we study how an ACT [17]-like approach can be defined for spatially adaptive computation in vision transformers. We show complete viability to remove the need for the extra halting sub-networks, and we show that our models bring simultaneous efficiency, accuracy, and token-importance allocation improvements, as shown later. + +# 3. A-ViT + +Consider a vision transformer network that takes an image $x \in \mathcal{R}^{C \times H \times W} (C, H, \text{and } W$ represent channel, height, and width respectively) as input to make a prediction through: + +$$ +y = \mathcal {C} \circ \mathcal {F} ^ {L} \circ \mathcal {F} ^ {L - 1} \circ \dots \circ \mathcal {F} ^ {1} \circ \mathcal {E} (x), \tag {1} +$$ + +where the encoding network $\mathcal{E}(\cdot)$ tokenizes the image patches from $x$ into the positioned tokens $t\in \mathcal{R}^{K\times E}$ , $K$ being the total number of tokens and $E$ the embedding dimension of each token. $\mathcal{C}(\cdot)$ post-processes the transformed class token after the entire stack, while the $L$ intermediate transformer blocks $\mathcal{F}(\cdot)$ transform the input via self-attention. Consider the transformer block at layer $l$ that transforms all tokens from layer $l - 1$ via: + +$$ +t _ {1: K} ^ {l} = \mathcal {F} ^ {l} \left(t _ {1: K} ^ {l - 1}\right), \tag {2} +$$ + +where $t_{1:K}^{l}$ denotes all the $K$ updated token, with $t_{1:K}^{0} = \mathcal{E}(x)$ . Note that the internal computation flow of transformer blocks $\mathcal{F}(\cdot)$ is such that the number of tokens $K$ can be changed from a layer to another. This offers out-of-the-box computational gains when tokens are dropped due to the halting mechanism. Vision transformer [11, 43] utilizes a consistent feature dimension $E$ for all tokens throughout + +layers. This makes it easy to learn and capture a global halting mechanism that monitors all layers in a joint manner. This also makes halting design easier for transformers compared to CNNs that require explicit handling of varying architectural dimensions, e.g., number of channel, at different depths. + +To halt tokens adaptively, we introduce an input-dependent halting score for each token as a halting probability $h_k^l$ for a token $k$ at layer $l$ : + +$$ +h _ {k} ^ {l} = H \left(t _ {k} ^ {l}\right), \tag {3} +$$ + +where $H(\cdot)$ is a halting module. Akin to ACT [17], we enforce the halting score of each token $h_k^l$ to be in the range $0 \leqslant h_k^l \leqslant 1$ , and use accumulative importance to halt tokens as inference progresses into deeper layers. To this end, we conduct the token stopping when the cumulative halting score exceeds $1 - \epsilon$ : + +$$ +N _ {k} = \underset {n \leqslant L} {\operatorname {a r g m i n}} \sum_ {l = 1} ^ {n} h _ {k} ^ {l} \geqslant 1 - \epsilon , \tag {4} +$$ + +where $\epsilon$ is a small positive constant that allows halting after one layer. To further alleviate any dependency on dynamically halted tokens between adjacent layers, we mask out a token $t_k$ for all remaining depth $l > N_k$ once it is halted by (i) zeroing out the token value, and (ii) blocking its attention to other tokens, shielding its impact to $t^{l > N_k}$ in Eqn. 2. We define $h_{1:K}^L = 1$ to enforce stopping at the final layer for all tokens. Our token masking keeps the computational cost of our training iterations similar to the original vision transformer's training cost. However, at the inference time, we simply remove the halted tokens from computation to measure the actual speedup gained by our halting mechanism. + +We incorporate $H(\cdot)$ into the existing vision transformer block by allocating a single neuron in the MLP layer to do the task. Therefore, we do not introduce any additional learnable parameters or compute for halting mechanism. More specifically, we observe that the embedding dimension $E$ of each token spares sufficient capacity to accommodate learning of adaptive halting, enabling halting score calculation as: + +$$ +H \left(t _ {k} ^ {l}\right) = \sigma \left(\gamma \cdot t _ {k, e} ^ {l} + \beta\right), \tag {5} +$$ + +where $t_{k,e}^{l}$ indicates the $e^{\mathrm{th}}$ dimension of token $t_{k}^{l}$ and $\sigma(u) = \frac{1}{1 + \exp^{-u}}$ is the logistic sigmoid function. Above, $\beta$ and $\gamma$ are shifting and scaling parameters that adjust the embedding before applying the non-linearity. Note that these two scalar parameters are shared across all layers for all tokens. Only one entry of the embedding dimension $E$ is used for halting score calculation. Empirically, we observe that the simple choice of $e = 0$ (the first dimension) performs well, while varying indices does not change the original performance, as we show later. As a result our halting mechanism does not introduce additional parameters or sub-network beyond the two scalar parameters $\beta$ and $\gamma$ . + +![](images/0121e06e0153a70d9d610aec3a7cf04039714eb6bf5f5dee530c0533c2ff1439.jpg) +Figure 2. An example of A-ViT: In the visualization, we omit (i) other patch tokens, (ii) the attention between the class and patch token and (iii) residual connections for simplicity. The first element of every token is reserved for halting score calculation, adding no computation overhead. We denote the class token with a subscript $c$ as it has a special treatment. Each token indexed by $k$ has a separate $N_{k}$ accumulator and stop at different depths. Unlike standard ACT, the mean-field formulation is applied only to the classification token, while other tokens contribute to the class token via attention. This allows adaptive token calculation without the aggregation of image/patch tokens. + +To track progress of halting probabilities across layers, we calculate a remainder for each token as: + +$$ +r _ {k} = 1 - \sum_ {l = 1} ^ {N _ {k} - 1} h _ {k} ^ {l}, \tag {6} +$$ + +that subsequent forms a halting probability as: + +$$ +p _ {k} ^ {l} = \left\{ \begin{array}{l l} 0 & \text {i f} l > N _ {k}, \\ r _ {k} & \text {i f} l = N _ {k}, \\ h _ {k} ^ {l} & \text {i f} l < N _ {k}. \end{array} \right. \tag {7} +$$ + +Given the range of $h$ and $r$ , halting probability per token at each layer is always bounded $0 \leqslant p_k^l \leqslant 1$ . The overall ponder loss to encourage early stopping is formulated via auxiliary variable $r$ (reminder): + +$$ +\mathcal {L} _ {\text {p o n d e r}} := \frac {1}{K} \sum_ {k = 1} ^ {K} \rho_ {k} = \frac {1}{K} \sum_ {k = 1} ^ {K} \left(N _ {k} + r _ {k}\right), \tag {8} +$$ + +where ponder loss $\rho_{k}$ of each token is averaged. Vision transformers use a special class token $t_k$ to produce the classification prediction, we denote it as $t_c$ for future notations. This token similar to other input tokens is updated in all layers. We apply a mean-field formulation (halting-probability weighted average of previous states) to form the output token $t_o$ and the associated task loss as: + +$$ +\mathcal {L} _ {\text {t a s k}} = \mathcal {C} \left(t _ {o}\right), \text {w h e r e} t _ {o} = \sum_ {l = 1} ^ {L} p _ {c} ^ {l} t _ {c} ^ {l}. \tag {9} +$$ + +Our vision transformer can then be trained by minimizing: + +$$ +\mathcal {L} _ {\text {o v e r a l l}} = \mathcal {L} _ {\text {t a s k}} + \alpha_ {\mathrm {p}} \mathcal {L} _ {\text {p o n d e r}}, \tag {10} +$$ + +where $\alpha_{\mathrm{p}}$ scales the pondering loss relative to the main task loss. Algorithm 1 describes the overall computation flow, and Fig. 2 depicts the associated halting mechanism for visual explanation. At this stage, the objective function encourages an accuracy-efficiency trade-off when pondering different tokens at varying depths, enabling adaptive control. + +One critical factor in Eqn. 10 is $\alpha_{\mathrm{p}}$ that balances halting strength and network performance for the target application. A larger $\alpha_{\mathrm{p}}$ value imposes a stronger penalty, and hence learns to halt tokens earlier. Despite efficacy towards computation reduction, prior work on adaptive computation [13, 17] have found that training can be sensitive to the choice of $\alpha_{\mathrm{p}}$ and its value may not provide a fine-grain control over accuracy-efficiency trade-off. We empirically observe a similar behavior in vision transformers. + +As a remedy, we introduce a distributional prior to regularize $h^l$ such that tokens are expected to exit at a target depth on average, however, we still allow per-image variations. In this case for infinite number of input images we expect the depth of token to vary within the distributional prior. Similar prior distribution has been recently shown effective to stabilize convergence during stochastic pondering [1]. To this end, we define a halting score distribution: + +$$ +\mathcal {H} := \left[ \frac {\sum_ {k = 1} ^ {K} h _ {k} ^ {1}}{K}, \frac {\sum_ {k = 1} ^ {K} h _ {k} ^ {2}}{K}, \dots , \frac {\sum_ {k = 1} ^ {K} h _ {k} ^ {L}}{K} \right], \tag {11} +$$ + +that averages expected halting score for all tokens across at each layer of network (i.e., $\mathcal{H} \in \mathcal{R}^L$ ). Using this as an estimate of how halting likelihoods distribute across layers, we regularize this distribution towards a pre-defined prior using KL divergence. We form the new distributional prior regularization term as: + +$$ +\mathcal {L} _ {\text {d i s t r .}} = \mathrm {K L} (\mathcal {H} | | \mathcal {H} ^ {\text {t a r g e t}}), \tag {12} +$$ + +Algorithm 1 Adaptive tokens in vision transformer without imposing extra parameters. + +Input: tokenized input tensor $\mathbf{input} \in \mathcal{R}^{K \times E}$ , $K, E$ being token number and embedding dimension; $c$ is class-token index in $K$ ; $0 < \epsilon < 1$ + +Output: aggregated output tensor out, ponder loss $\rho$ + +1: t = input +2: cumul = 0 ▷ Cumulative halting score +3: R = 1 ▷ Remainder value +4: out = 0 ▷ Output of the network +5: ρ = 0 ▷ Token ponder loss vector +6: m = 1 ▷ Token mask m ∈ $\mathcal{R}^K$ +7: for l = 1 ... L do +8: t = $\mathcal{F}^l(t \odot m)$ +9: if l < L then +10: h = σ(γ · t :, 0 + β) ▷ h ∈ $\mathcal{R}^K$ +11: else +12: h = 1 +13: end if +14: cumul += h +15: ρ += m ▷ Add one per remaining token +16: for k = 1, ..., K do +17: if cumulk < 1 - ε then +18: Rk -= hk +19: else +20: ρk += Rk +21: end if +22: end for +23: if cumulc < 1 - ε then +24: out += tc,: × hc +25: else +26: out += tc,: × Rc +27: end if +28: m ← cumul < 1 - ε ▷ Update mask +29: end for +30: return out, ρ = sum(ρ) / K + +where KL refers to the Kullback-Leibler divergence, and $\mathcal{H}^{\mathrm{target}}$ denotes a target halting score distribution with a guiding stopping layer. We use the probability density function of Gaussian distribution to define a bell-shaped distribution $\mathcal{H}^{\mathrm{target}}$ in this paper, centered at the expected stopping depth $N^{\mathrm{target}}$ . Intuitively, this weakly encourages the expected sum of halting score for each token to trigger exit condition at $N^{\mathrm{target}}$ . This offers enhanced control of expected remaining compute, as we show later in experiments. + +Our final loss function that trains the network parameters for adaptive token computation is formulated as: + +$$ +\mathcal {L} _ {\text {o v e r a l l}} = \mathcal {L} _ {\text {t a s k}} + \alpha_ {\mathrm {d}} \mathcal {L} _ {\text {d i s t r .}} + \alpha_ {\mathrm {p}} \mathcal {L} _ {\text {p o n d e r}}, \tag {13} +$$ + +where $\alpha_{\mathrm{d}}$ is a scalar coefficient that balances the distribution regularization against other loss terms. + +# 4. Experiments + +We evaluate our method for the classification task on the large-scale 1000-class ImageNet ILSVRC 2012 dataset [8] at the $224 \times 224$ pixel resolution. We first analyze the performance of adaptive tokens, both qualitatively and quantitatively. Then, we show the benefits of the proposed method over prior art, followed by a demonstration of direct throughput improvements of vision transformers on legacy hardware. Finally, we evaluate the different components of our proposed approach to validate our design choices. + +Implementation details. We base A-ViT on the data-efficient vision transformer architecture (DeiT) [43] that includes 12 layers in total. Based on original training recipe1, we train all models on only ImageNet1K dataset without auxiliary images. We use the default $16 \times 16$ patch resolution. For all experiments in this section, we use Adam for optimization (learning rate $1.5 \cdot 10^{-3}$ ) with cosine learning rate decay. For regularization constants we utilize $\alpha_{\mathrm{d}} = 0.1$ , $\alpha_{\mathrm{p}} = 5 \cdot 10^{-4}$ to scale loss terms. We use $\gamma = 5$ , $\beta = -10$ for sigmoid control gates $H(\cdot)$ , shared across all layers. We use the embedding value at index $e = 0$ to represent the halting probability $(H(\cdot))$ for tokens. Starting from publicly available pretrained checkpoints, we fine-tune DeiT-T/S variant models for 100 epochs, respectively, to learn adaptive tokens without distillation. We denote the associated adaptive versions as A-ViT-T/S respectively. In what follows, we mainly use the A-ViT-T for ablations and analysis before showing efficiency improvements for both variants afterwards. We find that mixup is not compatible with adaptive inference, and we focus on classification without auxiliary distillation token – we remove both from finetuning. Applying our finetuning on the full DeiT-S and DeiT-T results in a top-1 accuracy of $78.9\%$ and $71.3\%$ , respectively. For training runs we use 8 NVIDIA V100 GPUs and automatic-mixed precision (AMP) [33] acceleration. + +# 4.1. Analysis + +Qualitative results. Fig. 3 visualizes the tokens' depth that is adaptively controlled during inference with our A-ViT over the ImageNet1K validation set. Remarkably, we observe that our adaptive token halting enables longer processing for highly discriminative and salient regions, often associated with the target class. Also, we observe a highly effective halting of relatively irrelevant tokens and their associated computations. For example, our approach on animal classes retains the eyes, textures, and colors from the target object and analyze them in full depth, while using fewer layers to process the background (e.g., the sky around the bird, and ocean around sea animals). Note that even background tokens marked as not important still actively participate in + +![](images/6619bb8afe29e202a9031ac10ec64d9d9ad4cd53f4e195d55454b01253646aa4.jpg) +Figure 3. Original image (left) and the dynamic token depth (right) of A-ViT-T on the ImageNet-1K validation set. Distribution of token computation highly aligns with visual features. Tokens associated with informative regions are adaptively processed deeper, robust to repeating objects with complex backgrounds. Best viewed in color. + +classification during initial layers. In addition, we also observe the inspiring fact that adaptive tokens can easily (i) keep track of repeating target objects, as shown in the first image of the last row in Fig. 3, and (ii) even shield irrelevant objects completely (see second image of last row). + +Token depth distribution. Given a complete distinct token distribution per image, we next analyze the dataset-level token importance distributions for additional insights. Fig. 4 (a) depicts the average depth of the learnt tokens over the validation set. It demonstrates a 2D Gaussian-like distribution that is centered at the image center. This is consistent with the fact that most ImageNet samples are centered, intuitively aligning with the image distribution. As a result, more compute is allocated on-the-fly to center areas, and computational cost on the sides is reduced. + +Halting score distribution. To further evaluate the halting behavior across transformer layers, we plot the average layerwise halting score distribution over 12 layers. Fig. 4 (b) + +![](images/eefea9470b68fac7df002084a8403e632593b81e5c5ee8a42388347636d2ef86.jpg) +(a) + +![](images/dde56074b924a69dbb2f2dab6b3141b468c0ccd3038fa5793eace15794330538.jpg) +(b) +Figure 4. (a) Average depth of tokens per image patch position for A-ViT-T on ImageNet-1K validation set. (b) Halting score distribution across the transformer blocks. Each point associated with one randomly sampled image, denoting average token score at that layer. + +shows box plots of halting scores averaged over all tokens per layer per image. The analysis is performed on 5K randomly sampled validation images. As expected, the halting score gradually increases at initial stages, peaks and then decreases + +![](images/e9235e3774127bb4f05813e2d08d39d94cf494e4e2c7ed65ce3431f5ec89c884.jpg) +Hard samples. +Figure 5. Visual comparison of hard and easy samples from the ImageNet-1K validation set determined by average token depth. Note that all images above be correctly classified - only difference is that hard samples require more depths for tokens to process their semantic information. Tokens in the left images exit approximately 5 layers later compared to the right images. + +![](images/e9ae3c73a54a258ce465e96725ec43f94a8ad26a54f06785b5e5232ba937554e.jpg) +Easy samples. + +for deeper layers. + +Sharp-halting baseline. To further compare with static models of the same depth for performance gauging, we also train a DeiT-T with 8 layers as a sharp-halting baseline. We observe that our A-ViT-T outperforms this new baseline by $+1.4\%$ top-1 accuracy at a similar throughput. Although our adaptive regime is on average similarly shallow, it still inherits the expressivity of the original deeper network, as we observe that informative tokens are processed by deeper layers (e.g., until $12^{\text{th}}$ layer as in Fig. 3). + +Easy and hard samples. We can analyse the difficulty of an image for the network by looking at the averaged depth of the adaptive tokens per image. Therefore, in Fig. 5, we depict hard and easy samples in terms of the required computation. Note, all samples in the figure are correctly classified, and only differ by the averaged token depth. We can observe that images with homogeneous background are relatively easy for classification, and A-ViT processes them much faster than hard samples. Hard samples represent images with informative visual features distributed over the entire image, and hence incur more computation. + +Class-wise sensitivity. Given an adaptive inference paradigm, we analyze the change in classification accuracy for various classes with respect to the full model. In particular, we compute class-wise validation accuracy changes before and after applying adaptive inference. We summarize both qualitative and quantitative results in Table 1. We observe that originally very confident or uncertain samples are not affected by adaptive inference. Adaptive inference improves accuracy of the visually dominant classes such as individual furniture and animals. + +# 4.2. Comparison to Prior Art + +Next, we compare our method with previous work that study adaptive computation. For comprehensiveness, we sys + +
RankClass-wise Sensitivity to Adaptive Inference static acc.→adaptive acc.
Favoring (acc. incr.)Sensitive (acc. drop)Stable
1throne 56→74%muzzle 58→38%yellow lady-slipper 100→100%
2lakeland terrier 64→78%sewing machine 80→62%leonberg 100→100%
3cogi 60→74%vaccine 37→28%proboscis monkey 100→100%
4african elephant 54→68%flute 38→20%velvet 10→10%
5soft-coated wheaten terrier 68→82%shovel 64→46%laptop 14→14%
muzzlesewing machinevacuumthroneterriercogi
fixed √ adaptive ×fixed × adaptive √
+ +Table 1. Ranking of stable and sensitive classes to adaptive computation in A-ViT compared to fixed computation graph that executes the full model for inference. Sample images included for top three classes that favor or remain sensitive to adaptive computation. + +tematically compare with five state-of-the-art halting mechanisms, covering both vision and NLP methods that tackle the dynamic inference problem from different perspectives: (i) adaptive computation time [17] as ACT reference applied on halting entire layers, (ii) confidence-based halting [31] that gauges on logits, (iii) similarity-based halting [12] that oversees layer-wise similarity, (iv) pondering-based halting [1] that exits based on stochastic halting-probabilities, and (v) the very recent DynamicViT [36] that learns halting decisions via Gumble-softmax relaxation. Details in appendix. + +Performance comparison. We compare our results in Table 2 and demonstrate simultaneous performance improvements over prior art in having smaller averaged depth, smaller number of FLOPs and better classification accuracy. Notably our method involves no extra parameters, while cutting down FLOPs by $39\%$ with only a minor loss of accuracy. To further visualize improvements over the state-of-the-art DynamicViT [36], we include Fig. 6 as a qualitative comparison of token depth for an official sample presented in the work. As noticed, A-ViT more effectively captures the important regions associated with the target objects, ignores the background tokens, and improves efficiency. + +Note that both DynamicViT and A-ViT investigate adaptive tokens but from two different angles. DynamicViT utilizes Gumbel-Softmax to learn halting and incorporates a control for computation via a multi-stage token keeping ratio; it provides stronger guarantees on the latency by simply setting the ratio. A-ViT on the other hand takes a complete probabilistic approach to learn halting via ACT. This enables it to freely adjust computation, and hence capture enhanced semantic and improve accuracy, however requires a distributional prior and has a less intuitive hyper-parameter. + +Hardware speedup. In Table 3, we compare speedup on off-the-shelf GPUs. See appendix for measurement details. In contrast to spatial ACT in CNNs that require extra computation flow and kernel re-writing [13], A-ViT enables speedups out of the box in vision transformers. With only $0.3\%$ in accuracy drop, our method directly improves the throughputs of DeiT small and tiny variants by $38\%$ and $62\%$ without requiring hardware/library modification. + +
MethodEfficiencyTop-1 Acc. ↑
Params. freeAvg. depth ↓FLOPs ↓
Baseline [43]-12.001.3G71.3
ACT [17]10.011.0G71.0
Confidence threshold [31]10.631.1G65.8
Similarity gauging [12]10.681.1G69.4
PonderNet [1]9.741.0G66.2
DynamicViT [36]7.620.9G70.9
Ours7.230.8G71.0
+ +![](images/4be0efe8b526264e58f6354db080e9e77d4a364b5a3226155d22d171a908679e.jpg) +Original + +![](images/7dc598e854b198f7fb5abebee53ae52d709f0ecc155a51e772f74c085ee54b5b.jpg) +DynamicViT (Rao et al. [36]) +Figure 6. Visual comparison compared to prior art on token distribution for a sample taken from the public repository of DynamicViT by Rao et al. [36]. Only shaded (non-white) tokens are processed by all 12 layers. Our method better captures the semantics of the target class, drops more tokens, and saves more computation. + +![](images/8a007c34bdc8464b615e58394ae7a3ce876e86d181192435ca66681e7322b847.jpg) +Ours + +# 4.3. Ablations + +Here, we perform ablations studies to evaluate each component in our method and validate their contributions. + +Token-level ACT via $\mathcal{L}_{\text {ponder }}$ . One noticeable distinction of this work from conventional ACT [17] is a full exploration of spatial redundancy in image patches, and hence their tokens. Comparing the first and last row in Table 2, we observe that our fine-grained pondering reduces token depths by roughly 3 layers, and results in $25\%$ more FLOP reductions compared to the conventional ACT. + +Distributional prior via $\mathcal{L}_{\mathrm{distr}}$ . Incorporating the distributional prior allows us to better guide the expected token depth towards a target average depth, as seen in Fig. 7. As opposed to $\alpha_{\mathrm{p}}$ that indirectly gauges on the remaining efficiency and usually suffers from over-/under-penalization, our distributional prior guides a quick convergence to a target depth level, and hence improves final accuracy. Note that a distributional prior complements the ponder loss in guiding overall halting towards a target depth, but it cannot capture remainder information – using ACT-agnostic distributional prior alone results in an accuracy drop of more than $2\%$ . + +"Free" embedding to learn halting. Next we justify the usage of a single value in the embedding vector for halting score computation and representation. In the embedding vectors, we set one entry at a random index to zero and analyze the associated accuracy drop without any fin-tuning of the model. Repeating 10 times for DeiT-T/S variants, the ImageNet1K top-1 accuracy only drops by $0.08\% \pm 0.04\% / 0.04\% \pm 0.03\%$ , respectively. This experiment demonstrates that one element in the vector can be used for another task with minimal impact on the original + +Table 2. Comparison with prior art that studies dynamic inference halting mechanisms for transformers. Avg. depth specifies the mean depths of the tokens over the entire validation set. + +
MethodEfficiencyTop-1 Acc.↑Throughput
Params. ↓FLOPs ↓
ViT-B [11]86M17.6G77.90.3K ims/s
DeiT-S [43]22M4.6G78.90.8K ims/s
DynamicViT [36]23M3.4G78.31.0K ims/s
A-ViT-S22M3.6G78.61.1K ims/s
A-ViT-S + distl.22M3.6G80.71.1K ims/s
DeiT-T [43]5M1.2G71.32.1K ims/s
DynamicViT [36]5.9M0.9G70.92.9K ims/s
A-ViT-T5M0.8G71.03.4K ims/s
A-ViT-S + distl.5M0.8G72.41.1K ims/s
+ +Table 3. Throughput improvement enabled via adaptive tokens. Models with $+$ distil. is augmented with distillation token. + +![](images/a3771a6340734225554b4fc2a2be018ce4dfa96875931c8aaef638aa39566f3f.jpg) +Figure 7. Training curves with (blue) and without (yellow) distributional priors towards a target depth of 9 layers. Both lines share the exact same training hyper-parameter set with the only difference in including the distributional prior guidance. As opposed to $\alpha_{\mathrm{p}}$ that over-penalizes the networks, $\mathcal{L}_{\mathrm{distr.}}$ guides a very fast convergence towards the target depth and yields a $6.4\%$ accuracy gain. + +![](images/d0b7ff0df98691bb0b2f3438f52df4d970a0b8a9f6d2ffd76a3cd3cb55dcbbf5.jpg) + +performance. In our experiments, we pick the first element in the vector and use it for the halting score computation. + +Layer-wise networks to learn halting. We continue to examine viability to leverage extra networks for halting learning. To this end we add an extra two-layer learnable network (with input/hidden dimensions of 192/96, internal/output gates as GeLU/Sigmoid) on top of embeddings of each layer in A-ViT-T. We observed a very slight increase in accuracy of $+0.06\%$ with $+0.2\mathrm{M}$ parameter and $-12.6\%$ inference throughput overhead, as auxiliary nets have to be executed sequentially with ViT layers. Given this tradeoff, we base learning of halting on existing ViT parameters. + +# 5. Limitations & Future Directions + +In this work we primarily focused on the classification task. However, extension to other tasks such as video processing can be of great interest, given not only spatial but also temporal redundancy within input tokens. + +# 6. Conclusions + +We have introduced A-ViT to adaptively adjust the amount of token computation based on input complexity. We demonstrated that the method improves vision transformer throughput on hardware without imposing extra parameters or modifications of transformer blocks, outperforming prior dynamic approaches. Captured token importance distribution adaptively varies by input images, yet coincides surprisingly well with human perception, offering insights for future work to improve vision transformer efficiency. + +# References + +[1] Andrea Banino, Jan Balaguer, and Charles Blundell. Pondernet: Learning to ponder. In ICML Workshop, 2021. +[2] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. +[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. +[4] Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. In NeurIPS, 2018. +[5] Ting Chen, Ji Lin, Tian Lin, Song Han, Chong Wang, and Denny Zhou. Adaptive mixture of low-rank factorizations for compact neural modeling, 2019. +[6] Krzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Quincy Davis, Afroz Mohiuddin, Lukasz Kaiser, David Benjamin Belanger, Lucy J Colwell, and Adrian Weller. Rethinking attention with performers. In ICLR, 2021. +[7] Zhigang Dai, Bolun Cai, Yugeng Lin, and Junying Chen. Up-DETR: Unsupervised pre-training for object detection with transformers. In CVPR, 2021. +[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. +[9] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019. +[10] Chengyu Dong, Liyuan Liu, Zichao Li, and Jingbo Shang. Towards adaptive residual network training: A neural-ode perspective. In ICML, 2020. +[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. +[12] Maha Elbayad, Jiatao Gu, Edouard Grave, and Michael Auli. Depth-adaptive transformer. In ICLR, 2020. +[13] Michael Figurnov, Maxwell D Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially adaptive computation time for residual networks. In CVPR, 2017. +[14] Nicholas Frosst and Geoffrey Hinton. Distilling a neural network into a soft decision tree. arXiv preprint arXiv:1711.09784, 2017. +[15] Samy Wu Fung, Howard Heaton, Qiuwei Li, Daniel McKenzie, Stanley Osher, and Wotao Yin. JFB: Jacobian-free backpropagation for implicit networks. https://arxiv.org/abs/2103.12803, 2021. +[16] Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. LeVit: A vision transformer in convnet's clothing for faster inference. In ICCV, 2021. + +[17] Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016. +[18] Qiushan Guo, Zhipeng Yu, Yichao Wu, Ding Liang, Haoyu Qin, and Junjie Yan. Dynamic recursive neural network. In CVPR, 2019. +[19] Yizeng Han, Gao Huang, Shiji Song, Le Yang, Honghui Wang, and Yulin Wang. Dynamic neural networks: A survey. TPAMI, 2021. +[20] Drew A Hudson and C Lawrence Zitnick. Generative adversarial transformers. arXiv preprint arXiv:2103.01209, 2021. +[21] Yifan Jiang, Shiyu Chang, and Zhangyang Wang. TransGAN: Two transformers can make one strong GAN. In NeurIPS, 2021. +[22] Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. TinyBERT: Distilling bert for natural language understanding. In EMNLP, 2020. +[23] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are RNNs: Fast autoregressive transformers with linear attention. In ICML, 2020. +[24] Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In ICLR, 2020. +[25] Peter Kontschieder, Madalina Fiterau, Antonio Criminisi, and Samuel Rota Bulo. Deep neural decision forests. In CVPR, 2015. +[26] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A lite BERT for self-supervised learning of language representations. In ICLR, 2020. +[27] Sam Leroux, Pieter Simoens, Bart Dhoedt, P Molchanov, T Breuel, and J Kautz. IamNN: Iterative and adaptive mobile neural network for efficient image classification. In ICLR Workshop, 2018. +[28] Zhiqi Li, Wenhai Wang, Enze Xie, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, Tong Lu, and Ping Luo. Panoptic segformer. arXiv preprint arXiv:2109.03814, 2021. +[29] Ji Lin, Yongming Rao, Jiwen Lu, and Jie Zhou. Runtime neural pruning. In NeurlPS, 2017. +[30] Lanlan Liu and Jia Deng. Dynamic deep neural networks: Optimizing accuracy-efficiency trade-offs by selective execution. In AAAI, 2018. +[31] Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Haotang Deng, and Qi Ju. FastBERT: A self-distilling bert with adaptive inference time. In ACL, 2020. +[32] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, 2021. +[33] Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. Mixed precision training. In ICLR, 2018. +[34] Augustus Odena, Dieterich Lawson, and Christopher Olah. Changing model behavior at test-time using reinforcement learning. arXiv preprint arXiv:1702.07780, 2017. +[35] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training, 2018. + +[36] Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. DynamicViT: Efficient vision transformers with dynamic token sparsification. In NeurIPS, 2021. +[37] Samuel Rota Bulo and Peter Kontschieder. Neural decision forests for semantic image labelling. In CVPR, 2014. +[38] Roy Schwartz, Gabriel Stanovsky, Swabha Swayamdipta, Jesse Dodge, and Noah A Smith. The right tool for the job: Matching model and instance complexities. In ACL, 2020. +[39] Zhiqing Sun, Shengcao Cao, Yiming Yang, and Kris M Kitani. Rethinking transformer-based set prediction for object detection. In ICCV, 2021. +[40] Thierry Tambe, Coleman Hooper, Lillian Pentecost, Tianyu Jia, En-Yu Yang, Marco Donato, Victor Sanh, Paul Whatmough, Alexander M Rush, David Brooks, et al. EdgeBERT: Sentence-level energy optimizations for latency-aware multitask nlp inference. In MICRO, 2020. +[41] Yi Tay, Dara Bahri, Liu Yang, Donald Metzler, and Da-Cheng Juan. Sparse sinkhorn attention. In ICML, 2020. +[42] Surat Teerapittayanon, Bradley McDanel, and Hsiang-Tsung Kung. BranchyNet: Fast inference via early exiting from deep neural networks. In ICPR, 2016. +[43] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021. +[44] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. +[45] Andreas Veit and Serge Belongie. Convolutional networks with adaptive inference graphs. In ECCV, 2018. +[46] Thomas Verelst and Tinne Tuytelaars. Dynamic convolutions: Exploiting spatial sparsity for faster inference. In CVPR, 2020. +[47] Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020. +[48] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In ICCV, 2021. +[49] Xin Wang, Fisher Yu, Zi-Yi Dou, Trevor Darrell, and Joseph E Gonzalez. SkipNet: Learning dynamic routing in convolutional networks. In ECCV, 2018. +[50] Zuxuan Wu, Tushar Nagarajan, Abhishek Kumar, Steven Rennie, Larry S Davis, Kristen Grauman, and Rogerio Feris. Blockdrop: Dynamic inference paths in residual networks. In CVPR, 2018. +[51] Wenhan Xia, Hongxu Yin, Xiaoliang Dai, and Niraj K Jha. Fully dynamic inference with deep neural networks. TETC, 2021. +[52] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. SegFormer: Simple and efficient design for semantic segmentation with transformers. In NeurIPS, 2021. +[53] Huanrui Yang, Hongxu Yin, Pavlo Molchanov, Hai Li, and Jan Kautz. NViT: Vision transformer compression and parameter redistribution. arXiv preprint arXiv:2110.04869, 2021. + +[54] Le Yang, Yizeng Han, Xi Chen, Shiji Song, Jifeng Dai, and Gao Huang. Resolution adaptive networks for efficient inference. In CVPR, 2020. +[55] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Zihang Jiang, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token ViT: Training vision transformers from scratch onImagenet. In ICCV, 2021. +[56] Wangchunshu Zhou, Canwen Xu, Tao Ge, Julian McAuley, Ke Xu, and Furu Wei. BERT loses patience: Fast and robust inference with early exit. In NeurIPS, 2020. \ No newline at end of file diff --git a/avitadaptivetokensforefficientvisiontransformer/images.zip b/avitadaptivetokensforefficientvisiontransformer/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b917b9373ec7bbf657d9db8db609a1d304d1a854 --- /dev/null +++ b/avitadaptivetokensforefficientvisiontransformer/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae9826121dbe28903c931e4508e22a16f457a268c5dddafda446f26e07bc228 +size 618846 diff --git a/avitadaptivetokensforefficientvisiontransformer/layout.json b/avitadaptivetokensforefficientvisiontransformer/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7937147fe551f231359feb43c2049f315fed7b41 --- /dev/null +++ b/avitadaptivetokensforefficientvisiontransformer/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9160fcbb35464d77dd6163cb503c8317fb3d66e50211b761eed304cf6c425bcd +size 412404 diff --git a/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_content_list.json b/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e90875205047a6a8e672aeae7034316568673514 --- /dev/null +++ b/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:557472fd6e9c4d03b469b91e0da9d2df838a1ae1a27dba6c26698b304be68e6b +size 80897 diff --git a/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_model.json b/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9debe4324627cbd74bbbe2a7120ce506b43f2413 --- /dev/null +++ b/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d79c92a42a697af6c4ed5dcdffa9f8672a241876492e2e8fa60eb7614fcc1c0 +size 99837 diff --git a/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_origin.pdf b/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..86f9c669913a34191ce31212dd8af96df0a9394f --- /dev/null +++ b/avoxelgraphcnnforobjectclassificationwitheventcameras/84f5af9b-1ec8-4a50-957a-94e61dcdb494_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:791d0af6da88050d12bfadff1e9d2230ebac6d70affa87f920e157643417daab +size 1905572 diff --git a/avoxelgraphcnnforobjectclassificationwitheventcameras/full.md b/avoxelgraphcnnforobjectclassificationwitheventcameras/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8d3a2eea1e952f238655e0c56d62bdada3b967e1 --- /dev/null +++ b/avoxelgraphcnnforobjectclassificationwitheventcameras/full.md @@ -0,0 +1,289 @@ +# A Voxel Graph CNN for Object Classification with Event Cameras + +Yongjian Deng1 + +Hao Chen\* + +Hai Liu3 + +Youfu Li\* + +1College of Computer Science, Beijing University of Technology + +$^{2}$ School of Computer Science and Engineering, Southeast University + +3The National Engineering Research Center for E-Learning, Central China Normal University + +$^{4}$ Department of Mechanical Engineering, City University of Hong Kong + +yjdeng@bjut.edu.cn, haochen303@seu.edu.cn, hailiu0204@ccnu.edu.cn, meyfli@cityu.edu.hk + +# Abstract + +Event cameras attract researchers' attention due to their low power consumption, high dynamic range, and extremely high temporal resolution. Learning models on event-based object classification have recently achieved massive success by accumulating sparse events into dense frames to apply traditional 2D learning methods. Yet, these approaches necessitate heavy-weight models and are with high computational complexity due to the redundant information introduced by the sparse-to-dense conversion, limiting the potential of event cameras on real-life applications. This study aims to address the core problem of balancing accuracy and model complexity for event-based classification models. To this end, we introduce a novel graph representation for event data to exploit their sparsity better and customize a lightweight voxel graph convolutional neural network (EV-VGCNN) for event-based classification. Specifically, (1) using voxel-wise vertices rather than previous point-wise inputs to explicitly exploit regional 2D semantics of event streams while keeping the sparsity; (2) proposing a multi-scale feature relational layer (MFRL) to extract spatial and motion cues from each vertex discriminatively concerning its distances to neighbors. Comprehensive experiments show that our model can advance state-of-the-art classification accuracy with extremely low model complexity (merely 0.84M parameters). + +# 1. Introduction + +Each pixel of event cameras is independent and only report lightness changes at the correspondent location (Fig. 1). This novel working principle enables their output to be sparse and non-redundant [28, 37]. Consequently, event + +![](images/fef34badb1abaae735e59b8e82ff837e832f241617609a11a4454d131c03ca35.jpg) +Figure 1. Left: A sketch of the working principle of event cameras (the detailed working principle is introduced in supplementary material). Events are produced asynchronously according to the lightness $(\ln L)$ changes. Red and blue arrows represent positive and negative events, respectively. Right: The RGB image captured from the traditional RGB camera (top) and event signals in the original format produced from an event camera (bottom). + +![](images/0b289104afe0f91e8abd9fcd32e916aed37cfda77bf0fc529c22d7310b00ca5e.jpg) + +cameras hold advantages of low power consumption, high response speed, and high dynamic range compared to traditional cameras [17]. How to tailor models for event data with the particular format to perform core vision tasks, such as object classification, has been a trending topic. Motivated by the huge success of learning-based methods on vision tasks, developing data-driven approaches for event data becomes a leading choice. For instance, many studies [5, 12, 19, 50, 51] resort to 2D convolutional neural networks (CNNs) by converting sparse events to dense frames. These works achieve advanced performance utilizing well-pretrained 2D CNNs. Yet, the constructed dense representation and large size models sacrifice the sparsity of event data (Fig. 2 (a)) while limiting the potential of event cameras on mobile or wearable applications. + +To exploit the sparsity of event data and build low-complexity models, recent researchers migrate learning models initially designed for point clouds to event data, such as the works [43, 47] migrate models from pointnet-like architecture [38] and the approaches [3, 31] utilize graph neural networks. Although these approaches advance in exploiting the sparsity advantage of event data, a fundamental question has never been investigated: Is point-wise + +input (taking event points as processing units) proper for event-based vision tasks? + +Intuitively, each point in 3D point clouds can be used as a key point to building the external structure of an object [8]. Therefore, these points do well in describing the geometry, which is the key for classifying 3D objects. Instead, event data are more like 2D videos recorded asynchronously. Event-based classification models require the ability to accurately extract 2D semantics from the event data rather than their "geometry" (Fig. 1), which usually contains motion cues or motion trajectories. Thus, we believe that using raw events as input is not suitable, as it is difficult for sparse event points to provide decisive features (e.g., local 2D semantics) for event-based models. + +To overcome the lacking of characterizing local 2D semantics in the popular point-based solutions, this study proposes a novel voxel-wise representation for event data. Inspired by the traditional image domain: it is challenging to extract decisive features from images using discrete or discontinuous pixels (like sparse point-wise input). Thus, we propose a representation to encode locally coherent 2D semantics by describing the regional events contained in each voxel. In specific, we build a graph by voxelizing event points, selecting representative voxels as vertices (Fig. 2 (c)), and connecting them according to their spatio-temporal relationships for further processing. Each voxel in the graph can be analogous to frame patches of still images that contain essential cues such as local textures and contours [14], which can help the network recognize 2D scenes effectively. + +Besides the proposed representation, a lightweight graph-based learning architecture (EV-VGCNN) is introduced. The critical problem for designing an event-based graph model is how to learn the embeddings for the edges and vertices' features. First, we learn a scoring matrix for each vertex according to spatio-temporal geometry and utilize the learned matrix to achieve feature aggregation across its neighbors attentively. Moreover, for a vertex in the event-based graph, its adjacent neighbors usually convey local spatial messages, while distant neighbors are more likely to carry motion cues or global changes. Inspired by this variation, we design a multi-scale feature relational layer (MFRL) to extract semantic and motion cues from each vertex discriminatively. Specifically, two learnable blocks in MFRL are applied to adjacent and distant neighbors respectively, and the obtained features are aggregated as the joint representation of a vertex. Finally, we cascade multiple MFRL modules with graph pooling operations and a classifier as the EV-VGCNN to perform end-to-end object classification. The proposed model achieves SOTA accuracy while holding surprisingly low model complexity. + +The main contributions of this paper are summarized as follows: (1) We introduce a novel method to construct event-based graph representation with correspondence to + +![](images/adf2309fec1b0dfd6c872c71163774d87c5b570b3857d1e76147ce288deb46e9.jpg) +Event Signals + +![](images/2db2f17d418dbb5d7281a7953ef1d3053378775e9302b85bc0fc562c9b0fea52.jpg) +(a) + +![](images/a60e083b9c2f9eb1b77f8a4614f7ff6137761a6cbaebf90537f16bcf3dd59d2d.jpg) +(b) +Figure 2. Visual comparison of three types of event-based representation: (a) the frame-based representation by integrating events into dense frames; (b) the point-based representation generated by sampling a subset of event signals; (c) representative event voxels selected as vertices in the proposed graph. + +![](images/a0c1c2f0acf7c6a776ebc132f0f2b3c61104ba446b23915a6955e2c18fce5034.jpg) +(c) + +the properties of event data, which can effectively utilize informative features from voxelized event streams while maintaining the sparse and non-redundant advantage of event data. (2) We introduce the MFRL module composed of several SFRLs to discriminatively learn spatial semantics and motion cues from the event-based graph according to spatio-temporal relations between vertices and their neighbors. (3) Extensive experiments show that our model enjoys noticeable accuracy gains with extremely low model complexity (merely 0.84M parameters). + +# 2. Related Work + +Event-based approaches can be distinguished into two categories: frame-based method and point-based method. + +(i) Frame-based method: integrating event signals into frame-wise 2D representations to directly adopt 2D CNNs for event data. For example, studies such as [11, 12, 29, 30, 50, 51] accumulating event points along the time axis to frames w.r.t events' polarities, locations and timestamps. To adaptively embed events to frames, [19] and [5] introduce learnable neural blocks to weigh the importance of each event in the frame. Besides, The success of methods [10, 18, 23, 40, 46] in knowledge transfer also benefits from the frame-based representation. While these frame-based methods achieve encouraging performance on event-based classification, the conversion from sparse points to dense 2D maps introduces much redundant information [31]. As a result, they typically require heavy-weight models to extract high-level features, limiting the potential of event cameras on mobile or wearable applications. +(ii) Point-based method: taking a single event or a set of regional events as input units for feature extraction and aggregation. Early studies falling in this category focus on designing handcraft descriptors for event data to perform multiple vision tasks, such as corner detection [6, 33], edge/line extraction [29, 42], optical flow prediction [4, 7], denoising [48] and object classification [26, 44]. However, the quality of their extracted features is usually sensitive to the noise and scene variation, limiting their generalizability to complex scenarios. To enable models to respond adaptively to various samples of event data, the development of point-based learning methods is gradually becoming main + +![](images/0e4f46a49915fd9199f8522ebdd82ae71c68ed89cd3d6767b09e3f55762040f5.jpg) +Figure 3. (a) Graph construction: We first voxelize event data and then select $N_{p}$ representative voxels as the graph's input vertices according to the event points number inside each voxel. Finally, we attain features of vertices by integrating their internal events along the time axis. (b) EV-VGCNN: It consists of multiple multi-scale feature relational layers (MFRL) followed by graph pooling for learning global features from the input graph, and several linear layers for object classification. The MFRL module is to aggregate features for each vertex from k-nearest neighbors. In the figure, non-Linear(x,y) is a block with the input channel of $x$ and output channel of $y$ . It contains a linear layer, a Batch Normalization, and a ReLU layer. $N_{r}^{n}$ represents the output number of vertices of each graph pooling operation. + +stream. There are many visual tasks have been performed successfully, e.g., motion estimation [43], motion segmentation [31] and object classification [1, 3, 13, 35, 36, 47]. Among these approaches, the closest studies to ours are methods inspired by 3D point cloud learning models, such as [3, 31, 43, 47], where the RG-CNNs in [3] acquire superior results over other point-based methods on various datasets. These models are lightweight and show their potential in multiple tasks. However, all these algorithms take the original events as input units for further processing. As stated in Section 1, this input representation is challenging to extract regional 2D semantics effectively from event data. As a result, their models' performance on object classification tasks is far behind the frame-based solutions. Instead of using the original events as input units, this paper proposes a novel voxel-wise representation. Our constructed representation retains more semantic and motion cues while maintaining the sparsity advantage. Moreover, the MFRL module allows us to flexibly aggregate features from different neighbors of each vertex in the graph. Consequently, our model outperforms RG-CNNs [3] with a large margin in terms of accuracy and model complexity. In the supplementary, we also include connections between our models with voxel-based approaches for 3D point cloud learning. + +# 3. The Proposed Method + +We propose a novel graph construction method for event data and design a lightweight network EV-VGCNN for object classification. The pipeline of our graph-based solution is shown in Fig. 3, which can be depicted as follows. (i) + +The event stream is organized into voxels, where each voxel may contain several events. $(ii)$ We regard each voxel as a vertex in our graph. In specific, the coordinate of a vertex is determined by voxel positions. The feature (temporal and regional semantics) at each vertex is obtained by accumulating event point features inside its corresponding voxel. $(iii)$ We utilize the EV-VGCNN for sequentially aggregating each vertex's features to generate global representations. In the following, we detail two crucial components in our learning architecture sequentially, including the graph construction (Sec. 3.1) and the EV-VGCNN (Sec. 3.2). + +# 3.1. Graph construction + +In this part, we build a directed graph $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ , where $\mathcal{V} = \{1,\dots,N_p\}$ and $\mathcal{E}$ represent vertices and edges respectively. Each vertex $\nu_{i}$ has two attributes which are the spatio-temporal coordinate $\mathcal{U}_i\in \mathbb{R}^{1\times 3}$ and the feature vector $\mathcal{F}_i\in \mathbb{R}^{1\times D}$ . As the network EV-VGCNN is capable of finding neighbors and calculate edges' weights for vertices, we only need to determine the coordinate and features of each vertex in the graph construction stage. + +Voxelization. Event streams can be expressed as a 4D tuple: + +$$ +\left\{e _ {i} \right\} _ {N} = \left\{x _ {i}, y _ {i}, t _ {i}, p _ {i} \right\} _ {N}, \tag {1} +$$ + +where $e_i$ is a single event. The first two dimensions $x_i$ and $y_i$ are constrained with the range of the spatial resolution $(\{H, W\})$ of event cameras and $t_i$ is the timestamp when the event is triggered. Hence, $(x_i, y_i, t_i)$ represents the spatio-temporal coordinate of an event, and the last dimension $p_i$ can be seen as the attribute. Given an event + +![](images/2f1dc64c3304b51a667270290ed72a76f024d704ba85dd136a26717b6a207755.jpg) +(a) MFRL + +![](images/45b8eee36b752d7f961771297f1a7507284c7016814b57e0e001ea4d033cb6a6.jpg) +Figure 4. Structure of the MFRL and its base component $SFRL$ . (a) $MFRL$ : The MFRL is composed of two $SFRL$ modules and a shortcut connection, in which the two SFRL modules are to encode features from adjacent and distant neighbor vertices respectively. This design allows us to explore motion and spatial messages behind event signals flexibly. $\bigoplus$ : element-wise addition. (b) $SFRL$ : This module realizes the Eq. (4) and Eq. (5) using neural networks. Particularly, the $SFRL$ module takes vertices with their coordinates and features as input. For each vertex, the $SFRL$ builds edges between the vertex and its $N_{\text{neigh}}$ neighbors, computes the scoring matrix for its neighbors then aggregates the features from neighbors using the matrix to obtain the representation of this vertex. $\otimes$ : matrix multiplication. + +stream, we can subdivide the 3D x-y-t space into voxels, as shown in Fig. 3 (a). Considering the value discrepancy between $(x_{i},y_{i})$ and $(t_i)$ , we first normalize the time dimension with a compensation coefficient $A$ using: + +$$ +\left\{t _ {i} \right\} _ {N} = \frac {\left\{t _ {i} - t _ {0} \right\} _ {N} \times A}{t _ {N - 1} - t _ {0}}. \tag {2} +$$ + +After normalization, event signals encompass 3D space with range $H, W, A$ along the $x, y, t$ axes respectively. Then, we voxelize this 3D space with the size of each voxel as $v_h, v_w$ and $v_a$ . The resulting voxels in spatio-temporal space is of size $H_{voxel} = H / v_h$ , $W_{voxel} = W / v_w$ and $A_{voxel} = A / v_a$ , where each voxel may contain several events. In this work, we refer voxel locations to define the coordinate of each vertex in the graph. Accordingly, the coordinate of $i$ -th vertex $\mathcal{U}_i = (x_i^v, y_i^v, t_i^v)$ is with the range of $\{H_{voxel}, W_{voxel}, A_{voxel}\}$ . For simplicity, we assume that $H, W, A$ are divisible by $v_h, v_w$ and $v_a$ . + +Vertex selection. In practice, even though we only consider non-empty voxels as vertices, there are still tens of thousands of vertices that will be contained in a graph. Constructing a graph with all these vertices imposes a substantial computational burden. In addition, due to noise points (also known as hot pixels) produced by event cameras typically occurs isolated without any connections with other events, plenty of vertices may only be composed of single or a few noise points only. Accordingly, taking these uninformative vertices as input would inevitably introduce interference to the whole learning system. Therefore, we propose to keep only representative vertices for graph construction. To this end, we adopt a simple yet effective selection strategy, which is to find $N_{p}$ vertices with the largest number of event points inside and feed them into the learning system. On the one hand, this selection strategy can work as a noise filter for input data purification. On the other hand, + +this procedure can help us save computational costs. Please refer to our supplementary material for more comparisons with different selection approaches. + +Feature calculation for vertices. The performance of graph-based neural networks heavily relies on the quality of each vertex's input features. Since each vertex in our graph contains several event points inside, an appropriate method to encode the features for these points is required. Event streams can be seen as a 2D video recorded asynchronously. As an event voxel (vertex) is generally with a short time span, we think it is rational to represent the 2D semantics of voxels simulating the imaging principle of the traditional cameras. That is, accumulating event points into 2D frame patches along the time axis. Particularly, given a graph with vertices $\{\mathcal{V}_i\}_{N_p}$ and coordinates $\{(x_i^v,y_i^v,t_i^v)\}_{N_p}$ , we can attain 2D features $\mathcal{F}_i^{2d} \in \mathbb{R}^{1 \times v_h \times v_w}$ of its $i$ -th vertex $\mathcal{V}_i$ as formulated in Eq. (3). + +$$ +\mathcal {F} _ {i} ^ {2 d} (x, y) = \sum_ {i} ^ {N _ {v}} p _ {i} ^ {i n} \delta \left(x - x _ {i} ^ {i n}, y - y _ {i} ^ {i n}\right) t _ {i} ^ {i n}, \tag {3} +$$ + +where $N_{v}$ denotes the number of events inside the vertex $\mathcal{V}_i$ . For each internal event, its coordinate $(x_i^{in},y_i^{in},t_i^{in})$ is constrained with the size of voxels $(\{v_h,v_w,v_a\})$ . By linearly integrating the events w.r.t their temporal coordinates and polarities, we want to encode the 2D semantics of each vertex while retaining temporal (motion) cues to a certain extent [19,49,51]. Eventually, we flatten the resulting 2D features $\{\mathcal{F}_i^{2d}\}_{N_p}$ to obtain feature vectors $\{\mathcal{F}_i\}_{N_p} \in \mathbb{R}^{N_p \times D}$ of all vertices in the graph, where $D = v_h v_w$ . + +# 3.2.EV-VGCNN + +The proposed learning architecture comprises three main components: the multi-scale feature relational layer, the graph pooling operation, and the classifier. In this section, + +![](images/9c83455c47ad683226ec35602536cf053dc1ca0c48aca820b259fd4c772c5410.jpg) +Figure 5. An intuitive illustration of how the MFRL aggregate features for a vertex from its adjacent and distant neighbors. For a vertex (the red point) in our graph, we firstly determine its $N_{\text{neigh}}^{\text{adj}}$ (blue points) and $N_{\text{neigh}}^{\text{dis}}$ (yellow points) neighbors w.r.t distances. Then, we aggregate features from these neighbors utilizing two independent network branches, where yellow arrows and blue arrows represent learned weights from two SFRLs. + +we show how to design them and assemble these modules into the EV-VGCNN. + +Multi-scale feature relational layer (MFRL). Unlike the traditional 3D point clouds whose coordinates only express geometric messages, event data contains two different types of cues, i.e., 2D spatial messages, and motion information. For a vertex in the event-based graph, its adjacent neighbors usually carry local spatial cues. In contrast, its distant neighbors are more likely to comprise much motion information. Notably, though adjacent and distant neighbors carry motion and spatial cues simultaneously in most cases, the motion and spatial variances between a vertex and its adjacent and distant neighbors are different, i.e., adjacent neighbors hold small and local variance while distant neighbors carry more global changes. Given this disparity, it is difficult to use a shared CNN branch to learn all neighbors. Inspired by the multi-scale learning strategy in [39], we introduce the MFRL module to extract motion and semantic messages from vertices distinguishably depending on the distance between vertices and their neighbors. As shown in Fig. 4 (a), the MFRL consists of one shortcut connection and two single-scale feature relational layers (SFRL) to extract correlations from adjacent and distant neighbors respectively. More specifically, for a vertex, we define $N_{\text{neigh}}^{\text{adj}}$ and $N_{\text{neigh}}^{\text{dis}}$ as the numbers of its adjacent and distant neighbors, respectively. The results obtained from these three branches are then aggregated as the output. We intuitively illustrate this learning process in Fig. 5. + +We then detail how to design the SFRL module. In contrast to aggregating neighbors' features only using pooling operations like PointNet++ [39], we introduce a scoring matrix computed with correspondence to spatio-temporal relationships between each vertex and its neighbors to achieve feature aggregation attentively. In specific, through the construction procedure depicted in Sec. 3.1, we have obtained features $(\mathcal{F})$ and coordinates $(\mathcal{U})$ of vertices $(\mathcal{V})$ in the graph. The SFRL takes these features and coordinates as inputs and is entailed to accomplish three functions: $(i)$ building connections among vertices with edges, $(ii)$ computing the scoring matrix for neighbors of the vertex, and + +(iii) integrating features from the neighborhood for each vertex. As shown in Fig. 4 (b), to achieve these goals, we first utilize the K-Nearest Neighbor algorithm (K-NN) to determine $N_{\text{neigh}}$ neighbors for each vertex and link them with edges [16]. The graph includes a self-loop, meaning that each vertex also links itself as a neighbor [25]. Then, for the $i$ -th vertex $\mathcal{V}_i$ with edges $\mathcal{E}_i$ ( $\mathcal{E}_i \in \mathbb{R}^{1 \times N_{\text{neigh}}}$ ) and coordinates $\mathcal{U}_i$ , the scoring matrix can be calculated using: + +$$ +\mathcal {M} _ {i} = \mathbb {Q} \left(\underset {j: (i, j) \in \mathcal {E} _ {i}} {\mathrm {S} _ {G}} \left(g _ {i, j}\right); W _ {m}\right), \tag {4} +$$ + +where $g_{i,j} = [\mathcal{U}_i,\mathcal{U}_i - \mathcal{U}_j]\in \mathbb{R}^6$ represents the geometric relation between a vertex and its neighbors. $[\cdot ,\cdot ]$ denotes the concatenation of two vectors. $\mathbb{S}_G(\cdot)$ is a function that stacks all geometric relations of the vertex's neighbors $(\{g_{i,j}:(i,j)\in \mathcal{E}_i\})$ and its output is in $\mathbb{R}^{N_{\text{neigh}}\times 6}$ . $\mathbb{Q}$ is parameterized by $W_{m}$ and comprises a linear mapping function, a Batch Normalization, and a Tanh function to explore geometric messages from neighbor vertices. The output $\mathcal{M}_i\in \mathbb{R}^{N_{\text{neigh}}\times N_{\text{neigh}}}$ is the scoring matrix for $\mathcal{V}_i$ which aims to re-weight features from its neighbors based on spatio-temporal relationships when aggregating the neighbors' features for the central vertex. Finally, we formulate the function of aggregating features from neighbors into the vertex as: + +$$ +\mathcal {F} _ {i} ^ {\prime} = \sum \mathcal {M} _ {i} \left(\mathbb {H} \left(\underset {j \in \mathcal {E} _ {i}} {\mathbb {S} _ {F}} \left(\mathcal {F} _ {j}\right); W _ {f}\right)\right), \tag {5} +$$ + +where $\mathbb{S}_F(\cdot)$ is a function that stacks all features $(F_j\in$ $\mathbb{R}^{1\times D_{in}})$ from neighbor vertices and its output is in $\mathbb{R}^{N_{\text{neigh}}\times D_{in}}$ . $\mathbb{H}$ is a non-linear transform function with parameters $W_{f}$ and consists of a linear mapping function, a Batch Normalization and a ReLU. The function $\mathbb{H}$ takes the stacked features as input and produces transformed features in $\mathbb{R}^{N_{\text{neigh}}\times D_{out}}$ . After that, the scoring map $\mathcal{M}_i$ is utilized to re-weight neighbors' features. We then apply a summation operation on the feature space over all neighbors to generate the aggregated features $\mathcal{F}_i^{\prime}\in \mathbb{R}^{1\times D_{out}}$ for the $i$ -th vertex. + +Graph pooling operation. The pooling operation is to reduce the vertex number in the network progressively. The pooling layer in 3D vision models commonly aggregates local messages of each point and then selects a subset of points with the dominant response for the following processing. In our case, the feature aggregation step has been fulfilled by the MFRL module. Hence, in our pooling layers, we only need to randomly select vertices from the graph to enlarge the receptive field for the feature aggregation of each vertex. We denote the output number of vertices of the graph pooling operation as $N_r$ . + +Classifier. Following the operation used in [38, 39], we apply symmetry functions on the high-level features to achieve a global representation for the input. Specifically, + +we use max and average pooling operations to process these high-level features respectively, and then concatenate them to form a one-dimensional feature vector. Finally, we feed the global feature vector to three fully connected layers for classification. + +Network architecture. The structure of EV-VGCNN is the same for all datasets. As shown in Fig. 3 (b). We embed four relational learning modules (MFRL) into our model to obtain the global representation of an event stream. Besides, we apply the pooling operation after each of the first three MFRLs. We further apply a non-linear block consisting of a linear layer, a Batch Normalization, and a ReLU after the fourth MFRL and then feed the output feature of this nonlinear block to the classifier. + +# 4. Experimental Evaluation + +In this section, we use several benchmark datasets to evaluate the proposed method on the classification accuracy, the model complexity (measured in the number of trainable parameters), and the number of floating-point operations (FLOPs). Also, please refer to the supplementary material for details about the effectiveness of our method on the action recognition task. + +# 4.1. Datasets + +We validate our method on five representative event-based classification datasets: N-MNIST (N-M) [34], N-Caltech101 (N-Cal) [15, 34], CIFAR10-DVS (CIF10) [27], N-CARS (N-C) [44] and ASL-DVS (ASL) [2]. In general, there are two alternatives to generate these datasets. Particularly, N-M, N-Cal and CIF10 are obtained by recording traditional images displayed on monitors with fixed motion trajectories. This recording method may suffer from artificial noise introduced by the shooting and emulation environments. On the contrary, N-C and ASL are recorded in the real-world environment using event cameras, which means that the evaluation results on these two datasets should better reflect the performance of event-based models in practice. We train models separately for each dataset and evaluate the performance of our approach on their testing sets. For those datasets (N-Cal, CIF10, and ASL) without official splitting, we follow the experiment setup adopted in [3, 44], in which $20\%$ data are randomly selected for testing, and the remaining is used for training and validation. We average over five repetitions with different random seeds as our reported results. + +# 4.2. Implementation details + +Graph construction. We fix the compensation coefficient $A$ for all datasets as 9 to normalize event data. We set the input vertex number $N_{p}$ as 512 for N-MNIST and ASL as the objects in them are small size, set $N_{p}$ as 1024 for N-CARS, and $N_{p} = 2048$ for more complex datasets + +Table 1. Comparison of the classification accuracy between ours and other point-based methods. Using our proposed representation as input. Blue and green color indicate the first and second best performance. + +
MethodN-MN-CalN-CCIF10ASL
H-First [35]0.7120.0540.5610.077-
HOTS [26]0.8080.210.6240.271-
HATS [44]0.9910.6420.9020.524-
EventNet [43]0.7520.4250.7500.1710.949
PointNet++ [47]0.8410.5030.8090.4650.947
PointNet++ [47]†0.9550.6210.9070.5330.956
RG-CNNs [3]0.9900.6570.9140.5400.901
Ours (w/ SFRL)0.9920.7370.9440.6520.962
Ours0.9940.7480.9530.6700.983
+ +N-Cal and CIF10. According to the spatio-temporal discrepancy across different datasets, we set the voxel size as $(v_h,v_w,v_a) = (2,2,1)$ for N-MNIST, (7,7,1) for CIF10 and (5,5,3) for other datasets. Please refer to supplementary materials for details about voxel size settings. + +Network. The values of $N_{\text{neigh}}^{\text{adj}}$ and $N_{\text{neigh}}^{\text{dis}}$ for all MFRL modules are fixed as 10 and 15 respectively. We set the output vertex number of three graph pooling operations as 896, 768, and 640 for N-Cal, N-C, and CIF10 datasets. For the other two datasets, which only take 512 vertices as input, we remove the pooling operation between MFRL modules. We add dropout layers with a probability of 0.5 after the first two fully-connected layers in the classifier to avoid overfitting. Each fully-connected layer is followed by a LeakyReLU and a Batch Normalization except for the prediction layer. + +Training. We train our model from scratch for 250 epochs by optimizing the cross-entropy loss using the SGD [45] optimizer (except for the ASL) with a learning rate of 0.1 and reducing the learning rate until 1e-6 using cosine annealing. As for the ASL, we experimentally find that using the Adam [24] optimizer with a learning rate of 0.001 and decaying the learning rate by a factor of 0.5 every 20 epochs contributes to better performance. The batch size for training is set to 32 for all datasets. + +# 4.3. Classification accuracy + +In this section, we report the comparison to two mainstream event-based object classification solutions, namely point-based and frame-based methods, to show the advantages of our model comprehensively. + +Comparison with point-based methods. As our proposed work also falls under the category of point-based methods, we firstly compare it to SOTA point-based models. As shown in Table 1, the proposed method outperforms SOTA point-based models consistently. Especially, our approach improves the model's performance by a large margin on four challenging datasets such as N-Cal, N-C, CIF10, and ASL. Surprisingly, when alternative the input from point-wise to voxel-wise representation, the method + +Table 2. Comparison of different event-based classification models on the model complexity (#Params) and the number of FLOPs. † GFLOPs = 10^9 FLOPs. ‡ Using our proposed representation as input. ¶T(CPU) represents that both input generation and inference process run on CPU. T(GPU) means that input construction is on CPU and network inference is on GPU. + +
Method#ParamsGFLOPs†T(CPU)¶T(GPU)¶
EST [19]21.38 M4.2827.1 ms6.41 ms
M-LSTM [5]21.43 M4.8234.8 ms10.89 ms
MVF-Net [11]33.62 M5.6242.5 ms10.09 ms
AsyNet [30]3.69 M0.88--
EventNet [43]2.81 M0.919.3 ms3.35 ms
PointNet++ [47]1.76 M4.03174.3 ms103.85 ms
PointNet++‡ [47]1.77 M4.17178.4 ms107.97 ms
RG-CNNs [3]19.46 M0.791236 ms-
Ours0.84 M0.7026.1 ms7.12 ms
+ +in [47] achieves a significant performance gain, suggesting the effectiveness of our newly introduced event-based representation. Furthermore, Table 2 illustrates that our method shows huge advantages on the model and computational complexity, e.g., our model can achieve 20 times parameter reduction and are with fewer FLOPs compared to the SOTA method RG-CNNs. We attribute the two-sided improvement to two designs in our model. (i) Our graph is constructed by setting an event voxel instead of a single event point as the vertex. This modification retains more powerful regional semantics than other strategies. The resulting compact and informative inputs largely ease the following network to learn distinguishable features in various scenarios. (ii) The MFRL module in our network can exploit semantics and motion cues from each vertex distinguishably concerning its distances to neighbors, allowing us to construct a shallow and lightweight network while achieving SOTA accuracy. + +Moreover, we introduce a baseline model which replaces the MFRL with the SFRL module in the EV-VGCNN. In contrast to learning local and distant cues discriminatively, all neighbors of a vertex are equally treated in the SFRL to learn their correlations with shared parameters. For a fair comparison, we set $N_{\text{neigh}}$ for each SFRL as the summation of $N_{\text{neigh}}^{\text{adj}}$ and $N_{\text{neigh}}^{\text{dis}}$ in MFRL. As shown, the MFRL consistently improves the performance on listed datasets, suggesting that the adopted multi-scale learning strategy can effectively enhance the discriminativeness of features by considering the spatial-temporal variation across neighbors. + +Comparison with frame-based methods. To have a comprehensive analysis, we also compare our method with several representative frame-based approaches as shown in Table 3. In particular, MVF-Net has achieved SOTA performance on different classification datasets. From the table, we can see that EST, M-LSTM, and MVF-Net have been consistently improved after using pretrained networks, especially on two datasets (N-Cal, CIF10) converted from traditional images. This is because that the frame-based classi + +Table 3. Comparison of the classification accuracy between ours and frame-based methods. ${}^{ \dagger }$ Results are acquired by using the classifier with Resnet-34 [21] as the backbone. ${}^{ \ddagger }$ We train these approaches from scratch and adopt the same training and testing sets used in this paper. Blue and green color indicate the first and second best performance. + +
MethodN-MN-CalN-CCIF10ASL
Pretrained on ImageNet [9]
EST [19]0.9910.8370.9250.7490.991
M-LSTM [5]†0.9890.8570.9570.7300.992
MVF-Net [11]0.9930.8710.9680.7620.996
Without pretraining
EST [19]‡0.9900.7530.9190.6340.979
M-LSTM [5]‡0.9860.7380.9270.6310.980
MVF-Net [11]‡0.9810.6870.9270.5990.971
AsyNet [30]-0.7450.9440.663-
Ours0.9940.7480.9530.6700.983
+ +fication models can take advantage of the weights pretrained on large-scale traditional image datasets (e.g., ImageNet) [41]. However, without utilizing the prior knowledge from conventional images, our approach can still achieve comparable accuracy to these frame-based methods on N-M, N-C, and ASL datasets. More importantly, the proposed method obtains better results on all evaluated datasets than most frame-based methods trained from scratch. These comparisons demonstrate that our architecture and designs are greatly suitable for extracting distinguishable representations from event data. + +# 4.4. Complexity and computation analysis + +We follow the calculation method described in [3,20,22, 32] to compute FLOPs for these methods. Since models' architecture may vary when evaluated on different datasets, we obtain results from these models on the same dataset N-Cal. The model complexity and the number of FLOPs of these frame-based methods are listed in Table 2, in which our approach is capable of performing classification with lower computational cost and fewer parameters. Compared to frame-based solutions which introduce much redundant information, our graph network learns decisive features directly from the sparse inputs, thus effectively relieving the learning pressure of the neural network. For instance, the 18-channel frame-based representation of samples from the N-Cal dataset with a spatial resolution of $180 \times 240$ used in [19] has 777600 input elements, while our proposed graph only contains 2048 ones. + +In addition, we compute the averaged computation time for processing each sample in the dataset N-C and list the results in Table 2. We implement various methods on a workstation with a CPU (Intel i7), a GPU (GTX 1080Ti), and 64GB of RAM. From the table, we can find that the processing speed of our lightweight model is the same level with frame-based methods (e.g. EST). However, our method shows weakness in computation speed compared to Event- + +Table 4. Impact of different value of $N_{\text{neigh}}^{adj}$ and $N_{\text{neigh}}^{\text{dis}}$ on the performance evaluated on the N-Cal dataset. + +
Value
VariantsABCDEFG
Nadjneigh101010520520
Ndisneigh1510201515205
Accuracy0.7480.7420.7510.7370.7400.7430.730
+ +Net [43], which is developed on PointNet. We attribute this phenomenon to two points. (i) The integration operations for graph construction cost much computation time. (ii) The neighbor searching and feature embedding functions that do not exist in EventNet, though enlarge our model's performance by a large margin, also increase our computation time. Considering the low computational complexity (FLOPs) of our approach, we believe that there will be a large room for our method to speed up with the help of coding optimization. Moreover, though our approach cannot reach the temporal resolution of event data, the processing rate (only need $7.12\mathrm{ms}$ for each sample, which is equivalent to $140\mathrm{Hz}$ as frame-rate) is fast enough for most high-speed applications. + +# 4.5. Ablation study + +In this part, we conduct ablation studies to verify advantages of our voxel-wise graph representations and discuss the impact of hyper-parameters $N_{Neigh}^{adj}$ and $N_{Neigh}^{dis}$ to the system. Also, please refer to the supplementary material for details about the robustness of our model to the input vertex density. + +The value setting for $N_{\text{Neigh}}^{\text{adj}}$ and $N_{\text{Neigh}}^{\text{dis}}$ . In this part, we set up a series of experiments on the N-Cal dataset to discuss how the variation of $N_{\text{Neigh}}^{\text{adj}}$ and $N_{\text{Neigh}}^{\text{dis}}$ affects the final performance of our model. Results of the controlled experiment are listed in Table 4. Comparing the settings $A$ , $B$ and $C$ , we can find that when $N_{\text{Neigh}}^{\text{adj}}$ is fixed, a larger value of $N_{\text{Neigh}}^{\text{dis}}$ results in better performance. Intuitively, when we involve more distant neighbors to aggregate the features of a vertex, a denser neighborhood, carrying more global messages and cross-vertex spatio-temporal relationships, is encoded to aggregate the features for the central vertex. Differently, when we fix the $N_{\text{Neigh}}^{\text{dis}}$ and change the value of $N_{\text{Neigh}}^{\text{adj}}$ (e.g., settings $A$ , $D$ , and $E$ ) from 10 to 20, the final performance drops considerably. We argue that this is due to only a small number of adjacent neighbors being informative to characterize the local semantic information of a vertex. If a considerable part of adjacent neighbors is actually with large distance, then these "adjacent" neighbors are difficult to characterize this vertex's local semantics and tend to be interference. For the value chosen of these two hyper-parameters in this work, we firstly fix the summation of neighbors as 25 considering computational budget, then experimentally set $N_{\text{Neigh}}^{\text{adj}}$ and $N_{\text{Neigh}}^{\text{dis}}$ as 10 and 15 respectively according to the comparison among settings + +Table 5. Comparison between voxel-wise and point-wise graph construction strategies with the same network architecture. + +
Vertex type#VertexAccuracyGFLOPs
Original events20480.5650.63
Original events40960.6010.66
Original events81920.6190.72
Event voxels (Ours)20480.7480.70
+ +# $A,F$ and $G$ + +Comparison of graph construction strategies. To validate that our proposed voxel-wise graph is more effective in semantics encoding over point-wise inputs, this section performs comparisons of our voxel-wise graph to point-wise graph [3], which is constructed by selecting a random subset of event data as vertices and assigning the polarity of events to vertices as their features. We feed these two graphs to the same model EV-VGCNN and test their performance on the N-Cal dataset. The results in Table 5 show that with the same number of vertices (2048) inside, our graph construction strategy contributes to a significant accuracy gain, indicating that it encodes more informative features from the event data than the point-wise graph. We then increase the vertex number of the point-wise graph to 8192, which is much larger than ours. Even so, our method still has a considerable accuracy leading. We credit these superiorities to that our voxel-wise graph construction strategy enables the vertex to encode local correlations among points, thus carrying a more powerful representation for a point region. In contrast, although the compared point-wise graph reduces the complexity of the input, it leads to a severe loss of local 2D appearance and motion information in each vertex. + +# 5. Limitation + +First, this study is based on the assumption that the input event data to the model always relate to objects. When this assumption does not hold, our neighbor searching strategy in Euclidean space may not be able to find proper neighbors for vertices. Second, the potential of our model has not been fully facilitated at the current stage due to the lack of a prior knowledge support from large datasets. Third, the adopted synchronous processing pattern can normally provide more robust global features compared to asynchronous methods [30, 43] while inevitably sacrifice real-time performance. + +# 6. Conclusion + +In this work, we introduce a novel graph-based learning framework for event data. The proposed voxel-wise graph construction method retains more local information than previous point-wise methods while maintaining the sparsity of event data. Moreover, we tailor a MFRL module to explore spatial-temporal relationships between vertices and their neighbors discriminatively. Extensive experiments show the advantages of our designs, as well as the elegant improvement on both accuracy and model complexity achieved by the proposed lightweight EV-VGCNN. + +# References + +[1] Arnon Amir, Brian Taba, David Berg, Timothy Melano, Jeffrey McKinstry, Carmelo Di Nolfo, Tapan Nayak, Alexander Andreopoulos, Guillaume Garreau, Marcela Mendoza, et al. A low power, fully event-based gesture recognition system. In IEEE Conf. Comput. Vis. Pattern Recog., pages 7243-7252, 2017. 3 +[2] Yin Bi, Aaron Chadha, Alhabib Abbas, Eirina Bourtsoulatze, and Yiannis Andreopoulos. Graph-based object classification for neuromorphic vision sensing. In IEEE/CVF Int. Conf. Comput. Vis., pages 491-501, 2019. 6 +[3] Y. Bi, A. Chadha, A. Abbas, E. Bourtsovlatze, and Y. Andreopoulos. Graph-based spatio-temporal feature learning for neuromorphic vision sensing. IEEE Trans. Image Process., pages 1-1, 2020. 1, 3, 6, 7, 8 +[4] Tobias Brosch, Stephan Tschechne, and Heiko Neumann. On event-based optical flow detection. Front. Neurosci., 9:137, 2015. 2 +[5] Marco Cannici, Marco Ciccone, Andrea Romanoni, and Matteo Matteucci. A differentiable recurrent surface for asynchronous event-based data. In *Eur. Conf. Comput. Vis.*, August 2020. 1, 2, 7 +[6] Xavier Clady, Sio-Hoi Ieng, and Ryad Benosman. Asynchronous event-based corner detection and matching. Neural Netw., 66:91-106, 2015. 2 +[7] Xavier Clady, Jean-Matthieu Maro, Sébastien Barre, and Ryad B Benosman. A motion-based feature for event-based pattern recognition. Front. Neurosci., 10:594, 2017. 2 +[8] Paulo de Oliveira Rente, Catarina Brites, João Ascenso, and Fernando Pereira. Graph-based static 3d point clouds geometry coding. IEEE Trans. Multimedia, 21(2):284-299, 2019. 2 +[9] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conf. Comput. Vis. Pattern Recog., pages 248-255, 2009. 7 +[10] Yongjian Deng, Hao Chen, Huiying Chen, and Youfu Li. Learning from images: A distillation learning framework for event cameras. IEEE Trans. Image Process., pages 1-1, 2021. 2 +[11] Yongjian Deng, Hao Chen, and Youfu Li. Mvf-net: A multiview fusion network for event-based object classification. IEEE Trans. Circuits Syst. Video Technol., pages 1-1, 2021. 2, 7 +[12] Y. Deng, Y. Li, and H. Chen. Amae: Adaptive motion-agnostic encoder for event-based object classification. IEEE Robot. Autom. Lett., 5(3):4596–4603, 2020. 1, 2 +[13] Peter U Diehl, Daniel Neil, Jonathan Binas, Matthew Cook, Shih-Chii Liu, and Michael Pfeiffer. Fast-classifying, high-accuracy spiking deep networks through weight and threshold balancing. In 2015 International Joint Conference on Neural Networks, pages 1–8. IEEE, 2015. 3 +[14] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Trans + +formers for image recognition at scale. Int. Conf. Learn. Represent., 2021. 2 +[15] Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE Trans. Pattern Anal. Mach. Intell., 28(4):594–611, 2006. 6 +[16] Zeqing Fu and Wei Hu. Dynamic point cloud inpainting via spatial-temporal graph learning. IEEE Transactions on Multimedia, pages 1-1, 2021. 5 +[17] G. Gallego, T. Delbruck, G. M. Orchard, C. Bartolozzi, B. Taba, A. Censi, S. Leutenegger, A. Davison, J. Conradt, K. Daniilidis, and D. Scaramuzza. Event-based vision: A survey. IEEE Trans. Pattern Anal. Mach. Intell., pages 1-1, 2020. 1 +[18] Daniel Gehrig, Mathias Gehrig, Javier Hidalgo-Carrio, and Davide Scaramuzza. Video to events: Recycling video datasets for event cameras. In IEEE Conf. Comput. Vis. Pattern Recog., June 2020. 2 +[19] Daniel Gehrig, Antonio Loquercio, Konstantinos G Derpanis, and Davide Scaramuzza. End-to-end learning of representations for asynchronous event-based data. In IEEE/CVF Int. Conf. Comput. Vis., pages 5633-5643, 2019. 1, 2, 4, 7 +[20] Kaiming He and Jian Sun. Convolutional neural networks at constrained time cost. In IEEE Conf. Comput. Vis. Pattern Recog., pages 5353-5360, 2015. 7 +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conf. Comput. Vis. Pattern Recog., pages 770-778, 2016. 7 +[22] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. 7 +[23] Yuhuang Hu, Tobi Delbruck, and Shih-Chii Liu. Learning to exploit multiple vision modalities by using grafted networks. In Eur. Conf. Comput. Vis., pages 85-101, 2020. 2 +[24] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 +[25] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In Int. Conf. Learn. Represent., pages 1-35, 2016. 5 +[26] Xavier Lagorce, Garrick Orchard, Francesco Galluppi, Bertram E Shi, and Ryad B Benosman. Hots: a hierarchy of event-based time-surfaces for pattern recognition. IEEE Trans. Pattern Anal. Mach. Intell., 39(7):1346-1359, 2016. 2, 6 +[27] Hongmin Li, Hanchao Liu, Xiangyang Ji, Guoqi Li, and Luping Shi. Cifar10-dvs: An event-stream dataset for object classification. Front. Neurosci., 11:309, 2017. 6 +[28] P. Lichtsteiner, C. Posch, and T. Delbruck. A $128 \times 128$ 120 db $15~\mu s$ latency asynchronous temporal contrast vision sensor. IEEE J. Solid-State Circuit, 43(2):566-576, Feb 2008. 1 +[29] 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 Conf. Comput. Vis. Pattern Recog., pages 5419-5427, 2018. 2 + +[30] Nico Messikommer, Daniel Gehrig, Antonio Loquercio, and Davide Scaramuzza. Event-based asynchronous sparse convolutional networks. In Eur. Conf. Comput. Vis., pages 415-431. Springer, 2020. 2, 7, 8 +[31] Anton Mitrokhin, Zhiyuan Hua, Cornelia Fermuller, and Yiannis Aloimonos. Learning visual motion segmentation using event surfaces. In IEEE Conf. Comput. Vis. Pattern Recog., pages 14414-14423, 2020. 1, 2, 3 +[32] P Molchanov, S Tyree, T Karras, T Aila, and J Kautz. Pruning convolutional neural networks for resource efficient inference. In Int. Conf. Learn. Represent., 2019. 7 +[33] Elias Mueggler, Chiara Bartolozzi, and Davide Scaramuzza. Fast event-based corner detection. In British Mach. Vis. Conf, 2017. 2 +[34] Garrick Orchard, Ajinkya Jayawant, Gregory K Cohen, and Nitish Thakor. Converting static image datasets to spiking neuromorphic datasets using saccades. Front. Neurosci., 9:437, 2015. 6 +[35] G. Orchard, C. Meyer, R. Etienne-Cummings, C. Posch, N. Thakor, and R. Benosman. Hfirst: A temporal approach to object recognition. IEEE Trans. Pattern Anal. Mach. Intell., 37(10):2028-2040, Oct 2015. 3, 6 +[36] José Antonio Pérez-Carrasco, Bo Zhao, Carmen Serrano, Begona Acha, Teresa Serrano-Gotarredona, Shouchun Chen, and Bernabé Linares-Barranco. Mapping from frame-driven to frame-free event-driven vision systems by low-rate rate coding and coincidence processing—application to feedforward convnets. IEEE Trans. Pattern Anal. Mach. Intell., 35(11):2706-2719, 2013. 3 +[37] Christoph Posch, Daniel Matolin, and Rainer Wohlgenannt. A qvga 143 db dynamic range frame-free pwm image sensor with lossless pixel-level video compression and time-domain cds. IEEE J. Solid-State Circuit, 46(1):259-275, 2010. 1 +[38] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 652-660, 2017. 1, 5 +[39] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Conf. Neural Inf. Process. Syst., pages 5099-5108, 2017. 5 +[40] Henri Rebecq, Rene Ranftl, Vladlen Koltun, and Davide Scaramuzza. High speed and high dynamic range video with an event camera. IEEE Trans. Pattern Anal. Mach. Intell., pages 1-1, 2019. 2 +[41] H. Rebecq, R. Ranftl, V. Koltun, and D. Scaramuzza. High speed and high dynamic range video with an event camera. IEEE Trans. Pattern Anal. Mach. Intell., pages 1-1, 2019. 7 +[42] Sajjad Seifozzakerini, Wei-Yun Yau, Bo Zhao, and Kezhi Mao. Event-based hough transform in a spiking neural network for multiple line detection and tracking using a dynamic vision sensor. In British Mach. Vis. Conf, 2016. 2 +[43] Yusuke Sekikawa, Kosuke Hara, and Hideo Saito. Eventnet: Asynchronous recursive event processing. In IEEE Conf. Comput. Vis. Pattern Recog., June 2019. 1, 3, 6, 7, 8 +[44] Amos Sironi, Manuele Brambilla, Nicolas Bourdis, Xavier Lagorce, and Ryad Benosman. Hats: Histograms of av + +eraged time surfaces for robust event-based object classification. In IEEE Conf. Comput. Vis. Pattern Recog., pages 1731-1740, 2018. 2, 6 +[45] Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In Int. Conf. Mach. Learn, pages 1139-1147, 2013. 6 +[46] Lin Wang, Yujeong Chae, Sung-Hoon Yoon, Tae-Kyun Kim, and Kuk-Jin Yoon. Evdistill: Asynchronous events to endtask learning via bidirectional reconstruction-guided cross-modal knowledge distillation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 608-619, June 2021. 2 +[47] Qinyi Wang, Yexin Zhang, Junsong Yuan, and Yilong Lu. Space-time event clouds for gesture recognition: From rgb cameras to event cameras. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1826-1835, 2019. 1, 3, 6, 7 +[48] Jinjian Wu, Chuanwei Ma, Leida Li, Weisheng Dong, and Guangming Shi. Probabilistic undirected graph based denoising method for dynamic vision sensor. IEEE Trans. Multimedia, pages 1-1, 2020. 2 +[49] A. Zhu, Z. Wang, K. Khant, and K. Daniilidis. Eventgan: Leveraging large scale image datasets for event cameras. In IEEE Conf. Comput. Photography, pages 1-11, Los Alamitos, CA, USA, may 2021. IEEE Computer Society. 4 +[50] Alex Zhu, Liangzhe Yuan, Kenneth Chaney, and Kostas Daniilidis. Ev-flownet: Self-supervised optical flow estimation for event-based cameras. In Proceedings of Robotics: Science and Systems, Pittsburgh, Pennsylvania, June 2018. 1, 2 +[51] Alex Zihao Zhu, Liangzhe Yuan, Kenneth Chaney, and Kostas Daniilidis. Unsupervised event-based optical flow using motion compensation. In Eur. Conf. Comput. Vis., pages 0–0, 2018. 1, 2, 4 \ No newline at end of file diff --git a/avoxelgraphcnnforobjectclassificationwitheventcameras/images.zip b/avoxelgraphcnnforobjectclassificationwitheventcameras/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d4fb8cd542b5c27abf8cad74a1753b0abaa7f210 --- /dev/null +++ b/avoxelgraphcnnforobjectclassificationwitheventcameras/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6ba542e8782aa544cd3b2914bb2c2df353314f914fd6c76ae3808667e656ba9 +size 385221 diff --git a/avoxelgraphcnnforobjectclassificationwitheventcameras/layout.json b/avoxelgraphcnnforobjectclassificationwitheventcameras/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ee87261c8401c5ac60a68324352247f1d644e7fc --- /dev/null +++ b/avoxelgraphcnnforobjectclassificationwitheventcameras/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd50a3d0b1cb19ad5bb0bfb7fb672ffb8dd7d1e588f5526671b40f889fa668b5 +size 417916